Travis build: 1810 [cron]

This commit is contained in:
30secondsofcode
2018-03-12 20:37:13 +00:00
parent 6adcd00686
commit beacf24971
3 changed files with 30 additions and 4 deletions

9
test/prefix/prefix.js Normal file
View File

@ -0,0 +1,9 @@
const prefix = prop => {
const capitalizedProp = prop.charAt(0).toUpperCase() + prop.slice(1);
const prefixes = ['', 'webkit', 'moz', 'ms', 'o'];
const i = prefixes.findIndex(
prefix => typeof document.body.style[prefix ? prefix + capitalizedProp : prop] !== 'undefined'
);
return i !== -1 ? (i === 0 ? prop : prefixes[i] + capitalizedProp) : null;
};
module.exports = prefix;