jaredhanson / jaredhanson/connect-flash
isArray() deprecation
- 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 with lib/flash.js and inspect the _flash function around the isArray check shown in the issue diff. Confirm the project’s tests or validation commands, then ensure the deprecated check is replaced and the existing array-message behavior remains unchanged.
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
- 55/100