@comunica/core
Advanced tools
Comparing version 1.13.0 to 1.14.0
26
index.js
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// eslint-disable-next-line no-process-env | ||
if (!process || (process.env.NODE_ENV === 'production' && !process.env.COMUNICA_DEBUG)) { | ||
Error.stackTraceLimit = false; | ||
} | ||
__export(require("./lib/Bus")); | ||
__export(require("./lib/BusIndexed")); | ||
__export(require("./lib/ActionObserver")); | ||
__export(require("./lib/Actor")); | ||
__export(require("./lib/Logger")); | ||
__export(require("./lib/Mediator")); | ||
__exportStar(require("./lib/Bus"), exports); | ||
__exportStar(require("./lib/BusIndexed"), exports); | ||
__exportStar(require("./lib/ActionObserver"), exports); | ||
__exportStar(require("./lib/Actor"), exports); | ||
__exportStar(require("./lib/Logger"), exports); | ||
__exportStar(require("./lib/Mediator"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,3 @@ | ||
import { Actor, IAction, IActorOutput, IActorTest } from "./Actor"; | ||
import { Bus } from "./Bus"; | ||
import { Actor, IAction, IActorOutput, IActorTest } from './Actor'; | ||
import { Bus } from './Bus'; | ||
/** | ||
@@ -26,3 +26,3 @@ * An ActionObserver can passively listen to {@link Actor#run} inputs and outputs for all actors on a certain bus. | ||
*/ | ||
constructor(args: IActionObserverArgs<I, O>); | ||
protected constructor(args: IActionObserverArgs<I, O>); | ||
/** | ||
@@ -29,0 +29,0 @@ * Invoked when an action was run by an actor. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ActionObserver = void 0; | ||
/** | ||
@@ -4,0 +5,0 @@ * An ActionObserver can passively listen to {@link Actor#run} inputs and outputs for all actors on a certain bus. |
@@ -1,4 +0,4 @@ | ||
import { Map } from "immutable"; | ||
import { Bus } from "./Bus"; | ||
import { Logger } from "./Logger"; | ||
import { Map } from 'immutable'; | ||
import { Bus } from './Bus'; | ||
import { Logger } from './Logger'; | ||
/** | ||
@@ -35,3 +35,3 @@ * An actor can act on messages of certain types and provide output of a certain type. | ||
*/ | ||
constructor(args: IActorArgs<I, T, O>); | ||
protected constructor(args: IActorArgs<I, T, O>); | ||
/** | ||
@@ -38,0 +38,0 @@ * Get the logger from the given context. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ensureActionContext = exports.ActionContext = exports.Actor = void 0; | ||
const immutable_1 = require("immutable"); | ||
@@ -37,3 +38,3 @@ const Logger_1 = require("./Logger"); | ||
this.bus.subscribe(this); | ||
if (this.beforeActors.length) { | ||
if (this.beforeActors.length > 0) { | ||
this.bus.addDependencies(this, this.beforeActors); | ||
@@ -40,0 +41,0 @@ } |
@@ -1,3 +0,3 @@ | ||
import { ActionObserver } from "./ActionObserver"; | ||
import { Actor, IAction, IActorOutput, IActorTest } from "./Actor"; | ||
import { ActionObserver } from './ActionObserver'; | ||
import { Actor, IAction, IActorOutput, IActorTest } from './Actor'; | ||
/** | ||
@@ -4,0 +4,0 @@ * A publish-subscribe bus for sending actions to actors |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Bus = void 0; | ||
/** | ||
@@ -29,3 +30,4 @@ * A publish-subscribe bus for sending actions to actors | ||
this.observers = []; | ||
this.dependencyLinks = new Map(); // Mapping from dependency (after) to dependents (before) | ||
// Mapping from dependency (after) to dependents (before) | ||
this.dependencyLinks = new Map(); | ||
require('lodash.assign')(this, args); | ||
@@ -100,5 +102,3 @@ } | ||
publish(action) { | ||
return this.actors.map((actor) => { | ||
return { actor, reply: actor.test(action) }; | ||
}); | ||
return this.actors.map((actor) => ({ actor, reply: actor.test(action) })); | ||
} | ||
@@ -158,3 +158,3 @@ /** | ||
for (const dependency of this.dependencyLinks.get(actorsAfter[i])) { | ||
if (this.actors.indexOf(dependency) < 0 && actorsAfter.indexOf(dependency) >= 0) { | ||
if (!this.actors.includes(dependency) && actorsAfter.includes(dependency)) { | ||
validLink = false; | ||
@@ -171,3 +171,3 @@ break; | ||
if (activeActorAfterId < 0) { | ||
throw new Error('Cyclic dependency links detected in bus ' + this.name); | ||
throw new Error(`Cyclic dependency links detected in bus ${this.name}`); | ||
} | ||
@@ -174,0 +174,0 @@ // The dependent may not be available (yet), so we don't add it to the array (yet). |
@@ -1,3 +0,3 @@ | ||
import { Actor, IAction, IActorOutput, IActorTest } from "./Actor"; | ||
import { Bus, IActorReply, IBusArgs } from "./Bus"; | ||
import { Actor, IAction, IActorOutput, IActorTest } from './Actor'; | ||
import { Bus, IActorReply, IBusArgs } from './Bus'; | ||
/** | ||
@@ -4,0 +4,0 @@ * A bus that indexes identified actors, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BusIndexed = void 0; | ||
const Bus_1 = require("./Bus"); | ||
@@ -59,9 +60,5 @@ /** | ||
const actors = (this.actorsIndex[actionId] || []).concat(this.actorsIndex._undefined_ || []); | ||
return actors.map((actor) => { | ||
return { actor, reply: actor.test(action) }; | ||
}); | ||
return actors.map((actor) => ({ actor, reply: actor.test(action) })); | ||
} | ||
else { | ||
return super.publish(action); | ||
} | ||
return super.publish(action); | ||
} | ||
@@ -68,0 +65,0 @@ getActorIdentifier(actor) { |
@@ -30,2 +30,2 @@ /** | ||
*/ | ||
export declare const KEY_CONTEXT_LOG: string; | ||
export declare const KEY_CONTEXT_LOG = "@comunica/core:log"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.KEY_CONTEXT_LOG = exports.Logger = void 0; | ||
/** | ||
@@ -22,3 +23,2 @@ * A logger accepts messages from different levels | ||
*/ | ||
// tslint:disable:object-literal-sort-keys | ||
Logger.LEVELS = { | ||
@@ -25,0 +25,0 @@ trace: 0, |
@@ -1,3 +0,3 @@ | ||
import { Actor, IAction, IActorOutput, IActorTest } from "./Actor"; | ||
import { Bus, IActorReply } from "./Bus"; | ||
import { Actor, IAction, IActorOutput, IActorTest } from './Actor'; | ||
import { Bus, IActorReply } from './Bus'; | ||
/** | ||
@@ -33,3 +33,3 @@ * A mediator can mediate an action over a bus of actors. | ||
*/ | ||
constructor(args: IMediatorArgs<A, I, T, O>); | ||
protected constructor(args: IMediatorArgs<A, I, T, O>); | ||
/** | ||
@@ -36,0 +36,0 @@ * Publish the given action in the bus. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Mediator = void 0; | ||
/** | ||
@@ -47,4 +48,4 @@ * A mediator can mediate an action over a bus of actors. | ||
const actors = this.bus.publish(action); | ||
if (!actors.length) { | ||
throw new Error('No actors are able to reply to a message in the bus ' + this.bus.name); | ||
if (actors.length === 0) { | ||
throw new Error(`No actors are able to reply to a message in the bus ${this.bus.name}`); | ||
} | ||
@@ -51,0 +52,0 @@ return actors; |
{ | ||
"name": "@comunica/core", | ||
"version": "1.13.0", | ||
"version": "1.14.0", | ||
"description": "Lightweight, semantic and modular actor framework", | ||
@@ -42,2 +42,3 @@ "lsd:module": "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core", | ||
"dependencies": { | ||
"@types/lodash.assign": "^4.2.3", | ||
"immutable": "^3.8.2", | ||
@@ -49,3 +50,3 @@ "lodash.assign": "^4.2.0" | ||
"ts-jest": { | ||
"tsConfig": "test/tsconfig.json" | ||
"tsConfig": "../../tsconfig.json" | ||
} | ||
@@ -66,7 +67,6 @@ }, | ||
"test-watch": "node \"../../node_modules/jest/bin/jest.js\" ${1} --watch", | ||
"lint": "node \"../../node_modules/tslint/bin/tslint\" lib/**/*.ts test/**/*.ts --exclude '**/*.d.ts'", | ||
"build": "node \"../../node_modules/typescript/bin/tsc\"", | ||
"validate": "npm ls" | ||
}, | ||
"gitHead": "cd8df73fe091e3d7413147ec5301b47be2de392a" | ||
"gitHead": "6517367d95ef072468bfc0d88cf3a27f6d25a145" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50312
1028
3
+ Added@types/lodash.assign@^4.2.3
+ Added@types/lodash@4.17.13(transitive)
+ Added@types/lodash.assign@4.2.9(transitive)