MCPcopy Index your code
hub / github.com/formatjs/formatjs / ToObject

Function ToObject

packages/ecma262-abstract/ToObject.ts:4–11  ·  view source on GitHub ↗
(
  arg: T
)

Source from the content-addressed store, hash-verified

2 * https://tc39.es/ecma262/#sec-toobject
3 */
4export function ToObject<T>(
5 arg: T
6): T extends null ? never : T extends undefined ? never : T {
7 if (arg == null) {
8 throw new TypeError('undefined/null cannot be converted to object')
9 }
10 return Object(arg)
11}

Callers 5

core.tsFile · 0.85
constructorMethod · 0.85
CoerceOptionsToObjectFunction · 0.85
SupportedLocalesFunction · 0.85
ToDateTimeOptionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected