Options
All
  • Public
  • Public/Protected
  • All
Menu

Functions

Functions

get

  • get(obj: object, fields: PropertyKey[] | string, defVal?: any): any

安全的深度获取对象的字段 TODO 该函数尚处于早期测试阶段 注: 只要获取字段的值为 {@type null|undefined},就会直接返回 {@param defVal} 类似于 ES2019 的可选调用链特性: https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/%E5%8F%AF%E9%80%89%E9%93%BE

Parameters

  • obj: object

    获取的对象

  • fields: PropertyKey[] | string

    字段字符串或数组

  • defVal: any = null Default value

Returns any

  • Inherited
  • Protected
  • Private
  • Static
  • Module
  • Object
  • Property
  • Function
  • Variable
  • Index
  • Type
  • Class
  • Interface
  • Enum
  • Constructor
  • Getter/Setter
Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.