@bbn/bbn 1.0.268 → 1.0.270

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.
@@ -111,7 +111,7 @@ export default function analyzeFunction(fn) {
111
111
  args.push(currentArg);
112
112
  currentArg = {};
113
113
  isArrow = true;
114
- i++;
114
+ body = bbn.fn.substr(all, i + 2).trim();
115
115
  break;
116
116
  }
117
117
  else if (all[i] === "=" && all[i + 1] === ">") {
@@ -0,0 +1,6 @@
1
+ /**
2
+ *
3
+ * @param {String} varName
4
+ * @returns {String}
5
+ */
6
+ export default function firstVarElement(varName: any): any;
@@ -0,0 +1,19 @@
1
+ /**
2
+ *
3
+ * @param {String} varName
4
+ * @returns {String}
5
+ */
6
+ export default function firstVarElement(varName) {
7
+ var firstBracket = varName.indexOf('[');
8
+ var firstDot = varName.indexOf('.');
9
+ if (firstBracket === -1 && firstDot === -1) {
10
+ return varName;
11
+ }
12
+ if (firstBracket === -1) {
13
+ return varName.substring(0, firstDot);
14
+ }
15
+ if (firstDot === -1) {
16
+ return varName.substring(0, firstBracket);
17
+ }
18
+ return varName.substring(0, Math.min(firstBracket, firstDot));
19
+ }
package/dist/fn.d.ts CHANGED
@@ -75,6 +75,7 @@ import fieldValue from './fn/form/fieldValue.js';
75
75
  import fileExt from './fn/string/fileExt.js';
76
76
  import filter from './fn/object/filter.js';
77
77
  import filterToConditions from './fn/object/filterToConditions.js';
78
+ import firstVarElement from './fn/string/firstVarElement.js';
78
79
  import findAll from './fn/object/findAll.js';
79
80
  import fori from './fn/loop/fori.js';
80
81
  import forir from './fn/loop/forir.js';
@@ -311,6 +312,7 @@ declare const _default: {
311
312
  filter: typeof filter;
312
313
  filterToConditions: typeof filterToConditions;
313
314
  findAll: typeof findAll;
315
+ firstVarElement: typeof firstVarElement;
314
316
  fori: typeof fori;
315
317
  forir: typeof forir;
316
318
  format: typeof format;
package/dist/fn.js CHANGED
@@ -75,6 +75,7 @@ import fieldValue from './fn/form/fieldValue.js';
75
75
  import fileExt from './fn/string/fileExt.js';
76
76
  import filter from './fn/object/filter.js';
77
77
  import filterToConditions from './fn/object/filterToConditions.js';
78
+ import firstVarElement from './fn/string/firstVarElement.js';
78
79
  import findAll from './fn/object/findAll.js';
79
80
  import fori from './fn/loop/fori.js';
80
81
  import forir from './fn/loop/forir.js';
@@ -311,6 +312,7 @@ export default {
311
312
  filter: filter,
312
313
  filterToConditions: filterToConditions,
313
314
  findAll: findAll,
315
+ firstVarElement: firstVarElement,
314
316
  fori: fori,
315
317
  forir: forir,
316
318
  format: format,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.268",
3
+ "version": "1.0.270",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",