UNPKG

@expressots/shared

Version:

Shared library for ExpressoTS modules 🐎

19 lines (18 loc) 591 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.optionMatcher = optionMatcher; const constants_1 = require("./constants"); /** * Matches the options passed in the command line * @param args - The arguments passed in the command line * @returns The options passed in the command line */ function optionMatcher(args) { return args.reduce((previous, current) => { const matches = current.match(constants_1.ENV_VAR_REGEX); if (matches) { previous[matches[1]] = matches[2]; } return previous; }, {}); }