Skip to content

Commit

Permalink
v2.0.7 isObject condition made more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
nakednous committed Nov 2, 2023
1 parent 74270f8 commit 60174bc
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions p5.quadrille.js
Original file line number Diff line number Diff line change
Expand Up @@ -796,8 +796,7 @@ class Quadrille {

// TODO isPolyomino

// Static "protected" methods:
// TODO can they be made mutually exclusive ?
// Static "protected" methods

static _isEmpty(value) {
return value === null;
Expand All @@ -819,16 +818,20 @@ class Quadrille {
return value instanceof p5.Color;
}

static _isImage(value) {
return value instanceof p5.Image || value instanceof p5.Graphics;
}

static _isArray(value) {
return Array.isArray(value);
}

static _isObject(value) {
return value !== null && typeof value === 'object';
}

static _isImage(value) {
return value instanceof p5.Image || value instanceof p5.Graphics;
return Quadrille._isFilled(value) &&
!Quadrille._isColor(value) &&
!Quadrille._isImage(value) &&
!Quadrille._isArray(value) &&
typeof value === 'object';
}

// Instance methods:
Expand Down Expand Up @@ -1565,7 +1568,7 @@ class Quadrille {
const INFO =
{
LIBRARY: 'p5.quadrille.js',
VERSION: '2.0.6',
VERSION: '2.0.7',
HOMEPAGE: 'https://github.com/objetos/p5.quadrille.js'
};

Expand Down

0 comments on commit 60174bc

Please sign in to comment.