mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-22 20:37:58 +08:00
@@ -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
9
vinyl/vinyl.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user