|
|
@@ -138,10 +138,13 @@ export function* getNodeChildren( node, toJSON = false ) {
|
|
|
|
|
|
yield { property, childNode: object };
|
|
|
|
|
|
- } else if ( typeof object === 'object' ) {
|
|
|
+ } else if ( object && Object.getPrototypeOf( object ) === Object.prototype ) {
|
|
|
|
|
|
for ( const subProperty in object ) {
|
|
|
|
|
|
+ // Ignore private properties.
|
|
|
+ if ( subProperty.startsWith( '_' ) === true ) continue;
|
|
|
+
|
|
|
const child = object[ subProperty ];
|
|
|
|
|
|
if ( child && ( child.isNode === true || toJSON && typeof child.toJSON === 'function' ) ) {
|