Files
lodash/.internal/baseSetToString.js
2017-02-10 17:38:02 -08:00

19 lines
475 B
JavaScript

/**
* The base implementation of `setToString` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
function baseSetToString(func, string){
return Object.defineProperty(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': () => string,
'writable': true
})
}
export default baseSetToString