How to use no-case - 4 common examples

To help you get started, we’ve selected a few no-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 filp / oversmash / lib / scraper.js View on Github external
function normalizeKeyName (options, name) {
  if (options.normalizeNames) {
    let newName = noCase(name.replace('\'', ''), null, '_')
    const diacMatch = newName.match(lazyDiacriticsRegex)

    // Replace diacritics with their ascii equivalent (e.g ö -> o)
    if (diacMatch && lazyDiacriticsMap[diacMatch[1]]) {
      newName = newName.replace(diacMatch[1], lazyDiacriticsMap[diacMatch[1]])
    }

    if (options.normalizeNamesAs === 'camel') {
      return camelCase(newName)
    }

    return newName
  }

  return name
}
github blakeembrey / change-case / packages / constant-case / src / index.ts View on Github external
export function constantCase(input: string, options: Options = {}) {
  return noCase(input, {
    delimiter: "_",
    transform: upperCase,
    ...options
  });
}
github blakeembrey / change-case / packages / pascal-case / src / index.ts View on Github external
export function pascalCase(input: string, options: Options = {}) {
  return noCase(input, {
    delimiter: "",
    transform: pascalCaseTransform,
    ...options
  });
}
github blakeembrey / change-case / packages / capital-case / src / index.ts View on Github external
export function capitalCase(input: string, options: Options = {}) {
  return noCase(input, {
    delimiter: " ",
    transform: capitalCaseTransform,
    ...options
  });
}

no-case

Transform any case string into a lower case string with a space between each word

MIT
Latest version published 1 year ago

Package Health Score

61 / 100
Full package analysis

Popular no-case functions