[Pkg-javascript-commits] [sockjs-client] 109/434: Helper to count a size of object.
Tonnerre Lombard
tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:07 UTC 2014
This is an automated email from the git hooks/post-receive script.
tonnerre-guest pushed a commit to branch master
in repository sockjs-client.
commit 4e441002dd74feb9f8a9498a42b8c9c6eab78aa1
Author: Marek Majkowski <majek04 at gmail.com>
Date: Thu Sep 1 17:17:51 2011 +0100
Helper to count a size of object.
---
lib/utils.js | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/lib/utils.js b/lib/utils.js
index 232aae4..e4cdafe 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -66,6 +66,16 @@ utils.objectExtend = function(dst, src) {
return dst;
};
+utils.objectLength = function(obj) {
+ var i = 0;
+ for(var k in obj) {
+ if (obj.hasOwnProperty(k)) {
+ i += 1;
+ }
+ }
+ return i;
+};
+
// Try to clear some headers, in order to save bandwidth. For
// reference see:
// http://blog.mibbit.com/?p=143
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git
More information about the Pkg-javascript-commits
mailing list