triangle-utils 1.4.93 → 1.4.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -86,6 +86,9 @@ export class UtilsS3Vectors {
86
86
  return s3_vector;
87
87
  }
88
88
  async batch_get(s3_vector_ids) {
89
+ if (s3_vector_ids.length === 0) {
90
+ return [];
91
+ }
89
92
  const s3vectors_inputs = s3_vector_ids.map(get_s3vectors_input);
90
93
  const { s3_vector_bucket_name, s3_vector_index_name } = s3vectors_inputs[0];
91
94
  if (!s3vectors_inputs.every(s3vectors_input => s3vectors_input.s3_vector_bucket_name === s3_vector_bucket_name && s3vectors_input.s3_vector_index_name === s3_vector_index_name)) {
@@ -140,6 +143,9 @@ export class UtilsS3Vectors {
140
143
  });
141
144
  }
142
145
  async batch_put(s3_vectors) {
146
+ if (s3_vectors.length === 0) {
147
+ return;
148
+ }
143
149
  const s3vectors_inputs = s3_vectors.map(s3_vector => get_s3vectors_input(s3_vector.s3_vector_id));
144
150
  const { s3_vector_bucket_name, s3_vector_index_name } = s3vectors_inputs[0];
145
151
  if (!s3vectors_inputs.every(s3vectors_input => s3vectors_input.s3_vector_bucket_name === s3_vector_bucket_name && s3vectors_input.s3_vector_index_name === s3_vector_index_name)) {
@@ -168,6 +174,9 @@ export class UtilsS3Vectors {
168
174
  });
169
175
  }
170
176
  async batch_delete(s3_vector_ids) {
177
+ if (s3_vector_ids.length === 0) {
178
+ return;
179
+ }
171
180
  const s3vectors_inputs = s3_vector_ids.map(get_s3vectors_input);
172
181
  const { s3_vector_bucket_name, s3_vector_index_name } = s3vectors_inputs[0];
173
182
  if (!s3vectors_inputs.every(s3vectors_input => s3vectors_input.s3_vector_bucket_name === s3_vector_bucket_name && s3vectors_input.s3_vector_index_name === s3_vector_index_name)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-utils",
3
- "version": "1.4.93",
3
+ "version": "1.4.94",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -106,6 +106,9 @@ export class UtilsS3Vectors {
106
106
  }
107
107
 
108
108
  async batch_get(s3_vector_ids : string[]) {
109
+ if (s3_vector_ids.length === 0) {
110
+ return []
111
+ }
109
112
  const s3vectors_inputs : S3VectorsInput[] = s3_vector_ids.map(get_s3vectors_input)
110
113
  const { s3_vector_bucket_name, s3_vector_index_name } = s3vectors_inputs[0]
111
114
  if (!s3vectors_inputs.every(s3vectors_input => s3vectors_input.s3_vector_bucket_name === s3_vector_bucket_name && s3vectors_input.s3_vector_index_name === s3_vector_index_name)) {
@@ -162,6 +165,9 @@ export class UtilsS3Vectors {
162
165
  }
163
166
 
164
167
  async batch_put(s3_vectors : S3Vector[]) : Promise<void> {
168
+ if (s3_vectors.length === 0) {
169
+ return
170
+ }
165
171
  const s3vectors_inputs : S3VectorsInput[] = s3_vectors.map(s3_vector => get_s3vectors_input(s3_vector.s3_vector_id))
166
172
  const { s3_vector_bucket_name, s3_vector_index_name } = s3vectors_inputs[0]
167
173
  if (!s3vectors_inputs.every(s3vectors_input => s3vectors_input.s3_vector_bucket_name === s3_vector_bucket_name && s3vectors_input.s3_vector_index_name === s3_vector_index_name)) {
@@ -193,6 +199,9 @@ export class UtilsS3Vectors {
193
199
  }
194
200
 
195
201
  async batch_delete(s3_vector_ids : string[]) : Promise<void> {
202
+ if (s3_vector_ids.length === 0) {
203
+ return
204
+ }
196
205
  const s3vectors_inputs : S3VectorsInput[] = s3_vector_ids.map(get_s3vectors_input)
197
206
  const { s3_vector_bucket_name, s3_vector_index_name } = s3vectors_inputs[0]
198
207
  if (!s3vectors_inputs.every(s3vectors_input => s3vectors_input.s3_vector_bucket_name === s3_vector_bucket_name && s3vectors_input.s3_vector_index_name === s3_vector_index_name)) {