@joist/observable 2.0.0-alpha.18 → 2.0.0-alpha.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joist/observable",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.19",
|
|
4
4
|
"main": "./target/build/lib.js",
|
|
5
5
|
"module": "./target/build/lib.js",
|
|
6
6
|
"exports": {
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"test": "tsc -p tsconfig.test.json && wtr --config ../../wtr.config.mjs --port 8002",
|
|
36
36
|
"build": "tsc -p tsconfig.build.json"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "c83cae0c4733a4c5d79d52b683ec49001bd2b645"
|
|
39
39
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AttributeParser } from './attribute-parsers';
|
|
2
2
|
export declare function getObservableAttributes(c: typeof HTMLElement): Array<string>;
|
|
3
3
|
export declare function getAttributeParsers<T extends typeof HTMLElement>(c: T): Record<string, AttributeParser<unknown>>;
|
|
4
|
-
export declare function attr<T
|
|
4
|
+
export declare function attr<T>(p: Partial<AttributeParser<T>>): <E extends HTMLElement>(t: E, key: string) => void;
|
|
5
5
|
export declare function attr<T extends HTMLElement>(t: T, key: string): void;
|
|
@@ -8,7 +8,7 @@ export function getAttributeParsers(c) {
|
|
|
8
8
|
return parsers;
|
|
9
9
|
}
|
|
10
10
|
export function attr(targetOrParser, key) {
|
|
11
|
-
if (targetOrParser instanceof HTMLElement) {
|
|
11
|
+
if (targetOrParser instanceof HTMLElement && typeof key === 'string') {
|
|
12
12
|
const attrName = propNameToAttrName(key);
|
|
13
13
|
return defineAttribute(targetOrParser, attrName, key);
|
|
14
14
|
}
|