@corefunc/corefunc
Advanced tools
Comparing version 0.0.21 to 0.0.22
@@ -61,3 +61,3 @@ { | ||
}, | ||
"version": "0.0.21" | ||
"version": "0.0.22" | ||
} |
@@ -27,2 +27,23 @@ # CoreFunc | ||
arraySortStrings(["c", "a", "b"]); | ||
``` | ||
``` | ||
--- | ||
Discover more: | ||
- 🔎[Consono](https://consono.js.org)🔎 - | ||
The most informative and correct variable inspector for JavaScript on the web. | ||
- 🌠[OF](https://of.js.org)🌠 - Promise wrapper with some sugar. | ||
- 🔩[Local Storage Fallback](https://github.com/r37r0m0d3l/fallback-local-storage)🔩 - | ||
Universal localStorage fallback. | ||
- 🔄[Publish Subscribe](https://publish-subscribe.js.org)🔄 - | ||
JavaScript implementation of the Publish-Subscribe pattern. | ||
Or find useful these tools: | ||
- 🧾[JSON Sorter](https://r37r0m0d3l.github.io/json_sort)🧾 - Neat online JSON sorter. | ||
--- |
@@ -1,2 +0,3 @@ | ||
import fnLowerCase from "lodash-es/lowerCase"; | ||
import castToString from "../cast/to/string"; | ||
import stringClearReferences from "./clearReferences"; | ||
@@ -10,8 +11,14 @@ /** | ||
*/ | ||
function contains(haystack, needle, isStrict = false) { | ||
export default function stringContains(haystack: string, needle: string, isStrict: boolean = false): boolean { | ||
const strHaystack = castToString(haystack).normalize(); | ||
const strNeedle = castToString(needle).normalize(); | ||
if (isStrict) { | ||
stringClearReferences(strHaystack); | ||
stringClearReferences(strNeedle); | ||
return haystack.includes(needle); | ||
} | ||
return fnLowerCase(haystack).includes(fnLowerCase(needle)); | ||
const contains = strHaystack.toLowerCase().includes(strNeedle.toLowerCase()); | ||
stringClearReferences(strHaystack); | ||
stringClearReferences(strNeedle); | ||
return contains; | ||
} | ||
export default contains; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110790
290
3745
49