Skip to content

getDataIsArray

Source Code | Documentation

Always returns the context.data as an array. If context.data is not an array, it will be wrapped in an array.

ts
  import { 
getDataIsArray
} from 'feathers-utils/utils';

Type declaration

ts
/**
 * Always returns the `context.data` as an array.
 * If `context.data` is not an array, it will be wrapped in an array.
 *
 * @see https://utils.feathersjs.com/utils/get-data-is-array.html
 */
export declare function getDataIsArray<H extends HookContext = HookContext>(
  context: H,
): {
  data: any[]
  isArray: boolean
}
ArgumentTypeDescription
contextH

Released under the MIT License.