XuqmGroup-H5SDK/node_modules/@microsoft/api-extractor-model/lib-commonjs/model/SourceLocation.js
徐勤民 e34fa2052a feat(private): add private deployment SDK module
Adds @xuqm/h5-sdk/private entry point with JSON-based initialization,
feature gating, and error codes for private deployment scenarios.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 21:08:08 +08:00

39 行
1.4 KiB
JavaScript

"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.SourceLocation = void 0;
const node_url_1 = require("node:url");
/**
* The source location where a given API item is declared.
*
* @remarks
* The source location points to the `.ts` source file where the API item was originally
declared. However, in some cases, if source map resolution fails, it falls back to pointing
to the `.d.ts` file instead.
*
* @public
*/
class SourceLocation {
constructor(options) {
this._projectFolderUrl = options.projectFolderUrl;
this._fileUrlPath = options.fileUrlPath;
}
/**
* Returns the file URL to the given source location. Returns `undefined` if the file URL
* cannot be determined.
*/
get fileUrl() {
if (this._projectFolderUrl === undefined || this._fileUrlPath === undefined) {
return undefined;
}
let projectFolderUrl = this._projectFolderUrl;
if (!projectFolderUrl.endsWith('/')) {
projectFolderUrl += '/';
}
const url = new node_url_1.URL(this._fileUrlPath, projectFolderUrl);
return url.href;
}
}
exports.SourceLocation = SourceLocation;
//# sourceMappingURL=SourceLocation.js.map