Fix lint error
This commit is contained in:
parent
6de5d2dc50
commit
e6fe3d1aae
@ -1,5 +1,6 @@
|
||||
{
|
||||
"extends": "airbnb-base",
|
||||
"parser": "babel-eslint",
|
||||
"rules": {
|
||||
"no-underscore-dangle": 0,
|
||||
"linebreak-style": 0,
|
||||
|
2259
package-lock.json
generated
2259
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -54,6 +54,7 @@
|
||||
"@babel/preset-env": "^7.12.1",
|
||||
"@ffmpeg/core": "^0.11.0",
|
||||
"@types/emscripten": "^1.39.4",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"babel-loader": "^8.1.0",
|
||||
"chai": "^4.2.0",
|
||||
"cors": "^2.8.5",
|
||||
|
@ -5,6 +5,6 @@ const { devDependencies } = require('../../package.json');
|
||||
*/
|
||||
const corePath = typeof process !== 'undefined' && process.env.NODE_ENV === 'development'
|
||||
? new URL('/node_modules/@ffmpeg/core/dist/ffmpeg-core.js', import.meta.url).href
|
||||
: `https://unpkg.com/@ffmpeg/core@${devDependencies['@ffmpeg/core'].substring(1)}/dist/ffmpeg-core.js`
|
||||
: `https://unpkg.com/@ffmpeg/core@${devDependencies['@ffmpeg/core'].substring(1)}/dist/ffmpeg-core.js`;
|
||||
|
||||
export {corePath};
|
||||
module.exports = { corePath };
|
||||
|
@ -11,6 +11,7 @@ const readFromBlobOrFile = (blob) => (
|
||||
})
|
||||
);
|
||||
|
||||
// eslint-disable-next-line
|
||||
export const fetchFile = async (_data) => {
|
||||
let data = _data;
|
||||
if (typeof _data === 'undefined') {
|
||||
|
@ -18,8 +18,14 @@ const toBlobURL = async (url, mimeType) => {
|
||||
return blobURL;
|
||||
};
|
||||
|
||||
export const getCreateFFmpegCore = async ({ corePath: _corePath, workerPath: _workerPath, wasmPath: _wasmPath }) => {
|
||||
// eslint-disable-next-line
|
||||
export const getCreateFFmpegCore = async ({
|
||||
corePath: _corePath,
|
||||
workerPath: _workerPath,
|
||||
wasmPath: _wasmPath,
|
||||
}) => {
|
||||
// in Web Worker context
|
||||
// eslint-disable-next-line
|
||||
if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
|
||||
if (typeof _corePath !== 'string') {
|
||||
throw Error('corePath should be a string!');
|
||||
@ -59,7 +65,7 @@ export const getCreateFFmpegCore = async ({ corePath: _corePath, workerPath: _wo
|
||||
wasmPath,
|
||||
workerPath,
|
||||
});
|
||||
} else {
|
||||
}
|
||||
if (typeof _corePath !== 'string') {
|
||||
throw Error('corePath should be a string!');
|
||||
}
|
||||
@ -105,8 +111,4 @@ export const getCreateFFmpegCore = async ({ corePath: _corePath, workerPath: _wo
|
||||
wasmPath,
|
||||
workerPath,
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user