socket-function 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socket-function",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
package/src/misc.ts CHANGED
@@ -158,7 +158,7 @@ export class PromiseObj<T = void> {
158
158
  /** Resolve called does not mean the value is ready, as it may be resolved with a promise. */
159
159
  public resolveCalled?: boolean;
160
160
 
161
- public resolve(value: T | Promise<T>) {
161
+ public resolve = (value: T | Promise<T>) => {
162
162
  this.resolveCalled = true;
163
163
  if (typeof value === "object" && value !== null && value instanceof Promise) {
164
164
  value.then(
@@ -169,10 +169,10 @@ export class PromiseObj<T = void> {
169
169
  this.value = { value };
170
170
  }
171
171
  this.baseResolve(value);
172
- }
173
- public reject(error: any) {
172
+ };
173
+ public reject = (error: any) => {
174
174
  this.baseReject(error);
175
- }
175
+ };
176
176
 
177
177
  private baseResolve!: (value: T | Promise<T>) => void;
178
178
  private baseReject!: (error: any) => void;
@@ -19,7 +19,7 @@ export function getOpenTimesBase(): OwnTimeObjInternal[] {
19
19
  return openTimes;
20
20
  }
21
21
 
22
- (global as any).pendingOwnCallTime = openTimes;
22
+ (globalThis as any).pendingOwnCallTime = openTimes;
23
23
 
24
24
  // NOTE: This overhead time is actually mostly for aggregate time, but it is needed,
25
25
  // otherwise we consistently underestimate the time spent.