New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fabricator

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fabricator - npm Package Compare versions

Comparing version 0.4.4 to 0.5.0

8

index.js
'use strict';
var path = require('path')
var empty = require('is-empty')
, path = require('path')
, fs = require('fs');

@@ -23,2 +24,7 @@

//
// Empty strings, arrays or objects should not be processed, return early.
//
if (empty(stack)) return [];
switch (is(stack)) {

@@ -25,0 +31,0 @@ case 'string':

5

package.json
{
"name": "fabricator",
"version": "0.4.4",
"version": "0.5.0",
"description": "Discover collections of constructible instances from strings (filepaths), arrays or objects",

@@ -34,3 +34,6 @@ "main": "index.js",

"pre-commit": "1.0.x"
},
"dependencies": {
"is-empty": "0.0.1"
}
}

@@ -10,3 +10,3 @@ 'use strict';

function fn() {
function Y() { /* nope */ }
function Y(x, y) { x = y; }
Y.prototype.name = '';

@@ -13,0 +13,0 @@

@@ -23,2 +23,9 @@ describe('Fabricator', function () {

it('returns early if the stack is empty or falsy', function () {
var result = fabricator([false]);
assume(result).to.be.an('array');
assume(result.length).to.equal(0);
});
it('can init constructors from file paths', function () {

@@ -71,3 +78,3 @@ var result = fabricator(fixtures.string);

it('throws an error when we receive an invalid type', function (next) {
try { fabricator(new Date()); }
try { fabricator(Date.now()); }
catch (e) { next(); }

@@ -74,0 +81,0 @@ });

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