UNPKG

msw

Version:

Seamless REST/GraphQL API mocking library for browser and Node.js.

1 lines 739 B
{"version":3,"sources":["../../../../src/core/utils/internal/hasRefCounted.ts"],"sourcesContent":["import { isObject } from './isObject'\n\nexport function hasRefCounted<T extends object>(\n value: T,\n): value is T & NodeJS.RefCounted {\n return (\n /**\n * @note Guard against non-object values.\n * E.g. `setTimeout` returns an object in Node.js but a number in the browser.\n */\n isObject(value) &&\n typeof Reflect.get(value, 'ref') === 'function' &&\n typeof Reflect.get(value, 'unref') === 'function'\n )\n}\n"],"mappings":"AAAA,SAAS,gBAAgB;AAElB,SAAS,cACd,OACgC;AAChC;AAAA;AAAA;AAAA;AAAA;AAAA,IAKE,SAAS,KAAK,KACd,OAAO,QAAQ,IAAI,OAAO,KAAK,MAAM,cACrC,OAAO,QAAQ,IAAI,OAAO,OAAO,MAAM;AAAA;AAE3C;","names":[]}