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.2 to 0.0.3

6

gen-pasta.js

@@ -22,3 +22,2 @@ // gen-pasta.js

function last(item) {
var num = false
if (typeof item === 'number') return +item.toString().split('').pop()

@@ -29,3 +28,7 @@ if (typeof item === 'string') return item.split('').pop()

return item
}
function flatten (arr) {
if (Array.isArray(arr)) return arr.map(flatten).join('')
return '' + arr
}

@@ -36,2 +39,3 @@

, last:last
, flatten: flatten
, arrify: arrify

@@ -38,0 +42,0 @@ , combine: combine

2

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

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

@@ -15,1 +15,14 @@ #General Pasta

##combine(obj1, obj2)
Add everything from obj2 into obj1 and return obj1.
##last(item)
Attempt to return the last element from item, whatever
item might be.
##flatten(arr)
Steamrolls nested arrays into a string.

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

test('General', function (t) {
t.plan(9)
t.plan(12)

@@ -31,4 +31,7 @@ t.doesNotThrow(p.log, 'Log does not throw')

t.equal(obj2.foo, undefined, 'a stays the same')
t.equal(p.flatten([ 'a', 'b', 'c' ]), 'abc', 'Flatten Normal')
t.equal(p.flatten(1), '1', 'Flatten nothing')
t.equal(p.flatten([1, [2, [3, [4, [5 ]]]]]), '12345', 'Flatten Nest')
})
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