Merge pull request #11469 from bdchauvette/vinyl@1.2.0

Vinyl@1.2.0
This commit is contained in:
Andy
2016-09-24 08:11:26 -07:00
committed by GitHub
2 changed files with 32 additions and 2 deletions

View File

@@ -121,6 +121,31 @@ describe('File', () => {
});
describe('File.isVinyl()', () => {
it('should return true when an object is a Vinyl file', done => {
var file = new File();
File.isVinyl(file).should.equal(true);
done();
});
it('should return false when an object is not a Vinyl file', done => {
File.isVinyl({}).should.equal(false);
done();
});
});
describe('File.isCustomProp()', () => {
it('should return true when a File property is not managed internally', done => {
File.isCustomProp('foobar').should.equal(true);
done();
});
it('should return false when a File property is managed internally', done => {
File.isCustomProp('cwd').should.equal(false);
done();
});
});
describe('isBuffer()', () => {
it('should return true when the contents are a Buffer', done => {
var val = new Buffer("test");

9
vinyl/vinyl.d.ts vendored
View File

@@ -1,5 +1,5 @@
// Type definitions for vinyl 1.1.0
// Project: https://github.com/wearefractal/vinyl
// Type definitions for vinyl 1.2.0
// Project: https://github.com/gulpjs/vinyl
// Definitions by: vvakame <https://github.com/vvakame/>, jedmao <https://github.com/jedmao>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -140,6 +140,11 @@ declare module "vinyl" {
* Checks if a given object is a vinyl file.
*/
public static isVinyl(obj: any): boolean;
/**
* Checks if a property is not managed internally.
*/
public static isCustomProp(name: string): boolean;
}
export = File;