diff options
author | Brandon Kalinowski <4714862+brandonkal@users.noreply.github.com> | 2020-01-18 06:19:36 -0800 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2020-01-18 09:19:36 -0500 |
commit | 4f1fa82d1d0458170039d4809c3879993659e560 (patch) | |
tree | 84babc71260aeb2a2d48fa25ae44c92c4243c371 /std/encoding | |
parent | b2f01dcb50c68da2cab28b6bd64f4033e4ccf10e (diff) |
std(yaml): correct sortKeys type (#3708)
Diffstat (limited to 'std/encoding')
-rw-r--r-- | std/encoding/yaml/dumper/dumper_state.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/std/encoding/yaml/dumper/dumper_state.ts b/std/encoding/yaml/dumper/dumper_state.ts index 30e65f9a7..c2b7608f5 100644 --- a/std/encoding/yaml/dumper/dumper_state.ts +++ b/std/encoding/yaml/dumper/dumper_state.ts @@ -62,10 +62,13 @@ export interface DumperStateOptions { /** specifies a schema to use. */ schema?: SchemaDefinition; /** - * if true, sort keys when dumping YAML. + * If true, sort keys when dumping YAML in ascending, ASCII character order. * If a function, use the function to sort the keys. (default: false) + * If a function is specified, the function must return a negative value + * if first argument is less than second argument, zero if they're equal + * and a positive value otherwise. */ - sortKeys?: boolean | ((a: Any, b: Any) => number); + sortKeys?: boolean | ((a: string, b: string) => number); /** set max line width. (default: 80) */ lineWidth?: number; /** |