@axium/core 0.4.2 → 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.
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ export declare function forMime(mimeType: string): string;
2
+ export declare function forPath(path: string): string;
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
@@ -1,4 +1,5 @@
1
1
  export * from './api.js';
2
+ export * as icons from './icons.js';
2
3
  export * from './requests.js';
3
4
  export * from './schemas.js';
4
5
  export * from './user.js';
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './api.js';
2
+ export * as icons from './icons.js';
2
3
  export * from './requests.js';
3
4
  export * from './schemas.js';
4
5
  export * from './user.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/core",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "author": "James Prevett <axium@jamespre.dev> (https://jamespre.dev)",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -22,7 +22,8 @@
22
22
  "./*": "./dist/*.js"
23
23
  },
24
24
  "files": [
25
- "dist"
25
+ "dist",
26
+ "data"
26
27
  ],
27
28
  "scripts": {
28
29
  "build": "tsc"
@@ -31,6 +32,7 @@
31
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
  }