Skip to content

build(deps-dev): replace standard with neostandard #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![CI](https://github.com/fastify/secure-json-parse/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/fastify/secure-json-parse/actions/workflows/ci.yml)
[![NPM version](https://img.shields.io/npm/v/secure-json-parse.svg?style=flat)](https://www.npmjs.com/package/secure-json-parse)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)
[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)

`JSON.parse()` drop-in replacement with prototype poisoning protection.

Expand Down
6 changes: 6 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict'

module.exports = require('neostandard')({
ignores: require('neostandard').resolveIgnoresFromGitignore(),
ts: true
})
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"types": "types/index.d.ts",
"scripts": {
"benchmark": "cd benchmarks && npm install && npm run all",
"lint": "standard",
"lint": "eslint",
"lint:fix": "eslint --fix",
"test": "nyc npm run test:unit && npm run test:typescript",
"test:unit": "tape \"test/*.test.js\"",
"test:typescript": "tsd",
Expand All @@ -34,9 +35,9 @@
"@fastify/pre-commit": "^2.1.0",
"airtap": "^5.0.0",
"airtap-playwright": "^1.0.1",
"neostandard": "^0.11.9",
"nyc": "^17.0.0",
"playwright": "^1.43.1",
"standard": "^17.1.0",
"tape": "^5.7.5",
"tsd": "^0.31.0"
}
Expand Down
10 changes: 5 additions & 5 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ declare namespace parse {
* @param reviver The `JSON.parse()` optional `reviver` argument.
* @returns The parsed object, or `null` if there was an error or if the JSON contained possibly insecure properties.
*/
export function safeParse(text: string | Buffer, reviver?: Reviver | null): any
export function safeParse (text: string | Buffer, reviver?: Reviver | null): any

/**
* Scans a given object for prototype properties.
Expand All @@ -48,11 +48,11 @@ declare namespace parse {
* @param options Optional configuration object.
* @returns The object, or `null` if onError is set to `nullify`
*/
export function scan(obj: { [key: string | number]: any }, options?: ParseOptions): any
export function scan (obj: { [key: string | number]: any }, options?: ParseOptions): any

export { parse as default}
export { parse as default }
}

declare function parse(text: string | Buffer, options?: parse.ParseOptions): any
declare function parse(text: string | Buffer, reviver?: parse.Reviver | null, options?: parse.ParseOptions): any
declare function parse (text: string | Buffer, options?: parse.ParseOptions): any
declare function parse (text: string | Buffer, reviver?: parse.Reviver | null, options?: parse.ParseOptions): any
export = parse
2 changes: 1 addition & 1 deletion types/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sjson.scan({}, { protoAction: 'remove' })
sjson.scan({}, { protoAction: 'ignore' })
sjson.scan({}, { constructorAction: 'error' })
sjson.scan({}, { constructorAction: 'ignore' })
sjson.scan(new Array(), {})
sjson.scan([], {})

declare const input: Buffer
sjson.parse(input)
Expand Down
Loading