-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilter.go
More file actions
33 lines (25 loc) · 803 Bytes
/
filter.go
File metadata and controls
33 lines (25 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2023, the WebKit for Windows project authors. Please see the
// AUTHORS file for details. All rights reserved. Use of this source code is
// governed by a BSD-style license that can be found in the LICENSE file.
package reqcheck
import "github.com/Masterminds/semver"
func FilterSemanticVersion(item interface{}) bool {
release := item.(Release)
return release.SemVer != nil
}
func FilterStableRelease(item interface{}) bool {
release := item.(Release)
if release.SemVer == nil {
return false
}
return release.SemVer.Prerelease() == ""
}
func FilterSemanticConstraint(c *semver.Constraints) func(interface{}) bool {
return func(item interface{}) bool {
release := item.(Release)
if release.SemVer == nil {
return false
}
return c.Check(release.SemVer)
}
}