@zuplo/cli 7.9.20 → 7.9.21

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.
Files changed (78) hide show
  1. package/node_modules/@jsep-plugin/assignment/dist/cjs/index.cjs.js.map +1 -1
  2. package/node_modules/@jsep-plugin/assignment/dist/cjs/index.cjs.min.js +1 -1
  3. package/node_modules/@jsep-plugin/assignment/dist/cjs/index.cjs.min.js.map +1 -1
  4. package/node_modules/@jsep-plugin/assignment/dist/iife/index.iife.js +1 -1
  5. package/node_modules/@jsep-plugin/assignment/dist/iife/index.iife.js.map +1 -1
  6. package/node_modules/@jsep-plugin/assignment/dist/iife/index.iife.min.js +1 -1
  7. package/node_modules/@jsep-plugin/assignment/dist/iife/index.iife.min.js.map +1 -1
  8. package/node_modules/@jsep-plugin/assignment/dist/index.min.js +1 -1
  9. package/node_modules/@jsep-plugin/assignment/dist/index.min.js.map +1 -1
  10. package/node_modules/@jsep-plugin/assignment/package.json +4 -4
  11. package/node_modules/@jsep-plugin/regex/dist/cjs/index.cjs.js.map +1 -1
  12. package/node_modules/@jsep-plugin/regex/dist/cjs/index.cjs.min.js +1 -1
  13. package/node_modules/@jsep-plugin/regex/dist/cjs/index.cjs.min.js.map +1 -1
  14. package/node_modules/@jsep-plugin/regex/dist/iife/index.iife.js +1 -1
  15. package/node_modules/@jsep-plugin/regex/dist/iife/index.iife.js.map +1 -1
  16. package/node_modules/@jsep-plugin/regex/dist/iife/index.iife.min.js +1 -1
  17. package/node_modules/@jsep-plugin/regex/dist/iife/index.iife.min.js.map +1 -1
  18. package/node_modules/@jsep-plugin/regex/dist/index.min.js +1 -1
  19. package/node_modules/@jsep-plugin/regex/dist/index.min.js.map +1 -1
  20. package/node_modules/@jsep-plugin/regex/package.json +4 -4
  21. package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts +5 -0
  22. package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts.map +1 -1
  23. package/node_modules/@posthog/core/dist/posthog-core-stateless.js +7 -4
  24. package/node_modules/@posthog/core/dist/posthog-core-stateless.mjs +7 -4
  25. package/node_modules/@posthog/core/dist/posthog-core.d.ts +1 -0
  26. package/node_modules/@posthog/core/dist/posthog-core.d.ts.map +1 -1
  27. package/node_modules/@posthog/core/dist/posthog-core.js +8 -4
  28. package/node_modules/@posthog/core/dist/posthog-core.mjs +9 -5
  29. package/node_modules/@posthog/core/package.json +1 -1
  30. package/node_modules/@posthog/core/src/posthog-core-stateless.ts +12 -4
  31. package/node_modules/@posthog/core/src/posthog-core.ts +13 -11
  32. package/node_modules/@zuplo/core/package.json +1 -1
  33. package/node_modules/@zuplo/graphql/package.json +1 -1
  34. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  35. package/node_modules/@zuplo/otel/package.json +1 -1
  36. package/node_modules/@zuplo/runtime/package.json +1 -1
  37. package/node_modules/ip-address/README.md +70 -70
  38. package/node_modules/ip-address/dist/ipv6.js +7 -4
  39. package/node_modules/ip-address/dist/ipv6.js.map +1 -1
  40. package/node_modules/ip-address/dist/v6/constants.d.ts +3 -0
  41. package/node_modules/ip-address/dist/v6/constants.js +3 -0
  42. package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  43. package/node_modules/ip-address/package.json +2 -1
  44. package/node_modules/jsep/dist/cjs/jsep.cjs.js +4 -2
  45. package/node_modules/jsep/dist/cjs/jsep.cjs.js.map +1 -1
  46. package/node_modules/jsep/dist/cjs/jsep.cjs.min.js +1 -1
  47. package/node_modules/jsep/dist/cjs/jsep.cjs.min.js.map +1 -1
  48. package/node_modules/jsep/dist/iife/jsep.iife.js +5 -3
  49. package/node_modules/jsep/dist/iife/jsep.iife.js.map +1 -1
  50. package/node_modules/jsep/dist/iife/jsep.iife.min.js +1 -1
  51. package/node_modules/jsep/dist/iife/jsep.iife.min.js.map +1 -1
  52. package/node_modules/jsep/dist/jsep.js +4 -2
  53. package/node_modules/jsep/dist/jsep.min.js +1 -1
  54. package/node_modules/jsep/dist/jsep.min.js.map +1 -1
  55. package/node_modules/jsep/package.json +13 -13
  56. package/node_modules/process-warning/.github/workflows/ci.yml +1 -1
  57. package/node_modules/process-warning/.github/workflows/lock-threads.yml +1 -1
  58. package/node_modules/process-warning/.github/workflows/release.yml +24 -0
  59. package/node_modules/process-warning/README.md +46 -46
  60. package/node_modules/process-warning/package.json +1 -1
  61. package/node_modules/secure-json-parse/.github/dependabot.yml +42 -2
  62. package/node_modules/secure-json-parse/.github/workflows/ci.yml +20 -45
  63. package/node_modules/secure-json-parse/.github/workflows/lock-threads.yml +19 -0
  64. package/node_modules/secure-json-parse/.github/workflows/release.yml +24 -0
  65. package/node_modules/secure-json-parse/LICENSE +1 -3
  66. package/node_modules/secure-json-parse/README.md +63 -23
  67. package/node_modules/secure-json-parse/benchmarks/ignore.js +15 -13
  68. package/node_modules/secure-json-parse/benchmarks/no__proto__.js +19 -17
  69. package/node_modules/secure-json-parse/benchmarks/package.json +1 -1
  70. package/node_modules/secure-json-parse/benchmarks/remove.js +19 -17
  71. package/node_modules/secure-json-parse/benchmarks/throw.js +19 -17
  72. package/node_modules/secure-json-parse/benchmarks/valid.js +19 -17
  73. package/node_modules/secure-json-parse/index.js +4 -2
  74. package/node_modules/secure-json-parse/package.json +7 -7
  75. package/node_modules/secure-json-parse/test/index.test.js +3 -1
  76. package/node_modules/secure-json-parse/types/{index.test-d.ts → index.tst.ts} +15 -13
  77. package/package.json +11 -11
  78. package/node_modules/secure-json-parse/.github/stale.yml +0 -21
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsep",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "description": "a tiny JavaScript expression parser",
5
5
  "author": "Stephen Oney <swloney@gmail.com> (http://from.so/)",
6
6
  "maintainers": [
@@ -26,27 +26,27 @@
26
26
  "typings": "typings/tsd.d.ts",
27
27
  "private": false,
28
28
  "devDependencies": {
29
- "@commitlint/cli": "^13.1.0",
30
- "@commitlint/config-angular": "^13.1.0",
31
- "@rollup/plugin-replace": "^2.4.2",
29
+ "@commitlint/cli": "^21.2.3",
30
+ "@commitlint/config-angular": "^21.2.3",
31
+ "@rollup/plugin-replace": "^6.0.3",
32
32
  "@semantic-release/changelog": "^5.0.1",
33
33
  "@semantic-release/exec": "^6.0.3",
34
34
  "@semantic-release/git": "^9.0.0",
35
35
  "benchmark": "^2.1.4",
36
36
  "docco": "^0.9.1",
37
- "eslint": "^7.23.0",
37
+ "eslint": "^10.12.0",
38
38
  "http-server": "^14.1.1",
39
- "husky": "^7.0.0",
39
+ "husky": "^9.1.7",
40
40
  "node-qunit-puppeteer": "^2.1.2",
41
- "puppeteer": "^19.9.0",
42
- "rollup": "^2.44.0",
43
- "rollup-plugin-delete": "^2.0.0",
41
+ "puppeteer": "^25.12.0",
42
+ "rollup": "^4.64.2",
43
+ "rollup-plugin-delete": "^3.0.2",
44
44
  "rollup-plugin-terser": "^7.0.2",
45
45
  "semantic-release-monorepo": "^7.0.5",
46
46
  "semantic-release-plus": "^18.4.1"
47
47
  },
48
48
  "engines": {
49
- "node": ">= 10.16.0"
49
+ "node": ">= 20.16.0"
50
50
  },
51
51
  "directories": {
52
52
  "test": "test"
@@ -141,9 +141,9 @@
141
141
  "default": "npm run lint && npm run build:all && npm run test:all && npm run docco",
142
142
  "build": "npx rollup -c && cp package-cjs.json dist/cjs/package.json",
143
143
  "build:watch": "npx rollup -c --watch",
144
- "build:all": "pnpm run build -r",
145
- "test": "npx http-server -p 49649 --silent & npx node-qunit-puppeteer http://localhost:49649/test/unit_tests.html",
146
- "test:all": "npx http-server -p 49649 --silent & pnpm run test -r --workspace-concurrency=1",
144
+ "build:all": "pnpm --recursive --workspace-root run build",
145
+ "test": "npx http-server -p 49649 --silent & npx node-qunit-puppeteer http://localhost:49649/test/unit_tests.html 30000 \"--no-sandbox\" ",
146
+ "test:all": "pnpm -r --workspace-concurrency=1 run test",
147
147
  "test:performance": "node test/performance.test.js",
148
148
  "docco": "npx docco src/jsep.js --css=src/docco.css --output=annotated_source/",
149
149
  "lint": "npx eslint src/**/*.js test/*.js test/packages/**/*.js packages/**/*.js",
@@ -27,7 +27,7 @@ jobs:
27
27
  permissions:
28
28
  contents: write
29
29
  pull-requests: write
30
- uses: fastify/workflows/.github/workflows/plugins-ci.yml@2073dc8e1f9e172bf42daa3843c9dbd31af1e8cb # v6.0.0
30
+ uses: fastify/workflows/.github/workflows/plugins-ci.yml@ef591e2186785d5ab36b9fe6a79c7ce2f1d94e57 # v7.0.0
31
31
  with:
32
32
  license-check: true
33
33
  lint: true
@@ -16,4 +16,4 @@ jobs:
16
16
  permissions:
17
17
  issues: write
18
18
  pull-requests: write
19
- uses: fastify/workflows/.github/workflows/lock-threads.yml@2073dc8e1f9e172bf42daa3843c9dbd31af1e8cb # v6.0.0
19
+ uses: fastify/workflows/.github/workflows/lock-threads.yml@ef591e2186785d5ab36b9fe6a79c7ce2f1d94e57 # v7.0.0
@@ -0,0 +1,24 @@
1
+ name: Release the package
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ semver:
7
+ description: 'Release bump type'
8
+ required: true
9
+ type: choice
10
+ options:
11
+ - patch
12
+ - minor
13
+ - major
14
+
15
+ permissions: {}
16
+
17
+ jobs:
18
+ release:
19
+ permissions:
20
+ id-token: write # required for npm provenance via OIDC
21
+ contents: write # required to push the release commit and the tag
22
+ uses: fastify/workflows/.github/workflows/reusable-release.yml@b1a11bce713bc857e52b2231fec3c89071ad3135
23
+ with:
24
+ semver: ${{ inputs.semver }}
@@ -4,18 +4,18 @@
4
4
  [![NPM version](https://img.shields.io/npm/v/process-warning.svg?style=flat)](https://www.npmjs.com/package/process-warning)
5
5
  [![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)
6
6
 
7
- A small utility for generating consistent [warning objects](https://nodejs.org/api/process.html#event-warning) across your codebase.
7
+ A small utility for generating consistent [warning objects](https://nodejs.org/api/process.html#event-warning) across a codebase.
8
8
  It also exposes a utility for emitting those warnings, guaranteeing that they are issued only once (unless configured otherwise).
9
9
 
10
- _This module is used by the [Fastify](https://fastify.dev) framework and it was called `fastify-warning` prior to version 1.0.0._
10
+ _This module is used by the [Fastify](https://fastify.dev) framework, and it was called `fastify-warning` prior to version 1.0.0._
11
11
 
12
- ### Install
12
+ ## Install
13
13
 
14
14
  ```
15
15
  npm i process-warning
16
16
  ```
17
17
 
18
- ### Usage
18
+ ## Usage
19
19
 
20
20
  The module exports two builder functions for creating warnings.
21
21
 
@@ -34,35 +34,34 @@ const warning = createWarning({
34
34
  const emitted = warning('world')
35
35
  ```
36
36
 
37
- #### Methods
37
+ ### Methods
38
38
 
39
- ##### `createWarning({ name, code, message[, unlimited] })`
39
+ #### `createWarning({name, code, message[, unlimited]})`
40
40
 
41
- - `name` (`string`, required) - The error name, you can access it later with
42
- `error.name`. For consistency, we recommend prefixing module error names
43
- with `{YourModule}Warning`
44
- - `code` (`string`, required) - The warning code, you can access it later with
45
- `error.code`. For consistency, we recommend prefixing plugin error codes with
46
- `{ThreeLetterModuleName}_`, e.g. `FST_`. NOTE: codes should be all uppercase.
47
- - `message` (`string`, required) - The warning message. You can also use
48
- interpolated strings for formatting the message.
41
+ - `name` (`string`, required) - The error name, accessible through
42
+ `error.name`. For consistency, prefix module error names with
43
+ `{ModuleName}Warning`.
44
+ - `code` (`string`, required) - The warning code, accessible through
45
+ `error.code`. For consistency, prefix plugin error codes with
46
+ `{ThreeLetterModuleName}_`, e.g. `FST_`. Note: Codes should be all uppercase.
47
+ - `message` (`string`, required) - The warning message. Interpolated strings
48
+ can also be used to format the message.
49
49
  - `options` (`object`, optional) - Optional options with the following
50
50
  properties:
51
51
  + `unlimited` (`boolean`, optional) - Should the warning be emitted more than
52
52
  once? Defaults to `false`.
53
53
 
54
-
55
- ##### `createDeprecation({code, message[, options]})`
54
+ #### `createDeprecation({ code, message[, options] })`
56
55
 
57
56
  This is a wrapper for `createWarning`. It is equivalent to invoking
58
- `createWarning` with the `name` parameter set to "DeprecationWarning".
57
+ `createWarning` with the `name` parameter set to `"DeprecationWarning"`.
59
58
 
60
59
  Deprecation warnings have extended support for the Node.js CLI options:
61
60
  `--throw-deprecation`, `--no-deprecation`, and `--trace-deprecation`.
62
61
 
63
- ##### `warning([, a [, b [, c]]])`
62
+ #### `warning([, a [, b [, c]]])`
64
63
 
65
- The returned `warning` function can used for emitting warnings.
64
+ The returned `warning` function can be used to emit warnings.
66
65
  A warning is guaranteed to be emitted at least once.
67
66
 
68
67
  - `[, a [, b [, c]]]` (`any`, optional) - Parameters for string interpolation.
@@ -73,14 +72,16 @@ const FST_ERROR_CODE = createWarning({ name: 'MyAppWarning', code: 'FST_ERROR_CO
73
72
  FST_ERROR_CODE()
74
73
  ```
75
74
 
76
- How to use an interpolated string:
75
+ Using an interpolated string:
76
+
77
77
  ```js
78
78
  const { createWarning } = require('process-warning')
79
79
  const FST_ERROR_CODE = createWarning({ name: 'MyAppWarning', code: 'FST_ERROR_CODE', message: 'Hello %s'})
80
80
  FST_ERROR_CODE('world')
81
81
  ```
82
82
 
83
- The `warning` object has methods and properties for managing the warning's state. Useful for testing.
83
+ The `warning` object has methods and properties for managing the warning's state. These are useful for testing.
84
+
84
85
  ```js
85
86
  const { createWarning } = require('process-warning')
86
87
  const FST_ERROR_CODE = createWarning({ name: 'MyAppWarning', code: 'FST_ERROR_CODE', message: 'Hello %s'})
@@ -90,20 +91,21 @@ console.log(FST_ERROR_CODE.emitted) // true
90
91
 
91
92
  const FST_ERROR_CODE_2 = createWarning('MyAppWarning', 'FST_ERROR_CODE_2', 'Hello %s')
92
93
  FST_ERROR_CODE_2.emitted = true
93
- FST_ERROR_CODE_2('world') // will not be emitted because it is not unlimited
94
+ FST_ERROR_CODE_2('world') // Will not be emitted because it is not unlimited
94
95
  ```
95
96
 
96
- How to use an unlimited warning:
97
+ Using an unlimited warning:
98
+
97
99
  ```js
98
100
  const { createWarning } = require('process-warning')
99
101
  const FST_ERROR_CODE = createWarning({ name: 'MyAppWarning', code: 'FST_ERROR_CODE', message: 'Hello %s', unlimited: true })
100
- FST_ERROR_CODE('world') // will be emitted
101
- FST_ERROR_CODE('world') // will be emitted again
102
+ FST_ERROR_CODE('world') // Will be emitted
103
+ FST_ERROR_CODE('world') // Will be emitted again
102
104
  ```
103
105
 
104
106
  #### `spyWarning(warning)`
105
107
 
106
- Spy the created warning function for testing purpose.
108
+ Spy on the created warning function for testing purposes.
107
109
 
108
110
  ```js
109
111
  const { test } = require('node:test')
@@ -113,45 +115,43 @@ const FST_ERROR_CODE = createWarning({ name: 'MyAppWarning', code: 'FST_ERROR_CO
113
115
  test('spy warning', t => {
114
116
  const spyData = spyWarning(FST_ERROR_CODE)
115
117
 
116
- // call after spy
118
+ // Call after spying
117
119
  const emitted = FST_ERROR_CODE('world')
118
120
  t.assert.strictEqual(emitted, true)
119
121
 
120
- // restore the warning function
121
- // it must be called when you do not need to spy anymore
122
- // otherwise, the calls data will accumulates.
122
+ // Restore the warning function
123
+ // This must be called when spying is no longer required
124
+ // Otherwise, the call data will accumulate
123
125
  t.after(() => spyData.restore())
124
126
 
125
127
  t.assert.strictEqual(FST_ERROR_CODE.emitted, true)
126
- // calls return the arguments and result.
127
- // result indicate whether warning is emitted through process.emitWarning
128
+ // `calls` contains the arguments and results
129
+ // `result` indicates whether the warning was emitted through `process.emitWarning`
128
130
  console.log(spyData.calls) // [{ arguments: ['world'], result: true }]
129
131
  t.assert.deepStrictEqual(spyData.calls[0].arguments, ['world'])
130
- t.assert.strictEqual(spyData.calls[0].result, true)
131
- // number of times called the function
132
+ t.assert.strictEqual(spyData.calls[0].result, true)
133
+ // Number of times the function was called
132
134
  console.log(spyData.callCount()) // 1
133
- t.assert.strictEqual(spyData.callCount(), 1)
135
+ t.assert.strictEqual(spyData.callCount(), 1)
134
136
 
135
- // reset the spy stat and warning state
137
+ // Reset the spy statistics and warning state
136
138
  spyData.reset()
137
139
  t.assert.strictEqual(FST_ERROR_CODE.emitted, false)
138
140
  t.assert.deepStrictEqual(spyData.calls, [])
139
- t.assert.strictEqual(spyData.callCount(), 0)
141
+ t.assert.strictEqual(spyData.callCount(), 0)
140
142
  })
141
143
  ```
142
144
 
143
- #### Suppressing warnings
144
-
145
- It is possible to suppress warnings by utilizing one of node's built-in warning suppression mechanisms.
145
+ ### Suppressing warnings
146
146
 
147
- Warnings can be suppressed:
147
+ Warnings can be suppressed by using one of Node.js's built-in warning suppression mechanisms:
148
148
 
149
- - by setting the `NODE_NO_WARNINGS` environment variable to `1`
150
- - by passing the `--no-warnings` flag to the node process
151
- - by setting '--no-warnings' in the `NODE_OPTIONS` environment variable
149
+ - Setting the `NODE_NO_WARNINGS` environment variable to `1`
150
+ - Passing the `--no-warnings` flag to the Node.js process
151
+ - Setting `--no-warnings` in the `NODE_OPTIONS` environment variable
152
152
 
153
- For more information see [node's documentation](https://nodejs.org/api/cli.html).
153
+ For more information, see the [Node.js documentation](https://nodejs.org/api/cli.html).
154
154
 
155
155
  ## License
156
156
 
157
- Licensed under [MIT](./LICENSE).
157
+ Licensed under [MIT](./LICENSE).
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "process-warning",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "A small utility for creating warnings and emitting them.",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
@@ -2,12 +2,52 @@ version: 2
2
2
  updates:
3
3
  - package-ecosystem: "github-actions"
4
4
  directory: "/"
5
+ commit-message:
6
+ # Prefix all commit messages with "chore: "
7
+ prefix: "chore"
5
8
  schedule:
6
- interval: "monthly"
9
+ interval: "weekly"
10
+ cooldown:
11
+ default-days: 7
12
+ allow:
13
+ - dependency-name: "*"
14
+ update-types:
15
+ - "version-update:semver-major"
7
16
  open-pull-requests-limit: 10
8
17
 
9
18
  - package-ecosystem: "npm"
10
19
  directory: "/"
20
+ commit-message:
21
+ # Prefix all commit messages with "chore: "
22
+ prefix: "chore"
11
23
  schedule:
12
- interval: "monthly"
24
+ interval: "weekly"
25
+ cooldown:
26
+ default-days: 7
27
+ versioning-strategy: "increase-if-necessary"
28
+ allow:
29
+ - dependency-name: "*"
30
+ update-types:
31
+ - "version-update:semver-major"
32
+ ignore:
33
+ # TODO: remove ignore until neostandard support ESLint 10
34
+ - dependency-name: "eslint"
35
+ - dependency-name: "neostandard"
36
+ - dependency-name: "@stylistic/*"
13
37
  open-pull-requests-limit: 10
38
+ groups:
39
+ # Production dependencies with breaking changes
40
+ dependencies:
41
+ dependency-type: "production"
42
+ # ESLint related dependencies
43
+ dev-dependencies-eslint:
44
+ patterns:
45
+ - "eslint"
46
+ - "neostandard"
47
+ - "@stylistic/*"
48
+ # TypeScript related dependencies
49
+ dev-dependencies-typescript:
50
+ patterns:
51
+ - "@types/*"
52
+ - "tstyche"
53
+ - "typescript"
@@ -14,47 +14,22 @@ on:
14
14
  - 'docs/**'
15
15
  - '*.md'
16
16
 
17
+ # This allows a subsequently queued workflow run to interrupt previous runs
18
+ concurrency:
19
+ group: "${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
20
+ cancel-in-progress: true
21
+
17
22
  permissions:
18
23
  contents: read
19
24
 
20
25
  jobs:
21
- dependency-review:
22
- name: Dependency Review
23
- if: github.event_name == 'pull_request'
24
- runs-on: ubuntu-latest
25
- permissions:
26
- contents: read
27
- steps:
28
- - name: Check out repo
29
- uses: actions/checkout@v5
30
- with:
31
- persist-credentials: false
32
-
33
- - name: Dependency review
34
- uses: actions/dependency-review-action@56339e523c0409420f6c2c9a2f4292bbb3c07dd3 # v4.8.0
35
-
36
- lint:
37
- name: Lint Code
38
- runs-on: ubuntu-latest
26
+ quality-check:
27
+ uses: fastify/workflows/.github/workflows/nested-quality.yml@ef591e2186785d5ab36b9fe6a79c7ce2f1d94e57 # v7.0.0
39
28
  permissions:
40
29
  contents: read
41
- steps:
42
- - name: Check out repo
43
- uses: actions/checkout@v5
44
- with:
45
- persist-credentials: false
46
-
47
- - name: Setup Node
48
- uses: actions/setup-node@v5
49
- with:
50
- check-latest: true
51
- node-version: lts/*
52
-
53
- - name: Install dependencies
54
- run: npm i --ignore-scripts
55
-
56
- - name: Lint code
57
- run: npm run lint
30
+ with:
31
+ license-check: true
32
+ lint: true
58
33
 
59
34
  browsers:
60
35
  name: Test Browsers
@@ -63,12 +38,12 @@ jobs:
63
38
  contents: read
64
39
  steps:
65
40
  - name: Check out repo
66
- uses: actions/checkout@v5
41
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
67
42
  with:
68
43
  persist-credentials: false
69
44
 
70
45
  - name: Setup Node
71
- uses: actions/setup-node@v5
46
+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
72
47
  with:
73
48
  check-latest: true
74
49
  node-version: lts/*
@@ -89,15 +64,15 @@ jobs:
89
64
  contents: read
90
65
  strategy:
91
66
  matrix:
92
- node-version: [20, 22, 24]
67
+ node-version: [20, 22, 24, 26]
93
68
  steps:
94
69
  - name: Check out repo
95
- uses: actions/checkout@v5
70
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
96
71
  with:
97
72
  persist-credentials: false
98
73
 
99
74
  - name: Setup Node ${{ matrix.node-version }}
100
- uses: actions/setup-node@v5
75
+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
101
76
  with:
102
77
  check-latest: true
103
78
  node-version: ${{ matrix.node-version }}
@@ -115,12 +90,12 @@ jobs:
115
90
  contents: read
116
91
  steps:
117
92
  - name: Check out repo
118
- uses: actions/checkout@v5
93
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
119
94
  with:
120
95
  persist-credentials: false
121
96
 
122
97
  - name: Setup Node
123
- uses: actions/setup-node@v5
98
+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
124
99
  with:
125
100
  check-latest: true
126
101
  node-version: lts/*
@@ -128,7 +103,7 @@ jobs:
128
103
  - name: Install dependencies
129
104
  run: npm i --ignore-scripts
130
105
 
131
- - name: tsd
106
+ - name: tstyche
132
107
  run: npm run test:typescript
133
108
 
134
109
  automerge:
@@ -137,13 +112,13 @@ jobs:
137
112
  github.event_name == 'pull_request' &&
138
113
  github.event.pull_request.head.repo.full_name == github.repository &&
139
114
  github.event.pull_request.user.login == 'dependabot[bot]'
140
- needs: [browsers, lint, test, typescript]
115
+ needs: [browsers, quality-check, test, typescript]
141
116
  permissions:
142
117
  pull-requests: write
143
118
  contents: write
144
119
  runs-on: ubuntu-latest
145
120
  steps:
146
- - uses: fastify/github-action-merge-dependabot@e820d631adb1d8ab16c3b93e5afe713450884a4a # v3.11.1
121
+ - uses: fastify/github-action-merge-dependabot@30c3f8f14a4f7b315ba38dbc1b793d27128fef82 # v3.12.0
147
122
  with:
148
123
  github-token: ${{ secrets.GITHUB_TOKEN }}
149
124
  target: major
@@ -0,0 +1,19 @@
1
+ name: Lock Threads
2
+
3
+ on:
4
+ schedule:
5
+ - cron: '0 0 1 * *'
6
+ workflow_dispatch:
7
+
8
+ concurrency:
9
+ group: lock
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ lock-threads:
16
+ permissions:
17
+ issues: write
18
+ pull-requests: write
19
+ uses: fastify/workflows/.github/workflows/lock-threads.yml@ef591e2186785d5ab36b9fe6a79c7ce2f1d94e57 # v7.0.0
@@ -0,0 +1,24 @@
1
+ name: Release the package
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ semver:
7
+ description: 'Release bump type'
8
+ required: true
9
+ type: choice
10
+ options:
11
+ - patch
12
+ - minor
13
+ - major
14
+
15
+ permissions: {}
16
+
17
+ jobs:
18
+ release:
19
+ permissions:
20
+ id-token: write # required for npm provenance via OIDC
21
+ contents: write # required to push the release commit and the tag
22
+ uses: fastify/workflows/.github/workflows/reusable-release.yml@b1a11bce713bc857e52b2231fec3c89071ad3135
23
+ with:
24
+ semver: ${{ inputs.semver }}
@@ -1,9 +1,7 @@
1
1
  Copyright (c) 2019, Sideway Inc, and project contributors
2
- Copyright (c) 2019-present The Fastify team
2
+ Copyright (c) 2019-present The Fastify team <https://github.com/fastify/fastify#team>
3
3
  All rights reserved.
4
4
 
5
- The Fastify team members are listed at https://github.com/fastify/fastify#team.
6
-
7
5
  The complete list of contributors can be found at:
8
6
  - https://github.com/hapijs/bourne/graphs/contributors
9
7
  - https://github.com/fastify/secure-json-parse/graphs/contributors
@@ -88,39 +88,79 @@ Scans a given object for prototype properties where:
88
88
 
89
89
  ## Benchmarks
90
90
 
91
- Machine: 2,7 GHz Quad-Core Intel Core i7
91
+ Machine: 2.4 Ghz 14-core Intel Core i7-13650HX
92
92
 
93
93
  ```
94
- v14.8.0
95
-
94
+ v22.20.0
95
+
96
+ > benchmarks@1.0.0 valid
97
+ > node valid.js
98
+
99
+ valid benchmark
100
+ ┌─────────┬─────────────────────────────────────┬──────────────────┬──────────────────┬────────────────────────┬────────────────────────┬─────────┐
101
+ │ (index) │ Task name │ Latency avg (ns) │ Latency med (ns) │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
102
+ ├─────────┼─────────────────────────────────────┼──────────────────┼──────────────────┼────────────────────────┼────────────────────────┼─────────┤
103
+ │ 0 │ 'JSON.parse' │ '610.10 ± 0.39%' │ '600.00 ± 0.00' │ '1740515 ± 0.02%' │ '1666667 ± 0' │ 1639075 │
104
+ │ 1 │ 'JSON.parse proto' │ '875.42 ± 0.39%' │ '800.00 ± 0.00' │ '1210508 ± 0.03%' │ '1250000 ± 0' │ 1142308 │
105
+ │ 2 │ 'secure-json-parse parse' │ '634.34 ± 0.32%' │ '600.00 ± 0.00' │ '1624445 ± 0.01%' │ '1666667 ± 0' │ 1576434 │
106
+ │ 3 │ 'secure-json-parse parse proto' │ '657.25 ± 0.42%' │ '600.00 ± 0.00' │ '1666577 ± 0.03%' │ '1666667 ± 0' │ 1521499 │
107
+ │ 4 │ 'secure-json-parse safeParse' │ '646.03 ± 1.68%' │ '600.00 ± 0.00' │ '1622543 ± 0.02%' │ '1666667 ± 0' │ 1547914 │
108
+ │ 5 │ 'secure-json-parse safeParse proto' │ '912.34 ± 0.20%' │ '900.00 ± 0.00' │ '1122250 ± 0.02%' │ '1111111 ± 0' │ 1096080 │
109
+ │ 6 │ 'JSON.parse reviver' │ '3448.5 ± 0.59%' │ '3200.0 ± 0.00' │ '300173 ± 0.04%' │ '312500 ± 0' │ 289982 │
110
+ └─────────┴─────────────────────────────────────┴──────────────────┴──────────────────┴────────────────────────┴────────────────────────┴─────────┘
111
+
112
+ > benchmarks@1.0.0 ignore
96
113
  > node ignore.js
97
114
 
98
- JSON.parse x 679,376 ops/sec ±1.15% (84 runs sampled)
99
- secure-json-parse x 649,605 ops/sec ±0.58% (87 runs sampled)
100
- reviver x 244,414 ops/sec ±1.05% (88 runs sampled)
101
- Fastest is JSON.parse
102
-
115
+ ignore benchmark
116
+ ┌─────────┬───────────────────────────────┬──────────────────┬───────────────────┬────────────────────────┬────────────────────────┬─────────┐
117
+ │ (index) │ Task name │ Latency avg (ns) │ Latency med (ns) │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
118
+ ├─────────┼───────────────────────────────┼──────────────────┼───────────────────┼────────────────────────┼────────────────────────┼─────────┤
119
+ │ 0 │ 'JSON.parse' │ '897.15 ± 0.53%' │ '800.00 ± 0.00' │ '1201546 ± 0.03%' │ '1250000 ± 0' │ 1114647 │
120
+ │ 1 │ 'secure-json-parse parse' │ '891.22 ± 0.45%' │ '800.00 ± 0.00' │ '1168492 ± 0.02%' │ '1250000 ± 0' │ 1122056 │
121
+ │ 2 │ 'secure-json-parse safeParse' │ '938.74 ± 0.56%' │ '900.00 ± 0.00' │ '1106881 ± 0.02%' │ '1111111 ± 0' │ 1065255 │
122
+ │ 3 │ 'reviver' │ '5741.8 ± 0.79%' │ '4900.0 ± 100.00' │ '188823 ± 0.08%' │ '204082 ± 4252' │ 174162 │
123
+ └─────────┴───────────────────────────────┴──────────────────┴───────────────────┴────────────────────────┴────────────────────────┴─────────┘
124
+
125
+ > benchmarks@1.0.0 no_proto
103
126
  > node no__proto__.js
104
127
 
105
- JSON.parse x 652,190 ops/sec ±0.67% (86 runs sampled)
106
- secure-json-parse x 589,785 ops/sec ±1.01% (88 runs sampled)
107
- reviver x 218,075 ops/sec ±1.58% (87 runs sampled)
108
- Fastest is JSON.parse
109
-
128
+ no __proto__ benchmark
129
+ ┌─────────┬───────────────────────────────┬──────────────────┬───────────────────┬────────────────────────┬────────────────────────┬─────────┐
130
+ │ (index) │ Task name │ Latency avg (ns) │ Latency med (ns) │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
131
+ ├─────────┼───────────────────────────────┼──────────────────┼───────────────────┼────────────────────────┼────────────────────────┼─────────┤
132
+ │ 0 │ 'JSON.parse' │ '930.41 ± 0.56%' │ '800.00 ± 0.00' │ '1154630 ± 0.03%' │ '1250000 ± 0' │ 1074798 │
133
+ │ 1 │ 'secure-json-parse parse' │ '996.09 ± 0.27%' │ '900.00 ± 0.00' │ '1039752 ± 0.02%' │ '1111111 ± 0' │ 1003921 │
134
+ │ 2 │ 'secure-json-parse safeParse' │ '1050.5 ± 7.38%' │ '900.00 ± 0.00' │ '1038060 ± 0.02%' │ '1111111 ± 0' │ 951942 │
135
+ │ 3 │ 'reviver' │ '5424.7 ± 3.23%' │ '5100.0 ± 100.00' │ '192362 ± 0.05%' │ '196078 ± 3922' │ 184341 │
136
+ └─────────┴───────────────────────────────┴──────────────────┴───────────────────┴────────────────────────┴────────────────────────┴─────────┘
137
+
138
+ > benchmarks@1.0.0 remove
110
139
  > node remove.js
111
140
 
112
- JSON.parse x 683,527 ops/sec ±0.62% (88 runs sampled)
113
- secure-json-parse x 316,926 ops/sec ±0.63% (87 runs sampled)
114
- reviver x 214,167 ops/sec ±0.63% (86 runs sampled)
115
- Fastest is JSON.parse
116
-
141
+ remove benchmark
142
+ ┌─────────┬───────────────────────────────┬──────────────────┬───────────────────┬────────────────────────┬────────────────────────┬─────────┐
143
+ │ (index) │ Task name │ Latency avg (ns) │ Latency med (ns) │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
144
+ ├─────────┼───────────────────────────────┼──────────────────┼───────────────────┼────────────────────────┼────────────────────────┼─────────┤
145
+ │ 0 │ 'JSON.parse' │ '927.86 ± 0.51%' │ '800.00 ± 0.00' │ '1161336 ± 0.03%' │ '1250000 ± 0' │ 1077745 │
146
+ │ 1 │ 'secure-json-parse parse' │ '1968.1 ± 0.51%' │ '1900.0 ± 100.00' │ '525418 ± 0.02%' │ '526316 ± 26316' │ 508117 │
147
+ │ 2 │ 'secure-json-parse safeParse' │ '930.60 ± 0.19%' │ '900.00 ± 0.00' │ '1103037 ± 0.02%' │ '1111111 ± 0' │ 1074579 │
148
+ │ 3 │ 'reviver' │ '5531.4 ± 0.36%' │ '5100.0 ± 100.00' │ '187392 ± 0.06%' │ '196078 ± 3922' │ 180786 │
149
+ └─────────┴───────────────────────────────┴──────────────────┴───────────────────┴────────────────────────┴────────────────────────┴─────────┘
150
+
151
+ > benchmarks@1.0.0 throw
117
152
  > node throw.js
118
153
 
119
- JSON.parse x 682,548 ops/sec ±0.60% (88 runs sampled)
120
- JSON.parse error x 170,716 ops/sec ±0.93% (87 runs sampled)
121
- secure-json-parse x 104,483 ops/sec ±0.62% (87 runs sampled)
122
- reviver x 114,197 ops/sec ±0.63% (87 runs sampled)
123
- Fastest is JSON.parse
154
+ throw benchmark
155
+ ┌─────────┬───────────────────────────────┬──────────────────┬───────────────────┬────────────────────────┬────────────────────────┬─────────┐
156
+ │ (index) │ Task name │ Latency avg (ns) │ Latency med (ns) │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
157
+ ├─────────┼───────────────────────────────┼──────────────────┼───────────────────┼────────────────────────┼────────────────────────┼─────────┤
158
+ │ 0 │ 'JSON.parse valid' │ '908.52 ± 0.54%' │ '800.00 ± 0.00' │ '1178218 ± 0.03%' │ '1250000 ± 0' │ 1100690 │
159
+ │ 1 │ 'JSON.parse error' │ '7993.2 ± 0.54%' │ '7600.0 ± 200.00' │ '128668 ± 0.06%' │ '131579 ± 3374' │ 125108 │
160
+ │ 2 │ 'secure-json-parse parse' │ '3436.4 ± 2.67%' │ '3100.0 ± 100.00' │ '312206 ± 0.05%' │ '322581 ± 10081' │ 291001 │
161
+ │ 3 │ 'secure-json-parse safeParse' │ '2800.9 ± 0.33%' │ '2700.0 ± 0.00' │ '364670 ± 0.03%' │ '370370 ± 0' │ 357026 │
162
+ │ 4 │ 'reviver' │ '9045.6 ± 1.12%' │ '8300.0 ± 200.00' │ '115581 ± 0.08%' │ '120482 ± 2975' │ 110552 │
163
+ └─────────┴───────────────────────────────┴──────────────────┴───────────────────┴────────────────────────┴────────────────────────┴─────────┘
124
164
  ```
125
165
 
126
166
  ## Acknowledgments