⌈⌋ ⎇ branch:  Bitrhythm


Hex Artifact Content

Artifact e65feb713e0ecae76032dea2192ec048c3f6252a37eff4280130e0058e497434:


0000: 63 6f 6e 73 74 20 45 56 45 4e 54 5f 41 54 54 52  const EVENT_ATTR
0010: 5f 52 45 20 3d 20 2f 5e 6f 6e 2f 0a 0a 2f 2a 2a  _RE = /^on/../**
0020: 0a 20 2a 20 54 72 75 65 20 69 66 20 74 68 65 20  . * True if the 
0030: 65 76 65 6e 74 20 61 74 74 72 69 62 75 74 65 20  event attribute 
0040: 73 74 61 72 74 73 20 77 69 74 68 20 27 6f 6e 27  starts with 'on'
0050: 0a 20 2a 20 40 70 61 72 61 6d 20 20 20 7b 20 53  . * @param   { S
0060: 74 72 69 6e 67 20 7d 20 61 74 74 72 69 62 75 74  tring } attribut
0070: 65 20 2d 20 65 76 65 6e 74 20 61 74 74 72 69 62  e - event attrib
0080: 75 74 65 0a 20 2a 20 40 72 65 74 75 72 6e 73 20  ute. * @returns 
0090: 7b 20 42 6f 6f 6c 65 61 6e 20 7d 0a 20 2a 2f 0a  { Boolean }. */.
00a0: 65 78 70 6f 72 74 20 64 65 66 61 75 6c 74 20 66  export default f
00b0: 75 6e 63 74 69 6f 6e 20 69 73 45 76 65 6e 74 41  unction isEventA
00c0: 74 74 72 69 62 75 74 65 28 61 74 74 72 69 62 75  ttribute(attribu
00d0: 74 65 29 20 7b 0a 20 20 72 65 74 75 72 6e 20 45  te) {.  return E
00e0: 56 45 4e 54 5f 41 54 54 52 5f 52 45 2e 74 65 73  VENT_ATTR_RE.tes
00f0: 74 28 61 74 74 72 69 62 75 74 65 29 0a 7d        t(attribute).}