jstests/libs/override_methods/inject_tenant_prefix.js
/**
 * If the database for the given namespace can be migrated, prepend a tenant prefix if one has not
 * already been applied.
 */
If the database for the given namespace can be migrated, prepend a tenant prefix if one has not
already been applied.
If the database for the given namespace can be migrated prepend a tenant prefix if one has not already been applied .
function prependTenantIdToNsIfApplicable(ns) {
    if (ns.length === 0 || !ns.includes(".")) {
        return ns;
    }
    const splitNs = ns.split(".");
    splitNs[0] = prependTenantIdToDbNameIfApplicable(splitNs[0]);
    return splitNs.join(".");
}
function prependTenantIdToNsIfApplicable ( ns ) { if ( ns . length === 0 || ! ns . includes ( "." ) ) { return ns ; } const splitNs = ns . split ( "." ) ; splitNs [ 0 ] = prependTenantIdToDbNameIfApplicable ( splitNs [ 0 ] ) ; return splitNs . join ( "." ) ; }
If the database for the given namespace can be migrated, prepend a tenant prefix if one has not
 already been applied.
If the database for the given namespace can be migrated prepend a tenant prefix if one has not already been applied .
// There are input validation tests that use invalid namespaces, those should be ignored.