<commit_before>( function _l5_Entity_s_()
{

'use strict';

let _global = _global_;
let _ = _global_.wTools;
let Self = _.entity = _.entity || Object.create( null );

// --
//
// --

function identicalShallow( src1, src2 )
{
  _.assert( arguments.length === 2, 'Expects 2 arguments' );

  if( Object.prototype.toString.call( src1 ) !== Object.prototype.toString.call( src2 ) )
  return false;

  if( src1 === src2 )
  return true;

  if( _.hashMap.like( src1 ) )
  {
    /*
      - hashmap
    */
    return _.hashMap.areIdenticalShallow( src1, src2 )
  }
  else if( _.set.like( src1 ) )
  {
    /*
      - set
    */
    return _.set.areIdenticalShallow( src1, src2 );
  }
  else if( _.bufferAnyIs( src1 ) )
  {
    /*
      - BufferNode
      - BufferRaw
      - BufferRawShared
      - BufferTyped
      - BufferView
      - BufferBytes
    */
    return _.buffersAreIdenticalShallow( src1, src2 );
  }
  else if( _.countable.is( src1 ) )
  {
    /*
      - countable
      - vector
      - long
      - array
    */
    return _.countable.areIdenticalShallow( src1, src2 );
  }
  else if( _.object.like( src1 ) )
  {
    /*
      - objectLike
      - object

      - Map
      - Auxiliary
      - MapPure
      - MapPolluted
      - AuxiliaryPolluted
      - MapPrototyped
      - AuxiliaryPrototyped
    */
    if( _.date.is( src1 ) )
    {
      return _.date.areIdenticalShallow( src1, src2 );
    }
    else if( _.regexp.is( src1 ) )
    {
      return _.regexp.areIdenticalShallow( src1, src2 );
    }
    else if( _.aux.is( src1 ) )
    {
      return _.aux.areIdenticalShallow( src1, src2 );
    }

    /* non-identical objects */
    return false;
  }
  else if( _.primitiveIs( src1 ) )
  {
    /*
      - Symbol
      - Number
      - BigInt
      - Boolean
      - String
    */

    return _.primitive.areIdenticalShallow( src1, src2 );
  }
  else
  {
    return false;
  }
}

//

function equivalentShallow( src1, src2, options )
{
  /*
    - boolLikeTrue and boolLikeTrue - ( true, 1 )
    - boolLikeFalse and boolLikeFalse - ( false, 0 )
    - | number1 - number2 | < accuracy
    - strings that differ only in whitespaces at the start and/or at the end ?
    - regexp with same source and different flags
  */
  _.assert( arguments.length === 2 || arguments.length === 3, 'Expects 2 or 3 arguments' );
  _.assert( options === undefined || _.objectLike( options ), 'Expects map of options as third argument' );

  let accuracy;

  if( options )
  accuracy = options.accuracy || undefined;

  if( _.primitiveIs( src1 ) & _.primitiveIs( src2 ) ) /* check before type comparison ( 10n & 10 and 1 & true are equivalent ) */
  {
    /*
      - Symbol
      - Number
      - BigInt<commit_msg>Update comments<commit_after>( function _l5_Entity_s_()
{

'use strict';

let _global = _global_;
let _ = _global_.wTools;
let Self = _.entity = _.entity || Object.create( null );

// --
//
// --

function identicalShallow( src1, src2 )
{
  _.assert( arguments.length === 2, 'Expects 2 arguments' );

  if( Object.prototype.toString.call( src1 ) !== Object.prototype.toString.call( src2 ) )
  return false;

  if( src1 === src2 )
  return true;

  if( _.hashMap.like( src1 ) )
  {
    /*
      - hashmap
    */
    return _.hashMap.areIdenticalShallow( src1, src2 )
  }
  else if( _.set.like( src1 ) )
  {
    /*
      - set
    */
    return _.set.areIdenticalShallow( src1, src2 );
  }
  else if( _.bufferAnyIs( src1 ) )
  {
    /*
      - BufferNode
      - BufferRaw
      - BufferRawShared
      - BufferTyped
      - BufferView
      - BufferBytes
    */
    return _.buffersAreIdenticalShallow( src1, src2 );
  }
  else if( _.countable.is( src1 ) )
  {
    /*
      - countable
      - vector
      - long
      - array
    */
    return _.countable.areIdenticalShallow( src1, src2 );
  }
  else if( _.object.like( src1 ) )
  {
    /*
      - objectLike
      - object

      - Map
      - Auxiliary
      - MapPure
      - MapPolluted
      - AuxiliaryPolluted
      - MapPrototyped
      - AuxiliaryPrototyped
    */
    if( _.date.is( src1 ) )
    {
      return _.date.areIdenticalShallow( src1, src2 );
    }
    else if( _.regexp.is( src1 ) )
    {
      return _.regexp.areIdenticalShallow( src1, src2 );
    }
    else if( _.aux.is( src1 ) )
    {
      return _.aux.areIdenticalShallow( src1, src2 );
    }

    /* non-identical objects */
    return false;
  }
  else if( _.primitiveIs( src1 ) )
  {
    /*
      - Symbol
      - Number
      - BigInt
      - Boolean
      - String
    */

    return _.primitive.areIdenticalShallow( src1, src2 );
  }
  else
  {
    return false;
  }
}

//

function equivalentShallow( src1, src2, options )
{
  /*
    - boolLikeTrue and boolLikeTrue - ( true, 1 )
    - boolLikeFalse and boolLikeFalse - ( false, 0 )
    - | number1 - number2 | <= accuracy
    - strings that differ only in whitespaces at the start and/or at the end
    - regexp with same source and different flags
  */
  _.assert( arguments.length === 2 || arguments.length === 3, 'Expects 2 or 3 arguments' );
  _.assert( options === undefined || _.objectLike( options ), 'Expects map of options as third argument' );

  let accuracy;

  if( options )
  accuracy = options.accuracy || undefined;

  if( _.primitiveIs( src1 ) & _.primitiveIs( src2 ) ) /* check before type comparison ( 10n & 10 and 1 & true are equivalent ) */
  {
    /*
      - Symbol
      - Number
      - BigInt
{'fraction_non_alphanumeric': 0.12603954906671594, 'fraction_numerical': 0.018850489743115876, 'mean_word_length': 1.9493188010899183, 'pattern_counts': {'":': 0, '<': 5, '<?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': '908192', 'n_tokens_mistral': 1883, 'n_tokens_neox': 1828, 'n_words': 446}