File tree 2 files changed +6
-10
lines changed
2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,6 @@ std::vector<std::string> Dotenv::GetPathFromArgs(
42
42
}
43
43
44
44
void Dotenv::SetEnvironment (node::Environment* env) {
45
- if (store_.empty ()) {
46
- return ;
47
- }
48
-
49
45
auto isolate = env->isolate ();
50
46
51
47
for (const auto & entry : store_) {
@@ -67,7 +63,7 @@ void Dotenv::SetEnvironment(node::Environment* env) {
67
63
}
68
64
}
69
65
70
- Local<Object> Dotenv::ToObject (Environment* env) {
66
+ Local<Object> Dotenv::ToObject (Environment* env) const {
71
67
Local<Object> result = Object::New (env->isolate ());
72
68
73
69
for (const auto & entry : store_) {
@@ -263,7 +259,7 @@ Dotenv::ParseResult Dotenv::ParsePath(const std::string_view path) {
263
259
return ParseResult::Valid;
264
260
}
265
261
266
- void Dotenv::AssignNodeOptionsIfAvailable (std::string* node_options) {
262
+ void Dotenv::AssignNodeOptionsIfAvailable (std::string* node_options) const {
267
263
auto match = store_.find (" NODE_OPTIONS" );
268
264
269
265
if (match != store_.end ()) {
Original file line number Diff line number Diff line change @@ -15,17 +15,17 @@ class Dotenv {
15
15
enum ParseResult { Valid, FileError, InvalidContent };
16
16
17
17
Dotenv () = default ;
18
- Dotenv (const Dotenv& d) = default ;
18
+ Dotenv (const Dotenv& d) = delete ;
19
19
Dotenv (Dotenv&& d) noexcept = default ;
20
20
Dotenv& operator =(Dotenv&& d) noexcept = default ;
21
- Dotenv& operator =(const Dotenv& d) = default ;
21
+ Dotenv& operator =(const Dotenv& d) = delete ;
22
22
~Dotenv () = default ;
23
23
24
24
void ParseContent (const std::string_view content);
25
25
ParseResult ParsePath (const std::string_view path);
26
- void AssignNodeOptionsIfAvailable (std::string* node_options);
26
+ void AssignNodeOptionsIfAvailable (std::string* node_options) const ;
27
27
void SetEnvironment (Environment* env);
28
- v8::Local<v8::Object> ToObject (Environment* env);
28
+ v8::Local<v8::Object> ToObject (Environment* env) const ;
29
29
30
30
static std::vector<std::string> GetPathFromArgs (
31
31
const std::vector<std::string>& args);
You can’t perform that action at this time.
0 commit comments