{"_id":"@sanity/json-match","_rev":"53-08b876d88c29bb6cfb2a25175faa021d","name":"@sanity/json-match","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"@sanity/json-match","version":"1.0.0","keywords":["JSONMatch","sanity","json-match","groq","mutations","patches"],"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","_id":"@sanity/json-match@1.0.0","maintainers":[{"name":"kmelve","email":"knut.melvaer@gmail.com"},{"name":"bjoerge","email":"bjoerge@gmail.com"},{"name":"rexxars","email":"espen@hovlandsdal.com"},{"name":"skogsmaskin","email":"per.kristian.nordnes@gmail.com"},{"name":"tonina","email":"zhelyazkova.tonina@gmail.com"},{"name":"mattcraig","email":"matt@sanity.io"},{"name":"joneidejohnsen","email":"jon@sanity.io"},{"name":"rubioz","email":"jarubc@gmail.com"},{"name":"robinpyon","email":"robin@robinpyon.com"},{"name":"mariuslundgard","email":"studio@mariuslundgard.com"},{"name":"sanity-io","email":"developers@sanity.io"},{"name":"evenw","email":"even@sanity.io"},{"name":"radhe_sanity","email":"radhe@sanity.io"},{"name":"rbotten","email":"rbotten@gmail.com"},{"name":"danielsgroves","email":"hello@danielgroves.net"},{"name":"judofyr","email":"judofyr@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"obliadp","email":"orjan@sanity.io"},{"name":"dcilke","email":"dain.cilke@gmail.com"},{"name":"madken","email":"kenneth.madsen@sanity.io"},{"name":"fredcarlsen","email":"fred@superbig.co"},{"name":"hermanw","email":"herman@sanity.io"},{"name":"tambet","email":"tambet.masik@gmail.com"},{"name":"sgulseth","email":"sgulseth@gmail.com"},{"name":"atombender","email":"npm@purefiction.net"},{"name":"simeonsanity","email":"simeon@sanity.io"},{"name":"stipsan","email":"stipsan@gmail.com"},{"name":"snorreeb","email":"snorre.e.brekke@gmail.com"},{"name":"rankers","email":"richardankers@gmail.com"},{"name":"rdunk","email":"rupert@rupertdunk.com"},{"name":"michael-sanity","email":"michael@sanity.io"},{"name":"vincentquigley","email":"vincent@sanity.io"},{"name":"ritasdias","email":"anarita151@gmail.com"},{"name":"kenjonespizza","email":"ken@sanity.io"},{"name":"rneatherway-sanity","email":"robin.neatherway@sanity.io"},{"name":"josh_sanity_io","email":"josh@sanity.io"},{"name":"cngonzalez-sanity","email":"carolina@sanity.io"},{"name":"jjburbridge","email":"jonathan.burbridge@sanity.io"},{"name":"tdfka_rick","email":"joshua.ellis18@gmail.com"},{"name":"svirs","email":"shur@sanity.io"},{"name":"ryanbonial-sanity","email":"ryan.bonial@sanity.io"},{"name":"indrek.karner","email":"indrek.karner@sanity.io"},{"name":"ash","email":"ashley@juice49.com"},{"name":"sergeisarviro","email":"sergei@sanity.io"},{"name":"refiito","email":"margus@sanity.io"},{"name":"drewsanity","email":"drew.lyton@sanity.io"},{"name":"kaspar.lippmaa.sanity","email":"kaspar.lippmaa@sanity.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"simen.svale","email":"simen@sanity.io"},{"name":"tbeseda","email":"tbeseda@gmail.com"},{"name":"daniel.malmer","email":"daniel.malmer@sanity.io"},{"name":"jordanl17","email":"jordanl17@me.com"},{"name":"colepeters","email":"cole@colepeters.com"},{"name":"armandocerna","email":"armando@cerna.ca"},{"name":"joan_miralles_paez","email":"joan.miralles@sanity.io"},{"name":"christianhg","email":"services@groengaard.dk"},{"name":"pedro-sanity","email":"pedro@sanity.io"},{"name":"jwoods-sanity","email":"james.woods@sanity.io"},{"name":"ricokahler","email":"ricokahler@me.com"},{"name":"tiit.kass.saity","email":"tiit.kass@sanity.io"},{"name":"binoy14","email":"me@binoy.io"},{"name":"pauloborgesf","email":"paulo@sanity.io"},{"name":"ausha","email":"ausha@sanity.io"},{"name":"chrislarocquesanity","email":"chris.larocque@sanity.io"},{"name":"rostimelk","email":"hello@rosti.no"},{"name":"mattlewine.sanity","email":"matt.lewine@sanity.io"},{"name":"msfragala","email":"ms.fragala@gmail.com"},{"name":"adoprog","email":"adoprog@gmail.com"},{"name":"tonysanity","email":"tony.lepmets@sanity.io"},{"name":"mrmrs","email":"hi@mrmrs.cc"},{"name":"betson","email":"ben.getson@gmail.com"},{"name":"georgedoescode","email":"georgedoescode@gmail.com"},{"name":"macdonst","email":"simon.macdonald@gmail.com"},{"name":"eoinsanity","email":"eoin.falconer@sanity.io"},{"name":"dashedstripes","email":"adamgrayscale@gmail.com"},{"name":"jmswrnr","email":"npm@jmswrnr.com"},{"name":"snocorp_sanity","email":"dave.sewell@sanity.io"},{"name":"mmgj","email":"controloptioncommand+npm@gmail.com"},{"name":"filmaj","email":"maj.fil@gmail.com"},{"name":"samhem","email":"sam.hemingway@sanity.io"},{"name":"gu-stav","email":"gu@stav.dev"},{"name":"patricksanity","email":"patrick.mccarthy@sanity.io"},{"name":"mads.mogenshoj","email":"mads.mogenshoj@sanity.io"},{"name":"sanitytom","email":"tom@sanity.io"},{"name":"sanity-cb","email":"charlie.brown@sanity.io"},{"name":"mm-sanity","email":"mark.michon@sanity.io"},{"name":"sanitykev","email":"kevin.green@sanity.io"},{"name":"victor.ayogu","email":"victor.ayogu@sanity.io"},{"name":"ryanbethel_sanity","email":"ryan.bethel@sanity.io"},{"name":"brianleroux","email":"b@brian.io"}],"homepage":"https://github.com/sanity-io/json-match#readme","bugs":{"url":"https://github.com/sanity-io/json-match/issues"},"dist":{"shasum":"a4d4a1b9f7de9bc9091c6614e1cd1fe1d4b84827","tarball":"https://registry.npmjs.org/@sanity/json-match/-/json-match-1.0.0.tgz","fileCount":16,"integrity":"sha512-mzywptRS6NFqys9v3s2UPbsC2cEm3MteGEJI552gnN0E9/B6U97bJSxkBuPkHPnKZ5rHJrgPTlYYm9CyEa27gg==","signatures":[{"sig":"MEQCIFuMFHWGHQJ+7Gg4pXpXoIR+FrIaYrf/1rbxI8uXnpcEAiBZLdxZE3YwJDEG9VFN/ehYgZYQ429lQ6pFIoG7CTYMsw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":192902},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.2"},"exports":{".":{"import":"./dist/index.js","source":"./src/index.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"9000249776ed2cf7798486676c18a64df02a0284","scripts":{"lint":"eslint .","test":"tsc && vitest --run --coverage","build":"pkg-utils build --strict --check --clean"},"_npmUser":{"name":"sanity-io","actor":{"name":"sanity-io","type":"user","email":"developers@sanity.io"},"email":"developers@sanity.io"},"prettier":"@sanity/prettier-config","repository":{"url":"git+https://github.com/sanity-io/json-match.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight and lazy implementation of JSONMatch made for JavaScript","directories":{},"sideEffects":false,"_nodeVersion":"22.16.0","browserslist":"extends @sanity/browserslist-config","_hasShrinkwrap":false,"packageManager":"pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531","devDependencies":{"eslint":"^9.29.0","vitest":"^3.2.4","typescript":"^5.3.3","semantic-release":"^24.2.5","@sanity/pkg-utils":"^7.8.4","typescript-eslint":"^8.34.1","@vitest/coverage-v8":"^3.2.4","eslint-plugin-tsdoc":"^0.4.0","eslint-config-prettier":"^10.1.5","eslint-plugin-import-x":"^4.15.2","eslint-plugin-prettier":"^5.5.0","@sanity/prettier-config":"^1.0.5","@sanity/browserslist-config":"^1.0.5","@sanity/semantic-release-preset":"^5.0.0","eslint-import-resolver-typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/json-match_1.0.0_1750801584282_0.010637815494732639","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@sanity/json-match","version":"1.0.2","keywords":["JSONMatch","sanity","json-match","groq","mutations","patches"],"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","_id":"@sanity/json-match@1.0.2","maintainers":[{"name":"kmelve","email":"knut.melvaer@gmail.com"},{"name":"bjoerge","email":"bjoerge@gmail.com"},{"name":"rexxars","email":"espen@hovlandsdal.com"},{"name":"skogsmaskin","email":"per.kristian.nordnes@gmail.com"},{"name":"tonina","email":"zhelyazkova.tonina@gmail.com"},{"name":"mattcraig","email":"matt@sanity.io"},{"name":"joneidejohnsen","email":"jon@sanity.io"},{"name":"rubioz","email":"jarubc@gmail.com"},{"name":"robinpyon","email":"robin@robinpyon.com"},{"name":"mariuslundgard","email":"studio@mariuslundgard.com"},{"name":"sanity-io","email":"developers@sanity.io"},{"name":"evenw","email":"even@sanity.io"},{"name":"radhe_sanity","email":"radhe@sanity.io"},{"name":"rbotten","email":"rbotten@gmail.com"},{"name":"danielsgroves","email":"hello@danielgroves.net"},{"name":"judofyr","email":"judofyr@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"obliadp","email":"orjan@sanity.io"},{"name":"dcilke","email":"dain.cilke@gmail.com"},{"name":"madken","email":"kenneth.madsen@sanity.io"},{"name":"fredcarlsen","email":"fred@superbig.co"},{"name":"hermanw","email":"herman@sanity.io"},{"name":"tambet","email":"tambet.masik@gmail.com"},{"name":"sgulseth","email":"sgulseth@gmail.com"},{"name":"atombender","email":"npm@purefiction.net"},{"name":"simeonsanity","email":"simeon@sanity.io"},{"name":"stipsan","email":"stipsan@gmail.com"},{"name":"snorreeb","email":"snorre.e.brekke@gmail.com"},{"name":"rankers","email":"richardankers@gmail.com"},{"name":"rdunk","email":"rupert@rupertdunk.com"},{"name":"michael-sanity","email":"michael@sanity.io"},{"name":"vincentquigley","email":"vincent@sanity.io"},{"name":"ritasdias","email":"anarita151@gmail.com"},{"name":"kenjonespizza","email":"ken@sanity.io"},{"name":"rneatherway-sanity","email":"robin.neatherway@sanity.io"},{"name":"josh_sanity_io","email":"josh@sanity.io"},{"name":"cngonzalez-sanity","email":"carolina@sanity.io"},{"name":"jjburbridge","email":"jonathan.burbridge@sanity.io"},{"name":"tdfka_rick","email":"joshua.ellis18@gmail.com"},{"name":"svirs","email":"shur@sanity.io"},{"name":"ryanbonial-sanity","email":"ryan.bonial@sanity.io"},{"name":"indrek.karner","email":"indrek.karner@sanity.io"},{"name":"ash","email":"ashley@juice49.com"},{"name":"sergeisarviro","email":"sergei@sanity.io"},{"name":"refiito","email":"margus@sanity.io"},{"name":"drewsanity","email":"drew.lyton@sanity.io"},{"name":"kaspar.lippmaa.sanity","email":"kaspar.lippmaa@sanity.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"simen.svale","email":"simen@sanity.io"},{"name":"tbeseda","email":"tbeseda@gmail.com"},{"name":"daniel.malmer","email":"daniel.malmer@sanity.io"},{"name":"jordanl17","email":"jordanl17@me.com"},{"name":"colepeters","email":"cole@colepeters.com"},{"name":"armandocerna","email":"armando@cerna.ca"},{"name":"joan_miralles_paez","email":"joan.miralles@sanity.io"},{"name":"christianhg","email":"services@groengaard.dk"},{"name":"pedro-sanity","email":"pedro@sanity.io"},{"name":"jwoods-sanity","email":"james.woods@sanity.io"},{"name":"ricokahler","email":"ricokahler@me.com"},{"name":"tiit.kass.saity","email":"tiit.kass@sanity.io"},{"name":"binoy14","email":"me@binoy.io"},{"name":"pauloborgesf","email":"paulo@sanity.io"},{"name":"ausha","email":"ausha@sanity.io"},{"name":"chrislarocquesanity","email":"chris.larocque@sanity.io"},{"name":"rostimelk","email":"hello@rosti.no"},{"name":"mattlewine.sanity","email":"matt.lewine@sanity.io"},{"name":"msfragala","email":"ms.fragala@gmail.com"},{"name":"adoprog","email":"adoprog@gmail.com"},{"name":"tonysanity","email":"tony.lepmets@sanity.io"},{"name":"mrmrs","email":"hi@mrmrs.cc"},{"name":"betson","email":"ben.getson@gmail.com"},{"name":"georgedoescode","email":"georgedoescode@gmail.com"},{"name":"macdonst","email":"simon.macdonald@gmail.com"},{"name":"eoinsanity","email":"eoin.falconer@sanity.io"},{"name":"dashedstripes","email":"adamgrayscale@gmail.com"},{"name":"jmswrnr","email":"npm@jmswrnr.com"},{"name":"snocorp_sanity","email":"dave.sewell@sanity.io"},{"name":"mmgj","email":"controloptioncommand+npm@gmail.com"},{"name":"filmaj","email":"maj.fil@gmail.com"},{"name":"samhem","email":"sam.hemingway@sanity.io"},{"name":"gu-stav","email":"gu@stav.dev"},{"name":"patricksanity","email":"patrick.mccarthy@sanity.io"},{"name":"mads.mogenshoj","email":"mads.mogenshoj@sanity.io"},{"name":"sanitytom","email":"tom@sanity.io"},{"name":"sanity-cb","email":"charlie.brown@sanity.io"},{"name":"mm-sanity","email":"mark.michon@sanity.io"},{"name":"sanitykev","email":"kevin.green@sanity.io"},{"name":"victor.ayogu","email":"victor.ayogu@sanity.io"},{"name":"ryanbethel_sanity","email":"ryan.bethel@sanity.io"},{"name":"brianleroux","email":"b@brian.io"}],"homepage":"https://github.com/sanity-io/json-match#readme","bugs":{"url":"https://github.com/sanity-io/json-match/issues"},"dist":{"shasum":"8327de8b1d65aaba329c60f5406e49ddbe11e010","tarball":"https://registry.npmjs.org/@sanity/json-match/-/json-match-1.0.2.tgz","fileCount":19,"integrity":"sha512-VbhpiezxpmI0TGygdpw3gl9Gt2m7fXSGM3IoHJPTNv5Jpvt7vqgXWMOtQInlnoN/o9u5G0qQ84KDSI7Q7BuTSg==","signatures":[{"sig":"MEUCIH3D9iLz38TfMITV1zUXRMefX3noxWXa8t9c4N1FG5oRAiEAoiKusJUhtmWsOKInztEaY39BAkFcS1aNC6x8mvbKFvo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":302836},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.2"},"exports":{".":{"import":"./dist/index.js","source":"./src/index.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"6225b2bd5aafbd910cf73399b8b1759443477c84","scripts":{"lint":"eslint .","test":"tsc && vitest --run --coverage","build":"pkg-utils build --strict --check --clean","install":"npm run build"},"_npmUser":{"name":"sanity-io","actor":{"name":"sanity-io","type":"user","email":"developers@sanity.io"},"email":"developers@sanity.io"},"prettier":"@sanity/prettier-config","repository":{"url":"git+https://github.com/sanity-io/json-match.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight and lazy implementation of JSONMatch made for JavaScript","directories":{},"sideEffects":false,"_nodeVersion":"22.16.0","browserslist":"extends @sanity/browserslist-config","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531","devDependencies":{"eslint":"^9.29.0","vitest":"^3.2.4","typescript":"^5.3.3","semantic-release":"^24.2.5","@sanity/pkg-utils":"^7.8.4","typescript-eslint":"^8.34.1","@vitest/coverage-v8":"^3.2.4","eslint-plugin-tsdoc":"^0.4.0","eslint-config-prettier":"^10.1.5","eslint-plugin-import-x":"^4.15.2","eslint-plugin-prettier":"^5.5.0","@sanity/prettier-config":"^1.0.5","@sanity/browserslist-config":"^1.0.5","@sanity/semantic-release-preset":"^5.0.0","eslint-import-resolver-typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/json-match_1.0.2_1750804247760_0.6780578477186772","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@sanity/json-match","version":"1.0.3","keywords":["JSONMatch","sanity","json-match","groq","mutations","patches"],"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","_id":"@sanity/json-match@1.0.3","maintainers":[{"name":"kmelve","email":"knut.melvaer@gmail.com"},{"name":"bjoerge","email":"bjoerge@gmail.com"},{"name":"rexxars","email":"espen@hovlandsdal.com"},{"name":"skogsmaskin","email":"per.kristian.nordnes@gmail.com"},{"name":"tonina","email":"zhelyazkova.tonina@gmail.com"},{"name":"mattcraig","email":"matt@sanity.io"},{"name":"joneidejohnsen","email":"jon@sanity.io"},{"name":"rubioz","email":"jarubc@gmail.com"},{"name":"robinpyon","email":"robin@robinpyon.com"},{"name":"mariuslundgard","email":"studio@mariuslundgard.com"},{"name":"sanity-io","email":"developers@sanity.io"},{"name":"evenw","email":"even@sanity.io"},{"name":"radhe_sanity","email":"radhe@sanity.io"},{"name":"rbotten","email":"rbotten@gmail.com"},{"name":"danielsgroves","email":"hello@danielgroves.net"},{"name":"judofyr","email":"judofyr@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"obliadp","email":"orjan@sanity.io"},{"name":"dcilke","email":"dain.cilke@gmail.com"},{"name":"madken","email":"kenneth.madsen@sanity.io"},{"name":"fredcarlsen","email":"fred@superbig.co"},{"name":"hermanw","email":"herman@sanity.io"},{"name":"tambet","email":"tambet.masik@gmail.com"},{"name":"sgulseth","email":"sgulseth@gmail.com"},{"name":"atombender","email":"npm@purefiction.net"},{"name":"simeonsanity","email":"simeon@sanity.io"},{"name":"stipsan","email":"stipsan@gmail.com"},{"name":"snorreeb","email":"snorre.e.brekke@gmail.com"},{"name":"rankers","email":"richardankers@gmail.com"},{"name":"rdunk","email":"rupert@rupertdunk.com"},{"name":"michael-sanity","email":"michael@sanity.io"},{"name":"vincentquigley","email":"vincent@sanity.io"},{"name":"ritasdias","email":"anarita151@gmail.com"},{"name":"kenjonespizza","email":"ken@sanity.io"},{"name":"josh_sanity_io","email":"josh@sanity.io"},{"name":"cngonzalez-sanity","email":"carolina@sanity.io"},{"name":"jjburbridge","email":"jonathan.burbridge@sanity.io"},{"name":"tdfka_rick","email":"joshua.ellis18@gmail.com"},{"name":"svirs","email":"shur@sanity.io"},{"name":"ryanbonial-sanity","email":"ryan.bonial@sanity.io"},{"name":"indrek.karner","email":"indrek.karner@sanity.io"},{"name":"ash","email":"ashley@juice49.com"},{"name":"sergeisarviro","email":"sergei@sanity.io"},{"name":"refiito","email":"margus@sanity.io"},{"name":"drewsanity","email":"drew.lyton@sanity.io"},{"name":"kaspar.lippmaa.sanity","email":"kaspar.lippmaa@sanity.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"simen.svale","email":"simen@sanity.io"},{"name":"tbeseda","email":"tbeseda@gmail.com"},{"name":"daniel.malmer","email":"daniel.malmer@sanity.io"},{"name":"jordanl17","email":"jordanl17@me.com"},{"name":"colepeters","email":"cole@colepeters.com"},{"name":"armandocerna","email":"armando@cerna.ca"},{"name":"joan_miralles_paez","email":"joan.miralles@sanity.io"},{"name":"christianhg","email":"services@groengaard.dk"},{"name":"pedro-sanity","email":"pedro@sanity.io"},{"name":"jwoods-sanity","email":"james.woods@sanity.io"},{"name":"ricokahler","email":"ricokahler@me.com"},{"name":"tiit.kass.saity","email":"tiit.kass@sanity.io"},{"name":"binoy14","email":"me@binoy.io"},{"name":"pauloborgesf","email":"paulo@sanity.io"},{"name":"ausha","email":"ausha@sanity.io"},{"name":"chrislarocquesanity","email":"chris.larocque@sanity.io"},{"name":"rostimelk","email":"hello@rosti.no"},{"name":"mattlewine.sanity","email":"matt.lewine@sanity.io"},{"name":"msfragala","email":"ms.fragala@gmail.com"},{"name":"adoprog","email":"adoprog@gmail.com"},{"name":"tonysanity","email":"tony.lepmets@sanity.io"},{"name":"mrmrs","email":"hi@mrmrs.cc"},{"name":"betson","email":"ben.getson@gmail.com"},{"name":"georgedoescode","email":"georgedoescode@gmail.com"},{"name":"macdonst","email":"simon.macdonald@gmail.com"},{"name":"eoinsanity","email":"eoin.falconer@sanity.io"},{"name":"dashedstripes","email":"adamgrayscale@gmail.com"},{"name":"jmswrnr","email":"npm@jmswrnr.com"},{"name":"snocorp_sanity","email":"dave.sewell@sanity.io"},{"name":"mmgj","email":"controloptioncommand+npm@gmail.com"},{"name":"filmaj","email":"maj.fil@gmail.com"},{"name":"samhem","email":"sam.hemingway@sanity.io"},{"name":"gu-stav","email":"gu@stav.dev"},{"name":"patricksanity","email":"patrick.mccarthy@sanity.io"},{"name":"mads.mogenshoj","email":"mads.mogenshoj@sanity.io"},{"name":"sanitytom","email":"tom@sanity.io"},{"name":"sanity-cb","email":"charlie.brown@sanity.io"},{"name":"mm-sanity","email":"mark.michon@sanity.io"},{"name":"sanitykev","email":"kevin.green@sanity.io"},{"name":"victor.ayogu","email":"victor.ayogu@sanity.io"},{"name":"ryanbethel_sanity","email":"ryan.bethel@sanity.io"},{"name":"brianleroux","email":"b@brian.io"}],"homepage":"https://github.com/sanity-io/json-match#readme","bugs":{"url":"https://github.com/sanity-io/json-match/issues"},"dist":{"shasum":"4c3e5442914865e85280a18b497d44d5a25c439a","tarball":"https://registry.npmjs.org/@sanity/json-match/-/json-match-1.0.3.tgz","fileCount":19,"integrity":"sha512-aXqUUUg49XSz3aqmVGRZ34G7Y14Ccrea1HHef8/9BsNyECYubecnS5XmkDWgtK2wdQSoB1S+EXpzTWlAx4H27Q==","signatures":[{"sig":"MEUCIGsI8LNtsZ4GvetqYiOA4XFJugXUJJhJ/3Ii3nDapqI6AiEAy19+PLI8fhh7LM2NODqUfy+ZFxzkEXGZ6tSmE6nIB0Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":307434},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.2"},"exports":{".":{"import":"./dist/index.js","source":"./src/index.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"422882b7b0c98f02af0d9dee4057d30f5e35b104","scripts":{"lint":"eslint .","test":"tsc && vitest --run --coverage","build":"pkg-utils build --strict --check --clean","install":"npm run build"},"_npmUser":{"name":"sanity-io","actor":{"name":"sanity-io","type":"user","email":"developers@sanity.io"},"email":"developers@sanity.io"},"prettier":"@sanity/prettier-config","repository":{"url":"git+https://github.com/sanity-io/json-match.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight and lazy implementation of JSONMatch made for JavaScript","directories":{},"sideEffects":false,"_nodeVersion":"22.16.0","browserslist":"extends @sanity/browserslist-config","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531","devDependencies":{"eslint":"^9.29.0","vitest":"^3.2.4","typescript":"^5.3.3","semantic-release":"^24.2.5","@sanity/pkg-utils":"^7.8.4","typescript-eslint":"^8.34.1","@vitest/coverage-v8":"^3.2.4","eslint-plugin-tsdoc":"^0.4.0","eslint-config-prettier":"^10.1.5","eslint-plugin-import-x":"^4.15.2","eslint-plugin-prettier":"^5.5.0","@sanity/prettier-config":"^1.0.5","@sanity/browserslist-config":"^1.0.5","@sanity/semantic-release-preset":"^5.0.0","eslint-import-resolver-typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/json-match_1.0.3_1751256315252_0.3521922954569765","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@sanity/json-match","version":"1.0.4","keywords":["JSONMatch","sanity","json-match","groq","mutations","patches"],"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","_id":"@sanity/json-match@1.0.4","maintainers":[{"name":"kmelve","email":"knut.melvaer@gmail.com"},{"name":"bjoerge","email":"bjoerge@gmail.com"},{"name":"rexxars","email":"espen@hovlandsdal.com"},{"name":"skogsmaskin","email":"per.kristian.nordnes@gmail.com"},{"name":"tonina","email":"zhelyazkova.tonina@gmail.com"},{"name":"mattcraig","email":"matt@sanity.io"},{"name":"joneidejohnsen","email":"jon@sanity.io"},{"name":"rubioz","email":"jarubc@gmail.com"},{"name":"robinpyon","email":"robin@robinpyon.com"},{"name":"mariuslundgard","email":"studio@mariuslundgard.com"},{"name":"sanity-io","email":"developers@sanity.io"},{"name":"evenw","email":"even@sanity.io"},{"name":"radhe_sanity","email":"radhe@sanity.io"},{"name":"rbotten","email":"rbotten@gmail.com"},{"name":"danielsgroves","email":"hello@danielgroves.net"},{"name":"judofyr","email":"judofyr@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"obliadp","email":"orjan@sanity.io"},{"name":"dcilke","email":"dain.cilke@gmail.com"},{"name":"madken","email":"kenneth.madsen@sanity.io"},{"name":"fredcarlsen","email":"fred@superbig.co"},{"name":"hermanw","email":"herman@sanity.io"},{"name":"tambet","email":"tambet.masik@gmail.com"},{"name":"sgulseth","email":"sgulseth@gmail.com"},{"name":"atombender","email":"npm@purefiction.net"},{"name":"simeonsanity","email":"simeon@sanity.io"},{"name":"stipsan","email":"stipsan@gmail.com"},{"name":"snorreeb","email":"snorre.e.brekke@gmail.com"},{"name":"rankers","email":"richardankers@gmail.com"},{"name":"rdunk","email":"rupert@rupertdunk.com"},{"name":"michael-sanity","email":"michael@sanity.io"},{"name":"vincentquigley","email":"vincent@sanity.io"},{"name":"ritasdias","email":"anarita151@gmail.com"},{"name":"kenjonespizza","email":"ken@sanity.io"},{"name":"josh_sanity_io","email":"josh@sanity.io"},{"name":"cngonzalez-sanity","email":"carolina@sanity.io"},{"name":"jjburbridge","email":"jonathan.burbridge@sanity.io"},{"name":"tdfka_rick","email":"joshua.ellis18@gmail.com"},{"name":"svirs","email":"shur@sanity.io"},{"name":"ryanbonial-sanity","email":"ryan.bonial@sanity.io"},{"name":"indrek.karner","email":"indrek.karner@sanity.io"},{"name":"ash","email":"ashley@juice49.com"},{"name":"sergeisarviro","email":"sergei@sanity.io"},{"name":"refiito","email":"margus@sanity.io"},{"name":"drewsanity","email":"drew.lyton@sanity.io"},{"name":"kaspar.lippmaa.sanity","email":"kaspar.lippmaa@sanity.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"simen.svale","email":"simen@sanity.io"},{"name":"tbeseda","email":"tbeseda@gmail.com"},{"name":"daniel.malmer","email":"daniel.malmer@sanity.io"},{"name":"jordanl17","email":"jordanl17@me.com"},{"name":"colepeters","email":"cole@colepeters.com"},{"name":"armandocerna","email":"armando@cerna.ca"},{"name":"joan_miralles_paez","email":"joan.miralles@sanity.io"},{"name":"christianhg","email":"services@groengaard.dk"},{"name":"pedro-sanity","email":"pedro@sanity.io"},{"name":"jwoods-sanity","email":"james.woods@sanity.io"},{"name":"ricokahler","email":"ricokahler@me.com"},{"name":"tiit.kass.saity","email":"tiit.kass@sanity.io"},{"name":"binoy14","email":"me@binoy.io"},{"name":"pauloborgesf","email":"paulo@sanity.io"},{"name":"ausha","email":"ausha@sanity.io"},{"name":"chrislarocquesanity","email":"chris.larocque@sanity.io"},{"name":"rostimelk","email":"hello@rosti.no"},{"name":"mattlewine.sanity","email":"matt.lewine@sanity.io"},{"name":"msfragala","email":"ms.fragala@gmail.com"},{"name":"adoprog","email":"adoprog@gmail.com"},{"name":"tonysanity","email":"tony.lepmets@sanity.io"},{"name":"mrmrs","email":"hi@mrmrs.cc"},{"name":"betson","email":"ben.getson@gmail.com"},{"name":"georgedoescode","email":"georgedoescode@gmail.com"},{"name":"macdonst","email":"simon.macdonald@gmail.com"},{"name":"eoinsanity","email":"eoin.falconer@sanity.io"},{"name":"dashedstripes","email":"adamgrayscale@gmail.com"},{"name":"jmswrnr","email":"npm@jmswrnr.com"},{"name":"snocorp_sanity","email":"dave.sewell@sanity.io"},{"name":"mmgj","email":"controloptioncommand+npm@gmail.com"},{"name":"filmaj","email":"maj.fil@gmail.com"},{"name":"samhem","email":"sam.hemingway@sanity.io"},{"name":"gu-stav","email":"gu@stav.dev"},{"name":"patricksanity","email":"patrick.mccarthy@sanity.io"},{"name":"mads.mogenshoj","email":"mads.mogenshoj@sanity.io"},{"name":"sanitytom","email":"tom@sanity.io"},{"name":"sanity-cb","email":"charlie.brown@sanity.io"},{"name":"mm-sanity","email":"mark.michon@sanity.io"},{"name":"sanitykev","email":"kevin.green@sanity.io"},{"name":"victor.ayogu","email":"victor.ayogu@sanity.io"},{"name":"ryanbethel_sanity","email":"ryan.bethel@sanity.io"},{"name":"brianleroux","email":"b@brian.io"}],"homepage":"https://github.com/sanity-io/json-match#readme","bugs":{"url":"https://github.com/sanity-io/json-match/issues"},"dist":{"shasum":"4b76f75f626a4996fbecedc2f67d2f9a0b29c4c3","tarball":"https://registry.npmjs.org/@sanity/json-match/-/json-match-1.0.4.tgz","fileCount":19,"integrity":"sha512-g3ZdL95V1fnd99sFrauejX0Lkn/POEknvJOtBaC7adurs62Fnb/WyMkRaR4y01LYmsfrwioO0Mqmj0zbummInQ==","signatures":[{"sig":"MEQCIG25FMYVcYupQQALJwPi+YEjjHvtd+O68xHAhtQSnCsnAiAdZZCkD28+GuHz3Os2TUxDYGOuAvq7EPojWbRdcf8D0Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":307441},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.2"},"exports":{".":{"import":"./dist/index.js","source":"./src/index.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"b14352ad2ebe5c537aaa1e24644d40b911cd0960","scripts":{"lint":"eslint .","test":"tsc && vitest --run --coverage","build":"pkg-utils build --strict --check --clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"sanity-io","actor":{"name":"sanity-io","type":"user","email":"developers@sanity.io"},"email":"developers@sanity.io"},"prettier":"@sanity/prettier-config","repository":{"url":"git+https://github.com/sanity-io/json-match.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight and lazy implementation of JSONMatch made for JavaScript","directories":{},"sideEffects":false,"_nodeVersion":"22.16.0","browserslist":"extends @sanity/browserslist-config","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531","devDependencies":{"eslint":"^9.29.0","vitest":"^3.2.4","typescript":"^5.3.3","semantic-release":"^24.2.5","@sanity/pkg-utils":"^7.8.4","typescript-eslint":"^8.34.1","@vitest/coverage-v8":"^3.2.4","eslint-plugin-tsdoc":"^0.4.0","eslint-config-prettier":"^10.1.5","eslint-plugin-import-x":"^4.15.2","eslint-plugin-prettier":"^5.5.0","@sanity/prettier-config":"^1.0.5","@sanity/browserslist-config":"^1.0.5","@sanity/semantic-release-preset":"^5.0.0","eslint-import-resolver-typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/json-match_1.0.4_1751289990688_0.6122196207043","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@sanity/json-match","version":"1.0.5","keywords":["JSONMatch","sanity","json-match","groq","mutations","patches"],"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","_id":"@sanity/json-match@1.0.5","maintainers":[{"name":"kmelve","email":"knut.melvaer@gmail.com"},{"name":"bjoerge","email":"bjoerge@gmail.com"},{"name":"rexxars","email":"espen@hovlandsdal.com"},{"name":"skogsmaskin","email":"per.kristian.nordnes@gmail.com"},{"name":"tonina","email":"zhelyazkova.tonina@gmail.com"},{"name":"mattcraig","email":"matt@sanity.io"},{"name":"joneidejohnsen","email":"jon@sanity.io"},{"name":"rubioz","email":"jarubc@gmail.com"},{"name":"robinpyon","email":"robin@robinpyon.com"},{"name":"mariuslundgard","email":"studio@mariuslundgard.com"},{"name":"sanity-io","email":"developers@sanity.io"},{"name":"evenw","email":"even@sanity.io"},{"name":"radhe_sanity","email":"radhe@sanity.io"},{"name":"rbotten","email":"rbotten@gmail.com"},{"name":"danielsgroves","email":"hello@danielgroves.net"},{"name":"judofyr","email":"judofyr@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"obliadp","email":"orjan@sanity.io"},{"name":"dcilke","email":"dain.cilke@gmail.com"},{"name":"madken","email":"kenneth.madsen@sanity.io"},{"name":"fredcarlsen","email":"fred@superbig.co"},{"name":"hermanw","email":"herman@sanity.io"},{"name":"tambet","email":"tambet.masik@gmail.com"},{"name":"sgulseth","email":"sgulseth@gmail.com"},{"name":"atombender","email":"npm@purefiction.net"},{"name":"simeonsanity","email":"simeon@sanity.io"},{"name":"stipsan","email":"stipsan@gmail.com"},{"name":"snorreeb","email":"snorre.e.brekke@gmail.com"},{"name":"rankers","email":"richardankers@gmail.com"},{"name":"rdunk","email":"rupert@rupertdunk.com"},{"name":"michael-sanity","email":"michael@sanity.io"},{"name":"vincentquigley","email":"vincent@sanity.io"},{"name":"ritasdias","email":"anarita151@gmail.com"},{"name":"kenjonespizza","email":"ken@sanity.io"},{"name":"josh_sanity_io","email":"josh@sanity.io"},{"name":"cngonzalez-sanity","email":"carolina@sanity.io"},{"name":"jjburbridge","email":"jonathan.burbridge@sanity.io"},{"name":"tdfka_rick","email":"joshua.ellis18@gmail.com"},{"name":"svirs","email":"shur@sanity.io"},{"name":"ryanbonial-sanity","email":"ryan.bonial@sanity.io"},{"name":"indrek.karner","email":"indrek.karner@sanity.io"},{"name":"ash","email":"ashley@juice49.com"},{"name":"sergeisarviro","email":"sergei@sanity.io"},{"name":"refiito","email":"margus@sanity.io"},{"name":"drewsanity","email":"drew.lyton@sanity.io"},{"name":"kaspar.lippmaa.sanity","email":"kaspar.lippmaa@sanity.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"simen.svale","email":"simen@sanity.io"},{"name":"tbeseda","email":"tbeseda@gmail.com"},{"name":"daniel.malmer","email":"daniel.malmer@sanity.io"},{"name":"jordanl17","email":"jordanl17@me.com"},{"name":"colepeters","email":"cole@colepeters.com"},{"name":"armandocerna","email":"armando@cerna.ca"},{"name":"joan_miralles_paez","email":"joan.miralles@sanity.io"},{"name":"christianhg","email":"services@groengaard.dk"},{"name":"pedro-sanity","email":"pedro@sanity.io"},{"name":"jwoods-sanity","email":"james.woods@sanity.io"},{"name":"ricokahler","email":"ricokahler@me.com"},{"name":"tiit.kass.saity","email":"tiit.kass@sanity.io"},{"name":"binoy14","email":"me@binoy.io"},{"name":"pauloborgesf","email":"paulo@sanity.io"},{"name":"ausha","email":"ausha@sanity.io"},{"name":"chrislarocquesanity","email":"chris.larocque@sanity.io"},{"name":"rostimelk","email":"hello@rosti.no"},{"name":"mattlewine.sanity","email":"matt.lewine@sanity.io"},{"name":"msfragala","email":"ms.fragala@gmail.com"},{"name":"adoprog","email":"adoprog@gmail.com"},{"name":"tonysanity","email":"tony.lepmets@sanity.io"},{"name":"mrmrs","email":"hi@mrmrs.cc"},{"name":"betson","email":"ben.getson@gmail.com"},{"name":"georgedoescode","email":"georgedoescode@gmail.com"},{"name":"macdonst","email":"simon.macdonald@gmail.com"},{"name":"eoinsanity","email":"eoin.falconer@sanity.io"},{"name":"dashedstripes","email":"adamgrayscale@gmail.com"},{"name":"jmswrnr","email":"npm@jmswrnr.com"},{"name":"snocorp_sanity","email":"dave.sewell@sanity.io"},{"name":"mmgj","email":"controloptioncommand+npm@gmail.com"},{"name":"filmaj","email":"maj.fil@gmail.com"},{"name":"samhem","email":"sam.hemingway@sanity.io"},{"name":"gu-stav","email":"gu@stav.dev"},{"name":"patricksanity","email":"patrick.mccarthy@sanity.io"},{"name":"mads.mogenshoj","email":"mads.mogenshoj@sanity.io"},{"name":"sanitytom","email":"tom@sanity.io"},{"name":"sanity-cb","email":"charlie.brown@sanity.io"},{"name":"mm-sanity","email":"mark.michon@sanity.io"},{"name":"sanitykev","email":"kevin.green@sanity.io"},{"name":"victor.ayogu","email":"victor.ayogu@sanity.io"},{"name":"ryanbethel_sanity","email":"ryan.bethel@sanity.io"},{"name":"brianleroux","email":"b@brian.io"}],"homepage":"https://github.com/sanity-io/json-match#readme","bugs":{"url":"https://github.com/sanity-io/json-match/issues"},"dist":{"shasum":"fcaa1a05f5b77e47437fdb00db7a63c072c92e9f","tarball":"https://registry.npmjs.org/@sanity/json-match/-/json-match-1.0.5.tgz","fileCount":19,"integrity":"sha512-skhIX8gT/hLritEBkjfc7+TBlJNu/NLisyA8noKceCk28OatFK0wX7dIuFawkt3pfhTYVomVPykAYFcIm2OqJg==","signatures":[{"sig":"MEQCIFJTs08l4Xao8w8NN957NN7jaA6KbM8chztLB9n3dIxjAiBYOw2muVpMAwNBBxFVLerpANL8oiPEJWdjAIQyJ3f6aw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":307846},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.2"},"exports":{".":{"import":"./dist/index.js","source":"./src/index.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"8666c0aafda8f4273209791812ab0b57f654673a","scripts":{"lint":"eslint .","test":"tsc && vitest --run --coverage","build":"pkg-utils build --strict --check --clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"sanity-io","actor":{"name":"sanity-io","type":"user","email":"developers@sanity.io"},"email":"developers@sanity.io"},"prettier":"@sanity/prettier-config","repository":{"url":"git+https://github.com/sanity-io/json-match.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight and lazy implementation of JSONMatch made for JavaScript","directories":{},"sideEffects":false,"_nodeVersion":"22.16.0","browserslist":"extends @sanity/browserslist-config","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531","devDependencies":{"eslint":"^9.29.0","vitest":"^3.2.4","typescript":"^5.3.3","semantic-release":"^24.2.5","@sanity/pkg-utils":"^7.8.4","typescript-eslint":"^8.34.1","@vitest/coverage-v8":"^3.2.4","eslint-plugin-tsdoc":"^0.4.0","eslint-config-prettier":"^10.1.5","eslint-plugin-import-x":"^4.15.2","eslint-plugin-prettier":"^5.5.0","@sanity/prettier-config":"^1.0.5","@sanity/browserslist-config":"^1.0.5","@sanity/semantic-release-preset":"^5.0.0","eslint-import-resolver-typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/json-match_1.0.5_1751312573290_0.49071118995351215","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-06-24T21:46:24.281Z","modified":"2026-04-08T15:23:38.686Z","1.0.0":"2025-06-24T21:46:24.482Z","1.0.2":"2025-06-24T22:30:47.958Z","1.0.3":"2025-06-30T04:05:15.477Z","1.0.4":"2025-06-30T13:26:30.915Z","1.0.5":"2025-06-30T19:42:53.487Z"},"bugs":{"url":"https://github.com/sanity-io/json-match/issues"},"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","homepage":"https://github.com/sanity-io/json-match#readme","keywords":["JSONMatch","sanity","json-match","groq","mutations","patches"],"repository":{"url":"git+https://github.com/sanity-io/json-match.git","type":"git"},"description":"A lightweight and lazy implementation of JSONMatch made for JavaScript","maintainers":[{"email":"svc.npm@sanity.io","name":"sanity-svc.npm"},{"email":"developers@sanity.io","name":"sanity-io"}],"readme":"# @sanity/json-match\n\n[![npm version](https://img.shields.io/npm/v/@sanity/json-match.svg)](https://www.npmjs.com/package/@sanity/json-match) [![bundle size](https://deno.bundlejs.com/?q=@sanity/json-match&badge)](https://bundlejs.com/?q=@sanity/json-match) [![github status checks](https://badgen.net/github/checks/sanity-io/json-match)](https://github.com/sanity-io/json-match/actions) [![npm weekly downloads](https://img.shields.io/npm/dw/@sanity/json-match.svg)](https://www.npmjs.com/package/@sanity/json-match) [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)\n\n> A modern, lightweight implementation of the [JSONMatch](https://www.sanity.io/docs/content-lake/json-match) path expression language made for low-level use in other libraries such as the Sanity App SDK.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Core Concepts](#core-concepts)\n  - [What is JSONMatch?](#what-is-jsonmatch)\n  - [Lazy evaluation](#lazy-evaluation)\n  - [Handling undefined values](#handling-undefined-values)\n  - [Special `_key` handling](#special-_key-handling)\n  - [Path manipulation](#path-manipulation)\n- [JSONMatch Language Reference](#jsonmatch-language-reference)\n- [API Reference](#api-reference)\n  - [`jsonMatch(value, path, basePath?)`](#jsonmatchvalue-path-basepath)\n  - [`stringifyPath(path)`](#stringifypathpath)\n  - [`getIndexForKey(array, key)`](#getindexforkeyarray-key)\n  - [`getPathDepth(path)`](#getpathdepthpath)\n  - [`joinPaths(base, path)`](#joinpathsbase-path)\n  - [`parsePath(input)`](#parsepathinput)\n  - [`slicePath(path, start?, end?)`](#slicepathpath-start-end)\n- [LICENSE](#license)\n\n## Installation\n\n```bash\nnpm install @sanity/json-match\n```\n\n## Core Concepts\n\n### What is JSONMatch?\n\n[JSONMatch](https://www.sanity.io/docs/content-lake/json-match) is a query language designed to select one or more sub-values within a JSON document.\n\nHere's a quick example:\n\n```typescript\nimport {jsonMatch} from '@sanity/json-match'\n\nconst data = {\n  users: [\n    {name: 'Alice', _key: 'alice', age: 25, active: true},\n    {name: 'Bob', _key: 'bob', age: 30, active: false},\n    {name: 'Carol', _key: 'carol', age: 35, active: true},\n  ],\n}\n\n// 1. Write a path expression\nconst expression = 'users[active == true]'\n\n// 2. Evaluate expression against a value\nconst matches = jsonMatch(data, expression)\n\n// `jsonMatch` returns a generator of matches\nfor (const match of matches) {\n  console.log('Matched Value:', match.value)\n  console.log('Path to Value:', match.path)\n}\n\n// Output:\n//\n// Matched Value: {name: 'Alice', _key: 'alice', age: 25, active: true}\n// Path to Value: ['users', {_key: 'alice'}]\n//\n// Matched Value: {name: 'Carol', _key: 'carol', age: 35, active: true}\n// Path to Value: ['users', {_key: 'carol'}]\n```\n\nTo use JSONMatch you:\n\n1. **Write a path expression** (e.g. `users[active == true]`) that describes where to search (e.g. `users`) and what constraints must be satisfied (e.g. `[active == true]`). To use a path expression, you…\n2. **Evaluate it against a JSON value**. The evaluator then searches the document and returns all the matches that satisfy your expression.\n\nFor each match found, you get back a `MatchEntry` object:\n\n````ts\n// This object is yielded from `jsonMatch`\nexport interface MatchEntry {\n  /**\n   * The subvalue found within the given JSON value. This is\n   * referentially equal to the nested value in the JSON object.\n   */\n  value: unknown\n  /**\n   * An array of keys and indices representing the location of the value within\n   * the original value. Note that the evaluator will only yield paths that\n   * address a single value.\n   *\n   * ```ts\n   * const path: Path = ['users', 0, 'profile', { _key: 'email' }]\n   * // Represents: users[0].profile[_key==\"email\"]\n   * ```\n   */\n  path: SingleValuePath\n}\n\nexport type IndexTuple = [number | '', number | ''] // array slice e.g. [1:3]\nexport type KeyedSegment = {_key: string} // key constraint e.g. [_key==\"val\"]\n\nexport type PathSegment = string | number | KeyedSegment | IndexTuple\nexport type Path = PathSegment[]\n\n// `SingleValuePath`s don't include the index tuple since that can map to many values\nexport type SingleValuePath = Exclude<PathSegment, IndexTuple>[]\n\n// the `jsonMatch` function returns a Generator of `MatchEntry`\nexport function jsonMatch(value, pathExpr): Generator<MatchEntry>\n````\n\n> [!TIP]\n> The `Path` format is a common representation in many other Sanity libraries making it easy to integrate with other Sanity tools.\n>\n> This path type can be turned back into a string with [`stringifyPath`](#stringifypathpath) if desired. See the [path manipulation](#path-manipulation) section for more path utilities.\n\n### Lazy evaluation\n\nThe `jsonMatch` function is **lazy**, meaning it returns a [generator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator) that yields matches one by one, only when you ask for them. It doesn't compute all possible matches upfront.\n\nThis design offers a significant performance advantage, especially when you're working with large datasets and only need the first few matches. For example, if you're looking for the first active item in an array of thousands of elements, `jsonMatch` will stop searching as soon as it finds it.\n\n```javascript\nimport {jsonMatch} from '@sanity/json-match'\n\n// A large array where the match is halfway through\nconst data = {\n  items: Array.from({length: 1000}, (_, i) => ({\n    id: i,\n    active: i === 500, // Only item at index 500 is active\n  })),\n}\n\n// Find the first active item\nconst generator = jsonMatch(data, 'items[active == true]')\n\n// .next().value gets the first match without iterating the whole array\nconst firstMatch = generator.next().value\n\nconsole.log('Found:', firstMatch.value)\n// Found: { id: 500, active: true }\n```\n\nThis makes the library suitable for performance-critical tasks where you need to find a single value quickly.\n\n### Handling undefined values\n\n`jsonMatch` yields matches for paths that resolve to `undefined` values, even when traversing through invalid intermediate values. This **exhaustive path traversal** behavior is designed to support both **reading** and **writing** operations in the Sanity ecosystem.\n\n```javascript\nimport {jsonMatch} from '@sanity/json-match'\n\nconst data = {\n  user: {\n    name: 'Alice',\n    // Note: no 'email' property\n  },\n  posts: [\n    {title: 'First Post'},\n    // Note: no second post at index 1\n  ],\n  version: '1.0.0', // This is a string, not an object\n}\n\n// Accessing non-existent properties yields undefined with the path\nconst emailMatches = Array.from(jsonMatch(data, 'user.email'))\nconsole.log(emailMatches)\n// [{ value: undefined, path: ['user', 'email'] }]\n\n// Accessing out-of-bounds array indices also yields undefined\nconst missingPostMatches = Array.from(jsonMatch(data, 'posts[1].title'))\nconsole.log(missingPostMatches)\n// [{ value: undefined, path: ['posts', 1, 'title'] }]\n\n// Even traversing through non-objects continues until path is exhausted\nconst invalidTraversal = Array.from(jsonMatch(data, 'version.major.patch'))\nconsole.log(invalidTraversal)\n// [{ value: undefined, path: ['version', 'major', 'patch'] }]\n// Note: continues evaluating even though 'version' is a string\n\n// Arrays with mixed types yield undefined for non-objects\nconst mixedArray = {\n  items: ['string', {name: 'Alice'}, null, 42],\n}\nconst mixedResults = Array.from(jsonMatch(mixedArray, 'items.name'))\nconsole.log(mixedResults)\n// [\n//   { value: undefined, path: ['items', 0, 'name'] },  // string has no 'name'\n//   { value: 'Alice', path: ['items', 1, 'name'] },    // object has 'name'\n//   { value: undefined, path: ['items', 2, 'name'] },  // null has no 'name'\n//   { value: undefined, path: ['items', 3, 'name'] }   // number has no 'name'\n// ]\n\n// This allows downstream systems to know where values can be set\nconst pathsForSetting = Array.from(jsonMatch(data, 'user.profile.settings.theme')).map(\n  (m) => m.path,\n)\nconsole.log(pathsForSetting)\n// [['user', 'profile', 'settings', 'theme']] - full path even if intermediate values don't exist!\n```\n\n**Why this matters:**\n\n- **For reading**: You can distinguish between non-existent paths and paths that exist but contain `undefined`\n- **For writing**: You get the exact path information needed to set values at locations that don't currently exist, even through multiple levels of missing intermediate values\n- **For consistency**: The same path expression works for both reading existing values and determining where new values can be written\n- **For completeness**: Arrays with mixed types (objects, primitives, null) yield results for all elements, with `undefined` for non-objects\n\n**How exhaustive traversal works:**\n\n1. **Property access** (`obj.prop`): Always yields a result, even if `obj` is not an object\n2. **Array indexing** (`arr[0]`): Always yields a result, even if `arr` is not an array or index is out of bounds\n3. **Deep paths** (`a.b.c.d`): Continues evaluating the entire path even if intermediate segments are invalid\n4. **Array iteration** (`arr.prop`): Applies property access to every array element, yielding `undefined` for non-objects\n\n> [!NOTE]  \n> This exhaustive behavior only applies to property access and array indexing. Constraint-based filtering (like `[active == true]`) will still skip items that don't match the constraint, and existence checks (like `[email?]`) will not match `undefined` values.\n\n### Special `_key` handling\n\nIn Sanity documents, it's good practice to add a unique `_key` property to objects inside an array. This gives each object a stable identifier that doesn't change even if the array is reordered.\n\n`jsonMatch` has special first-class support for `_key`s to improve both path resilience and performance.\n\n1. When a matched object has a `_key`, the returned path will use the key instead of the array index. This creates a path that remains valid even if other items are added, removed, or reordered.\n2. When you filter an array by `_key` (e.g., `items[_key == \"b\"]`), this library creates and caches a lookup of indexes so subsequent evaluations of the same path expression will be cheap. See [`getIndexForKey`](#getindexforkeyarray-key) for more info.\n\n> [!WARNING]\n> For these optimizations to work reliably, **`_key` values are assumed to be unique within any given array.** If an array contains objects with duplicate `_key`s, the behavior is undefined, as the evaluator will typically match only the first object it finds.\n\n### Path manipulation\n\nThis library ships with some helper functions to help modify and normalize paths. These utilities allow you to programmatically construct, deconstruct, and analyze paths in a consistent way, regardless of their original format (string, array, or AST).\n\nHere are a few common use cases:\n\n```ts\nimport {joinPaths, slicePath, getPathDepth, stringifyPath, type Path} from '@sanity/json-match'\n\n// Path utilities work with path strings...\nconst originalPath = 'users[0].posts[_key==\"abc\"].title'\nconst parentFromString = slicePath(originalPath, 0, -1)\n// -> users[0].posts[_key==\"abc\"]\n\n// ...and Path arrays.\nconst originalPathArray: Path = ['users', 0, 'posts', {_key: 'abc'}, 'title']\nconst parentFromArray = slicePath(originalPathArray, 0, -1)\n// -> users[0].posts[_key==\"abc\"]\n\n// `joinPaths` also accepts both formats.\nconst newPath = joinPaths(parentFromArray, 'lastModified')\n// -> users[0].posts[_key==\"abc\"].lastModified\n\n// You can convert a Path array to its string equivalent with `stringifyPath`.\nconst pathString = stringifyPath(originalPathArray)\n// -> users[0].posts[_key==\"abc\"].title\nconsole.log(pathString === originalPath) // true\n\n// Get the depth (number of segments) of a path.\nconst depth = getPathDepth(originalPath)\n// -> 5\n```\n\n## JSONMatch Language Reference\n\nSee our [official documentation for JSONMatch](https://www.sanity.io/docs/content-lake/json-match).\n\n```javascript\nimport {jsonMatch} from '@sanity/json-match'\n\n// In this reference we will use the following example JSON object to extract data from:\nconst data = {\n  name: 'fred',\n  friends: [\n    {name: 'mork', age: 40, favoriteColor: 'red'},\n    {name: 'mindy', age: 32, favoriteColor: 'blue'},\n    {name: 'franklin', favoriteColor: 'yellow'},\n    {name: 'bob', favoriteColor: 'green'},\n    {name: 'alice', favoriteColor: 'blue'},\n  ],\n  roles: ['admin', 'owner'],\n  contactInfo: {\n    streetAddress: '42 Mountain Road',\n    state: {\n      shortName: 'WY',\n      longName: 'Wyoming',\n    },\n  },\n}\n\nfunction evaluate(expression) {\n  const matches = jsonMatch(data, expression)\n  const values = Array.from(matches).map((match) => match.value)\n  console.log(values)\n}\n\n// Given the example document, these expressions can be evaluated\nevaluate('name') // [ 'fred' ]\nevaluate('friends[*].name') // [ 'mork', 'mindy', 'franklin', 'bob', 'alice' ]\nevaluate('friends[age > 35].name') // [ 'mork' ]\nevaluate('friends[age > 30, favoriteColor == \"blue\"].name') // [ 'mork', 'mindy', 'alice' ]\nevaluate('friends[age?].age') // [ 40, 32 ]\nevaluate('friends[0].name') // [ 'mork' ]\nevaluate('friends[1:3].name') // [ 'mindy', 'franklin' ]\nevaluate('friends[0, 2:3].name') // [ 'mork', 'franklin' ]\nevaluate('contactInfo.state.shortName') // [ 'WY' ]\nevaluate('contactInfo.state[shortName, longName]') // [ 'WY', 'Wyoming' ]\nevaluate('friends.age[@ > 35]') // [ 40 ]\nevaluate('roles') // [ [ 'admin', 'owner' ] ]\nevaluate('roles[*]') // [ 'admin', 'owner' ]\nevaluate('roles[0]') // [ 'admin' ]\nevaluate('roles[-1]') // [ 'owner' ]\nevaluate('contactInfo..shortName') // [ 'WY' ]\nevaluate('[contactInfo.state.shortName, roles]') // [ 'WY', [ 'admin', 'owner' ] ]\n```\n\n<details>\n\n<summary>Full EBNF Grammar</summary>\n\n```ebnf\nExpression ::=\n  | String // literal\n  | Number // literal\n  | Boolean // literal\n  | Null // literal\n  | Path\n\n\nPath ::=\n  | '.' Path    // implicit 'this' descent\n  | '..' Path   // implicit 'this' recursive descent\n  | PathSegment\n  | PathSegment '.' Path\n  | PathSegment '..' Path\n\nPathSegment ::=\n  | This\n  | Identifier\n  | Wildcard\n  | Subscript\n\nSubscript ::=\n  | '[' SubscriptContent ']'\n\nSubscriptContent ::=\n  | SubscriptElement\n  | SubscriptElement ',' SubscriptContent\n\nSubscriptElement ::=\n  | Slice\n  | Existence\n  | Comparison\n  | Expression\n\nSlice ::=\n  | Number ':' Number\n  | Number ':'\n  | ':' Number\n  | ':'\n\nExistence ::=\n  | Path '?'\n\nComparison ::=\n  | Expression ComparisonOperator Expression\n\nComparisonOperator ::=\n  | '=='\n  | '!='\n  | '<'\n  | '<='\n  | '>'\n  | '>='\n\nThis ::=\n  | '@'\n  | '$'\n\nIdentifier ::=\n  | UnquotedIdentifier\n  | QuotedIdentifier\n\nWildcard ::=\n  | '*'\n\nNumber ::=\n  | '-'? [0-9]+ ('.' [0-9]+)?\n\nBoolean ::=\n  | 'true'\n  | 'false'\n\nNull ::=\n  | 'null'\n\nString ::=\n  | '\"' StringContent '\"'\n\nStringContent ::=\n  | (EscapeSequence | [^\"\\\\])*\n\nEscapeSequence ::=\n  | '\\\\' ['\"\\\\\\/bfnrt]\n  | '\\\\u' HexDigit HexDigit HexDigit HexDigit\n\nHexDigit ::=\n  | [0-9a-fA-F]\n\nUnquotedIdentifier ::=\n  | [a-zA-Z_$][a-zA-Z0-9_$]*\n\nQuotedIdentifier ::=\n  | \"'\" QuotedIdentifierContent \"'\"\n\nQuotedIdentifierContent ::=\n  | (EscapeSequence | [^'\\\\])*\n```\n\n</details>\n\n## API Reference\n\n### `jsonMatch(value, path, basePath?)`\n\nThe main function for evaluating JSONMatch expressions.\n\n```javascript\nimport {jsonMatch} from '@sanity/json-match'\n\nconst data = {users: [{name: 'Alice', age: 25}]}\n\n// Basic usage\nconst matches = Array.from(jsonMatch(data, 'users[*].name'))\n\n// With base path (useful for nested evaluation)\nconst nestedMatches = Array.from(jsonMatch(data.users, '[*].name', ['users']))\n```\n\n### `stringifyPath(path)`\n\nConvert various path formats to their string representation.\n\nThis function can handle JSONMatch AST nodes, Path arrays, and string expressions.\nIt's useful for normalizing different path formats into a consistent string format.\n\n```javascript\nimport {parsePath, stringifyPath} from '@sanity/json-match'\n\n// Convert AST back to string\nconst ast = parsePath('users[age > 21].name')\nconst str = stringifyPath(ast) // \"users[age>21].name\"\n\n// Convert Path array to string\nconst pathArr = ['users', 0, {_key: 'profile'}, 'email']\nconst pathStr = stringifyPath(pathArr) // \"users[0][_key==\\\"profile\\\"].email\"\n\n// String expressions are returned unchanged\nconst existing = 'items[*].name'\nconst result = stringifyPath(existing) // \"items[*].name\" (same string)\n\n// Useful for normalizing expressions\nconst normalized = stringifyPath(parsePath('  users  [  age  >  21  ] . name  '))\nconsole.log(normalized) // \"users[age>21].name\"\n```\n\n### `getIndexForKey(array, key)`\n\nEfficiently find the array index for objects with `_key` properties (Sanity's keyed arrays).\n\n```javascript\nimport {getIndexForKey} from '@sanity/json-match'\n\nconst keyedArray = [\n  {_key: 'item1', name: 'First'},\n  {_key: 'item2', name: 'Second'},\n  {_key: 'item3', name: 'Third'},\n]\n\nconst index = getIndexForKey(keyedArray, 'item2') // 1\nconsole.log(keyedArray[index]) // { _key: 'item2', name: 'Second' }\n\n// Performance: First call builds cache, subsequent calls are O(1)\nconst index2 = getIndexForKey(keyedArray, 'item3') // Fast lookup\n```\n\n### `getPathDepth(path)`\n\nCalculates the number of segments in a path.\n\n```javascript\nimport {getPathDepth} from '@sanity/json-match'\n\ngetPathDepth('user.profile.email') // 3\ngetPathDepth('items[0].name') // 3\ngetPathDepth(['users', {_key: 'alice'}]) // 2\n```\n\n### `joinPaths(base, path)`\n\nJoins two path segments into a single path string.\n\n```javascript\nimport {joinPaths} from '@sanity/json-match'\n\n// Adding properties\njoinPaths('user', 'profile') // 'user.profile'\n\n// Chaining operations\nlet path = 'data'\npath = joinPaths(path, 'users') // 'data.users'\npath = joinPaths(path, '[0]') // 'data.users[0]'\n```\n\n### `parsePath(input)`\n\nParse various path formats into a standardized AST.\n\n```javascript\nimport {parsePath} from '@sanity/json-match'\n\n// String expressions\nparsePath('user.profile.email')\n\n// Path arrays\nparsePath(['users', 0, {_key: 'profile'}, 'email'])\n\n// Already parsed AST (returns unchanged)\nconst ast = parsePath('items[*]')\nparsePath(ast) === ast // true\n```\n\n### `slicePath(path, start?, end?)`\n\nExtracts a section of a path, similar to `Array.prototype.slice`.\n\n```javascript\nimport {slicePath} from '@sanity/json-match'\n\nslicePath('a.b.c.d.e', 1, 4) // 'b.c.d'\n\n// Get parent path\nslicePath('user.profile.email', 0, -1) // 'user.profile'\n\n// Get last segment\nslicePath('items[0].name', -1) // 'name'\n```\n\n## LICENSE\n\nMIT License - see [LICENSE](./LICENSE) file for details.\n","readmeFilename":"README.md"}