mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Handle non-Array inputs for options.files.
This commit is contained in:
parent
c4a0e6c312
commit
1e23d035ce
2 changed files with 19 additions and 1 deletions
|
|
@ -230,7 +230,12 @@ function markdownlint(options, callback) {
|
|||
// Normalize inputs
|
||||
options = options || {};
|
||||
callback = callback || function noop() {};
|
||||
var files = (options.files || []).slice();
|
||||
var files = [];
|
||||
if (Array.isArray(options.files)) {
|
||||
files = options.files.slice();
|
||||
} else if (options.files) {
|
||||
files = [ String(options.files) ];
|
||||
}
|
||||
var strings = options.strings || {};
|
||||
var frontMatter = (options.frontMatter === undefined) ?
|
||||
shared.frontMatterRe : options.frontMatter;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue