@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.
@@ -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
- export declare function serviceTitleToFilenameLimit(title: string): string | undefined;
21
- export declare function serviceAppendExtMP4(title: string): string | undefined;
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
@@ -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;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,sBAOxD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,sBAGhD"}
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"}
@@ -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
- export function serviceTitleToFilenameLimit(title) {
48
- if (title == undefined)
49
- return;
50
- let num50 = 50;
51
- const titleLimit = title.length > num50
52
- ? title.substring(0, num50)
53
- : title;
54
- return serviceAppendExtMP4(titleLimit);
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 == undefined)
58
- return;
59
- return `${title}.mp4`;
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vacantthinker/firefox-addon-framework-easy",
3
- "version": "2026.0624.0946",
3
+ "version": "2026.0624.1014",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",