// file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
import { call, createCallableFunction } from "./function.js";
-import {
- isIntegralNumber,
- MAXIMUM_SAFE_INTEGRAL_NUMBER,
-} from "./numeric.js";
import {
canonicalNumericIndexString,
lengthOfArraylike,
}
};
-/** Returns whether the provided value is an integer index string. */
-export const isIntegerIndexString = ($) => {
- const value = canonicalNumericIndexString($);
- if (value !== undefined && isIntegralNumber(value)) {
- // The provided value is a canonical numeric index string.
- return sameValue(value, 0) ||
- value > 0 && value <= MAXIMUM_SAFE_INTEGRAL_NUMBER &&
- value === toLength(value);
- } else {
- // The provided value is not a canonical numeric index string.
- return false;
- }
-};
-
/**
* Returns an iterator over the items in the provided value according
* to the algorithm of `Array::values`.