跳到主要内容

plainObjectToFlattenPathObject()

function plainObjectToFlattenPathObject(object): Record<string, any>;

Defined in: object/plainObjectToFlattenPathObject.ts:33

扁平化对象

Parameters

ParameterTypeDescription
objectobject待扁平化的对象

Returns

Record<string, any>

扁平化后的键值对对象

Example

// 输入
{ a: { a: [0, 1] } }

// 输出
{ 'a.a[0]': 0, 'a.a[1]': 1 }