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

as-key

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

as-key

Convert any value to a string – except for symbols.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

as-key

Convert any value to a string – except for symbols.

Description

Behaves similar to a universal to-string-conversion tool, except that it doesn't degrade symbols into strings – which makes them lose their unique indexing ability when used as object keys.

Works with any special values such as null and undefined, objects, primitives, and even objects without toString methods (e.g. Object.create(null)).

Installing

npm: npm i try-with
yarn: yarn add try-with

const asKey = require('askey');

API

function asKey(value: any): string | symbol;

License

ISC

Keywords

FAQs

Package last updated on 15 Jun 2018

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