mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
fix(puterjs): fix settings object check
This commit is contained in:
parent
7f9d1e90b1
commit
5a616f67dd
@ -209,8 +209,13 @@ class AI{
|
||||
}
|
||||
|
||||
// if any of the args is an object, assume it's the settings object
|
||||
const is_object = v => {
|
||||
return typeof v === 'object' &&
|
||||
!Array.isArray(v) &&
|
||||
v !== null;
|
||||
};
|
||||
for (let i = 0; i < args.length; i++) {
|
||||
if (typeof args[i] === 'object') {
|
||||
if (is_object(args[i])) {
|
||||
settings = args[i];
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user