
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
@youngbeen/es-halfmoon
Advanced tools
`ES-halfmoon` is about to provide some prototype methods for ES not covered yet
[TOC]
New ES6+ has many amazing features like filter, map etc. But it's not enough. ES-halfmoon is about to provide some prototype methods for ES not covered yet.
All features will only be attached when ES does not provide, ES-halfmoon never overrides native ES methods
Array.get() like mapArray.forEachRight() loop reversedInstall it via npm
npm i @youngbeen/es-halfmoon
Array.get()Array.get(value, [keyName])
Tip: if
keyNamenot set, default get priority isid > key > value
e.g.
const fruits = [
{ id: 'apple', name: 'Apple' },
{ id: 'orange', name: 'Orange' },
{ id: 'banana', name: 'Banana' }
]
// finding item by specific value
fruits.get('orange') // -> { id: 'orange', name: 'Orange' }
// which equivalent
fruits.get('orange', 'id')
const myFruits = [
{ type: 'apple', name: 'Apple' },
{ type: 'orange', name: 'Orange' },
{ type: 'banana', name: 'Banana' }
]
// specify keyName
fruits.get('orange', 'type')
Array.forEachRight()Array.forEachRight(callback(item, [index]))
This method is useful when you are looping array for removing some item
e.g.
const array = ['h', 'e', 'l', 'l', 'o']
array.forEachRight((item, index) => {
console.log(item, index)
})
// 'o' 4
// 'l' 3
// 'l' 2
// 'e' 1
// 'h' 0
FAQs
`ES-halfmoon` is about to provide some prototype methods for ES not covered yet
The npm package @youngbeen/es-halfmoon receives a total of 6 weekly downloads. As such, @youngbeen/es-halfmoon popularity was classified as not popular.
We found that @youngbeen/es-halfmoon 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
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.