
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
@okiba/arrays
Advanced tools
Array utils for okiba js
__
npm i --save @okiba/arrays
Or import it directly in the browser
<script type="module" src="https://unpkg.com/@okiba/arrays/index.js"></script>
import arrays from '@okiba/arrays'
Okiba Core packages are not transpiled, so don't forget to transpile them with your favourite bundler. For example, using Babel with Webpack, you should prevent imports from okiba to be excluded from transpilation, like follows:
{
test: /\.js$/,
exclude: /node_modules\/(?!(@okiba)\/).*/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
Return the first element if it only contains one
const els = arrayOrOne([🍏, 🍌])
console.log(els) // [🍏, 🍌]
const els = arrayOrOne([🍏])
console.log(els) // 🍏
arrayLike
: Array-like
The options object.
any
The first element or the argument, undefined if empty array
Cast an array-like object or single element to Array
const elements = castArray(document.querySelectorAll('p')) // [p, p]
const fruits = castArray(🍒) // [🍒]
castable
: any
Array to cast
Array
The array-like converted to Array, or an Array containing the element
Removes an element from an array in-place without causing Garbage Collection
const array = [🍎, 🍐, 🍌]
spliceOne(array, 1)
console.log(array) // Logs: [🍎, 🍌]
array
: Array
Array you want to remove an element from
index
: Number
The index of the element to remove
FAQs
Array helpers for okiba.js
We found that @okiba/arrays demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.