@util.js/privates 0.41.2 → 0.41.4
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 +0 -1
- package/dist/Privates.js +10 -15
- package/package.json +4 -4
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
<p>
|
|
6
6
|
<a href="https://www.npmjs.com/package/@util.js/privates"><img alt="NPM Status" src="https://img.shields.io/npm/v/@util.js/privates.svg?style=flat"></a>
|
|
7
|
-
<a href="https://travis-ci.org/creemama/utiljs"><img alt="Travis CI Build Status" src="https://img.shields.io/travis/creemama/utiljs/master.svg?style=flat-square&label=Travis+CI"></a>
|
|
8
7
|
</p>
|
|
9
8
|
|
|
10
9
|
@util.js/privates is part of [Util.js](https://github.com/creemama/utiljs).
|
package/dist/Privates.js
CHANGED
|
@@ -53,7 +53,7 @@ module.exports = /*#__PURE__*/function () {
|
|
|
53
53
|
* @public
|
|
54
54
|
* @function Privates#call
|
|
55
55
|
*/
|
|
56
|
-
(0, _createClass2["default"])(Privates, [{
|
|
56
|
+
return (0, _createClass2["default"])(Privates, [{
|
|
57
57
|
key: "call",
|
|
58
58
|
value: function call(thiz, property) {
|
|
59
59
|
try {
|
|
@@ -166,16 +166,16 @@ module.exports = /*#__PURE__*/function () {
|
|
|
166
166
|
properties[_key2 - 1] = arguments[_key2];
|
|
167
167
|
}
|
|
168
168
|
(0, _forEach["default"])(properties).call(properties, function (currentProperties) {
|
|
169
|
-
var
|
|
170
|
-
(0, _forEach["default"])(
|
|
169
|
+
var _context0, _context1;
|
|
170
|
+
(0, _forEach["default"])(_context0 = (0, _entries["default"])(currentProperties)).call(_context0, function (_ref5) {
|
|
171
171
|
var _ref6 = (0, _slicedToArray2["default"])(_ref5, 2),
|
|
172
172
|
property = _ref6[0],
|
|
173
173
|
value = _ref6[1];
|
|
174
174
|
return t.set(thiz, property, value);
|
|
175
175
|
});
|
|
176
|
-
(0, _forEach["default"])(
|
|
177
|
-
var
|
|
178
|
-
return t.set(thiz, method, (0, _bind["default"])(
|
|
176
|
+
(0, _forEach["default"])(_context1 = getAllMethods(currentProperties)).call(_context1, function (method) {
|
|
177
|
+
var _context10;
|
|
178
|
+
return t.set(thiz, method, (0, _bind["default"])(_context10 = currentProperties[method]).call(_context10, currentProperties));
|
|
179
179
|
});
|
|
180
180
|
});
|
|
181
181
|
}
|
|
@@ -186,13 +186,10 @@ module.exports = /*#__PURE__*/function () {
|
|
|
186
186
|
for (var _len3 = arguments.length, properties = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
187
187
|
properties[_key3 - 1] = arguments[_key3];
|
|
188
188
|
}
|
|
189
|
-
for (var i = 0; i < properties.length; i++)
|
|
190
|
-
object[properties[i]] = this.get(thiz, properties[i]);
|
|
191
|
-
}
|
|
189
|
+
for (var i = 0; i < properties.length; i++) object[properties[i]] = this.get(thiz, properties[i]);
|
|
192
190
|
return object;
|
|
193
191
|
}
|
|
194
192
|
}]);
|
|
195
|
-
return Privates;
|
|
196
193
|
}();
|
|
197
194
|
function getPropertyErrorString(property) {
|
|
198
195
|
// https://stackoverflow.com/a/7772724
|
|
@@ -212,10 +209,10 @@ function getAllMethods(obj) {
|
|
|
212
209
|
if (!(0, _getPrototypeOf["default"])(obj)) return [];
|
|
213
210
|
var props = [];
|
|
214
211
|
do {
|
|
215
|
-
var
|
|
216
|
-
var l = (0, _filter["default"])(
|
|
212
|
+
var _context11, _context12, _context13, _context14;
|
|
213
|
+
var l = (0, _filter["default"])(_context11 = (0, _sort["default"])(_context12 = (0, _concat["default"])(_context13 = (0, _getOwnPropertyNames["default"])(obj)).call(_context13, (0, _map["default"])(_context14 = (0, _getOwnPropertySymbols["default"])(obj)).call(_context14, function (s) {
|
|
217
214
|
return s.toString();
|
|
218
|
-
}))).call(
|
|
215
|
+
}))).call(_context12)).call(_context11, function (p, i, arr) {
|
|
219
216
|
return typeof obj[p] === "function" &&
|
|
220
217
|
// only the methods
|
|
221
218
|
p !== "constructor" && (
|
|
@@ -225,12 +222,10 @@ function getAllMethods(obj) {
|
|
|
225
222
|
(0, _indexOf["default"])(props).call(props, p) === -1;
|
|
226
223
|
} // not overridden in a child
|
|
227
224
|
);
|
|
228
|
-
|
|
229
225
|
props = (0, _concat["default"])(props).call(props, l);
|
|
230
226
|
} while ((obj = (0, _getPrototypeOf["default"])(obj)) &&
|
|
231
227
|
// walk-up the prototype chain
|
|
232
228
|
(0, _getPrototypeOf["default"])(obj) // not the the Object prototype methods (hasOwnProperty, etc...)
|
|
233
229
|
);
|
|
234
|
-
|
|
235
230
|
return props;
|
|
236
231
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Chris Topher <c@creemama.com>",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@babel/runtime-corejs3": "7.
|
|
5
|
-
"@util.js/errors": "0.41.
|
|
4
|
+
"@babel/runtime-corejs3": "7.29.7",
|
|
5
|
+
"@util.js/errors": "0.41.4"
|
|
6
6
|
},
|
|
7
7
|
"description": "JavaScript utility class for private member variables",
|
|
8
8
|
"keywords": [
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
"type": "git",
|
|
30
30
|
"url": "https://github.com/creemama/utiljs/tree/master/packages/utiljs-privates"
|
|
31
31
|
},
|
|
32
|
-
"version": "0.41.
|
|
33
|
-
"gitHead": "
|
|
32
|
+
"version": "0.41.4",
|
|
33
|
+
"gitHead": "2119863a175cf7095ca3a2417e61af32974add15"
|
|
34
34
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright 2018 Chris Topher (c@creemama.com)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
-
the Software without restriction, including without limitation the rights to
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
9
|
-
of the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
-
so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|