File tree Expand file tree Collapse file tree 4 files changed +95
-229
lines changed Expand file tree Collapse file tree 4 files changed +95
-229
lines changed Original file line number Diff line number Diff line change 34
34
"homepage" : " https://github.com/gluons/gulp-json2cson" ,
35
35
"dependencies" : {
36
36
"cson" : " ^4.1.0" ,
37
- "gulp-util" : " ^3.0.8" ,
38
- "through2" : " ^2.0.3"
37
+ "plugin-error" : " ^0.1.2" ,
38
+ "replace-ext" : " ^1.0.0" ,
39
+ "through2" : " ^2.0.3" ,
40
+ "vinyl" : " ^2.1.0"
39
41
},
40
42
"devDependencies" : {
41
43
"babel-core" : " ^6.26.0" ,
46
48
"del" : " ^3.0.0" ,
47
49
"globby" : " ^7.1.1" ,
48
50
"make-dir" : " ^1.1.0" ,
49
- "mocha" : " *" ,
50
- "replace-ext" : " ^1.0.0"
51
+ "mocha" : " *"
51
52
}
52
53
}
Original file line number Diff line number Diff line change 1
- gutil = require ' gulp-util'
2
- through = require ' through2'
3
1
CSON = require ' cson'
4
-
5
- PluginError = gutil .PluginError
2
+ PluginError = require ' plugin-error'
3
+ replaceExt = require ' replace-ext'
4
+ through = require ' through2'
6
5
7
6
PLUGIN_NAME = ' gulp-json2cson'
8
7
@@ -16,7 +15,7 @@ module.exports = (indent = ' ') ->
16
15
try
17
16
json = JSON .parse file .contents .toString ()
18
17
file .contents = Buffer .from CSON .stringify json, null , indent
19
- file .path = gutil . replaceExtension file .path , ' .cson'
18
+ file .path = replaceExt file .path , ' .cson'
20
19
21
20
callback null , file
22
21
catch error
Original file line number Diff line number Diff line change 1
1
assert = require ' assert'
2
2
fs = require ' fs'
3
- gutil = require ' gulp-util '
3
+ Vinyl = require ' vinyl '
4
4
5
- { File } = gutil
6
5
{ readFileSync } = fs
7
6
8
7
json2cson = require ' ../dist/main.js'
@@ -13,7 +12,7 @@ describe 'JSON to CSON', () ->
13
12
it ' should parse JSON to CSON' , (done ) ->
14
13
myParser = json2cson ()
15
14
16
- fakeFile = new File {
15
+ fakeFile = new Vinyl {
17
16
cwd : ' .'
18
17
base : ' test/source'
19
18
path : ' test/source/success.json'
@@ -35,7 +34,7 @@ describe 'JSON to CSON', () ->
35
34
it ' should parse JSON to CSON with tab indentation' , (done ) ->
36
35
myParser = json2cson (' \t ' )
37
36
38
- fakeFile = new File {
37
+ fakeFile = new Vinyl {
39
38
cwd : ' .'
40
39
base : ' test/source'
41
40
path : ' test/source/success.json'
@@ -57,7 +56,7 @@ describe 'JSON to CSON', () ->
57
56
it ' should return error when cannot parse file' , (done ) ->
58
57
myParser = json2cson ()
59
58
60
- fakeFile = new File {
59
+ fakeFile = new Vinyl {
61
60
cwd : ' .'
62
61
base : ' test/source'
63
62
path : ' test/source/error.json'
You can’t perform that action at this time.
0 commit comments