Skip to content

Commit ebbb3fb

Browse files
committed
chore: fix wording
1 parent 74f5e9a commit ebbb3fb

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

standalone.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const SerializerSelector = require('./index')
44

5-
function StandaloneValidator (options = { readMode: true }) {
5+
function StandaloneSerializer (options = { readMode: true }) {
66
if (options.readMode === true && !options.restoreFunction) {
77
throw new Error('You must provide a restoreFunction options when readMode ON')
88
}
@@ -40,4 +40,4 @@ function StandaloneValidator (options = { readMode: true }) {
4040
}
4141
}
4242

43-
module.exports = StandaloneValidator
43+
module.exports = StandaloneSerializer

test/standalone.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ t.test('generate standalone code', t => {
5858

5959
const factory = FjsStandaloneCompiler({
6060
readMode: false,
61-
storeFunction (routeOpts, schemaValidationCode) {
61+
storeFunction (routeOpts, schemaSerializerCode) {
6262
t.same(routeOpts, endpointSchema)
63-
t.type(schemaValidationCode, 'string')
64-
fs.writeFileSync(path.join(__dirname, '/fjs-generated.js'), schemaValidationCode)
65-
t.pass('stored the validation function')
63+
t.type(schemaSerializerCode, 'string')
64+
fs.writeFileSync(path.join(__dirname, '/fjs-generated.js'), schemaSerializerCode)
65+
t.pass('stored the serializer function')
6666
}
6767
})
6868

@@ -92,7 +92,7 @@ t.test('fastify integration - writeMode', async t => {
9292
const fileName = generateFileName(routeOpts)
9393
t.ok(routeOpts)
9494
fs.writeFileSync(path.join(__dirname, fileName), schemaSerializationCode)
95-
t.pass(`stored the validation function ${fileName}`)
95+
t.pass(`stored the serializer function ${fileName}`)
9696
},
9797
restoreFunction () {
9898
t.fail('write mode ON')
@@ -112,7 +112,7 @@ t.test('fastify integration - writeMode forces standalone', async t => {
112112
const fileName = generateFileName(routeOpts)
113113
t.ok(routeOpts)
114114
fs.writeFileSync(path.join(__dirname, fileName), schemaSerializationCode)
115-
t.pass(`stored the validation function ${fileName}`)
115+
t.pass(`stored the serializer function ${fileName}`)
116116
},
117117
restoreFunction () {
118118
t.fail('write mode ON')
@@ -137,7 +137,7 @@ t.test('fastify integration - readMode', async t => {
137137
},
138138
restoreFunction (routeOpts) {
139139
const fileName = generateFileName(routeOpts)
140-
t.pass(`restore the validation function ${fileName}}`)
140+
t.pass(`restore the serializer function ${fileName}}`)
141141
return require(path.join(__dirname, fileName))
142142
}
143143
})

0 commit comments

Comments
 (0)