@edifice.io/utilities 2.6.9-develop-b2school.20261013134048 → 2.6.9-develop-enabling.20261013152718

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function m(e){const t=new Date().getTime(),a=e.includes("?")?"&":"?";return`${e}${a}timestamp=${t}`}exports.addTimestampToImageUrl=m;
1
+ function e(e){let t=new Date().getTime();return`${e}${e.includes(`?`)?`&`:`?`}timestamp=${t}`}exports.addTimestampToImageUrl=e;
@@ -1,7 +1,7 @@
1
- function m(t) {
2
- const e = (/* @__PURE__ */ new Date()).getTime(), a = t.includes("?") ? "&" : "?";
3
- return `${t}${a}timestamp=${e}`;
1
+ //#region src/add-timestamp-to-url/add-timestamp-to-url.ts
2
+ function e(e) {
3
+ let t = (/* @__PURE__ */ new Date()).getTime();
4
+ return `${e}${e.includes("?") ? "&" : "?"}timestamp=${t}`;
4
5
  }
5
- export {
6
- m as addTimestampToImageUrl
7
- };
6
+ //#endregion
7
+ export { e as addTimestampToImageUrl };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=(o,r)=>{if(o==0)return"0 octets";const t=1e3,i=r||2,s=["octets","Ko","Mo","Go"],e=Math.floor(Math.log(o)/Math.log(t));return parseFloat((o/Math.pow(t,e)).toFixed(i))+" "+s[e]};exports.customSize=a;
1
+ var e=(e,t)=>{if(e==0)return`0 octets`;let n=1e3,r=t||2,i=[`octets`,`Ko`,`Mo`,`Go`],a=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/n**a).toFixed(r))+` `+i[a]};exports.customSize=e;
@@ -1,8 +1,13 @@
1
- const c = (o, r) => {
2
- if (o == 0) return "0 octets";
3
- const t = 1e3, a = r || 2, s = ["octets", "Ko", "Mo", "Go"], e = Math.floor(Math.log(o) / Math.log(t));
4
- return parseFloat((o / Math.pow(t, e)).toFixed(a)) + " " + s[e];
5
- };
6
- export {
7
- c as customSize
1
+ //#region src/custom-size/custom-size.ts
2
+ var e = (e, t) => {
3
+ if (e == 0) return "0 octets";
4
+ let n = 1e3, r = t || 2, i = [
5
+ "octets",
6
+ "Ko",
7
+ "Mo",
8
+ "Go"
9
+ ], a = Math.floor(Math.log(e) / Math.log(n));
10
+ return parseFloat((e / n ** a).toFixed(r)) + " " + i[a];
8
11
  };
12
+ //#endregion
13
+ export { e as customSize };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../string-utils/string-utils.cjs"),a=(e,r)=>{const t="virtualID";if(!Object.hasOwnProperty.apply(e,[t])){const i=r??`${n.StringUtils.generateVirtualId()}#${e.size}`;Object.defineProperty(e,t,{value:i,writable:!1})}return e[t]};exports.getOrGenerateBlobId=a;
1
+ const e=require("../string-utils/string-utils.cjs");var t=(t,n)=>{let r=`virtualID`;if(!Object.hasOwnProperty.apply(t,[r])){let i=n??`${e.StringUtils.generateVirtualId()}#${t.size}`;Object.defineProperty(t,r,{value:i,writable:!1})}return t[r]};exports.getOrGenerateBlobId=t;
@@ -1,15 +1,15 @@
1
- import { StringUtils as i } from "../string-utils/string-utils.js";
2
- const s = (e, r) => {
3
- const t = "virtualID";
4
- if (!Object.hasOwnProperty.apply(e, [t])) {
5
- const a = r ?? `${i.generateVirtualId()}#${e.size}`;
6
- Object.defineProperty(e, t, {
7
- value: a,
8
- writable: !1
9
- });
10
- }
11
- return e[t];
12
- };
13
- export {
14
- s as getOrGenerateBlobId
1
+ import { StringUtils as e } from "../string-utils/string-utils.js";
2
+ //#region src/get-or-generate-blobId/get-or-generate-blobId.ts
3
+ var t = (t, n) => {
4
+ let r = "virtualID";
5
+ if (!Object.hasOwnProperty.apply(t, [r])) {
6
+ let i = n ?? `${e.generateVirtualId()}#${t.size}`;
7
+ Object.defineProperty(t, r, {
8
+ value: i,
9
+ writable: !1
10
+ });
11
+ }
12
+ return t[r];
15
13
  };
14
+ //#endregion
15
+ export { t as getOrGenerateBlobId };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e,i=0,t=0){return!e.includes("data:image")&&!e.includes("thumbnail")&&(e=e+(e.includes("?")?"&thumbnail=":"?thumbnail=")+`${i}x${t}`),e}exports.getThumbnail=n;
1
+ function e(e,t=0,n=0){return!e.includes(`data:image`)&&!e.includes(`thumbnail`)&&(e=e+(e.includes(`?`)?`&thumbnail=`:`?thumbnail=`)+`${t}x${n}`),e}exports.getThumbnail=e;
@@ -1,6 +1,6 @@
1
- function t(i, n = 0, u = 0) {
2
- return !i.includes("data:image") && !i.includes("thumbnail") && (i = i + (i.includes("?") ? "&thumbnail=" : "?thumbnail=") + `${n}x${u}`), i;
1
+ //#region src/get-thumbnail/get-thumbnail.ts
2
+ function e(e, t = 0, n = 0) {
3
+ return !e.includes("data:image") && !e.includes("thumbnail") && (e = e + (e.includes("?") ? "&thumbnail=" : "?thumbnail=") + `${t}x${n}`), e;
3
4
  }
4
- export {
5
- t as getThumbnail
6
- };
5
+ //#endregion
6
+ export { e as getThumbnail };
@@ -1 +1 @@
1
- "use strict";class p{static changeDimension(e,n,t,r){return t>r&&(e=Math.round(e*r/t),t=r),e>n&&(t=Math.round(t*n/e),e=n),{height:e,width:t}}static renameFileNameExtension(e,n){const t=e.split(".");return t.pop(),t.join(".")+"."+n}static resizeImage(e,n,t,r,o="jpeg",g=80){const a=g/100,i=document.createElement("canvas"),l=`image/${o}`;let c=e.width,m=e.height;const h=this.changeDimension(m,r,c,t);c=h.width,m=h.height;const s=i.getContext("2d");return s&&(i.width=c,i.height=m,s.fillStyle="white",s.fillRect(0,0,i.width,i.height),s.imageSmoothingEnabled&&s.imageSmoothingQuality&&(s.imageSmoothingQuality="high"),s.drawImage(e,0,0,c,m)),new Promise((w,d)=>{i.toBlob(u=>{u?w(new File([u],n,{type:l,lastModified:new Date().getTime()})):d()},l,a)})}static async resizeImageFile(e,n=1440,t=1440,r=80){if(!e)throw Error("Image resizer: file not found!");if(!e.type||!e.type.startsWith("image/"))throw Error("Image resizer: the file given is not an image.");const o="jpeg";return new Promise(g=>{const a=new Image;a.setAttribute("style","max-width: none;"),a.src=URL.createObjectURL(e),a.onload=async()=>{const i=await this.resizeImage(a,this.renameFileNameExtension(e.name,o),n,t,o,r);g(i)},a.onerror=i=>{throw Error("Image Loading Error: "+i)}})}}module.exports=p;
1
+ var e=class{static changeDimension(e,t,n,r){return n>r&&(e=Math.round(e*r/n),n=r),e>t&&(n=Math.round(n*t/e),e=t),{height:e,width:n}}static renameFileNameExtension(e,t){let n=e.split(`.`);return n.pop(),n.join(`.`)+`.`+t}static resizeImage(e,t,n,r,i=`jpeg`,a=80){let o=a/100,s=document.createElement(`canvas`),c=`image/${i}`,l=e.width,u=e.height,d=this.changeDimension(u,r,l,n);l=d.width,u=d.height;let f=s.getContext(`2d`);return f&&(s.width=l,s.height=u,f.fillStyle=`white`,f.fillRect(0,0,s.width,s.height),f.imageSmoothingEnabled&&f.imageSmoothingQuality&&(f.imageSmoothingQuality=`high`),f.drawImage(e,0,0,l,u)),new Promise((e,n)=>{s.toBlob(r=>{r?e(new File([r],t,{type:c,lastModified:new Date().getTime()})):n()},c,o)})}static async resizeImageFile(e,t=1440,n=1440,r=80){if(!e)throw Error(`Image resizer: file not found!`);if(!e.type||!e.type.startsWith(`image/`))throw Error(`Image resizer: the file given is not an image.`);let i=`jpeg`;return new Promise(a=>{let o=new Image;o.setAttribute(`style`,`max-width: none;`),o.src=URL.createObjectURL(e),o.onload=async()=>{a(await this.resizeImage(o,this.renameFileNameExtension(e.name,i),t,n,i,r))},o.onerror=e=>{throw Error(`Image Loading Error: `+e)}})}};exports.default=e;
@@ -1,96 +1,41 @@
1
- class p {
2
- /**
3
- * Adjusts the dimensions of an image to fit within the specified maximum width and height,
4
- * preserving the aspect ratio.
5
- *
6
- * @param height - The original height of the image.
7
- * @param maxHeight - The maximum allowed height for the image.
8
- * @param width - The original width of the image.
9
- * @param maxWidth - The maximum allowed width for the image.
10
- * @returns An object containing the adjusted height and width of the image.
11
- */
12
- static changeDimension(e, n, t, a) {
13
- return t > a && (e = Math.round(e * a / t), t = a), e > n && (t = Math.round(t * n / e), e = n), { height: e, width: t };
14
- }
15
- /**
16
- * Renames the file extension of a given filename.
17
- *
18
- * @param filename - The original filename whose extension needs to be changed.
19
- * @param newExtension - The new extension to be applied to the filename.
20
- * @returns The filename with the new extension.
21
- */
22
- static renameFileNameExtension(e, n) {
23
- const t = e.split(".");
24
- return t.pop(), t.join(".") + "." + n;
25
- }
26
- /**
27
- * Resizes an image to the specified dimensions and compresses it to the specified format and quality.
28
- *
29
- * @param image - The HTMLImageElement to be resized.
30
- * @param fileName - The name of the output file.
31
- * @param maxWidth - The maximum width of the resized image.
32
- * @param maxHeight - The maximum height of the resized image.
33
- * @param compressFormat - The format to compress the image to (default is "jpeg").
34
- * @param quality - The quality of the compressed image, as a percentage (default is 80).
35
- * @returns A Promise that resolves to a File object containing the resized and compressed image.
36
- */
37
- static resizeImage(e, n, t, a, s = "jpeg", g = 80) {
38
- const r = g / 100, i = document.createElement("canvas"), l = `image/${s}`;
39
- let c = e.width, m = e.height;
40
- const h = this.changeDimension(
41
- m,
42
- a,
43
- c,
44
- t
45
- );
46
- c = h.width, m = h.height;
47
- const o = i.getContext("2d");
48
- return o && (i.width = c, i.height = m, o.fillStyle = "white", o.fillRect(0, 0, i.width, i.height), o.imageSmoothingEnabled && o.imageSmoothingQuality && (o.imageSmoothingQuality = "high"), o.drawImage(e, 0, 0, c, m)), new Promise((u, w) => {
49
- i.toBlob(
50
- (d) => {
51
- d ? u(
52
- new File([d], n, {
53
- type: l,
54
- lastModified: (/* @__PURE__ */ new Date()).getTime()
55
- })
56
- ) : w();
57
- },
58
- l,
59
- r
60
- );
61
- });
62
- }
63
- /**
64
- * Resize and compress Image File in JPEG format (other format don't work well with canvas.toBlob() with quality parameter)
65
- * @param file The image file to resize
66
- * @param maxWidth The maximum width of the resized image
67
- * @param maxHeight The maximum height of the resized image
68
- * @param quality The quality of the compressed image
69
- * @returns The resized image file
70
- */
71
- static async resizeImageFile(e, n = 1440, t = 1440, a = 80) {
72
- if (!e) throw Error("Image resizer: file not found!");
73
- if (!e.type || !e.type.startsWith("image/"))
74
- throw Error("Image resizer: the file given is not an image.");
75
- const s = "jpeg";
76
- return new Promise((g) => {
77
- const r = new Image();
78
- r.setAttribute("style", "max-width: none;"), r.src = URL.createObjectURL(e), r.onload = async () => {
79
- const i = await this.resizeImage(
80
- r,
81
- this.renameFileNameExtension(e.name, s),
82
- n,
83
- t,
84
- s,
85
- a
86
- );
87
- g(i);
88
- }, r.onerror = (i) => {
89
- throw Error("Image Loading Error: " + i);
90
- };
91
- });
92
- }
93
- }
94
- export {
95
- p as default
1
+ //#region src/image-resizer/image-resizer.ts
2
+ var e = class {
3
+ static changeDimension(e, t, n, r) {
4
+ return n > r && (e = Math.round(e * r / n), n = r), e > t && (n = Math.round(n * t / e), e = t), {
5
+ height: e,
6
+ width: n
7
+ };
8
+ }
9
+ static renameFileNameExtension(e, t) {
10
+ let n = e.split(".");
11
+ return n.pop(), n.join(".") + "." + t;
12
+ }
13
+ static resizeImage(e, t, n, r, i = "jpeg", a = 80) {
14
+ let o = a / 100, s = document.createElement("canvas"), c = `image/${i}`, l = e.width, u = e.height, d = this.changeDimension(u, r, l, n);
15
+ l = d.width, u = d.height;
16
+ let f = s.getContext("2d");
17
+ return f && (s.width = l, s.height = u, f.fillStyle = "white", f.fillRect(0, 0, s.width, s.height), f.imageSmoothingEnabled && f.imageSmoothingQuality && (f.imageSmoothingQuality = "high"), f.drawImage(e, 0, 0, l, u)), new Promise((e, n) => {
18
+ s.toBlob((r) => {
19
+ r ? e(new File([r], t, {
20
+ type: c,
21
+ lastModified: (/* @__PURE__ */ new Date()).getTime()
22
+ })) : n();
23
+ }, c, o);
24
+ });
25
+ }
26
+ static async resizeImageFile(e, t = 1440, n = 1440, r = 80) {
27
+ if (!e) throw Error("Image resizer: file not found!");
28
+ if (!e.type || !e.type.startsWith("image/")) throw Error("Image resizer: the file given is not an image.");
29
+ let i = "jpeg";
30
+ return new Promise((a) => {
31
+ let o = new Image();
32
+ o.setAttribute("style", "max-width: none;"), o.src = URL.createObjectURL(e), o.onload = async () => {
33
+ a(await this.resizeImage(o, this.renameFileNameExtension(e.name, i), t, n, i, r));
34
+ }, o.onerror = (e) => {
35
+ throw Error("Image Loading Error: " + e);
36
+ };
37
+ });
38
+ }
96
39
  };
40
+ //#endregion
41
+ export { e as default };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./add-timestamp-to-url/add-timestamp-to-url.cjs"),r=require("./custom-size/custom-size.cjs"),i=require("./get-or-generate-blobId/get-or-generate-blobId.cjs"),s=require("./get-thumbnail/get-thumbnail.cjs"),o=require("./image-resizer/image-resizer.cjs"),a=require("./library-maps/library-maps.cjs"),n=require("./mime-type-utils/mime-type-utils.cjs"),m=require("./noop/noop.cjs"),u=require("./string-utils/string-utils.cjs"),e=require("./time/time.cjs"),l=require("./video/video.cjs");exports.addTimestampToImageUrl=t.addTimestampToImageUrl;exports.customSize=r.customSize;exports.getOrGenerateBlobId=i.getOrGenerateBlobId;exports.getThumbnail=s.getThumbnail;exports.ImageResizer=o;exports.libraryMaps=a.libraryMaps;exports.MimeTypeUtils=n.MimeTypeUtils;exports.NOOP=m.NOOP;exports.StringUtils=u.StringUtils;exports.convertMsToMS=e.convertMsToMS;exports.padTo2Digits=e.padTo2Digits;exports.getBestSupportedMimeType=l.getBestSupportedMimeType;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./add-timestamp-to-url/add-timestamp-to-url.cjs"),t=require("./custom-size/custom-size.cjs"),n=require("./string-utils/string-utils.cjs"),r=require("./get-or-generate-blobId/get-or-generate-blobId.cjs"),i=require("./get-thumbnail/get-thumbnail.cjs"),a=require("./image-resizer/image-resizer.cjs"),o=require("./library-maps/library-maps.cjs"),s=require("./mime-type-utils/mime-type-utils.cjs");require("./mime-type-utils/index.cjs");const c=require("./noop/noop.cjs"),l=require("./time/time.cjs"),u=require("./video/video.cjs");exports.ImageResizer=a,exports.MimeTypeUtils=s.MimeTypeUtils,exports.NOOP=c.NOOP,exports.StringUtils=n.StringUtils,exports.addTimestampToImageUrl=e.addTimestampToImageUrl,exports.convertMsToMS=l.convertMsToMS,exports.customSize=t.customSize,exports.getBestSupportedMimeType=u.getBestSupportedMimeType,exports.getOrGenerateBlobId=r.getOrGenerateBlobId,exports.getThumbnail=i.getThumbnail,exports.libraryMaps=o.libraryMaps,exports.padTo2Digits=l.padTo2Digits;
package/dist/index.js CHANGED
@@ -1,25 +1,13 @@
1
- import { addTimestampToImageUrl as o } from "./add-timestamp-to-url/add-timestamp-to-url.js";
2
- import { customSize as m } from "./custom-size/custom-size.js";
3
- import { getOrGenerateBlobId as f } from "./get-or-generate-blobId/get-or-generate-blobId.js";
4
- import { getThumbnail as a } from "./get-thumbnail/get-thumbnail.js";
5
- import { default as s } from "./image-resizer/image-resizer.js";
6
- import { libraryMaps as l } from "./library-maps/library-maps.js";
7
- import { MimeTypeUtils as d } from "./mime-type-utils/mime-type-utils.js";
8
- import { NOOP as n } from "./noop/noop.js";
9
- import { StringUtils as S } from "./string-utils/string-utils.js";
10
- import { convertMsToMS as y, padTo2Digits as I } from "./time/time.js";
11
- import { getBestSupportedMimeType as U } from "./video/video.js";
12
- export {
13
- s as ImageResizer,
14
- d as MimeTypeUtils,
15
- n as NOOP,
16
- S as StringUtils,
17
- o as addTimestampToImageUrl,
18
- y as convertMsToMS,
19
- m as customSize,
20
- U as getBestSupportedMimeType,
21
- f as getOrGenerateBlobId,
22
- a as getThumbnail,
23
- l as libraryMaps,
24
- I as padTo2Digits
25
- };
1
+ import { addTimestampToImageUrl as e } from "./add-timestamp-to-url/add-timestamp-to-url.js";
2
+ import { customSize as t } from "./custom-size/custom-size.js";
3
+ import { StringUtils as n } from "./string-utils/string-utils.js";
4
+ import { getOrGenerateBlobId as r } from "./get-or-generate-blobId/get-or-generate-blobId.js";
5
+ import { getThumbnail as i } from "./get-thumbnail/get-thumbnail.js";
6
+ import a from "./image-resizer/image-resizer.js";
7
+ import { libraryMaps as o } from "./library-maps/library-maps.js";
8
+ import { MimeTypeUtils as s } from "./mime-type-utils/mime-type-utils.js";
9
+ import "./mime-type-utils/index.js";
10
+ import { NOOP as c } from "./noop/noop.js";
11
+ import { convertMsToMS as l, padTo2Digits as u } from "./time/time.js";
12
+ import { getBestSupportedMimeType as d } from "./video/video.js";
13
+ export { a as ImageResizer, s as MimeTypeUtils, c as NOOP, n as StringUtils, e as addTimestampToImageUrl, l as convertMsToMS, t as customSize, d as getBestSupportedMimeType, r as getOrGenerateBlobId, i as getThumbnail, o as libraryMaps, u as padTo2Digits };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={blog:"Blog",mindmap:"MindMap",scrapbook:"ScrapBook",collaborativewall:"CollaborativeWall",timelinegenerator:"TimelineGenerator",wiki:"Wiki",exercizer:"Exercizer"};exports.libraryMaps=e;
1
+ var e={blog:`Blog`,mindmap:`MindMap`,scrapbook:`ScrapBook`,collaborativewall:`CollaborativeWall`,timelinegenerator:`TimelineGenerator`,wiki:`Wiki`,exercizer:`Exercizer`};exports.libraryMaps=e;
@@ -1,12 +1,12 @@
1
- const e = {
2
- blog: "Blog",
3
- mindmap: "MindMap",
4
- scrapbook: "ScrapBook",
5
- collaborativewall: "CollaborativeWall",
6
- timelinegenerator: "TimelineGenerator",
7
- wiki: "Wiki",
8
- exercizer: "Exercizer"
9
- };
10
- export {
11
- e as libraryMaps
1
+ //#region src/library-maps/library-maps.ts
2
+ var e = {
3
+ blog: "Blog",
4
+ mindmap: "MindMap",
5
+ scrapbook: "ScrapBook",
6
+ collaborativewall: "CollaborativeWall",
7
+ timelinegenerator: "TimelineGenerator",
8
+ wiki: "Wiki",
9
+ exercizer: "Exercizer"
12
10
  };
11
+ //#endregion
12
+ export { e as libraryMaps };
@@ -0,0 +1 @@
1
+ require("./mime-type-utils.cjs");
@@ -0,0 +1 @@
1
+ import "./mime-type-utils.js";
@@ -1 +1 @@
1
- "use strict";var p=Object.defineProperty;var d=(i,t,s)=>t in i?p(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s;var n=(i,t,s)=>d(i,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=class o{constructor(){n(this,"wordExtensions",new Set);n(this,"excelExtensions",new Set);n(this,"pptExtensions",new Set);n(this,"fileExtensionMap",new Map);n(this,"csvContentType",new Set);n(this,"csvExtensions",new Set);n(this,"txtExtensions",new Set);n(this,"mdExtensions",new Set);n(this,"PDF","application/pdf");n(this,"OCTET_STREAM","application/octet-stream");this.txtExtensions.add("txt"),this.mdExtensions.add("md"),this.wordExtensions.add("doc"),this.wordExtensions.add("dot"),this.wordExtensions.add("docx"),this.wordExtensions.add("dotx"),this.wordExtensions.add("docm"),this.wordExtensions.add("dotm"),this.wordExtensions.add("odt"),this.wordExtensions.add("ott"),this.wordExtensions.add("oth"),this.wordExtensions.add("odm"),this.excelExtensions.add("xls"),this.excelExtensions.add("xlt"),this.excelExtensions.add("xla"),this.excelExtensions.add("xlsx"),this.excelExtensions.add("xltx"),this.excelExtensions.add("xlsm"),this.excelExtensions.add("xltm"),this.excelExtensions.add("xlam"),this.excelExtensions.add("xlsb"),this.excelExtensions.add("ods"),this.excelExtensions.add("ots"),this.pptExtensions.add("ppt"),this.pptExtensions.add("pot"),this.pptExtensions.add("pps"),this.pptExtensions.add("ppa"),this.pptExtensions.add("pptx"),this.pptExtensions.add("potx"),this.pptExtensions.add("ppsx"),this.pptExtensions.add("ppam"),this.pptExtensions.add("pptm"),this.pptExtensions.add("potm"),this.pptExtensions.add("ppsm"),this.pptExtensions.add("odp"),this.pptExtensions.add("otp"),this.csvExtensions.add("csv"),this.fileExtensionMap.set("doc","application/msword"),this.fileExtensionMap.set("dot","application/msword"),this.fileExtensionMap.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),this.fileExtensionMap.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),this.fileExtensionMap.set("docm","application/vnd.ms-word.document.macroEnabled.12"),this.fileExtensionMap.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),this.fileExtensionMap.set("xls","application/vnd.ms-excel"),this.fileExtensionMap.set("xlt","application/vnd.ms-excel"),this.fileExtensionMap.set("xla","application/vnd.ms-excel"),this.fileExtensionMap.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),this.fileExtensionMap.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),this.fileExtensionMap.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),this.fileExtensionMap.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),this.fileExtensionMap.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),this.fileExtensionMap.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),this.fileExtensionMap.set("ppt","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pot","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pps","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("ppa","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),this.fileExtensionMap.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),this.fileExtensionMap.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),this.fileExtensionMap.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),this.fileExtensionMap.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),this.fileExtensionMap.set("odt","application/vnd.oasis.opendocument.text"),this.fileExtensionMap.set("ott","application/vnd.oasis.opendocument.text-template"),this.fileExtensionMap.set("oth","application/vnd.oasis.opendocument.text-web"),this.fileExtensionMap.set("odm","application/vnd.oasis.opendocument.text-master"),this.fileExtensionMap.set("odg","application/vnd.oasis.opendocument.graphics"),this.fileExtensionMap.set("otg","application/vnd.oasis.opendocument.graphics-template"),this.fileExtensionMap.set("odp","application/vnd.oasis.opendocument.presentation"),this.fileExtensionMap.set("otp","application/vnd.oasis.opendocument.presentation-template"),this.fileExtensionMap.set("ods","application/vnd.oasis.opendocument.spreadsheet"),this.fileExtensionMap.set("ots","application/vnd.oasis.opendocument.spreadsheet-template"),this.fileExtensionMap.set("odc","application/vnd.oasis.opendocument.chart"),this.fileExtensionMap.set("odf","application/vnd.oasis.opendocument.formula"),this.fileExtensionMap.set("odb","application/vnd.oasis.opendocument.database"),this.fileExtensionMap.set("odi","application/vnd.oasis.opendocument.image"),this.fileExtensionMap.set("oxt","application/vnd.openofficeorg.extension"),this.fileExtensionMap.set("txt","text/plain"),this.fileExtensionMap.set("md","text/markdown"),this.csvContentType.add("text/comma-separated-values"),this.csvContentType.add("text/csv"),this.csvContentType.add("application/csv")}getContentTypeForExtension(t){return this.fileExtensionMap.has(t)?this.fileExtensionMap.get(t)??null:null}getExtensionForContentType(t){for(const s of Array.from(this.fileExtensionMap.keys()))if((this.fileExtensionMap.get(s)||"").toLowerCase()==(t||"").toLowerCase())return s;return null}isWordLike(t,s){const e=this.getExtensionForContentType(t);return e?this.wordExtensions.has(e):t==this.OCTET_STREAM&&s?this.wordExtensions.has(s):!1}isExcelLike(t,s){const e=this.getExtensionForContentType(t);return e?this.excelExtensions.has(e):t==this.OCTET_STREAM&&s?this.excelExtensions.has(s):!1}isCsvLike(t,s){return this.csvContentType.has(t)?!0:t==this.OCTET_STREAM&&s?this.csvExtensions.has(s):!1}isPowerpointLike(t,s){const e=this.getExtensionForContentType(t);return e?this.pptExtensions.has(e):t==this.OCTET_STREAM&&s?this.pptExtensions.has(s):!1}isTxtLike(t,s){const e=this.getExtensionForContentType(t);return e?this.txtExtensions.has(e):t==this.OCTET_STREAM&&s?this.txtExtensions.has(s):!1}isMdLike(t,s){const e=this.getExtensionForContentType(t);return e?this.mdExtensions.has(e):t==this.OCTET_STREAM&&s?this.mdExtensions.has(s):!1}};n(o,"INSTANCE",new o);let a=o;exports.MimeTypeUtils=a;
1
+ var e=class e{static INSTANCE=new e;wordExtensions=new Set;excelExtensions=new Set;pptExtensions=new Set;fileExtensionMap=new Map;csvContentType=new Set;csvExtensions=new Set;txtExtensions=new Set;mdExtensions=new Set;PDF=`application/pdf`;OCTET_STREAM=`application/octet-stream`;constructor(){this.txtExtensions.add(`txt`),this.mdExtensions.add(`md`),this.wordExtensions.add(`doc`),this.wordExtensions.add(`dot`),this.wordExtensions.add(`docx`),this.wordExtensions.add(`dotx`),this.wordExtensions.add(`docm`),this.wordExtensions.add(`dotm`),this.wordExtensions.add(`odt`),this.wordExtensions.add(`ott`),this.wordExtensions.add(`oth`),this.wordExtensions.add(`odm`),this.excelExtensions.add(`xls`),this.excelExtensions.add(`xlt`),this.excelExtensions.add(`xla`),this.excelExtensions.add(`xlsx`),this.excelExtensions.add(`xltx`),this.excelExtensions.add(`xlsm`),this.excelExtensions.add(`xltm`),this.excelExtensions.add(`xlam`),this.excelExtensions.add(`xlsb`),this.excelExtensions.add(`ods`),this.excelExtensions.add(`ots`),this.pptExtensions.add(`ppt`),this.pptExtensions.add(`pot`),this.pptExtensions.add(`pps`),this.pptExtensions.add(`ppa`),this.pptExtensions.add(`pptx`),this.pptExtensions.add(`potx`),this.pptExtensions.add(`ppsx`),this.pptExtensions.add(`ppam`),this.pptExtensions.add(`pptm`),this.pptExtensions.add(`potm`),this.pptExtensions.add(`ppsm`),this.pptExtensions.add(`odp`),this.pptExtensions.add(`otp`),this.csvExtensions.add(`csv`),this.fileExtensionMap.set(`doc`,`application/msword`),this.fileExtensionMap.set(`dot`,`application/msword`),this.fileExtensionMap.set(`docx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`),this.fileExtensionMap.set(`dotx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.template`),this.fileExtensionMap.set(`docm`,`application/vnd.ms-word.document.macroEnabled.12`),this.fileExtensionMap.set(`dotm`,`application/vnd.ms-word.template.macroEnabled.12`),this.fileExtensionMap.set(`xls`,`application/vnd.ms-excel`),this.fileExtensionMap.set(`xlt`,`application/vnd.ms-excel`),this.fileExtensionMap.set(`xla`,`application/vnd.ms-excel`),this.fileExtensionMap.set(`xlsx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`),this.fileExtensionMap.set(`xltx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.template`),this.fileExtensionMap.set(`xlsm`,`application/vnd.ms-excel.sheet.macroEnabled.12`),this.fileExtensionMap.set(`xltm`,`application/vnd.ms-excel.template.macroEnabled.12`),this.fileExtensionMap.set(`xlam`,`application/vnd.ms-excel.addin.macroEnabled.12`),this.fileExtensionMap.set(`xlsb`,`application/vnd.ms-excel.sheet.binary.macroEnabled.12`),this.fileExtensionMap.set(`ppt`,`application/vnd.ms-powerpoint`),this.fileExtensionMap.set(`pot`,`application/vnd.ms-powerpoint`),this.fileExtensionMap.set(`pps`,`application/vnd.ms-powerpoint`),this.fileExtensionMap.set(`ppa`,`application/vnd.ms-powerpoint`),this.fileExtensionMap.set(`pptx`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`),this.fileExtensionMap.set(`potx`,`application/vnd.openxmlformats-officedocument.presentationml.template`),this.fileExtensionMap.set(`ppsx`,`application/vnd.openxmlformats-officedocument.presentationml.slideshow`),this.fileExtensionMap.set(`ppam`,`application/vnd.ms-powerpoint.addin.macroEnabled.12`),this.fileExtensionMap.set(`pptm`,`application/vnd.ms-powerpoint.presentation.macroEnabled.12`),this.fileExtensionMap.set(`potm`,`application/vnd.ms-powerpoint.presentation.macroEnabled.12`),this.fileExtensionMap.set(`ppsm`,`application/vnd.ms-powerpoint.slideshow.macroEnabled.12`),this.fileExtensionMap.set(`odt`,`application/vnd.oasis.opendocument.text`),this.fileExtensionMap.set(`ott`,`application/vnd.oasis.opendocument.text-template`),this.fileExtensionMap.set(`oth`,`application/vnd.oasis.opendocument.text-web`),this.fileExtensionMap.set(`odm`,`application/vnd.oasis.opendocument.text-master`),this.fileExtensionMap.set(`odg`,`application/vnd.oasis.opendocument.graphics`),this.fileExtensionMap.set(`otg`,`application/vnd.oasis.opendocument.graphics-template`),this.fileExtensionMap.set(`odp`,`application/vnd.oasis.opendocument.presentation`),this.fileExtensionMap.set(`otp`,`application/vnd.oasis.opendocument.presentation-template`),this.fileExtensionMap.set(`ods`,`application/vnd.oasis.opendocument.spreadsheet`),this.fileExtensionMap.set(`ots`,`application/vnd.oasis.opendocument.spreadsheet-template`),this.fileExtensionMap.set(`odc`,`application/vnd.oasis.opendocument.chart`),this.fileExtensionMap.set(`odf`,`application/vnd.oasis.opendocument.formula`),this.fileExtensionMap.set(`odb`,`application/vnd.oasis.opendocument.database`),this.fileExtensionMap.set(`odi`,`application/vnd.oasis.opendocument.image`),this.fileExtensionMap.set(`oxt`,`application/vnd.openofficeorg.extension`),this.fileExtensionMap.set(`txt`,`text/plain`),this.fileExtensionMap.set(`md`,`text/markdown`),this.csvContentType.add(`text/comma-separated-values`),this.csvContentType.add(`text/csv`),this.csvContentType.add(`application/csv`)}getContentTypeForExtension(e){return this.fileExtensionMap.has(e)?this.fileExtensionMap.get(e)??null:null}getExtensionForContentType(e){for(let t of Array.from(this.fileExtensionMap.keys()))if((this.fileExtensionMap.get(t)||``).toLowerCase()==(e||``).toLowerCase())return t;return null}isWordLike(e,t){let n=this.getExtensionForContentType(e);return n?this.wordExtensions.has(n):e==this.OCTET_STREAM&&t?this.wordExtensions.has(t):!1}isExcelLike(e,t){let n=this.getExtensionForContentType(e);return n?this.excelExtensions.has(n):e==this.OCTET_STREAM&&t?this.excelExtensions.has(t):!1}isCsvLike(e,t){return this.csvContentType.has(e)?!0:e==this.OCTET_STREAM&&t?this.csvExtensions.has(t):!1}isPowerpointLike(e,t){let n=this.getExtensionForContentType(e);return n?this.pptExtensions.has(n):e==this.OCTET_STREAM&&t?this.pptExtensions.has(t):!1}isTxtLike(e,t){let n=this.getExtensionForContentType(e);return n?this.txtExtensions.has(n):e==this.OCTET_STREAM&&t?this.txtExtensions.has(t):!1}isMdLike(e,t){let n=this.getExtensionForContentType(e);return n?this.mdExtensions.has(n):e==this.OCTET_STREAM&&t?this.mdExtensions.has(t):!1}};exports.MimeTypeUtils=e;
@@ -1,145 +1,49 @@
1
- var p = Object.defineProperty;
2
- var d = (i, t, s) => t in i ? p(i, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[t] = s;
3
- var n = (i, t, s) => d(i, typeof t != "symbol" ? t + "" : t, s);
4
- const o = class o {
5
- constructor() {
6
- n(this, "wordExtensions", /* @__PURE__ */ new Set());
7
- n(this, "excelExtensions", /* @__PURE__ */ new Set());
8
- n(this, "pptExtensions", /* @__PURE__ */ new Set());
9
- n(this, "fileExtensionMap", /* @__PURE__ */ new Map());
10
- n(this, "csvContentType", /* @__PURE__ */ new Set());
11
- n(this, "csvExtensions", /* @__PURE__ */ new Set());
12
- n(this, "txtExtensions", /* @__PURE__ */ new Set());
13
- n(this, "mdExtensions", /* @__PURE__ */ new Set());
14
- n(this, "PDF", "application/pdf");
15
- n(this, "OCTET_STREAM", "application/octet-stream");
16
- this.txtExtensions.add("txt"), this.mdExtensions.add("md"), this.wordExtensions.add("doc"), this.wordExtensions.add("dot"), this.wordExtensions.add("docx"), this.wordExtensions.add("dotx"), this.wordExtensions.add("docm"), this.wordExtensions.add("dotm"), this.wordExtensions.add("odt"), this.wordExtensions.add("ott"), this.wordExtensions.add("oth"), this.wordExtensions.add("odm"), this.excelExtensions.add("xls"), this.excelExtensions.add("xlt"), this.excelExtensions.add("xla"), this.excelExtensions.add("xlsx"), this.excelExtensions.add("xltx"), this.excelExtensions.add("xlsm"), this.excelExtensions.add("xltm"), this.excelExtensions.add("xlam"), this.excelExtensions.add("xlsb"), this.excelExtensions.add("ods"), this.excelExtensions.add("ots"), this.pptExtensions.add("ppt"), this.pptExtensions.add("pot"), this.pptExtensions.add("pps"), this.pptExtensions.add("ppa"), this.pptExtensions.add("pptx"), this.pptExtensions.add("potx"), this.pptExtensions.add("ppsx"), this.pptExtensions.add("ppam"), this.pptExtensions.add("pptm"), this.pptExtensions.add("potm"), this.pptExtensions.add("ppsm"), this.pptExtensions.add("odp"), this.pptExtensions.add("otp"), this.csvExtensions.add("csv"), this.fileExtensionMap.set("doc", "application/msword"), this.fileExtensionMap.set("dot", "application/msword"), this.fileExtensionMap.set(
17
- "docx",
18
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
19
- ), this.fileExtensionMap.set(
20
- "dotx",
21
- "application/vnd.openxmlformats-officedocument.wordprocessingml.template"
22
- ), this.fileExtensionMap.set(
23
- "docm",
24
- "application/vnd.ms-word.document.macroEnabled.12"
25
- ), this.fileExtensionMap.set(
26
- "dotm",
27
- "application/vnd.ms-word.template.macroEnabled.12"
28
- ), this.fileExtensionMap.set("xls", "application/vnd.ms-excel"), this.fileExtensionMap.set("xlt", "application/vnd.ms-excel"), this.fileExtensionMap.set("xla", "application/vnd.ms-excel"), this.fileExtensionMap.set(
29
- "xlsx",
30
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
31
- ), this.fileExtensionMap.set(
32
- "xltx",
33
- "application/vnd.openxmlformats-officedocument.spreadsheetml.template"
34
- ), this.fileExtensionMap.set(
35
- "xlsm",
36
- "application/vnd.ms-excel.sheet.macroEnabled.12"
37
- ), this.fileExtensionMap.set(
38
- "xltm",
39
- "application/vnd.ms-excel.template.macroEnabled.12"
40
- ), this.fileExtensionMap.set(
41
- "xlam",
42
- "application/vnd.ms-excel.addin.macroEnabled.12"
43
- ), this.fileExtensionMap.set(
44
- "xlsb",
45
- "application/vnd.ms-excel.sheet.binary.macroEnabled.12"
46
- ), this.fileExtensionMap.set("ppt", "application/vnd.ms-powerpoint"), this.fileExtensionMap.set("pot", "application/vnd.ms-powerpoint"), this.fileExtensionMap.set("pps", "application/vnd.ms-powerpoint"), this.fileExtensionMap.set("ppa", "application/vnd.ms-powerpoint"), this.fileExtensionMap.set(
47
- "pptx",
48
- "application/vnd.openxmlformats-officedocument.presentationml.presentation"
49
- ), this.fileExtensionMap.set(
50
- "potx",
51
- "application/vnd.openxmlformats-officedocument.presentationml.template"
52
- ), this.fileExtensionMap.set(
53
- "ppsx",
54
- "application/vnd.openxmlformats-officedocument.presentationml.slideshow"
55
- ), this.fileExtensionMap.set(
56
- "ppam",
57
- "application/vnd.ms-powerpoint.addin.macroEnabled.12"
58
- ), this.fileExtensionMap.set(
59
- "pptm",
60
- "application/vnd.ms-powerpoint.presentation.macroEnabled.12"
61
- ), this.fileExtensionMap.set(
62
- "potm",
63
- "application/vnd.ms-powerpoint.presentation.macroEnabled.12"
64
- ), this.fileExtensionMap.set(
65
- "ppsm",
66
- "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"
67
- ), this.fileExtensionMap.set("odt", "application/vnd.oasis.opendocument.text"), this.fileExtensionMap.set(
68
- "ott",
69
- "application/vnd.oasis.opendocument.text-template"
70
- ), this.fileExtensionMap.set(
71
- "oth",
72
- "application/vnd.oasis.opendocument.text-web"
73
- ), this.fileExtensionMap.set(
74
- "odm",
75
- "application/vnd.oasis.opendocument.text-master"
76
- ), this.fileExtensionMap.set(
77
- "odg",
78
- "application/vnd.oasis.opendocument.graphics"
79
- ), this.fileExtensionMap.set(
80
- "otg",
81
- "application/vnd.oasis.opendocument.graphics-template"
82
- ), this.fileExtensionMap.set(
83
- "odp",
84
- "application/vnd.oasis.opendocument.presentation"
85
- ), this.fileExtensionMap.set(
86
- "otp",
87
- "application/vnd.oasis.opendocument.presentation-template"
88
- ), this.fileExtensionMap.set(
89
- "ods",
90
- "application/vnd.oasis.opendocument.spreadsheet"
91
- ), this.fileExtensionMap.set(
92
- "ots",
93
- "application/vnd.oasis.opendocument.spreadsheet-template"
94
- ), this.fileExtensionMap.set(
95
- "odc",
96
- "application/vnd.oasis.opendocument.chart"
97
- ), this.fileExtensionMap.set(
98
- "odf",
99
- "application/vnd.oasis.opendocument.formula"
100
- ), this.fileExtensionMap.set(
101
- "odb",
102
- "application/vnd.oasis.opendocument.database"
103
- ), this.fileExtensionMap.set(
104
- "odi",
105
- "application/vnd.oasis.opendocument.image"
106
- ), this.fileExtensionMap.set("oxt", "application/vnd.openofficeorg.extension"), this.fileExtensionMap.set("txt", "text/plain"), this.fileExtensionMap.set("md", "text/markdown"), this.csvContentType.add("text/comma-separated-values"), this.csvContentType.add("text/csv"), this.csvContentType.add("application/csv");
107
- }
108
- getContentTypeForExtension(t) {
109
- return this.fileExtensionMap.has(t) ? this.fileExtensionMap.get(t) ?? null : null;
110
- }
111
- getExtensionForContentType(t) {
112
- for (const s of Array.from(this.fileExtensionMap.keys()))
113
- if ((this.fileExtensionMap.get(s) || "").toLowerCase() == (t || "").toLowerCase())
114
- return s;
115
- return null;
116
- }
117
- isWordLike(t, s) {
118
- const e = this.getExtensionForContentType(t);
119
- return e ? this.wordExtensions.has(e) : t == this.OCTET_STREAM && s ? this.wordExtensions.has(s) : !1;
120
- }
121
- isExcelLike(t, s) {
122
- const e = this.getExtensionForContentType(t);
123
- return e ? this.excelExtensions.has(e) : t == this.OCTET_STREAM && s ? this.excelExtensions.has(s) : !1;
124
- }
125
- isCsvLike(t, s) {
126
- return this.csvContentType.has(t) ? !0 : t == this.OCTET_STREAM && s ? this.csvExtensions.has(s) : !1;
127
- }
128
- isPowerpointLike(t, s) {
129
- const e = this.getExtensionForContentType(t);
130
- return e ? this.pptExtensions.has(e) : t == this.OCTET_STREAM && s ? this.pptExtensions.has(s) : !1;
131
- }
132
- isTxtLike(t, s) {
133
- const e = this.getExtensionForContentType(t);
134
- return e ? this.txtExtensions.has(e) : t == this.OCTET_STREAM && s ? this.txtExtensions.has(s) : !1;
135
- }
136
- isMdLike(t, s) {
137
- const e = this.getExtensionForContentType(t);
138
- return e ? this.mdExtensions.has(e) : t == this.OCTET_STREAM && s ? this.mdExtensions.has(s) : !1;
139
- }
140
- };
141
- n(o, "INSTANCE", new o());
142
- let a = o;
143
- export {
144
- a as MimeTypeUtils
1
+ //#region src/mime-type-utils/mime-type-utils.ts
2
+ var e = class e {
3
+ static INSTANCE = new e();
4
+ wordExtensions = /* @__PURE__ */ new Set();
5
+ excelExtensions = /* @__PURE__ */ new Set();
6
+ pptExtensions = /* @__PURE__ */ new Set();
7
+ fileExtensionMap = /* @__PURE__ */ new Map();
8
+ csvContentType = /* @__PURE__ */ new Set();
9
+ csvExtensions = /* @__PURE__ */ new Set();
10
+ txtExtensions = /* @__PURE__ */ new Set();
11
+ mdExtensions = /* @__PURE__ */ new Set();
12
+ PDF = "application/pdf";
13
+ OCTET_STREAM = "application/octet-stream";
14
+ constructor() {
15
+ this.txtExtensions.add("txt"), this.mdExtensions.add("md"), this.wordExtensions.add("doc"), this.wordExtensions.add("dot"), this.wordExtensions.add("docx"), this.wordExtensions.add("dotx"), this.wordExtensions.add("docm"), this.wordExtensions.add("dotm"), this.wordExtensions.add("odt"), this.wordExtensions.add("ott"), this.wordExtensions.add("oth"), this.wordExtensions.add("odm"), this.excelExtensions.add("xls"), this.excelExtensions.add("xlt"), this.excelExtensions.add("xla"), this.excelExtensions.add("xlsx"), this.excelExtensions.add("xltx"), this.excelExtensions.add("xlsm"), this.excelExtensions.add("xltm"), this.excelExtensions.add("xlam"), this.excelExtensions.add("xlsb"), this.excelExtensions.add("ods"), this.excelExtensions.add("ots"), this.pptExtensions.add("ppt"), this.pptExtensions.add("pot"), this.pptExtensions.add("pps"), this.pptExtensions.add("ppa"), this.pptExtensions.add("pptx"), this.pptExtensions.add("potx"), this.pptExtensions.add("ppsx"), this.pptExtensions.add("ppam"), this.pptExtensions.add("pptm"), this.pptExtensions.add("potm"), this.pptExtensions.add("ppsm"), this.pptExtensions.add("odp"), this.pptExtensions.add("otp"), this.csvExtensions.add("csv"), this.fileExtensionMap.set("doc", "application/msword"), this.fileExtensionMap.set("dot", "application/msword"), this.fileExtensionMap.set("docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"), this.fileExtensionMap.set("dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template"), this.fileExtensionMap.set("docm", "application/vnd.ms-word.document.macroEnabled.12"), this.fileExtensionMap.set("dotm", "application/vnd.ms-word.template.macroEnabled.12"), this.fileExtensionMap.set("xls", "application/vnd.ms-excel"), this.fileExtensionMap.set("xlt", "application/vnd.ms-excel"), this.fileExtensionMap.set("xla", "application/vnd.ms-excel"), this.fileExtensionMap.set("xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"), this.fileExtensionMap.set("xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template"), this.fileExtensionMap.set("xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12"), this.fileExtensionMap.set("xltm", "application/vnd.ms-excel.template.macroEnabled.12"), this.fileExtensionMap.set("xlam", "application/vnd.ms-excel.addin.macroEnabled.12"), this.fileExtensionMap.set("xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12"), this.fileExtensionMap.set("ppt", "application/vnd.ms-powerpoint"), this.fileExtensionMap.set("pot", "application/vnd.ms-powerpoint"), this.fileExtensionMap.set("pps", "application/vnd.ms-powerpoint"), this.fileExtensionMap.set("ppa", "application/vnd.ms-powerpoint"), this.fileExtensionMap.set("pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"), this.fileExtensionMap.set("potx", "application/vnd.openxmlformats-officedocument.presentationml.template"), this.fileExtensionMap.set("ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow"), this.fileExtensionMap.set("ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12"), this.fileExtensionMap.set("pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"), this.fileExtensionMap.set("potm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"), this.fileExtensionMap.set("ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"), this.fileExtensionMap.set("odt", "application/vnd.oasis.opendocument.text"), this.fileExtensionMap.set("ott", "application/vnd.oasis.opendocument.text-template"), this.fileExtensionMap.set("oth", "application/vnd.oasis.opendocument.text-web"), this.fileExtensionMap.set("odm", "application/vnd.oasis.opendocument.text-master"), this.fileExtensionMap.set("odg", "application/vnd.oasis.opendocument.graphics"), this.fileExtensionMap.set("otg", "application/vnd.oasis.opendocument.graphics-template"), this.fileExtensionMap.set("odp", "application/vnd.oasis.opendocument.presentation"), this.fileExtensionMap.set("otp", "application/vnd.oasis.opendocument.presentation-template"), this.fileExtensionMap.set("ods", "application/vnd.oasis.opendocument.spreadsheet"), this.fileExtensionMap.set("ots", "application/vnd.oasis.opendocument.spreadsheet-template"), this.fileExtensionMap.set("odc", "application/vnd.oasis.opendocument.chart"), this.fileExtensionMap.set("odf", "application/vnd.oasis.opendocument.formula"), this.fileExtensionMap.set("odb", "application/vnd.oasis.opendocument.database"), this.fileExtensionMap.set("odi", "application/vnd.oasis.opendocument.image"), this.fileExtensionMap.set("oxt", "application/vnd.openofficeorg.extension"), this.fileExtensionMap.set("txt", "text/plain"), this.fileExtensionMap.set("md", "text/markdown"), this.csvContentType.add("text/comma-separated-values"), this.csvContentType.add("text/csv"), this.csvContentType.add("application/csv");
16
+ }
17
+ getContentTypeForExtension(e) {
18
+ return this.fileExtensionMap.has(e) ? this.fileExtensionMap.get(e) ?? null : null;
19
+ }
20
+ getExtensionForContentType(e) {
21
+ for (let t of Array.from(this.fileExtensionMap.keys())) if ((this.fileExtensionMap.get(t) || "").toLowerCase() == (e || "").toLowerCase()) return t;
22
+ return null;
23
+ }
24
+ isWordLike(e, t) {
25
+ let n = this.getExtensionForContentType(e);
26
+ return n ? this.wordExtensions.has(n) : e == this.OCTET_STREAM && t ? this.wordExtensions.has(t) : !1;
27
+ }
28
+ isExcelLike(e, t) {
29
+ let n = this.getExtensionForContentType(e);
30
+ return n ? this.excelExtensions.has(n) : e == this.OCTET_STREAM && t ? this.excelExtensions.has(t) : !1;
31
+ }
32
+ isCsvLike(e, t) {
33
+ return this.csvContentType.has(e) ? !0 : e == this.OCTET_STREAM && t ? this.csvExtensions.has(t) : !1;
34
+ }
35
+ isPowerpointLike(e, t) {
36
+ let n = this.getExtensionForContentType(e);
37
+ return n ? this.pptExtensions.has(n) : e == this.OCTET_STREAM && t ? this.pptExtensions.has(t) : !1;
38
+ }
39
+ isTxtLike(e, t) {
40
+ let n = this.getExtensionForContentType(e);
41
+ return n ? this.txtExtensions.has(n) : e == this.OCTET_STREAM && t ? this.txtExtensions.has(t) : !1;
42
+ }
43
+ isMdLike(e, t) {
44
+ let n = this.getExtensionForContentType(e);
45
+ return n ? this.mdExtensions.has(n) : e == this.OCTET_STREAM && t ? this.mdExtensions.has(t) : !1;
46
+ }
145
47
  };
48
+ //#endregion
49
+ export { e as MimeTypeUtils };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=()=>{};exports.NOOP=e;
1
+ var e=()=>{};exports.NOOP=e;
package/dist/noop/noop.js CHANGED
@@ -1,5 +1,4 @@
1
- const o = () => {
2
- };
3
- export {
4
- o as NOOP
5
- };
1
+ //#region src/noop/noop.ts
2
+ var e = () => {};
3
+ //#endregion
4
+ export { e as NOOP };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class r{static isLocalURL(t){return t.length>0&&t.charAt(0)==="/"}static startWithHttp(t){return/^https?:\/\//gi.test(t)}static toCounter(t){return t>999?`${Number(t/1e3).toFixed(1)} k`:""+t}static generateVirtualId(){return"xxxx-xxxx-xxx-xxxx".replace(/[x]/g,()=>Math.floor(Math.random()*16).toString(16))}}exports.StringUtils=r;
1
+ var e=class{static isLocalURL(e){return e.length>0&&e.charAt(0)===`/`}static startWithHttp(e){return/^https?:\/\//gi.test(e)}static toCounter(e){return e>999?`${Number(e/1e3).toFixed(1)} k`:``+e}static generateVirtualId(){return`xxxx-xxxx-xxx-xxxx`.replace(/[x]/g,()=>Math.floor(Math.random()*16).toString(16))}};exports.StringUtils=e;
@@ -1,17 +1,17 @@
1
- class s {
2
- static isLocalURL(t) {
3
- return t.length > 0 && t.charAt(0) === "/";
4
- }
5
- static startWithHttp(t) {
6
- return /^https?:\/\//gi.test(t);
7
- }
8
- static toCounter(t) {
9
- return t > 999 ? `${Number(t / 1e3).toFixed(1)} k` : "" + t;
10
- }
11
- static generateVirtualId() {
12
- return "xxxx-xxxx-xxx-xxxx".replace(/[x]/g, () => Math.floor(Math.random() * 16).toString(16));
13
- }
14
- }
15
- export {
16
- s as StringUtils
1
+ //#region src/string-utils/string-utils.ts
2
+ var e = class {
3
+ static isLocalURL(e) {
4
+ return e.length > 0 && e.charAt(0) === "/";
5
+ }
6
+ static startWithHttp(e) {
7
+ return /^https?:\/\//gi.test(e);
8
+ }
9
+ static toCounter(e) {
10
+ return e > 999 ? `${Number(e / 1e3).toFixed(1)} k` : "" + e;
11
+ }
12
+ static generateVirtualId() {
13
+ return "xxxx-xxxx-xxx-xxxx".replace(/[x]/g, () => Math.floor(Math.random() * 16).toString(16));
14
+ }
17
15
  };
16
+ //#endregion
17
+ export { e as StringUtils };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=t=>{if(t>0){let o=Math.floor(t/1e3),e=Math.floor(o/60);return o=o%60,e=e%60,r(e)+":"+r(o)}return"00:00"},r=t=>t.toString().padStart(2,"0");exports.convertMsToMS=n;exports.padTo2Digits=r;
1
+ var e=e=>{if(e>0){let n=Math.floor(e/1e3),r=Math.floor(n/60);return n%=60,r%=60,t(r)+`:`+t(n)}return`00:00`},t=e=>e.toString().padStart(2,`0`);exports.convertMsToMS=e,exports.padTo2Digits=t;
package/dist/time/time.js CHANGED
@@ -1,11 +1,10 @@
1
- const n = (t) => {
2
- if (t > 0) {
3
- let r = Math.floor(t / 1e3), o = Math.floor(r / 60);
4
- return r = r % 60, o = o % 60, e(o) + ":" + e(r);
5
- }
6
- return "00:00";
7
- }, e = (t) => t.toString().padStart(2, "0");
8
- export {
9
- n as convertMsToMS,
10
- e as padTo2Digits
11
- };
1
+ //#region src/time/time.ts
2
+ var e = (e) => {
3
+ if (e > 0) {
4
+ let n = Math.floor(e / 1e3), r = Math.floor(n / 60);
5
+ return n %= 60, r %= 60, t(r) + ":" + t(n);
6
+ }
7
+ return "00:00";
8
+ }, t = (e) => e.toString().padStart(2, "0");
9
+ //#endregion
10
+ export { e as convertMsToMS, t as padTo2Digits };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=()=>MediaRecorder.isTypeSupported?["video/webm;codecs=vp9",'video/mp4; codecs="avc1.424028, mp4a.40.2"',"video/webm;codecs=vp8,opus","video/webm"].find(e=>MediaRecorder.isTypeSupported(e)?!0:(console.error(`${e} is not Supported`),!1))||"video/ogg":"video/webm;codecs=vp8,opus";exports.getBestSupportedMimeType=o;
1
+ var e=()=>MediaRecorder.isTypeSupported?[`video/webm;codecs=vp9`,`video/mp4; codecs="avc1.424028, mp4a.40.2"`,`video/webm;codecs=vp8,opus`,`video/webm`].find(e=>MediaRecorder.isTypeSupported(e)?!0:(console.error(`${e} is not Supported`),!1))||`video/ogg`:`video/webm;codecs=vp8,opus`;exports.getBestSupportedMimeType=e;
@@ -1,9 +1,9 @@
1
- const o = () => MediaRecorder.isTypeSupported ? [
2
- "video/webm;codecs=vp9",
3
- 'video/mp4; codecs="avc1.424028, mp4a.40.2"',
4
- "video/webm;codecs=vp8,opus",
5
- "video/webm"
1
+ //#region src/video/video.ts
2
+ var e = () => MediaRecorder.isTypeSupported ? [
3
+ "video/webm;codecs=vp9",
4
+ "video/mp4; codecs=\"avc1.424028, mp4a.40.2\"",
5
+ "video/webm;codecs=vp8,opus",
6
+ "video/webm"
6
7
  ].find((e) => MediaRecorder.isTypeSupported(e) ? !0 : (console.error(`${e} is not Supported`), !1)) || "video/ogg" : "video/webm;codecs=vp8,opus";
7
- export {
8
- o as getBestSupportedMimeType
9
- };
8
+ //#endregion
9
+ export { e as getBestSupportedMimeType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/utilities",
3
- "version": "2.6.9-develop-b2school.20261013134048",
3
+ "version": "2.6.9-develop-enabling.20261013152718",
4
4
  "description": "Edifice Utilities Package",
5
5
  "keywords": [
6
6
  "utilities",
@@ -35,7 +35,7 @@
35
35
  ],
36
36
  "devDependencies": {
37
37
  "@types/node": "22.19.8",
38
- "vite": "5.4.14",
38
+ "vite": "8.0.14",
39
39
  "vite-plugin-dts": "4.5.4"
40
40
  },
41
41
  "publishConfig": {
@@ -46,6 +46,6 @@
46
46
  "fix": "eslint --fix --report-unused-disable-directives --max-warnings 0",
47
47
  "format": "prettier --check \"src/**/*.ts\"",
48
48
  "format:write": "prettier --write \"src/**/*.ts\"",
49
- "lint": "eslint"
49
+ "lint": "eslint --max-warnings 0"
50
50
  }
51
51
  }