generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): ⬆️ Use Toggl RequestUrl API when available.
- Loading branch information
Showing
7 changed files
with
67 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
80 | ||
], | ||
"conventionalCommits.scopes": [ | ||
"reports" | ||
"reports", | ||
"api" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule toggl-client
added at
0f5a96
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { checkVersion } from './checkVersion'; | ||
|
||
describe('parse', () => { | ||
it('passes on equal version', () => { | ||
expect(checkVersion('1.2.3', 1, 2, 3)).toStrictEqual(true); | ||
}); | ||
|
||
it('passes on greater patch version', () => { | ||
expect(checkVersion('1.2.4', 1, 2, 3)).toStrictEqual(true); | ||
}); | ||
|
||
it('passes on greater minor version', () => { | ||
expect(checkVersion('1.3.4', 1, 2, 3)).toStrictEqual(true); | ||
}); | ||
|
||
it('passes on greater major version', () => { | ||
expect(checkVersion('2.3.4', 1, 2, 3)).toStrictEqual(true); | ||
}); | ||
|
||
it('fails on lesser major version', () => { | ||
expect(checkVersion('0.2.3', 1, 2, 3)).toStrictEqual(false); | ||
}); | ||
|
||
it('fails on lesser minor version', () => { | ||
expect(checkVersion('1.1.3', 1, 2, 3)).toStrictEqual(false); | ||
}); | ||
|
||
it('fails on lesser patch version', () => { | ||
expect(checkVersion('1.2.2', 1, 2, 3)).toStrictEqual(false); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* @param check version string to check. e.g. "0.13.21" | ||
* @param major Minimum major version | ||
* @param minor Minimum minor version | ||
* @param patch Minimum patch version | ||
* @return true if input string satisfies the major, minor and patch values (larger or equal than) | ||
*/ | ||
export function checkVersion( | ||
check: string, | ||
major: number, | ||
minor: number, | ||
patch: number | ||
): boolean { | ||
const [checkMajor, checkMinor, checkPatch] = check.split('.'); | ||
if ( | ||
parseInt(checkMajor) >= major && | ||
parseInt(checkMinor) >= minor && | ||
parseInt(checkPatch) >= patch | ||
) { | ||
return true; | ||
} | ||
return false; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters