Socket
Socket
Sign inDemoInstall

@sanity/mutator

Package Overview
Dependencies
Maintainers
7
Versions
1328
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.103.9 to 0.103.12

18

lib/document/Document.js

@@ -161,10 +161,12 @@ 'use strict';

if (this.HEAD) {
var updatedAt = new Date(this.HEAD._updatedAt);
if (this.incoming.find(function (mut) {
return mut.timestamp && mut.timestamp < updatedAt;
})) {
this.incoming = this.incoming.filter(function (mut) {
return mut.timestamp < updatedAt;
});
}
(function () {
var updatedAt = new Date(_this2.HEAD._updatedAt);
if (_this2.incoming.find(function (mut) {
return mut.timestamp && mut.timestamp < updatedAt;
})) {
_this2.incoming = _this2.incoming.filter(function (mut) {
return mut.timestamp < updatedAt;
});
}
})();
}

@@ -171,0 +173,0 @@

@@ -76,6 +76,8 @@ 'use strict';

} else if (mutation.patch) {
var patch = new _patch.Patcher(mutation.patch);
operations.push(function (doc) {
return patch.apply(doc);
});
(function () {
var patch = new _patch.Patcher(mutation.patch);
operations.push(function (doc) {
return patch.apply(doc);
});
})();
} else {

@@ -82,0 +84,0 @@ throw new Error('Unsupported mutation ' + JSON.stringify(mutation, null, 2));

@@ -157,10 +157,12 @@ 'use strict';

if (descender.tail) {
// Not arrived yet
var matcher = new Matcher(descender.descend(), _this2);
descender.head.toFieldReferences().forEach(function (field) {
leads.push({
target: descender.head,
matcher: matcher
(function () {
// Not arrived yet
var matcher = new Matcher(descender.descend(), _this2);
descender.head.toFieldReferences().forEach(function (field) {
leads.push({
target: descender.head,
matcher: matcher
});
});
});
})();
} else {

@@ -174,20 +176,22 @@ // arrived

if (this.hasRecursives()) {
// The recustives matcher will have no active set, only inherit recursives from this
var recursivesMatcher = new Matcher([], this);
if (probe.containerType() == 'array') {
var length = probe.length();
for (var i = 0; i < length; i++) {
leads.push({
target: _Expression2.default.indexReference(i),
matcher: recursivesMatcher
(function () {
// The recustives matcher will have no active set, only inherit recursives from this
var recursivesMatcher = new Matcher([], _this2);
if (probe.containerType() == 'array') {
var length = probe.length();
for (var i = 0; i < length; i++) {
leads.push({
target: _Expression2.default.indexReference(i),
matcher: recursivesMatcher
});
}
} else if (probe.containerType() == 'object') {
probe.attributeKeys().forEach(function (name) {
leads.push({
target: _Expression2.default.attributeReference(name),
matcher: recursivesMatcher
});
});
}
} else if (probe.containerType() == 'object') {
probe.attributeKeys().forEach(function (name) {
leads.push({
target: _Expression2.default.attributeReference(name),
matcher: recursivesMatcher
});
});
}
})();
}

@@ -194,0 +198,0 @@

@@ -7,2 +7,4 @@ 'use strict';

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

@@ -138,26 +140,34 @@

value: function tokenizeQuoted() {
var _this3 = this;
var quote = this.peek();
if (quote == "'" || quote == '"') {
this.consume(quote);
var _escape = false;
var inner = this.takeWhile(function (char) {
if (_escape) {
_escape = false;
return char;
}
if (char == '\\') {
_escape = true;
return '';
}
if (char != quote) {
return char;
}
return null;
});
this.consume(quote);
return {
type: 'quoted',
value: inner,
quote: quote == '"' ? 'double' : 'single'
};
var _ret2 = function () {
_this3.consume(quote);
var escape = false;
var inner = _this3.takeWhile(function (char) {
if (escape) {
escape = false;
return char;
}
if (char == '\\') {
escape = true;
return '';
}
if (char != quote) {
return char;
}
return null;
});
_this3.consume(quote);
return {
v: {
type: 'quoted',
value: inner,
quote: quote == '"' ? 'double' : 'single'
}
};
}();
if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v;
}

@@ -218,3 +228,3 @@ return null;

value: function tokenizeSymbol() {
var _this3 = this;
var _this4 = this;

@@ -225,3 +235,3 @@ var result = null;

var found = patterns.find(function (pattern) {
return _this3.tryConsume(pattern);
return _this4.tryConsume(pattern);
});

@@ -228,0 +238,0 @@ if (found) {

{
"name": "@sanity/mutator",
"version": "0.103.9",
"version": "0.103.12",
"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",

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