Repository: ccxt/ccxt
File: ts/src/base/Exchange.ts (TypeScript)

Code before:
    }

    handleParam (params: object, paramName: string, defaultValue = undefined) {
        const value = this.safeValue (params, paramName, defaultValue);
        if (value !== undefined) {
            params = this.omit (params, paramName);
        }
        return [ value, params ];
    }

    resolvePath (path, params) {
        return [
            this.implodeParams (path, params),
            this.omit (params, this.extractParams (path)),
        ];
    }

    getListFromObjectValues (objects, key: IndexType) {
        const newArray = this.toArray (objects);
        const results = [];
        for (let i = 0; i < newArray.length; i++) {
            results.push (newArray[i][key]);
        }
        return results;
    }

    getSymbolsForMarketType (marketType: string = undefined, subType: string = undefined, activeStatuses = [ true, undefined ]) {
        let filteredMarkets = this.markets;
        if (marketType !== undefined) {
            filteredMarkets = this.filterBy (filteredMarkets, 'type', marketType);
        }
        if (subType !== undefined) {
            this.checkRequiredArgument ('getSymbolsForMarketType', subType, 'subType', [ 'linear', 'inverse', 'quanto' ]);
            filteredMarkets = this.filterBy (filteredMarkets, 'subType', subType);
        }
        filteredMarkets = this.filterByArray (filteredMarkets, 'active', activeStatuses, false);
        return this.getListFromObjectValues (filteredMarkets, 'symbol');
    }

    requireSymbolsForMultiSubscription (callerMethodName: string, symbols: string[]) {
        if (symbols === undefined) {
            throw new ArgumentsRequired (this.id + ' ' + callerMethodName + '() might allow to subscribe to all symbols at once, but to avoid unnecessary load, you still need to provide the list of symbols. You can use the helper method "exchange.getSymbolsForMarketType(marketType?, subType?)" if you want symbols array per market type.');
        }
    }

    filterByArray (objects, key: IndexType, values = undefined, indexed = true) {
        objects = this.toArray (objects);
        // return all of them if no values were passed
        if (values === undefined || !values) {
            return indexed ? this.indexBy (objects, key) : objects;
        }

Review comment (suggestion):
`tiveStatuses = [ true, undefined ]` this syntax does not work in c#/java/etc, we can't use it

Code after:
    }

    handleParamString (params: object, paramName: string, defaultValue = undefined): [string, object] {
        const value = this.safeString (params, paramName, defaultValue);
        if (value !== undefined) {
            params = this.omit (params, paramName);
        }
        return [ value, params ];
    }

    resolvePath (path, params) {
        return [
            this.implodeParams (path, params),
            this.omit (params, this.extractParams (path)),
        ];
    }

    getListFromObjectValues (objects, key: IndexType) {
        const newArray = this.toArray (objects);
        const results = [];
        for (let i = 0; i < newArray.length; i++) {
            results.push (newArray[i][key]);
        }
        return results;
    }

    getSymbolsForMarketType (marketType: string = undefined, subType: string = undefined, symbolWithActiveStatus: boolean = true, symbolWithUnknownStatus: boolean = true) {
        let filteredMarkets = this.markets;
        if (marketType !== undefined) {
            filteredMarkets = this.filterBy (filteredMarkets, 'type', marketType);
        }
        if (subType !== undefined) {
            this.checkRequiredArgument ('getSymbolsForMarketType', subType, 'subType', [ 'linear', 'inverse', 'quanto' ]);
            filteredMarkets = this.filterBy (filteredMarkets, 'subType', subType);
        }
        const activeStatuses = [];
        if (symbolWithActiveStatus) {
            activeStatuses.push (true);
        }
        if (symbolWithUnknownStatus) {
            activeStatuses.push (undefined);
        }
        filteredMarkets = this.filterByArray (filteredMarkets, 'active', activeStatuses, false);
        return this.getListFromObjectValues (filteredMarkets, 'symbol');
    }

    filterByArray (objects, key: IndexType, values = undefined, indexed = true) {
        objects = this.toArray (objects);
        // return all of them if no values were passed
        if (values === undefined || !values) {
            return indexed ? this.indexBy (objects, key) : objects;