1
0
Fork 0
mirror of https://github.com/codedread/bitjs synced 2025-10-04 10:09:16 +02:00
bitjs/image/parsers/parsers.js
2024-01-19 13:25:45 -08:00

20 lines
447 B
JavaScript

/*
* parsers.js
*
* Common functionality for all image parsers.
*
* Licensed under the MIT License
*
* Copyright(c) 2024 Google Inc.
*/
/**
* Creates a new event of the given type with the specified data.
* @template T
* @param {string} type The event type.
* @param {T} data The event data.
* @returns {CustomEvent<T>} The new event.
*/
export function createEvent(type, data) {
return new CustomEvent(type, { detail: data });
}