1'use strict' 2 3const ls = require('../ls.js') 4const get = require('../get.js') 5const put = require('../put.js') 6const rm = require('../rm.js') 7const verify = require('../verify.js') 8const setLocale = require('../lib/util/y.js').setLocale 9const clearMemoized = require('../lib/memoization.js').clearMemoized 10const tmp = require('../lib/util/tmp.js') 11 12setLocale('en') 13 14const x = module.exports 15 16x.ls = cache => ls(cache) 17x.ls.stream = cache => ls.stream(cache) 18 19x.get = (cache, key, opts) => get(cache, key, opts) 20x.get.byDigest = (cache, hash, opts) => get.byDigest(cache, hash, opts) 21x.get.sync = (cache, key, opts) => get.sync(cache, key, opts) 22x.get.sync.byDigest = (cache, key, opts) => get.sync.byDigest(cache, key, opts) 23x.get.stream = (cache, key, opts) => get.stream(cache, key, opts) 24x.get.stream.byDigest = (cache, hash, opts) => get.stream.byDigest(cache, hash, opts) 25x.get.copy = (cache, key, dest, opts) => get.copy(cache, key, dest, opts) 26x.get.copy.byDigest = (cache, hash, dest, opts) => get.copy.byDigest(cache, hash, dest, opts) 27x.get.info = (cache, key) => get.info(cache, key) 28x.get.hasContent = (cache, hash) => get.hasContent(cache, hash) 29x.get.hasContent.sync = (cache, hash) => get.hasContent.sync(cache, hash) 30 31x.put = (cache, key, data, opts) => put(cache, key, data, opts) 32x.put.stream = (cache, key, opts) => put.stream(cache, key, opts) 33 34x.rm = (cache, key) => rm.entry(cache, key) 35x.rm.all = cache => rm.all(cache) 36x.rm.entry = x.rm 37x.rm.content = (cache, hash) => rm.content(cache, hash) 38 39x.setLocale = lang => setLocale(lang) 40x.clearMemoized = () => clearMemoized() 41 42x.tmp = {} 43x.tmp.mkdir = (cache, opts) => tmp.mkdir(cache, opts) 44x.tmp.withTmp = (cache, opts, cb) => tmp.withTmp(cache, opts, cb) 45 46x.verify = (cache, opts) => verify(cache, opts) 47x.verify.lastRun = cache => verify.lastRun(cache) 48