Comparing version 0.0.15 to 0.0.17
@@ -205,3 +205,3 @@ /* | ||
@return {String} The `dt` formated with the given `format` | ||
@description Formats the given date with the strftime format | ||
@description Formats the given date with the strftime formated | ||
@param {Date} dt the date object to format | ||
@@ -246,3 +246,3 @@ @param {String} format the format to convert the date to | ||
@description Find the century for the given `year` | ||
@param {String} year The year to find the century for | ||
@param {Number} year The year to find the century for | ||
*/ | ||
@@ -340,3 +340,3 @@ this.calcCentury = function (year) { | ||
@param {String} hour The hour to convert | ||
@param {Boolean} If hour is PM then this should be true | ||
@param {Boolean} pm hour is PM then this should be true | ||
*/ | ||
@@ -384,3 +384,3 @@ this.hrStd2Mil = function (hour, pm) { | ||
@description Add to a Date in intervals of different size, from | ||
milliseconds to years | ||
milliseconds to years | ||
@param {Date} dt Date (or timestamp Number), date to increment | ||
@@ -491,3 +491,3 @@ @param {String} interv a constant representing the interval, | ||
@description Get the difference in a specific unit of time (e.g., number | ||
of months, weeks, days, etc.) between two dates. | ||
of months, weeks, days, etc.) between two dates. | ||
@param {Date} date1 First date to check | ||
@@ -657,3 +657,3 @@ @param {Date} date2 Date to compate `date1` with | ||
@description Convert various sorts of strings to JavaScript | ||
Date objects | ||
Date objects | ||
@param {String} val The string to convert to a Date | ||
@@ -660,0 +660,0 @@ */ |
@@ -63,3 +63,3 @@ /* | ||
@description Emit an event by name and arguments or add it to the buffer if | ||
no outlet is set | ||
no outlet is set | ||
@param {String} name The name to use for the event | ||
@@ -97,3 +97,3 @@ @param {Array} args An array of arguments to emit | ||
@description Flush the buffer and continue piping new events to the outlet | ||
@param {Object} outlet The emitter to send events too | ||
@param {Object} outlet The emitter to send events to | ||
*/ | ||
@@ -100,0 +100,0 @@ this.sync = function (outlet) { |
@@ -63,4 +63,6 @@ var util = require('util') | ||
} | ||
// Also handle 'access', not an actual level | ||
log.access = log.info; | ||
})(); | ||
module.exports = log; |
@@ -52,2 +52,3 @@ /* | ||
@param {String} [opts.dataType] The type of data to send | ||
@param {Function} callback the function to call after, args are `error, data` | ||
*/ | ||
@@ -54,0 +55,0 @@ var request = function (opts, callback) { |
@@ -111,3 +111,3 @@ /* | ||
@description Escapes regex control-characters in strings | ||
used to build regexes dynamically | ||
used to build regexes dynamically | ||
@param {String} string The string of chars to escape | ||
@@ -223,4 +223,4 @@ */ | ||
@description Returns a new String with the last character removed. If the | ||
string ends with \r\n, both characters are removed. Applying chop to an | ||
empty string returns an empty string. | ||
string ends with \r\n, both characters are removed. Applying chop to an | ||
empty string returns an empty string. | ||
@param {String} string to return with the last character removed. | ||
@@ -227,0 +227,0 @@ */ |
@@ -40,3 +40,3 @@ /* | ||
@return {String} Returns the file extension for a given path | ||
@description Gets the file extension fir a path and returns it | ||
@description Gets the file extension for a path and returns it | ||
@param {String} path The path to get the extension for | ||
@@ -43,0 +43,0 @@ */ |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "0.0.15", | ||
"version": "0.0.17", | ||
"author": "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)", | ||
@@ -13,0 +13,0 @@ "main": "./lib/index.js", |
@@ -241,5 +241,42 @@ /* | ||
// We could test truncate and truncateHTML here, but helper tests already | ||
// include tests for them | ||
, 'test single tags in truncateHTML': function () { | ||
var str = string.truncateHTML('<p>Once upon a time in a world</p>', { length: 10 }); | ||
assert.equal(str, '<p>Once up...</p>'); | ||
} | ||
, 'test multiple tags in truncateHTML': function () { | ||
var str = string.truncateHTML('<p>Once upon a time <small>in a world</small></p>', { length: 10 }); | ||
assert.equal(str, '<p>Once up...<small>in a wo...</small></p>'); | ||
} | ||
, 'test multiple tags but only truncate once in truncateHTML': function () { | ||
var str = string.truncateHTML('<p>Once upon a time <small>in a world</small></p>', { length: 10, once: true }); | ||
assert.equal(str, '<p>Once up...<small>in a world</small></p>'); | ||
} | ||
, 'test standard truncate': function () { | ||
var str = string.truncate('Once upon a time in a world', { length: 10 }); | ||
assert.equal(str, 'Once up...'); | ||
} | ||
, 'test custom omission in truncate': function () { | ||
var str = string.truncate('Once upon a time in a world', { length: 10, omission: '///' }); | ||
assert.equal(str, 'Once up///'); | ||
} | ||
, 'test regex seperator in truncate': function () { | ||
var str = string.truncate('Once upon a time in a world', { length: 15, seperator: /\s/ }); | ||
assert.equal(str, 'Once upon a...'); | ||
} | ||
, 'test string seperator in truncate': function () { | ||
var str = string.truncate('Once upon a time in a world', { length: 15, seperator: ' ' }); | ||
assert.equal(str, 'Once upon a...'); | ||
} | ||
, 'test unsafe html in truncate': function () { | ||
var str = string.truncate('<p>Once upon a time in a world</p>', { length: 20 }); | ||
assert.equal(str, '<p>Once upon a ti...'); | ||
} | ||
, 'test nl2br for string': function () { | ||
@@ -246,0 +283,0 @@ var data = string.nl2br("geddy\n") |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
181423
5551