aswi2020vldc-gitlab/templetes/node_modules/es-abstract/2018/ToPropertyKey.js @ 143404cb
1 | 3a515b92 | cagy | 'use strict'; |
---|---|---|---|
2 | |||
3 | var GetIntrinsic = require('../GetIntrinsic'); |
||
4 | |||
5 | var $String = GetIntrinsic('%String%'); |
||
6 | |||
7 | var ToPrimitive = require('./ToPrimitive'); |
||
8 | var ToString = require('./ToString'); |
||
9 | |||
10 | // https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey
|
||
11 | |||
12 | module.exports = function ToPropertyKey(argument) { |
||
13 | var key = ToPrimitive(argument, $String); |
||
14 | return typeof key === 'symbol' ? key : ToString(key); |
||
15 | };
|