@util.js/privates 0.41.3 → 0.41.5

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
@@ -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 _context10, _context11;
170
- (0, _forEach["default"])(_context10 = (0, _entries["default"])(currentProperties)).call(_context10, function (_ref5) {
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"])(_context11 = getAllMethods(currentProperties)).call(_context11, function (method) {
177
- var _context12;
178
- return t.set(thiz, method, (0, _bind["default"])(_context12 = currentProperties[method]).call(_context12, currentProperties));
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
  }
@@ -190,7 +190,6 @@ module.exports = /*#__PURE__*/function () {
190
190
  return object;
191
191
  }
192
192
  }]);
193
- return Privates;
194
193
  }();
195
194
  function getPropertyErrorString(property) {
196
195
  // https://stackoverflow.com/a/7772724
@@ -210,10 +209,10 @@ function getAllMethods(obj) {
210
209
  if (!(0, _getPrototypeOf["default"])(obj)) return [];
211
210
  var props = [];
212
211
  do {
213
- var _context13, _context14, _context15, _context16;
214
- var l = (0, _filter["default"])(_context13 = (0, _sort["default"])(_context14 = (0, _concat["default"])(_context15 = (0, _getOwnPropertyNames["default"])(obj)).call(_context15, (0, _map["default"])(_context16 = (0, _getOwnPropertySymbols["default"])(obj)).call(_context16, function (s) {
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) {
215
214
  return s.toString();
216
- }))).call(_context14)).call(_context13, function (p, i, arr) {
215
+ }))).call(_context12)).call(_context11, function (p, i, arr) {
217
216
  return typeof obj[p] === "function" &&
218
217
  // only the methods
219
218
  p !== "constructor" && (
@@ -223,12 +222,10 @@ function getAllMethods(obj) {
223
222
  (0, _indexOf["default"])(props).call(props, p) === -1;
224
223
  } // not overridden in a child
225
224
  );
226
-
227
225
  props = (0, _concat["default"])(props).call(props, l);
228
226
  } while ((obj = (0, _getPrototypeOf["default"])(obj)) &&
229
227
  // walk-up the prototype chain
230
228
  (0, _getPrototypeOf["default"])(obj) // not the the Object prototype methods (hasOwnProperty, etc...)
231
229
  );
232
-
233
230
  return props;
234
231
  }
package/lib/Privates.js CHANGED
@@ -46,7 +46,7 @@ module.exports = class Privates {
46
46
  const propertyStr = getPropertyErrorString(property);
47
47
  throw new RethrownError(
48
48
  e,
49
- `privates.call(${thiz}, ${propertyStr}) failed. ${e.message}`
49
+ `privates.call(${thiz}, ${propertyStr}) failed. ${e.message}`,
50
50
  );
51
51
  }
52
52
  }
@@ -58,7 +58,7 @@ module.exports = class Privates {
58
58
  const propertyStr = getPropertyErrorString(property);
59
59
  throw new RethrownError(
60
60
  e,
61
- `privates.get(${thiz}, ${propertyStr}) failed. ${e.message}`
61
+ `privates.get(${thiz}, ${propertyStr}) failed. ${e.message}`,
62
62
  );
63
63
  }
64
64
  }
@@ -83,7 +83,7 @@ module.exports = class Privates {
83
83
  try {
84
84
  const lambdaProperties = {};
85
85
  Object.entries(properties).forEach(
86
- ([property, value]) => (lambdaProperties[property] = () => value)
86
+ ([property, value]) => (lambdaProperties[property] = () => value),
87
87
  );
88
88
  return lambdaProperties;
89
89
  } catch (e) {
@@ -95,7 +95,7 @@ module.exports = class Privates {
95
95
  lazyLoad(thiz, property, lazyLoadFunction) {
96
96
  if (typeof lazyLoadFunction !== "function")
97
97
  throw new TypeError(
98
- `lazyLoadFunction (${lazyLoadFunction}) must be a function.`
98
+ `lazyLoadFunction (${lazyLoadFunction}) must be a function.`,
99
99
  );
100
100
  let value;
101
101
  let loaded = false;
@@ -113,7 +113,7 @@ module.exports = class Privates {
113
113
  lazilyLoadedProperties.forEach((currentProperties) => {
114
114
  Object.entries(currentProperties).forEach(
115
115
  ([property, lazyLoadFunction]) =>
116
- t.lazyLoad(thiz, property, lazyLoadFunction)
116
+ t.lazyLoad(thiz, property, lazyLoadFunction),
117
117
  );
118
118
  });
119
119
  }
@@ -125,7 +125,7 @@ module.exports = class Privates {
125
125
  const propertyStr = getPropertyErrorString(property);
126
126
  throw new RethrownError(
127
127
  e,
128
- `privates.set(${thiz}, ${propertyStr}, ${newValue}) failed. ${e.message}`
128
+ `privates.set(${thiz}, ${propertyStr}, ${newValue}) failed. ${e.message}`,
129
129
  );
130
130
  }
131
131
  }
@@ -134,10 +134,10 @@ module.exports = class Privates {
134
134
  const t = this;
135
135
  properties.forEach((currentProperties) => {
136
136
  Object.entries(currentProperties).forEach(([property, value]) =>
137
- t.set(thiz, property, value)
137
+ t.set(thiz, property, value),
138
138
  );
139
139
  getAllMethods(currentProperties).forEach((method) =>
140
- t.set(thiz, method, currentProperties[method].bind(currentProperties))
140
+ t.set(thiz, method, currentProperties[method].bind(currentProperties)),
141
141
  );
142
142
  });
143
143
  }
@@ -180,7 +180,7 @@ function getAllMethods(obj) {
180
180
  typeof obj[p] === "function" && // only the methods
181
181
  p !== "constructor" && // not the constructor
182
182
  (i === 0 || p !== arr[i - 1]) && // not overriding in this prototype
183
- props.indexOf(p) === -1 // not overridden in a child
183
+ props.indexOf(p) === -1, // not overridden in a child
184
184
  );
185
185
  props = props.concat(l);
186
186
  } while (
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.21.0",
5
- "@util.js/errors": "0.41.3"
4
+ "@babel/runtime-corejs3": "7.29.7",
5
+ "@util.js/errors": "0.41.5"
6
6
  },
7
7
  "description": "JavaScript utility class for private member variables",
8
8
  "keywords": [
@@ -29,6 +29,5 @@
29
29
  "type": "git",
30
30
  "url": "https://github.com/creemama/utiljs/tree/master/packages/utiljs-privates"
31
31
  },
32
- "version": "0.41.3",
33
- "gitHead": "e17139b7f85c3abec178d8facdacc2aa6c5bb553"
32
+ "version": "0.41.5"
34
33
  }
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.