redux-astroglide 0.1.20 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +101 -139
- package/dist/index.js +101 -139
- package/dist/index.umd.js +3058 -329
- package/dist/plugins/index.es.js +58 -84
- package/dist/plugins/index.js +58 -84
- package/dist/plugins/index.umd.js +58 -84
- package/dist/plugins/persist/index.es.js +3 -1
- package/dist/plugins/persist/index.js +3 -1
- package/dist/plugins/persist/index.umd.js +3 -1
- package/dist/plugins/type/index.es.js +18 -24
- package/dist/plugins/type/index.js +18 -24
- package/dist/plugins/type/index.umd.js +18 -24
- package/dist/selectors/index.es.js +58 -72
- package/dist/selectors/index.js +58 -72
- package/dist/selectors/index.umd.js +2841 -80
- package/dist/types/astroglide.d.ts +1 -1
- package/dist/types/plugins/persist/__tests__/persist.test.d.ts +1 -0
- package/dist/types/setupTests.d.ts +2 -0
- package/package.json +14 -2
- package/CHANGELOG.md +0 -4
- package/plugins/index.es.js +0 -325
- package/plugins/index.js +0 -338
- package/plugins/index.umd.js +0 -422
- package/plugins/persist/index.es.js +0 -69
- package/plugins/persist/index.js +0 -76
- package/plugins/persist/index.umd.js +0 -82
- package/plugins/set/index.es.js +0 -17
- package/plugins/set/index.js +0 -19
- package/plugins/set/index.umd.js +0 -25
- package/plugins/type/index.es.js +0 -104
- package/plugins/type/index.js +0 -110
- package/plugins/type/index.umd.js +0 -194
package/plugins/set/index.umd.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global["redux-astroglide/plugins/set"] = factory());
|
|
5
|
-
})(this, (function () { 'use strict';
|
|
6
|
-
|
|
7
|
-
var index = (function (callback) {
|
|
8
|
-
return {
|
|
9
|
-
constructor: function constructor(innerCallback, value) {
|
|
10
|
-
this.value = value;
|
|
11
|
-
this.callback = innerCallback || callback;
|
|
12
|
-
},
|
|
13
|
-
update: function update(value, _ref) {
|
|
14
|
-
var draft = _ref.draft,
|
|
15
|
-
plugin = _ref.plugin;
|
|
16
|
-
return plugin.callback(value, {
|
|
17
|
-
draft: draft
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
return index;
|
|
24
|
-
|
|
25
|
-
}));
|
package/plugins/type/index.es.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import checkPropTypes from 'check-prop-types';
|
|
2
|
-
|
|
3
|
-
function ownKeys(e, r) {
|
|
4
|
-
var t = Object.keys(e);
|
|
5
|
-
if (Object.getOwnPropertySymbols) {
|
|
6
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
7
|
-
r && (o = o.filter(function (r) {
|
|
8
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
9
|
-
})), t.push.apply(t, o);
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
}
|
|
13
|
-
function _objectSpread2(e) {
|
|
14
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
15
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
16
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
17
|
-
_defineProperty(e, r, t[r]);
|
|
18
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
19
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return e;
|
|
23
|
-
}
|
|
24
|
-
function _defineProperty(obj, key, value) {
|
|
25
|
-
key = _toPropertyKey(key);
|
|
26
|
-
if (key in obj) {
|
|
27
|
-
Object.defineProperty(obj, key, {
|
|
28
|
-
value: value,
|
|
29
|
-
enumerable: true,
|
|
30
|
-
configurable: true,
|
|
31
|
-
writable: true
|
|
32
|
-
});
|
|
33
|
-
} else {
|
|
34
|
-
obj[key] = value;
|
|
35
|
-
}
|
|
36
|
-
return obj;
|
|
37
|
-
}
|
|
38
|
-
function _toPrimitive(input, hint) {
|
|
39
|
-
if (typeof input !== "object" || input === null) return input;
|
|
40
|
-
var prim = input[Symbol.toPrimitive];
|
|
41
|
-
if (prim !== undefined) {
|
|
42
|
-
var res = prim.call(input, hint || "default");
|
|
43
|
-
if (typeof res !== "object") return res;
|
|
44
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
45
|
-
}
|
|
46
|
-
return (hint === "string" ? String : Number)(input);
|
|
47
|
-
}
|
|
48
|
-
function _toPropertyKey(arg) {
|
|
49
|
-
var key = _toPrimitive(arg, "string");
|
|
50
|
-
return typeof key === "symbol" ? key : String(key);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
var checkPropType = function checkPropType(propType, value, name) {
|
|
54
|
-
var extraProps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
55
|
-
return checkPropTypes(_defineProperty({}, name, propType), _objectSpread2(_objectSpread2({}, extraProps), {}, _defineProperty({}, name, value)), name, undefined);
|
|
56
|
-
};
|
|
57
|
-
var checkProp = function checkProp(propType, value, name) {
|
|
58
|
-
var shouldTypeErrorPreventUpdate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
59
|
-
var result = checkPropType(propType, value, name);
|
|
60
|
-
if (result) {
|
|
61
|
-
var errorText = "Astroglide: prop ".concat(name, " with value ").concat(value, " is not of the specified type");
|
|
62
|
-
if (shouldTypeErrorPreventUpdate) {
|
|
63
|
-
throw Error(errorText);
|
|
64
|
-
} else {
|
|
65
|
-
console.warn(errorText);
|
|
66
|
-
}
|
|
67
|
-
return result;
|
|
68
|
-
}
|
|
69
|
-
return false;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
var index = (function () {
|
|
73
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
74
|
-
preventUpdate: false
|
|
75
|
-
},
|
|
76
|
-
preventUpdate = _ref.preventUpdate;
|
|
77
|
-
return {
|
|
78
|
-
constructor: function constructor(propType, value) {
|
|
79
|
-
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
80
|
-
this.value = value; // value set here because constructor signature is different
|
|
81
|
-
this.propType = propType;
|
|
82
|
-
this.config = _objectSpread2(_objectSpread2({}, this.config), config);
|
|
83
|
-
},
|
|
84
|
-
getInitialValue: function getInitialValue(value, _ref2) {
|
|
85
|
-
var key = _ref2.key,
|
|
86
|
-
plugin = _ref2.plugin;
|
|
87
|
-
var propType = plugin.propType;
|
|
88
|
-
checkProp(propType, value, key);
|
|
89
|
-
return value;
|
|
90
|
-
},
|
|
91
|
-
update: function update(value, _ref3) {
|
|
92
|
-
var key = _ref3.key,
|
|
93
|
-
plugin = _ref3.plugin;
|
|
94
|
-
var propType = plugin.propType;
|
|
95
|
-
checkProp(propType, value, key, plugin.config.preventUpdate !== undefined ? plugin.config.preventUpdate : preventUpdate);
|
|
96
|
-
return value;
|
|
97
|
-
},
|
|
98
|
-
config: {
|
|
99
|
-
preventUpdate: false
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
export { index as default };
|
package/plugins/type/index.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var checkPropTypes = require('check-prop-types');
|
|
4
|
-
|
|
5
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
6
|
-
|
|
7
|
-
var checkPropTypes__default = /*#__PURE__*/_interopDefaultLegacy(checkPropTypes);
|
|
8
|
-
|
|
9
|
-
function ownKeys(e, r) {
|
|
10
|
-
var t = Object.keys(e);
|
|
11
|
-
if (Object.getOwnPropertySymbols) {
|
|
12
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
13
|
-
r && (o = o.filter(function (r) {
|
|
14
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
15
|
-
})), t.push.apply(t, o);
|
|
16
|
-
}
|
|
17
|
-
return t;
|
|
18
|
-
}
|
|
19
|
-
function _objectSpread2(e) {
|
|
20
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
21
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
22
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
23
|
-
_defineProperty(e, r, t[r]);
|
|
24
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
25
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
return e;
|
|
29
|
-
}
|
|
30
|
-
function _defineProperty(obj, key, value) {
|
|
31
|
-
key = _toPropertyKey(key);
|
|
32
|
-
if (key in obj) {
|
|
33
|
-
Object.defineProperty(obj, key, {
|
|
34
|
-
value: value,
|
|
35
|
-
enumerable: true,
|
|
36
|
-
configurable: true,
|
|
37
|
-
writable: true
|
|
38
|
-
});
|
|
39
|
-
} else {
|
|
40
|
-
obj[key] = value;
|
|
41
|
-
}
|
|
42
|
-
return obj;
|
|
43
|
-
}
|
|
44
|
-
function _toPrimitive(input, hint) {
|
|
45
|
-
if (typeof input !== "object" || input === null) return input;
|
|
46
|
-
var prim = input[Symbol.toPrimitive];
|
|
47
|
-
if (prim !== undefined) {
|
|
48
|
-
var res = prim.call(input, hint || "default");
|
|
49
|
-
if (typeof res !== "object") return res;
|
|
50
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
51
|
-
}
|
|
52
|
-
return (hint === "string" ? String : Number)(input);
|
|
53
|
-
}
|
|
54
|
-
function _toPropertyKey(arg) {
|
|
55
|
-
var key = _toPrimitive(arg, "string");
|
|
56
|
-
return typeof key === "symbol" ? key : String(key);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
var checkPropType = function checkPropType(propType, value, name) {
|
|
60
|
-
var extraProps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
61
|
-
return checkPropTypes__default["default"](_defineProperty({}, name, propType), _objectSpread2(_objectSpread2({}, extraProps), {}, _defineProperty({}, name, value)), name, undefined);
|
|
62
|
-
};
|
|
63
|
-
var checkProp = function checkProp(propType, value, name) {
|
|
64
|
-
var shouldTypeErrorPreventUpdate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
65
|
-
var result = checkPropType(propType, value, name);
|
|
66
|
-
if (result) {
|
|
67
|
-
var errorText = "Astroglide: prop ".concat(name, " with value ").concat(value, " is not of the specified type");
|
|
68
|
-
if (shouldTypeErrorPreventUpdate) {
|
|
69
|
-
throw Error(errorText);
|
|
70
|
-
} else {
|
|
71
|
-
console.warn(errorText);
|
|
72
|
-
}
|
|
73
|
-
return result;
|
|
74
|
-
}
|
|
75
|
-
return false;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
var index = (function () {
|
|
79
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
80
|
-
preventUpdate: false
|
|
81
|
-
},
|
|
82
|
-
preventUpdate = _ref.preventUpdate;
|
|
83
|
-
return {
|
|
84
|
-
constructor: function constructor(propType, value) {
|
|
85
|
-
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
86
|
-
this.value = value; // value set here because constructor signature is different
|
|
87
|
-
this.propType = propType;
|
|
88
|
-
this.config = _objectSpread2(_objectSpread2({}, this.config), config);
|
|
89
|
-
},
|
|
90
|
-
getInitialValue: function getInitialValue(value, _ref2) {
|
|
91
|
-
var key = _ref2.key,
|
|
92
|
-
plugin = _ref2.plugin;
|
|
93
|
-
var propType = plugin.propType;
|
|
94
|
-
checkProp(propType, value, key);
|
|
95
|
-
return value;
|
|
96
|
-
},
|
|
97
|
-
update: function update(value, _ref3) {
|
|
98
|
-
var key = _ref3.key,
|
|
99
|
-
plugin = _ref3.plugin;
|
|
100
|
-
var propType = plugin.propType;
|
|
101
|
-
checkProp(propType, value, key, plugin.config.preventUpdate !== undefined ? plugin.config.preventUpdate : preventUpdate);
|
|
102
|
-
return value;
|
|
103
|
-
},
|
|
104
|
-
config: {
|
|
105
|
-
preventUpdate: false
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
module.exports = index;
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global["redux-astroglide/plugins/type"] = factory());
|
|
5
|
-
})(this, (function () { 'use strict';
|
|
6
|
-
|
|
7
|
-
function ownKeys(e, r) {
|
|
8
|
-
var t = Object.keys(e);
|
|
9
|
-
if (Object.getOwnPropertySymbols) {
|
|
10
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
11
|
-
r && (o = o.filter(function (r) {
|
|
12
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
13
|
-
})), t.push.apply(t, o);
|
|
14
|
-
}
|
|
15
|
-
return t;
|
|
16
|
-
}
|
|
17
|
-
function _objectSpread2(e) {
|
|
18
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
19
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
20
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
21
|
-
_defineProperty(e, r, t[r]);
|
|
22
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
23
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return e;
|
|
27
|
-
}
|
|
28
|
-
function _defineProperty(obj, key, value) {
|
|
29
|
-
key = _toPropertyKey(key);
|
|
30
|
-
if (key in obj) {
|
|
31
|
-
Object.defineProperty(obj, key, {
|
|
32
|
-
value: value,
|
|
33
|
-
enumerable: true,
|
|
34
|
-
configurable: true,
|
|
35
|
-
writable: true
|
|
36
|
-
});
|
|
37
|
-
} else {
|
|
38
|
-
obj[key] = value;
|
|
39
|
-
}
|
|
40
|
-
return obj;
|
|
41
|
-
}
|
|
42
|
-
function _toPrimitive(input, hint) {
|
|
43
|
-
if (typeof input !== "object" || input === null) return input;
|
|
44
|
-
var prim = input[Symbol.toPrimitive];
|
|
45
|
-
if (prim !== undefined) {
|
|
46
|
-
var res = prim.call(input, hint || "default");
|
|
47
|
-
if (typeof res !== "object") return res;
|
|
48
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
49
|
-
}
|
|
50
|
-
return (hint === "string" ? String : Number)(input);
|
|
51
|
-
}
|
|
52
|
-
function _toPropertyKey(arg) {
|
|
53
|
-
var key = _toPrimitive(arg, "string");
|
|
54
|
-
return typeof key === "symbol" ? key : String(key);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
var checkPropTypes$1 = {exports: {}};
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
61
|
-
*
|
|
62
|
-
* This source code is licensed under the MIT license found in the
|
|
63
|
-
* LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/
|
|
65
|
-
var ReactPropTypesSecret_1;
|
|
66
|
-
var hasRequiredReactPropTypesSecret;
|
|
67
|
-
function requireReactPropTypesSecret() {
|
|
68
|
-
if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
|
|
69
|
-
hasRequiredReactPropTypesSecret = 1;
|
|
70
|
-
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
71
|
-
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
72
|
-
return ReactPropTypesSecret_1;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Copyright Facebook, ratehub.
|
|
77
|
-
* All rights reserved.
|
|
78
|
-
*
|
|
79
|
-
* This code is intended to closely match the behaviour of checkPropTypes() from
|
|
80
|
-
* facebook/prop-types. The license for that code can be found here:
|
|
81
|
-
* https://github.com/facebook/prop-types/blob/be165febc8133dfbe2c45133db6d25664dd68ad8/LICENSE
|
|
82
|
-
*
|
|
83
|
-
* That function's source:
|
|
84
|
-
* https://github.com/facebook/prop-types/blob/be165febc8133dfbe2c45133db6d25664dd68ad8/checkPropTypes.js
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Check if the values match with the type specs
|
|
89
|
-
* Return a type error message or null
|
|
90
|
-
*
|
|
91
|
-
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
92
|
-
* @param {object} values Runtime values that need to be type-checked
|
|
93
|
-
* @param {string} location e.g. "prop", "context", "child context"
|
|
94
|
-
* @param {string} componentName Name of the component for error messages.
|
|
95
|
-
* @param {?Function} getStack Returns the component stack.
|
|
96
|
-
*/
|
|
97
|
-
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
98
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
99
|
-
const ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
100
|
-
var name = componentName || 'React class';
|
|
101
|
-
for (var typeSpecName in typeSpecs) {
|
|
102
|
-
if (typeSpecs.hasOwnProperty(typeSpecName)) {
|
|
103
|
-
var error;
|
|
104
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
105
|
-
return name + ': ' + location + ' type `' + typeSpecName + '` is ' + 'invalid; it must be a function, usually from React.PropTypes.';
|
|
106
|
-
} else {
|
|
107
|
-
// Prop type validation may throw. In case they do, catch and save the
|
|
108
|
-
// exception as the error.
|
|
109
|
-
try {
|
|
110
|
-
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
111
|
-
} catch (ex) {
|
|
112
|
-
error = ex;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
if (error && !(error instanceof Error)) {
|
|
116
|
-
return name + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker function must ' + 'return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).';
|
|
117
|
-
}
|
|
118
|
-
if (error instanceof Error) {
|
|
119
|
-
var stack = getStack && getStack() || '';
|
|
120
|
-
return 'Failed ' + location + ' type: ' + error.message + stack;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Same as checkPropTypes but throws on error
|
|
129
|
-
*/
|
|
130
|
-
function assertPropTypes() {
|
|
131
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
132
|
-
var error = checkPropTypes.apply(null, arguments);
|
|
133
|
-
if (error) {
|
|
134
|
-
throw new Error(error);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
checkPropTypes$1.exports = checkPropTypes;
|
|
139
|
-
checkPropTypes$1.exports.assertPropTypes = assertPropTypes;
|
|
140
|
-
|
|
141
|
-
var checkPropType = function checkPropType(propType, value, name) {
|
|
142
|
-
var extraProps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
143
|
-
return checkPropTypes$1.exports(_defineProperty({}, name, propType), _objectSpread2(_objectSpread2({}, extraProps), {}, _defineProperty({}, name, value)), name, undefined);
|
|
144
|
-
};
|
|
145
|
-
var checkProp = function checkProp(propType, value, name) {
|
|
146
|
-
var shouldTypeErrorPreventUpdate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
147
|
-
var result = checkPropType(propType, value, name);
|
|
148
|
-
if (result) {
|
|
149
|
-
var errorText = "Astroglide: prop ".concat(name, " with value ").concat(value, " is not of the specified type");
|
|
150
|
-
if (shouldTypeErrorPreventUpdate) {
|
|
151
|
-
throw Error(errorText);
|
|
152
|
-
} else {
|
|
153
|
-
console.warn(errorText);
|
|
154
|
-
}
|
|
155
|
-
return result;
|
|
156
|
-
}
|
|
157
|
-
return false;
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
var index = (function () {
|
|
161
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
162
|
-
preventUpdate: false
|
|
163
|
-
},
|
|
164
|
-
preventUpdate = _ref.preventUpdate;
|
|
165
|
-
return {
|
|
166
|
-
constructor: function constructor(propType, value) {
|
|
167
|
-
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
168
|
-
this.value = value; // value set here because constructor signature is different
|
|
169
|
-
this.propType = propType;
|
|
170
|
-
this.config = _objectSpread2(_objectSpread2({}, this.config), config);
|
|
171
|
-
},
|
|
172
|
-
getInitialValue: function getInitialValue(value, _ref2) {
|
|
173
|
-
var key = _ref2.key,
|
|
174
|
-
plugin = _ref2.plugin;
|
|
175
|
-
var propType = plugin.propType;
|
|
176
|
-
checkProp(propType, value, key);
|
|
177
|
-
return value;
|
|
178
|
-
},
|
|
179
|
-
update: function update(value, _ref3) {
|
|
180
|
-
var key = _ref3.key,
|
|
181
|
-
plugin = _ref3.plugin;
|
|
182
|
-
var propType = plugin.propType;
|
|
183
|
-
checkProp(propType, value, key, plugin.config.preventUpdate !== undefined ? plugin.config.preventUpdate : preventUpdate);
|
|
184
|
-
return value;
|
|
185
|
-
},
|
|
186
|
-
config: {
|
|
187
|
-
preventUpdate: false
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
return index;
|
|
193
|
-
|
|
194
|
-
}));
|