How to use the camelcase function in camelcase

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 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;
github ebi-webcomponents / nightingale / rollup.config.js View on Github external
import nodeResolve from "rollup-plugin-node-resolve";
import postcss from "rollup-plugin-postcss";
import postcssInlineSvg from "postcss-inline-svg";
import commonjs from "rollup-plugin-commonjs";
import path from "path";
import camelCase from "camelcase";

const PACKAGE_ROOT_PATH = process.cwd();
const PKG_JSON = require(path.join(PACKAGE_ROOT_PATH, "package.json"));

export default {
  input: "src/index.js",
  output: {
    file: "dist/" + PKG_JSON.name + ".js",
    format: "iife",
    name: camelCase(PKG_JSON.name, { pascalCase: true }),
    sourcemap: true,
    globals: {
      "uniprot-entry-data-adapter": "UniProtEntryDataAdapter",
      "protvista-uniprot-entry-adapter": "ProtVistaUniProtEntryAdapter",
      d3: "d3",
      "protvista-zoomable": "ProtvistaZoomable",
      "protvista-track": "ProtvistaTrack",
      "resize-observer-polyfill": "ResizeObserver",
      litemol: "Litemol"
    }
  },
  external: [
    "protvista-zoomable",
    "protvista-track",
    "protvista-uniprot-entry-adapter",
    "d3",

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