Comparing version 0.2.1 to 0.3.0
@@ -10,3 +10,3 @@ | ||
"use strict"; | ||
var lodash, oAgents, oCaniuseData, semver, _getBrowser, _versionToSemver; | ||
var fPrefixSort, lodash, oAgents, oCaniuseData, semver, _getBrowser, _versionToSemver; | ||
@@ -21,2 +21,6 @@ oCaniuseData = require("caniuse-db/data.json"); | ||
fPrefixSort = function(sPrefix) { | ||
return sPrefix.length; | ||
}; | ||
_getBrowser = function(sBrowserName) { | ||
@@ -153,3 +157,3 @@ var oAgent, sAgent; | ||
} | ||
return lodash.unique(aPrefixes); | ||
return lodash.sortBy(lodash.unique(aPrefixes), fPrefixSort).reverse(); | ||
}; |
{ | ||
"name": "prefiks", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "Get the vendors prefixes of a css properties, according to can i use datas.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -19,3 +19,4 @@ # prefiks | ||
The `prefix` functions returns an array with the prefixes to use for the given browser(s) versions (it always returns an array, even empty). | ||
The `prefix` functions returns an array with the prefixes to use for the given browser(s) versions (it always returns an array, even empty). | ||
The prefixes are reverse-ordered by length (longest prefix first). | ||
@@ -74,2 +75,3 @@ ### One browser form | ||
* **0.3.0**: Sorting prefixes by length (*14/07/14*) | ||
* **0.2.0**: Multiple browser form (*14/07/14*) | ||
@@ -76,0 +78,0 @@ * **0.1.0**: Initial release (*11/07/14*) |
@@ -60,3 +60,3 @@ "use strict"; | ||
test.deepEqual( prefiks( "transforms2d", "safari" ), [ "webkit" ], "Should be [ 'webkit' ]." ); | ||
test.deepEqual( prefiks( "transforms2d", "opera" ), [ "o", "webkit" ], "Should be [ 'o', 'webkit' ]." ); | ||
test.deepEqual( prefiks( "transforms2d", "opera" ), [ "webkit", "o" ], "Should be [ 'webkit', 'o' ]." ); | ||
test.deepEqual( prefiks( "transforms2d", "ios_saf" ), [ "webkit" ], "Should be [ 'webkit' ]." ); | ||
@@ -92,5 +92,5 @@ test.deepEqual( prefiks( "transforms2d", "op_mini" ), [], "Should be []." ); | ||
}; | ||
test.deepEqual( prefiks( "transforms2d", oBrowserHashOne ), [ "ms", "webkit", "o" ], "Should be [ 'ms', 'webkit', 'o' ]." ); | ||
test.deepEqual( prefiks( "transforms2d", oBrowserHashOne ), [ "webkit", "ms", "o" ], "Should be [ 'webkit', 'ms', 'o' ]." ); | ||
test.done(); | ||
}, | ||
}; |
Sorry, the diff of this file is not supported yet
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
19092
237
81