import Entity from "../entity/entity" ; import Search from "./search" ; import WhereField from "./where-field" ; export default class WhereString < TEntity extends Entity > extends WhereField < TEntity > { private value ! : string ; eq ( value ) { this . value = value ; return this . search ; } equal ( value ) { return this . eq ( value ) ; } equals ( value ) { return this . eq ( value ) ; } equalTo ( value ) { return this . eq ( value ) ; } toString ( ) { let matchPunctuation = /[,.<>{}[\]"':;!@#$%^&*()\-+=~| ]/g ; let escapedValue = this . value . replace ( matchPunctuation , '\\$&' ) ; return this . buildQuery ( `{${ escapedValue }}` ) ; } }