repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 2.62 kB
JSON
{"ast":null,"code":"\"use strict\";\n\nimport * as React from 'react';\nimport Animated from \"react-native-web/dist/exports/Animated\";\nexport function useAnimatedHashMap({\n routes,\n index\n}) {\n const refs = React.useRef({});\n const previous = refs.current;\n const routeKeys = Object.keys(previous);\n if (routes.length === routeKeys.length && routes.every(route => routeKeys.includes(route.key))) {\n return previous;\n }\n refs.current = {};\n routes.forEach(({\n key\n }, i) => {\n refs.current[key] = previous[key] ?? new Animated.Value(i === index ? 0 : i >= index ? 1 : -1);\n });\n return refs.current;\n}","map":{"version":3,"names":["React","Animated","useAnimatedHashMap","routes","index","refs","useRef","previous","current","routeKeys","Object","keys","length","every","route","includes","key","forEach","i","Value"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/bottom-tabs/src/utils/useAnimatedHashMap.tsx"],"sourcesContent":["import type { NavigationState } from '@react-navigation/routers';\nimport * as React from 'react';\nimport { Animated } from 'react-native';\n\nexport function useAnimatedHashMap({ routes, index }: NavigationState) {\n const refs = React.useRef<Record<string, Animated.Value>>({});\n const previous = refs.current;\n const routeKeys = Object.keys(previous);\n\n if (\n routes.length === routeKeys.length &&\n routes.every((route) => routeKeys.includes(route.key))\n ) {\n return previous;\n }\n refs.current = {};\n\n routes.forEach(({ key }, i) => {\n refs.current[key] =\n previous[key] ??\n new Animated.Value(i === index ? 0 : i >= index ? 1 : -1);\n });\n\n return refs.current;\n}\n"],"mappings":";;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAA,OAAAC,QAAA;AAG9B,OAAO,SAASC,kBAAkBA,CAAC;EAAEC,MAAM;EAAEC;AAAuB,CAAC,EAAE;EACrE,MAAMC,IAAI,GAAGL,KAAK,CAACM,MAAM,CAAiC,CAAC,CAAC,CAAC;EAC7D,MAAMC,QAAQ,GAAGF,IAAI,CAACG,OAAO;EAC7B,MAAMC,SAAS,GAAGC,MAAM,CAACC,IAAI,CAACJ,QAAQ,CAAC;EAEvC,IACEJ,MAAM,CAACS,MAAM,KAAKH,SAAS,CAACG,MAAM,IAClCT,MAAM,CAACU,KAAK,CAAEC,KAAK,IAAKL,SAAS,CAACM,QAAQ,CAACD,KAAK,CAACE,GAAG,CAAC,CAAC,EACtD;IACA,OAAOT,QAAQ;EACjB;EACAF,IAAI,CAACG,OAAO,GAAG,CAAC,CAAC;EAEjBL,MAAM,CAACc,OAAO,CAAC,CAAC;IAAED;EAAI,CAAC,EAAEE,CAAC,KAAK;IAC7Bb,IAAI,CAACG,OAAO,CAACQ,GAAG,CAAC,GACfT,QAAQ,CAACS,GAAG,CAAC,IACb,IAAIf,QAAQ,CAACkB,KAAK,CAACD,CAAC,KAAKd,KAAK,GAAG,CAAC,GAAGc,CAAC,IAAId,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;EAC7D,CAAC,CAAC;EAEF,OAAOC,IAAI,CAACG,OAAO;AACrB","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}