Gitter migration: Setup redirects (rollout pt. 3)
[gitter.git] / shared / get-room-name-from-troupe-name.js
blob0b816b8782ee52291145d9f6201e4bf888f09645
1 'use strict';
3 var getOrgNameFromTroupeName = require('./get-org-name-from-troupe-name');
4 var escapeStringRegexp = require('escape-string-regexp');
6 module.exports = function getRoomNameFromTroupeName(name) {
7 if (!name) return '';
9 // TODO: consider reworking this
10 return name.replace(
11 new RegExp('^' + escapeStringRegexp(getOrgNameFromTroupeName(name)) + '/'),