File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 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(
4242}
4343
4444void  Dotenv::SetEnvironment (node::Environment* env) {
45-   if  (store_.empty ()) {
46-     return ;
47-   }
48- 
4945  auto  isolate = env->isolate ();
5046
5147  for  (const  auto & entry : store_) {
@@ -67,7 +63,7 @@ void Dotenv::SetEnvironment(node::Environment* env) {
6763  }
6864}
6965
70- Local<Object> Dotenv::ToObject (Environment* env) {
66+ Local<Object> Dotenv::ToObject (Environment* env) const   {
7167  Local<Object> result = Object::New (env->isolate ());
7268
7369  for  (const  auto & entry : store_) {
@@ -263,7 +259,7 @@ Dotenv::ParseResult Dotenv::ParsePath(const std::string_view path) {
263259  return  ParseResult::Valid;
264260}
265261
266- void  Dotenv::AssignNodeOptionsIfAvailable (std::string* node_options) {
262+ void  Dotenv::AssignNodeOptionsIfAvailable (std::string* node_options) const   {
267263  auto  match = store_.find (" NODE_OPTIONS" 
268264
269265  if  (match != store_.end ()) {
Original file line number Diff line number Diff line change @@ -15,17 +15,17 @@ class Dotenv {
1515  enum  ParseResult { Valid, FileError, InvalidContent };
1616
1717  Dotenv () = default ;
18-   Dotenv (const  Dotenv& d) = default ;
18+   Dotenv (const  Dotenv& d) = delete ;
1919  Dotenv (Dotenv&& d) noexcept  = default ;
2020  Dotenv& operator =(Dotenv&& d) noexcept  = default ;
21-   Dotenv& operator =(const  Dotenv& d) = default ;
21+   Dotenv& operator =(const  Dotenv& d) = delete ;
2222  ~Dotenv () = default ;
2323
2424  void  ParseContent (const  std::string_view content);
2525  ParseResult ParsePath (const  std::string_view path);
26-   void  AssignNodeOptionsIfAvailable (std::string* node_options);
26+   void  AssignNodeOptionsIfAvailable (std::string* node_options)  const ;
2727  void  SetEnvironment (Environment* env);
28-   v8::Local<v8::Object> ToObject (Environment* env);
28+   v8::Local<v8::Object> ToObject (Environment* env)  const ;
2929
3030  static  std::vector<std::string> GetPathFromArgs (
3131      const  std::vector<std::string>& args);
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments