Files
marketing-app/server/node_modules/ip-address/dist/common.js
fahed 35d84b6bff Marketing Hub: RBAC, i18n (AR/EN), tasks overhaul, team/user merge, tutorial
Features:
- Full RBAC with 3 roles (superadmin/manager/contributor)
- Ownership tracking on posts, tasks, campaigns, projects
- Task system: assign to anyone, filter combobox, visibility scoping
- Team members merged into users table (single source of truth)
- Post thumbnails on kanban cards from attachments
- Publication link validation before publishing
- Interactive onboarding tutorial with Settings restart
- Full Arabic/English i18n with RTL layout support
- Language toggle in sidebar, IBM Plex Sans Arabic font
- Brand-based visibility filtering for non-superadmins
- Manager can only create contributors
- Profile completion flow for new users
- Cookie-based sessions (express-session + SQLite)
2026-02-08 20:46:58 +03:00

46 lines
1.4 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isInSubnet = isInSubnet;
exports.isCorrect = isCorrect;
exports.numberToPaddedHex = numberToPaddedHex;
exports.stringToPaddedHex = stringToPaddedHex;
exports.testBit = testBit;
function isInSubnet(address) {
if (this.subnetMask < address.subnetMask) {
return false;
}
if (this.mask(address.subnetMask) === address.mask()) {
return true;
}
return false;
}
function isCorrect(defaultBits) {
return function () {
if (this.addressMinusSuffix !== this.correctForm()) {
return false;
}
if (this.subnetMask === defaultBits && !this.parsedSubnet) {
return true;
}
return this.parsedSubnet === String(this.subnetMask);
};
}
function numberToPaddedHex(number) {
return number.toString(16).padStart(2, '0');
}
function stringToPaddedHex(numberString) {
return numberToPaddedHex(parseInt(numberString, 10));
}
/**
* @param binaryValue Binary representation of a value (e.g. `10`)
* @param position Byte position, where 0 is the least significant bit
*/
function testBit(binaryValue, position) {
const { length } = binaryValue;
if (position > length) {
return false;
}
const positionInString = length - position;
return binaryValue.substring(positionInString, positionInString + 1) === '1';
}
//# sourceMappingURL=common.js.map