diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/tslint/lib/utils.js | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) |
node_modules
Diffstat (limited to 'node_modules/tslint/lib/utils.js')
-rw-r--r-- | node_modules/tslint/lib/utils.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/node_modules/tslint/lib/utils.js b/node_modules/tslint/lib/utils.js index 04dbd1496..2bd5c8ca2 100644 --- a/node_modules/tslint/lib/utils.js +++ b/node_modules/tslint/lib/utils.js @@ -72,9 +72,7 @@ function dedent(strings) { for (var _i = 1; _i < arguments.length; _i++) { values[_i - 1] = arguments[_i]; } - var fullString = strings.reduce(function (accumulator, str, i) { - return "" + accumulator + values[i - 1] + str; - }); + var fullString = strings.reduce(function (accumulator, str, i) { return "" + accumulator + values[i - 1] + str; }); // match all leading spaces/tabs at the start of each line var match = fullString.match(/^[ \t]*(?=\S)/gm); if (match === null) { @@ -149,9 +147,8 @@ exports.find = find; /** Returns an array that is the concatenation of all output arrays. */ function flatMap(inputs, getOutputs) { var out = []; - for (var _i = 0, inputs_2 = inputs; _i < inputs_2.length; _i++) { - var input = inputs_2[_i]; - out.push.apply(out, getOutputs(input)); + for (var i = 0; i < inputs.length; i++) { + out.push.apply(out, getOutputs(inputs[i], i)); } return out; } @@ -159,8 +156,8 @@ exports.flatMap = flatMap; /** Returns an array of all outputs that are not `undefined`. */ function mapDefined(inputs, getOutput) { var out = []; - for (var _i = 0, inputs_3 = inputs; _i < inputs_3.length; _i++) { - var input = inputs_3[_i]; + for (var _i = 0, inputs_2 = inputs; _i < inputs_2.length; _i++) { + var input = inputs_2[_i]; var output = getOutput(input); if (output !== undefined) { out.push(output); @@ -214,3 +211,8 @@ function detectBufferEncoding(buffer, length) { return "utf8"; } exports.detectBufferEncoding = detectBufferEncoding; +// converts Windows normalized paths (with backwards slash `\`) to paths used by TypeScript (with forward slash `/`) +function denormalizeWinPath(path) { + return path.replace(/\\/g, "/"); +} +exports.denormalizeWinPath = denormalizeWinPath; |