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.
|
@@ -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;
|