From ef74c72bc8b3b3e3fa7f6e1d5ccc0e2f1ebe0a24 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sun, 21 Nov 2010 20:35:44 -0800 Subject: [PATCH] minor fixes --- lib/array-ext.js | 2 +- lib/date-ext.js | 2 +- lib/file-ext.js | 13 ++++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/array-ext.js b/lib/array-ext.js index 669161e..75312e6 100644 --- a/lib/array-ext.js +++ b/lib/array-ext.js @@ -62,7 +62,7 @@ var ArrayExt = exports.ArrayExt = { // pack // partition - , pluck: function(a, /* key paths, ... */) { + , pluck: function(a /* , key paths, ... */) { var args = [].slice.call(arguments, 1); args.unshift(a); return pluck.apply(null, args); diff --git a/lib/date-ext.js b/lib/date-ext.js index da0a7ec..472128c 100644 --- a/lib/date-ext.js +++ b/lib/date-ext.js @@ -87,7 +87,7 @@ var DateExt = { }, shortMonth: function(d) { return MonthsShort(d.getMonth()); - } + }, weekday: function(d) { return Weekdays(d.getDay()); }, diff --git a/lib/file-ext.js b/lib/file-ext.js index d575fa6..dbda660 100644 --- a/lib/file-ext.js +++ b/lib/file-ext.js @@ -1,11 +1,18 @@ -var constants = require('constants') - , fs = require('fs') +var fs = require('fs') , ArrayExt = require('./array-ext').ArrayExt , LineEmitter = require('./line-emitter').LineEmitter , ext = require('./ext') - , ENOENT = constants.ENOENT + , constants + , ENOENT ; +try { + constants = require('constants') +} catch (e) { + constants = process +} +ENOENT = constants.ENOENT + exports.extend = function(obj) { ext.extend(obj || fs, FileExt); }