Skip to content

Commit eb33f0e

Browse files
committed
Parse regex objects to strings
1 parent 9b6bd26 commit eb33f0e

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

example.js

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
'use strict'
1+
'use strict'
22

3-
const fastJson = require('.')
4-
const stringify = fastJson({
5-
title: 'Example Schema',
6-
type: 'object',
7-
properties: {
8-
firstName: {
9-
type: 'string'
10-
},
11-
lastName: {
12-
type: 'string'
13-
},
14-
age: {
15-
description: 'Age in years',
16-
type: 'integer'
17-
},
18-
now: {
19-
type: 'string'
20-
},
21-
reg: {
22-
type: 'string'
23-
}
3+
const fastJson = require('.')
4+
const stringify = fastJson({
5+
title: 'Example Schema',
6+
type: 'object',
7+
properties: {
8+
firstName: {
9+
type: 'string'
10+
},
11+
lastName: {
12+
type: 'string'
13+
},
14+
age: {
15+
description: 'Age in years',
16+
type: 'integer'
17+
},
18+
now: {
19+
type: 'string'
20+
},
21+
reg: {
22+
type: 'string'
2423
}
25-
})
24+
}
25+
})
2626

27-
console.log(stringify({
28-
firstName: 'Matteo',
29-
lastName: 'Collina',
30-
age: 32,
31-
now: new Date(),
32-
reg: /"([^"]|\\")*"/
27+
console.log(stringify({
28+
firstName: 'Matteo',
29+
lastName: 'Collina',
30+
age: 32,
31+
now: new Date(),
32+
reg: /"([^"]|\\")*"/
3333
}))

0 commit comments

Comments
 (0)