@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
- return typeof v === 'object' && v._id
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));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/api",
3
- "version": "0.17.0",
3
+ "version": "0.17.2",
4
4
  "description": "Hestia API definitions",
5
5
  "main": "dist/models.js",
6
6
  "typings": "dist/models.d.ts",