Skip to content

Commit 345511c

Browse files
committed
Merge branch 'master' into mergeing-main
2 parents 4a2b681 + 7f80f98 commit 345511c

27 files changed

+801
-275
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,43 @@
1-
name: CI workflow
2-
on: [push, pull_request]
1+
name: CI
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'docs/**'
7+
- '*.md'
8+
pull_request:
9+
paths-ignore:
10+
- 'docs/**'
11+
- '*.md'
12+
313
jobs:
414
test:
5-
runs-on: ubuntu-latest
15+
runs-on: ${{ matrix.os }}
616
strategy:
717
matrix:
8-
node-version: [10.x, 12.x, 13.x, 14.x]
18+
node-version: [10, 12, 13, 14, 16]
19+
os: [macos-latest, ubuntu-latest, windows-latest]
20+
921
steps:
10-
- uses: actions/checkout@v2
11-
- name: Use Node.js ${{ matrix.node-version }}
12-
uses: actions/[email protected]
13-
with:
14-
node-version: ${{ matrix.node-version }}
15-
- name: Install Dependencies
16-
run: npm install --ignore-scripts
17-
- name: Test
18-
run: npm run test
22+
- uses: actions/[email protected]
23+
24+
- name: Use Node.js
25+
uses: actions/[email protected]
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
29+
- name: Install Dependencies
30+
run: |
31+
npm install --ignore-scripts
32+
33+
- name: Run Tests
34+
run: |
35+
npm test
1936
2037
automerge:
2138
needs: test
2239
runs-on: ubuntu-latest
2340
steps:
24-
- uses: fastify/[email protected]
25-
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }}
41+
- uses: fastify/[email protected]
2642
with:
27-
github-token: ${{secrets.github_token}}
43+
github-token: ${{ secrets.GITHUB_TOKEN }}

.taprc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
esm: false
21
ts: false
32
jsx: false
43
coverage: false

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# fast-json-stringify
22

3-
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
4-
![Ci Workflow](https://github.com/fastify/fast-json-stringify/workflows/CI%20workflow/badge.svg)
3+
![CI](https://github.com/fastify/fast-json-stringify/workflows/CI/badge.svg)
4+
[![NPM version](https://img.shields.io/npm/v/fast-json-stringify.svg?style=flat)](https://www.npmjs.com/package/fast-json-stringify)
5+
[![Known Vulnerabilities](https://snyk.io/test/github/fastify/fast-json-stringify/badge.svg)](https://snyk.io/test/github/fastify/fast-json-stringify)
6+
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)
57
[![NPM downloads](https://img.shields.io/npm/dm/fast-json-stringify.svg?style=flat)](https://www.npmjs.com/package/fast-json-stringify)
68

79

@@ -106,7 +108,7 @@ const stringify = fastJson(mySchema, {
106108
<a name="fastJsonStringify"></a>
107109
### fastJsonStringify(schema)
108110

109-
Build a `stringify()` function based on [jsonschema](http://json-schema.org/).
111+
Build a `stringify()` function based on [jsonschema](https://json-schema.org/).
110112

111113
Supported types:
112114

@@ -137,6 +139,8 @@ And nested ones, too.
137139
| `date` | `2020-04-03` |
138140
| `time` | `09:11:08` |
139141

142+
**Note**: In the case of string formatted Date and not Date Object, there will be no manipulation on it. It should be properly formatted.
143+
140144
Example with a MomentJS object:
141145

142146
```javascript
@@ -338,7 +342,7 @@ const stringify = fastJson({
338342
savedId: { type: 'string' }
339343
},
340344
// without "required" validation any object will match
341-
required: ['saveId']
345+
required: ['savedId']
342346
},
343347
{
344348
type: 'object',
@@ -399,7 +403,7 @@ console.log(stringify({
399403
})) // {"kind":"foobar","foo":"FOO","bar":42}
400404
```
401405

402-
**NB:** don't declare the properties twice or you'll print them twice!
406+
**NB** Do not declare the properties twice or you will print them twice!
403407

404408
<a name="ref"></a>
405409
#### Reuse - $ref
@@ -602,7 +606,7 @@ console.log(stringify({ firstName: 'Foo', surname: 'bar' })) // '{"firstName":"F
602606
<a name="acknowledgements"></a>
603607
## Acknowledgements
604608

605-
This project was kindly sponsored by [nearForm](http://nearform.com).
609+
This project was kindly sponsored by [nearForm](https://nearform.com).
606610

607611
<a name="license"></a>
608612
## License

example.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
'use strict'
2-
31
const moment = require('moment')
4-
const fastJson = require('.')
2+
const fastJson = require('fast-json-stringify')
53
const stringify = fastJson({
64
title: 'Example Schema',
75
type: 'object',

0 commit comments

Comments
 (0)