babel-jsx-utils
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -10,6 +10,6 @@ import { JSXAttribute, JSXIdentifier, JSXNamespacedName, JSXOpeningElement } from "@babel/types"; | ||
* @param nodePath The NodePath of the JSX opening element | ||
* @param onError Called with the attribute name if it is present but cannot be resolved | ||
* @param onError Called with the attribute name and path if it is present but cannot be resolved | ||
* @param include If present, only these props are evaluated. Does not apply to spread attributes. | ||
*/ | ||
export declare function getAttributeValues(nodePath: CoreNodePath<JSXOpeningElement> | TraverseNodePath<JSXOpeningElement>, onError?: (attributeName: string) => void, include?: Set<string>): Record<string, unknown>; | ||
export declare function getAttributeValues(nodePath: CoreNodePath<JSXOpeningElement> | TraverseNodePath<JSXOpeningElement>, onError?: (attributeName: string, attributePath?: CoreNodePath<JSXAttribute>) => void, include?: Set<string>): Record<string, unknown>; | ||
/** | ||
@@ -16,0 +16,0 @@ * Attempt to get the value of a JSX attribute. Returns an object with the |
@@ -13,3 +13,3 @@ function parseIdentifier(identifier) { | ||
* @param nodePath The NodePath of the JSX opening element | ||
* @param onError Called with the attribute name if it is present but cannot be resolved | ||
* @param onError Called with the attribute name and path if it is present but cannot be resolved | ||
* @param include If present, only these props are evaluated. Does not apply to spread attributes. | ||
@@ -48,3 +48,3 @@ */ | ||
} else { | ||
onError == null ? void 0 : onError(prop); | ||
onError == null ? void 0 : onError(prop, attrPath); | ||
} | ||
@@ -51,0 +51,0 @@ } |
@@ -13,3 +13,3 @@ function parseIdentifier(identifier) { | ||
* @param nodePath The NodePath of the JSX opening element | ||
* @param onError Called with the attribute name if it is present but cannot be resolved | ||
* @param onError Called with the attribute name and path if it is present but cannot be resolved | ||
* @param include If present, only these props are evaluated. Does not apply to spread attributes. | ||
@@ -48,3 +48,3 @@ */ | ||
} else { | ||
onError == null ? void 0 : onError(prop); | ||
onError == null ? void 0 : onError(prop, attrPath); | ||
} | ||
@@ -51,0 +51,0 @@ } |
@@ -13,3 +13,3 @@ function parseIdentifier(identifier) { | ||
* @param nodePath The NodePath of the JSX opening element | ||
* @param onError Called with the attribute name if it is present but cannot be resolved | ||
* @param onError Called with the attribute name and path if it is present but cannot be resolved | ||
* @param include If present, only these props are evaluated. Does not apply to spread attributes. | ||
@@ -48,3 +48,3 @@ */ | ||
} else { | ||
onError?.(prop); | ||
onError?.(prop, attrPath); | ||
} | ||
@@ -51,0 +51,0 @@ } |
@@ -18,3 +18,3 @@ (function (global, factory) { | ||
* @param nodePath The NodePath of the JSX opening element | ||
* @param onError Called with the attribute name if it is present but cannot be resolved | ||
* @param onError Called with the attribute name and path if it is present but cannot be resolved | ||
* @param include If present, only these props are evaluated. Does not apply to spread attributes. | ||
@@ -53,3 +53,3 @@ */ | ||
} else { | ||
onError == null ? void 0 : onError(prop); | ||
onError == null ? void 0 : onError(prop, attrPath); | ||
} | ||
@@ -56,0 +56,0 @@ } |
{ | ||
"name": "babel-jsx-utils", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Utilities for working with Babel and JSX", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -47,2 +47,15 @@ # babel-jsx-utils | ||
## Installation | ||
Install: | ||
```shell | ||
yarn install babel-jsx-utils | ||
``` | ||
or | ||
```shell | ||
npm install babel-jsx-utils | ||
``` | ||
## Usage | ||
@@ -49,0 +62,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
37703
115
0