@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
30 lines (25 loc) • 611 B
JavaScript
import { BaseMatcher } from "../BaseMatcher.js";
import { Matcher } from "../Matcher.js";
/**
* @template T
*/
export class IsNot extends BaseMatcher {
/**
* @type {Matcher<T>}
*/
#matcher
/**
*
* @param {Matcher<T>} matcher
*/
constructor(matcher) {
super();
this.#matcher = matcher;
}
matches(item, mismatch_description) {
return !this.#matcher.matches(item, mismatch_description);
}
describeTo(description) {
description.appendText('not ').appendDescriptionOf(this.#matcher);
}
}