Skip to content

Commit e39f5a8

Browse files
jimmywartingdarrachequesne
authored andcommitted
[chore] Use native JSON and drop support for older nodejs versions (#64)
1 parent 9ce9a98 commit e39f5a8

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
language: node_js
22
sudo: false
33
node_js:
4-
- '0.10'
5-
- '0.12'
64
- '4'
75
- 'node'
86
notifications:

index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
var debug = require('debug')('socket.io-parser');
7-
var json = require('json3');
87
var Emitter = require('component-emitter');
98
var binary = require('./binary');
109
var isBuf = require('./is-buffer');
@@ -166,7 +165,7 @@ function encodeAsString(obj) {
166165

167166
// json data
168167
if (null != obj.data) {
169-
str += json.stringify(obj.data);
168+
str += JSON.stringify(obj.data);
170169
}
171170

172171
debug('encoded %j as %s', obj, str);
@@ -323,7 +322,7 @@ function decodeString(str) {
323322

324323
function tryParse(p, str) {
325324
try {
326-
p.data = json.parse(str);
325+
p.data = JSON.parse(str);
327326
} catch(e){
328327
return error();
329328
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
],
1414
"dependencies": {
1515
"debug": "2.3.3",
16-
"json3": "3.3.2",
1716
"component-emitter": "1.2.1",
1817
"isarray": "0.0.1"
1918
},

0 commit comments

Comments
 (0)