Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
20230729A
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoalh committed Jul 29, 2023
1 parent b160d1c commit 2c876c2
Show file tree
Hide file tree
Showing 78 changed files with 1,158 additions and 2,111 deletions.
16 changes: 6 additions & 10 deletions dist/array.d.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
/**
* @function isArrayStrict
* @description Whether the array is not contain custom defined properties.
* Determine whether the array is not contain custom defined properties.
* @param {unknown[]} item Item that need to determine.
* @returns {boolean} Determine result.
*/
declare function isArrayStrict(item: unknown[]): boolean;
export declare function isArrayStrict(item: unknown[]): boolean;
/**
* @function isArrayUniqueReference
* @description Whether the array is contain unique references.
* Determine whether the array is contain unique references.
* @param {unknown[]} item Item that need to determine.
* @returns {boolean} Determine result.
*/
declare function isArrayUniqueReference(item: unknown[]): boolean;
export declare function isArrayUniqueReference(item: unknown[]): boolean;
/**
* @function isArrayUnique
* @description Whether the array is contain unique elements.
* Determine whether the array is contain unique elements.
* @param {unknown[]} item Item that need to determine.
* @returns {boolean} Determine result.
*/
declare function isArrayUnique(item: unknown[]): boolean;
export { isArrayStrict, isArrayUnique, isArrayUniqueReference };
export declare function isArrayUnique(item: unknown[]): boolean;
//# sourceMappingURL=array.d.ts.map
2 changes: 1 addition & 1 deletion dist/array.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 6 additions & 10 deletions dist/array.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import equal from "@hugoalh/equal";
const arrayIndexRegExp = /^(?:0|[1-9]\d*)$/u;
/**
* @function isArrayStrict
* @description Whether the array is not contain custom defined properties.
* Determine whether the array is not contain custom defined properties.
* @param {unknown[]} item Item that need to determine.
* @returns {boolean} Determine result.
*/
function isArrayStrict(item) {
export function isArrayStrict(item) {
let itemPrototype = Object.getPrototypeOf(item);
if ((itemPrototype !== null && itemPrototype !== Array.prototype) ||
Object.getOwnPropertySymbols(item).length > 0) {
Expand Down Expand Up @@ -43,21 +42,19 @@ function isArrayStrict(item) {
return true;
}
/**
* @function isArrayUniqueReference
* @description Whether the array is contain unique references.
* Determine whether the array is contain unique references.
* @param {unknown[]} item Item that need to determine.
* @returns {boolean} Determine result.
*/
function isArrayUniqueReference(item) {
export function isArrayUniqueReference(item) {
return (new Set(item).size === item.length);
}
/**
* @function isArrayUnique
* @description Whether the array is contain unique elements.
* Determine whether the array is contain unique elements.
* @param {unknown[]} item Item that need to determine.
* @returns {boolean} Determine result.
*/
function isArrayUnique(item) {
export function isArrayUnique(item) {
if (!isArrayUniqueReference(item)) {
return false;
}
Expand All @@ -73,4 +70,3 @@ function isArrayUnique(item) {
}
return true;
}
export { isArrayStrict, isArrayUnique, isArrayUniqueReference };
37 changes: 15 additions & 22 deletions dist/bigint.d.ts
Original file line number Diff line number Diff line change
@@ -1,53 +1,46 @@
import { type IntegralNumericTypeEnumKeysType } from "./internal/enum.js";
/**
* @function isBigIntEven
* @description Whether the big integer is even.
* Determine whether the big integer is even.
* @param {bigint} item Item that need to determine.
* @returns {boolean} Determine result.
*/
declare function isBigIntEven(item: bigint): boolean;
export declare function isBigIntEven(item: bigint): boolean;
/**
* @function isBigIntIntegralNumericType
* @description Whether the big integer is match the specified integral numeric type.
* Determine whether the big integer is match the specified integral numeric type.
* @param {IntegralNumericTypeEnumKeysType} typeName Name of the integral numeric type.
* @param {bigint} item Item that need to determine.
* @returns {boolean} Determine result.
*/
declare function isBigIntIntegralNumericType(typeName: IntegralNumericTypeEnumKeysType, item: bigint): boolean;
export declare function isBigIntIntegralNumericType(typeName: IntegralNumericTypeEnumKeysType, item: bigint): boolean;
/**
* @function isBigIntNegative
* @description Whether the big integer is negative.
* Determine whether the big integer is negative.
* @param {bigint} item Item that need to determine.
* @returns {boolean} Determine result.
*/
declare function isBigIntNegative(item: bigint): boolean;
export declare function isBigIntNegative(item: bigint): boolean;
/**
* @function isBigIntOdd
* @description Whether the big integer is odd.
* Determine whether the big integer is odd.
* @param {bigint} item Item that need to determine.
* @returns {boolean} Determine result.
*/
declare function isBigIntOdd(item: bigint): boolean;
export declare function isBigIntOdd(item: bigint): boolean;
/**
* @function isBigIntPositive
* @description Whether the big integer is positive.
* Determine whether the big integer is positive.
* @param {bigint} item Item that need to determine.
* @returns {boolean} Determine result.
*/
declare function isBigIntPositive(item: bigint): boolean;
export declare function isBigIntPositive(item: bigint): boolean;
/**
* @function isBigIntPrime
* @description Whether the big integer is prime.
* Determine whether the big integer is prime.
* @param {bigint} item Item that need to determine.
* @returns {boolean} Determine result.
*/
declare function isBigIntPrime(item: bigint): boolean;
export declare function isBigIntPrime(item: bigint): boolean;
/**
* @function isBigIntSafe
* @description Whether the big integer is safe with IEEE-754.
* Determine whether the big integer is safe with IEEE-754.
* @param {bigint} item Item that need to determine.
* @returns {boolean} Determine result.
*/
declare function isBigIntSafe(item: bigint): boolean;
export { isBigIntEven, isBigIntEven as isBigIntegerEven, isBigIntIntegralNumericType, isBigIntIntegralNumericType as isBigIntegerIntegralNumericType, isBigIntNegative, isBigIntNegative as isBigIntegerNegative, isBigIntOdd, isBigIntOdd as isBigIntegerOdd, isBigIntPositive, isBigIntPositive as isBigIntegerPositive, isBigIntPrime, isBigIntPrime as isBigIntegerPrime, isBigIntSafe, isBigIntSafe as isBigIntegerSafe };
export declare function isBigIntSafe(item: bigint): boolean;
export { isBigIntEven as isBigIntegerEven, isBigIntIntegralNumericType as isBigIntegerIntegralNumericType, isBigIntNegative as isBigIntegerNegative, isBigIntOdd as isBigIntegerOdd, isBigIntPositive as isBigIntegerPositive, isBigIntPrime as isBigIntegerPrime, isBigIntSafe as isBigIntegerSafe };
//# sourceMappingURL=bigint.d.ts.map
2 changes: 1 addition & 1 deletion dist/bigint.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 15 additions & 22 deletions dist/bigint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,61 @@ import { integralNumericTypeRange, isPrimeNumeric } from "./internal/numeric.js"
const MAX_SAFE_INTEGER = BigInt(Number.MAX_SAFE_INTEGER);
const MIN_SAFE_INTEGER = BigInt(Number.MIN_SAFE_INTEGER);
/**
* @function isBigIntEven
* @description Whether the big integer is even.
* Determine whether the big integer is even.
* @param {bigint} item Item that need to determine.
* @returns {boolean} Determine result.
*/
function isBigIntEven(item) {
export function isBigIntEven(item) {
return (item % 2n === 0n);
}
/**
* @function isBigIntIntegralNumericType
* @description Whether the big integer is match the specified integral numeric type.
* Determine whether the big integer is match the specified integral numeric type.
* @param {IntegralNumericTypeEnumKeysType} typeName Name of the integral numeric type.
* @param {bigint} item Item that need to determine.
* @returns {boolean} Determine result.
*/
function isBigIntIntegralNumericType(typeName, item) {
export function isBigIntIntegralNumericType(typeName, item) {
let [minimum, maximum] = integralNumericTypeRange(typeName);
return (minimum <= item && item <= maximum);
}
/**
* @function isBigIntNegative
* @description Whether the big integer is negative.
* Determine whether the big integer is negative.
* @param {bigint} item Item that need to determine.
* @returns {boolean} Determine result.
*/
function isBigIntNegative(item) {
export function isBigIntNegative(item) {
return (item < 0n);
}
/**
* @function isBigIntOdd
* @description Whether the big integer is odd.
* Determine whether the big integer is odd.
* @param {bigint} item Item that need to determine.
* @returns {boolean} Determine result.
*/
function isBigIntOdd(item) {
export function isBigIntOdd(item) {
return (item % 2n !== 0n);
}
/**
* @function isBigIntPositive
* @description Whether the big integer is positive.
* Determine whether the big integer is positive.
* @param {bigint} item Item that need to determine.
* @returns {boolean} Determine result.
*/
function isBigIntPositive(item) {
export function isBigIntPositive(item) {
return (item >= 0n);
}
/**
* @function isBigIntPrime
* @description Whether the big integer is prime.
* Determine whether the big integer is prime.
* @param {bigint} item Item that need to determine.
* @returns {boolean} Determine result.
*/
function isBigIntPrime(item) {
export function isBigIntPrime(item) {
return isPrimeNumeric(item);
}
/**
* @function isBigIntSafe
* @description Whether the big integer is safe with IEEE-754.
* Determine whether the big integer is safe with IEEE-754.
* @param {bigint} item Item that need to determine.
* @returns {boolean} Determine result.
*/
function isBigIntSafe(item) {
export function isBigIntSafe(item) {
return (MIN_SAFE_INTEGER <= item && item <= MAX_SAFE_INTEGER);
}
export { isBigIntEven, isBigIntEven as isBigIntegerEven, isBigIntIntegralNumericType, isBigIntIntegralNumericType as isBigIntegerIntegralNumericType, isBigIntNegative, isBigIntNegative as isBigIntegerNegative, isBigIntOdd, isBigIntOdd as isBigIntegerOdd, isBigIntPositive, isBigIntPositive as isBigIntegerPositive, isBigIntPrime, isBigIntPrime as isBigIntegerPrime, isBigIntSafe, isBigIntSafe as isBigIntegerSafe };
export { isBigIntEven as isBigIntegerEven, isBigIntIntegralNumericType as isBigIntegerIntegralNumericType, isBigIntNegative as isBigIntegerNegative, isBigIntOdd as isBigIntegerOdd, isBigIntPositive as isBigIntegerPositive, isBigIntPrime as isBigIntegerPrime, isBigIntSafe as isBigIntegerSafe };
Loading

0 comments on commit 2c876c2

Please sign in to comment.