Skip to content

Commit

Permalink
Update style-to-object
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jan 17, 2023
1 parent 168f0dd commit b4b5405
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,10 @@
import {stringify as commas} from 'comma-separated-tokens'
import {html, svg, find, hastToReact} from 'property-information'
import {stringify as spaces} from 'space-separated-tokens'
// @ts-expect-error: typed incorrectly
import styleToObject from 'style-to-object'
import {pointStart} from 'unist-util-position'
import {VFileMessage} from 'vfile-message'

/** @type {(value: string, replacer: ((key: string, value: string) => void)) => void} */
const style = styleToObject

const own = {}.hasOwnProperty

/**
Expand Down Expand Up @@ -459,7 +455,7 @@ function parseStyle(state, node, value) {
const result = {}

try {
style(value, replacer)
styleToObject(value, replacer)
} catch (error_) {
const error = /** @type {Error} */ (error_)
const cleanMessage = error.message.replace(/^undefined:\d+:\d+: /, '')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"comma-separated-tokens": "^2.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",

This comment has been minimized.

Copy link
@remcohaszing

remcohaszing Jan 17, 2023

Member

Is there any particular reason to not use the wider version range?

This comment has been minimized.

Copy link
@wooorm

wooorm Jan 17, 2023

Author Member

not strongly but wanted to force this change through

This comment has been minimized.

Copy link
@remcohaszing

remcohaszing Jan 17, 2023

Member

It’s good that it fixes a type error, but it’s just an internal change. IMO this dependency update and a release were redundant. (Reverting it would be equally redundant.)

This comment has been minimized.

Copy link
@wooorm

wooorm Jan 17, 2023

Author Member

Yes, probably

"unist-util-position": "^4.0.0",
"vfile-message": "^3.0.0"
},
Expand Down

0 comments on commit b4b5405

Please sign in to comment.