@osaedasia/oresume
Version:
A user-friendly library for generating complete Single Page Applications (SPAs)
2 lines (1 loc) • 881 B
JavaScript
import{ParserAttributes as e}from"../../../domain/attributes/ParserAttributes.js";import{APatternService as t}from"./APatternService.js";import{DomHelper as r}from"../../helpers/DomHelper.js";import{isAnHTMLObject as a}from"../../../domain/definitions/interfaces/HTMLObject.js";import{isAnObserverService as s}from"../../../domain/definitions/interfaces/observer/IObserverService.js";class i extends t{type="observer";getAttributeValueRegex(){return r.createAttributeValuePattern(this.getPatternRegex())}createPatternObject(e,t){return s(t)?{type:"observer",index:e,marker:this.createPatternMarker(e),observer:t}:null}handleAttributeMatch(t,r){return`${e.PATTERN}="${r.marker}"`}handleContentMatch(e,t){let r;return r=a(t.observer.state)?t.observer.state.toHtml():String(t.observer.state),`<span ${this.handleAttributeMatch(e,t)}>${r}</span>`}}export{i as ObserverPatternService};