Skip to content

Commit

Permalink
Merge pull request #51 from iambumblehead/fix-syntax-error-at-readme
Browse files Browse the repository at this point in the history
fix syntax error at README
  • Loading branch information
iambumblehead authored Sep 11, 2023
2 parents db76a76 + ad98315 commit 97243f1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ jobs:
- run: npm install
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
# publish-npm:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# with:
# node-version: 16
# registry-url: https://registry.npmjs.org/
# - run: npm install
# - run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{secrets.npm_token}}

publish-gpr:
needs: build
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 6.1.2 - 2023-09-10

* [fix sytax error at README](https://github.com/iambumblehead/form-urlencoded/pull/50)


## 6.1.1 - 2023-09-10

* [add support for option 'ignoreEmptyArray',][611] credit @Sanva
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ form-urlencoded
Returns 'x-www-form-urlencoded' string data, an encoding often used when an [HTML form is submitted][1]. Form data is serialised in [this format][2] and sent to a server.

```javascript
import formurlencoded from 'form-urlencoded';
import formurlencoded from 'form-urlencoded'
// or:
// var formurlencoded = require('form-urlencoded');
// var formurlencoded = require('form-urlencoded')

const obj = {
str : 'val',
num : 0,
arr : [3, {prop : false}, 1, null, 6],
obj : {prop1 : null, prop2 : ['elem']}
};
}

console.log(formurlencoded(obj));
console.log(formurlencoded(obj))
// str=val&num=0&arr%5B0%5D=3&arr%5B1%5D%5Bprop%5D=false
// &arr%5B2%5D=1&arr%5B3%5D=null&arr%5B4%5D=6&obj%5Bprop
// 1%5D=null&obj%5Bprop2%5D%5B0%5D=elem
Expand All @@ -27,17 +27,17 @@ console.log(formurlencoded(obj, {
ignorenull : true,
skipIndex : true,
sorted : true
}));
}))
// arr%5B%5D=3&arr%5B%5D%5Bprop%5D=false&arr%5B%5D=1&arr
// %5B%5D=6&num=0&obj%5Bprop2%5D%5B%5D=elem&str=val

console.log(formurlencoded(obj, {
ignoreEmptyArray: true
ignoreEmptyArray: true,
ignorenull : true,
useDot : true,
skipIndex : true,
skipBracket : true
}));
}))
// str=val&num=0&arr=3&arr.prop=false&arr=1&arr=6&obj.pr
// op2=elem
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"require": "./form-urlencoded.js",
"import": "./form-urlencoded.mjs"
},
"version": "6.1.1",
"version": "6.1.2",
"description": "Return an object as an 'x-www-form-urlencoded' string",
"author": "Chris <chris@bumblehead.com>",
"license": "MIT",
Expand Down

0 comments on commit 97243f1

Please sign in to comment.