From b09e9c378f00301d3d612e508145fee656f6faea Mon Sep 17 00:00:00 2001 From: Adam Stephan-Slade Date: Wed, 23 Oct 2024 20:21:29 +1000 Subject: [PATCH 1/3] Use Array.isArray instead of util.isArray in flash.js --- lib/flash.js | 3 +-- package-lock.json | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 package-lock.json diff --git a/lib/flash.js b/lib/flash.js index a278bc1..3870866 100644 --- a/lib/flash.js +++ b/lib/flash.js @@ -2,7 +2,6 @@ * Module dependencies. */ var format = require('util').format; -var isArray = require('util').isArray; /** @@ -64,7 +63,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); }); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..688465f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,49 @@ +{ + "name": "connect-flash", + "version": "0.1.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "connect-flash", + "version": "0.1.1", + "devDependencies": { + "vows": "0.6.x" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/diff": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/diff/-/diff-1.0.8.tgz", + "integrity": "sha512-1zEb73vemXFpUmfh3fsta4YHz3lwebxXvaWmPbFv9apujQBWDnkrPDLXLQs1gZo4RCWMDsT89r0Pf/z8/02TGA==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==", + "dev": true, + "engines": { + "node": "> 0.1.90" + } + }, + "node_modules/vows": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/vows/-/vows-0.6.4.tgz", + "integrity": "sha512-CnnxhTuz08RHlAEagUSH6806IMxlOvYK5Nz5CyRGaqk9m2qVsP/0vtNBtU9rUS0TTrx3JYmPtHwIELaf+91t0Q==", + "dev": true, + "dependencies": { + "diff": "~1.0.3", + "eyes": ">=0.1.6" + }, + "bin": { + "vows": "bin/vows" + } + } + } +} From 092e534a759fe2678a6e51bd38acbe642730b96f Mon Sep 17 00:00:00 2001 From: Adam Stephan-Slade Date: Wed, 23 Oct 2024 20:25:09 +1000 Subject: [PATCH 2/3] Update dependencies: diff and vows --- package-lock.json | 148 ++++++++++++++++++++++++++++++++++++++++++---- package.json | 24 +++++--- 2 files changed, 155 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 688465f..92cfa21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,18 +7,46 @@ "": { "name": "connect-flash", "version": "0.1.1", + "dependencies": { + "diff": "^7.0.0" + }, "devDependencies": { - "vows": "0.6.x" + "vows": "^0.8.3" }, "engines": { "node": ">= 0.4.0" } }, - "node_modules/diff": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/diff/-/diff-1.0.8.tgz", - "integrity": "sha512-1zEb73vemXFpUmfh3fsta4YHz3lwebxXvaWmPbFv9apujQBWDnkrPDLXLQs1gZo4RCWMDsT89r0Pf/z8/02TGA==", + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true, + "license": "MIT" + }, + "node_modules/diff": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } @@ -32,18 +60,118 @@ "node": "> 0.1.90" } }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/vows": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/vows/-/vows-0.6.4.tgz", - "integrity": "sha512-CnnxhTuz08RHlAEagUSH6806IMxlOvYK5Nz5CyRGaqk9m2qVsP/0vtNBtU9rUS0TTrx3JYmPtHwIELaf+91t0Q==", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/vows/-/vows-0.8.3.tgz", + "integrity": "sha512-PVIxa/ovXhrw5gA3mz6M+ZF3PHlqX4tutR2p/y9NWPAaFVKcWBE8b2ktfr0opQM/qFmcOVWKjSCJVjnYOvjXhw==", "dev": true, + "license": "MIT", "dependencies": { - "diff": "~1.0.3", - "eyes": ">=0.1.6" + "diff": "^4.0.1", + "eyes": "~0.1.6", + "glob": "^7.1.2" }, "bin": { "vows": "bin/vows" } + }, + "node_modules/vows/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" } } } diff --git a/package.json b/package.json index bc46300..050f71a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,12 @@ "name": "connect-flash", "version": "0.1.1", "description": "Flash message middleware for Connect.", - "keywords": ["connect", "express", "flash", "messages"], + "keywords": [ + "connect", + "express", + "flash", + "messages" + ], "repository": { "type": "git", "url": "git://github.com/jaredhanson/connect-flash.git" @@ -15,18 +20,23 @@ "email": "jaredhanson@gmail.com", "url": "http://www.jaredhanson.net/" }, - "licenses": [ { - "type": "MIT", - "url": "http://www.opensource.org/licenses/MIT" - } ], + "licenses": [ + { + "type": "MIT", + "url": "http://www.opensource.org/licenses/MIT" + } + ], "main": "./lib", "dependencies": { + "diff": "^7.0.0" }, "devDependencies": { - "vows": "0.6.x" + "vows": "^0.8.3" }, "scripts": { "test": "NODE_PATH=lib node_modules/.bin/vows test/*-test.js" }, - "engines": { "node": ">= 0.4.0" } + "engines": { + "node": ">= 0.4.0" + } } From 20576ee042779cf91ee6f981dae4b756ed4de9e5 Mon Sep 17 00:00:00 2001 From: Adam Stephan-Slade Date: Wed, 23 Oct 2024 21:01:33 +1000 Subject: [PATCH 3/3] removed diff package as not required --- package-lock.json | 12 ------------ package.json | 3 --- 2 files changed, 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 92cfa21..db5a831 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,9 +7,6 @@ "": { "name": "connect-flash", "version": "0.1.1", - "dependencies": { - "diff": "^7.0.0" - }, "devDependencies": { "vows": "^0.8.3" }, @@ -42,15 +39,6 @@ "dev": true, "license": "MIT" }, - "node_modules/diff": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", - "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/eyes": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", diff --git a/package.json b/package.json index 050f71a..aa9d306 100644 --- a/package.json +++ b/package.json @@ -27,9 +27,6 @@ } ], "main": "./lib", - "dependencies": { - "diff": "^7.0.0" - }, "devDependencies": { "vows": "^0.8.3" },