gramio 0.4.7 → 0.4.8

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/dist/index.cjs CHANGED
@@ -428,7 +428,7 @@ class Bot {
428
428
  __Derives;
429
429
  "~" = this._;
430
430
  filters = {
431
- context: (name2) => (context) => context.is(name2)
431
+ context: (name) => (context) => context.is(name)
432
432
  };
433
433
  /** Options provided to instance */
434
434
  options;
@@ -651,18 +651,27 @@ class Bot {
651
651
  return this;
652
652
  }
653
653
  decorate(nameOrRecordValue, value) {
654
- for (const contextName of Object.keys(contexts.contextsMappings)) {
654
+ for (const contextName of Object.keys(
655
+ contexts.contextsMappings
656
+ )) {
655
657
  if (typeof nameOrRecordValue === "string")
656
- Object.defineProperty(contexts.contextsMappings[contextName].prototype, name, {
657
- value
658
- });
658
+ Object.defineProperty(
659
+ contexts.contextsMappings[contextName].prototype,
660
+ nameOrRecordValue,
661
+ {
662
+ value,
663
+ configurable: true
664
+ }
665
+ );
659
666
  else
660
667
  Object.defineProperties(
661
- // @ts-expect-error
662
668
  contexts.contextsMappings[contextName].prototype,
663
669
  Object.keys(nameOrRecordValue).reduce(
664
670
  (acc, key) => {
665
- acc[key] = { value: nameOrRecordValue[key] };
671
+ acc[key] = {
672
+ value: nameOrRecordValue[key],
673
+ configurable: true
674
+ };
666
675
  return acc;
667
676
  },
668
677
  {}
package/dist/index.js CHANGED
@@ -430,7 +430,7 @@ class Bot {
430
430
  __Derives;
431
431
  "~" = this._;
432
432
  filters = {
433
- context: (name2) => (context) => context.is(name2)
433
+ context: (name) => (context) => context.is(name)
434
434
  };
435
435
  /** Options provided to instance */
436
436
  options;
@@ -653,18 +653,27 @@ class Bot {
653
653
  return this;
654
654
  }
655
655
  decorate(nameOrRecordValue, value) {
656
- for (const contextName of Object.keys(contextsMappings)) {
656
+ for (const contextName of Object.keys(
657
+ contextsMappings
658
+ )) {
657
659
  if (typeof nameOrRecordValue === "string")
658
- Object.defineProperty(contextsMappings[contextName].prototype, name, {
659
- value
660
- });
660
+ Object.defineProperty(
661
+ contextsMappings[contextName].prototype,
662
+ nameOrRecordValue,
663
+ {
664
+ value,
665
+ configurable: true
666
+ }
667
+ );
661
668
  else
662
669
  Object.defineProperties(
663
- // @ts-expect-error
664
670
  contextsMappings[contextName].prototype,
665
671
  Object.keys(nameOrRecordValue).reduce(
666
672
  (acc, key) => {
667
- acc[key] = { value: nameOrRecordValue[key] };
673
+ acc[key] = {
674
+ value: nameOrRecordValue[key],
675
+ configurable: true
676
+ };
668
677
  return acc;
669
678
  },
670
679
  {}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gramio",
3
3
  "type": "module",
4
- "version": "0.4.7",
4
+ "version": "0.4.8",
5
5
  "description": "Powerful, extensible and really type-safe Telegram Bot API framework",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.js",