0.0.4 • Published 5 years ago
str-contain-sql v0.0.4
💨StrContainSQL
string utility to ckeck if the input contain sql syntax
$ npm i str-contain-sql --save
Usage
import strContainSQL from 'str-contain-sql'
// or
var strContainSQL = require('str-contain-sql')
Or include it via jsDelivr CDN:
<script src="https://cdn.jsdelivr.net/npm/str-contain-sql@0.0.4/index.min.js"></script>
strContainSQL("username; 1 = 1") // true
Methods & Examples
- strContainSQL(String) : Boolean
strContainSQL("username; 1 = 1") // true
strContainSQL("hello world drop table") // true
strContainSQL("username and password = '123") // true
strContainSQL("username") // false
Test
$ npm run test
Notes
- Works both in Node.js and in the browser.
- Supported in all old and modern browsers.
- All pull requests are welcome, feel free.
Related
- Type check : object, array, Promise, Set, Map, WeakSet, WeakMap, function, etc..
- Buk : Encode, decode, filter, skip, quotes, wrap, HTML special chars string
- MinValid : string validation
License
MIT