all files / lib/ utils.js

100% Statements 22/22
75% Branches 3/4
100% Functions 1/1
100% Lines 21/21
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80                                                                                                                     
'use strict';
 
Object.defineProperty(exports, "__esModule", {
  value: true
});
 
var _prequest = require('./deps/ajax/prequest');
 
var _prequest2 = _interopRequireDefault(_prequest);
 
var _parseUri = require('./deps/parseUri');
 
var _parseUri2 = _interopRequireDefault(_parseUri);
 
var _uuid = require('./deps/uuid');
 
var _uuid2 = _interopRequireDefault(_uuid);
 
var _promise = require('./deps/promise');
 
var _promise2 = _interopRequireDefault(_promise);
 
var _base = require('./deps/binary/base64');
 
var _errors = require('./deps/errors');
 
var _binaryStringToBlobOrBuffer = require('./deps/binary/binaryStringToBlobOrBuffer');
 
var _binaryStringToBlobOrBuffer2 = _interopRequireDefault(_binaryStringToBlobOrBuffer);
 
var _clone = require('./deps/clone');
 
var _clone2 = _interopRequireDefault(_clone);
 
var _jsExtend = require('js-extend');
 
var _jsExtend2 = _interopRequireDefault(_jsExtend);
 
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
// TODO: pretty sure these are in widespread use by Hoodie and others,
// also in the integration tests
 
// TODO: required by tests
 
// TODO: used by the integration tests and elsewhere, possibly
// even in the PouchDB guide and example code
 
// TODO: only used by the integration tests
 
var extend = _jsExtend2.default.extend;
 
// TODO: only used by the integration tests
 
// TODO: only used by the integration tests
 
// TODO: only used by the integration tests
//
// PouchDB.utils is basically a throwback to the pre-Browserify days,
// when this was the easiest way to access global utilities from anywhere
// in the project. For code cleanliness, we're trying to remove this file,
// but for practical reasons (legacy code, test code, etc.) this is still here.
//
 
// TODO: only used by the integration tests, which have
// some tests that explicitly override PouchDB.utils.ajax
 
exports.default = {
  ajax: _prequest2.default,
  parseUri: _parseUri2.default,
  uuid: _uuid2.default,
  Promise: _promise2.default,
  atob: _base.atob,
  btoa: _base.btoa,
  binaryStringToBlobOrBuffer: _binaryStringToBlobOrBuffer2.default,
  clone: _clone2.default,
  extend: extend,
  createError: _errors.createError
};
module.exports = exports['default'];