12 lines
333 B
JavaScript
12 lines
333 B
JavaScript
|
"use strict";
|
||
|
exports.buildFormatLongFn = buildFormatLongFn;
|
||
|
|
||
|
function buildFormatLongFn(args) {
|
||
|
return (options = {}) => {
|
||
|
// TODO: Remove String()
|
||
|
const width = options.width ? String(options.width) : args.defaultWidth;
|
||
|
const format = args.formats[width] || args.formats[args.defaultWidth];
|
||
|
return format;
|
||
|
};
|
||
|
}
|