@sheto/storage
Version:
你见过这么方便的Storage操作库吗?我见过,就是这个!
16 lines (15 loc) • 459 B
JavaScript
import { SUFFIX, DEFAULT } from './magic';
export function _generateStorageName(name) {
return `${name || DEFAULT}${SUFFIX}`;
}
export function _batchInitStore(name) {
if (Array.isArray(name)) {
const [firstStoreName, ...otherStoreNames] = name;
for (const storeName of otherStoreNames) {
this.create(_generateStorageName(storeName));
}
this.use(firstStoreName);
return;
}
this.use(name);
}