source: imaps-frontend/node_modules/hyphenate-style-name/index.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 452 bytes
RevLine 
[d565449]1/* eslint-disable no-var, prefer-template */
2var uppercasePattern = /[A-Z]/g
3var msPattern = /^ms-/
4var cache = {}
5
6function toHyphenLower(match) {
7 return '-' + match.toLowerCase()
8}
9
10function hyphenateStyleName(name) {
11 if (cache.hasOwnProperty(name)) {
12 return cache[name]
13 }
14
15 var hName = name.replace(uppercasePattern, toHyphenLower)
16 return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)
17}
18
19export default hyphenateStyleName
Note: See TracBrowser for help on using the repository browser.