qsu 1.13.0 → 1.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hasBadWords(str: string, words?: string[], allowWords?: string[]): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o="ㄱㄲㄴㄷㄸㄹㅁㅂㅃㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎ",t="ㅏㅐㅑㅒㅓㅔㅕㅖㅗㅘㅙㅚㅛㅜㅝㅞㅟㅠㅡㅢㅣ",n=" ㄱㄲㄳㄴㄵㄶㄷㄹㄺㄻㄼㄽㄾㄿㅀㅁㅂㅄㅅㅆㅇㅈㅊㅋㅌㅍㅎ",e={"ㅗㅏ":"ㅘ","ㅗㅐ":"ㅙ","ㅗㅣ":"ㅚ","ㅜㅓ":"ㅝ","ㅜㅔ":"ㅞ","ㅜㅣ":"ㅟ","ㅡㅣ":"ㅢ"},r={"ㄱㅅ":"ㄳ","ㄴㅈ":"ㄵ","ㄴㅎ":"ㄶ","ㄹㄱ":"ㄺ","ㄹㅁ":"ㄻ","ㄹㅂ":"ㄼ","ㄹㅅ":"ㄽ","ㄹㅌ":"ㄾ","ㄹㅍ":"ㄿ","ㄹㅎ":"ㅀ","ㅂㅅ":"ㅄ"},f={r:"ㅏ",i:"ㅣ"},s=o=>{const t={};for(const n of o)for(const o of n.slice(1))t[o]=n[0];return t},i=[9398,119808,119860,119912,120224,120276,120328,120380,120432],c=o=>{for(const t of i)if(o>=t&&o<=t+51)return String.fromCharCode(97+(o-t)%26)},l=s(["a4àáâãäåāăąаα","b8вβ","cçćčс","dďđ","e3èéêëēĕėęěеёε","g69ğ","hн","i1lìíîïīįıłіι","jј","kкκ","mм","nñńň","o0òóôõöøōőоο","pрρ","s5śšşѕ","t7ţťтτ","uùúûüūůűų","xхχ","yýÿу","z2źżž"]),d=s(["a@","c¢(","e€£","i!|¡/","s$§","t+","o°"]),h=/[\p{L}\p{N}]/u,u=o=>void 0!==o&&(t.includes(o)||void 0!==f[o]),g=(s,i)=>{const g=[];for(const e of s.toLowerCase()){let r=e;const f=r.codePointAt(0);f>=65281&&f<=65374?r=String.fromCharCode(f-65248).toLowerCase():f>=4352&&f<=4370?r=o[f-4352]:f>=4449&&f<=4469?r=t[f-4449]:f>=4520&&f<=4546?r=n[f-4519]:f>=9398&&(r=c(f)??r),void 0!==l[r]?g.push(l[r]):h.test(r)?g.push(r):i&&void 0!==d[r]&&g.push(d[r])}for(let o=1,t=g.length;o<t;o+=1)"ㅇ"===g[o]&&g[o-1]>="a"&&g[o-1]<="z"&&(g[o]="o");return(s=>{const i=[],c=s.length;let l=0;for(;l<c;){const d=o.indexOf(s[l]);let h=l+1,g=h<c?t.indexOf(f[s[h]]??s[h]):-1;if(-1===d||-1===g){i.push(s[l]),l+=1;continue}h+=1;const p=h<c?e[t[g]+s[h]]:void 0;void 0!==p&&(g=t.indexOf(p),h+=1);let a=h<c&&!u(s[h+1])?Math.max(n.indexOf(s[h]),0):0;if(a>0){h+=1;const o=h<c?r[n[a]+s[h]]:void 0;void 0===o||u(s[h+1])||(a=n.indexOf(o),h+=1)}i.push(String.fromCharCode(44032+28*(21*d+g)+a)),l=h}return i.join("")})(g).replace(/ㅇ/g,"o")},p=(o,t,n,e)=>{for(let r=0,f=n.length;r<f;r+=1)if(o>=n[r]&&o<e[r])return o===n[r]||o+t<=e[r];return!1},a=o=>{const t=[];for(const n of o){if("string"!=typeof n)continue;const o=g(n,!0);o&&t.push(o)}return t};export function hasBadWords(o,t=[],n=[]){if(!o||!t||0===t.length)return!1;const e=a(t);if(0===e.length)return!1;const r=n?a(n):[],f=o.split(/\s+/).filter(o=>""!==o);for(const o of[!0,!1]){const t=[],n=[];let s="";for(const e of f){const r=g(e,o);r&&(t.push(s.length),s+=r,n.push(s.length))}for(const o of r){let t=s.indexOf(o);for(;-1!==t;)s=s.slice(0,t)+"\0".repeat(o.length)+s.slice(t+o.length),t=s.indexOf(o,t+o.length)}for(const o of e){let e=s.indexOf(o);for(;-1!==e;){if(p(e,o.length,t,n))return!0;e=s.indexOf(o,e+1)}}}return!1}
|
package/dist/verify/index.d.ts
CHANGED
package/dist/verify/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{between}from"./between.js";export{contains}from"./contains.js";export{is2dArray}from"./is2dArray.js";export{isEmail}from"./isEmail.js";export{isEmpty}from"./isEmpty.js";export{isEqual}from"./isEqual.js";export{isEqualStrict}from"./isEqualStrict.js";export{isObject}from"./isObject.js";export{isTrueMinimumNumberOfTimes}from"./isTrueMinimumNumberOfTimes.js";export{isUrl}from"./isUrl.js";export{len}from"./len.js";
|
|
1
|
+
export{between}from"./between.js";export{contains}from"./contains.js";export{hasBadWords}from"./hasBadWords.js";export{is2dArray}from"./is2dArray.js";export{isEmail}from"./isEmail.js";export{isEmpty}from"./isEmpty.js";export{isEqual}from"./isEqual.js";export{isEqualStrict}from"./isEqualStrict.js";export{isObject}from"./isObject.js";export{isTrueMinimumNumberOfTimes}from"./isTrueMinimumNumberOfTimes.js";export{isUrl}from"./isUrl.js";export{len}from"./len.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qsu",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.2",
|
|
4
4
|
"description": "qsu is a utility library that contains useful and frequently used functions. Start with your preferred language and the modern development environment.",
|
|
5
5
|
"author": "CDGet <jooy2.contact@gmail.com>",
|
|
6
6
|
"license": "MIT",
|