secure-json-parse: add missing option (#43578)

Added constructorAction, which was missing from the previous type definition
Make protoAction optional, per URL below.
See https://github.com/fastify/secure-json-parse#readme

Co-authored-by: Mike MacCana <mike@daisie.com>
This commit is contained in:
Mike MacCana 2020-04-06 20:05:46 +01:00 committed by GitHub
parent fb754dafed
commit 45aa849073
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,12 +1,14 @@
// Type definitions for secure-json-parse 1.0
// Project: https://github.com/fastify/secure-json-parse#readme
// Definitions by: Sjoerd Diepen <https://github.com/OSjoerdWie>
// Mike MacCana <https://github.com/mikemaccana>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export type Reviver = (this: any, key: string, value: any) => any;
export interface ParseOptions {
protoAction: "error" | "remove" | "ignore";
protoAction?: "error" | "remove" | "ignore";
constructorAction?: "error" | "remove";
}
export function parse(input: string, reviver?: Reviver, options?: ParseOptions): any;