New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

obj-spread

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

obj-spread

My very own functions for array manipulation, called `arra`

latest
npmnpm
Version
1.0.23
Version published
Maintainers
1
Created
Source

A simple, but powerful way to extend classes with other classes. You can even extend built-in classes, like Array or String

Installation

npm i obj-spread -S

Usage

For example, you want to move all static functions from class Foo to internal class String. All you need to do is to create an instance of ObjSpread:

    new ObjSpread(Foo, String, s=>String(s));

Here, the last argument will convert the value to an actual String class. For example, if you want to spread to Array, you would do the following:

    new ObjSpread(Foo, Array, a=>[].concat(a));

In case if you don't need to convert anything, just do a=>a.

FAQs

Package last updated on 30 Aug 2021

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