UNPKG

graplix

Version:

Authorization framework for implementing Relation-based Access Control (ReBAC) with the Resolver (Inspired by [GraphQL](https://graphql.org))

12 lines (10 loc) 226 B
import type { Arrayable } from "./Arrayable"; export function normalizeArrayable<T>(x: Arrayable<T> | undefined | null): T[] { if (x == null) { return []; } if (Array.isArray(x)) { return x; } return [x]; }