b.transform(function (file) { return new Transform({ transform (buf, enc, next) { this.push(buf.toString('utf8').replace(/bar/g, 'baz')) next() } }) })
async findBuiltinEntities(utterance, language) { try { const result = await this.request(utterance, language); return { edges: this.transform(result), source: result }; } catch (ex) { this.logger.error(ex); return { edges: [] }; } }
compile(cubes, errorReporter) { // eslint-disable-next-line no-multi-assign this.cubes = this.queries = this.cubeSymbols.cubeList .filter(this.cubeValidator.isCubeValid.bind(this.cubeValidator)) .map((v) => this.transform(v, errorReporter.inContext(`${v.name} cube`))) .filter(c => !!c); }
set value(v) { if (!v && v !== 0) { this.placeholder = true; this.rendered = color.gray(this.transform.render(`${this.initial}`)); this._value = ``; } else { this.placeholder = false; this.rendered = this.transform.render(`${round(v, this.round)}`); this._value = round(v, this.round); } this.fire(); }
compile(cubes, errorReporter) { this.cubeDefinitions = R.pipe( R.map(c => [c.name, c]), R.fromPairs )(cubes); this.cubeList = cubes.map(c => (c.name ? this.getCubeDefinition(c.name) : this.createCube(c))); this.symbols = R.pipe( R.map((c) => [c.name, this.transform(c.name, errorReporter.inContext(`${c.name} cube`))]), R.fromPairs )(cubes); }
constructor(opts={}) { super(opts); this.transform = style.render(opts.style); this.scale = this.transform.scale; this.msg = opts.message; this.initial = opts.initial || ``; this.validator = opts.validate || (() => true); this.value = ``; this.errorMsg = opts.error || `Please Enter A Valid Value`; this.cursor = Number(!!this.initial); this.clear = clear(``); this.render(); }
/** * Returns an object representing the image editor transform * * * @param {object} state Global state tree * @returns {object} image editor transform { degrees, scaleX, scaleY } */ export function getImageEditorTransform( state ) { return state.editor.imageEditor.transform; }
onChangeChartType(type) { this.setState({ type: type }); this.chart.transform(type); }
const findMatchingPermissions = (userPermissions, permissions) => { return transform( userPermissions, (result, value) => { const associatedPermission = permissions.find( perm => perm.action === value.action && perm.subject === value.subject ); if (associatedPermission) { result.push(value); } }, [] ); }
function difference(object, base) { function changes(object, base) { return transform(object, function(result, value, key) { if (!isEqual(value, base[key])) { result[key] = isObject(value) && isObject(base[key]) ? changes(value, base[key]) : value; } }); } return changes(object, base); }
composeValidators( () => yup.string().transform((val, originalVal) => originalVal), addMinLengthValidator, addMaxLengthValidator, addStringRegexValidator )
const buildStrapiQuery = caslQuery => { const transform = _.flow([flattenDeep, cleanupUnwantedProperties]); return transform(caslQuery); }
composeValidators( () => yup.string().transform((val, originalVal) => originalVal), addMinLengthValidator, addMaxLengthValidator, addStringRegexValidator )
function difference(object, base) { function changes(object, base) { return transform(object, function(result, value, key) { if (!isEqual(value, base[key])) { result[key] = isObject(value) && isObject(base[key]) ? changes(value, base[key]) : value; } }); } return changes(object, base); }