Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

febs-db

Package Overview
Dependencies
Maintainers
1
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

febs-db - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

10

lib/database.js

@@ -95,6 +95,12 @@ 'use strict';

* @desc: 转换查询结果中的数据,按类型转换.
* 一次查询结果只能进行一次数据转换, 转换多次会出现结果错误.
* @return:
*/
database.prototype.ret_data_cvt = function(rows, table) {
return this.adapter.ret_data_cvt(rows, table);
database.prototype.ret_data_cvt = function(rows, ...table) {
let ret;
let mapObj = {};
for (let i = 0; i < table.length; i++) {
ret = this.adapter.ret_data_cvt(rows, table[i], mapObj);
}
return ret;
}

@@ -101,0 +107,0 @@

12

lib/mssql/adapter.js

@@ -85,5 +85,6 @@ 'use strict';

* @desc: 转换查询结果中的数据,按类型转换.
* @param alreadyCvt: 用于防止重复转换.
* @return:
*/
function ret_data_cvt(rows, table) {
function ret_data_cvt(rows, table, alreadyCvt = null) {
for (let i = 0; i < rows.length; i++) {

@@ -97,2 +98,11 @@ delete rows['RowNumber'];

if (kk) {
if (alreadyCvt) {
// 转换过不再处理.
if (alreadyCvt[kk])
continue;
alreadyCvt[kk] = true;
}
let t = dataType.getType(kk.type);

@@ -99,0 +109,0 @@ // fix bigint col.

@@ -81,5 +81,6 @@ 'use strict';

* @desc: 转换查询结果中的数据,按类型转换.
* @param alreadyCvt: 用于防止重复转换.
* @return:
*/
function ret_data_cvt(rows, table) {
function ret_data_cvt(rows, table, alreadyCvt = null) {
for (let i = 0; i < rows.length; i++) {

@@ -92,2 +93,11 @@ for (let k in rows[i]) {

if (kk) {
if (alreadyCvt) {
// 转换过不再处理.
if (alreadyCvt[kk])
continue;
alreadyCvt[kk] = true;
}
let t = dataType.getType(kk.type);

@@ -94,0 +104,0 @@ // fix bigint col.

@@ -54,3 +54,3 @@ {

},
"version": "1.3.2"
"version": "1.3.3"
}

@@ -817,3 +817,3 @@ febs db库用于连接数据库

*/
ret_data_cvt(rows, table)
ret_data_cvt(rows, ...table)
```

@@ -820,0 +820,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc