Skip to content

Commit 1bdcf26

Browse files
committed
style: destructure attr to improve code readability (eslint: prefer-destructuring)
1 parent a76bc28 commit 1bdcf26

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/templateCompilerModules/assetUrl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function rewrite(
6565
transformAssetUrlsOption?: TransformAssetUrlsOptions
6666
) {
6767
if (attr.name === name) {
68-
const value = attr.value
68+
const { value } = attr
6969
// only transform static URLs
7070
if (value.charAt(0) === '"' && value.charAt(value.length - 1) === '"') {
7171
attr.value = urlToRequire(value.slice(1, -1), transformAssetUrlsOption)

lib/templateCompilerModules/srcset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function transform(
2727
node.attrs.forEach(attr => {
2828
if (attr.name === 'srcset') {
2929
// same logic as in transform-require.js
30-
const value = attr.value
30+
const { value } = attr
3131
const isStatic =
3232
value.charAt(0) === '"' && value.charAt(value.length - 1) === '"'
3333
if (!isStatic) {

0 commit comments

Comments
 (0)