@colisweb/rescript-toolkit 2.26.1 → 2.27.0
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.
package/package.json
CHANGED
|
@@ -4,6 +4,13 @@ module String = {
|
|
|
4
4
|
|
|
5
5
|
@ocaml.doc(" TODO: remove ")
|
|
6
6
|
let join = joinNonEmty
|
|
7
|
+
|
|
8
|
+
let includes = (str1, str2) => {
|
|
9
|
+
str1
|
|
10
|
+
->Js.String2.toLowerCase
|
|
11
|
+
->Js.String2.normalizeByForm("NFD")
|
|
12
|
+
->Js.String2.includes(str2->Js.String2.toLowerCase->Js.String2.normalizeByForm("NFD"))
|
|
13
|
+
}
|
|
7
14
|
}
|
|
8
15
|
|
|
9
16
|
module Option = {
|
package/src/primitives/index.md
CHANGED
|
@@ -8,6 +8,19 @@ Utililties functions for primitives types :
|
|
|
8
8
|
|
|
9
9
|
## API
|
|
10
10
|
|
|
11
|
+
### String
|
|
12
|
+
|
|
13
|
+
#### includes
|
|
14
|
+
|
|
15
|
+
Check if the string is included by setting both strings to lowercase and using `normalize("NFD")`.
|
|
16
|
+
|
|
17
|
+
```rescript
|
|
18
|
+
let search = "aurelie"
|
|
19
|
+
let data = "Aurélie
|
|
20
|
+
|
|
21
|
+
data->Primitives.String.includes(search) // true
|
|
22
|
+
```
|
|
23
|
+
|
|
11
24
|
### Option
|
|
12
25
|
|
|
13
26
|
```rescript
|