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

observ-array

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

observ-array - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

add-listener.js
module.exports = addListener
function addListener(observArray, observ) {
var list = observArray.list
var list = observArray._list

@@ -6,0 +6,0 @@ return observ(function (value) {

@@ -13,3 +13,3 @@ var ObservArray = require("./index.js")

return [name, function () {
var res = this.list[name].apply(this.list, arguments)
var res = this._list[name].apply(this._list, arguments)

@@ -44,9 +44,9 @@ if (res && Array.isArray(res)) {

var args = slice.call(arguments)
args.unshift(this.list.length, 0)
args.unshift(this._list.length, 0)
this.splice.apply(this, args)
return this.list.length
return this._list.length
}
function observArrayPop() {
return this.splice(this.list.length - 1, 1)[0]
return this.splice(this._list.length - 1, 1)[0]
}

@@ -61,3 +61,3 @@ function observArrayShift() {

return this.list.length
return this._list.length
}

@@ -64,0 +64,0 @@

@@ -50,3 +50,3 @@ var Observ = require("observ")

// this is the list of observs instances
obs.list = list
obs._list = list

@@ -62,3 +62,3 @@ var removeListeners = list.map(function (observ) {

// listeners. Which causes rage bugs
obs.removeListeners = removeListeners
obs._removeListeners = removeListeners

@@ -69,7 +69,7 @@ return ArrayMethods(obs, list)

function get(index) {
return this.list[index]
return this._list[index]
}
function getLength() {
return this.list.length
return this._list.length
}
{
"name": "observ-array",
"version": "1.0.2",
"version": "1.0.3",
"description": "An array containing observable values",

@@ -5,0 +5,0 @@ "keywords": [],

@@ -16,3 +16,3 @@ var slice = Array.prototype.slice

// generate a list of args to mutate the internal
// list of only values
// list of only obs
var valueArgs = args.map(function (value, index) {

@@ -29,3 +29,3 @@ if (index === 0 || index === 1) {

// we remove the observs that we remove
var removed = obs.list.splice.apply(obs.list, args)
var removed = obs._list.splice.apply(obs._list, args)

@@ -38,4 +38,4 @@ var extraRemoveListeners = args.slice(2).map(function (observ) {

extraRemoveListeners.unshift(args[0], args[1])
var removedListeners = obs.removeListeners.splice
.apply(obs.removeListeners, extraRemoveListeners)
var removedListeners = obs._removeListeners.splice
.apply(obs._removeListeners, extraRemoveListeners)

@@ -42,0 +42,0 @@ removedListeners.forEach(function (removeObservListener) {

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