obby
Version:
Manipulate, clone, merge, and compare Javascript objects with ease.
2 lines (1 loc) • 1.21 kB
JavaScript
import m from"fast-copy";import*as u from"wild-wild-path";export*from"emptier";import{emptyDeep as E}from"empty-deep";import{deepEqual as l}from"fast-equals";import*as i from"wild-wild-utils";import{deepmerge as z}from"deepmerge-ts";import*as a from"wild-wild-parser";const y=m,o={inherited:!0,mutate:!0,classes:!0};function g(t,e,r){return u.has(t,e,{...o,...r})}function f(t,e,r){return u.get(t,e,{...o,...r})}function w(t,e,r){return u.list(t,e,{...o,...r})}function s(t,e,r,n){return u.set(t,e,r,{...o,...n})}function c(t,e,r){return u.remove(t,e,{...o,...r})}function h(t,e,r,n){s(r,n??e,f(t,e))}const d=l;function v(t,e="*",r){return i.flatten(i.pick(t,e,{classes:!0,entries:!0,leaves:!0,...r}))}function x(t,e){const r={};for(const[n,p]of Object.entries(t))s(r,n,p,e);return r}const k=(t,e,r,n)=>{s(r,n??e,f(t,e)),c(t,e)};function q(t){if(typeof t=="string")try{return!!a.parseQuery(t)}catch{return!1}return!1}function O(t){if(typeof t=="string")try{return!!a.parsePath(t)}catch{return!1}return!1}export{y as clone,h as copy,o as defaultPathOptions,E as emptyDeep,d as equals,v as flatten,f as get,w as getAll,g as has,O as isPath,q as isQuery,z as merge,k as move,s as set,x as unflatten,c as unset};