@cabloy/utils 2.0.7 → 2.0.8
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/dist/celjs/utils.d.ts +1 -1
- package/dist/index.js +4 -2
- package/package.json +1 -1
package/dist/celjs/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function regexp(str: string): string;
|
|
2
|
-
export declare function cel(str: string):
|
|
2
|
+
export declare function cel(str: string): any;
|
|
3
3
|
export declare function raw(str: string): string;
|
|
4
4
|
export declare function createFunction(expression: string, scopeKeys?: string[]): Function;
|
|
5
5
|
export declare function evaluateSimple(expression: string, scope?: object): any;
|
package/dist/index.js
CHANGED
|
@@ -281,10 +281,10 @@ celEnvBase.registerOperator('bool == null', (b, n) => b === n);
|
|
|
281
281
|
|
|
282
282
|
// get
|
|
283
283
|
celEnvBase.registerFunction('get(map,string):dyn', (obj, name) => {
|
|
284
|
-
return getProperty(obj, name);
|
|
284
|
+
return getProperty(obj, name) ?? null;
|
|
285
285
|
});
|
|
286
286
|
celEnvBase.registerFunction('get(map,string,string):dyn', (obj, name, sep) => {
|
|
287
|
-
return getProperty(obj, name, sep);
|
|
287
|
+
return getProperty(obj, name, sep) ?? null;
|
|
288
288
|
});
|
|
289
289
|
celEnvBase.registerFunction('exists(null,string):bool', (obj, name) => {
|
|
290
290
|
return hasProperty(obj, name);
|
|
@@ -307,6 +307,8 @@ const StringPrefixRaw = 'raw://';
|
|
|
307
307
|
function regexp(str) {
|
|
308
308
|
return `${StringPrefixRegexp}${str}`;
|
|
309
309
|
}
|
|
310
|
+
|
|
311
|
+
// should return any
|
|
310
312
|
function cel(str) {
|
|
311
313
|
return `${StringPrefixCel}${str}`;
|
|
312
314
|
}
|