How to use the change-case.camelCase 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 michikono / generator-angular-enterprise / generators / router / index.js View on Github external
constructor: function () {
    // Calling the super constructor is important so our generator is correctly set up
    helpers.NamedBase.apply(this, arguments);
    this.log(
      'Creating route to module ' + chalk.green(this.name) + ' using '
      + chalk.green((this.config.get('uirouter') && 'UI Router') || 'Angular Router')
    );

    this.choices = {
      name: changeCase.camelCase(this.name),
      namePascalCase: changeCase.pascalCase(this.name),
      nameParamCase: changeCase.paramCase(this.name)
    };
  },
github whynotsoluciones / node-env-configuration / lib / config.js View on Github external
Config.prototype.extend = function (array, value, conf) {

  conf = conf || this.conf;
  var propName = null;

  // Last property in hierarchy
  if (array && array.length === 1) {
    conf[changeCase.camelCase(array[0])] = value;
  } else if (array && array.length > 1) {
    propName = array[0];
    propName = changeCase.camelCase(propName);
    // if object is not on conf. hierarchy
    if (array[0] && conf[propName] === undefined) {
      conf[propName] = {};
    }
    this.extend(array.slice(1), value, conf[propName]);
  }

};
github forcedotcom / lightning-language-server / packages / aura-language-server / src / aura-indexer / indexer.ts View on Github external
private transformLwcTagName(tag: string) {
        const namespace = tag.split('-')[0];
        const name = tag
            .split('-')
            .slice(1)
            .join('-');
        return {
            namespace,
            name: changeCase.camelCase(name),
        };
    }
    private transformLwcTagToAura(tag: string, tagInfo: any): TagInfo {
github Shopify / polaris-react / config / rollup / namespaced-classname.js View on Github external
let className = file[localName];

  if (className == null) {
    if (isComponent(localName)) {
      className =
        componentName === localName
          ? polarisComponentName
          : subcomponentClassName(polarisComponentName, localName);
    } else if (SUBCOMPONENT_VARIATION_SELECTOR.test(localName)) {
      const [subcomponent, variation] = localName.split('-');
      const subcomponentName = subcomponentClassName(
        polarisComponentName,
        subcomponent,
      );
      className = variationClassName(subcomponentName, camelCase(variation));
    } else {
      className = variationClassName(
        polarisComponentName,
        camelCase(localName),
      );
    }
  }

  file[localName] = className;
  cache.files[filePath] = file;
  return className;
};
github carbon-design-system / carbon / packages / icons-react / src / createFromInfo.js View on Github external
return string.split(';').reduce((acc, declaration) => {
    const [property, value] = declaration.split(':').map(s => s.trim());
    return {
      ...acc,
      [camelCase(property)]: value,
    };
  }, {});
}
github keajs / kea / src / cli / kea-generate.js View on Github external
function replacePlaceholders (text, nameParts) {
  const scene = nameParts[0]

  const componentPath = nameParts.slice(1).join('/')
  const componentString = nameParts.slice(1).join('-')

  return text.split('$$CapitalScene$$').join(changeCase.pascalCase(scene))
    .split('$$dash-scene$$').join(changeCase.paramCase(scene))
    .split('$$camelScene$$').join(changeCase.camelCase(scene))
    .split('$$CapitalComponent$$').join(changeCase.pascalCase(componentString))
    .split('$$camelComponent$$').join(changeCase.camelCase(componentString))
    .split('$$path-component$$').join(componentPath)
    .split('$$dash-component$$').join(componentString)
}
github cdvntr / react-native-confetti / service / index.js View on Github external
}).then(answer => {
            let dirPath = './services';
            fs.ensureDirSync(dirPath);
            let filePath = path.format({dir: dirPath, base: changeCase.camelCase(answer.name) + '.js'});
            this.fs.copyTpl(this.templatePath('service.ejs'), filePath, {
              serviceName: answer.name,
              methodName: changeCase.camelCase(answer.name) + 'Method'
            });
    		});
    },
github aws-amplify / amplify-cli / packages / amplify-graphql-types-generator / src / swift / helpers.ts View on Github external
propertyFromVariant(variant: Variant): Variant & Property & Struct {
    const structName = this.structNameForVariant(variant);

    return Object.assign(variant, {
      propertyName: camelCase(structName),
      typeName: structName + '?',
      structName,
    });
  }
github michikono / generator-angular-enterprise / generators / controller / index.js View on Github external
prompting: function () {
    this.log('Creating a controller: ' + chalk.green(this.name) + '...');
    this.choices.moduleName = changeCase.camelCase(this.options.moduleName);

    var done = this.async();
    var customModules = _.filter(helpers.getAllAngularModules(this.config.get('clientSideFolder') + this.config.get('appSubFolder') + 'app.module.js'), function (m) {
      return _.startsWith(m, this.config.get('appName') + '.') && m !== (this.config.get('appName') + '.core');
    }, this).sort();

    if (!customModules.length) {
      this.env.error(chalk.red("There are no features in this app. Please generate a feature before generating a controller. \nFor example, 'ae feature myFeature'."));
    } else {
      var prompts = [
        {
          type: 'list',
          name: 'moduleName',
          message: 'Which module does this controller belong in?',
          choices: customModules
        }];
github aws-amplify / amplify-cli / packages / amplify-graphql-types-generator / src / swift / helpers.ts View on Github external
propertyFromInputField(field: GraphQLInputField) {
    return Object.assign(
      {},
      {
        propertyName: camelCase(field.name),
        typeName: this.typeNameFromGraphQLType(field.type),
        isOptional: !(field.type instanceof GraphQLNonNull),
        description: field.description || null,
        name: field.name,
      }
    );
  }