filter-changelog-paths
v1.0.0
Published
Extract CHANGELOG-like paths from multiple file paths
Downloads
22
Maintainers
Readme
filter-changelog-paths
A Node module to extract CHANGELOG-like paths from multiple file paths
const filterChangelogPaths = require('filter-changelog-paths');
filterChangelogPaths([
'CHANGELOG.txt',
'CONTRIBUTING',
'project/docs/release_notes.md',
'lib/index.js'
]);
//=> ['CHANGELOG.txt', 'project/docs/release_notes.md']
Installation
npm install filter-changelog-paths
API
const filterChangelogPaths = require('filter-changelog-paths');
filterChangelogPaths(filePaths)
filePaths: Array
of strings (file paths)
Return: Array
of strings
It filters a given array by using is-changelog-path as a filter function.
const filterChangelogPaths = require('filter-changelog-paths');
filterChangelogPaths([]); //=> []
filterChangelogPaths('changelog'); // throws a type error
filterChangelogPaths(['changelog', 1, 'history', true]); // throws a type error
filterChangelogPaths(); // throws a type error
filterChangelogPaths.posix(filePaths)
filePaths: Array
of strings (file paths)
Return: Array
of strings
Always interact in a posix compatible way.
filterChangelogPaths.posix(['dir\\releases']); //=> []
filterChangelogPaths.win32(filePaths)
filePaths: Array
of strings (file paths)
Return: Array
of strings
Always interact in a win32 compatible way.
filterChangelogPaths.win32(['dir\\releases']); //=> ['dir\\releases']
License
Copyright (c) 2015 Shinnosuke Watanabe
Licensed under the MIT License.