"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.CdmImportCollection = void 0;
const util_1 = require("util");
const internal_1 = require("../internal");
class CdmImportCollection extends internal_1.CdmCollection {
    constructor(ctx, owner) {
        super(ctx, owner, internal_1.cdmObjectType.import);
    }
    get owner() {
        return super.owner;
    }
    set owner(value) {
        super.owner = value;
    }
    /**
     * @inheritdoc
     */
    push(parameter, moniker) {
        const obj = super.push(parameter);
        if (moniker !== undefined && util_1.isString(moniker)) {
            obj.moniker = moniker;
        }
        return obj;
    }
    item(corpusPath, moniker, checkMoniker = true) {
        return this.allItems.find((x) => checkMoniker ? x.corpusPath === corpusPath && x.moniker === moniker : x.corpusPath === corpusPath);
    }
}
exports.CdmImportCollection = CdmImportCollection;
//# sourceMappingURL=CdmImportCollection.js.map