joinPath

将片段数组序列化为路径字符串

用法

joinPath 函数用于将片段数组序列化为路径字符串。

import { joinPath } from '@movk/core'

const p = joinPath(['a', 'x.y', 0, 'space key'])
// p: "a['x.y'][0]['space key']"
// 与解析往返:toPath(p) => ['a', 'x.y', 0, 'space key']

API

joinPath(segments)

将片段数组序列化为路径字符串。

参数

segments
(string | number)[] required
路径片段数组。

返回值

返回值
string
路径字符串。

Changelog

b6146 — refactor: 统一源码文件命名为 camelCase

Copyright © 2024 - 2026 YiXuan - MIT License