Skip to content

Releases: flowxo/flowxo-utils

v3.0.0

08 Feb 17:32
Compare
Choose a tag to compare

Added

  • Timezone support for Utils.parseDateTimeField()
  • Locale support for Utils.parseDateTimeField()

Utils.parseDateTimeField(date [, Object]) takes a second optional parameter of object.

  • timezone defaults to UTC
  • locale defaults to en

Usage:

Utils.parseDateTimeField('today at 3pm', {
  timezone: 'Europe/London',
  locale: 'en-GB'
});

Breaking change

Upgraded Sugar Date module from 1.x to 2.x. See Sugar breaking changes

Date object no longer gets extended with SugarDate by default. If you want to extend the Date object you must call Utils.activateDateParser().

v2.0.0

12 Sep 10:18
Compare
Choose a tag to compare

Added

  • maxDuration option to backoff module, to support abortion of backoff if the total operation time has or will exceed the maxDuration parameter on the next retry.

Breaking change

Backoff module is now invoked differently. Instead of creating a new Backoff object, and passing in the minDelay and maxDelay, you now pass everything into the attempt or attemptAsync methods.

Assuming the following operation:

var operation = function() {
return new Promise(function (resolve, reject) {
  request(options, function(err, res, body) {
    if(err) {
      return reject(err);
    }
    resolve(body);
  }
});

Old (1.x) syntax:

var backoff = new Backoff(100, 1000);
backoff.attemptAsync(5, operation).then(res => {
  // Do something with result
}, err => {
  // Do something with error
})

New (2.0) syntax:

var options = {
  minDelay: 100,
  maxDelay: 1000,
  maxAttempts: 5
};
backoff.attemptAsync(operation, options).then(res => {
  // Do something with result
}, err => {
  // Do something with error
})

v1.6.1

13 Sep 09:28
Compare
Choose a tag to compare

Added

  • NonRetryableError to backoff module, to support early aborting of backoff.

v1.6.0

09 Aug 15:47
Compare
Choose a tag to compare

Added

  • Promise-style attemptAsync method to backoff module.

v1.5.2

09 Aug 15:47
Compare
Choose a tag to compare

Fixed

  • Reverted to ES5 syntax for node 0.10 and 0.12 compatibility.

v1.5.1

09 Aug 15:46
Compare
Choose a tag to compare

Added

  • hashToKeyValPairs utility function.
  • Code coverage with istanbul.

v1.5.0

24 Mar 12:31
Compare
Choose a tag to compare

Added

  • Dumb console logger, with partial API compatibility with Winston.

v1.4.0

24 Mar 09:54
Compare
Choose a tag to compare

Added

  • Backoff utility.

v1.3.1

11 Mar 09:52
Compare
Choose a tag to compare

Added

  • Support for objects inside collections.

v1.3.0

10 Mar 11:24
Compare
Choose a tag to compare

Added

  • Support for 'flattened collections'.