On this page




createFilename(module, options, { requestShortener, chunkGraph, hashFunction }): string
Attributes
moduleFilenameTemplate:<string>
namespace:<string>
chunkGraph:<ChunkGraph>
hashFunction:<string> | <typeof Hash>
requestShortener:<RequestShortener>
Returns:<string>





matchObject(obj, str): boolean
Attributes

matchPart(str, test): boolean
Attributes
string to test
value which will be used to match against the string
Returns:<boolean>
true, when the RegExp matches

Tests if a string matches a RegExp or an array of RegExp.

ModuleFilenameHelpers.matchPart("foo.js", "foo"); // true
ModuleFilenameHelpers.matchPart("foo.js", "foo.js"); // true
ModuleFilenameHelpers.matchPart("foo.js", "foo."); // false
ModuleFilenameHelpers.matchPart("foo.js", "foo*"); // false
ModuleFilenameHelpers.matchPart("foo.js", "foo.*"); // true
ModuleFilenameHelpers.matchPart("foo.js", /^foo/); // true
ModuleFilenameHelpers.matchPart("foo.js", [/^foo/, "bar"]); // true
ModuleFilenameHelpers.matchPart("foo.js", [/^foo/, "bar"]); // true
ModuleFilenameHelpers.matchPart("foo.js", [/^foo/, /^bar/]); // true
ModuleFilenameHelpers.matchPart("foo.js", [/^baz/, /^bar/]); // false














replaceDuplicates(array, fn, comparator?): void
  • array {T[]}
  • fn (duplicateItem: <T>, duplicateItemIndex: <number>, numberOfTimesReplaced: <number>) => <T>
  • comparator (firstElement: <T>, nextElement: <T>) => <0> | <1> | <-1>
  • Returns: {T[]}



| (str: <string> ) => <boolean> | <(string | RegExp | ((str: string) => boolean))[]>