{"version":3,"sources":["node_modules\\fbjs\\lib\\createArrayFromMixed.js"],"names":["invariant","require","toArray","obj","length","Array","isArray","process","env","NODE_ENV","callee","hasOwnProperty","prototype","slice","call","e","ret","ii","hasArrayNature","nodeType","createArrayFromMixed","module","exports"],"mappings":"AAAA;;;;;;;;;;;;;AAaA,GAAIA,WAAYC,QAAQ,aAAR,CAAhB;;;;;;;;;;;AAWA,QAASC,QAAT,CAAiBC,GAAjB,CAAsB;AACpB,GAAIC,QAASD,IAAIC,MAAjB;;;;AAIA,EAAE,CAACC,MAAMC,OAAN,CAAcH,GAAd,CAAD,GAAwB,MAAOA,IAAP,GAAe,QAAf,EAA2B,MAAOA,IAAP,GAAe,UAAlE,CAAF,EAAmFI,QAAQC,GAAR,CAAYC,QAAZ,GAAyB,YAAzB,CAAwCT,UAAU,KAAV,CAAiB,qCAAjB,CAAxC,CAAkGA,UAAU,KAAV,CAArL,CAAwM,IAAK,EAA7M;;AAEA,EAAE,MAAOI,OAAP,GAAkB,QAApB,EAAgCG,QAAQC,GAAR,CAAYC,QAAZ,GAAyB,YAAzB,CAAwCT,UAAU,KAAV,CAAiB,yCAAjB,CAAxC,CAAsGA,UAAU,KAAV,CAAtI,CAAyJ,IAAK,EAA9J;;AAEA,EAAEI,SAAW,CAAX,EAAgBA,OAAS,CAAT,GAAcD,IAAhC,EAAuCI,QAAQC,GAAR,CAAYC,QAAZ,GAAyB,YAAzB,CAAwCT,UAAU,KAAV,CAAiB,8CAAjB,CAAxC,CAA2GA,UAAU,KAAV,CAAlJ,CAAqK,IAAK,EAA1K;;AAEA,EAAE,MAAOG,KAAIO,MAAX,GAAsB,UAAxB,EAAsCH,QAAQC,GAAR,CAAYC,QAAZ,GAAyB,YAAzB,CAAwCT,UAAU,KAAV,CAAiB,0DAA4D,iDAA7E,CAAxC,CAA0KA,UAAU,KAAV,CAAhN,CAAmO,IAAK,EAAxO;;;;;AAKA,GAAIG,IAAIQ,cAAR,CAAwB;AACtB,GAAI;AACF,MAAON,OAAMO,SAAN,CAAgBC,KAAhB,CAAsBC,IAAtB,CAA2BX,GAA3B,CAAP;AACD,CAAC,MAAOY,CAAP,CAAU;;AAEX;AACF;;;;AAID,GAAIC,KAAMX,MAAMD,MAAN,CAAV;AACA,IAAK,GAAIa,IAAK,CAAd,CAAiBA,GAAKb,MAAtB,CAA8Ba,IAA9B,CAAoC;AAClCD,IAAIC,EAAJ,EAAUd,IAAIc,EAAJ,CAAV;AACD;AACD,MAAOD,IAAP;AACD;;;;;;;;;;;;;;;;;AAiBD,QAASE,eAAT,CAAwBf,GAAxB,CAA6B;AAC3B;;AAEE,CAAC,CAACA,GAAF;;AAEA,MAAOA,IAAP,EAAc,QAAd,EAA0B,MAAOA,IAAP,EAAc,UAFxC;;AAIA,UAAYA,IAJZ;;AAMA,EAAE,eAAiBA,IAAnB,CANA;;;AASA,MAAOA,KAAIgB,QAAX,EAAuB,QATvB;;AAWAd,MAAMC,OAAN,CAAcH,GAAd;;AAEA,UAAYA,IAFZ;;AAIA,QAAUA,IAfV,CAFF;;AAmBD;;;;;;;;;;;;;;;;;;;;;;;AAuBD,QAASiB,qBAAT,CAA8BjB,GAA9B,CAAmC;AACjC,GAAI,CAACe,eAAef,GAAf,CAAL,CAA0B;AACxB,MAAO,CAACA,GAAD,CAAP;AACD,CAFD,IAEO,IAAIE,MAAMC,OAAN,CAAcH,GAAd,CAAJ,CAAwB;AAC7B,MAAOA,KAAIU,KAAJ,EAAP;AACD,CAFM,IAEA;AACL,MAAOX,SAAQC,GAAR,CAAP;AACD;AACF;;AAEDkB,OAAOC,OAAP,CAAiBF,oBAAjB","file":"createArrayFromMixed.js","sourceRoot":"D:/Work/Office/react-native-on-web/cli/tmpl/project","sourcesContent":["'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks\n */\n\nvar invariant = require('./invariant');\n\n/**\n * Convert array-like objects to arrays.\n *\n * This API assumes the caller knows the contents of the data type. For less\n * well defined inputs use createArrayFromMixed.\n *\n * @param {object|function|filelist} obj\n * @return {array}\n */\nfunction toArray(obj) {\n  var length = obj.length;\n\n  // Some browsers builtin objects can report typeof 'function' (e.g. NodeList\n  // in old versions of Safari).\n  !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;\n\n  !(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;\n\n  !(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;\n\n  !(typeof obj.callee !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object can\\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0;\n\n  // Old IE doesn't give collections access to hasOwnProperty. Assume inputs\n  // without method will throw during the slice call and skip straight to the\n  // fallback.\n  if (obj.hasOwnProperty) {\n    try {\n      return Array.prototype.slice.call(obj);\n    } catch (e) {\n      // IE < 9 does not support Array#slice on collections objects\n    }\n  }\n\n  // Fall back to copying key by key. This assumes all keys have a value,\n  // so will not preserve sparsely populated inputs.\n  var ret = Array(length);\n  for (var ii = 0; ii < length; ii++) {\n    ret[ii] = obj[ii];\n  }\n  return ret;\n}\n\n/**\n * Perform a heuristic test to determine if an object is \"array-like\".\n *\n *   A monk asked Joshu, a Zen master, \"Has a dog Buddha nature?\"\n *   Joshu replied: \"Mu.\"\n *\n * This function determines if its argument has \"array nature\": it returns\n * true if the argument is an actual array, an `arguments' object, or an\n * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).\n *\n * It will return false for other array-like objects like Filelist.\n *\n * @param {*} obj\n * @return {boolean}\n */\nfunction hasArrayNature(obj) {\n  return (\n    // not null/false\n    !!obj && (\n    // arrays are objects, NodeLists are functions in Safari\n    typeof obj == 'object' || typeof obj == 'function') &&\n    // quacks like an array\n    'length' in obj &&\n    // not window\n    !('setInterval' in obj) &&\n    // no DOM node should be considered an array-like\n    // a 'select' element has 'length' and 'item' properties on IE8\n    typeof obj.nodeType != 'number' && (\n    // a real array\n    Array.isArray(obj) ||\n    // arguments\n    'callee' in obj ||\n    // HTMLCollection/NodeList\n    'item' in obj)\n  );\n}\n\n/**\n * Ensure that the argument is an array by wrapping it in an array if it is not.\n * Creates a copy of the argument if it is already an array.\n *\n * This is mostly useful idiomatically:\n *\n *   var createArrayFromMixed = require('createArrayFromMixed');\n *\n *   function takesOneOrMoreThings(things) {\n *     things = createArrayFromMixed(things);\n *     ...\n *   }\n *\n * This allows you to treat `things' as an array, but accept scalars in the API.\n *\n * If you need to convert an array-like object, like `arguments`, into an array\n * use toArray instead.\n *\n * @param {*} obj\n * @return {array}\n */\nfunction createArrayFromMixed(obj) {\n  if (!hasArrayNature(obj)) {\n    return [obj];\n  } else if (Array.isArray(obj)) {\n    return obj.slice();\n  } else {\n    return toArray(obj);\n  }\n}\n\nmodule.exports = createArrayFromMixed;"]}