From 34a6dc4dd72b6d5865f2937e715c58edf7ba7c10 Mon Sep 17 00:00:00 2001 From: janehe Date: Wed, 21 May 2025 15:45:39 -0700 Subject: [PATCH 1/4] delete invalid jsdocs --- lib/encoder.js | 17 ----------------- lib/types/index.js | 2 -- lib/types/vector.js | 4 ---- 3 files changed, 23 deletions(-) diff --git a/lib/encoder.js b/lib/encoder.js index 7a78754d..152d9f0e 100644 --- a/lib/encoder.js +++ b/lib/encoder.js @@ -128,26 +128,10 @@ const zeroLengthTypesSupported = new Set([ dataTypes.blob ]); -/** - * @typedef {(singleTypeNames[keyof singleTypeNames] | types.dataTypes.duration | types.dataTypes.text)} SingleTypeCodes - * @typedef {('point' | 'polygon' | 'duration' | 'lineString' | 'dateRange')} CustomSimpleTypeCodes - * @typedef {(customTypeNames[CustomSimpleTypeCodes]) | CustomSimpleTypeCodes | 'empty'} CustomSimpleTypeNames - * @typedef {{code : SingleTypeCodes, info?: null, options? : {frozen?:boolean, reversed?:boolean} }} SingleColumnInfo - * @typedef {{code : (types.dataTypes.custom), info : CustomSimpleTypeNames, options? : {frozen?:boolean, reversed?:boolean}}} CustomSimpleColumnInfo - * @typedef {{code : (types.dataTypes.map), info : [ColumnInfo, ColumnInfo], options?: {frozen?: Boolean, reversed?: Boolean}}} MapColumnInfo - * @typedef {{code : (types.dataTypes.tuple), info : Array, options?: {frozen?: Boolean, reversed?: Boolean}}} TupleColumnInfo - * @typedef {{code : (types.dataTypes.tuple | types.dataTypes.list)}} TupleListColumnInfoWithoutSubtype TODO: guessDataType can return null on tuple/list info, why? - * @typedef {{code : (types.dataTypes.list | types.dataTypes.set), info : ColumnInfo, options?: {frozen?: Boolean, reversed?: Boolean}}} ListSetColumnInfo - * @typedef {{code : (types.dataTypes.udt), info : {name : string, fields : Array<{name : string, type : ColumnInfo}>}, options? : {frozen?: Boolean, reversed?: Boolean}}} UdtColumnInfo - * @typedef {{code : (types.dataTypes.custom), customTypeName : ('vector'), info : [ColumnInfo, number], options? : {frozen?:boolean, reversed?:boolean}}} VectorColumnInfo - * @typedef {{code : (types.dataTypes.custom), info : string, options? : {frozen?:boolean, reversed?:boolean}}} OtherCustomColumnInfo - * @typedef {SingleColumnInfo | CustomSimpleColumnInfo | MapColumnInfo | TupleColumnInfo | ListSetColumnInfo | VectorColumnInfo | OtherCustomColumnInfo | UdtColumnInfo | TupleListColumnInfoWithoutSubtype} ColumnInfo If this is a simple type, info is null; if this is a collection type with a simple subtype, info is a string, if this is a nested collection type, info is a ColumnInfo object - */ /** * Serializes and deserializes to and from a CQL type and a Javascript Type. * @param {Number} protocolVersion - * @param {import('./client.js').ClientOptions} options * @constructor */ function Encoder(protocolVersion, options) { @@ -1105,7 +1089,6 @@ function defineInstanceMembers() { /** * If not provided, it uses the array of buffers or the parameters and hints to build the routingKey * @param {Array} params - * @param {import('..').ExecutionOptions} execOptions * @param [keys] parameter keys and positions in the params array * @throws TypeError * @internal diff --git a/lib/types/index.js b/lib/types/index.js index f28dbb55..0ae92dfe 100644 --- a/lib/types/index.js +++ b/lib/types/index.js @@ -136,7 +136,6 @@ const dataTypes = { /** * Returns the typeInfo of a given type name * @param {string} name - * @returns {import('../encoder').ColumnInfo} */ getByName: function(name) { name = name.toLowerCase(); @@ -416,7 +415,6 @@ function uuid(options, buffer, offset) { * @internal * @ignore * @throws {ArgumentError} - * @param {import('../encoder').ColumnInfo} item */ function getDataTypeNameByCode(item) { if (!item || typeof item.code !== 'number') { diff --git a/lib/types/vector.js b/lib/types/vector.js index 308511ee..17b1f1fc 100644 --- a/lib/types/vector.js +++ b/lib/types/vector.js @@ -98,10 +98,6 @@ class Vector { return Vector; } - /** - * - * @param {(value: any, index: number, array: any[]) => void} callback - */ forEach(callback) { return this.elements.forEach(callback); } From 96dd69e0c22adbfaf2f8ca70e175781535da3037 Mon Sep 17 00:00:00 2001 From: janehe Date: Wed, 21 May 2025 20:29:01 -0700 Subject: [PATCH 2/4] remove empty @returns tag --- lib/encoder.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/encoder.js b/lib/encoder.js index 152d9f0e..123cb27a 100644 --- a/lib/encoder.js +++ b/lib/encoder.js @@ -196,7 +196,6 @@ function defineInstanceMembers() { * * @param {Buffer} bytes * @param {OtherCustomColumnInfo | VectorColumnInfo} columnInfo - * @returns */ this.decodeCustom = function (bytes, columnInfo) { @@ -734,7 +733,6 @@ function defineInstanceMembers() { * * @param {any} value * @param {OtherCustomColumnInfo | VectorColumnInfo} columnInfo - * @returns */ this.encodeCustom = function (value, columnInfo) { @@ -892,7 +890,6 @@ function defineInstanceMembers() { * * @param {any} value * @param {UdtColumnInfo} columnInfo - * @returns */ this.encodeUdt = function (value, columnInfo) { const udtInfo = columnInfo.info; @@ -923,7 +920,6 @@ function defineInstanceMembers() { * * @param {any} value * @param {TupleColumnInfo} columnInfo - * @returns */ this.encodeTuple = function (value, columnInfo) { const tupleInfo = columnInfo.info; From 6a0bd73d019254f9736fb438e774aa094deb6d2c Mon Sep 17 00:00:00 2001 From: janehe Date: Thu, 22 May 2025 00:52:05 -0700 Subject: [PATCH 3/4] add homepage --- docs.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs.yaml b/docs.yaml index 57daf33e..a3fea7e0 100644 --- a/docs.yaml +++ b/docs.yaml @@ -2,6 +2,7 @@ title: DataStax Node.js Driver summary: DataStax Node.js Driver for Apache Cassandra theme: datastax swiftype_drivers: nodejsdrivers +homepage: https://docs.datastax.com/en/developer/nodejs-driver sections: - title: Features prefix: /features @@ -37,8 +38,10 @@ links: - title: Npm href: https://www.npmjs.org/package/cassandra-driver versions: - - name: '4.7' + - name: '4.8' ref: 'master' + - name: '4.7' + ref: 'v4.7.2' - name: '4.6' ref: 'v4.6.4' - name: '4.5' From 97562ab0e5c1304f5f3a4dab9e22b70896d0f828 Mon Sep 17 00:00:00 2001 From: janehe Date: Thu, 22 May 2025 15:47:56 -0700 Subject: [PATCH 4/4] vector.js --- lib/types/vector.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/types/vector.js b/lib/types/vector.js index 17b1f1fc..7843b97d 100644 --- a/lib/types/vector.js +++ b/lib/types/vector.js @@ -15,10 +15,7 @@ */ "use strict"; /** @module types */ -/** - * Creates a new instance of Cql Vector, also compatible with Float32Array. - * @class - */ + const util = require('node:util'); class Vector { /** @@ -103,7 +100,7 @@ class Vector { } /** - * @returns {string | undefined} get the subtype string, e.g., "float", but it's optional so it can return null + * @returns {string | undefined} get the subtype string, e.g., "float", but it's optional so it can return undefined */ getSubtype(){ return this.subtype;