How to use the change-case.camel 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 lithiumtech / lithium-sdk / lib / generate.js View on Github external
function scaffold(type, subModule, name, createNewSubModule, cb) {

    var componentPath = type + 's/' + subModule + '/' + name;

    var ops = {
      name: name,
      type: type,
      subModule: subModule,
      camel: changeCase.camel(name)
    };

    if (createNewSubModule) {
      fs.mkdirSync('src/' + type + 's/' + subModule);
    }

    // certain types need special variables
    switch (type) {
      case 'directive':
        ops.camel = 'li' + changeCase.pascalCase(subModule) + changeCase.pascalCase(name);
        ops.markup = 'li:' + [subModule, name].join('-');
        ops.cssClass = ['lia', subModule, name].join('-');
        break;
      case 'service':
        ops.camel = '$li' + changeCase.pascalCase(name);
        break;
github TradeMe / tractor / src / app / Core / Components / StepInput / StepInputDirective.js View on Github external
function link ($scope, $element, $attrs) {
        if (_.isUndefined($scope.stepInput.model)) {
            throw new Error('The "tractor-step-input" directive requires a "model" attribute.');
        }

        if (_.isUndefined($scope.stepInput.label)) {
            throw new Error('The "tractor-step-input" directive requires a "label" attribute.');
        }

        if (_.isUndefined($attrs.form)) {
            throw new Error('The "tractor-step-input" directive requires a "form" attribute.');
        }

        $scope.stepInput.form = $scope.$parent[$attrs.form];
        $scope.stepInput.id = Math.floor(Math.random() * Date.now());
        $scope.stepInput.property = camelcase($scope.stepInput.label);

        $scope.handleKeyDown = function (event) {
            if (event.keyCode === 40) {
                event.preventDefault();
                if ($scope.selectedIndex !== $scope.stepInput.items.length - 1) {
                    $scope.selectedIndex += 1;
                }
            }
            else if (event.keyCode === 38) {
                event.preventDefault();
                if ($scope.selectedIndex !== 0) {
                    $scope.selectedIndex -= 1;
                }
            }
            else if (event.keyCode === 27) {
                $scope.stepInput.isOpen = false;
github types / _generator-typings / generators / app / index.js View on Github external
);

      this.fs.copyTpl(
        this.templatePath('template/test_tsconfig.json'),
        this.destinationPath('test/tsconfig.json'),
        {
          sourceMain: this.props.sourceMain
        }
      );

      if (~this.props.sourceUsages.indexOf('commonjs')) {
        this.fs.write('test/test.ts',
          [
            `import test = require('${this.props.testFramework}');`,
            '',
            `import ${changeCase.camel(this.props.sourceDeliveryPackageName)} = require('${this.props.sourceDeliveryPackageName}');`,
            ''
          ].join('\n'));
      }
      else if (~this.props.sourceUsages.indexOf('esm')) {
        this.fs.write('test/test.ts',
          [
            `import test = require('${this.props.testFramework}');`,
            '',
            `import ${changeCase.camel(this.props.sourceDeliveryPackageName)} from '${this.props.sourceDeliveryPackageName}';`,
            ''
          ].join('\n'));
      }
      else if (~this.props.sourceUsages.indexOf('amd')) {
        this.fs.write('test/test.ts',
          [
            'define((require, module, exports) => {',
github TradeMe / tractor / packages / ui / src / app / Core / Components / SelectInput / SelectInputDirective.js View on Github external
function link ($scope, $element, $attrs) {
        if (_.isUndefined($scope.model)) {
            throw new Error('The "tractor-select" directive requires a "model" attribute.');
        }

        if (_.isUndefined($scope.label)) {
            throw new Error('The "tractor-select" directive requires a "label" attribute.');
        }

        $scope.property = camelcase($scope.label);
        $scope.selectOptions = getOptionsFromProperty($scope);

        if (_.isUndefined($scope.selectOptions) && _.isUndefined($scope.options)) {
            throw new Error('The "tractor-select" directive requires an "options" attribute, or a "label" attribute that matches a set of options on the "model".');
        }

        $scope.$watchCollection('options', function () {
            $scope.selectOptions = $scope.options || getOptionsFromProperty($scope);
        });

        $scope.form = $scope.$parent[$attrs.form] || $scope.$parent.$ctrl[$attrs.form];
        $scope.id = Math.floor(Math.random() * Date.now());
    }
github TradeMe / tractor / packages / ui / src / app / Core / Components / Checkbox / CheckboxDirective.js View on Github external
function link ($scope) {
        if (_.isUndefined($scope.model)) {
            throw new Error('The "tractor-checkbox" directive requires a "model" attribute.');
        }

        if (_.isUndefined($scope.label)) {
            throw new Error('The "tractor-checkbox" directive requires an "label" attribute.');
        }

        $scope.property = camelcase($scope.label);
    }
};
github di3goleite / life / modules / weather / index.js View on Github external
forecasts = forecasts.map(function(forecast) {
        return {
          icon: changeCase.camel(forecast.icon),
          time: forecast.time,
          summary: forecast.summary,
          humidity: Math.ceil(forecast.humidity * 100),
          temperatureLow: Math.ceil(forecast.temperatureLow),
          temperatureHigh: Math.ceil(forecast.temperatureHigh),
          precipitationIntensity: Math.ceil(forecast.precipIntensity * 1000),
          precipitationProbability: Math.ceil(forecast.precipProbability * 100)
        };
      });
github TradeMe / tractor / packages / tractor-server / src / api / transformers / component-transformer.js View on Github external
    .then(() => transforms.transformIdentifiers(file, changeCase.camel(oldName), changeCase.camel(newName)))
    .then(() => transforms.transformMetadata(file, null, oldName, newName))
github jakemmarsh / react-rocket-boilerplate / app / js / utils / APIUtils.js View on Github external
    return helpers.processObjectKeys(response, key => { return camel(key); });
  },