release: WRNexusJS 0.3.5
This commit is contained in:
@@ -53,9 +53,21 @@ const components = readdirSync(componentsDir)
|
||||
const slots = [...source.matchAll(/<slot(?:\s+name="([^"]+)")?/g)].map(
|
||||
(match) => match[1] ?? "default",
|
||||
);
|
||||
const events = [
|
||||
...new Set([...source.matchAll(/@([A-Za-z][A-Za-z0-9_-]*)=/g)].map((match) => match[1])),
|
||||
const declaredEvents = [
|
||||
...new Set(
|
||||
[...source.matchAll(/@event\s+([A-Za-z][A-Za-z0-9_]*)\s*=\s*function/g)].map(
|
||||
(match) => match[1],
|
||||
),
|
||||
),
|
||||
];
|
||||
const events =
|
||||
declaredEvents.length > 0
|
||||
? declaredEvents
|
||||
: (entry?.events ?? [
|
||||
...new Set(
|
||||
[...source.matchAll(/@([A-Za-z][A-Za-z0-9_-]*)=/g)].map((match) => match[1]),
|
||||
),
|
||||
]);
|
||||
return {
|
||||
name,
|
||||
mount: name,
|
||||
|
||||
Reference in New Issue
Block a user