diff --git a/src/compile/nodes/Attribute.ts b/src/compile/nodes/Attribute.ts index c6f3d8ca24..8364af51f3 100644 --- a/src/compile/nodes/Attribute.ts +++ b/src/compile/nodes/Attribute.ts @@ -1,4 +1,4 @@ -import { stringify } from '../../utils/stringify'; +import { stringify } from '../utils/stringify'; import add_to_set from '../utils/add_to_set'; import Component from '../Component'; import Node from './shared/Node'; diff --git a/src/compile/render-dom/index.ts b/src/compile/render-dom/index.ts index 178a0a475b..2245c7d2b0 100644 --- a/src/compile/render-dom/index.ts +++ b/src/compile/render-dom/index.ts @@ -1,5 +1,5 @@ import deindent from '../utils/deindent'; -import { stringify, escape } from '../../utils/stringify'; +import { stringify, escape } from '../utils/stringify'; import CodeBuilder from '../utils/CodeBuilder'; import Component from '../Component'; import Renderer from './Renderer'; diff --git a/src/compile/render-dom/wrappers/Element/Attribute.ts b/src/compile/render-dom/wrappers/Element/Attribute.ts index 4746b1548c..39d110dade 100644 --- a/src/compile/render-dom/wrappers/Element/Attribute.ts +++ b/src/compile/render-dom/wrappers/Element/Attribute.ts @@ -2,7 +2,7 @@ import Attribute from '../../../nodes/Attribute'; import Block from '../../Block'; import fix_attribute_casing from './fix_attribute_casing'; import ElementWrapper from './index'; -import { stringify } from '../../../../utils/stringify'; +import { stringify } from '../../../utils/stringify'; import deindent from '../../../utils/deindent'; export default class AttributeWrapper { diff --git a/src/compile/render-dom/wrappers/Element/StyleAttribute.ts b/src/compile/render-dom/wrappers/Element/StyleAttribute.ts index 8d3672fb98..407e66911d 100644 --- a/src/compile/render-dom/wrappers/Element/StyleAttribute.ts +++ b/src/compile/render-dom/wrappers/Element/StyleAttribute.ts @@ -3,7 +3,7 @@ import Block from '../../Block'; import AttributeWrapper from './Attribute'; import Node from '../../../nodes/shared/Node'; import ElementWrapper from '.'; -import { stringify } from '../../../../utils/stringify'; +import { stringify } from '../../../utils/stringify'; import add_to_set from '../../../utils/add_to_set'; export interface StyleProp { diff --git a/src/compile/render-dom/wrappers/Element/index.ts b/src/compile/render-dom/wrappers/Element/index.ts index a9587c0579..f7cbee09d0 100644 --- a/src/compile/render-dom/wrappers/Element/index.ts +++ b/src/compile/render-dom/wrappers/Element/index.ts @@ -5,7 +5,7 @@ import Block from '../../Block'; import Node from '../../../nodes/shared/Node'; import { is_void, quote_prop_if_necessary, quote_name_if_necessary, sanitize } from '../../../../utils/names'; import FragmentWrapper from '../Fragment'; -import { stringify, escapeHTML, escape } from '../../../../utils/stringify'; +import { stringify, escape_html, escape } from '../../../utils/stringify'; import TextWrapper from '../Text'; import fix_attribute_casing from './fix_attribute_casing'; import deindent from '../../../utils/deindent'; @@ -323,7 +323,7 @@ export default class ElementWrapper extends Wrapper { return raw ? wrapper.node.data - : escapeHTML(wrapper.node.data) + : escape_html(wrapper.node.data) .replace(/\\/g, '\\\\') .replace(/`/g, '\\`') .replace(/\$/g, '\\$'); diff --git a/src/compile/render-dom/wrappers/Text.ts b/src/compile/render-dom/wrappers/Text.ts index 00028df67c..9c15033203 100644 --- a/src/compile/render-dom/wrappers/Text.ts +++ b/src/compile/render-dom/wrappers/Text.ts @@ -2,8 +2,7 @@ import Renderer from '../Renderer'; import Block from '../Block'; import Text from '../../nodes/Text'; import Wrapper from './shared/Wrapper'; -import { CompileOptions } from '../../../interfaces'; -import { stringify } from '../../../utils/stringify'; +import { stringify } from '../../utils/stringify'; // Whitespace inside one of these elements will not result in // a whitespace node being created in any circumstances. (This diff --git a/src/compile/render-dom/wrappers/Title.ts b/src/compile/render-dom/wrappers/Title.ts index 470678847c..f27273f46e 100644 --- a/src/compile/render-dom/wrappers/Title.ts +++ b/src/compile/render-dom/wrappers/Title.ts @@ -2,8 +2,7 @@ import Wrapper from './shared/Wrapper'; import Renderer from '../Renderer'; import Block from '../Block'; import Title from '../../nodes/Title'; -import FragmentWrapper from './Fragment'; -import { stringify } from '../../../utils/stringify'; +import { stringify } from '../../utils/stringify'; import add_to_set from '../../utils/add_to_set'; export default class TitleWrapper extends Wrapper { diff --git a/src/compile/render-ssr/handlers/AwaitBlock.ts b/src/compile/render-ssr/handlers/AwaitBlock.ts index a79ff18429..dfb6dc247c 100644 --- a/src/compile/render-ssr/handlers/AwaitBlock.ts +++ b/src/compile/render-ssr/handlers/AwaitBlock.ts @@ -1,6 +1,6 @@ import Renderer from '../Renderer'; import { CompileOptions } from '../../../interfaces'; -import { snip } from '../../../utils/snip'; +import { snip } from '../../utils/snip'; export default function(node, renderer: Renderer, options: CompileOptions) { renderer.append('${(function(__value) { if(@isPromise(__value)) return `'); diff --git a/src/compile/render-ssr/handlers/DebugTag.ts b/src/compile/render-ssr/handlers/DebugTag.ts index ac9e17a2ef..b04d541105 100644 --- a/src/compile/render-ssr/handlers/DebugTag.ts +++ b/src/compile/render-ssr/handlers/DebugTag.ts @@ -1,4 +1,4 @@ -import { stringify } from '../../../utils/stringify'; +import { stringify } from '../../utils/stringify'; export default function(node, renderer, options) { if (!options.dev) return; diff --git a/src/compile/render-ssr/handlers/EachBlock.ts b/src/compile/render-ssr/handlers/EachBlock.ts index a764b151aa..3731093a9b 100644 --- a/src/compile/render-ssr/handlers/EachBlock.ts +++ b/src/compile/render-ssr/handlers/EachBlock.ts @@ -1,4 +1,4 @@ -import { snip } from '../../../utils/snip'; +import { snip } from '../../utils/snip'; export default function(node, renderer, options) { const snippet = snip(node.expression); diff --git a/src/compile/render-ssr/handlers/Element.ts b/src/compile/render-ssr/handlers/Element.ts index bc633b2fbc..2824595b16 100644 --- a/src/compile/render-ssr/handlers/Element.ts +++ b/src/compile/render-ssr/handlers/Element.ts @@ -1,8 +1,8 @@ import { is_void, quote_prop_if_necessary, quote_name_if_necessary } from '../../../utils/names'; import Attribute from '../../nodes/Attribute'; import Node from '../../nodes/shared/Node'; -import { snip } from '../../../utils/snip'; -import { stringify_attribute } from '../../../utils/stringify_attribute'; +import { snip } from '../../utils/snip'; +import { stringify_attribute } from '../../utils/stringify_attribute'; import { get_slot_scope } from './shared/get_slot_scope'; // source: https://gist.github.com/ArjanSchouten/0b8574a6ad7f5065a5e7 diff --git a/src/compile/render-ssr/handlers/HtmlTag.ts b/src/compile/render-ssr/handlers/HtmlTag.ts index 4d6934d892..7562186a4b 100644 --- a/src/compile/render-ssr/handlers/HtmlTag.ts +++ b/src/compile/render-ssr/handlers/HtmlTag.ts @@ -1,4 +1,4 @@ -import { snip } from '../../../utils/snip'; +import { snip } from '../../utils/snip'; export default function(node, renderer, options) { renderer.append('${' + snip(node.expression) + '}'); diff --git a/src/compile/render-ssr/handlers/IfBlock.ts b/src/compile/render-ssr/handlers/IfBlock.ts index 9063bcc988..cbe505fef8 100644 --- a/src/compile/render-ssr/handlers/IfBlock.ts +++ b/src/compile/render-ssr/handlers/IfBlock.ts @@ -1,4 +1,4 @@ -import { snip } from '../../../utils/snip'; +import { snip } from '../../utils/snip'; export default function(node, renderer, options) { const snippet = snip(node.expression); diff --git a/src/compile/render-ssr/handlers/InlineComponent.ts b/src/compile/render-ssr/handlers/InlineComponent.ts index 862eff7c6d..a79b81fa9b 100644 --- a/src/compile/render-ssr/handlers/InlineComponent.ts +++ b/src/compile/render-ssr/handlers/InlineComponent.ts @@ -1,6 +1,6 @@ -import { escape, escapeTemplate, stringify } from '../../../utils/stringify'; +import { escape, escape_template, stringify } from '../../utils/stringify'; import { quote_name_if_necessary } from '../../../utils/names'; -import { snip } from '../../../utils/snip'; +import { snip } from '../../utils/snip'; import Renderer from '../Renderer'; import { stringify_props } from '../../utils/stringify_props'; import { get_slot_scope } from './shared/get_slot_scope'; @@ -9,7 +9,7 @@ type AppendTarget = any; // TODO function stringifyAttribute(chunk: Node) { if (chunk.type === 'Text') { - return escapeTemplate(escape(chunk.data)); + return escape_template(escape(chunk.data)); } return '${@escape( ' + snip(chunk) + ')}'; diff --git a/src/compile/render-ssr/handlers/Tag.ts b/src/compile/render-ssr/handlers/Tag.ts index 2cfbafd48a..eb887b8688 100644 --- a/src/compile/render-ssr/handlers/Tag.ts +++ b/src/compile/render-ssr/handlers/Tag.ts @@ -1,4 +1,4 @@ -import { snip } from '../../../utils/snip'; +import { snip } from '../../utils/snip'; export default function(node, renderer, options) { const snippet = snip(node.expression); diff --git a/src/compile/render-ssr/handlers/Text.ts b/src/compile/render-ssr/handlers/Text.ts index bfc9a5d55c..e794025370 100644 --- a/src/compile/render-ssr/handlers/Text.ts +++ b/src/compile/render-ssr/handlers/Text.ts @@ -1,4 +1,4 @@ -import { escapeHTML, escapeTemplate, escape } from '../../../utils/stringify'; +import { escape_html, escape_template, escape } from '../../utils/stringify'; export default function(node, renderer, options) { let text = node.data; @@ -8,7 +8,7 @@ export default function(node, renderer, options) { (node.parent.name !== 'script' && node.parent.name !== 'style') ) { // unless this Text node is inside a