-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
cole
committed
Aug 9, 2024
1 parent
b6b7663
commit 7b8d24c
Showing
6 changed files
with
38 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## packages 后续将迁移到 https://github.com/ColeWang/site-pro 并使用 tsx | ||
|
||
将使用 npm 引入 | ||
|
||
import { Table } from '@site-pro/components' | ||
|
||
import { Screen } from '@site-pro/plugins' |
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,3 +1,4 @@ | ||
export * from './version' | ||
export * from './install-site' | ||
export * from './plugins' | ||
export * from './components' |
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,19 @@ | ||
import { gt, head, lt, split, zipWith } from 'lodash-es' | ||
|
||
const version = __SITE_VERSION__ || '0.3.0' | ||
|
||
function parse (version) { | ||
return split(version, '.', 3).map(Number) | ||
} | ||
|
||
function compare (v1, v2, operation) { | ||
const result = zipWith(parse(v1), parse(v2), (a, b) => { | ||
return (gt(a, b) && 1) || (lt(a, b) && -1) || 0 | ||
}).filter((value) => value !== 0) | ||
return operation(head(result) || 0) | ||
} | ||
|
||
export { | ||
version, | ||
compare | ||
} |
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