Skip to content

Commit 5b06d66

Browse files
committed
Replaced string-based decoration marker with a Symbol in responseShortcutsPlugin
1 parent 4e81214 commit 5b06d66

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/plugins/response-shortcuts.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@ export type ResponseShortcuts = {
1010

1111
type ResponseShortcutsPromise = Promise<Response> & ResponseShortcuts
1212

13+
const DECORATED = Symbol('ffetch.responseShortcutsDecorated')
14+
1315
type DecoratedPromise = ResponseShortcutsPromise & {
14-
__ffetchResponseShortcutsDecorated__?: true
16+
[DECORATED]?: true
1517
}
1618

1719
function attachResponseShortcuts(
1820
promise: Promise<Response>
1921
): ResponseShortcutsPromise {
2022
const decorated = promise as DecoratedPromise
2123

22-
if (decorated.__ffetchResponseShortcutsDecorated__) {
24+
if (decorated[DECORATED]) {
2325
return decorated
2426
}
2527

@@ -64,7 +66,7 @@ function attachResponseShortcuts(
6466
enumerable: false,
6567
configurable: false,
6668
},
67-
__ffetchResponseShortcutsDecorated__: {
69+
[DECORATED]: {
6870
value: true,
6971
writable: false,
7072
enumerable: false,

0 commit comments

Comments
 (0)