Skip to content

Commit 3580eaf

Browse files
authoredMar 28, 2021
Merge pull request #32 from iambumblehead/use-ava-mjs
use mjs
2 parents 727bc87 + a9d84b0 commit 3580eaf

3 files changed

+16
-10
lines changed
 

‎form-urlencoded.spec.js ‎form-urlencoded.spec.mjs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
// babel and "@babel/plugin-transform-unicode-regex" stopped working
2-
// uupdate the file manually
3-
require('child_process').execSync(
4-
'sed -i "s/g, encode/gu, encode/" form-urlencoded.dist.js');
1+
import test from 'ava';
2+
import formurlencodeddist from './form-urlencoded.dist.js';
53

6-
const test = require('ava');
7-
const formurlencoded = require('.').default;
4+
const formurlencoded = formurlencodeddist.default;
85

96
// tests assume behaviour not given in ecmascript specification,
107
// object properties accessed in 'order'

‎package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"main": "form-urlencoded.dist",
44
"browser": "form-urlencoded.dist",
55
"module": "form-urlencoded.js",
6-
"version": "4.4.0",
6+
"version": "4.4.1",
77
"description": "Return an object as an 'x-www-form-urlencoded' string",
88
"author": "Chris <chris@bumblehead.com>",
99
"license": "MIT",
@@ -46,14 +46,15 @@
4646
"@babel/core": "^7.12.2",
4747
"@babel/eslint-parser": "7.13.10",
4848
"@babel/preset-env": "^7.13.12",
49-
"ava": "^3.15.0",
49+
"ava": "^4.0.0-alpha.1",
5050
"eslint": "^7.23.0",
5151
"eslint-plugin-import": "^2.14.0"
5252
},
5353
"scripts": {
54-
"test": "ava form-urlencoded.spec.js",
54+
"test": "ava form-urlencoded.spec.mjs",
5555
"lint": "eslint form-urlencoded.js",
56-
"start": "babel form-urlencoded.js --out-file form-urlencoded.dist.js",
56+
"start": "babel form-urlencoded.js --out-file form-urlencoded.dist.js && npm run unicode",
57+
"unicode": "node ./restore-unicode-removed-by-babel.js",
5758
"prepare": "npm start && npm run lint && npm test"
5859
},
5960
"babel": {

‎restore-unicode-removed-by-babel.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// babel and "@babel/plugin-transform-unicode-regex" stopped working
2+
// uupdate the file manually
3+
//
4+
// in: /g, encode
5+
// out: /gu, encode
6+
7+
require('child_process').execSync(
8+
'sed -i "s/g, encode/gu, encode/" form-urlencoded.dist.js');

0 commit comments

Comments
 (0)
Please sign in to comment.