UNPKG

args-any

Version:

Utility lib for parsing command options

22 lines 777 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.expandSeparator = void 0; const index_of_any_1 = require("index-of-any"); const _1 = require("."); const expandSeparator = (arg) => { let result = [arg]; if (_1.operator.has(arg)) return result; const [index, matchingString] = (0, index_of_any_1.indexOfAny)(arg, ..._1.operator.inlinesAllowed()); if (matchingString) { const firstPosition = 0; result = [ arg.substring(firstPosition, index), arg.substring(index, matchingString.length + index), arg.substring(matchingString.length + index) ]; } return result; }; exports.expandSeparator = expandSeparator; //# sourceMappingURL=expand-separator.js.map