Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

CBuffer

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

CBuffer - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

17

cbuffer.js

@@ -61,8 +61,25 @@ function CBuffer() {

},
// loop through each item in buffer
forEach : function( callback, context ) {
var i = 0;
// check if context was passed
if ( context ) {
for (; i < this.size; i++ ) {
callback.call( context, this.idx( i ), i, this );
}
} else {
for (; i < this.size; i++ ) {
callback( this.idx( i ), i, this );
}
}
},
// return first item in buffer
first : function() {
return this.data[ this.start ];
},
// return last item in buffer
last : function() {
return this.data[ this.end ];
},
// return specific index in buffer
idx : function( arg ) {

@@ -69,0 +86,0 @@ return this.data[( this.start + arg ) % this.length ];

2

package.json
{
"name" : "CBuffer",
"version" : "0.0.4",
"version" : "0.0.5",
"description" : "Circular Buffer JavaScript implementation",

@@ -5,0 +5,0 @@ "homepage" : "http://github.com/trevnorris/cbuffer",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc