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 {
119119 return [ key , options [ key ] ] ;
120120 }
121121
122- const isObject = typeof options [ key ] === "object" && options [ key ] !== null ;
123- if ( isObject ) {
122+ if ( NtpTimeSync . isPlainObject ( options [ key ] ) ) {
124123 return [ key , this . recursiveResolveOptions ( options [ key ] , defaults [ key ] ) ] ;
125124 }
126125
@@ -130,6 +129,11 @@ export class NtpTimeSync {
130129 return Object . fromEntries ( mergedConfig ) ;
131130 }
132131
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+
133137 /**
134138 * Returns a singleton
135139 */
You can’t perform that action at this time.
0 commit comments