source: imaps-frontend/node_modules/hyphenate-style-name/index.cjs.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: 474 bytes
Line 
1'use strict';
2
3/* eslint-disable no-var, prefer-template */
4var uppercasePattern = /[A-Z]/g;
5var msPattern = /^ms-/;
6var cache = {};
7
8function toHyphenLower(match) {
9 return '-' + match.toLowerCase()
10}
11
12function hyphenateStyleName(name) {
13 if (cache.hasOwnProperty(name)) {
14 return cache[name]
15 }
16
17 var hName = name.replace(uppercasePattern, toHyphenLower);
18 return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)
19}
20
21module.exports = hyphenateStyleName;
Note: See TracBrowser for help on using the repository browser.