@x-oasis/layout-equal 0.0.7

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.
@@ -0,0 +1,2 @@
1
+ import { ItemLayout } from "./types";
2
+ export default function layoutEqual(oldLayout: ItemLayout, newLayout: ItemLayout): boolean;
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+
2
+ 'use strict'
3
+
4
+ if (process.env.NODE_ENV === 'production') {
5
+ module.exports = require('./layout-equal.cjs.production.min.js')
6
+ } else {
7
+ module.exports = require('./layout-equal.cjs.development.js')
8
+ }
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ function layoutEqual(oldLayout, newLayout) {
6
+ var oldLayoutType = Object.prototype.toString.call(oldLayout);
7
+ var newLayoutType = Object.prototype.toString.call(newLayout);
8
+ if (oldLayoutType === newLayoutType && newLayoutType === '[object Object]') {
9
+ var keys = ['x', 'y', 'height', 'width'];
10
+ for (var index = 0; index < keys.length; index++) {
11
+ var key = keys[index];
12
+ if (oldLayout[key] !== newLayout[key]) {
13
+ return false;
14
+ }
15
+ }
16
+ return true;
17
+ }
18
+ return false;
19
+ }
20
+
21
+ exports.default = layoutEqual;
22
+ //# sourceMappingURL=layout-equal.cjs.development.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-equal.cjs.development.js","sources":["../src/index.ts"],"sourcesContent":["import { ItemLayout } from \"./types\";\n\nexport default function layoutEqual(oldLayout: ItemLayout, newLayout: ItemLayout) {\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 const keys = ['x', 'y', 'height', 'width'];\n for (let index = 0; index < keys.length; index++) {\n const key = keys[index];\n if (oldLayout[key] !== newLayout[key]) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}"],"names":["layoutEqual","oldLayout","newLayout","oldLayoutType","Object","prototype","toString","call","newLayoutType","keys","index","length","key"],"mappings":";;;;SAEwBA,WAAWA,CAACC,SAAqB,EAAEC,SAAqB;EAC9E,IAAMC,aAAa,GAAGC,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACN,SAAS,CAAC;EAC/D,IAAMO,aAAa,GAAGJ,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACL,SAAS,CAAC;EAE/D,IAAIC,aAAa,KAAKK,aAAa,IAAIA,aAAa,KAAK,iBAAiB,EAAE;IAC1E,IAAMC,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC;IAC1C,KAAK,IAAIC,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGD,IAAI,CAACE,MAAM,EAAED,KAAK,EAAE,EAAE;MAChD,IAAME,GAAG,GAAGH,IAAI,CAACC,KAAK,CAAC;MACvB,IAAIT,SAAS,CAACW,GAAG,CAAC,KAAKV,SAAS,CAACU,GAAG,CAAC,EAAE;QACrC,OAAO,KAAK;;;IAIhB,OAAO,IAAI;;EAGb,OAAO,KAAK;AACd;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(t,e){var r=Object.prototype.toString.call(t),o=Object.prototype.toString.call(e);if(r===o&&"[object Object]"===o){for(var c=["x","y","height","width"],i=0;i<c.length;i++){var n=c[i];if(t[n]!==e[n])return!1}return!0}return!1};
2
+ //# sourceMappingURL=layout-equal.cjs.production.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-equal.cjs.production.min.js","sources":["../src/index.ts"],"sourcesContent":["import { ItemLayout } from \"./types\";\n\nexport default function layoutEqual(oldLayout: ItemLayout, newLayout: ItemLayout) {\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 const keys = ['x', 'y', 'height', 'width'];\n for (let index = 0; index < keys.length; index++) {\n const key = keys[index];\n if (oldLayout[key] !== newLayout[key]) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}"],"names":["oldLayout","newLayout","oldLayoutType","Object","prototype","toString","call","newLayoutType","keys","index","length","key"],"mappings":"6FAEoCA,EAAuBC,GACzD,IAAMC,EAAgBC,OAAOC,UAAUC,SAASC,KAAKN,GAC/CO,EAAgBJ,OAAOC,UAAUC,SAASC,KAAKL,GAErD,GAAIC,IAAkBK,GAAmC,oBAAlBA,EAAqC,CAE1E,IADA,IAAMC,EAAO,CAAC,IAAK,IAAK,SAAU,SACzBC,EAAQ,EAAGA,EAAQD,EAAKE,OAAQD,IAAS,CAChD,IAAME,EAAMH,EAAKC,GACjB,GAAIT,EAAUW,KAASV,EAAUU,GAC/B,OAAO,EAIX,OAAO,EAGT,OAAO"}
@@ -0,0 +1,18 @@
1
+ function layoutEqual(oldLayout, newLayout) {
2
+ var oldLayoutType = Object.prototype.toString.call(oldLayout);
3
+ var newLayoutType = Object.prototype.toString.call(newLayout);
4
+ if (oldLayoutType === newLayoutType && newLayoutType === '[object Object]') {
5
+ var keys = ['x', 'y', 'height', 'width'];
6
+ for (var index = 0; index < keys.length; index++) {
7
+ var key = keys[index];
8
+ if (oldLayout[key] !== newLayout[key]) {
9
+ return false;
10
+ }
11
+ }
12
+ return true;
13
+ }
14
+ return false;
15
+ }
16
+
17
+ export default layoutEqual;
18
+ //# sourceMappingURL=layout-equal.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-equal.esm.js","sources":["../src/index.ts"],"sourcesContent":["import { ItemLayout } from \"./types\";\n\nexport default function layoutEqual(oldLayout: ItemLayout, newLayout: ItemLayout) {\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 const keys = ['x', 'y', 'height', 'width'];\n for (let index = 0; index < keys.length; index++) {\n const key = keys[index];\n if (oldLayout[key] !== newLayout[key]) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}"],"names":["layoutEqual","oldLayout","newLayout","oldLayoutType","Object","prototype","toString","call","newLayoutType","keys","index","length","key"],"mappings":"SAEwBA,WAAWA,CAACC,SAAqB,EAAEC,SAAqB;EAC9E,IAAMC,aAAa,GAAGC,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACN,SAAS,CAAC;EAC/D,IAAMO,aAAa,GAAGJ,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACL,SAAS,CAAC;EAE/D,IAAIC,aAAa,KAAKK,aAAa,IAAIA,aAAa,KAAK,iBAAiB,EAAE;IAC1E,IAAMC,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC;IAC1C,KAAK,IAAIC,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGD,IAAI,CAACE,MAAM,EAAED,KAAK,EAAE,EAAE;MAChD,IAAME,GAAG,GAAGH,IAAI,CAACC,KAAK,CAAC;MACvB,IAAIT,SAAS,CAACW,GAAG,CAAC,KAAKV,SAAS,CAACU,GAAG,CAAC,EAAE;QACrC,OAAO,KAAK;;;IAIhB,OAAO,IAAI;;EAGb,OAAO,KAAK;AACd;;;;"}
@@ -0,0 +1,6 @@
1
+ export declare type ItemLayout = {
2
+ x: number;
3
+ y: number;
4
+ width: number;
5
+ height: number;
6
+ };
package/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { default as layoutEqual } from './src'
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@x-oasis/layout-equal",
3
+ "version": "0.0.7",
4
+ "description": "select value function",
5
+ "main": "dist/index.js",
6
+ "typings": "dist/index.d.ts",
7
+ "module": "dist/layout-equal.esm.js",
8
+ "author": "",
9
+ "license": "ISC",
10
+ "devDependencies": {
11
+ "tsdx": "^0.14.1"
12
+ },
13
+ "scripts": {
14
+ "build": "tsdx build --tsconfig tsconfig.build.json",
15
+ "clean": "rimraf ./dist",
16
+ "test": "vitest",
17
+ "compile": "tsc -p tsconfig.build.json"
18
+ }
19
+ }
package/src/index.ts ADDED
@@ -0,0 +1,20 @@
1
+ import { ItemLayout } from "./types";
2
+
3
+ export default function layoutEqual(oldLayout: ItemLayout, newLayout: ItemLayout) {
4
+ const oldLayoutType = Object.prototype.toString.call(oldLayout);
5
+ const newLayoutType = Object.prototype.toString.call(newLayout);
6
+
7
+ if (oldLayoutType === newLayoutType && newLayoutType === '[object Object]') {
8
+ const keys = ['x', 'y', 'height', 'width'];
9
+ for (let index = 0; index < keys.length; index++) {
10
+ const key = keys[index];
11
+ if (oldLayout[key] !== newLayout[key]) {
12
+ return false;
13
+ }
14
+ }
15
+
16
+ return true;
17
+ }
18
+
19
+ return false;
20
+ }
package/src/types.ts ADDED
@@ -0,0 +1,6 @@
1
+ export type ItemLayout = {
2
+ x: number;
3
+ y: number;
4
+ width: number;
5
+ height: number;
6
+ };
@@ -0,0 +1,5 @@
1
+ import { expect, test } from 'vitest'
2
+
3
+ test('vitest', async () => {
4
+ expect('vitest').toBe('vitest')
5
+ })
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "../../../tsconfig.build.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "esModuleInterop": true
6
+ },
7
+
8
+ "include": [
9
+ "src/**/*"
10
+ ]
11
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "jsx": "react",
5
+ "esModuleInterop": true
6
+ }
7
+ }