UNPKG

react-dnd-html5-backend

Version:

HTML5 backend for React DnD

1 lines 926 B
{"version":3,"sources":["../src/matchesType.ts"],"sourcesContent":["//\n// HACK: copied from dnd-core. duplicating here to fix a CI issue\n//\nimport type { Identifier, SourceType, TargetType } from 'dnd-core'\n\nexport function matchesType(\n\ttargetType: TargetType | null,\n\tdraggedItemType: SourceType | null,\n): boolean {\n\tif (draggedItemType === null) {\n\t\treturn targetType === null\n\t}\n\treturn Array.isArray(targetType)\n\t\t? (targetType as Identifier[]).some((t) => t === draggedItemType)\n\t\t: targetType === draggedItemType\n}\n"],"names":["matchesType","targetType","draggedItemType","Array","isArray","some","t"],"mappings":"AAKA,OAAO,SAASA,WAAW,CAC1BC,UAA6B,EAC7BC,eAAkC,EACxB;IACV,IAAIA,eAAe,KAAK,IAAI,EAAE;QAC7B,OAAOD,UAAU,KAAK,IAAI,CAAA;KAC1B;IACD,OAAOE,KAAK,CAACC,OAAO,CAACH,UAAU,CAAC,GAC7B,AAACA,UAAU,CAAkBI,IAAI,CAAC,CAACC,CAAC,GAAKA,CAAC,KAAKJ,eAAe;IAAA,CAAC,GAC/DD,UAAU,KAAKC,eAAe,CAAA;CACjC"}