![Malicious npm Package Typosquats react-login-page to Deploy Keylogger](https://cdn.sanity.io/images/cgdhsj6q/production/007b21d9cf9e03ae0bb3f577d1bd59b9d715645a-1024x1024.webp?w=400&fit=max&auto=format)
Research
Security News
Malicious npm Package Typosquats react-login-page to Deploy Keylogger
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
circularr
Advanced tools
Readme
Circular fixed size array
npm i circularr
import Circularr from 'circularr'
// Create from
const arrFrom = Circularr.from([1, 2, 3, 4, 5])
// Create new with fixed size
const arr = new Circular(3) // [undefined, undefined, undefined]
// fill using value
arr.fill(0) // [0, 0, 0]
// shift in some values
arr.shift(16) // [0, 0, 16]
arr.shift(32) // [0, 16, 32]
// check contents
console.log(...arr) // undefined, 16, 32
class Circularr<T> {
// create Circularr
constructor(length: number)
static from<T>(source: T[]): Circularr<T>
// property
readonly length: number
// iterable
[Symbol.iterator](): IterableIterator<T>
// methods
fill(value: T): this
shift(value: T): T
unshift(value: T): T
}
fill(value: T): this
Fills the array using value, effectively resetting it. Returns this
.
const circularr = new Circularr(3) // [undefined, undefined, undefined]
circularr.fill(0) // [0, 0, 0]
shift(value: T): T
shift
method pushes the value to the end of the array, wherein the first value gets popped out and returned.
const circularr = new Circularr(3).fill(0)
circularr.shift(8) // [0, 0, 8] => 0
circularr.shift(16) // [0, 8, 16] => 0
circularr.shift(32) // [8, 16, 32] => 0
circularr.shift(64) // [16, 32, 64] => 8
circularr.length // 3
unshift(value: T): T
unshift
does the opposite. It pushes the value to the front, popping the last value out.
const circularr = new Circularr(3).fill(0)
circularr.unshift(8) // [8, 0, 0] => 0
circularr.unshift(16) // [16, 8, 0] => 0
circularr.unshift(32) // [32, 16, 8] => 0
circularr.unshift(64) // [64, 32, 16] => 8
circularr.length // 3
Circular
implements iterable
protocol, so it can be used with any standard iterable syntax
const circularr = Circularr.from([1, 2, 3])
// array destructuring
const [firstValue] = circularr
// destructuring copy
const copyToArray = [...circularr]
// for..of syntax
for (let value of circularr) {
console.log(value)
}
FAQs
Unknown package
The npm package circularr receives a total of 45,324 weekly downloads. As such, circularr popularity was classified as popular.
We found that circularr 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.
Research
Security News
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
Security News
The JavaScript community has launched the e18e initiative to improve ecosystem performance by cleaning up dependency trees, speeding up critical parts of the ecosystem, and documenting lighter alternatives to established tools.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.