Skip to content
Snippets Groups Projects
Commit d68840c9 authored by insert's avatar insert
Browse files

Add bottomify script.

parent d61815c2
No related merge requests found
This diff is collapsed.
// bottom.json generator
// deno run --allow-read --allow-write bottomify.ts
import { encode } from "https://deno.land/x/bottomify@0.3.0/deno.ts";
const text = await Deno.readTextFile("./en.json");
const data = JSON.parse(text);
function recurse(obj: { [key: string]: any }) {
for (let key of Object.keys(obj)) {
if (typeof obj[key] === 'object') {
recurse(obj[key]);
} else {
obj[key] = encode(obj[key]);
}
}
}
recurse(data);
await Deno.writeTextFile("./bottom.json", JSON.stringify(data));
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment