// ♓🌟 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
stringStartsWith,
substring,
} from "./string.js";
+import { ITERATOR } from "./value.js";
const sub·delims = rawString`[!\$&'()*+,;=]`;
const gen·delims = rawString`[:/?#\[\]@]`;
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,
},
};
const iriGeneratorIterablePrototype = {
- [iteratorSymbol]() {
+ [ITERATOR]() {
return {
next: bind(generatorIteratorNext, this.generator(), []),
};
},
};
const iriSegmentIterablePrototype = {
- [iteratorSymbol]() {
+ [ITERATOR]() {
return {
next: bind(
arrayIteratorNext,