nv-facutil-slct-ta 1.0.6 → 1.0.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.
Files changed (2) hide show
  1. package/index.js +14 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -205,6 +205,18 @@ const creat_on_ab =(Cls,requested_cnt,ab,offset=0)=>{
205
205
  }
206
206
  }
207
207
 
208
+ const is_overlaped = (typed_array0,typed_array1)=>{
209
+ var ab0 = typed_array0.buffer;
210
+ var ab1 = typed_array1.buffer;
211
+ if(ab0 === ab1) {
212
+ var si0 = typed_array0.byteOffset; var ei0 = si0 + typed_array0.byteLength;
213
+ var si1 = typed_array1.byteOffset; var ei1 = si1 + typed_array1.byteLength;
214
+ return !(ei0 <= si1 || ei1 <= si0); // 没有重叠时,返回 false
215
+ } else {
216
+ return false;
217
+ }
218
+ }
219
+
208
220
  module.exports = {
209
221
  check_sz_and_algn,
210
222
  calc_algn_si,
@@ -226,5 +238,6 @@ module.exports = {
226
238
  ////
227
239
  creat_debug_view,
228
240
  is_ablike,
229
- creat_on_ab
241
+ creat_on_ab,
242
+ is_overlaped,
230
243
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nv-facutil-slct-ta",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"