Skip to content

Commit 3c88a25

Browse files
Merge pull request #18 from knowledgecode/develop-1.2.0
2 parents 5a86fa4 + 1f34dfe commit 3c88a25

File tree

15 files changed

+1458
-3088
lines changed

15 files changed

+1458
-3088
lines changed

.circleci/config.yml

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,15 @@
1-
version: 2
1+
version: 2.1
2+
23
jobs:
3-
build:
4-
docker:
5-
- image: circleci/node:latest
6-
steps:
7-
- checkout
8-
- run:
9-
name: Update npm
10-
command: 'sudo npm install -g npm@latest'
11-
- restore_cache:
12-
key: dependency-cache-{{ checksum "package.json" }}
13-
- run:
14-
name: Install npm wee
15-
command: npm install
16-
- save_cache:
17-
key: dependency-cache-{{ checksum "package.json" }}
18-
paths:
19-
- node_modules
20-
test:
4+
build_and_test:
215
docker:
22-
- image: circleci/node:latest
6+
- image: cimg/node:current
237
steps:
248
- checkout
25-
- run:
26-
name: Test
27-
command: npm test
9+
- run: npm install
10+
- run: npm test
2811

2912
workflows:
30-
version: 2
3113
build_and_test:
3214
jobs:
33-
- build
34-
- test:
35-
requires:
36-
- build
15+
- build_and_test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.DS_Store
2+
dist
23
node_modules

README.md

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,60 +11,51 @@
1111

1212
## Installation
1313

14-
Node.js:
14+
via npm:
1515

1616
```shell
17-
npm install jquery-param --save
18-
```
19-
20-
the browser:
21-
22-
```html
23-
<script src="/path/to/jquery-param.min.js"></script>
17+
npm i jquery-param
2418
```
2519

2620
## Usage
2721

28-
CommonJS:
29-
3022
```javascript
31-
const param = require('jquery-param');
23+
import param from 'jquery-param';
3224

3325
const obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };
3426
const str = param(obj);
3527
// => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d"
3628
```
3729

38-
TypeScript:
30+
CommonJS:
3931

4032
```javascript
41-
import param from 'jquery-param';
33+
const param = require('jquery-param');
4234

4335
const obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };
4436
const str = param(obj);
4537
// => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d"
4638
```
4739

48-
*You will need to add `"esModuleInterop": true` to the `"compilerOptions"` field in `tsconfig.json`.*
49-
50-
ES Modules:
40+
ES Modules (Browser):
5141

5242
```html
5343
<script type="module">
54-
import param from './esm/jquery-param.es.js';
44+
import param from '/path/to/jquery-param.js';
5545
5646
const obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };
5747
const str = param(obj);
5848
// => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d"
5949
</script>
6050
```
6151

62-
Older browser:
52+
Traditional (Browser):
6353

6454
```html
55+
<script src="/path/to/jquery-param.js">
6556
<script>
6657
var obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };
67-
var str = window.param(obj); // global object
58+
var str = window.param(obj);
6859
// => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d"
6960
</script>
7061
```

esm/jquery-param.es.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

esm/jquery-param.es.min.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

jquery-param.js

Lines changed: 0 additions & 58 deletions
This file was deleted.

jquery-param.min.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)