mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
dev: small changes
This commit is contained in:
parent
d0cb0a96de
commit
c8abe2380f
@ -17,6 +17,7 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
const { AdvancedBase } = require("@heyputer/puter-js-common");
|
const { AdvancedBase } = require("@heyputer/puter-js-common");
|
||||||
|
const Library = require("./definitions/Library");
|
||||||
const { NotificationES } = require("./om/entitystorage/NotificationES");
|
const { NotificationES } = require("./om/entitystorage/NotificationES");
|
||||||
const { ProtectedAppES } = require("./om/entitystorage/ProtectedAppES");
|
const { ProtectedAppES } = require("./om/entitystorage/ProtectedAppES");
|
||||||
const { Context } = require('./util/context');
|
const { Context } = require('./util/context');
|
||||||
@ -49,16 +50,19 @@ const install = async ({ services, app, useapi }) => {
|
|||||||
useapi.withuse(() => {
|
useapi.withuse(() => {
|
||||||
def('Service', require('./services/BaseService'));
|
def('Service', require('./services/BaseService'));
|
||||||
def('Module', AdvancedBase);
|
def('Module', AdvancedBase);
|
||||||
|
def('Library', Library);
|
||||||
|
|
||||||
def('puter.middlewares.auth', require('./middleware/auth2'));
|
def('puter.middlewares.auth', require('./middleware/auth2'));
|
||||||
});
|
});
|
||||||
|
|
||||||
// === LIBRARIES ===
|
// === LIBRARIES ===
|
||||||
|
useapi.withuse(() => {
|
||||||
const ArrayUtil = require('./libraries/ArrayUtil');
|
const ArrayUtil = require('./libraries/ArrayUtil');
|
||||||
services.registerService('util-array', ArrayUtil);
|
services.registerService('util-array', ArrayUtil);
|
||||||
|
|
||||||
const LibTypeTagged = require('./libraries/LibTypeTagged');
|
const LibTypeTagged = require('./libraries/LibTypeTagged');
|
||||||
services.registerService('lib-type-tagged', LibTypeTagged);
|
services.registerService('lib-type-tagged', LibTypeTagged);
|
||||||
|
});
|
||||||
|
|
||||||
// === SERVICES ===
|
// === SERVICES ===
|
||||||
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
const Library = require("../definitions/Library");
|
class ArrayUtil extends use.Library {
|
||||||
|
|
||||||
class ArrayUtil extends Library {
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {*} marked_map
|
* @param {*} marked_map
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
const Library = require("../definitions/Library");
|
|
||||||
const { whatis } = require("../util/langutil");
|
const { whatis } = require("../util/langutil");
|
||||||
|
|
||||||
class LibTypeTagged extends Library {
|
class LibTypeTagged extends use.Library {
|
||||||
process (o) {
|
process (o) {
|
||||||
const could_be = whatis(o) === 'object' || Array.isArray(o);
|
const could_be = whatis(o) === 'object' || Array.isArray(o);
|
||||||
if ( ! could_be ) return {
|
if ( ! could_be ) return {
|
||||||
|
Loading…
Reference in New Issue
Block a user