github-oauth-scopes
v0.1.0
Published
utility for processing github oath scopes
Downloads
2
Readme
github-oauth-scopes
utility for processing github oath scopes
var ghScopes = require('github-oath-scopes');
ghScopes.isValid('repo'); // true
ghScopes.isValid('bad_scope'); // false
ghScopes.validate(['repo','bad_scope']); // throws an error
ghScopes.validate(['repo']); // returns the array
ghScopes.validate(null | undefined); // returns an empty array
// eliminate redundant scopes
ghScopes.reduce(['repo', 'repo:status']); // returns ['repo'];
ghScopes.longDescriptions; // a map of scopes to detailed descriptions
ghScopes.shortDescriptions; // a map of scopes to tool-tip ready descriptions