mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-03 03:55:26 +03:00
ef4fd4b8ef
no-issue This module was being shared between multiple parts of the codebase, the core/shared directory is a stopgap before we move it out to mongo-utils. |
||
---|---|---|
.. | ||
index.js | ||
package.json | ||
README.md |
nql-map-key-values
This utility returns a transformer which can be passed to the @nexes/nql
library to transform queries
Usage
const nql = require('@nexes/nql');
const mapKeyValues = require('nql-map-key-values');
nql('good:true', {
transformer: mapKeyValues({
key: {
from: 'good',
to: 'bad'
},
values: [{
from: true,
to: false
}, {
from: false,
to: true
}]
});
}).toJSON(); // => {bad: false}