UNPKG

@e-invoice-eu/cli

Version:

Generate e-invoices (E-Rechnung in German) conforming to EN16931 (Factur-X/ZUGFeRD, UBL, CII, XRechnung aka X-Rechnung) from LibreOffice Calc/Excel data or JSON.

28 lines 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.coerceOptions = coerceOptions; const runtime_1 = require("@esgettext/runtime"); const package_1 = require("./package"); const gtx = runtime_1.Textdomain.getInstance('e-invoice-eu-cli'); function coerceOptions(args, optspecs) { for (const optname in optspecs) { const optspec = optspecs[optname]; const optkey = optname.replace(/-(.)/g, (_, group1) => group1.toUpperCase()); const arg = args[optkey]; const isArray = typeof arg === 'object' && Array.isArray(arg); if (optspec.multi) { if (typeof arg !== 'undefined' && !isArray) { args[optkey] = [args[optkey]]; } } else { if (isArray) { console.error(gtx._x('{programName}: Error: The option' + " '{optname}' cannot be specified more than once!", { programName: package_1.Package.getName(), optname })); return false; } } } return true; } //# sourceMappingURL=optspec.js.map