yar icon indicating copy to clipboard operation
yar copied to clipboard

Add a new method called pop()

Open igorissen opened this issue 5 months ago • 1 comments

Runtime

nodejs

Runtime version

20.10.0

Module version

11.0.1

Used with

hapi

Any other relevant information

No response

What problem are you trying to solve?

Currently, my colleagues and I are using your plugin on this project Pix, and we've noticed that the use of the method get() isn't clear, especially when someone unfamiliar with the plugin sees this line request.yar.get('key', true);.

It's not clear what the value true means. For that we need to go to the documentation page. It will be great to use something like pop('key').

We think that as JavaScript developers we will somehow see more frequently this method pop used with arrays.

Do you have a new or modified API suggestion to solve the problem?

This method pop() will have an argument which is the key and will removes the key if it is available in the store. If the key does not exist, it will return null as value.

I have created a PR #167

igorissen avatar Feb 01 '24 17:02 igorissen