Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@d3fc/d3fc-rebind
Advanced tools
Utilities for copying methods from one d3 component to another in a configurable way
Utilities for copying methods from one D3 component to another in a configurable way
npm install @d3fc/d3fc-rebind
# fc.rebind(target, source, ...names)
Provides the same functionality as d3.rebind
-
Copies the methods with the specified
names
fromsource
totarget
, and returnstarget
. Calling one of the named methods on the target object invokes the same-named method on the source object, passing any arguments passed to the target method, and using the source object as the this context. If the source method returns the source object, the target method returns the target object (“setter” method); otherwise, the target method returns the return value of the source method (“getter” mode). The rebind operator allows inherited methods (mix-ins) to be rebound to a subclass on a different object.
# fc.rebindAll(target, source, [...transforms])
Provides the same functionality as rebind
but copies all properties found on source
to target
. Optionally, property name transforms can be specified. These receive a source property name and return either the target property name or a falsey value to indicate the property should not be copied.
N.B. This method does not work with properties found on the source object's prototype e.g. d3.dispatch().on
. If you need this functionality use rebind
.
As well as creating transforms manually, the following may be useful (especially if you're not able to use ES2015 features) -
# fc.exclude(...names)
Exclude a set of property names
. Names can be specified as a string
or RegExp
.
# fc.include(...names)
Include only the set of property names
. Names can be specified as a string
or RegExp
.
# fc.includeMap(mappings)
Include only the set of properties specified by the keys of mappings
using their corresponding values as the target property name e.g. { 'sourceName': 'targetName' }
.
# fc.prefix(str)
Prefix all property names with str
.
FAQs
Utilities for copying methods from one d3 component to another in a configurable way
The npm package @d3fc/d3fc-rebind receives a total of 4,782 weekly downloads. As such, @d3fc/d3fc-rebind popularity was classified as popular.
We found that @d3fc/d3fc-rebind demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.