File tree Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -43,15 +43,14 @@ module.exports = class Manifest {
4343 this . _index . set ( key , uri ) ;
4444
4545 let fp = this . filepath ;
46- return fp ? createFile ( fp , this . toJSON ( ) ) : Promise . resolve ( null ) ;
46+ return fp ? createFile ( fp , JSON . stringify ( this ) + "\n" ) : Promise . resolve ( null ) ;
4747 }
4848
4949 toJSON ( ) {
5050 let index = this . _index ;
51- let manifest = Array . from ( index . keys ( ) ) . sort ( ) . reduce ( ( memo , key ) => {
51+ return Array . from ( index . keys ( ) ) . sort ( ) . reduce ( ( memo , key ) => {
5252 memo [ key ] = index . get ( key ) ;
5353 return memo ;
5454 } , { } ) ;
55- return JSON . stringify ( manifest ) + "\n" ;
5655 }
5756} ;
Original file line number Diff line number Diff line change 2525 "lint" : " eslint --cache lib bin/* test test/bin/* && echo ✓"
2626 },
2727 "dependencies" : {
28- "browserslist" : " ~4.3.0 " ,
28+ "browserslist" : " ~4.3.4 " ,
2929 "minimist" : " ~1.2.0" ,
3030 "mkdirp" : " ~0.5.1" ,
3131 "nite-owl" : " ~3.3.2"
3232 },
3333 "devDependencies" : {
3434 "eslint-config-fnd" : " ^1.6.0" ,
3535 "mocha" : " ^5.2.0" ,
36- "npm-run-all" : " ^4.1.3 " ,
36+ "npm-run-all" : " ^4.1.5 " ,
3737 "release-util-fnd" : " ^1.1.1"
3838 }
3939}
Original file line number Diff line number Diff line change @@ -24,19 +24,19 @@ describe("manifest", _ => {
2424 let manifest = new Manifest ( root ) ;
2525 return manifest . set ( "foo.png" , "foo-abc123.png" ) .
2626 then ( _ => { // eslint-disable-next-line quotes
27- assertSame ( manifest . toJSON ( ) , `{"foo.png":"/foo-abc123.png"}\n ` ) ;
27+ assertSame ( JSON . stringify ( manifest ) , `{"foo.png":"/foo-abc123.png"}` ) ;
2828
2929 return manifest . set ( "bar.css" , "bar-def456.css" ) ;
3030 } ) .
3131 then ( _ => {
32- assertSame ( manifest . toJSON ( ) , // eslint-disable-next-line quotes
33- `{"bar.css":"/bar-def456.css","foo.png":"/foo-abc123.png"}\n ` ) ;
32+ assertSame ( JSON . stringify ( manifest ) , // eslint-disable-next-line quotes
33+ `{"bar.css":"/bar-def456.css","foo.png":"/foo-abc123.png"}` ) ;
3434
3535 return manifest . set ( "xox.js" , "xox-ghi789.js" ) ;
3636 } ) .
3737 then ( _ => {
38- assertSame ( manifest . toJSON ( ) , // eslint-disable-next-line quotes
39- `{"bar.css":"/bar-def456.css","foo.png":"/foo-abc123.png","xox.js":"/xox-ghi789.js"}\n ` ) ;
38+ assertSame ( JSON . stringify ( manifest ) , // eslint-disable-next-line quotes
39+ `{"bar.css":"/bar-def456.css","foo.png":"/foo-abc123.png","xox.js":"/xox-ghi789.js"}` ) ;
4040 } ) ;
4141 } ) ;
4242} ) ;
You can’t perform that action at this time.
0 commit comments