How to use the change-case.param 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 carbon-design-system / carbon / packages / icons-angular / src / build.js View on Github external
async function generateComponents() {
  // loop through the icons meta array
  for (const icon of icons) {
    const className = icon.moduleName;
    const selectorName = param(icon.moduleName);
    const rawSvg = toString(icon.descriptor);
    const outputPath = icon.outputOptions.file
      .replace('es', 'ts')
      .replace('.js', '.ts');
    // try to write out the component
    try {
      await fs.ensureDir(dirname(outputPath));
      await fs.writeFile(
        outputPath,
        componentTemplate(
          selectorName,
          className,
          rawSvg,
          icon.descriptor.attrs
        )
      );
github Planeshifter / node-word2vec / lib / index.js View on Github external
}

	if ( params.hasOwnProperty( 'silent' ) === true ) {
		silent = params.silent;
	}

	if ( !silent ) {
		var charm = require('charm')();
		charm.pipe(process.stdout);
		charm.reset();
	}

	paramsArr = [];
	for ( name in params ) {
		if ( params.hasOwnProperty(name) === true && name !== 'silent' ) {
			cc_name = changeCase.param( name );
			paramsArr.push( '-' + cc_name );
			paramsArr.push( params[name] );
		}
	}

	if( _.isString(input) === false || _.isString(output) === false ) {
		throw new TypeError( 'Input and output file names must be strings' );
	}

	cwd = process.cwd();
	inputPath = path.resolve( cwd, input );

	input = path.relative( SRC_FOLDER, inputPath );
	output = path.relative( SRC_FOLDER, output );

	var word2vecProc = spawn( './word2vec', ['-train', input, '-output', output ].concat(paramsArr), { cwd: SRC_FOLDER } );
github alexfedoseev / generator-flux-on-rails / app / index.js View on Github external
this.root        = path.join(shell.pwd(), this.name);
      this.rubyVersion = shell.env['RUBY_VERSION'];
      this.rvmString   = 'rvm ' + this.rubyVersion + '@' + this.name + ' do ';

      this.configRepo  = false;

      done();

    } else {

      var prompts = [
        {
          type   : 'input',
          name   : 'name',
          message: 'Enter app name:',
          default: shift.param(this.options.argv.original[0]) || null
        },
        {
          type   : 'checkbox',
          name   : 'parts',
          message: 'Choose parts to install:',
          choices: [
            {
              name   : 'Node App',
              value  : 'app',
              checked: true
            },
            {
              name   : 'Rails API',
              value  : 'api',
              checked: true
            }
github Urigo / SOFA / src / router.ts View on Github external
type,
  fieldName,
  router,
  models,
  link,
  handleError,
}: {
  schema: GraphQLSchema;
  type: GraphQLObjectType;
  fieldName: string;
  router: express.Router;
  models: string[];
  link: ApolloLink;
  handleError?: ErrorHandler;
}) {
  const path = `/${changeCase.param(fieldName)}`;
  const operation = getOperationType(type, schema);
  const methodMap = {
    query: 'get',
    mutation: 'post',
    subscription: undefined,
  };

  if (!operation) {
    throw new Error(`Type '${type}' is not a query, mutation or subscription`);
  }

  const method = methodMap[operation];

  if (!method) {
    throw new Error('Subscription is not supported yet');
  }
github 500tech / angular-kick / lib / format.js View on Github external
static toPartialControllerName(name) {
    return `_${ changeCase.param(name) }.js`;
  }
github 500tech / angular-kick / lib / format.js View on Github external
static toHTMLFileName(name) {
    return `${ changeCase.param(name) }.html`;
  }
github carbon-design-system / carbon / packages / icons-angular / src / templates.js View on Github external
template: \`
    <p>Component <code>&lt;ibm-icon-${param(
      icon.moduleName
    )}&gt;&lt;/ibm-icon-${param(icon.moduleName)}&gt;</code></p>
    
    <p>Directive <code>&lt;svg ibmIcon${pascal(
      icon.moduleName
    )}&gt;&lt;/svg&gt;</code></p>
    <svg></svg>
  \`
}))
.add("${icon.moduleName} with label", () =&gt; ({
  template: \`
    
    <svg></svg>
  \`
}))
.add("${icon.moduleName} with title", () =&gt; ({
  template: \`
    
    <svg title="icon title"></svg>
  \`
}))
.add("${icon.moduleName} with class on the SVG", () =&gt; ({
  template: \`
github plopjs / node-plop / src / baked-in-helpers.js View on Github external
import changeCase from 'change-case';

export default {
	camelCase: changeCase.camel,
	snakeCase: changeCase.snake,
	dotCase: changeCase.dot,
	pathCase: changeCase.path,
	lowerCase: changeCase.lower,
	upperCase: changeCase.upper,
	sentenceCase: changeCase.sentence,
	constantCase: changeCase.constant,
	titleCase: changeCase.title,

	dashCase: changeCase.param,
	kabobCase: changeCase.param,
	kebabCase: changeCase.param,

	properCase: changeCase.pascal,
	pascalCase: changeCase.pascal
};
github alexfedoseev / generator-flux-on-rails / app / index.js View on Github external
this.prompt(prompts, function (props) {

        function installPart(part) {
          return props.parts.indexOf(part) !== -1;
        }

        this.name        = shift.param(props.name);
        this.appName     = this.name + '-app';
        this.apiName     = this.name + '-api';
        this.installApp  = installPart('app');
        this.installApi  = installPart('api');

        this.root        = path.join(shell.pwd(), this.name);
        this.rubyVersion = shell.env['RUBY_VERSION'];
        this.rvmString   = 'rvm ' + this.rubyVersion + '@' + this.name + ' do ';

        this.configRepo  = props.configRepo;

        done();

      }.bind(this));
github cats-oss / scaffdog / src / template / funcs.ts View on Github external
funcs.set('kebab', (_: Context, v: string) => cc.param(v));
funcs.set('constant', (_: Context, v: string) => cc.constant(v));