@depup/msw 2.13.1-depup.0 → 2.13.2-depup.0
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.
- package/README.md +2 -2
- package/changes.json +1 -1
- package/lib/core/utils/internal/hasRefCounted.js +8 -1
- package/lib/core/utils/internal/hasRefCounted.js.map +1 -1
- package/lib/core/utils/internal/hasRefCounted.mjs +8 -1
- package/lib/core/utils/internal/hasRefCounted.mjs.map +1 -1
- package/lib/iife/index.js +7 -1
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/package.json +4 -4
- package/src/core/utils/internal/hasRefCounted.test.ts +21 -0
- package/src/core/utils/internal/hasRefCounted.ts +7 -0
package/lib/mockServiceWorker.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - Please do NOT modify this file.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
const PACKAGE_VERSION = '2.13.
|
|
10
|
+
const PACKAGE_VERSION = '2.13.2'
|
|
11
11
|
const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82'
|
|
12
12
|
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
|
13
13
|
const activeClientIds = new Set()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/msw",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.2-depup.0",
|
|
4
4
|
"description": "Seamless REST/GraphQL API mocking library for browser and Node.js. (with updated dependencies)",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./lib/core/index.js",
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
"vitest-environment-miniflare": "^2.14.4",
|
|
301
301
|
"webpack": "^5.95.0",
|
|
302
302
|
"webpack-http-server": "^0.5.0",
|
|
303
|
-
"msw": "2.13.
|
|
303
|
+
"msw": "2.13.2"
|
|
304
304
|
},
|
|
305
305
|
"peerDependencies": {
|
|
306
306
|
"typescript": ">= 4.8.x"
|
|
@@ -388,8 +388,8 @@
|
|
|
388
388
|
},
|
|
389
389
|
"depsUpdated": 11,
|
|
390
390
|
"originalPackage": "msw",
|
|
391
|
-
"originalVersion": "2.13.
|
|
392
|
-
"processedAt": "2026-04-
|
|
391
|
+
"originalVersion": "2.13.2",
|
|
392
|
+
"processedAt": "2026-04-08T12:27:02.371Z",
|
|
393
393
|
"smokeTest": "passed"
|
|
394
394
|
}
|
|
395
395
|
}
|
|
@@ -14,3 +14,24 @@ it('returns false for a non-refcounted object', () => {
|
|
|
14
14
|
expect(hasRefCounted({ ref() {} })).toBe(false)
|
|
15
15
|
expect(hasRefCounted({ unref() {} })).toBe(false)
|
|
16
16
|
})
|
|
17
|
+
|
|
18
|
+
it('returns false for non-object values', () => {
|
|
19
|
+
expect(
|
|
20
|
+
hasRefCounted(
|
|
21
|
+
// @ts-expect-error Runtime value.
|
|
22
|
+
null,
|
|
23
|
+
),
|
|
24
|
+
).toBe(false)
|
|
25
|
+
expect(
|
|
26
|
+
hasRefCounted(
|
|
27
|
+
// @ts-expect-error Runtime value.
|
|
28
|
+
123,
|
|
29
|
+
),
|
|
30
|
+
).toBe(false)
|
|
31
|
+
expect(
|
|
32
|
+
hasRefCounted(
|
|
33
|
+
// @ts-expect-error Runtime value.
|
|
34
|
+
'invalid',
|
|
35
|
+
),
|
|
36
|
+
).toBe(false)
|
|
37
|
+
})
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import { isObject } from './isObject'
|
|
2
|
+
|
|
1
3
|
export function hasRefCounted<T extends object>(
|
|
2
4
|
value: T,
|
|
3
5
|
): value is T & NodeJS.RefCounted {
|
|
4
6
|
return (
|
|
7
|
+
/**
|
|
8
|
+
* @note Guard against non-object values.
|
|
9
|
+
* E.g. `setTimeout` returns an object in Node.js but a number in the browser.
|
|
10
|
+
*/
|
|
11
|
+
isObject(value) &&
|
|
5
12
|
typeof Reflect.get(value, 'ref') === 'function' &&
|
|
6
13
|
typeof Reflect.get(value, 'unref') === 'function'
|
|
7
14
|
)
|