aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tslint/lib/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/tslint/lib/utils.js')
-rw-r--r--node_modules/tslint/lib/utils.js18
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;