@minionorg/share
Version:
2 lines (1 loc) • 1.77 kB
JavaScript
(function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports):typeof define=="function"&&define.amd?define(["exports"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.index={}))})(this,function(r){"use strict";var p=Object.defineProperty;var y=(r,e,i)=>e in r?p(r,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[e]=i;var s=(r,e,i)=>(y(r,typeof e!="symbol"?e+"":e,i),i);function e(n){return n.charAt(0).toUpperCase()+n.slice(1)}function i(n){if(!n)throw new SyntaxError("type is must");return function(t){return Object.prototype.toString.call(t)===`[object ${e(n)}]`}}function f(n){if(!n)throw new SyntaxError("type is must");return function(t){return Object.prototype.toString.call(t)===`[object ${e(n)}]`}}i("Function"),i("Object");class o{constructor(){}static notNull(t,u){if(t===null)throw new SyntaxError(u||"The value must not be empty")}static notEmpty(t,u){if(t.length===0)throw new SyntaxError(u||"The String must not be empty")}static errMsg(t){return function(u){return`${t}: ${u}`}}static isString(t){if(t===null)return null;if(f("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 c(n,t){const u=o.isString(n),l=o.isString(t);return u===l}function a(n,...t){if(t.length!==0){for(const u of t)if(c(n,u))return!0}return!1}r.default=a,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});