fix(core): update
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user