Skip to content

Commit 65014e6

Browse files
committed
🌀
1 parent 80aeb8d commit 65014e6

5 files changed

Lines changed: 72 additions & 64 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v1.2.4
2+
Исправлена ошибка «document.charset is undefined».
3+
14
# v1.2.3
25
- Правки typings.
36

dist/index.common.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ var hasWindow = typeof window !== 'undefined';
77
var hasNavigator = typeof navigator != 'undefined';
88
var hasScreen = typeof screen != 'undefined';
99
function getCharset() {
10-
return hasDocument ? document.charset.toLowerCase() : '';
10+
return hasDocument && typeof document.charset === 'string' ?
11+
document.charset.toLowerCase() :
12+
'';
1113
}
1214
function getHost() {
13-
return hasWindow ? window.location.hostname : '';
15+
return hasWindow && window.location ? window.location.hostname : '';
1416
}
1517
function getPageUrl() {
16-
return hasWindow ? window.location.href : '';
18+
return hasWindow && window.location ? window.location.href : '';
1719
}
1820
function getReferrer() {
1921
return hasDocument ? document.referrer : '';

dist/index.esm.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ var hasWindow = typeof window !== 'undefined';
33
var hasNavigator = typeof navigator != 'undefined';
44
var hasScreen = typeof screen != 'undefined';
55
function getCharset() {
6-
return hasDocument ? document.charset.toLowerCase() : '';
6+
return hasDocument && typeof document.charset === 'string' ?
7+
document.charset.toLowerCase() :
8+
'';
79
}
810
function getHost() {
9-
return hasWindow ? window.location.hostname : '';
11+
return hasWindow && window.location ? window.location.hostname : '';
1012
}
1113
function getPageUrl() {
12-
return hasWindow ? window.location.href : '';
14+
return hasWindow && window.location ? window.location.href : '';
1315
}
1416
function getReferrer() {
1517
return hasDocument ? document.referrer : '';

package-lock.json

Lines changed: 58 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "lyam",
33
"description": "Light Ya.Metrika for sites",
4-
"version": "1.2.3",
4+
"version": "1.2.4",
55
"author": {
66
"name": "Denis Seleznev",
77
"email": "hcodes@yandex.ru",

0 commit comments

Comments
 (0)