@lcap/nasl
Version:
NetEase Application Specific Language
21 lines • 856 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isStorageChanged = void 0;
const types_1 = require("../types");
const storage_1 = require("../storage");
exports.isStorageChanged = {
name: 'is-storage-changed',
async afterInit({ instructStatus: status }) {
const current = await (0, storage_1.getGlobalChangedTime)();
// 和服务端时间不一致,清除所有状态
if (current !== status.globalChangedTime) {
(0, storage_1.clearStorage)();
await (0, storage_1.setGlobalChangedTime)(status.globalChangedTime);
}
},
async afterInstruct(_, { instructStatus: status }) {
await (0, storage_1.setGlobalChangedTime)(status.globalChangedTime);
return types_1.RuleResult.UnMatch;
},
};
//# sourceMappingURL=is-storage-changed.js.map