
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
mapbox-gl-function
Advanced tools
Mapbox GL style functions are used to specify a property value that varies according to zoom level. This library implements the semantics of interpolated and piecewise-constant functions as specified by the Mapbox GL Style Specification.
Note that other Mapbox tools currently use v1, not v2.
var glfun = require('mapbox-gl-function');
var exponential = glfun({type: 'exponential', domain: [1, 5], range: [1, 10]});
exponential({ $zoom: 0 }); // => 1
exponential({ $zoom: 1 }); // => 1
exponential({ $zoom: 3 }); // => 5.5
exponential({ $zoom: 5 }); // => 10
exponential({ $zoom: 11 }); // => 10
var interval = glfun({type: 'interval', domain: [1, 3, 4], range: ['a', 'b', 'c']});
interval({ $zoom: 0 }); // => 'a'
interval({ $zoom: 1 }); // => 'a'
interval({ $zoom: 2 }); // => 'a'
interval({ $zoom: 3 }); // => 'b'
interval({ $zoom: 4 }); // => 'c'
var categorical = glfun({type: 'categorical', domain: ['A', 'B', 'C'], range: ['a', 'b', 'c']});
categorical({ $zoom: 'A' }); // => 'a'
categorical({ $zoom: 'B' }); // => 'b'
categorical({ $zoom: 'C' }); // => 'c'
FAQs
Evaluate a Mapbox GL style function
We found that mapbox-gl-function demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 38 open source maintainers 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
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.