From ada9bfca7db827a4d9962a23e7647189cc80370f Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 09:04:55 +0900 Subject: [PATCH] fix vinyl-fs/vinyl-fs-tests.ts and vinyl-fs/vinyl-fs.d.ts --- vinyl-fs/vinyl-fs-tests.ts | 22 +++++++++++----------- vinyl-fs/vinyl-fs.d.ts | 35 +++++++++++++++++++---------------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/vinyl-fs/vinyl-fs-tests.ts b/vinyl-fs/vinyl-fs-tests.ts index a29746166e..c8ca090700 100644 --- a/vinyl-fs/vinyl-fs-tests.ts +++ b/vinyl-fs/vinyl-fs-tests.ts @@ -229,7 +229,7 @@ var dataWrap = function (fn: any) { }; var realMode = function (n: any) { - return n & 07777; + return n & parseInt("07777", 8); }; describe('dest stream', function () { @@ -372,7 +372,7 @@ describe('dest stream', function () { var expectedContents = fs.readFileSync(inputPath); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, "./out-fixtures"); - var expectedMode = 0655; + var expectedMode = parseInt("0655", 8); var expectedFile = new File({ base: inputBase, @@ -412,7 +412,7 @@ describe('dest stream', function () { var expectedContents = fs.readFileSync(inputPath); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, "./out-fixtures"); - var expectedMode = 0655; + var expectedMode = parseInt("0655", 8); var contentStream = through.obj(); var expectedFile = new File({ @@ -456,7 +456,7 @@ describe('dest stream', function () { var expectedPath = path.join(__dirname, "./out-fixtures/test"); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, "./out-fixtures"); - var expectedMode = 0655; + var expectedMode = parseInt("0655", 8); var expectedFile = new File({ base: inputBase, @@ -555,7 +555,7 @@ var dataWrap = function (fn: any) { }; var realMode = function (n: any) { - return n & 07777; + return n & parseInt("07777", 8); }; describe('symlink stream', function () { @@ -706,7 +706,7 @@ describe('symlink stream', function () { var expectedContents = fs.readFileSync(inputPath); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, './out-fixtures'); - var expectedMode = 0655; + var expectedMode = parseInt("0655", 8); var expectedFile = new File({ base: inputBase, @@ -746,7 +746,7 @@ describe('symlink stream', function () { var expectedContents = fs.readFileSync(inputPath); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, './out-fixtures'); - var expectedMode = 0655; + var expectedMode = parseInt("0655", 8); var contentStream = through.obj(); var expectedFile = new File({ @@ -790,7 +790,7 @@ describe('symlink stream', function () { var expectedPath = path.join(__dirname, './out-fixtures/wow'); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, './out-fixtures'); - var expectedMode = 0655; + var expectedMode = parseInt("0655", 8); var expectedFile = new File({ base: inputBase, @@ -830,8 +830,8 @@ describe('symlink stream', function () { var inputBase = path.join(__dirname, './fixtures'); var inputPath = path.join(__dirname, './fixtures/wow/suchempty'); var expectedBase = path.join(__dirname, './out-fixtures/wow'); - var expectedDirMode = 0755; - var expectedFileMode = 0655; + var expectedDirMode = parseInt("0755", 8); + var expectedFileMode = parseInt("0655", 8); var firstFile = new File({ base: inputBase, @@ -867,7 +867,7 @@ describe('symlink stream', function () { var expectedContents = fs.readFileSync(inputPath); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, './out-fixtures'); - var expectedMode = 0722; + var expectedMode = parseInt("0722", 8); var expectedFile = new File({ base: inputBase, diff --git a/vinyl-fs/vinyl-fs.d.ts b/vinyl-fs/vinyl-fs.d.ts index 98bb34339b..70fc32abaa 100644 --- a/vinyl-fs/vinyl-fs.d.ts +++ b/vinyl-fs/vinyl-fs.d.ts @@ -21,7 +21,7 @@ declare module "vinyl-fs" { cwd?: string; /** - * Specifies the folder relative to the cwd + * Specifies the folder relative to the cwd * This is used to determine the file names when saving in .dest() * Default is where the glob begins */ @@ -34,16 +34,16 @@ declare module "vinyl-fs" { */ buffer?: boolean; - /** + /** * Setting this to false will ignore the contents of the file and disable writing to disk to speed up operations - * Defaults to true + * Defaults to true */ read?: boolean; /** Only find files that have been modified since the time specified */ since?: Date|number; - /** Setting this to true will create a duplex stream, one that passes through items and emits globbed files. + /** Setting this to true will create a duplex stream, one that passes through items and emits globbed files. * Defaults to false */ passthrough?: boolean; @@ -63,7 +63,7 @@ declare module "vinyl-fs" { /** * This is just a glob-watcher - * + * * @param globs Takes a glob string or an array of glob strings as the first argument * Globs are executed in order, so negations should follow positive globs * fs.src(['!b*.js', '*.js']) would not exclude any files, but this would: fs.src(['*.js', '!b*.js']) @@ -72,7 +72,7 @@ declare module "vinyl-fs" { /** * This is just a glob-watcher - * + * * @param globs Takes a glob string or an array of glob strings as the first argument * Globs are executed in order, so negations should follow positive globs * fs.src(['!b*.js', '*.js']) would not exclude any files, but this would: fs.src(['*.js', '!b*.js']) @@ -89,8 +89,8 @@ declare module "vinyl-fs" { * @param folder destination folder */ function dest(folder: string, opt?: { - /** Specify the working directory the folder is relative to - * Default is process.cwd() + /** Specify the working directory the folder is relative to + * Default is process.cwd() */ cwd?: string; @@ -125,14 +125,17 @@ declare module "vinyl-fs" { * cwd, base, and path will be overwritten to match the folder */ function symlink(folder: string, opts?: { - /** - * Specify the working directory the folder is relative to + /** + * Specify the working directory the folder is relative to * Default is process.cwd() */ cwd?: string; - /** - * Specify the mode the directory should be created with + /** Specify the mode the directory should be created with. Default is the process mode */ + mode?: number|string; + + /** + * Specify the mode the directory should be created with * Default is the process mode */ dirMode?: number @@ -146,14 +149,14 @@ declare module "vinyl-fs" { */ function symlink(getFolderPath: (File: File) => string, opts?: { - /** - * Specify the working directory the folder is relative to + /** + * Specify the working directory the folder is relative to * Default is process.cwd() */ cwd?: string; - /** - * Specify the mode the directory should be created with + /** + * Specify the mode the directory should be created with * Default is the process mode */ dirMode?: number