@shopify/statsd
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -9,2 +9,3 @@ 'use strict'; | ||
const _excluded = ["logger"]; | ||
const UNKNOWN = 'Unknown'; | ||
@@ -16,3 +17,3 @@ class StatsDClient { | ||
} = _ref, | ||
options = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, ["logger"]); | ||
options = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded); | ||
@@ -19,0 +20,0 @@ this.statsd = void 0; |
@@ -5,4 +5,3 @@ import { StatsD } from 'hot-shots'; | ||
export class StatsDClient { | ||
constructor(_a) { | ||
var { logger } = _a, options = __rest(_a, ["logger"]); | ||
constructor({ logger, ...options }) { | ||
this.logger = console; | ||
@@ -12,7 +11,10 @@ if (logger) { | ||
} | ||
this.options = Object.assign(Object.assign({}, options), { errorHandler: options.errorHandler | ||
this.options = { | ||
...options, | ||
errorHandler: options.errorHandler | ||
? options.errorHandler | ||
: (error) => { | ||
this.logger.log(`Error occurred in the StatsD client:\n${error.stack || error.message}`); | ||
} }); | ||
}, | ||
}; | ||
this.statsd = new StatsD(this.options); | ||
@@ -19,0 +21,0 @@ } |
@@ -1,1 +0,4 @@ | ||
module.exports = require("./build/cjs/index.js"); | ||
function interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : {default: obj}; | ||
} | ||
module.exports = interopRequireDefault(require("./build/cjs/index.js")); |
{ | ||
"name": "@shopify/statsd", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"license": "MIT", | ||
"description": "An opinionated StatsD client for Shopify Node.js servers and other StatsD utilities", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"types": "./build/ts/index.d.ts", | ||
"sideEffects": false, | ||
@@ -35,4 +35,3 @@ "publishConfig": { | ||
"index.mjs", | ||
"index.esnext", | ||
"index.d.ts" | ||
"index.esnext" | ||
], | ||
@@ -49,3 +48,3 @@ "module": "index.mjs", | ||
}, | ||
"gitHead": "0edc9e3b7df7b6a4805cc3ff1443641cdb8e8a72" | ||
"gitHead": "c7d64cb78303f2752c172f6df52b78bc56bebd40" | ||
} |
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
293135
419
21