UNPKG

882 BJavaScriptView Raw
1'use strict';
2
3function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
5var stringify = require('./_stringify');
6
7var Base = function Base(source) {
8 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
9 _ref$defaultValue = _ref.defaultValue,
10 defaultValue = _ref$defaultValue === undefined ? {} : _ref$defaultValue,
11 _ref$serialize = _ref.serialize,
12 serialize = _ref$serialize === undefined ? stringify : _ref$serialize,
13 _ref$deserialize = _ref.deserialize,
14 deserialize = _ref$deserialize === undefined ? JSON.parse : _ref$deserialize;
15
16 _classCallCheck(this, Base);
17
18 this.source = source;
19 this.defaultValue = defaultValue;
20 this.serialize = serialize;
21 this.deserialize = deserialize;
22};
23
24module.exports = Base;
\No newline at end of file