• File: _baseSetToString.js
  • Full Path: /home/awtadalkhimacom/public_html/services/node_modules/lodash/_baseSetToString.js
  • Date Modified: 10/30/2025 4:29 AM
  • File size: 641 bytes
  • MIME-type: text/plain
  • Charset: utf-8
var constant = require('./constant'),
    defineProperty = require('./_defineProperty'),
    identity = require('./identity');

/**
 * 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`.
 */
var baseSetToString = !defineProperty ? identity : function(func, string) {
  return defineProperty(func, 'toString', {
    'configurable': true,
    'enumerable': false,
    'value': constant(string),
    'writable': true
  });
};

module.exports = baseSetToString;