Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const getAugmentationsByEntitiesList = (EntitiesList) => new Promise((resolve,reject) => {
- Promise.all(
- EntitiesList
- .filter(Entity=>Object.keys(AugmentationsByEntityType).includes(Entity.type)&&AugmentationsByEntityType[Entity.type].length)
- .map(Entity => {
- AugmentationsByEntityType[Entity.type].map(
- AugmenterFunc=> {
- AugmenterFunc(Entity.data).then((data)=> {
- resolve({
- entity: Entity.name,
- type: Entity.type,
- Details: Entity.data,
- Augmenters: data
- });
- });
- }
- )
- })
- .filter(hasPromise=>hasPromise)
- )
- .then(resolve)
- .catch(reject);
- });
Add Comment
Please, Sign In to add comment