function _TN(path, ...args) {
    if (Array.isArray(path)) {
        path = path.reduce((a, c, i) => a + c + (args[i] ?? ''), '');
    } // else 'path' is a string
    const [schema, table] = path.split('.');
    if (table === undefined) {
        return {table: schema};
    }
    return schema ? {schema, table} : {table};
}
@function helpers._TN
@description
Table-Name helper function, to convert any `"schema.table"` string
into `{schema, table}` object. It also works as a template-tag function.

@param {string|TemplateStringsArray} path
Table-name path, as a simple string or a template string (with parameters).

@example
const {ColumnSet, _TN} = pgp.helpers;

// Using as a regular function:
const cs1 = new ColumnSet(['id', 'name'], {table: _TN('schema.table')});

// Using as a template-tag function:
const schema = 'schema';
const cs2 = new ColumnSet(['id', 'name'], {table: _TN`${schema}.table`});

@returns {Table}

@see {@link helpers.TableName TableName}, {@link external:TemplateStringsArray TemplateStringsArray}