@samet-it/be-couchbase-common 1.0.12 → 1.0.14

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.
@@ -119,7 +119,29 @@ let CbAdapterService = class CbAdapterService {
119
119
  return this.value(value);
120
120
  }
121
121
  value(value) {
122
- return common_2.$dev.secureJson(value);
122
+ var _a;
123
+ switch (typeof value) {
124
+ case "string":
125
+ return `"${JSON.stringify(value)}"`;
126
+ case "number":
127
+ return `${value}`;
128
+ case "boolean":
129
+ return value ? `true` : 'false';
130
+ case "object":
131
+ if (value) {
132
+ return common_2.$dev.secureJson(value, true);
133
+ }
134
+ else {
135
+ return 'null';
136
+ }
137
+ case "bigint":
138
+ return `"${value.toString(10)}"`;
139
+ case "symbol":
140
+ return `"${JSON.stringify(value.description)}"`;
141
+ case "function":
142
+ return `"${JSON.stringify((_a = value.name) !== null && _a !== void 0 ? _a : '~fn~')}[${value.length}]()"`;
143
+ }
144
+ return 'null';
123
145
  }
124
146
  /** {@inheritDoc} */
125
147
  flatten(result) {
@@ -58,6 +58,9 @@ class CbRepo {
58
58
  if (!name.startsWith('idx_')) {
59
59
  name = 'idx_' + name;
60
60
  }
61
+ if (name.length > 30) {
62
+ name = name.substring(0, 30);
63
+ }
61
64
  return name;
62
65
  }
63
66
  /**
@@ -140,6 +143,7 @@ class CbRepo {
140
143
  }
141
144
  else {
142
145
  fields.push(p1);
146
+ name = p1;
143
147
  }
144
148
  name = this._indexName(name);
145
149
  sql = `CREATE INDEX ${this.cb.f(name)} ON ${this.fullPath} (${fields.join(', ')})`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samet-it/be-couchbase-common",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "Couchbase common component",
5
5
  "keywords": [
6
6
  "Couchbase"