error_type 필드와 메서드
필드는 값에 관한 단순한 정보로, 대괄호 없이 점으로 읽어요: $value.name. 메서드는 인수를 받거나 작업을 수행하며, ->로 호출하거나 $value->name(arguments)처럼 값을 파이프로 넘겨서 호출해요: $value |> name(arguments).
필드
| 필드 | 타입 | 설명 |
|---|---|---|
.description | string | 이 오류 타입의 용도입니다. 없으면 null입니다. |
.extends | string | 이 오류 타입이 확장하는 오류 타입이며, 없으면 null입니다. |
.fields | list | 오류의 필드(자체 필드와 상속받은 필드)입니다: name, type, optional, description. |
.name | string | 오류 타입의 이름입니다. |
.status | number | 이 타입의 오류가 갖는 HTTP 상태 코드입니다(예: 404). 없으면 null입니다. |
any의 메서드
->convert(from?: 'json'|yaml|'csv'|'markdown'|'latex', to?: 'json'|yaml|'csv'|html|'markdown'|'latex', header?: bool, as?: type, headers?: list, indented?: bool)->from(type: 'json'|yaml|'csv'|'markdown'|'latex', header?: bool, as?: type)->is_a(type: word)->is_null()->or(fallback)->to(type: 'json'|yaml|'csv'|html|'markdown'|'latex', headers?: list, indented?: bool)->to_string()->type()