@azrico/webobject 1.2.31 → 1.2.32
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/README.md +52 -52
- package/dist/index.js +0 -2
- package/dist/src/WebObjects/ParentWebObject.js +5 -29
- package/dist/src/WebObjects/WebObject.d.ts +1 -1
- package/dist/src/WebObjects/WebObject.js +284 -462
- package/dist/src/WebObjects/WebObjectManager.d.ts +1 -0
- package/dist/src/WebObjects/WebObjectManager.js +134 -209
- package/dist/src/index.js +0 -18
- package/dist/src/structs/DummyObject.js +3 -22
- package/dist/src/structs/MapableObject.js +4 -35
- package/dist/src/structs/MetaObject.js +28 -74
- package/dist/src/structs/ObjectArray.d.ts +1 -1
- package/dist/src/structs/ObjectArray.js +5 -17
- package/dist/src/structs/ObjectManager.d.ts +4 -4
- package/dist/src/structs/ObjectManager.js +152 -295
- package/dist/src/structs/SimpleObject.d.ts +8 -8
- package/dist/src/structs/SimpleObject.js +185 -414
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
# deus-object
|
|
2
|
-
|
|
3
|
-
> Some useful object functions
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install --save deus-object
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Functions
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
object_clone(object);
|
|
15
|
-
object_first(object);
|
|
16
|
-
object_update(a, b);
|
|
17
|
-
object_delta(a, b);
|
|
18
|
-
object_has_delta(object);
|
|
19
|
-
object_equals(a, b);
|
|
20
|
-
isEmpty(object);
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
```js
|
|
26
|
-
import React, { Component } from 'react'
|
|
27
|
-
import { View } from 'react-native'
|
|
28
|
-
import FuncObject from 'deus-object'
|
|
29
|
-
|
|
30
|
-
class Example extends Component {
|
|
31
|
-
|
|
32
|
-
let eq1=FuncObject.object_equals({a:"b"},{a:"b"});//true
|
|
33
|
-
let eq2=FuncObject.object_equals({a:"b"},{a:"c"});//false
|
|
34
|
-
|
|
35
|
-
let ie1=FuncObject.isEmpty({}); //true
|
|
36
|
-
let ie2=FuncObject.isEmpty([]); //true
|
|
37
|
-
let ie3=FuncObject.isEmpty(null);//true
|
|
38
|
-
let ie4=FuncObject.isEmpty({test:"a"});//false
|
|
39
|
-
|
|
40
|
-
let if1=FuncObject.object_first({a:"a",b:"b",c:"c"});// a:"a"
|
|
41
|
-
let if2=FuncObject.object_first([1,2,3,4]);//1
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
render() {
|
|
45
|
-
return <View></View>
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## License
|
|
51
|
-
|
|
52
|
-
MIT © [](https://github.com/)
|
|
1
|
+
# deus-object
|
|
2
|
+
|
|
3
|
+
> Some useful object functions
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install --save deus-object
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Functions
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
object_clone(object);
|
|
15
|
+
object_first(object);
|
|
16
|
+
object_update(a, b);
|
|
17
|
+
object_delta(a, b);
|
|
18
|
+
object_has_delta(object);
|
|
19
|
+
object_equals(a, b);
|
|
20
|
+
isEmpty(object);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import React, { Component } from 'react'
|
|
27
|
+
import { View } from 'react-native'
|
|
28
|
+
import FuncObject from 'deus-object'
|
|
29
|
+
|
|
30
|
+
class Example extends Component {
|
|
31
|
+
|
|
32
|
+
let eq1=FuncObject.object_equals({a:"b"},{a:"b"});//true
|
|
33
|
+
let eq2=FuncObject.object_equals({a:"b"},{a:"c"});//false
|
|
34
|
+
|
|
35
|
+
let ie1=FuncObject.isEmpty({}); //true
|
|
36
|
+
let ie2=FuncObject.isEmpty([]); //true
|
|
37
|
+
let ie3=FuncObject.isEmpty(null);//true
|
|
38
|
+
let ie4=FuncObject.isEmpty({test:"a"});//false
|
|
39
|
+
|
|
40
|
+
let if1=FuncObject.object_first({a:"a",b:"b",c:"c"});// a:"a"
|
|
41
|
+
let if2=FuncObject.object_first([1,2,3,4]);//1
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
render() {
|
|
45
|
+
return <View></View>
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT © [](https://github.com/)
|
package/dist/index.js
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
var _index = require("./src/index");
|
|
8
|
-
|
|
9
7
|
Object.keys(_index).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _index[key]) return;
|
|
@@ -1,60 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports["default"] = exports.ParentWebObject = void 0;
|
|
9
|
-
|
|
10
7
|
var _WebObject2 = _interopRequireDefault(require("./WebObject"));
|
|
11
|
-
|
|
12
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
9
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
14
10
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
15
|
-
|
|
16
|
-
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); } }
|
|
17
|
-
|
|
11
|
+
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
18
12
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
19
|
-
|
|
20
13
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
21
|
-
|
|
22
14
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
23
|
-
|
|
24
15
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
25
|
-
|
|
26
16
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
27
|
-
|
|
28
17
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
29
|
-
|
|
30
18
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
31
|
-
|
|
32
19
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
20
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
22
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
36
23
|
/**
|
|
37
24
|
* This web object contains some more webobjects
|
|
38
25
|
*/
|
|
39
26
|
var ParentWebObject = /*#__PURE__*/function (_WebObject) {
|
|
40
27
|
_inherits(ParentWebObject, _WebObject);
|
|
41
|
-
|
|
42
28
|
var _super = _createSuper(ParentWebObject);
|
|
43
|
-
|
|
44
29
|
function ParentWebObject() {
|
|
45
30
|
var _this;
|
|
46
|
-
|
|
47
31
|
var is_readonly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
48
|
-
|
|
49
32
|
_classCallCheck(this, ParentWebObject);
|
|
50
|
-
|
|
51
33
|
_this = _super.call(this, is_readonly);
|
|
52
|
-
|
|
53
34
|
_defineProperty(_assertThisInitialized(_this), "__children", undefined);
|
|
54
|
-
|
|
55
35
|
return _this;
|
|
56
36
|
}
|
|
57
|
-
|
|
58
37
|
_createClass(ParentWebObject, [{
|
|
59
38
|
key: "set_children",
|
|
60
39
|
value: function set_children(val) {
|
|
@@ -64,14 +43,11 @@ var ParentWebObject = /*#__PURE__*/function (_WebObject) {
|
|
|
64
43
|
v.__parent__table_id = selftableid;
|
|
65
44
|
});
|
|
66
45
|
} else val = [];
|
|
67
|
-
|
|
68
46
|
this.__children = val;
|
|
69
47
|
}
|
|
70
48
|
}]);
|
|
71
|
-
|
|
72
49
|
return ParentWebObject;
|
|
73
50
|
}(_WebObject2["default"]);
|
|
74
|
-
|
|
75
51
|
exports.ParentWebObject = ParentWebObject;
|
|
76
52
|
var _default = ParentWebObject;
|
|
77
53
|
exports["default"] = _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import SimpleObject, { sendChangesType } from "../structs/SimpleObject";
|
|
2
2
|
import MetaObject from "../structs/MetaObject";
|
|
3
3
|
import WebObjectManager from "./WebObjectManager";
|
|
4
|
-
export
|
|
4
|
+
export type deltaParams = {
|
|
5
5
|
type?: string;
|
|
6
6
|
isChild?: boolean;
|
|
7
7
|
useDelta?: boolean;
|