es-toolkit 1.49.0-dev.1958 → 1.49.0-dev.1959
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.global.js +1 -1
- package/dist/compat/_internal/assignValue.js +2 -3
- package/dist/compat/_internal/assignValue.mjs +2 -3
- package/dist/compat/_internal/isIterateeCall.js +2 -3
- package/dist/compat/_internal/isIterateeCall.mjs +2 -3
- package/dist/compat/array/includes.js +3 -4
- package/dist/compat/array/includes.mjs +3 -4
- package/dist/compat/array/intersectionWith.js +2 -3
- package/dist/compat/array/intersectionWith.mjs +2 -3
- package/dist/compat/array/pullAllWith.js +2 -3
- package/dist/compat/array/pullAllWith.mjs +2 -3
- package/dist/compat/array/sortedIndexOf.js +2 -3
- package/dist/compat/array/sortedIndexOf.mjs +2 -3
- package/dist/compat/array/sortedLastIndexOf.js +2 -3
- package/dist/compat/array/sortedLastIndexOf.mjs +2 -3
- package/dist/compat/compat.d.mts +4 -3
- package/dist/compat/compat.d.ts +4 -3
- package/dist/compat/compat.js +4 -5
- package/dist/compat/compat.mjs +4 -5
- package/dist/compat/index.d.mts +4 -3
- package/dist/compat/index.d.ts +4 -3
- package/dist/compat/index.js +4 -3
- package/dist/compat/index.mjs +4 -3
- package/dist/compat/object/assign.js +2 -3
- package/dist/compat/object/assign.mjs +2 -3
- package/dist/compat/object/assignIn.js +2 -3
- package/dist/compat/object/assignIn.mjs +2 -3
- package/dist/compat/object/assignInWith.js +2 -3
- package/dist/compat/object/assignInWith.mjs +2 -3
- package/dist/compat/object/assignWith.js +2 -3
- package/dist/compat/object/assignWith.mjs +2 -3
- package/dist/compat/object/defaults.js +2 -3
- package/dist/compat/object/defaults.mjs +2 -3
- package/dist/compat/predicate/isMatchWith.js +4 -5
- package/dist/compat/predicate/isMatchWith.mjs +4 -5
- package/dist/compat/string/template.d.mts +1 -1
- package/dist/compat/string/template.d.ts +1 -1
- package/dist/compat/string/templateSettings.d.mts +18 -1
- package/dist/compat/string/templateSettings.d.ts +18 -1
- package/dist/compat/string/templateSettings.js +4 -1
- package/dist/compat/string/templateSettings.mjs +5 -1
- package/dist/compat/util/eq.d.mts +17 -1
- package/dist/compat/util/eq.d.ts +17 -1
- package/dist/compat/util/eq.js +19 -1
- package/dist/compat/util/eq.mjs +19 -1
- package/dist/map/hasValue.js +2 -2
- package/dist/map/hasValue.mjs +2 -2
- package/dist/predicate/isEqualWith.js +2 -3
- package/dist/predicate/isEqualWith.mjs +2 -3
- package/package.json +1 -1
- package/dist/_internal/isEqualsSameValueZero.d.mts +0 -17
- package/dist/_internal/isEqualsSameValueZero.d.ts +0 -17
- package/dist/_internal/isEqualsSameValueZero.js +0 -19
- package/dist/_internal/isEqualsSameValueZero.mjs +0 -19
package/dist/browser.global.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
${a?`function print() { __p += Array.prototype.join.call(arguments, ''); }`:``}
|
|
6
6
|
${t.variable?o:`with(obj) {\n${o}\n}`}
|
|
7
7
|
return __p;
|
|
8
|
-
}`,f=ya(()=>Function(...c,`${u}return ${d}`)(...l));if(f.source=d,f instanceof Error)throw f;return f}function
|
|
8
|
+
}`,f=ya(()=>Function(...c,`${u}return ${d}`)(...l));if(f.source=d,f instanceof Error)throw f;return f}let Fc=Nc;function Ic(e){return N(e).toLowerCase()}function Lc(e){return N(e).toUpperCase()}function Rc(e,t,n){if(e==null)return``;if(n!=null||t==null)return e.toString().trim();switch(typeof t){case`object`:return Array.isArray(t)?Bn(e,t.flatMap(e=>e.toString().split(``))):Bn(e,t.toString().split(``));default:return Bn(e,t.toString().split(``))}}function zc(e,t,n){return e==null?``:n!=null||t==null?e.toString().trimEnd():Rn(e,t.toString().split(``))}function Bc(e,t,n){return e==null?``:n!=null||t==null?e.toString().trimStart():zn(e,t.toString().split(``))}function Vc(e,t){e=e==null?``:`${e}`;let n=30,r=`...`;L(t)&&(n=Hc(t.length),r=`omission`in t?`${t.omission}`:`...`);let i=e.length,a=Array.from(r).length,o=Math.max(n-a,0),s;if(Fi.test(e)&&(s=Array.from(e),i=s.length),n>=i)return e;if(i<=a)return r;let c=s===void 0?e.slice(0,o):s?.slice(0,o).join(``),l=t?.separator;if(!l)return c+=r,c;let u=l instanceof RegExp?l.source:l,d=`u`+(l instanceof RegExp?l.flags.replace(`u`,``):``),f=RegExp(`(?<result>.*(?:(?!${u}).))(?:${u})`,d).exec(c);return(f?.groups?f.groups.result:c)+r}function Hc(e){return e==null?30:e<=0?0:e}function Uc(e){return Hn(N(e))}function Wc(e){return oc(sc(Xs(e))).map(e=>e.toUpperCase()).join(` `)}function Gc(e){return Un(N(e))}function Kc(e){let t=e.length,n=e.map(e=>{let t=e[0],n=e[1];if(!O(n))throw TypeError(`Expected a function`);return[V(t),n]});return function(...e){for(let r=0;r<t;r++){let t=n[r],i=t[0],a=t[1];if(i.apply(this,e))return a.apply(this,e)}}}function qc(e){return()=>e}function Jc(e,t){return e==null||Number.isNaN(e)?t:e}function Yc(e,t){return typeof e==`string`&&typeof t==`string`?e>t:K(e)>K(t)}function Xc(e,t){return typeof e==`string`&&typeof t==`string`?e>=t:K(e)>=K(t)}function Zc(e,t,...n){if(n=n.flat(1),e!=null)switch(typeof t){case`string`:return typeof e==`object`&&Object.hasOwn(e,t)?Qc(e,[t],n):Qc(e,P(t),n);case`number`:case`symbol`:return Qc(e,[t],n);default:return Array.isArray(t)?Qc(e,t,n):Qc(e,[t],n)}}function Qc(e,t,n){let r=F(e,t.slice(0,-1),e);if(r==null)return;let i=W(t),a=i?.valueOf();return i=typeof a==`number`?M(a):String(i),F(r,i)?.apply(r,n)}function $c(e,t){return typeof e==`string`&&typeof t==`string`?e<t:K(e)<K(t)}function el(e,t){return typeof e==`string`&&typeof t==`string`?e<=t:K(e)<=K(t)}function tl(e,...t){return function(n){return Zc(n,e,t)}}function nl(e,...t){return function(n){return Zc(e,n,t)}}function rl(){return Date.now()}function il(...e){e.length===1&&Array.isArray(e[0])&&(e=e[0]);let t=e.map(e=>V(e));return function(...e){return t.map(t=>t.apply(this,e))}}function al(...e){return function(...t){for(let n=0;n<e.length;++n){let r=e[n];if(!Array.isArray(r)){if(!V(r).apply(this,t))return!1;continue}for(let e=0;e<r.length;++e)if(!V(r[e]).apply(this,t))return!1}return!0}}function ol(...e){return function(...t){for(let n=0;n<e.length;++n){let r=e[n];if(!Array.isArray(r)){if(V(r).apply(this,t))return!0;continue}for(let e=0;e<r.length;++e)if(V(r[e]).apply(this,t))return!0}return!1}}function sl(){return[]}function cl(){return!1}function ll(){return{}}function ul(){return``}function dl(){return!0}function fl(e){return e==null?0:wi(J(e),0,4294967295)}function pl(e){let t={},n=$(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];i===`__proto__`?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[i]=a}return t}function ml(e){return e==null?0:wi(J(e),-bc,bc)}let hl=0;function gl(e=``){return`${e}${++hl}`}e.AbortError=Fe,e.Mutex=En,e.Semaphore=m,e.TimeoutError=Ie,e.add=Ya,e.after=_a,e.allKeyed=Tn,e.ary=va,e.assert=Gn,e.invariant=Gn,e.assign=vo,e.assignIn=Co,e.extend=Co,e.assignInWith=To,e.extendWith=To,e.assignWith=Do,e.asyncNoop=ze,e.at=mi,e.attempt=ya,e.attemptAsync=Wn,e.before=ba,e.bind=xa,e.bindAll=Ys,e.bindKey=Sa,e.camelCase=cc,e.capitalize=Js,e.cartesianProduct=t,e.castArray=Kn,e.ceil=Za,e.chunk=qn,e.chunkBy=r,e.clamp=wi,e.clone=ko,e.cloneDeep=sr,e.cloneDeepWith=or,e.cloneWith=Fo,e.combinations=i,e.compact=Jn,e.concat=Yn,e.cond=Kc,e.conforms=Ps,e.conformsTo=Ns,e.constant=qc,e.constantCase=kn,e.countBy=dr,e.create=Io,e.curry=Ca,e.curryRight=Da,e.debounce=ja,e.deburr=Xs,e.defaultTo=Jc,e.defaults=Lo,e.defaultsDeep=Ro,e.defer=Ma,e.delay=Na,e.difference=fr,e.differenceBy=mr,e.differenceWith=hr,e.divide=Qa,e.drop=gr,e.dropRight=_r,e.dropRightWhile=vr,e.dropWhile=br,e.each=Sr,e.forEach=Sr,e.eachRight=Cr,e.forEachRight=Cr,e.endsWith=lc,e.eq=D,e.escape=uc,e.escapeRegExp=dc,e.every=wr,e.fill=Er,e.filter=Dr,e.filterAsync=ee,e.find=Or,e.findIndex=kr,e.findKey=Uo,e.findLast=Ar,e.findLastIndex=jr,e.findLastKey=Wo,e.first=Mr,e.head=Mr,e.flatMap=Ir,e.flatMapAsync=ne,e.flatMapDeep=Rr,e.flatMapDepth=Lr,e.flatten=zr,e.flattenDeep=Br,e.flattenDepth=Nr,e.flattenObject=Lt,e.flip=Pa,e.floor=$a,e.flow=Fa,e.flowRight=Ia,e.forEachAsync=re,e.forIn=Go,e.forInRight=Ko,e.forOwn=qo,e.forOwnRight=Jo,e.fromPairs=Yo,e.functions=Xo,e.functionsIn=Zo,e.get=F,e.groupBy=Vr,e.gt=Yc,e.gte=Xc,e.has=ur,e.hasIn=Qo,e.identity=X,e.inRange=eo,e.includes=Hr,e.indexOf=Ur,e.initial=Wr,e.intersection=Gr,e.intersectionBy=Kr,e.intersectionWith=Jr,e.invert=$o,e.invertBy=es,e.invoke=Zc,e.invokeMap=Xr,e.isArguments=z,e.isArray=T,e.isArrayBuffer=Fs,e.isArrayLike=j,e.isArrayLikeObject=U,e.isBlob=Qt,e.isBoolean=Is,e.isBrowser=$t,e.isBuffer=Ss,e.isDate=Ls,e.isElement=Rs,e.isEmpty=zs,e.isEmptyObject=tn,e.isEqual=on,e.isEqualWith=Bs,e.isError=Vs,e.isFile=sn,e.isFinite=Hs,e.isFunction=Es,e.isInteger=Us,e.isIterable=cn,e.isJSON=ln,e.isJSONArray=dn,e.isJSONObject=fn,e.isJSONValue=un,e.isLength=Ds,e.isMap=Ti,e.isMatch=ar,e.isMatchWith=$n,e.isNaN=Vi,e.isNative=As,e.isNil=Ni,e.isNode=hn,e.isNotNil=gn,e.isNull=js,e.isNumber=Bi,e.isObject=L,e.isObjectLike=H,e.isPlainObject=E,e.isPrimitive=_,e.isPromise=vn,e.isRegExp=Ws,e.isSafeInteger=Gs,e.isSet=Ei,e.isString=Tr,e.isSubset=ue,e.isSubsetWith=de,e.isSymbol=G,e.isTypedArray=Z,e.isUndefined=Ms,e.isWeakMap=Ks,e.isWeakSet=qs,e.iteratee=V,e.join=Zr,e.kebabCase=fc,e.keyBy=$r,e.keys=Q,e.keysIn=$,e.last=W,e.lastIndexOf=ei,e.limitAsync=h,e.lowerCase=pc,e.lowerFirst=mc,e.lt=$c,e.lte=el,e.map=Fr,e.mapAsync=pe,e.mapKeys=ts,e.mapValues=ns,e.matches=R,e.matchesProperty=B,e.max=to,e.maxBy=no,e.mean=ao,e.meanBy=oo,e.median=it,e.medianBy=at,e.memoize=La,e.merge=as,e.mergeWith=rs,e.method=tl,e.methodOf=nl,e.min=so,e.minBy=co,e.multiply=lo,e.negate=yi,e.noop=_o,e.now=rl,e.nth=ti,e.nthArg=Ra,e.omit=ss,e.omitBy=ds,e.once=za,e.orderBy=si,e.over=il,e.overArgs=Ba,e.overEvery=al,e.overSome=ol,e.pad=_c,e.padEnd=vc,e.padStart=yc,e.parseInt=uo,e.partial=Va,e.partialRight=Ha,e.partition=ci,e.pascalCase=In,e.percentile=ot,e.pick=fs,e.pickBy=ps,e.property=I,e.propertyOf=ms,e.pull=li,e.pullAll=ui,e.pullAllBy=di,e.pullAllWith=pi,e.pullAt=_i,e.random=fo,e.randomInt=ye,e.range=po,e.rangeRight=mo,e.rearg=Ua,e.reduce=Qr,e.reduceAsync=he,e.reduceRight=vi,e.reject=bi,e.remove=xi,e.repeat=xc,e.replace=Sc,e.rest=Wa,e.result=hs,e.retry=tt,e.reverse=Si,e.reverseString=Ln,e.round=ho,e.sample=Ci,e.sampleSize=Oi,e.set=ma,e.setWith=gs,e.shuffle=Pi,e.size=Ii,e.slice=Li,e.snakeCase=Cc,e.some=Ri,e.sortBy=zi,e.sortKeys=Ht,e.sortedIndex=Ui,e.sortedIndexBy=Hi,e.sortedIndexOf=Wi,e.sortedLastIndex=Ki,e.sortedLastIndexBy=Gi,e.sortedLastIndexOf=qi,e.split=wc,e.spread=Ga,e.startCase=Tc,e.startsWith=Ec,e.stubArray=sl,e.stubFalse=cl,e.stubObject=ll,e.stubString=ul,e.stubTrue=dl,e.subtract=go,e.sum=io,e.sumBy=ro,e.tail=Ji,e.take=Yi,e.takeRight=Xi,e.takeRightWhile=Zi,e.takeWhile=Qi,e.template=Pc,e.templateSettings=Fc,e.throttle=Ka,e.timeout=Dn,e.times=Ai,e.toArray=Di,e.toCamelCaseKeys=qt,e.toDefaulted=_s,e.toFilled=Te,e.toFinite=q,e.toInteger=J,e.toLength=fl,e.toLower=Ic,e.toMerged=Jt,e.toNumber=K,e.toPairs=bs,e.toPairsIn=xs,e.toPath=P,e.toPlainObject=pl,e.toSafeInteger=ml,e.toSnakeCaseKeys=Xt,e.toString=N,e.toUpper=Lc,e.transform=Cs,e.trim=Rc,e.trimEnd=zc,e.trimStart=Bc,e.truncate=Vc,e.unary=qa,e.unescape=Uc,e.union=$i,e.unionBy=ea,e.unionWith=ta,e.uniq=qr,e.uniqBy=na,e.uniqWith=ra,e.uniqueId=gl,e.unset=hi,e.unzip=ia,e.unzipWith=aa,e.update=ws,e.updateWith=pa,e.upperCase=Wc,e.upperFirst=Gc,e.values=Mi,e.valuesIn=Ts,e.windowed=Ae,e.withTimeout=On,e.without=oa,e.words=oc,e.wrap=Ja,e.xor=sa,e.xorBy=ca,e.xorWith=la,e.zip=ua,e.zipObject=fa,e.zipObjectDeep=ha,e.zipWith=ga});
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
require("../util/eq.js");
|
|
1
|
+
const require_eq = require("../util/eq.js");
|
|
3
2
|
//#region src/compat/_internal/assignValue.ts
|
|
4
3
|
const assignValue = (object, key, value) => {
|
|
5
4
|
const objValue = object[key];
|
|
6
|
-
if (!(Object.hasOwn(object, key) &&
|
|
5
|
+
if (!(Object.hasOwn(object, key) && require_eq.eq(objValue, value)) || value === void 0 && !(key in object)) object[key] = value;
|
|
7
6
|
};
|
|
8
7
|
//#endregion
|
|
9
8
|
exports.assignValue = assignValue;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../util/eq.mjs";
|
|
1
|
+
import { eq } from "../util/eq.mjs";
|
|
3
2
|
//#region src/compat/_internal/assignValue.ts
|
|
4
3
|
const assignValue = (object, key, value) => {
|
|
5
4
|
const objValue = object[key];
|
|
6
|
-
if (!(Object.hasOwn(object, key) &&
|
|
5
|
+
if (!(Object.hasOwn(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) object[key] = value;
|
|
7
6
|
};
|
|
8
7
|
//#endregion
|
|
9
8
|
export { assignValue };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
require("../util/eq.js");
|
|
1
|
+
const require_eq = require("../util/eq.js");
|
|
3
2
|
const require_isArrayLike = require("../predicate/isArrayLike.js");
|
|
4
3
|
const require_isObject = require("../predicate/isObject.js");
|
|
5
4
|
const require_isIndex = require("./isIndex.js");
|
|
6
5
|
//#region src/compat/_internal/isIterateeCall.ts
|
|
7
6
|
function isIterateeCall(value, index, object) {
|
|
8
7
|
if (!require_isObject.isObject(object)) return false;
|
|
9
|
-
if (typeof index === "number" && require_isArrayLike.isArrayLike(object) && require_isIndex.isIndex(index) && index < object.length || typeof index === "string" && index in object) return
|
|
8
|
+
if (typeof index === "number" && require_isArrayLike.isArrayLike(object) && require_isIndex.isIndex(index) && index < object.length || typeof index === "string" && index in object) return require_eq.eq(object[index], value);
|
|
10
9
|
return false;
|
|
11
10
|
}
|
|
12
11
|
//#endregion
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../util/eq.mjs";
|
|
1
|
+
import { eq } from "../util/eq.mjs";
|
|
3
2
|
import { isArrayLike } from "../predicate/isArrayLike.mjs";
|
|
4
3
|
import { isObject } from "../predicate/isObject.mjs";
|
|
5
4
|
import { isIndex } from "./isIndex.mjs";
|
|
6
5
|
//#region src/compat/_internal/isIterateeCall.ts
|
|
7
6
|
function isIterateeCall(value, index, object) {
|
|
8
7
|
if (!isObject(object)) return false;
|
|
9
|
-
if (typeof index === "number" && isArrayLike(object) && isIndex(index) && index < object.length || typeof index === "string" && index in object) return
|
|
8
|
+
if (typeof index === "number" && isArrayLike(object) && isIndex(index) && index < object.length || typeof index === "string" && index in object) return eq(object[index], value);
|
|
10
9
|
return false;
|
|
11
10
|
}
|
|
12
11
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
require("../util/eq.js");
|
|
1
|
+
const require_eq = require("../util/eq.js");
|
|
3
2
|
const require_isArrayLike = require("../predicate/isArrayLike.js");
|
|
4
3
|
const require_toInteger = require("../util/toInteger.js");
|
|
5
4
|
const require_isString = require("../predicate/isString.js");
|
|
@@ -32,14 +31,14 @@ function includes(source, target, fromIndex, guard) {
|
|
|
32
31
|
if (Array.isArray(source)) return source.includes(target, fromIndex);
|
|
33
32
|
if (require_isArrayLike.isArrayLike(source)) {
|
|
34
33
|
if (fromIndex < 0) fromIndex = Math.max(0, source.length + fromIndex);
|
|
35
|
-
for (let i = fromIndex; i < source.length; i++) if (
|
|
34
|
+
for (let i = fromIndex; i < source.length; i++) if (require_eq.eq(source[i], target)) return true;
|
|
36
35
|
return false;
|
|
37
36
|
}
|
|
38
37
|
const keys = Object.keys(source);
|
|
39
38
|
if (fromIndex < 0) fromIndex = Math.max(0, keys.length + fromIndex);
|
|
40
39
|
for (let i = fromIndex; i < keys.length; i++) {
|
|
41
40
|
const value = Reflect.get(source, keys[i]);
|
|
42
|
-
if (
|
|
41
|
+
if (require_eq.eq(value, target)) return true;
|
|
43
42
|
}
|
|
44
43
|
return false;
|
|
45
44
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../util/eq.mjs";
|
|
1
|
+
import { eq } from "../util/eq.mjs";
|
|
3
2
|
import { isArrayLike } from "../predicate/isArrayLike.mjs";
|
|
4
3
|
import { toInteger } from "../util/toInteger.mjs";
|
|
5
4
|
import { isString } from "../predicate/isString.mjs";
|
|
@@ -32,12 +31,12 @@ function includes(source, target, fromIndex, guard) {
|
|
|
32
31
|
if (Array.isArray(source)) return source.includes(target, fromIndex);
|
|
33
32
|
if (isArrayLike(source)) {
|
|
34
33
|
if (fromIndex < 0) fromIndex = Math.max(0, source.length + fromIndex);
|
|
35
|
-
for (let i = fromIndex; i < source.length; i++) if (
|
|
34
|
+
for (let i = fromIndex; i < source.length; i++) if (eq(source[i], target)) return true;
|
|
36
35
|
return false;
|
|
37
36
|
}
|
|
38
37
|
const keys = Object.keys(source);
|
|
39
38
|
if (fromIndex < 0) fromIndex = Math.max(0, keys.length + fromIndex);
|
|
40
|
-
for (let i = fromIndex; i < keys.length; i++) if (
|
|
39
|
+
for (let i = fromIndex; i < keys.length; i++) if (eq(Reflect.get(source, keys[i]), target)) return true;
|
|
41
40
|
return false;
|
|
42
41
|
}
|
|
43
42
|
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const require_intersectionWith = require("../../array/intersectionWith.js");
|
|
2
|
-
const
|
|
3
|
-
require("../util/eq.js");
|
|
2
|
+
const require_eq = require("../util/eq.js");
|
|
4
3
|
const require_last = require("./last.js");
|
|
5
4
|
const require_uniq = require("./uniq.js");
|
|
6
5
|
//#region src/compat/array/intersectionWith.ts
|
|
@@ -21,7 +20,7 @@ const require_uniq = require("./uniq.js");
|
|
|
21
20
|
function intersectionWith(firstArr, ...otherArrs) {
|
|
22
21
|
if (firstArr == null) return [];
|
|
23
22
|
const _comparator = require_last.last(otherArrs);
|
|
24
|
-
let comparator =
|
|
23
|
+
let comparator = require_eq.eq;
|
|
25
24
|
let uniq$1 = require_uniq.uniq;
|
|
26
25
|
if (typeof _comparator === "function") {
|
|
27
26
|
comparator = _comparator;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { intersectionWith as intersectionWith$1 } from "../../array/intersectionWith.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import "../util/eq.mjs";
|
|
2
|
+
import { eq } from "../util/eq.mjs";
|
|
4
3
|
import { last } from "./last.mjs";
|
|
5
4
|
import { uniq } from "./uniq.mjs";
|
|
6
5
|
//#region src/compat/array/intersectionWith.ts
|
|
@@ -21,7 +20,7 @@ import { uniq } from "./uniq.mjs";
|
|
|
21
20
|
function intersectionWith(firstArr, ...otherArrs) {
|
|
22
21
|
if (firstArr == null) return [];
|
|
23
22
|
const _comparator = last(otherArrs);
|
|
24
|
-
let comparator =
|
|
23
|
+
let comparator = eq;
|
|
25
24
|
let uniq$1 = uniq;
|
|
26
25
|
if (typeof _comparator === "function") {
|
|
27
26
|
comparator = _comparator;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
require("../util/eq.js");
|
|
1
|
+
const require_eq = require("../util/eq.js");
|
|
3
2
|
const require_copyArray = require("../_internal/copyArray.js");
|
|
4
3
|
//#region src/compat/array/pullAllWith.ts
|
|
5
4
|
/**
|
|
@@ -27,7 +26,7 @@ function pullAllWith(array, values, comparator) {
|
|
|
27
26
|
if (array?.length == null || values?.length == null) return array;
|
|
28
27
|
if (array === values) values = require_copyArray.default(values);
|
|
29
28
|
let resultLength = 0;
|
|
30
|
-
if (comparator == null) comparator = (a, b) =>
|
|
29
|
+
if (comparator == null) comparator = (a, b) => require_eq.eq(a, b);
|
|
31
30
|
const valuesArray = Array.isArray(values) ? values : Array.from(values);
|
|
32
31
|
const hasUndefined = valuesArray.includes(void 0);
|
|
33
32
|
for (let i = 0; i < array.length; i++) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../util/eq.mjs";
|
|
1
|
+
import { eq } from "../util/eq.mjs";
|
|
3
2
|
import copyArray from "../_internal/copyArray.mjs";
|
|
4
3
|
//#region src/compat/array/pullAllWith.ts
|
|
5
4
|
/**
|
|
@@ -27,7 +26,7 @@ function pullAllWith(array, values, comparator) {
|
|
|
27
26
|
if (array?.length == null || values?.length == null) return array;
|
|
28
27
|
if (array === values) values = copyArray(values);
|
|
29
28
|
let resultLength = 0;
|
|
30
|
-
if (comparator == null) comparator = (a, b) =>
|
|
29
|
+
if (comparator == null) comparator = (a, b) => eq(a, b);
|
|
31
30
|
const valuesArray = Array.isArray(values) ? values : Array.from(values);
|
|
32
31
|
const hasUndefined = valuesArray.includes(void 0);
|
|
33
32
|
for (let i = 0; i < array.length; i++) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
require("../util/eq.js");
|
|
1
|
+
const require_eq = require("../util/eq.js");
|
|
3
2
|
const require_sortedIndex = require("./sortedIndex.js");
|
|
4
3
|
//#region src/compat/array/sortedIndexOf.ts
|
|
5
4
|
/**
|
|
@@ -36,7 +35,7 @@ const require_sortedIndex = require("./sortedIndex.js");
|
|
|
36
35
|
function sortedIndexOf(array, value) {
|
|
37
36
|
if (!array?.length) return -1;
|
|
38
37
|
const index = require_sortedIndex.sortedIndex(array, value);
|
|
39
|
-
if (index < array.length &&
|
|
38
|
+
if (index < array.length && require_eq.eq(array[index], value)) return index;
|
|
40
39
|
return -1;
|
|
41
40
|
}
|
|
42
41
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../util/eq.mjs";
|
|
1
|
+
import { eq } from "../util/eq.mjs";
|
|
3
2
|
import { sortedIndex } from "./sortedIndex.mjs";
|
|
4
3
|
//#region src/compat/array/sortedIndexOf.ts
|
|
5
4
|
/**
|
|
@@ -36,7 +35,7 @@ import { sortedIndex } from "./sortedIndex.mjs";
|
|
|
36
35
|
function sortedIndexOf(array, value) {
|
|
37
36
|
if (!array?.length) return -1;
|
|
38
37
|
const index = sortedIndex(array, value);
|
|
39
|
-
if (index < array.length &&
|
|
38
|
+
if (index < array.length && eq(array[index], value)) return index;
|
|
40
39
|
return -1;
|
|
41
40
|
}
|
|
42
41
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
require("../util/eq.js");
|
|
1
|
+
const require_eq = require("../util/eq.js");
|
|
3
2
|
const require_sortedLastIndex = require("./sortedLastIndex.js");
|
|
4
3
|
//#region src/compat/array/sortedLastIndexOf.ts
|
|
5
4
|
/**
|
|
@@ -37,7 +36,7 @@ const require_sortedLastIndex = require("./sortedLastIndex.js");
|
|
|
37
36
|
function sortedLastIndexOf(array, value) {
|
|
38
37
|
if (!array?.length) return -1;
|
|
39
38
|
const index = require_sortedLastIndex.sortedLastIndex(array, value) - 1;
|
|
40
|
-
if (index >= 0 &&
|
|
39
|
+
if (index >= 0 && require_eq.eq(array[index], value)) return index;
|
|
41
40
|
return -1;
|
|
42
41
|
}
|
|
43
42
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../util/eq.mjs";
|
|
1
|
+
import { eq } from "../util/eq.mjs";
|
|
3
2
|
import { sortedLastIndex } from "./sortedLastIndex.mjs";
|
|
4
3
|
//#region src/compat/array/sortedLastIndexOf.ts
|
|
5
4
|
/**
|
|
@@ -37,7 +36,7 @@ import { sortedLastIndex } from "./sortedLastIndex.mjs";
|
|
|
37
36
|
function sortedLastIndexOf(array, value) {
|
|
38
37
|
if (!array?.length) return -1;
|
|
39
38
|
const index = sortedLastIndex(array, value) - 1;
|
|
40
|
-
if (index >= 0 &&
|
|
39
|
+
if (index >= 0 && eq(array[index], value)) return index;
|
|
41
40
|
return -1;
|
|
42
41
|
}
|
|
43
42
|
//#endregion
|
package/dist/compat/compat.d.mts
CHANGED
|
@@ -246,7 +246,8 @@ import { snakeCase } from "./string/snakeCase.mjs";
|
|
|
246
246
|
import { split } from "./string/split.mjs";
|
|
247
247
|
import { startCase } from "./string/startCase.mjs";
|
|
248
248
|
import { startsWith } from "./string/startsWith.mjs";
|
|
249
|
-
import { template
|
|
249
|
+
import { template } from "./string/template.mjs";
|
|
250
|
+
import { templateSettings } from "./string/templateSettings.mjs";
|
|
250
251
|
import { toLower } from "./string/toLower.mjs";
|
|
251
252
|
import { toUpper } from "./string/toUpper.mjs";
|
|
252
253
|
import { trim } from "./string/trim.mjs";
|
|
@@ -260,7 +261,7 @@ import { words } from "./string/words.mjs";
|
|
|
260
261
|
import { cond } from "./util/cond.mjs";
|
|
261
262
|
import { constant } from "./util/constant.mjs";
|
|
262
263
|
import { defaultTo } from "./util/defaultTo.mjs";
|
|
263
|
-
import {
|
|
264
|
+
import { eq } from "./util/eq.mjs";
|
|
264
265
|
import { gt } from "./util/gt.mjs";
|
|
265
266
|
import { gte } from "./util/gte.mjs";
|
|
266
267
|
import { invoke } from "./util/invoke.mjs";
|
|
@@ -292,7 +293,7 @@ import { uniqueId } from "./util/uniqueId.mjs";
|
|
|
292
293
|
|
|
293
294
|
//#region src/compat/compat.d.ts
|
|
294
295
|
declare namespace compat_d_exports {
|
|
295
|
-
export { DebouncedFunc, add, after, ary, assign, assignIn, assignInWith, assignWith, at, attempt, before, bind, bindAll, bindKey, camelCase, capitalize, castArray, ceil, chunk, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, compact, concat, cond, conforms, conformsTo, constant, countBy, create, curry, curryRight, debounce, deburr, defaultTo, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, divide, drop, dropRight, dropRightWhile, dropWhile, forEach as each, forEachRight as eachRight, endsWith,
|
|
296
|
+
export { DebouncedFunc, add, after, ary, assign, assignIn, assignInWith, assignWith, at, attempt, before, bind, bindAll, bindKey, camelCase, capitalize, castArray, ceil, chunk, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, compact, concat, cond, conforms, conformsTo, constant, countBy, create, curry, curryRight, debounce, deburr, defaultTo, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, divide, drop, dropRight, dropRightWhile, dropWhile, forEach as each, forEachRight as eachRight, endsWith, eq, escape, escapeRegExp, every, assignIn as extend, assignInWith as extendWith, fill, filter, find, findIndex, findKey, findLast, findLastIndex, findLastKey, head as first, flatMap, flatMapDeep, flatMapDepth, flatten, flattenDeep, flattenDepth, flip, floor, flow, flowRight, forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, fromPairs, functions, functionsIn, get, groupBy, gt, gte, has, hasIn, head, identity, inRange, includes, indexOf, initial, intersection, intersectionBy, intersectionWith, invert, invertBy, invoke, invokeMap, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, iteratee, join, kebabCase, keyBy, keys, keysIn, last, lastIndexOf, lowerCase, lowerFirst, lt, lte, map, mapKeys, mapValues, matches, matchesProperty, max, maxBy, mean, meanBy, memoize, merge, mergeWith, method, methodOf, min, minBy, multiply, negate, noop, now, nth, nthArg, omit, omitBy, once, orderBy, over, overArgs, overEvery, overSome, pad, padEnd, padStart, parseInt, partial, partialRight, partition, pick, pickBy, property, propertyOf, pull, pullAll, pullAllBy, pullAllWith, pullAt, random, range, rangeRight, rearg, reduce, reduceRight, reject, remove, repeat, replace, rest, result, reverse, round, sample, sampleSize, set, setWith, shuffle, size, slice, snakeCase, some, sortBy, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, split, spread, startCase, startsWith, stubArray, stubFalse, stubObject, stubString, stubTrue, subtract, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, template, templateSettings, throttle, times, toArray, toDefaulted, toFinite, toInteger, toLength, toLower, toNumber, toPairs, toPairsIn, toPath, toPlainObject, toSafeInteger, toString, toUpper, transform, trim, trimEnd, trimStart, truncate, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, uniqueId, unset, unzip, unzipWith, update, updateWith, upperCase, upperFirst, values, valuesIn, without, words, wrap, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith };
|
|
296
297
|
}
|
|
297
298
|
//#endregion
|
|
298
299
|
export { compat_d_exports };
|
package/dist/compat/compat.d.ts
CHANGED
|
@@ -246,7 +246,8 @@ import { snakeCase } from "./string/snakeCase.js";
|
|
|
246
246
|
import { split } from "./string/split.js";
|
|
247
247
|
import { startCase } from "./string/startCase.js";
|
|
248
248
|
import { startsWith } from "./string/startsWith.js";
|
|
249
|
-
import { template
|
|
249
|
+
import { template } from "./string/template.js";
|
|
250
|
+
import { templateSettings } from "./string/templateSettings.js";
|
|
250
251
|
import { toLower } from "./string/toLower.js";
|
|
251
252
|
import { toUpper } from "./string/toUpper.js";
|
|
252
253
|
import { trim } from "./string/trim.js";
|
|
@@ -260,7 +261,7 @@ import { words } from "./string/words.js";
|
|
|
260
261
|
import { cond } from "./util/cond.js";
|
|
261
262
|
import { constant } from "./util/constant.js";
|
|
262
263
|
import { defaultTo } from "./util/defaultTo.js";
|
|
263
|
-
import {
|
|
264
|
+
import { eq } from "./util/eq.js";
|
|
264
265
|
import { gt } from "./util/gt.js";
|
|
265
266
|
import { gte } from "./util/gte.js";
|
|
266
267
|
import { invoke } from "./util/invoke.js";
|
|
@@ -292,7 +293,7 @@ import { uniqueId } from "./util/uniqueId.js";
|
|
|
292
293
|
|
|
293
294
|
//#region src/compat/compat.d.ts
|
|
294
295
|
declare namespace compat_d_exports {
|
|
295
|
-
export { DebouncedFunc, add, after, ary, assign, assignIn, assignInWith, assignWith, at, attempt, before, bind, bindAll, bindKey, camelCase, capitalize, castArray, ceil, chunk, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, compact, concat, cond, conforms, conformsTo, constant, countBy, create, curry, curryRight, debounce, deburr, defaultTo, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, divide, drop, dropRight, dropRightWhile, dropWhile, forEach as each, forEachRight as eachRight, endsWith,
|
|
296
|
+
export { DebouncedFunc, add, after, ary, assign, assignIn, assignInWith, assignWith, at, attempt, before, bind, bindAll, bindKey, camelCase, capitalize, castArray, ceil, chunk, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, compact, concat, cond, conforms, conformsTo, constant, countBy, create, curry, curryRight, debounce, deburr, defaultTo, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, divide, drop, dropRight, dropRightWhile, dropWhile, forEach as each, forEachRight as eachRight, endsWith, eq, escape, escapeRegExp, every, assignIn as extend, assignInWith as extendWith, fill, filter, find, findIndex, findKey, findLast, findLastIndex, findLastKey, head as first, flatMap, flatMapDeep, flatMapDepth, flatten, flattenDeep, flattenDepth, flip, floor, flow, flowRight, forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, fromPairs, functions, functionsIn, get, groupBy, gt, gte, has, hasIn, head, identity, inRange, includes, indexOf, initial, intersection, intersectionBy, intersectionWith, invert, invertBy, invoke, invokeMap, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, iteratee, join, kebabCase, keyBy, keys, keysIn, last, lastIndexOf, lowerCase, lowerFirst, lt, lte, map, mapKeys, mapValues, matches, matchesProperty, max, maxBy, mean, meanBy, memoize, merge, mergeWith, method, methodOf, min, minBy, multiply, negate, noop, now, nth, nthArg, omit, omitBy, once, orderBy, over, overArgs, overEvery, overSome, pad, padEnd, padStart, parseInt, partial, partialRight, partition, pick, pickBy, property, propertyOf, pull, pullAll, pullAllBy, pullAllWith, pullAt, random, range, rangeRight, rearg, reduce, reduceRight, reject, remove, repeat, replace, rest, result, reverse, round, sample, sampleSize, set, setWith, shuffle, size, slice, snakeCase, some, sortBy, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, split, spread, startCase, startsWith, stubArray, stubFalse, stubObject, stubString, stubTrue, subtract, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, template, templateSettings, throttle, times, toArray, toDefaulted, toFinite, toInteger, toLength, toLower, toNumber, toPairs, toPairsIn, toPath, toPlainObject, toSafeInteger, toString, toUpper, transform, trim, trimEnd, trimStart, truncate, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, uniqueId, unset, unzip, unzipWith, update, updateWith, upperCase, upperFirst, values, valuesIn, without, words, wrap, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith };
|
|
296
297
|
}
|
|
297
298
|
//#endregion
|
|
298
299
|
export { compat_d_exports };
|
package/dist/compat/compat.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
const require_runtime = require("../_virtual/_rolldown/runtime.js");
|
|
2
2
|
const require_isArray = require("./predicate/isArray.js");
|
|
3
3
|
const require_isPlainObject = require("./predicate/isPlainObject.js");
|
|
4
|
-
const
|
|
5
|
-
require("./util/eq.js");
|
|
4
|
+
const require_eq = require("./util/eq.js");
|
|
6
5
|
const require_isEqual = require("../predicate/isEqual.js");
|
|
7
6
|
const require_castArray = require("./array/castArray.js");
|
|
8
7
|
const require_isArrayLike = require("./predicate/isArrayLike.js");
|
|
@@ -264,7 +263,7 @@ const require_split = require("./string/split.js");
|
|
|
264
263
|
const require_startCase = require("./string/startCase.js");
|
|
265
264
|
const require_startsWith = require("./string/startsWith.js");
|
|
266
265
|
const require_template = require("./string/template.js");
|
|
267
|
-
require("./string/templateSettings.js");
|
|
266
|
+
const require_templateSettings = require("./string/templateSettings.js");
|
|
268
267
|
const require_toLower = require("./string/toLower.js");
|
|
269
268
|
const require_toUpper = require("./string/toUpper.js");
|
|
270
269
|
const require_trim = require("./string/trim.js");
|
|
@@ -350,7 +349,7 @@ var compat_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
|
350
349
|
each: () => require_forEach.forEach,
|
|
351
350
|
eachRight: () => require_forEachRight.forEachRight,
|
|
352
351
|
endsWith: () => require_endsWith.endsWith,
|
|
353
|
-
eq: () =>
|
|
352
|
+
eq: () => require_eq.eq,
|
|
354
353
|
escape: () => require_escape.escape,
|
|
355
354
|
escapeRegExp: () => require_escapeRegExp.escapeRegExp,
|
|
356
355
|
every: () => require_every.every,
|
|
@@ -546,7 +545,7 @@ var compat_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
|
546
545
|
takeRightWhile: () => require_takeRightWhile.takeRightWhile,
|
|
547
546
|
takeWhile: () => require_takeWhile.takeWhile,
|
|
548
547
|
template: () => require_template.template,
|
|
549
|
-
templateSettings: () =>
|
|
548
|
+
templateSettings: () => require_templateSettings.templateSettings,
|
|
550
549
|
throttle: () => require_throttle.throttle,
|
|
551
550
|
times: () => require_times.times,
|
|
552
551
|
toArray: () => require_toArray.toArray,
|
package/dist/compat/compat.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { isArray } from "./predicate/isArray.mjs";
|
|
3
3
|
import { isPlainObject } from "./predicate/isPlainObject.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import "./util/eq.mjs";
|
|
4
|
+
import { eq } from "./util/eq.mjs";
|
|
6
5
|
import { isEqual } from "../predicate/isEqual.mjs";
|
|
7
6
|
import { castArray } from "./array/castArray.mjs";
|
|
8
7
|
import { isArrayLike } from "./predicate/isArrayLike.mjs";
|
|
@@ -263,8 +262,8 @@ import { snakeCase } from "./string/snakeCase.mjs";
|
|
|
263
262
|
import { split } from "./string/split.mjs";
|
|
264
263
|
import { startCase } from "./string/startCase.mjs";
|
|
265
264
|
import { startsWith } from "./string/startsWith.mjs";
|
|
266
|
-
import { template
|
|
267
|
-
import "./string/templateSettings.mjs";
|
|
265
|
+
import { template } from "./string/template.mjs";
|
|
266
|
+
import { templateSettings } from "./string/templateSettings.mjs";
|
|
268
267
|
import { toLower } from "./string/toLower.mjs";
|
|
269
268
|
import { toUpper } from "./string/toUpper.mjs";
|
|
270
269
|
import { trim } from "./string/trim.mjs";
|
|
@@ -350,7 +349,7 @@ var compat_exports = /* @__PURE__ */ __exportAll({
|
|
|
350
349
|
each: () => forEach,
|
|
351
350
|
eachRight: () => forEachRight,
|
|
352
351
|
endsWith: () => endsWith,
|
|
353
|
-
eq: () =>
|
|
352
|
+
eq: () => eq,
|
|
354
353
|
escape: () => escape,
|
|
355
354
|
escapeRegExp: () => escapeRegExp,
|
|
356
355
|
every: () => every,
|
package/dist/compat/index.d.mts
CHANGED
|
@@ -247,7 +247,8 @@ import { snakeCase } from "./string/snakeCase.mjs";
|
|
|
247
247
|
import { split } from "./string/split.mjs";
|
|
248
248
|
import { startCase } from "./string/startCase.mjs";
|
|
249
249
|
import { startsWith } from "./string/startsWith.mjs";
|
|
250
|
-
import { template
|
|
250
|
+
import { template } from "./string/template.mjs";
|
|
251
|
+
import { templateSettings } from "./string/templateSettings.mjs";
|
|
251
252
|
import { toLower } from "./string/toLower.mjs";
|
|
252
253
|
import { toUpper } from "./string/toUpper.mjs";
|
|
253
254
|
import { trim } from "./string/trim.mjs";
|
|
@@ -261,7 +262,7 @@ import { words } from "./string/words.mjs";
|
|
|
261
262
|
import { cond } from "./util/cond.mjs";
|
|
262
263
|
import { constant } from "./util/constant.mjs";
|
|
263
264
|
import { defaultTo } from "./util/defaultTo.mjs";
|
|
264
|
-
import {
|
|
265
|
+
import { eq } from "./util/eq.mjs";
|
|
265
266
|
import { gt } from "./util/gt.mjs";
|
|
266
267
|
import { gte } from "./util/gte.mjs";
|
|
267
268
|
import { invoke } from "./util/invoke.mjs";
|
|
@@ -290,4 +291,4 @@ import { toPlainObject } from "./util/toPlainObject.mjs";
|
|
|
290
291
|
import { toSafeInteger } from "./util/toSafeInteger.mjs";
|
|
291
292
|
import { toString } from "./util/toString.mjs";
|
|
292
293
|
import { uniqueId } from "./util/uniqueId.mjs";
|
|
293
|
-
export { DebouncedFunc, add, after, ary, assign, assignIn, assignInWith, assignWith, at, attempt, before, bind, bindAll, bindKey, camelCase, capitalize, castArray, ceil, chunk, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, compact, concat, cond, conforms, conformsTo, constant, countBy, create, curry, curryRight, debounce, deburr, toolkit as default, defaultTo, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, divide, drop, dropRight, dropRightWhile, dropWhile, forEach as each, forEachRight as eachRight, endsWith,
|
|
294
|
+
export { DebouncedFunc, add, after, ary, assign, assignIn, assignInWith, assignWith, at, attempt, before, bind, bindAll, bindKey, camelCase, capitalize, castArray, ceil, chunk, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, compact, concat, cond, conforms, conformsTo, constant, countBy, create, curry, curryRight, debounce, deburr, toolkit as default, defaultTo, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, divide, drop, dropRight, dropRightWhile, dropWhile, forEach as each, forEachRight as eachRight, endsWith, eq, escape, escapeRegExp, every, assignIn as extend, assignInWith as extendWith, fill, filter, find, findIndex, findKey, findLast, findLastIndex, findLastKey, head as first, flatMap, flatMapDeep, flatMapDepth, flatten, flattenDeep, flattenDepth, flip, floor, flow, flowRight, forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, fromPairs, functions, functionsIn, get, groupBy, gt, gte, has, hasIn, head, identity, inRange, includes, indexOf, initial, intersection, intersectionBy, intersectionWith, invert, invertBy, invoke, invokeMap, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, iteratee, join, kebabCase, keyBy, keys, keysIn, last, lastIndexOf, lowerCase, lowerFirst, lt, lte, map, mapKeys, mapValues, matches, matchesProperty, max, maxBy, mean, meanBy, memoize, merge, mergeWith, method, methodOf, min, minBy, multiply, negate, noop, now, nth, nthArg, omit, omitBy, once, orderBy, over, overArgs, overEvery, overSome, pad, padEnd, padStart, parseInt, partial, partialRight, partition, pick, pickBy, property, propertyOf, pull, pullAll, pullAllBy, pullAllWith, pullAt, random, range, rangeRight, rearg, reduce, reduceRight, reject, remove, repeat, replace, rest, result, reverse, round, sample, sampleSize, set, setWith, shuffle, size, slice, snakeCase, some, sortBy, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, split, spread, startCase, startsWith, stubArray, stubFalse, stubObject, stubString, stubTrue, subtract, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, template, templateSettings, throttle, times, toArray, toDefaulted, toFinite, toInteger, toLength, toLower, toNumber, toPairs, toPairsIn, toPath, toPlainObject, toSafeInteger, toString, toUpper, transform, trim, trimEnd, trimStart, truncate, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, uniqueId, unset, unzip, unzipWith, update, updateWith, upperCase, upperFirst, values, valuesIn, without, words, wrap, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith };
|
package/dist/compat/index.d.ts
CHANGED
|
@@ -247,7 +247,8 @@ import { snakeCase } from "./string/snakeCase.js";
|
|
|
247
247
|
import { split } from "./string/split.js";
|
|
248
248
|
import { startCase } from "./string/startCase.js";
|
|
249
249
|
import { startsWith } from "./string/startsWith.js";
|
|
250
|
-
import { template
|
|
250
|
+
import { template } from "./string/template.js";
|
|
251
|
+
import { templateSettings } from "./string/templateSettings.js";
|
|
251
252
|
import { toLower } from "./string/toLower.js";
|
|
252
253
|
import { toUpper } from "./string/toUpper.js";
|
|
253
254
|
import { trim } from "./string/trim.js";
|
|
@@ -261,7 +262,7 @@ import { words } from "./string/words.js";
|
|
|
261
262
|
import { cond } from "./util/cond.js";
|
|
262
263
|
import { constant } from "./util/constant.js";
|
|
263
264
|
import { defaultTo } from "./util/defaultTo.js";
|
|
264
|
-
import {
|
|
265
|
+
import { eq } from "./util/eq.js";
|
|
265
266
|
import { gt } from "./util/gt.js";
|
|
266
267
|
import { gte } from "./util/gte.js";
|
|
267
268
|
import { invoke } from "./util/invoke.js";
|
|
@@ -290,4 +291,4 @@ import { toPlainObject } from "./util/toPlainObject.js";
|
|
|
290
291
|
import { toSafeInteger } from "./util/toSafeInteger.js";
|
|
291
292
|
import { toString } from "./util/toString.js";
|
|
292
293
|
import { uniqueId } from "./util/uniqueId.js";
|
|
293
|
-
export { DebouncedFunc, add, after, ary, assign, assignIn, assignInWith, assignWith, at, attempt, before, bind, bindAll, bindKey, camelCase, capitalize, castArray, ceil, chunk, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, compact, concat, cond, conforms, conformsTo, constant, countBy, create, curry, curryRight, debounce, deburr, toolkit as default, defaultTo, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, divide, drop, dropRight, dropRightWhile, dropWhile, forEach as each, forEachRight as eachRight, endsWith,
|
|
294
|
+
export { DebouncedFunc, add, after, ary, assign, assignIn, assignInWith, assignWith, at, attempt, before, bind, bindAll, bindKey, camelCase, capitalize, castArray, ceil, chunk, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, compact, concat, cond, conforms, conformsTo, constant, countBy, create, curry, curryRight, debounce, deburr, toolkit as default, defaultTo, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, divide, drop, dropRight, dropRightWhile, dropWhile, forEach as each, forEachRight as eachRight, endsWith, eq, escape, escapeRegExp, every, assignIn as extend, assignInWith as extendWith, fill, filter, find, findIndex, findKey, findLast, findLastIndex, findLastKey, head as first, flatMap, flatMapDeep, flatMapDepth, flatten, flattenDeep, flattenDepth, flip, floor, flow, flowRight, forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, fromPairs, functions, functionsIn, get, groupBy, gt, gte, has, hasIn, head, identity, inRange, includes, indexOf, initial, intersection, intersectionBy, intersectionWith, invert, invertBy, invoke, invokeMap, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, iteratee, join, kebabCase, keyBy, keys, keysIn, last, lastIndexOf, lowerCase, lowerFirst, lt, lte, map, mapKeys, mapValues, matches, matchesProperty, max, maxBy, mean, meanBy, memoize, merge, mergeWith, method, methodOf, min, minBy, multiply, negate, noop, now, nth, nthArg, omit, omitBy, once, orderBy, over, overArgs, overEvery, overSome, pad, padEnd, padStart, parseInt, partial, partialRight, partition, pick, pickBy, property, propertyOf, pull, pullAll, pullAllBy, pullAllWith, pullAt, random, range, rangeRight, rearg, reduce, reduceRight, reject, remove, repeat, replace, rest, result, reverse, round, sample, sampleSize, set, setWith, shuffle, size, slice, snakeCase, some, sortBy, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, split, spread, startCase, startsWith, stubArray, stubFalse, stubObject, stubString, stubTrue, subtract, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, template, templateSettings, throttle, times, toArray, toDefaulted, toFinite, toInteger, toLength, toLower, toNumber, toPairs, toPairsIn, toPath, toPlainObject, toSafeInteger, toString, toUpper, transform, trim, trimEnd, trimStart, truncate, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, uniqueId, unset, unzip, unzipWith, update, updateWith, upperCase, upperFirst, values, valuesIn, without, words, wrap, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith };
|
package/dist/compat/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperties(exports, {
|
|
|
4
4
|
});
|
|
5
5
|
const require_isArray = require("./predicate/isArray.js");
|
|
6
6
|
const require_isPlainObject = require("./predicate/isPlainObject.js");
|
|
7
|
-
const
|
|
7
|
+
const require_eq = require("./util/eq.js");
|
|
8
8
|
const require_isEqual = require("../predicate/isEqual.js");
|
|
9
9
|
const require_castArray = require("./array/castArray.js");
|
|
10
10
|
const require_isArrayLike = require("./predicate/isArrayLike.js");
|
|
@@ -261,6 +261,7 @@ const require_split = require("./string/split.js");
|
|
|
261
261
|
const require_startCase = require("./string/startCase.js");
|
|
262
262
|
const require_startsWith = require("./string/startsWith.js");
|
|
263
263
|
const require_template = require("./string/template.js");
|
|
264
|
+
const require_templateSettings = require("./string/templateSettings.js");
|
|
264
265
|
const require_toLower = require("./string/toLower.js");
|
|
265
266
|
const require_toUpper = require("./string/toUpper.js");
|
|
266
267
|
const require_trim = require("./string/trim.js");
|
|
@@ -347,7 +348,7 @@ exports.dropWhile = require_dropWhile.dropWhile;
|
|
|
347
348
|
exports.each = require_forEach.forEach;
|
|
348
349
|
exports.eachRight = require_forEachRight.forEachRight;
|
|
349
350
|
exports.endsWith = require_endsWith.endsWith;
|
|
350
|
-
exports.eq =
|
|
351
|
+
exports.eq = require_eq.eq;
|
|
351
352
|
exports.escape = require_escape.escape;
|
|
352
353
|
exports.escapeRegExp = require_escapeRegExp.escapeRegExp;
|
|
353
354
|
exports.every = require_every.every;
|
|
@@ -543,7 +544,7 @@ exports.takeRight = require_takeRight.takeRight;
|
|
|
543
544
|
exports.takeRightWhile = require_takeRightWhile.takeRightWhile;
|
|
544
545
|
exports.takeWhile = require_takeWhile.takeWhile;
|
|
545
546
|
exports.template = require_template.template;
|
|
546
|
-
exports.templateSettings =
|
|
547
|
+
exports.templateSettings = require_templateSettings.templateSettings;
|
|
547
548
|
exports.throttle = require_throttle.throttle;
|
|
548
549
|
exports.times = require_times.times;
|
|
549
550
|
exports.toArray = require_toArray.toArray;
|
package/dist/compat/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isArray } from "./predicate/isArray.mjs";
|
|
2
2
|
import { isPlainObject } from "./predicate/isPlainObject.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { eq } from "./util/eq.mjs";
|
|
4
4
|
import { isEqual } from "../predicate/isEqual.mjs";
|
|
5
5
|
import { castArray } from "./array/castArray.mjs";
|
|
6
6
|
import { isArrayLike } from "./predicate/isArrayLike.mjs";
|
|
@@ -256,7 +256,8 @@ import { snakeCase } from "./string/snakeCase.mjs";
|
|
|
256
256
|
import { split } from "./string/split.mjs";
|
|
257
257
|
import { startCase } from "./string/startCase.mjs";
|
|
258
258
|
import { startsWith } from "./string/startsWith.mjs";
|
|
259
|
-
import { template
|
|
259
|
+
import { template } from "./string/template.mjs";
|
|
260
|
+
import { templateSettings } from "./string/templateSettings.mjs";
|
|
260
261
|
import { toLower } from "./string/toLower.mjs";
|
|
261
262
|
import { toUpper } from "./string/toUpper.mjs";
|
|
262
263
|
import { trim } from "./string/trim.mjs";
|
|
@@ -291,4 +292,4 @@ import { toSafeInteger } from "./util/toSafeInteger.mjs";
|
|
|
291
292
|
import { uniqueId } from "./util/uniqueId.mjs";
|
|
292
293
|
import "./compat.mjs";
|
|
293
294
|
import { toolkit } from "./toolkit.mjs";
|
|
294
|
-
export { add, after, ary, assign, assignIn, assignInWith, assignWith, at, attempt, before, bind, bindAll, bindKey, camelCase, capitalize, castArray, ceil, chunk, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, compact, concat, cond, conforms, conformsTo, constant, countBy, create, curry, curryRight, debounce, deburr, toolkit as default, defaultTo, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, divide, drop, dropRight, dropRightWhile, dropWhile, forEach as each, forEachRight as eachRight, endsWith,
|
|
295
|
+
export { add, after, ary, assign, assignIn, assignInWith, assignWith, at, attempt, before, bind, bindAll, bindKey, camelCase, capitalize, castArray, ceil, chunk, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, compact, concat, cond, conforms, conformsTo, constant, countBy, create, curry, curryRight, debounce, deburr, toolkit as default, defaultTo, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, divide, drop, dropRight, dropRightWhile, dropWhile, forEach as each, forEachRight as eachRight, endsWith, eq, escape, escapeRegExp, every, assignIn as extend, assignInWith as extendWith, fill, filter, find, findIndex, findKey, findLast, findLastIndex, findLastKey, head as first, flatMap, flatMapDeep, flatMapDepth, flatten, flattenDeep, flattenDepth, flip, floor, flow, flowRight, forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, fromPairs, functions, functionsIn, get, groupBy, gt, gte, has, hasIn, head, identity, inRange, includes, indexOf, initial, intersection, intersectionBy, intersectionWith, invert, invertBy, invoke, invokeMap, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, iteratee, join, kebabCase, keyBy, keys, keysIn, last, lastIndexOf, lowerCase, lowerFirst, lt, lte, map, mapKeys, mapValues, matches, matchesProperty, max, maxBy, mean, meanBy, memoize, merge, mergeWith, method, methodOf, min, minBy, multiply, negate, noop, now, nth, nthArg, omit, omitBy, once, orderBy, over, overArgs, overEvery, overSome, pad, padEnd, padStart, parseInt, partial, partialRight, partition, pick, pickBy, property, propertyOf, pull, pullAll, pullAllBy, pullAllWith, pullAt, random, range, rangeRight, rearg, reduce, reduceRight, reject, remove, repeat, replace, rest, result, reverse, round, sample, sampleSize, set, setWith, shuffle, size, slice, snakeCase, some, sortBy, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, split, spread, startCase, startsWith, stubArray, stubFalse, stubObject, stubString, stubTrue, subtract, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, template, templateSettings, throttle, times, toArray, toDefaulted, toFinite, toInteger, toLength, toLower, toNumber, toPairs, toPairsIn, toPath, toPlainObject, toSafeInteger, toString, toUpper, transform, trim, trimEnd, trimStart, truncate, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, uniqueId, unset, unzip, unzipWith, update, updateWith, upperCase, upperFirst, values, valuesIn, without, words, wrap, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
require("../util/eq.js");
|
|
1
|
+
const require_eq = require("../util/eq.js");
|
|
3
2
|
const require_keys = require("./keys.js");
|
|
4
3
|
//#region src/compat/object/assign.ts
|
|
5
4
|
/**
|
|
@@ -26,7 +25,7 @@ function assignImpl(object, source) {
|
|
|
26
25
|
const keys$1 = require_keys.keys(source);
|
|
27
26
|
for (let i = 0; i < keys$1.length; i++) {
|
|
28
27
|
const key = keys$1[i];
|
|
29
|
-
if (!(key in object) || !
|
|
28
|
+
if (!(key in object) || !require_eq.eq(object[key], source[key])) object[key] = source[key];
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../util/eq.mjs";
|
|
1
|
+
import { eq } from "../util/eq.mjs";
|
|
3
2
|
import { keys } from "./keys.mjs";
|
|
4
3
|
//#region src/compat/object/assign.ts
|
|
5
4
|
/**
|
|
@@ -26,7 +25,7 @@ function assignImpl(object, source) {
|
|
|
26
25
|
const keys$1 = keys(source);
|
|
27
26
|
for (let i = 0; i < keys$1.length; i++) {
|
|
28
27
|
const key = keys$1[i];
|
|
29
|
-
if (!(key in object) || !
|
|
28
|
+
if (!(key in object) || !eq(object[key], source[key])) object[key] = source[key];
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
require("../util/eq.js");
|
|
1
|
+
const require_eq = require("../util/eq.js");
|
|
3
2
|
const require_keysIn = require("./keysIn.js");
|
|
4
3
|
//#region src/compat/object/assignIn.ts
|
|
5
4
|
/**
|
|
@@ -26,7 +25,7 @@ function assignInImpl(object, source) {
|
|
|
26
25
|
const keys = require_keysIn.keysIn(source);
|
|
27
26
|
for (let i = 0; i < keys.length; i++) {
|
|
28
27
|
const key = keys[i];
|
|
29
|
-
if (!(key in object) || !
|
|
28
|
+
if (!(key in object) || !require_eq.eq(object[key], source[key])) object[key] = source[key];
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../util/eq.mjs";
|
|
1
|
+
import { eq } from "../util/eq.mjs";
|
|
3
2
|
import { keysIn } from "./keysIn.mjs";
|
|
4
3
|
//#region src/compat/object/assignIn.ts
|
|
5
4
|
/**
|
|
@@ -26,7 +25,7 @@ function assignInImpl(object, source) {
|
|
|
26
25
|
const keys = keysIn(source);
|
|
27
26
|
for (let i = 0; i < keys.length; i++) {
|
|
28
27
|
const key = keys[i];
|
|
29
|
-
if (!(key in object) || !
|
|
28
|
+
if (!(key in object) || !eq(object[key], source[key])) object[key] = source[key];
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
require("../util/eq.js");
|
|
1
|
+
const require_eq = require("../util/eq.js");
|
|
3
2
|
const require_keysIn = require("./keysIn.js");
|
|
4
3
|
//#region src/compat/object/assignInWith.ts
|
|
5
4
|
/**
|
|
@@ -41,7 +40,7 @@ function assignInWithImpl(object, source, getValueToAssign) {
|
|
|
41
40
|
const objValue = object[key];
|
|
42
41
|
const srcValue = source[key];
|
|
43
42
|
const newValue = getValueToAssign?.(objValue, srcValue, key, object, source) ?? srcValue;
|
|
44
|
-
if (!(key in object) || !
|
|
43
|
+
if (!(key in object) || !require_eq.eq(objValue, newValue)) object[key] = newValue;
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../util/eq.mjs";
|
|
1
|
+
import { eq } from "../util/eq.mjs";
|
|
3
2
|
import { keysIn } from "./keysIn.mjs";
|
|
4
3
|
//#region src/compat/object/assignInWith.ts
|
|
5
4
|
/**
|
|
@@ -41,7 +40,7 @@ function assignInWithImpl(object, source, getValueToAssign) {
|
|
|
41
40
|
const objValue = object[key];
|
|
42
41
|
const srcValue = source[key];
|
|
43
42
|
const newValue = getValueToAssign?.(objValue, srcValue, key, object, source) ?? srcValue;
|
|
44
|
-
if (!(key in object) || !
|
|
43
|
+
if (!(key in object) || !eq(objValue, newValue)) object[key] = newValue;
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
require("../util/eq.js");
|
|
1
|
+
const require_eq = require("../util/eq.js");
|
|
3
2
|
const require_keys = require("./keys.js");
|
|
4
3
|
//#region src/compat/object/assignWith.ts
|
|
5
4
|
/**
|
|
@@ -41,7 +40,7 @@ function assignWithImpl(object, source, getValueToAssign) {
|
|
|
41
40
|
const objValue = object[key];
|
|
42
41
|
const srcValue = source[key];
|
|
43
42
|
const newValue = getValueToAssign?.(objValue, srcValue, key, object, source) ?? srcValue;
|
|
44
|
-
if (!(key in object) || !
|
|
43
|
+
if (!(key in object) || !require_eq.eq(objValue, newValue)) object[key] = newValue;
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../util/eq.mjs";
|
|
1
|
+
import { eq } from "../util/eq.mjs";
|
|
3
2
|
import { keys } from "./keys.mjs";
|
|
4
3
|
//#region src/compat/object/assignWith.ts
|
|
5
4
|
/**
|
|
@@ -41,7 +40,7 @@ function assignWithImpl(object, source, getValueToAssign) {
|
|
|
41
40
|
const objValue = object[key];
|
|
42
41
|
const srcValue = source[key];
|
|
43
42
|
const newValue = getValueToAssign?.(objValue, srcValue, key, object, source) ?? srcValue;
|
|
44
|
-
if (!(key in object) || !
|
|
43
|
+
if (!(key in object) || !eq(objValue, newValue)) object[key] = newValue;
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
require("../util/eq.js");
|
|
1
|
+
const require_eq = require("../util/eq.js");
|
|
3
2
|
const require_isNil = require("../../predicate/isNil.js");
|
|
4
3
|
const require_isIterateeCall = require("../_internal/isIterateeCall.js");
|
|
5
4
|
//#region src/compat/object/defaults.ts
|
|
@@ -38,7 +37,7 @@ function defaults(object, ...sources) {
|
|
|
38
37
|
for (let j = 0; j < keys.length; j++) {
|
|
39
38
|
const key = keys[j];
|
|
40
39
|
const value = object[key];
|
|
41
|
-
if (value === void 0 || !Object.hasOwn(object, key) &&
|
|
40
|
+
if (value === void 0 || !Object.hasOwn(object, key) && require_eq.eq(value, objectProto[key])) object[key] = source[key];
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
return object;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../util/eq.mjs";
|
|
1
|
+
import { eq } from "../util/eq.mjs";
|
|
3
2
|
import { isNil } from "../../predicate/isNil.mjs";
|
|
4
3
|
import { isIterateeCall } from "../_internal/isIterateeCall.mjs";
|
|
5
4
|
//#region src/compat/object/defaults.ts
|
|
@@ -38,7 +37,7 @@ function defaults(object, ...sources) {
|
|
|
38
37
|
for (let j = 0; j < keys.length; j++) {
|
|
39
38
|
const key = keys[j];
|
|
40
39
|
const value = object[key];
|
|
41
|
-
if (value === void 0 || !Object.hasOwn(object, key) &&
|
|
40
|
+
if (value === void 0 || !Object.hasOwn(object, key) && eq(value, objectProto[key])) object[key] = source[key];
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
return object;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const require_isPrimitive = require("../../predicate/isPrimitive.js");
|
|
2
|
-
const
|
|
3
|
-
require("../util/eq.js");
|
|
2
|
+
const require_eq = require("../util/eq.js");
|
|
4
3
|
const require_isObject = require("./isObject.js");
|
|
5
4
|
//#region src/compat/predicate/isMatchWith.ts
|
|
6
5
|
/**
|
|
@@ -86,14 +85,14 @@ function isMatchWithInternal(target, source, compare, stack, isRoot = false) {
|
|
|
86
85
|
case "object": return isObjectMatch(target, source, compare, stack);
|
|
87
86
|
case "function":
|
|
88
87
|
if (Object.keys(source).length > 0) return isMatchWithInternal(target, { ...source }, compare, stack, isRoot);
|
|
89
|
-
return
|
|
88
|
+
return require_eq.eq(target, source);
|
|
90
89
|
default:
|
|
91
|
-
if (!require_isObject.isObject(target)) return
|
|
90
|
+
if (!require_isObject.isObject(target)) return require_eq.eq(target, source);
|
|
92
91
|
if (isRoot) {
|
|
93
92
|
if (typeof source === "string") return source === "";
|
|
94
93
|
return true;
|
|
95
94
|
}
|
|
96
|
-
return
|
|
95
|
+
return require_eq.eq(target, source);
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
98
|
function isObjectMatch(target, source, compare, stack) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isPrimitive } from "../../predicate/isPrimitive.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import "../util/eq.mjs";
|
|
2
|
+
import { eq } from "../util/eq.mjs";
|
|
4
3
|
import { isObject } from "./isObject.mjs";
|
|
5
4
|
//#region src/compat/predicate/isMatchWith.ts
|
|
6
5
|
/**
|
|
@@ -86,14 +85,14 @@ function isMatchWithInternal(target, source, compare, stack, isRoot = false) {
|
|
|
86
85
|
case "object": return isObjectMatch(target, source, compare, stack);
|
|
87
86
|
case "function":
|
|
88
87
|
if (Object.keys(source).length > 0) return isMatchWithInternal(target, { ...source }, compare, stack, isRoot);
|
|
89
|
-
return
|
|
88
|
+
return eq(target, source);
|
|
90
89
|
default:
|
|
91
|
-
if (!isObject(target)) return
|
|
90
|
+
if (!isObject(target)) return eq(target, source);
|
|
92
91
|
if (isRoot) {
|
|
93
92
|
if (typeof source === "string") return source === "";
|
|
94
93
|
return true;
|
|
95
94
|
}
|
|
96
|
-
return
|
|
95
|
+
return eq(target, source);
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
98
|
function isObjectMatch(target, source, compare, stack) {
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { escape } from "./escape.mjs";
|
|
2
|
+
import { template } from "./template.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/compat/string/templateSettings.d.ts
|
|
5
|
+
declare const templateSettings: {
|
|
6
|
+
escape: RegExp;
|
|
7
|
+
evaluate: RegExp;
|
|
8
|
+
interpolate: RegExp;
|
|
9
|
+
variable: string;
|
|
10
|
+
imports: {
|
|
11
|
+
_: {
|
|
12
|
+
escape: typeof escape;
|
|
13
|
+
template: typeof template;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { templateSettings };
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { escape } from "./escape.js";
|
|
2
|
+
import { template } from "./template.js";
|
|
3
|
+
|
|
4
|
+
//#region src/compat/string/templateSettings.d.ts
|
|
5
|
+
declare const templateSettings: {
|
|
6
|
+
escape: RegExp;
|
|
7
|
+
evaluate: RegExp;
|
|
8
|
+
interpolate: RegExp;
|
|
9
|
+
variable: string;
|
|
10
|
+
imports: {
|
|
11
|
+
_: {
|
|
12
|
+
escape: typeof escape;
|
|
13
|
+
template: typeof template;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { templateSettings };
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/compat/util/eq.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Performs a `SameValueZero` comparison between two values to determine if they are equivalent.
|
|
4
|
+
*
|
|
5
|
+
* @param value The value to compare.
|
|
6
|
+
* @param other The other value to compare.
|
|
7
|
+
* @returns Returns `true` if the values are equivalent, else `false`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* eq(1, 1); // true
|
|
11
|
+
* eq(0, -0); // true
|
|
12
|
+
* eq(NaN, NaN); // true
|
|
13
|
+
* eq('a', Object('a')); // false
|
|
14
|
+
*/
|
|
15
|
+
declare function eq(value: any, other: any): boolean;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { eq };
|
package/dist/compat/util/eq.d.ts
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/compat/util/eq.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Performs a `SameValueZero` comparison between two values to determine if they are equivalent.
|
|
4
|
+
*
|
|
5
|
+
* @param value The value to compare.
|
|
6
|
+
* @param other The other value to compare.
|
|
7
|
+
* @returns Returns `true` if the values are equivalent, else `false`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* eq(1, 1); // true
|
|
11
|
+
* eq(0, -0); // true
|
|
12
|
+
* eq(NaN, NaN); // true
|
|
13
|
+
* eq('a', Object('a')); // false
|
|
14
|
+
*/
|
|
15
|
+
declare function eq(value: any, other: any): boolean;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { eq };
|
package/dist/compat/util/eq.js
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/compat/util/eq.ts
|
|
2
|
+
/**
|
|
3
|
+
* Performs a `SameValueZero` comparison between two values to determine if they are equivalent.
|
|
4
|
+
*
|
|
5
|
+
* @param value The value to compare.
|
|
6
|
+
* @param other The other value to compare.
|
|
7
|
+
* @returns Returns `true` if the values are equivalent, else `false`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* eq(1, 1); // true
|
|
11
|
+
* eq(0, -0); // true
|
|
12
|
+
* eq(NaN, NaN); // true
|
|
13
|
+
* eq('a', Object('a')); // false
|
|
14
|
+
*/
|
|
15
|
+
function eq(value, other) {
|
|
16
|
+
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.eq = eq;
|
package/dist/compat/util/eq.mjs
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/compat/util/eq.ts
|
|
2
|
+
/**
|
|
3
|
+
* Performs a `SameValueZero` comparison between two values to determine if they are equivalent.
|
|
4
|
+
*
|
|
5
|
+
* @param value The value to compare.
|
|
6
|
+
* @param other The other value to compare.
|
|
7
|
+
* @returns Returns `true` if the values are equivalent, else `false`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* eq(1, 1); // true
|
|
11
|
+
* eq(0, -0); // true
|
|
12
|
+
* eq(NaN, NaN); // true
|
|
13
|
+
* eq('a', Object('a')); // false
|
|
14
|
+
*/
|
|
15
|
+
function eq(value, other) {
|
|
16
|
+
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { eq };
|
package/dist/map/hasValue.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_eq = require("../compat/util/eq.js");
|
|
2
2
|
//#region src/map/hasValue.ts
|
|
3
3
|
/**
|
|
4
4
|
* Checks if a Map contains a specific value.
|
|
@@ -26,7 +26,7 @@ const require_isEqualsSameValueZero = require("../_internal/isEqualsSameValueZer
|
|
|
26
26
|
* // result2 will be: false
|
|
27
27
|
*/
|
|
28
28
|
function hasValue(map, searchElement) {
|
|
29
|
-
for (const value of map.values()) if (
|
|
29
|
+
for (const value of map.values()) if (require_eq.eq(value, searchElement)) return true;
|
|
30
30
|
return false;
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
package/dist/map/hasValue.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { eq } from "../compat/util/eq.mjs";
|
|
2
2
|
//#region src/map/hasValue.ts
|
|
3
3
|
/**
|
|
4
4
|
* Checks if a Map contains a specific value.
|
|
@@ -26,7 +26,7 @@ import { isEqualsSameValueZero } from "../_internal/isEqualsSameValueZero.mjs";
|
|
|
26
26
|
* // result2 will be: false
|
|
27
27
|
*/
|
|
28
28
|
function hasValue(map, searchElement) {
|
|
29
|
-
for (const value of map.values()) if (
|
|
29
|
+
for (const value of map.values()) if (eq(value, searchElement)) return true;
|
|
30
30
|
return false;
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
@@ -3,8 +3,7 @@ const require_getTag = require("../compat/_internal/getTag.js");
|
|
|
3
3
|
const require_tags = require("../compat/_internal/tags.js");
|
|
4
4
|
const require_isBuffer = require("./isBuffer.js");
|
|
5
5
|
const require_isPlainObject = require("./isPlainObject.js");
|
|
6
|
-
const
|
|
7
|
-
require("../compat/util/eq.js");
|
|
6
|
+
const require_eq = require("../compat/util/eq.js");
|
|
8
7
|
//#region src/predicate/isEqualWith.ts
|
|
9
8
|
/**
|
|
10
9
|
* Compares two values for equality using a custom comparison function.
|
|
@@ -71,7 +70,7 @@ function areObjectsEqual(a, b, stack, areValuesEqual) {
|
|
|
71
70
|
case require_tags.numberTag: {
|
|
72
71
|
const x = a.valueOf();
|
|
73
72
|
const y = b.valueOf();
|
|
74
|
-
return
|
|
73
|
+
return require_eq.eq(x, y);
|
|
75
74
|
}
|
|
76
75
|
case require_tags.booleanTag:
|
|
77
76
|
case require_tags.dateTag:
|
|
@@ -3,8 +3,7 @@ import { getTag } from "../compat/_internal/getTag.mjs";
|
|
|
3
3
|
import { arrayBufferTag, arrayTag, bigInt64ArrayTag, bigUint64ArrayTag, booleanTag, dataViewTag, dateTag, errorTag, float32ArrayTag, float64ArrayTag, functionTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag } from "../compat/_internal/tags.mjs";
|
|
4
4
|
import { isBuffer } from "./isBuffer.mjs";
|
|
5
5
|
import { isPlainObject } from "./isPlainObject.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import "../compat/util/eq.mjs";
|
|
6
|
+
import { eq } from "../compat/util/eq.mjs";
|
|
8
7
|
//#region src/predicate/isEqualWith.ts
|
|
9
8
|
/**
|
|
10
9
|
* Compares two values for equality using a custom comparison function.
|
|
@@ -68,7 +67,7 @@ function areObjectsEqual(a, b, stack, areValuesEqual) {
|
|
|
68
67
|
if (aTag !== bTag) return false;
|
|
69
68
|
switch (aTag) {
|
|
70
69
|
case stringTag: return a.toString() === b.toString();
|
|
71
|
-
case numberTag: return
|
|
70
|
+
case numberTag: return eq(a.valueOf(), b.valueOf());
|
|
72
71
|
case booleanTag:
|
|
73
72
|
case dateTag:
|
|
74
73
|
case symbolTag: return Object.is(a.valueOf(), b.valueOf());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-toolkit",
|
|
3
|
-
"version": "1.49.0-dev.
|
|
3
|
+
"version": "1.49.0-dev.1959+517d2998",
|
|
4
4
|
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
|
|
5
5
|
"homepage": "https://es-toolkit.dev",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//#region src/_internal/isEqualsSameValueZero.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Performs a `SameValueZero` comparison between two values to determine if they are equivalent.
|
|
4
|
-
*
|
|
5
|
-
* @param {any} value - The value to compare.
|
|
6
|
-
* @param {any} other - The other value to compare.
|
|
7
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* eq(1, 1); // true
|
|
11
|
-
* eq(0, -0); // true
|
|
12
|
-
* eq(NaN, NaN); // true
|
|
13
|
-
* eq('a', Object('a')); // false
|
|
14
|
-
*/
|
|
15
|
-
declare function isEqualsSameValueZero(value: any, other: any): boolean;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { isEqualsSameValueZero };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//#region src/_internal/isEqualsSameValueZero.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Performs a `SameValueZero` comparison between two values to determine if they are equivalent.
|
|
4
|
-
*
|
|
5
|
-
* @param {any} value - The value to compare.
|
|
6
|
-
* @param {any} other - The other value to compare.
|
|
7
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* eq(1, 1); // true
|
|
11
|
-
* eq(0, -0); // true
|
|
12
|
-
* eq(NaN, NaN); // true
|
|
13
|
-
* eq('a', Object('a')); // false
|
|
14
|
-
*/
|
|
15
|
-
declare function isEqualsSameValueZero(value: any, other: any): boolean;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { isEqualsSameValueZero };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//#region src/_internal/isEqualsSameValueZero.ts
|
|
2
|
-
/**
|
|
3
|
-
* Performs a `SameValueZero` comparison between two values to determine if they are equivalent.
|
|
4
|
-
*
|
|
5
|
-
* @param {any} value - The value to compare.
|
|
6
|
-
* @param {any} other - The other value to compare.
|
|
7
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* eq(1, 1); // true
|
|
11
|
-
* eq(0, -0); // true
|
|
12
|
-
* eq(NaN, NaN); // true
|
|
13
|
-
* eq('a', Object('a')); // false
|
|
14
|
-
*/
|
|
15
|
-
function isEqualsSameValueZero(value, other) {
|
|
16
|
-
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
exports.isEqualsSameValueZero = isEqualsSameValueZero;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//#region src/_internal/isEqualsSameValueZero.ts
|
|
2
|
-
/**
|
|
3
|
-
* Performs a `SameValueZero` comparison between two values to determine if they are equivalent.
|
|
4
|
-
*
|
|
5
|
-
* @param {any} value - The value to compare.
|
|
6
|
-
* @param {any} other - The other value to compare.
|
|
7
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* eq(1, 1); // true
|
|
11
|
-
* eq(0, -0); // true
|
|
12
|
-
* eq(NaN, NaN); // true
|
|
13
|
-
* eq('a', Object('a')); // false
|
|
14
|
-
*/
|
|
15
|
-
function isEqualsSameValueZero(value, other) {
|
|
16
|
-
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
export { isEqualsSameValueZero };
|