Skip to content

Conversation

@rubixvi
Copy link
Contributor

@rubixvi rubixvi commented Sep 30, 2025

What?

  • Implemented a new utility function getPath for safe access to nested object properties.
  • Replaced dependency on lodash.get in the Stripe plugin with this internal helper.
  • Supports:
    • Dot notation ('a.b.c')
    • Bracket notation ('a[0].b', 'a["key.with.dots"]')
    • Array paths (['a', 'b', 0, 'c'])
  • Returns a default value if the path cannot be resolved or if the resolved value is undefined.

Why?

  • Reduce dependency on external libraries (lodash.get).
  • Improve maintainability and control of utility logic.
  • Ensure consistency and reduce bundle size by using an internal implementation.

How?

  • Added getPath helper with regex-based path parsing.
  • Updated stripe-plugin to use getPath for method resolution and binding instead of lodash.get.

- Implemented a new utility function `getPath` that allows for safe access to nested object properties using dot and bracket notation.
- Supports both string and array representations of paths.
- Returns a default value if the specified path is not resolvable or if the resolved value is `undefined`.
@rubixvi rubixvi changed the title chore(stripe-plugin): replace lodash.get with internal getPath helper chore(plugin-stripe): replace lodash.get with internal getPath helper Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant