@xuda.io/xuda-dbs-plugin-xuda 1.0.30 → 1.0.31
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.
- package/package.json +1 -1
- package/server.js +19 -0
package/package.json
CHANGED
package/server.js
CHANGED
@@ -170,6 +170,25 @@ const find_item_by_key = function (arr, key, val) {
|
|
170
170
|
});
|
171
171
|
};
|
172
172
|
|
173
|
+
const get_cast_val = async function (source, attributeP, typeP, valP) {
|
174
|
+
const module = await import(
|
175
|
+
"https://dist.xuda.io/runtime/js/modules/xuda-get-cast-util-module.mjs"
|
176
|
+
);
|
177
|
+
|
178
|
+
return module.cast(
|
179
|
+
typeP,
|
180
|
+
valP,
|
181
|
+
function (res) {
|
182
|
+
var msg = `error converting ${attributeP} from ${valP} to ${typeP}`;
|
183
|
+
console.error(source, msg);
|
184
|
+
},
|
185
|
+
function (res) {
|
186
|
+
var msg = `type mismatch auto conversion made to ${attributeP} from value ${valP} to ${typeP}`;
|
187
|
+
console.warn(source, msg);
|
188
|
+
}
|
189
|
+
);
|
190
|
+
};
|
191
|
+
|
173
192
|
exports.create = async (params, setup_doc, resolve, reject) => {
|
174
193
|
const e = params.e;
|
175
194
|
const db = params.db;
|