inferred-types 0.55.22 → 0.55.23
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/modules/inferred-types/dist/index.cjs +45 -4
- package/modules/inferred-types/dist/index.cjs.map +1 -1
- package/modules/inferred-types/dist/index.d.ts +207 -115
- package/modules/inferred-types/dist/index.js +42 -4
- package/modules/inferred-types/dist/index.js.map +1 -1
- package/modules/runtime/dist/index.cjs +53 -6
- package/modules/runtime/dist/index.cjs.map +1 -1
- package/modules/runtime/dist/index.d.ts +81 -52
- package/modules/runtime/dist/index.js +50 -6
- package/modules/runtime/dist/index.js.map +1 -1
- package/modules/types/dist/index.d.ts +127 -64
- package/package.json +1 -1
|
@@ -119,6 +119,7 @@ __export(index_exports, {
|
|
|
119
119
|
ifChar: () => ifChar,
|
|
120
120
|
ifContainer: () => ifContainer,
|
|
121
121
|
ifDefined: () => ifDefined,
|
|
122
|
+
ifEqual: () => ifEqual,
|
|
122
123
|
ifFalse: () => ifFalse,
|
|
123
124
|
ifFunction: () => ifFunction,
|
|
124
125
|
ifHasKey: () => ifHasKey,
|
|
@@ -277,6 +278,7 @@ __export(index_exports, {
|
|
|
277
278
|
isNumericArray: () => isNumericArray,
|
|
278
279
|
isNumericString: () => isNumericString,
|
|
279
280
|
isObject: () => isObject,
|
|
281
|
+
isObjectKey: () => isObjectKey,
|
|
280
282
|
isObjectToken: () => isObjectToken,
|
|
281
283
|
isOptionalParamFunction: () => isOptionalParamFunction,
|
|
282
284
|
isPhoneNumber: () => isPhoneNumber,
|
|
@@ -412,6 +414,7 @@ __export(index_exports, {
|
|
|
412
414
|
lookupCountryCode: () => lookupCountryCode,
|
|
413
415
|
lookupCountryName: () => lookupCountryName,
|
|
414
416
|
lowercase: () => lowercase,
|
|
417
|
+
mapOver: () => mapOver,
|
|
415
418
|
maybePhoneNumber: () => maybePhoneNumber,
|
|
416
419
|
mergeObjects: () => mergeObjects,
|
|
417
420
|
mergeScalars: () => mergeScalars,
|
|
@@ -2687,6 +2690,19 @@ function ifContainer(value, ifContainer2, notContainer) {
|
|
|
2687
2690
|
return isObject(value) || isArray(value) ? ifContainer2(value) : notContainer(value);
|
|
2688
2691
|
}
|
|
2689
2692
|
|
|
2693
|
+
// src/boolean-logic/ifEqual.ts
|
|
2694
|
+
var import_node_console = require("console");
|
|
2695
|
+
function ifEqual(comparator) {
|
|
2696
|
+
return (val, ifTrue2, ifFalse2 = (v) => v) => {
|
|
2697
|
+
(0, import_node_console.log)({ val, comparator });
|
|
2698
|
+
if (JSON.stringify(comparator) === JSON.stringify(val)) {
|
|
2699
|
+
return ifTrue2(val);
|
|
2700
|
+
} else {
|
|
2701
|
+
return ifFalse2(val);
|
|
2702
|
+
}
|
|
2703
|
+
};
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2690
2706
|
// src/boolean-logic/ifFalse.ts
|
|
2691
2707
|
function ifFalse(val, ifVal, elseVal) {
|
|
2692
2708
|
return isFalse(val) ? ifVal : elseVal;
|
|
@@ -4226,7 +4242,7 @@ function isDefined(value) {
|
|
|
4226
4242
|
|
|
4227
4243
|
// src/type-guards/isDoneFn.ts
|
|
4228
4244
|
function isDoneFn(val) {
|
|
4229
|
-
return
|
|
4245
|
+
return isObject(val) && "done" in val && typeof val.done === "function";
|
|
4230
4246
|
}
|
|
4231
4247
|
|
|
4232
4248
|
// src/type-guards/isEmail.ts
|
|
@@ -4309,6 +4325,16 @@ function isNull(value) {
|
|
|
4309
4325
|
return value === null;
|
|
4310
4326
|
}
|
|
4311
4327
|
|
|
4328
|
+
// src/type-guards/isSymbol.ts
|
|
4329
|
+
function isSymbol(value) {
|
|
4330
|
+
return typeof value === "symbol";
|
|
4331
|
+
}
|
|
4332
|
+
|
|
4333
|
+
// src/type-guards/isObjectKey.ts
|
|
4334
|
+
function isObjectKey(val) {
|
|
4335
|
+
return isString(val) || isSymbol(val);
|
|
4336
|
+
}
|
|
4337
|
+
|
|
4312
4338
|
// src/type-guards/isPhoneNumber.ts
|
|
4313
4339
|
function maybePhoneNumber(val) {
|
|
4314
4340
|
const svelte = String(val).trim();
|
|
@@ -4386,11 +4412,6 @@ function isLikeRegExp(val) {
|
|
|
4386
4412
|
return false;
|
|
4387
4413
|
}
|
|
4388
4414
|
|
|
4389
|
-
// src/type-guards/isSymbol.ts
|
|
4390
|
-
function isSymbol(value) {
|
|
4391
|
-
return typeof value === "symbol";
|
|
4392
|
-
}
|
|
4393
|
-
|
|
4394
4415
|
// src/type-guards/isScalar.ts
|
|
4395
4416
|
function isScalar(value) {
|
|
4396
4417
|
return isString(value) || isNumber(value) || isSymbol(value) || isNull(value);
|
|
@@ -5306,6 +5327,29 @@ function logicalReturns(conditions) {
|
|
|
5306
5327
|
);
|
|
5307
5328
|
}
|
|
5308
5329
|
|
|
5330
|
+
// src/lists/mapOver.ts
|
|
5331
|
+
function mapOver(input, toArray = false) {
|
|
5332
|
+
const kind = {
|
|
5333
|
+
kind: Array.isArray(input) ? "MapOverArray" : isObject(input) && isTrue(toArray) ? "MapOverObjectToArray" : isObject(input) ? "MapOverObject" : Never
|
|
5334
|
+
};
|
|
5335
|
+
const fn2 = (cb) => {
|
|
5336
|
+
let output = isTrue(toArray) ? [] : isArray(input) ? [] : {};
|
|
5337
|
+
const kvs = isObject(input) ? toKeyValue(input) : input;
|
|
5338
|
+
for (const kv of kvs) {
|
|
5339
|
+
if (isObject(output) && isObject(input)) {
|
|
5340
|
+
output = {
|
|
5341
|
+
...output,
|
|
5342
|
+
[kv.key]: cb(kv)
|
|
5343
|
+
};
|
|
5344
|
+
} else if (isArray(output)) {
|
|
5345
|
+
output.push(cb(kv));
|
|
5346
|
+
}
|
|
5347
|
+
}
|
|
5348
|
+
return output;
|
|
5349
|
+
};
|
|
5350
|
+
return createFnWithProps(fn2, kind);
|
|
5351
|
+
}
|
|
5352
|
+
|
|
5309
5353
|
// src/lists/reverse.ts
|
|
5310
5354
|
function reverse(list2) {
|
|
5311
5355
|
return [...list2].reverse();
|
|
@@ -6647,6 +6691,7 @@ function asVueRef(value) {
|
|
|
6647
6691
|
ifChar,
|
|
6648
6692
|
ifContainer,
|
|
6649
6693
|
ifDefined,
|
|
6694
|
+
ifEqual,
|
|
6650
6695
|
ifFalse,
|
|
6651
6696
|
ifFunction,
|
|
6652
6697
|
ifHasKey,
|
|
@@ -6805,6 +6850,7 @@ function asVueRef(value) {
|
|
|
6805
6850
|
isNumericArray,
|
|
6806
6851
|
isNumericString,
|
|
6807
6852
|
isObject,
|
|
6853
|
+
isObjectKey,
|
|
6808
6854
|
isObjectToken,
|
|
6809
6855
|
isOptionalParamFunction,
|
|
6810
6856
|
isPhoneNumber,
|
|
@@ -6940,6 +6986,7 @@ function asVueRef(value) {
|
|
|
6940
6986
|
lookupCountryCode,
|
|
6941
6987
|
lookupCountryName,
|
|
6942
6988
|
lowercase,
|
|
6989
|
+
mapOver,
|
|
6943
6990
|
maybePhoneNumber,
|
|
6944
6991
|
mergeObjects,
|
|
6945
6992
|
mergeScalars,
|