Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
is-property
Advanced tools
The is-property npm package is a utility that checks if a string is a valid JavaScript property name. This can be useful in various scenarios, such as validating object keys or ensuring that dynamically generated property names are valid.
Check if a string is a valid property name
This feature allows you to check if a given string is a valid JavaScript property name. The first example returns true because 'validPropertyName' is a valid property name, while the second example returns false because '123invalid' is not.
const isProperty = require('is-property');
console.log(isProperty('validPropertyName')); // true
console.log(isProperty('123invalid')); // false
The property-validator package extends the basic functionality of checking valid property names by also providing validation for property values. It can be used to ensure that both property names and values meet certain criteria, making it more versatile than is-property.
Tests if a property of a JavaScript object can be accessed using the dot (.) notation or if it must be enclosed in brackets, (ie use x[" ... "])
var isProperty = require("is-property")
console.log(isProperty("foo")) //Prints true
console.log(isProperty("0")) //Prints false
npm install is-property
require("is-property")(str)
Checks if str is a property
str
is a string which we will test if it is a property or notReturns true or false depending if str is a property
(c) 2013 Mikola Lysenko. MIT License
FAQs
Tests if a JSON property can be accessed using . syntax
The npm package is-property receives a total of 3,659,370 weekly downloads. As such, is-property popularity was classified as popular.
We found that is-property demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.