inferred-types 0.55.21 → 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.
@@ -323,6 +323,7 @@ __export(index_exports, {
323
323
  ifChar: () => ifChar,
324
324
  ifContainer: () => ifContainer,
325
325
  ifDefined: () => ifDefined,
326
+ ifEqual: () => ifEqual,
326
327
  ifFalse: () => ifFalse,
327
328
  ifFunction: () => ifFunction,
328
329
  ifHasKey: () => ifHasKey,
@@ -481,6 +482,7 @@ __export(index_exports, {
481
482
  isNumericArray: () => isNumericArray,
482
483
  isNumericString: () => isNumericString,
483
484
  isObject: () => isObject,
485
+ isObjectKey: () => isObjectKey,
484
486
  isObjectToken: () => isObjectToken,
485
487
  isOptionalParamFunction: () => isOptionalParamFunction,
486
488
  isPhoneNumber: () => isPhoneNumber,
@@ -616,6 +618,7 @@ __export(index_exports, {
616
618
  lookupCountryCode: () => lookupCountryCode,
617
619
  lookupCountryName: () => lookupCountryName,
618
620
  lowercase: () => lowercase,
621
+ mapOver: () => mapOver,
619
622
  maybePhoneNumber: () => maybePhoneNumber,
620
623
  mergeObjects: () => mergeObjects,
621
624
  mergeScalars: () => mergeScalars,
@@ -3429,6 +3432,7 @@ var TYPE_TRANSFORMS = {
3429
3432
  };
3430
3433
 
3431
3434
  // ../runtime/dist/index.js
3435
+ var import_node_console = require("console");
3432
3436
  function asEscapeFunction(fn2) {
3433
3437
  return createFnWithProps(fn2, { escape: true });
3434
3438
  }
@@ -5588,6 +5592,16 @@ function ifChar(ch, callback_if_match = def_if, callback_not_match = def_else) {
5588
5592
  function ifContainer(value, ifContainer2, notContainer) {
5589
5593
  return isObject(value) || isArray(value) ? ifContainer2(value) : notContainer(value);
5590
5594
  }
5595
+ function ifEqual(comparator) {
5596
+ return (val, ifTrue2, ifFalse2 = (v) => v) => {
5597
+ (0, import_node_console.log)({ val, comparator });
5598
+ if (JSON.stringify(comparator) === JSON.stringify(val)) {
5599
+ return ifTrue2(val);
5600
+ } else {
5601
+ return ifFalse2(val);
5602
+ }
5603
+ };
5604
+ }
5591
5605
  function ifFalse(val, ifVal, elseVal) {
5592
5606
  return isFalse(val) ? ifVal : elseVal;
5593
5607
  }
@@ -6870,7 +6884,7 @@ function isDefined(value) {
6870
6884
  return value !== void 0;
6871
6885
  }
6872
6886
  function isDoneFn(val) {
6873
- return hasKeys("done")(val) && typeof val.done === "function";
6887
+ return isObject(val) && "done" in val && typeof val.done === "function";
6874
6888
  }
6875
6889
  function isEmail(val) {
6876
6890
  if (!isString(val)) {
@@ -6924,6 +6938,12 @@ function isNotNull(value) {
6924
6938
  function isNull(value) {
6925
6939
  return value === null;
6926
6940
  }
6941
+ function isSymbol(value) {
6942
+ return typeof value === "symbol";
6943
+ }
6944
+ function isObjectKey(val) {
6945
+ return isString(val) || isSymbol(val);
6946
+ }
6927
6947
  function maybePhoneNumber(val) {
6928
6948
  const svelte = String(val).trim();
6929
6949
  const chars = svelte.split("");
@@ -6993,9 +7013,6 @@ function isLikeRegExp(val) {
6993
7013
  }
6994
7014
  return false;
6995
7015
  }
6996
- function isSymbol(value) {
6997
- return typeof value === "symbol";
6998
- }
6999
7016
  function isScalar(value) {
7000
7017
  return isString(value) || isNumber(value) || isSymbol(value) || isNull(value);
7001
7018
  }
@@ -7779,6 +7796,27 @@ function logicalReturns(conditions) {
7779
7796
  (c) => isBoolean(c) ? c : isFunction(c) ? c() : Never2
7780
7797
  );
7781
7798
  }
7799
+ function mapOver(input, toArray = false) {
7800
+ const kind = {
7801
+ kind: Array.isArray(input) ? "MapOverArray" : isObject(input) && isTrue(toArray) ? "MapOverObjectToArray" : isObject(input) ? "MapOverObject" : Never2
7802
+ };
7803
+ const fn2 = (cb) => {
7804
+ let output = isTrue(toArray) ? [] : isArray(input) ? [] : {};
7805
+ const kvs = isObject(input) ? toKeyValue(input) : input;
7806
+ for (const kv of kvs) {
7807
+ if (isObject(output) && isObject(input)) {
7808
+ output = {
7809
+ ...output,
7810
+ [kv.key]: cb(kv)
7811
+ };
7812
+ } else if (isArray(output)) {
7813
+ output.push(cb(kv));
7814
+ }
7815
+ }
7816
+ return output;
7817
+ };
7818
+ return createFnWithProps(fn2, kind);
7819
+ }
7782
7820
  function reverse(list2) {
7783
7821
  return [...list2].reverse();
7784
7822
  }
@@ -9352,6 +9390,7 @@ var ExifSaturation = /* @__PURE__ */ ((ExifSaturation2) => {
9352
9390
  ifChar,
9353
9391
  ifContainer,
9354
9392
  ifDefined,
9393
+ ifEqual,
9355
9394
  ifFalse,
9356
9395
  ifFunction,
9357
9396
  ifHasKey,
@@ -9510,6 +9549,7 @@ var ExifSaturation = /* @__PURE__ */ ((ExifSaturation2) => {
9510
9549
  isNumericArray,
9511
9550
  isNumericString,
9512
9551
  isObject,
9552
+ isObjectKey,
9513
9553
  isObjectToken,
9514
9554
  isOptionalParamFunction,
9515
9555
  isPhoneNumber,
@@ -9645,6 +9685,7 @@ var ExifSaturation = /* @__PURE__ */ ((ExifSaturation2) => {
9645
9685
  lookupCountryCode,
9646
9686
  lookupCountryName,
9647
9687
  lowercase,
9688
+ mapOver,
9648
9689
  maybePhoneNumber,
9649
9690
  mergeObjects,
9650
9691
  mergeScalars,