Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / yargs / node_modules / camelcase / index.js
1 'use strict';
2 module.exports = function () {
3         var str = [].map.call(arguments, function (str) {
4                 return str.trim();
5         }).filter(function (str) {
6                 return str.length;
7         }).join('-');
8
9         if (!str.length) {
10                 return '';
11         }
12
13         if (str.length === 1 || !(/[_.\- ]+/).test(str) ) {
14                 if (str[0] === str[0].toLowerCase() && str.slice(1) !== str.slice(1).toLowerCase()) {
15                         return str;
16                 }
17
18                 return str.toLowerCase();
19         }
20
21         return str
22         .replace(/^[_.\- ]+/, '')
23         .toLowerCase()
24         .replace(/[_.\- ]+(\w|$)/g, function (m, p1) {
25                 return p1.toUpperCase();
26         });
27 };