Skip to content

Commit

Permalink
refactor(common): delete unused function ignoreTmpAndHiddenFile (#5600
Browse files Browse the repository at this point in the history
)
  • Loading branch information
yoshinorin authored Dec 31, 2024
1 parent 07781d8 commit 353d8f5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
5 changes: 0 additions & 5 deletions lib/plugins/processor/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ function isExcludedFile(path: string, config) {
return false;
}

export const ignoreTmpAndHiddenFile = new Pattern(path => {
if (isTmpFile(path) || isHiddenFile(path)) return false;
return true;
});

export {isTmpFile};
export {isHiddenFile};
export {isExcludedFile};
Expand Down
12 changes: 1 addition & 11 deletions test/scripts/processors/common.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import moment from 'moment';
import { isTmpFile, isHiddenFile, ignoreTmpAndHiddenFile as pattern, toDate, timezone, isMatch } from '../../../lib/plugins/processor/common';
import { isTmpFile, isHiddenFile, toDate, timezone, isMatch } from '../../../lib/plugins/processor/common';
import chai from 'chai';
const should = chai.should();

Expand All @@ -18,16 +18,6 @@ describe('common', () => {
isHiddenFile('foo/.bar').should.be.true;
});

it('ignoreTmpAndHiddenFile()', () => {
pattern.match('foo').should.be.true;
pattern.match('foo%').should.be.false;
pattern.match('foo~').should.be.false;
pattern.match('_foo').should.be.false;
pattern.match('foo/_bar').should.be.false;
pattern.match('.foo').should.be.false;
pattern.match('foo/.bar').should.be.false;
});

it('toDate()', () => {
const m = moment();
const d = new Date();
Expand Down

0 comments on commit 353d8f5

Please sign in to comment.