Class: DefaultFilenameFormatter

DefaultFilenameFormatter

new DefaultFilenameFormatter(options)

Formats/Parses a file that has the format: itemId.js
Parameters:
Name Type Description
options Object The options
Properties
Name Type Attributes Default Description
delimiter String <optional>
. The delimiter between the response name and the suffix of the file.
suffix String <optional>
'' The suffix of the file.
Implements:
Source:

Methods

format(itemId) → {String}

Formats the itemId to itemId+delimiter+suffix
Parameters:
Name Type Description
itemId String The itemId to use
Implements:
Source:
Returns:
The formatted string
Type
String

isValid(fileName) → {Boolean}

Returns true if the fileName matches the type supported by this FilenameFormmatter
Parameters:
Name Type Description
fileName String The filename
Implements:
Source:
Returns:
True if fileName is a match to endsWith(this._delimiter + this._suffix)
Type
Boolean

parse(fileName) → {Array.String}

Parses a filename into [itemId, suffix]
Parameters:
Name Type Description
fileName String The filename to parse
Implements:
Source:
Returns:
Array of itemId and suffix
Type
Array.String