How to use camel-case - 10 common examples

To help you get started, we’ve selected a few camel-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 express-vue / express-vue / lib / parser / index.js View on Github external
content = content.replace(styleRegex, '');

                if (templateArray.length === 0) {
                    let error = `I had an error processing component templates. in this file \n${templatePath}`;
                    console.error(new Error(error));
                    reject(error);
                }

                let templateName = templateArray[templateArray.length - 1].replace('.vue', '');
                let componentScript = script || {};
                componentScript.template = body;

                resolve({
                    type: type,
                    style: style,
                    name: camelCase(templateName),
                    script: componentScript
                });
            }
        });
    });
github charlieschwabacher / gestalt / packages / gestalt-utils / src / camelizeKeys.js View on Github external
return Object.keys(obj).reduce((memo, key) => {
    memo[camel(key)] = obj[key];
    return memo;
  }, {});
}
github patternfly / patternfly-react / packages / react-styles / src / utils.js View on Github external
export function getModifier(styleObj, modifier, defaultModifier) {
  if (!styleObj) {
    return null;
  }

  const modifiers = styleObj.modifiers || styleObj;
  return modifiers[modifier] || modifiers[camelcase(modifier)] || defaultModifier;
}
github danfuzz / bayou / local-modules / app-setup / DebugTools.js View on Github external
_bindHandler(name, paramPath = null) {
    const fullPath = (paramPath === null)
      ? `/${name}`
      : `/${name}/${paramPath}`;
    const handlerMethod = this[`_handle_${camelCase(name)}`].bind(this);

    function handleRequest(req, res, next) {
      try {
        Promise.resolve(handlerMethod(req, res)).catch((error) => {
          next(error);
        });
      } catch (error) {
        next(error);
      }
    }

    this._router.get(fullPath, handleRequest);
  }
github TradeMe / tractor / plugins / mocha-specs / src / tractor / server / files / mocha-spec-file-refactorer.js View on Github external
async function mockRequestFileNameChange (file, data) {
    let { oldName, newName } = data;

    let oldInstanceName = camelcase(oldName);
    let newInstanceName = camelcase(newName);

    await file.refactor('identifierChange', {
        oldName: oldInstanceName,
        newName: newInstanceName,
        context: MOCK_REQUEST_INSTANCE_REQUIRE_QUERY
    });
    return file.refactor('identifierChange', {
        oldName: oldInstanceName,
        newName: newInstanceName,
        context: MOCK_REQUEST_INSTANCE_BODY_PROPERTY_QUERY
    });
}
github TradeMe / tractor / plugins / page-objects / src / tractor / client / models / meta / action-meta.js View on Github external
constructor (meta) {
            let { description, name, parameters, returns } = meta;

            this.description = description;
            this.name = name;
            this.variableName = camelcase(this.name);

            this.parameters = this._getParameters(parameters);

            if (returns) {
                if (typeof returns === 'string') {
                    returns = { type: returns };
                }
                this.returns = new ValueModel(returns);
            }
        }
github TradeMe / tractor / plugins / mocha-specs / src / tractor / server / files / mocha-spec-file-refactorer.js View on Github external
async function mockRequestFileNameChange (file, data) {
    let { oldName, newName } = data;

    let oldInstanceName = camelcase(oldName);
    let newInstanceName = camelcase(newName);

    await file.refactor('identifierChange', {
        oldName: oldInstanceName,
        newName: newInstanceName,
        context: MOCK_REQUEST_INSTANCE_REQUIRE_QUERY
    });
    return file.refactor('identifierChange', {
        oldName: oldInstanceName,
        newName: newInstanceName,
        context: MOCK_REQUEST_INSTANCE_BODY_PROPERTY_QUERY
    });
}
github charlieschwabacher / gestalt / packages / gestalt-graphql / src / generateGraphQLSchema.js View on Github external
fields: mutations.reduce((memo, mutationDefinition) => {
      const definition = transformSimpleMutationDefinition(
        mutationDefinition(types)
      );
      memo[camel(definition.name)] = mutationWithClientMutationId(definition);
      return memo;
    }, {}),
  });
github dotansimha / graphql-code-generator / packages / plugins / java / apollo-android / src / operation-visitor.ts View on Github external
childFragmentSpread.map(spread => ({
          name: camelCase(spread.name),
          type: spread.name,
          annotations: ['Nonnull'],
        })),
        [],

camel-case

Transform into a string with the separator denoted by the next word capitalized

MIT
Latest version published 7 months ago

Package Health Score

63 / 100
Full package analysis

Popular camel-case functions