1234567891011121314151617181920212223242526 |
- import _ from 'lodash'
- import {baseConfigProcess} from "./config";
- import {lookupFn, lookupScope} from "./lib";
- class FixClass {
- @baseConfigProcess()
- fix(me, config) {
- const {fix} = config
- if (!fix) {
- return
- }
- const scope = lookupScope(me)
- if (_.isArray(fix)) {
- _.each(fix, (f) => {
- const fn = lookupFn(scope, f)
- fn.call(this, me, config)
- })
- } else if (_.isString(fix)) {
- const fn = lookupFn(scope, fix)
- fn.call(this, me, config)
- }
- }
- }
|