Skip to content

checkRequired

Source Code | Documentation

Check selected fields exist and are not falsey. Numeric 0 is acceptable.

ts
  import { 
checkRequired
} from 'feathers-utils/hooks';

Type declaration

ts
/**
 * Check selected fields exist and are not falsey. Numeric 0 is acceptable.
 *
 * @see https://utils.feathersjs.com/hooks/check-required.html
 */
export declare function checkRequired<H extends HookContext = HookContext>(
  fieldNames: MaybeArray<string>,
): (context: H, next?: NextFunction) => any
ArgumentTypeDescription
fieldNamesMaybeArray<string>
typemethodsmulti
before, aroundcreate, update, patchyes

Released under the MIT License.