locales-detector
Advanced tools
Comparing version 1.1.0 to 1.1.1
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
## [1.1.1] 2018-10-29 | ||
### Fixed | ||
- Slice un-need locales from default transformer | ||
## [1.1.0] 2018-08-15 | ||
@@ -5,0 +10,0 @@ ### Changed |
@@ -164,3 +164,3 @@ 'use strict'; | ||
if (locales) { | ||
if (typeof locales === 'string') { | ||
return locales.split(','); | ||
@@ -167,0 +167,0 @@ } |
@@ -103,3 +103,3 @@ 'use strict'; | ||
if (locales) { | ||
if (typeof locales === 'string') { | ||
return locales.split(','); | ||
@@ -106,0 +106,0 @@ } |
@@ -290,3 +290,3 @@ import queryString from 'query-string'; | ||
value: function transform(locales) { | ||
return [].concat(toConsumableArray(locales.map(function (locale) { | ||
var transformedLocales = [].concat(toConsumableArray(locales.map(function (locale) { | ||
var splitedLocale = locale.split('-'); | ||
@@ -303,2 +303,5 @@ return splitedLocale.map(function (value, index) { | ||
}, [])), [this.defaultLocale]); | ||
// slice locales that comes after default locale | ||
return transformedLocales.slice(0, transformedLocales.indexOf(this.defaultLocale) + 1); | ||
} | ||
@@ -462,3 +465,3 @@ }]); | ||
if (locales) { | ||
if (typeof locales === 'string') { | ||
return locales.split(','); | ||
@@ -465,0 +468,0 @@ } |
@@ -296,3 +296,3 @@ 'use strict'; | ||
value: function transform(locales) { | ||
return [].concat(toConsumableArray(locales.map(function (locale) { | ||
var transformedLocales = [].concat(toConsumableArray(locales.map(function (locale) { | ||
var splitedLocale = locale.split('-'); | ||
@@ -309,2 +309,5 @@ return splitedLocale.map(function (value, index) { | ||
}, [])), [this.defaultLocale]); | ||
// slice locales that comes after default locale | ||
return transformedLocales.slice(0, transformedLocales.indexOf(this.defaultLocale) + 1); | ||
} | ||
@@ -468,3 +471,3 @@ }]); | ||
if (locales) { | ||
if (typeof locales === 'string') { | ||
return locales.split(','); | ||
@@ -471,0 +474,0 @@ } |
@@ -102,3 +102,3 @@ 'use strict'; | ||
value: function transform(locales) { | ||
return [].concat(toConsumableArray(locales.map(function (locale) { | ||
var transformedLocales = [].concat(toConsumableArray(locales.map(function (locale) { | ||
var splitedLocale = locale.split('-'); | ||
@@ -115,2 +115,5 @@ return splitedLocale.map(function (value, index) { | ||
}, [])), [this.defaultLocale]); | ||
// slice locales that comes after default locale | ||
return transformedLocales.slice(0, transformedLocales.indexOf(this.defaultLocale) + 1); | ||
} | ||
@@ -117,0 +120,0 @@ }]); |
@@ -292,3 +292,3 @@ 'use strict'; | ||
value: function transform(locales) { | ||
return [].concat(toConsumableArray(locales.map(function (locale) { | ||
var transformedLocales = [].concat(toConsumableArray(locales.map(function (locale) { | ||
var splitedLocale = locale.split('-'); | ||
@@ -305,2 +305,5 @@ return splitedLocale.map(function (value, index) { | ||
}, [])), [this.defaultLocale]); | ||
// slice locales that comes after default locale | ||
return transformedLocales.slice(0, transformedLocales.indexOf(this.defaultLocale) + 1); | ||
} | ||
@@ -307,0 +310,0 @@ }]); |
{ | ||
"name": "locales-detector", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Tool for detecting locales of visitors and transform them.", | ||
@@ -25,10 +25,10 @@ "keywords": [ | ||
"@socifi/eslint-config": "^1.10.0", | ||
"@socifi/jest-config": "^1.9.0", | ||
"@socifi/jest-config": "^1.10.0", | ||
"@socifi/rollup-config": "^1.10.0", | ||
"flow-bin": "^0.78.0", | ||
"flow-coverage-report": "^0.5.0", | ||
"flow-typed": "^2.4.0" | ||
"flow-bin": "^0.84.0", | ||
"flow-coverage-report": "^0.6.0", | ||
"flow-typed": "^2.5.1" | ||
}, | ||
"dependencies": { | ||
"query-string": "^6.1.0" | ||
"query-string": "^6.2.0" | ||
}, | ||
@@ -35,0 +35,0 @@ "scripts": { |
@@ -32,3 +32,3 @@ // @flow strict | ||
if (locales) { | ||
if (typeof locales === 'string') { | ||
return locales.split(','); | ||
@@ -35,0 +35,0 @@ } |
@@ -26,3 +26,3 @@ // @flow strict | ||
transform(locales: Array<string>): Array<string> { | ||
return [ | ||
const transformedLocales = [ | ||
...locales.map((locale) => { | ||
@@ -40,3 +40,6 @@ const splitedLocale = locale.split('-'); | ||
]; | ||
// slice locales that comes after default locale | ||
return transformedLocales.slice(0, transformedLocales.indexOf(this.defaultLocale) + 1); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
119964
2594
Updatedquery-string@^6.2.0