ag-common 0.0.35 → 0.0.36

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.
@@ -23,3 +23,4 @@ export declare function toTitleCase(str: string): string;
23
23
  * @returns
24
24
  */
25
25
  export declare function replaceRemove(str: string, ...params: string[]): string;
26
+ export declare function containsInsensitive(str: string, ...args: string[]): boolean;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.replaceRemove = exports.toTitleCase = exports.niceUrl = exports.truncate = exports.trim = exports.trimSide = exports.csvJSON = void 0;
3
+ exports.containsInsensitive = exports.replaceRemove = exports.toTitleCase = exports.niceUrl = exports.truncate = exports.trim = exports.trimSide = exports.csvJSON = void 0;
4
4
  const csvJSON = (csv) => {
5
5
  const lines = csv.split('\n');
6
6
  const result = [];
@@ -109,3 +109,11 @@ function replaceRemove(str, ...params) {
109
109
  return ret;
110
110
  }
111
111
  exports.replaceRemove = replaceRemove;
112
+ function containsInsensitive(str, ...args) {
113
+ if (!str || !args) {
114
+ return false;
115
+ }
116
+ const l = str.toLowerCase();
117
+ return !!args.find((a) => l.includes(a));
118
+ }
119
+ exports.containsInsensitive = containsInsensitive;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-common",
3
- "version": "0.0.35",
3
+ "version": "0.0.36",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Andrei Gec <@andreigec> (https://gec.dev/)",