UNPKG

si-funciona

Version:

Funciones de utilidad para uso general. [General usage utility functions.]

20 lines (18 loc) 481 B
'use strict' Object.defineProperty(exports, '__esModule', { value: true }) exports.default = void 0 require('core-js/stable') /** * Retrieve the string part after the last search match. * @memberOf module:stringHelpers * @param {string} str * @param {string} search * @returns {string} */ const strBeforeLast = (str, search) => { const index = str.lastIndexOf(search) return index === -1 ? '' : str.substring(0, index) } var _default = exports.default = strBeforeLast