Comparing version 1.3.0 to 1.4.0
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -10,3 +12,6 @@ value: true | ||
exports.attachDebugConsole = attachDebugConsole; | ||
exports.logger = logger; | ||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); | ||
function debug(events) { | ||
@@ -45,11 +50,16 @@ return debugWindow(events) || debugProcess(events); | ||
function attachDebugConsole(events) { | ||
events.onAny(function (_ref) { | ||
var event = _ref.event; | ||
events.onAny(logger); | ||
events.withOp("*").onAny(logger); | ||
} | ||
if (event.op !== "get") { | ||
// eslint-disable-next-line no-console | ||
console.log(event.op, event.props, event.args); | ||
} | ||
}); | ||
function logger(_ref) { | ||
var _console; | ||
var event = _ref.event; | ||
var msg = [event.op, event.props, event.args].reduce(function (memo, arg) { | ||
return arg ? memo.concat([arg]) : memo; | ||
}, []); // eslint-disable-next-line no-console | ||
(_console = console).log.apply(_console, (0, _toConsumableArray2.default)(msg)); | ||
} | ||
//# sourceMappingURL=debug.js.map |
@@ -60,5 +60,2 @@ "use strict"; | ||
keys.add(eventKey({ | ||
prep: prep | ||
})); | ||
keys.add(eventKey({ | ||
op: op, | ||
@@ -68,2 +65,9 @@ prep: prep | ||
if (op) { | ||
keys.add(eventKey({ | ||
op: "*", | ||
prep: prep | ||
})); | ||
} | ||
if (props) { | ||
@@ -86,2 +90,10 @@ for (var x = 0; x < props.length - 1; x++) { | ||
})); | ||
if (op) { | ||
keys.add(eventKey({ | ||
op: "*", | ||
prep: prep, | ||
props: wild | ||
})); | ||
} | ||
} | ||
@@ -111,10 +123,2 @@ } | ||
if (subscribe && !op) { | ||
keys.add(eventKey({ | ||
op: "*", | ||
prep: prep, | ||
props: props | ||
})); | ||
} | ||
if (!subscribe) { | ||
@@ -137,2 +141,10 @@ var wild = wildProps(props); | ||
})); | ||
if (op) { | ||
keys.add(eventKey({ | ||
op: "*", | ||
prep: prep, | ||
props: wild | ||
})); | ||
} | ||
} | ||
@@ -139,0 +151,0 @@ } |
@@ -20,3 +20,3 @@ "use strict"; | ||
if (!set.has(op)) { | ||
if (op !== "*" && !set.has(op)) { | ||
set.add(op); | ||
@@ -23,0 +23,0 @@ events[op] = _build.emit.bind((0, _objectSpread2.default)({}, options, { |
@@ -36,8 +36,13 @@ export function debug(events) { | ||
export function attachDebugConsole(events) { | ||
events.onAny(({ event }) => { | ||
if (event.op !== "get") { | ||
// eslint-disable-next-line no-console | ||
console.log(event.op, event.props, event.args) | ||
} | ||
}) | ||
events.onAny(logger) | ||
events.withOp("*").onAny(logger) | ||
} | ||
export function logger({ event }) { | ||
const msg = [event.op, event.props, event.args].reduce( | ||
(memo, arg) => (arg ? memo.concat([arg]) : memo), | ||
[] | ||
) | ||
// eslint-disable-next-line no-console | ||
console.log(...msg) | ||
} |
@@ -39,5 +39,8 @@ import { propVarRegex } from "./props" | ||
if (!subscribe) { | ||
keys.add(eventKey({ prep })) | ||
keys.add(eventKey({ op, prep })) | ||
if (op) { | ||
keys.add(eventKey({ op: "*", prep })) | ||
} | ||
if (props) { | ||
@@ -59,2 +62,8 @@ for (let x = 0; x < props.length - 1; x++) { | ||
keys.add(eventKey({ op, prep, props: wild })) | ||
if (op) { | ||
keys.add( | ||
eventKey({ op: "*", prep, props: wild }) | ||
) | ||
} | ||
} | ||
@@ -77,6 +86,2 @@ } | ||
if (subscribe && !op) { | ||
keys.add(eventKey({ op: "*", prep, props })) | ||
} | ||
if (!subscribe) { | ||
@@ -91,2 +96,6 @@ const wild = wildProps(props) | ||
keys.add(eventKey({ op, prep, props: wild })) | ||
if (op) { | ||
keys.add(eventKey({ op: "*", prep, props: wild })) | ||
} | ||
} | ||
@@ -93,0 +102,0 @@ } |
@@ -7,3 +7,3 @@ import { emit } from "./build" | ||
if (!set.has(op)) { | ||
if (op !== "*" && !set.has(op)) { | ||
set.add(op) | ||
@@ -10,0 +10,0 @@ events[op] = emit.bind({ ...options, op }) |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Build beautiful and extensible eventing APIs", | ||
@@ -18,0 +18,0 @@ "keywords": [ |
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
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances 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
118506
2211
2