zet-lib 1.2.63 → 1.2.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/Util.js CHANGED
@@ -1079,6 +1079,14 @@ Util.findFilesName = (arr = [], filename = '') => {
1079
1079
  return arr.filter((item) => item.includes(filename))
1080
1080
  }
1081
1081
 
1082
+ //convert image file to base64
1083
+ Util.imageFiletoBase64 = (imgPath) => {
1084
+ // read image file
1085
+ const base64Image = fs.readFileSync(imgPath, 'base64')
1086
+ const extensionName = path.extname(imgPath)
1087
+ return `data:image/${extensionName.split('.').pop()};base64,${base64Image}`
1088
+ }
1089
+
1082
1090
  Util.getFiles = function (dir, token = '') {
1083
1091
  let arr = fs.readdirSync(dir)
1084
1092
  let folders = ''
package/lib/moduleLib.js CHANGED
@@ -270,7 +270,7 @@ m.typeahead = (req, res, table, elem) => {
270
270
  $("${element}").val("");
271
271
  $("${element}").change();
272
272
  });${Util.newLine}`
273
- script += `$("${elem}").typeahead({highlight: true,source: function (query, asyncprocess) {
273
+ script += `$("${elem}").typeahead({highlight:true,minLength:2,source: function (query, asyncprocess) {
274
274
  jQuery.ajax({
275
275
  url : "/ztypeahead/${table}/${key}",
276
276
  type : 'GET',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zet-lib",
3
- "version": "1.2.63",
3
+ "version": "1.2.65",
4
4
  "description": "zet is a library that part of zet generator.",
5
5
  "engines": {
6
6
  "node": ">=18"