Warnings for dangerous files
parent
3b8f934741
commit
ca61c9cb85
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Error/error-filled-16</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs>
|
||||
<path d="M8,1 C11.864,1 15,4.136 15,8 C15,11.864 11.864,15 8,15 C4.136,15 1,11.864 1,8 C1,4.136 4.136,1 8,1 Z M8,3.5 C7.98736684,3.5 7.9747349,3.50024902 7.96211155,3.50074693 C7.43159364,3.52167214 7.01848713,3.96870512 7.03941235,4.49922303 L7.20654214,8.7364722 C7.22336326,9.16293903 7.57398102,9.5 8.00077946,9.5 C8.42754697,9.5 8.77810943,9.16290468 8.79481871,8.73646441 L8.96084687,4.49923322 C8.96133837,4.48668956 8.96158419,4.47413748 8.96158419,4.46158419 C8.96158419,3.93051591 8.53106829,3.5 8,3.5 Z M8,10.5 C7.44771525,10.5 7,10.9477153 7,11.5 C7,12.0522847 7.44771525,12.5 8,12.5 C8.55228475,12.5 9,12.0522847 9,11.5 C9,10.9477153 8.55228475,10.5 8,10.5 Z" id="path-1"></path>
|
||||
<rect id="path-3" x="0" y="0" width="16.1006289" height="16.1006289"></rect>
|
||||
</defs>
|
||||
<g id="Error/error-filled-16" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<mask id="mask-2" fill="white">
|
||||
<use xlink:href="#path-1"></use>
|
||||
</mask>
|
||||
<use id="Combined-Shape" fill="#FF261F" fill-rule="nonzero" xlink:href="#path-1"></use>
|
||||
<g id="Color/UI/Black" mask="url(#mask-2)">
|
||||
<mask id="mask-4" fill="white">
|
||||
<use xlink:href="#path-3"></use>
|
||||
</mask>
|
||||
<use id="fill" fill="#000000" fill-rule="evenodd" xlink:href="#path-3"></use>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.7 KiB |
@ -1,6 +1,13 @@
|
||||
import * as GoogleChrome from './GoogleChrome';
|
||||
import { arrayBufferToObjectURL } from './arrayBufferToObjectURL';
|
||||
import { isFileDangerous } from './isFileDangerous';
|
||||
import { missingCaseError } from './missingCaseError';
|
||||
import { migrateColor } from './migrateColor';
|
||||
|
||||
export { arrayBufferToObjectURL, GoogleChrome, missingCaseError, migrateColor };
|
||||
export {
|
||||
arrayBufferToObjectURL,
|
||||
GoogleChrome,
|
||||
isFileDangerous,
|
||||
migrateColor,
|
||||
missingCaseError,
|
||||
};
|
||||
|
@ -0,0 +1,6 @@
|
||||
// tslint:disable-next-line max-line-length
|
||||
const DANGEROUS_FILE_TYPES = /\.(ADE|ADP|APK|BAT|CHM|CMD|COM|CPL|DLL|DMG|EXE|HTA|INS|ISP|JAR|JS|JSE|LIB|LNK|MDE|MSC|MSI|MSP|MST|NSH|PIF|SCR|SCT|SHB|SYS|VB|VBE|VBS|VXD|WSC|WSF|WSH|CAB)$/i;
|
||||
|
||||
export function isFileDangerous(fileName: string): boolean {
|
||||
return DANGEROUS_FILE_TYPES.test(fileName);
|
||||
}
|
Loading…
Reference in New Issue