- Add .gitignore: exclude compiled binaries, build artifacts, and Helm values files containing real secrets (authentik, prometheus) - Add all Kubernetes deployment manifests (deployment/) - Add services source code: ha-sync, device-inventory, games-console, paperclip, parts-inventory - Add Ansible orchestration: playbooks, roles, inventory, cloud-init - Add hardware specs, execution plans, scripts, HOMELAB.md - Add skills/homelab/SKILL.md + skills/install.sh to preserve Copilot skill - Remove previously-tracked inventory-cli binary from git index Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
33 lines
711 B
JavaScript
33 lines
711 B
JavaScript
'use strict';
|
|
const lenient = require('./lenient');
|
|
|
|
const yn = (input, options) => {
|
|
input = String(input).trim();
|
|
|
|
options = Object.assign({
|
|
lenient: false,
|
|
default: null
|
|
}, options);
|
|
|
|
if (options.default !== null && typeof options.default !== 'boolean') {
|
|
throw new TypeError(`Expected the \`default\` option to be of type \`boolean\`, got \`${typeof options.default}\``);
|
|
}
|
|
|
|
if (/^(?:y|yes|true|1)$/i.test(input)) {
|
|
return true;
|
|
}
|
|
|
|
if (/^(?:n|no|false|0)$/i.test(input)) {
|
|
return false;
|
|
}
|
|
|
|
if (options.lenient === true) {
|
|
return lenient(input, options);
|
|
}
|
|
|
|
return options.default;
|
|
};
|
|
|
|
module.exports = yn;
|
|
// TODO: Remove this for the next major release
|
|
module.exports.default = yn;
|