NeahOpti/node_modules/postgres-bytea/encoder.js
2025-04-22 12:49:37 +02:00

18 lines
285 B
JavaScript

'use strict'
const { Transform } = require('stream')
class ByteaEncoder extends Transform {
constructor () {
super()
this.push('\\\\x')
}
_transform (chunk, encoding, callback) {
this.push(chunk.toString('hex'))
callback()
}
}
module.exports = ByteaEncoder