UNPKG

k8ts

Version:

Powerful framework for building Kubernetes manifests in TypeScript.

21 lines 633 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Proverbs = void 0; const promises_1 = require("fs/promises"); class Proverbs { _proverbs; constructor(_proverbs) { this._proverbs = _proverbs; } static async make(file) { const loaded = await (0, promises_1.readFile)(file, "utf-8"); const lines = loaded.split("\n"); return new Proverbs(lines); } get random() { const idx = Math.floor(Math.random() * this._proverbs.length); return this._proverbs[idx]; } } exports.Proverbs = Proverbs; //# sourceMappingURL=proverbs.js.map