-
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #18 from deno-library/ISSUE_15_loglevel
[#15] add debug and log as loglevel
- Loading branch information
Showing
7 changed files
with
134 additions
and
10 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,34 @@ | ||
export { green, red, stripAnsiCode, yellow } from "jsr:@std/fmt@1.0.3/colors"; | ||
// UNSTABLE | ||
export { writeAll } from "jsr:@std/io@0.225.0/write-all"; | ||
export { exists } from "jsr:@std/fs@1.0.5"; | ||
export { | ||
cyan, | ||
gray, | ||
green, | ||
red, | ||
stripAnsiCode, | ||
yellow, | ||
} from "jsr:@std/fmt@1.0.3/colors"; | ||
|
||
/** | ||
* use a local copy of UNSTABLE { type Writer, writeAll } from "jsr:@std/io@0.225.0/write-all"; | ||
*/ | ||
export interface Writer { | ||
/** Writes `p.byteLength` bytes from `p` to the underlying data stream. It | ||
* resolves to the number of bytes written from `p` (`0` <= `n` <= | ||
* `p.byteLength`) or reject with the error encountered that caused the | ||
* write to stop early. `write()` must reject with a non-null error if | ||
* would resolve to `n` < `p.byteLength`. `write()` must not modify the | ||
* slice data, even temporarily. | ||
* | ||
* Implementations should not retain a reference to `p`. | ||
*/ | ||
write(p: Uint8Array): Promise<number>; | ||
} | ||
|
||
export async function writeAll(writer: Writer, data: Uint8Array) { | ||
let nwritten = 0; | ||
while (nwritten < data.length) { | ||
nwritten += await writer.write(data.subarray(nwritten)); | ||
} | ||
} | ||
export { exists } from "jsr:@std/fs@^1.0.6"; | ||
|
||
export { stat } from "node:fs/promises"; |
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