There is a bug in the isEmpty function. I wanted to test if my object is empty using the isEmpty radash function. If given an empty object like myObject = {} it correctly says that it is empty. If the object is not empty like myObject = { a: 1 } it correctly says that it is not empty. But if my object contains the length key and the value of it is 0 then it incorrectly assumes the whole object is empty.
Example (can be tested on Radash Playground):
var radash = require("radash")
const shipment = {
status: "DRAFT",
length: 0,
name: "Joe Doe"
}
console.log(radash.isEmpty(shipment)) // true
There is a bug in the
isEmptyfunction. I wanted to test if my object is empty using theisEmptyradash function. If given an empty object likemyObject = {}it correctly says that it is empty. If the object is not empty likemyObject = { a: 1 }it correctly says that it is not empty. But if my object contains thelengthkey and the value of it is0then it incorrectly assumes the whole object is empty.Example (can be tested on Radash Playground):