业务框架数据层静态配置表Json数据生成 + 数据结构对象代码生成插件

This commit is contained in:
dgflash
2022-04-29 11:29:08 +08:00
parent 8a3ea3a9d7
commit 910376d2f5
2278 changed files with 496925 additions and 511 deletions

View File

@@ -0,0 +1,15 @@
// eslint-disable-next-line node/no-unsupported-features/node-builtins
const textEncoder = typeof TextEncoder === 'undefined' ? null : new TextEncoder('utf-8');
const {Buffer} = require('buffer');
function stringToBuffer(str) {
if (typeof str !== 'string') {
return str;
}
if (textEncoder) {
return Buffer.from(textEncoder.encode(str).buffer);
}
return Buffer.from(str);
}
exports.stringToBuffer = stringToBuffer;