77
88const bundleWalk = require ( 'npm-bundled' )
99const BundleWalker = bundleWalk . BundleWalker
10- const BundleWalkerSync = bundleWalk . BundleWalkerSync
1110
1211const ignoreWalk = require ( 'ignore-walk' )
1312const IgnoreWalker = ignoreWalk . Walker
14- const IgnoreWalkerSync = ignoreWalk . WalkerSync
1513
1614const rootBuiltinRules = Symbol ( 'root-builtin-rules' )
1715const packageNecessaryRules = Symbol ( 'package-necessary-rules' )
@@ -418,26 +416,6 @@ class Walker extends npmWalker(IgnoreWalker) {
418416 }
419417}
420418
421- class WalkerSync extends npmWalker ( IgnoreWalkerSync ) {
422- globFiles ( pattern , cb ) {
423- cb ( null , glob . sync ( pattern , { dot : true , cwd : this . path , nocase : true } ) )
424- }
425-
426- readPackageJson ( entries ) {
427- const p = this . path + '/package.json'
428- try {
429- this . onReadPackageJson ( entries , null , fs . readFileSync ( p ) )
430- } catch ( er ) {
431- this . onReadPackageJson ( entries , er )
432- }
433- }
434-
435- walker ( entry , opt , then ) {
436- new WalkerSync ( this . walkerOpt ( entry , opt ) ) . start ( )
437- then ( )
438- }
439- }
440-
441419const walk = ( options , callback ) => {
442420 options = options || { }
443421 const p = new Promise ( ( resolve , reject ) => {
@@ -452,16 +430,6 @@ const walk = (options, callback) => {
452430 return callback ? p . then ( res => callback ( null , res ) , callback ) : p
453431}
454432
455- const walkSync = options => {
456- options = options || { }
457- const bw = new BundleWalkerSync ( options ) . start ( )
458- options . bundled = bw . result
459- options . packageJsonCache = bw . packageJsonCache
460- const walker = new WalkerSync ( options )
461- walker . start ( )
462- return walker . result
463- }
464-
465433// optimize for compressibility
466434// extname, then basename, then locale alphabetically
467435// https://twitter.com/isntitvacant/status/1131094910923231232
@@ -477,6 +445,4 @@ const sort = (a, b) => {
477445}
478446
479447module . exports = walk
480- walk . sync = walkSync
481448walk . Walker = Walker
482- walk . WalkerSync = WalkerSync
0 commit comments