Socket
Socket
Sign inDemoInstall

protoblast

Package Overview
Dependencies
0
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

protoblast


Version published
Weekly downloads
304
increased by68.89%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

0.2.0 (2016-05-02)

  • Minor version bump because of added namespaces to Function.inherits
  • JSON.clone will now also look for #dryClone(wm) and #clone() methods
  • JSON.clone second parameter is an optional method name to use for cloning
  • Fix bug in JSONPath
  • String#fillPlaceholders can now remove used values from the given object
  • Add Date#setTimestring to set the time in order of '12:00:00'
  • The date 't' format should now return the number of days in the given month
  • Added JSON.safeParse
  • Function.hinder can now call pushed tasks with an error and other data
  • toDry methods no longer need to return a 'path' property for undrying
  • When the function passed to Object.walk returns false, it won't recurse
  • Added Object.getPropertyDescriptor, which will look for a descriptor up the prototype chain
  • Getter and setter functions will now also receive a super property reference to the function they're overriding
  • Function.setStatic properties can now be overwritten
  • Function.setStatic can now optionally not be inherited
  • Add Blast.createObjectId for the browser
  • Checksumming a null value won't throw an error anymore
  • Object.merge should now correctly assign objects over primitive values

Readme

Source

protoblast Protoblast

NPM version Build Status Coverage Status

Extend native objects with helpful methods to speed up development, or leave the native objects alone and use bound methods.

Getting started

For more information and API documentation, visit the Protoblast homepage.

Installation

$ npm install protoblast

Features

  • Targeted for node.js & optimal performance, but perfectly usable in the browser
  • A way to use all new methods without modifying native prototypes

Todo

  • Write documentation (currently a WIP)
  • Write more unit tests (coverage is currently around 60%)
  • Finish browser unit tests
  • ...

Use

You can use Protoblast in 2 ways.

Modify the native prototypes

This is the easiest way to use all the new methods & shims. Ideal for internal or big projects.

require('protoblast')();

// Now new native methods have been added
var arr = [5,9,3,4,1];

arr.flashsort();
// [1, 3, 4, 5, 9]

Use bound functions

You can also get an object that has pre-bound all the new methods, without modifying anything.

It's more verbose, but should be the way to use Protoblast in redistributable modules.

var Blast = require('protoblast')(false);

// Now new native methods have been added
var arr = [5,9,3,4,1];

Blast.Bound.Array.flashsort(arr);
// [1, 3, 4, 5, 9]

Keywords

FAQs

Last updated on 02 May 2016

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc