aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/misc
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-16 11:33:22 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit6702a1b2ccd666285dee9c72b5bace641d2fce8b (patch)
tree78b7125d664b6f6b6c993c4e8483e1bdd24a0a30 /client/src/app/shared/misc
parent503c6f440abc8f5924c38c4bd63591cb6cefacec (diff)
downloadPeerTube-6702a1b2ccd666285dee9c72b5bace641d2fce8b.tar.gz
PeerTube-6702a1b2ccd666285dee9c72b5bace641d2fce8b.tar.zst
PeerTube-6702a1b2ccd666285dee9c72b5bace641d2fce8b.zip
Add ability to search available plugins
Diffstat (limited to 'client/src/app/shared/misc')
-rw-r--r--client/src/app/shared/misc/utils.ts18
1 files changed, 0 insertions, 18 deletions
diff --git a/client/src/app/shared/misc/utils.ts b/client/src/app/shared/misc/utils.ts
index 098496d45..85fc1c3a0 100644
--- a/client/src/app/shared/misc/utils.ts
+++ b/client/src/app/shared/misc/utils.ts
@@ -134,23 +134,6 @@ function scrollToTop () {
134 window.scroll(0, 0) 134 window.scroll(0, 0)
135} 135}
136 136
137// Thanks https://stackoverflow.com/a/16187766
138function compareSemVer (a: string, b: string) {
139 const regExStrip0 = /(\.0+)+$/
140 const segmentsA = a.replace(regExStrip0, '').split('.')
141 const segmentsB = b.replace(regExStrip0, '').split('.')
142
143 const l = Math.min(segmentsA.length, segmentsB.length)
144
145 for (let i = 0; i < l; i++) {
146 const diff = parseInt(segmentsA[ i ], 10) - parseInt(segmentsB[ i ], 10)
147
148 if (diff) return diff
149 }
150
151 return segmentsA.length - segmentsB.length
152}
153
154export { 137export {
155 sortBy, 138 sortBy,
156 durationToString, 139 durationToString,
@@ -161,7 +144,6 @@ export {
161 getAbsoluteAPIUrl, 144 getAbsoluteAPIUrl,
162 dateToHuman, 145 dateToHuman,
163 immutableAssign, 146 immutableAssign,
164 compareSemVer,
165 objectToFormData, 147 objectToFormData,
166 objectLineFeedToHtml, 148 objectLineFeedToHtml,
167 removeElementFromArray, 149 removeElementFromArray,