How to use the @learninglocker/xapi-validation/dist/factory.authority function in @learninglocker/xapi-validation

To help you get started, we’ve selected a few @learninglocker/xapi-validation 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 LearningLocker / learninglocker / lib / models / client.js View on Github external
const validateAuthority = async (value) => {
  const decodedValue = JSON.parse(value);
  const warnings = authority(decodedValue, ['authority']);
  if (Array.isArray(warnings) && warnings.length > 0) {
    throw new Error('Authority is invalid');
  }
  return true;
};

@learninglocker/xapi-validation

Validation library for the xAPI.

MIT
Latest version published 1 year ago

Package Health Score

52 / 100
Full package analysis

Similar packages