Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@blackglory/log

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blackglory/log - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

lib/es2015/group.d.ts

355

dist/es2015/index.umd.js

@@ -21,3 +21,3 @@ (function (global, factory) {

var es2018 = {};
var es2018$3 = {};

@@ -587,42 +587,68 @@ var array = {};

var regexp = {};
regexp.isntRegExp = regexp.isRegExp = void 0;
function isRegExp(val) {
return val instanceof RegExp;
}
regexp.isRegExp = isRegExp;
function isntRegExp(val) {
return !isRegExp(val);
}
regexp.isntRegExp = isntRegExp;
var symbol = {};
symbol.isntSymbol = symbol.isSymbol = void 0;
function isSymbol(val) {
return typeof val === 'symbol';
}
symbol.isSymbol = isSymbol;
function isntSymbol(val) {
return !isSymbol(val);
}
symbol.isntSymbol = isntSymbol;
(function (exports) {
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};__exportStar(array, exports);
__exportStar(asyncIterable, exports);
__exportStar(bigint, exports);
__exportStar(boolean, exports);
__exportStar(char, exports);
__exportStar(date, exports);
__exportStar(_enum, exports);
__exportStar(error, exports);
__exportStar(falsy, exports);
__exportStar(_function, exports);
__exportStar(iterable, exports);
__exportStar(json, exports);
__exportStar(_null, exports);
__exportStar(number, exports);
__exportStar(object, exports);
__exportStar(promise, exports);
__exportStar(string, exports);
__exportStar(_undefined, exports);
__exportStar(url, exports);
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};__exportStar(array, exports);
__exportStar(asyncIterable, exports);
__exportStar(bigint, exports);
__exportStar(boolean, exports);
__exportStar(char, exports);
__exportStar(date, exports);
__exportStar(_enum, exports);
__exportStar(error, exports);
__exportStar(falsy, exports);
__exportStar(_function, exports);
__exportStar(iterable, exports);
__exportStar(json, exports);
__exportStar(_null, exports);
__exportStar(number, exports);
__exportStar(object, exports);
__exportStar(promise, exports);
__exportStar(string, exports);
__exportStar(_undefined, exports);
__exportStar(url, exports);
__exportStar(regexp, exports);
__exportStar(symbol, exports);
} (es2018$3));
}(es2018));
function time(message, fn) {
const startTime = now();
const result = fn();
if (es2018.isPromiseLike(result)) {
if (es2018$3.isPromiseLike(result)) {
return result.then(() => {

@@ -688,2 +714,259 @@ const endTime = now();

var es2018$2 = {};
var go$1 = {};
go$1.go = void 0;
function go(fn) {
return fn();
}
go$1.go = go;
var goMicrotask$1 = {};
goMicrotask$1.goMicrotask = void 0;
function goMicrotask(fn) {
return new Promise((resolve, reject) => {
queueMicrotask(async () => {
try {
resolve(await fn());
}
catch (e) {
reject(e);
}
});
});
}
goMicrotask$1.goMicrotask = goMicrotask;
var goMacrotask$1 = {};
var es2018$1 = {};
var exponentialBackoff = {};
var es2018 = {};
var random$1 = {};
random$1.random = void 0;
function random(min, max) {
return Math.random() * (max - min) + min;
}
random$1.random = random;
var randomInt$1 = {};
randomInt$1.randomInt = void 0;
function randomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min;
}
randomInt$1.randomInt = randomInt;
var randomIntInclusive$1 = {};
randomIntInclusive$1.randomIntInclusive = void 0;
function randomIntInclusive(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}
randomIntInclusive$1.randomIntInclusive = randomIntInclusive;
(function (exports) {
var __createBinding = (commonjsGlobal && commonjsGlobal.__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 = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};__exportStar(random$1, exports);
__exportStar(randomInt$1, exports);
__exportStar(randomIntInclusive$1, exports);
} (es2018));
exponentialBackoff.calculateExponentialBackoffTimeout = void 0;
const extra_rand_1 = es2018;
function calculateExponentialBackoffTimeout({ baseTimeout, retries, maxTimeout = Infinity, factor = 2, jitter = true }) {
const timeout = Math.min(factor ** retries * baseTimeout, maxTimeout);
if (jitter) {
return (0, extra_rand_1.randomIntInclusive)(0, timeout);
}
else {
return timeout;
}
}
exponentialBackoff.calculateExponentialBackoffTimeout = calculateExponentialBackoffTimeout;
var setTimeout$1 = {};
setTimeout$1.setTimeout = void 0;
function setTimeout(timeout, cb) {
const timer = globalThis.setTimeout(cb, timeout);
return () => clearTimeout(timer);
}
setTimeout$1.setTimeout = setTimeout;
var setSchedule$1 = {};
setSchedule$1.setSchedule = void 0;
const set_timeout_1$3 = setTimeout$1;
function setSchedule(timestamp, cb) {
const timeout = timestamp - Date.now();
return (0, set_timeout_1$3.setTimeout)(timeout, cb);
}
setSchedule$1.setSchedule = setSchedule;
var setInterval$1 = {};
setInterval$1.setInterval = void 0;
function setInterval(timeout, cb) {
const timer = globalThis.setInterval(cb, timeout);
return () => clearInterval(timer);
}
setInterval$1.setInterval = setInterval;
var setImmediate$1 = {};
setImmediate$1.setImmediate = void 0;
const set_timeout_1$2 = setTimeout$1;
function setImmediate(cb) {
if (globalThis.setImmediate) {
const timer = globalThis.setImmediate(cb);
return () => clearImmediate(timer);
}
else {
return (0, set_timeout_1$2.setTimeout)(0, cb);
}
}
setImmediate$1.setImmediate = setImmediate;
var setTimeoutLoop$1 = {};
setTimeoutLoop$1.setTimeoutLoop = void 0;
const set_timeout_1$1 = setTimeout$1;
function setTimeoutLoop(timeout, cb) {
let isCancelled = false;
let cancel = (0, set_timeout_1$1.setTimeout)(timeout, loop);
return () => {
isCancelled = true;
cancel();
};
async function loop() {
await cb();
if (!isCancelled) {
cancel = (0, set_timeout_1$1.setTimeout)(timeout, loop);
}
}
}
setTimeoutLoop$1.setTimeoutLoop = setTimeoutLoop;
var setDynamicTimeoutLoop$1 = {};
setDynamicTimeoutLoop$1.setDynamicTimeoutLoop = void 0;
const set_timeout_1 = setTimeout$1;
function setDynamicTimeoutLoop(timeout, cb) {
let isCancelled = false;
let cancel = (0, set_timeout_1.setTimeout)(timeout, loop);
return () => {
isCancelled = true;
cancel();
};
async function loop() {
const start = Date.now();
await cb();
const elapsed = Date.now() - start;
if (!isCancelled) {
cancel = (0, set_timeout_1.setTimeout)(Math.max(timeout - elapsed, 0), loop);
}
}
}
setDynamicTimeoutLoop$1.setDynamicTimeoutLoop = setDynamicTimeoutLoop;
(function (exports) {
var __createBinding = (commonjsGlobal && commonjsGlobal.__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 = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};__exportStar(exponentialBackoff, exports);
__exportStar(setTimeout$1, exports);
__exportStar(setSchedule$1, exports);
__exportStar(setInterval$1, exports);
__exportStar(setImmediate$1, exports);
__exportStar(setTimeoutLoop$1, exports);
__exportStar(setDynamicTimeoutLoop$1, exports);
} (es2018$1));
goMacrotask$1.goMacrotask = void 0;
const extra_timers_1 = es2018$1;
function goMacrotask(fn) {
return new Promise((resolve, reject) => {
(0, extra_timers_1.setImmediate)(async () => {
try {
resolve(await fn());
}
catch (e) {
reject(e);
}
});
});
}
goMacrotask$1.goMacrotask = goMacrotask;
(function (exports) {
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};__exportStar(go$1, exports);
__exportStar(goMicrotask$1, exports);
__exportStar(goMacrotask$1, exports);
} (es2018$2));
function group(...args) {
const [label, fn] = es2018$2.go(() => {
if (args.length === 1) {
const [fn] = args;
return [undefined, fn];
}
else {
const [label, fn] = args;
return [label, fn];
}
});
// 由于一些控制台会将undefined参数显示为'undefined', 在此确保在undefined时不传入参数.
if (es2018$3.isUndefined(label)) {
console.group();
}
else {
console.group(label);
}
const result = fn();
console.groupEnd();
return result;
}
exports.group = group;
exports.log = log;

@@ -690,0 +973,0 @@ exports.time = time;

4

dist/es2015/index.umd.min.js

@@ -1,2 +0,2 @@

!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).Log={})}(this,(function(n){"use strict";function t(){return performance.now()}function i(n,t){return t-n+"ms"}var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={},o={};function u(n){return Array.isArray(n)}o.isntEmptyArray=o.isEmptyArray=o.isntArray=o.isArray=void 0,o.isArray=u,o.isntArray=function(n){return!u(n)},o.isEmptyArray=function(n){return 0===n.length},o.isntEmptyArray=function(n){return 0!==n.length};var s={},c={};function f(n){return null===n}c.isntNull=c.isNull=void 0,c.isNull=f,c.isntNull=function(n){return!f(n)};var a={};function l(n){return void 0===n}a.isntUndefined=a.isUndefined=void 0,a.isUndefined=l,a.isntUndefined=function(n){return!l(n)};var b={};function y(n){return"function"==typeof n}b.isntFunction=b.isFunction=void 0,b.isFunction=y,b.isntFunction=function(n){return!y(n)},s.isntAsyncIterable=s.isAsyncIterable=void 0;const d=c,v=a,p=b;function g(n){return(0,d.isntNull)(n)&&(0,v.isntUndefined)(n)&&(0,p.isFunction)(n[Symbol.asyncIterator])}s.isAsyncIterable=g,s.isntAsyncIterable=function(n){return!g(n)};var j={};function m(n){return"bigint"==typeof n}j.isntBigInt=j.isBigInt=void 0,j.isBigInt=m,j.isntBigInt=function(n){return!m(n)};var O={};function h(n){return"boolean"==typeof n}O.isntBoolean=O.isBoolean=void 0,O.isBoolean=h,O.isntBoolean=function(n){return!h(n)};var N={},P={};function A(n){return"string"==typeof n}P.isntString=P.isString=void 0,P.isString=A,P.isntString=function(n){return!A(n)},N.isntChar=N.isChar=void 0;const F=P;function I(n){return(0,F.isString)(n)&&1===n.length}N.isChar=I,N.isntChar=function(n){return!I(n)};var S={};function E(n){return n instanceof Date}S.isntDate=S.isDate=void 0,S.isDate=E,S.isntDate=function(n){return!E(n)};var w={};w.inEnum=void 0,w.inEnum=function(n,t){return Object.values(t).includes(n)};var _={};function B(n){return n instanceof Error}_.isntError=_.isError=void 0,_.isError=B,_.isntError=function(n){return!B(n)};var U={};function J(n){return!n}U.isntFalsy=U.isFalsy=void 0,U.isFalsy=J,U.isntFalsy=function(n){return!J(n)};var L={};L.isntIterable=L.isIterable=void 0;const k=c,D=a,x=b;function T(n){return(0,k.isntNull)(n)&&(0,D.isntUndefined)(n)&&(0,x.isFunction)(n[Symbol.iterator])}L.isIterable=T,L.isntIterable=function(n){return!T(n)};var C={},M={};function R(n){return"number"==typeof n}function q(n){return Number.isNaN(n)}M.isntNaN=M.isNaN=M.isNegativeInfinity=M.isPositiveInfinity=M.isFinite=M.isntNumber=M.isNumber=void 0,M.isNumber=R,M.isntNumber=function(n){return!R(n)},M.isFinite=function(n){return Number.isFinite(n)},M.isPositiveInfinity=function(n){return n===1/0},M.isNegativeInfinity=function(n){return n===-1/0},M.isNaN=q,M.isntNaN=function(n){return!q(n)};var z={},G="object"==typeof e&&e&&e.Object===Object&&e,H="object"==typeof self&&self&&self.Object===Object&&self,K=(G||H||Function("return this")()).Symbol,Q=K,V=Object.prototype,W=V.hasOwnProperty,X=V.toString,Y=Q?Q.toStringTag:void 0;var Z=function(n){var t=W.call(n,Y),i=n[Y];try{n[Y]=void 0;var e=!0}catch(n){}var r=X.call(n);return e&&(t?n[Y]=i:delete n[Y]),r},$=Object.prototype.toString;var nn=Z,tn=function(n){return $.call(n)},en=K?K.toStringTag:void 0;var rn=function(n){return null==n?void 0===n?"[object Undefined]":"[object Null]":en&&en in Object(n)?nn(n):tn(n)};var on=function(n,t){return function(i){return n(t(i))}}(Object.getPrototypeOf,Object);var un=rn,sn=on,cn=function(n){return null!=n&&"object"==typeof n},fn=Function.prototype,an=Object.prototype,ln=fn.toString,bn=an.hasOwnProperty,yn=ln.call(Object);var dn=function(n){if(!cn(n)||"[object Object]"!=un(n))return!1;var t=sn(n);if(null===t)return!0;var i=bn.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&ln.call(i)==yn},vn=e&&e.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};z.isntEmptyObject=z.isEmptyObject=z.isntPlainObject=z.isPlainObject=z.isntObject=z.isObject=void 0;const pn=vn(dn);function gn(n){return null!==n&&"object"==typeof n}function jn(n){return(0,pn.default)(n)}z.isObject=gn,z.isntObject=function(n){return!gn(n)},z.isPlainObject=jn,z.isntPlainObject=function(n){return!jn(n)},z.isEmptyObject=function(n){return 0===Object.keys(n).length},z.isntEmptyObject=function(n){return 0!==Object.keys(n).length},C.isntJsonable=C.isJsonable=C.isntJson=C.isJson=void 0;const mn=c,On=O,hn=P,Nn=M,Pn=o,An=z;function Fn(n){return(0,mn.isNull)(n)||(0,On.isBoolean)(n)||(0,hn.isString)(n)||(0,Nn.isNumber)(n)||(0,Pn.isArray)(n)&&n.every(Fn)||(0,An.isPlainObject)(n)&&Object.values(n).every(Fn)}C.isJson=Fn,C.isntJson=function(n){return!Fn(n)},C.isJsonable=function(n){try{return JSON.stringify(n),!0}catch(n){return!1}},C.isntJsonable=function n(t){return!n()};var In={};In.isPromiseLike=In.isntPromiseLike=In.isntPromise=In.isPromise=void 0;const Sn=z,En=b;function wn(n){return n instanceof Promise}function _n(n){return(0,Sn.isObject)(n)&&(0,En.isFunction)(n.then)}In.isPromise=wn,In.isntPromise=function(n){return!wn(n)},In.isntPromiseLike=function(n){return!_n(n)},In.isPromiseLike=_n;var Bn={};
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).Log={})}(this,(function(n){"use strict";function t(){return performance.now()}function e(n,t){return t-n+"ms"}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={},o={};function u(n){return Array.isArray(n)}o.isntEmptyArray=o.isEmptyArray=o.isntArray=o.isArray=void 0,o.isArray=u,o.isntArray=function(n){return!u(n)},o.isEmptyArray=function(n){return 0===n.length},o.isntEmptyArray=function(n){return 0!==n.length};var c={},s={};function a(n){return null===n}s.isntNull=s.isNull=void 0,s.isNull=a,s.isntNull=function(n){return!a(n)};var f={};function l(n){return void 0===n}f.isntUndefined=f.isUndefined=void 0,f.isUndefined=l,f.isntUndefined=function(n){return!l(n)};var d={};function v(n){return"function"==typeof n}d.isntFunction=d.isFunction=void 0,d.isFunction=v,d.isntFunction=function(n){return!v(n)},c.isntAsyncIterable=c.isAsyncIterable=void 0;const b=s,y=f,m=d;function p(n){return(0,b.isntNull)(n)&&(0,y.isntUndefined)(n)&&(0,m.isFunction)(n[Symbol.asyncIterator])}c.isAsyncIterable=p,c.isntAsyncIterable=function(n){return!p(n)};var g={};function O(n){return"bigint"==typeof n}g.isntBigInt=g.isBigInt=void 0,g.isBigInt=O,g.isntBigInt=function(n){return!O(n)};var j={};function h(n){return"boolean"==typeof n}j.isntBoolean=j.isBoolean=void 0,j.isBoolean=h,j.isntBoolean=function(n){return!h(n)};var I={},P={};function w(n){return"string"==typeof n}P.isntString=P.isString=void 0,P.isString=w,P.isntString=function(n){return!w(n)},I.isntChar=I.isChar=void 0;const N=P;function T(n){return(0,N.isString)(n)&&1===n.length}I.isChar=T,I.isntChar=function(n){return!T(n)};var _={};function S(n){return n instanceof Date}_.isntDate=_.isDate=void 0,_.isDate=S,_.isntDate=function(n){return!S(n)};var E={};E.inEnum=void 0,E.inEnum=function(n,t){return Object.values(t).includes(n)};var M={};function x(n){return n instanceof Error}M.isntError=M.isError=void 0,M.isError=x,M.isntError=function(n){return!x(n)};var A={};function F(n){return!n}A.isntFalsy=A.isFalsy=void 0,A.isFalsy=F,A.isntFalsy=function(n){return!F(n)};var B={};B.isntIterable=B.isIterable=void 0;const k=s,D=f,L=d;function U(n){return(0,k.isntNull)(n)&&(0,D.isntUndefined)(n)&&(0,L.isFunction)(n[Symbol.iterator])}B.isIterable=U,B.isntIterable=function(n){return!U(n)};var J={},R={};function C(n){return"number"==typeof n}function q(n){return Number.isNaN(n)}R.isntNaN=R.isNaN=R.isNegativeInfinity=R.isPositiveInfinity=R.isFinite=R.isntNumber=R.isNumber=void 0,R.isNumber=C,R.isntNumber=function(n){return!C(n)},R.isFinite=function(n){return Number.isFinite(n)},R.isPositiveInfinity=function(n){return n===1/0},R.isNegativeInfinity=function(n){return n===-1/0},R.isNaN=q,R.isntNaN=function(n){return!q(n)};var z={},G="object"==typeof i&&i&&i.Object===Object&&i,H="object"==typeof self&&self&&self.Object===Object&&self,K=(G||H||Function("return this")()).Symbol,Q=K,V=Object.prototype,W=V.hasOwnProperty,X=V.toString,Y=Q?Q.toStringTag:void 0;var Z=function(n){var t=W.call(n,Y),e=n[Y];try{n[Y]=void 0;var i=!0}catch(n){}var r=X.call(n);return i&&(t?n[Y]=e:delete n[Y]),r},$=Object.prototype.toString;var nn=Z,tn=function(n){return $.call(n)},en=K?K.toStringTag:void 0;var rn=function(n){return null==n?void 0===n?"[object Undefined]":"[object Null]":en&&en in Object(n)?nn(n):tn(n)};var on=function(n,t){return function(e){return n(t(e))}}(Object.getPrototypeOf,Object);var un=rn,cn=on,sn=function(n){return null!=n&&"object"==typeof n},an=Function.prototype,fn=Object.prototype,ln=an.toString,dn=fn.hasOwnProperty,vn=ln.call(Object);var bn=function(n){if(!sn(n)||"[object Object]"!=un(n))return!1;var t=cn(n);if(null===t)return!0;var e=dn.call(t,"constructor")&&t.constructor;return"function"==typeof e&&e instanceof e&&ln.call(e)==vn},yn=i&&i.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};z.isntEmptyObject=z.isEmptyObject=z.isntPlainObject=z.isPlainObject=z.isntObject=z.isObject=void 0;const mn=yn(bn);function pn(n){return null!==n&&"object"==typeof n}function gn(n){return(0,mn.default)(n)}z.isObject=pn,z.isntObject=function(n){return!pn(n)},z.isPlainObject=gn,z.isntPlainObject=function(n){return!gn(n)},z.isEmptyObject=function(n){return 0===Object.keys(n).length},z.isntEmptyObject=function(n){return 0!==Object.keys(n).length},J.isntJsonable=J.isJsonable=J.isntJson=J.isJson=void 0;const On=s,jn=j,hn=P,In=R,Pn=o,wn=z;function Nn(n){return(0,On.isNull)(n)||(0,jn.isBoolean)(n)||(0,hn.isString)(n)||(0,In.isNumber)(n)||(0,Pn.isArray)(n)&&n.every(Nn)||(0,wn.isPlainObject)(n)&&Object.values(n).every(Nn)}J.isJson=Nn,J.isntJson=function(n){return!Nn(n)},J.isJsonable=function(n){try{return JSON.stringify(n),!0}catch(n){return!1}},J.isntJsonable=function n(t){return!n()};var Tn={};Tn.isPromiseLike=Tn.isntPromiseLike=Tn.isntPromise=Tn.isPromise=void 0;const _n=z,Sn=d;function En(n){return n instanceof Promise}function Mn(n){return(0,_n.isObject)(n)&&(0,Sn.isFunction)(n.then)}Tn.isPromise=En,Tn.isntPromise=function(n){return!En(n)},Tn.isntPromiseLike=function(n){return!Mn(n)},Tn.isPromiseLike=Mn;var xn={};xn.isAbsoluteURL=void 0,xn.isAbsoluteURL=function(n){try{return new URL(n),!0}catch(n){return!1}};var An={};function Fn(n){return n instanceof RegExp}An.isntRegExp=An.isRegExp=void 0,An.isRegExp=Fn,An.isntRegExp=function(n){return!Fn(n)};var Bn={};function kn(n){return"symbol"==typeof n}
/*! *****************************************************************************

@@ -16,3 +16,3 @@ Copyright (c) Microsoft Corporation.

***************************************************************************** */
function Un(n,t,i,e){return new(i||(i=Promise))((function(r,o){function u(n){try{c(e.next(n))}catch(n){o(n)}}function s(n){try{c(e.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?r(n.value):(t=n.value,t instanceof i?t:new i((function(n){n(t)}))).then(u,s)}c((e=e.apply(n,t||[])).next())}))}Bn.isAbsoluteURL=void 0,Bn.isAbsoluteURL=function(n){try{return new URL(n),!0}catch(n){return!1}},function(n){var t=e&&e.__createBinding||(Object.create?function(n,t,i,e){void 0===e&&(e=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(n,e,r)}:function(n,t,i,e){void 0===e&&(e=i),n[e]=t[i]}),i=e&&e.__exportStar||function(n,i){for(var e in n)"default"===e||Object.prototype.hasOwnProperty.call(i,e)||t(i,n,e)};i(o,n),i(s,n),i(j,n),i(O,n),i(N,n),i(S,n),i(w,n),i(_,n),i(U,n),i(b,n),i(L,n),i(C,n),i(c,n),i(M,n),i(z,n),i(In,n),i(P,n),i(a,n),i(Bn,n)}(r),n.log=function(...n){return console.log(...n),n[n.length-1]},n.time=function(n,e){const o=t(),u=e();if(r.isPromiseLike(u))return u.then((()=>{const e=t();return console.log(n,i(o,e)),u}));{const e=t();return console.log(n,i(o,e)),u}},n.timeAsyncFunction=function(n,e){return function(...r){return Un(this,void 0,void 0,(function*(){const o=t(),u=yield e(...r),s=t();return console.log(n,i(o,s)),u}))}},n.timeFunction=function(n,e){return function(...r){const o=t(),u=e(...r),s=t();return console.log(n,i(o,s)),u}},Object.defineProperty(n,"__esModule",{value:!0})}));
function Dn(n,t,e,i){return new(e||(e=Promise))((function(r,o){function u(n){try{s(i.next(n))}catch(n){o(n)}}function c(n){try{s(i.throw(n))}catch(n){o(n)}}function s(n){var t;n.done?r(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,c)}s((i=i.apply(n,t||[])).next())}))}Bn.isntSymbol=Bn.isSymbol=void 0,Bn.isSymbol=kn,Bn.isntSymbol=function(n){return!kn(n)},function(n){var t=i&&i.__createBinding||(Object.create?function(n,t,e,i){void 0===i&&(i=e);var r=Object.getOwnPropertyDescriptor(t,e);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(n,i,r)}:function(n,t,e,i){void 0===i&&(i=e),n[i]=t[e]}),e=i&&i.__exportStar||function(n,e){for(var i in n)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||t(e,n,i)};e(o,n),e(c,n),e(g,n),e(j,n),e(I,n),e(_,n),e(E,n),e(M,n),e(A,n),e(d,n),e(B,n),e(J,n),e(s,n),e(R,n),e(z,n),e(Tn,n),e(P,n),e(f,n),e(xn,n),e(An,n),e(Bn,n)}(r);var Ln={},Un={};Un.go=void 0,Un.go=function(n){return n()};var Jn={};Jn.goMicrotask=void 0,Jn.goMicrotask=function(n){return new Promise(((t,e)=>{queueMicrotask((async()=>{try{t(await n())}catch(n){e(n)}}))}))};var Rn={},Cn={},qn={},zn={},Gn={};Gn.random=void 0,Gn.random=function(n,t){return Math.random()*(t-n)+n};var Hn={};Hn.randomInt=void 0,Hn.randomInt=function(n,t){return n=Math.ceil(n),t=Math.floor(t),Math.floor(Math.random()*(t-n))+n};var Kn={};Kn.randomIntInclusive=void 0,Kn.randomIntInclusive=function(n,t){return n=Math.ceil(n),t=Math.floor(t),Math.floor(Math.random()*(t-n+1))+n},function(n){var t=i&&i.__createBinding||(Object.create?function(n,t,e,i){void 0===i&&(i=e),Object.defineProperty(n,i,{enumerable:!0,get:function(){return t[e]}})}:function(n,t,e,i){void 0===i&&(i=e),n[i]=t[e]}),e=i&&i.__exportStar||function(n,e){for(var i in n)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||t(e,n,i)};e(Gn,n),e(Hn,n),e(Kn,n)}(zn),qn.calculateExponentialBackoffTimeout=void 0;const Qn=zn;qn.calculateExponentialBackoffTimeout=function({baseTimeout:n,retries:t,maxTimeout:e=1/0,factor:i=2,jitter:r=!0}){const o=Math.min(i**t*n,e);return r?(0,Qn.randomIntInclusive)(0,o):o};var Vn={};Vn.setTimeout=void 0,Vn.setTimeout=function(n,t){const e=globalThis.setTimeout(t,n);return()=>clearTimeout(e)};var Wn={setSchedule:void 0};const Xn=Vn;Wn.setSchedule=function(n,t){const e=n-Date.now();return(0,Xn.setTimeout)(e,t)};var Yn={};Yn.setInterval=void 0,Yn.setInterval=function(n,t){const e=globalThis.setInterval(t,n);return()=>clearInterval(e)};var Zn={setImmediate:void 0};const $n=Vn;Zn.setImmediate=function(n){if(globalThis.setImmediate){const t=globalThis.setImmediate(n);return()=>clearImmediate(t)}return(0,$n.setTimeout)(0,n)};var nt={setTimeoutLoop:void 0};const tt=Vn;nt.setTimeoutLoop=function(n,t){let e=!1,i=(0,tt.setTimeout)(n,(async function r(){await t(),e||(i=(0,tt.setTimeout)(n,r))}));return()=>{e=!0,i()}};var et={setDynamicTimeoutLoop:void 0};const it=Vn;et.setDynamicTimeoutLoop=function(n,t){let e=!1,i=(0,it.setTimeout)(n,(async function r(){const o=Date.now();await t();const u=Date.now()-o;e||(i=(0,it.setTimeout)(Math.max(n-u,0),r))}));return()=>{e=!0,i()}},function(n){var t=i&&i.__createBinding||(Object.create?function(n,t,e,i){void 0===i&&(i=e),Object.defineProperty(n,i,{enumerable:!0,get:function(){return t[e]}})}:function(n,t,e,i){void 0===i&&(i=e),n[i]=t[e]}),e=i&&i.__exportStar||function(n,e){for(var i in n)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||t(e,n,i)};e(qn,n),e(Vn,n),e(Wn,n),e(Yn,n),e(Zn,n),e(nt,n),e(et,n)}(Cn),Rn.goMacrotask=void 0;const rt=Cn;Rn.goMacrotask=function(n){return new Promise(((t,e)=>{(0,rt.setImmediate)((async()=>{try{t(await n())}catch(n){e(n)}}))}))},function(n){var t=i&&i.__createBinding||(Object.create?function(n,t,e,i){void 0===i&&(i=e);var r=Object.getOwnPropertyDescriptor(t,e);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(n,i,r)}:function(n,t,e,i){void 0===i&&(i=e),n[i]=t[e]}),e=i&&i.__exportStar||function(n,e){for(var i in n)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||t(e,n,i)};e(Un,n),e(Jn,n),e(Rn,n)}(Ln),n.group=function(...n){const[t,e]=Ln.go((()=>{if(1===n.length){const[t]=n;return[void 0,t]}{const[t,e]=n;return[t,e]}}));r.isUndefined(t)?console.group():console.group(t);const i=e();return console.groupEnd(),i},n.log=function(...n){return console.log(...n),n[n.length-1]},n.time=function(n,i){const o=t(),u=i();if(r.isPromiseLike(u))return u.then((()=>{const i=t();return console.log(n,e(o,i)),u}));{const i=t();return console.log(n,e(o,i)),u}},n.timeAsyncFunction=function(n,i){return function(...r){return Dn(this,void 0,void 0,(function*(){const o=t(),u=yield i(...r),c=t();return console.log(n,e(o,c)),u}))}},n.timeFunction=function(n,i){return function(...r){const o=t(),u=i(...r),c=t();return console.log(n,e(o,c)),u}},Object.defineProperty(n,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.min.js.map

@@ -21,3 +21,3 @@ (function (global, factory) {

var es2018 = {};
var es2018$3 = {};

@@ -587,42 +587,68 @@ var array = {};

var regexp = {};
regexp.isntRegExp = regexp.isRegExp = void 0;
function isRegExp(val) {
return val instanceof RegExp;
}
regexp.isRegExp = isRegExp;
function isntRegExp(val) {
return !isRegExp(val);
}
regexp.isntRegExp = isntRegExp;
var symbol = {};
symbol.isntSymbol = symbol.isSymbol = void 0;
function isSymbol(val) {
return typeof val === 'symbol';
}
symbol.isSymbol = isSymbol;
function isntSymbol(val) {
return !isSymbol(val);
}
symbol.isntSymbol = isntSymbol;
(function (exports) {
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};__exportStar(array, exports);
__exportStar(asyncIterable, exports);
__exportStar(bigint, exports);
__exportStar(boolean, exports);
__exportStar(char, exports);
__exportStar(date, exports);
__exportStar(_enum, exports);
__exportStar(error, exports);
__exportStar(falsy, exports);
__exportStar(_function, exports);
__exportStar(iterable, exports);
__exportStar(json, exports);
__exportStar(_null, exports);
__exportStar(number, exports);
__exportStar(object, exports);
__exportStar(promise, exports);
__exportStar(string, exports);
__exportStar(_undefined, exports);
__exportStar(url, exports);
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};__exportStar(array, exports);
__exportStar(asyncIterable, exports);
__exportStar(bigint, exports);
__exportStar(boolean, exports);
__exportStar(char, exports);
__exportStar(date, exports);
__exportStar(_enum, exports);
__exportStar(error, exports);
__exportStar(falsy, exports);
__exportStar(_function, exports);
__exportStar(iterable, exports);
__exportStar(json, exports);
__exportStar(_null, exports);
__exportStar(number, exports);
__exportStar(object, exports);
__exportStar(promise, exports);
__exportStar(string, exports);
__exportStar(_undefined, exports);
__exportStar(url, exports);
__exportStar(regexp, exports);
__exportStar(symbol, exports);
} (es2018$3));
}(es2018));
function time(message, fn) {
const startTime = now();
const result = fn();
if (es2018.isPromiseLike(result)) {
if (es2018$3.isPromiseLike(result)) {
return result.then(() => {

@@ -661,2 +687,259 @@ const endTime = now();

var es2018$2 = {};
var go$1 = {};
go$1.go = void 0;
function go(fn) {
return fn();
}
go$1.go = go;
var goMicrotask$1 = {};
goMicrotask$1.goMicrotask = void 0;
function goMicrotask(fn) {
return new Promise((resolve, reject) => {
queueMicrotask(async () => {
try {
resolve(await fn());
}
catch (e) {
reject(e);
}
});
});
}
goMicrotask$1.goMicrotask = goMicrotask;
var goMacrotask$1 = {};
var es2018$1 = {};
var exponentialBackoff = {};
var es2018 = {};
var random$1 = {};
random$1.random = void 0;
function random(min, max) {
return Math.random() * (max - min) + min;
}
random$1.random = random;
var randomInt$1 = {};
randomInt$1.randomInt = void 0;
function randomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min;
}
randomInt$1.randomInt = randomInt;
var randomIntInclusive$1 = {};
randomIntInclusive$1.randomIntInclusive = void 0;
function randomIntInclusive(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}
randomIntInclusive$1.randomIntInclusive = randomIntInclusive;
(function (exports) {
var __createBinding = (commonjsGlobal && commonjsGlobal.__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 = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};__exportStar(random$1, exports);
__exportStar(randomInt$1, exports);
__exportStar(randomIntInclusive$1, exports);
} (es2018));
exponentialBackoff.calculateExponentialBackoffTimeout = void 0;
const extra_rand_1 = es2018;
function calculateExponentialBackoffTimeout({ baseTimeout, retries, maxTimeout = Infinity, factor = 2, jitter = true }) {
const timeout = Math.min(factor ** retries * baseTimeout, maxTimeout);
if (jitter) {
return (0, extra_rand_1.randomIntInclusive)(0, timeout);
}
else {
return timeout;
}
}
exponentialBackoff.calculateExponentialBackoffTimeout = calculateExponentialBackoffTimeout;
var setTimeout$1 = {};
setTimeout$1.setTimeout = void 0;
function setTimeout(timeout, cb) {
const timer = globalThis.setTimeout(cb, timeout);
return () => clearTimeout(timer);
}
setTimeout$1.setTimeout = setTimeout;
var setSchedule$1 = {};
setSchedule$1.setSchedule = void 0;
const set_timeout_1$3 = setTimeout$1;
function setSchedule(timestamp, cb) {
const timeout = timestamp - Date.now();
return (0, set_timeout_1$3.setTimeout)(timeout, cb);
}
setSchedule$1.setSchedule = setSchedule;
var setInterval$1 = {};
setInterval$1.setInterval = void 0;
function setInterval(timeout, cb) {
const timer = globalThis.setInterval(cb, timeout);
return () => clearInterval(timer);
}
setInterval$1.setInterval = setInterval;
var setImmediate$1 = {};
setImmediate$1.setImmediate = void 0;
const set_timeout_1$2 = setTimeout$1;
function setImmediate(cb) {
if (globalThis.setImmediate) {
const timer = globalThis.setImmediate(cb);
return () => clearImmediate(timer);
}
else {
return (0, set_timeout_1$2.setTimeout)(0, cb);
}
}
setImmediate$1.setImmediate = setImmediate;
var setTimeoutLoop$1 = {};
setTimeoutLoop$1.setTimeoutLoop = void 0;
const set_timeout_1$1 = setTimeout$1;
function setTimeoutLoop(timeout, cb) {
let isCancelled = false;
let cancel = (0, set_timeout_1$1.setTimeout)(timeout, loop);
return () => {
isCancelled = true;
cancel();
};
async function loop() {
await cb();
if (!isCancelled) {
cancel = (0, set_timeout_1$1.setTimeout)(timeout, loop);
}
}
}
setTimeoutLoop$1.setTimeoutLoop = setTimeoutLoop;
var setDynamicTimeoutLoop$1 = {};
setDynamicTimeoutLoop$1.setDynamicTimeoutLoop = void 0;
const set_timeout_1 = setTimeout$1;
function setDynamicTimeoutLoop(timeout, cb) {
let isCancelled = false;
let cancel = (0, set_timeout_1.setTimeout)(timeout, loop);
return () => {
isCancelled = true;
cancel();
};
async function loop() {
const start = Date.now();
await cb();
const elapsed = Date.now() - start;
if (!isCancelled) {
cancel = (0, set_timeout_1.setTimeout)(Math.max(timeout - elapsed, 0), loop);
}
}
}
setDynamicTimeoutLoop$1.setDynamicTimeoutLoop = setDynamicTimeoutLoop;
(function (exports) {
var __createBinding = (commonjsGlobal && commonjsGlobal.__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 = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};__exportStar(exponentialBackoff, exports);
__exportStar(setTimeout$1, exports);
__exportStar(setSchedule$1, exports);
__exportStar(setInterval$1, exports);
__exportStar(setImmediate$1, exports);
__exportStar(setTimeoutLoop$1, exports);
__exportStar(setDynamicTimeoutLoop$1, exports);
} (es2018$1));
goMacrotask$1.goMacrotask = void 0;
const extra_timers_1 = es2018$1;
function goMacrotask(fn) {
return new Promise((resolve, reject) => {
(0, extra_timers_1.setImmediate)(async () => {
try {
resolve(await fn());
}
catch (e) {
reject(e);
}
});
});
}
goMacrotask$1.goMacrotask = goMacrotask;
(function (exports) {
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};__exportStar(go$1, exports);
__exportStar(goMicrotask$1, exports);
__exportStar(goMacrotask$1, exports);
} (es2018$2));
function group(...args) {
const [label, fn] = es2018$2.go(() => {
if (args.length === 1) {
const [fn] = args;
return [undefined, fn];
}
else {
const [label, fn] = args;
return [label, fn];
}
});
// 由于一些控制台会将undefined参数显示为'undefined', 在此确保在undefined时不传入参数.
if (es2018$3.isUndefined(label)) {
console.group();
}
else {
console.group(label);
}
const result = fn();
console.groupEnd();
return result;
}
exports.group = group;
exports.log = log;

@@ -663,0 +946,0 @@ exports.time = time;

@@ -1,2 +0,2 @@

!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).Log={})}(this,(function(n){"use strict";function t(){return performance.now()}function i(n,t){return t-n+"ms"}var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={},o={};function u(n){return Array.isArray(n)}o.isntEmptyArray=o.isEmptyArray=o.isntArray=o.isArray=void 0,o.isArray=u,o.isntArray=function(n){return!u(n)},o.isEmptyArray=function(n){return 0===n.length},o.isntEmptyArray=function(n){return 0!==n.length};var s={},c={};function f(n){return null===n}c.isntNull=c.isNull=void 0,c.isNull=f,c.isntNull=function(n){return!f(n)};var a={};function l(n){return void 0===n}a.isntUndefined=a.isUndefined=void 0,a.isUndefined=l,a.isntUndefined=function(n){return!l(n)};var b={};function y(n){return"function"==typeof n}b.isntFunction=b.isFunction=void 0,b.isFunction=y,b.isntFunction=function(n){return!y(n)},s.isntAsyncIterable=s.isAsyncIterable=void 0;const d=c,v=a,p=b;function g(n){return(0,d.isntNull)(n)&&(0,v.isntUndefined)(n)&&(0,p.isFunction)(n[Symbol.asyncIterator])}s.isAsyncIterable=g,s.isntAsyncIterable=function(n){return!g(n)};var j={};function O(n){return"bigint"==typeof n}j.isntBigInt=j.isBigInt=void 0,j.isBigInt=O,j.isntBigInt=function(n){return!O(n)};var m={};function N(n){return"boolean"==typeof n}m.isntBoolean=m.isBoolean=void 0,m.isBoolean=N,m.isntBoolean=function(n){return!N(n)};var h={},P={};function A(n){return"string"==typeof n}P.isntString=P.isString=void 0,P.isString=A,P.isntString=function(n){return!A(n)},h.isntChar=h.isChar=void 0;const F=P;function I(n){return(0,F.isString)(n)&&1===n.length}h.isChar=I,h.isntChar=function(n){return!I(n)};var S={};function E(n){return n instanceof Date}S.isntDate=S.isDate=void 0,S.isDate=E,S.isntDate=function(n){return!E(n)};var w={};w.inEnum=void 0,w.inEnum=function(n,t){return Object.values(t).includes(n)};var _={};function B(n){return n instanceof Error}_.isntError=_.isError=void 0,_.isError=B,_.isntError=function(n){return!B(n)};var U={};function J(n){return!n}U.isntFalsy=U.isFalsy=void 0,U.isFalsy=J,U.isntFalsy=function(n){return!J(n)};var L={};L.isntIterable=L.isIterable=void 0;const k=c,D=a,T=b;function x(n){return(0,k.isntNull)(n)&&(0,D.isntUndefined)(n)&&(0,T.isFunction)(n[Symbol.iterator])}L.isIterable=x,L.isntIterable=function(n){return!x(n)};var C={},M={};function R(n){return"number"==typeof n}function q(n){return Number.isNaN(n)}M.isntNaN=M.isNaN=M.isNegativeInfinity=M.isPositiveInfinity=M.isFinite=M.isntNumber=M.isNumber=void 0,M.isNumber=R,M.isntNumber=function(n){return!R(n)},M.isFinite=function(n){return Number.isFinite(n)},M.isPositiveInfinity=function(n){return n===1/0},M.isNegativeInfinity=function(n){return n===-1/0},M.isNaN=q,M.isntNaN=function(n){return!q(n)};var z={},G="object"==typeof e&&e&&e.Object===Object&&e,H="object"==typeof self&&self&&self.Object===Object&&self,K=(G||H||Function("return this")()).Symbol,Q=K,V=Object.prototype,W=V.hasOwnProperty,X=V.toString,Y=Q?Q.toStringTag:void 0;var Z=function(n){var t=W.call(n,Y),i=n[Y];try{n[Y]=void 0;var e=!0}catch(n){}var r=X.call(n);return e&&(t?n[Y]=i:delete n[Y]),r},$=Object.prototype.toString;var nn=Z,tn=function(n){return $.call(n)},en=K?K.toStringTag:void 0;var rn=function(n){return null==n?void 0===n?"[object Undefined]":"[object Null]":en&&en in Object(n)?nn(n):tn(n)};var on=function(n,t){return function(i){return n(t(i))}}(Object.getPrototypeOf,Object);var un=rn,sn=on,cn=function(n){return null!=n&&"object"==typeof n},fn=Function.prototype,an=Object.prototype,ln=fn.toString,bn=an.hasOwnProperty,yn=ln.call(Object);var dn=function(n){if(!cn(n)||"[object Object]"!=un(n))return!1;var t=sn(n);if(null===t)return!0;var i=bn.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&ln.call(i)==yn},vn=e&&e.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};z.isntEmptyObject=z.isEmptyObject=z.isntPlainObject=z.isPlainObject=z.isntObject=z.isObject=void 0;const pn=vn(dn);function gn(n){return null!==n&&"object"==typeof n}function jn(n){return(0,pn.default)(n)}z.isObject=gn,z.isntObject=function(n){return!gn(n)},z.isPlainObject=jn,z.isntPlainObject=function(n){return!jn(n)},z.isEmptyObject=function(n){return 0===Object.keys(n).length},z.isntEmptyObject=function(n){return 0!==Object.keys(n).length},C.isntJsonable=C.isJsonable=C.isntJson=C.isJson=void 0;const On=c,mn=m,Nn=P,hn=M,Pn=o,An=z;function Fn(n){return(0,On.isNull)(n)||(0,mn.isBoolean)(n)||(0,Nn.isString)(n)||(0,hn.isNumber)(n)||(0,Pn.isArray)(n)&&n.every(Fn)||(0,An.isPlainObject)(n)&&Object.values(n).every(Fn)}C.isJson=Fn,C.isntJson=function(n){return!Fn(n)},C.isJsonable=function(n){try{return JSON.stringify(n),!0}catch(n){return!1}},C.isntJsonable=function n(t){return!n()};var In={};In.isPromiseLike=In.isntPromiseLike=In.isntPromise=In.isPromise=void 0;const Sn=z,En=b;function wn(n){return n instanceof Promise}function _n(n){return(0,Sn.isObject)(n)&&(0,En.isFunction)(n.then)}In.isPromise=wn,In.isntPromise=function(n){return!wn(n)},In.isntPromiseLike=function(n){return!_n(n)},In.isPromiseLike=_n;var Bn={};Bn.isAbsoluteURL=void 0,Bn.isAbsoluteURL=function(n){try{return new URL(n),!0}catch(n){return!1}},function(n){var t=e&&e.__createBinding||(Object.create?function(n,t,i,e){void 0===e&&(e=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(n,e,r)}:function(n,t,i,e){void 0===e&&(e=i),n[e]=t[i]}),i=e&&e.__exportStar||function(n,i){for(var e in n)"default"===e||Object.prototype.hasOwnProperty.call(i,e)||t(i,n,e)};i(o,n),i(s,n),i(j,n),i(m,n),i(h,n),i(S,n),i(w,n),i(_,n),i(U,n),i(b,n),i(L,n),i(C,n),i(c,n),i(M,n),i(z,n),i(In,n),i(P,n),i(a,n),i(Bn,n)}(r),n.log=function(...n){return console.log(...n),n[n.length-1]},n.time=function(n,e){const o=t(),u=e();if(r.isPromiseLike(u))return u.then((()=>{const e=t();return console.log(n,i(o,e)),u}));{const e=t();return console.log(n,i(o,e)),u}},n.timeAsyncFunction=function(n,e){return async function(...r){const o=t(),u=await e(...r),s=t();return console.log(n,i(o,s)),u}},n.timeFunction=function(n,e){return function(...r){const o=t(),u=e(...r),s=t();return console.log(n,i(o,s)),u}},Object.defineProperty(n,"__esModule",{value:!0})}));
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).Log={})}(this,(function(t){"use strict";function n(){return performance.now()}function e(t,n){return n-t+"ms"}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={},o={};function u(t){return Array.isArray(t)}o.isntEmptyArray=o.isEmptyArray=o.isntArray=o.isArray=void 0,o.isArray=u,o.isntArray=function(t){return!u(t)},o.isEmptyArray=function(t){return 0===t.length},o.isntEmptyArray=function(t){return 0!==t.length};var c={},s={};function a(t){return null===t}s.isntNull=s.isNull=void 0,s.isNull=a,s.isntNull=function(t){return!a(t)};var f={};function l(t){return void 0===t}f.isntUndefined=f.isUndefined=void 0,f.isUndefined=l,f.isntUndefined=function(t){return!l(t)};var d={};function v(t){return"function"==typeof t}d.isntFunction=d.isFunction=void 0,d.isFunction=v,d.isntFunction=function(t){return!v(t)},c.isntAsyncIterable=c.isAsyncIterable=void 0;const b=s,y=f,m=d;function p(t){return(0,b.isntNull)(t)&&(0,y.isntUndefined)(t)&&(0,m.isFunction)(t[Symbol.asyncIterator])}c.isAsyncIterable=p,c.isntAsyncIterable=function(t){return!p(t)};var g={};function O(t){return"bigint"==typeof t}g.isntBigInt=g.isBigInt=void 0,g.isBigInt=O,g.isntBigInt=function(t){return!O(t)};var j={};function h(t){return"boolean"==typeof t}j.isntBoolean=j.isBoolean=void 0,j.isBoolean=h,j.isntBoolean=function(t){return!h(t)};var I={},P={};function N(t){return"string"==typeof t}P.isntString=P.isString=void 0,P.isString=N,P.isntString=function(t){return!N(t)},I.isntChar=I.isChar=void 0;const T=P;function w(t){return(0,T.isString)(t)&&1===t.length}I.isChar=w,I.isntChar=function(t){return!w(t)};var _={};function S(t){return t instanceof Date}_.isntDate=_.isDate=void 0,_.isDate=S,_.isntDate=function(t){return!S(t)};var E={};E.inEnum=void 0,E.inEnum=function(t,n){return Object.values(n).includes(t)};var M={};function A(t){return t instanceof Error}M.isntError=M.isError=void 0,M.isError=A,M.isntError=function(t){return!A(t)};var F={};function x(t){return!t}F.isntFalsy=F.isFalsy=void 0,F.isFalsy=x,F.isntFalsy=function(t){return!x(t)};var B={};B.isntIterable=B.isIterable=void 0;const k=s,D=f,L=d;function U(t){return(0,k.isntNull)(t)&&(0,D.isntUndefined)(t)&&(0,L.isFunction)(t[Symbol.iterator])}B.isIterable=U,B.isntIterable=function(t){return!U(t)};var J={},R={};function C(t){return"number"==typeof t}function q(t){return Number.isNaN(t)}R.isntNaN=R.isNaN=R.isNegativeInfinity=R.isPositiveInfinity=R.isFinite=R.isntNumber=R.isNumber=void 0,R.isNumber=C,R.isntNumber=function(t){return!C(t)},R.isFinite=function(t){return Number.isFinite(t)},R.isPositiveInfinity=function(t){return t===1/0},R.isNegativeInfinity=function(t){return t===-1/0},R.isNaN=q,R.isntNaN=function(t){return!q(t)};var z={},G="object"==typeof i&&i&&i.Object===Object&&i,H="object"==typeof self&&self&&self.Object===Object&&self,K=(G||H||Function("return this")()).Symbol,Q=K,V=Object.prototype,W=V.hasOwnProperty,X=V.toString,Y=Q?Q.toStringTag:void 0;var Z=function(t){var n=W.call(t,Y),e=t[Y];try{t[Y]=void 0;var i=!0}catch(t){}var r=X.call(t);return i&&(n?t[Y]=e:delete t[Y]),r},$=Object.prototype.toString;var tt=Z,nt=function(t){return $.call(t)},et=K?K.toStringTag:void 0;var it=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":et&&et in Object(t)?tt(t):nt(t)};var rt=function(t,n){return function(e){return t(n(e))}}(Object.getPrototypeOf,Object);var ot=it,ut=rt,ct=function(t){return null!=t&&"object"==typeof t},st=Function.prototype,at=Object.prototype,ft=st.toString,lt=at.hasOwnProperty,dt=ft.call(Object);var vt=function(t){if(!ct(t)||"[object Object]"!=ot(t))return!1;var n=ut(t);if(null===n)return!0;var e=lt.call(n,"constructor")&&n.constructor;return"function"==typeof e&&e instanceof e&&ft.call(e)==dt},bt=i&&i.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};z.isntEmptyObject=z.isEmptyObject=z.isntPlainObject=z.isPlainObject=z.isntObject=z.isObject=void 0;const yt=bt(vt);function mt(t){return null!==t&&"object"==typeof t}function pt(t){return(0,yt.default)(t)}z.isObject=mt,z.isntObject=function(t){return!mt(t)},z.isPlainObject=pt,z.isntPlainObject=function(t){return!pt(t)},z.isEmptyObject=function(t){return 0===Object.keys(t).length},z.isntEmptyObject=function(t){return 0!==Object.keys(t).length},J.isntJsonable=J.isJsonable=J.isntJson=J.isJson=void 0;const gt=s,Ot=j,jt=P,ht=R,It=o,Pt=z;function Nt(t){return(0,gt.isNull)(t)||(0,Ot.isBoolean)(t)||(0,jt.isString)(t)||(0,ht.isNumber)(t)||(0,It.isArray)(t)&&t.every(Nt)||(0,Pt.isPlainObject)(t)&&Object.values(t).every(Nt)}J.isJson=Nt,J.isntJson=function(t){return!Nt(t)},J.isJsonable=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},J.isntJsonable=function t(n){return!t()};var Tt={};Tt.isPromiseLike=Tt.isntPromiseLike=Tt.isntPromise=Tt.isPromise=void 0;const wt=z,_t=d;function St(t){return t instanceof Promise}function Et(t){return(0,wt.isObject)(t)&&(0,_t.isFunction)(t.then)}Tt.isPromise=St,Tt.isntPromise=function(t){return!St(t)},Tt.isntPromiseLike=function(t){return!Et(t)},Tt.isPromiseLike=Et;var Mt={};Mt.isAbsoluteURL=void 0,Mt.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}};var At={};function Ft(t){return t instanceof RegExp}At.isntRegExp=At.isRegExp=void 0,At.isRegExp=Ft,At.isntRegExp=function(t){return!Ft(t)};var xt={};function Bt(t){return"symbol"==typeof t}xt.isntSymbol=xt.isSymbol=void 0,xt.isSymbol=Bt,xt.isntSymbol=function(t){return!Bt(t)},function(t){var n=i&&i.__createBinding||(Object.create?function(t,n,e,i){void 0===i&&(i=e);var r=Object.getOwnPropertyDescriptor(n,e);r&&!("get"in r?!n.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return n[e]}}),Object.defineProperty(t,i,r)}:function(t,n,e,i){void 0===i&&(i=e),t[i]=n[e]}),e=i&&i.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};e(o,t),e(c,t),e(g,t),e(j,t),e(I,t),e(_,t),e(E,t),e(M,t),e(F,t),e(d,t),e(B,t),e(J,t),e(s,t),e(R,t),e(z,t),e(Tt,t),e(P,t),e(f,t),e(Mt,t),e(At,t),e(xt,t)}(r);var kt={},Dt={};Dt.go=void 0,Dt.go=function(t){return t()};var Lt={};Lt.goMicrotask=void 0,Lt.goMicrotask=function(t){return new Promise(((n,e)=>{queueMicrotask((async()=>{try{n(await t())}catch(t){e(t)}}))}))};var Ut={},Jt={},Rt={},Ct={},qt={};qt.random=void 0,qt.random=function(t,n){return Math.random()*(n-t)+t};var zt={};zt.randomInt=void 0,zt.randomInt=function(t,n){return t=Math.ceil(t),n=Math.floor(n),Math.floor(Math.random()*(n-t))+t};var Gt={};Gt.randomIntInclusive=void 0,Gt.randomIntInclusive=function(t,n){return t=Math.ceil(t),n=Math.floor(n),Math.floor(Math.random()*(n-t+1))+t},function(t){var n=i&&i.__createBinding||(Object.create?function(t,n,e,i){void 0===i&&(i=e),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,i){void 0===i&&(i=e),t[i]=n[e]}),e=i&&i.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};e(qt,t),e(zt,t),e(Gt,t)}(Ct),Rt.calculateExponentialBackoffTimeout=void 0;const Ht=Ct;Rt.calculateExponentialBackoffTimeout=function({baseTimeout:t,retries:n,maxTimeout:e=1/0,factor:i=2,jitter:r=!0}){const o=Math.min(i**n*t,e);return r?(0,Ht.randomIntInclusive)(0,o):o};var Kt={};Kt.setTimeout=void 0,Kt.setTimeout=function(t,n){const e=globalThis.setTimeout(n,t);return()=>clearTimeout(e)};var Qt={setSchedule:void 0};const Vt=Kt;Qt.setSchedule=function(t,n){const e=t-Date.now();return(0,Vt.setTimeout)(e,n)};var Wt={};Wt.setInterval=void 0,Wt.setInterval=function(t,n){const e=globalThis.setInterval(n,t);return()=>clearInterval(e)};var Xt={setImmediate:void 0};const Yt=Kt;Xt.setImmediate=function(t){if(globalThis.setImmediate){const n=globalThis.setImmediate(t);return()=>clearImmediate(n)}return(0,Yt.setTimeout)(0,t)};var Zt={setTimeoutLoop:void 0};const $t=Kt;Zt.setTimeoutLoop=function(t,n){let e=!1,i=(0,$t.setTimeout)(t,(async function r(){await n(),e||(i=(0,$t.setTimeout)(t,r))}));return()=>{e=!0,i()}};var tn={setDynamicTimeoutLoop:void 0};const nn=Kt;tn.setDynamicTimeoutLoop=function(t,n){let e=!1,i=(0,nn.setTimeout)(t,(async function r(){const o=Date.now();await n();const u=Date.now()-o;e||(i=(0,nn.setTimeout)(Math.max(t-u,0),r))}));return()=>{e=!0,i()}},function(t){var n=i&&i.__createBinding||(Object.create?function(t,n,e,i){void 0===i&&(i=e),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,i){void 0===i&&(i=e),t[i]=n[e]}),e=i&&i.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};e(Rt,t),e(Kt,t),e(Qt,t),e(Wt,t),e(Xt,t),e(Zt,t),e(tn,t)}(Jt),Ut.goMacrotask=void 0;const en=Jt;Ut.goMacrotask=function(t){return new Promise(((n,e)=>{(0,en.setImmediate)((async()=>{try{n(await t())}catch(t){e(t)}}))}))},function(t){var n=i&&i.__createBinding||(Object.create?function(t,n,e,i){void 0===i&&(i=e);var r=Object.getOwnPropertyDescriptor(n,e);r&&!("get"in r?!n.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return n[e]}}),Object.defineProperty(t,i,r)}:function(t,n,e,i){void 0===i&&(i=e),t[i]=n[e]}),e=i&&i.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};e(Dt,t),e(Lt,t),e(Ut,t)}(kt),t.group=function(...t){const[n,e]=kt.go((()=>{if(1===t.length){const[n]=t;return[void 0,n]}{const[n,e]=t;return[n,e]}}));r.isUndefined(n)?console.group():console.group(n);const i=e();return console.groupEnd(),i},t.log=function(...t){return console.log(...t),t[t.length-1]},t.time=function(t,i){const o=n(),u=i();if(r.isPromiseLike(u))return u.then((()=>{const i=n();return console.log(t,e(o,i)),u}));{const i=n();return console.log(t,e(o,i)),u}},t.timeAsyncFunction=function(t,i){return async function(...r){const o=n(),u=await i(...r),c=n();return console.log(t,e(o,c)),u}},t.timeFunction=function(t,i){return function(...r){const o=n(),u=i(...r),c=n();return console.log(t,e(o,c)),u}},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.min.js.map

@@ -5,1 +5,2 @@ export * from './log';

export * from './time-async-function';
export * from './group';

@@ -21,2 +21,3 @@ "use strict";

__exportStar(require("./time-async-function"), exports);
__exportStar(require("./group"), exports);
//# sourceMappingURL=index.js.map

@@ -5,1 +5,2 @@ export * from './log';

export * from './time-async-function';
export * from './group';

@@ -21,2 +21,3 @@ "use strict";

__exportStar(require("./time-async-function"), exports);
__exportStar(require("./group"), exports);
//# sourceMappingURL=index.js.map
{
"name": "@blackglory/log",
"version": "1.2.0",
"version": "1.3.0",
"description": "",

@@ -45,15 +45,15 @@ "keywords": [],

"devDependencies": {
"@commitlint/cli": "^16.2.3",
"@commitlint/config-conventional": "^16.2.1",
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-commonjs": "^21.1.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.2.1",
"@rollup/plugin-replace": "^4.0.0",
"@rollup/plugin-typescript": "^8.3.2",
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@rollup/plugin-alias": "^4.0.0",
"@rollup/plugin-commonjs": "^23.0.0",
"@rollup/plugin-json": "^5.0.0",
"@rollup/plugin-node-resolve": "^15.0.0",
"@rollup/plugin-replace": "^5.0.0",
"@rollup/plugin-typescript": "^9.0.0",
"@types/jest": "^27.4.1",
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"eslint": "^8.13.0",
"extra-promise": "^1.0.2",
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
"eslint": "^8.25.0",
"extra-promise": "^3.2.2",
"husky": "4",

@@ -63,6 +63,6 @@ "jest": "^27.5.1",

"rimraf": "^3.0.2",
"rollup": "^2.70.2",
"rollup": "^2.79.1",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-terser": "^7.0.2",
"standard-version": "^9.3.2",
"standard-version": "^9.5.0",
"ts-jest": "^27.1.4",

@@ -74,4 +74,5 @@ "tscpaths": "^0.0.9",

"dependencies": {
"@blackglory/types": "^1.1.0"
"@blackglory/go": "^1.1.2",
"@blackglory/types": "^1.3.0"
}
}

@@ -45,1 +45,7 @@ # log

```
### group
```ts
function group<T>(label: string, fn: () => T): T
function group<T>(fn: () => T): T
```

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

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

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc