diff options
author | Fukuda Naoto <naoto.fukuda1217@gmail.com> | 2020-11-06 11:33:59 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-06 13:33:59 +1100 |
commit | fd9b6e03af5ce8c8b78c2a0e71faa55a68890004 (patch) | |
tree | 782d9646364550dbbf543e29d03eeef91fd7555d /std/fmt/printf.ts | |
parent | bfa00bef220fd26bed26940cdcaf5edf4bf83e13 (diff) |
docs(std): add some missing JSDoc (#7765)
Refs #7487
Diffstat (limited to 'std/fmt/printf.ts')
-rw-r--r-- | std/fmt/printf.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/std/fmt/printf.ts b/std/fmt/printf.ts index b12ee7a2c..c4c8c8e5c 100644 --- a/std/fmt/printf.ts +++ b/std/fmt/printf.ts @@ -661,11 +661,19 @@ class Printf { } } +/** + * Converts and format a variable number of `args` as is specified by `format`. + * `sprintf` returns the formatted string. + */ export function sprintf(format: string, ...args: unknown[]): string { const printf = new Printf(format, ...args); return printf.doPrintf(); } +/** + * Converts and format a variable number of `args` as is specified by `format`. + * `printf` writes the formatted string to standard output. + */ export function printf(format: string, ...args: unknown[]): void { const s = sprintf(format, ...args); Deno.stdout.writeSync(new TextEncoder().encode(s)); |