e2ed
Version:
E2E testing framework over Playwright
14 lines (13 loc) • 434 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasToJsonMethod = hasToJsonMethod;
/**
* Returns `true`, if value is object with `toJSON` method, and `false` otherwise.
* @internal
*/
function hasToJsonMethod(value) {
return (value !== null &&
(typeof value === 'object' || typeof value === 'function') &&
'toJSON' in value &&
typeof value.toJSON === 'function');
}