REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 3.18 KB
Close
/opt/alt/alt-nodejs18/root/lib/node_modules/npm/node_modules/@tufjs/models/dist/base.js
Text
Base64
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Signed = exports.isMetadataKind = exports.MetadataKind = void 0; const util_1 = __importDefault(require("util")); const error_1 = require("./error"); const utils_1 = require("./utils"); const SPECIFICATION_VERSION = ['1', '0', '31']; var MetadataKind; (function (MetadataKind) { MetadataKind["Root"] = "root"; MetadataKind["Timestamp"] = "timestamp"; MetadataKind["Snapshot"] = "snapshot"; MetadataKind["Targets"] = "targets"; })(MetadataKind || (exports.MetadataKind = MetadataKind = {})); function isMetadataKind(value) { return (typeof value === 'string' && Object.values(MetadataKind).includes(value)); } exports.isMetadataKind = isMetadataKind; /*** * A base class for the signed part of TUF metadata. * * Objects with base class Signed are usually included in a ``Metadata`` object * on the signed attribute. This class provides attributes and methods that * are common for all TUF metadata types (roles). */ class Signed { constructor(options) { this.specVersion = options.specVersion || SPECIFICATION_VERSION.join('.'); const specList = this.specVersion.split('.'); if (!(specList.length === 2 || specList.length === 3) || !specList.every((item) => isNumeric(item))) { throw new error_1.ValueError('Failed to parse specVersion'); } // major version must match if (specList[0] != SPECIFICATION_VERSION[0]) { throw new error_1.ValueError('Unsupported specVersion'); } this.expires = options.expires || new Date().toISOString(); this.version = options.version || 1; this.unrecognizedFields = options.unrecognizedFields || {}; } equals(other) { if (!(other instanceof Signed)) { return false; } return (this.specVersion === other.specVersion && this.expires === other.expires && this.version === other.version && util_1.default.isDeepStrictEqual(this.unrecognizedFields, other.unrecognizedFields)); } isExpired(referenceTime) { if (!referenceTime) { referenceTime = new Date(); } return referenceTime >= new Date(this.expires); } static commonFieldsFromJSON(data) { const { spec_version, expires, version, ...rest } = data; if (utils_1.guard.isDefined(spec_version) && !(typeof spec_version === 'string')) { throw new TypeError('spec_version must be a string'); } if (utils_1.guard.isDefined(expires) && !(typeof expires === 'string')) { throw new TypeError('expires must be a string'); } if (utils_1.guard.isDefined(version) && !(typeof version === 'number')) { throw new TypeError('version must be a number'); } return { specVersion: spec_version, expires, version, unrecognizedFields: rest, }; } } exports.Signed = Signed; function isNumeric(str) { return !isNaN(Number(str)); }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 13
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
utils
DIR
-
drwxr-xr-x
2026-03-19 07:09:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
base.js
3.18 KB
lrw-r--r--
2026-03-09 09:08:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
delegations.js
3.87 KB
lrw-r--r--
2026-03-09 09:08:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
error.js
1.19 KB
lrw-r--r--
2026-03-09 09:08:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
file.js
6.46 KB
lrw-r--r--
2026-03-09 09:08:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
1.86 KB
lrw-r--r--
2026-03-09 09:08:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
key.js
3.08 KB
lrw-r--r--
2026-03-09 09:08:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
metadata.js
6.10 KB
lrw-r--r--
2026-03-09 09:08:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
role.js
11.00 KB
lrw-r--r--
2026-03-09 09:08:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
root.js
4.10 KB
lrw-r--r--
2026-03-09 09:08:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
signature.js
1018 B
lrw-r--r--
2026-03-09 09:08:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
snapshot.js
2.34 KB
lrw-r--r--
2026-03-09 09:08:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
targets.js
2.99 KB
lrw-r--r--
2026-03-09 09:08:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
timestamp.js
1.96 KB
lrw-r--r--
2026-03-09 09:08:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).