Closed lucioerlan closed 9 months ago
Hi! Thanks for the pull request. I find the code good as-is though.
lydell
That's just your opinion and I respect it.
I often use this package in my projects and recently encountered an error while using it. So, I decided to look into how it was made and saw an opportunity to improve it. This was just one of several enhancements I intended to make. Anyway, thank you for responding.
This PR:
Changes:
lines-around-comment
: Introduced an arrayrequiredProperties
and the use of theevery()
method for validation, making the code more concise and easier to update.unicorn/template-indent
: Employed a Set for forbidden elements and a dedicated function for checking, improving performance and readability.Justification:
References: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every