Skip to content

v.1.4.1

Compare
Choose a tag to compare
@vitaly-t vitaly-t released this 02 Jun 17:43
· 2235 commits to master since this release

The following conversion helpers have been extended to accept the value passed in as a function that needs to be called in order to resolve the actual value:

  • as.bool
  • as.number
  • as.text
  • as.date
  • as.json
  • as.array
  • as.csv

Example:

var s = pgp.as.csv(function () {
    return [1, 'two', false];
});
console.log(s);
// prints: 1,'two',false

When the function-parameter returns a function again, it will be called repeatedly, till a non-function value is returned.

Tests have been modified and new ones added to account for the new feature.