Skip to content

Commit

Permalink
refactor(postman): consolidate migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Aug 20, 2023
1 parent e269654 commit e80ee75
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import collection from '../collection.json';
import { traverse, writeCollection } from '../../utils';

const NUMERIC_REGEX = /^\d+$/;

traverse(collection, '', null, (value, key, parent) => {
if (key === 'name' && value === 'Create Scheduled Messages') {
delete parent.request.body.options;
}

if (key === 'value') {
switch (value) {
case 'true':
Expand All @@ -10,6 +16,11 @@ traverse(collection, '', null, (value, key, parent) => {
case 'false':
parent[key] = false;
break;
default:
if (NUMERIC_REGEX.test(value)) {
parent[key] = parseInt(value, 10);
}
break;
}
}
});
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit e80ee75

Please sign in to comment.