How to use the change-case.sentenceCase function in change-case

To help you get started, we’ve selected a few change-case examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RouteInjector / route-injector / lib / mongoose-plugins / mongoose-jsonform / lib / mongoose-jsonform.js View on Github external
if (defaultValue && opt.setDefaults) {
                                    pathO.options.default = defaultValue;
                                    if (type.type == 'date') {
                                        pathO.options.default = pathO.options.default.toISOString();
                                    }
                                }
                                // TODO: Check if fullpath is undefined. If it is, attach it to options
                                if (fullPath) {
                                    pathO.arraypath = fullPath + '.' + pathString;
                                }
                                addCustomOptions(pathO);
                                _.extend(obj[path], convertTypeOptions(type.type, pathO.options), type);
                            } else if (type.type == 'array') {
                                obj[path] = type;
                                // Humanize array title
                                var sentenceCased = changeCase.sentenceCase(path);
                                var titleCased = changeCase.titleCase(sentenceCased);
                                obj[path].title = titleCased;
                                if (type.items.type == 'object') {
                                    // TODO: Pass to the the parseSchema the current path
                                    parseSchema(pathO.schema, obj[path].items.properties, pathO.path);
                                } else {
                                    type = getType(pathString, pathO.caster.instance);

                                    if (_.isFunction(pathO.options.default)) {
                                        type.default = pathO.options.default();
                                    }
                                    if (defaultValue && opt.setDefaults) {
                                        pathO.options.default = defaultValue;
                                        if (type.type == 'date') {
                                            pathO.options.default = pathO.options.default.toISOString();
                                        }
github ethereum / remix / remix-tests / src / testRunner.ts View on Github external
method.call(sendParams).then((result) => {
                let time = Math.ceil((Date.now() - startTime) / 1000.0)
                if (result) {
                    const resp: TestResultInterface = {
                      type: 'testPass',
                      value: changeCase.sentenceCase(func.name),
                      time: time,
                      context: testName
                    }
                    testCallback(undefined, resp)
                    passingNum += 1
                    timePassed += time
                } else {
                    const resp: TestResultInterface = {
                      type: 'testFailure',
                      value: changeCase.sentenceCase(func.name),
                      time: time,
                      errMsg: 'function returned false',
                      context: testName
                    }
                    testCallback(undefined, resp)
                    failureNum += 1
github RouteInjector / route-injector / lib / engine / routeinjector / typeBased.js View on Github external
sc.options["x-schema-form"] = sc.options["x-schema-form"] || {};
     sc.options["x-schema-form"]["disableSuccessState"] = true;
     }*/

    if (fullKey == modelConfig.id) {
        //set unique index
        var sc = getElementSchema(Model.schema.paths, fullKey);
        if (sc) {
            //Here we should unregister and register the model again (only for set the unique index to true
            sc.options.unique = true;
        }
    }

    //Enable pretty title if possible
    if (!field.title) {
        var sentenceCased = changeCase.sentenceCase(key);
        var titleCased = changeCase.titleCase(sentenceCased);
        var sc = getElementSchema(Model.schema.paths, fullKey);
        if (sc) {
            sc.options.title = titleCased;
        }
    }

    if (field.class) {
        var sc = getElementSchema(Model.schema.paths, fullKey);
        if (sc) {
            sc.options["x-schema-form"] = sc.options["x-schema-form"] || {};
            sc.options["x-schema-form"]["htmlClass"] = field.class;
        }
    }

    if (field.fieldClass) {
github mozilla-releng / balrog / ui / src / components / StatusLabel / index.jsx View on Github external
function StatusLabel(props) {
  const { state, mini, className, ...rest } = props;

  return (
    <label>
      {sentenceCase(state).toUpperCase() || 'UNKNOWN'}
    </label>
  );
}
github carbon-design-system / carbon / packages / icons / tasks / scaffold-metadata.js View on Github external
const icons = Object.keys(iconsGroupedByName).map(key => {
    const iconIsCategorized =
      categoryInformation[key] && categoryInformation[key].subcategory;

    const group = iconsGroupedByName[key];
    const savedIcon = metadata.icons.find(({ name }) => name === key);
    const icon = {
      name: key,
      friendly_name: savedIcon ? savedIcon.friendly_name : sentenceCase(key),
      usage: savedIcon ? savedIcon.usage : 'This is a description for usage',
      categories: iconIsCategorized
        ? [
            {
              name: categoryInformation[key].category,
              subcategory: categoryInformation[key].subcategory,
            },
          ]
        : [],
      aliases: savedIcon ? savedIcon.aliases : [key],
    };

    if (group.icon) {
      icon.sizes = [group.icon.size];
    } else if (group.icons) {
      icon.sizes = group.icons.map(icon => icon.size);
github lightness / github-repo-tools / src / modules / table / table.service.ts View on Github external
    const headers = fields.map(field => changeCase.sentenceCase(field));
github apache / incubator-myriad / myriad-scheduler / src / main / resources / webapp / js / components / TasksComponent.js View on Github external
_prettyName(name) {
    name = changeCase.sentenceCase(name);
    name = changeCase.titleCase(name);
    return name;
  }
github fabien0102 / gatsby-starter / generators / component-generator.js View on Github external
        default: data => `${sentenceCase(data.name)} component.`
      },