Skip to content

Replace deprecated util.isArray() with Array.isArray() - #76

Open
sidharthcodes-arch wants to merge 3 commits into
jaredhanson:masterfrom
sidharthcodes-arch:master
Open

Replace deprecated util.isArray() with Array.isArray()#76
sidharthcodes-arch wants to merge 3 commits into
jaredhanson:masterfrom
sidharthcodes-arch:master

Conversation

@sidharthcodes-arch

Copy link
Copy Markdown

This pull request fixes a Node.js deprecation warning caused by the use of util.isArray() in lib/flash.js.

Changes made:

  • Removed var isArray = require('util').isArray;
  • Replaced all instances of isArray(msg) with Array.isArray(msg)

Reason for change:
Node.js has deprecated util.isArray(). Using Array.isArray() is the recommended modern approach and removes the warning when using connect-flash in current Node.js versions.

Testing:

  • Tested locally by replacing connect-flash in a sample project with this patched version.
  • Verified that all flash functionalities work as expected.
  • No deprecation warnings appear.

This patch is backward-compatible and does not affect existing API behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant