UNPKG

@platform/cell.schema

Version:

URI and database schemas for the `cell.os`.

27 lines (26 loc) 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function isHttp(input) { if (input === void 0) { input = ''; } input = input.trim(); return input.startsWith('https://') || input.startsWith('http://'); } exports.isHttp = isHttp; exports.isNilOrEmptyObject = function (value, options) { if (options === void 0) { options = {}; } return value === null ? true : exports.isUndefinedOrEmptyObject(value, options); }; exports.isUndefinedOrEmptyObject = function (value, options) { if (options === void 0) { options = {}; } return value === undefined ? true : exports.isEmptyObject(value, options); }; exports.isEmptyObject = function (value, options) { if (options === void 0) { options = {}; } if (value === null || typeof value !== 'object') { return false; } var keys = options.ignoreHash ? Object.keys(value).filter(function (key) { return key !== 'hash'; }) : Object.keys(value); return keys.length === 0; };