[Pkg-javascript-commits] [node-stream-splicer] 51/71: negative indexes

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:55:52 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-stream-splicer.

commit c94643995c0793cc4383e33785cbe12c086c08f1
Author: James Halliday <mail at substack.net>
Date:   Sat Jun 14 13:18:57 2014 -0700

    negative indexes
---
 index.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/index.js b/index.js
index e59b545..4be5d21 100644
--- a/index.js
+++ b/index.js
@@ -159,7 +159,10 @@ Pipeline.prototype.splice = function (start, removeLen) {
 };
 
 Pipeline.prototype.get = function (index) {
-    return this._streams[index];
+    if (index < 0) {
+        return this._streams[this._streams.length + index];
+    }
+    else return this._streams[index];
 };
 
 Pipeline.prototype.indexOf = function (stream) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-stream-splicer.git



More information about the Pkg-javascript-commits mailing list