<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: HeyRole</title>
    <description>The latest articles on DEV Community by HeyRole (@heyrole).</description>
    <link>https://dev.to/heyrole</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4267030%2F0dd49c8b-87a5-4d42-ac1b-b29688085ca5.png</url>
      <title>DEV Community: HeyRole</title>
      <link>https://dev.to/heyrole</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/heyrole"/>
    <language>en</language>
    <item>
      <title>Modeling remote job eligibility when the posting leaves a field blank</title>
      <dc:creator>HeyRole</dc:creator>
      <pubDate>Thu, 26 Nov 2026 13:35:06 +0000</pubDate>
      <link>https://dev.to/heyrole/modeling-remote-job-eligibility-when-the-posting-leaves-a-field-blank-4942</link>
      <guid>https://dev.to/heyrole/modeling-remote-job-eligibility-when-the-posting-leaves-a-field-blank-4942</guid>
      <description>&lt;p&gt;A hiring filter can quietly invent a fact. Suppose the importer initializes every posting with an empty list of countries. Later, the search code treats an empty list as “worldwide”. An employer who wrote only “remote” suddenly appears to hire in every country.&lt;/p&gt;

&lt;p&gt;The ambiguity comes from putting two meanings in the same array. In TypeScript, I would give each meaning its own case:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nc"&gt;HiringArea&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"unspecified"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"worldwide"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"listed"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;countries&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;matchesCountry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;area&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;HiringArea&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;country&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;area&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kind&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"worldwide"&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;area&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kind&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"listed"&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;area&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;countries&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;country&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here the codes are normalized before matching. The non-empty tuple keeps a listed area from quietly becoming an empty array. A posting that just says “remote” stays visible in an unfiltered search. A country-specific search can now make a narrower promise.&lt;/p&gt;

&lt;p&gt;Three examples make good regression cases. “UK remote” matches GB. “Remote” alone leaves the hiring area unspecified. “US company hiring remotely in Canada” matches CA, because the employer’s headquarters belongs in a different field.&lt;/p&gt;

&lt;p&gt;Country matching is only one step. “Canada, Ontario only” needs a separate regional constraint. “Four hours of overlap with London” describes a schedule. Keeping the original sentence beside the parsed fields gives the next person enough information to correct an overly broad match.&lt;/p&gt;

&lt;p&gt;This example grew out of work on &lt;a href="https://heyrole.ai" rel="noopener noreferrer"&gt;HeyRole’s remote job board&lt;/a&gt;. If you maintain a search filter, try adding a fixture where the source leaves your most important field blank. Then check exactly where that record appears.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>programming</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
