@augment-vir/common
Advanced tools
Comparing version 13.2.4 to 13.3.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isLengthAtLeast = void 0; | ||
exports.assertLengthAtLeast = exports.isLengthAtLeast = void 0; | ||
function isLengthAtLeast(array, length) { | ||
return array.length >= length; | ||
try { | ||
assertLengthAtLeast(array, length); | ||
return true; | ||
} | ||
catch (error) { | ||
return false; | ||
} | ||
} | ||
exports.isLengthAtLeast = isLengthAtLeast; | ||
function assertLengthAtLeast(array, length, arrayName) { | ||
if (array.length < length) { | ||
throw new Error(arrayName | ||
? `'${arrayName}' is not at least '${length}' in length.` | ||
: `Array is not at least '${length}' in length.`); | ||
} | ||
} | ||
exports.assertLengthAtLeast = assertLengthAtLeast; |
export function isLengthAtLeast(array, length) { | ||
return array.length >= length; | ||
try { | ||
assertLengthAtLeast(array, length); | ||
return true; | ||
} | ||
catch (error) { | ||
return false; | ||
} | ||
} | ||
export function assertLengthAtLeast(array, length, arrayName) { | ||
if (array.length < length) { | ||
throw new Error(arrayName | ||
? `'${arrayName}' is not at least '${length}' in length.` | ||
: `Array is not at least '${length}' in length.`); | ||
} | ||
} |
@@ -8,2 +8,3 @@ export type Tuple<ArrayElementGeneric, LengthGeneric extends number> = LengthGeneric extends LengthGeneric ? number extends LengthGeneric ? ArrayElementGeneric[] : _TupleOf<ArrayElementGeneric, LengthGeneric, []> : never; | ||
export declare function isLengthAtLeast<ArrayElementGeneric, LengthGeneric extends number>(array: ReadonlyArray<ArrayElementGeneric | undefined>, length: LengthGeneric): array is AtLeastTuple<ArrayElementGeneric, LengthGeneric>; | ||
export declare function assertLengthAtLeast<ArrayElementGeneric, LengthGeneric extends number>(array: ReadonlyArray<ArrayElementGeneric | undefined>, length: LengthGeneric, arrayName?: string): asserts array is AtLeastTuple<ArrayElementGeneric, LengthGeneric>; | ||
export {}; |
{ | ||
"name": "@augment-vir/common", | ||
"version": "13.2.4", | ||
"version": "13.3.0", | ||
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common", | ||
@@ -5,0 +5,0 @@ "bugs": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138096
3231