react-native-nitro-cookies 1.0.0 → 1.0.2

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.
Files changed (37) hide show
  1. package/android/AGENTS.md +62 -0
  2. package/android/src/main/java/com/margelo/nitro/nitrocookies/NitroCookies.kt +37 -21
  3. package/ios/AGENTS.md +49 -0
  4. package/ios/NitroCookies.swift +63 -16
  5. package/lib/module/AGENTS.md +50 -0
  6. package/lib/typescript/src/NitroCookies.nitro.d.ts.map +1 -1
  7. package/nitrogen/generated/android/c++/JCookie.hpp +1 -1
  8. package/nitrogen/generated/android/c++/JHybridNitroCookiesSpec.cpp +9 -1
  9. package/nitrogen/generated/android/c++/JHybridNitroCookiesSpec.hpp +2 -1
  10. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrocookies/Cookie.kt +2 -2
  11. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrocookies/HybridNitroCookiesSpec.kt +1 -1
  12. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrocookies/nitrocookiesOnLoad.kt +1 -1
  13. package/nitrogen/generated/android/nitrocookies+autolinking.cmake +1 -1
  14. package/nitrogen/generated/android/nitrocookies+autolinking.gradle +1 -1
  15. package/nitrogen/generated/android/nitrocookiesOnLoad.cpp +1 -1
  16. package/nitrogen/generated/android/nitrocookiesOnLoad.hpp +1 -1
  17. package/nitrogen/generated/ios/NitroCookies+autolinking.rb +2 -2
  18. package/nitrogen/generated/ios/NitroCookies-Swift-Cxx-Bridge.cpp +2 -1
  19. package/nitrogen/generated/ios/NitroCookies-Swift-Cxx-Bridge.hpp +3 -3
  20. package/nitrogen/generated/ios/NitroCookies-Swift-Cxx-Umbrella.hpp +1 -1
  21. package/nitrogen/generated/ios/NitroCookiesAutolinking.mm +1 -1
  22. package/nitrogen/generated/ios/NitroCookiesAutolinking.swift +9 -8
  23. package/nitrogen/generated/ios/c++/HybridNitroCookiesSpecSwift.cpp +1 -1
  24. package/nitrogen/generated/ios/c++/HybridNitroCookiesSpecSwift.hpp +7 -1
  25. package/nitrogen/generated/ios/swift/Cookie.swift +59 -143
  26. package/nitrogen/generated/ios/swift/Func_void.swift +1 -2
  27. package/nitrogen/generated/ios/swift/Func_void_bool.swift +1 -2
  28. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -2
  29. package/nitrogen/generated/ios/swift/Func_void_std__vector_Cookie_.swift +1 -2
  30. package/nitrogen/generated/ios/swift/HybridNitroCookiesSpec.swift +3 -5
  31. package/nitrogen/generated/ios/swift/HybridNitroCookiesSpec_cxx.swift +9 -3
  32. package/nitrogen/generated/shared/c++/Cookie.hpp +34 -26
  33. package/nitrogen/generated/shared/c++/HybridNitroCookiesSpec.cpp +1 -1
  34. package/nitrogen/generated/shared/c++/HybridNitroCookiesSpec.hpp +1 -1
  35. package/package.json +13 -13
  36. package/src/AGENTS.md +50 -0
  37. package/src/NitroCookies.nitro.ts +4 -2
@@ -2,7 +2,7 @@
2
2
  /// NitroCookies-Swift-Cxx-Umbrella.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -2,7 +2,7 @@
2
2
  /// NitroCookiesAutolinking.mm
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #import <Foundation/Foundation.h>
@@ -2,19 +2,16 @@
2
2
  /// NitroCookiesAutolinking.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
+ import NitroModules
9
+
10
+ // TODO: Use empty enums once Swift supports exporting them as namespaces
11
+ // See: https://github.com/swiftlang/swift/pull/83616
8
12
  public final class NitroCookiesAutolinking {
9
13
  public typealias bridge = margelo.nitro.nitrocookies.bridge.swift
10
14
 
11
- /**
12
- * Creates an instance of a Swift class that implements `HybridNitroCookiesSpec`,
13
- * and wraps it in a Swift class that can directly interop with C++ (`HybridNitroCookiesSpec_cxx`)
14
- *
15
- * This is generated by Nitrogen and will initialize the class specified
16
- * in the `"autolinking"` property of `nitro.json` (in this case, `HybridNitroCookies`).
17
- */
18
15
  public static func createNitroCookies() -> bridge.std__shared_ptr_HybridNitroCookiesSpec_ {
19
16
  let hybridObject = HybridNitroCookies()
20
17
  return { () -> bridge.std__shared_ptr_HybridNitroCookiesSpec_ in
@@ -22,4 +19,8 @@ public final class NitroCookiesAutolinking {
22
19
  return __cxxWrapped.getCxxPart()
23
20
  }()
24
21
  }
22
+
23
+ public static func isNitroCookiesRecyclable() -> Bool {
24
+ return HybridNitroCookies.self is any RecyclableView.Type
25
+ }
25
26
  }
@@ -2,7 +2,7 @@
2
2
  /// HybridNitroCookiesSpecSwift.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "HybridNitroCookiesSpecSwift.hpp"
@@ -2,7 +2,7 @@
2
2
  /// HybridNitroCookiesSpecSwift.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -52,6 +52,12 @@ namespace margelo::nitro::nitrocookies {
52
52
  inline size_t getExternalMemorySize() noexcept override {
53
53
  return _swiftPart.getMemorySize();
54
54
  }
55
+ bool equals(const std::shared_ptr<HybridObject>& other) override {
56
+ if (auto otherCast = std::dynamic_pointer_cast<HybridNitroCookiesSpecSwift>(other)) {
57
+ return _swiftPart.equals(otherCast->_swiftPart);
58
+ }
59
+ return false;
60
+ }
55
61
  void dispose() noexcept override {
56
62
  _swiftPart.dispose();
57
63
  }
@@ -2,7 +2,7 @@
2
2
  /// Cookie.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import NitroModules
@@ -58,169 +58,85 @@ public extension Cookie {
58
58
  }())
59
59
  }
60
60
 
61
+ @inline(__always)
61
62
  var name: String {
62
- @inline(__always)
63
- get {
64
- return String(self.__name)
65
- }
66
- @inline(__always)
67
- set {
68
- self.__name = std.string(newValue)
69
- }
63
+ return String(self.__name)
70
64
  }
71
65
 
66
+ @inline(__always)
72
67
  var value: String {
73
- @inline(__always)
74
- get {
75
- return String(self.__value)
76
- }
77
- @inline(__always)
78
- set {
79
- self.__value = std.string(newValue)
80
- }
68
+ return String(self.__value)
81
69
  }
82
70
 
71
+ @inline(__always)
83
72
  var path: String? {
84
- @inline(__always)
85
- get {
86
- return { () -> String? in
87
- if bridge.has_value_std__optional_std__string_(self.__path) {
88
- let __unwrapped = bridge.get_std__optional_std__string_(self.__path)
89
- return String(__unwrapped)
90
- } else {
91
- return nil
92
- }
93
- }()
94
- }
95
- @inline(__always)
96
- set {
97
- self.__path = { () -> bridge.std__optional_std__string_ in
98
- if let __unwrappedValue = newValue {
99
- return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
100
- } else {
101
- return .init()
102
- }
103
- }()
104
- }
73
+ return { () -> String? in
74
+ if bridge.has_value_std__optional_std__string_(self.__path) {
75
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__path)
76
+ return String(__unwrapped)
77
+ } else {
78
+ return nil
79
+ }
80
+ }()
105
81
  }
106
82
 
83
+ @inline(__always)
107
84
  var domain: String? {
108
- @inline(__always)
109
- get {
110
- return { () -> String? in
111
- if bridge.has_value_std__optional_std__string_(self.__domain) {
112
- let __unwrapped = bridge.get_std__optional_std__string_(self.__domain)
113
- return String(__unwrapped)
114
- } else {
115
- return nil
116
- }
117
- }()
118
- }
119
- @inline(__always)
120
- set {
121
- self.__domain = { () -> bridge.std__optional_std__string_ in
122
- if let __unwrappedValue = newValue {
123
- return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
124
- } else {
125
- return .init()
126
- }
127
- }()
128
- }
85
+ return { () -> String? in
86
+ if bridge.has_value_std__optional_std__string_(self.__domain) {
87
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__domain)
88
+ return String(__unwrapped)
89
+ } else {
90
+ return nil
91
+ }
92
+ }()
129
93
  }
130
94
 
95
+ @inline(__always)
131
96
  var version: String? {
132
- @inline(__always)
133
- get {
134
- return { () -> String? in
135
- if bridge.has_value_std__optional_std__string_(self.__version) {
136
- let __unwrapped = bridge.get_std__optional_std__string_(self.__version)
137
- return String(__unwrapped)
138
- } else {
139
- return nil
140
- }
141
- }()
142
- }
143
- @inline(__always)
144
- set {
145
- self.__version = { () -> bridge.std__optional_std__string_ in
146
- if let __unwrappedValue = newValue {
147
- return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
148
- } else {
149
- return .init()
150
- }
151
- }()
152
- }
97
+ return { () -> String? in
98
+ if bridge.has_value_std__optional_std__string_(self.__version) {
99
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__version)
100
+ return String(__unwrapped)
101
+ } else {
102
+ return nil
103
+ }
104
+ }()
153
105
  }
154
106
 
107
+ @inline(__always)
155
108
  var expires: String? {
156
- @inline(__always)
157
- get {
158
- return { () -> String? in
159
- if bridge.has_value_std__optional_std__string_(self.__expires) {
160
- let __unwrapped = bridge.get_std__optional_std__string_(self.__expires)
161
- return String(__unwrapped)
162
- } else {
163
- return nil
164
- }
165
- }()
166
- }
167
- @inline(__always)
168
- set {
169
- self.__expires = { () -> bridge.std__optional_std__string_ in
170
- if let __unwrappedValue = newValue {
171
- return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
172
- } else {
173
- return .init()
174
- }
175
- }()
176
- }
109
+ return { () -> String? in
110
+ if bridge.has_value_std__optional_std__string_(self.__expires) {
111
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__expires)
112
+ return String(__unwrapped)
113
+ } else {
114
+ return nil
115
+ }
116
+ }()
177
117
  }
178
118
 
119
+ @inline(__always)
179
120
  var secure: Bool? {
180
- @inline(__always)
181
- get {
182
- return { () -> Bool? in
183
- if bridge.has_value_std__optional_bool_(self.__secure) {
184
- let __unwrapped = bridge.get_std__optional_bool_(self.__secure)
185
- return __unwrapped
186
- } else {
187
- return nil
188
- }
189
- }()
190
- }
191
- @inline(__always)
192
- set {
193
- self.__secure = { () -> bridge.std__optional_bool_ in
194
- if let __unwrappedValue = newValue {
195
- return bridge.create_std__optional_bool_(__unwrappedValue)
196
- } else {
197
- return .init()
198
- }
199
- }()
200
- }
121
+ return { () -> Bool? in
122
+ if bridge.has_value_std__optional_bool_(self.__secure) {
123
+ let __unwrapped = bridge.get_std__optional_bool_(self.__secure)
124
+ return __unwrapped
125
+ } else {
126
+ return nil
127
+ }
128
+ }()
201
129
  }
202
130
 
131
+ @inline(__always)
203
132
  var httpOnly: Bool? {
204
- @inline(__always)
205
- get {
206
- return { () -> Bool? in
207
- if bridge.has_value_std__optional_bool_(self.__httpOnly) {
208
- let __unwrapped = bridge.get_std__optional_bool_(self.__httpOnly)
209
- return __unwrapped
210
- } else {
211
- return nil
212
- }
213
- }()
214
- }
215
- @inline(__always)
216
- set {
217
- self.__httpOnly = { () -> bridge.std__optional_bool_ in
218
- if let __unwrappedValue = newValue {
219
- return bridge.create_std__optional_bool_(__unwrappedValue)
220
- } else {
221
- return .init()
222
- }
223
- }()
224
- }
133
+ return { () -> Bool? in
134
+ if bridge.has_value_std__optional_bool_(self.__httpOnly) {
135
+ let __unwrapped = bridge.get_std__optional_bool_(self.__httpOnly)
136
+ return __unwrapped
137
+ } else {
138
+ return nil
139
+ }
140
+ }()
225
141
  }
226
142
  }
@@ -2,12 +2,11 @@
2
2
  /// Func_void.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import NitroModules
9
9
 
10
-
11
10
  /**
12
11
  * Wraps a Swift `() -> Void` as a class.
13
12
  * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
@@ -2,12 +2,11 @@
2
2
  /// Func_void_bool.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import NitroModules
9
9
 
10
-
11
10
  /**
12
11
  * Wraps a Swift `(_ value: Bool) -> Void` as a class.
13
12
  * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
@@ -2,12 +2,11 @@
2
2
  /// Func_void_std__exception_ptr.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import NitroModules
9
9
 
10
-
11
10
  /**
12
11
  * Wraps a Swift `(_ error: Error) -> Void` as a class.
13
12
  * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
@@ -2,12 +2,11 @@
2
2
  /// Func_void_std__vector_Cookie_.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import NitroModules
9
9
 
10
-
11
10
  /**
12
11
  * Wraps a Swift `(_ value: [Cookie]) -> Void` as a class.
13
12
  * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
@@ -2,11 +2,9 @@
2
2
  /// HybridNitroCookiesSpec.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
- import NitroModules
10
8
  import NitroModules
11
9
 
12
10
  /// See ``HybridNitroCookiesSpec``
@@ -43,14 +41,14 @@ open class HybridNitroCookiesSpec_base {
43
41
  public init() { }
44
42
  public func getCxxWrapper() -> HybridNitroCookiesSpec_cxx {
45
43
  #if DEBUG
46
- guard self is HybridNitroCookiesSpec else {
44
+ guard self is any HybridNitroCookiesSpec else {
47
45
  fatalError("`self` is not a `HybridNitroCookiesSpec`! Did you accidentally inherit from `HybridNitroCookiesSpec_base` instead of `HybridNitroCookiesSpec`?")
48
46
  }
49
47
  #endif
50
48
  if let cxxWrapper = self.cxxWrapper {
51
49
  return cxxWrapper
52
50
  } else {
53
- let cxxWrapper = HybridNitroCookiesSpec_cxx(self as! HybridNitroCookiesSpec)
51
+ let cxxWrapper = HybridNitroCookiesSpec_cxx(self as! any HybridNitroCookiesSpec)
54
52
  self.cxxWrapper = cxxWrapper
55
53
  return cxxWrapper
56
54
  }
@@ -2,11 +2,9 @@
2
2
  /// HybridNitroCookiesSpec_cxx.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
- import NitroModules
10
8
  import NitroModules
11
9
 
12
10
  /**
@@ -97,6 +95,14 @@ open class HybridNitroCookiesSpec_cxx {
97
95
  return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
98
96
  }
99
97
 
98
+ /**
99
+ * Compares this object with the given [other] object for reference equality.
100
+ */
101
+ @inline(__always)
102
+ public func equals(other: HybridNitroCookiesSpec_cxx) -> Bool {
103
+ return self.__implementation === other.__implementation
104
+ }
105
+
100
106
  /**
101
107
  * Call dispose() on the Swift class.
102
108
  * This _may_ be called manually from JS.
@@ -2,7 +2,7 @@
2
2
  /// Cookie.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -22,6 +22,11 @@
22
22
  #else
23
23
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
24
  #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
25
30
 
26
31
 
27
32
 
@@ -33,7 +38,7 @@ namespace margelo::nitro::nitrocookies {
33
38
  /**
34
39
  * A struct which can be represented as a JavaScript object (Cookie).
35
40
  */
36
- struct Cookie {
41
+ struct Cookie final {
37
42
  public:
38
43
  std::string name SWIFT_PRIVATE;
39
44
  std::string value SWIFT_PRIVATE;
@@ -47,6 +52,9 @@ namespace margelo::nitro::nitrocookies {
47
52
  public:
48
53
  Cookie() = default;
49
54
  explicit Cookie(std::string name, std::string value, std::optional<std::string> path, std::optional<std::string> domain, std::optional<std::string> version, std::optional<std::string> expires, std::optional<bool> secure, std::optional<bool> httpOnly): name(name), value(value), path(path), domain(domain), version(version), expires(expires), secure(secure), httpOnly(httpOnly) {}
55
+
56
+ public:
57
+ friend bool operator==(const Cookie& lhs, const Cookie& rhs) = default;
50
58
  };
51
59
 
52
60
  } // namespace margelo::nitro::nitrocookies
@@ -59,26 +67,26 @@ namespace margelo::nitro {
59
67
  static inline margelo::nitro::nitrocookies::Cookie fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
60
68
  jsi::Object obj = arg.asObject(runtime);
61
69
  return margelo::nitro::nitrocookies::Cookie(
62
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "name")),
63
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "value")),
64
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "path")),
65
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "domain")),
66
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "version")),
67
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "expires")),
68
- JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "secure")),
69
- JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "httpOnly"))
70
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "name"))),
71
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "value"))),
72
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "path"))),
73
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "domain"))),
74
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "version"))),
75
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expires"))),
76
+ JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "secure"))),
77
+ JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "httpOnly")))
70
78
  );
71
79
  }
72
80
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitrocookies::Cookie& arg) {
73
81
  jsi::Object obj(runtime);
74
- obj.setProperty(runtime, "name", JSIConverter<std::string>::toJSI(runtime, arg.name));
75
- obj.setProperty(runtime, "value", JSIConverter<std::string>::toJSI(runtime, arg.value));
76
- obj.setProperty(runtime, "path", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.path));
77
- obj.setProperty(runtime, "domain", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.domain));
78
- obj.setProperty(runtime, "version", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.version));
79
- obj.setProperty(runtime, "expires", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.expires));
80
- obj.setProperty(runtime, "secure", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.secure));
81
- obj.setProperty(runtime, "httpOnly", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.httpOnly));
82
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "name"), JSIConverter<std::string>::toJSI(runtime, arg.name));
83
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "value"), JSIConverter<std::string>::toJSI(runtime, arg.value));
84
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "path"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.path));
85
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "domain"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.domain));
86
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "version"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.version));
87
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "expires"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.expires));
88
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "secure"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.secure));
89
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "httpOnly"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.httpOnly));
82
90
  return obj;
83
91
  }
84
92
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -89,14 +97,14 @@ namespace margelo::nitro {
89
97
  if (!nitro::isPlainObject(runtime, obj)) {
90
98
  return false;
91
99
  }
92
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "name"))) return false;
93
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "value"))) return false;
94
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "path"))) return false;
95
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "domain"))) return false;
96
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "version"))) return false;
97
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "expires"))) return false;
98
- if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "secure"))) return false;
99
- if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "httpOnly"))) return false;
100
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "name")))) return false;
101
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "value")))) return false;
102
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "path")))) return false;
103
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "domain")))) return false;
104
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "version")))) return false;
105
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expires")))) return false;
106
+ if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "secure")))) return false;
107
+ if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "httpOnly")))) return false;
100
108
  return true;
101
109
  }
102
110
  };
@@ -2,7 +2,7 @@
2
2
  /// HybridNitroCookiesSpec.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "HybridNitroCookiesSpec.hpp"
@@ -2,7 +2,7 @@
2
2
  /// HybridNitroCookiesSpec.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nitro-cookies",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Fetch, Get Cookies 🍪 at the Speed of Nitro",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -72,22 +72,22 @@
72
72
  "registry": "https://registry.npmjs.org/"
73
73
  },
74
74
  "devDependencies": {
75
- "@react-native/babel-preset": "0.81.1",
76
- "@types/jest": "^30.0.0",
77
- "@types/react": "^19.1.0",
78
- "del-cli": "^6.0.0",
79
- "jest": "^30.2.0",
80
- "nitrogen": "^0.31.4",
81
- "react": "19.1.0",
82
- "react-native": "0.81.1",
83
- "react-native-builder-bob": "^0.40.14",
84
- "react-native-nitro-modules": "^0.31.4",
85
- "typescript": "^5.9.2"
75
+ "@react-native/babel-preset": "0.84.0",
76
+ "@types/jest": "30.0.0",
77
+ "@types/react": "19.2.14",
78
+ "del-cli": "6.0.0",
79
+ "jest": "30.2.0",
80
+ "nitrogen": "0.33.9",
81
+ "react": "19.2.3",
82
+ "react-native": "0.84.0",
83
+ "react-native-builder-bob": "0.40.18",
84
+ "react-native-nitro-modules": "0.33.9",
85
+ "typescript": "5.9.3"
86
86
  },
87
87
  "peerDependencies": {
88
88
  "react": "*",
89
89
  "react-native": "*",
90
- "react-native-nitro-modules": "^0.31.4"
90
+ "react-native-nitro-modules": "~0.33.9"
91
91
  },
92
92
  "prettier": {
93
93
  "quoteProps": "consistent",