Comparing version 7.0.4 to 7.0.5
import type { RoarrGlobalState } from './types'; | ||
declare const ROARR: RoarrGlobalState; | ||
declare const Roarr: import("./types").Logger; | ||
export type { Logger, Message, TranslateMessageFunction, MessageEventHandler, } from './types'; | ||
export { ROARR, }; | ||
declare const _default: import("./types").Logger; | ||
export default _default; | ||
export { Roarr, ROARR, }; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ROARR = void 0; | ||
exports.ROARR = exports.Roarr = void 0; | ||
const globalthis_1 = __importDefault(require("globalthis")); | ||
@@ -14,3 +14,3 @@ const factories_1 = require("./factories"); | ||
const logFactory = factories_1.createLogger; | ||
exports.default = logFactory((message) => { | ||
const Roarr = logFactory((message) => { | ||
if (ROARR.write) { | ||
@@ -23,1 +23,2 @@ // Stringify message as soon as it is received to prevent | ||
}); | ||
exports.Roarr = Roarr; |
import type { Logger, MessageContext, MessageEventHandler } from '../types'; | ||
declare const createLogger: (onMessage: MessageEventHandler, parentContext?: MessageContext) => Logger; | ||
export default createLogger; | ||
export declare const createLogger: (onMessage: MessageEventHandler, parentContext?: MessageContext) => Logger; |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createLogger = void 0; | ||
const fast_printf_1 = require("fast-printf"); | ||
@@ -85,3 +86,3 @@ const globalthis_1 = __importDefault(require("globalthis")); | ||
if (typeof context === 'function') { | ||
return createLogger((message) => { | ||
return (0, exports.createLogger)((message) => { | ||
const nextMessage = context(message); | ||
@@ -94,3 +95,3 @@ if (typeof nextMessage !== 'object' || nextMessage === null) { | ||
} | ||
return createLogger(onMessage, { | ||
return (0, exports.createLogger)(onMessage, { | ||
...getAsyncLocalContext(), | ||
@@ -176,2 +177,2 @@ ...parentContext, | ||
}; | ||
exports.default = createLogger; | ||
exports.createLogger = createLogger; |
import type { Logger, MessageContext, MessageEventHandler } from '../types'; | ||
declare const createMockLogger: (onMessage: MessageEventHandler, parentContext?: MessageContext) => Logger; | ||
export default createMockLogger; | ||
export declare const createMockLogger: (onMessage: MessageEventHandler, parentContext?: MessageContext) => Logger; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createMockLogger = void 0; | ||
const constants_1 = require("../constants"); | ||
@@ -12,3 +13,3 @@ const createMockLogger = (onMessage, parentContext) => { | ||
log.child = (context) => { | ||
return createMockLogger(onMessage, parentContext); | ||
return (0, exports.createMockLogger)(onMessage, parentContext); | ||
}; | ||
@@ -50,2 +51,2 @@ log.getContext = () => { | ||
}; | ||
exports.default = createMockLogger; | ||
exports.createMockLogger = createMockLogger; |
import type { Writer } from '../types'; | ||
declare const _default: () => Writer; | ||
export default _default; | ||
export declare const createNodeWriter: () => Writer; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createNodeWriter = void 0; | ||
const createBlockingWriter = (stream) => { | ||
@@ -10,3 +11,3 @@ return { | ||
}; | ||
exports.default = () => { | ||
const createNodeWriter = () => { | ||
var _a; | ||
@@ -18,1 +19,2 @@ // eslint-disable-next-line node/no-process-env | ||
}; | ||
exports.createNodeWriter = createNodeWriter; |
import type { RoarrGlobalState } from '../types'; | ||
declare const _default: (currentState: any) => RoarrGlobalState; | ||
export default _default; | ||
export declare const createRoarrInitialGlobalState: (currentState: any) => RoarrGlobalState; |
@@ -6,7 +6,8 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createRoarrInitialGlobalState = void 0; | ||
const detect_node_1 = __importDefault(require("detect-node")); | ||
const semver_compare_1 = __importDefault(require("semver-compare")); | ||
const config_1 = require("../config"); | ||
const createNodeWriter_1 = __importDefault(require("./createNodeWriter")); | ||
exports.default = (currentState) => { | ||
const createNodeWriter_1 = require("./createNodeWriter"); | ||
const createRoarrInitialGlobalState = (currentState) => { | ||
const versions = (currentState.versions || []).concat(); | ||
@@ -33,3 +34,3 @@ if (versions.length > 1) { | ||
...newState, | ||
...(0, createNodeWriter_1.default)(), | ||
...(0, createNodeWriter_1.createNodeWriter)(), | ||
asyncLocalStorage, | ||
@@ -43,1 +44,2 @@ }; | ||
}; | ||
exports.createRoarrInitialGlobalState = createRoarrInitialGlobalState; |
@@ -1,3 +0,3 @@ | ||
export { default as createLogger, } from './createLogger'; | ||
export { default as createMockLogger, } from './createMockLogger'; | ||
export { default as createRoarrInitialGlobalState, } from './createRoarrInitialGlobalState'; | ||
export { createLogger, } from './createLogger'; | ||
export { createMockLogger, } from './createMockLogger'; | ||
export { createRoarrInitialGlobalState, } from './createRoarrInitialGlobalState'; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createRoarrInitialGlobalState = exports.createMockLogger = exports.createLogger = void 0; | ||
var createLogger_1 = require("./createLogger"); | ||
Object.defineProperty(exports, "createLogger", { enumerable: true, get: function () { return __importDefault(createLogger_1).default; } }); | ||
Object.defineProperty(exports, "createLogger", { enumerable: true, get: function () { return createLogger_1.createLogger; } }); | ||
var createMockLogger_1 = require("./createMockLogger"); | ||
Object.defineProperty(exports, "createMockLogger", { enumerable: true, get: function () { return __importDefault(createMockLogger_1).default; } }); | ||
Object.defineProperty(exports, "createMockLogger", { enumerable: true, get: function () { return createMockLogger_1.createMockLogger; } }); | ||
var createRoarrInitialGlobalState_1 = require("./createRoarrInitialGlobalState"); | ||
Object.defineProperty(exports, "createRoarrInitialGlobalState", { enumerable: true, get: function () { return __importDefault(createRoarrInitialGlobalState_1).default; } }); | ||
Object.defineProperty(exports, "createRoarrInitialGlobalState", { enumerable: true, get: function () { return createRoarrInitialGlobalState_1.createRoarrInitialGlobalState; } }); |
@@ -10,4 +10,4 @@ "use strict"; | ||
const globalthis_1 = __importDefault(require("globalthis")); | ||
const createLogger_1 = __importDefault(require("../../src/factories/createLogger")); | ||
const createRoarrInitialGlobalState_1 = __importDefault(require("../../src/factories/createRoarrInitialGlobalState")); | ||
const createLogger_1 = require("../../src/factories/createLogger"); | ||
const createRoarrInitialGlobalState_1 = require("../../src/factories/createRoarrInitialGlobalState"); | ||
const time = -1; | ||
@@ -18,7 +18,7 @@ const version = '2.0.0'; | ||
globalThis.ROARR = null; | ||
globalThis.ROARR = (0, createRoarrInitialGlobalState_1.default)({}); | ||
globalThis.ROARR = (0, createRoarrInitialGlobalState_1.createRoarrInitialGlobalState)({}); | ||
}); | ||
const createLoggerWithHistory = () => { | ||
const messages = []; | ||
const log = (0, createLogger_1.default)((message) => { | ||
const log = (0, createLogger_1.createLogger)((message) => { | ||
messages.push({ | ||
@@ -25,0 +25,0 @@ ...message, |
@@ -8,5 +8,5 @@ "use strict"; | ||
const config_1 = require("../../src/config"); | ||
const createRoarrInitialGlobalState_1 = __importDefault(require("../../src/factories/createRoarrInitialGlobalState")); | ||
const createRoarrInitialGlobalState_1 = require("../../src/factories/createRoarrInitialGlobalState"); | ||
(0, ava_1.default)('creates new state', (t) => { | ||
const state = (0, createRoarrInitialGlobalState_1.default)({}); | ||
const state = (0, createRoarrInitialGlobalState_1.createRoarrInitialGlobalState)({}); | ||
t.like(state, { | ||
@@ -20,3 +20,3 @@ sequence: 0, | ||
(0, ava_1.default)('respects existing sequence', (t) => { | ||
const state = (0, createRoarrInitialGlobalState_1.default)({ | ||
const state = (0, createRoarrInitialGlobalState_1.createRoarrInitialGlobalState)({ | ||
sequence: 1, | ||
@@ -32,3 +32,3 @@ }); | ||
(0, ava_1.default)('appends the latest version', (t) => { | ||
const state = (0, createRoarrInitialGlobalState_1.default)({ | ||
const state = (0, createRoarrInitialGlobalState_1.createRoarrInitialGlobalState)({ | ||
versions: [ | ||
@@ -47,7 +47,7 @@ '0.0.1', | ||
(0, ava_1.default)('sets "write" method if current is the first version', (t) => { | ||
const state = (0, createRoarrInitialGlobalState_1.default)({}); | ||
const state = (0, createRoarrInitialGlobalState_1.createRoarrInitialGlobalState)({}); | ||
t.is(typeof state.write, 'function'); | ||
}); | ||
(0, ava_1.default)('overrides "write" method if current is the latest version', (t) => { | ||
const state = (0, createRoarrInitialGlobalState_1.default)({ | ||
const state = (0, createRoarrInitialGlobalState_1.createRoarrInitialGlobalState)({ | ||
versions: [ | ||
@@ -63,3 +63,3 @@ '0.0.1', | ||
const write = () => { }; | ||
const state = (0, createRoarrInitialGlobalState_1.default)({ | ||
const state = (0, createRoarrInitialGlobalState_1.createRoarrInitialGlobalState)({ | ||
versions: [ | ||
@@ -66,0 +66,0 @@ '100.0.0', |
@@ -27,4 +27,4 @@ "use strict"; | ||
const globalthis_1 = __importDefault(require("globalthis")); | ||
const createLogger_1 = __importDefault(require("../../src/factories/createLogger")); | ||
const createRoarrInitialGlobalState_1 = __importDefault(require("../../src/factories/createRoarrInitialGlobalState")); | ||
const createLogger_1 = require("../../src/factories/createLogger"); | ||
const createRoarrInitialGlobalState_1 = require("../../src/factories/createRoarrInitialGlobalState"); | ||
const time = -1; | ||
@@ -34,7 +34,7 @@ const version = '2.0.0'; | ||
const globalThis = (0, globalthis_1.default)(); | ||
globalThis.ROARR = (0, createRoarrInitialGlobalState_1.default)({}); | ||
globalThis.ROARR = (0, createRoarrInitialGlobalState_1.createRoarrInitialGlobalState)({}); | ||
}); | ||
const createLoggerWithHistory = () => { | ||
const messages = []; | ||
const log = (0, createLogger_1.default)((message) => { | ||
const log = (0, createLogger_1.createLogger)((message) => { | ||
messages.push({ | ||
@@ -41,0 +41,0 @@ ...message, |
@@ -83,3 +83,3 @@ { | ||
"typings": "./dist/src/Roarr.d.ts", | ||
"version": "7.0.4" | ||
"version": "7.0.5" | ||
} |
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
71975
1382