/
drndsv
/
react
Обзор
Документация
Войти
/
drndsv
/
react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/jsx-ast-utils/lib/propName.js
22 строки
573 B
drndsv
Initial commit
14 апр 2025, 22:53
14 апр 2025, 22:53
641ac8a
Код
Авторство
О чём код?
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = propName; /** * Returns the name of the prop given the JSXAttribute object. */ function propName() { var prop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; if (!prop.type || prop.type !== 'JSXAttribute') { throw new Error('The prop must be a JSXAttribute collected by the AST parser.'); } if (prop.name.type === 'JSXNamespacedName') { return prop.name.namespace.name + ':' + prop.name.name.name; } return prop.name.name; }