bin/builders/trie.js
function insertInTrie({ parts, isIcann }, trie) {
  let node = trie;

  for (let i = 0; i < parts.length; i += 1) {
    const part = parts[i];
    let nextNode = node[part];
    if (nextNode === undefined) {
      nextNode = {};
      node[part] = nextNode;
    }

    node = nextNode;
  }

  node.$ = isIcann ? 1 : 2;

  return trie;
}
function insertInTrie({ parts, isIcann }, trie) {
  let node = trie;

  for (let i = 0; i < parts.length; i += 1) {
    const part = parts[i];
    let nextNode = node[part];
    if (nextNode === undefined) {
      nextNode = {};
      node[part] = nextNode;
    }

    node = nextNode;
  }

  node.$ = isIcann ? 1 : 2;

  return trie;
}
function insertInTrie ( { parts , isIcann } , trie ) { let node = trie ; for ( let i = 0 ; i < parts . length ; i += 1 ) { const part = parts [ i ] ; let nextNode = node [ part ] ; if ( nextNode === undefined ) { nextNode = { } ; node [ part ] = nextNode ; } node = nextNode ; } node . $ = isIcann ? 1 : 2 ; return trie ; }
Insert a public suffix rule in the `trie`.
Insert a public suffix rule in the trie .