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

factory.ts

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

factory.ts - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

CHANGELOG.md

2

lib/async.d.ts
import { RecPartial } from "./shared";
import * as Sync from "./sync";
export declare type FactoryFunc<T, U = T> = (item?: RecPartial<T>) => Promise<U>;

@@ -49,1 +50,2 @@ export declare type ListFactoryFunc<T, U = T> = (count: number, item?: RecPartial<T>) => Promise<U[]>;

export declare function makeFactory<T>(builder: Builder<T>): Factory<T>;
export declare function makeFactoryFromSync<T>(builder: Sync.Builder<T>): Factory<T>;

@@ -11,2 +11,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const Sync = require("./sync");
function isPromise(t) {

@@ -182,2 +183,8 @@ return typeof t["then"] === "function";

}
else if (v.constructor === Sync.Generator) {
value = v.build(seqNum);
}
else if (v.constructor == Sync.Derived) {
derived.push({ key, derived: new Derived(v.func) });
}
}

@@ -193,2 +200,6 @@ t[key] = value;

exports.makeFactory = makeFactory;
function makeFactoryFromSync(builder) {
return new Factory(builder);
}
exports.makeFactoryFromSync = makeFactoryFromSync;
//# sourceMappingURL=async.js.map

@@ -50,3 +50,4 @@ "use strict";

let yKeys = Object.keys(y);
for (const key of Object.keys(v)) {
const allKeys = uniq(Object.keys(v).concat(yKeys));
for (const key of allKeys) {
if (yKeys.indexOf(key) >= 0) {

@@ -143,2 +144,11 @@ const itemKeyVal = y[key];

exports.makeFactory = makeFactory;
function uniq(ts) {
const out = [];
for (const v of ts) {
if (out.indexOf(v) < 0) {
out.push(v);
}
}
return out;
}
//# sourceMappingURL=sync.js.map

2

package.json
{
"name": "factory.ts",
"version": "0.3.3",
"version": "0.3.4",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "A Typescript test data factory similar to factory_bot and rosie",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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