Download Fore_End/cpcn2/node_modules/easy-stack/es5.js from zxy0307/JavaWeb: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/easy-stack/es5.js
- Command line
-
hf download hf://zxy0307/JavaWeb/Fore_End/cpcn2/node_modules/easy-stack/es5.js
-
curl -L -o es5.js https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/easy-stack/es5.js
1.52 kB
| function Stack(){ | |
| Object.defineProperties( | |
| this, | |
| { | |
| add:{ | |
| enumerable:true, | |
| writable:false, | |
| value:addToStack | |
| }, | |
| next:{ | |
| enumerable:true, | |
| writable:false, | |
| value:run | |
| }, | |
| clear:{ | |
| enumerable:true, | |
| writable:false, | |
| value:clearStack | |
| }, | |
| contents:{ | |
| enumerable:false, | |
| get:getStack, | |
| set:setStack | |
| }, | |
| autoRun:{ | |
| enumerable:true, | |
| writable:true, | |
| value:true | |
| }, | |
| stop:{ | |
| enumerable:true, | |
| writable:true, | |
| value:false | |
| } | |
| } | |
| ); | |
| var stack=[]; | |
| var running=false; | |
| var stop=false; | |
| function clearStack(){ | |
| stack=[]; | |
| return stack; | |
| } | |
| function getStack(){ | |
| return stack; | |
| } | |
| function setStack(val){ | |
| stack=val; | |
| return stack; | |
| } | |
| function addToStack(){ | |
| for(var i in arguments){ | |
| stack.unshift(arguments[i]); | |
| } | |
| if(!running && !this.stop && this.autoRun){ | |
| this.next(); | |
| } | |
| } | |
| function run(){ | |
| running=true; | |
| if(stack.length<1 || this.stop){ | |
| running=false; | |
| return; | |
| } | |
| stack.shift().bind(this)(); | |
| } | |
| } | |