Skip to content

fix: quoted properties of ObjectExpression not in exports proxy#94

Merged
antfu merged 3 commits intounjs:mainfrom
AriPerkkio:main
Nov 11, 2023
Merged

fix: quoted properties of ObjectExpression not in exports proxy#94
antfu merged 3 commits intounjs:mainfrom
AriPerkkio:main

Conversation

@AriPerkkio
Copy link
Contributor

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

When traversing the c of following:

export default {
  foo: {
    "c": { key: 5 },
    'd': { key: 6 },
  }
}

return (prop.value as any).value;

> prop.value.value
undefined

> prop.value
Node {
  type: 'ObjectExpression',
  start: 35,
  end: 45,
  loc: SourceLocation { ... },
  properties: [
    Node {
      type: 'ObjectProperty',
      start: 37,
      end: 43,
      loc: [SourceLocation],
      method: false,
      key: [Node],
      computed: false,
      shorthand: false,
      value: [Node]
    }
  ]
}

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codecov
Copy link

codecov bot commented Nov 10, 2023

Codecov Report

Merging #94 (16457e1) into main (32be90e) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 16457e1 differs from pull request most recent head da554fb. Consider uploading reports for the commit da554fb to get more accurate results

@@           Coverage Diff           @@
##             main      #94   +/-   ##
=======================================
  Coverage   93.53%   93.53%           
=======================================
  Files          23       23           
  Lines        1749     1749           
  Branches      327      328    +1     
=======================================
  Hits         1636     1636           
  Misses        113      113           
Files Coverage Δ
src/proxy/object.ts 95.45% <100.00%> (ø)

Co-authored-by: Alexander Lichter <github@lichter.io>
@antfu antfu merged commit 46c950d into unjs:main Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parseModule does not include object properties with quotes in their names

3 participants