mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
added tree-shaking to ramda import
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
import * as R from "ramda"
|
import partition from "ramda/es/partition"
|
||||||
|
import chain from "ramda/es/chain"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
IFileOrFolder,
|
IFileOrFolder,
|
||||||
IFile,
|
IFile,
|
||||||
@@ -39,7 +41,7 @@ function generateFolder({
|
|||||||
path: IFile["path"]
|
path: IFile["path"]
|
||||||
targets: IFolder[]
|
targets: IFolder[]
|
||||||
}): IFolder {
|
}): IFolder {
|
||||||
const children = join(R.chain(target => target.children, targets))
|
const children = join(chain(target => target.children, targets))
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title,
|
title,
|
||||||
@@ -66,7 +68,7 @@ function generateFile({
|
|||||||
function join([head, ...tail]: IFileOrFolder[]): IFileOrFolder[] {
|
function join([head, ...tail]: IFileOrFolder[]): IFileOrFolder[] {
|
||||||
if (!head) return []
|
if (!head) return []
|
||||||
|
|
||||||
const [similarFs, remaining] = R.partition(
|
const [similarFs, remaining] = partition(
|
||||||
obj => obj.title === head.title && obj.type === head.type,
|
obj => obj.title === head.title && obj.type === head.type,
|
||||||
tail
|
tail
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user