differentIndividuals: function (classes) {
   var return_string = decamelize(classes[0]["$"]["IRI"].replace("#", ""), " ").capitalize(true)+" is different from ";
   for (var i = 1; i < classes.length; i++){
     return_string += decamelize(classes[i]["$"]["IRI"].replace("#", ""), " ").capitalize(true)
     if (i != classes.length-1){
       return_string += " and ";
     }
   }
   return return_string;
 },
 disjointWith: function (classes){
   var return_string = articles.articlize(decamelize(classes[0]["$"]["IRI"].replace("#", ""), " ")).capitalize(true)+" is different from ";
   for (var i = 1; i < classes.length; i++){
     return_string += articles.articlize(decamelize(classes[i]["$"]["IRI"].replace("#", ""), " ").capitalize(true))
     if (i != classes.length-1){
       return_string += " and ";
     }
   }
   return return_string;
 },
 subPropertyOfChaining: function (subC, classes){
   var return_string = "";
   for (var i = 0; i < classes.length; i++){
     return_string += decamelize(classes[i]["$"]["IRI"].replace("#", ""), " ").capitalize(true)
     if (i != classes.length-1){
       return_string += " and ";
     }
   }
   return_string += " is contained in "+decamelize(subC, " ").capitalize(true);
   return return_string;
 },
Example #4
0
 self.functionDescription = function (fn, defaultDescription) {
   if (defaultDescription) {
     return defaultDescription
   }
   var description = fn.name ? decamelize(fn.name, '-') : 'generated-value'
   return ['(', description, ')'].join('')
 }
Example #5
0
    Object.keys(processors).forEach(plugin => {
        let shortName = plugin.replace('postcss', '');
        shortName = shortName.slice(0, 1).toLowerCase() + shortName.slice(1);

        let opts = defined(
            options[shortName],
            options[plugin],
            options[decamelize(plugin, '-')]
        );

        if (opts === false) {
            opts = {disable: true};
        }

        opts = assign({},
            defaultOptions[plugin],
            safe ? safeOptions[plugin] : null,
            opts
        );

        if (!opts.disable) {
            proc.use(processors[plugin](opts));
        }

    });
function genDoc(src) {
  let componentInfo;
  let dependency;
  try {
    componentInfo = docs.parse(src);
    dependency = detective(src)
      .filter(hasUpperCase)
      .map(dep => dep.split(path.sep).pop())
      .filter(dep => !!dep); // remove null and empty string
    componentInfo.dependency = dependency;
  } catch (err) {
    console.error(err);
  }
  if (componentInfo) {
    // create new line
    componentInfo.description = componentInfo.description.split(/[\r\n]+/)

    for (let key in componentInfo.props) {
      const prop = componentInfo.props[key];

      // flatten propTypes
      while (
        prop.type &&
        prop.type.value &&
        prop.type.value.value &&
        prop.type.value.name
        // because some prop named 'value', so we need to distinguish the reserved word(value)
        // and word 'value'
      ) {
        if (prop.type.value.name === 'shape') {
          // transform 'shape'
          for (let key in prop.type.value.value) {
            prop.type.value.value[key].value = `${key} : ${prop.type.value.value[key].name}`;
          }
        }
        prop.type.name += ` ${prop.type.value.name}`;
        prop.type.value = prop.type.value.value;
        prop.type.type = prop.type.value.type;
      }

      // make camel case human-readable
      if (prop.type && prop.type.name) {
        prop.type.name = decamelize(prop.type.name, ' ');
      }

      if (prop.description && prop.description.indexOf('@link') !== -1) {
        const tokens = prop.description.split(/[\n\r\s]+/);
        // detect @link
        const href = tokens[tokens.indexOf('@link') + 1];
        // remove @link
        prop.description = prop.description.replace(/@link[\s]+.*[\n\r\s]+/g, '')
        prop.type.link = {
          href,
        };
      }
    }
  }
  return componentInfo;
}
Example #7
0
function processMarkdown (markdown, key) {
  if (!pageCache[key]) {
    const { content, data } = grayMatter(markdown)
    const html = marked(content)
    pageCache[key] = { content: html, key: decamelize(key, '-'), ...data }
  }
  return pageCache[key]
}
 /**
  * Creates &amp; separated params string
  * @param params {object}
  */
 static urlParams(params) {
   const result = [];
   for (const key in params) {
     if (params.hasOwnProperty(key)) {
       result.push(`${decamelize(key)}=${params[key]}`);
     }
   }
   return result.join('&');
 }
Example #9
0
 flags.aliases[key].concat(key).forEach(function (x) {
   if (/[A-Z]/.test(x) && configuration['camel-case-expansion']) {
     var c = decamelize(x, '-')
     if (c !== key && flags.aliases[key].indexOf(c) === -1) {
       flags.aliases[key].push(c)
       newAliases[c] = true
     }
   }
 })
Example #10
0
 each(ruleSet, ((value, property) => {
   if (isObject(value)) {
     const newObject = {}
     newObject[property] = value
     stylesStr += compileStyles(newObject) // eslint-disable-line
   } else {
     stylesStr += `${decamelize(property, '-')}:${value};` // eslint-disable-line
   }
 }))
 dataSource = dataSource.map(x => ({
   ...x,
   appointmentType: decamelize(x.appointmentType, ' ')
     .split(' ')
     .map(ap => ap[0].toUpperCase() + ap.slice(1))
     .join(' '),
   appointmentDate: riMoment(x.appointmentDate).format('L'),
   startTime: riMoment(x.startTime).format('hh:mm A'),
 }));
Example #12
0
 static _createServiceRequestCounter({ requestCounter }) {
   if (requestCounter) {
     const { category, serviceFamily, name } = this
     const service = decamelize(name)
     return requestCounter.labels(category, serviceFamily, service)
   } else {
     // When metrics are disabled, return a mock counter.
     return { inc: () => {} }
   }
 }
Example #13
0
function buildToolbarMetadata(toolbarJsonFilePath){
    var parsedPath = path.parse(toolbarJsonFilePath);
    var toolbarName = path.parse(parsedPath.dir).base;

    return {
        dir: parsedPath.dir,
        nameCC: toolbarName,
        nameDC: decamelize(toolbarName, '-'),
    };
}
Example #14
0
function createBuildTest (type, pkgExport) {
  var pkgExportTest = "test/" + decamelize(pkgExport, "-") + ".test.js";

  sh.mkdir("-p", path.join("build", type, "test"));

  sh.exec("BABEL_ENV=" + type + " babel"
        + " -s inline"
        + " -o " + path.join("build", type, pkgExportTest)
        + " " + pkgExportTest);
}
Example #15
0
gulp.task('plugin:create', function(){
  if(flags.n && flags.n !== ''){
    var src = flags.m?'./scripts/templates/wrap-min.tmpl':'./scripts/templates/wrap.tmpl';
    return gulp.src(src)
      .pipe(replace('PluginName', flags.n))
      .pipe(rename(decamelize(flags.n, '-') + '.ts'))
      .pipe(gulp.dest('./src/plugins/'));
  } else {
    console.log("Usage is: gulp plugin:create -n PluginName");
  }
});
Example #16
0
exports.argvIndex = function(argv) {
    var index = _argvIndex(argv);
    if (index === -1 && typeof argv === 'string' && argv.indexOf('--') === 0) {
        // For some dumb reason, gulp-runner thought it would be a good idea to
        // dick around with the arg names, decamelizing them. Lets see can we
        // find the arg that way, if it starts with '--'.
        return _argvIndex(decamelize(argv, '-'));
    } else {
        return index;
    }
};
    return function(input, uppercaseFirst) {

      if (typeof input !== "string") {
        return input;
      }

      var result = decamelize(input, ' ');

      if (uppercaseFirst) {
        result = result.charAt(0).toUpperCase() + result.slice(1);
      }

      return result;
    };
Example #18
0
  constructor(fn) {
    super();

    console.assert(isFunction(fn), 'should be function');

    let name = fn.name;
    if (name) {
      name = decamelize(name, '-');
      if (name.startsWith('exhibit-')) name = name.substring(8);
    }
    else name = '[anonymous]';

    Object.defineProperties(this, {
      fn: {value: isGeneratorFunction(fn) ? coroutine(fn) : fn},
      name: {value: name},
    });
  }
Example #19
0
function createBuildBundle (type, pkgExport) {
  var buildBundle = path.join(
    "bundle",
    type,
    decamelize(pkgExport, "-") + ".js"
  );
  var buildBundleMap = buildBundle + ".map";

  sh.exec("browserify"
        + " -d"
        + " -s " + pkgExport
        + " build/" + type
        + " | exorcist " + buildBundleMap
        + " > " + buildBundle);

  // TODO: Remove this if exorcist updated to throw errors
  if (!sh.test("-e", buildBundleMap))
    throw Error("Failed to create " + buildBundleMap);
}
Example #20
0
function createTestBundle (type, pkgExport) {
  var testBundle = path.join(
    "bundle",
    type,
    "test",
    decamelize(pkgExport, "-") + ".test.js"
  );
  var testBundleMap = testBundle + ".map";

  sh.exec("browserify"
        + " -d "
        + testBundle.replace("bundle", "build")
        + " | exorcist " + testBundleMap
        + " > " + testBundle);

  // TODO: Remove this if exorcist updated to throw errors
  if (!sh.test("-e", testBundleMap))
    throw Error("Failed to create " + testBundleMap);
}
Example #21
0
function createTestBundleResources (type, pkgExport) {
  createResource(
    path.join("bundle", type, "test/mocha.css"),
    undefined,
    path.join(__dirname, "../resource/bundle/_mocha.css")
  );

  createResource(
    path.join("bundle", type, "test/mocha.js"),
    undefined,
    path.join(__dirname, "../resource/bundle/_mocha.js")
  );

  createResource(
    path.join("bundle", type, "test/index.html"),
    decamelize(pkgExport, "-"),
    path.join(__dirname, "../resource/bundle/_test.html")
  );
}
Example #22
0
	function decamelizeObject(object, separator)
	{
		if(isArray(object))
		{
			var newObject = [];

			for(var k in object)
			{
				if(object.hasOwnProperty(k))
				{
					if(typeof object[k] == "object" && object[k])
					{
						newObject.push(decamelizeObject(object[k]));
					}
					else
					{
						newObject.push(object[k]);
					}
				}
			}
		}
		else
		{
			var newObject = {};

			for(var k in object)
			{
				if(object.hasOwnProperty(k))
				{
					var newK = decamelize(k, separator);
					newObject[newK] = object[k];

					if(typeof newObject[newK] == "object" && newObject[newK])
					{
						newObject[newK] = decamelizeObject(newObject[newK]);
					}
				}
			}
		}

		return newObject;
	}
Example #23
0
    // format the default-value-string displayed in
    // the right-hand column.
    function defaultString(value, defaultDescription) {
        var string = '[default: ';

        if (value === undefined) return null;

        if (defaultDescription) {
          string += defaultDescription;
        } else {
          switch (typeof value) {
              case 'string':
                string += JSON.stringify(value);
                break;
              case 'function':
                string += '(' + (value.name.length ? decamelize(value.name, '-') : 'generated-value') + ')'
                break;
              default:
                string += value;
          }
        }

        return string + ']';
    }
 maxCardinality: function (subC, superC, rel, card) {
   return articles.articlize(decamelize(subC, " ")).capitalize(true)+" "+decamelize(rel, " ")+" at most "+card+" "+decamelize(superC, " ").capitalize(true)
 },
 characteristicsFunctional: function (rel) {
   return "Every Class or Object "+decamelize(rel, " ").capitalize(true)+" only 1 Class or Object";
 },
 inverseOf: function (subR, superR) {
   return (decamelize(subR, " ").capitalize(true)+" is the opposite of "+decamelize(superR, " ").capitalize(true));
 },
 equivalentRelations: function (subR, superR){
   return decamelize(subR, " ").capitalize(true)+" is the same as "+decamelize(superR, " ").capitalize(true)
 },
 subPropertyOf: function (subR, superR) {
   return (decamelize(subR, " ").capitalize(true)+" is "+articles.articlize(decamelize(superR, " ").capitalize(true)));
 },
 instances: function (subC, superC) {
   return "<img src='img/individ.png'></img>"+articles.articlize(decamelize(subC, " ")).capitalize(true)+" is "+articles.articlize(decamelize(superC, " ").capitalize(true));
 },
 equivalentClasses: function (subC, superC) {
   return articles.articlize(decamelize(subC, " ")).capitalize(true)+" is the same as "+articles.articlize(decamelize(superC, " ").capitalize(true))
 },