-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create listener service and matcher service (partial) (#14)
* Create listener service and matcher service (partial) * Add Cache service --------- Co-authored-by: Baghdasaryan <[email protected]>
- Loading branch information
Showing
18 changed files
with
558 additions
and
306 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
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
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
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 @@ | ||
export const excludedUrls: string[] = ['chrome://', 'chrome-extension', 'https://chrome.google.com']; |
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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './regExp'; | ||
export * from './timeDifference'; | ||
export const encode = (mimi, value = '') => `data:${mimi};charset=UTF-8;base64,${btoa(unescape(encodeURIComponent(value)))}`; | ||
export const decode = (value = '') => decodeURIComponent(escape(atob(value.substring(value.indexOf('base64,') + 7)))); | ||
export const structuredClone = (object: any) => (typeof window?.structuredClone === 'function' && window.structuredClone(object)) || JSON.parse(JSON.stringify(object)); |
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,19 @@ | ||
export const getTimeDifference = (startDate, endDate) => { | ||
const startTime = startDate.getTime(); | ||
const endTime = endDate.getTime(); | ||
const timeDifferenceInMilliseconds = endTime - startTime; // milliseconds | ||
const timeDifferenceInSeconds = timeDifferenceInMilliseconds / 1000; // seconds | ||
const timeDifferenceInMinutes = timeDifferenceInMilliseconds / (1000 * 60); // minutes | ||
const timeDifferenceInHours = timeDifferenceInMilliseconds / (1000 * 60 * 60); // hours | ||
return { | ||
milliseconds: timeDifferenceInMilliseconds, | ||
seconds: timeDifferenceInSeconds, | ||
minutes: timeDifferenceInMinutes, | ||
hours: timeDifferenceInHours, | ||
}; | ||
} | ||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.