fix(core): update
This commit is contained in:
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smartjson',
|
||||
version: '4.0.7',
|
||||
description: 'typed json handlers'
|
||||
}
|
15
ts/index.ts
15
ts/index.ts
@ -1,4 +1,4 @@
|
||||
import * as plugins from './smartjson.plugins';
|
||||
import * as plugins from './smartjson.plugins.js';
|
||||
|
||||
/**
|
||||
* allows you to parse a json
|
||||
@ -10,10 +10,15 @@ export const parse = plugins.bufferJson.parse;
|
||||
* @param objArg
|
||||
* @param optionsArg
|
||||
*/
|
||||
export const stringify = (objArg: any, optionsArg: plugins.IStableJsonTypes['Options'] = {}): string => {
|
||||
export const stringify = (
|
||||
objArg: any,
|
||||
simpleOrderArray?: string[],
|
||||
optionsArg: plugins.IStableJsonTypes['Options'] = {}
|
||||
): string => {
|
||||
const bufferedJson = plugins.bufferJson.stringify(objArg);
|
||||
objArg = JSON.parse(bufferedJson);
|
||||
return plugins.stableJson(objArg, optionsArg);
|
||||
let returnJson = plugins.stableJson(objArg, optionsArg);
|
||||
return returnJson;
|
||||
};
|
||||
|
||||
export class Smartjson {
|
||||
@ -69,7 +74,7 @@ export class Smartjson {
|
||||
*/
|
||||
public foldToJson() {
|
||||
const foldedObject = this.foldToObject();
|
||||
return stringify(foldedObject, {});
|
||||
return stringify(foldedObject);
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,4 +94,4 @@ export const deepEqualObjects = (object1: any, object2: any): boolean => {
|
||||
const object1String = stringify(object1);
|
||||
const object2String = stringify(object2);
|
||||
return object1String === object2String;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user