Sha256: ceda5be8f50ef142360093ad8dea45beb09199b8f6b34cd64c88b56815e9a503
Contents?: true
Size: 1.22 KB
Versions: 43
Compression:
Stored size: 1.22 KB
Contents
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = elementType; function resolveMemberExpressions() { var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var property = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; if (object.type === 'JSXMemberExpression') { return resolveMemberExpressions(object.object, object.property) + '.' + property.name; } return object.name + '.' + property.name; } /** * Returns the tagName associated with a JSXElement. */ function elementType() { var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var name = node.name; if (!name) { throw new Error('The argument provided is not a JSXElement node.'); } if (name.type === 'JSXMemberExpression') { var _name$object = name.object, object = _name$object === undefined ? {} : _name$object, _name$property = name.property, property = _name$property === undefined ? {} : _name$property; return resolveMemberExpressions(object, property); } if (name.type === 'JSXNamespacedName') { return name.namespace.name + ':' + name.name.name; } return node.name.name; }
Version data entries
43 entries across 43 versions & 1 rubygems