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
|
@@ -2713,6 +2713,7 @@ var TYPE_TRANSFORMS = {
|
|
|
2713
2713
|
};
|
|
2714
2714
|
|
|
2715
2715
|
// ../runtime/dist/index.js
|
|
2716
|
+
import { log } from "node:console";
|
|
2716
2717
|
function asEscapeFunction(fn2) {
|
|
2717
2718
|
return createFnWithProps(fn2, { escape: true });
|
|
2718
2719
|
}
|
|
@@ -4872,6 +4873,16 @@ function ifChar(ch, callback_if_match = def_if, callback_not_match = def_else) {
|
|
|
4872
4873
|
function ifContainer(value, ifContainer2, notContainer) {
|
|
4873
4874
|
return isObject(value) || isArray(value) ? ifContainer2(value) : notContainer(value);
|
|
4874
4875
|
}
|
|
4876
|
+
function ifEqual(comparator) {
|
|
4877
|
+
return (val, ifTrue2, ifFalse2 = (v) => v) => {
|
|
4878
|
+
log({ val, comparator });
|
|
4879
|
+
if (JSON.stringify(comparator) === JSON.stringify(val)) {
|
|
4880
|
+
return ifTrue2(val);
|
|
4881
|
+
} else {
|
|
4882
|
+
return ifFalse2(val);
|
|
4883
|
+
}
|
|
4884
|
+
};
|
|
4885
|
+
}
|
|
4875
4886
|
function ifFalse(val, ifVal, elseVal) {
|
|
4876
4887
|
return isFalse(val) ? ifVal : elseVal;
|
|
4877
4888
|
}
|
|
@@ -6154,7 +6165,7 @@ function isDefined(value) {
|
|
|
6154
6165
|
return value !== void 0;
|
|
6155
6166
|
}
|
|
6156
6167
|
function isDoneFn(val) {
|
|
6157
|
-
return
|
|
6168
|
+
return isObject(val) && "done" in val && typeof val.done === "function";
|
|
6158
6169
|
}
|
|
6159
6170
|
function isEmail(val) {
|
|
6160
6171
|
if (!isString(val)) {
|
|
@@ -6208,6 +6219,12 @@ function isNotNull(value) {
|
|
|
6208
6219
|
function isNull(value) {
|
|
6209
6220
|
return value === null;
|
|
6210
6221
|
}
|
|
6222
|
+
function isSymbol(value) {
|
|
6223
|
+
return typeof value === "symbol";
|
|
6224
|
+
}
|
|
6225
|
+
function isObjectKey(val) {
|
|
6226
|
+
return isString(val) || isSymbol(val);
|
|
6227
|
+
}
|
|
6211
6228
|
function maybePhoneNumber(val) {
|
|
6212
6229
|
const svelte = String(val).trim();
|
|
6213
6230
|
const chars = svelte.split("");
|
|
@@ -6277,9 +6294,6 @@ function isLikeRegExp(val) {
|
|
|
6277
6294
|
}
|
|
6278
6295
|
return false;
|
|
6279
6296
|
}
|
|
6280
|
-
function isSymbol(value) {
|
|
6281
|
-
return typeof value === "symbol";
|
|
6282
|
-
}
|
|
6283
6297
|
function isScalar(value) {
|
|
6284
6298
|
return isString(value) || isNumber(value) || isSymbol(value) || isNull(value);
|
|
6285
6299
|
}
|
|
@@ -7063,6 +7077,27 @@ function logicalReturns(conditions) {
|
|
|
7063
7077
|
(c) => isBoolean(c) ? c : isFunction(c) ? c() : Never2
|
|
7064
7078
|
);
|
|
7065
7079
|
}
|
|
7080
|
+
function mapOver(input, toArray = false) {
|
|
7081
|
+
const kind = {
|
|
7082
|
+
kind: Array.isArray(input) ? "MapOverArray" : isObject(input) && isTrue(toArray) ? "MapOverObjectToArray" : isObject(input) ? "MapOverObject" : Never2
|
|
7083
|
+
};
|
|
7084
|
+
const fn2 = (cb) => {
|
|
7085
|
+
let output = isTrue(toArray) ? [] : isArray(input) ? [] : {};
|
|
7086
|
+
const kvs = isObject(input) ? toKeyValue(input) : input;
|
|
7087
|
+
for (const kv of kvs) {
|
|
7088
|
+
if (isObject(output) && isObject(input)) {
|
|
7089
|
+
output = {
|
|
7090
|
+
...output,
|
|
7091
|
+
[kv.key]: cb(kv)
|
|
7092
|
+
};
|
|
7093
|
+
} else if (isArray(output)) {
|
|
7094
|
+
output.push(cb(kv));
|
|
7095
|
+
}
|
|
7096
|
+
}
|
|
7097
|
+
return output;
|
|
7098
|
+
};
|
|
7099
|
+
return createFnWithProps(fn2, kind);
|
|
7100
|
+
}
|
|
7066
7101
|
function reverse(list2) {
|
|
7067
7102
|
return [...list2].reverse();
|
|
7068
7103
|
}
|
|
@@ -8635,6 +8670,7 @@ export {
|
|
|
8635
8670
|
ifChar,
|
|
8636
8671
|
ifContainer,
|
|
8637
8672
|
ifDefined,
|
|
8673
|
+
ifEqual,
|
|
8638
8674
|
ifFalse,
|
|
8639
8675
|
ifFunction,
|
|
8640
8676
|
ifHasKey,
|
|
@@ -8793,6 +8829,7 @@ export {
|
|
|
8793
8829
|
isNumericArray,
|
|
8794
8830
|
isNumericString,
|
|
8795
8831
|
isObject,
|
|
8832
|
+
isObjectKey,
|
|
8796
8833
|
isObjectToken,
|
|
8797
8834
|
isOptionalParamFunction,
|
|
8798
8835
|
isPhoneNumber,
|
|
@@ -8928,6 +8965,7 @@ export {
|
|
|
8928
8965
|
lookupCountryCode,
|
|
8929
8966
|
lookupCountryName,
|
|
8930
8967
|
lowercase,
|
|
8968
|
+
mapOver,
|
|
8931
8969
|
maybePhoneNumber,
|
|
8932
8970
|
mergeObjects,
|
|
8933
8971
|
mergeScalars,
|