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 | d39d0b7e02eee9773be2d6ac5f53fc86395a8197 (patch) | |
tree | a1d766aed4a0350af38f1d4804da402346c8a7ae /src/jssh.js | |
parent | 7abe9c7a3528782316b34328c8799c8e8f1933bb (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 22809e0..15b3100 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; |