@x-oasis/layout-equal 0.1.13 → 0.1.14
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.
- package/dist/layout-equal.cjs.development.js +2 -3
- package/dist/layout-equal.cjs.development.js.map +1 -1
- package/dist/layout-equal.cjs.production.min.js +1 -1
- package/dist/layout-equal.cjs.production.min.js.map +1 -1
- package/dist/layout-equal.esm.js +2 -3
- package/dist/layout-equal.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -3
|
@@ -10,9 +10,8 @@ function layoutEqual(oldLayout, newLayout, keysToCheck) {
|
|
|
10
10
|
var oldLayoutType = Object.prototype.toString.call(oldLayout);
|
|
11
11
|
var newLayoutType = Object.prototype.toString.call(newLayout);
|
|
12
12
|
if (oldLayoutType === newLayoutType && newLayoutType === '[object Object]') {
|
|
13
|
-
for (var index = 0; index <
|
|
14
|
-
var key =
|
|
15
|
-
if (!(key in keysToCheck)) continue;
|
|
13
|
+
for (var index = 0; index < keysToCheck.length; index++) {
|
|
14
|
+
var key = keysToCheck[index];
|
|
16
15
|
if (oldLayout[key] !== newLayout[key]) {
|
|
17
16
|
return false;
|
|
18
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-equal.cjs.development.js","sources":["../src/index.ts"],"sourcesContent":["import { ItemLayout } from './types';\n\nconst KEY_TO_CHECK = ['x', 'y', 'height', 'width'];\n\nexport default function layoutEqual(\n oldLayout: ItemLayout,\n newLayout: ItemLayout,\n // @ts-ignore\n keysToCheck: Array<'x' | 'y' | 'height' | 'width'> = KEY_TO_CHECK\n) {\n const oldLayoutType = Object.prototype.toString.call(oldLayout);\n const newLayoutType = Object.prototype.toString.call(newLayout);\n\n if (oldLayoutType === newLayoutType && newLayoutType === '[object Object]') {\n for (let index = 0; index <
|
|
1
|
+
{"version":3,"file":"layout-equal.cjs.development.js","sources":["../src/index.ts"],"sourcesContent":["import { ItemLayout } from './types';\n\nconst KEY_TO_CHECK = ['x', 'y', 'height', 'width'];\n\nexport default function layoutEqual(\n oldLayout: ItemLayout,\n newLayout: ItemLayout,\n // @ts-ignore\n keysToCheck: Array<'x' | 'y' | 'height' | 'width'> = KEY_TO_CHECK\n) {\n const oldLayoutType = Object.prototype.toString.call(oldLayout);\n const newLayoutType = Object.prototype.toString.call(newLayout);\n\n if (oldLayoutType === newLayoutType && newLayoutType === '[object Object]') {\n for (let index = 0; index < keysToCheck.length; index++) {\n const key = keysToCheck[index];\n if (oldLayout[key] !== newLayout[key]) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}\n"],"names":["KEY_TO_CHECK","layoutEqual","oldLayout","newLayout","keysToCheck","oldLayoutType","Object","prototype","toString","call","newLayoutType","index","length","key"],"mappings":";;;;AAEA,IAAMA,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC;SAE1BC,WAAWA,CACjCC,SAAqB,EACrBC,SAAqB,EAErBC;MAAAA;IAAAA,cAAqDJ,YAAY;;EAEjE,IAAMK,aAAa,GAAGC,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACP,SAAS,CAAC;EAC/D,IAAMQ,aAAa,GAAGJ,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACN,SAAS,CAAC;EAE/D,IAAIE,aAAa,KAAKK,aAAa,IAAIA,aAAa,KAAK,iBAAiB,EAAE;IAC1E,KAAK,IAAIC,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGP,WAAW,CAACQ,MAAM,EAAED,KAAK,EAAE,EAAE;MACvD,IAAME,GAAG,GAAGT,WAAW,CAACO,KAAK,CAAC;MAC9B,IAAIT,SAAS,CAACW,GAAG,CAAC,KAAKV,SAAS,CAACU,GAAG,CAAC,EAAE;QACrC,OAAO,KAAK;;;IAIhB,OAAO,IAAI;;EAGb,OAAO,KAAK;AACd;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=["x","y","height","width"];exports.default=function(e,r,o){void 0===o&&(o=t);var i=Object.prototype.toString.call(e),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=["x","y","height","width"];exports.default=function(e,r,o){void 0===o&&(o=t);var i=Object.prototype.toString.call(e),c=Object.prototype.toString.call(r);if(i===c&&"[object Object]"===c){for(var n=0;n<o.length;n++){var a=o[n];if(e[a]!==r[a])return!1}return!0}return!1};
|
|
2
2
|
//# sourceMappingURL=layout-equal.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-equal.cjs.production.min.js","sources":["../src/index.ts"],"sourcesContent":["import { ItemLayout } from './types';\n\nconst KEY_TO_CHECK = ['x', 'y', 'height', 'width'];\n\nexport default function layoutEqual(\n oldLayout: ItemLayout,\n newLayout: ItemLayout,\n // @ts-ignore\n keysToCheck: Array<'x' | 'y' | 'height' | 'width'> = KEY_TO_CHECK\n) {\n const oldLayoutType = Object.prototype.toString.call(oldLayout);\n const newLayoutType = Object.prototype.toString.call(newLayout);\n\n if (oldLayoutType === newLayoutType && newLayoutType === '[object Object]') {\n for (let index = 0; index <
|
|
1
|
+
{"version":3,"file":"layout-equal.cjs.production.min.js","sources":["../src/index.ts"],"sourcesContent":["import { ItemLayout } from './types';\n\nconst KEY_TO_CHECK = ['x', 'y', 'height', 'width'];\n\nexport default function layoutEqual(\n oldLayout: ItemLayout,\n newLayout: ItemLayout,\n // @ts-ignore\n keysToCheck: Array<'x' | 'y' | 'height' | 'width'> = KEY_TO_CHECK\n) {\n const oldLayoutType = Object.prototype.toString.call(oldLayout);\n const newLayoutType = Object.prototype.toString.call(newLayout);\n\n if (oldLayoutType === newLayoutType && newLayoutType === '[object Object]') {\n for (let index = 0; index < keysToCheck.length; index++) {\n const key = keysToCheck[index];\n if (oldLayout[key] !== newLayout[key]) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}\n"],"names":["KEY_TO_CHECK","oldLayout","newLayout","keysToCheck","oldLayoutType","Object","prototype","toString","call","newLayoutType","index","length","key"],"mappings":"oEAEA,IAAMA,EAAe,CAAC,IAAK,IAAK,SAAU,kCAGxCC,EACAC,EAEAC,YAAAA,IAAAA,EAAqDH,GAErD,IAAMI,EAAgBC,OAAOC,UAAUC,SAASC,KAAKP,GAC/CQ,EAAgBJ,OAAOC,UAAUC,SAASC,KAAKN,GAErD,GAAIE,IAAkBK,GAAmC,oBAAlBA,EAAqC,CAC1E,IAAK,IAAIC,EAAQ,EAAGA,EAAQP,EAAYQ,OAAQD,IAAS,CACvD,IAAME,EAAMT,EAAYO,GACxB,GAAIT,EAAUW,KAASV,EAAUU,GAC/B,OAAO,EAIX,OAAO,EAGT,OAAO"}
|
package/dist/layout-equal.esm.js
CHANGED
|
@@ -6,9 +6,8 @@ function layoutEqual(oldLayout, newLayout, keysToCheck) {
|
|
|
6
6
|
var oldLayoutType = Object.prototype.toString.call(oldLayout);
|
|
7
7
|
var newLayoutType = Object.prototype.toString.call(newLayout);
|
|
8
8
|
if (oldLayoutType === newLayoutType && newLayoutType === '[object Object]') {
|
|
9
|
-
for (var index = 0; index <
|
|
10
|
-
var key =
|
|
11
|
-
if (!(key in keysToCheck)) continue;
|
|
9
|
+
for (var index = 0; index < keysToCheck.length; index++) {
|
|
10
|
+
var key = keysToCheck[index];
|
|
12
11
|
if (oldLayout[key] !== newLayout[key]) {
|
|
13
12
|
return false;
|
|
14
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-equal.esm.js","sources":["../src/index.ts"],"sourcesContent":["import { ItemLayout } from './types';\n\nconst KEY_TO_CHECK = ['x', 'y', 'height', 'width'];\n\nexport default function layoutEqual(\n oldLayout: ItemLayout,\n newLayout: ItemLayout,\n // @ts-ignore\n keysToCheck: Array<'x' | 'y' | 'height' | 'width'> = KEY_TO_CHECK\n) {\n const oldLayoutType = Object.prototype.toString.call(oldLayout);\n const newLayoutType = Object.prototype.toString.call(newLayout);\n\n if (oldLayoutType === newLayoutType && newLayoutType === '[object Object]') {\n for (let index = 0; index <
|
|
1
|
+
{"version":3,"file":"layout-equal.esm.js","sources":["../src/index.ts"],"sourcesContent":["import { ItemLayout } from './types';\n\nconst KEY_TO_CHECK = ['x', 'y', 'height', 'width'];\n\nexport default function layoutEqual(\n oldLayout: ItemLayout,\n newLayout: ItemLayout,\n // @ts-ignore\n keysToCheck: Array<'x' | 'y' | 'height' | 'width'> = KEY_TO_CHECK\n) {\n const oldLayoutType = Object.prototype.toString.call(oldLayout);\n const newLayoutType = Object.prototype.toString.call(newLayout);\n\n if (oldLayoutType === newLayoutType && newLayoutType === '[object Object]') {\n for (let index = 0; index < keysToCheck.length; index++) {\n const key = keysToCheck[index];\n if (oldLayout[key] !== newLayout[key]) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}\n"],"names":["KEY_TO_CHECK","layoutEqual","oldLayout","newLayout","keysToCheck","oldLayoutType","Object","prototype","toString","call","newLayoutType","index","length","key"],"mappings":"AAEA,IAAMA,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC;SAE1BC,WAAWA,CACjCC,SAAqB,EACrBC,SAAqB,EAErBC;MAAAA;IAAAA,cAAqDJ,YAAY;;EAEjE,IAAMK,aAAa,GAAGC,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACP,SAAS,CAAC;EAC/D,IAAMQ,aAAa,GAAGJ,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACN,SAAS,CAAC;EAE/D,IAAIE,aAAa,KAAKK,aAAa,IAAIA,aAAa,KAAK,iBAAiB,EAAE;IAC1E,KAAK,IAAIC,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGP,WAAW,CAACQ,MAAM,EAAED,KAAK,EAAE,EAAE;MACvD,IAAME,GAAG,GAAGT,WAAW,CAACO,KAAK,CAAC;MAC9B,IAAIT,SAAS,CAACW,GAAG,CAAC,KAAKV,SAAS,CAACU,GAAG,CAAC,EAAE;QACrC,OAAO,KAAK;;;IAIhB,OAAO,IAAI;;EAGb,OAAO,KAAK;AACd;;;;"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -12,9 +12,8 @@ export default function layoutEqual(
|
|
|
12
12
|
const newLayoutType = Object.prototype.toString.call(newLayout);
|
|
13
13
|
|
|
14
14
|
if (oldLayoutType === newLayoutType && newLayoutType === '[object Object]') {
|
|
15
|
-
for (let index = 0; index <
|
|
16
|
-
const key =
|
|
17
|
-
if (!(key in keysToCheck)) continue;
|
|
15
|
+
for (let index = 0; index < keysToCheck.length; index++) {
|
|
16
|
+
const key = keysToCheck[index];
|
|
18
17
|
if (oldLayout[key] !== newLayout[key]) {
|
|
19
18
|
return false;
|
|
20
19
|
}
|