Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Table of Contents generated with DocToc
Objects with auto-generated property chains
class Hedge
propoerties may be predefined
or auto-generated, either
example:
handler = ( hedges, a, b, c ) ->
log hedges, [ a, b, c, ]
return null
h = new Hedge { handler, }
h.foo
# [ 'foo', ]
since hubs and properties are proxies, can do things on property access, no call needed, so both d.foo
and d.foo 42
can potentially do things
cfg
:
cfg.handler
: mandatory property; function to be called on prop access, call, or both
d = new Multimix { handler, }
returns the handler wrapped into a proxyMultimix
instance is accessible as d[Multimix.symbol]
. Multimix.symbol
is a private symbol
and thus guaranteed not to overwrite or shadow an existing propertyhandler
will be returnedhandler
will be auto-generated on first access; these will be functions
that, when called with any number of arguments f P...
, will in turn call handler props, P...
handler
will be called in the context of hub
where given; otherwise, its context will be the
Multimix
instance.hub
: optional reference / base object (re 'hub': as if props were spokes)
cfg.create
:
true
(default): missing props will be auto-generated as functions that call handler
in the context
of cfg.hub
where given (or else the Multimix
instance)false
: no missing props will be generatedcreate key, target
when a new property is first accessed; this function
may or may not create a new property as seen fit. The MultiMix proxy will, at any rate, return
target[ key ]
which may or may not be undefined
.cfg.strict
: (default false
) if set to true
, trying to access an unset property will cause an
error. This setting is only valid when used in conjunction with create: false
.
cfg.oneshot
: (default false
) if set to true
, trying to re-assign any value to an existing property
will cause an error
cfg.deletion
: (default true
) if set to false
, trying to delete any property will cause an error
cfg.hide
: (default true
) if set to true
, will make auto-generated properties non-enumerable so
they don't show up in console output
cfg.strict
cfg.oneshot
cfg.deletion
FAQs
Objects with auto-generated property chains
The npm package multimix receives a total of 16 weekly downloads. As such, multimix popularity was classified as not popular.
We found that multimix demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.