hstore.js 315 B

123456789101112131415
  1. 'use strict';
  2. const hstore = require('pg-hstore')({ sanitize: true });
  3. function stringify(data) {
  4. if (data === null) return null;
  5. return hstore.stringify(data);
  6. }
  7. exports.stringify = stringify;
  8. function parse(value) {
  9. if (value === null) return null;
  10. return hstore.parse(value);
  11. }
  12. exports.parse = parse;