How to use camelcase - 10 common examples

To help you get started, we’ve selected a few camelcase 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 alibaba / rax / packages / babel-plugin-transform-jsx-stylesheet / src / index.js View on Github external
ImportDeclaration({ node }, { file }) {
        const sourceValue = node.source.value;
        const extname = path.extname(sourceValue);
        const cssIndex = cssSuffixs.indexOf(extname);
        // Do not convert `import styles from './foo.css'` kind
        if (node.specifiers.length === 0 && cssIndex > -1) {
          let cssFileCount = file.get('cssFileCount') || 0;
          let cssParamIdentifiers = file.get('cssParamIdentifiers') || [];
          const cssFileBaseName = camelcase(path.basename(sourceValue, extname));
          const styleSheetIdentifier = t.identifier(`${cssFileBaseName + NAME_SUFFIX}`);

          node.specifiers = [t.importDefaultSpecifier(styleSheetIdentifier)];
          cssParamIdentifiers.push(styleSheetIdentifier);
          cssFileCount++;

          file.set('cssParamIdentifiers', cssParamIdentifiers);
          file.set('cssFileCount', cssFileCount);
        }
      }
    }
github Undistraction / cssapi-mq / src / __tests__ / helpers / testRangedFeatureHelpers.js View on Github external
describe('range queries', () => {
      const aboveMethod = camelcase('above', name);
      const belowMethod = camelcase('below', name);
      const betweenMethod = camelcase('between', pluralise(name));
      const atMethod = camelcase('at', name);
      const atBreakpointMethod = camelcase('at', name, 'Breakpoint');

      describe(`${aboveMethod}()`, () => {
        runTests(tests.above, name, aboveMethod);
      });

      describe(`${belowMethod}()`, () => {
        runTests(tests.below, name, belowMethod);
      });

      describe(`${betweenMethod}()`, () => {
        runTests(tests.between, name, betweenMethod);
      });

      describe(`${atMethod}()`, () => {
        runTests(tests.at, name, atMethod);
github 9technology / meta-props / src / index.js View on Github external
        const split = key.split(splitter).filter(Boolean).map(k => camelcase(k));
        const splitLen = split.length;
github textlint / playground / src / components / TextlintDemo / AddTextlintRule.js View on Github external
return new Promise((resolve, reject) => {
        const camelizedName = camelCase(moduleName);
        const API_URL = `https://www.brcdn.org/${moduleName}/latest?standalone=${camelizedName}`;
        dispatch(startRequest(API_URL));
        var script = document.createElement("script");
        script.src = API_URL;
        script.onload = () => {
            console.log(camelizedName);
            if (window[camelizedName]) {
                dispatch(successResponse(API_URL));
                window[moduleName] = window[camelizedName];
                dispatch(addRule(moduleName, window[camelizedName]));
                resolve(window[moduleName]);
            } else {
                const error = new Error(`Not use ${moduleName}`);
                dispatch(failureResponse(API_URL, error));
                reject(error);
            }
github MMF-FE / vue-svgicon / dist / lib / build.js View on Github external
files.forEach(function (file) {
        var name = path.basename(file).split('.')[0];
        var filePath = getFilePath(opts.sourcePath, file, subDir);
        var dir = filePath.split('/')[0];
        if (dir) {
            if (!dirMap[dir]) {
                dirMap[dir] = [];
                if (shouldExport) {
                    var dirName = camelcase_1.default(dir, {
                        pascalCase: true
                    });
                    content += isES6
                        ? "export * as  " + dirName + " from './" + dir + "'\n"
                        : "module.exports." + dirName + " = require('./" + dir + "')\n";
                }
                else {
                    content += isES6
                        ? "import './" + dir + "'\n"
                        : "require('./" + dir + "')\n";
                }
            }
            dirMap[dir].push(file);
        }
        else {
            if (shouldExport) {
github ryardley / indexr / lib / modules / cli / index.js View on Github external
  const camel = (value) => camelcase(value);
  const extractFlagName = flow(flags, extractLongTag, camel);
github andywer / gear / src / cli.js View on Github external
-d, --out-dir <output dir="">    Set output directory.
    --flow        Set babel plugin to use, like 'runtime' or
                                  'strip-types' (default).
    --help                        Print this help.
    -w, --watch                   Watch files, recompile on change.

  Visit https://github.com/andywer/gear for more information.
`, {
  alias: {
    d: 'out-dir',
    w: 'watch'
  }
})

const [ commandName, ...args ] = cli.input
const command = commandName ? commands[ camelcase(commandName.toLowerCase()) ] : null

if (!commandName || cli.flags.help) {
  cli.showHelp()
} else if (command) {
  command(args, cli.flags, createLogger())
} else {
  throw new Error(`Unknown command: ${commandName}`)
}
</output>
github vuejs / jsx / packages / babel-sugar-v-model / src / index.js View on Github external
return string => {
    if (!cache[string]) {
      cache[string] = camelCase(string)
    }

    return cache[string]
  }
})()
github beaverbuilder / assistant / src / utils / store / actions.js View on Github external
Object.entries( state ).map( ( [ key ] ) => {
		if ( ! reducers[ key ] ) {
			const type = `SET_${ key.toUpperCase() }`
			const action = camelCase( `set_${ key }` )
			actions[ action ] = value => ( { type, value } )
		}
	} )
github ali1k / ld-r / services / import.js View on Github external
.on('data', function(data){
                        counter++;
                        if(counter === 1){
                            for(let prop in data){
                                if (validUrl.isUri(data[prop].toString()) && contextOptions['skippedColumns'].indexOf(camelCase(prop)) == -1){
                                    if(contextOptions['customMappings'] && contextOptions['customMappings'][camelCase(prop)]){
                                        contextObj[contextOptions['customMappings'][camelCase(prop)]] = {
                                            '@type': '@id'
                                        };
                                    }else{
                                        contextObj['v:' + camelCase(prop)] = {
                                            '@type': '@id'
                                        };
                                    }
                                }
                            }
                        }
                        let tmpObj = {};
                        tmpObj['@type'] = contextOptions['entityType'];
                        for(let prop in data){
                            if(!prop.trim()){
                                continue;

camelcase

Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`

MIT
Latest version published 1 year ago

Package Health Score

73 / 100
Full package analysis

Popular camelcase functions