@op-engineering/op-sqlite 11.2.6 → 11.2.7

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.
@@ -738,19 +738,22 @@ void DBHostObject::create_jsi_functions() {
738
738
 
739
739
  function_map["getDbPath"] = HOSTFN("getDbPath") {
740
740
  std::string path = std::string(base_path);
741
- if (count == 1 && !args[0].isString()) {
742
- throw std::runtime_error(
743
- "[op-sqlite][open] database location must be a string");
744
- }
745
-
746
- std::string last_path = args[0].asString(rt).utf8(rt);
747
-
748
- if (last_path == ":memory:") {
749
- path = ":memory:";
750
- } else if (last_path.rfind('/', 0) == 0) {
751
- path = last_path;
752
- } else {
753
- path = path + "/" + last_path;
741
+
742
+ if (count == 1) {
743
+ if(!args[0].isString()) {
744
+ throw std::runtime_error(
745
+ "[op-sqlite][open] database location must be a string");
746
+ }
747
+
748
+ std::string last_path = args[0].asString(rt).utf8(rt);
749
+
750
+ if (last_path == ":memory:") {
751
+ path = ":memory:";
752
+ } else if (last_path.rfind('/', 0) == 0) {
753
+ path = last_path;
754
+ } else {
755
+ path = path + "/" + last_path;
756
+ }
754
757
  }
755
758
 
756
759
  auto result = opsqlite_get_db_path(db_name, path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@op-engineering/op-sqlite",
3
- "version": "11.2.6",
3
+ "version": "11.2.7",
4
4
  "description": "Next generation SQLite for React Native",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",