react-native-fs-turbo 0.5.0 → 0.5.1

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.
Files changed (122) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/RNFSTurbo.podspec +0 -0
  4. package/android/CMakeLists.txt +0 -0
  5. package/android/build.gradle +0 -0
  6. package/android/gradle.properties +0 -0
  7. package/android/src/main/AndroidManifest.xml +0 -0
  8. package/android/src/main/AndroidManifestNew.xml +0 -0
  9. package/android/src/main/codegen/RNFSTurboSpec.java +0 -0
  10. package/android/src/main/cpp/JNIOnLoad.cpp +0 -0
  11. package/android/src/main/cpp/RNFSTurboLogger.cpp +0 -0
  12. package/android/src/main/cpp/RNFSTurboModule.cpp +0 -0
  13. package/android/src/main/cpp/RNFSTurboModule.h +0 -0
  14. package/android/src/main/cpp/RNFSTurboPlatformHelper.cpp +0 -0
  15. package/android/src/main/java/com/cmpayc/rnfsturbo/JNIOnLoad.java +0 -0
  16. package/android/src/main/java/com/cmpayc/rnfsturbo/RNFSTurboDownloadParams.java +0 -0
  17. package/android/src/main/java/com/cmpayc/rnfsturbo/RNFSTurboDownloadResult.java +0 -0
  18. package/android/src/main/java/com/cmpayc/rnfsturbo/RNFSTurboDownloader.java +0 -0
  19. package/android/src/main/java/com/cmpayc/rnfsturbo/RNFSTurboIORejectionException.java +0 -0
  20. package/android/src/main/java/com/cmpayc/rnfsturbo/RNFSTurboModule.java +0 -0
  21. package/android/src/main/java/com/cmpayc/rnfsturbo/RNFSTurboPackage.java +0 -0
  22. package/android/src/main/java/com/cmpayc/rnfsturbo/RNFSTurboPlatformHelper.java +0 -0
  23. package/android/src/main/java/com/cmpayc/rnfsturbo/RNFSTurboUploadParams.java +0 -0
  24. package/android/src/main/java/com/cmpayc/rnfsturbo/RNFSTurboUploadResult.java +0 -0
  25. package/android/src/main/java/com/cmpayc/rnfsturbo/RNFSTurboUploader.java +0 -0
  26. package/cpp/RNFSTurboHostObject.cpp +11 -9
  27. package/cpp/RNFSTurboHostObject.h +0 -0
  28. package/cpp/RNFSTurboInstall.cpp +0 -0
  29. package/cpp/RNFSTurboInstall.h +0 -0
  30. package/cpp/RNFSTurboLogger.h +0 -0
  31. package/cpp/RNFSTurboPlatformHelper.h +0 -0
  32. package/cpp/algorithms/Krypt/AES.cpp +0 -0
  33. package/cpp/algorithms/Krypt/AES.hpp +0 -0
  34. package/cpp/algorithms/Krypt/aes-config.hpp +0 -0
  35. package/cpp/algorithms/Krypt/blockcipher.hpp +0 -0
  36. package/cpp/algorithms/Krypt/bytearray.cpp +0 -0
  37. package/cpp/algorithms/Krypt/bytearray.hpp +0 -0
  38. package/cpp/algorithms/Krypt/functions.cpp +0 -0
  39. package/cpp/algorithms/Krypt/functions.hpp +0 -0
  40. package/cpp/algorithms/Krypt/mode.cpp +0 -0
  41. package/cpp/algorithms/Krypt/mode.hpp +0 -0
  42. package/cpp/algorithms/Krypt/padding.cpp +0 -0
  43. package/cpp/algorithms/Krypt/padding.hpp +0 -0
  44. package/cpp/algorithms/Krypt/types.hpp +0 -0
  45. package/cpp/algorithms/base64.cpp +0 -0
  46. package/cpp/algorithms/base64.h +0 -0
  47. package/cpp/algorithms/md5.cpp +0 -0
  48. package/cpp/algorithms/md5.h +0 -0
  49. package/cpp/algorithms/sha1.cpp +0 -0
  50. package/cpp/algorithms/sha1.h +0 -0
  51. package/cpp/algorithms/sha224.cpp +0 -0
  52. package/cpp/algorithms/sha224.h +0 -0
  53. package/cpp/algorithms/sha256.cpp +0 -0
  54. package/cpp/algorithms/sha256.h +0 -0
  55. package/cpp/algorithms/sha384.cpp +0 -0
  56. package/cpp/algorithms/sha384.h +0 -0
  57. package/cpp/algorithms/sha512.cpp +0 -0
  58. package/cpp/algorithms/sha512.h +0 -0
  59. package/cpp/encryption/encryption-utils.cpp +0 -0
  60. package/cpp/encryption/encryption-utils.h +0 -0
  61. package/cpp/filesystem/filesystem-utils.cpp +0 -0
  62. package/cpp/filesystem/filesystem-utils.h +0 -0
  63. package/ios/PrivacyInfo.xcprivacy +0 -0
  64. package/ios/RNFSTurboDownloader.h +0 -0
  65. package/ios/RNFSTurboDownloader.mm +0 -0
  66. package/ios/RNFSTurboLogger.mm +0 -0
  67. package/ios/RNFSTurboModule.h +0 -0
  68. package/ios/RNFSTurboModule.mm +0 -0
  69. package/ios/RNFSTurboPlatformHelper.mm +0 -0
  70. package/ios/RNFSTurboUploader.h +0 -0
  71. package/ios/RNFSTurboUploader.mm +0 -0
  72. package/lib/commonjs/ModuleNotFoundError.js +0 -0
  73. package/lib/commonjs/ModuleNotFoundError.js.map +0 -0
  74. package/lib/commonjs/NativeRNFSTurboModule.js +0 -0
  75. package/lib/commonjs/NativeRNFSTurboModule.js.map +0 -0
  76. package/lib/commonjs/RNFSTurbo.js +0 -0
  77. package/lib/commonjs/RNFSTurbo.js.map +0 -0
  78. package/lib/commonjs/Types.js +0 -0
  79. package/lib/commonjs/Types.js.map +0 -0
  80. package/lib/commonjs/createRNFSTurbo.js +0 -0
  81. package/lib/commonjs/createRNFSTurbo.js.map +0 -0
  82. package/lib/commonjs/globals.d.js +0 -0
  83. package/lib/commonjs/globals.d.js.map +0 -0
  84. package/lib/commonjs/index.js +0 -0
  85. package/lib/commonjs/index.js.map +0 -0
  86. package/lib/commonjs/package.json +0 -0
  87. package/lib/module/ModuleNotFoundError.js +0 -0
  88. package/lib/module/ModuleNotFoundError.js.map +0 -0
  89. package/lib/module/NativeRNFSTurboModule.js +0 -0
  90. package/lib/module/NativeRNFSTurboModule.js.map +0 -0
  91. package/lib/module/RNFSTurbo.js +0 -0
  92. package/lib/module/RNFSTurbo.js.map +0 -0
  93. package/lib/module/Types.js +0 -0
  94. package/lib/module/Types.js.map +0 -0
  95. package/lib/module/createRNFSTurbo.js +0 -0
  96. package/lib/module/createRNFSTurbo.js.map +0 -0
  97. package/lib/module/globals.d.js +0 -0
  98. package/lib/module/globals.d.js.map +0 -0
  99. package/lib/module/index.js +0 -0
  100. package/lib/module/index.js.map +0 -0
  101. package/lib/module/package.json +0 -0
  102. package/lib/typescript/ModuleNotFoundError.d.ts +0 -0
  103. package/lib/typescript/ModuleNotFoundError.d.ts.map +0 -0
  104. package/lib/typescript/NativeRNFSTurboModule.d.ts +0 -0
  105. package/lib/typescript/NativeRNFSTurboModule.d.ts.map +0 -0
  106. package/lib/typescript/RNFSTurbo.d.ts +0 -0
  107. package/lib/typescript/RNFSTurbo.d.ts.map +0 -0
  108. package/lib/typescript/Types.d.ts +0 -0
  109. package/lib/typescript/Types.d.ts.map +0 -0
  110. package/lib/typescript/createRNFSTurbo.d.ts +0 -0
  111. package/lib/typescript/createRNFSTurbo.d.ts.map +0 -0
  112. package/lib/typescript/index.d.ts +0 -0
  113. package/lib/typescript/index.d.ts.map +0 -0
  114. package/package.json +1 -1
  115. package/react-native.config.js +0 -0
  116. package/src/ModuleNotFoundError.ts +0 -0
  117. package/src/NativeRNFSTurboModule.ts +0 -0
  118. package/src/RNFSTurbo.ts +0 -0
  119. package/src/Types.ts +0 -0
  120. package/src/createRNFSTurbo.ts +0 -0
  121. package/src/globals.d.ts +0 -0
  122. package/src/index.ts +0 -0
package/LICENSE CHANGED
File without changes
package/README.md CHANGED
File without changes
package/RNFSTurbo.podspec CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -601,20 +601,22 @@ jsi::Value RNFSTurboHostObject::get(jsi::Runtime& runtime, const jsi::PropNameID
601
601
  }
602
602
 
603
603
  try {
604
+ struct stat t_stat;
605
+ bool fileExists = stat(filePath.c_str(), &t_stat) >= 0;
604
606
  if (encoding == "uint8" || encoding == "uint16" || encoding == "uint32") {
605
- if (propName == "write" && offset > -1 && encoding == "uint8") {
607
+ if (fileExists && propName == "write" && offset > -1 && encoding == "uint8") {
606
608
  std::string replaceString(
607
609
  reinterpret_cast<char*>(contentArrUint8),
608
610
  contentLength
609
611
  );
610
612
  writeWithOffset(filePath.c_str(), replaceString, offset);
611
- } else if (propName == "write" && offset > -1 && encoding == "uint16") {
613
+ } else if (fileExists && propName == "write" && offset > -1 && encoding == "uint16") {
612
614
  std::string replaceString(
613
615
  reinterpret_cast<char*>(contentArrUint16),
614
616
  contentLength
615
617
  );
616
618
  writeWithOffset(filePath.c_str(), replaceString, offset);
617
- } else if (propName == "write" && offset > -1 && encoding == "uint32") {
619
+ } else if (fileExists && propName == "write" && offset > -1 && encoding == "uint32") {
618
620
  std::string replaceString(
619
621
  reinterpret_cast<char*>(contentArrUint32),
620
622
  contentLength
@@ -628,11 +630,11 @@ jsi::Value RNFSTurboHostObject::get(jsi::Runtime& runtime, const jsi::PropNameID
628
630
  contentArrUint16,
629
631
  contentArrUint32,
630
632
  contentLength,
631
- propName == "appendFile" || (propName == "write" && offset == -1)
633
+ fileExists && (propName == "appendFile" || (propName == "write" && offset == -1))
632
634
  );
633
635
  }
634
636
  } else if (encoding == "float32") {
635
- if (propName == "write" && offset > -1) {
637
+ if (fileExists && propName == "write" && offset > -1) {
636
638
  std::string replaceString = reinterpret_cast<char*>(contentArrFloat32);
637
639
  writeWithOffset(filePath.c_str(), replaceString, offset);
638
640
  } else {
@@ -640,11 +642,11 @@ jsi::Value RNFSTurboHostObject::get(jsi::Runtime& runtime, const jsi::PropNameID
640
642
  filePath.c_str(),
641
643
  contentArrFloat32,
642
644
  contentLength,
643
- propName == "appendFile" || (propName == "write" && offset == -1)
645
+ fileExists && (propName == "appendFile" || (propName == "write" && offset == -1))
644
646
  );
645
647
  }
646
648
  } else {
647
- if (propName == "write" && offset > -1) {
649
+ if (fileExists && propName == "write" && offset > -1) {
648
650
  writeWithOffset(
649
651
  filePath.c_str(),
650
652
  content,
@@ -673,14 +675,14 @@ jsi::Value RNFSTurboHostObject::get(jsi::Runtime& runtime, const jsi::PropNameID
673
675
  writeFile(
674
676
  filePath.c_str(),
675
677
  encryptedContent,
676
- propName == "appendFile" || (propName == "write" && offset == -1)
678
+ fileExists && (propName == "appendFile" || (propName == "write" && offset == -1))
677
679
  );
678
680
  #endif
679
681
  } else {
680
682
  writeFile(
681
683
  filePath.c_str(),
682
684
  content,
683
- propName == "appendFile" || (propName == "write" && offset == -1)
685
+ fileExists && (propName == "appendFile" || (propName == "write" && offset == -1))
684
686
  );
685
687
  }
686
688
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-fs-turbo",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "React-Native library for working with Android/iOS file system, written using JSI and C++ TurboModules",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
File without changes
File without changes
File without changes
package/src/RNFSTurbo.ts CHANGED
File without changes
package/src/Types.ts CHANGED
File without changes
File without changes
package/src/globals.d.ts CHANGED
File without changes
package/src/index.ts CHANGED
File without changes