@deepkit/framework
Version:
34 lines • 1.31 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.findQuerySatisfied = findQuerySatisfied;
exports.normalizeDirectory = normalizeDirectory;
/*@ts-ignore*/
const { __ΩFilterQuery } = require('@deepkit/rpc');
/*
* Deepkit Framework
* Copyright (C) 2021 Deepkit UG, Marc J. Schmidt
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the MIT License.
*
* You should have received a copy of the MIT License along with this program.
*/
const sift_1 = __importDefault(require("sift"));
//todo: move to live-database
function findQuerySatisfied(target, query) {
//get rid of "Excessive stack depth comparing types 'any' and 'SiftQuery<T[]>'."
return sift_1.default(query, [target]).length > 0;
}
findQuerySatisfied.__type = ['target', () => __ΩFilterQuery, 'query', 'findQuerySatisfied', 'P"2!"o""2#)/$'];
function normalizeDirectory(path) {
if (path[0] !== '/')
path = '/' + path;
if (path[path.length - 1] !== '/')
path = path + '/';
return path;
}
normalizeDirectory.__type = ['path', 'normalizeDirectory', 'P&2!&/"'];
//# sourceMappingURL=utils.js.map
;