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

rubyisms

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rubyisms - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

2

package.json
{
"name": "rubyisms",
"version": "0.1.4",
"version": "0.1.5",
"description": "Prototype extensions.",

@@ -5,0 +5,0 @@ "main": "rubyisms.js",

@@ -82,2 +82,75 @@ // Colin 'Oka' Hall-Coates

// Methods
var _String = {
_p: SP,
eql: function (o) {
return this === o;
},
prepend: function (o) {
return o + this;
}
};
var _Array = {
_p: AP,
drop: AP.slice,
fetch: function(n, d) {
if (typeof n !== 'number' || !isFinite(n)) throw new TypeError('Expected number');
if (Math.abs(n) > this.length - 1 && typeof d === 'undefined') throw new RangeError('Index out of bounds');
if (n < 0) n = this.length + n;
return (typeof this[n] !== 'undefined' ? this[n] : d);
},
take: function (n) {
return this.slice().splice(0, n);
},
valuesAt: function () {
var a = Array.prototype.slice.call(arguments),
s = this,
o = [];
a.forEach(function (e) {
if (typeof e !== 'number' || !isFinite(e)) throw new TypeError('Expected index');
if (e < 0) e = s.length + e;
o.push(s[e]);
});
return o;
},
zip: function() {
var a = Array.prototype.slice.call(arguments),
o = [];
this.forEach(function(e, i) {
var q = [e];
a.forEach(function(e) {
if (!Array.isArray(e)) throw new TypeError('Expected type array');
q.push(e[i]);
});
o.push(q);
});
return o;
}
};
var _Object = {
_p: OP
};
var _Number = {
_p: NP
};
function buildPrototypes(e) {
for (var k in e) {
if (k === '_p') continue;
if (e.hasOwnProperty(k)) e._p[k] = (e._p[k] || e[k]);
}
}
[_String, _Array, _Object, _Number].forEach(buildPrototypes);
}());
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