@lcap/nasl
Version:
NetEase Application Specific Language
27 lines • 998 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isNoNull = exports.onlyKeyInObject = exports.onlyKeysInObject = exports.isFrontendPath = void 0;
function isFrontendPath(path) {
return (path.startsWith('app.frontendTypes') ||
path.startsWith('app.frontends') ||
path.startsWith('app.views'));
}
exports.isFrontendPath = isFrontendPath;
function isSameArray(arr1, arr2) {
const set1 = new Set(arr1);
const set2 = new Set(arr2);
return set1.size === set2.size && Array.from(set1.keys()).every((item) => set2.has(item));
}
function onlyKeysInObject(object, keys) {
return isSameArray(Object.keys(object), keys);
}
exports.onlyKeysInObject = onlyKeysInObject;
function onlyKeyInObject(object, key) {
return onlyKeysInObject(object, [key]);
}
exports.onlyKeyInObject = onlyKeyInObject;
function isNoNull(input) {
return input !== undefined && input !== null;
}
exports.isNoNull = isNoNull;
//# sourceMappingURL=utils.js.map