Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Contains common utility methods and classes used in our plugins.
Either use the foo-utils.js
or foo-utils.min.js
files in the dist/ directory with the default namespace FooUtils
or if you want to embed this as part of another package you can rename the namespace and file as part of a copy/concat/uglify task by using something like the below.
copy: {
main: {
src: './node_modules/foo-utils/dist/foo-utils.js',
dest: 'compiled/my-api-utils.js',
options: {
process: function (content, srcpath) {
return content.replace(/FooUtils/g, "MyApi.utils");
}
}
}
},
The above simply regex replaces all occurrences of FooUtils
to MyApi.utils
within the JavaScript files and then renames the file to my-api-utils.js
. As this is a simple regex replace the namespace MyApi
must exist prior to the my-api-utils.js
file being included in the page.
This package does expose a custom grunt task called foo-utils
that can be used to perform the above and it requires just two options to be set; namespace
and dest
.
"foo-utils": {
options: {
namespace: "MyApi.utils",
dest: "./dist/my-api-utils.js"
}
},
Ideally the above would be used as a step in a larger build process that would include the my-api-utils.js
file as part of its own concat or uglify tasks resulting in a single file so any include order namespace issues are no longer a problem.
There are considerable changes for this version as I included babel in the build and performed a cleanup of old/unused methods.
FooUtils.uniqueId
and FooUtils.removeUniqueId
methods as they were no longer being used in any of our plugins.FooUtils.scrollParent
method as it was no longer being used due to issues in some browsers.FooUtils.src
method as it was no longer being used in any of our plugins.FooUtils.versionCompare
method as it was only being used by the lib when it registered itself and that was changed in version 0.2.0.FooUtils.animation
namespace and moved the FooUtils.animation.requestFrame
and FooUtils.animation.cancelFrame
methods to the base FooUtils
namespace as FooUtils.requestFrame
and FooUtils.cancelFrame
.FooUtils.transition.transitionend
and FooUtils.transition.supported
properties as all supported browsers now have support for the transitionend
event and browser detection is no longer required.FooUtils.transition.start(element, triggerFn, propertyName, timeout)
method to provide better functionality now that all supported browsers support the transitionend
event.FooUtils.Bounds
object as its functionality can be better implemented using an IntersectionObserver
.FooUtils.fn.when
method and replaced it with FooUtils.fn.all
and FooUtils.fn.allSettled
to match the signatures of the standard Promise
api.FooUtils.fn.resolveWith
and FooUtils.fn.rejectWith
methods to better match those provided by jQuery. The first parameter is now the thisArg
within any callbacks.FooUtils.Class.bases
method to FooUtils.Class.getBaseClasses
.FooUtils.fn.check
and FooUtils.fn.fetch
methods as they were no longer being used in any of our plugins.FooUtils.Factory
class, use the new FooUtils.ClassRegistry
class instead.FooUtils.ClassRegistry
class to replace the previous FooUtils.Factory
class.FooUtils.transition.disable(element, modifyFn)
method to help with working with transitions. This method temporarily disables all transitions on an element, executes the callback to modify the element, and then enables all transitions again once modifications are complete.FooUtils.transition.modify(element, modifyFn [, immediate [, propertyName]])
method to help with working with transitions. The immediate
parameter changes how the modifyFn
is used; true
is applied immediately with no transition, false
is applied immediately but waits for the transition to end.FooUtils.fn.all
method to match the functionality provided by the Promise.all
method.FooUtils.fn.allSettled
method to match the functionality provided by the Promise.allSettled
method.FooUtils.fn.resolve
method to match the functionality provided by the Promise.resolve
method and the previous FooUtils.fn.resolveWith
method.FooUtils.fn.reject
method to match the functionality provided by the Promise.reject
method and the previous FooUtils.fn.rejectWith
method.FooUtils.inArray
method to test if a value exists in an array. Essentially a wrapper around the native indexOf
method on an array, but it checks if the haystack is an actual array.FooUtils.Debugger
class, it's usefulness had come to an end, and it was reporting as a cookie in Chrome because it checked on the existence of localStorage as the script was parsed.FooUtils.FullscreenAPI
class which was exposed as FooUtils.fullscreen
as not all projects need it and initializing it by default was unnecessary overhead.FooUtils.find
method to pluck a single value from an array or object.FooUtils.each
method to iterate over arrays or objects.FooUtils.Event.parse
method that splits an event name into its type and namespace.FooUtils.transition.duration
, FooUtils.animation.duration
and FooUtils.animation.iterations
methods to handle multiple values.FooUtils.EventClass
to expose various internal members publicly. This class now exposes an events
object as well as a addListener
and removeListener
methods.FooUtils.fn.when
method to handle values that are not promises passed in as part of the array.FooUtils.str.format
method to use the new FooUtils.each
method internally.FooUtils.str.from
and FooUtils.str.until
methods by simply removing unnecessary parameter checks.devDependencies
in the package.json
.FooUtils.Class.bases
method to return an array of all inherited classes.FooUtils.str.kebab
method for formatting strings to kebab case (this-is-kebab).FooUtils.url.parts
method.FooUtils.animation
namespace containing various properties and methods to help with CSS animations.FooUtils.FullscreenAPI
class, exposed as the FooUtils.fullscreen
instance, to provide a cross browser fullscreen API.FooUtils.Timer
class to provide a simple event based timer.FooUtils.EventClass
's on
and off
methods when using an object with space separated event names.FooUtils.EventClass
and FooUtils.Event
classes to handle namespaced events.FooUtils.EventClass
's on
and off
methods to accept an object containing event type to handler mappings.FooUtils.fn.debounce
.FooUtils.scrollParent( element, axis, def )
to explicitly test for overflow:scroll
or overflow:auto
rather than just not overflow:hidden
.FooUtils.scrollParent( element, axis, def )
to exclude <html/>
from the result as its scroll events are raised on the document
.Start of changelog. Older versions have no breaking changes.
FooUtils.Throttle
class, replaced with two methods FooUtils.fn.debounce( fn, time )
and FooUtils.fn.throttle( fn, time )
.FooUtils.EventClass
base class and FooUtils.Event
classes to allow objects to be subscribed to and emit events through the supplied .on( eventName, callback [, thisArg] )
, .off( eventName [, callback] )
and .trigger( eventName, args )
methods.FooUtils.selectify( classes )
method.FooUtils.src( src, srcset, srcWidth, srcHeight, renderWidth, renderHeight, devicePixelRatio )
method.FooUtils.scrollParent( element, axis, def )
method.FAQs
Contains common utility methods and classes used in our plugins.
We found that foo-utils 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.