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

@sanity/mutator

Package Overview
Dependencies
Maintainers
56
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.3 to 3.57.4-memoized-form-state.18

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 @@ }

6

package.json
{
"name": "@sanity/mutator",
"version": "3.57.3",
"version": "3.57.4-memoized-form-state.18+199df15e4c",
"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.3",
"@sanity/types": "3.57.4-memoized-form-state.18+199df15e4c",
"@sanity/uuid": "^3.0.1",

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

},
"gitHead": "9be6707fde0096e0afb5f7363b20cd7b90ee84e7"
"gitHead": "199df15e4c7b3887daa1f3a122a44cbd1e4e6fc2"
}

@@ -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