12345678910111213141516171819202122232425262728 |
- import { getCallback } from './getCallback';
- import { getKeyPrefix } from './getKeyPrefix';
- //tslint:disable-next-line:no-ignored-initial-value
- export function dropInstanceCommon(options, callback) {
- callback = getCallback.apply(this, arguments);
- options = (typeof options !== 'function' && options) || {};
- if (!options.name) {
- const currentConfig = this.config();
- options.name = options.name || currentConfig.name;
- options.storeName = options.storeName || currentConfig.storeName;
- }
- let promise;
- if (!options.name) {
- promise = Promise.reject('Invalid arguments');
- }
- else {
- promise = new Promise(resolve => {
- if (!options.storeName) {
- resolve(`${options.name}/`);
- }
- else {
- resolve(getKeyPrefix(options, this._defaultConfig));
- }
- });
- }
- return { promise, callback };
- }
- //# sourceMappingURL=dropInstanceCommon.js.map
|