Travis build: 1808

This commit is contained in:
30secondsofcode
2018-03-12 20:31:45 +00:00
parent 62a93e1c71
commit 6adcd00686
3 changed files with 46 additions and 4 deletions

View File

@ -9,9 +9,11 @@ Use `String.charAt()` and `String.toUpperCase()` to capitalize the property, whi
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;
}
const i = prefixes.findIndex(
prefix => typeof document.body.style[prefix ? prefix + capitalizedProp : prop] !== 'undefined'
);
return i !== -1 ? (i === 0 ? prop : prefixes[i] + capitalizedProp) : null;
};
```
```js