Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
No more cannot read property x of undefined
wih a simple ~200bytes script!
$ yarn add epk-nil
or
$ npm install epk-nil --save
then inport it as a module
ES6
import Nil from 'epk-nil'
ES5
const Nil = require('epk-nil')
1991 fan? JsDelivr to the rescue!
<script src="https://cdn.jsdelivr.net/npm/epk-nil@0.1.0/dist/dist.js" type="text/javascript"> </script>
import Nil from 'epk-nil' // Or import the library as you wish using npm or CDN script tag!
const myObject = {
user: {
name: 'John',
surname: 'Doe',
birthday: '1995-01-29',
contacts: {
email: 'foo@bar.com',
phone: '000 0000000'
},
languages: ['english', 'italian']
}
}
const a = Nil(myObject, 'user.name') // => John
const b = Nil(myObject, 'languages[1]') // => italian
const c = Nil(myObject, 'foo.bar.baz') // => false
if (a) {
console.log(a) // => John
}
if (b) {
console.log(b) // => italian
}
if (c) {
console.log(c) // => won't log anything!
}
import React from "react";
import ReactDOM from "react-dom";
import Nil from "epk-nil";
const user = {
name: {
first_name: "John",
last_name: "Doe"
},
contacts: {
phone: "+00 000 0000000",
email: "john@doe.do"
}
};
const App = () =>
<div className="App">
<h1>Hello {Nil(user, "name.first_name")}!</h1>
<h2> {Nil(user, "contacts.email")} </h2>
<p>
{Nil(user, "contacts.phone.office") || "You don't have an office phone."}
</p>
</div>
const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);
Nil is released undet the MIT License.
FAQs
My hate isn't undefined.
The npm package epk-nil receives a total of 0 weekly downloads. As such, epk-nil popularity was classified as not popular.
We found that epk-nil 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.