diff --git a/lib/helpers/table-name.js b/lib/helpers/table-name.js index a5b310ec..ed6a73ab 100644 --- a/lib/helpers/table-name.js +++ b/lib/helpers/table-name.js @@ -169,7 +169,8 @@ npm.utils.addInspection(TableName, function () { */ function _TN(path, ...args) { if (Array.isArray(path) && path.raw) { - path = path.map((b, i) => b + (i < args.length ? args[i] ?? '' : '')).join(''); + const v = i => i < args.length ? args[i] ?? '' : ''; + path = path.reduce((a, c, i) => a + c + v(i), ''); } // else 'path' is a string const [schema, table] = path.split('.'); if (table === undefined) { diff --git a/package.json b/package.json index 3e017d00..1faa7cc8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pg-promise", - "version": "11.7.7", + "version": "11.7.8", "description": "PostgreSQL interface for Node.js", "main": "lib/index.js", "typings": "typescript/pg-promise.d.ts",