avoid errors when required via node and no location is present

This commit is contained in:
Andrea Giammarchi
2014-11-07 10:02:24 +00:00
parent db01efff07
commit a8ad0e4e07
3 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,4 @@
var location = global.location || {};
/*jslint indent: 2, browser: true, bitwise: true, plusplus: true */
var twemoji = (function (
/*! Copyright Twitter Inc. and other contributors. Licensed under MIT *//*
@ -510,4 +511,7 @@ var twemoji = (function (
}
}());
if (!location.protocol) {
twemoji.base = twemoji.base.replace(/^http:/, "");
}
module.exports = twemoji;