UNPKG

superflected

Version:

A port of ActiveSupport's inflector to Node.js

7 lines (5 loc) 208 B
import { cacheable } from "./cacheable"; import { underscore } from "./underscore"; export const constantify = cacheable((word: string) => { return underscore(word).toUpperCase().replace(/\s+/g, "_"); });