Skip to content

Commit 3a9aab1

Browse files
committed
[BREAKING]: Support Node.js >=4
1 parent 88c3d49 commit 3a9aab1

File tree

8 files changed

+10
-19
lines changed

8 files changed

+10
-19
lines changed

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,3 @@ insert_final_newline = true
1010
[{package.json,*.yml}]
1111
indent_style = space
1212
indent_size = 2
13-
14-
[*.md]
15-
trim_trailing_whitespace = false

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* text=auto
2+
*.js text eol=lf

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
language: node_js
22
node_js:
3-
- '5'
3+
- '6'
44
- '4'
5-
- '0.12'
6-
- '0.10'

index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
'use strict';
2-
module.exports = function (str) {
3-
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
4-
return '%' + c.charCodeAt(0).toString(16).toUpperCase();
5-
});
6-
};
2+
module.exports = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);

license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) Kevin Mårtensson <[email protected]> (github.com/kevva)
3+
Copyright (c) Kevin Martensson <[email protected]> (github.com/kevva)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"url": "github.com/kevva"
1111
},
1212
"engines": {
13-
"node": ">=0.10.0"
13+
"node": ">=4"
1414
},
1515
"scripts": {
1616
"test": "xo && ava"

readme.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ strictUriEncode('unicorn*foobar');
2929

3030
#### string
3131

32-
*Required*
3332
Type: `string`, `number`
3433

3534
String to URI encode.

test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import test from 'ava';
2-
import fn from './';
2+
import m from './';
33

44
test(t => {
5-
t.is(fn('unicorn!foobar'), 'unicorn%21foobar');
6-
t.is(fn('unicorn\'foobar'), 'unicorn%27foobar');
7-
t.is(fn('unicorn*foobar'), 'unicorn%2Afoobar');
8-
t.not(fn('unicorn*foobar'), encodeURIComponent('unicorn*foobar'));
5+
t.is(m('unicorn!foobar'), 'unicorn%21foobar');
6+
t.is(m('unicorn\'foobar'), 'unicorn%27foobar');
7+
t.is(m('unicorn*foobar'), 'unicorn%2Afoobar');
8+
t.not(m('unicorn*foobar'), encodeURIComponent('unicorn*foobar'));
99
});

0 commit comments

Comments
 (0)