67cda6bb7ff8ec0e07c26b0f6f9865c2.json 4.9 KB
{"ast":null,"code":"var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.createAnimatedDebug=createAnimatedDebug;var _slicedToArray2=_interopRequireDefault(require(\"@babel/runtime/helpers/slicedToArray\"));var _classCallCheck2=_interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));var _createClass2=_interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));var _possibleConstructorReturn2=_interopRequireDefault(require(\"@babel/runtime/helpers/possibleConstructorReturn\"));var _getPrototypeOf2=_interopRequireDefault(require(\"@babel/runtime/helpers/getPrototypeOf\"));var _inherits2=_interopRequireDefault(require(\"@babel/runtime/helpers/inherits\"));var _val=require(\"../val\");var _AnimatedNode2=_interopRequireDefault(require(\"./AnimatedNode\"));var _AnimatedBlock=require(\"./AnimatedBlock\");var _AnimatedCall=require(\"./AnimatedCall\");var AnimatedDebug=function(_AnimatedNode){(0,_inherits2.default)(AnimatedDebug,_AnimatedNode);function AnimatedDebug(message,value){var _this;(0,_classCallCheck2.default)(this,AnimatedDebug);_this=(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(AnimatedDebug).call(this,{type:'debug',message:message,value:value.__nodeID},[value]));_this._message=message;_this._value=value;return _this;}(0,_createClass2.default)(AnimatedDebug,[{key:\"__onEvaluate\",value:function __onEvaluate(){var value=(0,_val.val)(this._value);console.log(this._message,value);return value;}}]);return AnimatedDebug;}(_AnimatedNode2.default);function createAnimatedDebug(message,value){if(__DEV__){var runningInRemoteDebugger=typeof atob!=='undefined';var runningInExpoShell=global.Expo&&global.Expo.Constants.appOwnership!=='standalone';if(runningInRemoteDebugger||runningInExpoShell){return(0,_AnimatedBlock.createAnimatedBlock)([(0,_AnimatedCall.createAnimatedCall)([value],function(_ref){var _ref2=(0,_slicedToArray2.default)(_ref,1),a=_ref2[0];return console.log(message+\" \"+a);}),value]);}else{return new AnimatedDebug(message,(0,_AnimatedBlock.adapt)(value));}}return value;}","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-reanimated/src/core/AnimatedDebug.js"],"names":["AnimatedDebug","message","value","type","__nodeID","_message","_value","console","log","AnimatedNode","createAnimatedDebug","__DEV__","runningInRemoteDebugger","atob","runningInExpoShell","global","Expo","Constants","appOwnership","a"],"mappings":"kvBAAA,2BACA,qEACA,8CACA,4C,GAEMA,CAAAA,a,6EAIJ,uBAAYC,OAAZ,CAAqBC,KAArB,CAA4B,4DAC1B,yGAAM,CAAEC,IAAI,CAAE,OAAR,CAAiBF,OAAO,CAAPA,OAAjB,CAA0BC,KAAK,CAAEA,KAAK,CAACE,QAAvC,CAAN,CAAyD,CAACF,KAAD,CAAzD,GACA,MAAKG,QAAL,CAAgBJ,OAAhB,CACA,MAAKK,MAAL,CAAcJ,KAAd,CAH0B,aAI3B,C,0FAEc,CACb,GAAMA,CAAAA,KAAK,CAAG,aAAI,KAAKI,MAAT,CAAd,CACAC,OAAO,CAACC,GAAR,CAAY,KAAKH,QAAjB,CAA2BH,KAA3B,EACA,MAAOA,CAAAA,KAAP,CACD,C,2BAdyBO,sB,EAiBrB,QAASC,CAAAA,mBAAT,CAA6BT,OAA7B,CAAsCC,KAAtC,CAA6C,CAClD,GAAIS,OAAJ,CAAa,CACX,GAAMC,CAAAA,uBAAuB,CAAG,MAAOC,CAAAA,IAAP,GAAgB,WAAhD,CAIA,GAAMC,CAAAA,kBAAkB,CACtBC,MAAM,CAACC,IAAP,EAAeD,MAAM,CAACC,IAAP,CAAYC,SAAZ,CAAsBC,YAAtB,GAAuC,YADxD,CAGA,GAAIN,uBAAuB,EAAIE,kBAA/B,CAAmD,CAGjD,MAAO,uCAAM,CACX,qCAAK,CAACZ,KAAD,CAAL,CAAc,6DAAEiB,CAAF,gBAASZ,CAAAA,OAAO,CAACC,GAAR,CAAeP,OAAf,KAA0BkB,CAA1B,CAAT,EAAd,CADW,CAEXjB,KAFW,CAAN,CAAP,CAID,CAPD,IAOO,CACL,MAAO,IAAIF,CAAAA,aAAJ,CAAkBC,OAAlB,CAA2B,yBAAMC,KAAN,CAA3B,CAAP,CACD,CACF,CAED,MAAOA,CAAAA,KAAP,CACD","sourcesContent":["import { val } from '../val';\nimport AnimatedNode from './AnimatedNode';\nimport { createAnimatedBlock as block, adapt } from './AnimatedBlock';\nimport { createAnimatedCall as call } from './AnimatedCall';\n\nclass AnimatedDebug extends AnimatedNode {\n  _message;\n  _value;\n\n  constructor(message, value) {\n    super({ type: 'debug', message, value: value.__nodeID }, [value]);\n    this._message = message;\n    this._value = value;\n  }\n\n  __onEvaluate() {\n    const value = val(this._value);\n    console.log(this._message, value);\n    return value;\n  }\n}\n\nexport function createAnimatedDebug(message, value) {\n  if (__DEV__) {\n    const runningInRemoteDebugger = typeof atob !== 'undefined';\n    // hack to detect if app is running in remote debugger\n    // https://stackoverflow.com/questions/39022216\n\n    const runningInExpoShell =\n      global.Expo && global.Expo.Constants.appOwnership !== 'standalone';\n\n    if (runningInRemoteDebugger || runningInExpoShell) {\n      // When running in expo or remote debugger we use JS console.log to output variables\n      // otherwise we output to the native console using native debug node\n      return block([\n        call([value], ([a]) => console.log(`${message} ${a}`)),\n        value,\n      ]);\n    } else {\n      return new AnimatedDebug(message, adapt(value));\n    }\n  }\n  // Debugging is disabled in PROD\n  return value;\n}\n"]},"metadata":{},"sourceType":"script"}