0

I just noticed something I've never seen in almost a decade of JS programming.

const field: IntrospectionField = (resource.type as IntrospectionObjectType).fields.find(
  field => {
    return field.name === key;
  }
)!; // HERE

Note the ! at the end of the last line.

I wonder:

  • What it is supposed to do?
  • What does it actually do?

I believe it's just a typo, and that it doesn't affect anything, but I could be wrong.

I've found this in an open source piece of software at https://github.com/Weakky/ra-data-opencrud/blob/master/src/getResponseParser.ts#L17

Álvaro González
  • 135,557
  • 38
  • 250
  • 339
Vadorequest
  • 14,569
  • 21
  • 102
  • 201

0 Answers0