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

wodge

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wodge

a wodge of functional dough

  • 0.6.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-97.18%
Maintainers
1
Weekly downloads
 
Created
Source

view on npm npm module downloads per month Dependency Status Analytics

browser support

#wodge A collection of useful functions.

#API Documentation Generated jsdoc documentation.

##extend Merge a list of objects, left to right, into one.

###Parameters object {Object} - a sequence of Object instances to be extended

###Example

w.extend({}, { one: 1, three: 3 }, { one: "one", two: 2 }, { four: 4 });
// { one: "one", two: 2, three: 3, four: 4 }

##clone Returns a copy of the input object

###Parameters input {Object} - the object to clone

Returns Object

##omit Returns a clone of the input object, minus the specified properties

###Parameters input {Object} - the object to clone toOmit {string[]} - an array of property names to omit from the clone

###Example

w.omit({ one: 1, two: 2, three: 3, four: 4 }, [ "two", "four" ]);
// { one: 1, three: 3 }

Returns Object

##escapeRegExp escape special regular expression characters

###Example

w.escapeRegExp("(.*)"); 
// '\\(\\.\\*\\)'

##pluck Plucks the value of the specified property from each object in the input array

###Parameters arrayOfObjects {Object[]} - the input array of objects the {string} - property to pluck

###Example

var data = [
    {one: 1, two: 2},
    {two: "two"},
    {one: "one", two: "zwei"},
];

w.pluck(data, "one");
// [ 1, "one" ]

w.pluck(data, "two");
// [ 2, "two", "zwei" ]

w.pluck(data, "one", "two");
// [ 1, "two", "one" ]

Returns Array

##arrayify Either:

  • puts a single scalar in an array
  • converts array-like object to a real array
  • converts null or undefined to an empty array

##getHomeDir Cross-platform home directory retriever

##exists ###Example

exists([ 1, 2, 3 ], 2)             // true
exists([
    { result: false, number: 1 },
    { result: false, number: 2 }
], { result: true })               // false

##first Works on an array of objects. Returns the first object with property set to value.

##commonDir commonDir returns the directory common to each path in the list

###Parameters files {Array} - An array of file paths to inspect

Returns string - A single path ending with the path separator, e.g. "/user/some/folder/"

FAQs

Package last updated on 09 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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