updated

This commit is contained in:
2024-11-29 16:09:45 +01:00
parent f3bf9e0612
commit 5e7e5b6f33
16 changed files with 102 additions and 66 deletions

View File

@ -1,13 +1,3 @@
/* deprecated/fallback */
globalThis.cyclicLoop= function*(items){
if(!items) items= 'win32'===process.platform ? '|/-\\' : "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏";
const { length }= items;
for(let i=0; true; i++){
if(i===length) i= 0;
yield items[i];
}
}
Reflect.defineProperty($, "clipboard", {
get(){
if($.env.XDG_SESSION_TYPE === "x11")
@ -25,8 +15,4 @@ export function onrepl(){
Reflect.defineProperty(s, "jq", { get(){ return file=> s.cat(file).xargs(JSON.parse); } });
}
/** Place for custom code when eval starts (`--eval`/`--print`) */
export function oneval(){ /* --print/--echo aliases */
Reflect.defineProperty($, "nosed", { get(){ return this.stdin.text(""); }, });
Reflect.defineProperty($, "nojq", { get(){ return this.stdin.json(null); }, });
Reflect.defineProperty($, "noawk", { get(){ return this.stdin.lines([]); }, });
}
// export function oneval(){}