feat: ring buffer
This commit is contained in:
parent
3be55dc53e
commit
7101b99c35
3 changed files with 58 additions and 3 deletions
|
|
@ -30,7 +30,7 @@ try { fs.unlinkSync(day_path); } catch (e) { }
|
|||
try { fs.mkdirSync(day_path); } catch (e) { }
|
||||
|
||||
function generate_method(method) {
|
||||
return `${method.name}(${method.args}): ${method.return || "void"} {
|
||||
return `${method.name}(${method.args || ""}): ${method.return || "void"} {
|
||||
|
||||
}`;
|
||||
}
|
||||
|
|
@ -46,7 +46,7 @@ function generate_getter(getter) {
|
|||
}
|
||||
|
||||
function create_class(name, item) {
|
||||
fs.writeFileSync(path.join(day_path, `${name}.ts`), `export default class ${name}<T> {
|
||||
fs.writeFileSync(path.join(day_path, `${name}.ts`), `export default class ${name}${item.generic || ""} {
|
||||
${(item.properties || []).map(generate_property).join("\n ")}
|
||||
|
||||
${(item.getters || []).map(generate_getter).join("\n ")}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue