This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-js/generateDts.js
2022-08-11 13:37:38 +08:00

19 lines
419 B
JavaScript

const fs = require("fs");
async function work() {
const imageDts = await fs.promises.readFile("src/image.d.ts", "utf-8");
const indexDts = await fs.promises.readFile("index.d.ts", "utf-8");
const content = `declare module "doric" {
${indexDts
.replace(/\sdeclare\s/g, " ")
.split("\n")
.map((e) => ` ${e}`)
.join("\n")}
}
${imageDts}
`;
await fs.promises.writeFile("index.d.ts", content);
}
work();