New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@formily/shared

Package Overview
Dependencies
Maintainers
2
Versions
243
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formily/shared - npm Package Compare versions

Comparing version 2.0.0-beta.22 to 2.0.0-beta.23

23

dist/formily.shared.umd.development.js

@@ -8,11 +8,6 @@ (function (global, factory) {

var isType = function (type) { return function (obj) {
return obj != null &&
(Array.isArray(type) ? type : [type]).some(function (t) { return getType(obj) === "[object " + t + "]"; });
return getType(obj) === "[object " + type + "]";
}; };
var getType = function (obj) { return Object.prototype.toString.call(obj); };
var isFn = isType([
'Function',
'AsyncFunction',
'GeneratorFunction',
]);
var isFn = function (val) { return typeof val === 'function'; };
var isArr = Array.isArray;

@@ -23,6 +18,12 @@ var isPlainObj = isType('Object');

var isNum = isType('Number');
var isMap = isType('Map');
var isSet = isType('Set');
var isWeakMap = isType('WeakMap');
var isWeakSet = isType('WeakSet');
var isMap = function (val) {
return val && val instanceof Map;
};
var isSet = function (val) { return val && val instanceof Set; };
var isWeakMap = function (val) {
return val && val instanceof WeakMap;
};
var isWeakSet = function (val) {
return val && val instanceof WeakSet;
};
var isNumberLike = function (index) {

@@ -29,0 +30,0 @@ return isNum(index) || /^\d+$/.test(index);

@@ -1,2 +0,2 @@

!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((r="undefined"!=typeof globalThis?globalThis:r||self).Formily=r.Formily||{},r.Formily.Shared={}))}(this,(function(r){"use strict";var e=function(r){return function(e){return null!=e&&(Array.isArray(r)?r:[r]).some((function(r){return t(e)==="[object "+r+"]"}))}},t=function(r){return Object.prototype.toString.call(r)},n=e(["Function","AsyncFunction","GeneratorFunction"]),o=Array.isArray,i=e("Object"),u=e("String"),c=e("Boolean"),f=e("Number"),a=e("Map"),s=e("Set"),l=e("WeakMap"),p=e("WeakSet"),y=function(r){return"object"==typeof r},b=e("RegExp");function d(r,e,t){if(o(r)||u(r)){if(t){for(var n=r.length-1;n>=0;n--)if(!1===e(r[n],n))return}else for(n=0;n<r.length;n++)if(!1===e(r[n],n))return}else if(y(r)){var i=void 0;for(i in r)if(Object.hasOwnProperty.call(r,i)&&!1===e(r[i],i))return}}function g(r,e,t){var n=!1;return d(r,(function(r,t){if(e(r,t))return n=!0,!1}),t),n}var h=function(){try{if("undefined"!=typeof self)return self}catch(r){}try{if("undefined"!=typeof window)return window}catch(r){}try{if("undefined"!=typeof global)return global}catch(r){}return Function("return this")()}(),O=function(r,e){return n(e)?r instanceof e:!!u(e)&&(!!h[e]&&r instanceof h[e])},v=o,m=Object.keys,S=Object.prototype.hasOwnProperty;function j(r,e){if(r===e)return!0;if(r&&e&&"object"==typeof r&&"object"==typeof e){var t,n=v(r),o=v(e),i=void 0,u=void 0;if(n&&o){if((t=r.length)!==e.length)return!1;for(i=t;0!=i--;)if(!j(r[i],e[i]))return!1;return!0}if(n!==o)return!1;var c=r&&r._isAMomentObject,f=e&&e._isAMomentObject;if(c!==f)return!1;if(c&&f)return r.isSame(e);var a=r&&r.toJS;if(a!==(e&&e.toJS))return!1;if(a)return r.is?r.is(e):r===e;var s=O(r,"Date"),l=O(e,"Date");if(s!==l)return!1;if(s&&l)return r.getTime()===e.getTime();var p=O(r,"RegExp"),y=O(e,"RegExp");if(p!==y)return!1;if(p&&y)return r.toString()===e.toString();var b=O(r,"URL"),d=O(e,"URL");if(b!==d)return!1;if(b&&d)return r.href===e.href;var g=r&&r.toJSON,h=e&&e.toJSON;if(g!==h)return!1;if(g&&h)return j(r.toJSON(),e.toJSON());var E=m(r);if((t=E.length)!==m(e).length)return!1;for(i=t;0!=i--;)if(!S.call(e,E[i]))return!1;for(i=t;0!=i--;)if(!("_owner"===(u=E[i])&&r.$$typeof||j(r[u],e[u])))return!1;return!0}return r!=r&&e!=e}var E=function(){return(E=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}).apply(this,arguments)},A=function(r){if(Array.isArray(r)){var e=[];return r.forEach((function(r){e.push(A(r))})),e}if(i(r)){if("$$typeof"in r&&"_owner"in r)return r;if(r._isAMomentObject)return r;if(r._isJSONSchemaObject)return r;if(n(r.toJS))return r.toJS();if(n(r.toJSON))return r.toJSON();var t={};for(var o in r)Object.hasOwnProperty.call(r,o)&&(t[o]=A(r[o]));return t}return r},w=Object.prototype.hasOwnProperty,R=Object.prototype.toString,M=function(r){return null!=r};
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(((r="undefined"!=typeof globalThis?globalThis:r||self).Formily=r.Formily||{},r.Formily.Shared={}))}(this,(function(r){"use strict";var t=function(r){return function(t){return e(t)==="[object "+r+"]"}},e=function(r){return Object.prototype.toString.call(r)},n=function(r){return"function"==typeof r},o=Array.isArray,i=t("Object"),u=t("String"),c=t("Boolean"),f=t("Number"),a=function(r){return"object"==typeof r},s=t("RegExp");function l(r,t,e){if(o(r)||u(r)){if(e){for(var n=r.length-1;n>=0;n--)if(!1===t(r[n],n))return}else for(n=0;n<r.length;n++)if(!1===t(r[n],n))return}else if(a(r)){var i=void 0;for(i in r)if(Object.hasOwnProperty.call(r,i)&&!1===t(r[i],i))return}}function p(r,t,e){var n=!1;return l(r,(function(r,e){if(t(r,e))return n=!0,!1}),e),n}var y=function(){try{if("undefined"!=typeof self)return self}catch(r){}try{if("undefined"!=typeof window)return window}catch(r){}try{if("undefined"!=typeof global)return global}catch(r){}return Function("return this")()}(),b=function(r,t){return n(t)?r instanceof t:!!u(t)&&(!!y[t]&&r instanceof y[t])},d=o,g=Object.keys,h=Object.prototype.hasOwnProperty;function O(r,t){if(r===t)return!0;if(r&&t&&"object"==typeof r&&"object"==typeof t){var e,n=d(r),o=d(t),i=void 0,u=void 0;if(n&&o){if((e=r.length)!==t.length)return!1;for(i=e;0!=i--;)if(!O(r[i],t[i]))return!1;return!0}if(n!==o)return!1;var c=r&&r._isAMomentObject,f=t&&t._isAMomentObject;if(c!==f)return!1;if(c&&f)return r.isSame(t);var a=r&&r.toJS;if(a!==(t&&t.toJS))return!1;if(a)return r.is?r.is(t):r===t;var s=b(r,"Date"),l=b(t,"Date");if(s!==l)return!1;if(s&&l)return r.getTime()===t.getTime();var p=b(r,"RegExp"),y=b(t,"RegExp");if(p!==y)return!1;if(p&&y)return r.toString()===t.toString();var v=b(r,"URL"),m=b(t,"URL");if(v!==m)return!1;if(v&&m)return r.href===t.href;var S=r&&r.toJSON,j=t&&t.toJSON;if(S!==j)return!1;if(S&&j)return O(r.toJSON(),t.toJSON());var E=g(r);if((e=E.length)!==g(t).length)return!1;for(i=e;0!=i--;)if(!h.call(t,E[i]))return!1;for(i=e;0!=i--;)if(!("_owner"===(u=E[i])&&r.$$typeof||O(r[u],t[u])))return!1;return!0}return r!=r&&t!=t}var v=function(){return(v=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r}).apply(this,arguments)},m=function(r){if(Array.isArray(r)){var t=[];return r.forEach((function(r){t.push(m(r))})),t}if(i(r)){if("$$typeof"in r&&"_owner"in r)return r;if(r._isAMomentObject)return r;if(r._isJSONSchemaObject)return r;if(n(r.toJS))return r.toJS();if(n(r.toJSON))return r.toJSON();var e={};for(var o in r)Object.hasOwnProperty.call(r,o)&&(e[o]=m(r[o]));return e}return r},S=Object.prototype.hasOwnProperty,j=Object.prototype.toString,E=function(r){return null!=r};
/*! *****************************************************************************

@@ -15,2 +15,2 @@ Copyright (c) Microsoft Corporation.

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function P(r){if(null==r)return!0;if("boolean"==typeof r)return!1;if("number"==typeof r)return!1;if("string"==typeof r)return 0===r.length;if("function"==typeof r)return 0===r.length;if(Array.isArray(r)){if(0===r.length)return!0;for(var e=0;e<r.length;e++)if(void 0!==r[e]&&null!==r[e]&&""!==r[e]&&0!==r[e])return!1;return!0}if(O(r,"Error"))return""===r.message;if(r.toString===R)switch(r.toString()){case"[object File]":case"[object Map]":case"[object Set]":return 0===r.size;case"[object Object]":for(var t in r)if(w.call(r,t))return!1;return!0}return!1}function N(r){return r.toLowerCase()}var x=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],C=/[^A-Z0-9]+/gi;function T(r,e){void 0===e&&(e={});for(var t=e.splitRegexp,n=void 0===t?x:t,o=e.stripRegexp,i=void 0===o?C:o,u=e.transform,c=void 0===u?N:u,f=e.delimiter,a=void 0===f?" ":f,s=L(L(r,n,"$1\0$2"),i,"\0"),l=0,p=s.length;"\0"===s.charAt(l);)l++;for(;"\0"===s.charAt(p-1);)p--;return s.slice(l,p).split("\0").map(c).join(a)}function L(r,e,t){return e instanceof RegExp?r.replace(e,t):e.reduce((function(r,e){return r.replace(e,t)}),r)}function J(r,e){var t=r.charAt(0),n=r.substr(1).toLowerCase();return e>0&&t>="0"&&t<="9"?"_"+t+n:""+t.toUpperCase()+n}function F(r,e){return void 0===e&&(e={}),T(r,E({delimiter:"",transform:J},e))}function $(r,e){return 0===e?r.toLowerCase():J(r,e)}var _="[\ud800-\udbff][\udc00-\udfff]",I=function(r){return"string"==typeof r?r.replace((e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),new RegExp(e,"g")),""):r;var e};const k=Formily.Path.Path;var D={};var U=function(){var r=this;this.subscribers={index:0},this.subscribe=function(e){if(n(e)){var t=r.subscribers.index+1;return r.subscribers[t]=e,r.subscribers.index++,t}},this.unsubscribe=function(e){r.subscribers[e]?delete r.subscribers[e]:e||(r.subscribers={index:0})},this.notify=function(e,t){r.subscription&&r.subscription&&n(r.subscription.notify)&&!1===r.subscription.notify.call(r,e)||t||d(r.subscribers,(function(t){n(t)&&t(function(e){return r.subscription&&n(r.subscription.filter)?r.subscription.filter.call(r,e):e}(e))}))}};function W(r){return function(r){return!!r&&"object"==typeof r}(r)&&!function(r){var e=Object.prototype.toString.call(r);return"[object RegExp]"===e||"[object Date]"===e||function(r){return r.$$typeof===G}(r)}(r)}var G="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Z(r,e){return!1!==e.clone&&e.isMergeableObject(r)?H((t=r,Array.isArray(t)?[]:{}),r,e):r;var t}function B(r,e,t){return r.concat(e).map((function(r){return Z(r,t)}))}function z(r){return M(r)?Object.keys(r).concat(function(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter((function(e){return r.propertyIsEnumerable(e)})):[]}(r)):[]}function K(r,e){try{return e in r}catch(r){return!1}}function q(r,e,t){var n=t.assign&&r||{};return t.isMergeableObject(r)?(t.assign||z(r).forEach((function(e){n[e]=Z(r[e],t)})),z(e).forEach((function(o){(function(r,e){return K(r,e)&&!(Object.hasOwnProperty.call(r,e)&&Object.propertyIsEnumerable.call(r,e))})(r,o)||(r[o]||(n[o]=e[o]),K(r,o)&&t.isMergeableObject(e[o])?n[o]=function(r,e){if(!e.customMerge)return H;var t=e.customMerge(r);return"function"==typeof t?t:H}(o,t)(r[o],e[o],t):n[o]=Z(e[o],t))})),n):r}function H(r,e,t){(t=t||{}).arrayMerge=t.arrayMerge||B,t.isMergeableObject=t.isMergeableObject||W,t.cloneUnlessOtherwiseSpecified=Z;var n=Array.isArray(e);return n===Array.isArray(r)?n?t.arrayMerge(r,e,t):q(r,e,t):Z(e,t)}var X,V=H,Y=function(r){return!((null==(e=r)?void 0:e._owner)&&(null==e?void 0:e.$$typeof)||(null==e?void 0:e._isAMomentObject)||(null==e?void 0:e._isJSONSchemaObject)||(null==e?void 0:e.toJS)||(null==e?void 0:e.toJSON))&&"object"==typeof r;var e},Q=function(r,e){if(t(r)===t(e)&&Y(r)&&Y(e)){var n=o(r)?[]:{};return d(e,(function(e,t){n[t]=Q(r[t],e)})),d(r,(function(r,e){M(n[e])||(n[e]=r)})),n}return P(e)?r:e};!function(r){r.DEBUG="debug",r.ERROR="error",r.INFO="info",r.LOG="log",r.WARN="warn",r.DIR="dir",r.DIRXML="dirxml",r.TABLE="table",r.TRACE="trace",r.GROUP="group",r.GROUPCOLLAPSED="groupCollapsed",r.GROUPEND="groupEnd",r.CLEAR="clear",r.COUNT="count",r.COUNTRESET="countReset",r.ASSERT="assert",r.PROFILE="profile",r.PROFILEEND="profileEnd",r.TIME="time",r.TIMELOG="timeLog",r.TIMEEND="timeEnd",r.TIMESTAMP="timeStamp",r.CONTEXT="context",r.MEMORY="memory",r.TIPS="tips"}(X||(X={}));for(var rr=new(function(){function r(r){this.keyword="APP",this.keyword=r}return r.prototype.getKeyWordStyle=function(r){return"[ "+this.keyword+" "+r+" ]: "},r.prototype.callConsole=function(r,e,t){var n={content:e,keyword:this.keyword},o=console,i=this.getKeyWordStyle(r);return o[r]&&o[r](i,e),t&&(n.tips=t,o.info(this.getKeyWordStyle(X.TIPS),t)),n},r.prototype.log=function(r){return this.callConsole(X.LOG,r)},r.prototype.warn=function(r,e){return this.callConsole(X.WARN,r,e)},r.prototype.error=function(r,e){return this.callConsole(X.ERROR,r,e)},r.prototype.info=function(r){return this.callConsole(X.INFO,r)},r}())("Formily"),er=36,tr="";er--;)tr+=er.toString(36);r.FormPath=k,r.Subscribable=U,r.camelCase=function(r,e){return void 0===e&&(e={}),F(r,E({transform:$},e))},r.clone=A,r.defaults=Q,r.deprecate=function r(e,t,o){if(n(e))return function(n,i,u,c,f){return r(t,o),e.apply(this,arguments)};u(e)&&!D[e]&&(D[e]=!0,console.warn(new Error(e+" has been deprecated. Do not continue to use this api."+(t||""))))},r.each=d,r.every=function(r,e,t){var n=!0;return d(r,(function(r,t){if(!e(r,t))return n=!1,!1}),t),n},r.find=function(r,e,t){var n;return d(r,(function(r,t){if(e(r,t))return n=r,!1}),t),n},r.findIndex=function(r,e,t){var n=-1;return d(r,(function(r,t){if(e(r,t))return n=t,!1}),t),n},r.getType=t,r.globalThisPolyfill=h,r.includes=function(r,e,t){return u(r)?r.includes(e):g(r,(function(r){return r===e}),t)},r.instOf=O,r.isArr=o,r.isBool=c,r.isEmpty=P,r.isEqual=function(r,e){try{return j(r,e)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||-2146828260===r.number)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}},r.isFn=n,r.isHTMLElement=function(r){return Object.prototype.toString.call(r).indexOf("HTML")>-1},r.isMap=a,r.isNum=f,r.isNumberLike=function(r){return f(r)||/^\d+$/.test(r)},r.isObj=y,r.isPlainObj=i,r.isReactElement=function(r){return r&&r.$$typeof&&r._owner},r.isRegExp=b,r.isSet=s,r.isStr=u,r.isValid=M,r.isWeakMap=l,r.isWeakSet=p,r.log=rr,r.lowerCase=N,r.map=function(r,e,t){var n=o(r)||u(r)?[]:{};return d(r,(function(r,t){var i=e(r,t);o(n)?n.push(i):n[t]=i}),t),n},r.merge=V,r.paramCase=function(r,e){return void 0===e&&(e={}),function(r,e){return void 0===e&&(e={}),T(r,E({delimiter:"."},e))}(r,E({delimiter:"-"},e))},r.pascalCase=F,r.reduce=function(r,e,t,n){var o=t;return d(r,(function(r,t){o=e(o,r,t)}),n),o},r.shallowClone=function(r){return Array.isArray(r)?r.slice(0):i(r)?"$$typeof"in r&&"_owner"in r||r._isAMomentObject||r._isJSONSchemaObject||n(r.toJS)||n(r.toJSON)?r:E({},r):"object"==typeof r?new r.constructor(r):r},r.some=g,r.stringLength=function(r){return I(r).replace(e&&e.exact?new RegExp("^"+_+"$"):new RegExp(_,"g")," ").length;var e},r.toArr=function(r){return o(r)?r:r?[r]:[]},r.uid=function(r){for(var e="",t=r||11;t--;)e+=tr[36*Math.random()|0];return e},r.upperCase=function(r){return r.toUpperCase()},Object.defineProperty(r,"__esModule",{value:!0})}));
***************************************************************************** */function w(r){if(null==r)return!0;if("boolean"==typeof r)return!1;if("number"==typeof r)return!1;if("string"==typeof r)return 0===r.length;if("function"==typeof r)return 0===r.length;if(Array.isArray(r)){if(0===r.length)return!0;for(var t=0;t<r.length;t++)if(void 0!==r[t]&&null!==r[t]&&""!==r[t]&&0!==r[t])return!1;return!0}if(b(r,"Error"))return""===r.message;if(r.toString===j)switch(r.toString()){case"[object File]":case"[object Map]":case"[object Set]":return 0===r.size;case"[object Object]":for(var e in r)if(S.call(r,e))return!1;return!0}return!1}function A(r){return r.toLowerCase()}var R=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],M=/[^A-Z0-9]+/gi;function P(r,t){void 0===t&&(t={});for(var e=t.splitRegexp,n=void 0===e?R:e,o=t.stripRegexp,i=void 0===o?M:o,u=t.transform,c=void 0===u?A:u,f=t.delimiter,a=void 0===f?" ":f,s=N(N(r,n,"$1\0$2"),i,"\0"),l=0,p=s.length;"\0"===s.charAt(l);)l++;for(;"\0"===s.charAt(p-1);)p--;return s.slice(l,p).split("\0").map(c).join(a)}function N(r,t,e){return t instanceof RegExp?r.replace(t,e):t.reduce((function(r,t){return r.replace(t,e)}),r)}function x(r,t){var e=r.charAt(0),n=r.substr(1).toLowerCase();return t>0&&e>="0"&&e<="9"?"_"+e+n:""+e.toUpperCase()+n}function C(r,t){return void 0===t&&(t={}),P(r,v({delimiter:"",transform:x},t))}function T(r,t){return 0===t?r.toLowerCase():x(r,t)}var L="[\ud800-\udbff][\udc00-\udfff]",J=function(r){return"string"==typeof r?r.replace((t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),new RegExp(t,"g")),""):r;var t};const $=Formily.Path.Path;var _={};var I=function(){var r=this;this.subscribers={index:0},this.subscribe=function(t){if(n(t)){var e=r.subscribers.index+1;return r.subscribers[e]=t,r.subscribers.index++,e}},this.unsubscribe=function(t){r.subscribers[t]?delete r.subscribers[t]:t||(r.subscribers={index:0})},this.notify=function(t,e){r.subscription&&r.subscription&&n(r.subscription.notify)&&!1===r.subscription.notify.call(r,t)||e||l(r.subscribers,(function(e){n(e)&&e(function(t){return r.subscription&&n(r.subscription.filter)?r.subscription.filter.call(r,t):t}(t))}))}};function k(r){return function(r){return!!r&&"object"==typeof r}(r)&&!function(r){var t=Object.prototype.toString.call(r);return"[object RegExp]"===t||"[object Date]"===t||function(r){return r.$$typeof===F}(r)}(r)}var F="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function D(r,t){return!1!==t.clone&&t.isMergeableObject(r)?B((e=r,Array.isArray(e)?[]:{}),r,t):r;var e}function U(r,t,e){return r.concat(t).map((function(r){return D(r,e)}))}function W(r){return E(r)?Object.keys(r).concat(function(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter((function(t){return r.propertyIsEnumerable(t)})):[]}(r)):[]}function G(r,t){try{return t in r}catch(r){return!1}}function Z(r,t,e){var n=e.assign&&r||{};return e.isMergeableObject(r)?(e.assign||W(r).forEach((function(t){n[t]=D(r[t],e)})),W(t).forEach((function(o){(function(r,t){return G(r,t)&&!(Object.hasOwnProperty.call(r,t)&&Object.propertyIsEnumerable.call(r,t))})(r,o)||(r[o]||(n[o]=t[o]),G(r,o)&&e.isMergeableObject(t[o])?n[o]=function(r,t){if(!t.customMerge)return B;var e=t.customMerge(r);return"function"==typeof e?e:B}(o,e)(r[o],t[o],e):n[o]=D(t[o],e))})),n):r}function B(r,t,e){(e=e||{}).arrayMerge=e.arrayMerge||U,e.isMergeableObject=e.isMergeableObject||k,e.cloneUnlessOtherwiseSpecified=D;var n=Array.isArray(t);return n===Array.isArray(r)?n?e.arrayMerge(r,t,e):Z(r,t,e):D(t,e)}var z,K=B,q=function(r){return!((null==(t=r)?void 0:t._owner)&&(null==t?void 0:t.$$typeof)||(null==t?void 0:t._isAMomentObject)||(null==t?void 0:t._isJSONSchemaObject)||(null==t?void 0:t.toJS)||(null==t?void 0:t.toJSON))&&"object"==typeof r;var t},H=function(r,t){if(e(r)===e(t)&&q(r)&&q(t)){var n=o(r)?[]:{};return l(t,(function(t,e){n[e]=H(r[e],t)})),l(r,(function(r,t){E(n[t])||(n[t]=r)})),n}return w(t)?r:t};!function(r){r.DEBUG="debug",r.ERROR="error",r.INFO="info",r.LOG="log",r.WARN="warn",r.DIR="dir",r.DIRXML="dirxml",r.TABLE="table",r.TRACE="trace",r.GROUP="group",r.GROUPCOLLAPSED="groupCollapsed",r.GROUPEND="groupEnd",r.CLEAR="clear",r.COUNT="count",r.COUNTRESET="countReset",r.ASSERT="assert",r.PROFILE="profile",r.PROFILEEND="profileEnd",r.TIME="time",r.TIMELOG="timeLog",r.TIMEEND="timeEnd",r.TIMESTAMP="timeStamp",r.CONTEXT="context",r.MEMORY="memory",r.TIPS="tips"}(z||(z={}));for(var X=new(function(){function r(r){this.keyword="APP",this.keyword=r}return r.prototype.getKeyWordStyle=function(r){return"[ "+this.keyword+" "+r+" ]: "},r.prototype.callConsole=function(r,t,e){var n={content:t,keyword:this.keyword},o=console,i=this.getKeyWordStyle(r);return o[r]&&o[r](i,t),e&&(n.tips=e,o.info(this.getKeyWordStyle(z.TIPS),e)),n},r.prototype.log=function(r){return this.callConsole(z.LOG,r)},r.prototype.warn=function(r,t){return this.callConsole(z.WARN,r,t)},r.prototype.error=function(r,t){return this.callConsole(z.ERROR,r,t)},r.prototype.info=function(r){return this.callConsole(z.INFO,r)},r}())("Formily"),V=36,Y="";V--;)Y+=V.toString(36);r.FormPath=$,r.Subscribable=I,r.camelCase=function(r,t){return void 0===t&&(t={}),C(r,v({transform:T},t))},r.clone=m,r.defaults=H,r.deprecate=function r(t,e,o){if(n(t))return function(n,i,u,c,f){return r(e,o),t.apply(this,arguments)};u(t)&&!_[t]&&(_[t]=!0,console.warn(new Error(t+" has been deprecated. Do not continue to use this api."+(e||""))))},r.each=l,r.every=function(r,t,e){var n=!0;return l(r,(function(r,e){if(!t(r,e))return n=!1,!1}),e),n},r.find=function(r,t,e){var n;return l(r,(function(r,e){if(t(r,e))return n=r,!1}),e),n},r.findIndex=function(r,t,e){var n=-1;return l(r,(function(r,e){if(t(r,e))return n=e,!1}),e),n},r.getType=e,r.globalThisPolyfill=y,r.includes=function(r,t,e){return u(r)?r.includes(t):p(r,(function(r){return r===t}),e)},r.instOf=b,r.isArr=o,r.isBool=c,r.isEmpty=w,r.isEqual=function(r,t){try{return O(r,t)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||-2146828260===r.number)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}},r.isFn=n,r.isHTMLElement=function(r){return Object.prototype.toString.call(r).indexOf("HTML")>-1},r.isMap=function(r){return r&&r instanceof Map},r.isNum=f,r.isNumberLike=function(r){return f(r)||/^\d+$/.test(r)},r.isObj=a,r.isPlainObj=i,r.isReactElement=function(r){return r&&r.$$typeof&&r._owner},r.isRegExp=s,r.isSet=function(r){return r&&r instanceof Set},r.isStr=u,r.isValid=E,r.isWeakMap=function(r){return r&&r instanceof WeakMap},r.isWeakSet=function(r){return r&&r instanceof WeakSet},r.log=X,r.lowerCase=A,r.map=function(r,t,e){var n=o(r)||u(r)?[]:{};return l(r,(function(r,e){var i=t(r,e);o(n)?n.push(i):n[e]=i}),e),n},r.merge=K,r.paramCase=function(r,t){return void 0===t&&(t={}),function(r,t){return void 0===t&&(t={}),P(r,v({delimiter:"."},t))}(r,v({delimiter:"-"},t))},r.pascalCase=C,r.reduce=function(r,t,e,n){var o=e;return l(r,(function(r,e){o=t(o,r,e)}),n),o},r.shallowClone=function(r){return Array.isArray(r)?r.slice(0):i(r)?"$$typeof"in r&&"_owner"in r||r._isAMomentObject||r._isJSONSchemaObject||n(r.toJS)||n(r.toJSON)?r:v({},r):"object"==typeof r?new r.constructor(r):r},r.some=p,r.stringLength=function(r){return J(r).replace(t&&t.exact?new RegExp("^"+L+"$"):new RegExp(L,"g")," ").length;var t},r.toArr=function(r){return o(r)?r:r?[r]:[]},r.uid=function(r){for(var t="",e=r||11;e--;)t+=Y[36*Math.random()|0];return t},r.upperCase=function(r){return r.toUpperCase()},Object.defineProperty(r,"__esModule",{value:!0})}));
/// <reference types="react" />
export declare const getType: (obj: any) => any;
export declare const isFn: (obj: unknown) => obj is (...args: any[]) => any;
export declare const isFn: (val: any) => val is Function;
export declare const isArr: (arg: any) => arg is any[];

@@ -9,6 +9,6 @@ export declare const isPlainObj: (obj: unknown) => obj is object;

export declare const isNum: (obj: unknown) => obj is number;
export declare const isMap: (obj: unknown) => obj is unknown;
export declare const isSet: (obj: unknown) => obj is unknown;
export declare const isWeakMap: (obj: unknown) => obj is unknown;
export declare const isWeakSet: (obj: unknown) => obj is unknown;
export declare const isMap: (val: any) => val is Map<any, any>;
export declare const isSet: (val: any) => val is Set<any>;
export declare const isWeakMap: (val: any) => val is WeakMap<any, any>;
export declare const isWeakSet: (val: any) => val is WeakSet<any>;
export declare const isNumberLike: (index: any) => index is number;

@@ -15,0 +15,0 @@ export declare const isObj: (val: unknown) => val is object;

var isType = function (type) { return function (obj) {
return obj != null &&
(Array.isArray(type) ? type : [type]).some(function (t) { return getType(obj) === "[object " + t + "]"; });
return getType(obj) === "[object " + type + "]";
}; };
export var getType = function (obj) { return Object.prototype.toString.call(obj); };
export var isFn = isType([
'Function',
'AsyncFunction',
'GeneratorFunction',
]);
export var isFn = function (val) { return typeof val === 'function'; };
export var isArr = Array.isArray;

@@ -16,6 +11,12 @@ export var isPlainObj = isType('Object');

export var isNum = isType('Number');
export var isMap = isType('Map');
export var isSet = isType('Set');
export var isWeakMap = isType('WeakMap');
export var isWeakSet = isType('WeakSet');
export var isMap = function (val) {
return val && val instanceof Map;
};
export var isSet = function (val) { return val && val instanceof Set; };
export var isWeakMap = function (val) {
return val && val instanceof WeakMap;
};
export var isWeakSet = function (val) {
return val && val instanceof WeakSet;
};
export var isNumberLike = function (index) {

@@ -22,0 +23,0 @@ return isNum(index) || /^\d+$/.test(index);

/// <reference types="react" />
export declare const getType: (obj: any) => any;
export declare const isFn: (obj: unknown) => obj is (...args: any[]) => any;
export declare const isFn: (val: any) => val is Function;
export declare const isArr: (arg: any) => arg is any[];

@@ -9,6 +9,6 @@ export declare const isPlainObj: (obj: unknown) => obj is object;

export declare const isNum: (obj: unknown) => obj is number;
export declare const isMap: (obj: unknown) => obj is unknown;
export declare const isSet: (obj: unknown) => obj is unknown;
export declare const isWeakMap: (obj: unknown) => obj is unknown;
export declare const isWeakSet: (obj: unknown) => obj is unknown;
export declare const isMap: (val: any) => val is Map<any, any>;
export declare const isSet: (val: any) => val is Set<any>;
export declare const isWeakMap: (val: any) => val is WeakMap<any, any>;
export declare const isWeakSet: (val: any) => val is WeakSet<any>;
export declare const isNumberLike: (index: any) => index is number;

@@ -15,0 +15,0 @@ export declare const isObj: (val: unknown) => val is object;

@@ -5,12 +5,8 @@ "use strict";

var isType = function (type) { return function (obj) {
return obj != null &&
(Array.isArray(type) ? type : [type]).some(function (t) { return exports.getType(obj) === "[object " + t + "]"; });
return exports.getType(obj) === "[object " + type + "]";
}; };
var getType = function (obj) { return Object.prototype.toString.call(obj); };
exports.getType = getType;
exports.isFn = isType([
'Function',
'AsyncFunction',
'GeneratorFunction',
]);
var isFn = function (val) { return typeof val === 'function'; };
exports.isFn = isFn;
exports.isArr = Array.isArray;

@@ -21,6 +17,16 @@ exports.isPlainObj = isType('Object');

exports.isNum = isType('Number');
exports.isMap = isType('Map');
exports.isSet = isType('Set');
exports.isWeakMap = isType('WeakMap');
exports.isWeakSet = isType('WeakSet');
var isMap = function (val) {
return val && val instanceof Map;
};
exports.isMap = isMap;
var isSet = function (val) { return val && val instanceof Set; };
exports.isSet = isSet;
var isWeakMap = function (val) {
return val && val instanceof WeakMap;
};
exports.isWeakMap = isWeakMap;
var isWeakSet = function (val) {
return val && val instanceof WeakSet;
};
exports.isWeakSet = isWeakSet;
var isNumberLike = function (index) {

@@ -27,0 +33,0 @@ return exports.isNum(index) || /^\d+$/.test(index);

{
"name": "@formily/shared",
"version": "2.0.0-beta.22",
"version": "2.0.0-beta.23",
"license": "MIT",

@@ -26,3 +26,3 @@ "main": "lib",

},
"gitHead": "97d93d06afb25805b714a3542736a2bd2a7172ad",
"gitHead": "d27724774e9629076fe53444bf456b7c322432cf",
"scripts": {

@@ -38,3 +38,3 @@ "build": "rimraf -rf lib esm dist && npm run build:cjs && npm run build:esm && npm run build:umd",

"dependencies": {
"@formily/path": "^2.0.0-beta.22",
"@formily/path": "^2.0.0-beta.23",
"camel-case": "^4.1.1",

@@ -41,0 +41,0 @@ "lower-case": "^2.0.1",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc