Every line of 'typescript check if 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.
4 function isString(node) { 5 return t.isLiteral(node) && typeof node.value === 'string'; 6 }
141 isString (node) { 142 return node && ( 143 types.isLiteral(node) && 144 typeof node.value === 'string' || ( 145 types.isTemplateLiteral(node) && 146 node.expressions.length === 0 && 147 node.quasis.length === 1 148 ) 149 ) 150 }
9 export function string(val) { 10 return typeof val === 'string' || val instanceof String; 11 }
8 function isString(node) { 9 return node.type == 'Value' && typeof node.value == 'string' 10 }
6 export default function isString(node) { 7 return node.type === 'Literal' && typeof node.value === 'string'; 8 }
9 function isString (str) { 10 return typeof str === 'string' || str instanceof String; 11 }
6 function isString (str: mixed): boolean %checks { 7 return typeof str === 'string' || str instanceof String; 8 }
9 export function isString(string) { 10 return typeof string === 'string'; 11 }
4 function checkArrayForString(arr, string) { 5 for(let i = 0; i < arr.length; i++) { 6 if(arr[i].indexOf(string) > -1) { 7 return true; 8 } 9 }; 10 return false; 11 }
40 export function is_string(value) { 41 return typeof value === 'string'; 42 }