Skip to content

Commit

Permalink
fix: replace is-number dependency with a one liner (#20)
Browse files Browse the repository at this point in the history
* fix: replace is-number dependency with a one liner
  • Loading branch information
Abuzeid1 authored Aug 13, 2024
1 parent 7ac1deb commit 63414e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions lib/formatter/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const isNumber = require('is-number');
const betterror = require('../betterror');
const sanitiser = require('../sanitiser');
const types = require('../types');
Expand Down Expand Up @@ -83,7 +82,7 @@ module.exports = function formatter({ prefix, sanitise = sanitiser, scheme = 'da
if (typeof value === 'bigint') {
value = Number(process.hrtime.bigint() - value) / 1e6;
}
if (typeof value !== 'number' || !isNumber(value)) {
if (typeof value !== 'number' || value - value !== 0) {
throw betterror(new TypeError(`Expected 'value' to be a number, instead got ${value} (${typeof value})`), { type, key, value, rate, tags });
}

Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fiverr/statsd-client",
"version": "1.1.1",
"version": "1.1.2",
"description": "📈 A feature packed, highly customisable StatsD client",
"keywords": [
"StatsD",
Expand Down Expand Up @@ -31,9 +31,6 @@
"test": "mocha 'spec.js' '**/spec.js' --require .mocha",
"lint": "eslint '.*.js' '*.js' '**/*.js'"
},
"dependencies": {
"is-number": "^7.0.0"
},
"devDependencies": {
"@fiverr/eslint-config-fiverr": "^3.2.4",
"@lets/wait": "^2.0.2",
Expand Down

0 comments on commit 63414e9

Please sign in to comment.