react-node-key
Advanced tools
Comparing version
@@ -191,3 +191,3 @@ 'use strict'; | ||
var nodeKey = _get(fiberNode, 'pendingProps._nk'); | ||
var nodeKey = _get(fiberNode, 'memoizedProps._nk') || _get(fiberNode, 'pendingProps._nk'); | ||
@@ -194,0 +194,0 @@ var isArray = _isString(nodeKey) && isArrReg.test(nodeKey); |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("szfe-tools/lib/run"),require("react"),require("szfe-tools/lib/isFunction"),require("szfe-tools/lib/isString"),require("szfe-tools/lib/get")):"function"==typeof define&&define.amd?define(["exports","szfe-tools/lib/run","react","szfe-tools/lib/isFunction","szfe-tools/lib/isString","szfe-tools/lib/get"],e):e((t=t||self).ReactNodeKey={},t._run,t.react,t._isFunction,t._isString,t._get)}(this,function(t,c,n,i,a,u){"use strict";function f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function l(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function y(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function b(i){var c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e,r,n,o=s(i);return e=c?(t=s(this).constructor,Reflect.construct(o,arguments,t)):o.apply(this,arguments),r=this,!(n=e)||"object"!=typeof n&&"function"!=typeof n?y(r):n}}function d(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function e(){var r=0,n=new Map;return function(t){var e=n.get(t);return e||(e=(++r).toString(32),n.set(t,e)),e}}c=c&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c,i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i,a=a&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a,u=u&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u;function v(t){var e,r,n,o=O(u(t,"type.$$typeof",t.type)),i=(r=u(e=t,"key")||e.index,n=u(e,"pendingProps._nk"),a(n)&&g.test(n)?"".concat(n,".").concat(r):n||r);return"".concat(o,",").concat(i)}function h(t){var e,r,n,o=w(t.type),i=(r=u(e=t,"key")||e.index,n=u(e,"props._nk"),a(n)&&j.test(n)?"".concat(n,".").concat(r):n||r);return"".concat(o,",").concat(i)}var _,g=/^iAr/,O=e(),m=function(t,e){var r,n,o=(r=function t(e){return e.return?[e].concat(d(t(e.return))):[e]}(t),n=e,r.map(function(t){var e=v(t);return i(n)?c(n,void 0,t,e):e}).filter(Boolean).join("|"));return O(o)},j=/^iAr/,w=e(),P=function(t,e){var r,n,o=(r=function t(e){return e.__?[e].concat(d(t(e.__))):[e]}(t),n=e,r.map(function(t){var e=h(t);return i(n)?c(n,void 0,t,e):e}).filter(Boolean).join("|"));return w(o)},r=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}(i,n.Component);var t,e,r,o=b(i);function i(){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return l(y(r=o.call.apply(o,[this].concat(e))),"key",null),l(y(r),"genKey",function(t){switch(_||((r._reactInternalFiber||r._reactInternals)&&(_="React"),r.__v&&(_="Preact")),_){case"Preact":r.key=P(r.__v,t);break;case"React":var e=r._reactInternalFiber||r._reactInternals;r.key=m(e,t)}return r.key}),r}return t=i,(e=[{key:"render",value:function(){var t=this.props,e=t.children,r=t.prefix,n=t.onHandleNode;return c(e,void 0,"".concat(r).concat(this.key||this.genKey(n)))}}])&&f(t.prototype,e),r&&f(t,r),i}();l(r,"defaultProps",{onHandleNode:void 0,prefix:""}),t.default=r,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("szfe-tools/lib/run"),require("react"),require("szfe-tools/lib/isFunction"),require("szfe-tools/lib/isString"),require("szfe-tools/lib/get")):"function"==typeof define&&define.amd?define(["exports","szfe-tools/lib/run","react","szfe-tools/lib/isFunction","szfe-tools/lib/isString","szfe-tools/lib/get"],e):e((t=t||self).ReactNodeKey={},t._run,t.react,t._isFunction,t._isString,t._get)}(this,function(t,c,n,i,a,u){"use strict";function f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function l(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function y(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d(i){var c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e,r,n,o=s(i);return e=c?(t=s(this).constructor,Reflect.construct(o,arguments,t)):o.apply(this,arguments),r=this,!(n=e)||"object"!=typeof n&&"function"!=typeof n?y(r):n}}function b(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function e(){var r=0,n=new Map;return function(t){var e=n.get(t);return e||(e=(++r).toString(32),n.set(t,e)),e}}c=c&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c,i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i,a=a&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a,u=u&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u;function v(t){var e,r,n,o=m(u(t,"type.$$typeof",t.type)),i=(r=u(e=t,"key")||e.index,n=u(e,"memoizedProps._nk")||u(e,"pendingProps._nk"),a(n)&&g.test(n)?"".concat(n,".").concat(r):n||r);return"".concat(o,",").concat(i)}function h(t){var e,r,n,o=w(t.type),i=(r=u(e=t,"key")||e.index,n=u(e,"props._nk"),a(n)&&j.test(n)?"".concat(n,".").concat(r):n||r);return"".concat(o,",").concat(i)}var _,g=/^iAr/,m=e(),O=function(t,e){var r,n,o=(r=function t(e){return e.return?[e].concat(b(t(e.return))):[e]}(t),n=e,r.map(function(t){var e=v(t);return i(n)?c(n,void 0,t,e):e}).filter(Boolean).join("|"));return m(o)},j=/^iAr/,w=e(),P=function(t,e){var r,n,o=(r=function t(e){return e.__?[e].concat(b(t(e.__))):[e]}(t),n=e,r.map(function(t){var e=h(t);return i(n)?c(n,void 0,t,e):e}).filter(Boolean).join("|"));return w(o)},r=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}(i,n.Component);var t,e,r,o=d(i);function i(){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return l(y(r=o.call.apply(o,[this].concat(e))),"key",null),l(y(r),"genKey",function(t){switch(_||((r._reactInternalFiber||r._reactInternals)&&(_="React"),r.__v&&(_="Preact")),_){case"Preact":r.key=P(r.__v,t);break;case"React":var e=r._reactInternalFiber||r._reactInternals;r.key=O(e,t)}return r.key}),r}return t=i,(e=[{key:"render",value:function(){var t=this.props,e=t.children,r=t.prefix,n=t.onHandleNode;return c(e,void 0,"".concat(r).concat(this.key||this.genKey(n)))}}])&&f(t.prototype,e),r&&f(t,r),i}();l(r,"defaultProps",{onHandleNode:void 0,prefix:""}),t.default=r,Object.defineProperty(t,"__esModule",{value:!0})}); |
{ | ||
"name": "react-node-key", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Automatic key-marked for React nodes, generate an unique identifier by render location", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
34510
0.39%