Internet-programming_PIbd-2.../Library/node_modules/lowdb/adapters/Base.js

24 lines
882 B
JavaScript
Raw Normal View History

2023-11-30 18:37:55 +04:00
'use strict';
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var stringify = require('./_stringify');
var Base = function Base(source) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref$defaultValue = _ref.defaultValue,
defaultValue = _ref$defaultValue === undefined ? {} : _ref$defaultValue,
_ref$serialize = _ref.serialize,
serialize = _ref$serialize === undefined ? stringify : _ref$serialize,
_ref$deserialize = _ref.deserialize,
deserialize = _ref$deserialize === undefined ? JSON.parse : _ref$deserialize;
_classCallCheck(this, Base);
this.source = source;
this.defaultValue = defaultValue;
this.serialize = serialize;
this.deserialize = deserialize;
};
module.exports = Base;