@wavy/fn 0.0.8 → 0.0.9
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/main.cjs +8 -0
- package/dist/main.d.cts +5 -1
- package/dist/main.d.ts +5 -1
- package/dist/main.js +7 -0
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -43,6 +43,7 @@ __export(main_exports, {
|
|
|
43
43
|
formatInvoiceNo: () => formatInvoiceNo,
|
|
44
44
|
getCaps: () => getCaps,
|
|
45
45
|
getFileExt: () => getFileExt,
|
|
46
|
+
getFilename: () => getFilename,
|
|
46
47
|
getMimeTypes: () => getMimeTypes,
|
|
47
48
|
group: () => group,
|
|
48
49
|
hasIndex: () => hasIndex,
|
|
@@ -835,6 +836,12 @@ function inferFilename(filePath) {
|
|
|
835
836
|
function getFileExt(filePath) {
|
|
836
837
|
return "." + takeLastWhile(filePath.split(""), (v) => v !== ".").join("");
|
|
837
838
|
}
|
|
839
|
+
function getFilename(params) {
|
|
840
|
+
if (!params.filename) return inferFilename(params.filePath);
|
|
841
|
+
const fileExt = getFileExt(params.filePath);
|
|
842
|
+
if (params.filename.includes(fileExt)) return params.filename.trim();
|
|
843
|
+
return params.filename.trim() + fileExt;
|
|
844
|
+
}
|
|
838
845
|
async function copyToClipboard(text) {
|
|
839
846
|
try {
|
|
840
847
|
await navigator.clipboard.writeText(text);
|
|
@@ -1092,6 +1099,7 @@ var serverDataAdapter = new ServerDataAdapter().invoke;
|
|
|
1092
1099
|
formatInvoiceNo,
|
|
1093
1100
|
getCaps,
|
|
1094
1101
|
getFileExt,
|
|
1102
|
+
getFilename,
|
|
1095
1103
|
getMimeTypes,
|
|
1096
1104
|
group,
|
|
1097
1105
|
hasIndex,
|
package/dist/main.d.cts
CHANGED
|
@@ -149,6 +149,10 @@ declare function someValuesEmpty<O extends {
|
|
|
149
149
|
declare function poll<T>(getValue: () => T, interval?: number): Promise<Awaited<T> & ({} | null)>;
|
|
150
150
|
declare function inferFilename(filePath: string): string;
|
|
151
151
|
declare function getFileExt(filePath: string): string;
|
|
152
|
+
declare function getFilename(params: {
|
|
153
|
+
filePath: string;
|
|
154
|
+
filename?: string;
|
|
155
|
+
}): string;
|
|
152
156
|
declare function copyToClipboard(text: string): Promise<TaskResult>;
|
|
153
157
|
declare function readClipboardText(): Promise<TaskResult<{
|
|
154
158
|
text: string;
|
|
@@ -167,4 +171,4 @@ declare const serverDataAdapter: {
|
|
|
167
171
|
}>(event: "unzip", data: DataType): NormalizeFromServer<DataType>;
|
|
168
172
|
};
|
|
169
173
|
|
|
170
|
-
export { addArticle, arrayWithConst, asyncRun, averageOf, blankSpaces, buildArray, camelCaseToLetter, classNameExt, classNameResolver, coerceIn, copyToClipboard, count, dataSearcher, distinct, drop, dropLast, dropLastWhile, dropWhile, format, formatGCTRegNo, formatInvoiceNo, getCaps, getFileExt, getMimeTypes, group, hasIndex, ifDefined, ifEmpty, inRange, indexOf, indices, inferFilename, insertAt, isEmpty, isFile, isLetter, isLocalFile, isNumber, lastIndex, map, mapToArray, maxOf, minOf, negate, ordinalIndicator, overwrite, pluralize, poll, random, range, readClipboardText, removeAll, repeat, run, serverDataAdapter, someValuesEmpty, sort, strictArray, stringToSearch, subObjectList, sumOf, take, takeLast, takeLastWhile, takeWhile, timeDuration, toNumber, trimString, undefinedIfEmpty, upperFirst, windowed };
|
|
174
|
+
export { addArticle, arrayWithConst, asyncRun, averageOf, blankSpaces, buildArray, camelCaseToLetter, classNameExt, classNameResolver, coerceIn, copyToClipboard, count, dataSearcher, distinct, drop, dropLast, dropLastWhile, dropWhile, format, formatGCTRegNo, formatInvoiceNo, getCaps, getFileExt, getFilename, getMimeTypes, group, hasIndex, ifDefined, ifEmpty, inRange, indexOf, indices, inferFilename, insertAt, isEmpty, isFile, isLetter, isLocalFile, isNumber, lastIndex, map, mapToArray, maxOf, minOf, negate, ordinalIndicator, overwrite, pluralize, poll, random, range, readClipboardText, removeAll, repeat, run, serverDataAdapter, someValuesEmpty, sort, strictArray, stringToSearch, subObjectList, sumOf, take, takeLast, takeLastWhile, takeWhile, timeDuration, toNumber, trimString, undefinedIfEmpty, upperFirst, windowed };
|
package/dist/main.d.ts
CHANGED
|
@@ -149,6 +149,10 @@ declare function someValuesEmpty<O extends {
|
|
|
149
149
|
declare function poll<T>(getValue: () => T, interval?: number): Promise<Awaited<T> & ({} | null)>;
|
|
150
150
|
declare function inferFilename(filePath: string): string;
|
|
151
151
|
declare function getFileExt(filePath: string): string;
|
|
152
|
+
declare function getFilename(params: {
|
|
153
|
+
filePath: string;
|
|
154
|
+
filename?: string;
|
|
155
|
+
}): string;
|
|
152
156
|
declare function copyToClipboard(text: string): Promise<TaskResult>;
|
|
153
157
|
declare function readClipboardText(): Promise<TaskResult<{
|
|
154
158
|
text: string;
|
|
@@ -167,4 +171,4 @@ declare const serverDataAdapter: {
|
|
|
167
171
|
}>(event: "unzip", data: DataType): NormalizeFromServer<DataType>;
|
|
168
172
|
};
|
|
169
173
|
|
|
170
|
-
export { addArticle, arrayWithConst, asyncRun, averageOf, blankSpaces, buildArray, camelCaseToLetter, classNameExt, classNameResolver, coerceIn, copyToClipboard, count, dataSearcher, distinct, drop, dropLast, dropLastWhile, dropWhile, format, formatGCTRegNo, formatInvoiceNo, getCaps, getFileExt, getMimeTypes, group, hasIndex, ifDefined, ifEmpty, inRange, indexOf, indices, inferFilename, insertAt, isEmpty, isFile, isLetter, isLocalFile, isNumber, lastIndex, map, mapToArray, maxOf, minOf, negate, ordinalIndicator, overwrite, pluralize, poll, random, range, readClipboardText, removeAll, repeat, run, serverDataAdapter, someValuesEmpty, sort, strictArray, stringToSearch, subObjectList, sumOf, take, takeLast, takeLastWhile, takeWhile, timeDuration, toNumber, trimString, undefinedIfEmpty, upperFirst, windowed };
|
|
174
|
+
export { addArticle, arrayWithConst, asyncRun, averageOf, blankSpaces, buildArray, camelCaseToLetter, classNameExt, classNameResolver, coerceIn, copyToClipboard, count, dataSearcher, distinct, drop, dropLast, dropLastWhile, dropWhile, format, formatGCTRegNo, formatInvoiceNo, getCaps, getFileExt, getFilename, getMimeTypes, group, hasIndex, ifDefined, ifEmpty, inRange, indexOf, indices, inferFilename, insertAt, isEmpty, isFile, isLetter, isLocalFile, isNumber, lastIndex, map, mapToArray, maxOf, minOf, negate, ordinalIndicator, overwrite, pluralize, poll, random, range, readClipboardText, removeAll, repeat, run, serverDataAdapter, someValuesEmpty, sort, strictArray, stringToSearch, subObjectList, sumOf, take, takeLast, takeLastWhile, takeWhile, timeDuration, toNumber, trimString, undefinedIfEmpty, upperFirst, windowed };
|
package/dist/main.js
CHANGED
|
@@ -739,6 +739,12 @@ function inferFilename(filePath) {
|
|
|
739
739
|
function getFileExt(filePath) {
|
|
740
740
|
return "." + takeLastWhile(filePath.split(""), (v) => v !== ".").join("");
|
|
741
741
|
}
|
|
742
|
+
function getFilename(params) {
|
|
743
|
+
if (!params.filename) return inferFilename(params.filePath);
|
|
744
|
+
const fileExt = getFileExt(params.filePath);
|
|
745
|
+
if (params.filename.includes(fileExt)) return params.filename.trim();
|
|
746
|
+
return params.filename.trim() + fileExt;
|
|
747
|
+
}
|
|
742
748
|
async function copyToClipboard(text) {
|
|
743
749
|
try {
|
|
744
750
|
await navigator.clipboard.writeText(text);
|
|
@@ -995,6 +1001,7 @@ export {
|
|
|
995
1001
|
formatInvoiceNo,
|
|
996
1002
|
getCaps,
|
|
997
1003
|
getFileExt,
|
|
1004
|
+
getFilename,
|
|
998
1005
|
getMimeTypes,
|
|
999
1006
|
group,
|
|
1000
1007
|
hasIndex,
|