satcheljs-trace
Advanced tools
Comparing version 2.11.0 to 2.12.0
@@ -0,2 +1,3 @@ | ||
/// <reference types="es6-promise" /> | ||
import { DispatchFunction, ActionFunction, ActionContext } from 'satcheljs'; | ||
export default function trace(next: DispatchFunction, action: ActionFunction, actionType: string, args: IArguments, actionContext: ActionContext): void | Promise<any>; |
"use strict"; | ||
var depth = 0; | ||
function trace(next, action, actionType, args, actionContext) { | ||
groupStart("Executing action: " + (actionType ? actionType : "(anonymous action)")); | ||
log("Executing action: " + (actionType ? actionType : "(anonymous action)")); | ||
try { | ||
depth++; | ||
return next(action, actionType, args, actionContext); | ||
} | ||
finally { | ||
groupEnd(); | ||
depth--; | ||
} | ||
@@ -13,14 +15,5 @@ } | ||
exports.default = trace; | ||
function groupStart(message) { | ||
if (typeof console.group == "function") { | ||
console.group(message); | ||
} | ||
else { | ||
console.log(message); | ||
} | ||
function log(message) { | ||
var indentation = (new Array(depth + 1)).join(' '); | ||
console.log(indentation + message); | ||
} | ||
function groupEnd() { | ||
if (typeof console.groupEnd == "function") { | ||
console.groupEnd(); | ||
} | ||
} |
{ | ||
"name": "satcheljs-trace", | ||
"version": "2.11.0", | ||
"version": "2.12.0", | ||
"description": "Tracing middleware for SatchelJS.", | ||
@@ -15,3 +15,3 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"satcheljs": "2.11.0" | ||
"satcheljs": "2.12.0" | ||
}, | ||
@@ -18,0 +18,0 @@ "devDependencies": { |
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
3219
25
+ Addedsatcheljs@2.12.0(transitive)
- Removedsatcheljs@2.11.0(transitive)
Updatedsatcheljs@2.12.0