UNPKG

text-constant-case

Version:

Convert into upper case text with an underscore between words

16 lines (15 loc) 492 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.constantCase = constantCase; const text_no_case_1 = require("text-no-case"); const text_upper_case_1 = require("text-upper-case"); function constantCase(input, options = {}) { // Handle null/undefined inputs gracefully if (!input) return ""; return (0, text_no_case_1.noCase)(input, { delimiter: "_", transform: text_upper_case_1.upperCase, ...options, }); }