The fwlib/underscore
module wraps the legacy build of the lodash
library
and adds some Fireworks-specific methods. The lodash
code has been
minified in a way that works within the Fireworks JS engine, but you can
change the define()
call in this file to load "fwlib/lodash"
if you
want to load the un-minified code to help with debugging.
The Lo-Dash functions that rely on setTimeout()
have been overridden to
throw errors, since that function is not available within Fireworks. The
library has also been patched so that _.has()
uses the in
operator
instead of hasOwnProperty()
when checking for properties on native objects,
which don't correctly support hasOwnProperty()
.
In addition to the standard Lo-Dash methods like _.isFunction()
, there
are equivalent methods for all native Fireworks types, like _.isImage()
,
which can be useful when filtering the selection. Note that _.isGroup()
will return false if the group is actually a smart shape, and
_.isSmartShape()
will return true in that case.
The _.createObject()
method has been enhanced to take a properties
parameter that will add the properties from an object passed in as the
second parameter.
This module calls _.noConflict()
to remove the global _
reference
that Lo-Dash creates by default.
- Source:
- lib/fwlib/underscore.js, line 5
Requires
- module:fwlib/lodash.min