fix(core): update

This commit is contained in:
Philipp Kunz 2024-03-19 13:30:15 +01:00
parent 8937dfb553
commit d1d679ac34
2 changed files with 14 additions and 1 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartjson',
version: '5.0.14',
version: '5.0.15',
description: 'typed json handlers'
}

View File

@ -1,5 +1,6 @@
import * as plugins from './smartjson.plugins.js';
import * as bufferhandling from './bufferhandling.js';
import { json } from 'stream/consumers';
/**
* allows you to parse a json
@ -114,3 +115,15 @@ export const deepEqualObjects = (object1: any, object2: any): boolean => {
const object2String = stringify(object2);
return object1String === object2String;
};
export const deepEqualJsonLStrings = (jsonLString1: string, jsonLString2: string): boolean => {
const firstArray = [];
jsonLString1.split('\n').forEach((line) => {
firstArray.push(parse(line));
});
const secondArray = [];
jsonLString2.split('\n').forEach((line) => {
secondArray.push(parse(line));
});
return deepEqualObjects(firstArray, secondArray);
}