Last active
November 5, 2016 08:46
-
-
Save hakant/d68576a8d9cc9ed85e8d3c649ad8a856 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** AdminRepository.ts **/ | |
| "use strict"; | |
| import * as _ from 'underscore'; | |
| import * as nconf from 'nconf'; | |
| const businessRules = nconf.get("BusinessRules"); | |
| let admins = businessRules.Administrators; | |
| export default class AdminRepository implements IAdminRepository { | |
| IsUserAdmin(username){ | |
| return _.contains(admins, username); | |
| } | |
| } | |
| /** ideas.js **/ | |
| const AdminRepository = require('../repositories/AdminRepository'); | |
| let adminRepository = new AdminRepository.default(); | |
| /** after converting it to Ideas.ts it will become: **/ | |
| import AdminRepository from '../repositories/AdminRepository'; | |
| const adminRepository = new AdminRepository(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment