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