mirror of
https://gitee.com/dgflash/oops-framework.git
synced 2026-05-28 18:56:17 +08:00
业务框架数据层静态配置表Json数据生成 + 数据结构对象代码生成插件
This commit is contained in:
15
extensions/oops-plugin-excel-to-json/node_modules/exceljs/lib/utils/browser-buffer-encode.js
generated
vendored
Normal file
15
extensions/oops-plugin-excel-to-json/node_modules/exceljs/lib/utils/browser-buffer-encode.js
generated
vendored
Normal 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;
|
||||
Reference in New Issue
Block a user