@tscircuit/core 0.0.1439 → 0.0.1440
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/dist/index.js +9 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1927,8 +1927,15 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
1927
1927
|
if (this.canHaveTextChildren || textContent.trim() === "") {
|
|
1928
1928
|
return;
|
|
1929
1929
|
}
|
|
1930
|
+
const parentName = this._parsedProps?.name;
|
|
1931
|
+
const parentDescriptor = parentName ? `<${this.componentName} name="${parentName}">` : `<${this.componentName}>`;
|
|
1932
|
+
const isNaNValuedText = /^NaN/.test(textContent.trim());
|
|
1933
|
+
const nanHint = isNaNValuedText ? ` This looks like a numeric expression that evaluated to NaN (e.g. \`\${value}${textContent.trim().replace(
|
|
1934
|
+
/^NaN/,
|
|
1935
|
+
""
|
|
1936
|
+
)}\` where \`value\` is NaN) \u2014 check the computation that produces this value.` : "";
|
|
1930
1937
|
throw new Error(
|
|
1931
|
-
`Invalid JSX Element:
|
|
1938
|
+
`Invalid JSX Element: ${parentDescriptor} received stray text "${textContent}" as a child, but it cannot hold text children. Remove the text or wrap it in an appropriate component.${nanHint}`
|
|
1932
1939
|
);
|
|
1933
1940
|
}
|
|
1934
1941
|
if (Object.keys(component).length === 0) {
|
|
@@ -22557,7 +22564,7 @@ function Group_getRoutingPhasePlans(group) {
|
|
|
22557
22564
|
var package_default = {
|
|
22558
22565
|
name: "@tscircuit/core",
|
|
22559
22566
|
type: "module",
|
|
22560
|
-
version: "0.0.
|
|
22567
|
+
version: "0.0.1439",
|
|
22561
22568
|
types: "dist/index.d.ts",
|
|
22562
22569
|
main: "dist/index.js",
|
|
22563
22570
|
module: "dist/index.js",
|