@bbn/bbn 1.0.210 → 1.0.212

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.
@@ -50,7 +50,8 @@ export default function callback(url, res, fn, fn2, ele) {
50
50
  if (isObj && res.prescript) {
51
51
  /* var ok can be changed to false in prescript execution */
52
52
  try {
53
- eval(res.prescript);
53
+ var preFn = new Function(res.prescript);
54
+ preFn();
54
55
  }
55
56
  catch (e) {
56
57
  error(e.message || '');
@@ -82,7 +83,8 @@ export default function callback(url, res, fn, fn2, ele) {
82
83
  tmp = (function (data, ele) {
83
84
  var r = null;
84
85
  try {
85
- r = eval(res.script);
86
+ var fnScript = new Function(res.script);
87
+ r = fnScript();
86
88
  if (isFunction(r)) {
87
89
  r = r(data, ele);
88
90
  }
@@ -103,7 +105,8 @@ export default function callback(url, res, fn, fn2, ele) {
103
105
  bbn.fn.defaultPostLinkFunction(res, ele);
104
106
  }
105
107
  if (tmp && isObj && res.postscript) {
106
- eval(res.postscript);
108
+ var fnPost = new Function(res.postscript);
109
+ fnPost(res.postscript);
107
110
  }
108
111
  if (isObj && res.error) {
109
112
  errTitle = res.errorTitle || bbn.lng.server_response;
@@ -36,15 +36,15 @@ export default function submit(form, e, fn) {
36
36
  //$form.attr("action", null);
37
37
  form.setAttribute('action', null);
38
38
  //$form.data("bbnSubmit", 1);
39
- if (!fn) {
40
- fn = form.getAttribute('data-script') ? eval(form.getAttribute('data-script')) : null;
39
+ var args = [url, data];
40
+ if (!fn && form.getAttribute('data-script')) {
41
+ fn = new Function(form.getAttribute('data-script'));
42
+ fn = fn();
41
43
  }
42
44
  if (fn) {
43
- post(url, data, fn);
44
- }
45
- else {
46
- post(url, data);
45
+ args.push(fn);
47
46
  }
47
+ post.apply(void 0, args);
48
48
  }
49
49
  }
50
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.210",
3
+ "version": "1.0.212",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "gitauto": "git stage ./src/* ./*.ts ./*.json ./*.config.js ./test/*.mjs && git stage -f ./dist/* && git commit -m \"Latest changes\"",
14
14
  "gitend": "git stage ./package.json && git stage -f ./dist/* && git commit -m \"Latest changes\" && git push",
15
15
  "pub": "npm version patch && npm publish",
16
- "build": "./node_modules/.bin/webpack --config webpack.config.js",
16
+ "build": "./node_modules/.bin/rollup -c",
17
17
  "all": "npm run type && npm run test && npm run gitauto && npm version patch && npm run build && npm run gitend && npm publish",
18
18
  "test": "IS_TESTING=true ./node_modules/.bin/mocha -r jsdom-global/register",
19
19
  "wtf": "echo \"Error: no test specified\" && exit 1"
@@ -29,7 +29,7 @@
29
29
  "jsdom-global": "3.0.2",
30
30
  "mocha": "^10.2.0",
31
31
  "ts-loader": "^9.5.0",
32
- "typescript": "5.1.6",
32
+ "typescript": "^5.4.5",
33
33
  "webpack": "^5.88.2",
34
34
  "webpack-cli": "^5.1.4"
35
35
  },
@@ -38,8 +38,16 @@
38
38
  },
39
39
  "homepage": "https://github.com/nabab/bbn-js#readme",
40
40
  "dependencies": {
41
+ "@rollup/plugin-commonjs": "^25.0.7",
42
+ "@rollup/plugin-json": "^6.1.0",
43
+ "@rollup/plugin-node-resolve": "^15.2.3",
44
+ "@rollup/plugin-replace": "^5.0.5",
45
+ "@rollup/plugin-terser": "^0.4.4",
46
+ "@rollup/plugin-typescript": "^11.1.6",
41
47
  "axios": "^1.5.1",
42
- "dayjs": "^1.11.10"
48
+ "dayjs": "^1.11.10",
49
+ "rollup": "^4.16.2",
50
+ "tslib": "^2.6.2"
43
51
  },
44
52
  "directories": {
45
53
  "doc": "doc",