Skip to content

Commit

Permalink
Merge branch 'feat/ignore-junk' of https://github.com/whitecrownclown…
Browse files Browse the repository at this point in the history
…/cpy into feat/ignore-junk
  • Loading branch information
Daniel Andrei committed Aug 4, 2019
2 parents 26731bf + 5208695 commit 5d43a82
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 91 deletions.
65 changes: 31 additions & 34 deletions index.d.ts
@@ -1,23 +1,23 @@
import {GlobbyOptions} from 'globby';
import {Options as CpFileOptions} from 'cp-file';
import { GlobbyOptions } from 'globby';
import { Options as CpFileOptions } from 'cp-file';

declare namespace cpy {
interface Options extends Readonly<GlobbyOptions>, CpFileOptions {
/**
interface Options extends Readonly<GlobbyOptions>, CpFileOptions {
/**
Working directory to find source files.
@default process.cwd()
*/
readonly cwd?: string;
readonly cwd?: string;

/**
/**
Preserve path structure.
@default false
*/
readonly parents?: boolean;
readonly parents?: boolean;

/**
/**
Filename or function returning a filename used to rename every file in `source`.
@example
Expand All @@ -31,51 +31,48 @@ declare namespace cpy {
})();
```
*/
readonly rename?: string | ((basename: string) => string);
readonly rename?: string | ((basename: string) => string);

/**
/**
Number of files being copied concurrently.
@default (os.cpus().length || 1) * 2
*/
readonly concurrency?: number;
readonly concurrency?: number;

/**
/**
Ignore junk files.
@default true
*/
readonly ignoreJunk?: boolean;
}
readonly ignoreJunk?: boolean;
}

interface ProgressData {
/**
interface ProgressData {
/**
Copied file count.
*/
completedFiles: number;
completedFiles: number;

/**
/**
Overall file count.
*/
totalFiles: number;
totalFiles: number;

/**
/**
Completed size in bytes.
*/
completedSize: number;
completedSize: number;

/**
/**
Completed percentage. A value between `0` and `1`.
*/
percent: number;
}

interface ProgressEmitter {
on(
event: 'progress',
handler: (progress: ProgressData) => void
): Promise<string[]>;
}
percent: number;
}

interface ProgressEmitter {
on(event: 'progress', handler: (progress: ProgressData) => void): Promise<string[]>;
}
}

/**
Expand All @@ -96,9 +93,9 @@ import cpy = require('cpy');
```
*/
declare function cpy(
source: string | ReadonlyArray<string>,
destination: string,
options?: cpy.Options
source: string | ReadonlyArray<string>,
destination: string,
options?: cpy.Options
): Promise<string[]> & cpy.ProgressEmitter;

export = cpy;
114 changes: 57 additions & 57 deletions package.json
@@ -1,59 +1,59 @@
{
"name": "cpy",
"version": "7.3.0",
"description": "Copy files",
"license": "MIT",
"repository": "sindresorhus/cpy",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"cpy-error.js",
"index.js",
"index.d.ts"
],
"keywords": [
"copy",
"cp",
"cpy",
"file",
"files",
"clone",
"fs",
"stream",
"glob",
"file-system",
"ncp",
"fast",
"quick",
"data",
"content",
"contents",
"cpx",
"directory",
"directories"
],
"dependencies": {
"arrify": "^2.0.1",
"cp-file": "^7.0.0",
"globby": "^9.2.0",
"nested-error-stacks": "^2.1.0",
"p-all": "^2.1.0",
"junk": "^3.1.0"
},
"devDependencies": {
"ava": "^2.1.0",
"rimraf": "^2.6.3",
"tempfile": "^3.0.0",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
"name": "cpy",
"version": "7.3.0",
"description": "Copy files",
"license": "MIT",
"repository": "sindresorhus/cpy",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"cpy-error.js",
"index.js",
"index.d.ts"
],
"keywords": [
"copy",
"cp",
"cpy",
"file",
"files",
"clone",
"fs",
"stream",
"glob",
"file-system",
"ncp",
"fast",
"quick",
"data",
"content",
"contents",
"cpx",
"directory",
"directories"
],
"dependencies": {
"arrify": "^2.0.1",
"cp-file": "^7.0.0",
"globby": "^9.2.0",
"nested-error-stacks": "^2.1.0",
"p-all": "^2.1.0",
"junk": "^3.1.0"
},
"devDependencies": {
"ava": "^2.1.0",
"rimraf": "^2.6.3",
"tempfile": "^3.0.0",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}

0 comments on commit 5d43a82

Please sign in to comment.