File tree 4 files changed +29
-3
lines changed
Filter options
4 files changed +29
-3
lines changed
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " jspython-cli" ,
3
- "version" : " 2.1.14 " ,
3
+ "version" : " 2.1.15 " ,
4
4
"description" : " CLI for jspython. Allows you to run jspython (*.jspy) files" ,
5
5
"main" : " ./lib/public-api.js" ,
6
6
"bin" : {
Original file line number Diff line number Diff line change 1
-
2
1
export class Assert {
3
2
#chainedCheckCount: number = 1 ;
4
3
public status : boolean = true ;
@@ -45,6 +44,26 @@ export class Assert {
45
44
) ;
46
45
}
47
46
47
+ isTruthy ( value : unknown ) : Assert {
48
+ return this . assertFunction (
49
+ value ,
50
+ null ,
51
+ ( e , r ) => ! ! e ,
52
+ ( e , r ) =>
53
+ `Value '${ e } ' is not Truthy - https://developer.mozilla.org/en-US/docs/Glossary/Truthy`
54
+ ) ;
55
+ }
56
+
57
+ isFalsy ( value : unknown ) : Assert {
58
+ return this . assertFunction (
59
+ value ,
60
+ null ,
61
+ ( e , r ) => ! e ,
62
+ ( e , r ) =>
63
+ `Value '${ e } ' is not Falsy - https://developer.mozilla.org/en-US/docs/Glossary/Falsy`
64
+ ) ;
65
+ }
66
+
48
67
isTrue ( value : unknown ) : Assert {
49
68
return this . assertFunction (
50
69
value ,
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ async function main() {
90
90
console . log ( ` :\> jspython -f (fileName.jspy)` ) ;
91
91
console . log ( ` :\> jspython --file=(fileName.jspy)` ) ;
92
92
console . log ( ` :\> jspython --file=(fileName.jspy) --srcRoot=src` ) ;
93
+ console . log ( ` :\> jspython --file=(fileName.jspy) --param1=someValue1 --param2=someValue2` ) ;
93
94
console . log ( ' ' ) ;
94
95
return ;
95
96
}
Original file line number Diff line number Diff line change @@ -101,7 +101,13 @@ async function initialize(baseSource: string) {
101
101
}
102
102
103
103
initialScope . assert = ( name : string , dataContext : any ) => assert ( name , dataContext ) ;
104
- initialScope . showAsserts = ( ) => console . table ( initialScope . asserts ) ;
104
+ initialScope . showAsserts = ( ) =>
105
+ console . table (
106
+ initialScope . asserts ?. map ( ( r : any ) => ( {
107
+ status : r . success ? 'success' : 'fail' ,
108
+ assert : `${ r . name } ${ ! ! r . description ? ': ' : '' } ${ r . description || '' } ` . trim ( )
109
+ } ) )
110
+ ) ;
105
111
initialScope . print = ( ...args : any ) =>
106
112
logFn ( {
107
113
time : new Date ( ) ,
You can’t perform that action at this time.
0 commit comments