canonize 0.1.0

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.
Files changed (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +629 -0
  3. package/dist/coercers/array.d.ts +7 -0
  4. package/dist/coercers/array.d.ts.map +1 -0
  5. package/dist/coercers/bigint.d.ts +5 -0
  6. package/dist/coercers/bigint.d.ts.map +1 -0
  7. package/dist/coercers/boolean.d.ts +5 -0
  8. package/dist/coercers/boolean.d.ts.map +1 -0
  9. package/dist/coercers/date.d.ts +5 -0
  10. package/dist/coercers/date.d.ts.map +1 -0
  11. package/dist/coercers/discriminated-union.d.ts +7 -0
  12. package/dist/coercers/discriminated-union.d.ts.map +1 -0
  13. package/dist/coercers/enum.d.ts +9 -0
  14. package/dist/coercers/enum.d.ts.map +1 -0
  15. package/dist/coercers/intersection.d.ts +8 -0
  16. package/dist/coercers/intersection.d.ts.map +1 -0
  17. package/dist/coercers/literal.d.ts +5 -0
  18. package/dist/coercers/literal.d.ts.map +1 -0
  19. package/dist/coercers/map-set.d.ts +11 -0
  20. package/dist/coercers/map-set.d.ts.map +1 -0
  21. package/dist/coercers/nan.d.ts +5 -0
  22. package/dist/coercers/nan.d.ts.map +1 -0
  23. package/dist/coercers/null.d.ts +5 -0
  24. package/dist/coercers/null.d.ts.map +1 -0
  25. package/dist/coercers/number.d.ts +13 -0
  26. package/dist/coercers/number.d.ts.map +1 -0
  27. package/dist/coercers/object.d.ts +7 -0
  28. package/dist/coercers/object.d.ts.map +1 -0
  29. package/dist/coercers/record.d.ts +7 -0
  30. package/dist/coercers/record.d.ts.map +1 -0
  31. package/dist/coercers/string.d.ts +6 -0
  32. package/dist/coercers/string.d.ts.map +1 -0
  33. package/dist/coercers/tuple.d.ts +7 -0
  34. package/dist/coercers/tuple.d.ts.map +1 -0
  35. package/dist/coercers/union.d.ts +7 -0
  36. package/dist/coercers/union.d.ts.map +1 -0
  37. package/dist/constants.d.ts +36 -0
  38. package/dist/constants.d.ts.map +1 -0
  39. package/dist/create-schema.d.ts +5 -0
  40. package/dist/create-schema.d.ts.map +1 -0
  41. package/dist/index.d.ts +51 -0
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/index.js +1623 -0
  44. package/dist/index.js.map +33 -0
  45. package/dist/tool-parameters/index.d.ts +206 -0
  46. package/dist/tool-parameters/index.d.ts.map +1 -0
  47. package/dist/tool-parameters/index.js +301 -0
  48. package/dist/tool-parameters/index.js.map +12 -0
  49. package/dist/tool-parameters/link-metadata.d.ts +17 -0
  50. package/dist/tool-parameters/link-metadata.d.ts.map +1 -0
  51. package/dist/utilities/circular.d.ts +27 -0
  52. package/dist/utilities/circular.d.ts.map +1 -0
  53. package/dist/utilities/parsers.d.ts +29 -0
  54. package/dist/utilities/parsers.d.ts.map +1 -0
  55. package/dist/utilities/special-methods.d.ts +14 -0
  56. package/dist/utilities/special-methods.d.ts.map +1 -0
  57. package/dist/utilities/type-coercion.d.ts +11 -0
  58. package/dist/utilities/type-coercion.d.ts.map +1 -0
  59. package/dist/utilities/type-detection.d.ts +26 -0
  60. package/dist/utilities/type-detection.d.ts.map +1 -0
  61. package/dist/utilities/type-guards.d.ts +35 -0
  62. package/dist/utilities/type-guards.d.ts.map +1 -0
  63. package/package.json +123 -0
package/package.json ADDED
@@ -0,0 +1,123 @@
1
+ {
2
+ "name": "canonize",
3
+ "version": "0.1.0",
4
+ "description": "Aggressive type coercion for Zod schemas. Wrap any Zod schema with intelligent coercion that handles edge cases, maintains type safety, and lets validation focus on business logic.",
5
+ "keywords": [
6
+ "zod",
7
+ "schema",
8
+ "validation",
9
+ "coercion",
10
+ "type-coercion",
11
+ "transform",
12
+ "parse",
13
+ "typescript",
14
+ "standard-schema"
15
+ ],
16
+ "homepage": "https://github.com/stevekinney/canonize#readme",
17
+ "bugs": {
18
+ "url": "https://github.com/stevekinney/canonize/issues"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/stevekinney/canonize.git"
23
+ },
24
+ "license": "MIT",
25
+ "author": "Steve Kinney <hello@stevekinney.net>",
26
+ "type": "module",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.js",
31
+ "default": "./dist/index.js"
32
+ },
33
+ "./tool-parameters": {
34
+ "types": "./dist/tool-parameters/index.d.ts",
35
+ "import": "./dist/tool-parameters/index.js",
36
+ "default": "./dist/tool-parameters/index.js"
37
+ }
38
+ },
39
+ "main": "./dist/index.js",
40
+ "module": "./dist/index.js",
41
+ "types": "./dist/index.d.ts",
42
+ "files": [
43
+ "dist",
44
+ "LICENSE",
45
+ "README.md"
46
+ ],
47
+ "scripts": {
48
+ "build": "bun run build:js && bun run build:types",
49
+ "build:js": "bun build ./src/index.ts ./src/tool-parameters/index.ts --outdir=dist --target=browser --format=esm --splitting --sourcemap=external --external=zod",
50
+ "build:types": "tsc -p tsconfig.build.json",
51
+ "clean": "rm -rf dist coverage node_modules/.cache",
52
+ "dev": "bun --watch run src/index.ts",
53
+ "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
54
+ "format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\"",
55
+ "lint": "eslint .",
56
+ "lint:fix": "eslint . --fix",
57
+ "prepare": "husky",
58
+ "prepublishOnly": "bun run clean && bun run build && bun run test",
59
+ "start": "bun run src/index.ts",
60
+ "test": "bun test",
61
+ "test:coverage": "bun test --coverage",
62
+ "typecheck": "tsc --noEmit",
63
+ "validate": "bun run lint && bun run typecheck && bun run test"
64
+ },
65
+ "lint-staged": {
66
+ "src/**/*.{js,ts,tsx,jsx,mjs,cjs}": [
67
+ "eslint --fix",
68
+ "prettier --write"
69
+ ],
70
+ "scripts/**/*.{js,ts,tsx,jsx,mjs,cjs}": [
71
+ "eslint --fix",
72
+ "prettier --write"
73
+ ],
74
+ "**/*.{json,md,css,scss}": [
75
+ "prettier --write"
76
+ ],
77
+ "package.json": [
78
+ "sort-package-json"
79
+ ]
80
+ },
81
+ "devDependencies": {
82
+ "@eslint/eslintrc": "^3.3.3",
83
+ "@eslint/js": "^9.39.2",
84
+ "@eslint/markdown": "^7.5.1",
85
+ "@types/bun": "^1.3.5",
86
+ "@types/mdast": "^4.0.4",
87
+ "@typescript-eslint/eslint-plugin": "^8.50.0",
88
+ "@typescript-eslint/parser": "^8.50.0",
89
+ "chalk": "^5.6.2",
90
+ "change-case": "^5.4.4",
91
+ "eslint": "^9.39.2",
92
+ "eslint-config-prettier": "^10.1.8",
93
+ "eslint-import-resolver-typescript": "^4.4.4",
94
+ "eslint-plugin-eslint-comments": "^3.2.0",
95
+ "eslint-plugin-import": "^2.32.0",
96
+ "eslint-plugin-prettier": "^5.5.4",
97
+ "eslint-plugin-promise": "^7.2.1",
98
+ "eslint-plugin-regexp": "^2.10.0",
99
+ "eslint-plugin-simple-import-sort": "^12.1.1",
100
+ "eslint-plugin-unicorn": "^62.0.0",
101
+ "eslint-plugin-unused-imports": "^4.3.0",
102
+ "fast-check": "^4.5.3",
103
+ "globals": "^16.5.0",
104
+ "husky": "^9.1.7",
105
+ "lint-staged": "^16.2.7",
106
+ "prettier": "^3.7.4",
107
+ "remark": "^15.0.1",
108
+ "remark-parse": "^11.0.0",
109
+ "remark-stringify": "^11.0.0",
110
+ "sort-package-json": "^3.6.0",
111
+ "typescript": "^5.8.3",
112
+ "typescript-eslint": "^8.50.0",
113
+ "unified": "^11.0.5",
114
+ "unist-util-remove": "^4.0.0",
115
+ "zod": "^4.2.1"
116
+ },
117
+ "peerDependencies": {
118
+ "zod": ">=3.23.0"
119
+ },
120
+ "engines": {
121
+ "node": ">=18.0.0"
122
+ }
123
+ }