mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
…
|
||
---|---|---|
.. | ||
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}