fix(core): update
This commit is contained in:
parent
9bc1c4bf93
commit
ee025d094c
@ -3,6 +3,7 @@
|
||||
"npmAccessLevel": "public"
|
||||
},
|
||||
"gitzone": {
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "pushrocks",
|
||||
|
10527
package-lock.json
generated
10527
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
22
package.json
22
package.json
@ -3,11 +3,11 @@
|
||||
"version": "3.0.10",
|
||||
"private": false,
|
||||
"description": "typed json handlers",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
"scripts": {
|
||||
"test": "(tstest test/)",
|
||||
"build": "(tsbuild)"
|
||||
"test": "(tstest test/ --web)",
|
||||
"build": "(tsbuild --web)"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -20,16 +20,18 @@
|
||||
},
|
||||
"homepage": "https://gitlab.com/pushrocks/smartjson#README",
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.17",
|
||||
"@gitzone/tsrun": "^1.2.8",
|
||||
"@gitzone/tstest": "^1.0.28",
|
||||
"@pushrocks/tapbundle": "^3.2.0",
|
||||
"@types/node": "^12.12.17",
|
||||
"tslint": "^5.20.1",
|
||||
"@gitzone/tsbuild": "^2.1.25",
|
||||
"@gitzone/tsrun": "^1.2.12",
|
||||
"@gitzone/tstest": "^1.0.52",
|
||||
"@pushrocks/tapbundle": "^3.2.9",
|
||||
"@types/node": "^14.11.2",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/buffer-json": "^2.0.0",
|
||||
"@types/fast-json-stable-stringify": "^2.0.0",
|
||||
"buffer-json": "^2.0.0",
|
||||
"fast-json-stable-stringify": "^2.1.0",
|
||||
"lodash.clonedeep": "^4.5.0"
|
||||
},
|
||||
|
@ -4,9 +4,14 @@ export class Smartjson {
|
||||
// ======
|
||||
// STATIC
|
||||
// ======
|
||||
public static parse = JSON.parse;
|
||||
/**
|
||||
* allows you to parse a json
|
||||
*/
|
||||
public static parse = plugins.bufferJson.parse;
|
||||
|
||||
public static stringify = (objArg: any, optionsArg: plugins.IStableJsonTypes['Options']) => {
|
||||
const bufferedJson = plugins.bufferJson.stringify(objArg);
|
||||
objArg = JSON.parse(bufferedJson);
|
||||
return plugins.stableJson(objArg, optionsArg);
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,11 @@
|
||||
// third party scope
|
||||
import lodashCloneDeep from 'lodash.clonedeep';
|
||||
import stableJson2 from 'fast-json-stable-stringify';
|
||||
import bufferJson from 'buffer-json';
|
||||
|
||||
const stableJson = stableJson2 as any;
|
||||
|
||||
export { lodashCloneDeep, stableJson };
|
||||
export { bufferJson, lodashCloneDeep, stableJson };
|
||||
|
||||
export interface IStableJsonTypes {
|
||||
Comparator: (a: IStableJsonTypes['CompareDescriptor'], b: IStableJsonTypes['CompareDescriptor']) => number;
|
||||
|
Loading…
Reference in New Issue
Block a user