fix(core): update
This commit is contained in:
19
ts/index.ts
19
ts/index.ts
@ -1,19 +1,8 @@
|
||||
import * as plugins from './smartmime.plugins';
|
||||
|
||||
export const binaryFileTypes = [
|
||||
'jpg',
|
||||
'png',
|
||||
'pdf'
|
||||
];
|
||||
export const binaryFileTypes = ['jpg', 'png', 'pdf'];
|
||||
|
||||
export const supportedFileTypes = [
|
||||
'json',
|
||||
'html',
|
||||
'svg',
|
||||
'jpg',
|
||||
'ts',
|
||||
'js',
|
||||
];
|
||||
export const supportedFileTypes = ['json', 'html', 'svg', 'jpg', 'ts', 'js'];
|
||||
|
||||
export type TMimeTypes = 'image/jpeg' | 'image/svg+xml' | 'application/json' | 'text/html';
|
||||
|
||||
@ -30,8 +19,8 @@ export const isBinary = (pathArg: string) => {
|
||||
isBinary = pathArg.endsWith(`.${binaryFileType}`);
|
||||
}
|
||||
return isBinary;
|
||||
}
|
||||
};
|
||||
|
||||
export const getEncoding = (pathArg: string) => {
|
||||
return isBinary(pathArg) ? 'binary' : 'utf8';
|
||||
}
|
||||
};
|
||||
|
@ -1,13 +1,9 @@
|
||||
// node native scope
|
||||
import * as path from 'path';
|
||||
|
||||
export {
|
||||
path
|
||||
};
|
||||
export { path };
|
||||
|
||||
// thirdparty scope
|
||||
import mimeTypes from 'mime-types';
|
||||
|
||||
export {
|
||||
mimeTypes
|
||||
};
|
||||
export { mimeTypes };
|
||||
|
Reference in New Issue
Block a user