Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

bind-all-methods-nondestructive-pmb

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bind-all-methods-nondestructive-pmb

Flat-copy an object except all methods are bound to a given context. Do not modify the origin object.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

bind-all-methods-nondestructive-pmb

Flat-copy an object except all methods are bound to a given context. Do not modify the origin object.

API

This module exports one function that holds some methods:

bindAllMethods(context, origin)

Alias for bindAllMethods.onto({}, context, origin).

bindAllMethods.dest(dest, origin)

Alias for bindAllMethods.onto(dest, dest, origin).

May be used to install additional APIs onto an existing object without affecting unrelated methods.

bindAllMethods.onto(dest, context[, origin])

If origin is false-y, context is used instead.

Copy all properties of origin onto dest, except methods. For methods, instead, assign a version that is bound to context. Return dest.

Usage

see test/usage.mjs.

Known issues

  • Needs more/better tests and docs.

 

License

ISC

Keywords

bind methods

FAQs

Package last updated on 26 Feb 2024

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