haystack-codegen
Version:
Project Haystack Core code generation tools
32 lines (31 loc) • 802 B
JavaScript
;
/*
* Copyright (c) 2021, J2 Innovations. All Rights Reserved
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.DocHeaderNode = void 0;
const DATE_OPTIONS = {
year: '2-digit',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
};
/**
* Generates the header for a document.
*/
class DocHeaderNode {
newLines = 1;
generateCode(out) {
out('/*');
out(` * Automatically generated by haystack-codegen on ${this.toDateString()}.`);
out(' */');
out('');
out('/* eslint @typescript-eslint/no-namespace: "off" */');
}
toDateString() {
return new Date().toLocaleDateString(undefined, DATE_OPTIONS);
}
}
exports.DocHeaderNode = DocHeaderNode;