{"version":3,"file":"guard.mjs","names":[],"sources":["../../../../src/data-grid/style-rules/guard.ts"],"sourcesContent":["/*!\n *\n *  Copyright (c) \"Neo4j\"\n *  Neo4j Sweden AB [http://neo4j.com]\n *\n *  This file is part of Neo4j.\n *\n *  Neo4j is free software: you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation, either version 3 of the License, or\n *  (at your option) any later version.\n *\n *  This program is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { DataGridStyleRuleSchema } from './internal/schemas';\nimport type { DataGridStyleRule } from './types';\n\n/**\n * Runtime type guard for {@link DataGridStyleRule}, backed by the internal Zod\n * schema. Narrows an `unknown` value to `DataGridStyleRule` when it is a valid\n * style rule.\n *\n * This lets consumers validate values without taking a dependency on Zod or on\n * our schema export. For example, it can be passed to another validation\n * library's custom check:\n *\n * @example\n * ```ts\n * import { z } from 'zod';\n * import { isDataGridStyleRule, type DataGridStyleRule } from '@neo4j-ndl/react';\n *\n * const formSchema = z.object({\n *   rule: z.custom<DataGridStyleRule>(isDataGridStyleRule),\n *   notes: z.string(),\n * });\n * ```\n */\nexport const isDataGridStyleRule = (\n  value: unknown,\n): value is DataGridStyleRule =>\n  DataGridStyleRuleSchema.safeParse(value).success;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAa,uBACX,UAEA,wBAAwB,UAAU,KAAK,CAAC,CAAC"}