dev: small changes

This commit is contained in:
KernelDeimos 2024-07-06 13:20:17 -04:00
parent d0cb0a96de
commit c8abe2380f
3 changed files with 10 additions and 9 deletions

View File

@ -17,6 +17,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("@heyputer/puter-js-common");
const Library = require("./definitions/Library");
const { NotificationES } = require("./om/entitystorage/NotificationES");
const { ProtectedAppES } = require("./om/entitystorage/ProtectedAppES");
const { Context } = require('./util/context');
@ -49,16 +50,19 @@ const install = async ({ services, app, useapi }) => {
useapi.withuse(() => {
def('Service', require('./services/BaseService'));
def('Module', AdvancedBase);
def('Library', Library);
def('puter.middlewares.auth', require('./middleware/auth2'));
});
// === LIBRARIES ===
const ArrayUtil = require('./libraries/ArrayUtil');
services.registerService('util-array', ArrayUtil);
useapi.withuse(() => {
const ArrayUtil = require('./libraries/ArrayUtil');
services.registerService('util-array', ArrayUtil);
const LibTypeTagged = require('./libraries/LibTypeTagged');
services.registerService('lib-type-tagged', LibTypeTagged);
const LibTypeTagged = require('./libraries/LibTypeTagged');
services.registerService('lib-type-tagged', LibTypeTagged);
});
// === SERVICES ===

View File

@ -1,6 +1,4 @@
const Library = require("../definitions/Library");
class ArrayUtil extends Library {
class ArrayUtil extends use.Library {
/**
*
* @param {*} marked_map

View File

@ -1,7 +1,6 @@
const Library = require("../definitions/Library");
const { whatis } = require("../util/langutil");
class LibTypeTagged extends Library {
class LibTypeTagged extends use.Library {
process (o) {
const could_be = whatis(o) === 'object' || Array.isArray(o);
if ( ! could_be ) return {