Skip to content

Commit

Permalink
lint and release
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Aug 11, 2022
1 parent 2cca31d commit 205a200
Show file tree
Hide file tree
Showing 15 changed files with 13,428 additions and 3,818 deletions.
11 changes: 10 additions & 1 deletion .eslintrc
@@ -1,4 +1,4 @@
parser: babel-eslint
parser: "@babel/eslint-parser"
extends: airbnb

rules:
Expand All @@ -8,6 +8,12 @@ rules:
comma-dangle: [2, "never"]
padded-blocks: [0, "never"]
no-unused-vars: [2, {vars: all, args: none}]
no-param-reassign: 0
guard-for-in: 0
no-restricted-syntax: 0
prefer-rest-params: 0
import/extensions: 0
no-plusplus: 0
react/prop-types:
- 0
- ignore: #coming from hoc
Expand All @@ -17,3 +23,6 @@ rules:

globals:
expect: false
window: false
navigator: false
document: false
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
### 6.1.5

- lookup subdomain with localhost option [264](https://github.com/i18next/i18next-browser-languageDetector/pull/264)

### 6.1.4

- fix querystring lookup if happening after # [256](https://github.com/i18next/i18next-browser-languageDetector/issues/256)
Expand Down
18 changes: 9 additions & 9 deletions i18nextBrowserLanguageDetector.js
Expand Up @@ -50,36 +50,36 @@
var opt = options || {};
opt.path = opt.path || '/';
var value = encodeURIComponent(val);
var str = name + '=' + value;
var str = "".concat(name, "=").concat(value);

if (opt.maxAge > 0) {
var maxAge = opt.maxAge - 0;
if (isNaN(maxAge)) throw new Error('maxAge should be a Number');
str += '; Max-Age=' + Math.floor(maxAge);
if (Number.isNaN(maxAge)) throw new Error('maxAge should be a Number');
str += "; Max-Age=".concat(Math.floor(maxAge));
}

if (opt.domain) {
if (!fieldContentRegExp.test(opt.domain)) {
throw new TypeError('option domain is invalid');
}

str += '; Domain=' + opt.domain;
str += "; Domain=".concat(opt.domain);
}

if (opt.path) {
if (!fieldContentRegExp.test(opt.path)) {
throw new TypeError('option path is invalid');
}

str += '; Path=' + opt.path;
str += "; Path=".concat(opt.path);
}

if (opt.expires) {
if (typeof opt.expires.toUTCString !== 'function') {
throw new TypeError('option expires is invalid');
}

str += '; Expires=' + opt.expires.toUTCString();
str += "; Expires=".concat(opt.expires.toUTCString());
}

if (opt.httpOnly) str += '; HttpOnly';
Expand Down Expand Up @@ -129,7 +129,7 @@
document.cookie = serializeCookie(name, encodeURIComponent(value), cookieOptions);
},
read: function read(name) {
var nameEQ = name + '=';
var nameEQ = "".concat(name, "=");
var ca = document.cookie.split(';');

for (var i = 0; i < ca.length; i++) {
Expand Down Expand Up @@ -361,8 +361,8 @@
lookupSessionStorage: 'i18nextLng',
// cache user language
caches: ['localStorage'],
excludeCacheFor: ['cimode'] //cookieMinutes: 10,
//cookieDomain: 'myDomain'
excludeCacheFor: ['cimode'] // cookieMinutes: 10,
// cookieDomain: 'myDomain'

};
}
Expand Down
2 changes: 1 addition & 1 deletion i18nextBrowserLanguageDetector.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 205a200

Please sign in to comment.