New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nova_ecs

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nova_ecs - npm Package Compare versions

Comparing version 0.1.9 to 0.1.10

8

arg_types.d.ts

@@ -7,2 +7,3 @@ /// <amd-module name="nova_ecs/arg_types" />

import { EntityMap } from "./entity_map";
import { EcsEvent, EventData } from "./events";
import { Modifier, ModifierResult } from "./modifier";

@@ -22,5 +23,8 @@ import { Query } from "./query";

export declare type GetArgSelector<T> = T extends typeof GetArg ? GetArgFunction : never;
export declare type ArgTypes = Component<any, any, any, any> | Query | Resource<any, any, any, any> | typeof Entities | typeof Components | typeof UUID | typeof GetEntity | typeof GetArg | Modifier<readonly ArgTypes[], any>;
export declare const Emit: unique symbol;
export declare type EmitFunction = <Data>(event: EcsEvent<Data, any>, data: Data, entities?: Set<string>) => void;
export declare type EmitSelector<T> = T extends typeof Emit ? EmitFunction : never;
export declare type ArgTypes = Component<any, any, any, any> | Query | Resource<any, any, any, any> | EcsEvent<any, any> | typeof Entities | typeof Components | typeof UUID | typeof GetEntity | typeof GetArg | typeof Emit | Modifier<readonly ArgTypes[], any>;
declare type AllowUndefined<T> = T extends undefined ? T : never;
export declare type ArgData<T> = Draft<ComponentData<T> | ResourceData<T>> | EntitiesObject<T> | ComponentsObject<T> | UUIDData<T> | GetEntityObject<T> | GetArgSelector<T> | ModifierResult<T> | AllowUndefined<T> | QueryResults<T>;
export declare type ArgData<T> = Draft<ComponentData<T> | ResourceData<T>> | QueryResults<T> | EventData<T> | EntitiesObject<T> | ComponentsObject<T> | UUIDData<T> | GetEntityObject<T> | GetArgSelector<T> | EmitSelector<T> | ModifierResult<T> | AllowUndefined<T>;
export declare type ArgsToData<Args> = {

@@ -27,0 +31,0 @@ [K in keyof Args]: ArgData<Args[K]>;

@@ -12,9 +12,10 @@ (function (factory) {

Object.defineProperty(exports, "__esModule", { value: true });
exports.GetArg = exports.GetEntity = exports.UUID = exports.Components = exports.Entities = void 0;
exports.Entities = Symbol();
exports.Components = Symbol();
exports.UUID = Symbol();
exports.GetEntity = Symbol();
exports.GetArg = Symbol();
exports.Emit = exports.GetArg = exports.GetEntity = exports.UUID = exports.Components = exports.Entities = void 0;
exports.Entities = Symbol('Entities');
exports.Components = Symbol('Components');
exports.UUID = Symbol('UUID');
exports.GetEntity = Symbol('Get Entity');
exports.GetArg = Symbol('Get Arg');
exports.Emit = Symbol('Emit');
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJnX3R5cGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vbm92YV9lY3MvYXJnX3R5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztJQVNhLFFBQUEsUUFBUSxHQUFHLE1BQU0sRUFBRSxDQUFDO0lBR3BCLFFBQUEsVUFBVSxHQUFHLE1BQU0sRUFBRSxDQUFDO0lBSXRCLFFBQUEsSUFBSSxHQUFHLE1BQU0sRUFBRSxDQUFDO0lBR2hCLFFBQUEsU0FBUyxHQUFHLE1BQU0sRUFBRSxDQUFDO0lBR3JCLFFBQUEsTUFBTSxHQUFHLE1BQU0sRUFBRSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgRWl0aGVyIH0gZnJvbSBcImZwLXRzL2xpYi9FaXRoZXJcIjtcbmltcG9ydCB7IERyYWZ0IH0gZnJvbSBcImltbWVyXCI7XG5pbXBvcnQgeyBDb21wb25lbnQsIENvbXBvbmVudERhdGEsIFVua25vd25Db21wb25lbnQgfSBmcm9tIFwiLi9jb21wb25lbnRcIjtcbmltcG9ydCB7IEVudGl0eSB9IGZyb20gXCIuL2VudGl0eVwiO1xuaW1wb3J0IHsgRW50aXR5TWFwIH0gZnJvbSBcIi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TW9kaWZpZXI8cmVhZG9ubHkgQXJnVHlwZXNbXSwgYW55PjtcblxudHlwZSBBbGxvd1VuZGVmaW5lZDxUPiA9IFQgZXh0ZW5kcyB1bmRlZmluZWQgPyBUIDogbmV2ZXI7XG5cbmV4cG9ydCB0eXBlIEFyZ0RhdGE8VD4gPVxuICAgIERyYWZ0PENvbXBvbmVudERhdGE8VD4gfCBSZXNvdXJjZURhdGE8VD4+XG4gICAgfCBRdWVyeVJlc3VsdHM8VD5cbiAgICB8IEV2ZW50RGF0YTxUPlxuICAgIHwgRW50aXRpZXNPYmplY3Q8VD5cbiAgICB8IENvbXBvbmVudHNPYmplY3Q8VD5cbiAgICB8IFVVSUREYXRhPFQ+XG4gICAgfCBHZXRFbnRpdHlPYmplY3Q8VD5cbiAgICB8IEdldEFyZ1NlbGVjdG9yPFQ+XG4gICAgfCBFbWl0U2VsZWN0b3I8VD5cbiAgICB8IE1vZGlmaWVyUmVzdWx0PFQ+XG4gICAgfCBBbGxvd1VuZGVmaW5lZDxUPjtcblxuXG5leHBvcnQgdHlwZSBBcmdzVG9EYXRhPEFyZ3M+ID0ge1xuICAgIFtLIGluIGtleW9mIEFyZ3NdOiBBcmdEYXRhPEFyZ3NbS10+XG59XG5cbmV4cG9ydCB0eXBlIFF1ZXJ5UmVzdWx0czxRPiA9XG4gICAgUSBleHRlbmRzIFF1ZXJ5PGluZmVyIFF1ZXJ5QXJncz4gPyBBcmdzVG9EYXRhPFF1ZXJ5QXJncz5bXSA6IG5ldmVyO1xuIl19
/// <amd-module name="nova_ecs/events" />
export declare const StepEvent: unique symbol;
export declare const DeleteEvent: unique symbol;
import * as t from 'io-ts';
export declare class EcsEvent<Data, DataSerialized = Data> {
private readonly eventSymbol;
readonly name?: string;
readonly type?: t.Type<Data, DataSerialized>;
constructor(args?: {
name?: string;
type?: t.Type<Data, DataSerialized>;
});
}
export declare const StepEvent: EcsEvent<undefined, undefined>;
export declare const DeleteEvent: EcsEvent<undefined, undefined>;
export declare type EventData<E> = E extends EcsEvent<infer Data, any> ? Data : never;
export declare type UnknownEvent = EcsEvent<unknown, unknown>;

@@ -12,6 +12,17 @@ (function (factory) {

Object.defineProperty(exports, "__esModule", { value: true });
exports.DeleteEvent = exports.StepEvent = void 0;
exports.StepEvent = Symbol('step');
exports.DeleteEvent = Symbol('delete');
exports.DeleteEvent = exports.StepEvent = exports.EcsEvent = void 0;
const eventSymbol = Symbol('Event');
class EcsEvent {
constructor(args) {
// Necessary so Query does not extend EcsEvent, which ruins the arg
// type system.
this.eventSymbol = eventSymbol;
this.name = args?.name;
this.type = args?.type;
}
}
exports.EcsEvent = EcsEvent;
exports.StepEvent = new EcsEvent({ name: 'step' });
exports.DeleteEvent = new EcsEvent({ name: 'delete' });
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vbm92YV9lY3MvZXZlbnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztJQUFhLFFBQUEsU0FBUyxHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQztJQUMzQixRQUFBLFdBQVcsR0FBRyxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgU3RlcEV2ZW50ID0gU3ltYm9sKCdzdGVwJyk7XG5leHBvcnQgY29uc3QgRGVsZXRlRXZlbnQgPSBTeW1ib2woJ2RlbGV0ZScpO1xuXG4iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vbm92YV9lY3MvZXZlbnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs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nLCB0eXBlPzogdC5UeXBlPERhdGEsIERhdGFTZXJpYWxpemVkPiB9KSB7XG4gICAgICAgIHRoaXMubmFtZSA9IGFyZ3M/Lm5hbWU7XG4gICAgICAgIHRoaXMudHlwZSA9IGFyZ3M/LnR5cGU7XG4gICAgfVxufVxuXG5leHBvcnQgY29uc3QgU3RlcEV2ZW50ID0gbmV3IEVjc0V2ZW50PHVuZGVmaW5lZD4oeyBuYW1lOiAnc3RlcCcgfSk7XG5leHBvcnQgY29uc3QgRGVsZXRlRXZlbnQgPSBuZXcgRWNzRXZlbnQ8dW5kZWZpbmVkPih7IG5hbWU6ICdkZWxldGUnIH0pO1xuXG5leHBvcnQgdHlwZSBFdmVudERhdGE8RT4gPSBFIGV4dGVuZHMgRWNzRXZlbnQ8aW5mZXIgRGF0YSwgYW55PiA/IERhdGEgOiBuZXZlcjtcblxuZXhwb3J0IHR5cGUgVW5rbm93bkV2ZW50ID0gRWNzRXZlbnQ8dW5rbm93biwgdW5rbm93bj47XG5cbiJdfQ==
{
"name": "nova_ecs",
"version": "0.1.9",
"version": "0.1.10",
"description": "The Entity Component System for NovaJS",

@@ -5,0 +5,0 @@ "repository": "https://github.com/mattsoulanille/NovaJS",

@@ -13,2 +13,3 @@ /// <amd-module name="nova_ecs/query" />

readonly name?: string | undefined;
private readonly querySymbol;
readonly components: ReadonlySet<UnknownComponent>;

@@ -15,0 +16,0 @@ readonly resources: ReadonlySet<UnknownResource>;

@@ -17,6 +17,3 @@ (function (factory) {

const utils_1 = require("nova_ecs/utils");
// type ComponentsOnly<T extends readonly [...unknown[]]> =
// Exclude<Extract<T[number], Component<any, any, any, any>>, Resource<any, any, any, any>>;
// type ResourcesOnly<T extends readonly [...unknown[]]> =
// Extract<T[number], Resource<any, any, any, any>>;
const querySymbol = Symbol('Query');
/**

@@ -30,2 +27,4 @@ * A query provides a way of iterating over all the Entities that have

this.name = name;
// Prevent query from being a subtype of EcsEvent
this.querySymbol = querySymbol;
const modifiers = args.filter(arg => ar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bnQ+O1xuICAgIHJlYWRvbmx5IHJlc291cmNlczogUmVhZG9ubHlTZXQ8VW5rbm93blJlc291cmNlPjtcblxuICAgIGNvbnN0cnVjdG9yKHJlYWRvbmx5IGFyZ3M6IFF1ZXJ5QXJncywgcmVhZG9ubHkgbmFtZT86IHN0cmluZykge1xuICAgICAgICBjb25zdCBtb2RpZmllcnMgPSBhcmdzLmZpbHRlcihhcmcgPT4gYXJnIGluc3RhbmNlb2YgTW9kaWZpZXIpIGFzIFVua25vd25Nb2RpZmllcltdO1xuICAgICAgICBjb25zdCBtb2RpZmllckNvbXBvbmVudHMgPSBtb2RpZmllcnNcbiAgICAgICAgICAgIC5tYXAobW9kaWZpZXIgPT4gbW9kaWZpZXIucXVlcnkuY29tcG9uZW50cylcbiAgICAgICAgICAgIC5yZWR1Y2UoKGEsIGIpID0+IG5ldyBTZXQoWy4uLmEsIC4uLmJdKSwgbmV3IFNldCgpKTtcblxuICAgICAgICBjb25zdCBtb2RpZmllclJlc291cmNlcyA9IG1vZGlmaWVyc1xuICAgICAgICAgICAgLm1hcChtb2RpZmllciA9PiBtb2RpZmllci5xdWVyeS5yZXNvdXJjZXMpXG4gICAgICAgICAgICAucmVkdWNlKChhLCBiKSA9PiBuZXcgU2V0KFsuLi5hLCAuLi5iXSksIG5ldyBTZXQoKSk7XG5cblxuICAgICAgICB0aGlzLmNvbXBvbmVudHMgPSBuZXcgU2V0KFsuLi4odGhpcy5hcmdzLmZpbHRlcihcbiAgICAgICAgICAgIGEgPT4gKGEgaW5zdGFuY2VvZiBDb21wb25lbnQpXG4gICAgICAgICAgICAgICAgJiYgIShhIGluc3RhbmNlb2YgUmVzb3VyY2UpKSBhcyBVbmtub3duQ29tcG9uZW50W10pLFxuICAgICAgICAuLi5tb2RpZmllckNvbXBvbmVudHNdKTtcblxuICAgICAgICB0aGlzLnJlc291cmNlcyA9IG5ldyBTZXQoWy4uLih0aGlzLmFyZ3MuZmlsdGVyKFxuICAgICAgICAgICAgYSA9PiA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ICAgICAgICAgICAgICYmICEoYSBpbnN0YW5jZW9mIFJlc291cmNlKSkgYXMgVW5rbm93bkNvbXBvbmVudFtdKSxcbiAgICAgICAgLi4ubW9kaWZpZXJDb21wb25lbnRzXSk7XG5cbiAgICAgICAgdGhpcy5yZXNvdXJjZXMgPSBuZXcgU2V0KFsuLi4odGhpcy5hcmdzLmZpbHRlcihcbiAgICAgICAgICAgIGEgPT4gKGEgaW5zdGFuY2VvZiBSZXNvdXJjZSkpIGFzIFVua25vd25SZXNvdXJjZVtdKSxcbiAgICAgICAgLi4ubW9kaWZpZXJSZXNvdXJjZXNdKTtcbiAgICB9XG5cbiAgICBzdXBwb3J0c0VudGl0eShlbnRpdHk6IFdpdGhDb21wb25lbnRzKSB7XG4gICAgICAgIHJldHVybiBzdWJzZXQodGhpcy5jb21wb25lbnRzLCBuZXcgU2V0KGVudGl0eS5jb21wb25lbnRzLmtleXMoKSkpO1xuICAgIH1cblxuICAgIHRvU3RyaW5nKCkge1xuICAgICAgICByZXR1cm4gYFF1ZXJ5KCR7dGhpcy5uYW1lID8/ICd1bm5hbWVkJ30pYDtcbiAgICB9XG59XG4iXX0=
/// <amd-module name="nova_ecs/system" />
import { ArgsToData, ArgTypes } from "./arg_types";
import { EcsEvent, UnknownEvent } from "./events";
import { Query } from "./query";

@@ -9,3 +10,3 @@ export interface BaseSystemArgs<StepArgTypes extends readonly ArgTypes[]> {

readonly after?: Iterable<System | string>;
readonly event?: Symbol;
readonly events?: Iterable<EcsEvent<any, any>>;
}

@@ -21,6 +22,6 @@ export interface SystemArgs<StepArgTypes extends readonly ArgTypes[]> extends BaseSystemArgs<StepArgTypes> {

readonly after: ReadonlySet<System | string>;
readonly event: Symbol;
readonly events: Set<UnknownEvent>;
readonly query: Query<StepArgTypes>;
constructor({ name, args, step, before, after, event }: SystemArgs<StepArgTypes>);
constructor({ name, args, step, before, after, events }: SystemArgs<StepArgTypes>);
toString(): string;
}

@@ -16,3 +16,3 @@ (function (factory) {

class System {
constructor({ name, args, step, before, after, event }) {
constructor({ name, args, step, before, after, events }) {
this.name = name;

@@ -23,3 +23,3 @@ this.args = args;

this.after = new Set([...after ?? []]);
this.event = event ?? events_1.StepEvent;
this.events = new Set([...events ?? [events_1.StepEvent]]);
this.query = new query_1.Query(args);

@@ -33,2 +33,2 @@ }

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3lzdGVtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vbm92YV9lY3Mvc3lzdGVtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztJQUNBLDRDQUFxQztJQUNyQywwQ0FBZ0M7SUFjaEMsTUFBYSxNQUFNO1FBU2YsWUFBWSxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsSUFBSSxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsS0FBSyxFQUE0QjtZQUM1RSxJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztZQUNqQixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztZQUNqQixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztZQUNqQixJQUFJLENBQUMsTUFBTSxHQUFHLElBQUksR0FBRyxDQUFDLENBQUMsR0FBRyxNQUFNLElBQUksRUFBRSxDQUFDLENBQUMsQ0FBQztZQUN6QyxJQUFJLENBQUMsS0FBSyxHQUFHLElBQUksR0FBRyxDQUFDLENBQUMsR0FBRyxLQUFLLElBQUksRUFBRSxDQUFDLENBQUMsQ0FBQztZQUN2QyxJQUFJLENBQUMsS0FBSyxHQUFHLEtBQUssSUFBSSxrQkFBUyxDQUFDO1lBQ2hDLElBQUksQ0FBQyxLQUFLLEdBQUcsSUFBSSxhQUFLLENBQUMsSUFBSSxDQUFDLENBQUM7UUFDakMsQ0FBQztRQUVELFFBQVE7WUFDSixPQUFPLFVBQVUsSUFB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2ZW50XV0pIGFzIFNldDxVbmtub3duRXZlbnQ+O1xuICAgICAgICB0aGlzLnF1ZXJ5ID0gbmV3IFF1ZXJ5KGFyZ3MpO1xuICAgIH1cblxuICAgIHRvU3RyaW5nKCkge1xuICAgICAgICByZXR1cm4gYFN5c3RlbSgke3RoaXMubmFtZSA/PyB0aGlzLmFyZ3MubWFwKGEgPT4gYS50b1N0cmluZygpKX0pYDtcbiAgICB9XG59XG4iXX0=

@@ -6,2 +6,3 @@ /// <amd-module name="nova_ecs/world" />

import { EntityMapHandle } from "./entity_map";
import { EcsEvent } from "./events";
import { EventMap } from "./event_map";

@@ -27,3 +28,6 @@ import { Plugin } from './plugin';

private eventQueue;
private boundEmit;
constructor(name?: string | undefined);
emit<Data>(event: EcsEvent<Data, any>, data: Data, entities?: Set<string>): void;
private emitWrapped;
addPlugin(plugin: Plugin): void;

@@ -30,0 +34,0 @@ private callWithNewDraft;

@@ -91,2 +91,3 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {

this.eventQueue = [];
this.boundEmit = this.emit.bind(this);
this.addPlugin(async_system_1.AsyncSystemPlugin);

@@ -109,2 +110,3 @@ this.entities.set('singleton', {

event: events_1.DeleteEvent,
data: undefined,
entities: currentDeleted,

@@ -114,2 +116,12 @@ });

}
emit(event, data, entities) {
this.emitWrapped(event, data, entities);
}
emitWrapped(event, data, entities) {
this.eventQueue.push({
event: event,
data,
entities
});
}
addPlugin(plugin) {

@@ -207,10 +219,10 @@ // TODO: Namespace component and system names. Perhaps use ':' or '/' to

}
runEvent(draft, ecsEvent) {
runEvent(draft, eventWithEntities) {
// TODO: Cache this probably.
const systems = this.systems.filter(s => s.event === ecsEvent.event);
const systems = this.systems.filter(s => s.events.has(eventWithEntities.event));
// Default to all entities if none are specified. When defaulting to all,
// this includes entities added in the same step.
let entities;
if (ecsEvent.entities) {
entities = [...ecsEvent.entities].map(entry => {
if (eventWithEntities.entities) {
entities = [...eventWithEntities.entities].map(entry => {
if (typeof entry === 'string') {

@@ -224,4 +236,5 @@ return [entry, draft.entities.get(entry)];

}
const eventTuple = [eventWithEntities.event, eventWithEntities.data];
for (const system of systems) {
const argList = this.fulfillQuery(system.query, draft, entities);
const argList = this.fulfillQuery(system.query, draft, entities, eventTuple);
for (const args of argList) {

@@ -236,2 +249,3 @@ system.step(...args);

event: events_1.StepEvent,
data: undefined,
});

@@ -241,3 +255,3 @@ this.flush(draft);

}
getArg(arg, draft, entity, uuid) {
getArg(arg, draft, entity, uuid, event) {
if (arg instanceof resource_1.Resource) {

@@ -273,2 +287,5 @@ if (draft.resources.has(arg)) {

}
else if (arg === arg_types_1.Emit) {
return Either_1.right(this.boundEmit);
}
else if (arg === arg_types_1.GetArg) {

@@ -278,2 +295,12 @@ // TODO: Why don't these types work?

}
else if (arg instanceof events_1.EcsEvent) {
if (!event) {
return Either_1.left(undefined);
}
const [ecsEvent, data] = event;
if (ecsEvent === arg) {
return Either_1.right(data);
}
return Either_1.left(undefined);
}
else if (arg instanceof modifier_1.Modifier) {

@@ -291,10 +318,10 @@ const modifier = arg;

}
fulfillQuery(query, draft, entities = draft.entities) {
fulfillQuery(query, draft, entities = draft.entities, event) {
const supportedEntities = [...entities].filter(([, entity]) => query.supportsEntity(entity));
return supportedEntities.map(([uuid, entity]) => this.fulfillQueryForEntity(entity, uuid, query, draft))
return supportedEntities.map(([uuid, entity]) => this.fulfillQueryForEntity(entity, uuid, query, draft, event))
.filter((results) => Either_1.isRight(results))
.map(rightResults => rightResults.right);
}
fulfillQueryForEntity(entity, uuid, query, draft) {
const results = query.args.map(arg => this.getArg(arg, draft, entity, uuid));
fulfillQueryForEntity(entity, uuid, query, draft, event) {
const results = query.args.map(arg => this.getArg(arg, draft, entity, uuid, event));
const rightResults = [];

@@ -315,2 +342,2 @@ for (const result of results) {

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ybGQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6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aXRpZXMpIHtcbiAgICAgICAgICAgIGVudGl0aWVzID0gWy4uLmVjc0V2ZW50LmVudGl0aWVzXS5tYXAoZW50cnkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZW50cnkgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbZW50cnksIGRyYWZ0LmVudGl0aWVzLmdldChlbnRyeSldO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBlbnRyeTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KS5maWx0ZXIoKGVudHJ5KTogZW50cnkgaXMgW3N0cmluZywgRHJhZnQ8RW50aXR5Pl0gPT4gQm9vbGVhbihlbnRyeVsxXSkpO1xuICAgICAgICB9XG5cbiAgICAgICAgZm9yIChjb25zdCBzeXN0ZW0gb2Ygc3lzdGVtcykge1xuICAgICAgICAgICAgY29uc3QgYXJnTGlzdCA9IHRoaXMuZnVsZmlsbFF1ZXJ5KHN5c3RlbS5xdWVyeSwgZHJhZnQsIGVudGl0aWVzKTtcbiAgICAgICAgICAgIGZvciAoY29uc3QgYXJncyBvZiBhcmdMaXN0KSB7XG4gICAgICAgICAgICAgICAgc3lzdGVtLnN0ZXAoLi4uYXJncyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBzdGVwKCkge1xuICAgICAgICB0aGlzLnN0YXRlID0gcHJvZHVjZSh0aGlzLnN0YXRlLCBkcmFmdCA9PiB7XG4gICAgICAgICAgICB0aGlzLmV2ZW50UXVldWUucHVzaCh7XG4gICAgICAgICAgICAgICAgZXZlbnQ6IFN0ZXBFdmVudCxcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICB0aGlzLmZsdXNoKGRyYWZ0KTtcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgcHJpdmF0ZSBnZXRBcmc8VCBleHRlbmRzIEFyZ1R5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IGlzUmlnaHQocmVzdWx0cykpXG4gICAgICAgICAgICAubWFwKHJpZ2h0UmVzdWx0cyA9PiByaWdodFJlc3VsdHMucmlnaHQpO1xuICAgIH1cblxuICAgIHByaXZhdGUgZnVsZmlsbFF1ZXJ5Rm9yRW50aXR5PEMgZXh0ZW5kcyByZWFkb25seSBBcmdUeXBlc1tdPihcbiAgICAgICAgZW50aXR5OiBEcmFmdDxFbnRpdHk+LCB1dWlkOiBzdHJpbmcsIHF1ZXJ5OiBRdWVyeTxDPiwgZHJhZnQ6IERyYWZ0PFN0YXRlPik6XG4gICAgICAgIEVpdGhlcjx1bmRlZmluZWQsIEFyZ3NUb0RhdGE8Qz4+IHtcblxuICAgICAgICBjb25zdCByZXN1bHRzID0gcXVlcnkuYXJncy5tYXAoYXJnID0+IHRoaXMuZ2V0QXJnKGFyZywgZHJhZnQsIGVudGl0eSwgdXVpZCkpO1xuICAgICAgICBjb25zdCByaWdodFJlc3VsdHM6IHVua25vd25bXSA9IFtdO1xuICAgICAgICBmb3IgKGNvbnN0IHJlc3VsdCBvZiByZXN1bHRzKSB7XG4gICAgICAgICAgICBpZiAoaXNMZWZ0KHJlc3VsdCkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCh1bmRlZmluZWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmlnaHRSZXN1bHRzLnB1c2gocmVzdWx0LnJpZ2h0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmlnaHQocmlnaHRSZXN1bHRzIGFzIHVua25vd24gYXMgQXJnc1RvRGF0YTxDPik7XG4gICAgfVxuXG4gICAgdG9TdHJpbmcoKSB7XG4gICAgICAgIHJldHVybiBgV29ybGQoJHt0aGlzLm5hbWUgPz8gJ3VubmFtZWQnfSlgO1xuICAgIH1cbn1cbiJdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ybGQuanMiLCJzb3VyY2VSb290IjoiIiwic291cm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AgICAgICAgICAgIC5ldmVudHMuZGVsZXRlLnN1YnNjcmliZShkZWxldGVkID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBjdXJyZW50RGVsZXRlZCA9IG5ldyBTZXQoWy4uLmRlbGV0ZWRdXG4gICAgICAgICAgICAgICAgICAgIC5tYXAoKFt1dWlkLCBlbnRpdHldKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gW3V1aWQsIGN1cnJlbnRJZkRyYWZ0KGVudGl0eSldO1xuICAgICAgICAgICAgICAgICAgICB9KSkgYXMgTm9uTnVsbGFibGU8RWNzRXZlbnRXaXRoRW50aXRpZXM8dW5rbm93bj5bJ2VudGl0aWVzJ10+O1xuXG4gICAgICAgICAgICAgICAgdGhpcy5ldmVudFF1ZXVlLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBldmVudDogRGVsZXRlRXZlbnQgYXMgVW5rbm93bkV2ZW50LFxuICAgICAgICAgICAgICAgICAgICBkYXRhOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIGVudGl0aWVzOiBjdXJyZW50RGVsZXRlZCxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgIH1cblxuICAgIGVtaXQ8RGF0YT4oZXZlbnQ6IEVjc0V2ZW50PERhdGEsIGFueT4sIGRhdGE6IERhdGEsIGVudGl0aWVzPzogU2V0PHN0cmluZz4pIHtcbiAgICAgICAgdGhpcy5lbWl0V3JhcHBlZChldmVudCwgZGF0YSwgZW50aXRpZXMpO1xuICAgIH1cblxuICAgIHByaXZhdGUgZW1pdFdyYXBwZWQ8RGF0YT4oZXZlbnQ6IEVjc0V2ZW50PERhdGEsIGFueT4sIGRhdGE6IERhdGEsXG4gICAgICAgIGVudGl0aWVzPzogU2V0PHN0cmluZz4gfCBTZXQ8W3N0cmluZywgRW50aXR5XT4pIHtcbiAgICAgICAgdGhpcy5ldmVudFF1ZXVlLnB1c2goe1xuICAgICAgICAgICAg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ICAgICAgICAgICAgLy8gc3lzdGVtIGluIHRoZSBncmFwaC5cbiAgICAgICAgICAgIGZvciAoY29uc3QgYmVmb3JlIG9mIHN5c3RlbS5iZWZvcmUpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBiZWZvcmVTeXN0ZW0gPSBzeXN0ZW1NYXAuZ2V0KGJlZm9yZSk7XG4gICAgICAgICAgICAgICAgaWYgKGJlZm9yZVN5c3RlbSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBpbmNvbWluZ0JlZm9yZUVkZ2VzID0gZ3JhcGguZ2V0KGJlZm9yZVN5c3RlbSk7XG4gICAgICAgICAgICAgICAgICAgIGluY29taW5nQmVmb3JlRWRnZXM/LmFkZChzeXN0ZW0pXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBUaGlzIHN5c3RlbSBoYXMgaW5jb21pbmcgZWRnZXMgZnJvbSB0aGUgc3lzdGVtcyB0aGF0IGl0IHJ1bnMgYWZ0ZXIuXG4gICAgICAgICAgICBmb3IgKGNvbnN0IGFmdGVyIG9mIHN5c3RlbS5hZnRlcikge1xuICAgICAgICAgICAgICAgIGNvbnN0IGFmdGVyU3lzdGVtID0gc3lzdGVtTWFwLmdldChhZnRlcik7XG4gICAgICAgICAgICAgICAgaWYgKGFmdGVyU3lzdGVtKSB7XG4gICAgICAgICAgICAgICAgICAgIGluY29taW5nRWRnZXMuYWRkKGFmdGVyU3lzdGVtKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBUb3BvbG9naWNhbGx5IHNvcnQgdGhlIGdyYXBoXG4gICAgICAgIHRoaXMuc3lzdGVtcyA9IHRvcG9sb2dpY2FsU29ydChncmFwaCk7XG5cbiAgICAgICAgdGhpcy5uYW1lU3lzdGVtTWFwLnNldChzeXN0ZW0ubmFtZSwgc3lzdGVtKTtcbiAgICAgICAgZm9yIChjb25zdCBjb21wb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G4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBlbnRyeSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtlbnRyeSwgZHJhZnQuZW50aXRpZXMuZ2V0KGVudHJ5KV07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVudHJ5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pLmZpbHRlcigoZW50cnkpOiBlbnRyeSBpcyBbc3RyaW5nLCBEcmFmdDxFbnRpdHk+XSA9PiBCb29sZWFuKGVudHJ5WzFdKSk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBldmVudFR1cGxlID0gW2V2ZW50V2l0aEVudGl0aWVzLmV2ZW50LCBldmVudFdpdGhFbnRpdGllcy5kYXRhXSBhcyBjb25zdDtcbiAgICAgICAgZm9yIChjb25zdCBzeXN0ZW0gb2Ygc3lzdGVtcykge1xuICAgICAgICAgICAgY29uc3QgYXJnTGlzdCA9IHRoaXMuZnVsZmlsbFF1ZXJ5KHN5c3RlbS5xdWVyeSwgZHJhZnQsIGVudGl0aWVzLCBldmVudFR1cGxlKTtcbiAgICAgICAgICAgIGZvciAoY29uc3QgYXJncyBvZiBhcmdMaXN0KSB7XG4gICAgICAgICAgICAgICAgc3lzdGVtLnN0ZXAoLi4uYXJncyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBzdGVwKCkge1xuICAgICAgICB0aGlzLnN0YXRlID0gcHJvZHVjZSh0aGlzLnN0YXRlLCBkcmFmdCA9PiB7XG4gICAgICAgICAgICB0aGlzLmV2ZW50UXVldWUucHVzaCh7XG4gICAgICAgICAgICAgICAgZXZlbnQ6IFN0ZXBFdmVudCBhcyBVbmtub3duRXZlbnQsXG4gICAgICAgICAgICAgICAgZGF0YTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgIC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iBEcmFmdDxTdGF0ZT4sXG4gICAgICAgIGV2ZW50PzogcmVhZG9ubHkgW0Vjc0V2ZW50PHVua25vd24+LCB1bmtub3duXSk6XG4gICAgICAgIEVpdGhlcjx1bmRlZmluZWQsIEFyZ3NUb0RhdGE8Qz4+IHtcblxuICAgICAgICBjb25zdCByZXN1bHRzID0gcXVlcnkuYXJncy5tYXAoYXJnID0+IHRoaXMuZ2V0QXJnKGFyZywgZHJhZnQsIGVudGl0eSwgdXVpZCwgZXZlbnQpKTtcbiAgICAgICAgY29uc3QgcmlnaHRSZXN1bHRzOiB1bmtub3duW10gPSBbXTtcbiAgICAgICAgZm9yIChjb25zdCByZXN1bHQgb2YgcmVzdWx0cykge1xuICAgICAgICAgICAgaWYgKGlzTGVmdChyZXN1bHQpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQodW5kZWZpbmVkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJpZ2h0UmVzdWx0cy5wdXNoKHJlc3VsdC5yaWdodCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJpZ2h0KHJpZ2h0UmVzdWx0cyBhcyB1bmtub3duIGFzIEFyZ3NUb0RhdGE8Qz4pO1xuICAgIH1cblxuICAgIHRvU3RyaW5nKCkge1xuICAgICAgICByZXR1cm4gYFdvcmxkKCR7dGhpcy5uYW1lID8/ICd1bm5hbWVkJ30pYDtcbiAgICB9XG59XG4iXX0=

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc