ddan-js 2.9.9 → 2.9.11

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.
Files changed (117) hide show
  1. package/bin/browser.d.ts +39 -0
  2. package/bin/ddan-js.browser.js +1 -1
  3. package/bin/ddan-js.js +1 -1
  4. package/bin/ddan-js.mjs +1 -1
  5. package/bin/ddan-tiny.js +1 -0
  6. package/bin/ddan-upload.js +1 -1
  7. package/bin/index.d.ts +39 -0
  8. package/bin/lib/class/event.js +1 -0
  9. package/bin/lib/class/getset.js +1 -0
  10. package/bin/lib/class/icon.js +1 -0
  11. package/bin/lib/class/persist.js +1 -0
  12. package/bin/lib/class/pipeTask.js +1 -0
  13. package/bin/lib/class/store.js +1 -0
  14. package/bin/lib/common/_Symbol.js +1 -0
  15. package/bin/lib/common/_freeGlobal.js +1 -0
  16. package/bin/lib/common/_object.js +1 -0
  17. package/bin/lib/common/_root.js +1 -0
  18. package/bin/lib/common/internal/asciiToArray.js +1 -0
  19. package/bin/lib/common/internal/castSlice.js +1 -0
  20. package/bin/lib/common/internal/createCaseFirst.js +1 -0
  21. package/bin/lib/common/internal/hasUnicode.js +1 -0
  22. package/bin/lib/common/internal/nodeTypes.js +1 -0
  23. package/bin/lib/common/internal/slice.js +1 -0
  24. package/bin/lib/common/internal/stringToArray.js +1 -0
  25. package/bin/lib/common/internal/unicodeToArray.js +1 -0
  26. package/bin/lib/common/internal/unicodeWords.js +1 -0
  27. package/bin/lib/modules/convert/base.js +1 -0
  28. package/bin/lib/modules/convert/base64.js +1 -0
  29. package/bin/lib/modules/convert/index.js +1 -0
  30. package/bin/lib/modules/convert/md5.js +1 -0
  31. package/bin/lib/modules/convert/pkcs.js +1 -0
  32. package/bin/lib/modules/convert/utf8.js +1 -0
  33. package/bin/lib/modules/crypto/base64.js +1 -0
  34. package/bin/lib/modules/crypto/const.js +1 -0
  35. package/bin/lib/modules/crypto/index.js +1 -0
  36. package/bin/lib/modules/crypto/rsa.js +1 -0
  37. package/bin/lib/modules/crypto/tea.js +1 -0
  38. package/bin/lib/modules/crypto/uuid.js +1 -0
  39. package/bin/lib/modules/css.js +1 -0
  40. package/bin/lib/modules/fetch.js +1 -0
  41. package/bin/lib/modules/gbk.js +1 -0
  42. package/bin/lib/modules/hook/base.js +1 -0
  43. package/bin/lib/modules/hook/hooker.js +1 -0
  44. package/bin/lib/modules/hook/index.js +1 -0
  45. package/bin/lib/modules/hook/log.js +1 -0
  46. package/bin/lib/modules/hook/modules/bezier.js +1 -0
  47. package/bin/lib/modules/hook/modules/debounce.js +1 -0
  48. package/bin/lib/modules/hook/modules/mutex.js +1 -0
  49. package/bin/lib/modules/hook/modules/pipeline.js +1 -0
  50. package/bin/lib/modules/hook/modules/polling.js +1 -0
  51. package/bin/lib/modules/hook/modules/safeTask.js +1 -0
  52. package/bin/lib/modules/hook/modules/throttle.js +1 -0
  53. package/bin/lib/modules/html.js +1 -0
  54. package/bin/lib/modules/http/index.js +1 -0
  55. package/bin/lib/modules/http/interceptor.js +1 -0
  56. package/bin/lib/modules/list/base.js +1 -0
  57. package/bin/lib/modules/list/index.js +1 -0
  58. package/bin/lib/modules/math/index.js +1 -0
  59. package/bin/lib/modules/node/rsa-web.js +1 -0
  60. package/bin/lib/modules/obj/index.js +1 -0
  61. package/bin/lib/modules/qs/decode.js +1 -0
  62. package/bin/lib/modules/qs/encode.js +1 -0
  63. package/bin/lib/modules/qs/index.js +1 -0
  64. package/bin/lib/modules/regex.js +1 -0
  65. package/bin/lib/modules/rsa.js +1 -0
  66. package/bin/lib/modules/rule/async-validator/index.js +1 -0
  67. package/bin/lib/modules/rule/async-validator/messages.js +1 -0
  68. package/bin/lib/modules/rule/async-validator/rule/enum.js +1 -0
  69. package/bin/lib/modules/rule/async-validator/rule/index.js +1 -0
  70. package/bin/lib/modules/rule/async-validator/rule/pattern.js +1 -0
  71. package/bin/lib/modules/rule/async-validator/rule/range.js +1 -0
  72. package/bin/lib/modules/rule/async-validator/rule/required.js +1 -0
  73. package/bin/lib/modules/rule/async-validator/rule/type.js +1 -0
  74. package/bin/lib/modules/rule/async-validator/rule/url.js +1 -0
  75. package/bin/lib/modules/rule/async-validator/rule/whitespace.js +1 -0
  76. package/bin/lib/modules/rule/async-validator/util.js +1 -0
  77. package/bin/lib/modules/rule/async-validator/validator/any.js +1 -0
  78. package/bin/lib/modules/rule/async-validator/validator/array.js +1 -0
  79. package/bin/lib/modules/rule/async-validator/validator/boolean.js +1 -0
  80. package/bin/lib/modules/rule/async-validator/validator/date.js +1 -0
  81. package/bin/lib/modules/rule/async-validator/validator/enum.js +1 -0
  82. package/bin/lib/modules/rule/async-validator/validator/float.js +1 -0
  83. package/bin/lib/modules/rule/async-validator/validator/index.js +1 -0
  84. package/bin/lib/modules/rule/async-validator/validator/integer.js +1 -0
  85. package/bin/lib/modules/rule/async-validator/validator/method.js +1 -0
  86. package/bin/lib/modules/rule/async-validator/validator/number.js +1 -0
  87. package/bin/lib/modules/rule/async-validator/validator/object.js +1 -0
  88. package/bin/lib/modules/rule/async-validator/validator/pattern.js +1 -0
  89. package/bin/lib/modules/rule/async-validator/validator/regexp.js +1 -0
  90. package/bin/lib/modules/rule/async-validator/validator/required.js +1 -0
  91. package/bin/lib/modules/rule/async-validator/validator/string.js +1 -0
  92. package/bin/lib/modules/rule/async-validator/validator/type.js +1 -0
  93. package/bin/lib/modules/rule/index.js +1 -0
  94. package/bin/lib/modules/string/index.js +1 -0
  95. package/bin/lib/modules/string/words.js +1 -0
  96. package/bin/lib/modules/time/const.js +1 -0
  97. package/bin/lib/modules/time/dtime.js +1 -0
  98. package/bin/lib/modules/time/frame.js +1 -0
  99. package/bin/lib/modules/time/index.js +1 -0
  100. package/bin/lib/tiny/hook.js +1 -0
  101. package/bin/lib/tiny/store.js +1 -0
  102. package/bin/lib/tiny/utils.js +1 -0
  103. package/bin/lib/tiny/web.js +1 -0
  104. package/bin/lib/tiny.js +1 -0
  105. package/bin/lib/util/function.js +1 -0
  106. package/bin/lib/util/includes.js +1 -0
  107. package/bin/lib/util/index.js +1 -0
  108. package/bin/lib/util/is.js +1 -0
  109. package/bin/lib/util/to.js +1 -0
  110. package/bin/modules/html.d.ts +1 -0
  111. package/bin/modules/qs/index.d.ts +9 -0
  112. package/bin/tiny/hook.d.ts +185 -0
  113. package/bin/tiny/store.d.ts +9 -0
  114. package/bin/tiny/utils.d.ts +239 -0
  115. package/bin/tiny/web.d.ts +114 -0
  116. package/bin/tiny.d.ts +6 -0
  117. package/package.json +12 -20
@@ -0,0 +1 @@
1
+ class s{list=[];constructor(){this.invoke=this.invoke.bind(this)}use(s){this.list=this.list.concat(s)}invoke(s){return this.list.reduce(((s,e)=>s.then((s=>e(s)))),Promise.resolve(s)).catch((s=>"REFETCH"===s.sig?Promise.resolve(s.result):Promise.reject(s)))}}export{s as default};
@@ -0,0 +1 @@
1
+ var r={groupBy:function(r,t){return r.reduce(((r,n)=>((r[n[t]]=r[n[t]]||[]).push(n),r)),{})},first:function(r){if(!r)return;return r.length<=0?void 0:r[0]},last:function(r){if(!r)return;const t=r.length;return t<=0?void 0:r[t-1]},toList:function(r){return Array.isArray(r)?r:r?[r]:[]}};export{r as default};
@@ -0,0 +1 @@
1
+ import t from"../../util/is.js";import n from"../math/index.js";import r from"./base.js";var e={...r,stepAction:function(n,r,e=100){if(!t.isFunction(r))return;if(!t.isArray(n)||n.length<=0)return;let i=0;for(;n.length>i;){let t=e+i,s=n.slice(i,t);r&&r(s),i=t}},skip:function(n,r){if(!t.isArray(n)||n.length<=0)return[];const e=r;return n.slice(e)},take:function(n,r,e=0){if(!t.isArray(n)||n.length<=0)return[];const i=e||0;if(i>=n.length)return[];const s=r+i;return n.slice(i,n.length<s?n.length:s)||[]},distinct:function(n){return!t.isArray(n)||n.length<=0?[]:[...new Set(n)]},randoms:function(t,r=1,e=!1){const i=t.length||0;return n.randoms(i,r,e).map((n=>t[n]))||[]},toKV:(n,r,e)=>{const i={};return r&&e?((n||[]).forEach((n=>{if(!n||!t.isObject(n))return;const s=n[r];(t.isString(s)&&""!==s||t.isNumber(s))&&(i[s]=n[e])})),i):i}};export{e as default};
@@ -0,0 +1 @@
1
+ function n(n){return Math.floor(Math.random()*n)}function r(n,r=10){return+parseFloat(Number(n).toExponential(r))}const t=180/Math.PI;var e={random:n,randomRange:function(n,r){return Math.floor(Math.random()*(r-n+1)+n)},lerp:function(n,r,t){return n*(1-t)+r*t},randoms:function(r,t=1,e=!1){const o=[];for(;;){if(o.length>=t)break;if(!e&&o.length>=r)break;const a=n(r);e?o.push(a):o.includes(a)||o.push(a)}return o},strip:r,float:function(n,{digits:t=2,fixed:e=!1}={}){const o=r(n).toFixed(t);return e||!t?+o:+o.replace(/(\.[1-9]?)0+$/,"$1").replace(/\.$/,"")},radian2degree:function(n){return n*t},degree2radian:function(n){return n/t},calcDataSize:function(n){const r={gb:0,mb:0,kb:0,b:0,total:n,desc:""},t=[{name:"gb",divisor:1<<30},{name:"mb",divisor:1<<20},{name:"kb",divisor:1024},{name:"b",divisor:1}];for(const e of t){const t=Math.floor(n/e.divisor);r[e.name]=t,n-=t*e.divisor}return r.gb>0?r.desc=(r.gb+r.mb/1024).toFixed(2)+"GB":r.mb>0?r.desc=(r.mb+r.kb/1024).toFixed(2)+"MB":r.kb>0?r.desc=(r.kb+r.b/1024).toFixed(2)+"KB":r.desc=r.b+"B",r}};export{e as default};
@@ -0,0 +1 @@
1
+ import e from"../crypto/rsa.js";import r from"crypto";const t=()=>r.webcrypto.subtle;var c={generateKeys:()=>e.generateKeys(t()),encrypt:async(r,c)=>e.encrypt(t(),r,c),decrypt:async(r,c)=>e.decrypt(t(),r,c),encode:async r=>e.encrypt(t(),r,e.RSAPublicKey),decode:async r=>e.decrypt(t(),r,e.RSAPrivateKey)};export{c as default};
@@ -0,0 +1 @@
1
+ import e from"../string/index.js";const r=e=>{if(!e)return e;if("object"!=typeof e)return e;const t=Array.isArray(e)?[]:{};for(const n in e)e.hasOwnProperty(n)&&(t[n]=r(e[n]));return t};const t=(e,r,t={})=>{const o=e||{},{ignoreUndefined:i=!0,cover:c=!1}=t;if(!r)return o;for(const s in r){if(!r.hasOwnProperty(s))continue;const f=r[s];"object"!=typeof f||"object"!=typeof e[s]||c?i&&void 0===f||t.ignoreNull&&null===f||t.ignoreZero&&0===f||t.ignoreEmptyArray&&Array.isArray(f)&&f.length<=0||t.ignoreEmptyString&&"string"==typeof f&&""===f.trim()||(o[s]=f):o[s]=n(e[s],f,t)}return o},n=(e,r,n={})=>{let o={};return o=e&&"object"==typeof e&&!Array.isArray(e)?t(e,r,n):t({...e},r,n),o},o=(e,r,n={})=>t({...e},r,{cover:!0,...n}),i=(e,r,t,n,o=!1)=>{if(!e||!r||!t)return;let c=e[r];null!==c&&"object"==typeof c&&o&&Object.keys(c).forEach((e=>{i(c,e,t,n,o)})),Object.defineProperty(e,r,{configurable:!0,enumerable:!0,set:s=>{t.call(n,s,c),c=s,o&&i(e,r,t,n,o)},get:()=>c})};var c={copy:(r,t={})=>{if(void 0===r)return;const n=JSON.parse(JSON.stringify(r));if("object"!=typeof n)return n;if(Array.isArray(n))return n;const{fields:o=[],camel:i=!1,pure:c=!0}=t;if((!o||o.length<=0)&&!i)return n;const s={};for(const r in n){if(!n.hasOwnProperty(r))continue;const f=i?c&&r.startsWith("_")?r:e.camelCase(r):r;if(o.length>0&&!o.includes(r)&&!o.includes(f))continue;const y=n[r];t.ignoreNull&&null===y||(t.ignoreZero&&0===y||t.ignoreEmptyArray&&Array.isArray(y)&&y.length<=0||t.ignoreEmptyString&&"string"==typeof y&&""===y.trim()||(s[f]=y))}return s},clone:r,merge:n,isEmpty:e=>0!==e&&(!e||"object"==typeof e&&(Array.isArray(e)?!e.length:Object.keys(e).length<=0)),parseValue:(r,{number:t=!1,boolean:n=!1}={})=>{if(!r&&"object"!=typeof r)return r;for(const[o,i]of Object.entries(r))if("object"==typeof i&&null!==i)for(const[r,o]of Object.entries(i))i[r]=e.parseValue(o,{number:t,boolean:n});else r[o]=e.parseValue(i,{number:t,boolean:n});return r},cloneClass:function(e){return e?"object"!=typeof e?e:Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e)):e},combine:o,combines:(e,r={})=>{let t={};if(!e||e.length<=0)return t;const{ignoreUndefined:n=!0,ignoreNull:i=!0,ignoreZero:c=!0,ignoreEmptyArray:s=!0,ignoreEmptyString:f=!0,cover:y=!0}=r;return e.forEach((e=>t=o(t,e,{ignoreUndefined:n,ignoreNull:i,ignoreZero:c,ignoreEmptyArray:s,ignoreEmptyString:f,cover:y}))),t},observe:i,find:(e,r)=>{if(e&&"object"==typeof e)return Object.entries(e||{}).find((([e,t])=>!(!r||!r(e,t))))}};export{c as default};
@@ -0,0 +1 @@
1
+ import e from"../../common/_object.js";import o from"../obj/index.js";const r=function(r,{sep:t="&",eq:n="=",max:s=1e3,multiple:l=!0,uri:p=!0,parseNumber:a=!1,parseBoolean:m=!1}={}){t=t||"&",n=n||"=";const u={};if("string"!=typeof r||0===r.length)return u;const i=/\+/g,c=s||1e3;let f=(r=r.split(t)).length;c>0&&f>c&&(f=c);for(let o=0;o<f;++o){let t,s,a,m,c=r[o].replace(i,"%20"),f=c.indexOf(n);f>=0?(t=c.substr(0,f),s=c.substr(f+1)):(t=c,s=""),a=p?decodeURIComponent(t):t,m=p?decodeURIComponent(s):s,e.hasOwnProperty.call(u,a)&&l?Array.isArray(u[a])?u[a].push(m):u[a]=[u[a],m]:u[a]=m}return o.parseValue(u,{number:a,boolean:m}),u};export{r as default};
@@ -0,0 +1 @@
1
+ const e=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},n=function(e,n=!0){return n?encodeURIComponent(e):e},t=function(t,{sep:c="&",eq:l="=",name:a=null,uri:o=!0,cleanZero:u=!1,cleanNull:i=!1,cleanWhitespace:s=!1}={}){return c=c||"&",l=l||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(a){const f=n(e(a),o)+l,p=t[a];return Array.isArray(p)?p.map((function(t){return f+n(e(t),o)})).join(c):r(p,{cleanZero:u,cleanNull:i,cleanWhitespace:s})?"":f+n(e(p),o)})).filter(Boolean).join(c):a?n(e(a),o)+l+n(e(t),o):""},r=function(e,{cleanZero:n=!1,cleanNull:t=!1,cleanWhitespace:r=!1}={}){return!(!n||0!==e)||(!(!t||null!=e)||!(!r||"string"!=typeof e||""!==e.trim()))};export{t as default};
@@ -0,0 +1 @@
1
+ import t from"./decode.js";import r from"./encode.js";const e=/^(https?):\/\/([\w.\_\-]+)(?::(\d+))?/,s=t=>{const r=(t||"").replace(/\\/g,"/").split("?")[0],e=r.match(/[\/]?([\w\_\-]+)[.]?[\w]*[?]?$/),s=e?e[1]:"",i=r.lastIndexOf("/")+1,n=r.substring(i),o=n.lastIndexOf("."),l=n.substring(0,o)||"",p=o>=0?n.substring(o):"";return{route:r.substring(0,i)||"",page:s,name:n,withoutExtension:l,extname:p}},i=t=>{const r={href:t,url:"",origin:"",protocol:"",host:"",port:"",query:""};if(!t)return r;const s=t.match(e);if(!s||s.length<4)return r;const i=s[3]||"",n=t.split("?");return r.url=n[0],r.origin=s[0],r.protocol=`${s[1]}:`,r.host=`${s[2]}${i?":"+i:""}`,r.port=i,r.query=n.length>1?n[1]:"",r},n=(t,r)=>{if(t===r)return!0;if(!t)return!1;if(!r)return!1;if("*"===r)return!0;const e=r.replace(/\./g,"\\.").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^"+e+"$").test(t)};var o={parse:t,stringify:r,https:t=>t?t.replace(/^http[s]?/,"https"):t,parseUrl:r=>{const e=i(r),{origin:n="",url:o="",query:l=""}=e,p=s(o),u=t(l,{multiple:!0,uri:!1});return{...e,...p,pathname:o.substring(o.indexOf(n||"")+n.length),params:u}},parsePath:s,parseHost:i,join:(...t)=>{const r=[];let e=!1;return t.forEach((t=>{const s=t.trim();if(""===s)return;if(/^(\w+):\/\//.test(s))return r.length=0,r.push(s),void(e=!0);s.split("/").forEach((t=>{"."!==t&&""!==t&&(".."===t?r.length>0&&".."!==r[r.length-1]?r.pop():e||r.push(".."):r.push(t))}))})),r.join("/")},shExpMatch:n,isLocalIpAddress:t=>!!t&&!!(n(t,"127.0.0.1")||n(t,"localhost")||n(t,"192.168.*.*")),parseFileUrl:r=>{const e={href:r,file:"",url:"",protocol:"",host:"",query:"",params:{}};if(!r)return e;let s=r?r.replace(/\\/g,"/"):"";s.startsWith("file://")&&!s.startsWith("file:///")?s="file:///"+s.slice(7):s.startsWith("file:/")&&!s.startsWith("file:///")&&(s="file:///"+s.slice(6));const i=s.match(/^file:\/\/(?:([^\/\\]+))?(\/.*)?$/);if(!i||i.length<3)return e;e.protocol="file:";const n=i[1]||"",o=i[2]||"";e.host=n;const l=o.split("?");return e.url=e.protocol+`//${e.host}`+l[0],e.file=l[0],e.query=l.length>1?l[1]:"",e.params=t(e.query,{multiple:!0,uri:!1}),e}};export{o as default};
@@ -0,0 +1 @@
1
+ var e={pattern:{num:"0-9",zh:"一-龥",en:"A-Za-z"},regex:(e,d)=>new RegExp(e,d),entire:{chinese:/^[\u4E00-\u9FA5]+$/,real:/^(\-|\+)?\d+(\.\d+)?$/,cssReal:/^(\-|\+)?\d*(\.)?\d+$/,id:/^[A-Za-z0-9]+$/,yyyyMMdd:/^(\d{4})-?(\d{2})-?(\d{2})$/}};export{e as default};
@@ -0,0 +1 @@
1
+ import e from"./crypto/rsa.js";const t="undefined"!=typeof window?window.crypto.subtle:{};var y={generateKeys:()=>e.generateKeys(t),encrypt:async(y,c)=>e.encrypt(t,y,c),decrypt:async(y,c)=>e.decrypt(t,y,c),encode:async y=>e.encrypt(t,y,e.RSAPublicKey),decode:async y=>e.decrypt(t,y,e.RSAPrivateKey)};export{y as default};
@@ -0,0 +1 @@
1
+ import{warning as e,deepMerge as t,asyncMap as s,format as r,convertFieldsError as a,complementError as i}from"./util.js";import l from"./validator/index.js";import{messages as o,newMessages as n}from"./messages.js";class u{static register=function(e,t){if("function"!=typeof t)throw new Error("Cannot register a validator by type, validator is not a function");l[e]=t};static warning=e;static messages=o;static validators=l;rules={};_messages=o;constructor(e){this.define(e)}define(e){if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!=typeof e||Array.isArray(e))throw new Error("Rules must be an object");this.rules={},Object.keys(e).forEach((t=>{const s=e[t];this.rules[t]=Array.isArray(s)?s:[s]}))}messages(e){return e&&(this._messages=t(n(),e)),this._messages}validate(e,l={},f=(()=>{})){let c=e,d=l,g=f;if("function"==typeof d&&(g=d,d={}),!this.rules||0===Object.keys(this.rules).length)return g&&g(null,c),Promise.resolve(c);if(d.messages){let e=this.messages();e===o&&(e=n()),t(e,d.messages),d.messages=e}else d.messages=this.messages();const p={};(d.keys||Object.keys(this.rules)).forEach((t=>{const s=this.rules[t];let r=c[t];s.forEach((s=>{let a=s;"function"==typeof a.transform&&(c===e&&(c={...c}),r=c[t]=a.transform(r)),a="function"==typeof a?{validator:a}:{...a},a.validator=this.getValidationMethod(a),a.validator&&(a.field=t,a.fullField=a.fullField||t,a.type=this.getType(a),p[t]=p[t]||[],p[t].push({rule:a,value:r,source:c,field:t}))}))}));const y={};return s(p,d,((e,t)=>{const s=e.rule;let a,l=!("object"!==s.type&&"array"!==s.type||"object"!=typeof s.fields&&"object"!=typeof s.defaultField);function o(e,t){return{...t,fullField:`${s.fullField}.${e}`,fullFields:s.fullFields?[...s.fullFields,e]:[e]}}function n(a=[]){let n=Array.isArray(a)?a:[a];!0===d.suppressWarning&&n.length&&u.warning("async-validator:",n),n.length&&void 0!==s.message&&(n=[].concat(s.message));let f=n.map(i(s,c));if(d.first&&f.length)return y[s.field]=1,t(f);if(l){if(s.required&&!e.value)return void 0!==s.message?f=[].concat(s.message).map(i(s,c)):d.error&&(f=[d.error(s,r(d.messages.required,s.field))]),t(f);let a={};s.defaultField&&Object.keys(e.value).map((e=>{a[e]=s.defaultField})),a={...a,...e.rule.fields};const l={};Object.keys(a).forEach((e=>{const t=a[e],s=Array.isArray(t)?t:[t];l[e]=s.map(o.bind(null,e))}));const n=new u(l);n.messages(d.messages),e.rule.options&&(e.rule.options.messages=d.messages,e.rule.options.error=d.error),n.validate(e.value,e.rule.options||d,(e=>{const s=[];f&&f.length&&s.push(...f),e&&e.length&&s.push(...e),t(s.length?s:null)}))}else t(f)}if(l=l&&(s.required||!s.required&&e.value),s.field=e.field,s.asyncValidator)a=s.asyncValidator(s,e.value,n,e.source,d);else if(s.validator){try{a=s.validator(s,e.value,n,e.source,d)}catch(e){console.error?.(e),d.suppressValidatorError||setTimeout((()=>{throw e}),0),n(e.message)}!0===a?n():!1===a?n("function"==typeof s.message?s.message(s.fullField||s.field):s.message||`${s.fullField||s.field} fails`):a instanceof Array?n(a):a instanceof Error&&n(a.message)}a&&a.then&&a.then((()=>n()),(e=>n(e)))}),(e=>{!function(e){let t=[],s={};for(let s=0;s<e.length;s++)r=e[s],Array.isArray(r)?t=t.concat(...r):t.push(r);var r;t.length?(s=a(t),g(t,s)):g(null,c)}(e)}),c)}getType(e){if(void 0===e.type&&e.pattern instanceof RegExp&&(e.type="pattern"),"function"!=typeof e.validator&&e.type&&!l.hasOwnProperty(e.type))throw new Error(r("Unknown rule type %s",e.type));return e.type||"string"}getValidationMethod(e){if("function"==typeof e.validator)return e.validator;const t=Object.keys(e),s=t.indexOf("message");return-1!==s&&t.splice(s,1),1===t.length&&"required"===t[0]?l.required:l[this.getType(e)]||void 0}}export{u as default};
@@ -0,0 +1 @@
1
+ function s(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone(){const s=JSON.parse(JSON.stringify(this));return s.clone=this.clone,s}}}const e=s();export{e as messages,s as newMessages};
@@ -0,0 +1 @@
1
+ import{format as s}from"../util.js";const e="enum",r=(r,i,a,l,o)=>{r[e]=Array.isArray(r[e])?r[e]:[],-1===r[e].indexOf(i)&&l.push(s(o.messages[e],r.fullField,r[e].join(", ")))};export{r as default};
@@ -0,0 +1 @@
1
+ import r from"./required.js";import e from"./whitespace.js";import t from"./type.js";import m from"./range.js";import o from"./enum.js";import p from"./pattern.js";var i={required:r,whitespace:e,type:t,range:m,enum:o,pattern:p};export{i as default};
@@ -0,0 +1 @@
1
+ import{format as t}from"../util.js";const e=(e,s,a,p,n)=>{if(e.pattern)if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(s)||p.push(t(n.messages.pattern.mismatch,e.fullField,s,e.pattern));else if("string"==typeof e.pattern){new RegExp(e.pattern).test(s)||p.push(t(n.messages.pattern.mismatch,e.fullField,s,e.pattern))}};export{e as default};
@@ -0,0 +1 @@
1
+ import{format as e}from"../util.js";const n=(n,s,m,l,r)=>{const u="number"==typeof n.len,a="number"==typeof n.min,t="number"==typeof n.max,i=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;let f=s,p="";const o="number"==typeof s,g="string"==typeof s,F=Array.isArray(s);if(o?p="number":g?p="string":F&&(p="array"),!p)return!1;F&&(f=s.length),g&&(f=s.replace(i,"_").length),u?f!==n.len&&l.push(e(r.messages[p].len,n.fullField,n.len)):a&&!t&&f<n.min?l.push(e(r.messages[p].min,n.fullField,n.min)):t&&!a&&f>n.max?l.push(e(r.messages[p].max,n.fullField,n.max)):a&&t&&(f<n.min||f>n.max)&&l.push(e(r.messages[p].range,n.fullField,n.min,n.max))};export{n as default};
@@ -0,0 +1 @@
1
+ import{isEmptyValue as e,format as r}from"../util.js";const s=(s,t,i,l,u,d)=>{!s.required||i.hasOwnProperty(s.field||"")&&!e(t,d||s.type)||l.push(r(u.messages.required,s.fullField))};export{s as default};
@@ -0,0 +1 @@
1
+ import{format as e}from"../util.js";import t from"./required.js";import r from"./url.js";const u=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,o=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,n={integer:e=>n.number(e)&&parseInt(e,10)===e,float:e=>n.number(e)&&!n.integer(e),array:e=>Array.isArray(e),regexp(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(e){return!1}},date:e=>"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear&&!isNaN(e.getTime()),number:e=>!isNaN(e)&&"number"==typeof e,object:e=>"object"==typeof e&&!n.array(e),method:e=>"function"==typeof e,email:e=>"string"==typeof e&&e.length<=320&&!!e.match(u),url:e=>"string"==typeof e&&e.length<=2048&&!!e.match(r()),hex:e=>"string"==typeof e&&!!e.match(o)},i=(r,u,o,i,a)=>{if(r.required&&void 0===u)return void t(r,u,o,i,a);const f=r.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(f)>-1?n[f](u)||i.push(e(a.messages.types[f],r.fullField,r.type)):f&&typeof u!==r.type&&i.push(e(a.messages.types[f],r.fullField,r.type))};export{i as default};
@@ -0,0 +1 @@
1
+ let $;var e=()=>{if($)return $;const e="[a-fA-F\\d:]",n=$=>$&&$.includeBoundaries?`(?:(?<=\\s|^)(?=${e})|(?<=${e})(?=\\s|$))`:"",a="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",f="[a-fA-F\\d]{1,4}",u=`\n(?:\n(?:${f}:){7}(?:${f}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:${f}:){6}(?:${a}|:${f}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:${f}:){5}(?::${a}|(?::${f}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:${f}:){4}(?:(?::${f}){0,1}:${a}|(?::${f}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:${f}:){3}(?:(?::${f}){0,2}:${a}|(?::${f}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:${f}:){2}(?:(?::${f}){0,3}:${a}|(?::${f}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:${f}:){1}(?:(?::${f}){0,4}:${a}|(?::${f}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::${f}){0,5}:${a}|(?::${f}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),d=new RegExp(`(?:^${a}$)|(?:^${u}$)`),t=new RegExp(`^${a}$`),g=new RegExp(`^${u}$`),r=$=>$&&$.exact?d:new RegExp(`(?:${n($)}${a}${n($)})|(?:${n($)}${u}${n($)})`,"g");r.v4=$=>$&&$.exact?t:new RegExp(`${n($)}${a}${n($)}`,"g"),r.v6=$=>$&&$.exact?g:new RegExp(`${n($)}${u}${n($)}`,"g");const c=r.v4().source,s=r.v6().source;return $=new RegExp(`(?:^${`(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|${c}|${s}|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?`}$)`,"i"),$};export{e as default};
@@ -0,0 +1 @@
1
+ import{format as s}from"../util.js";const e=(e,t,l,a,i)=>{(/^\s+$/.test(t)||""===t)&&a.push(s(i.messages.whitespace,e.fullField))};export{e as default};
@@ -0,0 +1 @@
1
+ const e=/%[sdj%]/g;let n=()=>{};function t(e){if(!e||!e.length)return null;const n={};return e.forEach((e=>{const t=e.field;n[t]=n[t]||[],n[t].push(e)})),n}function r(n,...t){let r=0;const o=t.length;if("function"==typeof n)return n.apply(null,t);if("string"==typeof n){return n.replace(e,(e=>{if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(t[r++]);case"%d":return Number(t[r++]);case"%j":try{return JSON.stringify(t[r++])}catch(e){return"[Circular]"}break;default:return e}}))}return n}function o(e,n){return null==e||(!("array"!==n||!Array.isArray(e)||e.length)||!(!function(e){return"string"===e||"url"===e||"hex"===e||"email"===e||"date"===e||"pattern"===e}(n)||"string"!=typeof e||e))}function i(e,n,t){let r=0;const o=e.length;!function i(s){if(s&&s.length)return void t(s);const f=r;r+=1,f<o?n(e[f],i):t([])}([])}"undefined"!=typeof process&&process.env&&"production"!==process.env.NODE_ENV&&"undefined"!=typeof window&&"undefined"!=typeof document&&(n=(e,n)=>{"undefined"!=typeof console&&console.warn&&"undefined"==typeof ASYNC_VALIDATOR_NO_WARNING&&n.every((e=>"string"==typeof e))&&console.warn(e,n)});class s extends Error{errors;fields;constructor(e,n){super("Async Validation Error"),this.errors=e,this.fields=n}}function f(e,n,r,o,f){if(n.first){const n=new Promise(((n,l)=>{const u=function(e){const n=[];return Object.keys(e).forEach((t=>{n.push(...e[t]||[])})),n}(e);i(u,r,(e=>(o(e),e.length?l(new s(e,t(e))):n(f))))}));return n.catch((e=>e)),n}const l=!0===n.firstFields?Object.keys(e):n.firstFields||[],u=Object.keys(e),c=u.length;let d=0;const a=[],p=new Promise(((n,p)=>{const h=e=>{if(a.push.apply(a,e),d++,d===c)return o(a),a.length?p(new s(a,t(a))):n(f)};u.length||(o(a),n(f)),u.forEach((n=>{const t=e[n];-1!==l.indexOf(n)?i(t,r,h):function(e,n,t){const r=[];let o=0;const i=e.length;function s(e){r.push(...e||[]),o++,o===i&&t(r)}e.forEach((e=>{n(e,s)}))}(t,r,h)}))}));return p.catch((e=>e)),p}function l(e,n){return t=>{let r;return r=e.fullFields?function(e,n){let t=e;for(let e=0;e<n.length;e++){if(null==t)return t;t=t[n[e]]}return t}(n,e.fullFields):n[t.field||e.fullField],(o=t)&&void 0!==o.message?(t.field=t.field||e.fullField,t.fieldValue=r,t):{message:"function"==typeof t?t():t,fieldValue:r,field:t.field||e.fullField};var o}}function u(e,n){if(n)for(const t in n)if(n.hasOwnProperty(t)){const r=n[t];"object"==typeof r&&"object"==typeof e[t]?e[t]={...e[t],...r}:e[t]=r}return e}export{s as AsyncValidationError,f as asyncMap,l as complementError,t as convertFieldsError,u as deepMerge,r as format,o as isEmptyValue,n as warning};
@@ -0,0 +1 @@
1
+ import r from"../rule/index.js";import{isEmptyValue as e}from"../util.js";const i=(i,t,o,u,d)=>{const f=[];if(i.required||!i.required&&u.hasOwnProperty(i.field)){if(e(t)&&!i.required)return o();r.required(i,t,u,f,d)}o(f)};export{i as default};
@@ -0,0 +1 @@
1
+ import r from"../rule/index.js";const e=(e,i,u,n,t)=>{const d=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(null==i&&!e.required)return u();r.required(e,i,n,d,t,"array"),null!=i&&(r.type(e,i,n,d,t),r.range(e,i,n,d,t))}u(d)};export{e as default};
@@ -0,0 +1 @@
1
+ import{isEmptyValue as r}from"../util.js";import e from"../rule/index.js";const i=(i,t,o,d,u)=>{const f=[];if(i.required||!i.required&&d.hasOwnProperty(i.field)){if(r(t)&&!i.required)return o();e.required(i,t,d,f,u),void 0!==t&&e.type(i,t,d,f,u)}o(f)};export{i as default};
@@ -0,0 +1 @@
1
+ import e from"../rule/index.js";import{isEmptyValue as r}from"../util.js";const t=(t,i,a,d,n)=>{const o=[];if(t.required||!t.required&&d.hasOwnProperty(t.field)){if(r(i,"date")&&!t.required)return a();if(e.required(t,i,d,o,n),!r(i,"date")){let r;r=i instanceof Date?i:new Date(i),e.type(t,r,d,o,n),r&&e.range(t,r.getTime(),d,o,n)}}a(o)};export{t as default};
@@ -0,0 +1 @@
1
+ import r from"../rule/index.js";import{isEmptyValue as e}from"../util.js";const i=(i,o,t,u,d)=>{const f=[];if(i.required||!i.required&&u.hasOwnProperty(i.field)){if(e(o)&&!i.required)return t();r.required(i,o,u,f,d),void 0!==o&&r.enum(i,o,u,f,d)}t(f)};export{i as default};
@@ -0,0 +1 @@
1
+ import r from"../rule/index.js";import{isEmptyValue as e}from"../util.js";const i=(i,t,o,d,u)=>{const f=[];if(i.required||!i.required&&d.hasOwnProperty(i.field)){if(e(t)&&!i.required)return o();r.required(i,t,d,f,u),void 0!==t&&(r.type(i,t,d,f,u),r.range(i,t,d,f,u))}o(f)};export{i as default};
@@ -0,0 +1 @@
1
+ import r from"./string.js";import o from"./method.js";import m from"./number.js";import t from"./boolean.js";import e from"./regexp.js";import i from"./integer.js";import p from"./float.js";import a from"./array.js";import f from"./object.js";import s from"./enum.js";import j from"./pattern.js";import n from"./date.js";import u from"./required.js";import d from"./type.js";import l from"./any.js";var b={string:r,method:o,number:m,boolean:t,regexp:e,integer:i,float:p,array:a,object:f,enum:s,pattern:j,date:n,url:d,hex:d,email:d,required:u,any:l};export{b as default};
@@ -0,0 +1 @@
1
+ import r from"../rule/index.js";import{isEmptyValue as e}from"../util.js";const i=(i,t,o,d,u)=>{const f=[];if(i.required||!i.required&&d.hasOwnProperty(i.field)){if(e(t)&&!i.required)return o();r.required(i,t,d,f,u),void 0!==t&&(r.type(i,t,d,f,u),r.range(i,t,d,f,u))}o(f)};export{i as default};
@@ -0,0 +1 @@
1
+ import r from"../rule/index.js";import{isEmptyValue as e}from"../util.js";const i=(i,t,o,d,u)=>{const f=[];if(i.required||!i.required&&d.hasOwnProperty(i.field)){if(e(t)&&!i.required)return o();r.required(i,t,d,f,u),void 0!==t&&r.type(i,t,d,f,u)}o(f)};export{i as default};
@@ -0,0 +1 @@
1
+ import r from"../rule/index.js";import{isEmptyValue as e}from"../util.js";const i=(i,o,t,d,u)=>{const f=[];if(i.required||!i.required&&d.hasOwnProperty(i.field)){if(""===o&&(o=void 0),e(o)&&!i.required)return t();r.required(i,o,d,f,u),void 0!==o&&(r.type(i,o,d,f,u),r.range(i,o,d,f,u))}t(f)};export{i as default};
@@ -0,0 +1 @@
1
+ import r from"../rule/index.js";import{isEmptyValue as e}from"../util.js";const i=(i,t,o,d,u)=>{const f=[];if(i.required||!i.required&&d.hasOwnProperty(i.field)){if(e(t)&&!i.required)return o();r.required(i,t,d,f,u),void 0!==t&&r.type(i,t,d,f,u)}o(f)};export{i as default};
@@ -0,0 +1 @@
1
+ import r from"../rule/index.js";import{isEmptyValue as e}from"../util.js";const i=(i,t,n,o,s)=>{const u=[];if(i.required||!i.required&&o.hasOwnProperty(i.field)){if(e(t,"string")&&!i.required)return n();r.required(i,t,o,u,s),e(t,"string")||r.pattern(i,t,o,u,s)}n(u)};export{i as default};
@@ -0,0 +1 @@
1
+ import r from"../rule/index.js";import{isEmptyValue as e}from"../util.js";const i=(i,t,o,u,d)=>{const f=[];if(i.required||!i.required&&u.hasOwnProperty(i.field)){if(e(t)&&!i.required)return o();r.required(i,t,u,f,d),e(t)||r.type(i,t,u,f,d)}o(f)};export{i as default};
@@ -0,0 +1 @@
1
+ import r from"../rule/index.js";const e=(e,a,o,t,s)=>{const i=[],y=Array.isArray(a)?"array":typeof a;r.required(e,a,t,i,s,y),o(i)};export{e as default};
@@ -0,0 +1 @@
1
+ import r from"../rule/index.js";import{isEmptyValue as e}from"../util.js";const t=(t,i,s,n,o)=>{const p=[];if(t.required||!t.required&&n.hasOwnProperty(t.field||"")){if(e(i,"string")&&!t.required)return s();r.required(t,i,n,p,o,"string"),e(i,"string")||(r.type(t,i,n,p,o),r.range(t,i,n,p,o),r.pattern(t,i,n,p,o),!0===t.whitespace&&r.whitespace(t,i,n,p,o))}s(p)};export{t as default};
@@ -0,0 +1 @@
1
+ import r from"../rule/index.js";import{isEmptyValue as e}from"../util.js";const i=(i,t,o,u,d)=>{const f=i.type,p=[];if(i.required||!i.required&&u.hasOwnProperty(i.field)){if(e(t,f)&&!i.required)return o();r.required(i,t,u,p,d,f),e(t,f)||r.type(i,t,u,p,d)}o(p)};export{i as default};
@@ -0,0 +1 @@
1
+ import t from"../hook/index.js";import n from"./async-validator/index.js";function e(t){return new n(t)}var r={validateId:function(t){return!!t&&(!(t.length<6)&&!!/^[A-Za-z0-9_-]+$/.test(t))},validatePhone:function(t){return!!t&&!!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(t)},validator:e,validate:function(n,r,i={},u=(()=>{})){return t.run(e(n).validate(r,i,u))},isChinese:function(t){return!!t&&!!/^[\u4E00-\u9FA5]+$/.test(t)},isNumber:function(t){return!!t&&!!/^[0-9]+$/.test(t)},isFloat:function(t){return!!t&&!!/^(\-|\+)?\d+(\.\d+)?$/.test(t)},isPhoneNumber:function(t){return!!t&&!!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(t)}};export{r as default};
@@ -0,0 +1 @@
1
+ import e from"../../common/internal/createCaseFirst.js";import r from"../../util/is.js";import t from"./words.js";function s(e){if(null==e)return"";if("string"==typeof e)return e;if(Array.isArray(e))return`${e.map((e=>null==e?e:s(e)))}`;if(r.isSymbol(e))return e.toString();const t=`${e}`;return"0"==t&&1/e==-Infinity?"-0":t}const a=e("toUpperCase"),o=e("toLowerCase");var n={toString:s,startCase:e=>t(`${e}`.replace(/['\u2019]/g,"")).reduce(((e,r,t)=>e+(t?" ":"")+a(r)),""),snakeCase:e=>t(s(e).replace(/['\u2019]/g,"")).reduce(((e,r,t)=>e+(t?"_":"")+r.toLowerCase()),""),kebabCase:e=>t(s(e).replace(/['\u2019]/g,"")).reduce(((e,r,t)=>e+(t?"-":"")+r.toLowerCase()),""),camelCase:e=>t(s(e).replace(/['\u2019]/g,"")).reduce(((e,r,t)=>(r=r.toLowerCase(),e+(t?a(r):r))),""),upperCase:e=>t(s(e).replace(/['\u2019]/g,"")).reduce(((e,r,t)=>e+(t?" ":"")+r.toUpperCase()),""),upperFirst:a,lowerCase:e=>t(s(e).replace(/['\u2019]/g,"")).reduce(((e,r,t)=>e+(t?" ":"")+r.toLowerCase()),""),lowerFirst:o,splitOnFirst:(e,r)=>{if("string"!=typeof e||"string"!=typeof r)throw new TypeError("Expected the arguments to be of type `string`");if(""===e||""===r)return[];const t=e.indexOf(r);return-1===t?[]:[e.slice(0,t),e.slice(t+r.length)]},parseValue:(e,{number:r=!1,boolean:t=!1}={})=>{let s=e;return e&&"string"==typeof e?(r&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?s=Number(e):!t||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(s="true"===e.toLowerCase()),s):s},replace:(e,r)=>{if(!e)return e;if(!r)return e;let t=e;return((Array.isArray(r)?r:[r])||[]).forEach((e=>{e.key&&e.value&&(t=t.replace(new RegExp(e.key,e.flag||""),e.value))})),t},jsonFormat:e=>{try{if(!e)return"";const r=JSON.parse(e);return JSON.stringify(r,null,2)}catch(r){return e}},toLines:(e,r="\n")=>e?e.split(r).map((e=>e.trim())).filter((e=>!!e)):[]};export{n as default};
@@ -0,0 +1 @@
1
+ import t from"../../common/internal/unicodeWords.js";const n=RegExp.prototype.test.bind(/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/),o=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function r(r,a){if(void 0===a){const a=n(r)?t(r):function(t){return t.match(o)}(r);return a||[]}return r.match(a)||[]}export{r as default};
@@ -0,0 +1 @@
1
+ var e={oneDay:864e5,oneHour:36e5,oneMinute:6e4,oneSecond:1e3};export{e as default};
@@ -0,0 +1 @@
1
+ import t from"./const.js";class s{date;timestamp=0;yyyy=0;yy="";M=0;MM="";d=0;dd="";h=0;hh="";m=0;mm="";s=0;ss="";S=0;SS="";SSS="";constructor(t){if(!t)return;const s="string"==typeof t||"number"==typeof t?new Date(t):t;s&&(this.date=s,this.timestamp=s.getTime(),this.toDate())}toDate(){return this.date?(this.yyyy=this.date.getFullYear(),this.yy=`${this.yyyy}`.substr(2),this.M=this.date.getMonth()+1,this.MM=(this.M<10?"0":"")+this.M,this.d=this.date.getDate(),this.dd=(this.d<10?"0":"")+this.d,this.h=this.date.getHours(),this.hh=(this.h<10?"0":"")+this.h,this.m=this.date.getMinutes(),this.mm=(this.m<10?"0":"")+this.m,this.s=this.date.getSeconds(),this.ss=(this.s<10?"0":"")+this.s,this.S=this.date.getMilliseconds(),this.SS=(this.S<10?"0":"")+this.S,this.SSS=this.S.toString().padStart(3,"0"),this):this}toCountdown(s=""){const e={countdown:0,timestamp:0,seconds:0,d:0,dd:"",h:0,hh:"",m:0,mm:"",s:0,ss:"",S:0,SS:"",SSS:"",desc:""};if(!this.timestamp)return e;e.timestamp=this.timestamp,e.countdown=Math.max(e.timestamp-Date.now(),0),e.seconds=Math.floor(e.countdown/t.oneSecond);let h=e.countdown;e.d=Math.floor(h/t.oneDay),e.dd=(e.d<10?"0":"")+e.d,h%=t.oneDay,e.h=Math.floor(h/t.oneHour),e.hh=(e.h<10?"0":"")+e.h,h%=t.oneHour,e.m=Math.floor(h/t.oneMinute),e.mm=(e.m<10?"0":"")+e.m,h%=t.oneMinute,e.s=Math.floor(h/t.oneSecond),e.ss=(e.s<10?"0":"")+e.s,h%=t.oneSecond,e.S=h,e.SS=(e.S<10?"0":"")+e.S,e.SSS=e.S.toString().padStart(3,"0");let i=s;return i||(i=e.countdown>t.oneHour?"hh:mm:ss":e.countdown>t.oneMinute?"mm:ss":"ss"),e.desc=i.replace(/\bdd|d|hh|h|mm|m|ss|s|SSS|SS|S\b/g,(t=>e[t])),e}add(t=0){return t?(this.timestamp=this.timestamp+t,this.date=new Date(this.timestamp),this.toDate(),this):this}format(t="yyyy-MM-dd hh:mm:ss"){return t.replace(/\byyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S\b/g,(t=>this[t]))}static get timezoneOffset(){return(new Date).getTimezoneOffset()/60}static getLocalTime(t=0){const s=new Date,e=s.getTime(),h=6e4*s.getTimezoneOffset();return new Date(e+h+36e5*t)}}export{s as default};
@@ -0,0 +1 @@
1
+ import t from"../../class/event.js";class e{_loopTimer;_event=new t;started=!1;interval=0;constructor(t=0){this.interval=t||500}start(){return this.started||(this.stop(),this._loopTimer=setInterval((()=>{this._handleLoop()}),this.interval),this.started=!0),this}stop(){return this._loopTimer?(clearInterval(this._loopTimer),this._loopTimer=0,this.started=!1,this):this}restart(){return this.stop(),this.start(),this}on(t){return this._event.on("frame",t),this}off(t){return t?(this._event.off("frame",t),this):this}_handleLoop(){this._event.emit("frame")}}export{e as default};
@@ -0,0 +1 @@
1
+ import t from"./frame.js";import e from"./dtime.js";import n from"./const.js";const o=(t,e="yyyy-MM-dd hh:mm:ss")=>{const n="string"==typeof t||"number"==typeof t?new Date(t):t;return n?r(n).format(e):""},r=t=>{const n="string"==typeof t||"number"==typeof t?new Date(t):t;return new e(n||0)};function m({year:t=0,month:e=0,date:n=0,hour:r=0,minute:m=0,second:a=0}){const i=`${t||"yyyy"}/${e||"MM"}/${n||"dd"} ${r}:${m}:${a}`;return new Date(o(Date.now(),i)).getTime()}var a={...n,now:function(){return r(new Date)},isToday:t=>t&&(new Date).toDateString()===new Date(t).toDateString(),parseTimestamp:m,todayZero:()=>m({}),format:o,countdown:(t,e="")=>{const n="string"==typeof t||"number"==typeof t?new Date(t):t;if(!n)return"";return r(n).toCountdown(e)},dtime:r,loopFrame:(e=500)=>new t(e),getTimezoneOffset:()=>e.timezoneOffset,getLocalTime:e.getLocalTime};export{a as default};
@@ -0,0 +1 @@
1
+ import o from"../modules/convert/index.js";import m from"../modules/hook/index.js";import r from"../modules/math/index.js";import s from"../modules/qs/index.js";import i from"../modules/string/index.js";import t from"../util/function.js";import e from"../modules/crypto/index.js";const d={...o,...e,...m,...i,...r,...t,qs:s};export{d as default};
@@ -0,0 +1 @@
1
+ import s,{storeRef as r}from"../class/store.js";import t,{persistConfig as o}from"../class/persist.js";const e={Store:s,storeRef:r,Persist:t,persistConfig:o};export{e as default};
@@ -0,0 +1 @@
1
+ import o from"../modules/convert/index.js";import m from"../modules/gbk.js";import e from"../modules/list/index.js";import r from"../modules/math/index.js";import i from"../modules/obj/index.js";import s from"../modules/regex.js";import t from"../modules/rule/index.js";import d from"../modules/string/index.js";import l from"../modules/time/index.js";import n from"../modules/crypto/index.js";import u from"../util/index.js";const j={gbk:m,math:r,list:e,string:d,time:l,obj:i,rule:t,regex:s,...o,...n,...u,Event:Event};export{j as default};
@@ -0,0 +1 @@
1
+ import o from"../class/icon.js";import s from"../modules/css.js";import m from"../modules/fetch.js";import t from"../modules/html.js";import r from"../modules/http/index.js";import e from"../modules/qs/index.js";const i={fetch:m,Http:r,css:s,qs:e,icon:o,html:t};export{i as default};
@@ -0,0 +1 @@
1
+ export{default as dHook}from"./tiny/hook.js";export{default as dStore}from"./tiny/store.js";export{default as dUtil}from"./tiny/utils.js";export{default as dWeb}from"./tiny/web.js";
@@ -0,0 +1 @@
1
+ import t from"../class/getset.js";var n={singleton:function(){class t{static __instance__;constructor(){}static get Instance(){return t.__instance__||(t.__instance__=new this),t.__instance__}static get I(){return this.Instance}}return t},getset:function(n){const s=new t;return void 0!==n&&s.set(n),s}};export{n as default};
@@ -0,0 +1 @@
1
+ import r from"./is.js";import n from"./to.js";import t from"../common/_object.js";function e(r){return r!=r}function o(r,n){return function(r,n){for(var t=-1,e=r?r.length:0,o=Array(e);++t<e;)o[t]=n(r[t],t,r);return o}(n,(function(n){return r[n]}))}var i,u,f=(i=Object.keys,u=Object,function(r){return i(u(r))}),a=Math.max;function c(n,e){var o=r.isArray(n)||r.isArguments(n)?function(r,n){for(var t=-1,e=Array(r);++t<r;)e[t]=n(t);return e}(n.length,String):[],i=o.length,u=!!i;for(var f in n)!e&&!t.hasOwnProperty.call(n,f)||u&&("length"==f||r.isIndex(f,i))||o.push(f);return o}function s(i,u,s,h){var l;i=r.isArrayLike(i)?i:(l=i)?o(l,function(n){return r.isArrayLike(n)?c(n):function(n){if(!r.isPrototype(n))return f(n);var e=[];for(var o in Object(n))t.hasOwnProperty.call(n,o)&&"constructor"!=o&&e.push(o);return e}(n)}(l)):[],s=s&&!h?n.toInteger(s):0;var g=i.length;return s<0&&(s=a(g+s,0)),r.isString(i)?s<=g&&i.indexOf(u,s)>-1:!!g&&function(r,n,t){if(n!=n)return function(r,n,t,e){for(var o=r.length,i=t+(e?1:-1);e?i--:++i<o;)if(n(r[i],i,r))return i;return-1}(r,e,t);for(var o=t-1,i=r.length;++o<i;)if(r[o]===n)return o;return-1}(i,u,s)>-1}export{s as default};
@@ -0,0 +1 @@
1
+ import o from"./is.js";import r from"./includes.js";import i from"../common/_object.js";import t from"../modules/obj/index.js";import e from"./function.js";var s={...o,...i,...t,...e,includes:r,forof:(r,i)=>{if(!r)return;let t;if(o.isObject(r)&&(t=o.isArray(r)?r.entries():Object.entries(r),t))for(const[o,r]of t)i&&i(o,r)}};export{s as default};
@@ -0,0 +1 @@
1
+ import t from"../common/_object.js";import e from"../common/_root.js";import n from"../common/internal/nodeTypes.js";var r="[object Function]",o="[object GeneratorFunction]",i="[object AsyncFunction]",c=9007199254740991;const u=/^(?:0|[1-9]\d*)$/,s=e?.Buffer?.isBuffer,f=/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)Array\]$/,a=n&&n.isTypedArray;function l(t){const e=typeof t;return null!=t&&("object"==e||"function"==e)}function y(t){return null!=t&&"object"==typeof t}const p=Array.isArray;function b(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=c}(t.length)&&!j(t)}function g(t){return y(t)&&b(t)}function j(e){var n=l(e)?t.getTag(e):"";return n===r||n===o||n===i}function m(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Object.prototype)}function O(e){return g(e)&&t.hasOwnProperty.call(e,"callee")&&(!t.propertyIsEnumerable.call(e,"callee")||"[object Arguments]"==t.toString.call(e))}const A="undefined"!=typeof window&&void 0!==window.document,d="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,T=a?t=>a(t):e=>y(e)&&f.test(t.getTag(e)),P="function"==typeof s?s:()=>!1;var B={is:function(e,n){return t.getTag(e)===`[object ${n}]`},isNumber:function(e){return"[object Number]"===t.getTag(e)},isString:function(e){return"string"==typeof e||!p(e)&&y(e)&&"[object String]"==t.getTag(e)},isObject:l,isObjectLike:y,isPlainObject:function(e){if(!y(e)||"[object Object]"!=t.getTag(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n},isSymbol:function(e){return"symbol"==typeof e||y(e)&&"[object Symbol]"===t.getTag(e)},isFunction:j,isArray:p,isArrayLikeObject:g,isIndex:function(t,e){return!!(e=null==e?c:e)&&("number"==typeof t||u.test(t))&&t>-1&&t%1==0&&t<e},isArrayLike:b,isPrototype:m,isArguments:O,isPromise:function(e){return"[object Promise]"===(l(e)?t.getTag(e):"")},isBrowser:A,isNode:d,isBlobOrBuffer:t=>t instanceof Blob||t instanceof ArrayBuffer,isUint8Array:t=>t instanceof Uint8Array,isArrayBuffer:t=>t instanceof ArrayBuffer,isEmpty:e=>{if(null==e)return!0;if(b(e)&&(Array.isArray(e)||"string"==typeof e||"function"==typeof e.splice||P(e)||T(e)||O(e)))return!e.length;const n=t.getTag(e);if("[object Map]"===n||"[object Set]"===n)return!e.size;if(m(e))return!Object.keys(e).length;for(const n in e)if(t.hasOwnProperty.call(e,n))return!1;return!0}};export{B as default};
@@ -0,0 +1 @@
1
+ import t from"./is.js";const e=NaN,r=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,f=1/0,u=17976931348623157e292;function c(f){if("number"==typeof f)return f;if(t.isSymbol(f))return e;if(t.isObject(f)){const e="function"==typeof f.valueOf?f.valueOf():f;f=t.isObject(e)?e+"":e}if("string"!=typeof f)return 0===f?f:+f;f=f.replace(r,"");const u=i.test(f);return u||o.test(f)?s(f.slice(2),u?2:8):n.test(f)?e:+f}function a(t){return t?(t=c(t))===f||t===-f?(t<0?-1:1)*u:t==t?t:0:0===t?t:0}var p={toNumber:c,toFinite:a,toInteger:function(t){var e=a(t),r=e%1;return e==e?r?e-r:e:0}};export{p as default};
@@ -22,5 +22,6 @@ declare const _default: {
22
22
  legacyCopy: (text: string) => boolean;
23
23
  takeHtmlLinks: (htmlContent: string) => never[];
24
24
  takeHtml: (htmlContent: string, regex: RegExp) => string[];
25
+ toBlobUrl: (part: BlobPart, mime: "application/javascript") => string;
25
26
  };
26
27
  export default _default;
@@ -46,5 +46,14 @@ declare const _default: {
46
46
  join: (...args: string[]) => string;
47
47
  shExpMatch: (text: string, pattern: string) => boolean;
48
48
  isLocalIpAddress: (addr: string) => boolean;
49
+ parseFileUrl: (url: string) => {
50
+ href: string;
51
+ file: string;
52
+ url: string;
53
+ protocol: string;
54
+ host: string;
55
+ query: string;
56
+ params: {};
57
+ };
49
58
  };
50
59
  export default _default;
@@ -0,0 +1,185 @@
1
+ declare const dHook: {
2
+ qs: {
3
+ parse: (qs: any, { sep, eq, max, multiple, uri, parseNumber, parseBoolean }?: {
4
+ sep?: string | undefined;
5
+ eq?: string | undefined;
6
+ max?: number | undefined;
7
+ multiple?: boolean | undefined;
8
+ uri?: boolean | undefined;
9
+ parseNumber?: boolean | undefined;
10
+ parseBoolean?: boolean | undefined;
11
+ }) => {};
12
+ stringify: (obj: any, { sep, eq, name, uri, cleanZero, cleanNull, cleanWhitespace }?: {
13
+ sep?: string | undefined;
14
+ eq?: string | undefined;
15
+ name?: null | undefined;
16
+ uri?: boolean | undefined;
17
+ cleanZero?: boolean | undefined;
18
+ cleanNull?: boolean | undefined;
19
+ cleanWhitespace?: boolean | undefined;
20
+ }) => string;
21
+ https: (url: string) => string;
22
+ parseUrl: (url: string) => {
23
+ pathname: string;
24
+ params: {};
25
+ route: string;
26
+ page: string;
27
+ name: string;
28
+ withoutExtension: string;
29
+ extname: string;
30
+ href: string;
31
+ url: string;
32
+ origin: string;
33
+ host: string;
34
+ protocol: string;
35
+ port: string;
36
+ query: string;
37
+ };
38
+ parsePath: (url: string) => {
39
+ route: string;
40
+ page: string;
41
+ name: string;
42
+ withoutExtension: string;
43
+ extname: string;
44
+ };
45
+ parseHost: (url: string) => import("..").Ddan.IHttpHost;
46
+ join: (...args: string[]) => string;
47
+ shExpMatch: (text: string, pattern: string) => boolean;
48
+ isLocalIpAddress: (addr: string) => boolean;
49
+ parseFileUrl: (url: string) => {
50
+ href: string;
51
+ file: string;
52
+ url: string;
53
+ protocol: string;
54
+ host: string;
55
+ query: string;
56
+ params: {};
57
+ };
58
+ };
59
+ singleton: <T>() => {
60
+ new (): {};
61
+ __instance__: any;
62
+ readonly Instance: T;
63
+ readonly I: T;
64
+ };
65
+ getset: <T_1 = any>(t?: T_1 | undefined) => import("..").Ddan.IGetset<T_1>;
66
+ random: (max: number) => number;
67
+ randomRange: (min: number, max: number) => number;
68
+ lerp: (start: number, end: number, t: number) => number;
69
+ randoms: (max: number, count?: number, repeat?: boolean) => number[];
70
+ strip: (num: string | number, digits?: number) => number;
71
+ float: (num: string | number, { digits, fixed }?: {
72
+ digits?: number | undefined;
73
+ fixed?: boolean | undefined;
74
+ }) => number;
75
+ radian2degree: (radians: number) => number;
76
+ degree2radian: (degrees: number) => number;
77
+ calcDataSize: (data: number) => {
78
+ gb: number;
79
+ mb: number;
80
+ kb: number;
81
+ b: number;
82
+ total: number;
83
+ desc: string;
84
+ };
85
+ toString: (value: any) => any;
86
+ startCase: (string: any) => any;
87
+ snakeCase: (string: any) => any;
88
+ kebabCase: (string: any) => any;
89
+ camelCase: (string: any) => any;
90
+ upperCase: (string: any) => any;
91
+ upperFirst: (string: any) => any;
92
+ lowerCase: (string: any) => any;
93
+ lowerFirst: (string: any) => any;
94
+ splitOnFirst: (string: any, separator: any) => string[];
95
+ parseValue: (value?: any, { number, boolean }?: {
96
+ number?: boolean | undefined;
97
+ boolean?: boolean | undefined;
98
+ }) => any;
99
+ replace: (source: string, rules: import("..").Ddan.IRegexRule | import("..").Ddan.IRegexRule[]) => string;
100
+ jsonFormat: (jsonString: string) => string;
101
+ toLines: (content: string, separator?: string | RegExp) => string[];
102
+ sleep: (ms?: number) => Promise<unknown>;
103
+ run: <T_2 = any>(task?: import("..").Ddan.PFunction<T_2> | undefined, wait?: number) => Promise<[any, undefined] | [null, T_2]>;
104
+ exec: (func: import("..").Ddan.Function, taskId?: string) => import("..").Ddan.PSafeResult<any>;
105
+ debounce: typeof import("../modules/hook/modules/debounce").default;
106
+ throttle: typeof import("../modules/hook/modules/throttle").default;
107
+ task: (param?: import("..").Ddan.Func1<any, any> | undefined) => import("../class/pipeTask").default;
108
+ mutex: typeof import("../modules/hook/modules/mutex").default;
109
+ polling: typeof import("../modules/hook/modules/polling").default;
110
+ pipe: (func: import("..").Ddan.Function, callback?: ((result: import("..").Ddan.SafeResult<any>) => void) | undefined) => import("../modules/hook/modules/pipeline").default;
111
+ pipeline: (max?: number) => import("../modules/hook/modules/pipeline").default;
112
+ safeTask: (func: import("..").Ddan.Function, callback?: ((result: import("..").Ddan.SafeResult<any>) => void) | undefined) => import("../modules/hook/modules/safeTask").default;
113
+ bezier1: (p0: import("..").Ddan.IPoint, p1: import("..").Ddan.IPoint, t: number) => import("..").Ddan.IPoint;
114
+ bezier2: (p0: import("..").Ddan.IPoint, p1: import("..").Ddan.IPoint, p2: import("..").Ddan.IPoint, t: number) => import("..").Ddan.IPoint;
115
+ bezier3: (p0: import("..").Ddan.IPoint, p1: import("..").Ddan.IPoint, p2: import("..").Ddan.IPoint, p3: import("..").Ddan.IPoint, t: number) => import("..").Ddan.IPoint;
116
+ bezier: (points: import("..").Ddan.IPoint[], t: number) => import("..").Ddan.IPoint;
117
+ bezierCurve: (points: import("..").Ddan.IPoint[], t: number) => import("..").Ddan.IPoint;
118
+ lerpAverage: (points: import("..").Ddan.IPoint[], step: number, type?: "" | "lerp") => number;
119
+ proportion: (start: number, end: number, current: number) => number;
120
+ logString: (data: any) => string;
121
+ logParse: (logStr: string) => string;
122
+ logRString: (data: any) => Promise<string>;
123
+ logRParse: (logStr: string) => Promise<string>;
124
+ to: <T_3 = any, U extends object = any>(promise: Promise<T_3>, errorExt?: object | undefined, fn?: import("..").Ddan.noop | undefined) => Promise<[null, T_3] | [U, undefined]>;
125
+ go: <T_4 = any>(task?: import("..").Ddan.PFunction<T_4> | undefined, fn?: import("..").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_4]>;
126
+ delay: (ms?: number) => Promise<unknown>;
127
+ safeRun: <T_5 = any>(func: any, fn?: import("..").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_5]>;
128
+ toError: (value: any) => any;
129
+ timeout: <T_6 = any>(task?: import("..").Ddan.PFunction<T_6> | undefined, ms?: number, desc?: string) => Promise<[any, undefined] | [null, T_6]>;
130
+ base64: {
131
+ encode: (input: string) => string;
132
+ decode: (base64Str: string) => string;
133
+ encodeByOss: (input: string) => string;
134
+ };
135
+ tea: {
136
+ TEAKey: string;
137
+ encrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
138
+ decrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
139
+ toTeaKey: (str: string) => Uint32Array;
140
+ encode: (plaintext: string, key: string) => string;
141
+ decode: (ciphertext: string, key: string) => string;
142
+ encodeBytes: (plainbytes: Uint8Array, key: string) => Uint8Array;
143
+ decodeBytes: (cipherbytes: Uint8Array, key: string) => Uint8Array;
144
+ };
145
+ uuid: (len?: number, radix?: number) => string;
146
+ guid: (len: number, prefix?: boolean, sep?: string) => string;
147
+ getHexString: (len: number) => string;
148
+ keyNumber: string;
149
+ keyLower: string;
150
+ keyUpper: string;
151
+ keyChars: string;
152
+ str2ab: (content?: string, base64?: boolean) => ArrayBuffer;
153
+ ab2str: (data: ArrayBuffer, base64?: boolean) => string;
154
+ utf8ToBase64: (str: string) => string;
155
+ base64ToUtf8: (base64Str: string) => string;
156
+ getRandomBytes: (length: number) => Uint8Array;
157
+ textEncode: (text: string) => Uint8Array;
158
+ textDecode: (buf: ArrayBufferLike) => string;
159
+ toDataUrl: (textOrBuf: string | ArrayBuffer, contentType?: string) => string;
160
+ md5: (input: string | Uint8Array) => string;
161
+ md5Base64: (input: string | Uint8Array) => string;
162
+ toBase64: (input?: string) => string;
163
+ fromBase64: (input?: string) => string;
164
+ bytesToBase64: (bytes: Uint8Array) => string;
165
+ base64ToBytes: (input?: string) => Uint8Array;
166
+ toUtf8: (content: string) => string;
167
+ fromUtf8: (utftext: string) => string;
168
+ toUtf8Bytes: (content: string) => Uint8Array;
169
+ fromUtf8Bytes: (utf8Bytes: Uint8Array) => string;
170
+ pkcs7Padding: (plaintext: Uint8Array, blockSize: number) => Uint8Array;
171
+ pkcs7Unpadding: (ciphertext: Uint8Array) => Uint8Array;
172
+ bytes2str: (bytes: Uint8Array) => string;
173
+ str2bytes: (str?: string) => Uint8Array;
174
+ str2hex: (str: string) => string;
175
+ hex2str: (hexstr: string) => string;
176
+ concatBytes: (...args: Uint8Array[]) => Uint8Array;
177
+ uint32ToBytes: (uint32: Uint32Array) => Uint8Array;
178
+ bytesToUint32: (bytes: Uint8Array) => Uint32Array;
179
+ hex2bytes: (hex: string) => Uint8Array;
180
+ bytes2hex: (bytes: Uint8Array) => string;
181
+ toUint32: (str: string) => Uint32Array;
182
+ fromUint32: (uint32: Uint32Array) => string;
183
+ flatten: <T_7>(data: T_7[], recursive?: boolean, list?: T_7[]) => T_7[];
184
+ };
185
+ export default dHook;
@@ -0,0 +1,9 @@
1
+ import Store from '../class/store';
2
+ import Persist from '../class/persist';
3
+ declare const dStore: {
4
+ Store: typeof Store;
5
+ storeRef: (source: import("..").Ddan.IDStore, persistConfig?: import("..").Ddan.IDPersistConfig | undefined) => any;
6
+ Persist: typeof Persist;
7
+ persistConfig: (key: string, fields: string[], storage: import("..").Ddan.IStorage) => import("..").Ddan.IDPersistConfig;
8
+ };
9
+ export default dStore;