-
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 #65 from dojyorin/dev
feat: import assert and fix width.
- Loading branch information
Showing
16 changed files
with
157 additions
and
45 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 @@ | ||
export {assertEquals} from "https://deno.land/std@0.194.0/testing/asserts.ts"; | ||
export {dirname, fromFileUrl} from "https://deno.land/std@0.194.0/path/mod.ts"; | ||
export {serve} from "https://deno.land/std@0.194.0/http/mod.ts"; | ||
export {exists} from "https://deno.land/std@0.194.0/fs/mod.ts"; | ||
export {assertEquals} from "https://deno.land/std@0.195.0/testing/asserts.ts"; | ||
export {dirname, fromFileUrl} from "https://deno.land/std@0.195.0/path/mod.ts"; | ||
export {serve} from "https://deno.land/std@0.195.0/http/mod.ts"; | ||
export {exists} from "https://deno.land/std@0.195.0/fs/mod.ts"; |
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 @@ | ||
export {dirname, fromFileUrl} from "https://deno.land/std@0.194.0/path/mod.ts"; | ||
export {Logger} from "https://deno.land/std@0.194.0/log/mod.ts"; | ||
export {ConsoleHandler, FileHandler} from "https://deno.land/std@0.194.0/log/handlers.ts"; | ||
export {format as formatDate} from "https://deno.land/std@0.194.0/datetime/mod.ts"; | ||
export {dirname, fromFileUrl} from "https://deno.land/std@0.195.0/path/mod.ts"; | ||
export {Logger} from "https://deno.land/std@0.195.0/log/mod.ts"; | ||
export {ConsoleHandler, FileHandler} from "https://deno.land/std@0.195.0/log/handlers.ts"; | ||
export {format as formatDate} from "https://deno.land/std@0.195.0/datetime/mod.ts"; |
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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Define import assertion on dynamic import. | ||
* Default to JSON. | ||
* @example | ||
* ```ts | ||
* const {default: json} = await import("./data.json", importAssert()); | ||
* ``` | ||
*/ | ||
export function importAssert(type?:string):ImportCallOptions{ | ||
return { | ||
assert: { | ||
type: type ?? "json" | ||
} | ||
}; | ||
} |
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
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
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,17 @@ | ||
import {assertEquals} from "../deps.test.ts"; | ||
import {importAssert} from "../src/import.ts"; | ||
|
||
const expect = <const>{ | ||
assert: { | ||
type: "json" | ||
} | ||
}; | ||
|
||
Deno.test({ | ||
name: "Import: Assert Option", | ||
fn(){ | ||
const option = importAssert(); | ||
|
||
assertEquals(option, expect); | ||
} | ||
}); |
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
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
Oops, something went wrong.