get-date-format
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -27,2 +27,5 @@ "use strict"; | ||
exports.default = function (dates, options) { | ||
if (!Array.isArray(dates)) { | ||
throw new Error('Date samples should be type of Array'); | ||
} | ||
var allFormats = options ? (0, _getAllFormats2.default)(options) : allFormatsPrefetched; | ||
@@ -29,0 +32,0 @@ var extractedDateFormat = allFormats.find(function (format) { |
@@ -54,2 +54,6 @@ 'use strict'; | ||
(0, _chai.expect)(result).to.be.null; | ||
}); | ||
test('Should throw if sample of dates is not an array', function () { | ||
(0, _chai.expect)(_getDateFormat2.default.bind(null, 'someString')).to.throw('Date samples should be type of Array'); | ||
}); |
{ | ||
"name": "get-date-format", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Module that tries to get the date format out of sample of dates", | ||
@@ -5,0 +5,0 @@ "main": "./dist/lib.js", |
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
13054
181