Spaces:
Runtime error
Runtime error
Download node_modules/postgres/src/queue.js from o134/Desinger-System: direct link, hf CLI and curl.
- Browser
- Download file 541 Bytes
-
https://huggingface.co/spaces/o134/Desinger-System/resolve/main/node_modules/postgres/src/queue.js
- Command line
-
hf download hf://spaces/o134/Desinger-System/node_modules/postgres/src/queue.js
-
curl -L -o queue.js https://huggingface.co/spaces/o134/Desinger-System/resolve/main/node_modules/postgres/src/queue.js
541 Bytes
| export default Queue | |
| function Queue(initial = []) { | |
| let xs = initial.slice() | |
| let index = 0 | |
| return { | |
| get length() { | |
| return xs.length - index | |
| }, | |
| remove: (x) => { | |
| const index = xs.indexOf(x) | |
| return index === -1 | |
| ? null | |
| : (xs.splice(index, 1), x) | |
| }, | |
| push: (x) => (xs.push(x), x), | |
| shift: () => { | |
| const out = xs[index++] | |
| if (index === xs.length) { | |
| index = 0 | |
| xs = [] | |
| } else { | |
| xs[index - 1] = undefined | |
| } | |
| return out | |
| } | |
| } | |
| } | |