-
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.
- Loading branch information
Showing
8 changed files
with
55 additions
and
77 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"editor.defaultFormatter": "biomejs.biome", | ||
"editor.formatOnSave": true | ||
"editor.defaultFormatter": "biomejs.biome", | ||
"editor.formatOnSave": true | ||
} |
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,3 +1,37 @@ | ||
# apple-app-site-association | ||
|
||
Check apple-app-site-association file. | ||
|
||
## Usage | ||
|
||
Reference types: | ||
|
||
```typescript | ||
import type { AppleAppSiteAssociation } from 'apple-app-site-association'; | ||
const aasa = { | ||
applinks: { | ||
// ... | ||
} | ||
} as const satisfies AppleAppSiteAssociation; | ||
``` | ||
|
||
Test universal links: | ||
|
||
```typescript | ||
import { test } from 'node:test'; | ||
import { createAssert } from 'apple-app-site-association'; | ||
const assert = createAssert(YOUR_DOMAIN, AASA_JSON); | ||
test("universal link works", async () => { | ||
await assert.universalLink("/path/to/your/app", "match"); | ||
await assert.universalLink("/#donot_deeplinking", "block"); | ||
}); | ||
``` | ||
|
||
Use `swcutil` command directly: | ||
|
||
```typescript | ||
import { swcutil } from 'apple-app-site-association/swcutil'; | ||
const { status, stdout, stderr } = await swcutil({ | ||
// ... | ||
}); | ||
``` |
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,4 +1,3 @@ | ||
export { swcutil } from "./swcutil.js"; | ||
export { verify, createVerifier } from "./verify.js"; | ||
export { createAssert } from "./test.js"; | ||
export { verify } from "./verify.js"; | ||
export type * from "./types.js"; |
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,14 +1,18 @@ | ||
import * as assert from "node:assert"; | ||
import { test } from "node:test"; | ||
import { createAssert } from "apple-app-site-association"; | ||
const assert = createAssert("zozo.jp"); | ||
import { verify } from "apple-app-site-association"; | ||
|
||
test("single", async () => { | ||
await assert.universalLink("/", "match"); | ||
const json = await fetch( | ||
"https://zozo.jp/.well-known/apple-app-site-association", | ||
).then((res) => res.json()); | ||
|
||
test("/sale/ should match", async () => { | ||
assert.strictEqual(await verify("zozo.jp", "/sale/", json), "match"); | ||
}); | ||
|
||
test("multiple", async () => { | ||
await assert.universalLinks([ | ||
["/", "match"], | ||
["/#nondeeplinking", "block"], | ||
]); | ||
test("#nondeeplinking should block", async () => { | ||
assert.strictEqual( | ||
await verify("zozo.jp", "/sale/#nondeeplinking", json), | ||
"block", | ||
); | ||
}); |