Skip to content

Commit a29366a

Browse files
committed
Use 'Buffer.from'. Yarn.
1 parent 8e72bcc commit a29366a

File tree

8 files changed

+774
-13
lines changed

8 files changed

+774
-13
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
indent_size = 4
6+
charset = utf-8
7+
8+
[*.md]
9+
trim_trailing_whitespace = false
10+
11+
[{*.{coffee,cson,yml,yaml,jade,pug},{package,bower}.json}]
12+
indent_style = space
13+
indent_size = 2

.travis.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language: node_js
22
node_js:
3-
- "5"
4-
- "4"
3+
- "6"
4+
- "5"
5+
- "4"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![GitHub license](https://img.shields.io/github/license/gluons/gulp-json2cson.svg?style=flat-square)]()
33
[![npm](https://img.shields.io/npm/v/gulp-json2cson.svg?style=flat-square)](https://www.npmjs.com/package/gulp-json2cson)
44
[![npm](https://img.shields.io/npm/dt/gulp-json2cson.svg?style=flat-square)](https://www.npmjs.com/package/gulp-json2cson)
5-
[![Travis branch](https://img.shields.io/travis/gluons/gulp-json2cson/master.svg?style=flat-square)](https://travis-ci.org/gluons/gulp-json2cson)
5+
[![Travis branch](https://img.shields.io/travis/gluons/gulp-json2cson/node-6-buffer.svg?style=flat-square)](https://travis-ci.org/gluons/gulp-json2cson)
66

77
[Gulp](http://gulpjs.com/) plugin to parse JSON to CSON with [bevry/cson](https://github.com/bevry/cson)
88

coffeelint.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"indentation": {
3+
"uses": "spaces",
4+
"value": 2
5+
},
6+
"max_line_length": {
7+
"level": "ignore"
8+
}
9+
}

index.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = (indent = ' ') ->
1616

1717
try
1818
json = JSON.parse file.contents.toString()
19-
file.contents = new Buffer CSON.stringify json, null, indent
19+
file.contents = Buffer.from CSON.stringify json, null, indent
2020
file.path = gutil.replaceExtension file.path, '.cson'
2121

2222
callback null, file

package.json

+3-8
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,12 @@
2727
},
2828
"homepage": "https://github.com/gluons/gulp-json2cson#readme",
2929
"dependencies": {
30-
"coffee-script": "^1.10.0",
31-
"cson": "^3.0.2",
30+
"coffee-script": "^1.11.1",
31+
"cson": "^4.0.0",
3232
"gulp-util": "^3.0.7",
3333
"through2": "^2.0.1"
3434
},
3535
"devDependencies": {
36-
"mocha": "^2.4.5"
37-
},
38-
"coffeelintConfig": {
39-
"max_line_length": {
40-
"level": "ignore"
41-
}
36+
"mocha": "*"
4237
}
4338
}

test/test.coffee

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ describe 'JSON to CSON', () ->
5858
myParser.once 'error', (err) ->
5959
assert.notEqual err, null
6060
assert.equal err.name, 'SyntaxError'
61-
assert.equal err.message, 'Unexpected token :'
6261
done()
6362
return
6463

0 commit comments

Comments
 (0)