function addMapping(id, mapping) {
	const expanded_id = id.replace(vendorProductRE, (_, a, b) => {
		return (
			"000".slice(a.length - 1) + a + "-" + "000".slice(b.length - 1) + b + "-"
		);
	});
	const sparse_id = id.replace(vendorProductRE, (_, a, b) => {
		return (
			a.replace(leadingZeroRE, "") + "-" + b.replace(leadingZeroRE, "") + "-"
		);
	});

	// Normalize optional parameters
	mapping.analog =
		mapping.analog ||
		mapping.buttons.map(() => {
			return -1;
		});
	mapping.normalize_fn =
		mapping.normalize_fn ||
		function (value) {
			return value;
		};

	remap.set(expanded_id, mapping);
	remap.set(sparse_id, mapping);
}
Firefox reports different ids for gamepads depending on the platform:
- Windows: vendor and product codes contain leading zeroes
- Mac: vendor and product codes are sparse (no leading zeroes)

This function normalizes the id to support both formats
@ignore