<commit_before>/**
 * Copyright (c) "Neo4j"
 * Neo4j Sweden AB [http://neo4j.com]
 *
 * This file is part of Neo4j.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { internal } from 'neo4j-driver-core'

const {
  util: { assertString }
} = internal

const SERVER_VERSION_REGEX = /^(Neo4j\/)?(\d+)\.(\d+)(?:\.)?(\d*)(\.|-|\+)?([0-9A-Za-z-.]*)?$/

const NEO4J_IN_DEV_VERSION_STRING = 'Neo4j/dev'

class ServerVersion {
  /**
   * @constructor
   * @param {number} major the major version number.
   * @param {number} minor the minor version number.
   * @param {number} patch the patch version number.
   * @param {string} the original version string
   */
  constructor (major, minor, patch, originalVersionString) {
    this.major = major
    this.minor = minor
    this.patch = patch

    this._originalVersionString = originalVersionString
  }

  /**
   * Fetch server version using the given driver.
   * @param {Driver} driver the driver to use.<commit_msg>Added missing JSDOC param name (#832)<commit_after>/**
 * Copyright (c) "Neo4j"
 * Neo4j Sweden AB [http://neo4j.com]
 *
 * This file is part of Neo4j.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { internal } from 'neo4j-driver-core'

const {
  util: { assertString }
} = internal

const SERVER_VERSION_REGEX = /^(Neo4j\/)?(\d+)\.(\d+)(?:\.)?(\d*)(\.|-|\+)?([0-9A-Za-z-.]*)?$/

const NEO4J_IN_DEV_VERSION_STRING = 'Neo4j/dev'

class ServerVersion {
  /**
   * @constructor
   * @param {number} major the major version number.
   * @param {number} minor the minor version number.
   * @param {number} patch the patch version number.
   * @param {string} [originalVersionString] the original version string
   */
  constructor (major, minor, patch, originalVersionString) {
    this.major = major
    this.minor = minor
    this.patch = patch

    this._originalVersionString = originalVersionString
  }

  /**
   * Fetch server version using the given driver.
   * @param {Driver} driver the driver to use.
{'fraction_non_alphanumeric': 0.12043795620437957, 'fraction_numerical': 0.01028533510285335, 'mean_word_length': 3.440353460972018, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6021427', 'n_tokens_mistral': 925, 'n_tokens_neox': 900, 'n_words': 331}