typed-dom
Advanced tools
Comparing version
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.330 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.331 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -155,3 +155,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
function elem(context, ns, tag, attrs) { | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser.`); | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser`); | ||
const opts = 'is' in attrs ? { | ||
@@ -207,6 +207,6 @@ is: attrs['is'] | ||
case 'function': | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}".`); | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}"`); | ||
const names = name.split(/\s+/); | ||
for (const name of names) { | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}".`); | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}"`); | ||
const type = name.slice(2).toLowerCase(); | ||
@@ -213,0 +213,0 @@ el.addEventListener(type, value, { |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.330 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.331 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -3,0 +3,0 @@ if(typeof exports === 'object' && typeof module === 'object') |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.330 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.331 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -679,3 +679,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
const el = factory ? (0, dom_1.define)(factory(baseFactory, tag, attrs ?? {}, children), attrs) : baseFactory(tag, attrs); | ||
if (tag.toLowerCase() !== el.tagName.toLowerCase()) throw new Error(`TypedDOM: Expected tag name is "${tag.toLowerCase()}" but actually "${el.tagName.toLowerCase()}".`); | ||
if (tag.toLowerCase() !== el.tagName.toLowerCase()) throw new Error(`TypedDOM: Expected tag name is "${tag.toLowerCase()}" but actually "${el.tagName.toLowerCase()}"`); | ||
return el; | ||
@@ -822,3 +822,3 @@ } | ||
default: | ||
throw new Error(`TypedDOM: Invalid children type.`); | ||
throw new TypeError(`TypedDOM: Invalid children type`); | ||
} | ||
@@ -843,3 +843,3 @@ throwErrorIfUnavailable(this); | ||
default: | ||
throw new Error(`TypedDOM: Invalid children type.`); | ||
throw new TypeError(`TypedDOM: Invalid children type`); | ||
} | ||
@@ -1024,3 +1024,3 @@ this.isInit = false; | ||
if (!oldParent || oldParent === newParent || !(internal_1.symbols.proxy in oldParent)) return; | ||
throw new Error(`TypedDOM: Proxy children must be removed from the old parent proxy before assigning to the new parent proxy.`); | ||
throw new Error(`TypedDOM: Proxy children must be removed from the old parent proxy before assigning to the new parent proxy`); | ||
} | ||
@@ -1074,3 +1074,3 @@ | ||
function elem(context, ns, tag, attrs) { | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser.`); | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser`); | ||
const opts = 'is' in attrs ? { | ||
@@ -1126,6 +1126,6 @@ is: attrs['is'] | ||
case 'function': | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}".`); | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}"`); | ||
const names = name.split(/\s+/); | ||
for (const name of names) { | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}".`); | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}"`); | ||
const type = name.slice(2).toLowerCase(); | ||
@@ -1132,0 +1132,0 @@ el.addEventListener(type, value, { |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.330 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.331 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -3,0 +3,0 @@ if(typeof exports === 'object' && typeof module === 'object') |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.330 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.331 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -679,3 +679,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
const el = factory ? (0, dom_1.define)(factory(baseFactory, tag, attrs ?? {}, children), attrs) : baseFactory(tag, attrs); | ||
if (tag.toLowerCase() !== el.tagName.toLowerCase()) throw new Error(`TypedDOM: Expected tag name is "${tag.toLowerCase()}" but actually "${el.tagName.toLowerCase()}".`); | ||
if (tag.toLowerCase() !== el.tagName.toLowerCase()) throw new Error(`TypedDOM: Expected tag name is "${tag.toLowerCase()}" but actually "${el.tagName.toLowerCase()}"`); | ||
return el; | ||
@@ -822,3 +822,3 @@ } | ||
default: | ||
throw new Error(`TypedDOM: Invalid children type.`); | ||
throw new TypeError(`TypedDOM: Invalid children type`); | ||
} | ||
@@ -843,3 +843,3 @@ throwErrorIfUnavailable(this); | ||
default: | ||
throw new Error(`TypedDOM: Invalid children type.`); | ||
throw new TypeError(`TypedDOM: Invalid children type`); | ||
} | ||
@@ -1024,3 +1024,3 @@ this.isInit = false; | ||
if (!oldParent || oldParent === newParent || !(internal_1.symbols.proxy in oldParent)) return; | ||
throw new Error(`TypedDOM: Proxy children must be removed from the old parent proxy before assigning to the new parent proxy.`); | ||
throw new Error(`TypedDOM: Proxy children must be removed from the old parent proxy before assigning to the new parent proxy`); | ||
} | ||
@@ -1074,3 +1074,3 @@ | ||
function elem(context, ns, tag, attrs) { | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser.`); | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser`); | ||
const opts = 'is' in attrs ? { | ||
@@ -1126,6 +1126,6 @@ is: attrs['is'] | ||
case 'function': | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}".`); | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}"`); | ||
const names = name.split(/\s+/); | ||
for (const name of names) { | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}".`); | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}"`); | ||
const type = name.slice(2).toLowerCase(); | ||
@@ -1132,0 +1132,0 @@ el.addEventListener(type, value, { |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.330 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.331 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -3,0 +3,0 @@ if(typeof exports === 'object' && typeof module === 'object') |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.330 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.331 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -155,3 +155,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
function elem(context, ns, tag, attrs) { | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser.`); | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser`); | ||
const opts = 'is' in attrs ? { | ||
@@ -207,6 +207,6 @@ is: attrs['is'] | ||
case 'function': | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}".`); | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}"`); | ||
const names = name.split(/\s+/); | ||
for (const name of names) { | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}".`); | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}"`); | ||
const type = name.slice(2).toLowerCase(); | ||
@@ -213,0 +213,0 @@ el.addEventListener(type, value, { |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.330 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.331 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -155,3 +155,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
function elem(context, ns, tag, attrs) { | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser.`); | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser`); | ||
const opts = 'is' in attrs ? { | ||
@@ -207,6 +207,6 @@ is: attrs['is'] | ||
case 'function': | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}".`); | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}"`); | ||
const names = name.split(/\s+/); | ||
for (const name of names) { | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}".`); | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}"`); | ||
const type = name.slice(2).toLowerCase(); | ||
@@ -213,0 +213,0 @@ el.addEventListener(type, value, { |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.330 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.331 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -3,0 +3,0 @@ if(typeof exports === 'object' && typeof module === 'object') |
16
index.js
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.330 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.331 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -679,3 +679,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
const el = factory ? (0, dom_1.define)(factory(baseFactory, tag, attrs ?? {}, children), attrs) : baseFactory(tag, attrs); | ||
if (tag.toLowerCase() !== el.tagName.toLowerCase()) throw new Error(`TypedDOM: Expected tag name is "${tag.toLowerCase()}" but actually "${el.tagName.toLowerCase()}".`); | ||
if (tag.toLowerCase() !== el.tagName.toLowerCase()) throw new Error(`TypedDOM: Expected tag name is "${tag.toLowerCase()}" but actually "${el.tagName.toLowerCase()}"`); | ||
return el; | ||
@@ -822,3 +822,3 @@ } | ||
default: | ||
throw new Error(`TypedDOM: Invalid children type.`); | ||
throw new TypeError(`TypedDOM: Invalid children type`); | ||
} | ||
@@ -843,3 +843,3 @@ throwErrorIfUnavailable(this); | ||
default: | ||
throw new Error(`TypedDOM: Invalid children type.`); | ||
throw new TypeError(`TypedDOM: Invalid children type`); | ||
} | ||
@@ -1024,3 +1024,3 @@ this.isInit = false; | ||
if (!oldParent || oldParent === newParent || !(internal_1.symbols.proxy in oldParent)) return; | ||
throw new Error(`TypedDOM: Proxy children must be removed from the old parent proxy before assigning to the new parent proxy.`); | ||
throw new Error(`TypedDOM: Proxy children must be removed from the old parent proxy before assigning to the new parent proxy`); | ||
} | ||
@@ -1074,3 +1074,3 @@ | ||
function elem(context, ns, tag, attrs) { | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser.`); | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser`); | ||
const opts = 'is' in attrs ? { | ||
@@ -1126,6 +1126,6 @@ is: attrs['is'] | ||
case 'function': | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}".`); | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}"`); | ||
const names = name.split(/\s+/); | ||
for (const name of names) { | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}".`); | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}"`); | ||
const type = name.slice(2).toLowerCase(); | ||
@@ -1132,0 +1132,0 @@ el.addEventListener(type, value, { |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.330 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.331 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -3,0 +3,0 @@ if(typeof exports === 'object' && typeof module === 'object') |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.330 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.331 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -679,3 +679,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
const el = factory ? (0, dom_1.define)(factory(baseFactory, tag, attrs ?? {}, children), attrs) : baseFactory(tag, attrs); | ||
if (tag.toLowerCase() !== el.tagName.toLowerCase()) throw new Error(`TypedDOM: Expected tag name is "${tag.toLowerCase()}" but actually "${el.tagName.toLowerCase()}".`); | ||
if (tag.toLowerCase() !== el.tagName.toLowerCase()) throw new Error(`TypedDOM: Expected tag name is "${tag.toLowerCase()}" but actually "${el.tagName.toLowerCase()}"`); | ||
return el; | ||
@@ -822,3 +822,3 @@ } | ||
default: | ||
throw new Error(`TypedDOM: Invalid children type.`); | ||
throw new TypeError(`TypedDOM: Invalid children type`); | ||
} | ||
@@ -843,3 +843,3 @@ throwErrorIfUnavailable(this); | ||
default: | ||
throw new Error(`TypedDOM: Invalid children type.`); | ||
throw new TypeError(`TypedDOM: Invalid children type`); | ||
} | ||
@@ -1024,3 +1024,3 @@ this.isInit = false; | ||
if (!oldParent || oldParent === newParent || !(internal_1.symbols.proxy in oldParent)) return; | ||
throw new Error(`TypedDOM: Proxy children must be removed from the old parent proxy before assigning to the new parent proxy.`); | ||
throw new Error(`TypedDOM: Proxy children must be removed from the old parent proxy before assigning to the new parent proxy`); | ||
} | ||
@@ -1074,3 +1074,3 @@ | ||
function elem(context, ns, tag, attrs) { | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser.`); | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser`); | ||
const opts = 'is' in attrs ? { | ||
@@ -1126,6 +1126,6 @@ is: attrs['is'] | ||
case 'function': | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}".`); | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}"`); | ||
const names = name.split(/\s+/); | ||
for (const name of names) { | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}".`); | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}"`); | ||
const type = name.slice(2).toLowerCase(); | ||
@@ -1132,0 +1132,0 @@ el.addEventListener(type, value, { |
{ | ||
"name": "typed-dom", | ||
"version": "0.0.330", | ||
"version": "0.0.331", | ||
"description": "A value-level and type-level DOM builder.", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.330 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.331 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -3,0 +3,0 @@ if(typeof exports === 'object' && typeof module === 'object') |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.330 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.331 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -155,3 +155,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
function elem(context, ns, tag, attrs) { | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser.`); | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser`); | ||
const opts = 'is' in attrs ? { | ||
@@ -207,6 +207,6 @@ is: attrs['is'] | ||
case 'function': | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}".`); | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}"`); | ||
const names = name.split(/\s+/); | ||
for (const name of names) { | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}".`); | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}"`); | ||
const type = name.slice(2).toLowerCase(); | ||
@@ -213,0 +213,0 @@ el.addEventListener(type, value, { |
@@ -101,3 +101,3 @@ import { El, ElementProxy } from './proxy'; | ||
: baseFactory(tag, attrs) as unknown as Element; | ||
if (tag.toLowerCase() !== el.tagName.toLowerCase()) throw new Error(`TypedDOM: Expected tag name is "${tag.toLowerCase()}" but actually "${el.tagName.toLowerCase()}".`); | ||
if (tag.toLowerCase() !== el.tagName.toLowerCase()) throw new Error(`TypedDOM: Expected tag name is "${tag.toLowerCase()}" but actually "${el.tagName.toLowerCase()}"`); | ||
return el; | ||
@@ -104,0 +104,0 @@ } |
@@ -95,3 +95,3 @@ import { isArray } from 'spica/alias'; | ||
default: | ||
throw new Error(`TypedDOM: Invalid children type.`); | ||
throw new TypeError(`TypedDOM: Invalid children type`); | ||
} | ||
@@ -116,3 +116,3 @@ throwErrorIfUnavailable(this); | ||
default: | ||
throw new Error(`TypedDOM: Invalid children type.`); | ||
throw new TypeError(`TypedDOM: Invalid children type`); | ||
} | ||
@@ -333,3 +333,3 @@ this.isInit = false; | ||
if (!oldParent || oldParent === newParent || !(symbols.proxy in oldParent)) return; | ||
throw new Error(`TypedDOM: Proxy children must be removed from the old parent proxy before assigning to the new parent proxy.`); | ||
throw new Error(`TypedDOM: Proxy children must be removed from the old parent proxy before assigning to the new parent proxy`); | ||
} |
@@ -98,3 +98,3 @@ import { isArray, hasOwnProperty } from 'spica/alias'; | ||
function elem(context: Document | ShadowRoot, ns: NS, tag: string, attrs: Attrs): Element { | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser.`); | ||
if (!('createElement' in context)) throw new Error(`TypedDOM: Scoped custom elements are not supported on this browser`); | ||
const opts = 'is' in attrs ? { is: attrs['is'] as string } : undefined; | ||
@@ -155,6 +155,6 @@ switch (ns) { | ||
case 'function': | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}".`); | ||
if (name.length < 3) throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${name}"`); | ||
const names = name.split(/\s+/); | ||
for (const name of names) { | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}".`); | ||
if (!name.startsWith('on')) throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${name}"`); | ||
const type = name.slice(2).toLowerCase(); | ||
@@ -161,0 +161,0 @@ el.addEventListener(type, value, { |
@@ -5,3 +5,3 @@ { | ||
"lib": [ | ||
"ES2021", | ||
"ES2022", | ||
"DOM", | ||
@@ -8,0 +8,0 @@ "DOM.Iterable" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
665028
0