diff --git a/modules/__tests__/createPrefixer-test.js b/modules/__tests__/createPrefixer-test.js index 265ff9c..a9e1b42 100644 --- a/modules/__tests__/createPrefixer-test.js +++ b/modules/__tests__/createPrefixer-test.js @@ -232,12 +232,12 @@ describe('Static Prefixer', () => { transition: '200ms linear appearance, 100ms linear width', } const output = { - WebkitTransition: - '200ms linear -webkit-appearance,200ms linear appearance, 100ms linear width', MozTransition: '200ms linear -moz-appearance,200ms linear appearance, 100ms linear width', + WebkitTransition: + '200ms linear -webkit-appearance,200ms linear appearance, 100ms linear width', transition: - '200ms linear -moz-appearance,200ms linear -webkit-appearance,200ms linear appearance, 100ms linear width', + '200ms linear -ms-appearance,200ms linear -moz-appearance,200ms linear -webkit-appearance,200ms linear appearance, 100ms linear width', } expect(prefix(input)).toEqual(output) expect(prefix(input)).toEqual(output) diff --git a/modules/generator/generatePrefixMap.js b/modules/generator/generatePrefixMap.js index 9000673..d17cd95 100644 --- a/modules/generator/generatePrefixMap.js +++ b/modules/generator/generatePrefixMap.js @@ -73,7 +73,7 @@ export default function generatePrefixMap(browserList: Object): Object { filterAndRemoveIfEmpty( prefixMap, flexPropsIE[i], - prefix => prefix !== 'ms' && prefix !== 'Moz' + (prefix) => prefix !== 'ms' && prefix !== 'Moz' ) } @@ -82,11 +82,15 @@ export default function generatePrefixMap(browserList: Object): Object { filterAndRemoveIfEmpty( prefixMap, 'transition', - prefix => prefix !== 'Moz' && prefix !== 'Webkit' + (prefix) => prefix !== 'Moz' && prefix !== 'Webkit' ) // remove WebkitFlexDirection as it does not exist - filterAndRemoveIfEmpty(prefixMap, 'flexDirection', prefix => prefix !== 'Moz') + filterAndRemoveIfEmpty( + prefixMap, + 'flexDirection', + (prefix) => prefix !== 'Moz' + ) return prefixMap } diff --git a/modules/generator/index.js b/modules/generator/index.js index a450b53..f3204b8 100644 --- a/modules/generator/index.js +++ b/modules/generator/index.js @@ -15,7 +15,7 @@ export function generateFile( compatibility?: boolean ) { const pluginImports = pluginList - .map(plugin => generateImportString(plugin, compatibility)) + .map((plugin) => generateImportString(plugin, compatibility)) .join('\n') const moduleExporter = compatibility ? 'module.exports = ' : 'export default' @@ -51,7 +51,7 @@ function saveFile(fileContent: string, path: string): void { const fs = require('fs') /* eslint-enable global-require */ - fs.writeFile(path, fileContent, err => { + fs.writeFile(path, fileContent, (err) => { if (err) { throw err } diff --git a/modules/plugins/calc.js b/modules/plugins/calc.js index e9600d3..e37056c 100644 --- a/modules/plugins/calc.js +++ b/modules/plugins/calc.js @@ -9,6 +9,6 @@ export default function calc(property: string, value: any): ?Array { !isPrefixedValue(value) && value.indexOf('calc(') > -1 ) { - return prefixes.map(prefix => value.replace(/calc\(/g, `${prefix}calc(`)) + return prefixes.map((prefix) => value.replace(/calc\(/g, `${prefix}calc(`)) } } diff --git a/modules/plugins/crossFade.js b/modules/plugins/crossFade.js index e8fa863..83940d5 100644 --- a/modules/plugins/crossFade.js +++ b/modules/plugins/crossFade.js @@ -13,7 +13,7 @@ export default function crossFade( !isPrefixedValue(value) && value.indexOf('cross-fade(') > -1 ) { - return prefixes.map(prefix => + return prefixes.map((prefix) => value.replace(/cross-fade\(/g, `${prefix}cross-fade(`) ) } diff --git a/modules/plugins/cursor.js b/modules/plugins/cursor.js index 012d381..347c7c2 100644 --- a/modules/plugins/cursor.js +++ b/modules/plugins/cursor.js @@ -10,6 +10,6 @@ const values = { export default function cursor(property: string, value: any): ?Array { if (property === 'cursor' && values.hasOwnProperty(value)) { - return prefixes.map(prefix => prefix + value) + return prefixes.map((prefix) => prefix + value) } } diff --git a/modules/plugins/filter.js b/modules/plugins/filter.js index b73bddf..cf80483 100644 --- a/modules/plugins/filter.js +++ b/modules/plugins/filter.js @@ -10,7 +10,7 @@ export default function filter(property: string, value: any): ?Array { !isPrefixedValue(value) && value.indexOf('filter(') > -1 ) { - return prefixes.map(prefix => + return prefixes.map((prefix) => value.replace(/filter\(/g, `${prefix}filter(`) ) } diff --git a/modules/plugins/gradient.js b/modules/plugins/gradient.js index 3744769..a95e3f2 100644 --- a/modules/plugins/gradient.js +++ b/modules/plugins/gradient.js @@ -10,6 +10,8 @@ export default function gradient(property: string, value: any): ?Array { !isPrefixedValue(value) && values.test(value) ) { - return prefixes.map(prefix => value.replace(values, grad => prefix + grad)) + return prefixes.map((prefix) => + value.replace(values, (grad) => prefix + grad) + ) } } diff --git a/modules/plugins/imageSet.js b/modules/plugins/imageSet.js index 9de839e..a05a905 100644 --- a/modules/plugins/imageSet.js +++ b/modules/plugins/imageSet.js @@ -10,7 +10,7 @@ export default function imageSet(property: string, value: any): ?Array { !isPrefixedValue(value) && value.indexOf('image-set(') > -1 ) { - return prefixes.map(prefix => + return prefixes.map((prefix) => value.replace(/image-set\(/g, `${prefix}image-set(`) ) } diff --git a/modules/plugins/transition.js b/modules/plugins/transition.js index b1a47d2..fb74f2f 100644 --- a/modules/plugins/transition.js +++ b/modules/plugins/transition.js @@ -68,7 +68,7 @@ export default function transition( // if the property is already prefixed const webkitOutput = outputValue .split(/,(?![^()]*(?:\([^()]*\))?\))/g) - .filter(val => !/-moz-|-ms-/.test(val)) + .filter((val) => !/-moz-|-ms-/.test(val)) .join(',') if (property.indexOf('Webkit') > -1) { @@ -77,7 +77,7 @@ export default function transition( const mozOutput = outputValue .split(/,(?![^()]*(?:\([^()]*\))?\))/g) - .filter(val => !/-webkit-|-ms-/.test(val)) + .filter((val) => !/-webkit-|-ms-/.test(val)) .join(',') if (property.indexOf('Moz') > -1) { diff --git a/package.json b/package.json index d5c4813..1b23323 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "inline-style-prefixer", - "version": "6.0.0", + "version": "6.0.1", "description": "Run-time Autoprefixer for JavaScript style objects", "module": "es/index.js", "jsnext:main": "es/index.js", @@ -23,7 +23,7 @@ "format": "prettier --write \"./modules/**/*.js\"", "generate": "cross-env BABEL_ENV=commonjs babel-node generateDefaultData", "lint": "eslint modules/**/*.js", - "release": "yarn build && npm publish && yarn docs", + "release": "yarn build && npm publish", "test": "cross-env BABEL_ENV=commonjs jest", "coverage": "yarn test --coverage" }, diff --git a/yarn.lock b/yarn.lock index 6bf4125..afef96a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -134,11 +134,6 @@ ansi-escapes@^1.1.0, ansi-escapes@^1.4.0: resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" integrity sha1-06ioOzGapneTZisT52HHkRQiMG4= -ansi-regex@*: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== - ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -2225,7 +2220,7 @@ debug@~2.2.0: dependencies: ms "0.7.1" -debuglog@*, debuglog@^1.0.1: +debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI= @@ -4117,7 +4112,7 @@ import-lazy@^2.1.0: resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= -imurmurhash@*, imurmurhash@^0.1.4: +imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= @@ -5157,11 +5152,6 @@ lodash._baseflatten@~4.2.0: resolved "https://registry.yarnpkg.com/lodash._baseflatten/-/lodash._baseflatten-4.2.1.tgz#54acad5e6ef53532a5b8269c0ad725470cfd9208" integrity sha1-VKytXm71NTKluCacCtclRwz9kgg= -lodash._baseindexof@*: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c" - integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw= - lodash._baseuniq@~4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8" @@ -5170,33 +5160,11 @@ lodash._baseuniq@~4.6.0: lodash._createset "~4.0.0" lodash._root "~3.0.0" -lodash._bindcallback@*: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" - integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4= - -lodash._cacheindexof@*: - version "3.0.2" - resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92" - integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI= - -lodash._createcache@*: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093" - integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM= - dependencies: - lodash._getnative "^3.0.0" - lodash._createset@~4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26" integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY= -lodash._getnative@*, lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U= - lodash._root@~3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" @@ -5304,11 +5272,6 @@ lodash.rest@^4.0.0: resolved "https://registry.yarnpkg.com/lodash.rest/-/lodash.rest-4.0.5.tgz#954ef75049262038c96d1fc98b28fdaf9f0772aa" integrity sha1-lU73UEkmIDjJbR/Jiyj9r58Hcqo= -lodash.restparam@*: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU= - lodash.some@^4.4.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" @@ -7248,7 +7211,7 @@ readable-stream@~2.1.2, readable-stream@~2.1.5: string_decoder "~0.10.x" util-deprecate "~1.0.1" -readdir-scoped-modules@*, readdir-scoped-modules@^1.0.0: +readdir-scoped-modules@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz#8d45407b4f870a0dcaebc0e28670d18e74514309" integrity sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw== @@ -8660,7 +8623,7 @@ v8flags@^2.1.1: dependencies: user-home "^1.1.1" -validate-npm-package-license@*, validate-npm-package-license@^3.0.1, validate-npm-package-license@~3.0.1: +validate-npm-package-license@^3.0.1, validate-npm-package-license@~3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==