From e96db8e5707dd073d4dde125076e0a8d0f21d7b1 Mon Sep 17 00:00:00 2001 From: vseventer Date: Mon, 18 Jan 2016 09:57:58 +1100 Subject: [PATCH] RE #2: Add support for Node.js 4.x, update copyright and dependencies. --- CHANGELOG.md | 5 +++++ LICENSE.txt | 2 +- README.md | 2 +- index.js | 2 +- lib/filter.js | 9 +++++++-- package.json | 16 ++++++++-------- test/filter.test.js | 2 +- 7 files changed, 24 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80e4137..e926c5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.1.4 (January 18, 2016) +* Bugfix: add support for Node.js 4.x. +* Updated copyright to `2016`. +* Updated dependencies. + ## 0.1.3 (July 31, 2015) * Bugfix: uncss now ignores external stylesheets. diff --git a/LICENSE.txt b/LICENSE.txt index 46855ff..da47e6d 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Mark van Seventer +Copyright (c) 2016 Mark van Seventer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 0e5a228..542f932 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ See the [Changelog](./CHANGELOG.md) for a list of changes. ## License The MIT License (MIT) - Copyright (c) 2015 Mark van Seventer + Copyright (c) 2016 Mark van Seventer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/index.js b/index.js index e4a4095..2aae577 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ /** * The MIT License (MIT) * - * Copyright (c) 2015 Mark van Seventer + * Copyright (c) 2016 Mark van Seventer * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/lib/filter.js b/lib/filter.js index 3f6e7f4..e7df622 100644 --- a/lib/filter.js +++ b/lib/filter.js @@ -1,7 +1,7 @@ /** * The MIT License (MIT) * - * Copyright (c) 2015 Mark van Seventer + * Copyright (c) 2016 Mark van Seventer * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -63,7 +63,12 @@ module.exports = function(str, locals) { // Retrieve raw HTML from HTML files. var promise = Promise.map(routes, function(path) { var stream = route.get(path); - return streamToArrayAsync(stream).then(Buffer.concat); + return streamToArrayAsync(stream).then(function(arr) { + var buffers = arr.map(function(el) { + return el instanceof Buffer ? el : new Buffer(el); + }); + return Buffer.concat(buffers).toString(); + }); }); // UnCSS the raw HTML with the CSS provided. diff --git a/package.json b/package.json index fde2b96..dac0dcf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "hexo-uncss", - "version" : "0.1.3", + "version" : "0.1.4", "description" : "uncss plugin for Hexo.", "keywords" : [ "hexo", "hexo-plugin", "hexo-filter", "uncss", "css", "html" ], "homepage" : "https://github.com/vseventer/hexo-uncss", @@ -14,17 +14,17 @@ "test" : "./node_modules/.bin/mocha test/" }, "dependencies": { - "bluebird" : "2.9.x", + "bluebird" : "3.1.x", "debug" : "2.2.x", - "minimatch" : "2.0.x", - "object-assign" : "3.0.x", - "stream-to-array" : "2.0.x", + "minimatch" : "3.0.x", + "object-assign" : "4.0.x", + "stream-to-array" : "2.2.x", "uncss" : "0.12.x" }, "devDependencies": { - "jshint" : "2.8.x", - "jshint-stylish" : "2.0.x", - "mocha" : "2.2.x" + "jshint" : "2.9.x", + "jshint-stylish" : "2.1.x", + "mocha" : "2.3.x" }, "engines": { "node" : ">=0.10.x" } } \ No newline at end of file diff --git a/test/filter.test.js b/test/filter.test.js index a2f1c62..e7fb12e 100644 --- a/test/filter.test.js +++ b/test/filter.test.js @@ -1,7 +1,7 @@ /** * The MIT License (MIT) * - * Copyright (c) 2015 Mark van Seventer + * Copyright (c) 2016 Mark van Seventer * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal