Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit aeb56f1

Browse files
authored
Allow to use destructuring import with pick
1 parent ae4b643 commit aeb56f1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var isString = function(s){
44
return typeof(s) === 'string';
55
};
66

7-
module.exports.parse = function(al){
7+
function parse(al){
88
var strings = (al || "").match(regex);
99
return strings.map(function(m){
1010
if(!m){
@@ -28,13 +28,13 @@ module.exports.parse = function(al){
2828
});
2929
};
3030

31-
module.exports.pick = function(supportedLanguages, acceptLanguage){
31+
function pick(supportedLanguages, acceptLanguage){
3232
if (!supportedLanguages || !supportedLanguages.length || !acceptLanguage) {
3333
return null;
3434
}
3535

3636
if(isString(acceptLanguage)){
37-
acceptLanguage = this.parse(acceptLanguage);
37+
acceptLanguage = parse(acceptLanguage);
3838
}
3939

4040
var supported = supportedLanguages.map(function(support){
@@ -67,3 +67,6 @@ module.exports.pick = function(supportedLanguages, acceptLanguage){
6767

6868
return null;
6969
};
70+
71+
module.exports.parse = parse;
72+
module.exports.pick = pick;

0 commit comments

Comments
 (0)