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

dot-wild

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot-wild - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

5

CHANGELOG.md

@@ -0,1 +1,6 @@

## v2.2.2 (2017-06-09)
* Bug fix in `v2.2.1`...
## v2.2.1 (2017-06-09)

@@ -2,0 +7,0 @@

7

lib/index.js

@@ -229,3 +229,8 @@ "use strict";

if (i === tokens.length - 1) {
_data = simpleRemove(_data, token);
if (isArray(_data)) {
_data.splice(parseInt(token, 10), 1);
}
else {
delete _data[token];
}
return false;

@@ -232,0 +237,0 @@ }

2

package.json
{
"name": "dot-wild",
"version": "2.2.1",
"version": "2.2.2",
"description": "Use powerful dot notation (dot path + wildcard) to manipulate properties of JSON",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -228,3 +228,3 @@ import * as assert from 'power-assert';

it('remove()', () => {
it.only('remove()', () => {
const t1 = { foo: { bar: 'baz' } };

@@ -323,3 +323,3 @@ const assertT1 = () => {

const values = [
let values: any = [
1,

@@ -335,2 +335,77 @@ 2,

assert(result.length === 0);
values = [
{ nest: [1, 2, 3] },
{ nest: [1, 2, 3] },
{ nest: [1, 2, 3] },
];
result = dot.remove(values, '0.nest.0');
assert.deepStrictEqual(result, [
{ nest: [2, 3] },
{ nest: [1, 2, 3] },
{ nest: [1, 2, 3] },
]);
assert(result[0].nest.length === 2);
values = [
[
[1, 2, 3],
[1, 2, 3],
[1, 2, 3],
],
[
[1, 2, 3],
[1, 2, 3],
[1, 2, 3],
],
];
result = dot.remove(values, '*.0');
assert.deepStrictEqual(result, [
[
[1, 2, 3],
[1, 2, 3],
],
[
[1, 2, 3],
[1, 2, 3],
],
]);
assert(result[0].length === 2);
assert(result[1].length === 2);
result = dot.remove(values, '*.*.2');
assert.deepStrictEqual(result, [
[
[1, 2],
[1, 2],
[1, 2],
],
[
[1, 2],
[1, 2],
[1, 2],
],
]);
assert(result[0][0].length === 2);
assert(result[0][1].length === 2);
assert(result[0][2].length === 2);
assert(result[1][0].length === 2);
assert(result[1][1].length === 2);
assert(result[1][2].length === 2);
result = dot.remove(values, '*.*.3');
assert.deepStrictEqual(result, [
[
[1, 2, 3],
[1, 2, 3],
[1, 2, 3],
],
[
[1, 2, 3],
[1, 2, 3],
[1, 2, 3],
],
]);
});

@@ -337,0 +412,0 @@

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