Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

to-property-key-x

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

to-property-key-x

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

  • 3.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

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.
ParamTypeDescription
argument*The argument to onvert to a property key.

Example

import toPropertyKey from 'to-property-key-x';

console.log(toPropertyKey()); // 'undefined'
console.log(toPropertyKey(1)); // '1'
console.log(toPropertyKey(true)); // 'true'

const symbol = Symbol('a');
console.log(toPropertyKey(symbol)); // symbol

toPropertyKey(Object.create(null)); // TypeError

Keywords

FAQs

Package last updated on 28 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc