UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

49 lines (48 loc) 1.28 kB
import { SYNAPSE_ENTITY_ID_REGEX as p } from "../../../utils/functions/RegularExpressions.js"; const a = "__rowKey", m = (n) => { const e = n.trim(); if (e) { if (e.toUpperCase().startsWith("SELECT")) return { type: "sql", input: e }; if (p.test(e)) return { type: "recordSetId", input: e }; if (/^[A-Za-z]\w*=+$/.test(e)) return { type: "sessionId", input: e }; } else return { type: "empty", input: "" }; return { type: "unknown", input: e }; }; function f(n, e) { const r = Object.keys(n), u = Object.keys(e); if (r.length !== u.length) return !1; for (const t of r) { const o = n[t], i = e[t], l = (s) => s == null || s === ""; if (!(l(o) && l(i)) && String(o) !== String(i)) return !1; } return !0; } function I(n, e, r) { function u(t) { if (t.type === "UPDATE") { const o = e.slice( t.fromRowIndex, t.toRowIndex ), i = n.slice( t.fromRowIndex, t.toRowIndex ); return o.map( (s, c) => f(s, i[c]) ).every(Boolean); } return !1; } return r.filter((t) => !u(t)); } export { a as GRID_ROW_REACT_KEY_PROPERTY, m as parseQueryInput, I as removeNoOpOperations, f as rowsAreIdentical }; //# sourceMappingURL=DataGridUtils.js.map