Skip to content

Release 5.0.0

Compare
Choose a tag to compare
@KrisSiegel KrisSiegel released this 20 Aug 11:28
· 18 commits to master since this release

Version 5.0 brings in some major changes, the first LTS version and huge improvements over previous versions.

_What's new?_

  • A new way to validate is here! msngr.is(input,...) allows any amount of parameters to validate. The object returned with msngr.is() provides multiple ways to checking the type(s) of objects supplied through familiar properties. For instance:
msngr.is("My String").string; // Returns true
msngr.is("    ").empty; // Returns true
msngr.is(undefined).there; // Returns false
msngr.is("one", "another", "weee").string; // Returns true
  • A new way to setup middleware now exists and replaces the previous options.
  • A new msngr.safe(obj, prop, default) method was added for accessing deep properties, safely.

_Breaking changes_

  • All previously used type, existence and empty checking methods are now removed in favor of the new msngr.is() way.
  • msngr(msg).subscribers has been renamed to msngr(msg).handlers to better reflect the msngr terminology.
  • msngr(msg).options has been axed in favor of the new middleware concept outlined in the above section.
  • Options have been removed entirely along with their specific implementations. This has been replaced by a middleware setup with currently no default middlewares.
  • msngr.merge() now has different, better behavior. No longer tries to merge strings and has a very strict set of rules easy to see in the source code. msngr.copy() was changed in a very similar way

_Misc changes_

  • Highly revised documentation. This is still ongoing.
  • Vastly refactored