diff --git a/.npmrc b/.npmrc index 43c97e7..9951b11 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,2 @@ package-lock=false +ignore-scripts=true diff --git a/lib/handlers/element.js b/lib/handlers/element.js index b2bfc2c..f0718a2 100644 --- a/lib/handlers/element.js +++ b/lib/handlers/element.js @@ -14,12 +14,8 @@ import { start as identifierStart, cont as identifierCont } from 'estree-util-is-identifier-name' -// @ts-expect-error: `style-to-object` doesn’t support actual ESM + TS correctly. import styleToObject from 'style-to-object' -/** @type {(value: string, iterator?: (property: string, value: string, declaration: unknown) => void) => Record} */ -const style = styleToObject - const own = {}.hasOwnProperty /** @@ -185,7 +181,7 @@ function parseStyle(value, tagName) { const result = {} try { - style(value, iterator) + styleToObject(value, iterator) } catch (error) { const exception = /** @type {Error} */ (error) exception.message = diff --git a/package.json b/package.json index 74c3e5e..311455c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hast-util-to-estree", - "version": "2.2.0", + "version": "2.2.1", "description": "hast utility to transform to estree (JavaScript AST) JSX", "license": "MIT", "keywords": [ @@ -52,7 +52,7 @@ "mdast-util-mdxjs-esm": "^1.0.0", "property-information": "^6.0.0", "space-separated-tokens": "^2.0.0", - "style-to-object": "^0.4.0", + "style-to-object": "^0.4.1", "unist-util-position": "^4.0.0", "zwitch": "^2.0.0" }, diff --git a/readme.md b/readme.md index 8d528ec..69101dc 100644 --- a/readme.md +++ b/readme.md @@ -191,7 +191,7 @@ calls, and then serialize with whatever (`astring`, `escodegen`). Default handlers for elements (`Record`). -Each key is an element name, each value is a [`Handle`][handle]. +Each key is a node type, each value is a [`Handle`][handle]. ### `Handle`