@fanpian/js-handle
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -177,2 +177,5 @@ module.exports = | ||
__webpack_require__.d(__webpack_exports__, "utils", function() { return /* reexport */ library_utils; }); | ||
__webpack_require__.d(__webpack_exports__, "validate", function() { return /* reexport */ library_validate; }); | ||
__webpack_require__.d(__webpack_exports__, "IpValidateType", function() { return /* reexport */ IpValidateType; }); | ||
__webpack_require__.d(__webpack_exports__, "PhoneValidateType", function() { return /* reexport */ PhoneValidateType; }); | ||
@@ -730,2 +733,4 @@ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js | ||
/* harmony default export */ var src_0 = ({ | ||
@@ -732,0 +737,0 @@ validate: library_validate, |
@@ -186,2 +186,5 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
__webpack_require__.d(__webpack_exports__, "utils", function() { return /* reexport */ library_utils; }); | ||
__webpack_require__.d(__webpack_exports__, "validate", function() { return /* reexport */ library_validate; }); | ||
__webpack_require__.d(__webpack_exports__, "IpValidateType", function() { return /* reexport */ IpValidateType; }); | ||
__webpack_require__.d(__webpack_exports__, "PhoneValidateType", function() { return /* reexport */ PhoneValidateType; }); | ||
@@ -739,2 +742,4 @@ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js | ||
/* harmony default export */ var src_0 = ({ | ||
@@ -741,0 +746,0 @@ validate: library_validate, |
@@ -1,2 +0,2 @@ | ||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["js-handle"]=t():e["js-handle"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({8875:function(e,t,n){var r,o,i;(function(n,a){o=[],r=a,i="function"===typeof r?r.apply(t,o):r,void 0===i||(e.exports=i)})("undefined"!==typeof self&&self,(function(){function e(){if(document.currentScript)return document.currentScript;try{throw new Error}catch(l){var e,t,n,r=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,o=/@([^@]*):(\d+):(\d+)\s*$/gi,i=r.exec(l.stack)||o.exec(l.stack),a=i&&i[1]||!1,d=i&&i[2]||!1,u=document.location.href.replace(document.location.hash,""),f=document.getElementsByTagName("script");a===u&&(e=document.documentElement.outerHTML,t=new RegExp("(?:[^\\n]+?\\n){0,"+(d-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),n=e.replace(t,"$1").trim());for(var c=0;c<f.length;c++){if("interactive"===f[c].readyState)return f[c];if(f[c].src===a)return f[c];if(a===u&&f[c].innerHTML&&f[c].innerHTML.trim()===n)return f[c]}return null}}return e}))},fb15:function(e,t,n){"use strict";if(n.r(t),n.d(t,"utils",(function(){return Q})),"undefined"!==typeof window){var r=window.document.currentScript,o=n("8875");r=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var i=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var a,d;(function(e){e[e["sober"]=0]="sober",e[e["loose"]=1]="loose",e[e["mostLoose"]=2]="mostLoose"})(a||(a={})),function(e){e[e["v4"]=0]="v4",e[e["v6"]=1]="v6",e[e["v4_or_v6"]=2]="v4_or_v6"}(d||(d={}));var u=function(e,t){return e.test(t)},f=u,c=/^[1-9]\d{9,29}$/,l=/\d{3}-\d{8}|\d{4}-\d{7}/,s=/^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$/,p=/^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-7|9])|(?:5[0-3|5-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[1|8|9]))\d{8}$/,v=/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,m=/^(?:(?:\+|00)86)?1\d{10}$/,b=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,h=/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i,y=/^((([a-f0-9]{2}:){5})|(([a-f0-9]{2}-){5}))[a-f0-9]{2}$/i,A=/[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/g,F={card_no:c,fixed_phone:l,id_card:s,sober_phone:p,loose_phone:v,most_loose_phone:m,ip_v4:b,ip_v6:h,mac:y,email:A},w={validate:function(e){return f(c,e)}},T=w,g={validate:function(e){return f(l,e)}},_=g,x={validate:function(e){return f(s,e)}},j=x,$={validate:function(e,t){var n=a[t||a.sober];return n===a[a.sober]?p.test(e):n===a[a.loose]?v.test(e):n===a[a.mostLoose]?m.test(e):p.test(e)}},S=$,O={validate:function(e,t){var n=d[t||d.v4];return n===d[d.v4]?b.test(e):n===d[d.v6]?h.test(e):b.test(e)||h.test(e)}},P=O,E={validate:function(e){return f(A,e)}},N=E,C={validate:function(e){return f(y,e)}},M=C,L={cardNo:T,fixedPhone:_,idCard:j,phone:S,ip:P,email:N,mac:M},U=L;function k(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var B=function e(){k(this,e),this.idFrom="id",this.idTo="id",this.labelFrom="name",this.labelTo="name",this.childTo="children",this.parentFrom="parentId",this.parentTo="parentId",this.deleteEmptyChildrenAttr=!1,this.deleteNodes=new Array,this.disabledNodes=new Array,this.rootParentVal=[void 0,null,0]},H=function(e,t){var n=e.filter((function(e){return t.deleteNodes.some((function(n){return n!==e[t.idFrom]}))}));return n.map((function(e){e[t.idTo]=e[t.idFrom],e[t.labelTo]=e[t.labelFrom],e[t.parentTo]=e[t.parentFrom],e[t.childTo]=[];var n=t.disabledNodes.find((function(n){return n.key===e[t.idTo]}));return n&&(e[n.fieldName]=n.fieldVaule),e}))},V=function e(t,n,r){var o=t.filter((function(e){return e[r.parentTo]===n[r.idTo]}));o.map((function(o){var i=t.some((function(e){return e[r.parentTo]===o[r.idTo]}));i?e(t,o,r):r.deleteEmptyChildrenAttr&&delete o[r.childTo],n[r.childTo].push(o)}))},D=function(e,t){var n=new B,r=Object.assign({},n,t),o=H(e,r);return o.filter((function(e){return r.rootParentVal.includes(e[r.parentTo])})).map((function(e){return V(o,e,r),e}))},I=D,R=I,X=function(e){if(!e)return{};var t=e.match(/([^?=&]+)(=([^&]*))/g)||[];return t.reduce((function(e,t){var n=t.indexOf("="),r=t.slice(0,n),o=t.slice(n+1);return e[r]=o,e}),{})},q=function(e,t){if(!t)return null;var n=X(e);return n[t]},z=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)return new Uint8Array(0);var n=e,r=";base64,";if(t){var o=n.indexOf(r);o>-1&&(n=n.substr(o+r.length))}for(var i=window.atob(n),a=new Uint8Array(i.length),d=0;d<i.length;d++)a[d]=i.charCodeAt(d);return a},G=function(e){for(var t=new Uint8Array(e),n=t.length,r="",o=0;o<n;o++)r=String.fromCharCode(t[o]);return window.btoa(r)},J=function(e,t){return!0},K={regExps:F,arrayToTree:R,getParams:X,getParamByName:q,base64ToUint8Array:z,byteArrayToBase64:G,validate:J},Q=K,W={validate:U,utils:Q};t["default"]=W}})["default"]})); | ||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["js-handle"]=t():e["js-handle"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({8875:function(e,t,n){var r,o,i;(function(n,a){o=[],r=a,i="function"===typeof r?r.apply(t,o):r,void 0===i||(e.exports=i)})("undefined"!==typeof self&&self,(function(){function e(){if(document.currentScript)return document.currentScript;try{throw new Error}catch(l){var e,t,n,r=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,o=/@([^@]*):(\d+):(\d+)\s*$/gi,i=r.exec(l.stack)||o.exec(l.stack),a=i&&i[1]||!1,d=i&&i[2]||!1,u=document.location.href.replace(document.location.hash,""),f=document.getElementsByTagName("script");a===u&&(e=document.documentElement.outerHTML,t=new RegExp("(?:[^\\n]+?\\n){0,"+(d-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),n=e.replace(t,"$1").trim());for(var c=0;c<f.length;c++){if("interactive"===f[c].readyState)return f[c];if(f[c].src===a)return f[c];if(a===u&&f[c].innerHTML&&f[c].innerHTML.trim()===n)return f[c]}return null}}return e}))},fb15:function(e,t,n){"use strict";if(n.r(t),n.d(t,"utils",(function(){return Q})),n.d(t,"validate",(function(){return V})),n.d(t,"IpValidateType",(function(){return d})),n.d(t,"PhoneValidateType",(function(){return a})),"undefined"!==typeof window){var r=window.document.currentScript,o=n("8875");r=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var i=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var a,d;(function(e){e[e["sober"]=0]="sober",e[e["loose"]=1]="loose",e[e["mostLoose"]=2]="mostLoose"})(a||(a={})),function(e){e[e["v4"]=0]="v4",e[e["v6"]=1]="v6",e[e["v4_or_v6"]=2]="v4_or_v6"}(d||(d={}));var u=function(e,t){return e.test(t)},f=u,c=/^[1-9]\d{9,29}$/,l=/\d{3}-\d{8}|\d{4}-\d{7}/,s=/^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$/,p=/^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-7|9])|(?:5[0-3|5-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[1|8|9]))\d{8}$/,v=/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,m=/^(?:(?:\+|00)86)?1\d{10}$/,b=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,h=/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i,y=/^((([a-f0-9]{2}:){5})|(([a-f0-9]{2}-){5}))[a-f0-9]{2}$/i,A=/[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/g,F={card_no:c,fixed_phone:l,id_card:s,sober_phone:p,loose_phone:v,most_loose_phone:m,ip_v4:b,ip_v6:h,mac:y,email:A},T={validate:function(e){return f(c,e)}},w=T,g={validate:function(e){return f(l,e)}},_=g,x={validate:function(e){return f(s,e)}},j=x,$={validate:function(e,t){var n=a[t||a.sober];return n===a[a.sober]?p.test(e):n===a[a.loose]?v.test(e):n===a[a.mostLoose]?m.test(e):p.test(e)}},P=$,S={validate:function(e,t){var n=d[t||d.v4];return n===d[d.v4]?b.test(e):n===d[d.v6]?h.test(e):b.test(e)||h.test(e)}},O=S,E={validate:function(e){return f(A,e)}},N=E,C={validate:function(e){return f(y,e)}},M=C,L={cardNo:w,fixedPhone:_,idCard:j,phone:P,ip:O,email:N,mac:M},V=L;function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var k=function e(){U(this,e),this.idFrom="id",this.idTo="id",this.labelFrom="name",this.labelTo="name",this.childTo="children",this.parentFrom="parentId",this.parentTo="parentId",this.deleteEmptyChildrenAttr=!1,this.deleteNodes=new Array,this.disabledNodes=new Array,this.rootParentVal=[void 0,null,0]},B=function(e,t){var n=e.filter((function(e){return t.deleteNodes.some((function(n){return n!==e[t.idFrom]}))}));return n.map((function(e){e[t.idTo]=e[t.idFrom],e[t.labelTo]=e[t.labelFrom],e[t.parentTo]=e[t.parentFrom],e[t.childTo]=[];var n=t.disabledNodes.find((function(n){return n.key===e[t.idTo]}));return n&&(e[n.fieldName]=n.fieldVaule),e}))},H=function e(t,n,r){var o=t.filter((function(e){return e[r.parentTo]===n[r.idTo]}));o.map((function(o){var i=t.some((function(e){return e[r.parentTo]===o[r.idTo]}));i?e(t,o,r):r.deleteEmptyChildrenAttr&&delete o[r.childTo],n[r.childTo].push(o)}))},I=function(e,t){var n=new k,r=Object.assign({},n,t),o=B(e,r);return o.filter((function(e){return r.rootParentVal.includes(e[r.parentTo])})).map((function(e){return H(o,e,r),e}))},D=I,R=D,X=function(e){if(!e)return{};var t=e.match(/([^?=&]+)(=([^&]*))/g)||[];return t.reduce((function(e,t){var n=t.indexOf("="),r=t.slice(0,n),o=t.slice(n+1);return e[r]=o,e}),{})},q=function(e,t){if(!t)return null;var n=X(e);return n[t]},z=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)return new Uint8Array(0);var n=e,r=";base64,";if(t){var o=n.indexOf(r);o>-1&&(n=n.substr(o+r.length))}for(var i=window.atob(n),a=new Uint8Array(i.length),d=0;d<i.length;d++)a[d]=i.charCodeAt(d);return a},G=function(e){for(var t=new Uint8Array(e),n=t.length,r="",o=0;o<n;o++)r=String.fromCharCode(t[o]);return window.btoa(r)},J=function(e,t){return!0},K={regExps:F,arrayToTree:R,getParams:X,getParamByName:q,base64ToUint8Array:z,byteArrayToBase64:G,validate:J},Q=K,W={validate:V,utils:Q};t["default"]=W}})["default"]})); | ||
//# sourceMappingURL=js-handle.umd.min.js.map |
export { default as utils } from './library/utils'; | ||
export { default as validate } from './library/validate'; | ||
export { IpValidateType, PhoneValidateType } from './library/utils/validate'; | ||
declare const _default: { | ||
@@ -3,0 +5,0 @@ validate: { |
@@ -1,7 +0,1 @@ | ||
/** | ||
* 验证方法 | ||
*/ | ||
interface ValidateMethod { | ||
(reg: RegExp, value: string): boolean; | ||
} | ||
export interface Validate { | ||
@@ -77,3 +71,3 @@ /** | ||
*/ | ||
declare const validate: ValidateMethod; | ||
declare const validate: (reg: RegExp, value: string) => boolean; | ||
export default validate; |
{ | ||
"name": "@fanpian/js-handle", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "js-handle的操作库", | ||
@@ -5,0 +5,0 @@ "author": { |
import validate from './library/validate'; | ||
import utils from './library/utils'; | ||
export { default as utils } from './library/utils'; | ||
export { default as validate } from './library/validate'; | ||
export { IpValidateType, PhoneValidateType } from './library/utils/validate'; | ||
@@ -5,0 +8,0 @@ export default { |
@@ -1,8 +0,1 @@ | ||
/** | ||
* 验证方法 | ||
*/ | ||
interface ValidateMethod { | ||
(reg: RegExp, value: string): boolean; | ||
} | ||
export interface Validate { | ||
@@ -87,3 +80,3 @@ /** | ||
*/ | ||
const validate: ValidateMethod = (reg: RegExp, value: string) => { | ||
const validate = (reg: RegExp, value: string) => { | ||
return reg.test(value); | ||
@@ -90,0 +83,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
178045
2176