Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

to-property-key-x

2.0.2 • Public • Published

Travis status Dependency status devDependency status npm version

to-property-key-x

Converts argument to a value that can be used as a property key.

Version: 2.0.2
Author: Xotic750 Xotic750@gmail.com
License: MIT
Copyright: Xotic750

module.exports(argument)string | symbol

This method Converts argument to a value that can be used as a property key.

Kind: Exported function
Returns: string | symbol - The converted argument.
Throws:

  • TypeError If argument is not a symbol and is not coercible to a string.
Param Type Description
argument * The argument to onvert to a property key.

Example

var toPropertyKey = require('to-property-key-x');
 
toPropertyKey(); // 'undefined'
toPropertyKey(1); // '1'
toPropertyKey(true); // 'true'
 
var symbol = Symbol('a');
toPropertyKey(symbol); // symbol
 
toPropertyKey(Object.create(null)); // TypeError

install

npm i to-property-key-x

Downloadsweekly downloads

20,101

version

2.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability