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

Method #isSimplySerializable

toml/stringify.ts:163–173  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

161 throw new Error("Should never reach");
162 }
163 #isSimplySerializable(value: unknown): boolean {
164 return (
165 typeof value === "string" ||
166 typeof value === "number" ||
167 typeof value === "boolean" ||
168 value instanceof RegExp ||
169 value instanceof Date ||
170 (value instanceof Array &&
171 this.#getTypeOfArray(value) !== "ONLY_OBJECT_EXCLUDING_ARRAY")
172 );
173 }
174 #header(keys: string[]): string {
175 return `[${joinKeys(keys)}]`;
176 }

Callers 1

#printObjectMethod · 0.95

Calls 1

#getTypeOfArrayMethod · 0.95

Tested by

no test coverage detected