Skip to content

Skeudenn / shared/file-name-template / fillFileNameTemplate

Function: fillFileNameTemplate() ​

fillFileNameTemplate(template, values, volumePrefix?, prefixNumericOnly?): string

Defined in: src/shared/file-name-template.ts:80

template with each field replaced by its value: {series} - T{volume} - {title} gives Tintin - T20 - Tintin au Tibet, and T{volume:2} gives T07 for the volume 7. An empty volume is left out with the text glued before the field and the separator before that: the same template gives Tintin - Tintin au Tibet. With volumePrefix, each {volume} is written with it in front, after the padding (T and {volume:2} give T07); prefixNumericOnly keeps it off a volume that isn't a whole number. The result isn't made safe for the file system: the caller does it.

Parameters ​

template ​

string

values ​

Record<FileNameField, string>

volumePrefix? ​

string = ''

prefixNumericOnly? ​

boolean = false

Returns ​

string