MCPcopy Index your code
hub / github.com/nodejs/node / StringCharIterator

Class StringCharIterator

lib/internal/source_map/source_map.js:89–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87const kMappings = Symbol('kMappings');
88
89class StringCharIterator {
90 /**
91 * @param {string} string
92 */
93 constructor(string) {
94 this._string = string;
95 this._position = 0;
96 }
97
98 /**
99 * @returns {string}
100 */
101 next() {
102 return StringPrototypeCharAt(this._string, this._position++);
103 }
104
105 /**
106 * @returns {string}
107 */
108 peek() {
109 return StringPrototypeCharAt(this._string, this._position);
110 }
111
112 /**
113 * @returns {boolean}
114 */
115 hasNext() {
116 return this._position < this._string.length;
117 }
118}
119
120/**
121 * @class

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…