thisStringValue.js 356 B

123456789101112131415
  1. 'use strict';
  2. var $StringValueOf = require('call-bind/callBound')('String.prototype.valueOf');
  3. var Type = require('./Type');
  4. // https://262.ecma-international.org/6.0/#sec-properties-of-the-string-prototype-object
  5. module.exports = function thisStringValue(value) {
  6. if (Type(value) === 'String') {
  7. return value;
  8. }
  9. return $StringValueOf(value);
  10. };