UNPKG

react-blips

Version:
25 lines (18 loc) 739 B
'use strict'; exports.__esModule = true; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; exports.getPropNameOr = getPropNameOr; var _isNil = require('./isNil'); function getPropNameOr(key) { return function (config) { var name = key; if (!(0, _isNil.isNil)(config.name)) { if (_typeof(config.name) === 'object') { name = config.name[key] || key; } else if (typeof config.name === 'string') { name = key === 'data' ? config.name : key; } } return name; }; }