feat: gatherWithLatus
This commit is contained in:
parent
2b2c932580
commit
c9a0a3fff9
|
@ -1,5 +1,14 @@
|
|||
import {basename, extname} from 'path';
|
||||
|
||||
const capitalize = (token) => token.substring(0, 1).toUpperCase() + token.substring(1);
|
||||
|
||||
export const gatherWithLatus = (context) => (latus) => (
|
||||
Object.fromEntries(context.keys().map((path) => [
|
||||
capitalize(basename(path, extname(path))),
|
||||
context(path).default(latus),
|
||||
]))
|
||||
);
|
||||
|
||||
export default (latus, type, idAttribute, typeAttribute, check = () => {}) => {
|
||||
const gathered = latus.invokeReduce(type);
|
||||
check(gathered, type);
|
||||
|
|
|
@ -8,7 +8,7 @@ export {default as ensureUniqueReduction} from './ensure-unique-reduction';
|
|||
export {default as EventEmitter} from './event-emitter';
|
||||
export {deflate, inflate} from './flate';
|
||||
export {compose, fastApply} from './function';
|
||||
export {default as gather} from './gather';
|
||||
export {gatherWithLatus, default as gather} from './gather';
|
||||
export {default as Middleware} from './middleware';
|
||||
export {default as Latus} from './latus';
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user