Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 11x 2x 2x 9x 9x 9x 11x 11x | import lowercaseKeys from 'lowercase-keys' import protoProps from 'prototype-properties' const lowerProtoProps = lowercaseKeys(protoProps) /** * Determine if a property belongs to a type's prototype * @param {String} type - JS type * @param {String} property - name of property * @return {Boolean} - type has property on its prototype */ export default (type, property) => { if (typeof type !== 'string' || typeof property !== 'string') { throw new TypeError('Expected a string') } const lowerType = type.toLowerCase() return !!lowerProtoProps[lowerType] && lowerProtoProps[lowerType].indexOf(property) > -1 } |