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

proto-list

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proto-list - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

2

package.json
{
"name": "proto-list",
"version": "1.2.2",
"version": "1.2.3",
"description": "A utility for managing a prototype chain",

@@ -5,0 +5,0 @@ "main": "./proto-list.js",

module.exports = ProtoList
function setProto(obj, proto) {
if (typeof Object.setPrototypeOf === "function")
return Object.setPrototypeOf(obj, proto)
else
obj.__proto__ = proto
}
function ProtoList () {

@@ -12,3 +19,3 @@ this.list = []

if (this.list.length) {
this.list[this.list.length - 1].__proto__ = r
setProto(this.list[this.list.length - 1], r)
}

@@ -39,5 +46,5 @@ },

if (this.list.length >= 1) {
this.list[this.list.length - 1].__proto__ = obj
setProto(this.list[this.list.length - 1], obj)
}
obj.__proto__ = this.root
setProto(obj, this.root)
return this.list.push(obj)

@@ -47,3 +54,3 @@ }

if (this.list.length >= 2) {
this.list[this.list.length - 2].__proto__ = this.root
setProto(this.list[this.list.length - 2], this.root)
}

@@ -53,3 +60,3 @@ return this.list.pop()

, unshift : function (obj) {
obj.__proto__ = this.list[0] || this.root
setProto(obj, this.list[0] || this.root)
return this.list.unshift(obj)

@@ -59,3 +66,3 @@ }

if (this.list.length === 1) {
this.list[0].__proto__ = this.root
setProto(this.list[0], this.root)
}

@@ -82,3 +89,3 @@ return this.list.shift()

for (var i = 0, l = this.list.length; i < l; i++) {
this.list[i].__proto__ = this.list[i + 1] || this.root
setProto(this.list[i], this.list[i + 1] || this.root)
}

@@ -85,0 +92,0 @@ return ret

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