@axium/core 0.4.1 → 0.4.3
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/data/mime-icons.json +29 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +6 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"application/gzip": "file-zipper",
|
|
3
|
+
"application/json": "brackets-curly",
|
|
4
|
+
"application/octet-stream": "file",
|
|
5
|
+
"application/pdf": "file-invoice",
|
|
6
|
+
"application/pgp-signature": "file-contract",
|
|
7
|
+
"application/vnd.rar": "box-archive",
|
|
8
|
+
"application/x-7z-compressed": "file-zipper",
|
|
9
|
+
"application/x-bzip": "file-zipper",
|
|
10
|
+
"application/x-bzip2": "file-zipper",
|
|
11
|
+
"application/x-sh": "square-terminal",
|
|
12
|
+
"application/x-tar": "box-archive",
|
|
13
|
+
"application/x-xz": "file-zipper",
|
|
14
|
+
"application/xml": "code",
|
|
15
|
+
"application/zip": "file-zipper",
|
|
16
|
+
"audio": "waveform-lines",
|
|
17
|
+
"image": "image",
|
|
18
|
+
"image/gif": "gif",
|
|
19
|
+
"image/svg+xml": "file-svg",
|
|
20
|
+
"image/vnd.microsoft.icon": "icons",
|
|
21
|
+
"text/css": "css",
|
|
22
|
+
"text/csv": "file-csv",
|
|
23
|
+
"text/html": "code",
|
|
24
|
+
"text/javascript": "brands/square-js",
|
|
25
|
+
"application/x-javascript": "brands/square-js",
|
|
26
|
+
"text/plain": "file-lines",
|
|
27
|
+
"text/xml": "code",
|
|
28
|
+
"video": "clapperboard-play"
|
|
29
|
+
}
|
package/dist/icons.d.ts
ADDED
package/dist/icons.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import mime from 'mime';
|
|
2
|
+
import icons from '../data/mime-icons.json' with { type: 'json' };
|
|
3
|
+
export function forMime(mimeType) {
|
|
4
|
+
if (mimeType in icons)
|
|
5
|
+
return icons[mimeType];
|
|
6
|
+
const [prefix] = mimeType.split('/');
|
|
7
|
+
if (prefix in icons)
|
|
8
|
+
return icons[prefix];
|
|
9
|
+
return 'file';
|
|
10
|
+
}
|
|
11
|
+
export function forPath(path) {
|
|
12
|
+
const type = mime.getType(path) || 'application/octet-stream';
|
|
13
|
+
return forMime(type);
|
|
14
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axium/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"author": "James Prevett <axium@jamespre.dev> (https://jamespre.dev)",
|
|
5
5
|
"funding": {
|
|
6
6
|
"type": "individual",
|
|
@@ -22,15 +22,17 @@
|
|
|
22
22
|
"./*": "./dist/*.js"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
|
-
"dist"
|
|
25
|
+
"dist",
|
|
26
|
+
"data"
|
|
26
27
|
],
|
|
27
28
|
"scripts": {
|
|
28
29
|
"build": "tsc"
|
|
29
30
|
},
|
|
30
31
|
"peerDependencies": {
|
|
31
|
-
"zod": "^3.25.
|
|
32
|
+
"zod": "^3.25.76"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"@simplewebauthn/types": "^12.0.0"
|
|
35
|
+
"@simplewebauthn/types": "^12.0.0",
|
|
36
|
+
"mime": "^4.0.7"
|
|
35
37
|
}
|
|
36
38
|
}
|