all files / dist/utils/ FileUtils.js

100% Statements 18/18
100% Branches 6/6
100% Functions 5/5
100% Lines 17/17
1 function Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28    39×   12× 24× 12× 12× 12×   11× 16×              
"use strict";
var FileUtils = (function () {
    /* istanbul ignore next */ function FileUtils() {
    }
    FileUtils.standardizeSlashes = function (fileName) {
        return fileName.replace(/\\/g, "/");
    };
    FileUtils.filePathMatches = function (fileName, searchString) {
        var _this = this;
        var splitBySlash = function (p) { return _this.standardizeSlashes(p || "").replace(/^\//, "").split("/"); };
        var fileNameItems = splitBySlash(fileName);
        var searchItems = splitBySlash(searchString);
        if (searchItems.length > fileNameItems.length) {
            return false;
        }
        for (var i = 0; i < searchItems.length; i++) {
            if (searchItems[searchItems.length - i - 1] !== fileNameItems[fileNameItems.length - i - 1]) {
                return false;
            }
        }
        return searchItems.length > 0;
    };
    return FileUtils;
}());
exports.FileUtils = FileUtils;
 
//# sourceMappingURL=FileUtils.js.map