Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 831 Bytes

README.md

File metadata and controls

35 lines (21 loc) · 831 Bytes

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