Every line of 'typescript boolean to string' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
21 function boolToString(value) { 22 if (value) { 23 return 'true'; 24 } else if (value === false) { 25 return 'false'; 26 } 27 return 'null'; 28 }
28 function boolToString(bool_value) { 29 return bool_value ? TRUE_STRING_VALUE : FALSE_STRING_VALUE; 30 }
70 function getBooleanString(value) { 71 if (value === 'false' || !value) { 72 return 'false'; 73 } 74 75 return 'true'; 76 }
52 export function bool(value: boolean): string { 53 return value ? 'T' : 'F'; 54 }
160 function stringToBoolean(string){ 161 switch(angular.isString(string) ? string.toLowerCase() : null){ 162 case 'true': case 'yes': case '1': return true; 163 case 'false': case 'no': case '0': case null: return false; 164 default: return Boolean(string); 165 } 166 }
131 function booleanFromExpression(node: ts.Expression): boolean | undefined { 132 switch (node.kind) { 133 case ts.SyntaxKind.TrueKeyword: 134 return true; 135 case ts.SyntaxKind.FalseKeyword: 136 return false; 137 default: 138 return undefined; 139 } 140 }
18 function boolToString(boolValue) { 19 return boolValue === '1' ? 'Yes' : 'No'; 20 }
69 boolean(node, jsonSchema, xsd) { 70 var booleanSchema = new JsonSchemaFile({}); 71 booleanSchema.type = jsonSchemaTypes.BOOLEAN; 72 73 var integerSchema = new JsonSchemaFile({}); 74 integerSchema.type = jsonSchemaTypes.INTEGER; 75 integerSchema.maximum = 1; 76 integerSchema.minimum = 0; 77 78 jsonSchema.oneOf.push(booleanSchema); 79 jsonSchema.oneOf.push(integerSchema); 80 return true; 81 }
111 isBooleanType() { 112 return (this.type.flags & ts.TypeFlags.Boolean) !== 0; 113 }
106 function stringToBoolean(str, defaultValue) { 107 if (typeof str === 'number') 108 str = str.toString(); 109 return !str ? (defaultValue ? true : false) 110 : str.toLowerCase() === 'false' ? false 111 : /^\d+$/.test(str) ? (parseInt(str) ? true : false) 112 : true; 113 }