Skip to content

Commit c8abe23

Browse files
committed
dev: small changes
1 parent d0cb0a9 commit c8abe23

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

packages/backend/src/CoreModule.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
*/
1919
const { AdvancedBase } = require("@heyputer/puter-js-common");
20+
const Library = require("./definitions/Library");
2021
const { NotificationES } = require("./om/entitystorage/NotificationES");
2122
const { ProtectedAppES } = require("./om/entitystorage/ProtectedAppES");
2223
const { Context } = require('./util/context');
@@ -49,16 +50,19 @@ const install = async ({ services, app, useapi }) => {
4950
useapi.withuse(() => {
5051
def('Service', require('./services/BaseService'));
5152
def('Module', AdvancedBase);
53+
def('Library', Library);
5254

5355
def('puter.middlewares.auth', require('./middleware/auth2'));
5456
});
5557

5658
// === LIBRARIES ===
57-
const ArrayUtil = require('./libraries/ArrayUtil');
58-
services.registerService('util-array', ArrayUtil);
59+
useapi.withuse(() => {
60+
const ArrayUtil = require('./libraries/ArrayUtil');
61+
services.registerService('util-array', ArrayUtil);
5962

60-
const LibTypeTagged = require('./libraries/LibTypeTagged');
61-
services.registerService('lib-type-tagged', LibTypeTagged);
63+
const LibTypeTagged = require('./libraries/LibTypeTagged');
64+
services.registerService('lib-type-tagged', LibTypeTagged);
65+
});
6266

6367
// === SERVICES ===
6468

packages/backend/src/libraries/ArrayUtil.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
const Library = require("../definitions/Library");
2-
3-
class ArrayUtil extends Library {
1+
class ArrayUtil extends use.Library {
42
/**
53
*
64
* @param {*} marked_map

packages/backend/src/libraries/LibTypeTagged.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
const Library = require("../definitions/Library");
21
const { whatis } = require("../util/langutil");
32

4-
class LibTypeTagged extends Library {
3+
class LibTypeTagged extends use.Library {
54
process (o) {
65
const could_be = whatis(o) === 'object' || Array.isArray(o);
76
if ( ! could_be ) return {

0 commit comments

Comments
 (0)