Commit Graph

36 Commits

Author SHA1 Message Date
toasted-nutbread
a02891e52c
Update copyright year (#1194)
* Update copyright year

* Remove redundant Author info
2021-01-01 14:50:41 -05:00
toasted-nutbread
ae9a20e0de
Json schema improvements (#1078)
* Test multipleOf

* Refactor defaulting

* Use default if invalid for non-object/array properties

* Add tests
2020-11-30 18:56:28 -05:00
toasted-nutbread
9e57509e25
Json schema default value improvement (#964)
* Ensure value has property before using its value

* Add tests
2020-10-27 19:40:19 -04:00
toasted-nutbread
75734de7eb
Option schema default value info (#963)
* Add traversal info to getValidValueOrDefault

* Move private function
2020-10-27 19:27:27 -04:00
toasted-nutbread
7d78e8737f
Cache map improvements (#856)
* Update CacheMap API; get=>getOrCreate; add get; add set; add has

* Update tests

* Add more tests
2020-09-22 20:09:12 -04:00
toasted-nutbread
8d28477562
Fix default options missing profiles (#829)
* Add minItems requirement for profiles array

* Use minItems/maxItems for default value construction
2020-09-13 19:59:02 -04:00
toasted-nutbread
f168efb69c
OptionsUtil refactor / options default values (#807)
* Replace _readFile with _fetchAsset for consistency with Backend

* Fix error messages

* Make OptionsUtil non-static

* Update how default options are assigned

* Add createValidatingProxy

* Add validate, update _onApiSetAllSettings

* Remove unused api.optionsSchemaGet

* Remove Backend._optionsSchema

* Update OptionsUtil to create its own JsonSchemaValidator

* Rename Backend._optionsSchemaValidator

* Make getDefault non-async
2020-09-11 14:15:08 -04:00
toasted-nutbread
f3dd2270a5
Json schema profile conditions (#758)
* Add clearCache function

* Add upgrade

* Use schema-based profile condition validation

* Update profile conditions settings controller

* Remove unnecessary async

* Remove old

* Remove unused templates
2020-09-04 17:44:00 -04:00
toasted-nutbread
d582c7a0f8
JSON schema refactor (#731)
* Remove JsonSchema.clone

* Move createProxy function

* Group public properties first

* Create private version of getPropertySchema

* Mark functions as private

* Use non-static getValidValueOrDefault

* Mark private

* Make public validate function not take an info parameter

* Remove JsonSchema

* Add isValid function

* Use isValid for some tests

* Fix incorrect type
2020-08-15 17:23:09 -04:00
toasted-nutbread
587822c16e
More JSON schema improvements (#729)
* Add support for constant values

* Add contains check for arrays

* Add tests

* Simplify getValidValueOrDefault testing
2020-08-11 19:21:26 -04:00
toasted-nutbread
486d44f719
Json schema improvements (#722)
* Add support for regex pattern testing

* Add tests

* Separate JsonSchemaProxyHandler statics into JsonSchemaValidator

* Use this instead of JsonSchemaValidator

* Make JsonSchemaValidator non-static

* Use cache map for regex
2020-08-09 14:18:59 -04:00
toasted-nutbread
1d02013642
Make JsonSchemaProxyHandler.unconstrainedSchema public and non-configurable (#636) 2020-07-03 11:55:39 -04:00
toasted-nutbread
cdf191336a
Clone function (#624)
* Add clone function

* Replace utilIsolate with clone

* Replace JsonSchema.isolate with clone function

* Include core.js for tests which use json-schema.js

* Update visisted set
2020-06-28 12:38:34 -04:00
4e5029f7ec Update license author field to broader to explicitly reflect that
Yomichan is an ongoing community project. It really does take a village,
and everyone who contributes code owns a part of it :)
2020-04-10 11:10:21 -07:00
toasted-nutbread
c0d91bffc4 Add no-shadow 2020-02-22 14:53:02 -05:00
toasted-nutbread
3c28c7dd7c Fix init 2020-02-02 11:22:22 -05:00
toasted-nutbread
fff1e67a5e Improve schema path when using getPropertySchema 2020-02-02 11:18:13 -05:00
toasted-nutbread
b1fc9c024a Update how property schemas are returned 2020-02-02 11:13:26 -05:00
toasted-nutbread
ea808024d7 Fix missing else 2020-02-02 11:04:38 -05:00
toasted-nutbread
3bef380e3b Add improved error information when validation fails 2020-02-02 10:51:48 -05:00
toasted-nutbread
fca5c75151 Fix ifSchema 2020-02-02 10:35:41 -05:00
toasted-nutbread
7c9fe2c6cf Fix conditional logic 2020-02-02 10:17:16 -05:00
toasted-nutbread
964db74108 Update schema validation to throw errors 2020-02-02 10:12:01 -05:00
toasted-nutbread
36e641e001 getSchemaOrValueType return null 2020-02-02 10:12:01 -05:00
toasted-nutbread
0171d86b28 Fix maxLength check 2020-02-02 10:12:01 -05:00
toasted-nutbread
52b623b5cd Improve getPropertySchema's type detection 2020-02-02 10:12:01 -05:00
toasted-nutbread
31dbeab67c Add validate on JsonSchema 2020-02-02 10:12:01 -05:00
toasted-nutbread
980a1ddf74 Improve support for array schemas 2020-02-02 10:12:01 -05:00
toasted-nutbread
a844698f15 Return unconstrained schema when additionalProperties is true/undefined 2020-02-02 10:12:01 -05:00
toasted-nutbread
203216986e Add support for conditionals 2020-02-02 10:12:01 -05:00
toasted-nutbread
6595715f7c Add support for allOf, anyOf, oneOf, and not 2020-02-02 10:12:01 -05:00
toasted-nutbread
0b474751b5 Add simplified isObject test 2020-02-02 10:12:01 -05:00
toasted-nutbread
0d7ccf25b8 Update license info URL 2020-01-01 12:00:31 -05:00
toasted-nutbread
899ef167d1 Update copyright 2020-01-01 12:00:00 -05:00
toasted-nutbread
bbace4c93b Fix schema defaults not applying to arrays 2019-12-29 18:57:29 -05:00
toasted-nutbread
b770944b12 Create proxy system for json schema validation 2019-12-29 12:33:15 -05:00