forked from daren.hsu/line_push
update
This commit is contained in:
+8
-6
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user