aboutsummaryrefslogtreecommitdiff
path: root/src/shared/operations.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/operations.ts')
-rw-r--r--src/shared/operations.ts28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/shared/operations.ts b/src/shared/operations.ts
index 1ce5256..beca7b9 100644
--- a/src/shared/operations.ts
+++ b/src/shared/operations.ts
@@ -376,7 +376,7 @@ const assertOptionalBoolean = (obj: any, name: string) => {
const assertOptionalString = (obj: any, name: string, values?: string[]) => {
if (Object.prototype.hasOwnProperty.call(obj, name)) {
- let value = obj[name];
+ const value = obj[name];
if (typeof value !== 'string') {
throw new TypeError(
`Not a string parameter: '${name}' (${typeof value})`,
@@ -508,3 +508,29 @@ export const valueOf = (o: any): Operation => {
}
throw new TypeError('Unknown operation type: ' + o.type);
};
+
+export const isNRepeatable = (type: string): boolean => {
+ switch (type) {
+ case SCROLL_VERTICALLY:
+ case SCROLL_HORIZONALLY:
+ case SCROLL_PAGES:
+ case NAVIGATE_HISTORY_PREV:
+ case NAVIGATE_HISTORY_NEXT:
+ case NAVIGATE_PARENT:
+ case TAB_CLOSE:
+ case TAB_CLOSE_FORCE:
+ case TAB_CLOSE_RIGHT:
+ case TAB_REOPEN:
+ case TAB_PREV:
+ case TAB_NEXT:
+ case TAB_DUPLICATE:
+ case ZOOM_IN:
+ case ZOOM_OUT:
+ case URLS_PASTE:
+ case FIND_NEXT:
+ case FIND_PREV:
+ case REPEAT_LAST:
+ return true;
+ }
+ return false;
+};