Comparing version
@@ -433,3 +433,3 @@ import fs from 'node:fs/promises'; | ||
filters = { | ||
context: (name2) => (context) => context.is(name2) | ||
context: (name) => (context) => context.is(name) | ||
}; | ||
@@ -657,14 +657,23 @@ /** Options provided to instance */ | ||
decorate(nameOrRecordValue, value) { | ||
for (const contextName of Object.keys(contextsMappings)) { | ||
for (const contextName of Object.keys( | ||
contextsMappings | ||
)) { | ||
if (typeof nameOrRecordValue === "string") | ||
Object.defineProperty(contextsMappings[contextName].prototype, name, { | ||
value | ||
}); | ||
Object.defineProperty( | ||
contextsMappings[contextName].prototype, | ||
nameOrRecordValue, | ||
{ | ||
value, | ||
configurable: true | ||
} | ||
); | ||
else | ||
Object.defineProperties( | ||
// @ts-expect-error | ||
contextsMappings[contextName].prototype, | ||
Object.keys(nameOrRecordValue).reduce( | ||
(acc, key) => { | ||
acc[key] = { value: nameOrRecordValue[key] }; | ||
acc[key] = { | ||
value: nameOrRecordValue[key], | ||
configurable: true | ||
}; | ||
return acc; | ||
@@ -671,0 +680,0 @@ }, |
{ | ||
"name": "gramio", | ||
"type": "module", | ||
"version": "0.4.7", | ||
"version": "0.4.8", | ||
"description": "Powerful, extensible and really type-safe Telegram Bot API framework", | ||
@@ -6,0 +6,0 @@ "main": "dist/index.cjs", |
Sorry, the diff of this file is not supported yet
174757
0.15%3818
0.47%