Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vinyl

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vinyl - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

6

index.js
var path = require('path');
var clone = require('lodash.clone');
var cloneStats = require('clone-stats');

@@ -46,4 +46,4 @@ var isBuffer = require('./lib/isBuffer');

File.prototype.clone = function() {
var clonedStat = clone(this.stat);
var clonedContents = this.isBuffer() ? cloneBuffer(this.contents) : this.contents;
var clonedStat = this.stat ? cloneStats(this.stat) : null;

@@ -129,2 +129,2 @@ return new File({

module.exports = File;
module.exports = File;
{
"name": "vinyl",
"description": "A virtual file format",
"version": "0.2.1",
"version": "0.2.2",
"homepage": "http://github.com/wearefractal/vinyl",

@@ -10,3 +10,3 @@ "repository": "git://github.com/wearefractal/vinyl.git",

"dependencies": {
"lodash.clone": "~2.4.1"
"clone-stats": "0.0.0"
},

@@ -13,0 +13,0 @@ "devDependencies": {

var File = require('../');
var Stream = require('stream');
var fs = require('fs');

@@ -232,4 +233,24 @@ var should = require('should');

});
it('should properly clone the `stat` property', function(done) {
var options = {
cwd: "/",
base: "/test/",
path: "/test/test.js",
contents: new Buffer("test"),
stat: fs.statSync(__filename)
};
var file = new File(options);
var copy = file.clone();
copy.stat.isFile().should.be.true;
copy.stat.isDirectory().should.be.false;
should(file.stat instanceof fs.Stats).be.true;
should(copy.stat instanceof fs.Stats).be.true;
done();
});
});
describe('pipe()', function() {

@@ -520,2 +541,2 @@ it('should write to stream with Buffer', function(done) {

});
});
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