@vacantthinker/firefox-addon-framework-easy 2026.624.946 → 2026.624.1014
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/serviceGet.d.ts +9 -2
- package/dist/serviceGet.d.ts.map +1 -1
- package/dist/serviceGet.js +21 -11
- package/package.json +1 -1
package/dist/serviceGet.d.ts
CHANGED
|
@@ -17,7 +17,14 @@ export declare function serviceParseURL(targetUrl: string): URL | undefined;
|
|
|
17
17
|
* @returns The formatted timestamp string.
|
|
18
18
|
*/
|
|
19
19
|
export declare function serviceGetCurrentDateYYYYMMDDHHMMSS(): string;
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Truncates a title to a safe length and appends the .mp4
|
|
22
|
+
* extension.
|
|
23
|
+
*/
|
|
24
|
+
export declare function serviceTitleToFilenameLimit(title: string | undefined, filenameLength?: number): string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Appends the .mp4 extension to a given string.
|
|
27
|
+
*/
|
|
28
|
+
export declare function serviceAppendExtMP4(title: string | undefined): string | undefined;
|
|
22
29
|
export {};
|
|
23
30
|
//# sourceMappingURL=serviceGet.d.ts.map
|
package/dist/serviceGet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceGet.d.ts","sourceRoot":"","sources":["../src/serviceGet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,sBAKjD;AAED,UAAU,OAAO;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,eAAe,CAAC;CAC/B;AAED,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CASxC;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,mBAGhD;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,IAAI,MAAM,CAY5D;
|
|
1
|
+
{"version":3,"file":"serviceGet.d.ts","sourceRoot":"","sources":["../src/serviceGet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,sBAKjD;AAED,UAAU,OAAO;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,eAAe,CAAC;CAC/B;AAED,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CASxC;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,mBAGhD;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,IAAI,MAAM,CAY5D;AAGD;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,cAAc,GAAE,MAAW,GAC1B,MAAM,GAAG,SAAS,CAOpB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAQ/C"}
|
package/dist/serviceGet.js
CHANGED
|
@@ -44,17 +44,27 @@ export function serviceGetCurrentDateYYYYMMDDHHMMSS() {
|
|
|
44
44
|
const milliseconds = date.getMilliseconds();
|
|
45
45
|
return `${year}_${month}_${day}_${hours}h_${minutes}m_${seconds}s_${milliseconds}`;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Truncates a title to a safe length and appends the .mp4
|
|
49
|
+
* extension.
|
|
50
|
+
*/
|
|
51
|
+
export function serviceTitleToFilenameLimit(title, filenameLength = 50) {
|
|
52
|
+
if (!title)
|
|
53
|
+
return undefined;
|
|
54
|
+
// .slice() safely handles strings shorter than
|
|
55
|
+
// MAX_FILENAME_LENGTH without throwing errors
|
|
56
|
+
const truncatedTitle = title.slice(0, filenameLength);
|
|
57
|
+
return serviceAppendExtMP4(truncatedTitle);
|
|
55
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Appends the .mp4 extension to a given string.
|
|
61
|
+
*/
|
|
56
62
|
export function serviceAppendExtMP4(title) {
|
|
57
|
-
if (title
|
|
58
|
-
return;
|
|
59
|
-
|
|
63
|
+
if (!title)
|
|
64
|
+
return undefined;
|
|
65
|
+
// Prevents duplicating the extension if it's already there
|
|
66
|
+
let extMP4 = '.mp4';
|
|
67
|
+
if (title.toLowerCase().endsWith(extMP4))
|
|
68
|
+
return title;
|
|
69
|
+
return `${title}${extMP4}`;
|
|
60
70
|
}
|