inferred-types 1.0.1 → 1.1.0
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/constants/dist/index.cjs +2 -1
- package/modules/constants/dist/index.cjs.map +1 -1
- package/modules/constants/dist/index.d.cts +1 -1
- package/modules/constants/dist/index.d.cts.map +1 -1
- package/modules/constants/dist/index.d.ts +1 -1
- package/modules/constants/dist/index.d.ts.map +1 -1
- package/modules/constants/dist/index.js +2 -1
- package/modules/constants/dist/index.js.map +1 -1
- package/modules/runtime/dist/index.cjs +6 -1
- package/modules/runtime/dist/index.cjs.map +1 -1
- package/modules/runtime/dist/index.d.cts +1 -1
- package/modules/runtime/dist/index.d.cts.map +1 -1
- package/modules/runtime/dist/index.d.ts +1 -1
- package/modules/runtime/dist/index.d.ts.map +1 -1
- package/modules/runtime/dist/index.js +6 -1
- package/modules/runtime/dist/index.js.map +1 -1
- package/modules/types/dist/index.d.cts +13025 -12989
- package/modules/types/dist/index.d.cts.map +1 -1
- package/modules/types/dist/index.d.ts +13025 -12989
- package/modules/types/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -233,7 +233,8 @@ const COMPARISON_OPERATIONS = [
|
|
|
233
233
|
"false",
|
|
234
234
|
"returnEquals",
|
|
235
235
|
"returnExtends",
|
|
236
|
-
"isTemplateLiteral"
|
|
236
|
+
"isTemplateLiteral",
|
|
237
|
+
"hasLength"
|
|
237
238
|
];
|
|
238
239
|
|
|
239
240
|
//#endregion
|
|
@@ -8693,6 +8694,10 @@ function handle_other(val, op, params) {
|
|
|
8693
8694
|
if (!(val instanceof Error)) return false;
|
|
8694
8695
|
if (!params[0]) return err(`invalid-params/errorsOfType`, `The 'errorsOfType' operation requires a type parameter`, { params });
|
|
8695
8696
|
return "type" in val && val.type === params[0];
|
|
8697
|
+
case "hasLength": if (isString(val)) return isNarrowableArray(params) && contains(params, val.length);
|
|
8698
|
+
else if (isNumber(val)) return isNarrowableArray(params) && contains(params, `${val}`.length);
|
|
8699
|
+
else if (isArray(val)) return isNarrowableArray(params) && contains(params, val.length);
|
|
8700
|
+
else return false;
|
|
8696
8701
|
case "returnEquals":
|
|
8697
8702
|
if (!isFunction(val)) return false;
|
|
8698
8703
|
return err(`compare/runtime`, `The comparison type "returnEquals" can not be evaluated in the runtime system!`);
|