MCPcopy Index your code
hub / github.com/TypeScriptToLua/TypeScriptToLua / keys

Method keys

src/lualib/Map.ts:136–155  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134 }
135
136 public keys(): IterableIterator<K> {
137 const getFirstKey = () => this.firstKey;
138 const nextKey = this.nextKey;
139 let key: K | undefined;
140 let started = false;
141 return {
142 [Symbol.iterator](): IterableIterator<K> {
143 return this;
144 },
145 next(): IteratorResult<K> {
146 if (!started) {
147 started = true;
148 key = getFirstKey();
149 } else {
150 key = nextKey.get(key!);
151 }
152 return { done: !key, value: key! };
153 },
154 };
155 }
156
157 public values(): IterableIterator<V> {
158 const getFirstKey = () => this.firstKey;

Callers 1

forEachMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected