New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sanity-diff-patch

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sanity-diff-patch - npm Package Compare versions

Comparing version 3.0.3 to 3.0.4

6

dist/index.js
import { makeDiff, cleanupEfficiency, stringifyPatches, makePatches } from '@sanity/diff-match-patch';
const IS_DOTTABLE_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
function pathToString(path) {

@@ -12,5 +13,6 @@ return path.reduce((target, segment, i) => {

return "".concat(target, "[").concat(segment, "]");
} else if (typeof segment === "string" && (/^\d+$/.test(segment) || segment.includes("-"))) {
return "".concat(target, "[\"").concat(segment, "\"]");
}
if (typeof segment === "string" && !IS_DOTTABLE_RE.test(segment)) {
return "".concat(target, "['").concat(segment, "']");
}
if (typeof segment === "string") {

@@ -17,0 +19,0 @@ const separator = i === 0 ? "" : ".";

{
"name": "sanity-diff-patch",
"version": "3.0.3",
"version": "3.0.4",
"description": "Generates a set of Sanity patches needed to change an item (usually a document) from one shape to another",

@@ -5,0 +5,0 @@ "sideEffects": false,

import type {KeyedSanityObject} from './diffPatch.js'
const IS_DOTTABLE_RE = /^[A-Za-z_][A-Za-z0-9_]*$/
/**

@@ -40,6 +42,8 @@ * A segment of a path

return `${target}[${segment}]`
} else if (typeof segment === 'string' && (/^\d+$/.test(segment) || segment.includes('-'))) {
return `${target}["${segment}"]`
}
if (typeof segment === 'string' && !IS_DOTTABLE_RE.test(segment)) {
return `${target}['${segment}']`
}
if (typeof segment === 'string') {

@@ -46,0 +50,0 @@ const separator = i === 0 ? '' : '.'

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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