diff options
author | amy <[email protected]> | 2023-02-28 13:59:52 +0000 |
---|---|---|
committer | amy <[email protected]> | 2023-02-28 13:59:52 +0000 |
commit | 607ba19e57fd3ef39a65417b8f0370a354e560f4 (patch) | |
tree | 8dbb9f246853dff2774e89e382bdb99d8c3f413b /src/jssh.js | |
parent | 003893771641ca175a5453c3c1a81de83f0decc5 (diff) |
lots of things i think
Diffstat (limited to 'src/jssh.js')
-rw-r--r-- | src/jssh.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/jssh.js b/src/jssh.js index 7035ce3..ee3eb6d 100644 --- a/src/jssh.js +++ b/src/jssh.js @@ -7,6 +7,22 @@ class jssh { this.uid = uid; this.window_create = window_create; } + search(fs,target,opt={},path='./'){ + let match = [] + for(let f of fs){ + if(f.dir){ + let tt = this.search(f.content,target,opt,path+f.name+"/") + if(tt!=undefined&&tt.length>0) + match.push(...tt) + } + if((!opt.exact&&hrx(f.name,"*"+target+"*")||(opt.exact&&hrx(f.name,target)))){ + match.push(path+f.name) + } + } + //console.log(match.length) + //if(match.length!=0) + return match; + } set_wd(dir) { //let lwd = fs let wd = fs; |