* Add Lunr as a site search option * Use a class like the Algolia option does * Lint * Working on showing real content, prep for highlighting * Move searching to their own files * Split out ridiculous fn * Add highlighting * Less lunr search code * A little more tidy * Then chain on write too * Mark from server too * Write a batch of indices * Update compress.js * Highlighting with fewer calls * Update lunr-search.js * Update lunr-search.js * Update lunr-search.js * Update lunr-search.js * Update lunr-search.js * Update lunr-search.js
22 lines
504 B
JavaScript
22 lines
504 B
JavaScript
const { promisify } = require('util')
|
|
const zlib = require('zlib')
|
|
const brotliCompress = promisify(zlib.brotliCompress)
|
|
const brotliDecompress = promisify(zlib.brotliDecompress)
|
|
|
|
const options = {
|
|
params: {
|
|
[zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_TEXT,
|
|
[zlib.constants.BROTLI_PARAM_QUALITY]: 6
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
async compress (data) {
|
|
return brotliCompress(data, options)
|
|
},
|
|
|
|
async decompress (data) {
|
|
return brotliDecompress(data, options)
|
|
}
|
|
}
|