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

@sanity/mutator

Package Overview
Dependencies
Maintainers
59
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 3.57.2-canary.16 to 3.57.2-manifests.67

1

lib/index.d.ts

@@ -100,2 +100,3 @@ import {CreateIfNotExistsMutation} from '@sanity/types'

_updatedAt?: string
_createdAt?: string
[attribute: string]: unknown

@@ -102,0 +103,0 @@ }

8

package.json
{
"name": "@sanity/mutator",
"version": "3.57.2-canary.16+5cb335b1a2",
"version": "3.57.2-manifests.67+0246fa6e86",
"description": "A set of models to make it easier to utilize the powerful real time collaborative features of Sanity",

@@ -53,3 +53,3 @@ "keywords": [

"@sanity/diff-match-patch": "^3.1.1",
"@sanity/types": "3.57.2-canary.16+5cb335b1a2",
"@sanity/types": "3.57.2-manifests.67+0246fa6e86",
"@sanity/uuid": "^3.0.1",

@@ -61,3 +61,3 @@ "debug": "^4.3.4",

"@jest/globals": "^29.7.0",
"@repo/package.config": "3.57.1",
"@repo/package.config": "3.57.4",
"@types/debug": "^4.1.5",

@@ -67,3 +67,3 @@ "@types/lodash": "^4.17.7",

},
"gitHead": "5cb335b1a2dcdf5cc967e88e22d2e8c082bb9c2e"
"gitHead": "0246fa6e86d13669d16c487d1667baf36981ed98"
}

@@ -109,6 +109,10 @@ import {Patcher} from '../patch'

// creation requires a _createdAt
const getGuaranteedCreatedAt = (doc: Doc): string =>
doc?._createdAt || this.params.timestamp || new Date().toISOString()
this.mutations.forEach((mutation) => {
if (mutation.create) {
// TODO: Fail entire patch if document did exist
const create = mutation.create || {}
const create = (mutation.create || {}) as Doc
operations.push((doc): Doc => {

@@ -119,4 +123,4 @@ if (doc) {

return Object.assign(create as Doc, {
_createdAt: create._createdAt || this.params.timestamp,
return Object.assign(create, {
_createdAt: getGuaranteedCreatedAt(create),
})

@@ -132,3 +136,3 @@ })

? Object.assign(createIfNotExists, {
_createdAt: createIfNotExists._createdAt || this.params.timestamp,
_createdAt: getGuaranteedCreatedAt(createIfNotExists),
})

@@ -144,3 +148,3 @@ : doc,

Object.assign(createOrReplace, {
_createdAt: createOrReplace._createdAt || this.params.timestamp,
_createdAt: getGuaranteedCreatedAt(createOrReplace),
}),

@@ -147,0 +151,0 @@ )

@@ -19,2 +19,3 @@ import {

_updatedAt?: string
_createdAt?: string
[attribute: string]: unknown

@@ -21,0 +22,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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