UNPKG

@redocly/cli

Version:

[@Redocly](https://redocly.com) CLI is your all-in-one OpenAPI utility. It builds, manages, improves, and quality-checks your OpenAPI descriptions, all of which comes in handy for various phases of the API Lifecycle. Create your own rulesets to make API g

29 lines (28 loc) 739 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isObject = isObject; exports.isEmptyObject = isEmptyObject; exports.isString = isString; exports.keysOf = keysOf; exports.capitalize = capitalize; function isObject(obj) { const type = typeof obj; return type === 'function' || (type === 'object' && !!obj); } function isEmptyObject(obj) { return !!obj && Object.keys(obj).length === 0; } function isString(str) { return Object.prototype.toString.call(str) === '[object String]'; } function keysOf(obj) { if (!obj) return []; return Object.keys(obj); } function capitalize(s) { if (s?.length > 0) { return s[0].toUpperCase() + s.slice(1); } return s; }