]> Lady’s Gitweb - Pisces/blobdiff - string.js
Add denseProxy, various collection.js improvements
[Pisces] / string.js
index ddc05d7d71ee6f479c2153596542d8cba9554a03..99528a8c2c88f7c032a37e3a5bd472145ce4dbb5 100644 (file)
--- a/string.js
+++ b/string.js
@@ -345,25 +345,6 @@ export const {
   };
 })();
 
-/**
- * Returns −0 if the provided argument is `"-0"´; returns a number
- * representing the index if the provided argument is a canonical
- * numeric index string; otherwise, returns undefined.
- *
- * There is no clamping of the numeric index, but note that numbers
- * above 2^53 − 1 are not safe nor valid integer indices.
- */
-export const canonicalNumericIndexString = ($) => {
-  if (typeof $ !== "string") {
-    return UNDEFINED;
-  } else if ($ === "-0") {
-    return -0;
-  } else {
-    const n = +$;
-    return $ === `${n}` ? n : UNDEFINED;
-  }
-};
-
 export const {
   /**
    * Returns an iterator over the codepoints in the string representation
@@ -548,36 +529,6 @@ export const getLastSubstringIndex = createCallableFunction(
   { name: "getLastSubstringIndex" },
 );
 
-/** Returns whether the provided value is an array index. */
-export const isArrayIndexString = ($) => {
-  const value = canonicalNumericIndexString($);
-  if (value !== UNDEFINED) {
-    // The provided value is a canonical numeric index string.
-    //
-    // Return whether it is in range for array indices.
-    return sameValue(value, 0)
-      || value === toLength(value) && value > 0 && value < -1 >>> 0;
-  } else {
-    // The provided value is not a canonical numeric index string.
-    return false;
-  }
-};
-
-/** Returns whether the provided value is an integer index string. */
-export const isIntegerIndexString = ($) => {
-  const value = canonicalNumericIndexString($);
-  if (value !== UNDEFINED) {
-    // The provided value is a canonical numeric index string.
-    //
-    // Return whether it is in range for integer indices.
-    return sameValue(value, 0)
-      || value === toLength(value) && value > 0;
-  } else {
-    // The provided value is not a canonical numeric index string.
-    return false;
-  }
-};
-
 /**
  * Returns the result of joining the provided iterable.
  *
This page took 0.022964 seconds and 4 git commands to generate.