Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
969b892ed8 | |||
d1d679ac34 | |||
8937dfb553 | |||
09d45b1f45 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartjson",
|
"name": "@push.rocks/smartjson",
|
||||||
"version": "5.0.13",
|
"version": "5.0.15",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "typed json handlers",
|
"description": "typed json handlers",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartjson',
|
name: '@push.rocks/smartjson',
|
||||||
version: '5.0.13',
|
version: '5.0.15',
|
||||||
description: 'typed json handlers'
|
description: 'typed json handlers'
|
||||||
}
|
}
|
||||||
|
13
ts/index.ts
13
ts/index.ts
@ -1,5 +1,6 @@
|
|||||||
import * as plugins from './smartjson.plugins.js';
|
import * as plugins from './smartjson.plugins.js';
|
||||||
import * as bufferhandling from './bufferhandling.js';
|
import * as bufferhandling from './bufferhandling.js';
|
||||||
|
import { json } from 'stream/consumers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* allows you to parse a json
|
* allows you to parse a json
|
||||||
@ -114,3 +115,15 @@ export const deepEqualObjects = (object1: any, object2: any): boolean => {
|
|||||||
const object2String = stringify(object2);
|
const object2String = stringify(object2);
|
||||||
return object1String === object2String;
|
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);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user