You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

22 lines
514 B

import { cloneMethod } from '../check/symbols.js';
import { constant } from './constant.js';
class ContextImplem {
constructor() {
this.receivedLogs = [];
}
log(data) {
this.receivedLogs.push(data);
}
size() {
return this.receivedLogs.length;
}
toString() {
return JSON.stringify({ logs: this.receivedLogs });
}
[cloneMethod]() {
return new ContextImplem();
}
}
export function context() {
return constant(new ContextImplem());
}