UNPKG

@schorts/shared-kernel

Version:

A modular, type-safe foundation for building expressive, maintainable applications. This package provides core abstractions for domain modeling, HTTP integration, authentication, state management, and more — designed to be framework-agnostic and highly ex

24 lines (17 loc) 528 B
import { ValueObject } from "./"; export abstract class BooleanValue implements ValueObject { readonly valueType = "Boolean"; readonly value: boolean; constructor(value: boolean) { this.value = value; } get isValid(): boolean { return true; } equals(valueObject: unknown): boolean { if (!(valueObject instanceof BooleanValue)) return false; if (!this.isValid || !valueObject.isValid) return false; return this.value === valueObject.value; } abstract readonly attributeName: string; }