brisky-stamp
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -1,8 +0,6 @@ | ||
'use strict' | ||
var on = false | ||
exports.cnt = 0 | ||
const bs = global.briskystamp = { on: false, cnt: 0 } | ||
// add timestamp option -- maybe allways use it | ||
exports.create = (type, src, override) => { | ||
var stamp = override || ++exports.cnt | ||
var stamp = override || ++bs.cnt | ||
if (type) { | ||
@@ -18,6 +16,6 @@ stamp = type + '-' + stamp | ||
exports.on = fn => { | ||
if (!on) { | ||
on = [ fn ] | ||
if (!bs.on) { | ||
bs.on = [ fn ] | ||
} else { | ||
on.push(fn) | ||
bs.on.push(fn) | ||
} | ||
@@ -27,9 +25,12 @@ } | ||
exports.close = () => { | ||
const on = bs.on | ||
if (on) { | ||
for (let i = 0; i < on.length; i++) { on[i]() } | ||
on = false | ||
for (let i = 0; i < on.length; i++) { | ||
on[i]() | ||
} | ||
bs.on = false | ||
} | ||
} | ||
exports.clear = () => { on = false } | ||
exports.clear = () => { bs.on = false } | ||
@@ -36,0 +37,0 @@ exports.parse = stamp => { |
{ | ||
"name": "brisky-stamp", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Generate unique meta information for change in a system", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -7,6 +7,7 @@ 'use strict' | ||
bstamp = require('../') | ||
const gbstamp = global.briskystamp | ||
t.plan(4) | ||
stamp('default', bstamp.cnt + 1, bstamp.create()) | ||
stamp('type', 'click-' + (bstamp.cnt + 1), bstamp.create('click')) | ||
stamp('source', 'mac|' + (bstamp.cnt + 1), bstamp.create(void 0, 'mac')) | ||
stamp('default', gbstamp.cnt + 1, bstamp.create()) | ||
stamp('type', 'click-' + (gbstamp.cnt + 1), bstamp.create('click')) | ||
stamp('source', 'mac|' + (gbstamp.cnt + 1), bstamp.create(void 0, 'mac')) | ||
stamp('all', 'mac|click-override', bstamp.create('click', 'mac', 'override')) | ||
@@ -13,0 +14,0 @@ function stamp (label, result, val) { |
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
104071
308