bind-obj-methods

WebJar for bind-obj-methods

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

bind-obj-methods
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

bind-obj-methods
WebJar for bind-obj-methods
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/isaacs/bind-obj-methods

Download bind-obj-methods

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/bind-obj-methods/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>bind-obj-methods</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/bind-obj-methods/
implementation 'org.webjars.npm:bind-obj-methods:2.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/bind-obj-methods/
implementation ("org.webjars.npm:bind-obj-methods:2.0.0")
'org.webjars.npm:bind-obj-methods:jar:2.0.0'
<dependency org="org.webjars.npm" name="bind-obj-methods" rev="2.0.0">
  <artifact name="bind-obj-methods" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='bind-obj-methods', version='2.0.0')
)
libraryDependencies += "org.webjars.npm" % "bind-obj-methods" % "2.0.0"
[org.webjars.npm/bind-obj-methods "2.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

bind-obj-methods

Bind methods to an object from that object or some other source. Optionally specify a set of methods to skip over.

Also binds non-enumerable methods, retaining their non-enumerable-ness.

API

bindObjMethods(obj, [source], [omit])

Bind all the methods from source onto obj, skipping over anything in the omit list. omit can be either an array or an object of boolean values. source defaults to obj if not specified.

USAGE

var bindObjMethods = require('bind-obj-methods')

var obj = {
  method: () => this.foo,
  foo: 'bar'
}

var m = obj.method
m() // undefined

bindObjMethods(obj)
m = obj.method
m() // 'bar'

Versions

Version
2.0.0