Skip to content

Finalize string vs array glob paths #3

Description

@richrdkng

When storing and returning named glob paths, finalize the stored/returned form of glob paths.

Suggested Features:

- 1.:
Add the built-in behavior of automatic string/array determination, so when there is only 1 glob path under a given name, the glob path will be a string. Otherwise, when adding glob paths to that given name or remove from its glob paths, when there is more, than 1 glob paths, store and handle the glob paths as arrays.

Important: Finalize this behavior module-wise, meaning, when a particular stored glob path is an array, when returning it from functions, if it is stored as an array, return it too as an array.

Also extend the tests to test this behavior.

- 2.:
Add the ability to be able to define custom behavior, meaning, that the user be able to define, what glob path storage/return behavior should be used, e.g.:

Paths.setGlobBehavior(Paths.HANDLE_GLOB_AS_STRING);

// OR

Paths.setGlobBehavior(Paths.HANDLE_GLOB_AS_ARRAY);

// OR

Paths.setGlobBehavior(Paths.HANDLE_GLOB_DYNAMICALLY);

Note: When glob handling is strictly set to HANDLE_GLOB_AS_STRING, throw error, when, by functionality, glob paths must be extended to arrays (e.g.: when appending to glob paths).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions