MCPcopy Create free account
hub / github.com/denoland/std / #getTypeOfArray

Method #getTypeOfArray

toml/stringify.ts:108–115  ·  view source on GitHub ↗
(arr: unknown[])

Source from the content-addressed store, hash-verified

106 ["string", "number", "boolean"].includes(typeof value);
107 }
108 #getTypeOfArray(arr: unknown[]): ArrayType {
109 if (this.#arrayTypeCache.has(arr)) {
110 return this.#arrayTypeCache.get(arr)!;
111 }
112 const type = this.#doGetTypeOfArray(arr);
113 this.#arrayTypeCache.set(arr, type);
114 return type;
115 }
116 #doGetTypeOfArray(arr: unknown[]): ArrayType {
117 if (!arr.length) {
118 // any type should be fine

Callers 2

#printObjectMethod · 0.95
#isSimplySerializableMethod · 0.95

Calls 4

#doGetTypeOfArrayMethod · 0.95
hasMethod · 0.65
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected