Skip to content

Commit c8db031

Browse files
authored
Merge pull request #310 from frouriojs/develop
release v1.2.1
2 parents 4d8d959 + 164b3c8 commit c8db031

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

.github/workflows/nodejs.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ on: [push, pull_request]
44

55
jobs:
66
test:
7-
name: "Test on Node:${{ matrix.node-version }} OS:${{ matrix.os }}"
7+
name: 'Test on Node:${{ matrix.node-version }} OS:${{ matrix.os }}'
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
11-
node-version: [18, 20]
11+
node-version: [20, 22]
1212
os: [ubuntu-latest]
1313
include:
1414
- os: windows-latest
15-
node-version: 20
15+
node-version: 22
1616
steps:
1717
- uses: actions/checkout@v3
1818
- name: setup Node.js ${{ matrix.node-version }}
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/cache@v2
2323
id: npm-cache
2424
with:
25-
path: "node_modules"
25+
path: 'node_modules'
2626
key: ${{ runner.os }}-node-v${{ matrix.node-version }}-npm-${{ hashFiles('package-lock.json') }}
2727
- run: npm install
2828
if: steps.npm-cache.outputs.cache-hit != 'true'
@@ -35,18 +35,21 @@ jobs:
3535
release:
3636
runs-on: ubuntu-latest
3737
needs: test
38+
permissions:
39+
contents: read
40+
id-token: write
3841
if: startsWith(github.ref, 'refs/tags/v')
3942
steps:
4043
- uses: actions/checkout@v3
4144
- name: Use Node.js
4245
uses: actions/setup-node@v3
4346
with:
44-
node-version: 20
45-
registry-url: "https://registry.npmjs.org"
47+
node-version: 22
48+
registry-url: 'https://registry.npmjs.org'
4649
- uses: actions/cache@v2
4750
id: npm-cache
4851
with:
49-
path: "node_modules"
52+
path: 'node_modules'
5053
key: ${{ runner.os }}-node-v20-npm-${{ hashFiles('package-lock.json') }}
5154
- run: npm install
5255
if: steps.npm-cache.outputs.cache-hit != 'true'
@@ -55,6 +58,6 @@ jobs:
5558
VERSION="$(node -e 'console.log(process.argv[1].match(/^refs\/tags\/v(\d+\.\d+\.\d+)$/)[1])' "${{ github.ref }}")"
5659
node -e 'console.log(JSON.stringify({...require("./package.json"),version:process.argv[1]}, null, 2))' "$VERSION" | tee ./tmp-package.json
5760
mv ./tmp-package.json ./package.json
58-
- run: npm publish
61+
- run: npm publish --provenance
5962
env:
6063
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

servers/all/$server.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ const parseStringArrayTypeQueryParams = (stringArrayTypeParams: [string, boolean
113113
if (!isOptional && param === undefined) {
114114
query[key] = [];
115115
} else if (!isOptional || param !== undefined) {
116-
const vals = (Array.isArray(param) ? param : [param]);
117-
118-
query[key] = vals;
116+
query[key] = Array.isArray(param) ? param : [param];
119117
}
120118

121119
delete query[`${key}[]`];

src/buildServerFile.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ const parseStringArrayTypeQueryParams = (stringArrayTypeParams: [string, boolean
144144
if (!isOptional && param === undefined) {
145145
query[key] = [];
146146
} else if (!isOptional || param !== undefined) {
147-
const vals = (Array.isArray(param) ? param : [param]);
148-
149-
query[key] = vals;
147+
query[key] = Array.isArray(param) ? param : [param];
150148
}
151149
152150
delete query[\`\${key}[]\`];

tests/index.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ test('PUT: zod validations', async () => {
215215
fetchClient.put({
216216
query: {
217217
requiredNum: 0,
218-
requiredNumArr: [],
218+
requiredNumArr: [1],
219219
id: '1',
220220
strArray: [],
221221
disable: 'true',
222222
bool: 1 as any,
223-
boolArray: [],
223+
boolArray: [true],
224224
},
225225
body: { port },
226226
}),

0 commit comments

Comments
 (0)