msw 2.13.1 → 2.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,7 +21,14 @@ __export(hasRefCounted_exports, {
21
21
  hasRefCounted: () => hasRefCounted
22
22
  });
23
23
  module.exports = __toCommonJS(hasRefCounted_exports);
24
+ var import_isObject = require("./isObject");
24
25
  function hasRefCounted(value) {
25
- return typeof Reflect.get(value, "ref") === "function" && typeof Reflect.get(value, "unref") === "function";
26
+ return (
27
+ /**
28
+ * @note Guard against non-object values.
29
+ * E.g. `setTimeout` returns an object in Node.js but a number in the browser.
30
+ */
31
+ (0, import_isObject.isObject)(value) && typeof Reflect.get(value, "ref") === "function" && typeof Reflect.get(value, "unref") === "function"
32
+ );
26
33
  }
27
34
  //# sourceMappingURL=hasRefCounted.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/core/utils/internal/hasRefCounted.ts"],"sourcesContent":["export function hasRefCounted<T extends object>(\n value: T,\n): value is T & NodeJS.RefCounted {\n return (\n typeof Reflect.get(value, 'ref') === 'function' &&\n typeof Reflect.get(value, 'unref') === 'function'\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,cACd,OACgC;AAChC,SACE,OAAO,QAAQ,IAAI,OAAO,KAAK,MAAM,cACrC,OAAO,QAAQ,IAAI,OAAO,OAAO,MAAM;AAE3C;","names":[]}
1
+ {"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;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;AAElB,SAAS,cACd,OACgC;AAChC;AAAA;AAAA;AAAA;AAAA;AAAA,QAKE,0BAAS,KAAK,KACd,OAAO,QAAQ,IAAI,OAAO,KAAK,MAAM,cACrC,OAAO,QAAQ,IAAI,OAAO,OAAO,MAAM;AAAA;AAE3C;","names":[]}
@@ -1,5 +1,12 @@
1
+ import { isObject } from './isObject.mjs';
1
2
  function hasRefCounted(value) {
2
- return typeof Reflect.get(value, "ref") === "function" && typeof Reflect.get(value, "unref") === "function";
3
+ return (
4
+ /**
5
+ * @note Guard against non-object values.
6
+ * E.g. `setTimeout` returns an object in Node.js but a number in the browser.
7
+ */
8
+ isObject(value) && typeof Reflect.get(value, "ref") === "function" && typeof Reflect.get(value, "unref") === "function"
9
+ );
3
10
  }
4
11
  export {
5
12
  hasRefCounted
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/core/utils/internal/hasRefCounted.ts"],"sourcesContent":["export function hasRefCounted<T extends object>(\n value: T,\n): value is T & NodeJS.RefCounted {\n return (\n typeof Reflect.get(value, 'ref') === 'function' &&\n typeof Reflect.get(value, 'unref') === 'function'\n )\n}\n"],"mappings":"AAAO,SAAS,cACd,OACgC;AAChC,SACE,OAAO,QAAQ,IAAI,OAAO,KAAK,MAAM,cACrC,OAAO,QAAQ,IAAI,OAAO,OAAO,MAAM;AAE3C;","names":[]}
1
+ {"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":[]}
package/lib/iife/index.js CHANGED
@@ -20456,7 +20456,13 @@ Consider naming this operation or using "graphql.operation()" request handler to
20456
20456
 
20457
20457
  // src/core/utils/internal/hasRefCounted.ts
20458
20458
  function hasRefCounted(value) {
20459
- return typeof Reflect.get(value, "ref") === "function" && typeof Reflect.get(value, "unref") === "function";
20459
+ return (
20460
+ /**
20461
+ * @note Guard against non-object values.
20462
+ * E.g. `setTimeout` returns an object in Node.js but a number in the browser.
20463
+ */
20464
+ isObject2(value) && typeof Reflect.get(value, "ref") === "function" && typeof Reflect.get(value, "unref") === "function"
20465
+ );
20460
20466
  }
20461
20467
 
20462
20468
  // src/core/ws/WebSocketMemoryClientStore.ts