emitty
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -42,2 +42,6 @@ 'use strict'; | ||
} | ||
// Expanding of Glob-patterns that should be excluded during scanning | ||
if (options.scanner.exclude) { | ||
options.scanner.exclude = paths_1.expandGlobPatterns(options.scanner.exclude); | ||
} | ||
root = paths_1.normalize(root); | ||
@@ -44,0 +48,0 @@ const config = new config_1.Config(language); |
@@ -27,3 +27,2 @@ /// <reference types="node" /> | ||
private scannerFilter(stat); | ||
private expandGlobPatterns(); | ||
} |
@@ -8,4 +8,2 @@ 'use strict'; | ||
const fs_1 = require("../utils/fs"); | ||
// RegExp's | ||
const reGlobBaseName = /^\*\*\/([\w\.-]+)\/?$/; | ||
class Scanner { | ||
@@ -18,3 +16,3 @@ constructor(root, storage, language, options) { | ||
this.excludePatterns = []; | ||
this.expandGlobPatterns(); | ||
this.excludePatterns = this.options.scanner.exclude; | ||
} | ||
@@ -113,14 +111,3 @@ scan(filepath, stats) { | ||
} | ||
expandGlobPatterns() { | ||
this.excludePatterns = this.options.scanner.exclude; | ||
// Expand **/name to **/name + **/name/** | ||
if (this.options.scanner.exclude) { | ||
this.options.scanner.exclude.forEach((pattern) => { | ||
if (reGlobBaseName.test(pattern)) { | ||
this.excludePatterns.push(pattern + '/**'); | ||
} | ||
}); | ||
} | ||
} | ||
} | ||
exports.Scanner = Scanner; |
export declare function normalize(filepath: string): string; | ||
export declare function join(a: string, b: string): string; | ||
export declare function relative(from: string, to: string): string; | ||
export declare function expandGlobPatterns(toExclude: string[]): string[]; |
'use strict'; | ||
const path = require("path"); | ||
// RegExp's | ||
const reGlobBaseName = /^\*\*\/([\w\.-]+)\/?$/; | ||
function normalize(filepath) { | ||
@@ -15,1 +17,14 @@ return filepath.replace(/\\/g, '/'); | ||
exports.relative = relative; | ||
function expandGlobPatterns(toExclude) { | ||
const result = toExclude; | ||
// Expand **/name to **/name + **/name/** | ||
if (result) { | ||
toExclude.forEach((pattern) => { | ||
if (reGlobBaseName.test(pattern)) { | ||
result.push(pattern + '/**'); | ||
} | ||
}); | ||
} | ||
return result; | ||
} | ||
exports.expandGlobPatterns = expandGlobPatterns; |
{ | ||
"name": "emitty", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Determine the inheritance of template and style files", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
41751
866