@colisweb/rescript-toolkit 2.26.1 → 2.29.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "2.26.1",
3
+ "version": "2.29.0",
4
4
  "scripts": {
5
5
  "clean": "rescript clean",
6
6
  "build": "rescript build",
@@ -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 = {
@@ -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
@@ -50,3 +50,9 @@ module DomElement = {
50
50
 
51
51
  @val
52
52
  external innerWidth: int = "window.innerWidth"
53
+
54
+ @val
55
+ external screenWidth: int = "window.screen.width"
56
+
57
+ @val
58
+ external screenHeight: int = "window.screen.height"
@@ -0,0 +1,16 @@
1
+ module Browser = {
2
+ @module("@datadog/browser-rum") @scope("datadogRum")
3
+ external datadogRumInit: 'a => unit = "init"
4
+
5
+ @module("@datadog/browser-rum") @scope("datadogRum")
6
+ external startSessionReplayRecording: 'a => unit = "startSessionReplayRecording"
7
+
8
+ @module("@datadog/browser-rum") @scope("datadogRum")
9
+ external addAction: (string, 'a) => unit = "addAction"
10
+
11
+ @module("@datadog/browser-rum") @scope("datadogRum")
12
+ external addRumGlobalContext: (string, 'a) => unit = "addRumGlobalContext"
13
+
14
+ @module("@datadog/browser-rum") @scope("datadogRum")
15
+ external setUser: 'a => unit = "setUser"
16
+ }
@@ -65,6 +65,9 @@ module SwrConfig = {
65
65
 
66
66
  @send
67
67
  external mutate: (t, 'key, 'data, bool) => unit = "mutate"
68
+
69
+ @module("swr") @react.component
70
+ external make: (~value: fetcherOptions=?, ~children: React.element) => React.element = "SWRConfig"
68
71
  }
69
72
 
70
73
  @module("swr")