@capacitor-community/sqlite
Advanced tools
Comparing version 2.3.0-2 to 2.3.0-beta.1
@@ -1,2 +0,2 @@ | ||
declare module "@capacitor/core" { | ||
declare module '@capacitor/core' { | ||
interface PluginRegistry { | ||
@@ -3,0 +3,0 @@ CapacitorSQLite: CapacitorSQLitePlugin; |
/* JSON function */ | ||
export function isJsonSQLite(obj) { | ||
const keyFirstLevel = ["database", "encrypted", "mode", "tables"]; | ||
const keyFirstLevel = [ | ||
'database', | ||
'encrypted', | ||
'mode', | ||
'tables', | ||
]; | ||
if (obj == null || | ||
@@ -10,11 +15,11 @@ (Object.keys(obj).length === 0 && obj.constructor === Object)) | ||
return false; | ||
if (key === "database" && typeof obj[key] != "string") | ||
if (key === 'database' && typeof obj[key] != 'string') | ||
return false; | ||
if (key === "encrypted" && typeof obj[key] != "boolean") | ||
if (key === 'encrypted' && typeof obj[key] != 'boolean') | ||
return false; | ||
if (key === "mode" && typeof obj[key] != "string") | ||
if (key === 'mode' && typeof obj[key] != 'string') | ||
return false; | ||
if (key === "tables" && typeof obj[key] != "object") | ||
if (key === 'tables' && typeof obj[key] != 'object') | ||
return false; | ||
if (key === "tables") { | ||
if (key === 'tables') { | ||
for (let i = 0; i < obj[key].length; i++) { | ||
@@ -30,3 +35,3 @@ const retTable = isTable(obj[key][i]); | ||
export function isTable(obj) { | ||
const keyTableLevel = ["name", "schema", "indexes", "values"]; | ||
const keyTableLevel = ['name', 'schema', 'indexes', 'values']; | ||
let nbColumn = 0; | ||
@@ -39,12 +44,12 @@ if (obj == null || | ||
return false; | ||
if (key === "name" && typeof obj[key] != "string") | ||
if (key === 'name' && typeof obj[key] != 'string') | ||
return false; | ||
if (key === "schema" && typeof obj[key] != "object") | ||
if (key === 'schema' && typeof obj[key] != 'object') | ||
return false; | ||
if (key === "indexes" && typeof obj[key] != "object") | ||
if (key === 'indexes' && typeof obj[key] != 'object') | ||
return false; | ||
if (key === "values" && typeof obj[key] != "object") | ||
if (key === 'values' && typeof obj[key] != 'object') | ||
return false; | ||
if (key === "schema") { | ||
obj["schema"].forEach((element) => { | ||
if (key === 'schema') { | ||
obj['schema'].forEach((element) => { | ||
if (element.column) { | ||
@@ -60,3 +65,3 @@ nbColumn++; | ||
} | ||
if (key === "indexes") { | ||
if (key === 'indexes') { | ||
for (let i = 0; i < obj[key].length; i++) { | ||
@@ -68,6 +73,6 @@ const retIndexes = isIndexes(obj[key][i]); | ||
} | ||
if (key === "values") { | ||
if (key === 'values') { | ||
if (nbColumn > 0) { | ||
for (let i = 0; i < obj[key].length; i++) { | ||
if (typeof obj[key][i] != "object" || obj[key][i].length != nbColumn) | ||
if (typeof obj[key][i] != 'object' || obj[key][i].length != nbColumn) | ||
return false; | ||
@@ -81,3 +86,3 @@ } | ||
function isSchema(obj) { | ||
const keySchemaLevel = ["column", "value", "foreignkey"]; | ||
const keySchemaLevel = ['column', 'value', 'foreignkey']; | ||
if (obj == null || | ||
@@ -89,7 +94,7 @@ (Object.keys(obj).length === 0 && obj.constructor === Object)) | ||
return false; | ||
if (key === "column" && typeof obj[key] != "string") | ||
if (key === 'column' && typeof obj[key] != 'string') | ||
return false; | ||
if (key === "value" && typeof obj[key] != "string") | ||
if (key === 'value' && typeof obj[key] != 'string') | ||
return false; | ||
if (key === "foreignkey" && typeof obj[key] != "string") | ||
if (key === 'foreignkey' && typeof obj[key] != 'string') | ||
return false; | ||
@@ -100,3 +105,3 @@ } | ||
function isIndexes(obj) { | ||
const keyIndexesLevel = ["name", "column"]; | ||
const keyIndexesLevel = ['name', 'column']; | ||
if (obj == null || | ||
@@ -108,5 +113,5 @@ (Object.keys(obj).length === 0 && obj.constructor === Object)) | ||
return false; | ||
if (key === "name" && typeof obj[key] != "string") | ||
if (key === 'name' && typeof obj[key] != 'string') | ||
return false; | ||
if (key === "column" && typeof obj[key] != "string") | ||
if (key === 'column' && typeof obj[key] != 'string') | ||
return false; | ||
@@ -113,0 +118,0 @@ } |
@@ -15,3 +15,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
name: 'CapacitorSQLite', | ||
platforms: ['web'] | ||
platforms: ['web'], | ||
}); | ||
@@ -28,3 +28,3 @@ } | ||
console.log('open', options); | ||
return Promise.reject("Not implemented"); | ||
return Promise.reject('Not implemented'); | ||
}); | ||
@@ -35,3 +35,3 @@ } | ||
console.log('close', options); | ||
return Promise.reject("Not implemented"); | ||
return Promise.reject('Not implemented'); | ||
}); | ||
@@ -42,3 +42,3 @@ } | ||
console.log('execute', options); | ||
return Promise.reject("Not implemented"); | ||
return Promise.reject('Not implemented'); | ||
}); | ||
@@ -49,3 +49,3 @@ } | ||
console.log('execute', options); | ||
return Promise.reject("Not implemented"); | ||
return Promise.reject('Not implemented'); | ||
}); | ||
@@ -56,3 +56,3 @@ } | ||
console.log('run', options); | ||
return Promise.reject("Not implemented"); | ||
return Promise.reject('Not implemented'); | ||
}); | ||
@@ -63,3 +63,3 @@ } | ||
console.log('query', options); | ||
return Promise.reject("Not implemented"); | ||
return Promise.reject('Not implemented'); | ||
}); | ||
@@ -70,3 +70,3 @@ } | ||
console.log('isDBExists', options); | ||
return Promise.reject("Not implemented"); | ||
return Promise.reject('Not implemented'); | ||
}); | ||
@@ -77,3 +77,3 @@ } | ||
console.log('deleteDatabase', options); | ||
return Promise.reject("Not implemented"); | ||
return Promise.reject('Not implemented'); | ||
}); | ||
@@ -84,3 +84,3 @@ } | ||
console.log('isJsonValid', options); | ||
return Promise.reject("Not implemented"); | ||
return Promise.reject('Not implemented'); | ||
}); | ||
@@ -91,3 +91,3 @@ } | ||
console.log('importFromJson', options); | ||
return Promise.reject("Not implemented"); | ||
return Promise.reject('Not implemented'); | ||
}); | ||
@@ -98,3 +98,3 @@ } | ||
console.log('exportToJson', options); | ||
return Promise.reject("Not implemented"); | ||
return Promise.reject('Not implemented'); | ||
}); | ||
@@ -105,3 +105,3 @@ } | ||
console.log('createSyncTable'); | ||
return Promise.reject("Not implemented"); | ||
return Promise.reject('Not implemented'); | ||
}); | ||
@@ -112,3 +112,3 @@ } | ||
console.log('setSyncDate', options); | ||
return Promise.reject("Not implemented"); | ||
return Promise.reject('Not implemented'); | ||
}); | ||
@@ -115,0 +115,0 @@ } |
{ | ||
"name": "@capacitor-community/sqlite", | ||
"version": "2.3.0-2", | ||
"version": "2.3.0-beta.1", | ||
"description": "Capacitor SQLite Plugin", | ||
@@ -11,7 +11,8 @@ "homepage": "https://github.com/capacitor-community/sqlite", | ||
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"", | ||
"fmt": "npm run prettier -- --write && npm run swiftlint -- autocorrect", | ||
"swiftlint": "node-swiftlint", | ||
"build": "npm run clean && tsc && rollup -c rollup.config.js", | ||
"clean": "rimraf ./dist", | ||
"prepublishOnly": "npm run build", | ||
"npm-publish": "np" | ||
"watch": "tsc --watch", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -18,0 +19,0 @@ "author": "Jean Pierre Queau", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3343
9812115
149
1