Describe the bug
The isEntity function is not properly reflecting whether or not it is an entity, as the validation whether it is an instance of BaseEntity is returning false.
The issue can be reproduced by invoking entity.isEntity on an instance of BaseEntity within the buildAllFields method of the DataMapper class in Herbs2Mongo.
This has been tested using nested entities.
Expected behavior
The isEntity function should return true for all instances of BaseEntity.
Proposed solution
When calling instance.toString() we receive a string class extends BaseEntity {}, so it is possible to validate that the instance converted to string includes extends BaseEntity
Describe the bug The isEntity function is not properly reflecting whether or not it is an entity, as the validation whether it is an instance of BaseEntity is returning false.
To Reproduce Steps to reproduce the behavior:
The issue can be reproduced by invoking entity.isEntity on an instance of BaseEntity within the buildAllFields method of the DataMapper class in Herbs2Mongo. This has been tested using nested entities.
Expected behavior The isEntity function should return true for all instances of BaseEntity.
Proposed solution When calling instance.toString() we receive a string
class extends BaseEntity {}
, so it is possible to validate that the instance converted to string includesextends BaseEntity
Screenshots Here's a print of the problem happening when Herbs2Mongo tries to do this validation:
Additional context Resolution of issue https://github.com/herbsjs/herbs2mongo/issues/35 depends on this bug being fixed.