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

25 lines (20 loc) 599 B
export function isObject(obj: unknown): obj is Record<string, unknown> { const type = typeof obj; return type === 'function' || (type === 'object' && !!obj); } export function isEmptyObject(obj: any) { return !!obj && Object.keys(obj).length === 0; } export function isString(str: string) { return Object.prototype.toString.call(str) === '[object String]'; } export function keysOf<T>(obj: T) { if (!obj) return []; return Object.keys(obj) as (keyof T)[]; } export function capitalize(s: string) { if (s?.length > 0) { return s[0].toUpperCase() + s.slice(1); } return s; }