Skip to content

Commit

Permalink
Merge pull request #310 from frouriojs/develop
Browse files Browse the repository at this point in the history
release v1.2.1
  • Loading branch information
solufa authored Nov 14, 2024
2 parents 4d8d959 + 164b3c8 commit c8db031
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ on: [push, pull_request]

jobs:
test:
name: "Test on Node:${{ matrix.node-version }} OS:${{ matrix.os }}"
name: 'Test on Node:${{ matrix.node-version }} OS:${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18, 20]
node-version: [20, 22]
os: [ubuntu-latest]
include:
- os: windows-latest
node-version: 20
node-version: 22
steps:
- uses: actions/checkout@v3
- name: setup Node.js ${{ matrix.node-version }}
Expand All @@ -22,7 +22,7 @@ jobs:
- uses: actions/cache@v2
id: npm-cache
with:
path: "node_modules"
path: 'node_modules'
key: ${{ runner.os }}-node-v${{ matrix.node-version }}-npm-${{ hashFiles('package-lock.json') }}
- run: npm install
if: steps.npm-cache.outputs.cache-hit != 'true'
Expand All @@ -35,18 +35,21 @@ jobs:
release:
runs-on: ubuntu-latest
needs: test
permissions:
contents: read
id-token: write
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
node-version: 22
registry-url: 'https://registry.npmjs.org'
- uses: actions/cache@v2
id: npm-cache
with:
path: "node_modules"
path: 'node_modules'
key: ${{ runner.os }}-node-v20-npm-${{ hashFiles('package-lock.json') }}
- run: npm install
if: steps.npm-cache.outputs.cache-hit != 'true'
Expand All @@ -55,6 +58,6 @@ jobs:
VERSION="$(node -e 'console.log(process.argv[1].match(/^refs\/tags\/v(\d+\.\d+\.\d+)$/)[1])' "${{ github.ref }}")"
node -e 'console.log(JSON.stringify({...require("./package.json"),version:process.argv[1]}, null, 2))' "$VERSION" | tee ./tmp-package.json
mv ./tmp-package.json ./package.json
- run: npm publish
- run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 1 addition & 3 deletions servers/all/$server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ const parseStringArrayTypeQueryParams = (stringArrayTypeParams: [string, boolean
if (!isOptional && param === undefined) {
query[key] = [];
} else if (!isOptional || param !== undefined) {
const vals = (Array.isArray(param) ? param : [param]);

query[key] = vals;
query[key] = Array.isArray(param) ? param : [param];
}

delete query[`${key}[]`];
Expand Down
4 changes: 1 addition & 3 deletions src/buildServerFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,7 @@ const parseStringArrayTypeQueryParams = (stringArrayTypeParams: [string, boolean
if (!isOptional && param === undefined) {
query[key] = [];
} else if (!isOptional || param !== undefined) {
const vals = (Array.isArray(param) ? param : [param]);
query[key] = vals;
query[key] = Array.isArray(param) ? param : [param];
}
delete query[\`\${key}[]\`];
Expand Down
4 changes: 2 additions & 2 deletions tests/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,12 @@ test('PUT: zod validations', async () => {
fetchClient.put({
query: {
requiredNum: 0,
requiredNumArr: [],
requiredNumArr: [1],
id: '1',
strArray: [],
disable: 'true',
bool: 1 as any,
boolArray: [],
boolArray: [true],
},
body: { port },
}),
Expand Down

0 comments on commit c8db031

Please sign in to comment.