stoplightio/json

View on GitHub
src/hasRef.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { hasSomeRef } from './resolvers/guards';

export const hasRef = (obj: unknown): obj is Record<string, unknown> & { $ref: string } =>
  hasSomeRef(obj) && typeof obj.$ref === 'string';