File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -119,8 +119,7 @@ export class NtpTimeSync {
119
119
return [ key , options [ key ] ] ;
120
120
}
121
121
122
- const isObject = typeof options [ key ] === "object" && options [ key ] !== null ;
123
- if ( isObject ) {
122
+ if ( NtpTimeSync . isPlainObject ( options [ key ] ) ) {
124
123
return [ key , this . recursiveResolveOptions ( options [ key ] , defaults [ key ] ) ] ;
125
124
}
126
125
@@ -130,6 +129,11 @@ export class NtpTimeSync {
130
129
return Object . fromEntries ( mergedConfig ) ;
131
130
}
132
131
132
+ // @see https://quickref.me/check-if-a-value-is-a-plain-object.html
133
+ private static isPlainObject ( v : any ) : boolean {
134
+ return ! ! v && typeof v === "object" && ( v . __proto__ === null || v . __proto__ === Object . prototype ) ;
135
+ }
136
+
133
137
/**
134
138
* Returns a singleton
135
139
*/
You can’t perform that action at this time.
0 commit comments