fix(core): update

This commit is contained in:
2020-10-03 11:20:58 +00:00
parent 9bc1c4bf93
commit ee025d094c
5 changed files with 9634 additions and 927 deletions

View File

@ -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);
}

View File

@ -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;