@applitools/monitoring-commons
Advanced tools
Comparing version 1.0.19 to 2.0.1
{ | ||
"name": "@applitools/monitoring-commons", | ||
"version": "1.0.19", | ||
"version": "2.0.1", | ||
"description": "", | ||
"main": "src/monitoring-commons.js", | ||
"main": "dist/cjs/monitoring-commons.js", | ||
"module": "dist/mjs/monitoring-commons.js", | ||
"exports": { | ||
".": { | ||
"import": "./dist/mjs/monitoring-commons.js", | ||
"require": "./dist/cjs/monitoring-commons.js" | ||
} | ||
}, | ||
"engines": { | ||
@@ -10,7 +17,10 @@ "node": ">=8.0.0" | ||
"files": [ | ||
"src" | ||
"src", | ||
"dist" | ||
], | ||
"scripts": { | ||
"build": "#", | ||
"test": "mocha --no-timeouts 'test/unit/*.test.js' 'test/it/*.test.js' 'test/e2e/*.test.js' && npm run eslint", | ||
"build": "rm -fr dist/* && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json", | ||
"test": "npm run test:mocha && npm run eslint", | ||
"test:mocha": "npm run build && mocha --no-timeouts 'test/unit/*.test.js' 'test/it/*.test.js'", | ||
"test:mocha-mjs": "npm run build && mocha --require @babel/register --no-timeouts 'test/**/*.test.mjs'", | ||
"eslint": "eslint '**/*.js'", | ||
@@ -34,15 +44,16 @@ "prepublishOnly": "npm version patch" | ||
}, | ||
"dependencies": { | ||
"debug": "^4.1.0" | ||
}, | ||
"devDependencies": { | ||
"@applitools/build-commons": "^1.1.13", | ||
"chai": "^4.2.0", | ||
"eslint": "^5.16.0", | ||
"eslint-plugin-mocha-no-only": "^1.1.0", | ||
"eslint-plugin-node": "^8.0.1", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
"mocha": "^4.0.1", | ||
"prettier": "^1.19.1" | ||
"@babel/cli": "^7.15.7", | ||
"@babel/core": "^7.15.5", | ||
"@babel/preset-env": "^7.15.6", | ||
"@babel/register": "^7.15.3", | ||
"chai": "^4.3.8", | ||
"eslint": "^8.48.0", | ||
"eslint-plugin-mocha-no-only": "^1.1.1", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"mocha": "^10.2.0", | ||
"prettier": "^3.0.3", | ||
"typescript": "^5.1.6" | ||
} | ||
} |
@@ -1,5 +0,8 @@ | ||
'use strict' | ||
"use strict"; | ||
function makeTiming({parentPerformance = undefined, nowService = Date.now} = {}) { | ||
const performance = parentPerformance || {} | ||
function makeTiming({ | ||
parentPerformance = undefined, | ||
nowService = Date.now, | ||
} = {}) { | ||
const performance = parentPerformance || {}; | ||
@@ -14,10 +17,13 @@ /** | ||
function timeItAsync(name, f) { | ||
const start = nowService() | ||
const start = nowService(); | ||
return f().then( | ||
v => ((performance[name] = (performance[name] || 0) + nowService() - start), v), | ||
v => ( | ||
(performance[name] = (performance[name] || 0) + nowService() - start), Promise.reject(v) | ||
(v) => ( | ||
(performance[name] = (performance[name] || 0) + nowService() - start), v | ||
), | ||
) | ||
(v) => ( | ||
(performance[name] = (performance[name] || 0) + nowService() - start), | ||
Promise.reject(v) | ||
), | ||
); | ||
} | ||
@@ -31,6 +37,6 @@ | ||
function getTimeItCallback(name) { | ||
const start = nowService() | ||
const start = nowService(); | ||
return () => { | ||
performance[name] = (performance[name] || 0) + nowService() - start | ||
} | ||
performance[name] = (performance[name] || 0) + nowService() - start; | ||
}; | ||
} | ||
@@ -46,12 +52,12 @@ | ||
function timeIt(name, f) { | ||
const start = nowService() | ||
const start = nowService(); | ||
try { | ||
const ret = f() | ||
const ret = f(); | ||
performance[name] = (performance[name] || 0) + nowService() - start | ||
performance[name] = (performance[name] || 0) + nowService() - start; | ||
return ret | ||
return ret; | ||
} catch (err) { | ||
performance[name] = (performance[name] || 0) + nowService() - start | ||
throw err | ||
performance[name] = (performance[name] || 0) + nowService() - start; | ||
throw err; | ||
} | ||
@@ -65,3 +71,3 @@ } | ||
performance, | ||
} | ||
}; | ||
} | ||
@@ -71,2 +77,2 @@ | ||
makeTiming, | ||
} | ||
}; |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
21628
0
12
193
12
2
- Removeddebug@^4.1.0
- Removeddebug@4.4.0(transitive)
- Removedms@2.1.3(transitive)