Socket
Book a DemoInstallSign in
Socket

@nativescript/appwrite

Package Overview
Dependencies
Maintainers
19
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nativescript/appwrite - npm Package Compare versions

Comparing version

to
0.1.0

1

index.android.d.ts

@@ -0,1 +1,2 @@

export declare function dataDeserialize(nativeData?: any): any;
export declare class Client {

@@ -2,0 +3,0 @@ private _native;

import { Utils } from '@nativescript/core';
export function dataDeserialize(nativeData) {
if (nativeData === null || typeof nativeData !== 'object') {
return nativeData;
}
let store;
switch (nativeData.getClass().getName()) {
case 'java.lang.String': {
return String(nativeData);
}
case 'java.lang.Boolean': {
return String(nativeData) === 'true';
}
case 'java.lang.Float':
case 'java.lang.Integer':
case 'java.lang.Long':
case 'java.lang.Double':
case 'java.lang.Short': {
return Number(nativeData);
}
case 'org.json.JSONArray': {
store = [];
for (let j = 0; j < nativeData.length(); j++) {
store[j] = dataDeserialize(nativeData.get(j));
}
break;
}
case 'org.json.JSONObject': {
store = {};
const i = nativeData.keys();
let key;
while (i.hasNext()) {
key = i.next();
store[key] = dataDeserialize(nativeData.get(key));
}
break;
}
case 'androidx.collection.SimpleArrayMap': {
const count = nativeData.size();
for (let l = 0; l < count; l++) {
const key = nativeData.keyAt(l);
store[key] = dataDeserialize(nativeData.get(key));
}
break;
}
case 'com.google.gson.internal.LinkedTreeMap':
case 'androidx.collection.ArrayMap':
case 'android.os.Bundle':
case 'java.util.HashMap':
case 'java.util.Map': {
store = {};
const keys = nativeData.keySet().toArray();
for (let k = 0; k < keys.length; k++) {
const key = keys[k];
store[key] = dataDeserialize(nativeData.get(key));
}
break;
}
default:
if (typeof nativeData === 'object' && nativeData instanceof java.util.List) {
const array = [];
const size = nativeData.size();
for (let i = 0, n = size; i < n; i++) {
array[i] = dataDeserialize(nativeData.get(i));
}
store = array;
}
else {
store = null;
}
break;
}
return store;
}
export class Client {

@@ -112,3 +185,3 @@ constructor() {

get labels() {
return Utils.dataDeserialize(this.native.getLabels());
return dataDeserialize(this.native.getLabels());
}

@@ -134,3 +207,3 @@ get mfa() {

get prefs() {
return Utils.dataDeserialize(this.native.getPrefs);
return dataDeserialize(this.native.getPrefs());
}

@@ -160,3 +233,3 @@ get registration() {

toJSON() {
return Utils.dataDeserialize(this.native.toMap());
return dataDeserialize(this.native.toMap());
}

@@ -256,3 +329,3 @@ }

get data() {
return Utils.dataDeserialize(this.native.getData());
return dataDeserialize(this.native.getData());
}

@@ -266,3 +339,3 @@ get databaseId() {

get permissions() {
return Utils.dataDeserialize(this.native.getPermissions());
return dataDeserialize(this.native.getPermissions());
}

@@ -434,3 +507,3 @@ get updatedAt() {

get factors() {
return Utils.dataDeserialize(this.native.getFactors());
return dataDeserialize(this.native.getFactors());
}

@@ -437,0 +510,0 @@ get id() {

2

package.json
{
"name": "@nativescript/appwrite",
"version": "0.0.4",
"version": "0.1.0",
"description": "Appwrite SDK for NativeScript",

@@ -5,0 +5,0 @@ "main": "index",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.