@minionorg/share
Version:
2 lines (1 loc) • 1.98 kB
JavaScript
(function(u,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(u=typeof globalThis<"u"?globalThis:u||self,n(u.index={}))})(this,function(u){"use strict";var y=Object.defineProperty;var h=(u,n,i)=>n in u?y(u,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[n]=i;var s=(u,n,i)=>(h(u,typeof n!="symbol"?n+"":n,i),i);function n(e){return e.charAt(0).toUpperCase()+e.slice(1)}function i(e){if(!e)throw new SyntaxError("type is must");return function(t){return Object.prototype.toString.call(t)===`[object ${n(e)}]`}}function l(e){if(!e)throw new SyntaxError("type is must");return function(t){return Object.prototype.toString.call(t)===`[object ${n(e)}]`}}i("Function"),i("Object");class o{constructor(){}static notNull(t,r){if(t===null)throw new SyntaxError(r||"The value must not be empty")}static notEmpty(t,r){if(t.length===0)throw new SyntaxError(r||"The String must not be empty")}static errMsg(t){return function(r){return`${t}: ${r}`}}static isString(t){if(t===null)return null;if(l("string")(t))return t;throw new TypeError("The parameter type is string")}static isValidDateFormat(t){return/(^(y{4}|y{2})[.\u002f-](m{1,2})[.\u002f-](d{1,2})$)|(^(m{1,2})[.\u002f-](d{1,2})[.\u002f-]((y{4}|y{2})$))|(^(d{1,2})[.\u002f-](m{1,2})[.\u002f-]((y{4}|y{2})$))/gi.test(t)}static isTimeFormat(t){return/(^(h{1,2}):(m{1,2}):(s{1,2})$)|(^(h{1,2}):(m{1,2})$)/gi.test(t)}}s(o,"DEFAULT_NOT_NAN_EX_MESSAGE","\u9A8C\u8BC1\u7684\u503C\u4E0D\u662F\u6570\u5B57");function f(e,t){const r=o.isString(e),p=o.isString(t);return r===p}function a(e,t){if(f(e,t))return!0;if(e!==null&&t!==null){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!f(e.charAt(r).toUpperCase(),t.charAt(r).toUpperCase()))return!1;return!0}else return!1}function c(e,...t){if(t.length!==0){for(const r of t)if(a(e,r))return!0}return!1}u.default=c,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});