Socket
Socket
Sign inDemoInstall

protoblast

Package Overview
Dependencies
1
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    protoblast

Native object expansion library


Version published
Weekly downloads
180
decreased by-33.09%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

0.6.5 (2019-02-18)

  • Fix Function#throttle() not throttling enough because setTimeout fires too soon
  • Add String#isUpperCase() and String#isLowerCase()
  • Add ignore_arguments option to the memoize() decorator
  • Add Object#zip(keys, values) and Object#unzip(obj)
  • Add Blast.checksumSymbol you can use to define a method that replaces the parameter of a Object.checksum(obj) call
  • Make Date.parseString() understand regular date strings
  • Make Function.contitute(fnc) schedule the function using Blast.queueImmediate() if Blast has already been loaded
  • Make the internal queueImmediate, queueTick methods asynchronous even after Blast had loaded
  • Blast.doLoaded() will now also work after Protoblast has already loaded once
  • Allow passing a regex into RegExp.interpret()
  • Add a main_class getter to namespaces
  • Add String#countCharacters() to count characters, including emojis
  • Make String#count() use String#countCharacters() when empty string is given
  • Add String#substrCharacters(begin, length) to get a substring of the actual characters
  • Add String#substringCharacters(begin, end)
  • Make String#truncate() honour emojis
  • Add HTML tokenizer based on the original String#stripTags method
  • Truncate HTML strings with help from the tokenizer

Readme

Source

Protoblast logo Protoblast

Mac/Linux Build Status Windows Build status Codecov Coverage report Known Vulnerabilities Dependency Status

Extend native objects with helpful methods to speed up development
Coded with ❤️ by Jelle De Loecker.

Installation

$ npm install protoblast

Documentation

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

Getting Started

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 and execute the returned function
require('protoblast')();

var str = 'Get what we want';

// New native methods, like after, will have been added
str.after('what');
// ' we want'

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.

// Require protoblast and execute the returned function with `false` as parameter
var Blast = require('protoblast')(false);

var str = 'Get what we want';

// Native objects will have been left alone, they can be accessed like this:
Blast.Bound.String.after(str, 'what');
// ' we want'

Keywords

FAQs

Last updated on 18 Feb 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc