src/hooks/serialize.ts
Function serialize
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function serialize<H extends HookContext = HookContext>(
schema1: SerializeSchema<H> | SyncContextFunction<SerializeSchema, H>,
) {
return (context: H) => {
const schema = typeof schema1 === 'function' ? schema1(context) : schema1;
Function serializeItem
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function serializeItem(item: any, schema: any) {
const computed: Record<string, any> = {};
Object.keys(schema.computed || {}).forEach(name => {
computed[name] = schema.computed[name](item, context); // needs closure
});