UNPKG

repoweaver

Version:

A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies

1 lines 2.78 kB
{"ast":null,"code":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createIconSourceCache;\nconst TYPE_VALUE = 'value';\nconst TYPE_ERROR = 'error';\nfunction createIconSourceCache() {\n const cache = new Map();\n const setValue = (key, value) => cache.set(key, {\n type: TYPE_VALUE,\n data: value\n });\n const setError = (key, error) => cache.set(key, {\n type: TYPE_ERROR,\n data: error\n });\n const get = key => {\n const value = cache.get(key);\n if (!value) {\n return undefined;\n }\n const {\n type,\n data\n } = value;\n if (type === TYPE_ERROR) {\n throw data;\n }\n return data;\n };\n return {\n setValue,\n setError,\n get\n };\n}","map":{"version":3,"names":["TYPE_VALUE","TYPE_ERROR","createIconSourceCache","cache","Map","setValue","key","value","set","type","data","setError","error","get","undefined"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-native-vector-icons/common/src/create-icon-source-cache.ts"],"sourcesContent":["const TYPE_VALUE = 'value';\nconst TYPE_ERROR = 'error';\n\ntype ValueData = { uri: string; scale: number };\n\ntype Value = { type: typeof TYPE_VALUE; data: ValueData } | { type: typeof TYPE_ERROR; data: Error };\n\nexport default function createIconSourceCache() {\n const cache = new Map<string, Value>();\n\n const setValue = (key: string, value: ValueData) => cache.set(key, { type: TYPE_VALUE, data: value });\n\n const setError = (key: string, error: Error) => cache.set(key, { type: TYPE_ERROR, data: error });\n\n const get = (key: string) => {\n const value = cache.get(key);\n if (!value) {\n return undefined;\n }\n\n const { type, data } = value;\n if (type === TYPE_ERROR) {\n throw data;\n }\n return data;\n };\n\n return { setValue, setError, get };\n}\n"],"mappings":";;;;;;AAAA,MAAMA,UAAU,GAAG,OAAO;AAC1B,MAAMC,UAAU,GAAG,OAAO;AAMX,SAASC,qBAAqBA,CAAA,EAAG;EAC9C,MAAMC,KAAK,GAAG,IAAIC,GAAG,CAAgB,CAAC;EAEtC,MAAMC,QAAQ,GAAGA,CAACC,GAAW,EAAEC,KAAgB,KAAKJ,KAAK,CAACK,GAAG,CAACF,GAAG,EAAE;IAAEG,IAAI,EAAET,UAAU;IAAEU,IAAI,EAAEH;EAAM,CAAC,CAAC;EAErG,MAAMI,QAAQ,GAAGA,CAACL,GAAW,EAAEM,KAAY,KAAKT,KAAK,CAACK,GAAG,CAACF,GAAG,EAAE;IAAEG,IAAI,EAAER,UAAU;IAAES,IAAI,EAAEE;EAAM,CAAC,CAAC;EAEjG,MAAMC,GAAG,GAAIP,GAAW,IAAK;IAC3B,MAAMC,KAAK,GAAGJ,KAAK,CAACU,GAAG,CAACP,GAAG,CAAC;IAC5B,IAAI,CAACC,KAAK,EAAE;MACV,OAAOO,SAAS;IAClB;IAEA,MAAM;MAAEL,IAAI;MAAEC;IAAK,CAAC,GAAGH,KAAK;IAC5B,IAAIE,IAAI,KAAKR,UAAU,EAAE;MACvB,MAAMS,IAAI;IACZ;IACA,OAAOA,IAAI;EACb,CAAC;EAED,OAAO;IAAEL,QAAQ;IAAEM,QAAQ;IAAEE;EAAI,CAAC;AACpC","ignoreList":[]},"metadata":{"hasCjsExports":true},"sourceType":"script","externalDependencies":[]}