Skip to content

v7.0.0

Latest

Choose a tag to compare

@sindresorhus sindresorhus released this 13 Oct 19:10

Breaking

Improvements

  • Keep plural acronyms together 5fb69c0
    • userIDs → user_ids (was user_i_ds)
    • listAPIs → list_apis (was list_ap_is)
    • With preserveConsecutiveUppercase: userIDs → user_IDs (was user_I_ds)
    • This only applies at the end of a word, so userIDIsValid still becomes user_id_is_valid. Ambiguous endings are treated as plural acronyms: exportPDFAs → export_pdfas (was export_pdf_as).
  • Recognize titlecase letters at word boundaries 2f5aff4
    • helloDžemal → hello_džemal (was hellodžemal)
  • Recognize Unicode decimal digits at word boundaries 8541bf9
    • version٢Beta → version٢_beta (was version٢beta)
  • Recognize uppercase characters that are not letters, such as Roman numerals and circled letters 850fb81
    • chapterⅫTitle → chapter_ⅻ_title (was chapterⅻtitle)

Fixes

  • Fix separator with $ replacement patterns not being inserted literally (#48) d8f982a
    • decamelize('helloWorld', {separator: '$&'}) → hello$&world (was helloowwworldworld)
  • Fix splitting words with decomposed (NFD) accents, which are common in macOS file names 0eb37b4
    • caféMenu → café_menu (was cafémenu)
    • With preserveConsecutiveUppercase: ÉCOLEName → ÉCOLE_name (was éCOLE_name)
  • Fix custom separators with letters being lowercased and inserted twice f1b285f 5fb69c0
    • decamelize('fooBar', {separator: 'X'}) → fooXbar (was fooxxbar)
  • Fix preserveConsecutiveUppercase lowercasing a single letter that is astral or has combining marks 6cea6a8
    • 𐐀 stays 𐐀 (was 𐐨)

v6.0.1...v7.0.0