Comparing version 1.0.0 to 1.0.1
# Changelog | ||
## 1.0.1 - 2020-06-22 | ||
- **fix:** cockatiel not working in certain browser builds | ||
## 1.0.0 - 2020-06-16 | ||
@@ -4,0 +8,0 @@ |
@@ -14,4 +14,10 @@ "use strict"; | ||
const makeStopwatch = () => { | ||
const start = process.hrtime.bigint(); | ||
return () => Number(process.hrtime.bigint() - start) / 1000000; // ns->ms | ||
if (typeof performance !== 'undefined') { | ||
const start = performance.now(); | ||
return () => performance.now() - start; | ||
} | ||
else { | ||
const start = process.hrtime.bigint(); | ||
return () => Number(process.hrtime.bigint() - start) / 1000000; // ns->ms | ||
} | ||
}; | ||
@@ -31,4 +37,4 @@ class ExecuteWrapper { | ||
const e = new ExecuteWrapper(this.errorFilter, this.resultFilter); | ||
e.onSuccess(evt => this.successEmitter.emit(evt)); | ||
e.onFailure(evt => this.failureEmitter.emit(evt)); | ||
e.onSuccess((evt) => this.successEmitter.emit(evt)); | ||
e.onFailure((evt) => this.failureEmitter.emit(evt)); | ||
return e; | ||
@@ -35,0 +41,0 @@ } |
@@ -12,4 +12,10 @@ import { EventEmitter } from './Event'; | ||
const makeStopwatch = () => { | ||
const start = process.hrtime.bigint(); | ||
return () => Number(process.hrtime.bigint() - start) / 1000000; // ns->ms | ||
if (typeof performance !== 'undefined') { | ||
const start = performance.now(); | ||
return () => performance.now() - start; | ||
} | ||
else { | ||
const start = process.hrtime.bigint(); | ||
return () => Number(process.hrtime.bigint() - start) / 1000000; // ns->ms | ||
} | ||
}; | ||
@@ -29,4 +35,4 @@ export class ExecuteWrapper { | ||
const e = new ExecuteWrapper(this.errorFilter, this.resultFilter); | ||
e.onSuccess(evt => this.successEmitter.emit(evt)); | ||
e.onFailure(evt => this.failureEmitter.emit(evt)); | ||
e.onSuccess((evt) => this.successEmitter.emit(evt)); | ||
e.onFailure((evt) => this.failureEmitter.emit(evt)); | ||
return e; | ||
@@ -33,0 +39,0 @@ } |
{ | ||
"name": "cockatiel", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A resilience and transient-fault-handling library that allows developers to express policies such as Backoff, Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. Inspired by .NET Polly.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
472646
286
7205