Sha256: ee411fed0433affa9a23b20937ae9b9a79e173d71dce7dc0633c54e27378a78d

Contents?: true

Size: 1.43 KB

Versions: 41

Compression:

Stored size: 1.43 KB

Contents

{"version":3,"sources":["../src/cacheWrapper.ts"],"names":["cacheWrapper","cache","key","fn","cached","get","undefined","result","set","cacheWrapperSync"],"mappings":";;;;;;;;AAEA,eAAeA,YAAf,CACEC,KADF,EAEEC,GAFF,EAGEC,EAHF,EAI8B;AAC5B,QAAMC,MAAM,GAAGH,KAAK,CAACI,GAAN,CAAUH,GAAV,CAAf;;AACA,MAAIE,MAAM,KAAKE,SAAf,EAA0B;AACxB,WAAOF,MAAP;AACD;;AAED,QAAMG,MAAM,GAAG,MAAMJ,EAAE,EAAvB;AACAF,EAAAA,KAAK,CAACO,GAAN,CAAUN,GAAV,EAAeK,MAAf;AACA,SAAOA,MAAP;AACD;;AAED,SAASE,gBAAT,CACER,KADF,EAEEC,GAFF,EAGEC,EAHF,EAIqB;AACnB,QAAMC,MAAM,GAAGH,KAAK,CAACI,GAAN,CAAUH,GAAV,CAAf;;AACA,MAAIE,MAAM,KAAKE,SAAf,EAA0B;AACxB,WAAOF,MAAP;AACD;;AAED,QAAMG,MAAM,GAAGJ,EAAE,EAAjB;AACAF,EAAAA,KAAK,CAACO,GAAN,CAAUN,GAAV,EAAeK,MAAf;AACA,SAAOA,MAAP;AACD","sourcesContent":["import { Cache, CosmiconfigResult } from './types';\n\nasync function cacheWrapper(\n  cache: Cache,\n  key: string,\n  fn: () => Promise<CosmiconfigResult>,\n): Promise<CosmiconfigResult> {\n  const cached = cache.get(key);\n  if (cached !== undefined) {\n    return cached;\n  }\n\n  const result = await fn();\n  cache.set(key, result);\n  return result;\n}\n\nfunction cacheWrapperSync(\n  cache: Cache,\n  key: string,\n  fn: () => CosmiconfigResult,\n): CosmiconfigResult {\n  const cached = cache.get(key);\n  if (cached !== undefined) {\n    return cached;\n  }\n\n  const result = fn();\n  cache.set(key, result);\n  return result;\n}\n\nexport { cacheWrapper, cacheWrapperSync };\n"],"file":"cacheWrapper.js"}

Version data entries

41 entries across 40 versions & 7 rubygems

Version Path
trusty-cms-4.3.2 node_modules/cosmiconfig/dist/cacheWrapper.js.map
trusty-cms-4.3.1 node_modules/cosmiconfig/dist/cacheWrapper.js.map
trusty-cms-4.3 node_modules/cosmiconfig/dist/cacheWrapper.js.map
trusty-cms-4.2.3 node_modules/cosmiconfig/dist/cacheWrapper.js.map
tang-0.2.1 spec/tang_app/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/cacheWrapper.js.map
trusty-cms-4.2.2 node_modules/cosmiconfig/dist/cacheWrapper.js.map
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/cacheWrapper.js.map
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/cacheWrapper.js.map
ruby2js-4.0.4 lib/tasks/testrails/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/cacheWrapper.js.map
ruby2js-4.0.3 lib/tasks/testrails/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/cacheWrapper.js.map
trusty-cms-4.2.1 node_modules/cosmiconfig/dist/cacheWrapper.js.map
trusty-cms-4.2 node_modules/cosmiconfig/dist/cacheWrapper.js.map
trusty-cms-4.1.9 node_modules/cosmiconfig/dist/cacheWrapper.js.map
trusty-cms-4.1.8 node_modules/cosmiconfig/dist/cacheWrapper.js.map
tang-0.2.0 spec/tang_app/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/cacheWrapper.js.map
trusty-cms-4.1.7 node_modules/cosmiconfig/dist/cacheWrapper.js.map
tang-0.1.0 spec/tang_app/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/cacheWrapper.js.map
tang-0.0.9 spec/tang_app/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/cacheWrapper.js.map
trusty-cms-4.1.6 node_modules/cosmiconfig/dist/cacheWrapper.js.map
trusty-cms-4.1.5 node_modules/cosmiconfig/dist/cacheWrapper.js.map