-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
167 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/*! | ||
* js-data-firebase | ||
* @version 2.0.0-beta.1 - Homepage <http://www.js-data.io/docs/dsfirebaseadapter> | ||
* @version 2.0.0-rc.1 - Homepage <http://www.js-data.io/docs/dsfirebaseadapter> | ||
* @author Jason Dobry <[email protected]> | ||
* @copyright (c) 2014-2015 Jason Dobry | ||
* @license MIT <https://github.com/js-data/js-data-firebase/blob/master/LICENSE> | ||
|
@@ -63,34 +63,17 @@ return /******/ (function(modules) { // webpackBootstrap | |
/* 0 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
|
||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; | ||
|
||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
|
||
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; | ||
|
||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
|
||
var _JSData = __webpack_require__(1); | ||
|
||
var _JSData2 = _interopRequireWildcard(_JSData); | ||
|
||
var _Firebase = __webpack_require__(2); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
|
||
var _Firebase2 = _interopRequireWildcard(_Firebase); | ||
var JSData = __webpack_require__(1); | ||
var Firebase = __webpack_require__(2); | ||
var values = __webpack_require__(3); | ||
|
||
var _omit = __webpack_require__(3); | ||
|
||
var _omit2 = _interopRequireWildcard(_omit); | ||
|
||
var _values = __webpack_require__(4); | ||
|
||
var _values2 = _interopRequireWildcard(_values); | ||
|
||
var emptyStore = new _JSData2['default'].DS(); | ||
var DSUtils = _JSData2['default'].DSUtils; | ||
var emptyStore = new JSData.DS(); | ||
var DSUtils = JSData.DSUtils; | ||
var omit = DSUtils.omit; | ||
var deepMixIn = DSUtils.deepMixIn; | ||
var removeCircular = DSUtils.removeCircular; | ||
var forOwn = DSUtils.forOwn; | ||
|
@@ -147,7 +130,7 @@ return /******/ (function(modules) { // webpackBootstrap | |
options = options || {}; | ||
this.defaults = new Defaults(); | ||
deepMixIn(this.defaults, options); | ||
this.ref = new _Firebase2['default'](options.basePath || this.defaults.basePath); | ||
this.ref = new Firebase(options.basePath || this.defaults.basePath); | ||
} | ||
|
||
_createClass(DSFirebaseAdapter, [{ | ||
|
@@ -189,7 +172,7 @@ return /******/ (function(modules) { // webpackBootstrap | |
value[resourceConfig.idAttribute] = '/' + key; | ||
} | ||
}); | ||
resolve(filter.call(emptyStore, _values2['default'](data), resourceConfig.name, params, options)); | ||
resolve(filter.call(emptyStore, values(data), resourceConfig.name, params, options)); | ||
}, reject, _this2); | ||
}); | ||
}); | ||
|
@@ -206,7 +189,7 @@ return /******/ (function(modules) { // webpackBootstrap | |
return createTask(function (resolve, reject) { | ||
queueTask(function () { | ||
var resourceRef = _this3.getRef(resourceConfig, options); | ||
var itemRef = resourceRef.push(removeCircular(_omit2['default'](attrs, resourceConfig.relationFields || [])), function (err) { | ||
var itemRef = resourceRef.push(removeCircular(omit(attrs, resourceConfig.relationFields || [])), function (err) { | ||
if (err) { | ||
return reject(err); | ||
} else { | ||
|
@@ -237,7 +220,7 @@ return /******/ (function(modules) { // webpackBootstrap | |
|
||
return createTask(function (resolve, reject) { | ||
queueTask(function () { | ||
attrs = removeCircular(_omit2['default'](attrs || {}, resourceConfig.relationFields || [])); | ||
attrs = removeCircular(omit(attrs || {}, resourceConfig.relationFields || [])); | ||
var itemRef = _this4.getRef(resourceConfig, options).child(id); | ||
itemRef.once('value', function (dataSnapshot) { | ||
try { | ||
|
@@ -327,8 +310,7 @@ return /******/ (function(modules) { // webpackBootstrap | |
return DSFirebaseAdapter; | ||
})(); | ||
|
||
exports['default'] = DSFirebaseAdapter; | ||
module.exports = exports['default']; | ||
module.exports = DSFirebaseAdapter; | ||
|
||
/***/ }, | ||
/* 1 */ | ||
|
@@ -346,34 +328,7 @@ return /******/ (function(modules) { // webpackBootstrap | |
/* 3 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
|
||
var slice = __webpack_require__(5); | ||
var contains = __webpack_require__(6); | ||
|
||
/** | ||
* Return a copy of the object, filtered to only contain properties except the blacklisted keys. | ||
*/ | ||
function omit(obj, var_keys){ | ||
var keys = typeof arguments[1] !== 'string'? arguments[1] : slice(arguments, 1), | ||
out = {}; | ||
|
||
for (var property in obj) { | ||
if (obj.hasOwnProperty(property) && !contains(keys, property)) { | ||
out[property] = obj[property]; | ||
} | ||
} | ||
return out; | ||
} | ||
|
||
module.exports = omit; | ||
|
||
|
||
|
||
|
||
/***/ }, | ||
/* 4 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
|
||
var forOwn = __webpack_require__(7); | ||
var forOwn = __webpack_require__(4); | ||
|
||
/** | ||
* Get object values | ||
|
@@ -392,68 +347,11 @@ return /******/ (function(modules) { // webpackBootstrap | |
|
||
|
||
/***/ }, | ||
/* 5 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
|
||
|
||
|
||
/** | ||
* Create slice of source array or array-like object | ||
*/ | ||
function slice(arr, start, end){ | ||
var len = arr.length; | ||
|
||
if (start == null) { | ||
start = 0; | ||
} else if (start < 0) { | ||
start = Math.max(len + start, 0); | ||
} else { | ||
start = Math.min(start, len); | ||
} | ||
|
||
if (end == null) { | ||
end = len; | ||
} else if (end < 0) { | ||
end = Math.max(len + end, 0); | ||
} else { | ||
end = Math.min(end, len); | ||
} | ||
|
||
var result = []; | ||
while (start < end) { | ||
result.push(arr[start++]); | ||
} | ||
|
||
return result; | ||
} | ||
|
||
module.exports = slice; | ||
|
||
|
||
|
||
|
||
/***/ }, | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
|
||
var indexOf = __webpack_require__(10); | ||
|
||
/** | ||
* If array contains values. | ||
*/ | ||
function contains(arr, val) { | ||
return indexOf(arr, val) !== -1; | ||
} | ||
module.exports = contains; | ||
|
||
|
||
|
||
/***/ }, | ||
/* 7 */ | ||
/* 4 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
|
||
var hasOwn = __webpack_require__(8); | ||
var forIn = __webpack_require__(9); | ||
var hasOwn = __webpack_require__(5); | ||
var forIn = __webpack_require__(6); | ||
|
||
/** | ||
* Similar to Array/forEach but works over object properties and fixes Don't | ||
|
@@ -474,7 +372,7 @@ return /******/ (function(modules) { // webpackBootstrap | |
|
||
|
||
/***/ }, | ||
/* 8 */ | ||
/* 5 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
|
||
|
||
|
@@ -492,10 +390,10 @@ return /******/ (function(modules) { // webpackBootstrap | |
|
||
|
||
/***/ }, | ||
/* 9 */ | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
|
||
var hasOwn = __webpack_require__(8); | ||
var hasOwn = __webpack_require__(5); | ||
|
||
var _hasDontEnumBug, | ||
_dontEnums; | ||
|
@@ -573,40 +471,6 @@ return /******/ (function(modules) { // webpackBootstrap | |
|
||
|
||
|
||
/***/ }, | ||
/* 10 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
|
||
|
||
|
||
/** | ||
* Array.indexOf | ||
*/ | ||
function indexOf(arr, item, fromIndex) { | ||
fromIndex = fromIndex || 0; | ||
if (arr == null) { | ||
return -1; | ||
} | ||
|
||
var len = arr.length, | ||
i = fromIndex < 0 ? len + fromIndex : fromIndex; | ||
while (i < len) { | ||
// we iterate over sparse items since there is no way to make it | ||
// work properly on IE 7-8. see #64 | ||
if (arr[i] === item) { | ||
return i; | ||
} | ||
|
||
i++; | ||
} | ||
|
||
return -1; | ||
} | ||
|
||
module.exports = indexOf; | ||
|
||
|
||
|
||
/***/ } | ||
/******/ ]) | ||
}); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.