typeshi 1.7.13 → 1.7.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,14 +40,14 @@ export declare function stringContainsAnyOf(s: string, substrings: string | stri
40
40
  * - **`false`** `otherwise`.
41
41
  */
42
42
  export declare function equivalentAlphanumericStrings(s1: string, s2: string, tolerance?: number): boolean;
43
- export declare class StringOperation {
43
+ export declare namespace Str {
44
44
  /**
45
45
  * @param s `string`
46
46
  * @param prefixes `string | string[] | RegExp` possible starting string(s).
47
47
  * @param flags `RegExpFlagsEnum[] (Optional)` regex flags to use when creating the {@link RegExp} object. see {@link RegExpFlagsEnum}
48
48
  * @returns **`true`** if the string starts with any of the prefixes, **`false`** otherwise.
49
49
  */
50
- static startsWith: typeof stringStartsWithAnyOf;
50
+ const startsWith: typeof stringStartsWithAnyOf;
51
51
  /**
52
52
  * Checks if a string ends with any of the specified suffixes.
53
53
  * @param s `string`
@@ -55,14 +55,14 @@ export declare class StringOperation {
55
55
  * @param flags `RegExpFlagsEnum[] (Optional)` regex flags to use when creating the {@link RegExp} object. see {@link RegExpFlagsEnum}
56
56
  * @returns **`true`** if the string ends with any of the suffixes, **`false`** otherwise.
57
57
  */
58
- static endsWith: typeof stringEndsWithAnyOf;
58
+ const endsWith: typeof stringEndsWithAnyOf;
59
59
  /**
60
- * @param s `string` to check.
61
- * @param substrings `string | string[] | RegExp`.
60
+ * @param s `string`
61
+ * @param substrings `string | string[] | RegExp`
62
62
  * @param flags `RegExpFlagsEnum[] (Optional)` regex flags to use when creating the {@link RegExp} object. see {@link RegExpFlagsEnum}
63
63
  * @returns **`true`** if the string contains any of the substrings, **`false`** otherwise.
64
64
  */
65
- static contains: typeof stringContainsAnyOf;
65
+ const contains: typeof stringContainsAnyOf;
66
66
  /**
67
67
  * Ignores case by default:
68
68
  * - converts `s1` & `s2` to lowercase and removes all non-alphanumeric characters from both strings,
@@ -75,7 +75,7 @@ export declare class StringOperation {
75
75
  * - **`true`** `if` the two alphanumeric strings are equivalent,
76
76
  * - **`false`** `otherwise`.
77
77
  */
78
- static equivalentAlphanumeric: typeof equivalentAlphanumericStrings;
78
+ const equivalentAlphanumeric: typeof equivalentAlphanumericStrings;
79
79
  }
80
80
  /** for simple regular expressions...
81
81
  * so like not ones that have parentheses, pipes, or curly braced numbers */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StringOperation = void 0;
3
+ exports.Str = void 0;
4
4
  exports.stringEndsWithAnyOf = stringEndsWithAnyOf;
5
5
  exports.stringStartsWithAnyOf = stringStartsWithAnyOf;
6
6
  exports.stringContainsAnyOf = stringContainsAnyOf;
@@ -173,44 +173,44 @@ function equivalentAlphanumericStrings(s1, s2, tolerance = 0.90) {
173
173
  }
174
174
  return false;
175
175
  }
176
- class StringOperation {
177
- }
178
- exports.StringOperation = StringOperation;
179
- /**
180
- * @param s `string`
181
- * @param prefixes `string | string[] | RegExp` possible starting string(s).
182
- * @param flags `RegExpFlagsEnum[] (Optional)` regex flags to use when creating the {@link RegExp} object. see {@link RegExpFlagsEnum}
183
- * @returns **`true`** if the string starts with any of the prefixes, **`false`** otherwise.
184
- */
185
- StringOperation.startsWith = stringStartsWithAnyOf;
186
- /**
187
- * Checks if a string ends with any of the specified suffixes.
188
- * @param s `string`
189
- * @param suffixes `string | string[] | RegExp` possible ending strings.
190
- * @param flags `RegExpFlagsEnum[] (Optional)` regex flags to use when creating the {@link RegExp} object. see {@link RegExpFlagsEnum}
191
- * @returns **`true`** if the string ends with any of the suffixes, **`false`** otherwise.
192
- */
193
- StringOperation.endsWith = stringEndsWithAnyOf;
194
- /**
195
- * @param s `string` to check.
196
- * @param substrings `string | string[] | RegExp`.
197
- * @param flags `RegExpFlagsEnum[] (Optional)` regex flags to use when creating the {@link RegExp} object. see {@link RegExpFlagsEnum}
198
- * @returns **`true`** if the string contains any of the substrings, **`false`** otherwise.
199
- */
200
- StringOperation.contains = stringContainsAnyOf;
201
- /**
202
- * Ignores case by default:
203
- * - converts `s1` & `s2` to lowercase and removes all non-alphanumeric characters from both strings,
204
- * - sorts the characters in both strings,
205
- * - then compares the two strings for equivalence.
206
- * @param s1 `string`
207
- * @param s2 `string`
208
- * @param tolerance `number` - a number between 0 and 1, default is `0.90`
209
- * @returns **`boolean`**
210
- * - **`true`** `if` the two alphanumeric strings are equivalent,
211
- * - **`false`** `otherwise`.
212
- */
213
- StringOperation.equivalentAlphanumeric = equivalentAlphanumericStrings;
176
+ var Str;
177
+ (function (Str) {
178
+ /**
179
+ * @param s `string`
180
+ * @param prefixes `string | string[] | RegExp` possible starting string(s).
181
+ * @param flags `RegExpFlagsEnum[] (Optional)` regex flags to use when creating the {@link RegExp} object. see {@link RegExpFlagsEnum}
182
+ * @returns **`true`** if the string starts with any of the prefixes, **`false`** otherwise.
183
+ */
184
+ Str.startsWith = stringStartsWithAnyOf;
185
+ /**
186
+ * Checks if a string ends with any of the specified suffixes.
187
+ * @param s `string`
188
+ * @param suffixes `string | string[] | RegExp` possible ending strings.
189
+ * @param flags `RegExpFlagsEnum[] (Optional)` regex flags to use when creating the {@link RegExp} object. see {@link RegExpFlagsEnum}
190
+ * @returns **`true`** if the string ends with any of the suffixes, **`false`** otherwise.
191
+ */
192
+ Str.endsWith = stringEndsWithAnyOf;
193
+ /**
194
+ * @param s `string`
195
+ * @param substrings `string | string[] | RegExp`
196
+ * @param flags `RegExpFlagsEnum[] (Optional)` regex flags to use when creating the {@link RegExp} object. see {@link RegExpFlagsEnum}
197
+ * @returns **`true`** if the string contains any of the substrings, **`false`** otherwise.
198
+ */
199
+ Str.contains = stringContainsAnyOf;
200
+ /**
201
+ * Ignores case by default:
202
+ * - converts `s1` & `s2` to lowercase and removes all non-alphanumeric characters from both strings,
203
+ * - sorts the characters in both strings,
204
+ * - then compares the two strings for equivalence.
205
+ * @param s1 `string`
206
+ * @param s2 `string`
207
+ * @param tolerance `number` - a number between 0 and 1, default is `0.90`
208
+ * @returns **`boolean`**
209
+ * - **`true`** `if` the two alphanumeric strings are equivalent,
210
+ * - **`false`** `otherwise`.
211
+ */
212
+ Str.equivalentAlphanumeric = equivalentAlphanumericStrings;
213
+ })(Str || (exports.Str = Str = {}));
214
214
  /** for simple regular expressions...
215
215
  * so like not ones that have parentheses, pipes, or curly braced numbers */
216
216
  function extractSource(regex) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typeshi",
3
- "version": "1.7.13",
3
+ "version": "1.7.14",
4
4
  "description": "TypeScript utility modules",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",