UNPKG

333 BJavaScriptView Raw
1'use strict';
2var toPrimitive = require('../internals/to-primitive');
3var isSymbol = require('../internals/is-symbol');
4
5// `ToPropertyKey` abstract operation
6// https://tc39.es/ecma262/#sec-topropertykey
7module.exports = function (argument) {
8 var key = toPrimitive(argument, 'string');
9 return isSymbol(key) ? key : key + '';
10};