fratzinger/feathers-utils

View on GitHub
src/utils/toJSON.ts

Summary

Maintainability
A
0 mins
Test Coverage
C
75%
import type { HookContext } from "@feathersjs/feathers";

export const toJSON = (context: HookContext) => {
  if (context.toJSON) {
    return context.toJSON();
  }
  return context;
};