72be9857d9f43f481dc1c74d0122ba70.json 5.5 KB
{"ast":null,"code":"function _typeof(obj) {\n  \"@babel/helpers - typeof\";\n\n  if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n    _typeof = function _typeof(obj) {\n      return typeof obj;\n    };\n  } else {\n    _typeof = function _typeof(obj) {\n      return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n    };\n  }\n\n  return _typeof(obj);\n}\n\nimport { isMemo } from 'react-is';\nexport function fillRef(ref, node) {\n  if (typeof ref === 'function') {\n    ref(node);\n  } else if (_typeof(ref) === 'object' && ref && 'current' in ref) {\n    ref.current = node;\n  }\n}\n/**\n * Merge refs into one ref function to support ref passing.\n */\n\nexport function composeRef() {\n  for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n    refs[_key] = arguments[_key];\n  }\n\n  return function (node) {\n    refs.forEach(function (ref) {\n      fillRef(ref, node);\n    });\n  };\n}\nexport function supportRef(nodeOrComponent) {\n  var _type$prototype, _nodeOrComponent$prot;\n\n  var type = isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type; // Function component node\n\n  if (typeof type === 'function' && !((_type$prototype = type.prototype) === null || _type$prototype === void 0 ? void 0 : _type$prototype.render)) {\n    return false;\n  } // Class component\n\n\n  if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) === null || _nodeOrComponent$prot === void 0 ? void 0 : _nodeOrComponent$prot.render)) {\n    return false;\n  }\n\n  return true;\n}\n/* eslint-enable */","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-util/es/ref.js"],"names":["_typeof","obj","Symbol","iterator","constructor","prototype","isMemo","fillRef","ref","node","current","composeRef","_len","arguments","length","refs","Array","_key","forEach","supportRef","nodeOrComponent","_type$prototype","_nodeOrComponent$prot","type","render"],"mappings":"AAAA,SAASA,OAAT,CAAiBC,GA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ACrBM,IAAAA,IAAI,CAACG,OAAL,CAAa,UAAUV,GAAV,EAAe;AAC1BD,MAAAA,OAAO,CAACC,GAAD,EAAMC,IAAN,CAAP;AACD,KAFD;AAGD,GAJD;AAKD;AACD,OAAO,SAASU,UAAT,CAAoBC,eAApB,EAAqC;AAC1C,MAAIC,eAAJ,EAAqBC,qBAArB;;AAEA,MAAIC,IAAI,GAAGjB,MAAM,CAACc,eAAD,CAAN,GAA0BA,eAAe,CAACG,IAAhB,CAAqBA,IAA/C,GAAsDH,eAAe,CAACG,IAAjF,CAH0C,CAG6C;;AAEvF,MAAI,OAAOA,IAAP,KAAgB,UAAhB,IAA8B,EAAE,CAACF,eAAe,GAAGE,IAAI,CAAClB,SAAxB,MAAuC,IAAvC,IAA+CgB,eAAe,KAAK,KAAK,CAAxE,GAA4E,KAAK,CAAjF,GAAqFA,eAAe,CAACG,MAAvG,CAAlC,EAAkJ;AAChJ,WAAO,KAAP;AACD,GAPyC,CAOxC;;;AAGF,MAAI,OAAOJ,eAAP,KAA2B,UAA3B,IAAyC,EAAE,CAACE,qBAAqB,GAAGF,eAAe,CAACf,SAAzC,MAAwD,IAAxD,IAAgEiB,qBAAqB,KAAK,KAAK,CAA/F,GAAmG,KAAK,CAAxG,GAA4GA,qBAAqB,CAACE,MAApI,CAA7C,EAA0L;AACxL,WAAO,KAAP;AACD;;AAED,SAAO,IAAP;AACD;AACD","sourcesContent":["function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { isMemo } from 'react-is';\nexport function fillRef(ref, node) {\n  if (typeof ref === 'function') {\n    ref(node);\n  } else if (_typeof(ref) === 'object' && ref && 'current' in ref) {\n    ref.current = node;\n  }\n}\n/**\n * Merge refs into one ref function to support ref passing.\n */\n\nexport function composeRef() {\n  for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n    refs[_key] = arguments[_key];\n  }\n\n  return function (node) {\n    refs.forEach(function (ref) {\n      fillRef(ref, node);\n    });\n  };\n}\nexport function supportRef(nodeOrComponent) {\n  var _type$prototype, _nodeOrComponent$prot;\n\n  var type = isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type; // Function component node\n\n  if (typeof type === 'function' && !((_type$prototype = type.prototype) === null || _type$prototype === void 0 ? void 0 : _type$prototype.render)) {\n    return false;\n  } // Class component\n\n\n  if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) === null || _nodeOrComponent$prot === void 0 ? void 0 : _nodeOrComponent$prot.render)) {\n    return false;\n  }\n\n  return true;\n}\n/* eslint-enable */"]},"metadata":{},"sourceType":"module"}