WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,14 @@ var fs = require('graceful-fs');
66var Vinyl = require ( 'vinyl' ) ;
77var Transform = require ( 'streamx' ) . Transform ;
88
9+ function newStats ( ) {
10+ // Node.js is cruel and emits deprecation if we don't build
11+ // a `new Stats()` like this
12+ var stats = Object . create ( fs . Stats . prototype ) ;
13+ fs . Stats . prototype . constructor . call ( stats ) ;
14+ return stats ;
15+ }
16+
917function prepareWrite ( folderResolver , optResolver ) {
1018 if ( ! folderResolver ) {
1119 throw new Error ( 'Invalid output folder' ) ;
@@ -35,7 +43,7 @@ function prepareWrite(folderResolver, optResolver) {
3543 file . path = writePath ;
3644 if ( ! file . isSymbolic ( ) ) {
3745 var mode = optResolver . resolve ( 'mode' , file ) ;
38- file . stat = file . stat || new fs . Stats ( ) ;
46+ file . stat = file . stat || newStats ( ) ;
3947 file . stat . mode = mode ;
4048 }
4149
Original file line number Diff line number Diff line change @@ -6,6 +6,14 @@ var fs = require('graceful-fs');
66var Vinyl = require ( 'vinyl' ) ;
77var Transform = require ( 'streamx' ) . Transform ;
88
9+ function newStats ( ) {
10+ // Node.js is cruel and emits deprecation if we don't build
11+ // a `new Stats()` like this
12+ var stats = Object . create ( fs . Stats . prototype ) ;
13+ fs . Stats . prototype . constructor . call ( stats ) ;
14+ return stats ;
15+ }
16+
917function prepareSymlink ( folderResolver , optResolver ) {
1018 if ( ! folderResolver ) {
1119 throw new Error ( 'Invalid output folder' ) ;
@@ -32,7 +40,7 @@ function prepareSymlink(folderResolver, optResolver) {
3240
3341 // Wire up new properties
3442 // Note: keep the target stats for now, we may need them in link-file
35- file . stat = file . stat || new fs . Stats ( ) ;
43+ file . stat = file . stat || newStats ( )
3644 file . cwd = cwd ;
3745 file . base = basePath ;
3846 // This is the path we are linking *TO*
Original file line number Diff line number Diff line change 3636 "streamx" : " ^2.14.0" ,
3737 "to-through" : " ^3.0.0" ,
3838 "value-or-function" : " ^4.0.0" ,
39- "vinyl" : " ^3.0.0 " ,
39+ "vinyl" : " ^3.0.1 " ,
4040 "vinyl-sourcemap" : " ^2.0.0"
4141 },
4242 "devDependencies" : {
You can’t perform that action at this time.
0 commit comments