This commit is contained in:
2022-07-18 02:50:52 +00:00
parent befd344ab0
commit 06181b34d6
8569 changed files with 818704 additions and 352705 deletions
+8 -6
View File
@@ -1,6 +1,8 @@
import {LoaderContext, LoaderCallback} from '..';
import type {LoaderContext, LoaderCallback} from '../types';
import {normalizeOptions, getResources, injectResources} from '.';
import {getResources} from './get-resources';
import {injectResources} from './inject-resources';
import {normalizeOptions} from './normalize-options';
export const loadResources = async (ctx: LoaderContext, source: string, callback: LoaderCallback) => {
try {
@@ -8,10 +10,10 @@ export const loadResources = async (ctx: LoaderContext, source: string, callback
const resources = await getResources(ctx, options);
const content = await injectResources(options, source, resources);
const content = await injectResources(ctx, options, source, resources);
return callback(null, content);
} catch (err) {
return callback(err);
callback(null, content);
} catch (err: unknown) {
callback(err as Error);
}
};