import { interfaces } from "../interfaces/interfaces" ; class QueryableString implements interfaces . QueryableString { private str : string ; public constructor ( str ) { this . str = str ; } public startsWith ( searchString ) { return this . str . indexOf ( searchString ) === 0 ; } public endsWith ( searchString ) { let reverseString = "" ; const reverseSearchString = searchString . split ( "" ) . reverse ( ) . join ( "" ) ; reverseString = this . str . split ( "" ) . reverse ( ) . join ( "" ) ; return this . startsWith . call ( { str : reverseString } , reverseSearchString ) ; } public contains ( searchString ) { return ( this . str . indexOf ( searchString ) !== - 1 ) ; } public equals ( compareString ) { return this . str === compareString ; } public value ( ) { return this . str ; } } export { QueryableString } ;