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

Method #numberDeclaration

toml/stringify.ts:193–205  ·  view source on GitHub ↗
(keys: string[], value: number)

Source from the content-addressed store, hash-verified

191 return `${this.#declaration(keys)}${JSON.stringify(value)}`;
192 }
193 #numberDeclaration(keys: string[], value: number): string {
194 if (Number.isNaN(value)) {
195 return `${this.#declaration(keys)}nan`;
196 }
197 switch (value) {
198 case Infinity:
199 return `${this.#declaration(keys)}inf`;
200 case -Infinity:
201 return `${this.#declaration(keys)}-inf`;
202 default:
203 return `${this.#declaration(keys)}${value}`;
204 }
205 }
206 #boolDeclaration(keys: string[], value: boolean): string {
207 return `${this.#declaration(keys)}${value}`;
208 }

Callers 1

#printObjectMethod · 0.95

Calls 1

#declarationMethod · 0.95

Tested by

no test coverage detected