fast-json-stringify 5.2.0 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,3 +15,4 @@ jobs:
15
15
  uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3
16
16
  with:
17
17
  license-check: true
18
+ lint: true
package/.taprc CHANGED
@@ -1,3 +1,9 @@
1
1
  ts: false
2
2
  jsx: false
3
- coverage: false
3
+ branches: 65
4
+ functions: 100
5
+ lines: 89
6
+ statements: 89
7
+ nyc-arg:
8
+ - "--exclude=.cache/*"
9
+ - "--exclude=lib/schema-validator.js"
@@ -23,4 +23,4 @@ const validationCode = standaloneCode(ajv, validate)
23
23
 
24
24
  const moduleCode = `/* CODE GENERATED BY '${path.basename(__filename)}' DO NOT EDIT! */\n${validationCode}`
25
25
 
26
- fs.writeFileSync(path.join(__dirname, 'schema-validator.js'), moduleCode)
26
+ fs.writeFileSync(path.join(__dirname, '../lib/schema-validator.js'), moduleCode)
@@ -1,4 +1,4 @@
1
- const fastJson = require('.')
1
+ const fastJson = require('..')
2
2
  const stringify = fastJson({
3
3
  title: 'Example Schema',
4
4
  type: 'object',
@@ -2,7 +2,7 @@
2
2
 
3
3
  const http = require('http')
4
4
 
5
- const stringify = require('.')({
5
+ const stringify = require('fast-json-stringify')({
6
6
  type: 'object',
7
7
  properties: {
8
8
  hello: {
package/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import Ajv, { Options as AjvOptions } from "ajv"
2
+
2
3
  declare namespace build {
3
4
  interface BaseSchema {
4
5
  /**
@@ -189,13 +190,13 @@ interface StandaloneOption extends build.Options {
189
190
  declare function build(schema: build.AnySchema, options: DebugOption): { code: string, ajv: Ajv };
190
191
  declare function build(schema: build.AnySchema, options: DeprecateDebugOption): { code: string, ajv: Ajv };
191
192
  declare function build(schema: build.AnySchema, options: StandaloneOption): string;
192
- declare function build(schema: build.AnySchema, options?: build.Options): (doc: any) => any;
193
- declare function build(schema: build.StringSchema, options?: build.Options): (doc: string) => string;
194
- declare function build(schema: build.IntegerSchema | build.NumberSchema, options?: build.Options): (doc: number) => string;
195
- declare function build(schema: build.NullSchema, options?: build.Options): (doc: null) => "null";
196
- declare function build(schema: build.BooleanSchema, options?: build.Options): (doc: boolean) => string;
197
- declare function build(schema: build.ArraySchema | build.TupleSchema, options?: build.Options): (doc: any[]) => string;
198
- declare function build(schema: build.ObjectSchema, options?: build.Options): (doc: object) => string;
199
- declare function build(schema: build.Schema, options?: build.Options): (doc: object | any[] | string | number | boolean | null) => string;
193
+ declare function build(schema: build.AnySchema, options?: build.Options): <TDoc = any>(doc: TDoc) => any;
194
+ declare function build(schema: build.StringSchema, options?: build.Options): <TDoc extends string = string>(doc: TDoc) => string;
195
+ declare function build(schema: build.IntegerSchema | build.NumberSchema, options?: build.Options): <TDoc extends number = number>(doc: TDoc) => string;
196
+ declare function build(schema: build.NullSchema, options?: build.Options): <TDoc extends null = null>(doc: TDoc) => "null";
197
+ declare function build(schema: build.BooleanSchema, options?: build.Options): <TDoc extends boolean = boolean>(doc: TDoc) => string;
198
+ declare function build(schema: build.ArraySchema | build.TupleSchema, options?: build.Options): <TDoc extends any[]= any[]>(doc: TDoc) => string;
199
+ declare function build(schema: build.ObjectSchema, options?: build.Options): <TDoc extends object = object>(doc: TDoc) => string;
200
+ declare function build(schema: build.Schema, options?: build.Options): <TDoc = object | any[] | string | number | boolean | null> (doc: TDoc) => string;
200
201
 
201
202
  export = build;