axj-ab_ 1.0.2 → 1.0.5

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.
Files changed (2) hide show
  1. package/index.js +25 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -404,14 +404,20 @@ var ab_ = {
404
404
 
405
405
  post(name) {
406
406
  var args = false
407
- if (arguments.length === 3 && arguments[0] === undefined) {
407
+ var from = undefined
408
+ if (arguments.length >= 3 && arguments[0] === undefined) {
408
409
  name = arguments[1]
409
410
  args = true
411
+ from = arguments[3]
410
412
  }
411
413
 
412
414
  var target = ab_.$center
413
415
  var fn = target[name]
414
416
  if (fn) {
417
+ if (from) {
418
+ target['$from'] = from
419
+ }
420
+
415
421
  fn.apply(target, args ? arguments[2] : ab_.args(arguments, 1))
416
422
  return
417
423
  }
@@ -430,6 +436,10 @@ var ab_ = {
430
436
  name = name.substr(i + 1)
431
437
  fn = target[name]
432
438
  if (fn) {
439
+ if (from) {
440
+ target['$from'] = from
441
+ }
442
+
433
443
  fn.apply(target, args ? arguments[2] : ab_.args(arguments, 1))
434
444
  return
435
445
  }
@@ -1220,4 +1230,18 @@ try {
1220
1230
  console.error(e)
1221
1231
  }
1222
1232
 
1233
+ try {
1234
+ if (globalThis) {
1235
+ if (globalThis.ab_) {
1236
+ ab_ = globalThis.ab_
1237
+
1238
+ } else {
1239
+ globalThis.ab_ = ab_
1240
+ }
1241
+ }
1242
+
1243
+ } catch (e) {
1244
+ console.error(e)
1245
+ }
1246
+
1223
1247
  module.exports = ab_
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "axj-ab_",
3
3
  "type": "commonjs",
4
- "version": "1.0.2",
4
+ "version": "1.0.5",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {