New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tincan-validator

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tincan-validator

Validates tincan statements, activities, agents, and states

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

Tincan Validator

Validates Tincan API statements, activities, agents, and states

Installation

npm install tincan-validator

Usage

Can be used sync or async style.

var validator = require("tincan-validator");

var statementErrors = validator.validateStatement(myStatement);
console.log(statementErrors);

validator.validateActivity(myActivity, function(activityErrors){
    console.log(activityErrors);
});

Available methods

  • validateStatement(statement, callback)
  • validateAgent(agent, callback)
  • validateActivity(activity, callback)
  • validateState(state, callback) //TODO

Additional methods

These are used internally by the above methods, but are available if you need them.

  • validateActor(actor, callback)
  • validateGroup(group, callback)
  • validateVerb(verb, callback)
  • validateLanguageMap(languageMap, callback)
  • validateObject(object, callback)
  • validateResult(result, callback)
  • validateISO8601(timestamp, callback)
  • validateContext(context, callback)
  • validateVersion(version, callback)
  • validateAuthority(authority, callback)

Developing

npm install
grunt test
grunt build

Development is all coffeescript located in /src.

Tests are located in /test with mock validation objects in /test/mocks

Any contributions should pass all existing unit tests before a pull request will be accepted.

Ideally unit tests should be written for contributions

Todo

  • validate statement context
  • validate statement authority
  • validate states
  • descriptions for all errors
  • add some failure tests

Keywords

tincan

FAQs

Package last updated on 10 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts