Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Nov 11, 2023

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.

src/proxy/object.ts Outdated Show resolved Hide resolved
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 <[email protected]>
@antfu antfu merged commit 46c950d into unjs:main Nov 11, 2023
1 check passed
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