File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 "multer" : " ^0.1.8" ,
2121 "node-resemble-js" : " 0.0.4" ,
2222 "node-uuid" : " ^1.4.2" ,
23- "pngjs-image" : " ^0.9.3 " ,
23+ "pngjs-image" : " ^0.10.0 " ,
2424 "recursive-readdir" : " ^1.2.1" ,
2525 "tar.gz" : " ^0.1.1"
2626 },
Original file line number Diff line number Diff line change @@ -28,21 +28,9 @@ function getShasPath(project) {
2828}
2929
3030function getImageFromPath ( path ) {
31- return new Bluebird ( function ( resolve , reject ) {
32- var domain = require ( 'domain' ) . create ( ) ;
33- domain . on ( 'error' , function ( err ) {
34- reject ( err ) ;
35- } ) ;
36-
37- domain . run ( function ( ) {
38- PNGImage . readImageAsync ( path )
39- . then ( function ( image ) {
40- resolve ( image . getImage ( ) ) ;
41- } )
42- . catch ( function ( err ) {
43- reject ( err ) ;
44- } ) ;
45- } ) ;
31+ return PNGImage . readImageAsync ( path )
32+ . then ( function ( image ) {
33+ return image . getImage ( ) ;
4634 } ) ;
4735}
4836
@@ -63,21 +51,12 @@ var Storage = {
6351 } ,
6452
6553 hasProject : function ( project ) {
66- return new Bluebird ( function ( resolve ) {
67- var domain = require ( 'domain' ) . create ( ) ;
68- domain . on ( 'error' , function ( ) {
69- resolve ( false ) ;
70- } ) ;
71-
72- domain . run ( function ( ) {
73- fs . statAsync ( path . join ( dataPath , project , 'project.json' ) )
74- . then ( function ( stat ) {
75- resolve ( stat . isFile ( ) ) ;
76- } )
77- . catch ( function ( ) {
78- resolve ( false ) ;
79- } ) ;
80- } ) ;
54+ return fs . statAsync ( path . join ( dataPath , project , 'project.json' ) )
55+ . then ( function ( stat ) {
56+ return stat . isFile ( ) ;
57+ } )
58+ . catch ( function ( ) {
59+ return false ;
8160 } ) ;
8261 } ,
8362
You can’t perform that action at this time.
0 commit comments