Skip to content

Commit 3b10164

Browse files
authored
Merge pull request #77 from jsr-core/fit-jsr
📝 Update docs for JSR
2 parents d94d0c2 + 792a70d commit 3b10164

File tree

7 files changed

+82
-93
lines changed

7 files changed

+82
-93
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ jobs:
4141
timeout-minutes: 5
4242
- run: |
4343
deno task coverage --lcov > coverage.lcov
44-
- uses: codecov/codecov-action@v3
44+
- uses: codecov/codecov-action@v4
4545
with:
4646
os: ${{ runner.os }}
4747
files: ./coverage.lcov
48+
token: ${{ secrets.CODECOV_TOKEN }}
4849

4950
bench:
5051
runs-on: ubuntu-latest

README.md

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# unknownutil
22

3-
[![jsr](https://img.shields.io/jsr/v/%40core/unknownutil?logo=javascript&logoColor=white)](https://jsr.io/@core/unknownutil)
3+
[![jsr](https://jsr.io/badges/@core/unknownutil)](https://jsr.io/@core/unknownutil)
44
[![npm](https://img.shields.io/npm/v/unknownutil?logo=npm&logoColor=white)](https://www.npmjs.com/package/unknownutil)
5-
[![denoland](https://img.shields.io/github/v/release/jsr-core/unknownutil?logo=deno&label=denoland)](https://github.com/jsr-core/unknownutil/releases)
5+
[![denoland](https://img.shields.io/github/v/release/jsr-core/unknownutil?logo=deno&label=denoland)](https://deno.land/x/unknownutil)
66
[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/unknownutil/mod.ts)
77
[![test](https://github.com/jsr-core/unknownutil/workflows/Test/badge.svg)](https://github.com/jsr-core/unknownutil/actions?query=workflow%3ATest)
88
[![codecov](https://codecov.io/github/jsr-core/unknownutil/graph/badge.svg?token=pfbLRGU5AM)](https://codecov.io/github/jsr-core/unknownutil)
@@ -23,7 +23,7 @@ expected type. For example, `isString` (or `is.String`) returns `true` if a
2323
given value is `string`.
2424

2525
```typescript
26-
import { is } from "https://deno.land/x/unknownutil@$MODULE_VERSION/mod.ts";
26+
import { is } from "@core/unknownutil";
2727

2828
const a: unknown = "Hello";
2929
if (is.String(a)) {
@@ -34,10 +34,7 @@ if (is.String(a)) {
3434
For more complex types, you can use `is*Of` (or `is.*Of`) functions like:
3535

3636
```typescript
37-
import {
38-
is,
39-
PredicateType,
40-
} from "https://deno.land/x/unknownutil@$MODULE_VERSION/mod.ts";
37+
import { is, PredicateType } from "@core/unknownutil";
4138

4239
const isArticle = is.ObjectOf({
4340
title: is.String,
@@ -83,7 +80,7 @@ Additionally, you can manipulate the predicate function returned from
8380
similar to TypeScript's `Pick`, `Omit`, `Partial`, `Required` utility types.
8481

8582
```typescript
86-
import { is } from "https://deno.land/x/unknownutil@$MODULE_VERSION/mod.ts";
83+
import { is } from "@core/unknownutil";
8784

8885
const isArticle = is.ObjectOf({
8986
title: is.String,
@@ -169,7 +166,7 @@ If you need an union type or an intersection type, use `isUnionOf` and
169166
`isIntersectionOf` like:
170167

171168
```typescript
172-
import { is } from "https://deno.land/x/unknownutil@$MODULE_VERSION/mod.ts";
169+
import { is } from "@core/unknownutil";
173170

174171
const isFoo = is.ObjectOf({
175172
foo: is.String,
@@ -192,10 +189,7 @@ The `assert` function does nothing if a given value is expected type. Otherwise,
192189
it throws an `AssertError` exception like:
193190

194191
```typescript
195-
import {
196-
assert,
197-
is,
198-
} from "https://deno.land/x/unknownutil@$MODULE_VERSION/mod.ts";
192+
import { assert, is } from "@core/unknownutil";
199193

200194
const a: unknown = "Hello";
201195

@@ -213,10 +207,7 @@ The `ensure` function return the value as-is if a given value is expected type.
213207
Otherwise, it throws an `AssertError` exception like:
214208

215209
```typescript
216-
import {
217-
ensure,
218-
is,
219-
} from "https://deno.land/x/unknownutil@$MODULE_VERSION/mod.ts";
210+
import { ensure, is } from "@core/unknownutil";
220211

221212
const a: unknown = "Hello";
222213

@@ -235,10 +226,7 @@ Otherwise, it returns `undefined` that suites with
235226
like:
236227

237228
```typescript
238-
import {
239-
is,
240-
maybe,
241-
} from "https://deno.land/x/unknownutil@$MODULE_VERSION/mod.ts";
229+
import { is, maybe } from "@core/unknownutil";
242230

243231
const a: unknown = "Hello";
244232

deno.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"@deno/dnt": "jsr:@deno/dnt@^0.41.1",
77
"@std/assert": "jsr:@std/assert@^0.221.0",
88
"@std/testing": "jsr:@std/testing@^0.221.0",
9-
"https://deno.land/x/unknownutil@$MODULE_VERSION/": "./"
9+
"@core/unknownutil": "./mod.ts"
1010
},
1111
"tasks": {
1212
"build-npm": "deno run -A scripts/build_npm.ts $(git describe --tags --always --dirty)",

0 commit comments

Comments
 (0)