Comparing version 1.1.0 to 1.2.0
13
index.js
@@ -44,13 +44,14 @@ /*! | ||
Object.defineProperty(request, 'getLocaleFromHeader', { | ||
value: function() { | ||
value: function(multi) { | ||
var accept = this.acceptsLanguages() || '', | ||
reg = /(^|,\s*)([a-z-]+)/gi, | ||
match, | ||
locale; | ||
locales = [], | ||
match; | ||
while ((match = reg.exec(accept))) { | ||
if (!locale) { | ||
locale = match[2]; | ||
locales.push(match[2]) | ||
if (!multi && locales.length) { | ||
break; | ||
} | ||
} | ||
return locale; | ||
return multi ? locales : locales[0]; | ||
} | ||
@@ -57,0 +58,0 @@ }); |
{ | ||
"name": "koa-locale", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Get locale variable from query, subdomain, the last domain, accept-languages or cookie for koa.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4186
80