jaredhanson / jaredhanson/connect-flash
util.isArray is deprecated, use Array.isArray instead
- Dominant language
- JavaScript
- Stars
- 1.2k
- Forks
- 173
- PR merge metrics
- No merged PRs in 30d
Description
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used [patch-package](https://github.com/ds300/patch-package) to patch `connect-flash@0.1.1` for the project I'm working on.
Here is the diff that solved my problem:
```diff
diff --git a/node_modules/connect-flash/lib/flash.js b/node_modules/connect-flash/lib/flash.js
index a278bc1..570c327 100644
--- a/node_modules/connect-flash/lib/flash.js
+++ b/node_modules/connect-flash/lib/flash.js
@@ -64,7 +64,7 @@ function _flash(type, msg) {
if (arguments.length > 2 && format) {
var args = Array.prototype.slice.call(arguments, 1);
msg = format.apply(undefined, args);
- } else if (isArray(msg)) {
+ } else if (Array.isArray(msg)) {
msg.forEach(function(val){
(msgs[type] = msgs[type] || []).push(val);
});
```
This issue body was [partially generated by patch-package](https://github.com/ds300/patch-package/issues/296).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in lib/flash.js at the _flash function and review the isArray check shown in the issue. Replace the deprecated check with Array.isArray, then run the project's existing tests to confirm flash messages still handle arrays correctly and no deprecated call remains.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100