1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.QueryableString = void 0;
|
4 | class QueryableString {
|
5 | constructor(str) {
|
6 | this.str = str;
|
7 | }
|
8 | startsWith(searchString) {
|
9 | return this.str.indexOf(searchString) === 0;
|
10 | }
|
11 | endsWith(searchString) {
|
12 | let reverseString = "";
|
13 | const reverseSearchString = searchString.split("").reverse().join("");
|
14 | reverseString = this.str.split("").reverse().join("");
|
15 | return this.startsWith.call({ str: reverseString }, reverseSearchString);
|
16 | }
|
17 | contains(searchString) {
|
18 | return (this.str.indexOf(searchString) !== -1);
|
19 | }
|
20 | equals(compareString) {
|
21 | return this.str === compareString;
|
22 | }
|
23 | value() {
|
24 | return this.str;
|
25 | }
|
26 | }
|
27 | exports.QueryableString = QueryableString;
|
28 |
|
\ | No newline at end of file |