@nerd-bible/valio 0.0.10 → 0.0.12

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 (3) hide show
  1. package/LICENSE.md +111 -0
  2. package/README.md +4 -4
  3. package/package.json +1 -1
package/LICENSE.md ADDED
@@ -0,0 +1,111 @@
1
+ Creative Commons Legal Code
2
+
3
+ CC0 1.0 Universal
4
+
5
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12
+ HEREUNDER.
13
+
14
+ Statement of Purpose
15
+
16
+ The laws of most jurisdictions throughout the world automatically confer
17
+ exclusive Copyright and Related Rights (defined below) upon the creator and
18
+ subsequent owner(s) (each and all, an "owner") of an original work of authorship
19
+ and/or a database (each, a "Work").
20
+
21
+ Certain owners wish to permanently relinquish those rights to a Work for the
22
+ purpose of contributing to a commons of creative, cultural and scientific works
23
+ ("Commons") that the public can reliably and without fear of later claims of
24
+ infringement build upon, modify, incorporate in other works, reuse and
25
+ redistribute as freely as possible in any form whatsoever and for any purposes,
26
+ including without limitation commercial purposes. These owners may contribute to
27
+ the Commons to promote the ideal of a free culture and the further production of
28
+ creative, cultural and scientific works, or to gain reputation or greater
29
+ distribution for their Work in part through the use and efforts of others.
30
+
31
+ For these and/or other purposes and motivations, and without any expectation of
32
+ additional consideration or compensation, the person associating CC0 with a Work
33
+ (the "Affirmer"), to the extent that he or she is an owner of Copyright and
34
+ Related Rights in the Work, voluntarily elects to apply CC0 to the Work and
35
+ publicly distribute the Work under its terms, with knowledge of his or her
36
+ Copyright and Related Rights in the Work and the meaning and intended legal
37
+ effect of CC0 on those rights.
38
+
39
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
40
+ protected by copyright and related or neighboring rights ("Copyright and
41
+ Related Rights"). Copyright and Related Rights include, but are not limited
42
+ to, the following:
43
+
44
+ i. the right to reproduce, adapt, distribute, perform, display, communicate, and
45
+ translate a Work; ii. moral rights retained by the original author(s) and/or
46
+ performer(s); iii. publicity and privacy rights pertaining to a person's image
47
+ or likeness depicted in a Work; iv. rights protecting against unfair competition
48
+ in regards to a Work, subject to the limitations in paragraph 4(a), below; v.
49
+ rights protecting the extraction, dissemination, use and reuse of data in a
50
+ Work; vi. database rights (such as those arising under Directive 96/9/EC of the
51
+ European Parliament and of the Council of 11 March 1996 on the legal protection
52
+ of databases, and under any national implementation thereof, including any
53
+ amended or successor version of such directive); and vii. other similar,
54
+ equivalent or corresponding rights throughout the world based on applicable law
55
+ or treaty, and any national implementations thereof.
56
+
57
+ 2. Waiver. To the greatest extent permitted by, but not in contravention of,
58
+ applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
59
+ unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
60
+ and Related Rights and associated claims and causes of action, whether now
61
+ known or unknown (including existing as well as future claims and causes of
62
+ action), in the Work (i) in all territories worldwide, (ii) for the maximum
63
+ duration provided by applicable law or treaty (including future time
64
+ extensions), (iii) in any current or future medium and for any number of
65
+ copies, and (iv) for any purpose whatsoever, including without limitation
66
+ commercial, advertising or promotional purposes (the "Waiver"). Affirmer
67
+ makes the Waiver for the benefit of each member of the public at large and to
68
+ the detriment of Affirmer's heirs and successors, fully intending that such
69
+ Waiver shall not be subject to revocation, rescission, cancellation,
70
+ termination, or any other legal or equitable action to disrupt the quiet
71
+ enjoyment of the Work by the public as contemplated by Affirmer's express
72
+ Statement of Purpose.
73
+
74
+ 3. Public License Fallback. Should any part of the Waiver for any reason be
75
+ judged legally invalid or ineffective under applicable law, then the Waiver
76
+ shall be preserved to the maximum extent permitted taking into account
77
+ Affirmer's express Statement of Purpose. In addition, to the extent the
78
+ Waiver is so judged Affirmer hereby grants to each affected person a
79
+ royalty-free, non transferable, non sublicensable, non exclusive, irrevocable
80
+ and unconditional license to exercise Affirmer's Copyright and Related Rights
81
+ in the Work (i) in all territories worldwide, (ii) for the maximum duration
82
+ provided by applicable law or treaty (including future time extensions),
83
+ (iii) in any current or future medium and for any number of copies, and (iv)
84
+ for any purpose whatsoever, including without limitation commercial,
85
+ advertising or promotional purposes (the "License"). The License shall be
86
+ deemed effective as of the date CC0 was applied by Affirmer to the Work.
87
+ Should any part of the License for any reason be judged legally invalid or
88
+ ineffective under applicable law, such partial invalidity or ineffectiveness
89
+ shall not invalidate the remainder of the License, and in such case Affirmer
90
+ hereby affirms that he or she will not (i) exercise any of his or her
91
+ remaining Copyright and Related Rights in the Work or (ii) assert any
92
+ associated claims and causes of action with respect to the Work, in either
93
+ case contrary to Affirmer's express Statement of Purpose.
94
+
95
+ 4. Limitations and Disclaimers.
96
+
97
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
98
+ surrendered, licensed or otherwise affected by this document. b. Affirmer offers
99
+ the Work as-is and makes no representations or warranties of any kind concerning
100
+ the Work, express, implied, statutory or otherwise, including without limitation
101
+ warranties of title, merchantability, fitness for a particular purpose, non
102
+ infringement, or the absence of latent or other defects, accuracy, or the
103
+ present or absence of errors, whether or not discoverable, all to the greatest
104
+ extent permissible under applicable law. c. Affirmer disclaims responsibility
105
+ for clearing rights of other persons that may apply to the Work or any use
106
+ thereof, including without limitation any person's Copyright and Related Rights
107
+ in the Work. Further, Affirmer disclaims responsibility for obtaining any
108
+ necessary consents, permissions or other rights required for any use of the
109
+ Work. d. Affirmer understands and acknowledges that Creative Commons is not a
110
+ party to this document and has no duty or obligation with respect to this CC0 or
111
+ use of the Work.
package/README.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # valio
2
2
 
3
- Encode and decode to Typescript types with extensible error handling.
3
+ Encode and decode Typescript types with extensible error handling.
4
4
 
5
5
  ## Why?
6
6
 
7
7
  I like [Zod](https://zod.dev), but its codecs don't support
8
- [custom error contexts.](https://github.com/colinhacks/zod/issues/)
8
+ [custom error contexts.](https://github.com/colinhacks/zod/issues/) I tried
9
+ adding support to Zod but found it easier to start from scratch.
9
10
 
10
11
  ## Theory
11
12
 
@@ -54,6 +55,7 @@ expect(schema.encode(3)).toEqual({
54
55
  ```
55
56
 
56
57
  There are common builtin codecs for coercion.
58
+
57
59
  ```ts
58
60
  import * as v from "@nerd-bible/valio";
59
61
 
@@ -121,5 +123,3 @@ expect(schema.decode(3, new MyContext())).toEqual({
121
123
  errors: { ".": [{ input: 3, message: "You done messed up" }] },
122
124
  });
123
125
  ```
124
-
125
- Those are the highlights. Read the `.test.ts` files for the rest.
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "src",
21
21
  "dist"
22
22
  ],
23
- "version": "0.0.10",
23
+ "version": "0.0.12",
24
24
  "repository": {
25
25
  "url": "git+https://github.com/nerd-bible/valio"
26
26
  }