How to use the change-case.snake 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 plopjs / node-plop / src / baked-in-helpers.js View on Github external
import changeCase from 'change-case';

export default {
	camelCase: changeCase.camel,
	snakeCase: changeCase.snake,
	dotCase: changeCase.dot,
	pathCase: changeCase.path,
	lowerCase: changeCase.lower,
	upperCase: changeCase.upper,
	sentenceCase: changeCase.sentence,
	constantCase: changeCase.constant,
	titleCase: changeCase.title,

	dashCase: changeCase.param,
	kabobCase: changeCase.param,
	kebabCase: changeCase.param,

	properCase: changeCase.pascal,
	pascalCase: changeCase.pascal
};
github unic / estatico / helpers / scaffold.js View on Github external
function getSanitizedName(name, allowUnderscores) {
	name = changeCase.snake(name);

	return (!allowUnderscores) ? name.replace(/_/g, '') : name;
}
github cats-oss / scaffdog / src / template / funcs.ts View on Github external
funcs.set('snake', (_: Context, v: string) => cc.snake(v));
funcs.set('pascal', (_: Context, v: string) => cc.pascal(v));
github bharathnayak03 / svg-wc-icons / src / utils.js View on Github external
function generateFileName(fileName, { prefix, suffix }) {
  const prefixStr = prefix ? `${prefix}-` : '';
  const suffixStr = suffix ? `-${suffix}` : '';

  return `${changeCase.snake(prefixStr + fileName.replace('.svg', '') + suffixStr)}`;
}
github 0xProject / 0x-monorepo / packages / abi-gen / src / index.ts View on Github external
function makeLanguageSpecificName(methodName: string): string {
    return args.language === 'Python' ? changeCase.snake(methodName) : methodName;
}
github 0xProject / 0x-monorepo / packages / abi-gen / src / utils.ts View on Github external
toPythonIdentifier(input: string): string {
        let snakeCased = changeCase.snake(input);
        const pythonReservedWords = [
            'False',
            'None',
            'True',
            'and',
            'as',
            'assert',
            'break',
            'class',
            'continue',
            'def',
            'del',
            'elif',
            'else',
            'except',
            'finally',
github brightcove / dog-watcher / lib / dataDog.js View on Github external
function (board, next) {
            fs.writeJson(path.resolve(targetDir,
                boardInfo.id + '-' + changeCase.snake(boardInfo.title || 'untitled') + '.json'),
              board, next);
          }
        ],
github bharathnayak03 / svg-wc-icons / lib / utils.js View on Github external
function generateFileName(fileName, {
  prefix,
  suffix
}) {
  const prefixStr = prefix ? `${prefix}-` : '';
  const suffixStr = suffix ? `-${suffix}` : '';
  return `${changeCase.snake(prefixStr + fileName.replace('.svg', '') + suffixStr)}`;
}