{"version":3,"sources":["../../source/schema/groups/integer/integer.ts","../../source/math/math.ts"],"names":["z","INTEGER_SCHEMA","NEGATIVE_INTEGER_SCHEMA","POSITIVE_INTEGER_SCHEMA","validatePositiveInteger","value","fibonacci","number"],"mappings":"AACA,OAAS,KAAAA,MAAS,MAIX,IAAMC,EAAiBD,EAAE,OAAO,EAAE,IAAI,EAChCE,EAA0BF,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EACpDG,EAA0BH,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAU1D,SAASI,EAA0CC,EAAoD,CAC7GF,EAAwB,MAAME,CAAK,CACpC,CChBO,SAASC,EAAUC,EAAwB,CAGjD,OAFAH,EAAwBG,CAAM,EAE1BA,IAAW,GAAKA,IAAW,EACvB,EAGDD,EAAUC,EAAS,CAAC,EAAID,EAAUC,EAAS,CAAC,CACpD","sourcesContent":["import type { Integer, Negative, NonNegative } from \"type-fest/source/numeric\";\nimport { z } from \"zod\";\n\nexport type { Integer } from \"type-fest/source/numeric\";\n\nexport const INTEGER_SCHEMA = z.number().int();\nexport const NEGATIVE_INTEGER_SCHEMA = z.number().int().negative();\nexport const POSITIVE_INTEGER_SCHEMA = z.number().int().positive();\n\nexport function validateInteger<N extends number>(value: N): asserts value is Integer<N> {\n\tINTEGER_SCHEMA.parse(value);\n}\n\nexport function validateNegativeInteger<N extends number>(value: N): asserts value is Negative<Integer<N>> {\n\tNEGATIVE_INTEGER_SCHEMA.parse(value);\n}\n\nexport function validatePositiveInteger<N extends number>(value: N): asserts value is NonNegative<Integer<N>> {\n\tPOSITIVE_INTEGER_SCHEMA.parse(value);\n}\n\nexport function isInteger<N extends number>(value: N): value is Integer<N> {\n\treturn INTEGER_SCHEMA.safeParse(value).success;\n}\n\nexport function isNegativeInteger<N extends number>(value: N): value is Negative<Integer<N>> {\n\treturn NEGATIVE_INTEGER_SCHEMA.safeParse(value).success;\n}\n\nexport function isPositiveInteger<N extends number>(value: N): value is NonNegative<Integer<N>> {\n\treturn POSITIVE_INTEGER_SCHEMA.safeParse(value).success;\n}\n","import { validatePositiveInteger } from \"../schema/groups/integer/integer.ts\";\n\n/** @see {@link https://en.wikipedia.org/wiki/Fibonacci_number} Fibonacci number */\nexport function fibonacci(number: number): number {\n\tvalidatePositiveInteger(number);\n\n\tif (number === 1 || number === 2) {\n\t\treturn 1;\n\t}\n\n\treturn fibonacci(number - 1) + fibonacci(number - 2);\n}\n"]}