Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dree

Package Overview
Dependencies
Maintainers
1
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dree - npm Package Compare versions

Comparing version 4.6.0 to 4.6.1

2

bundled/bin/index.js
#!/usr/bin/env node
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("../lib/index")):"function"==typeof define&&define.amd?define("dree",["../lib/index"],t):"object"==typeof exports?exports.dree=t(require("../lib/index")):e.dree=t(e.dree)}(this,(e=>(()=>{"use strict";var t={130:function(e,t,o){var n=this&&this.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var n,i=0,r=t.length;i<r;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var i=o(760),r=o(147),s=o(259),d=o(259);function a(e){var t=/^\/(?<pattern>.*)\/(?<flags>[igm]*)?$/;return e?e.map((function(e){var o=e.match(t);return o?new RegExp(o.groups.pattern.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),o.groups.flags):e})):[]}function h(e){if(e)switch(e){case"ascending":return d.SortMethodPredefined.ALPHABETICAL;case"descending":return d.SortMethodPredefined.ALPHABETICAL_REVERSE;default:return e}}i.scriptName("dree").command("parse <source>","Save the directory tree as a text file",(function(e){e.positional("source",{describe:"The path of the root of the directory tree",type:"string"})}),(function(e){var t=e,o={symbolicLinks:t.symbolicLinks,followLinks:t.followLinks,showHidden:t.showHidden,depth:t.depth,exclude:a(t.exclude),extensions:t.extensions,sorted:h(t.sorted),skipErrors:t.skipErrors},n=t.source,i=t.dest,d=!t.dest||t.show,l=s.parse(n,o);d&&console.log(l),i&&(0,r.writeFileSync)(i,l)})).command("scan <source>","Save the directory tree as a json file",(function(e){e.positional("source",{describe:"The path of the root of the directory tree",type:"string"}).options({tabs:{describe:"How many tabs will be used to indent the resulted json",type:"number",default:0},pretty:{describe:"If the resulted json will be pretty printed with 4 tabs. Overwrites the tabs option",type:"boolean",default:!1}})}),(function(e){var t=e,o={stat:t.stat,normalize:t.normalize,symbolicLinks:t.symbolicLinks,followLinks:t.followLinks,sizeInBytes:t.sizeInBytes,size:t.size,hash:t.hash,hashAlgorithm:t.hashAlgorithm,hashEncoding:t.hashEncoding,showHidden:t.showHidden,depth:t.depth,exclude:a(t.exclude),matches:a(t.matches),emptyDirectory:t.emptyDirectory,excludeEmptyDirectories:t.excludeEmptyDirectories,descendants:t.descendants,descendantsIgnoreDirectories:t.descendantsIgnoreDirectories,extensions:t.extensions,sorted:h(t.sorted),skipErrors:t.skipErrors},n=t.source,i=t.dest,d=!t.dest||t.show,l=t.pretty?4:t.tabs,c=JSON.stringify(s.scan(n,o),null,l);d&&console.log(c),i&&(0,r.writeFileSync)(i,c)})).options({dest:{alias:"d",describe:"The path of the output file destination. If not specified, in any case the result will be printed on the command line.",type:"string"},show:{alias:"s",default:!1,describe:"Whether you want to print the result on the command line. This will be ignored and set to true if no destination is specified.",type:"boolean"},stat:{default:!1,describe:"Whether you want the fs.stat included in the json result",type:"boolean",hidden:!0},normalize:{default:!1,describe:"Whether you want to normalize the path in the json result",type:"boolean",hidden:!0},"symbolic-links":{default:!0,describe:"Whether you want to consider symbolic links during the elaboration, could not work on windows",type:"boolean",hidden:!0},"follow-links":{default:!1,describe:"Whether you want to follow symbolic links during the elaboration, could not work on windows",type:"boolean",hidden:!0},"size-in-bytes":{default:!0,describe:"Whether you want to include the size in bytes in the json result",type:"boolean",hidden:!0},size:{default:!0,describe:"Whether you want to include the size in a proper unit in the json result",type:"boolean",hidden:!0},hash:{default:!0,describe:"Whether you want to include the hash in the json result",type:"boolean",hidden:!0},"hash-algorithm":{default:"md5",describe:"The hash algorithm that you want to use for the hash in the json result",type:"string",choices:["md5","sha1"],hidden:!0},"hash-encoding":{default:"hex",describe:"The hash encoding that you want to use for the hash in the json result",type:"string",choiches:["hex","base64","latin1"],hidden:!0},"show-hidden":{default:!0,describe:"Whether you want to consider hidden files during the elaboration",type:"boolean",hidden:!0},depth:{default:void 0,describe:"The max depth wich could be reached during the elaboration from the given folder",type:"number",hidden:!0},exclude:{describe:"An array of strings (glob patterns) or regex (just write them as you would with js, e.g. /^[a-b]*$/g) whose all matched path will not be considered during the elaboration",type:"array",hidden:!0},matches:{describe:"An array of strings (glob patterns) or regex (just write them as you would with js, e.g. /^[a-b]*$/g) and all the non-matching paths will not be considered by the algorithm. Note: All the ancestors of a matching node will be added",type:"array",hidden:!0},extensions:{describe:"An array of strings containing all the extensions wich will be considered",type:"array",hidden:!0},"empty-directory":{default:!1,describe:"Whether you want to include the property isEmpty in the result",type:"boolean",hidden:!0},"exclude-empty-directories":{default:!1,describe:"Whether you want to exclude all the empty directories from the result, even if they contains nodes excluded by other options",type:"boolean",hidden:!0},sorted:{default:void 0,describe:"Whether you want the result to contain values sorted with a dree pre-defined sorting method. 'ascending' or 'descending' are kept for retrocompatibility. If not specified, the result values are not ordered.",type:"string",choices:n(n([],Object.values(d.SortMethodPredefined),!0),["ascending","descending"],!1),hidden:!0},descendants:{default:!1,describe:"Whether you want the result to contain the number of descendants for each node",type:"boolean",hidden:!0},"descendants-ignore-directories":{default:!1,describe:"Whether you want the result directories to be ignored when calculating the number of descendants",type:"boolean",hidden:!0},"skip-errors":{default:!0,describe:"Whether you want to skip folders and files wich give errors during the execution",type:"boolean",hidden:!0},options:{alias:"o",describe:"A path to a json config file. If an option is both on the file and in the command, the command one will be considered",config:!0}}).showHidden("all-options").completion("completion","Creates the completion bash script to add o your .bashrc in order to have the tab autocompletion for this cli service").demandCommand(1,"You must specify a command").strict().epilogue("For more information, find our manual at https://github.com/euberdeveloper/dree#readme").argv},760:e=>{e.exports=require("yargs")},147:e=>{e.exports=require("fs")},259:t=>{t.exports=e}},o={};return function e(n){var i=o[n];if(void 0!==i)return i.exports;var r=o[n]={exports:{}};return t[n].call(r.exports,r,r.exports,e),r.exports}(130)})()));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("../lib/index")):"function"==typeof define&&define.amd?define("dree",["../lib/index"],t):"object"==typeof exports?exports.dree=t(require("../lib/index")):e.dree=t(e.dree)}(this,(e=>(()=>{"use strict";var t={495:function(e,t,o){var n=this&&this.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var n,i=0,r=t.length;i<r;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var i=o(760),r=o(147),s=o(259),d=o(259);function a(e){var t=/^\/(?<pattern>.*)\/(?<flags>[igm]*)?$/;return e?e.map((function(e){var o=e.match(t);return o?new RegExp(o.groups.pattern.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),o.groups.flags):e})):[]}function h(e){if(e)switch(e){case"ascending":return d.SortMethodPredefined.ALPHABETICAL;case"descending":return d.SortMethodPredefined.ALPHABETICAL_REVERSE;default:return e}}i.scriptName("dree").command("parse <source>","Save the directory tree as a text file",(function(e){e.positional("source",{describe:"The path of the root of the directory tree",type:"string"})}),(function(e){var t=e,o={symbolicLinks:t.symbolicLinks,followLinks:t.followLinks,showHidden:t.showHidden,depth:t.depth,exclude:a(t.exclude),extensions:t.extensions,sorted:h(t.sorted),skipErrors:t.skipErrors},n=t.source,i=t.dest,d=!t.dest||t.show,l=s.parse(n,o);d&&console.log(l),i&&(0,r.writeFileSync)(i,l)})).command("scan <source>","Save the directory tree as a json file",(function(e){e.positional("source",{describe:"The path of the root of the directory tree",type:"string"}).options({tabs:{describe:"How many tabs will be used to indent the resulted json",type:"number",default:0},pretty:{describe:"If the resulted json will be pretty printed with 4 tabs. Overwrites the tabs option",type:"boolean",default:!1}})}),(function(e){var t=e,o={stat:t.stat,normalize:t.normalize,symbolicLinks:t.symbolicLinks,followLinks:t.followLinks,sizeInBytes:t.sizeInBytes,size:t.size,hash:t.hash,hashAlgorithm:t.hashAlgorithm,hashEncoding:t.hashEncoding,showHidden:t.showHidden,depth:t.depth,exclude:a(t.exclude),matches:a(t.matches),emptyDirectory:t.emptyDirectory,excludeEmptyDirectories:t.excludeEmptyDirectories,descendants:t.descendants,descendantsIgnoreDirectories:t.descendantsIgnoreDirectories,extensions:t.extensions,sorted:h(t.sorted),skipErrors:t.skipErrors},n=t.source,i=t.dest,d=!t.dest||t.show,l=t.pretty?4:t.tabs,c=JSON.stringify(s.scan(n,o),null,l);d&&console.log(c),i&&(0,r.writeFileSync)(i,c)})).options({dest:{alias:"d",describe:"The path of the output file destination. If not specified, in any case the result will be printed on the command line.",type:"string"},show:{alias:"s",default:!1,describe:"Whether you want to print the result on the command line. This will be ignored and set to true if no destination is specified.",type:"boolean"},stat:{default:!1,describe:"Whether you want the fs.stat included in the json result",type:"boolean",hidden:!0},normalize:{default:!1,describe:"Whether you want to normalize the path in the json result",type:"boolean",hidden:!0},"symbolic-links":{default:!0,describe:"Whether you want to consider symbolic links during the elaboration, could not work on windows",type:"boolean",hidden:!0},"follow-links":{default:!1,describe:"Whether you want to follow symbolic links during the elaboration, could not work on windows",type:"boolean",hidden:!0},"size-in-bytes":{default:!0,describe:"Whether you want to include the size in bytes in the json result",type:"boolean",hidden:!0},size:{default:!0,describe:"Whether you want to include the size in a proper unit in the json result",type:"boolean",hidden:!0},hash:{default:!0,describe:"Whether you want to include the hash in the json result",type:"boolean",hidden:!0},"hash-algorithm":{default:"md5",describe:"The hash algorithm that you want to use for the hash in the json result",type:"string",choices:["md5","sha1"],hidden:!0},"hash-encoding":{default:"hex",describe:"The hash encoding that you want to use for the hash in the json result",type:"string",choiches:["hex","base64","latin1"],hidden:!0},"show-hidden":{default:!0,describe:"Whether you want to consider hidden files during the elaboration",type:"boolean",hidden:!0},depth:{default:void 0,describe:"The max depth wich could be reached during the elaboration from the given folder",type:"number",hidden:!0},exclude:{describe:"An array of strings (glob patterns) or regex (just write them as you would with js, e.g. /^[a-b]*$/g) whose all matched path will not be considered during the elaboration",type:"array",hidden:!0},matches:{describe:"An array of strings (glob patterns) or regex (just write them as you would with js, e.g. /^[a-b]*$/g) and all the non-matching paths will not be considered by the algorithm. Note: All the ancestors of a matching node will be added",type:"array",hidden:!0},extensions:{describe:"An array of strings containing all the extensions wich will be considered",type:"array",hidden:!0},"empty-directory":{default:!1,describe:"Whether you want to include the property isEmpty in the result",type:"boolean",hidden:!0},"exclude-empty-directories":{default:!1,describe:"Whether you want to exclude all the empty directories from the result, even if they contains nodes excluded by other options",type:"boolean",hidden:!0},sorted:{default:void 0,describe:"Whether you want the result to contain values sorted with a dree pre-defined sorting method. 'ascending' or 'descending' are kept for retrocompatibility. If not specified, the result values are not ordered.",type:"string",choices:n(n([],Object.values(d.SortMethodPredefined),!0),["ascending","descending"],!1),hidden:!0},descendants:{default:!1,describe:"Whether you want the result to contain the number of descendants for each node",type:"boolean",hidden:!0},"descendants-ignore-directories":{default:!1,describe:"Whether you want the result directories to be ignored when calculating the number of descendants",type:"boolean",hidden:!0},"skip-errors":{default:!0,describe:"Whether you want to skip folders and files wich give errors during the execution",type:"boolean",hidden:!0},options:{alias:"o",describe:"A path to a json config file. If an option is both on the file and in the command, the command one will be considered",config:!0}}).showHidden("all-options").completion("completion","Creates the completion bash script to add o your .bashrc in order to have the tab autocompletion for this cli service").demandCommand(1,"You must specify a command").strict().epilogue("For more information, find our manual at https://github.com/euberdeveloper/dree#readme").argv},760:e=>{e.exports=require("yargs")},147:e=>{e.exports=require("fs")},259:t=>{t.exports=e}},o={};return function e(n){var i=o[n];if(void 0!==i)return i.exports;var r=o[n]={exports:{}};return t[n].call(r.exports,r,r.exports,e),r.exports}(495)})()));

@@ -1,1 +0,1 @@

!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("dree",[],r):"object"==typeof exports?exports.dree=r():e.dree=r()}(this,(()=>(()=>{"use strict";var e={183:function(e,r,t){var n=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var r;e.done?s(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(o,a)}c((n=n.apply(e,r||[])).next())}))},s=this&&this.__generator||function(e,r){var t,n,s,i,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(o=0)),o;)try{if(t=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(6===a[0]&&o.label<s[1]){o.label=s[1],s=a;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(a);break}s[2]&&o.ops.pop(),o.trys.pop();continue}a=r.call(e,o)}catch(e){a=[6,e],n=0}finally{t=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(r,"__esModule",{value:!0}),r.parseTreeAsync=r.parseTree=r.parseAsync=r.parse=r.scanAsync=r.scan=r.SortMethodPredefined=r.Type=void 0;var i,o,a=t(17),c=t(113),u=t(828),l=t(147),f=t(292);!function(e){e.DIRECTORY="directory",e.FILE="file"}(i||(r.Type=i={})),function(e){e.ALPHABETICAL="alpha",e.ALPHABETICAL_REVERSE="antialpha",e.ALPHABETICAL_INSENSITIVE="alpha-insensitive",e.ALPHABETICAL_INSENSITIVE_REVERSE="antialpha-insensitive"}(o||(r.SortMethodPredefined=o={}));var h={stat:!1,normalize:!1,symbolicLinks:!0,followLinks:!1,sizeInBytes:!0,size:!0,hash:!0,hashAlgorithm:"md5",hashEncoding:"hex",showHidden:!0,depth:void 0,exclude:void 0,matches:void 0,extensions:void 0,emptyDirectory:!1,excludeEmptyDirectories:!1,descendants:!1,descendantsIgnoreDirectories:!1,sorted:!1,skipErrors:!0},d={symbolicLinks:!0,followLinks:!1,showHidden:!0,depth:void 0,exclude:void 0,extensions:void 0,sorted:!1,skipErrors:!0};function p(e){return(Array.isArray(e)?e:[e]).map((function(e){return e instanceof RegExp?e:(0,u.makeRe)(e,{dot:!0})})).filter((function(e){return e instanceof RegExp}))}function v(e){var r={};if(e){for(var t in h)r[t]=void 0!==e[t]?e[t]:h[t];r.depth<0&&(r.depth=0)}else r=h;return r}function y(e){var r={};if(e){for(var t in d)r[t]=void 0!==e[t]?e[t]:d[t];r.depth<0&&(r.depth=0)}else r=d;return r}function E(e){var r,t=["B","KB","MB","GB","TB"];for(r=0;r<t.length&&e>1e3;r++)e/=1e3;return Math.round(100*e)/100+" "+t[r]}function m(e,r){return e.localeCompare(r)}function I(e,r){return e.toLowerCase().localeCompare(r.toLowerCase())}function L(e,r){if(!r)return e;if(!0===r)return e.sort(m);if("string"==typeof r)switch(r){case o.ALPHABETICAL:return e.sort(m);case o.ALPHABETICAL_REVERSE:return e.sort(m).reverse();case o.ALPHABETICAL_INSENSITIVE:return e.sort(I);case o.ALPHABETICAL_INSENSITIVE_REVERSE:return e.sort(I).reverse();default:return e}else if("function"==typeof r)return e.sort(r)}function b(e,r){if(!r)return e;if(!0===r)return e.sort((function(e,r){return m(e.relativePath,r.relativePath)}));if("string"==typeof r)switch(r){case o.ALPHABETICAL:return e.sort((function(e,r){return m(e.relativePath,r.relativePath)}));case o.ALPHABETICAL_REVERSE:return e.sort((function(e,r){return m(e.relativePath,r.relativePath)})).reverse();case o.ALPHABETICAL_INSENSITIVE:return e.sort((function(e,r){return I(e.relativePath,r.relativePath)}));case o.ALPHABETICAL_INSENSITIVE_REVERSE:return e.sort((function(e,r){return I(e.relativePath,r.relativePath)})).reverse();default:return e}else if("function"==typeof r)return e.sort((function(e,t){return r(e.relativePath,t.relativePath)}))}function w(e,r,t,n,s,o){if(void 0!==n.depth&&t>n.depth)return null;var u=e===r?".":(0,a.relative)(e,r);if(n.exclude&&e!==r&&p(n.exclude).some((function(e){return e.test("/".concat(u))})))return null;var f,h,d=(0,a.basename)(r);try{f=(0,l.statSync)(r)}catch(e){if(n.skipErrors)return null;throw e}try{h=(0,l.lstatSync)(r)}catch(e){if(n.skipErrors)return null;throw e}var v,y=h.isSymbolicLink(),m=f.isFile()?i.FILE:i.DIRECTORY;if(!n.showHidden&&"."===d.charAt(0))return null;if(!n.symbolicLinks&&y)return null;if(n.hash){var I=n.hashAlgorithm;(v=(0,c.createHash)(I)).update(d)}var b={name:d,path:n.normalize?r.replace(/\\/g,"/"):r,relativePath:n.normalize?u.replace(/\\/g,"/"):u,type:m,isSymbolicLink:y,stat:n.followLinks?f:h};switch(n.stat||delete b.stat,m){case i.DIRECTORY:var k=[],x=void 0;if(n.followLinks||!y){try{x=L(x=(0,l.readdirSync)(r),n.sorted)}catch(e){if(n.skipErrors)return null;throw e}if(n.emptyDirectory&&(b.isEmpty=!x.length),x.forEach((function(i){var c=w(e,(0,a.resolve)(r,i),t+1,n,s,o);null!==c&&k.push(c)})),n.excludeEmptyDirectories&&!k.length)return null}if(n.matches&&e!==r){var A=p(n.matches);if(!k.length&&A.some((function(e){return!e.test("/".concat(u))})))return null}if(n.sizeInBytes||n.size){var g=k.reduce((function(e,r){return e+r.sizeInBytes}),0);b.sizeInBytes=g,b.size=n.size?E(g):void 0,n.sizeInBytes||k.forEach((function(e){return e.sizeInBytes=void 0}))}if(n.hash){k.forEach((function(e){v.update(e.hash)}));var R=n.hashEncoding;b.hash=v.digest(R)}n.descendants&&(b.descendants=k.reduce((function(e,r){var t;return e+(r.type===i.DIRECTORY&&n.descendantsIgnoreDirectories?0:1)+(null!==(t=r.descendants)&&void 0!==t?t:0)}),0)),k.length&&(b.children=k);break;case i.FILE:if(b.extension=(0,a.extname)(r).replace(".",""),n.extensions&&-1===n.extensions.indexOf(b.extension))return null;if(n.matches&&e!==r&&(A=p(n.matches)).some((function(e){return!e.test("/".concat(u))})))return null;if((n.sizeInBytes||n.size)&&(g=n.followLinks?f.size:h.size,b.sizeInBytes=g,b.size=n.size?E(g):void 0),n.hash){var S=void 0;try{S=(0,l.readFileSync)(r)}catch(e){if(n.skipErrors)return null;throw e}v.update(S),R=n.hashEncoding,b.hash=v.digest(R)}break;default:return null}return s&&m===i.FILE?s(b,n.followLinks?f:h):o&&m===i.DIRECTORY&&o(b,n.followLinks?f:h),b}function k(e,r,t,o,u,l){return n(this,void 0,void 0,(function(){var h,d,v,y,m,I,b,w,x,A,g,R,S,z,T,B,C,P,D,O=this;return s(this,(function(H){switch(H.label){case 0:if(void 0!==o.depth&&t>o.depth)return[2,null];if(h=e===r?".":(0,a.relative)(e,r),o.exclude&&e!==r&&p(o.exclude).some((function(e){return e.test("/".concat(h))})))return[2,null];d=(0,a.basename)(r),H.label=1;case 1:return H.trys.push([1,3,,4]),[4,(0,f.stat)(r)];case 2:return v=H.sent(),[3,4];case 3:if(y=H.sent(),o.skipErrors)return[2,null];throw y;case 4:return H.trys.push([4,6,,7]),[4,(0,f.lstat)(r)];case 5:return m=H.sent(),[3,7];case 6:if(I=H.sent(),o.skipErrors)return[2,null];throw I;case 7:if(b=m.isSymbolicLink(),w=v.isFile()?i.FILE:i.DIRECTORY,!o.showHidden&&"."===d.charAt(0))return[2,null];if(!o.symbolicLinks&&b)return[2,null];switch(o.hash&&(A=o.hashAlgorithm,(x=(0,c.createHash)(A)).update(d)),g={name:d,path:o.normalize?r.replace(/\\/g,"/"):r,relativePath:o.normalize?h.replace(/\\/g,"/"):h,type:w,isSymbolicLink:b,stat:o.followLinks?v:m},o.stat||delete g.stat,w){case i.DIRECTORY:return[3,8];case i.FILE:return[3,15]}return[3,21];case 8:if(R=[],S=void 0,!o.followLinks&&b)return[3,14];H.label=9;case 9:return H.trys.push([9,11,,12]),[4,(0,f.readdir)(r)];case 10:return S=L(S=H.sent(),o.sorted),[3,12];case 11:if(z=H.sent(),o.skipErrors)return[2,null];throw z;case 12:return o.emptyDirectory&&(g.isEmpty=!S.length),[4,Promise.all(S.map((function(i){return n(O,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,k(e,(0,a.resolve)(r,i),t+1,o,u,l)];case 1:return[2,n.sent()]}}))}))})))];case 13:if(R=(R=H.sent()).filter((function(e){return null!==e})),o.excludeEmptyDirectories&&!R.length)return[2,null];H.label=14;case 14:return o.matches&&e!==r&&(T=p(o.matches),!R.length&&T.some((function(e){return!e.test("/".concat(h))})))?[2,null]:((o.sizeInBytes||o.size)&&(B=R.reduce((function(e,r){return e+r.sizeInBytes}),0),g.sizeInBytes=B,g.size=o.size?E(B):void 0,o.sizeInBytes||R.forEach((function(e){return e.sizeInBytes=void 0}))),o.hash&&(R.forEach((function(e){x.update(e.hash)})),D=o.hashEncoding,g.hash=x.digest(D)),o.descendants&&(g.descendants=R.reduce((function(e,r){var t;return e+(r.type===i.DIRECTORY&&o.descendantsIgnoreDirectories?0:1)+(null!==(t=r.descendants)&&void 0!==t?t:0)}),0)),R.length&&(g.children=R),[3,22]);case 15:if(g.extension=(0,a.extname)(r).replace(".",""),o.extensions&&-1===o.extensions.indexOf(g.extension))return[2,null];if(o.matches&&e!==r&&(T=p(o.matches)).some((function(e){return!e.test("/".concat(h))})))return[2,null];if((o.sizeInBytes||o.size)&&(B=o.followLinks?v.size:m.size,g.sizeInBytes=B,g.size=o.size?E(B):void 0),!o.hash)return[3,20];C=void 0,H.label=16;case 16:return H.trys.push([16,18,,19]),[4,(0,f.readFile)(r)];case 17:return C=H.sent(),[3,19];case 18:if(P=H.sent(),o.skipErrors)return[2,null];throw P;case 19:x.update(C),D=o.hashEncoding,g.hash=x.digest(D),H.label=20;case 20:return[3,22];case 21:return[2,null];case 22:return u&&w===i.FILE?[4,u(g,o.followLinks?v:m)]:[3,24];case 23:return H.sent(),[3,26];case 24:return l&&w===i.DIRECTORY?[4,l(g,o.followLinks?v:m)]:[3,26];case 25:H.sent(),H.label=26;case 26:return[2,g]}}))}))}function x(e,r,t){return!r.symbolicLinks&&e.isSymbolicLink||!r.showHidden&&"."===e.name.charAt(0)||void 0!==r.extensions&&e.type===i.FILE&&-1===r.extensions.indexOf(e.extension)||r.exclude&&p(r.exclude).some((function(r){return r.test("/".concat(e.relativePath))}))||void 0!==r.depth&&t>r.depth}function A(e,r,t,n,s){var o="",c=r.map((function(o,c){var u="";if(void 0!==n.depth&&s>n.depth)return"";if(n.exclude&&p(n.exclude).some((function(r){return r.test("/".concat((0,a.relative)(e,o)))})))return"";var f,h,d=(0,a.basename)(o);try{f=(0,l.statSync)(o)}catch(e){if(n.skipErrors)return null;throw e}try{h=(0,l.lstatSync)(o)}catch(e){if(n.skipErrors)return null;throw e}var v=h.isSymbolicLink(),y=f.isFile()?i.FILE:i.DIRECTORY;if(!n.showHidden&&"."===d.charAt(0))return"";if(!n.symbolicLinks&&v)return"";var E=(0,a.extname)(o).replace(".","");if(n.extensions&&y===i.FILE&&-1===n.extensions.indexOf(E))return"";var m=v?">>":y===i.DIRECTORY?"─> ":"── ",I=t+(c===r.length-1?" ":"│ ");if(u+=m+d,(n.followLinks||!v)&&y===i.DIRECTORY){var b;try{b=L(b=(0,l.readdirSync)(o).map((function(e){return(0,a.resolve)(o,e)})),n.sorted)}catch(e){if(n.skipErrors)return null;throw e}u+=b.length?A(e,b,I,n,s+1):""}return u}));return c.filter((function(e){return!!e})).forEach((function(e,r,n){o+=t+(r===n.length-1?"└"+e:"├"+e)})),o}function g(e,r,t,o,c){return n(this,void 0,void 0,(function(){var u,l=this;return s(this,(function(h){switch(h.label){case 0:return u="",[4,Promise.all(r.map((function(u,h){return n(l,void 0,void 0,(function(){var n,l,d,v,y,E,m,I,b,w,k,x,A,R,S;return s(this,(function(s){switch(s.label){case 0:if(n="",void 0!==o.depth&&c>o.depth)return[2,""];if(o.exclude&&p(o.exclude).some((function(r){return r.test("/".concat((0,a.relative)(e,u)))})))return[2,""];l=(0,a.basename)(u),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,(0,f.stat)(u)];case 2:return d=s.sent(),[3,4];case 3:if(v=s.sent(),o.skipErrors)return[2,null];throw v;case 4:return s.trys.push([4,6,,7]),[4,(0,f.lstat)(u)];case 5:return y=s.sent(),[3,7];case 6:if(E=s.sent(),o.skipErrors)return[2,null];throw E;case 7:if(m=y.isSymbolicLink(),I=d.isFile()?i.FILE:i.DIRECTORY,!o.showHidden&&"."===l.charAt(0))return[2,""];if(!o.symbolicLinks&&m)return[2,""];if(b=(0,a.extname)(u).replace(".",""),o.extensions&&I===i.FILE&&-1===o.extensions.indexOf(b))return[2,""];if(w=m?">>":I===i.DIRECTORY?"─> ":"── ",k=t+(h===r.length-1?" ":"│ "),n+=w+l,!o.followLinks&&m||I!==i.DIRECTORY)return[3,15];s.label=8;case 8:return s.trys.push([8,10,,11]),[4,(0,f.readdir)(u)];case 9:return x=L(x=s.sent().map((function(e){return(0,a.resolve)(u,e)})),o.sorted),[3,11];case 10:if(A=s.sent(),o.skipErrors)return[2,null];throw A;case 11:return R=n,x.length?[4,g(e,x,k,o,c+1)]:[3,13];case 12:return S=s.sent(),[3,14];case 13:S="",s.label=14;case 14:n=R+S,s.label=15;case 15:return[2,n]}}))}))})))];case 1:return h.sent().filter((function(e){return!!e})).forEach((function(e,r,n){u+=t+(r===n.length-1?"└"+e:"├"+e)})),[2,u]}}))}))}function R(e,r,t,n){var s="";return(e=b(e,t.sorted)).filter((function(e){return!x(e,t,n)})).forEach((function(e,o,a){var c=e.isSymbolicLink?">>":e.type===i.DIRECTORY?"─> ":"── ",u=o===a.length-1?"└"+c:"├"+c,l=r+(o===a.length-1?" ":"│ ");s+=r+u+e.name,s+=!e.children||!t.followLinks&&e.isSymbolicLink?"":R(e.children,l,t,n+1)})),s}function S(e,r,t,o){return n(this,void 0,void 0,(function(){var n,a,c,u,l,f,h,d,p;return s(this,(function(s){switch(s.label){case 0:n="",e=b(e,t.sorted),a=e.filter((function(e){return!x(e,t,o)})),c=0,s.label=1;case 1:return c<a.length?(u=a[c],l=u.isSymbolicLink?">>":u.type===i.DIRECTORY?"─> ":"── ",f=c===a.length-1?"└"+l:"├"+l,h=r+(c===a.length-1?" ":"│ "),n+=r+f+u.name,d=n,!u.children||!t.followLinks&&u.isSymbolicLink?[3,3]:[4,S(u.children,h,t,o+1)]):[3,6];case 2:return p=s.sent(),[3,4];case 3:p="",s.label=4;case 4:n=d+p,s.label=5;case 5:return c++,[3,1];case 6:return[2,n]}}))}))}r.scan=function(e,r,t,n){var s=(0,a.resolve)(e),i=v(r),o=w(s,s,0,i,t,n);return o&&(o.sizeInBytes=i.sizeInBytes?o.sizeInBytes:void 0),o},r.scanAsync=function(e,r,t,i){return n(this,void 0,void 0,(function(){var n,o,c;return s(this,(function(s){switch(s.label){case 0:return n=(0,a.resolve)(e),o=v(r),[4,k(n,n,0,o,t,i)];case 1:return(c=s.sent())&&(c.sizeInBytes=o.sizeInBytes?c.sizeInBytes:void 0),[2,c]}}))}))},r.parse=function(e,r){var t,n,s="",i=(0,a.resolve)(e),o=y(r);s+=(0,a.basename)(i);try{t=(0,l.statSync)(e)}catch(e){if(o.skipErrors)return null;throw e}try{n=(0,l.lstatSync)(e)}catch(e){if(o.skipErrors)return null;throw e}var c=n.isSymbolicLink();if((o.followLinks||!c)&&t.isDirectory()){var u=void 0;try{u=L(u=(0,l.readdirSync)(i).map((function(e){return(0,a.resolve)(i,e)})),o.sorted)}catch(e){if(o.skipErrors)return null;throw e}s+=u.length?A(e,u,"\n ",o,1):""}return s},r.parseAsync=function(e,r){return n(this,void 0,void 0,(function(){var t,n,i,o,c,u,l,h,d,p,v,E,m;return s(this,(function(s){switch(s.label){case 0:t="",n=(0,a.resolve)(e),i=y(r),o=(0,a.basename)(n),t+=o,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,(0,f.stat)(e)];case 2:return c=s.sent(),[3,4];case 3:if(u=s.sent(),i.skipErrors)return[2,null];throw u;case 4:return s.trys.push([4,6,,7]),[4,(0,f.lstat)(e)];case 5:return l=s.sent(),[3,7];case 6:if(h=s.sent(),i.skipErrors)return[2,null];throw h;case 7:if(d=l.isSymbolicLink(),!i.followLinks&&d||!c.isDirectory())return[3,15];p=void 0,s.label=8;case 8:return s.trys.push([8,10,,11]),[4,(0,f.readdir)(n)];case 9:return p=L(p=s.sent().map((function(e){return(0,a.resolve)(n,e)})),i.sorted),[3,11];case 10:if(v=s.sent(),i.skipErrors)return[2,null];throw v;case 11:return E=t,p.length?[4,g(e,p,"\n ",i,1)]:[3,13];case 12:return m=s.sent(),[3,14];case 13:m="",s.label=14;case 14:t=E+m,s.label=15;case 15:return[2,t]}}))}))},r.parseTree=function(e,r){var t="",n=y(r);return(t+=e?e.name:"")+(e.children?R(e.children,"\n ",n,1):"")},r.parseTreeAsync=function(e,r){return n(this,void 0,void 0,(function(){var t,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t="",n=y(r),t+=e?e.name:"",i=t,e.children?[4,S(e.children,"\n ",n,1)]:[3,2];case 1:return o=s.sent(),[3,3];case 2:o="",s.label=3;case 3:return[2,t=i+o]}}))}))}},828:e=>{e.exports=require("minimatch")},113:e=>{e.exports=require("crypto")},147:e=>{e.exports=require("fs")},292:e=>{e.exports=require("fs/promises")},17:e=>{e.exports=require("path")}},r={};return function t(n){var s=r[n];if(void 0!==s)return s.exports;var i=r[n]={exports:{}};return e[n].call(i.exports,i,i.exports,t),i.exports}(183)})()));
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("dree",[],r):"object"==typeof exports?exports.dree=r():e.dree=r()}(this,(()=>(()=>{"use strict";var e={807:function(e,r,t){var n=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var r;e.done?s(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(o,a)}c((n=n.apply(e,r||[])).next())}))},s=this&&this.__generator||function(e,r){var t,n,s,i,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(o=0)),o;)try{if(t=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(6===a[0]&&o.label<s[1]){o.label=s[1],s=a;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(a);break}s[2]&&o.ops.pop(),o.trys.pop();continue}a=r.call(e,o)}catch(e){a=[6,e],n=0}finally{t=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(r,"__esModule",{value:!0}),r.parseTreeAsync=r.parseTree=r.parseAsync=r.parse=r.scanAsync=r.scan=r.SortMethodPredefined=r.Type=void 0;var i,o,a=t(17),c=t(113),u=t(828),l=t(147),f=t(292);!function(e){e.DIRECTORY="directory",e.FILE="file"}(i||(r.Type=i={})),function(e){e.ALPHABETICAL="alpha",e.ALPHABETICAL_REVERSE="antialpha",e.ALPHABETICAL_INSENSITIVE="alpha-insensitive",e.ALPHABETICAL_INSENSITIVE_REVERSE="antialpha-insensitive"}(o||(r.SortMethodPredefined=o={}));var h={stat:!1,normalize:!1,symbolicLinks:!0,followLinks:!1,sizeInBytes:!0,size:!0,hash:!0,hashAlgorithm:"md5",hashEncoding:"hex",showHidden:!0,depth:void 0,exclude:void 0,matches:void 0,extensions:void 0,emptyDirectory:!1,excludeEmptyDirectories:!1,descendants:!1,descendantsIgnoreDirectories:!1,sorted:!1,skipErrors:!0},d={symbolicLinks:!0,followLinks:!1,showHidden:!0,depth:void 0,exclude:void 0,extensions:void 0,sorted:!1,skipErrors:!0};function p(e){return(Array.isArray(e)?e:[e]).map((function(e){return e instanceof RegExp?e:(0,u.makeRe)(e,{dot:!0})})).filter((function(e){return e instanceof RegExp}))}function v(e){var r={};if(e){for(var t in h)r[t]=void 0!==e[t]?e[t]:h[t];r.depth<0&&(r.depth=0)}else r=h;return r}function y(e){var r={};if(e){for(var t in d)r[t]=void 0!==e[t]?e[t]:d[t];r.depth<0&&(r.depth=0)}else r=d;return r}function E(e){var r,t=["B","KB","MB","GB","TB"];for(r=0;r<t.length&&e>1e3;r++)e/=1e3;return Math.round(100*e)/100+" "+t[r]}function m(e,r){return e.localeCompare(r)}function I(e,r){return e.toLowerCase().localeCompare(r.toLowerCase())}function L(e,r){if(!r)return e;if(!0===r)return e.sort(m);if("string"==typeof r)switch(r){case o.ALPHABETICAL:return e.sort(m);case o.ALPHABETICAL_REVERSE:return e.sort(m).reverse();case o.ALPHABETICAL_INSENSITIVE:return e.sort(I);case o.ALPHABETICAL_INSENSITIVE_REVERSE:return e.sort(I).reverse();default:return e}else if("function"==typeof r)return e.sort(r)}function b(e,r){if(!r)return e;if(!0===r)return e.sort((function(e,r){return m(e.relativePath,r.relativePath)}));if("string"==typeof r)switch(r){case o.ALPHABETICAL:return e.sort((function(e,r){return m(e.relativePath,r.relativePath)}));case o.ALPHABETICAL_REVERSE:return e.sort((function(e,r){return m(e.relativePath,r.relativePath)})).reverse();case o.ALPHABETICAL_INSENSITIVE:return e.sort((function(e,r){return I(e.relativePath,r.relativePath)}));case o.ALPHABETICAL_INSENSITIVE_REVERSE:return e.sort((function(e,r){return I(e.relativePath,r.relativePath)})).reverse();default:return e}else if("function"==typeof r)return e.sort((function(e,t){return r(e.relativePath,t.relativePath)}))}function w(e,r,t,n,s,o){if(void 0!==n.depth&&t>n.depth)return null;var u=e===r?".":(0,a.relative)(e,r);if(n.exclude&&e!==r&&p(n.exclude).some((function(e){return e.test("/".concat(u))})))return null;var f,h,d=(0,a.basename)(r);try{f=(0,l.statSync)(r)}catch(e){if(n.skipErrors)return null;throw e}try{h=(0,l.lstatSync)(r)}catch(e){if(n.skipErrors)return null;throw e}var v,y=h.isSymbolicLink(),m=f.isFile()?i.FILE:i.DIRECTORY;if(!n.showHidden&&"."===d.charAt(0))return null;if(!n.symbolicLinks&&y)return null;if(n.hash){var I=n.hashAlgorithm;(v=(0,c.createHash)(I)).update(d)}var b={name:d,path:n.normalize?r.replace(/\\/g,"/"):r,relativePath:n.normalize?u.replace(/\\/g,"/"):u,type:m,isSymbolicLink:y,stat:n.followLinks?f:h};switch(n.stat||delete b.stat,m){case i.DIRECTORY:var k=[],x=void 0;if(n.followLinks||!y){try{x=L(x=(0,l.readdirSync)(r),n.sorted)}catch(e){if(n.skipErrors)return null;throw e}if(n.emptyDirectory&&(b.isEmpty=!x.length),x.forEach((function(i){var c=w(e,(0,a.resolve)(r,i),t+1,n,s,o);null!==c&&k.push(c)})),n.excludeEmptyDirectories&&!k.length)return null}if(n.matches&&e!==r){var A=p(n.matches);if(!k.length&&A.some((function(e){return!e.test("/".concat(u))})))return null}if(n.sizeInBytes||n.size){var g=k.reduce((function(e,r){return e+r.sizeInBytes}),0);b.sizeInBytes=g,b.size=n.size?E(g):void 0,n.sizeInBytes||k.forEach((function(e){return e.sizeInBytes=void 0}))}if(n.hash){k.forEach((function(e){v.update(e.hash)}));var R=n.hashEncoding;b.hash=v.digest(R)}n.descendants&&(b.descendants=k.reduce((function(e,r){var t;return e+(r.type===i.DIRECTORY&&n.descendantsIgnoreDirectories?0:1)+(null!==(t=r.descendants)&&void 0!==t?t:0)}),0)),k.length&&(b.children=k);break;case i.FILE:if(b.extension=(0,a.extname)(r).replace(".",""),n.extensions&&-1===n.extensions.indexOf(b.extension))return null;if(n.matches&&e!==r&&(A=p(n.matches)).some((function(e){return!e.test("/".concat(u))})))return null;if((n.sizeInBytes||n.size)&&(g=n.followLinks?f.size:h.size,b.sizeInBytes=g,b.size=n.size?E(g):void 0),n.hash){var S=void 0;try{S=(0,l.readFileSync)(r)}catch(e){if(n.skipErrors)return null;throw e}v.update(S),R=n.hashEncoding,b.hash=v.digest(R)}break;default:return null}return s&&m===i.FILE?s(b,n.followLinks?f:h):o&&m===i.DIRECTORY&&o(b,n.followLinks?f:h),b}function k(e,r,t,o,u,l){return n(this,void 0,void 0,(function(){var h,d,v,y,m,I,b,w,x,A,g,R,S,z,T,B,C,P,D,O=this;return s(this,(function(H){switch(H.label){case 0:if(void 0!==o.depth&&t>o.depth)return[2,null];if(h=e===r?".":(0,a.relative)(e,r),o.exclude&&e!==r&&p(o.exclude).some((function(e){return e.test("/".concat(h))})))return[2,null];d=(0,a.basename)(r),H.label=1;case 1:return H.trys.push([1,3,,4]),[4,(0,f.stat)(r)];case 2:return v=H.sent(),[3,4];case 3:if(y=H.sent(),o.skipErrors)return[2,null];throw y;case 4:return H.trys.push([4,6,,7]),[4,(0,f.lstat)(r)];case 5:return m=H.sent(),[3,7];case 6:if(I=H.sent(),o.skipErrors)return[2,null];throw I;case 7:if(b=m.isSymbolicLink(),w=v.isFile()?i.FILE:i.DIRECTORY,!o.showHidden&&"."===d.charAt(0))return[2,null];if(!o.symbolicLinks&&b)return[2,null];switch(o.hash&&(A=o.hashAlgorithm,(x=(0,c.createHash)(A)).update(d)),g={name:d,path:o.normalize?r.replace(/\\/g,"/"):r,relativePath:o.normalize?h.replace(/\\/g,"/"):h,type:w,isSymbolicLink:b,stat:o.followLinks?v:m},o.stat||delete g.stat,w){case i.DIRECTORY:return[3,8];case i.FILE:return[3,15]}return[3,21];case 8:if(R=[],S=void 0,!o.followLinks&&b)return[3,14];H.label=9;case 9:return H.trys.push([9,11,,12]),[4,(0,f.readdir)(r)];case 10:return S=L(S=H.sent(),o.sorted),[3,12];case 11:if(z=H.sent(),o.skipErrors)return[2,null];throw z;case 12:return o.emptyDirectory&&(g.isEmpty=!S.length),[4,Promise.all(S.map((function(i){return n(O,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,k(e,(0,a.resolve)(r,i),t+1,o,u,l)];case 1:return[2,n.sent()]}}))}))})))];case 13:if(R=(R=H.sent()).filter((function(e){return null!==e})),o.excludeEmptyDirectories&&!R.length)return[2,null];H.label=14;case 14:return o.matches&&e!==r&&(T=p(o.matches),!R.length&&T.some((function(e){return!e.test("/".concat(h))})))?[2,null]:((o.sizeInBytes||o.size)&&(B=R.reduce((function(e,r){return e+r.sizeInBytes}),0),g.sizeInBytes=B,g.size=o.size?E(B):void 0,o.sizeInBytes||R.forEach((function(e){return e.sizeInBytes=void 0}))),o.hash&&(R.forEach((function(e){x.update(e.hash)})),D=o.hashEncoding,g.hash=x.digest(D)),o.descendants&&(g.descendants=R.reduce((function(e,r){var t;return e+(r.type===i.DIRECTORY&&o.descendantsIgnoreDirectories?0:1)+(null!==(t=r.descendants)&&void 0!==t?t:0)}),0)),R.length&&(g.children=R),[3,22]);case 15:if(g.extension=(0,a.extname)(r).replace(".",""),o.extensions&&-1===o.extensions.indexOf(g.extension))return[2,null];if(o.matches&&e!==r&&(T=p(o.matches)).some((function(e){return!e.test("/".concat(h))})))return[2,null];if((o.sizeInBytes||o.size)&&(B=o.followLinks?v.size:m.size,g.sizeInBytes=B,g.size=o.size?E(B):void 0),!o.hash)return[3,20];C=void 0,H.label=16;case 16:return H.trys.push([16,18,,19]),[4,(0,f.readFile)(r)];case 17:return C=H.sent(),[3,19];case 18:if(P=H.sent(),o.skipErrors)return[2,null];throw P;case 19:x.update(C),D=o.hashEncoding,g.hash=x.digest(D),H.label=20;case 20:return[3,22];case 21:return[2,null];case 22:return u&&w===i.FILE?[4,u(g,o.followLinks?v:m)]:[3,24];case 23:return H.sent(),[3,26];case 24:return l&&w===i.DIRECTORY?[4,l(g,o.followLinks?v:m)]:[3,26];case 25:H.sent(),H.label=26;case 26:return[2,g]}}))}))}function x(e,r,t){return!r.symbolicLinks&&e.isSymbolicLink||!r.showHidden&&"."===e.name.charAt(0)||void 0!==r.extensions&&e.type===i.FILE&&-1===r.extensions.indexOf(e.extension)||r.exclude&&p(r.exclude).some((function(r){return r.test("/".concat(e.relativePath))}))||void 0!==r.depth&&t>r.depth}function A(e,r,t,n,s){var o="",c=r.map((function(o,c){var u="";if(void 0!==n.depth&&s>n.depth)return"";if(n.exclude&&p(n.exclude).some((function(r){return r.test("/".concat((0,a.relative)(e,o)))})))return"";var f,h,d=(0,a.basename)(o);try{f=(0,l.statSync)(o)}catch(e){if(n.skipErrors)return null;throw e}try{h=(0,l.lstatSync)(o)}catch(e){if(n.skipErrors)return null;throw e}var v=h.isSymbolicLink(),y=f.isFile()?i.FILE:i.DIRECTORY;if(!n.showHidden&&"."===d.charAt(0))return"";if(!n.symbolicLinks&&v)return"";var E=(0,a.extname)(o).replace(".","");if(n.extensions&&y===i.FILE&&-1===n.extensions.indexOf(E))return"";var m=v?">>":y===i.DIRECTORY?"─> ":"── ",I=t+(c===r.length-1?" ":"│ ");if(u+=m+d,(n.followLinks||!v)&&y===i.DIRECTORY){var b;try{b=L(b=(0,l.readdirSync)(o).map((function(e){return(0,a.resolve)(o,e)})),n.sorted)}catch(e){if(n.skipErrors)return null;throw e}u+=b.length?A(e,b,I,n,s+1):""}return u}));return c.filter((function(e){return!!e})).forEach((function(e,r,n){o+=t+(r===n.length-1?"└"+e:"├"+e)})),o}function g(e,r,t,o,c){return n(this,void 0,void 0,(function(){var u,l=this;return s(this,(function(h){switch(h.label){case 0:return u="",[4,Promise.all(r.map((function(u,h){return n(l,void 0,void 0,(function(){var n,l,d,v,y,E,m,I,b,w,k,x,A,R,S;return s(this,(function(s){switch(s.label){case 0:if(n="",void 0!==o.depth&&c>o.depth)return[2,""];if(o.exclude&&p(o.exclude).some((function(r){return r.test("/".concat((0,a.relative)(e,u)))})))return[2,""];l=(0,a.basename)(u),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,(0,f.stat)(u)];case 2:return d=s.sent(),[3,4];case 3:if(v=s.sent(),o.skipErrors)return[2,null];throw v;case 4:return s.trys.push([4,6,,7]),[4,(0,f.lstat)(u)];case 5:return y=s.sent(),[3,7];case 6:if(E=s.sent(),o.skipErrors)return[2,null];throw E;case 7:if(m=y.isSymbolicLink(),I=d.isFile()?i.FILE:i.DIRECTORY,!o.showHidden&&"."===l.charAt(0))return[2,""];if(!o.symbolicLinks&&m)return[2,""];if(b=(0,a.extname)(u).replace(".",""),o.extensions&&I===i.FILE&&-1===o.extensions.indexOf(b))return[2,""];if(w=m?">>":I===i.DIRECTORY?"─> ":"── ",k=t+(h===r.length-1?" ":"│ "),n+=w+l,!o.followLinks&&m||I!==i.DIRECTORY)return[3,15];s.label=8;case 8:return s.trys.push([8,10,,11]),[4,(0,f.readdir)(u)];case 9:return x=L(x=s.sent().map((function(e){return(0,a.resolve)(u,e)})),o.sorted),[3,11];case 10:if(A=s.sent(),o.skipErrors)return[2,null];throw A;case 11:return R=n,x.length?[4,g(e,x,k,o,c+1)]:[3,13];case 12:return S=s.sent(),[3,14];case 13:S="",s.label=14;case 14:n=R+S,s.label=15;case 15:return[2,n]}}))}))})))];case 1:return h.sent().filter((function(e){return!!e})).forEach((function(e,r,n){u+=t+(r===n.length-1?"└"+e:"├"+e)})),[2,u]}}))}))}function R(e,r,t,n){var s="";return(e=b(e,t.sorted)).filter((function(e){return!x(e,t,n)})).forEach((function(e,o,a){var c=e.isSymbolicLink?">>":e.type===i.DIRECTORY?"─> ":"── ",u=o===a.length-1?"└"+c:"├"+c,l=r+(o===a.length-1?" ":"│ ");s+=r+u+e.name,s+=!e.children||!t.followLinks&&e.isSymbolicLink?"":R(e.children,l,t,n+1)})),s}function S(e,r,t,o){return n(this,void 0,void 0,(function(){var n,a,c,u,l,f,h,d,p;return s(this,(function(s){switch(s.label){case 0:n="",e=b(e,t.sorted),a=e.filter((function(e){return!x(e,t,o)})),c=0,s.label=1;case 1:return c<a.length?(u=a[c],l=u.isSymbolicLink?">>":u.type===i.DIRECTORY?"─> ":"── ",f=c===a.length-1?"└"+l:"├"+l,h=r+(c===a.length-1?" ":"│ "),n+=r+f+u.name,d=n,!u.children||!t.followLinks&&u.isSymbolicLink?[3,3]:[4,S(u.children,h,t,o+1)]):[3,6];case 2:return p=s.sent(),[3,4];case 3:p="",s.label=4;case 4:n=d+p,s.label=5;case 5:return c++,[3,1];case 6:return[2,n]}}))}))}r.scan=function(e,r,t,n){var s=(0,a.resolve)(e),i=v(r),o=w(s,s,0,i,t,n);return o&&(o.sizeInBytes=i.sizeInBytes?o.sizeInBytes:void 0),o},r.scanAsync=function(e,r,t,i){return n(this,void 0,void 0,(function(){var n,o,c;return s(this,(function(s){switch(s.label){case 0:return n=(0,a.resolve)(e),o=v(r),[4,k(n,n,0,o,t,i)];case 1:return(c=s.sent())&&(c.sizeInBytes=o.sizeInBytes?c.sizeInBytes:void 0),[2,c]}}))}))},r.parse=function(e,r){var t,n,s="",i=(0,a.resolve)(e),o=y(r);s+=(0,a.basename)(i);try{t=(0,l.statSync)(e)}catch(e){if(o.skipErrors)return null;throw e}try{n=(0,l.lstatSync)(e)}catch(e){if(o.skipErrors)return null;throw e}var c=n.isSymbolicLink();if((o.followLinks||!c)&&t.isDirectory()){var u=void 0;try{u=L(u=(0,l.readdirSync)(i).map((function(e){return(0,a.resolve)(i,e)})),o.sorted)}catch(e){if(o.skipErrors)return null;throw e}s+=u.length?A(e,u,"\n ",o,1):""}return s},r.parseAsync=function(e,r){return n(this,void 0,void 0,(function(){var t,n,i,o,c,u,l,h,d,p,v,E,m;return s(this,(function(s){switch(s.label){case 0:t="",n=(0,a.resolve)(e),i=y(r),o=(0,a.basename)(n),t+=o,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,(0,f.stat)(e)];case 2:return c=s.sent(),[3,4];case 3:if(u=s.sent(),i.skipErrors)return[2,null];throw u;case 4:return s.trys.push([4,6,,7]),[4,(0,f.lstat)(e)];case 5:return l=s.sent(),[3,7];case 6:if(h=s.sent(),i.skipErrors)return[2,null];throw h;case 7:if(d=l.isSymbolicLink(),!i.followLinks&&d||!c.isDirectory())return[3,15];p=void 0,s.label=8;case 8:return s.trys.push([8,10,,11]),[4,(0,f.readdir)(n)];case 9:return p=L(p=s.sent().map((function(e){return(0,a.resolve)(n,e)})),i.sorted),[3,11];case 10:if(v=s.sent(),i.skipErrors)return[2,null];throw v;case 11:return E=t,p.length?[4,g(e,p,"\n ",i,1)]:[3,13];case 12:return m=s.sent(),[3,14];case 13:m="",s.label=14;case 14:t=E+m,s.label=15;case 15:return[2,t]}}))}))},r.parseTree=function(e,r){var t="",n=y(r);return(t+=e?e.name:"")+(e.children?R(e.children,"\n ",n,1):"")},r.parseTreeAsync=function(e,r){return n(this,void 0,void 0,(function(){var t,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t="",n=y(r),t+=e?e.name:"",i=t,e.children?[4,S(e.children,"\n ",n,1)]:[3,2];case 1:return o=s.sent(),[3,3];case 2:o="",s.label=3;case 3:return[2,t=i+o]}}))}))}},828:e=>{e.exports=require("minimatch")},113:e=>{e.exports=require("crypto")},147:e=>{e.exports=require("fs")},292:e=>{e.exports=require("fs/promises")},17:e=>{e.exports=require("path")}},r={};return function t(n){var s=r[n];if(void 0!==s)return s.exports;var i=r[n]={exports:{}};return e[n].call(i.exports,i,i.exports,t),i.exports}(807)})()));
## [4.6.1](https://github.com/euberdeveloper/dree/compare/4.6.0...4.6.1) (2024-01-11)
# [4.6.0](https://github.com/euberdeveloper/dree/compare/4.5.8...4.6.0) (2023-12-07)

@@ -4,0 +6,0 @@

{
"name": "dree",
"version": "4.6.0",
"version": "4.6.1",
"description": "A nodejs module wich helps you handle a directory tree providing you its abstraction through tested functions and a custom configuration.",

@@ -5,0 +5,0 @@ "main": "bundled/lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc