Skip to content

Commit

Permalink
version 2.9.8
Browse files Browse the repository at this point in the history
  • Loading branch information
vladd-g committed Mar 25, 2024
2 parents f99a509 + 9ba1057 commit dfd9498
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
10 changes: 10 additions & 0 deletions lib/src/coders/bridge-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ export class BridgeErrorCoder
data.underlyingError ?? {},
)}"`,
});
case 'wrongParam':
case 'WRONG_PARAMETER':
return new AdaptyError({
adaptyCode: 3001,
message:
data.name ??
`Wrong parameter. Bridge error: ${JSON.stringify(
data.underlyingError ?? {},
)}"`,
});
case 'methodNotImplemented':
return new AdaptyError({
adaptyCode: 2003,
Expand Down
11 changes: 10 additions & 1 deletion lib/src/coders/coder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ export abstract class Coder<

private getNestedValue(obj: Record<string, any>, key: string): any {
const keys = key.split('.');
let current = obj;
let current;
if (typeof obj === 'string') {
try {
current = JSON.parse(obj);
} catch (error) {
return undefined;
}
} else {
current = obj;
}

for (let i = 0; i < keys.length; i++) {
const key = keys[i]!;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package",
"name": "react-native-adapty",
"version": "2.9.7",
"version": "2.9.8",
"description": "Adapty React Native SDK",
"license": "MIT",
"author": "Vanya Dorofeyev <DivanDoesApps@gmail.com> (https://github.com/divanc)",
Expand Down

0 comments on commit dfd9498

Please sign in to comment.