diff --git a/config/default-b-tu.ts b/config/default-b-tu.ts index 988fe365..f6532b66 100644 --- a/config/default-b-tu.ts +++ b/config/default-b-tu.ts @@ -3,7 +3,7 @@ import {SCConfigFile} from '@openstapps/core'; import {RecursivePartial} from '@openstapps/logger/lib/common'; import moment from 'moment'; -import {inRangeInclusive} from '../src/common'; +import {inRangeInclusive} from './default'; const ssRange = [4, 9]; const wsRange = [10, 3]; diff --git a/config/default-fb-fh.ts b/config/default-fb-fh.ts index 496f0c5e..1e1b8360 100644 --- a/config/default-fb-fh.ts +++ b/config/default-fb-fh.ts @@ -3,7 +3,7 @@ import {SCConfigFile} from '@openstapps/core'; import {RecursivePartial} from '@openstapps/logger/lib/common'; import moment from 'moment'; -import {inRangeInclusive} from '../src/common'; +import {inRangeInclusive} from './default'; const ssRange = [4, 9]; const wsRange = [10, 3]; diff --git a/config/default-ks-ug.ts b/config/default-ks-ug.ts index 42be301b..61365b72 100644 --- a/config/default-ks-ug.ts +++ b/config/default-ks-ug.ts @@ -3,7 +3,7 @@ import {SCConfigFile} from '@openstapps/core'; import {RecursivePartial} from '@openstapps/logger/lib/common'; import moment from 'moment'; -import {inRangeInclusive} from '../src/common'; +import {inRangeInclusive} from './default'; const ssRange = [4, 9]; const wsRange = [10, 3]; diff --git a/config/default.ts b/config/default.ts index 7e6a1a42..a43f678d 100644 --- a/config/default.ts +++ b/config/default.ts @@ -12,6 +12,16 @@ import { import {readFileSync} from 'fs'; import {resolve} from 'path'; +/** + * Evaluates if a number is within the given range + * + * @param num The number that should be checked + * @param range Array of two numbers representing a range (inclusive interval) + */ +export function inRangeInclusive(num: number, range: number[]): boolean { + return num >= range[0] && num <= range[1]; +} + const userGroupSetting: SCUserGroupSetting = { categories: ['profile'], defaultValue: 'students', diff --git a/src/common.ts b/src/common.ts index 1e9e5e26..5777a1cd 100644 --- a/src/common.ts +++ b/src/common.ts @@ -18,16 +18,6 @@ import {Validator} from '@openstapps/core-tools/lib/validate'; import config from 'config'; import {BackendTransport} from './notification/backend-transport'; -/** - * Evaluates if a number is within the given range - * - * @param num The number that should be checked - * @param range Array of two numbers representing a range (inclusive interval) - */ -export function inRangeInclusive(num: number, range: number[]): boolean { - return num >= range[0] && num <= range[1]; -} - /** * Instance of the transport for sending mails */ diff --git a/test/common.spec.ts b/test/common.spec.ts index bc2f31a5..513f0f3a 100644 --- a/test/common.spec.ts +++ b/test/common.spec.ts @@ -13,7 +13,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import {inRangeInclusive} from '../src/common'; +import {inRangeInclusive} from '../config/default'; import {expect} from 'chai'; describe('Common', function () {