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

Support depth for getKeys() #539

Open
1 task
melasculla opened this issue Dec 25, 2024 · 2 comments
Open
1 task

Support depth for getKeys() #539

melasculla opened this issue Dec 25, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@melasculla
Copy link

melasculla commented Dec 25, 2024

Describe the feature

hello there, im using unStorage to store images and files in filesystem im making it dynamic so can store files in different folders, but when i tried to get keys inside folder that have sub folders i got all items in sub folders too, i guess its expected behavior but would be great to have option to disable this behavior and get only current folder items

e.g.

// incudeSubFolders: true
[
    "current.webp",
    "current.webp",
    "test:4.webp",
    "test:5.webp",
    "hello:world:1.webp",
    "hello:world:2.webp",
    "hello:world:3.webp"
]
// incudeSubFolders: false
[
    "current.webp",
    "current.webp"
]

does that make sense? cause for now i need to filter keys and exclude all that have :
Thanks!

Additional information

  • Would you be willing to help implement this feature?
@melasculla melasculla added the enhancement New feature or request label Dec 25, 2024
@pi0 pi0 changed the title Add option for getKeys() to return only child items Support depth for getKeys() Dec 25, 2024
@pi0
Copy link
Member

pi0 commented Dec 25, 2024

Nice suggestion. I have updated title to make it little more generic we can support getKeys(base, { depth: 1 }) for same effect.

@melasculla
Copy link
Author

Thank you so much! cant wait for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants