Skip to content

Commit 34844c6

Browse files
chore: move top level modules into folders (#526)
* chore: move top level modules into folders * Update build/build-schema-validator.js Co-authored-by: KaKa <[email protected]> * chore: update path to example.js module Co-authored-by: KaKa <[email protected]>
1 parent 8f4fdfc commit 34844c6

File tree

11 files changed

+10
-10
lines changed

11 files changed

+10
-10
lines changed

build-schema-validator.js renamed to build/build-schema-validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ const validationCode = standaloneCode(ajv, validate)
2323

2424
const moduleCode = `/* CODE GENERATED BY '${path.basename(__filename)}' DO NOT EDIT! */\n${validationCode}`
2525

26-
fs.writeFileSync(path.join(__dirname, 'schema-validator.js'), moduleCode)
26+
fs.writeFileSync(path.join(__dirname, '../lib/schema-validator.js'), moduleCode)

example.js renamed to examples/example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const fastJson = require('.')
1+
const fastJson = require('..')
22
const stringify = fastJson({
33
title: 'Example Schema',
44
type: 'object',

server.js renamed to examples/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const http = require('http')
44

5-
const stringify = require('.')({
5+
const stringify = require('fast-json-stringify')({
66
type: 'object',
77
properties: {
88
hello: {

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ const merge = require('@fastify/deepmerge')()
66
const clone = require('rfdc')({ proto: true })
77
const { randomUUID } = require('crypto')
88

9-
const validate = require('./schema-validator')
10-
const Serializer = require('./serializer')
11-
const Validator = require('./validator')
12-
const RefResolver = require('./ref-resolver')
9+
const validate = require('./lib/schema-validator')
10+
const Serializer = require('./lib/serializer')
11+
const Validator = require('./lib/validator')
12+
const RefResolver = require('./lib/ref-resolver')
1313

1414
let largeArraySize = 2e4
1515
let largeArrayMechanism = 'default'
@@ -151,7 +151,7 @@ function build (schema, options) {
151151

152152
if (options.mode === 'standalone') {
153153
// lazy load
154-
const buildStandaloneCode = require('./standalone')
154+
const buildStandaloneCode = require('./lib/standalone')
155155
return buildStandaloneCode(options, validator, contextFunctionCode)
156156
}
157157

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@
6161
"schema-validator.js"
6262
]
6363
},
64-
"runkitExampleFilename": "example.js"
64+
"runkitExampleFilename": "./examples/example.js"
6565
}

0 commit comments

Comments
 (0)