brisky-stamp
Advanced tools
Comparing version 3.0.10 to 3.0.11
if (!global.briskystamp) { | ||
var exports$1 = {}; | ||
const next = typeof setImmediate === 'undefined' ? setTimeout : setImmediate; | ||
const ts = exports.ts = 535673248076; | ||
const ts = exports$1.ts = 535673248076; | ||
var tsInProgress = false; | ||
@@ -9,5 +10,5 @@ var cnt = 0; | ||
global.briskystamp = exports; | ||
exports.inProgress = false; | ||
exports.offset = 0; | ||
global.briskystamp = exports$1; | ||
exports$1.inProgress = false; | ||
exports$1.offset = 0; | ||
@@ -17,3 +18,3 @@ const ms = () => { | ||
cnt = 0; | ||
d = Date.now() - ts + exports.offset; | ||
d = Date.now() - ts + exports$1.offset; | ||
tsInProgress = true; | ||
@@ -27,3 +28,3 @@ next(() => { tsInProgress = false; }); | ||
exports.create = (type, src, override) => { | ||
exports$1.create = (type, src, override) => { | ||
if (type) { | ||
@@ -38,9 +39,9 @@ return [ override || ms(), src || 0, parseInt(type, 36) ] | ||
exports.src = stamp => stamp && stamp[1]; | ||
exports$1.src = stamp => stamp && stamp[1]; | ||
exports.val = stamp => stamp && (stamp[0] || stamp); | ||
exports$1.val = stamp => stamp && (stamp[0] || stamp); | ||
exports.type = stamp => stamp && stamp[2] && stamp[2].toString(36); | ||
exports$1.type = stamp => stamp && stamp[2] && stamp[2].toString(36); | ||
exports.on = fn => { | ||
exports$1.on = fn => { | ||
if (!on) { | ||
@@ -53,16 +54,16 @@ on = [ fn ]; | ||
exports.clear = () => { on = false; }; // rename this to stop | ||
exports$1.clear = () => { on = false; }; // rename this to stop | ||
exports.close = () => { | ||
if (on && !exports.inProgress) { | ||
exports.inProgress = true; | ||
exports$1.close = () => { | ||
if (on && !exports$1.inProgress) { | ||
exports$1.inProgress = true; | ||
for (let i = 0; i < on.length; i++) { on[i](); } | ||
exports.inProgress = on = false; | ||
exports$1.inProgress = on = false; | ||
} | ||
}; | ||
exports.parse = stamp => { | ||
exports$1.parse = stamp => { | ||
const parsed = { val: stamp[0] }; | ||
const src = stamp[1]; | ||
const type = exports.type(stamp); | ||
const type = exports$1.type(stamp); | ||
if (src) parsed.src = src; | ||
@@ -69,0 +70,0 @@ if (type) parsed.type = type; |
'use strict'; | ||
if (!global.briskystamp) { | ||
var exports$1 = {}; | ||
const next = typeof setImmediate === 'undefined' ? setTimeout : setImmediate; | ||
const ts = exports.ts = 535673248076; | ||
const ts = exports$1.ts = 535673248076; | ||
var tsInProgress = false; | ||
@@ -11,5 +12,5 @@ var cnt = 0; | ||
global.briskystamp = exports; | ||
exports.inProgress = false; | ||
exports.offset = 0; | ||
global.briskystamp = exports$1; | ||
exports$1.inProgress = false; | ||
exports$1.offset = 0; | ||
@@ -19,3 +20,3 @@ const ms = () => { | ||
cnt = 0; | ||
d = Date.now() - ts + exports.offset; | ||
d = Date.now() - ts + exports$1.offset; | ||
tsInProgress = true; | ||
@@ -29,3 +30,3 @@ next(() => { tsInProgress = false; }); | ||
exports.create = (type, src, override) => { | ||
exports$1.create = (type, src, override) => { | ||
if (type) { | ||
@@ -40,9 +41,9 @@ return [ override || ms(), src || 0, parseInt(type, 36) ] | ||
exports.src = stamp => stamp && stamp[1]; | ||
exports$1.src = stamp => stamp && stamp[1]; | ||
exports.val = stamp => stamp && (stamp[0] || stamp); | ||
exports$1.val = stamp => stamp && (stamp[0] || stamp); | ||
exports.type = stamp => stamp && stamp[2] && stamp[2].toString(36); | ||
exports$1.type = stamp => stamp && stamp[2] && stamp[2].toString(36); | ||
exports.on = fn => { | ||
exports$1.on = fn => { | ||
if (!on) { | ||
@@ -55,16 +56,16 @@ on = [ fn ]; | ||
exports.clear = () => { on = false; }; // rename this to stop | ||
exports$1.clear = () => { on = false; }; // rename this to stop | ||
exports.close = () => { | ||
if (on && !exports.inProgress) { | ||
exports.inProgress = true; | ||
exports$1.close = () => { | ||
if (on && !exports$1.inProgress) { | ||
exports$1.inProgress = true; | ||
for (let i = 0; i < on.length; i++) { on[i](); } | ||
exports.inProgress = on = false; | ||
exports$1.inProgress = on = false; | ||
} | ||
}; | ||
exports.parse = stamp => { | ||
exports$1.parse = stamp => { | ||
const parsed = { val: stamp[0] }; | ||
const src = stamp[1]; | ||
const type = exports.type(stamp); | ||
const type = exports$1.type(stamp); | ||
if (src) parsed.src = src; | ||
@@ -71,0 +72,0 @@ if (type) parsed.type = type; |
{ | ||
"name": "brisky-stamp", | ||
"version": "3.0.10", | ||
"version": "3.0.11", | ||
"description": "Generate unique meta information for change in a system", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
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
14049
123