Skip to content

Commit

Permalink
Merge 361bdd7 into 5790e5e
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Nov 22, 2021
2 parents 5790e5e + 361bdd7 commit 587a778
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 44 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/ci.yml
Expand Up @@ -10,7 +10,6 @@ jobs:
strategy:
matrix:
name:
- Node.js 0.8
- Node.js 0.10
- Node.js 4.x
- Node.js 6.x
Expand All @@ -21,11 +20,6 @@ jobs:
- Node.js 16.x

include:
- name: Node.js 0.8
node-version: "0.8"
npm-i: mocha@2.5.3 supertest@1.1.0
npm-rm: nyc

- name: Node.js 0.10
node-version: "0.10"
npm-i: mocha@3.5.3 supertest@2.0.0
Expand Down Expand Up @@ -65,14 +59,6 @@ jobs:
shell: bash -eo pipefail -l {0}
run: |
nvm install --default ${{ matrix.node-version }}
if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then
nvm install --alias=npm 0.10
npm install -g npm@1.2.8000
NPM=$(which npm)
nvm use ${{ matrix.node-version }}
ln -fs "$NPM" "$(which npm)"
sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")"
fi
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
- name: Configure npm
Expand Down
7 changes: 7 additions & 0 deletions HISTORY.md
@@ -1,3 +1,10 @@
5.x
===

* Drop support for Express.js 2.x
* Drop support for Node.js 0.8
* Use `uid-safe` for async helpers tracking

4.2.0 / 2021-11-16
==================

Expand Down
15 changes: 3 additions & 12 deletions lib/async.js
@@ -1,5 +1,7 @@
/// provides the async helper functionality

var uid = require('uid-safe')

function Waiter() {
if (!(this instanceof Waiter)) {
return new Waiter();
Expand Down Expand Up @@ -51,17 +53,6 @@ Waiter.prototype.done = function(fn) {
}
};

var alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_';

var gen_id = function() {
var res = '';
for (var i=0 ; i<8 ; ++i) {
res += alphabet[Math.floor(Math.random() * alphabet.length)];
}

return res;
};

module.exports = function() {
// baton which contains the current
// set of deferreds
Expand All @@ -86,7 +77,7 @@ module.exports = function() {
waiter = new Waiter();
}

var id = '__' + gen_id() + '__';
var id = '__' + uid.sync(10) + '__'

var cur_waiter = waiter;
waiter.wait();
Expand Down
16 changes: 0 additions & 16 deletions lib/hbs.js
Expand Up @@ -207,22 +207,6 @@ function middleware(filename, options, cb) {
tryReadFileAndCache(layout_filename);
}

// express 2.x template engine compliance
Instance.prototype.compile = function (str) {
if (typeof str !== 'string') {
return str;
}

var template = this.handlebars.compile(str);
return function (locals) {
return template(locals, {
helpers: locals.blockHelpers,
partials: null,
data: null
});
};
};

Instance.prototype.registerHelper = function () {
this.handlebars.registerHelper.apply(this.handlebars, arguments);
};
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -11,6 +11,7 @@
"main": "lib/hbs.js",
"dependencies": {
"handlebars": "4.7.7",
"uid-safe": "2.1.5",
"walk": "2.3.15"
},
"devDependencies": {
Expand All @@ -28,8 +29,7 @@
"README.md"
],
"engines": {
"node": ">= 0.8",
"npm": "1.2.8000 || >= 1.4.16"
"node": ">= 0.10"
},
"scripts": {
"lint": "eslint .",
Expand Down

0 comments on commit 587a778

Please sign in to comment.