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

Use JSON instead of multidimensional array in AddIPMMappedNamespaces #580

Open
isc-shuliu opened this issue Oct 7, 2024 · 0 comments
Open
Assignees

Comments

@isc-shuliu
Copy link
Collaborator

isc-shuliu commented Oct 7, 2024

This seems like a good use of a JSON object instead of a subscripted array. Seems overly complex and harder to follow the logic with the subscripted array.
My general rule of thumb is to use a subscripted array mostly when I need de-duplication so like a set.
For a dynamic object, can look like the following (also document why ns and width are needed):

{
  ns: "*",
  width: 4,
  namespaces: {
    "USER": [
       "zpm": { "version": "0.9.0-SNAPSHOT", description: "Package Management System", devMode: 1 },
       "zpm-registy": { "version": "1.3.2", description: "ZPM Registry", devMode: 0 }
    ]
  }

Originally posted by @isc-kiyer in #485 (comment)

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

No branches or pull requests

1 participant