How to use the inflected.titleize function in inflected

To help you get started, we’ve selected a few inflected 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 DefinitelyTyped / DefinitelyTyped / inflected / inflected-tests.ts View on Github external
import * as Inflector from "inflected";

Inflector.pluralize("Category");
Inflector.singularize("Categories");
Inflector.camelize("nerd_bar", false);
Inflector.underscore('FooBar')      // => 'foo_bar'
//Inflector.humanize('employee_salary')                   // => 'Employee salary'
//Inflector.humanize('author_id')                         // => 'Author'
Inflector.humanize('author_id', { capitalize: false })  // => 'author'

Inflector.titleize('man from the boondocks')   // => 'Man From The Boondocks'
Inflector.titleize('x-men: the last stand')    // => 'X Men: The Last Stand'
Inflector.titleize('TheManWithoutAPast')       // => 'The Man Without A Past'
Inflector.titleize('raiders_of_the_lost_ark')  // => 'Raiders Of The Lost Ark'

Inflector.tableize('RawScaledScorer')  // => 'raw_scaled_scorers'
Inflector.tableize('egg_and_ham')      // => 'egg_and_hams'
Inflector.tableize('fancyCategory')    // => 'fancy_categories'

Inflector.classify('egg_and_hams')  // => 'EggAndHam'
Inflector.classify('posts')         // => 'Post'

Inflector.dasherize('puni_puni')  // => 'puni-puni'

Inflector.foreignKey('Message')         // => 'message_id'
Inflector.foreignKey('Message', false)  // => 'messageid'
github DefinitelyTyped / DefinitelyTyped / inflected / inflected-tests.ts View on Github external
import * as Inflector from "inflected";

Inflector.pluralize("Category");
Inflector.singularize("Categories");
Inflector.camelize("nerd_bar", false);
Inflector.underscore('FooBar')      // => 'foo_bar'
//Inflector.humanize('employee_salary')                   // => 'Employee salary'
//Inflector.humanize('author_id')                         // => 'Author'
Inflector.humanize('author_id', { capitalize: false })  // => 'author'

Inflector.titleize('man from the boondocks')   // => 'Man From The Boondocks'
Inflector.titleize('x-men: the last stand')    // => 'X Men: The Last Stand'
Inflector.titleize('TheManWithoutAPast')       // => 'The Man Without A Past'
Inflector.titleize('raiders_of_the_lost_ark')  // => 'Raiders Of The Lost Ark'

Inflector.tableize('RawScaledScorer')  // => 'raw_scaled_scorers'
Inflector.tableize('egg_and_ham')      // => 'egg_and_hams'
Inflector.tableize('fancyCategory')    // => 'fancy_categories'

Inflector.classify('egg_and_hams')  // => 'EggAndHam'
Inflector.classify('posts')         // => 'Post'

Inflector.dasherize('puni_puni')  // => 'puni-puni'

Inflector.foreignKey('Message')         // => 'message_id'
Inflector.foreignKey('Message', false)  // => 'messageid'

Inflector.ordinal(1)      // => 'st'
github sillsdev / appbuilder-portal / source / SIL.AppBuilder.Portal.Frontend / src / ui / components / product-artifact / header.tsx View on Github external
function humanReadableName(productDefinition) {
  const { name } = attributesFor(productDefinition);

  return titleize(name);
}
github sillsdev / appbuilder-portal / source / SIL.AppBuilder.Portal.Frontend / src / ui / components / inputs / resource-select / index.tsx View on Github external
const options = items.map((i) => {
      let label;
      const attributes = attributesFor(i);

      if (typeof labelField === 'string') {
        label = attributes[labelField];
      } else {
        label = labelField(i);
      }

      const text = titleize(label);

      return { text, value: i.id };
    });
github neinteractiveliterature / intercode / app / javascript / EventsApp / TeamMemberAdmin / EditTeamMember.jsx View on Github external
await update({
      variables: {
        input: {
          id: teamMember.id,
          team_member: buildTeamMemberInput(teamMember),
        },
      },
    });

    history.replace(`${eventPath}/team_members`);
  };

  return (
    <>
      <h1>
        {titleize(underscore(event.event_category.team_member_name))}
        {' Settings for '}
        {teamMember.user_con_profile.name_without_nickname}
      </h1>

      <dl>
        <dt>Email</dt>
        <dd>
          <a href="{`mailto:${teamMember.user_con_profile.email}`}">
            {teamMember.user_con_profile.email}
          </a>
        </dd>

        <dt>Daytime phone</dt>
        <dd>
          <a href="{`tel:${teamMember.user_con_profile.day_phone}`}">
            {teamMember.user_con_profile.day_phone}</a></dd></dl>
github neinteractiveliterature / intercode / app / javascript / OrganizationAdmin / OrganizationDisplay.jsx View on Github external
                  .map((permission) => titleize(
                    getOrganizationRolePermissionName(permission.permission),
                  ))
                  .join(', ')}
github neinteractiveliterature / intercode / app / javascript / EventsApp / TeamMemberAdmin / NewTeamMember.jsx View on Github external
},
      },
      refetchQueries: [
        { query: TeamMembersQuery, variables: { eventId: event.id } },
      ],
      awaitRefetchQueries: true,
    });

    history.replace(`${eventPath}/team_members`);
  };

  return (
    &lt;&gt;
      <h1>
        {'Add '}
        {titleize(underscore(event.event_category.team_member_name))}
      </h1>

      <div>
        <label>
          {`${humanize(underscore(event.event_category.team_member_name))}`}
          {' '}
          to add
        </label>
        </div>
github sillsdev / appbuilder-portal / source / SIL.AppBuilder.Portal.Frontend / src / ui / components / project-table / table / row / products / product-item.tsx View on Github external
humanReadableName = () => {
    const { productDefinition } = this.props;
    const { name } = attributesFor(productDefinition);

    const readableName = titleize(name);

    return readableName;
  };
github openspending / os-packager / app / services / utils.js View on Github external
module.exports.convertToTitle = function(string) {
  return inflector.titleize('' + (string || ''));
};