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