MCPcopy Create free account
hub / github.com/WinterTC55/iter-streams / hasCustomToString

Function hasCustomToString

src/from.ts:95–98  ·  view source on GitHub ↗

* Check if object has a custom toString() (not Object.prototype.toString).

(obj: object)

Source from the content-addressed store, hash-verified

93 * Check if object has a custom toString() (not Object.prototype.toString).
94 */
95function hasCustomToString(obj: object): boolean {
96 const toString = (obj as { toString?: unknown }).toString;
97 return typeof toString === 'function' && toString !== Object.prototype.toString;
98}
99
100/**
101 * Check if object has Symbol.toPrimitive.

Callers 1

tryStringCoercionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected