minimalistic-server 0.0.18 → 0.0.20
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/index.mjs +8 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -729,6 +729,14 @@ export class UploadedFile {
|
|
|
729
729
|
return this.#contentType;
|
|
730
730
|
}
|
|
731
731
|
|
|
732
|
+
getExtension() {
|
|
733
|
+
return this.#fileName?.toLowerCase().split('.').at(-1) ?? '';
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
getContentTypeByExtension() {
|
|
737
|
+
return mimeTypes[this.getExtension()] ?? 'application/octet-stream';
|
|
738
|
+
}
|
|
739
|
+
|
|
732
740
|
getFileName() {
|
|
733
741
|
return this.#fileName;
|
|
734
742
|
}
|