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