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.1.9 to 1.1.10

0

lib/condition.js

@@ -0,0 +0,0 @@ 'use strict';

26

lib/dataType.js

@@ -7,2 +7,3 @@ 'use strict';

var BigNumber = require('bignumber.js');

@@ -30,2 +31,27 @@ /**

/**
* 将sql类型的bigint值转换成nodejs值, 大于13位的数值将使用bignumber, 否者使用number.
* @param {*} sqlValue 数据库bigint值.
*/
getValueBigInt(sqlValue) {
if (typeof sqlValue === 'string') {
if (sqlValue.length >= 13) // 对千亿以上的数值使用bignumber.
return new BigNumber(sqlValue);
else
return parseInt(sqlValue);
} else {
return sqlValue;
}
},
/**
* 将sql类型的bit值转换成nodejs值
* @param {*} sqlValue 数据库bit值.
*/
getValueBit(sqlValue) {
if (typeof sqlValue === 'boolean')
return sqlValue;
return (1==sqlValue.readUInt8(0));
},
/**
* @desc: use string.

@@ -32,0 +58,0 @@ */

@@ -0,0 +0,0 @@ 'use strict';

16

lib/mssql/adapter.js

@@ -68,8 +68,3 @@ 'use strict';

cret.insertId = ret.recordset[0].identity;
if (typeof cret.insertId === 'string') {
if (cret.insertId.length >= 13) // 对千亿以上的数值使用bignumber.
cret.insertId = new BigNumber(cret.insertId);
else
cret.insertId = parseInt(cret.insertId);
}
cret.insertId = dataType.getValueBigInt(cret.insertId);
}

@@ -98,7 +93,8 @@ } else {

if (typeof rows[i][kk.map] === 'string' && t === dataType.BigInt) {
if (rows[i][kk.map].length >= 13)
rows[i][kk.map] = new BigNumber(rows[i][kk.map]);
else
rows[i][kk.map] = parseInt(rows[i][kk.map]);
rows[i][kk.map] = dataType.getValueBigInt(rows[i][kk.map]);
}
// // fix boolean col.
// else if (t === dataType.Bit) {
// rows[i][kk.map] = dataType.getValueBit(rows[i][kk.map]);
// }
}

@@ -105,0 +101,0 @@

@@ -0,0 +0,0 @@ 'use strict';

@@ -57,8 +57,3 @@ 'use strict';

cret.insertId = ret.insertId;
if (typeof cret.insertId === 'string') {
if (cret.insertId.length >= 13) // 对千亿以上的数值使用bignumber.
cret.insertId = new BigNumber(cret.insertId);
else
cret.insertId = parseInt(cret.insertId);
}
cret.insertId = dataType.getValueBigInt(cret.insertId);
}

@@ -91,10 +86,7 @@ if (ret instanceof Array) {

if (typeof rows[i][kk.map] === 'string' && t === dataType.BigInt) {
if (rows[i][kk.map].length >= 13)
rows[i][kk.map] = new BigNumber(rows[i][kk.map]);
else
rows[i][kk.map] = parseInt(rows[i][kk.map]);
rows[i][kk.map] = dataType.getValueBigInt(rows[i][kk.map]);
}
// fix boolean col.
else if (t === dataType.Bit) {
rows[i][kk.map] = (1==rows[i][kk.map].readUInt8(0));
rows[i][kk.map] = dataType.getValueBit(rows[i][kk.map]);
}

@@ -101,0 +93,0 @@ }

@@ -0,0 +0,0 @@ 'use strict';

@@ -52,3 +52,3 @@ {

},
"version": "1.1.9"
"version": "1.1.10"
}

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

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

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,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