Socket
Socket
Sign inDemoInstall

lossless-json

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lossless-json - npm Package Compare versions

Comparing version 3.0.2 to 4.0.0

3

lib/esm/config.js
/**
* Get and/or set configuration options
* @deprecated There is no config anymore
*/ // eslint-disable-next-line @typescript-eslint/no-unused-vars
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function config(options) {

@@ -6,0 +7,0 @@ // Backward compatibility warning for v1.x

@@ -302,3 +302,2 @@ import { parseLosslessNumber } from './numberParsers.js';

};
const codeBackslash = 0x5c; // "\"

@@ -305,0 +304,0 @@ const codeOpeningBrace = 0x7b; // "{"

@@ -68,3 +68,2 @@ import { test, expect } from 'vitest';

});
test('stringify a full JSON object', function () {

@@ -110,3 +109,2 @@ const expected = '{"a":123,"b":"str","c":null,"d":false,"e":[1,2,3]}';

};
expect(() => stringify([4], undefined, undefined, [wrongStringifier])).toThrow('Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: oopsie4)');

@@ -113,0 +111,0 @@ });

@@ -0,17 +1,29 @@

export type Reviver = (key: string, value: unknown) => unknown;
export type NumberParser = (value: string) => unknown;
export type Replacer = ((key: string, value: unknown) => unknown | undefined) | Array<string | number>;
export interface NumberStringifier {
test: (value: unknown) => boolean;
stringify: (value: unknown) => string;
}
export type GenericObject<T> = Record<string, T>;
/**
* @deprecated use `unknown` or `string | number | boolean | null` instead
*/
export type JSONPrimitive = string | number | boolean | null;
/**
* @deprecated use `unknown` instead
*/
export type JSONValue = {
[key: string]: JSONValue;
} | JSONValue[] | JSONPrimitive;
/**
* @deprecated use `unknown` or a Record instead
*/
export type JSONObject = {
[key: string]: JSONValue;
};
/**
* @deprecated use `unknown` or an Array instead
*/
export type JSONArray = JSONValue[];
export type Reviver = (key: string, value: JSONValue) => unknown;
export type NumberParser = (value: string) => unknown;
export type Replacer = ((key: string, value: unknown) => unknown | undefined) | Array<string | number>;
export interface NumberStringifier {
test: (value: unknown) => boolean;
stringify: (value: unknown) => string;
}
export type GenericObject<T> = Record<string, T>;
/**

@@ -18,0 +30,0 @@ * @deprecated use `unknown` instead

{
"name": "lossless-json",
"version": "3.0.2",
"version": "4.0.0",
"description": "Parse JSON without risk of losing numeric information",

@@ -59,14 +59,14 @@ "main": "lib/umd/lossless-json.js",

"devDependencies": {
"@babel/cli": "7.23.0",
"@babel/core": "7.23.2",
"@babel/plugin-transform-typescript": "7.22.15",
"@babel/preset-env": "7.23.2",
"@babel/preset-typescript": "7.23.2",
"@commitlint/cli": "18.2.0",
"@commitlint/config-conventional": "18.1.0",
"@babel/cli": "7.23.4",
"@babel/core": "7.23.6",
"@babel/plugin-transform-typescript": "7.23.6",
"@babel/preset-env": "7.23.6",
"@babel/preset-typescript": "7.23.3",
"@commitlint/cli": "18.4.3",
"@commitlint/config-conventional": "18.4.3",
"@rollup/plugin-terser": "0.4.4",
"@types/benchmark": "2.1.4",
"@types/node": "20.8.10",
"@typescript-eslint/eslint-plugin": "6.9.1",
"@typescript-eslint/parser": "6.9.1",
"@types/benchmark": "2.1.5",
"@types/node": "20.10.4",
"@typescript-eslint/eslint-plugin": "6.14.0",
"@typescript-eslint/parser": "6.14.0",
"benchmark": "2.1.4",

@@ -76,6 +76,6 @@ "cpy-cli": "5.0.0",

"del-cli": "5.1.0",
"eslint": "8.53.0",
"eslint": "8.55.0",
"eslint-config-standard": "17.1.0",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-n": "16.2.0",
"eslint-plugin-n": "16.4.0",
"eslint-plugin-node": "11.1.0",

@@ -85,7 +85,7 @@ "eslint-plugin-promise": "6.1.1",

"npm-run-all": "4.1.5",
"prettier": "3.0.3",
"rollup": "4.3.0",
"prettier": "3.1.1",
"rollup": "4.9.0",
"standard-version": "9.5.0",
"typescript": "5.2.2",
"vitest": "0.34.6"
"typescript": "5.3.3",
"vitest": "1.0.4"
},

@@ -92,0 +92,0 @@ "files": [

@@ -220,3 +220,3 @@ # lossless-json

The string to parse as JSON. See the JSON object for a description of JSON syntax.
- **@param** `{(key: string, value: JSONValue) => unknown} [reviver]`
- **@param** `{(key: string, value: unknown) => unknown} [reviver]`
If a function, prescribes how the value originally produced by parsing is transformed, before being returned.

@@ -223,0 +223,0 @@ - **@param** `{function(value: string) : unknown} [parseNumber]`

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc