@hestia-earth/api 0.17.0 → 0.17.2
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.
|
@@ -167,14 +167,8 @@ exports.isFolderUpload = function (path) { return [
|
|
|
167
167
|
exports.isAggregation,
|
|
168
168
|
exports.isGlossary
|
|
169
169
|
].some(function (f) { return f(path); }); };
|
|
170
|
-
var asString = function (v) {
|
|
171
|
-
|
|
172
|
-
? v._id.toString()
|
|
173
|
-
: typeof v === 'object' && v.id
|
|
174
|
-
? v.id.toString()
|
|
175
|
-
: v.toString();
|
|
176
|
-
};
|
|
177
|
-
exports.isOwner = function (file, user) { return asString(file.user) === asString(user); };
|
|
170
|
+
var asString = function (v) { var _a, _b; return typeof v === 'object' ? ((_a = v === null || v === void 0 ? void 0 : v._id) === null || _a === void 0 ? void 0 : _a.toString()) || ((_b = v === null || v === void 0 ? void 0 : v.id) === null || _b === void 0 ? void 0 : _b.toString()) : v === null || v === void 0 ? void 0 : v.toString(); };
|
|
171
|
+
exports.isOwner = function (file, user) { return asString(file === null || file === void 0 ? void 0 : file.user) === asString(user); };
|
|
178
172
|
exports.isAuthorized = function (_a, user) {
|
|
179
173
|
var authorizedUsers = _a.authorizedUsers;
|
|
180
174
|
return (authorizedUsers || []).map(asString).includes(asString(user));
|