Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {
FlashStore,
FlashStoreSync,
VERSION,
} from 'flash-store'
if (VERSION === '0.0.0') {
throw new Error('version should be set befoer publishing')
}
const store = new FlashStore()
store.destroy()
const storeSync = new FlashStoreSync()
storeSync.destroy()
console.info(`Smoke Testing v${store.version()} PASSED!`)
import {
FlashStore,
FlashStoreSync,
VERSION,
} from 'flash-store'
if (VERSION === '0.0.0') {
throw new Error('version should be set befoer publishing')
}
const store = new FlashStore()
store.destroy()
const storeSync = new FlashStoreSync()
storeSync.destroy()
console.info(`Smoke Testing v${store.version()} PASSED!`)
public init(): void {
log.verbose('FaceCache', 'init()')
if (!fs.existsSync(this.workdir)) {
throw new Error(`directory not exist: ${this.workdir}`)
}
if (!this.store) {
const storeName = 'face-cache.store'
this.store = new FlashStore(
path.join(this.workdir, storeName),
)
}
if (!this.embeddingStore) {
const storeName = 'face-cache-embedding.store'
this.embeddingStore = new FlashStore(
path.join(this.workdir, storeName),
)
}
if (!this.imagedir) {
const dirName = 'imagedir'
this.imagedir = path.join(this.workdir, dirName)
if (!fs.existsSync(this.imagedir)) {
fs.mkdirSync(this.imagedir)
}
}
}
public init(): void {
log.verbose('FaceCache', 'init()')
if (!fs.existsSync(this.workdir)) {
throw new Error(`directory not exist: ${this.workdir}`)
}
if (!this.store) {
const storeName = 'face-cache.store'
this.store = new FlashStore(
path.join(this.workdir, storeName),
)
}
if (!this.embeddingStore) {
const storeName = 'face-cache-embedding.store'
this.embeddingStore = new FlashStore(
path.join(this.workdir, storeName),
)
}
if (!this.imagedir) {
const dirName = 'imagedir'
this.imagedir = path.join(this.workdir, dirName)
if (!fs.existsSync(this.imagedir)) {
fs.mkdirSync(this.imagedir)
}
'.wechaty',
'puppet-macpro-cache',
path.sep,
'flash-store-v0.14',
path.sep,
userId,
)
const baseDirExist = await fs.pathExists(baseDir)
if (!baseDirExist) {
await fs.mkdirp(baseDir)
}
this.cacheContactRawPayload = new FlashStore(path.join(baseDir, 'contact-raw-payload'))
this.cacheRoomMemberRawPayload = new FlashStore(path.join(baseDir, 'room-member-raw-payload'))
this.cacheRoomRawPayload = new FlashStore(path.join(baseDir, 'room-raw-payload'))
this.cacheFile = new FlashStore(path.join(baseDir, 'file-cache'))
this.cacheFriendshipRawPayload = new FlashStore(path.join(baseDir, 'friendship'))
const contactTotal = this.cacheContactRawPayload.size
log.verbose(PRE, `initCache() inited ${await contactTotal} Contacts, cachedir="${baseDir}"`)
}
path.sep,
'flash-store-v0.14',
path.sep,
userId,
)
const baseDirExist = await fs.pathExists(baseDir)
if (!baseDirExist) {
await fs.mkdirp(baseDir)
}
this.cacheContactRawPayload = new FlashStore(path.join(baseDir, 'contact-raw-payload'))
this.cacheRoomMemberRawPayload = new FlashStore(path.join(baseDir, 'room-member-raw-payload'))
this.cacheRoomRawPayload = new FlashStore(path.join(baseDir, 'room-raw-payload'))
this.cacheFile = new FlashStore(path.join(baseDir, 'file-cache'))
this.cacheFriendshipRawPayload = new FlashStore(path.join(baseDir, 'friendship'))
const contactTotal = this.cacheContactRawPayload.size
log.verbose(PRE, `initCache() inited ${await contactTotal} Contacts, cachedir="${baseDir}"`)
}
'puppet-macpro-cache',
path.sep,
'flash-store-v0.14',
path.sep,
userId,
)
const baseDirExist = await fs.pathExists(baseDir)
if (!baseDirExist) {
await fs.mkdirp(baseDir)
}
this.cacheContactRawPayload = new FlashStore(path.join(baseDir, 'contact-raw-payload'))
this.cacheRoomMemberRawPayload = new FlashStore(path.join(baseDir, 'room-member-raw-payload'))
this.cacheRoomRawPayload = new FlashStore(path.join(baseDir, 'room-raw-payload'))
this.cacheFile = new FlashStore(path.join(baseDir, 'file-cache'))
this.cacheFriendshipRawPayload = new FlashStore(path.join(baseDir, 'friendship'))
const contactTotal = this.cacheContactRawPayload.size
log.verbose(PRE, `initCache() inited ${await contactTotal} Contacts, cachedir="${baseDir}"`)
}
path.sep,
'.wechaty',
'puppet-padplus-cache',
path.sep,
'flash-store-v0.14',
path.sep,
userId,
)
const baseDirExist = await fs.pathExists(baseDir)
if (!baseDirExist) {
await fs.mkdirp(baseDir)
}
this.cacheWXID = new FlashStore(path.join(baseDir, 'accound-wxid'))
this.cacheContactRawPayload = new FlashStore(path.join(baseDir, 'contact-raw-payload'))
this.cacheRoomMemberRawPayload = new FlashStore(path.join(baseDir, 'room-member-raw-payload'))
this.cacheRoomRawPayload = new FlashStore(path.join(baseDir, 'room-raw-payload'))
this.cacheFriendshipRawPayload = new FlashStore(path.join(baseDir, 'friendship'))
const contactTotal = this.cacheContactRawPayload.size
log.verbose(PRE, `initCache() inited ${contactTotal} Contacts, cachedir="${baseDir}"`)
}
path.sep,
'flash-store-v0.14',
path.sep,
userId,
)
const baseDirExist = await fs.pathExists(baseDir)
if (!baseDirExist) {
await fs.mkdirp(baseDir)
}
this.cacheWXID = new FlashStore(path.join(baseDir, 'accound-wxid'))
this.cacheContactRawPayload = new FlashStore(path.join(baseDir, 'contact-raw-payload'))
this.cacheRoomMemberRawPayload = new FlashStore(path.join(baseDir, 'room-member-raw-payload'))
this.cacheRoomRawPayload = new FlashStore(path.join(baseDir, 'room-raw-payload'))
this.cacheFriendshipRawPayload = new FlashStore(path.join(baseDir, 'friendship'))
const contactTotal = this.cacheContactRawPayload.size
log.verbose(PRE, `initCache() inited ${contactTotal} Contacts, cachedir="${baseDir}"`)
}
'flash-store-v0.14',
path.sep,
userId,
)
const baseDirExist = await fs.pathExists(baseDir)
if (!baseDirExist) {
await fs.mkdirp(baseDir)
}
this.cacheContactRawPayload = new FlashStore(path.join(baseDir, 'contact-raw-payload'))
this.cacheRoomMemberRawPayload = new FlashStore(path.join(baseDir, 'room-member-raw-payload'))
this.cacheRoomRawPayload = new FlashStore(path.join(baseDir, 'room-raw-payload'))
this.cacheFile = new FlashStore(path.join(baseDir, 'file-cache'))
this.cacheFriendshipRawPayload = new FlashStore(path.join(baseDir, 'friendship'))
const contactTotal = this.cacheContactRawPayload.size
log.verbose(PRE, `initCache() inited ${await contactTotal} Contacts, cachedir="${baseDir}"`)
}