<commit_before>---
layout: guide
---

Refinements are a frequently used aspect of any type system. They are so
ingrained in the way that we program and even the way that we think you might
not even notice them.

In the code below, value can either be `"A"` or `"B"` and an if statement

```js
// @flow
function method(value: "A" | "B") {
  if (value === "A") {
    // value is "A"<commit_msg>[PR] Update refinements.md<commit_after>---
layout: guide
---

Refinements are a frequently used aspect of any type system. They are so
ingrained in the way that we program and even the way that we think you might
not even notice them.

In the code below, value can either be `"A"` or `"B"`.

```js
// @flow
function method(value: "A" | "B") {
  if (value === "A") {
    // value is "A"
{'fraction_non_alphanumeric': 0.12853470437017994, 'fraction_numerical': 0.0, 'mean_word_length': 3.303867403314917, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '803566', 'n_tokens_mistral': 252, 'n_tokens_neox': 245, 'n_words': 123}