fix: support numeric keys when rendering (#2584)
I'm trying to migrate one of my projects which publishes a plugin, and this was blocking me. Looks like key is typed as `export type Key = string | number | any;`, so we might need to make more changes here in the future.
This commit is contained in:
@@ -165,8 +165,11 @@ options[OptionsType.ATTR] = (name, value) => {
|
||||
|
||||
const PATCHED = new WeakSet<VNode>();
|
||||
|
||||
function normalizeKey(str: string) {
|
||||
return str.replaceAll(":", "_");
|
||||
function normalizeKey(key: string | number) {
|
||||
if (typeof key === "number") {
|
||||
key = key.toString();
|
||||
}
|
||||
return key.replaceAll(":", "_");
|
||||
}
|
||||
|
||||
const oldDiff = options[OptionsType.DIFF];
|
||||
|
||||
Reference in New Issue
Block a user