-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from lambdalisue/support-jsr
Support jsr
- Loading branch information
Showing
10 changed files
with
57 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: jsr | ||
|
||
env: | ||
DENO_VERSION: 1.x | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: ${{ env.DENO_VERSION }} | ||
- name: Publish | ||
run: | | ||
deno run -A jsr:@david/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
{ | ||
"lock": false, | ||
"name": "@lambdalisue/errorutil", | ||
"version": "0.0.0", | ||
"exports": "./mod.ts", | ||
"tasks": { | ||
"build-npm": "deno run -A scripts/build_npm.ts $(git describe --tags --always --dirty)", | ||
"test": "deno test -A --parallel --shuffle --doc --coverage=.coverage", | ||
"check": "deno check ./**/*.ts", | ||
"coverage": "deno coverage .coverage", | ||
"upgrade": "deno run -q -A https://deno.land/x/[email protected]/cli.ts ./**/*.ts", | ||
"upgrade:commit": "deno task -q upgrade --commit --prefix :package: --pre-commit=fmt" | ||
"test": "deno test -A --parallel --shuffle --doc --coverage=.coverage", | ||
"coverage": "deno coverage .coverage" | ||
}, | ||
"imports": { | ||
"@core/unknownutil": "jsr:@core/unknownutil@^3.17.2", | ||
"@deno/dnt": "jsr:@deno/dnt@^0.41.1", | ||
"@std/assert": "jsr:@std/assert@^0.221.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
import { | ||
is, | ||
PredicateType, | ||
} from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { is, type Predicate } from "@core/unknownutil"; | ||
|
||
export const isErrorObject = is.ObjectOf({ | ||
export type ErrorObject = { | ||
proto: string; | ||
name: string; | ||
message: string; | ||
stack?: string; | ||
attributes: Record<string, unknown>; | ||
}; | ||
|
||
export const isErrorObject: Predicate<ErrorObject> = is.ObjectOf({ | ||
proto: is.String, | ||
name: is.String, | ||
message: is.String, | ||
stack: is.OptionalOf(is.String), | ||
attributes: is.Record, | ||
}); | ||
|
||
export type ErrorObject = PredicateType<typeof isErrorObject>; | ||
|
||
/** | ||
* Convert an error to an error object | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
import { | ||
assertEquals, | ||
assertInstanceOf, | ||
} from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import { assertEquals, assertInstanceOf } from "@std/assert"; | ||
import { fromErrorObject, toErrorObject } from "./error_object.ts"; | ||
|
||
class CustomError extends Error { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { assertThrows } from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import { assertThrows } from "@std/assert"; | ||
import { raise } from "./raise.ts"; | ||
|
||
Deno.test("raise", () => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
import { | ||
assertEquals, | ||
assertRejects, | ||
assertThrows, | ||
} from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import { assertEquals, assertRejects, assertThrows } from "@std/assert"; | ||
import { raise } from "./raise.ts"; | ||
import { tryOr, tryOrElse } from "./try_or.ts"; | ||
|
||
|