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

@sanity/mutator

Package Overview
Dependencies
Maintainers
7
Versions
1361
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/mutator - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

.vscode/launch.json

20

lib/jsonpath/Descender.js

@@ -96,18 +96,8 @@ 'use strict';

var length = probe.length();
if (head.constraintTargetIsSelf()) {
for (var i = 0; i < length; i++) {
// Push new descenders with constraint translated to literal indices
// where they match
if (head.testConstraint(probe.getIndex(i))) {
result.push(new Descender(new _Expression2.default({ type: 'index', value: i }), this.tail));
}
for (var i = 0; i < length; i++) {
// Push new descenders with constraint translated to literal indices
// where they match
if (head.testConstraint(probe.getIndex(i))) {
result.push(new Descender(new _Expression2.default({ type: 'index', value: i }), this.tail));
}
} else {
// The target of the constraint is really the values of the descendants
// Push the constraint back onto the tail
var newTail = head.concat(this.tail);
// Then make descenders for all indices
for (var _i = 0; _i < length; _i++) {
result.push(new Descender(new _Expression2.default({ type: 'index', value: _i }), newTail));
}
}

@@ -114,0 +104,0 @@ return result;

{
"name": "@sanity/mutator",
"version": "0.1.3",
"version": "0.1.4",
"description": "A set of models to make it easier to utilize the powerful real time collaborative features of Sanity",

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

@@ -72,22 +72,9 @@ // @flow

const length = probe.length()
if (head.constraintTargetIsSelf()) {
for (let i = 0; i < length; i++) {
// Push new descenders with constraint translated to literal indices
// where they match
if (head.testConstraint(probe.getIndex(i))) {
result.push(new Descender(
new Expression({type: 'index', value: i}),
this.tail
))
}
}
} else {
// The target of the constraint is really the values of the descendants
// Push the constraint back onto the tail
const newTail = head.concat(this.tail)
// Then make descenders for all indices
for (let i = 0; i < length; i++) {
result.push(new Descender(
for (let i = 0; i < length; i++) {
// Push new descenders with constraint translated to literal indices
// where they match
if (head.testConstraint(probe.getIndex(i))) {
result.push(new Descender(
new Expression({type: 'index', value: i}),
newTail
this.tail
))

@@ -94,0 +81,0 @@ }

@@ -28,4 +28,3 @@ import { test } from 'tap'

expectDescendants(tap, iterated, [
'<[0]|[a == 7][b,c].d>',
'<[1]|[a == 7][b,c].d>',
'<[1]|[b,c].d>'
])

@@ -32,0 +31,0 @@ tap.end()

@@ -122,3 +122,15 @@ /* eslint-disable id-length, quote-props */

{
name: 'By key',
before: {
a: [{key: 'one'}, {key: 'two'}],
},
patch: {
unset: ['a[key=="one"]']
},
after: {
a: [{key: 'two'}],
}
}
]
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