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

feat(api): Expand APIs with new customizable options and enhanced functionality #6

Merged
merged 7 commits into from
Apr 26, 2024

Commits on Apr 24, 2024

  1. refactor(types): Refactor and improve the types declaration

    * Declared a new type called `StringPath` represents the path from a string
    * Changed the value of `LsOptionsInterface`'s properties to their constant values instead of their types (number)
    * Refactored the `LsTypesValues` type, ensuring values compatibility with changes of `LsTypesInterface` interface
    * Declared a new type called `ResolvedLsOptions` and an interface called `DefaultLsOptions`
    mitsuki31 committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    c259a7d View commit details
    Browse the repository at this point in the history
  2. feat(lsfnd): Introduce the defaultLsOptions

    This constant object contains all default options for `ls*` functions and it is publicly visible. In addition, refactored some types representation from specific parameters, variables, and even on explicit conversion types to more precise and improve types correctiveness.
    mitsuki31 committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    7ccfa38 View commit details
    Browse the repository at this point in the history
  3. refactor(ls): Enchance the resolution of options parameter

    By defining a new internal function called `resolveOptions` with consume one argument which for the unresoved `options` itself we can definitely improve the `options` parameter resolution to more flexible and use less code. This also make improvisation of type strict to that parameter.
    mitsuki31 committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    17d99bb View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2024

  1. feat(api): Add new several API options

    Here is the list new options that just being added in this change:
      - absolute?: { boolean } - Whether to return absolute paths for all entries.
      - basename? { boolean } - Whether to makes the returned entries only have their file and/or directories names.
      - rootDir?: { StringPath } - A string path represents the root directory to resolve the relative paths.
    
    They all were have their own priority tier, in the list above their priority are sorted from the highest (top) to the lowest (bottom). So, if you specified the `rootDir` but you also enabled the `absolute` option, then -- as a result, -- the `absolute` will be used instead (it is because the `absolute` option have the highest priority) and the `rootDir` value will be ignored.
    
    Please note, that the `basename` option are implicitly includes any directory names while listing a directory. If you want include the filenames only, then combining it with the `lsTypes.LS_F` is a good way if you are using `ls` function, or combine this option with `lsFiles` function for more flexible.
    mitsuki31 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    f578589 View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2024

  1. feat(rootDir): Add file URL support to rootDir option

    Please note, this only supports the URL with 'file:' protocol. Attempting to use other than 'file:' protocol will causing an error.
    mitsuki31 committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    2ba4a20 View commit details
    Browse the repository at this point in the history
  2. docs: Add some TypeDoc documentation

    Added TypeDoc documentation to the `defaultLsOptions` object and the `resolveOptions` (internal) function.
    mitsuki31 committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    968401c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d381781 View commit details
    Browse the repository at this point in the history