# you-shall-not-pass **Repository Path**: mirrors_WebReflection/you-shall-not-pass ## Basic Information - **Project Name**: you-shall-not-pass - **Description**: a simple way to filter strings - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-19 - **Last Updated**: 2025-12-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README you-shall-not-pass ================== just a simple way to filter strings [![build status](https://secure.travis-ci.org/WebReflection/you-shall-not-pass.png)](http://travis-ci.org/WebReflection/you-shall-not-pass) ### What It happens that you would like to filter something that if matches shall not pass. ### Blacklist VS Whitelist The function accepts optionally no list, blacklist, or whitelist, and it gives precedence to the white one. However, if no list is provided and matches the input, the `youShallNotPass.maybe` is returned instead. To preserve the security intent, by maybe, `youShallNotPass(str)` returns true but if you want to rely the blacklist 100% feel free to chnge the value. ```javascript // if you don't care about non checked things youShallNotPass.maybe = true; ``` ### API ```javascript youShallNotPass( str:string, [blacklist:Array|RegExp|null], [whitelist:Array|RegExp|null] ):boolean ``` These are few examples from the test file: ```javascript true === youShallNotPass( 'test', /\btest\b/ // blacklist ); true === youShallNotPass( 'test', [ // blacklist as list /\btes\b/, /\btest\b/ ] ); // as whitelisted, then stronger! false === youShallNotPass( 'test', /.*/, /\btest\b/ ); // same as above false === youShallNotPass( 'test', [ /.*/, /\btest\b/ ], [ /\btest\b/ ] ); ```