Download Fore_End/cpcn2/node_modules/easy-stack/stack.js from zxy0307/JavaWeb: direct link, hf CLI and curl.
- Browser
- Download file 697 Bytes
-
https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/easy-stack/stack.js
- Command line
-
hf download hf://zxy0307/JavaWeb/Fore_End/cpcn2/node_modules/easy-stack/stack.js
-
curl -L -o stack.js https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/easy-stack/stack.js
697 Bytes
| class Stack{ | |
| constructor(){ | |
| this.stack=[]; | |
| this.autoRun=true; | |
| this.running=false; | |
| this.stop=false; | |
| } | |
| clear(){ | |
| this.stack=[]; | |
| return this.stack; | |
| } | |
| contents(val){ | |
| if(val){ | |
| this.stack=val; | |
| } | |
| return this.stack; | |
| } | |
| add(...callbacks){ | |
| this.stack.push(...callbacks); | |
| if(!this.running && !this.stop && this.autoRun){ | |
| this.next(); | |
| } | |
| } | |
| next(){ | |
| this.running=true; | |
| if(this.stack.length<1 || this.stop){ | |
| this.running=false; | |
| return; | |
| } | |
| this.stack.pop().bind(this)(); | |
| } | |
| } | |
| module.exports=Stack; | |