react-blips
Version:
Official React bindings for Blips
19 lines (15 loc) • 651 B
JavaScript
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; };
import { isNil } from './isNil';
export function getPropNameOr(key) {
return function (config) {
var name = key;
if (!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;
};
}