@azrico/webobject 1.3.20 → 1.3.22

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 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
@@ -1,16 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _index = require("./src/index");
7
- Object.keys(_index).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _index[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function get() {
13
- return _index[key];
14
- }
15
- });
16
- });
1
+ export * from "./src/index";
@@ -1,53 +1,22 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = exports.ParentWebObject = void 0;
7
- var _WebObject2 = _interopRequireDefault(require("./WebObject"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
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); }
10
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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); } }
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; }
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); }
14
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
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); }; }
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); }
17
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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; } }
19
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
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); }
1
+ import WebObject from "./WebObject";
23
2
  /**
24
3
  * This web object contains some more webobjects
25
- */
26
- var ParentWebObject = /*#__PURE__*/function (_WebObject) {
27
- _inherits(ParentWebObject, _WebObject);
28
- var _super = _createSuper(ParentWebObject);
29
- function ParentWebObject() {
30
- var _this;
31
- var is_readonly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
32
- _classCallCheck(this, ParentWebObject);
33
- _this = _super.call(this, is_readonly);
34
- _defineProperty(_assertThisInitialized(_this), "__children", undefined);
35
- return _this;
36
- }
37
- _createClass(ParentWebObject, [{
38
- key: "set_children",
39
- value: function set_children(val) {
40
- if (Array.isArray(val)) {
41
- var selftableid = this.__table_id;
42
- val.forEach(function (v) {
43
- v.__parent__table_id = selftableid;
44
- });
45
- } else val = [];
46
- this.__children = val;
47
- }
48
- }]);
49
- return ParentWebObject;
50
- }(_WebObject2["default"]);
51
- exports.ParentWebObject = ParentWebObject;
52
- var _default = ParentWebObject;
53
- exports["default"] = _default;
4
+ */
5
+ export class ParentWebObject extends WebObject {
6
+ constructor(is_readonly = false) {
7
+ super(is_readonly);
8
+ }
9
+ __children = undefined;
10
+ set_children(val) {
11
+ if (Array.isArray(val)) {
12
+ const selftableid = this.__table_id;
13
+ val.forEach((v) => {
14
+ v.__parent__table_id = selftableid;
15
+ });
16
+ }
17
+ else
18
+ val = [];
19
+ this.__children = val;
20
+ }
21
+ }
22
+ export default ParentWebObject;