@util.js/privates 0.41.4 → 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/lib/Privates.js +9 -9
- package/package.json +2 -3
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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "Chris Topher <c@creemama.com>",
|
|
3
3
|
"dependencies": {
|
|
4
4
|
"@babel/runtime-corejs3": "7.29.7",
|
|
5
|
-
"@util.js/errors": "0.41.
|
|
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.
|
|
33
|
-
"gitHead": "2119863a175cf7095ca3a2417e61af32974add15"
|
|
32
|
+
"version": "0.41.5"
|
|
34
33
|
}
|