@ohos-ports/djv 0.0.0-stage → 2.1.4-beta.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.
- package/CHANGELOG.md +199 -0
- package/LICENSE +21 -0
- package/README.md +244 -2
- package/djv.js +2 -0
- package/djv.js.map +1 -0
- package/lib/djv.js +304 -0
- package/lib/utils/environment.js +38 -0
- package/lib/utils/formats.js +29 -0
- package/lib/utils/index.js +45 -0
- package/lib/utils/keywords.js +29 -0
- package/lib/utils/properties.js +94 -0
- package/lib/utils/schema.js +91 -0
- package/lib/utils/state.js +273 -0
- package/lib/utils/template.js +308 -0
- package/lib/utils/types.js +10 -0
- package/lib/utils/uri.js +133 -0
- package/lib/validators/$ref.js +16 -0
- package/lib/validators/allOf.js +14 -0
- package/lib/validators/anyOf.js +14 -0
- package/lib/validators/const.js +11 -0
- package/lib/validators/contains.js +23 -0
- package/lib/validators/dependencies.js +25 -0
- package/lib/validators/format.js +32 -0
- package/lib/validators/index.js +63 -0
- package/lib/validators/items.js +47 -0
- package/lib/validators/not.js +12 -0
- package/lib/validators/oneOf.js +25 -0
- package/lib/validators/patternProperties.js +63 -0
- package/lib/validators/properties.js +28 -0
- package/lib/validators/property.js +20 -0
- package/lib/validators/propertyNames.js +12 -0
- package/lib/validators/required.js +13 -0
- package/lib/validators/type.js +13 -0
- package/package.json +56 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
#### 2.1.4 (2020-12-27)
|
|
2
|
+
|
|
3
|
+
##### Chores
|
|
4
|
+
|
|
5
|
+
* **npm:** regenerate package lock ([46bfdbe8](https://github.com/korzio/djv/commit/46bfdbe86fe821e9bb4ed9b39ea1830840204742))
|
|
6
|
+
* **code:** Move clear decode function to outer scope ([5e65fda4](https://github.com/korzio/djv/commit/5e65fda4edbaa7a7495fd759fb5ab942fa06308f))
|
|
7
|
+
|
|
8
|
+
#### 2.1.2 (2019-03-06)
|
|
9
|
+
|
|
10
|
+
##### Other Changes
|
|
11
|
+
|
|
12
|
+
* Update package version to 2.1.2 [#76](https://github.com/korzio/djv/pull/76) ([9b40c9d5](https://github.com/korzio/djv/commit/9b40c9d5ae50ce0d1324b5b25d3d9f8b8169882e))
|
|
13
|
+
* Fix required validator throwing on null values [#75](https://github.com/korzio/djv/pull/76)
|
|
14
|
+
|
|
15
|
+
#### 2.1.1 (2018-09-04)
|
|
16
|
+
|
|
17
|
+
##### Other Changes
|
|
18
|
+
|
|
19
|
+
* Update package version to 2.1.1 [#69](https://github.com/korzio/djv/pull/69) ([44190e9d](https://github.com/korzio/djv/commit/44190e9d9fab723942d93cc34a36c22e85c0b11d))
|
|
20
|
+
|
|
21
|
+
[Add `browser` field](https://docs.npmjs.com/files/package.json#browser)
|
|
22
|
+
|
|
23
|
+
#### 2.1.0 (2018-06-24)
|
|
24
|
+
|
|
25
|
+
##### New Features
|
|
26
|
+
|
|
27
|
+
* **error code** [BREAKING CHANGE] Change default error handlers to output error objects instead of strings ([#54](https://github.com/korzio/djv/commit/014a38285ede3e26455bb07c02d1613541892897))
|
|
28
|
+
|
|
29
|
+
##### Other Changes
|
|
30
|
+
|
|
31
|
+
* Update package version to 2.1.0 [#65](https://github.com/korzio/djv/pull/65) ([6fd3445f](https://github.com/korzio/djv/commit/6fd3445f3a7374d186a2519f068826a76e0887ea))
|
|
32
|
+
|
|
33
|
+
#### 2.0.0 (2017-10-10)
|
|
34
|
+
|
|
35
|
+
##### New Features
|
|
36
|
+
|
|
37
|
+
* **env** [BREAKING CHANGE] Make schema v6 default #48 ([bd1d4cae](https://github.com/korzio/djv/commit/bd1d4cae9d275c188536d37d721236745c4a1dc2))
|
|
38
|
+
|
|
39
|
+
##### Documentation Changes
|
|
40
|
+
|
|
41
|
+
* **api** Add auto-generated docs #48 ([440ff67d](https://github.com/korzio/djv/commit/440ff67d84aad429ab5a334aed384f59c5a96aa7))
|
|
42
|
+
* **site** Add index documentation page #48 ([cb4db59b](https://github.com/korzio/djv/commit/cb4db59b1db66f5107a834b236ad461e04e3e6cb))
|
|
43
|
+
* **env** Add environment section to describe options ([5e0e1a91](https://github.com/korzio/djv/commit/5e0e1a91e1eead2942032545e220e44f24c87dfd))
|
|
44
|
+
|
|
45
|
+
#### 1.2.0 (2017-09-25)
|
|
46
|
+
|
|
47
|
+
##### Documentation Changes
|
|
48
|
+
|
|
49
|
+
* **npm:** Remove docs folder from npm files #51 ([d5d2a8de](https://github.com/korzio/djv/commit/d5d2a8decd75db3351734ba25175b98533ca2d75))
|
|
50
|
+
* **readme:** Update v6 support #51 ([2ec9d7f0](https://github.com/korzio/djv/commit/2ec9d7f0abe53edb5b0e0c2d23b0747dd1cafbca))
|
|
51
|
+
* **const:** Add const documentation #51 ([b7f0355d](https://github.com/korzio/djv/commit/b7f0355d61e048d88ee485007d006f47831de0c9))
|
|
52
|
+
* **state:**
|
|
53
|
+
* Fix state documentation #51 ([7a000072](https://github.com/korzio/djv/commit/7a000072b038bf6ffa3a4d0c98252c739fecd7c3))
|
|
54
|
+
* Add resolution exampes #41 ([a89658c0](https://github.com/korzio/djv/commit/a89658c07dfb65848920425404e278b5c099eaa7))
|
|
55
|
+
* Add state description #41 ([ff1b7a75](https://github.com/korzio/djv/commit/ff1b7a75392e807098c29d0a719b99cdb1f596d6))
|
|
56
|
+
* **todo:** Add todo for draft-06 #41 ([4fa64971](https://github.com/korzio/djv/commit/4fa64971c550fa558fda3031c93bd62ef061a7aa))
|
|
57
|
+
* **contribute:** Change tests debug description ([b0d03069](https://github.com/korzio/djv/commit/b0d03069c24c462cee82c8c6b5c78baeb4cc4f41))
|
|
58
|
+
* **contributing:**
|
|
59
|
+
* Fix version ([351a8eb8](https://github.com/korzio/djv/commit/351a8eb88648b2939ecc7e6a87c9c6ce1f762f1d))
|
|
60
|
+
* Fix typo ([66b62f3e](https://github.com/korzio/djv/commit/66b62f3eab75768403eae9682bb49ebf859f99eb))
|
|
61
|
+
* Add release branch MR description ([faf53856](https://github.com/korzio/djv/commit/faf538564894a47d386e621b7de8a21602020052))
|
|
62
|
+
* **release:** Add table of contents, update release contributing #35 ([2f69a166](https://github.com/korzio/djv/commit/2f69a1660c3d882bc783e42dbd8ea45e7173d824))
|
|
63
|
+
* Update api docs, format utils ([11cae181](https://github.com/korzio/djv/commit/11cae1815de6f786abc24a71616eb50e18b2beaf))
|
|
64
|
+
|
|
65
|
+
##### New Features
|
|
66
|
+
|
|
67
|
+
* **id:** Add $id, examples keywords #44 ([1ef4745f](https://github.com/korzio/djv/commit/1ef4745f1658857c6c132264b8319fdaa73ccbcc))
|
|
68
|
+
* **format:** Add uri formats #44 ([79802269](https://github.com/korzio/djv/commit/79802269650e530228f2719497ddda165acfba81))
|
|
69
|
+
* **validator:**
|
|
70
|
+
* Add json-pointer format #44 ([7a522f8a](https://github.com/korzio/djv/commit/7a522f8a9da29504190140329d12faf0aa29d4c5))
|
|
71
|
+
* Add propertyNames validator #44 ([5ad9d343](https://github.com/korzio/djv/commit/5ad9d343575558be0e6a69bd2420b958e1d4dc00))
|
|
72
|
+
* Add const validator #44 ([1d4fa106](https://github.com/korzio/djv/commit/1d4fa10656d4bb7caffd2fd9b598ecfccf1d71eb))
|
|
73
|
+
* Add contains validator #44 ([8ecf27d8](https://github.com/korzio/djv/commit/8ecf27d81621b7638e6199c75c1ab623f47561ec))
|
|
74
|
+
* **validators:** Add useVersion method to change environment version; Add exlusive maximum/minimum properties #44 ([f57f9116](https://github.com/korzio/djv/commit/f57f9116204ad0f9f4126a81e6ead89bbce25f58))
|
|
75
|
+
|
|
76
|
+
##### Bug Fixes
|
|
77
|
+
|
|
78
|
+
* **test:**
|
|
79
|
+
* Add name json mock data to test environment #41 ([c1d0e13b](https://github.com/korzio/djv/commit/c1d0e13bb50ccab189e88b7f6d6e2568c47a3770))
|
|
80
|
+
* **rename:** Rename template resolve to link as in state #41 ([34fc6e4d](https://github.com/korzio/djv/commit/34fc6e4d3f378a82378244a354817cd9ec4a6e3e))
|
|
81
|
+
* **format:** Add regex, fix uri formatters #44 ([757397d7](https://github.com/korzio/djv/commit/757397d7fb1a698a92953596804cf37d28b325d1))
|
|
82
|
+
* **draft-06:**
|
|
83
|
+
* Move validators to patch environment #44 ([9f7412bc](https://github.com/korzio/djv/commit/9f7412bc3ed8148d119b729cf30b6f8d4c7fbb82))
|
|
84
|
+
* Fix properties strict type check #44 ([f663f7ba](https://github.com/korzio/djv/commit/f663f7ba6285ed04575050ac9d27eb4509420c01))
|
|
85
|
+
* **boolean:** Fix transform default schema ([69488621](https://github.com/korzio/djv/commit/694886218a5f1330d5c49671d88932b645185b95))
|
|
86
|
+
* **tests:** Add isSchema, transformSchema utilities for boolean schema presentation #44 ([cb48a2a1](https://github.com/korzio/djv/commit/cb48a2a1da27a7a9c1c373a412b2c0624b8f8f7d))
|
|
87
|
+
* **validator:** Add not array required check #44 ([83b01279](https://github.com/korzio/djv/commit/83b01279824698d783aedc8c39b0b434c404f22b))
|
|
88
|
+
|
|
89
|
+
##### Other Changes
|
|
90
|
+
|
|
91
|
+
* **state:** Fix skip describe for jasmine #41 ([52ffd0c7](https://github.com/korzio/djv/commit/52ffd0c7f500bf793dfd26df6b46a6551b7ef328))
|
|
92
|
+
* **debug:** Add console output if error is thrown ([6b61a465](https://github.com/korzio/djv/commit/6b61a4657668fbee616acf1a7092cfc4a9c53a4c))
|
|
93
|
+
* Add draft-06 tests; Switch to json schema test package #44 ([1a9ce7e7](https://github.com/korzio/djv/commit/1a9ce7e77b200fb475735997928edc378e9caf19))
|
|
94
|
+
|
|
95
|
+
##### Refactors
|
|
96
|
+
|
|
97
|
+
* **files:**
|
|
98
|
+
* Clean code; Remove deprecated #51 ([b815f6dc](https://github.com/korzio/djv/commit/b815f6dcafa1b40f13895b1ffb3d348dff4ed2b4))
|
|
99
|
+
* Clean code; Split utils to uri and schema; Move transforms to environment #51 ([7c497fb5](https://github.com/korzio/djv/commit/7c497fb50613680afec2b011a1a46012c0c7b247))
|
|
100
|
+
* **performance:** Clean code; Change uri keys utils; Rewrite state resolution id algorithm to not use multiple functions calls #51 ([1fe9339d](https://github.com/korzio/djv/commit/1fe9339d4fefdcbaf75b54e3df53c9c1b5a08f06))
|
|
101
|
+
* **state:**
|
|
102
|
+
* Clean code; Change cleanId to head #51 ([465749a4](https://github.com/korzio/djv/commit/465749a4c48bab74d34158b15abaacdd44ffdb17))
|
|
103
|
+
* Add draft-06 meta schema to tests; Add uriKeys variable to contain id/$id changes; Fix boolean schema descend resolution #41 ([01b37316](https://github.com/korzio/djv/commit/01b37316529752a1fe982f3028bf9065b5a5fbc1))
|
|
104
|
+
* Move descend to state; Fix intermediate ids resolution #41 ([ad70e8e7](https://github.com/korzio/djv/commit/ad70e8e775a6834034a1e17a6052eeb9c3b2b47b))
|
|
105
|
+
* Fix uri utils regexps #41 ([0df12100](https://github.com/korzio/djv/commit/0df121002385e679a9dfe339f7c2ce66a5e2d86c))
|
|
106
|
+
* Fix ignore other properties in $ref schemas; Clean schemas stack after visit #41 ([fe85a55b](https://github.com/korzio/djv/commit/fe85a55b49b8acb6a9013f452a6cb4554a03dd07))
|
|
107
|
+
* Add reference schema resolution; Add resolution by id #41 ([64d9ba5e](https://github.com/korzio/djv/commit/64d9ba5e1dacc4b61c2e561290564bbb372c6635))
|
|
108
|
+
* Simplify resolution; Rename descend utils #41 ([c55f3af6](https://github.com/korzio/djv/commit/c55f3af6cc96e11909c28648164e105e450866c5))
|
|
109
|
+
* **validators:**
|
|
110
|
+
* Change hasOwnProperty usage; Add checks for boolean schemas #44 ([af5fcc75](https://github.com/korzio/djv/commit/af5fcc755788215b9c6f26f09a3aee7ae72c760d))
|
|
111
|
+
|
|
112
|
+
##### Code Style Changes
|
|
113
|
+
|
|
114
|
+
* **state:** Normalize if-else utils clauses #41 ([b9b11e29](https://github.com/korzio/djv/commit/b9b11e2996607ffe566f33ecd5ab4409bec9f280))
|
|
115
|
+
|
|
116
|
+
##### Tests
|
|
117
|
+
|
|
118
|
+
* **properties:** Add check for object type #44 ([3fb8bcbb](https://github.com/korzio/djv/commit/3fb8bcbb56b8915bef2e492524eb1bc8387d75aa))
|
|
119
|
+
|
|
120
|
+
#### 1.1.1 (2017-07-20)
|
|
121
|
+
|
|
122
|
+
##### Documentation Changes
|
|
123
|
+
|
|
124
|
+
* **contributing:**
|
|
125
|
+
* Add benchmark suite debug description ([b0c05722](https://github.com/korzio/djv/commit/b0c05722c39477fc80fd95c189c6129ccc937c4e))
|
|
126
|
+
* Add contributing rules file ([3a0db5b4](https://github.com/korzio/djv/commit/3a0db5b4b2f4b04f27a20f479eaee043069daf15))
|
|
127
|
+
* Fix text ([470ec0f0](https://github.com/korzio/djv/commit/470ec0f0f3ba5a3b0b31f8ca7b32bbd80baf0742))
|
|
128
|
+
* Change changelog package version ([f7f44e88](https://github.com/korzio/djv/commit/f7f44e8807cfe2b029e98961841edcdb3dae9c99))
|
|
129
|
+
* **error handle:** Fix example ([9b7a5545](https://github.com/korzio/djv/commit/9b7a554547e3cd1148f43c35d99ce3e1114a5983))
|
|
130
|
+
|
|
131
|
+
##### New Features
|
|
132
|
+
|
|
133
|
+
* **webpack:**
|
|
134
|
+
* Add source maps, add manual test html, update docs #34 ([40ecd525](https://github.com/korzio/djv/commit/40ecd525e6f45d8a07282e424272e52de5826d8a))
|
|
135
|
+
* Update webpack #34 ([73cfa621](https://github.com/korzio/djv/commit/73cfa621a8378fd61f5b74680e01522632f2d7fb))
|
|
136
|
+
|
|
137
|
+
##### Bug Fixes
|
|
138
|
+
|
|
139
|
+
* **utils:** Add type checking ([038d89a7](https://github.com/korzio/djv/commit/038d89a796ccbdac335fff6d143222da2a7db3ec))
|
|
140
|
+
* **validators:** Add required type object check ([4970bc5e](https://github.com/korzio/djv/commit/4970bc5ed1cf438db2dfae644ac62de682e14fbd))
|
|
141
|
+
* **items:** Add items is array check #29 ([d13cdcd2](https://github.com/korzio/djv/commit/d13cdcd27df4f59556dceb34a1ea5bfce5477475))
|
|
142
|
+
* **test:** Add latest suite tests ([323c9a0d](https://github.com/korzio/djv/commit/323c9a0ddb87ca748e473cc6d790494831290519))
|
|
143
|
+
|
|
144
|
+
##### Refactors
|
|
145
|
+
|
|
146
|
+
* **state:**
|
|
147
|
+
* Handle circular self schema dependency ([7bbefcc5](https://github.com/korzio/djv/commit/7bbefcc56e9ef79468a937db91cb18a07fed1620))
|
|
148
|
+
* Add resolution schema search ([05307fcc](https://github.com/korzio/djv/commit/05307fcc0458adfb16af87ad6df20102c0658bb9))
|
|
149
|
+
* Add iterate through fragment even it is not a fragment ([068114c1](https://github.com/korzio/djv/commit/068114c19ca124cc63afca646c482345b34ced21))
|
|
150
|
+
* Clean descent utils method ([fd18b7d8](https://github.com/korzio/djv/commit/fd18b7d8f7ccda0cb1084d27674cd7b0939dd581))
|
|
151
|
+
* Move descent outside of the state ([3691b361](https://github.com/korzio/djv/commit/3691b36161dad7ab2a0945db324f660a0b3e0b7f))
|
|
152
|
+
* Change domain to path usage in url resolution ([856f1a52](https://github.com/korzio/djv/commit/856f1a52fe9162da45ac277ab7dfb72a38c34949))
|
|
153
|
+
* Add full uri check for resolution purpose ([1bdf4e88](https://github.com/korzio/djv/commit/1bdf4e88f979c9885351dea5c7c3e61b1a510626))
|
|
154
|
+
* Add experimental strategy to resolve state ([fb9c5a96](https://github.com/korzio/djv/commit/fb9c5a9608e705c93a4ae910e618aaacd429a6ea))
|
|
155
|
+
* Change ascend method to solve parentSchema ([e366f3dc](https://github.com/korzio/djv/commit/e366f3dc8e29493cfd61038247fe4938adfbd813))
|
|
156
|
+
* Draft rename resolution scope ([99aaea1e](https://github.com/korzio/djv/commit/99aaea1e22fff1c1fd59b9f5a9c2b9f1e82b0772))
|
|
157
|
+
* Add join path utility ([8dc9cee2](https://github.com/korzio/djv/commit/8dc9cee2b6f7595b3e7d8559627fa35e2b36b301))
|
|
158
|
+
|
|
159
|
+
#### 1.1.0 (2017-6-16)
|
|
160
|
+
|
|
161
|
+
##### New Features
|
|
162
|
+
|
|
163
|
+
* **error:** Add ability to customize error handler #16 ([3b6b69ee](https://github.com/korzio/djv/commit/3b6b69ee2527685f9404ad9cb332697ccd9f5f2e))
|
|
164
|
+
* **format:** Add custom formatter for environment, unite generate and state in one file ([3dd47aeb](https://github.com/korzio/djv/commit/3dd47aebdbfcaabef3252e7ff7f2f18ef4cb346b))
|
|
165
|
+
|
|
166
|
+
##### Bug Fixes
|
|
167
|
+
|
|
168
|
+
* **environment:** Add clean id method #20 ([b9bfc527](https://github.com/korzio/djv/commit/b9bfc52783579f9c21e276c569956863f9c99458))
|
|
169
|
+
* **state:** Add deferred schema resolution for loop references #13 ([b818df12](https://github.com/korzio/djv/commit/b818df122e801dd2dc92f39fba6d6e3906c1aadf))
|
|
170
|
+
|
|
171
|
+
##### Other Changes
|
|
172
|
+
|
|
173
|
+
* **readme:** Add addFormat description #15 ([7878ff95](https://github.com/korzio/djv/commit/7878ff95830ae3772e8175a7ab55c86446d27677))
|
|
174
|
+
* Add throw test; Change register draft ([dd6662d9](https://github.com/korzio/djv/commit/dd6662d9d09a25d874940db91d8402fae65594cc))
|
|
175
|
+
* Add documentation for utilties #13 ([867fe41b](https://github.com/korzio/djv/commit/867fe41b988eaf20c850955a01fa79c36c6f8c53))
|
|
176
|
+
* Refactor coupled generate ([495d8ac0](https://github.com/korzio/djv/commit/495d8ac062467108392b72ce24f9ba47e9c2eb52))
|
|
177
|
+
* Move resolve to state prototype ([bc1167d9](https://github.com/korzio/djv/commit/bc1167d992c37a608532964405355e5a35206139))
|
|
178
|
+
* Restructure utils, move to folder, split into files ([2de156de](https://github.com/korzio/djv/commit/2de156dee60be45417a7b9f31f35d9527d3bf1c3))
|
|
179
|
+
* Refactor inner toFunction, move to generate ([a9b7f6fe](https://github.com/korzio/djv/commit/a9b7f6fe09036751946397de4ae1b8ea0dcc3ed4))
|
|
180
|
+
* Separate state class ([192fdfd2](https://github.com/korzio/djv/commit/192fdfd294393a08e5b90663054276ff9de8f23c))
|
|
181
|
+
* Add generated functions entries cache ([8a84ece3](https://github.com/korzio/djv/commit/8a84ece328ab68ce1188105937b8549435d255c2))
|
|
182
|
+
* Clean visited state ([44fa0d45](https://github.com/korzio/djv/commit/44fa0d45f54cbff0631dd1ca29fe4f4eade778b1))
|
|
183
|
+
* Move static generate functions to utils ([8acc4059](https://github.com/korzio/djv/commit/8acc4059e0ea2bd359f7f92d558da98c4e1d8834))
|
|
184
|
+
|
|
185
|
+
##### Refactors
|
|
186
|
+
|
|
187
|
+
* **validators:** Separate property and format validators #15 ([910f7674](https://github.com/korzio/djv/commit/910f7674871444d148e45235a193bd85df405bfb))
|
|
188
|
+
* **state:**
|
|
189
|
+
* Add generate method to state #13 ([ba6d18e9](https://github.com/korzio/djv/commit/ba6d18e94d8060c616d66c4ca92bbfda0fe2525b))
|
|
190
|
+
* Make state use environment resolved object #13 ([79dce9db](https://github.com/korzio/djv/commit/79dce9db0b3517504d2d1c2cde0e03cd20e7791d))
|
|
191
|
+
|
|
192
|
+
##### Code Style Changes
|
|
193
|
+
|
|
194
|
+
* **utilities:** Clean utilities format #14 ([6c994916](https://github.com/korzio/djv/commit/6c994916aa619ac44505a57a3fafb679d2760b40))
|
|
195
|
+
* **template:**
|
|
196
|
+
* Rename fn to tpl as in other places #15 ([85217a25](https://github.com/korzio/djv/commit/85217a25df97eff618043f18ef2055c3d3df22cb))
|
|
197
|
+
* Rename template instance to tpl #13 ([def56c91](https://github.com/korzio/djv/commit/def56c91d3c4c321fd388aea18bdf43ec86c1fe4))
|
|
198
|
+
* **lint:** Temporary fix global require with lint comment ([489717fe](https://github.com/korzio/djv/commit/489717fe66e586368abdcebee1535e7617b84390))
|
|
199
|
+
* **comment:** Uncomment try catch for tests ([68db5919](https://github.com/korzio/djv/commit/68db59194d61acd8ea00b3aa2d2002de0c990a79))
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 korzio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,245 @@
|
|
|
1
|
-
|
|
1
|
+
[](https://travis-ci.org/korzio/djv)
|
|
2
|
+
[](https://gitter.im/korzio/djv)
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
# djv <a name="title"></a>
|
|
5
|
+
|
|
6
|
+
Dynamic JSON-Schema Validator
|
|
7
|
+
|
|
8
|
+
[Official Documentation](http://korzio.github.io/djv/)
|
|
9
|
+
|
|
10
|
+
Current package supports **JSON-Schema v6 and v4**. It contains utils to validate objects against schemas.
|
|
11
|
+
This is a part of **djv** packages aimed to work with json-schema.
|
|
12
|
+
|
|
13
|
+
- [djv](https://github.com/korzio/djv) validate object against schemas
|
|
14
|
+
- [djvi](https://github.com/korzio/djvi) instantiate objects by schema definition
|
|
15
|
+
- [jvu](https://github.com/korzio/jvu) utilities for declarative, FP usage
|
|
16
|
+
- [@djv/draft-04](https://github.com/korzio/@djv/draft-04) environment updates to support *draft-04*
|
|
17
|
+
|
|
18
|
+
Any contributions are welcome. Check the [contribution guide](./CONTRIBUTING.md).
|
|
19
|
+
Since version **1.2.0** *djv* package supports `draft-06`. Version **2.0.0** makes `draft-06` the default schema version. To use other versions check the [environment section](#environment).
|
|
20
|
+
|
|
21
|
+
## Table of contents <a name="content"></a>
|
|
22
|
+
|
|
23
|
+
* [djv](#title)
|
|
24
|
+
* [Table of contents](#content)
|
|
25
|
+
* [Install](#install)
|
|
26
|
+
* [Usage](#usage)
|
|
27
|
+
* [API](#api)
|
|
28
|
+
* [Environment](#environment)
|
|
29
|
+
* [addSchema](#addSchema)
|
|
30
|
+
* [validate](#validate)
|
|
31
|
+
* [removeSchema](#removeSchema)
|
|
32
|
+
* [resolve](#resolve)
|
|
33
|
+
* [export](#export)
|
|
34
|
+
* [import](#import)
|
|
35
|
+
* [addFormat](#addFormat)
|
|
36
|
+
* [setErrorHandler](#errorHandler)
|
|
37
|
+
* [useVersion](#useVersion)
|
|
38
|
+
* [Tests](#tests)
|
|
39
|
+
* [References](#references)
|
|
40
|
+
|
|
41
|
+
## Install <a name="install"></a>
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install djv
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
or
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<script src="djv.js"></script>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
There are 2 versions of validator
|
|
54
|
+
|
|
55
|
+
- `./lib/djv.js` a default one, not uglified and not transpiled
|
|
56
|
+
- `./djv.js` a built one with a webpack, babel and uglify (preferable for frontend)
|
|
57
|
+
|
|
58
|
+
## Usage <a name="usage"></a>
|
|
59
|
+
|
|
60
|
+
```javascript
|
|
61
|
+
const env = new djv();
|
|
62
|
+
const jsonSchema = {
|
|
63
|
+
"common": {
|
|
64
|
+
"properties": {
|
|
65
|
+
"type": {
|
|
66
|
+
"enum": ["common"]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"required": [
|
|
70
|
+
"type"
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// Use `addSchema` to add json-schema
|
|
76
|
+
env.addSchema('test', jsonSchema);
|
|
77
|
+
env.validate('test#/common', { type: 'common' });
|
|
78
|
+
// => undefined
|
|
79
|
+
|
|
80
|
+
env.validate('test#/common', { type: 'custom' });
|
|
81
|
+
// => 'required: data'
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## API <a name="api"></a>
|
|
85
|
+
|
|
86
|
+
### Environment <a name="environment"></a>
|
|
87
|
+
|
|
88
|
+
To instantiate *djv* environment
|
|
89
|
+
|
|
90
|
+
```javascript
|
|
91
|
+
const djv = require('djv');
|
|
92
|
+
const env = djv({
|
|
93
|
+
version: 'draft-06', // use json-schema draft-06
|
|
94
|
+
formats: { /*...*/ }, // custom formats @see #addFormat
|
|
95
|
+
errorHandler: () => { /*...*/ }, // custom error handler, @see #setErrorHandler
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
To use a previous version of JSON-Schema draft, use a [`draft-04` plugin](https://www.npmjs.com/package/@korzio/djv-draft-04), specified in [*optionalDependencies*](https://docs.npmjs.com/files/package.json#optionaldependencies) of *djv* package.
|
|
100
|
+
|
|
101
|
+
```javascript
|
|
102
|
+
const env = new djv({ version: 'draft-04' });
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### addSchema(name: string, schema: object?) -> resolved: object <a name="addSchema"></a>
|
|
106
|
+
|
|
107
|
+
Add a schema to a current djv environment,
|
|
108
|
+
|
|
109
|
+
```javascript
|
|
110
|
+
env.addSchema('test', jsonSchema);
|
|
111
|
+
/* => {
|
|
112
|
+
fn: function f0(data){...}
|
|
113
|
+
name: 'test'
|
|
114
|
+
schema: ...
|
|
115
|
+
} */
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### validate(name: string, object: object) -> error: string <a name="validate"></a>
|
|
119
|
+
|
|
120
|
+
Check if object is valid against the schema
|
|
121
|
+
|
|
122
|
+
```javascript
|
|
123
|
+
env.validate('test#/common', { type: 'common' });
|
|
124
|
+
// => undefined
|
|
125
|
+
|
|
126
|
+
env.validate('test#/common', { type: 'custom' });
|
|
127
|
+
// => 'required: data'
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
where
|
|
131
|
+
|
|
132
|
+
* *name* - schema path in current environment
|
|
133
|
+
* *object* - object to validate
|
|
134
|
+
* *error* - undefined if it is valid
|
|
135
|
+
|
|
136
|
+
### removeSchema(name: string) <a name="removeSchema"></a>
|
|
137
|
+
|
|
138
|
+
Remove a schema or the whole structure from the djv environment
|
|
139
|
+
|
|
140
|
+
```javascript
|
|
141
|
+
env.removeSchema('test');
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### resolve(name: string?) <a name="resolve"></a>
|
|
145
|
+
|
|
146
|
+
Resolve the name by existing environment
|
|
147
|
+
|
|
148
|
+
```javascript
|
|
149
|
+
env.resolve('test');
|
|
150
|
+
// => { name: 'test', schema: {} }, fn: ... }
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### export(name: string?) -> state: object <a name="export"></a>
|
|
154
|
+
|
|
155
|
+
Export the whole structure object from environment or resolved by a given name
|
|
156
|
+
|
|
157
|
+
```javascript
|
|
158
|
+
env.export();
|
|
159
|
+
// => { test: { name: 'test', schema: {}, ... } }
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
where **state** is an internal structure or only resolved schema object
|
|
163
|
+
|
|
164
|
+
### import(config: object) <a name="import"></a>
|
|
165
|
+
|
|
166
|
+
Import all found structure objects to internal environment structure
|
|
167
|
+
|
|
168
|
+
```javascript
|
|
169
|
+
env.import(config);
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### addFormat(name: string, formatter: string/function) <a name="addFormat"></a>
|
|
173
|
+
|
|
174
|
+
Add formatter to djv environment. When a string is passed it is interpreted as an expression which when returns `true` goes with an error, when returns `false` then a property is valid. When a function is passed it will be executed during schema compilation with a current schema and template helper arguments.
|
|
175
|
+
|
|
176
|
+
```javascript
|
|
177
|
+
env.addFormat('UpperCase', '%s !== %s.toUpperCase()');
|
|
178
|
+
// or
|
|
179
|
+
env.addFormat('isOk', function(schema, tpl){
|
|
180
|
+
return `!${schema.isOk}`;
|
|
181
|
+
});
|
|
182
|
+
env.validate('ok', 'valid') // => undefined if schema contains isOk property
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### setErrorHandler(errorHandler: function) <a name="errorHandler"></a>
|
|
186
|
+
|
|
187
|
+
Specify custom error handler which will be used in generated functions when problem found.
|
|
188
|
+
The function should return a string expression, which will be executed when generated validator function is executed. The simplist use case is the default one @see `template/defaultErrorHandler`
|
|
189
|
+
```javascript
|
|
190
|
+
function defaultErrorHandler(errorType) {
|
|
191
|
+
return `return "${errorType}: ${tpl.data}";`;
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
It returns an expression 'return ...', so the output is an error string.
|
|
195
|
+
|
|
196
|
+
```javascript
|
|
197
|
+
djv({ errorHandler: () => 'return { error: true };' }) // => returns an object
|
|
198
|
+
djv({
|
|
199
|
+
errorHandler(type) {
|
|
200
|
+
return `errors.push({
|
|
201
|
+
type: '${type}',
|
|
202
|
+
schema: '${this.schema[this.schema.length - 1]}',
|
|
203
|
+
data: '${this.data[this.data.length - 1]}'
|
|
204
|
+
});`;
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
```
|
|
208
|
+
When a custom error handler is used, the template body function adds a `error` variable inside a generated validator, which can be used to put error information. `errorType` is always passed to error handler function. Some validate utilities put extra argument, like f.e. currently processed property value. Inside the handler context is a templater instance, which contains `this.schema`, `this.data` paths arrays to identify validator position.
|
|
209
|
+
@see test/index/setErrorHandler for more examples
|
|
210
|
+
|
|
211
|
+
### useVersion(version: string, configure: function) <a name="useVersion"></a>
|
|
212
|
+
|
|
213
|
+
To customize environment provide a `configure` function which will update configuration for *djv* instance.
|
|
214
|
+
|
|
215
|
+
```javascript
|
|
216
|
+
env.useVersion('draft-04')
|
|
217
|
+
// or
|
|
218
|
+
env.useVersion('custom', configure)
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
`Configure` will get internal properties as an argument. Check the [@korzio/djv-draft-04 code](https://github.com/korzio/-djv-draft-04/blob/master/index.js).
|
|
222
|
+
|
|
223
|
+
```javascript
|
|
224
|
+
exposed = {
|
|
225
|
+
properties,
|
|
226
|
+
keywords,
|
|
227
|
+
validators,
|
|
228
|
+
formats,
|
|
229
|
+
keys,
|
|
230
|
+
transformation,
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**!Important** Modifying them will affect all *djv* instances in an application.
|
|
235
|
+
|
|
236
|
+
## Tests <a name="tests"></a>
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
npm test
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## References <a name="references"></a>
|
|
243
|
+
|
|
244
|
+
* [JSON-Schema Specification](http://json-schema.org/)
|
|
245
|
+
* [JSON-Schema Benchmark](https://github.com/ebdrup/json-schema-benchmark)
|
package/djv.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@korzio/djv-draft-04")):"function"==typeof define&&define.amd?define(["@korzio/djv-draft-04"],t):"object"==typeof exports?exports.djv=t(require("@korzio/djv-draft-04")):e.djv=t(e["@korzio/djv-draft-04"])}("undefined"!=typeof self?self:this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=8)}([function(e,t,r){"use strict";function n(e,t,r){return"function"!=typeof e?e:e(t,r)}function a(e,t){return"object"===(void 0===e?"undefined":o(e))&&Object.prototype.hasOwnProperty.call(e,t)}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports={asExpression:n,hasProperty:a}},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e){return"object"===(void 0===e?"undefined":f(e))||"boolean"==typeof e}function o(e){return!0===e?s.ANY_SCHEMA:!1===e?s.NOT_ANY_SCHEMA:e}function i(e){if("object"!==(void 0===e?"undefined":f(e))||null===e)return{enum:[e]};if(Array.isArray(e))return{items:e.map(i),additionalItems:!1};var t=Object.keys(e);return{properties:t.reduce(function(t,r){return Object.assign({},t,n({},r,i(e[r])))},{}),required:t}}var f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s={ANY_SCHEMA:{},NOT_ANY_SCHEMA:{not:{}}};e.exports={is:a,make:i,transform:o,transformation:s}},function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function a(e){if("string"!=typeof e)return e;var t=String.prototype.replace.call(e,/[^a-z0-9áéíóúñü .,_-]/gim,"");return String.prototype.trim.call(t)}function o(e,t){function r(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=void 0;return r.lines.push(e.replace(/%i/g,function(){return"i"}).replace(/\$(\d)/g,function(e,t){return""+a(n[t-1])}).replace(/(%[sd])/g,function(){return n.length&&(i=n.shift()),""+i})),r}function n(e){return e.replace("[","").replace("]","").replace("(","").replace(")","").replace("decodeURIComponent","")}function o(){return this.join(".").replace(/\.\[/g,"[")}var i="function"==typeof t.errorHandler?t.errorHandler:function(e){var t=this.data.toString().replace(/^data/,""),r=t.replace(/\['([^']+)'\]/gi,".$1").replace(/\[(i[0-9]*)\]/gi,"['+$1+']"),a="#"+t.replace(/\[i([0-9]*)\]/gi,"/items").replace(/\['([^']+)'\]/gi,"/properties/$1")+"/"+e;return"return {\n keyword: '"+e+"',\n dataPath: decodeURIComponent(\""+n(r)+'"),\n schemaPath: decodeURIComponent("'+n(a)+'")\n };'};return Object.assign(r,{cachedIndex:0,cached:[],cache:function(e){var t=r.cached[r.cached.length-1];return t[e]?"i"+t[e]:(r.cachedIndex+=1,t[e]=r.cachedIndex,"(i"+t[e]+" = "+e+")")},data:["data"],error:i,lines:[],schema:["schema"],push:r,link:function(t){return"f"+e.link(t)},visit:function(t){r.cached.push({}),e.visit(t,r),r.cached.pop()}}),r.data.toString=o,r.schema.toString=o,r}function i(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.inner,a=new Function("schema",e)(t);return n||(a.toString=function(){return e}),a}function f(e){var t=e.defineErrors,r=e.index;return"\n "+(t?"const errors = [];":"")+"\n "+(r?"let i"+Array.apply(void 0,n(Array(r))).map(function(e,t){return t+1}).join(",i")+";":"")+"\n "}function s(e){var t=e.context;if(e.inner||!t.length)return"";var r=[],n=[];return t.forEach(function(e,t){if("number"==typeof e)return void n.push(t+1+" = f"+(e+1));r.push(t+1+" = "+e)}),"const f"+r.concat(n).join(", f")+";"}function c(e){var t=e.defineErrors,r=e.lines,n=f(e),a=t?"if(errors.length) return errors;":"";return'\n "use strict";\n '+n+"\n "+r.join("\n")+"\n "+a+"\n "}function u(e,t){var r=e.cachedIndex,n=e.lines,a=t.context,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.inner,f=o.errorHandler,u={context:a,inner:i,defineErrors:f,index:r,lines:n};return"\n "+s(u)+"\n function f0(data) {\n "+c(u)+"\n }\n return f0;\n "}function p(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return function(){for(var t=arguments.length,n=Array(t),a=0;a<t;a++)n[a]=arguments[a];var o=n[n.length-1]||{},i=[e[0]];return r.forEach(function(t,r){var a=Number.isInteger(t)?n[t]:o[t];i.push(a,e[r+1])}),i.join("")}}e.exports={body:u,restore:i,template:o,expression:p}},function(e,t,r){"use strict";function n(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var a=n(["!/^[a-zA-Z]+$/.test(",")"],["!/^[a-zA-Z]+$/.test(",")"]),o=n(["!/^[a-zA-Z0-9]+$/.test(",")"],["!/^[a-zA-Z0-9]+$/.test(",")"]),i=n(["!/^[-_a-zA-Z0-9]+$/.test(",")"],["!/^[-_a-zA-Z0-9]+$/.test(",")"]),f=n(["!/^[a-fA-F0-9]+$/.test(",")"],["!/^[a-fA-F0-9]+$/.test(",")"]),s=n(["!/^[0-9]+$/.test(",")"],["!/^[0-9]+$/.test(",")"]),c=n(["isNaN(Date.parse(",")) || ~",".indexOf('/')"],["isNaN(Date.parse(",")) || ~",".indexOf(\\'/\\')"]),u=n([""," !== ",".toUpperCase()"],[""," !== ",".toUpperCase()"]),p=n([""," !== ",".toLowerCase()"],[""," !== ",".toLowerCase()"]),A=n(["",".length >= 256 || !/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9]))*$/.test(",")"],["",".length >= 256 || !/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\\\-]{0,61}[a-zA-Z0-9])(\\\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-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:){0,6}[0-9A-Fa-f]{1,4})?::)|[Vv][0-9A-Fa-f]+\\\\.[A-Za-z0-9\\\\-._~!$&\\'()*+,;=:]+)\\\\]|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|(?:[A-Za-z0-9\\\\-._~!$&\\'()*+,;=]|%[0-9A-Fa-f]{2})*)(?::[0-9]*)?(?:\\\\/(?:[A-Za-z0-9\\\\-._~!$&\\'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*|\\\\/(?:(?:[A-Za-z0-9\\\\-._~!$&\\'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:\\\\/(?:[A-Za-z0-9\\\\-._~!$&\\'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)?|(?:[A-Za-z0-9\\\\-._~!$&\\'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:\\\\/(?:[A-Za-z0-9\\\\-._~!$&\\'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*|)(?:\\\\?(?:[A-Za-z0-9\\\\-._~!$&\\'()*+,;=:@\\\\/?]|%[0-9A-Fa-f]{2})*)?(?:\\\\#(?:[A-Za-z0-9\\\\-._~!$&\\'()*+,;=:@\\\\/?]|%[0-9A-Fa-f]{2})*)?$/.test(",")"]),l=n(["!/^[^@]+@[^@]+\\.[^@]+$/.test(",")"],["!/^[^@]+@[^@]+\\\\.[^@]+$/.test(",")"]),y=n(["!/^(\\d?\\d?\\d){0,255}\\.(\\d?\\d?\\d){0,255}\\.(\\d?\\d?\\d){0,255}\\.(\\d?\\d?\\d){0,255}$/.test(",") || ",'.split(".")[3] > 255'],["!/^(\\\\d?\\\\d?\\\\d){0,255}\\\\.(\\\\d?\\\\d?\\\\d){0,255}\\\\.(\\\\d?\\\\d?\\\\d){0,255}\\\\.(\\\\d?\\\\d?\\\\d){0,255}$/.test(",") || ",'.split(".")[3] > 255']),h=n(["!/^((?=.*::)(?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[+#.\\\\/;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\\\\:[1-9][0-9]{0,3}|\\\\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\\\\:[1-9][0-9]{0,3}|\\\\*)?)*\\\\})*$/i.test(",")"]),b=r(2),g=b.expression;e.exports={alpha:g(a,"data"),alphanumeric:g(o,"data"),identifier:g(i,"data"),hexadecimal:g(f,"data"),numeric:g(s,"data"),"date-time":g(c,"data","data"),uppercase:g(u,"data","data"),lowercase:g(p,"data","data"),hostname:g(A,"data","data"),uri:g(d,"data"),email:g(l,"data"),ipv4:g(y,"data","data"),ipv6:g(h,"data"),regex:g(m,"data"),"json-pointer":g(F,"data"),"uri-reference":g(v,"data"),"uri-template":g($,"data")}},function(e,t,r){"use strict";var n=r(11),a=r(12),o=r(13),i=r(14),f=r(16),s=r(17),c=r(18),u=r(19),p=r(20),A=r(21),d=r(22),l=r(23),y=r(24),h=r(25),m=r(26),F=r(27);e.exports={name:{$ref:f,required:n,format:a,property:o,type:i,not:s,anyOf:c,oneOf:u,allOf:p,dependencies:A,properties:d,patternProperties:l,items:y,contains:h,constant:m,propertyNames:F},list:[f,n,a,o,i,s,c,u,p,A,d,l,y,h,m,F]}},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports={readOnly:"false",exclusiveMinimum:function(e){return"%s <= "+e.exclusiveMinimum},minimum:function(e){return"%s < "+e.minimum},exclusiveMaximum:function(e){return"%s >= "+e.exclusiveMaximum},maximum:function(e){return"%s > "+e.maximum},multipleOf:'($1/$2) % 1 !== 0 && typeof $1 === "number"',pattern:function(e){var t=void 0,r=void 0;return"string"==typeof e.pattern?t=e.pattern:(t=e.pattern[0],r=e.pattern[1]),'typeof ($1) === "string" && !'+new RegExp(t,r)+".test($1)"},minLength:'typeof $1 === "string" && function dltml(b,c){for(var a=0,d=b.length;a<d&&c;){var e=b.charCodeAt(a++);55296<=e&&56319>=e&&a<d&&56320!==(b.charCodeAt(a++)&64512)&&a--;c--}return!!c}($1, $2)',maxLength:'typeof $1 === "string" && function dmtml(b,c){for(var a=0,d=b.length;a<d&&0<=c;){var e=b.charCodeAt(a++);55296<=e&&56319>=e&&a<d&&56320!==(b.charCodeAt(a++)&64512)&&a--;c--}return 0>c}($1, $2)',minItems:"$1.length < $2 && Array.isArray($1)",maxItems:"$1.length > $2 && Array.isArray($1)",uniqueItems:function(e,t){return e.uniqueItems?(t(t.cache("{}")),'Array.isArray($1) && $1.some(function(item, key) {\n if(item !== null && typeof item === "object") key = JSON.stringify(item);\n else key = item;\n if('+t.cache("{}")+".hasOwnProperty(key)) return true;\n "+t.cache("{}")+"[key] = true;\n })"):"true"},minProperties:'!Array.isArray($1) && typeof $1 === "object" && Object.keys($1).length < $2',maxProperties:'!Array.isArray($1) && typeof $1 === "object" && Object.keys($1).length > $2',enum:function(e,t){return e.enum.map(function(e){var r="$1",a=e;return"object"===(void 0===e?"undefined":n(e))?(a="'"+JSON.stringify(e)+"'",r=t.cache("JSON.stringify($1)")):"string"==typeof e&&(a="'"+escape(e)+"'"),r+" != decodeURIComponent("+a+")"}).join(" && ")}}},function(e,t,r){"use strict";e.exports=["$ref","$schema","type","not","anyOf","allOf","oneOf","properties","patternProperties","additionalProperties","items","additionalItems","required","default","title","description","definitions","dependencies","$id","contains","const","examples"]},function(e,t,r){"use strict";function n(e){return"string"!=typeof e?e:e.split(u)[0]}function a(e){return c.test(e)}function o(e){return e.replace(p,"$1")}function i(e){return"string"!=typeof e?e:e.split(u)[1]}function f(e){return e.filter(function(e){return"string"==typeof e}).reduce(function(e,t){if(!e.length||a(t))return t;if(!t)return e;if(0===t.indexOf("#")){var r=e.indexOf("#");return-1===r?e+t:e.slice(0,r)+t}var n=o(e)+t;return n+(-1===n.indexOf("#")?"#":"")},"")}function s(e){return decodeURIComponent(e.replace(/~1/g,"/").replace(/~0/g,"~"))}var c=/:\/\//,u=/#\/?/,p=/(^[^:]+:\/\/[^?#]*\/).*/,A={id:"$id"};e.exports={makePath:f,isFullUri:a,head:n,fragment:i,normalize:s,keys:A}},function(e,t,r){e.exports=r(9)},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!(this instanceof a))return new a(e);this.options=e,this.resolved={},this.state=new A(null,this),this.useVersion(e.version,e.versionConfigure),this.addFormat(e.formats)}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(2),f=i.restore,s=i.expression,c=r(3),u=r(10),p=u.generate,A=u.State,d=r(28),l=d.add,y=d.use;Object.assign(a,{expression:s}),Object.assign(a.prototype,{validate:function(e,t){return this.resolve(e).fn(t)},addSchema:function(e,t){var r=this,n="object"===(void 0===e?"undefined":o(e))?e:t,a={schema:n,fn:p(this,n,void 0,this.options)};return[e,t.id].filter(function(e){return"string"==typeof e}).forEach(function(e){r.resolved[e]=Object.assign({name:e},a)}),a},removeSchema:function(e){e?delete this.resolved[e]:this.resolved={}},resolve:function(e){return"object"!==(void 0===e?"undefined":o(e))&&this.resolved[e]?this.resolved[e]:this.addSchema(e,this.state.resolve(e))},export:function(e){var t=this,r=void 0;return e?(r=this.resolve(e),r={name:e,schema:r.schema,fn:r.fn.toString()}):(r={},Object.keys(this.resolved).forEach(function(e){r[e]={name:e,schema:t.resolved[e].schema,fn:t.resolved[e].fn.toString()}})),JSON.stringify(r)},import:function(e){var t=this,r=JSON.parse(e),a=r;r.name&&r.fn&&r.schema&&(a=n({},r.name,r)),Object.keys(a).forEach(function(e){var r=a[e],n=r.name,o=r.schema,i=r.fn,s=f(i,o,t.options);t.resolved[n]={name:n,schema:o,fn:s}})},addFormat:function(e,t){if("string"==typeof e)return void(c[e]=t);"object"===(void 0===e?"undefined":o(e))&&Object.assign(c,e)},setErrorHandler:function(e){Object.assign(this.options,{errorHandler:e})},useVersion:function(e,t){"function"!=typeof t&&"draft-04"===e&&(t=r(29)),"function"==typeof t&&l(e,t),y(e)}}),e.exports=a},function(e,t,r){"use strict";function n(){var e=(arguments.length>0&&void 0!==arguments[0]&&arguments[0],arguments[1]);Object.assign(this,{context:[],entries:new Map,env:e})}function a(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n(t,e),a=arguments[3],o=u(r,a);o.visit(t);var i=s(o,r,a);return c(i,t,a)}var o=r(4),i=o.list,f=r(2),s=f.body,c=f.restore,u=f.template,p=r(0),A=p.hasProperty,d=r(7),l=d.normalize,y=d.makePath,h=d.head,m=d.isFullUri,F=d.fragment,v=d.keys,$=r(1),b=$.is,g=$.transform;n.prototype=Object.assign(Object.create(Array.prototype),{addEntry:function(e,t){var r=this.entries.get(t);return!1===r?this.context.push(t):(void 0===r&&(this.entries.set(t,!1),r=a(this.env,t,this,{inner:!0}),this.entries.set(t,r),this.revealReference(t)),this.context.push(r))},revealReference:function(e){for(var t=this.context.indexOf(e);-1!==t;t=this.context.indexOf(e))this.context[t]=this.context.length},link:function(e){var t=this.resolve(e);return this.addEntry(e,t)},resolveReference:function(e){if(m(e))return e;for(var t=void 0,r=void 0,n=this.length-1;n>=0;n-=1,t=!1){var a=this[n],o=a[v.id],i=a.$ref;if(t=o||i,m(t)){r=n;break}}for(var f=[],s=this.length-1;s>r;s-=1){var c=this[s],u=c[v.id],p=c.$ref,A=u||p;h(A)&&f.push(A)}return y([t].concat(f,[e]))},ascend:function(e){for(var t=h(e),r=this.env.resolved[t]||{},n=r.schema,a=void 0===n?this[0]:n;a.$ref&&h(a.$ref)!==h(e)&&1===Object.keys(a).length;)a=this.ascend(a.$ref);return a},descend:function(e,t){var r=this,n=F(e);if(!n&&m(e))return t;n||(n=e);var a=n.split("/"),o=a.map(l).reduce(function(e,t,n){var o=e[t];return b(o)||(o=e.definitions&&e.definitions[t]),n!==a.length-1&&A(o,v.id)&&r.push(o),o},t);return b(o)?o:t},resolve:function(e){if("string"!=typeof e)return e;var t=this.resolveReference(e),r=this.ascend(t);return this.descend(e,r)},visit:function(e,t){var r=g(e),n=this.length;this.push(r),i.some(function(e){return e(r,t)}),this.length=n}}),e.exports={State:n,generate:a}},function(e,t,r){"use strict";e.exports=function(e,t){Array.isArray(e.required)&&t("if ("+t.data+" !== null && typeof "+t.data+" === 'object' && !Array.isArray("+t.data+")) {\n "+e.required.map(function(e){return"if (!"+t.data+'.hasOwnProperty(decodeURIComponent("'+escape(e)+'"))) '+t.error("required",e)}).join("")+"\n }")}},function(e,t,r){"use strict";var n=r(3);e.exports=function(e,t){if(void 0!==e.format){var r=n[e.format];if("function"==typeof r){t("if ("+r({data:t.data,schema:e})+") "+t.error("format"))}}}},function(e,t,r){"use strict";var n=r(5),a=r(6),o=r(0),i=o.asExpression;e.exports=function(e,t){Object.keys(e).forEach(function(r){if(-1===a.indexOf(r)&&"format"!==r){var o=i(n[r],e,t);if(o){var f=t.error(r);t("if ("+o+") "+f,t.data,e[r])}}})}},function(e,t,r){"use strict";var n=r(15),a=r(0),o=a.hasProperty;e.exports=function(e,t){if(o(e,"type")){var r=t.error("type",e.type);t("if ("+("("+[].concat(e.type).map(function(e){return n[e]}).join(") && (")+")")+") "+r,t.data)}}},function(e,t,r){"use strict";e.exports={null:"%s !== null",string:'typeof %s !== "string"',boolean:'typeof %s !== "boolean"',number:'typeof %s !== "number" || %s !== %s',integer:'typeof %s !== "number" || %s % 1 !== 0',object:'!%s || typeof %s !== "object" || Array.isArray(%s)',array:"!Array.isArray(%s)",date:"!(%s instanceof Date)"}},function(e,t,r){"use strict";var n=r(0),a=n.hasProperty;e.exports=function(e,t){return!!a(e,"$ref")&&(t("if ("+t.link(e.$ref)+"("+t.data+")) "+t.error("$ref")),!0)}},function(e,t,r){"use strict";var n=r(0),a=n.hasProperty;e.exports=function(e,t){if(a(e,"not")){t("if (!"+(t.link(e.not)+"("+t.data+")")+") "+t.error("not"))}}},function(e,t,r){"use strict";var n=r(0),a=n.hasProperty;e.exports=function(e,t){if(a(e,"anyOf")){var r=t.error("anyOf"),n=e.anyOf.map(function(e){return t.link(e)+"("+t.data+")"}).join(" && ");t("if ("+n+") "+r)}}},function(e,t,r){"use strict";var n=r(0),a=n.hasProperty;e.exports=function(e,t){if(a(e,"oneOf")){var r=e.oneOf.map(function(e){return t.link(e)}),n=t.cache("["+r+"]"),o=t.cache("["+r+"]"),i=t.cache(o+".length - 1"),f=t.cache(o+".length - 1"),s=t.cache("0"),c=t.cache("0"),u=t.error("oneOf");t("for (\n "+n+", "+i+", "+s+";\n "+f+" >= 0 && "+f+" < "+o+".length;\n "+f+"--) {\n if(!"+o+"["+f+"]("+t.data+")) "+c+"++;\n }\n if ("+c+" !== 1) "+u+"\n ")}}},function(e,t,r){"use strict";var n=r(0),a=n.hasProperty;e.exports=function(e,t){if(a(e,"allOf")){var r=t.error("allOf"),n=e.allOf.map(function(e){return t.link(e)+"("+t.data+")"}).join(" || ");t("if ("+n+") "+r)}}},function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var a=r(0),o=a.hasProperty,i=r(1),f=i.is;e.exports=function(e,t){o(e,"dependencies")&&Object.keys(e.dependencies).forEach(function(r){var a=e.dependencies[r],o=t.error("dependencies");t("if ("+t.data+'.hasOwnProperty(decodeURIComponent("'+escape(r)+'"))) {'),Array.isArray(a)||"string"==typeof a?[].concat(n(a)).map(function(e){return"if (!"+t.data+'.hasOwnProperty(decodeURIComponent("'+escape(e)+'"))) '+o}).map(t):f(a)&&t.visit(a),t("}")})}},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=r(0),o=a.hasProperty;e.exports=function(e,t){o(e,"properties")&&"object"===n(e.properties)&&Object.keys(e.properties).forEach(function(r){var a=e.properties[r];if("object"!==(void 0===a?"undefined":n(a))||Object.keys(a).length){var o=!e.required||-1===e.required.indexOf(r);o&&t("if ("+t.data+'.hasOwnProperty(decodeURIComponent("'+escape(r)+'"))) {'),t.data.push("[decodeURIComponent('"+escape(r)+"')]"),t.visit(a),t.data.pop(),o&&t("}")}})}},function(e,t,r){"use strict";var n=r(0),a=n.hasProperty;e.exports=function(e,t){var r=a(e,"additionalProperties")&&!0!==e.additionalProperties,n=a(e,"patternProperties");if(r||n){t("if(typeof "+t.data+" === 'object' && !Array.isArray("+t.data+")) {"),t(t.cache("null"));var o=t.cache("null"),i=function(){!1===e.additionalProperties?t(t.error("additionalProperties")):e.additionalProperties&&(t.data.push("["+o+"]"),t.visit(e.additionalProperties),t.data.pop())};t("for ("+o+" in "+t.data+") {"),r&&n&&t(t.cache("false")),n?Object.keys(e.patternProperties).forEach(function(n){t("if ("+new RegExp(n)+".test("+o+")) {"),r&&t(t.cache("false")+" = true;");var a=e.patternProperties[n];t.data.push("["+o+"]"),t.visit(a),t.data.pop(),t("}"),e.properties?t("if ("+(r?t.cache("false")+" || ":"")+" "+t.schema+".properties.hasOwnProperty("+o+")) continue;"):r&&t("if ("+t.cache("false")+") continue;"),i()}):(e.properties&&t("if("+t.schema+".properties.hasOwnProperty("+o+")) continue;"),i()),t("}}")}}},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=r(0),o=a.hasProperty;e.exports=function(e,t){if(o(e,"items")){var r=e.items.length,a=t.error("additionalItems"),i=t.data;if(t("if(Array.isArray("+i+")) {"),Array.isArray(e.items)){if(!1===e.additionalItems&&t("if ("+i+".length > "+r+") "+a),e.items.forEach(function(e,r){t("if("+i+".length > "+r+") {"),i.push("["+r+"]"),t.visit(e),i.pop(),t("}")}),"object"===n(e.additionalItems)){var f=t.cache(r),s=t.cache(r);t("for ("+f+"; "+s+" < "+i+".length; "+s+"++) {"),i.push("["+t.cache(r)+"]"),t.visit(e.additionalItems),i.pop(),t("}")}}else{var c=t.cache("0"),u=t.cache("0");t("for ("+c+"; "+u+" < "+i+".length; "+u+"++) {"),i.push("["+u+"]"),t.visit(e.items),i.pop(),t("}")}t("}")}}},function(e,t,r){"use strict";var n=r(0),a=n.hasProperty;e.exports=function(e,t){if(a(e,"contains")){var r=t.error("contains"),n=""+t.link(e.contains),o=t.data,i=t.cache("0"),f=t.cache("0");t("if (Array.isArray("+o+")) {\n if ("+o+".length === 0) "+r+"\n for ("+i+"; "+f+" < "+o+".length; "+f+"++) {\n if (!"+n+"("+o.toString.apply(o.concat("["+f+"]"))+")) break;\n if ("+f+" === "+o+".length - 1) "+r+"\n }\n }")}}},function(e,t,r){"use strict";var n=r(0),a=n.hasProperty,o=r(1),i=o.make;e.exports=function(e,t){if(a(e,"const")){var r=i(e.const);t.visit(r)}}},function(e,t,r){"use strict";var n=r(0),a=n.hasProperty;e.exports=function(e,t){if(a(e,"propertyNames")){var r=t.link(e.propertyNames),n=t.error("propertyNames");t("if (Object.keys("+t.data+").some("+r+")) "+n)}}},function(e,t,r){"use strict";function n(e,t){d[e]=t}function a(e){if(e&&d[e]){(0,d[e])({properties:o,keywords:i,validators:f,formats:s,keys:u,transformation:A})}}var o=r(5),i=r(6),f=r(4),s=r(3),c=r(7),u=c.keys,p=r(1),A=p.transformation,d={};e.exports={add:n,use:a}},function(t,r){t.exports=e}])});
|
|
2
|
+
//# sourceMappingURL=djv.js.map
|