UNPKG

recink

Version:

Rethink CI for JavaScript applications

41 lines (35 loc) 585 B
'use strict'; /** * Apply transformer over a value */ class Transformer { /** * @param {string} path * @param {function} transformer */ constructor(path, transformer) { this._path = path; this._transformer = transformer; } /** * @param {*} value * * @returns {Promise} */ transform(value) { return this.transformer(value); } /** * @returns {function} */ get transformer() { return this._transformer; } /** * @returns {string} */ get path() { return this._path; } } module.exports = Transformer;