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

gen-pasta

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gen-pasta - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

11

gen-pasta.js

@@ -6,8 +6,8 @@ // gen-pasta.js

//
function arrify (arr) {
return Array.prototype.slice.apply(arr)
function slice (ar, start, end) {
return Array.prototype.slice.call(ar, start, end)
}
function log () {
if (console && console.log) console.log(arrify(arguments))
if (console && console.log) console.log(slice(arguments))
}

@@ -52,5 +52,8 @@

, first: first
, list: list
, flatten: flatten
, arrify: arrify
, slice: slice
, combine: combine
// Depricated names
, arrify: slice
}

@@ -57,0 +60,0 @@

{ "name": "gen-pasta"
, "version": "0.0.4"
, "version": "0.0.5"
, "author": "Nick Niemeir <nick.niemeir@gmail.com> (http://nrn.io)"

@@ -4,0 +4,0 @@ , "main": "gen-pasta.js"

@@ -11,5 +11,5 @@ #General Pasta

##arrify(obj)
##slice(obj[, start, end])
Take an array like object and return a real array.
Take an array like object and return a real array. Optional start/end.

@@ -16,0 +16,0 @@ ##combine(obj1, obj2)

@@ -5,12 +5,17 @@ var p = require('../gen-pasta')()

test('General', function (t) {
t.plan(16)
t.doesNotThrow(p.log, 'Log does not throw')
t.equal((function () {
return p.arrify(arguments)
})(1, 2, 3).join()
, [1, 2, 3].join()
t.same((function () {
return p.slice(arguments)
})(1, 2, 3)
, [1, 2, 3]
, 'Turn array like objects into arrays'
)
t.same((function () {
return p.slice(arguments, 1, 2)
})(1, 2, 3)
, [ 2 ]
, 'Turn array like objects into arrays, w/ start/end'
)

@@ -43,3 +48,4 @@ t.equal(p.last([1, 2, 3]), 3, 'Last element')

t.end()
})
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