MCPcopy Index your code
hub / github.com/hapijs/hapi / addEncoder

Method addEncoder

lib/compression.js:46–53  ·  view source on GitHub ↗
(encoding, encoder)

Source from the content-addressed store, hash-verified

44 }
45
46 addEncoder(encoding, encoder) {
47
48 Hoek.assert(this.encoders[encoding] === undefined, `Cannot override existing encoder for ${encoding}`);
49 Hoek.assert(typeof encoder === 'function', `Invalid encoder function for ${encoding}`);
50 this.encoders[encoding] = encoder;
51 this.encodings.unshift(encoding);
52 this._updateCommons();
53 }
54
55 addDecoder(encoding, decoder) {
56

Callers 1

encoderMethod · 0.80

Calls 1

_updateCommonsMethod · 0.80

Tested by

no test coverage detected