feat: udpates
This commit is contained in:
28
single-scripts/decode-uri-component.ts
Executable file
28
single-scripts/decode-uri-component.ts
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env runts --
|
||||||
|
|
||||||
|
import {parseArgs} from "jsr:@std/cli/parse-args";
|
||||||
|
import {toArrayBuffer} from "https://deno.land/std@0.203.0/streams/mod.ts";
|
||||||
|
|
||||||
|
const flags = parseArgs(Deno.args, {
|
||||||
|
boolean: ["help"],
|
||||||
|
string: ["value"],
|
||||||
|
});
|
||||||
|
|
||||||
|
if (flags.help) {
|
||||||
|
console.log("echo value | encode-uri-component.ts");
|
||||||
|
console.log("encode-uri-component.ts --value <value>");
|
||||||
|
Deno.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
let input;
|
||||||
|
if (flags.value) {
|
||||||
|
input = flags.value;
|
||||||
|
} else {
|
||||||
|
input = new TextDecoder().decode(await toArrayBuffer(Deno.stdin.readable));
|
||||||
|
}
|
||||||
|
const encoded = decodeURIComponent(input);
|
||||||
|
|
||||||
|
console.log(encoded);
|
||||||
|
|
||||||
|
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260121T234540+08:00.MEUCIFlsdAs2FF+M18v15vsX
|
||||||
|
// 5xKzD6RoWA0m8cduuBT8SKviAiEA2LWLhGEq5QBGLNzMWwAwKq82Cv7PgjkWG9Z4rgcz6GA=
|
||||||
28
single-scripts/decode-uri.ts
Executable file
28
single-scripts/decode-uri.ts
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env runts --
|
||||||
|
|
||||||
|
import {parseArgs} from "jsr:@std/cli/parse-args";
|
||||||
|
import {toArrayBuffer} from "https://deno.land/std@0.203.0/streams/mod.ts";
|
||||||
|
|
||||||
|
const flags = parseArgs(Deno.args, {
|
||||||
|
boolean: ["help"],
|
||||||
|
string: ["value"],
|
||||||
|
});
|
||||||
|
|
||||||
|
if (flags.help) {
|
||||||
|
console.log("echo value | encode-uri-component.ts");
|
||||||
|
console.log("encode-uri-component.ts --value <value>");
|
||||||
|
Deno.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
let input;
|
||||||
|
if (flags.value) {
|
||||||
|
input = flags.value;
|
||||||
|
} else {
|
||||||
|
input = new TextDecoder().decode(await toArrayBuffer(Deno.stdin.readable));
|
||||||
|
}
|
||||||
|
const encoded = decodeURI(input);
|
||||||
|
|
||||||
|
console.log(encoded);
|
||||||
|
|
||||||
|
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260121T234532+08:00.MEUCIQCeMv9i5EQ0NC5i9RLH
|
||||||
|
// 3aqgzsOZ3lZVbivVNwrreeQKnAIgBqmHd7er1TV8bfJgG4fM3Z0g8bBhtKNFL1x7mraTkXI=
|
||||||
28
single-scripts/encode-uri-component.ts
Executable file
28
single-scripts/encode-uri-component.ts
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env runts --
|
||||||
|
|
||||||
|
import { parseArgs } from "jsr:@std/cli/parse-args";
|
||||||
|
import { toArrayBuffer } from "https://deno.land/std@0.203.0/streams/mod.ts";
|
||||||
|
|
||||||
|
const flags = parseArgs(Deno.args, {
|
||||||
|
boolean: ["help"],
|
||||||
|
string: ["value"],
|
||||||
|
});
|
||||||
|
|
||||||
|
if (flags.help) {
|
||||||
|
console.log("echo value | encode-uri-component.ts");
|
||||||
|
console.log("encode-uri-component.ts --value <value>");
|
||||||
|
Deno.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
let input;
|
||||||
|
if (flags.value) {
|
||||||
|
input = flags.value;
|
||||||
|
} else {
|
||||||
|
input = new TextDecoder().decode(await toArrayBuffer(Deno.stdin.readable));
|
||||||
|
}
|
||||||
|
const encoded = encodeURIComponent(input);
|
||||||
|
|
||||||
|
console.log(encoded);
|
||||||
|
|
||||||
|
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260121T234554+08:00.MEUCIBu77Jl2kBpnQfz5Us0h
|
||||||
|
// hv9ccvxvsKC0FKEQxRze3z0rAiEArwtUf0JRYQZmEDnpCjQ3SZqy+Fudk7JO3UqNhTJ13hg=
|
||||||
28
single-scripts/encode-uri.ts
Executable file
28
single-scripts/encode-uri.ts
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env runts --
|
||||||
|
|
||||||
|
import {parseArgs} from "jsr:@std/cli/parse-args";
|
||||||
|
import {toArrayBuffer} from "https://deno.land/std@0.203.0/streams/mod.ts";
|
||||||
|
|
||||||
|
const flags = parseArgs(Deno.args, {
|
||||||
|
boolean: ["help"],
|
||||||
|
string: ["value"],
|
||||||
|
});
|
||||||
|
|
||||||
|
if (flags.help) {
|
||||||
|
console.log("echo value | encode-uri-component.ts");
|
||||||
|
console.log("encode-uri-component.ts --value <value>");
|
||||||
|
Deno.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
let input;
|
||||||
|
if (flags.value) {
|
||||||
|
input = flags.value;
|
||||||
|
} else {
|
||||||
|
input = new TextDecoder().decode(await toArrayBuffer(Deno.stdin.readable));
|
||||||
|
}
|
||||||
|
const encoded = encodeURI(input);
|
||||||
|
|
||||||
|
console.log(encoded);
|
||||||
|
|
||||||
|
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260121T234549+08:00.MEUCIB0e/l8ee6VlgMwYM9hu
|
||||||
|
// G2znsgPWxfylKLZ19Dt44byrAiEAhVkboLnYk7dIO0zj44KP0SHvmUHGKm0L3QrivTmFfGI=
|
||||||
Reference in New Issue
Block a user