@pittica/google-business-intelligence-helpers 1.17.2 → 1.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/naming/file.js +4 -4
- package/package.json +1 -1
package/dist/naming/file.js
CHANGED
|
@@ -58,10 +58,10 @@ exports.getJsonStorageName = (date, file) => `${format(date, "YYYY-MM-DD")}/${fo
|
|
|
58
58
|
* Generates a filename from the givend data.
|
|
59
59
|
*
|
|
60
60
|
* @param {object} filedata File data.
|
|
61
|
-
* @param {string}
|
|
61
|
+
* @param {string} dateFormat Date format.
|
|
62
62
|
* @returns {string} A filename from the givend data.
|
|
63
63
|
*/
|
|
64
|
-
exports.createFilename = (filedata,
|
|
64
|
+
exports.createFilename = (filedata, dateFormat = "YYYY-MM-DD") => `${format(filedata.date, dateFormat)}-${filedata.fullname}.${filedata.extension}`;
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* Merges the given filename parts.
|
|
@@ -70,10 +70,10 @@ exports.createFilename = (filedata, format = "YYYY-MM-DD") => `${format(filedata
|
|
|
70
70
|
* @param {string} name File or function name.
|
|
71
71
|
* @param {string} extension File extension.
|
|
72
72
|
* @param {int} version File version.
|
|
73
|
-
* @param {string}
|
|
73
|
+
* @param {string} dateFormat Date format.
|
|
74
74
|
* @returns {string} The merged given filename parts.
|
|
75
75
|
*/
|
|
76
|
-
exports.mergeFilename = (date, name, extension, version = 0,
|
|
76
|
+
exports.mergeFilename = (date, name, extension, version = 0, dateFormat = "YYYY-MM-DD") => `${format(date, dateFormat)}-${name}${version ? `_${version}` : ""}.${extension.toLowerCase()}`;
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* Merges the given filename data.
|
package/package.json
CHANGED