File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 branches :
66 - main
77 pull_request :
8- branches :
9- - main
8+ workflow_dispatch :
109
1110jobs :
1211 build :
1312 runs-on : ubuntu-latest
13+ strategy :
14+ matrix :
15+ node-version : [16, 18]
1416 steps :
1517 - name : Checkout
1618 uses : actions/checkout@v2
@@ -21,27 +23,12 @@ jobs:
2123 - name : Setup Node.js
2224 uses : actions/setup-node@v3
2325 with :
24- node-version : 16
26+ node-version : ${{ matrix.node-version }}
2527 always-auth : true
2628 cache : yarn
2729
28- - name : Setup Git
29- run : |
30- git config --local user.name "kettanaito"
31- git config --local user.email "kettanaito@gmail.com"
32-
3330 - name : Install dependencies
3431 run : yarn install --frozen-lockfile
3532
3633 - name : Unit tests
3734 run : yarn test
38-
39- - name : Build
40- run : yarn build
41-
42- - name : Release
43- if : contains(github.ref, 'refs/heads/main')
44- run : yarn release
45- env :
46- GITHUB_TOKEN : ${{ secrets.GH_ADMIN_TOKEN }}
47- NPM_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 1+ name : release
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ workflow_dispatch :
8+
9+ jobs :
10+ publish :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Checkout
14+ uses : actions/checkout@v2
15+ with :
16+ fetch-depth : 0
17+ token : ${{ secrets.GH_ADMIN_TOKEN }}
18+
19+ - name : Setup Node.js
20+ uses : actions/setup-node@v3
21+ with :
22+ node-version : 18
23+ always-auth : true
24+ cache : yarn
25+
26+ - name : Setup Git
27+ run : |
28+ git config --local user.name "kettanaito"
29+ git config --local user.email "kettanaito@gmail.com"
30+
31+ - name : Install dependencies
32+ run : yarn install --frozen-lockfile
33+
34+ - name : Build
35+ run : yarn build
36+
37+ - name : Release
38+ if : contains(github.ref, 'refs/heads/main')
39+ run : yarn release
40+ env :
41+ GITHUB_TOKEN : ${{ secrets.GH_ADMIN_TOKEN }}
42+ NPM_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change @@ -21,12 +21,13 @@ export class Headers {
2121
2222 constructor ( init ?: HeadersInit | HeadersObject | HeadersList ) {
2323 /**
24- * @note Cannot check if the `init` is an instance of the `Headers`
25- * because that class is only defined in the browser .
24+ * @note Cannot necessarily check if the `init` is an instance of the
25+ * `Headers` because that class may not be defined in Node or jsdom .
2626 */
2727 if (
2828 [ 'Headers' , 'HeadersPolyfill' ] . includes ( init ?. constructor . name ) ||
29- init instanceof Headers
29+ init instanceof Headers ||
30+ ( typeof globalThis . Headers !== 'undefined' && init instanceof globalThis . Headers )
3031 ) {
3132 const initialHeaders = init as Headers
3233 initialHeaders . forEach ( ( value , name ) => {
You can’t perform that action at this time.
0 commit comments