
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
flatten-vertex-data
Advanced tools
Copies flat or nested array data into the specified typed array, or a new typed array. Intended to be used for WebGL buffers. If the input is nested array data, this guesses the dimensionality based on the length of the first sub-array.
npm install flatten-vertex-data --save
Accepts a dtype string (creating a new array) or an output typed array to re-use. Defaults to creating a new Float32Array.
var flatten = require('flatten-vertex-data')
var positions = [ [x1, y1], [x2, y2], [x3, y3] ]
flatten(positions)
//=> new Float32Array([ x1, y1, x2, y2, x3, y3 ])
flatten(positions, 'uint16')
//=> new Uint16Array([ x1, y1, x2, y2, x3, y3 ])
// flatten & copy positions into output
var output = new Uint16Array(positions.length * 2)
flatten(positions, output)
output = flatten(data, [output|type], [offset])
Copies flat or nested arrays into a typed array, where data
can be:
[ [ x, y ], [ x, y ] ]
[ x, y, z, x, y, z ]
new Float32Array([ x, y ])
The second parameter can be a type
string for dtype, which creates a new array. Or, it can be an existing typed array to re-use as the output
destination. It defaults to 'float32'
(a new Float32Array).
Returns the output
typed array.
The third parameter, offset
, can be a number (default 0), the index in the destination array at which to start copying the data
. If a new array is being created, its capacity will be expanded to fit dataLength + offset
(i.e. it will have leading zeros).
MIT, see LICENSE.md for details.
FAQs
flattens nested vertex data into a typed array
The npm package flatten-vertex-data receives a total of 296,037 weekly downloads. As such, flatten-vertex-data popularity was classified as popular.
We found that flatten-vertex-data demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.