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

safe-identifier

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

safe-identifier - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

2

index.js

@@ -25,3 +25,3 @@ const { reservedES3, reservedESnext } = require('./reserved')

function identifier(key, unique) {
if (unique) key += ' ' + hashCode(key)
if (unique) key += ' ' + hashCode(key).toString(36)
const id = key.trim().replace(/\W+/g, '_')

@@ -28,0 +28,0 @@ return reservedES3[id] || reservedESnext[id] || /^\d/.test(id) ? '_' + id : id

{
"name": "safe-identifier",
"version": "0.3.0",
"version": "0.3.1",
"author": "Eemeli Aro <eemeli@gmail.com>",

@@ -5,0 +5,0 @@ "license": "ISC",

@@ -14,3 +14,4 @@ # safe-identifier

identifier('enum') === '_enum'
identifier(' my \0var ') === 'my_var'
identifier('my var', true) === 'my_var_hk17pp'
identifier(' my \0var ', true) === 'my_var_1d8fi3'

@@ -17,0 +18,0 @@ property('Foo', 'bar') === 'Foo.bar'

Sorry, the diff of this file is not supported yet

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