Upgrade Ava to v4

This commit is contained in:
Henry Mercer 2022-02-01 18:01:11 +00:00
parent 9a40cc5274
commit ce89f1b611
1153 changed files with 27264 additions and 95308 deletions

View file

@ -1,7 +1,4 @@
'use strict';
const clone = require('lodash/clone');
class ContextRef {
export default class ContextRef {
constructor() {
this.value = {};
}
@ -18,7 +15,6 @@ class ContextRef {
return new LateBinding(this);
}
}
module.exports = ContextRef;
class LateBinding extends ContextRef {
constructor(ref) {
@ -29,7 +25,8 @@ class LateBinding extends ContextRef {
get() {
if (!this.bound) {
this.set(clone(this.ref.get()));
const value = this.ref.get();
this.set(value !== null && typeof value === 'object' ? {...value} : value);
}
return super.get();