| 41176 | static getPatchesOfType(s, o) { |
| 41177 | return s.filter(o) |
| 41178 | } |
| 41179 | constructor(s) { |
| 41180 | ;(Object.assign( |
| 41181 | this, |
| 41182 | { |
| 41183 | spec: '', |
| 41184 | debugLevel: 'info', |
| 41185 | plugins: [], |
| 41186 | pluginHistory: {}, |
| 41187 | errors: [], |
| 41188 | mutations: [], |
| 41189 | promisedPatches: [], |
| 41190 | state: {}, |
| 41191 | patches: [], |
| 41192 | context: {}, |
| 41193 | contextTree: new ContextTree(), |
| 41194 | showDebug: !1, |
| 41195 | allPatches: [], |
| 41196 | pluginProp: 'specMap', |
| 41197 | libMethods: Object.assign(Object.create(this), Wo, { getInstance: () => this }), |
| 41198 | allowMetaPatches: !1, |
| 41199 | }, |
| 41200 | s |
| 41201 | ), |
| 41202 | (this.get = this._get.bind(this)), |
| 41203 | (this.getContext = this._getContext.bind(this)), |
| 41204 | (this.hasRun = this._hasRun.bind(this)), |
| 41205 | (this.wrappedPlugins = this.plugins |
| 41206 | .map(this.wrapPlugin.bind(this)) |
| 41207 | .filter(Wo.isFunction)), |
| 41208 | this.patches.push(Wo.add([], this.spec)), |
| 41209 | this.patches.push(Wo.context([], this.context)), |
| 41210 | this.updatePatches(this.patches)) |
| 41211 | } |
| 41212 | debug(s, ...o) { |
| 41213 | this.debugLevel === s && console.log(...o) |