New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dobesv/clean-dest

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dobesv/clean-dest - npm Package Compare versions

Comparing version 1.3.3 to 1.3.4

11

dist/bin.js

@@ -36,2 +36,9 @@ #!/usr/bin/env node

},
ignore: {
default: '*.tsbuildinfo',
describe: 'Glob of output files to keep regardless of input files (seperate multiple rules with semicolon)',
demand: false,
type: 'string',
alias: 'i',
},
permanent: {

@@ -42,2 +49,3 @@ default: false,

type: 'boolean',
alias: 'p',
},

@@ -49,2 +57,3 @@ 'dry-run': {

type: 'boolean',
alias: 'n',
},

@@ -56,2 +65,3 @@ verbose: {

type: 'boolean',
alias: 'v',
},

@@ -67,2 +77,3 @@ })

basePattern: argv['base-pattern'],
ignore: argv['ignore'],
fileMapArgument: argv['file-map'],

@@ -69,0 +80,0 @@ permanent: argv['permanent'],

8

dist/index.js

@@ -61,3 +61,3 @@ "use strict";

.map((elt) => normalizeFileMap(elt, replaceExt))
.reduce((mapFn1, mapFn2) => (destFilePath) => Array.from(new Set([...mapFn1(destFilePath), ...mapFn2(destFilePath)])));
.reduce((mapFn1, mapFn2) => (destFilePath) => Array.from(new Set([...mapFn1(destFilePath), ...mapFn2(destFilePath)])).sort());
}

@@ -98,3 +98,3 @@ if (fileMap && typeof fileMap === 'object') {

this.log('Executing, using config', this._config);
const { srcRootPath, destRootPath, fileMapArgument, basePattern } = this._config;
const { srcRootPath, destRootPath, fileMapArgument, basePattern, ignore } = this._config;
const fileMap = normalizeFileMap(fileMapArgument

@@ -114,2 +114,6 @@ ? /^[.][a-z0-9]/i.test(fileMapArgument)

const destFilePaths = [basePattern || defaultBasePattern];
if (ignore) {
destFilePaths.push(...splitAndTrim(ignore, ';').map((rule) => '!' + rule));
}
``;
for (const srcFilePath of srcFilePaths) {

@@ -116,0 +120,0 @@ const destFilePath = this.mapDestFile(srcFilePath, srcRootPath, destRootPath, fileMap);

{
"name": "@dobesv/clean-dest",
"version": "1.3.3",
"version": "1.3.4",
"description": "A CLI to clean a destination directory given a source directory",

@@ -5,0 +5,0 @@ "bin": "./dist/bin.js",

@@ -123,2 +123,5 @@ # clean-dest

### `ignore`
### `permanent`

@@ -125,0 +128,0 @@

@@ -39,2 +39,9 @@ #!/usr/bin/env node

},
ignore: {
default: '*.tsbuildinfo',
describe: 'Glob of output files to keep regardless of input files (seperate multiple rules with semicolon)',
demand: false,
type: 'string',
alias: 'i',
},
permanent: {

@@ -46,2 +53,3 @@ default: false,

type: 'boolean',
alias: 'p',
},

@@ -53,2 +61,3 @@ 'dry-run': {

type: 'boolean',
alias: 'n',
},

@@ -60,2 +69,3 @@ verbose: {

type: 'boolean',
alias: 'v',
},

@@ -72,2 +82,3 @@ })

basePattern: argv['base-pattern'],
ignore: argv['ignore'],
fileMapArgument: argv['file-map'],

@@ -74,0 +85,0 @@ permanent: argv['permanent'],

@@ -26,2 +26,3 @@ import { describe, it } from 'mocha';

fileMapArgument: null,
ignore: null,
permanent: true,

@@ -126,3 +127,3 @@ verbose: true,

it('only processes files with a mapping', async () => {
it('does not exclude files with no mapping', async () => {
const tsxFileMap: FileMap = {

@@ -188,3 +189,3 @@ '.tsx': (destFilePath) => [destFilePath.replace(/.tsx$/, '.js')],

it('ignores files with no mapping', async () => {
it('does not exclude files with no mapping', async () => {
const srcRootPath = './test/data/**/*';

@@ -207,4 +208,29 @@ const sut = createSUT(

});
it('applies ignore rule if provided', async () => {
const srcRootPath = './test/data/**/*';
const sut = createSUT(
{
fileMapArgument: '.ts:.js',
srcRootPath,
ignore: '*.tsbuildinfo;*.json',
},
(patterns) => Promise.resolve(patterns)
);
const actual = await sut.execute();
const expected: Array<string> = [
'dest/**/*',
'!*.tsbuildinfo',
'!*.json',
'!../file1.js',
'!../file2.js',
'!../folder1',
'!../folder2',
'!../folder1/file3.js',
'!../folder2/file4.js',
];
assert.deepStrictEqual(actual, expected);
});
});
});
});

@@ -12,2 +12,3 @@ import path from 'path';

readonly fileMapArgument: string | null;
readonly ignore: string | null;
readonly permanent: boolean;

@@ -108,3 +109,3 @@ readonly verbose: boolean;

new Set([...mapFn1(destFilePath), ...mapFn2(destFilePath)])
)
).sort()
);

@@ -161,3 +162,3 @@ }

this.log('Executing, using config', this._config);
const { srcRootPath, destRootPath, fileMapArgument, basePattern } =
const { srcRootPath, destRootPath, fileMapArgument, basePattern, ignore } =
this._config;

@@ -180,2 +181,8 @@ const fileMap: FileMapFunction = normalizeFileMap(

const destFilePaths = [basePattern || defaultBasePattern];
if (ignore) {
destFilePaths.push(
...splitAndTrim(ignore, ';').map((rule) => '!' + rule)
);
}
``;
for (const srcFilePath of srcFilePaths) {

@@ -182,0 +189,0 @@ const destFilePath = this.mapDestFile(

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc