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

object-additions

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-additions

Methods which extend the Object object.

  • 0.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
95
increased by20.25%
Maintainers
1
Weekly downloads
 
Created
Source

Object Additions

Object Additions is a set Object utility methods. This package plays nice with others by not forcing you to "pollute" the global Object object. On the other hand, it provides a means to add them to the global Object object, if that's how you roll.

If you opt-in to adding these methods to the global Object object, each of them will only be added if members don't already exist with their given name.

The current suite includes:

  • isString
  • isNumber
  • isUndefined
  • isDate
  • isFunction
  • extend
  • values

Usage

To get a reference to the additions, while NOT modifying the global Object object, just require the package:

var additions = require("object-additions").object;
additions.isString("hi");
// -> true

If, on the other hand, you want to just add these to the global Object object, call the add method:

require("object-additions").add();
Object.isString("hi");
// -> true

These additions are inspired (and sometimes directly copied from) Prototype.js

Installation

Grab a copy of the source, and require it in your app:

require("./path/to/object-additions").add();

Or install it with NPM:

$ npm install object-additions

Then require it in your app:

require("object-additions").add();

FAQs

Package last updated on 31 Dec 2011

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