MCPcopy Create free account
hub / github.com/socketio/socket.io / _toPrimitive

Function _toPrimitive

client-dist/socket.io.js:256–265  ·  view source on GitHub ↗
(input, hint)

Source from the content-addressed store, hash-verified

254 };
255 }
256 function _toPrimitive(input, hint) {
257 if (typeof input !== "object" || input === null) return input;
258 var prim = input[Symbol.toPrimitive];
259 if (prim !== undefined) {
260 var res = prim.call(input, hint || "default");
261 if (typeof res !== "object") return res;
262 throw new TypeError("@@toPrimitive must return a primitive value.");
263 }
264 return (hint === "string" ? String : Number)(input);
265 }
266 function _toPropertyKey(arg) {
267 var key = _toPrimitive(arg, "string");
268 return typeof key === "symbol" ? key : String(key);

Callers 1

_toPropertyKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected