@yinyinfurong_zmr/dbc-can
Version:
A general purpose CAN (Controller Area Network) toolbox with support for .dbc file parsing, CAN message decoding, and more
14 lines • 445 B
JavaScript
import path from 'path';
/**
* Determines if the containing filepath has the correct extension
*
* @param file Filepath
* @param ext File extension to check against
*/
export const validateFileExtension = (file, ext) => {
const fileExt = path.extname(file);
if (fileExt !== ext) {
throw new Error(`Function expected a file extension of '.dbc', got ${fileExt}`);
}
};
//# sourceMappingURL=FileHandlers.js.map