Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tsmx/json-traverse

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsmx/json-traverse - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

4

package.json
{
"name": "@tsmx/json-traverse",
"version": "1.0.5",
"version": "1.0.6",
"description": "Traverse and manipulate JSON objects.",

@@ -31,4 +31,4 @@ "main": "json-traverse.js",

"devDependencies": {
"jest": "^26.4.2"
"jest": "^29.2.2"
}
}

@@ -6,3 +6,3 @@ # [**@tsmx/json-traverse**](https://github.com/tsmx/json-traverse)

![node-current (scoped)](https://img.shields.io/node/v/@tsmx/json-traverse)
[![Build Status](https://img.shields.io/github/workflow/status/tsmx/json-traverse/git-ci-build)](https://img.shields.io/github/workflow/status/tsmx/json-traverse/git-ci-build)
[![Build Status](https://img.shields.io/github/actions/workflow/status/tsmx/json-traverse/git-build.yml?branch=master)](https://img.shields.io/github/actions/workflow/status/tsmx/json-traverse/git-build.yml?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/tsmx/json-traverse/badge.svg?branch=master)](https://coveralls.io/github/tsmx/json-traverse?branch=master)

@@ -9,0 +9,0 @@

@@ -56,3 +56,3 @@ describe('json-traverse test suite', () => {

it('tests a manipulation of plain properties and array entries', async (done) => {
it('tests a manipulation of plain properties and array entries', async () => {
callbacksChangeValue = {

@@ -79,6 +79,5 @@ processValue: (key, value, level, path, isObjectRoot, isArrayElement, cbSetValue) => {

expect(simpleTestObj.MyArray[5]).toBe(7000);
done();
});
it('tests a full traversal of a complex JSON object', async (done) => {
it('tests a full traversal of a complex JSON object', async () => {
callbacks = {

@@ -130,6 +129,5 @@ processValue: (key, value, level, path, isObjectRoot, isArrayElement) => {

expect(testOutput[36]).toBe('Leaving level 0...');
done();
});
it('tests a conversion to a HTML list of a complex JSON object', async (done) => {
it('tests a conversion to a HTML list of a complex JSON object', async () => {
callbacksHtml = {

@@ -172,6 +170,5 @@ processValue: (key, value, level, path, isObjectRoot, isArrayElement) => {

expect(testOutput[15]).toBe('</ul>');
done();
});
it('tests a traversal with no callbacks for a simple object - nothing should happen', async (done) => {
it('tests a traversal with no callbacks for a simple object - nothing should happen', async () => {
const before = JSON.stringify(simpleTestObj);

@@ -182,6 +179,5 @@ jt.traverse(simpleTestObj);

expect(testOutput.length).toBe(0);
done();
});
it('tests a traversal with no callbacks for a complex object - nothing should happen', async (done) => {
it('tests a traversal with no callbacks for a complex object - nothing should happen', async () => {
const before = JSON.stringify(complexTestObj);

@@ -192,6 +188,5 @@ jt.traverse(complexTestObj);

expect(testOutput.length).toBe(0);
done();
});
it('tests a manipulation of nested object in an array', async (done) => {
it('tests a manipulation of nested object in an array', async () => {
callbacksChangeValue = {

@@ -207,6 +202,5 @@ processValue: (key, value, level, path, isObjectRoot, isArrayElement, cbSetValue) => {

expect(complexTestObj.parent.array[4]['array-sub-key']).toBe('ttt');
done();
});
it('tests a complete exchange of nested object in an array', async (done) => {
it('tests a complete exchange of nested object in an array', async () => {
callbacksChangeValue = {

@@ -222,6 +216,5 @@ processValue: (key, value, level, path, isObjectRoot, isArrayElement, cbSetValue) => {

expect(JSON.stringify(complexTestObj.parent.array[4])).toBe(JSON.stringify({ objname: 'new-object' }));
done();
});
it('tests a complete exchange of nested object', async (done) => {
it('tests a complete exchange of nested object', async () => {
callbacksChangeValue = {

@@ -237,5 +230,4 @@ processValue: (key, value, level, path, isObjectRoot, isArrayElement, cbSetValue) => {

expect(JSON.stringify(complexTestObj.parent.child)).toBe(JSON.stringify({ objname: 'new-object' }));
done();
});
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc