How to use the feathers-hooks-common.validateSchema function in feathers-hooks-common

To help you get started, we’ve selected a few feathers-hooks-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github feathers-plus / generator-feathers-plus / test-expands / cumulative-2-sequelize-services.test-expected / src1 / services / nedb-1 / nedb-1.validate.js View on Github external
let validateUpdate = options => {
  // ! code: func_update
  return validateSchema(update, ajv, options);
  // !end
};
github feathersjs-ecosystem / feathers-hooks-common / types / tests.ts View on Github external
}
});
// $ExpectType Hook>
traverse(function(node) {
    if (typeof node === 'string') {
        this.update(node.trim());
    }
}, context => context.params.query);

// $ExpectType Hook>
validate(async (data, context) => {
    return { length: 'expected max 3, got 7' };
});

// $ExpectType Hook>
validateSchema({}, ajv);

// $ExpectType Hook>
iffElse(syncTrue, [hook1, hook2], [hook3, hook4]);
// $ExpectType Hook>
iffElse(asyncTrue, [hook1, hook2], [hook3, hook4]);

// $ExpectType IffHook
iff(syncTrue, hook1, hook2);
// $ExpectType IffHook
iff(asyncTrue, hook1, hook2);
// $ExpectType Hook>
iff(syncTrue, hook1, hook2).else(hook3, hook4);
// $ExpectType Hook>
iff(asyncTrue, hook1, hook2).else(hook3, hook4);

// $ExpectType IffHook
github feathers-plus / generator-feathers-plus / test-expands / ts-cumulative-1-mongoose.test-expected / src1 / services / nedb-2 / nedb-2.validate.ts View on Github external
let validatePatch = (options?: any) => {
  // ! code: func_patch
  return validateSchema(patch, ajv, options);
  // !end
};
github feathers-plus / generator-feathers-plus / test-expands / ts-cumulative-1-mongoose.test-expected / src1 / services / nedb-2 / nedb-2.validate.ts View on Github external
let validateUpdate = (options?: any) => {
  // ! code: func_update
  return validateSchema(update, ajv, options);
  // !end
};
github feathers-plus / generator-feathers-plus / test-expands / ts-cumulative-1-mongo.test-expected / src1 / services / nedb-1 / nedb-1.validate.ts View on Github external
let validateUpdate = (options?: any) => {
  // ! code: func_update
  return validateSchema(update, ajv, options);
  // !end
};
github feathers-plus / generator-feathers-plus / examples / ts / 07-fakes / feathers-app / src / services / roles / roles.validate.ts View on Github external
let validateCreate = (options?: any) => {
  // ! code: func_create
  return validateSchema(create, ajv, options);
  // !end
};
github feathers-plus / generator-feathers-plus / examples / js / 06-service / feathers-app / src / services / teams / teams.validate.js View on Github external
let validateCreate = options => {
  // ! code: func_create
  return validateSchema(create, ajv, options);
  // !end
};
github feathers-plus / generator-feathers-plus / examples / ts / 06-service / feathers-app / src / services / roles / roles.validate.ts View on Github external
let validatePatch = (options?: any) => {
  // ! code: func_patch
  return validateSchema(patch, ajv, options);
  // !end
};
github feathers-plus / generator-feathers-plus / examples / ts / 04-model / feathers-app / src / services / users / users.validate.ts View on Github external
let validateCreate = (options?: any) => {
  // ! code: func_create
  return validateSchema(create, ajv, options);
  // !end
};
github feathers-plus / generator-feathers-plus / examples / ts / 06-service / feathers-app / src / services / teams / teams.validate.ts View on Github external
let validateCreate = (options?: any) => {
  // ! code: func_create
  return validateSchema(create, ajv, options);
  // !end
};