File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -63,3 +63,11 @@ exports.toArray = function(a) {
6363 ret [ i ] = a [ i ] ;
6464 return ret ;
6565}
66+
67+ exports . toIntArray = function ( a ) {
68+ var l = a . length ;
69+ var ret = new Array ( l ) ;
70+ for ( var i = 0 ; i < l ; i ++ )
71+ ret [ i ] = a [ i ] | 0 ;
72+ return ret ;
73+ }
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ module Data.ArrayBuffer.Typed( Writer()
1414 , hasIndex
1515 , at
1616 , toArray
17+ , toIntArray
1718 ) where
1819
1920import Prelude (Unit , ($))
@@ -82,3 +83,7 @@ at a n = if a `hasIndex` n then
8283
8384-- | Turn typed array into an array.
8485foreign import toArray :: forall a . ArrayView a -> Array Number
86+
87+ -- | Turn typed array into integer array.
88+ foreign import toIntArray :: forall a . ArrayView a -> Array Int
89+
You can’t perform that action at this time.
0 commit comments