pg-promise
Advanced tools
Comparing version 11.7.0 to 11.7.1
@@ -28,3 +28,3 @@ /* | ||
* @property {function} _TN | ||
* {@link helpers._TN _TN} Table-Name template tag function. | ||
* {@link helpers._TN _TN} Table-Name conversion function. | ||
* | ||
@@ -31,0 +31,0 @@ * @property {function} ColumnSet |
@@ -142,3 +142,3 @@ /* | ||
* @description | ||
* Table-Name template tag function, to convert any `"schema.table"` string | ||
* Table-Name helper function, to convert any `"schema.table"` string | ||
* into `{schema, table}` object. | ||
@@ -149,8 +149,12 @@ * | ||
* | ||
* const cs = new ColumnSet(['id', 'name'], {table: _TN`schema.table`}); | ||
* // Using as a regular function: | ||
* const cs1 = new ColumnSet(['id', 'name'], {table: _TN('schema.table')}); | ||
* | ||
* // Using as a template-tag function: | ||
* const cs2 = new ColumnSet(['id', 'name'], {table: _TN`schema.table`}); | ||
* | ||
* @returns {Table} | ||
*/ | ||
function _TN(data) { | ||
const [schema, table] = data[0].split('.'); | ||
function _TN(s) { | ||
const [schema, table] = (s.raw ? s[0] : s).split('.'); | ||
return table === undefined ? {table: schema} : {schema, table}; | ||
@@ -157,0 +161,0 @@ } |
{ | ||
"name": "pg-promise", | ||
"version": "11.7.0", | ||
"version": "11.7.1", | ||
"description": "PostgreSQL interface for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -711,3 +711,3 @@ /* | ||
_TN: (data: TemplateStringsArray) => ITable | ||
_TN: (data: TemplateStringsArray | string) => ITable | ||
} | ||
@@ -714,0 +714,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
424444
9796