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

Method add

src/lualib/Set.ts:34–51  ·  view source on GitHub ↗
(value: T)

Source from the content-addressed store, hash-verified

32 }
33
34 public add(value: T): Set<T> {
35 const isNewValue = !this.has(value);
36 if (isNewValue) {
37 this.size++;
38 }
39
40 // Do order bookkeeping
41 if (this.firstKey === undefined) {
42 this.firstKey = value;
43 this.lastKey = value;
44 } else if (isNewValue) {
45 this.nextKey.set(this.lastKey!, value);
46 this.previousKey.set(value, this.lastKey!);
47 this.lastKey = value;
48 }
49
50 return this;
51 }
52
53 public clear(): void {
54 this.nextKey = new LuaTable();

Callers 14

findUsedLualibFeaturesFunction · 0.95
constructorMethod · 0.95
unionMethod · 0.95
intersectionMethod · 0.95
symmetricDifferenceMethod · 0.95
lualibFileVisitorMethod · 0.95
printMethod · 0.45
printStatementArrayMethod · 0.45
loadFunction · 0.45
getExtendedTstlOptionsFunction · 0.45
processDependencyMethod · 0.45
importLuaLibFeatureFunction · 0.45

Calls 2

hasMethod · 0.95
setMethod · 0.45

Tested by

no test coverage detected