@nativescript-community/arraybuffers
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -6,5 +6,8 @@ # Change Log | ||
## [1.1.2](https://github.com/nativescript-community/arraybuffers/compare/v1.1.1...v1.1.2) (2023-08-10) | ||
**Note:** Version bump only for package @nativescript-community/arraybuffers | ||
## [1.1.1](https://github.com/nativescript-community/arraybuffers/compare/v1.1.0...v1.1.1) (2022-10-28) | ||
### Bug Fixes | ||
@@ -14,9 +17,4 @@ | ||
# [1.1.0](https://github.com/nativescript-community/arraybuffers/compare/v1.0.3...v1.1.0) (2022-10-17) | ||
### Features | ||
@@ -26,6 +24,2 @@ | ||
## [1.0.3](https://github.com/nativescript-community/arraybuffers/compare/v1.0.2...v1.0.3) (2022-10-17) | ||
@@ -35,6 +29,2 @@ | ||
## [1.0.2](https://github.com/nativescript-community/arraybuffers/compare/v1.0.1...v1.0.2) (2022-10-15) | ||
@@ -44,6 +34,2 @@ | ||
## [1.0.1](https://github.com/nativescript-community/arraybuffers/compare/v1.0.0...v1.0.1) (2022-07-17) | ||
@@ -53,8 +39,4 @@ | ||
# 1.0.0 (2022-05-13) | ||
**Note:** Version bump only for package @nativescript-community/arraybuffers |
@@ -38,4 +38,6 @@ let _runtimeVersion; | ||
const result = ArrayBuffer.from(bb); | ||
//@ts-ignore | ||
return useInts ? new Int8Array(result) : new Float32Array(result); | ||
} | ||
//@ts-ignore | ||
return useInts ? new Int8Array(length) : new Float32Array(length); | ||
@@ -53,5 +55,9 @@ } | ||
if (useInts) { | ||
buffer.nativeObject.rewind(); | ||
const bytuffer = buffer.nativeObject; | ||
if (bytuffer.isDirect()) { | ||
return buffer['nativeObject'].array(); | ||
} | ||
bytuffer.rewind(); | ||
const bytes = Array.create('byte', buffer.byteLength); | ||
buffer.nativeObject.get(bytes); | ||
bytuffer.get(bytes); | ||
return bytes; | ||
@@ -68,4 +74,6 @@ } | ||
if (!Array.isArray(array) && !isBufferView) { | ||
// return so that we can now it is not supported (as not a valid array) | ||
return null; | ||
} | ||
// for now we cant do it the old way | ||
if (!isBufferView && supportsDirectArrayBuffers()) { | ||
@@ -72,0 +80,0 @@ const nArray = createNativeArray(array.length, useInts); |
{ | ||
"name": "@nativescript-community/arraybuffers", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Utility methods to work with Array Buffers in Nativescript", | ||
@@ -46,3 +46,3 @@ "main": "index", | ||
"bootstrapper": "nativescript-plugin-seed", | ||
"gitHead": "7b01e842f6e538ef91956bb70f8998139ba7c93a" | ||
"gitHead": "4a41db99de5ef3f902767aebafa9fcdbed3e01d9" | ||
} |
@@ -11,4 +11,4 @@ { | ||
}, | ||
"include": ["../../src/arraybuffers/**/*", "../../references.d.ts", "../../src/references.d.ts"], | ||
"include": ["../../src/arraybuffers/**/*", "../../references.d.ts", "../../tools/references.d.ts", "../../src/references.d.ts"], | ||
"exclude": ["../../src/arraybuffers/angular/**"] | ||
} |
Sorry, the diff of this file is not supported yet
30820
164