factory-girl
Advanced tools
Comparing version 4.2.0 to 4.2.1
125
index.es6.js
@@ -1099,2 +1099,83 @@ import _slicedToArray from 'babel-runtime/helpers/slicedToArray'; | ||
var ObjectAdapter = function (_DefaultAdapter) { | ||
_inherits(ObjectAdapter, _DefaultAdapter); | ||
function ObjectAdapter() { | ||
_classCallCheck(this, ObjectAdapter); | ||
return _possibleConstructorReturn(this, _Object$getPrototypeOf(ObjectAdapter).apply(this, arguments)); | ||
} | ||
_createClass(ObjectAdapter, [{ | ||
key: 'build', | ||
value: function build(Model, props) { | ||
var model = new Model(); | ||
this.set(props, model, Model); | ||
return model; | ||
} | ||
}, { | ||
key: 'save', | ||
value: function () { | ||
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(model, Model) { | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
return _context.abrupt('return', model); | ||
case 1: | ||
case 'end': | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee, this); | ||
})); | ||
function save(_x, _x2) { | ||
return _ref.apply(this, arguments); | ||
} | ||
return save; | ||
}() | ||
}, { | ||
key: 'destroy', | ||
value: function () { | ||
var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(model, Model) { | ||
return _regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
return _context2.abrupt('return', model); | ||
case 1: | ||
case 'end': | ||
return _context2.stop(); | ||
} | ||
} | ||
}, _callee2, this); | ||
})); | ||
function destroy(_x3, _x4) { | ||
return _ref2.apply(this, arguments); | ||
} | ||
return destroy; | ||
}() | ||
}, { | ||
key: 'get', | ||
value: function get(model, attr, Model) { | ||
return model[attr]; | ||
} | ||
}, { | ||
key: 'set', | ||
value: function set(props, model, Model) { | ||
return _Object$assign(model, props); | ||
} | ||
}]); | ||
return ObjectAdapter; | ||
}(DefaultAdapter); | ||
/* eslint-disable no-unused-vars */ | ||
var BookshelfAdapter = function (_DefaultAdapter) { | ||
@@ -1182,19 +1263,25 @@ _inherits(BookshelfAdapter, _DefaultAdapter); | ||
var ObjectAdapter = function (_DefaultAdapter) { | ||
_inherits(ObjectAdapter, _DefaultAdapter); | ||
var ReduxORMAdapter = function (_DefaultAdapter) { | ||
_inherits(ReduxORMAdapter, _DefaultAdapter); | ||
function ObjectAdapter() { | ||
_classCallCheck(this, ObjectAdapter); | ||
function ReduxORMAdapter(session) { | ||
_classCallCheck(this, ReduxORMAdapter); | ||
return _possibleConstructorReturn(this, _Object$getPrototypeOf(ObjectAdapter).apply(this, arguments)); | ||
var _this = _possibleConstructorReturn(this, _Object$getPrototypeOf(ReduxORMAdapter).call(this)); | ||
_this.session = session; | ||
return _this; | ||
} | ||
_createClass(ObjectAdapter, [{ | ||
_createClass(ReduxORMAdapter, [{ | ||
key: 'build', | ||
value: function build(Model, props) { | ||
var model = new Model(); | ||
this.set(props, model, Model); | ||
return model; | ||
value: function build(modelName, props) { | ||
return this.session[modelName].create(props); | ||
} | ||
}, { | ||
key: 'get', | ||
value: function get(model, attr) { | ||
return model[attr]; | ||
} | ||
}, { | ||
key: 'save', | ||
@@ -1231,3 +1318,5 @@ value: function () { | ||
case 0: | ||
return _context2.abrupt('return', model); | ||
return _context2.abrupt('return', _Promise.resolve(model.delete()).then(function () { | ||
return true; | ||
})); | ||
@@ -1248,15 +1337,5 @@ case 1: | ||
}() | ||
}, { | ||
key: 'get', | ||
value: function get(model, attr, Model) { | ||
return model[attr]; | ||
} | ||
}, { | ||
key: 'set', | ||
value: function set(props, model, Model) { | ||
return _Object$assign(model, props); | ||
} | ||
}]); | ||
return ObjectAdapter; | ||
return ReduxORMAdapter; | ||
}(DefaultAdapter); | ||
@@ -1267,3 +1346,3 @@ | ||
export { BookshelfAdapter, DefaultAdapter, MongooseAdapter, SequelizeAdapter, ObjectAdapter, factory };export default factory; | ||
export { ObjectAdapter, BookshelfAdapter, DefaultAdapter, MongooseAdapter, SequelizeAdapter, ReduxORMAdapter, factory };export default factory; | ||
//# sourceMappingURL=index.es6.js.map |
126
index.js
@@ -1105,2 +1105,83 @@ 'use strict'; | ||
var ObjectAdapter = function (_DefaultAdapter) { | ||
_inherits(ObjectAdapter, _DefaultAdapter); | ||
function ObjectAdapter() { | ||
_classCallCheck(this, ObjectAdapter); | ||
return _possibleConstructorReturn(this, _Object$getPrototypeOf(ObjectAdapter).apply(this, arguments)); | ||
} | ||
_createClass(ObjectAdapter, [{ | ||
key: 'build', | ||
value: function build(Model, props) { | ||
var model = new Model(); | ||
this.set(props, model, Model); | ||
return model; | ||
} | ||
}, { | ||
key: 'save', | ||
value: function () { | ||
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(model, Model) { | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
return _context.abrupt('return', model); | ||
case 1: | ||
case 'end': | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee, this); | ||
})); | ||
function save(_x, _x2) { | ||
return _ref.apply(this, arguments); | ||
} | ||
return save; | ||
}() | ||
}, { | ||
key: 'destroy', | ||
value: function () { | ||
var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(model, Model) { | ||
return _regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
return _context2.abrupt('return', model); | ||
case 1: | ||
case 'end': | ||
return _context2.stop(); | ||
} | ||
} | ||
}, _callee2, this); | ||
})); | ||
function destroy(_x3, _x4) { | ||
return _ref2.apply(this, arguments); | ||
} | ||
return destroy; | ||
}() | ||
}, { | ||
key: 'get', | ||
value: function get(model, attr, Model) { | ||
return model[attr]; | ||
} | ||
}, { | ||
key: 'set', | ||
value: function set(props, model, Model) { | ||
return _Object$assign(model, props); | ||
} | ||
}]); | ||
return ObjectAdapter; | ||
}(DefaultAdapter); | ||
/* eslint-disable no-unused-vars */ | ||
var BookshelfAdapter = function (_DefaultAdapter) { | ||
@@ -1188,19 +1269,25 @@ _inherits(BookshelfAdapter, _DefaultAdapter); | ||
var ObjectAdapter = function (_DefaultAdapter) { | ||
_inherits(ObjectAdapter, _DefaultAdapter); | ||
var ReduxORMAdapter = function (_DefaultAdapter) { | ||
_inherits(ReduxORMAdapter, _DefaultAdapter); | ||
function ObjectAdapter() { | ||
_classCallCheck(this, ObjectAdapter); | ||
function ReduxORMAdapter(session) { | ||
_classCallCheck(this, ReduxORMAdapter); | ||
return _possibleConstructorReturn(this, _Object$getPrototypeOf(ObjectAdapter).apply(this, arguments)); | ||
var _this = _possibleConstructorReturn(this, _Object$getPrototypeOf(ReduxORMAdapter).call(this)); | ||
_this.session = session; | ||
return _this; | ||
} | ||
_createClass(ObjectAdapter, [{ | ||
_createClass(ReduxORMAdapter, [{ | ||
key: 'build', | ||
value: function build(Model, props) { | ||
var model = new Model(); | ||
this.set(props, model, Model); | ||
return model; | ||
value: function build(modelName, props) { | ||
return this.session[modelName].create(props); | ||
} | ||
}, { | ||
key: 'get', | ||
value: function get(model, attr) { | ||
return model[attr]; | ||
} | ||
}, { | ||
key: 'save', | ||
@@ -1237,3 +1324,5 @@ value: function () { | ||
case 0: | ||
return _context2.abrupt('return', model); | ||
return _context2.abrupt('return', _Promise.resolve(model.delete()).then(function () { | ||
return true; | ||
})); | ||
@@ -1254,15 +1343,5 @@ case 1: | ||
}() | ||
}, { | ||
key: 'get', | ||
value: function get(model, attr, Model) { | ||
return model[attr]; | ||
} | ||
}, { | ||
key: 'set', | ||
value: function set(props, model, Model) { | ||
return _Object$assign(model, props); | ||
} | ||
}]); | ||
return ObjectAdapter; | ||
return ReduxORMAdapter; | ||
}(DefaultAdapter); | ||
@@ -1273,2 +1352,3 @@ | ||
exports.ObjectAdapter = ObjectAdapter; | ||
exports.BookshelfAdapter = BookshelfAdapter; | ||
@@ -1278,5 +1358,5 @@ exports.DefaultAdapter = DefaultAdapter; | ||
exports.SequelizeAdapter = SequelizeAdapter; | ||
exports.ObjectAdapter = ObjectAdapter; | ||
exports.ReduxORMAdapter = ReduxORMAdapter; | ||
exports.factory = factory; | ||
exports['default'] = factory; | ||
//# sourceMappingURL=index.js.map |
126
index.umd.js
@@ -1105,2 +1105,83 @@ (function (global, factory) { | ||
var ObjectAdapter = function (_DefaultAdapter) { | ||
_inherits(ObjectAdapter, _DefaultAdapter); | ||
function ObjectAdapter() { | ||
_classCallCheck(this, ObjectAdapter); | ||
return _possibleConstructorReturn(this, _Object$getPrototypeOf(ObjectAdapter).apply(this, arguments)); | ||
} | ||
_createClass(ObjectAdapter, [{ | ||
key: 'build', | ||
value: function build(Model, props) { | ||
var model = new Model(); | ||
this.set(props, model, Model); | ||
return model; | ||
} | ||
}, { | ||
key: 'save', | ||
value: function () { | ||
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(model, Model) { | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
return _context.abrupt('return', model); | ||
case 1: | ||
case 'end': | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee, this); | ||
})); | ||
function save(_x, _x2) { | ||
return _ref.apply(this, arguments); | ||
} | ||
return save; | ||
}() | ||
}, { | ||
key: 'destroy', | ||
value: function () { | ||
var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(model, Model) { | ||
return _regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
return _context2.abrupt('return', model); | ||
case 1: | ||
case 'end': | ||
return _context2.stop(); | ||
} | ||
} | ||
}, _callee2, this); | ||
})); | ||
function destroy(_x3, _x4) { | ||
return _ref2.apply(this, arguments); | ||
} | ||
return destroy; | ||
}() | ||
}, { | ||
key: 'get', | ||
value: function get(model, attr, Model) { | ||
return model[attr]; | ||
} | ||
}, { | ||
key: 'set', | ||
value: function set(props, model, Model) { | ||
return _Object$assign(model, props); | ||
} | ||
}]); | ||
return ObjectAdapter; | ||
}(DefaultAdapter); | ||
/* eslint-disable no-unused-vars */ | ||
var BookshelfAdapter = function (_DefaultAdapter) { | ||
@@ -1188,19 +1269,25 @@ _inherits(BookshelfAdapter, _DefaultAdapter); | ||
var ObjectAdapter = function (_DefaultAdapter) { | ||
_inherits(ObjectAdapter, _DefaultAdapter); | ||
var ReduxORMAdapter = function (_DefaultAdapter) { | ||
_inherits(ReduxORMAdapter, _DefaultAdapter); | ||
function ObjectAdapter() { | ||
_classCallCheck(this, ObjectAdapter); | ||
function ReduxORMAdapter(session) { | ||
_classCallCheck(this, ReduxORMAdapter); | ||
return _possibleConstructorReturn(this, _Object$getPrototypeOf(ObjectAdapter).apply(this, arguments)); | ||
var _this = _possibleConstructorReturn(this, _Object$getPrototypeOf(ReduxORMAdapter).call(this)); | ||
_this.session = session; | ||
return _this; | ||
} | ||
_createClass(ObjectAdapter, [{ | ||
_createClass(ReduxORMAdapter, [{ | ||
key: 'build', | ||
value: function build(Model, props) { | ||
var model = new Model(); | ||
this.set(props, model, Model); | ||
return model; | ||
value: function build(modelName, props) { | ||
return this.session[modelName].create(props); | ||
} | ||
}, { | ||
key: 'get', | ||
value: function get(model, attr) { | ||
return model[attr]; | ||
} | ||
}, { | ||
key: 'save', | ||
@@ -1237,3 +1324,5 @@ value: function () { | ||
case 0: | ||
return _context2.abrupt('return', model); | ||
return _context2.abrupt('return', _Promise.resolve(model.delete()).then(function () { | ||
return true; | ||
})); | ||
@@ -1254,15 +1343,5 @@ case 1: | ||
}() | ||
}, { | ||
key: 'get', | ||
value: function get(model, attr, Model) { | ||
return model[attr]; | ||
} | ||
}, { | ||
key: 'set', | ||
value: function set(props, model, Model) { | ||
return _Object$assign(model, props); | ||
} | ||
}]); | ||
return ObjectAdapter; | ||
return ReduxORMAdapter; | ||
}(DefaultAdapter); | ||
@@ -1273,2 +1352,3 @@ | ||
exports.ObjectAdapter = ObjectAdapter; | ||
exports.BookshelfAdapter = BookshelfAdapter; | ||
@@ -1278,3 +1358,3 @@ exports.DefaultAdapter = DefaultAdapter; | ||
exports.SequelizeAdapter = SequelizeAdapter; | ||
exports.ObjectAdapter = ObjectAdapter; | ||
exports.ReduxORMAdapter = ReduxORMAdapter; | ||
exports.factory = factory; | ||
@@ -1281,0 +1361,0 @@ exports['default'] = factory; |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"keywords": [ | ||
@@ -12,0 +12,0 @@ "factory", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
702106
14264