Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

safe-stable-stringify

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.4.0 to 2.4.1

20

esm/wrapper.d.ts

@@ -1,19 +0,1 @@

export function stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string;
export function stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
export interface StringifyOptions {
bigint?: boolean,
circularValue?: string | null | TypeErrorConstructor | ErrorConstructor,
deterministic?: boolean,
maximumBreadth?: number,
maximumDepth?: number,
strict?: boolean,
}
export namespace stringify {
export function configure(options: StringifyOptions): typeof stringify;
}
export function configure(options: StringifyOptions): typeof stringify;
export default stringify;
export * from '../index.d'

13

index.d.ts

@@ -1,4 +0,7 @@

export function stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string;
export function stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
export type Replacer = (number | string)[] | null | undefined | ((key: string, value: unknown) => string | number | boolean | null)
export function stringify(value: undefined | symbol | ((...args: unknown[]) => unknown), replacer?: Replacer, space?: string | number): undefined
export function stringify(value: string | number | unknown[] | null | boolean | object, replacer?: Replacer, space?: string | number): string
export function stringify(value: unknown, replacer?: ((key: string, value: unknown) => unknown) | (number | string)[] | null | undefined, space?: string | number): string | undefined
export interface StringifyOptions {

@@ -14,7 +17,7 @@ bigint?: boolean,

export namespace stringify {
export function configure(options: StringifyOptions): typeof stringify;
export function configure(options: StringifyOptions): typeof stringify
}
export function configure(options: StringifyOptions): typeof stringify;
export function configure(options: StringifyOptions): typeof stringify
export default stringify;
export default stringify

@@ -22,5 +22,4 @@ 'use strict'

// eslint-disable-next-line
// eslint-disable-next-line no-control-regex
const strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/
// eslint-disable-next-line
const strEscapeSequencesReplacer = new RegExp(strEscapeSequencesRegExp, 'g')

@@ -134,3 +133,3 @@

function getCircularValueOption (options) {
if (options && hasOwnProperty.call(options, 'circularValue')) {
if (hasOwnProperty.call(options, 'circularValue')) {
const circularValue = options.circularValue

@@ -157,3 +156,3 @@ if (typeof circularValue === 'string') {

let value
if (options && hasOwnProperty.call(options, key)) {
if (hasOwnProperty.call(options, key)) {
value = options[key]

@@ -169,3 +168,3 @@ if (typeof value !== 'boolean') {

let value
if (options && hasOwnProperty.call(options, key)) {
if (hasOwnProperty.call(options, key)) {
value = options[key]

@@ -203,3 +202,3 @@ if (typeof value !== 'number') {

function getStrictOption (options) {
if (options && hasOwnProperty.call(options, 'strict')) {
if (hasOwnProperty.call(options, 'strict')) {
const value = options.strict

@@ -206,0 +205,0 @@ if (typeof value !== 'boolean') {

{
"name": "safe-stable-stringify",
"version": "2.4.0",
"version": "2.4.1",
"description": "Deterministic and safely JSON.stringify to quickly serialize JavaScript objects",

@@ -5,0 +5,0 @@ "exports": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc