]> Lady’s Gitweb - Pisces/blobdiff - iri.js
Add methods for own entries and values to object.js
[Pisces] / iri.js
diff --git a/iri.js b/iri.js
index de23d5de40953ed88a0fb33ea5e9cf3379a6f92b..5dd9dd098ed778e7e8984e8e20484f0c0f9b6d1d 100644 (file)
--- a/iri.js
+++ b/iri.js
@@ -1,7 +1,7 @@
 // ♓🌟 Piscēs ∷ iri.js
 // ====================================================================
 //
-// Copyright © 2020, 2022 Lady [@ Lady’s Computer].
+// Copyright © 2020, 2022–2023 Lady [@ Lady’s Computer].
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -20,6 +20,7 @@ import {
   stringStartsWith,
   substring,
 } from "./string.js";
+import { ITERATOR } from "./value.js";
 
 const sub·delims = rawString`[!\$&'()*+,;=]`;
 const gen·delims = rawString`[:/?#\[\]@]`;
@@ -168,7 +169,7 @@ export const {
   /**
    * Recomposes an (L·E·)I·R·I reference from its component parts.
    *
-   * See §5.3 of R·F·C3986.
+   * See §5.3 of R·F·C 3986.
    */
   composeReference,
 
@@ -193,29 +194,28 @@ export const {
    * Removes all dot segments ("." or "..") from the provided
    * (L·E·)I·R·I.
    *
-   * See §5.2.4 of R·F·C3986.
+   * See §5.2.4 of R·F·C 3986.
    */
   removeDotSegments,
 } = (() => {
   const TE = TextEncoder;
-  const { iterator: iteratorSymbol } = Symbol;
   const { toString: numberToString } = Number.prototype;
   const { encode: teEncode } = TE.prototype;
 
-  const { [iteratorSymbol]: arrayIterator } = Array.prototype;
+  const { [ITERATOR]: arrayIterator } = Array.prototype;
   const {
     next: arrayIteratorNext,
-  } = Object.getPrototypeOf([][iteratorSymbol]());
+  } = Object.getPrototypeOf([][ITERATOR]());
   const {
     next: generatorIteratorNext,
   } = Object.getPrototypeOf(function* () {}.prototype);
-  const { [iteratorSymbol]: stringIterator } = String.prototype;
+  const { [ITERATOR]: stringIterator } = String.prototype;
   const {
     next: stringIteratorNext,
-  } = Object.getPrototypeOf(""[iteratorSymbol]());
+  } = Object.getPrototypeOf(""[ITERATOR]());
 
   const iriCharacterIterablePrototype = {
-    [iteratorSymbol]() {
+    [ITERATOR]() {
       return {
         next: bind(
           stringIteratorNext,
@@ -226,14 +226,14 @@ export const {
     },
   };
   const iriGeneratorIterablePrototype = {
-    [iteratorSymbol]() {
+    [ITERATOR]() {
       return {
         next: bind(generatorIteratorNext, this.generator(), []),
       };
     },
   };
   const iriSegmentIterablePrototype = {
-    [iteratorSymbol]() {
+    [ITERATOR]() {
       return {
         next: bind(
           arrayIteratorNext,
@@ -535,7 +535,7 @@ export const {
  * Returns the result of merging the provided reference path with the
  * provided base path.
  *
- * See §5.2.3 of R·F·C3986.
+ * See §5.2.3 of R·F·C 3986.
  */
 export const mergePaths = (base, reference) => {
   const baseStr = `${base}` || "/";
@@ -592,7 +592,7 @@ export const {
  * Resolves the provided reference relative to the provided base
  * (L·E·)I·R·I.
  *
- * See §5.2 of R·F·C3986.
+ * See §5.2 of R·F·C 3986.
  */
 export const resolveReference = (R, Base = location ?? "") => {
   const {
This page took 0.058337 seconds and 4 git commands to generate.