Skip to content

Instantly share code, notes, and snippets.

@hakant
Last active November 5, 2016 08:46
Show Gist options
  • Select an option

  • Save hakant/d68576a8d9cc9ed85e8d3c649ad8a856 to your computer and use it in GitHub Desktop.

Select an option

Save hakant/d68576a8d9cc9ed85e8d3c649ad8a856 to your computer and use it in GitHub Desktop.
/** 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