Files
cloudron-box/src/location.js
Girish Ramakrishnan 12e073e8cf use node: prefix for requires
mostly because code is being autogenerated by all the AI stuff using
this prefix. it's also used in the stack trace.
2025-08-14 12:55:35 +05:30

29 lines
869 B
JavaScript

'use strict';
const assert = require('node:assert');
class Location {
constructor(subdomain, domain, type, certificate) {
assert(subdomain === null || typeof subdomain === 'string');
assert(domain === null || typeof domain === 'string');
assert.strictEqual(typeof type, 'string');
this.subdomain = subdomain;
this.domain = domain;
this.type = type;
this.certificate = certificate || null;
this.fqdn = domain ? (subdomain + (subdomain ? '.' : '') + domain) : '';
}
}
// subdomain (table) types
Location.TYPE_PRIMARY = 'primary';
Location.TYPE_SECONDARY = 'secondary';
Location.TYPE_REDIRECT = 'redirect';
Location.TYPE_ALIAS = 'alias';
Location.TYPE_DASHBOARD = 'dashboard';
Location.TYPE_MAIL = 'mail';
Location.TYPE_DIRECTORY_SERVER = 'directoryserver';
exports = module.exports = Location;