UNPKG

hades-cli

Version:
18 lines (17 loc) 469 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const _ = require("lodash"); /** * Convert a string to Snake Case. * * @example * 'Foo Bar'.toSnakeCase() // Will return `foo_bar`. * 'fooBar'.toSnakeCase() // Will return `foo_bar`. * '--FOO-BAR--'.toSnakeCase() // Will return `foo_bar`. * * @returns {string} * The Snake Cased string. */ String.prototype.toSnakeCase = function () { return _.snakeCase(this); };