@timberio/core
Advanced tools
Comparing version 0.11.0 to 0.12.0
@@ -45,3 +45,3 @@ import { ITimberLog, Pipeline } from "@timberio/types"; | ||
/** | ||
* Add a function to the pipeline | ||
* Add a middleware function to the logging pipeline | ||
* | ||
@@ -51,3 +51,3 @@ * @param fn - Function to add to the log pipeline | ||
*/ | ||
addPipeline(fn: Pipeline): void; | ||
use(fn: Pipeline): void; | ||
/** | ||
@@ -54,0 +54,0 @@ * Remove a function from the pipeline |
@@ -72,3 +72,3 @@ "use strict"; | ||
/** | ||
* Add a function to the pipeline | ||
* Add a middleware function to the logging pipeline | ||
* | ||
@@ -78,3 +78,3 @@ * @param fn - Function to add to the log pipeline | ||
*/ | ||
addPipeline(fn) { | ||
use(fn) { | ||
this._pipeline.push(fn); | ||
@@ -81,0 +81,0 @@ } |
@@ -93,3 +93,3 @@ "use strict"; | ||
// Add a custom pipeline that replaces `message` | ||
base.addPipeline(async (log) => { | ||
base.use(async (log) => { | ||
return Object.assign({}, log, { message: newMessage }); | ||
@@ -107,3 +107,3 @@ }); | ||
// Add the pipeline | ||
base.addPipeline(customPipeline); | ||
base.use(customPipeline); | ||
// Confirm that it exists in the `_pipeline` array | ||
@@ -110,0 +110,0 @@ expect(base._pipeline).toContain(customPipeline); |
@@ -45,3 +45,3 @@ import { ITimberLog, Pipeline } from "@timberio/types"; | ||
/** | ||
* Add a function to the pipeline | ||
* Add a middleware function to the logging pipeline | ||
* | ||
@@ -51,3 +51,3 @@ * @param fn - Function to add to the log pipeline | ||
*/ | ||
addPipeline(fn: Pipeline): void; | ||
use(fn: Pipeline): void; | ||
/** | ||
@@ -54,0 +54,0 @@ * Remove a function from the pipeline |
@@ -70,3 +70,3 @@ import { preProcess } from "./pipeline"; | ||
/** | ||
* Add a function to the pipeline | ||
* Add a middleware function to the logging pipeline | ||
* | ||
@@ -76,3 +76,3 @@ * @param fn - Function to add to the log pipeline | ||
*/ | ||
addPipeline(fn) { | ||
use(fn) { | ||
this._pipeline.push(fn); | ||
@@ -79,0 +79,0 @@ } |
@@ -88,3 +88,3 @@ import Base from "./base"; | ||
// Add a custom pipeline that replaces `message` | ||
base.addPipeline(async (log) => { | ||
base.use(async (log) => { | ||
return Object.assign({}, log, { message: newMessage }); | ||
@@ -102,3 +102,3 @@ }); | ||
// Add the pipeline | ||
base.addPipeline(customPipeline); | ||
base.use(customPipeline); | ||
// Confirm that it exists in the `_pipeline` array | ||
@@ -105,0 +105,0 @@ expect(base._pipeline).toContain(customPipeline); |
{ | ||
"name": "@timberio/core", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "Timber.io - logging core", | ||
@@ -40,5 +40,5 @@ "keywords": [ | ||
"dependencies": { | ||
"@timberio/types": "^0.11.0" | ||
"@timberio/types": "^0.12.0" | ||
}, | ||
"gitHead": "3de26f28c517656dcdfc6746ec27b549fb200e1f" | ||
"gitHead": "511550cfec37c90b6c3c8c6935a83faa4910d0a1" | ||
} |
@@ -122,3 +122,3 @@ import Base from "./base"; | ||
// Add a custom pipeline that replaces `message` | ||
base.addPipeline(async log => { | ||
base.use(async log => { | ||
return { | ||
@@ -144,3 +144,3 @@ ...log, | ||
// Add the pipeline | ||
base.addPipeline(customPipeline); | ||
base.use(customPipeline); | ||
@@ -147,0 +147,0 @@ // Confirm that it exists in the `_pipeline` array |
@@ -93,3 +93,3 @@ import { ITimberLog, Pipeline } from "@timberio/types"; | ||
/** | ||
* Add a function to the pipeline | ||
* Add a middleware function to the logging pipeline | ||
* | ||
@@ -99,3 +99,3 @@ * @param fn - Function to add to the log pipeline | ||
*/ | ||
public addPipeline(fn: Pipeline): void { | ||
public use(fn: Pipeline): void { | ||
this._pipeline.push(fn); | ||
@@ -102,0 +102,0 @@ } |
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
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
40884
+ Added@timberio/types@0.12.0(transitive)
+ Addedcommander@1.1.1(transitive)
+ Addedjs@0.1.0(transitive)
+ Addedkeypress@0.1.0(transitive)
- Removed@timberio/types@0.11.0(transitive)
Updated@timberio/types@^0.12.0