Skip to content

worklifebeyond/wlb-role-helper-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WorkLifeBeyond role helper for JavaScript

npm version

  • Install

    npm: npm install --save wlb-role-helper

    yarn yarn add wlb-role-helper

  • Usage

     const { getGlobalRoles, getOrgRoles, Roles } = require('wlb-role-helper');
     
     let gLobalRoles = getGlobalRoles("10");
     // ["student"]
     
     let orgRoles = getOrgRoles("00010001");
     // ["organization-hr-admin", "organization-supervisor"]
    
     if(orgRoles.includes(Roles.ORGANIZATION_SUPERVISOR)){
        // true
     }
    
     const getRoleNumber = getRoleFromValueToNumber([0,3]);
     // 10010000

    See Test for details.

  • Test

    Run npm test

About

Role helper for JavaScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published