langgraph-ui-components 0.0.4 → 0.0.6
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/dist/index.es10.js +31 -16
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es100.js +36 -3156
- package/dist/index.es100.js.map +1 -1
- package/dist/index.es101.js +162 -33
- package/dist/index.es101.js.map +1 -1
- package/dist/index.es102.js +203 -5
- package/dist/index.es102.js.map +1 -1
- package/dist/index.es103.js +13 -72
- package/dist/index.es103.js.map +1 -1
- package/dist/index.es104.js +27 -34
- package/dist/index.es104.js.map +1 -1
- package/dist/index.es105.js +34 -5
- package/dist/index.es105.js.map +1 -1
- package/dist/index.es106.js +3159 -2
- package/dist/index.es106.js.map +1 -1
- package/dist/index.es107.js +5 -11
- package/dist/index.es107.js.map +1 -1
- package/dist/index.es108.js +2 -503
- package/dist/index.es108.js.map +1 -1
- package/dist/index.es109.js +16 -5
- package/dist/index.es109.js.map +1 -1
- package/dist/index.es11.js +146 -120
- package/dist/index.es11.js.map +1 -1
- package/dist/index.es110.js +13 -2
- package/dist/index.es110.js.map +1 -1
- package/dist/index.es111.js +484 -129
- package/dist/index.es111.js.map +1 -1
- package/dist/index.es112.js +5 -906
- package/dist/index.es112.js.map +1 -1
- package/dist/index.es113.js +2 -282
- package/dist/index.es113.js.map +1 -1
- package/dist/index.es114.js +148 -4
- package/dist/index.es114.js.map +1 -1
- package/dist/index.es115.js +869 -407
- package/dist/index.es115.js.map +1 -1
- package/dist/index.es116.js +274 -40
- package/dist/index.es116.js.map +1 -1
- package/dist/index.es117.js +4 -24
- package/dist/index.es117.js.map +1 -1
- package/dist/index.es118.js +437 -72
- package/dist/index.es118.js.map +1 -1
- package/dist/index.es119.js +42 -125
- package/dist/index.es119.js.map +1 -1
- package/dist/index.es12.js +13 -103
- package/dist/index.es12.js.map +1 -1
- package/dist/index.es120.js +21 -48
- package/dist/index.es120.js.map +1 -1
- package/dist/index.es121.js +77 -8
- package/dist/index.es121.js.map +1 -1
- package/dist/index.es122.js +127 -43
- package/dist/index.es122.js.map +1 -1
- package/dist/index.es123.js +41 -91
- package/dist/index.es123.js.map +1 -1
- package/dist/index.es124.js +9 -52
- package/dist/index.es124.js.map +1 -1
- package/dist/index.es125.js +44 -15
- package/dist/index.es125.js.map +1 -1
- package/dist/index.es126.js +97 -13
- package/dist/index.es126.js.map +1 -1
- package/dist/index.es127.js +52 -88
- package/dist/index.es127.js.map +1 -1
- package/dist/index.es128.js +15 -2
- package/dist/index.es128.js.map +1 -1
- package/dist/index.es129.js +87 -54
- package/dist/index.es129.js.map +1 -1
- package/dist/index.es13.js +126 -32
- package/dist/index.es13.js.map +1 -1
- package/dist/index.es130.js +2 -100
- package/dist/index.es130.js.map +1 -1
- package/dist/index.es131.js +163 -190
- package/dist/index.es131.js.map +1 -1
- package/dist/index.es132.js +2 -110
- package/dist/index.es132.js.map +1 -1
- package/dist/index.es133.js +53 -32
- package/dist/index.es133.js.map +1 -1
- package/dist/index.es134.js +99 -9
- package/dist/index.es134.js.map +1 -1
- package/dist/index.es135.js +190 -10
- package/dist/index.es135.js.map +1 -1
- package/dist/index.es136.js +108 -10
- package/dist/index.es136.js.map +1 -1
- package/dist/index.es137.js +30 -86
- package/dist/index.es137.js.map +1 -1
- package/dist/index.es138.js +10 -275
- package/dist/index.es138.js.map +1 -1
- package/dist/index.es139.js +11 -2
- package/dist/index.es139.js.map +1 -1
- package/dist/index.es140.js +11 -163
- package/dist/index.es140.js.map +1 -1
- package/dist/index.es141.js +87 -47
- package/dist/index.es141.js.map +1 -1
- package/dist/index.es142.js +266 -31
- package/dist/index.es142.js.map +1 -1
- package/dist/index.es143.js +2 -35
- package/dist/index.es143.js.map +1 -1
- package/dist/index.es144.js +155 -31
- package/dist/index.es144.js.map +1 -1
- package/dist/index.es145.js +48 -21
- package/dist/index.es145.js.map +1 -1
- package/dist/index.es146.js +33 -584
- package/dist/index.es146.js.map +1 -1
- package/dist/index.es147.js +34 -124
- package/dist/index.es147.js.map +1 -1
- package/dist/index.es148.js +31 -155
- package/dist/index.es148.js.map +1 -1
- package/dist/index.es149.js +24 -2
- package/dist/index.es149.js.map +1 -1
- package/dist/index.es15.js +15 -15
- package/dist/index.es150.js +591 -2
- package/dist/index.es150.js.map +1 -1
- package/dist/index.es151.js +125 -2
- package/dist/index.es151.js.map +1 -1
- package/dist/index.es152.js +3 -21
- package/dist/index.es152.js.map +1 -1
- package/dist/index.es153.js +2 -2
- package/dist/index.es154.js +2 -25
- package/dist/index.es154.js.map +1 -1
- package/dist/index.es155.js +22 -8
- package/dist/index.es155.js.map +1 -1
- package/dist/index.es156.js +2 -5
- package/dist/index.es156.js.map +1 -1
- package/dist/index.es157.js +24 -12
- package/dist/index.es157.js.map +1 -1
- package/dist/index.es158.js +5 -6
- package/dist/index.es158.js.map +1 -1
- package/dist/index.es159.js +12 -63
- package/dist/index.es159.js.map +1 -1
- package/dist/index.es160.js +5 -21
- package/dist/index.es160.js.map +1 -1
- package/dist/index.es161.js +8 -6
- package/dist/index.es161.js.map +1 -1
- package/dist/index.es162.js +22 -346
- package/dist/index.es162.js.map +1 -1
- package/dist/index.es163.js +12 -25
- package/dist/index.es163.js.map +1 -1
- package/dist/index.es164.js +53 -11
- package/dist/index.es164.js.map +1 -1
- package/dist/index.es165.js +59 -49
- package/dist/index.es165.js.map +1 -1
- package/dist/index.es166.js +22 -7
- package/dist/index.es166.js.map +1 -1
- package/dist/index.es167.js +5 -102
- package/dist/index.es167.js.map +1 -1
- package/dist/index.es168.js +339 -109
- package/dist/index.es168.js.map +1 -1
- package/dist/index.es169.js +7 -136
- package/dist/index.es169.js.map +1 -1
- package/dist/index.es17.js +2 -2
- package/dist/index.es170.js +97 -109
- package/dist/index.es170.js.map +1 -1
- package/dist/index.es171.js +119 -6
- package/dist/index.es171.js.map +1 -1
- package/dist/index.es172.js +136 -4
- package/dist/index.es172.js.map +1 -1
- package/dist/index.es173.js +115 -2
- package/dist/index.es173.js.map +1 -1
- package/dist/index.es174.js +6 -3737
- package/dist/index.es174.js.map +1 -1
- package/dist/index.es175.js +2 -342
- package/dist/index.es175.js.map +1 -1
- package/dist/index.es176.js +138 -105
- package/dist/index.es176.js.map +1 -1
- package/dist/index.es177.js +2 -133
- package/dist/index.es177.js.map +1 -1
- package/dist/index.es178.js +3734 -12
- package/dist/index.es178.js.map +1 -1
- package/dist/index.es179.js +326 -136
- package/dist/index.es179.js.map +1 -1
- package/dist/index.es180.js +107 -13
- package/dist/index.es180.js.map +1 -1
- package/dist/index.es181.js +131 -6
- package/dist/index.es181.js.map +1 -1
- package/dist/index.es182.js +13 -19
- package/dist/index.es182.js.map +1 -1
- package/dist/index.es183.js +139 -77
- package/dist/index.es183.js.map +1 -1
- package/dist/index.es184.js +13 -241
- package/dist/index.es184.js.map +1 -1
- package/dist/index.es185.js +8 -24
- package/dist/index.es185.js.map +1 -1
- package/dist/index.es186.js +21 -6
- package/dist/index.es186.js.map +1 -1
- package/dist/index.es187.js +90 -4
- package/dist/index.es187.js.map +1 -1
- package/dist/index.es188.js +240 -15
- package/dist/index.es188.js.map +1 -1
- package/dist/index.es189.js +24 -8
- package/dist/index.es189.js.map +1 -1
- package/dist/index.es190.js +6 -142
- package/dist/index.es190.js.map +1 -1
- package/dist/index.es191.js +4 -2
- package/dist/index.es191.js.map +1 -1
- package/dist/index.es192.js +18 -32
- package/dist/index.es192.js.map +1 -1
- package/dist/index.es193.js +8 -6
- package/dist/index.es193.js.map +1 -1
- package/dist/index.es194.js +31 -105
- package/dist/index.es194.js.map +1 -1
- package/dist/index.es195.js +6 -13
- package/dist/index.es195.js.map +1 -1
- package/dist/index.es196.js +105 -17
- package/dist/index.es196.js.map +1 -1
- package/dist/index.es197.js +11 -29
- package/dist/index.es197.js.map +1 -1
- package/dist/index.es198.js +17 -3
- package/dist/index.es198.js.map +1 -1
- package/dist/index.es199.js +30 -4
- package/dist/index.es199.js.map +1 -1
- package/dist/index.es2.js +24 -15
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es20.js +35 -66
- package/dist/index.es20.js.map +1 -1
- package/dist/index.es200.js +4 -5
- package/dist/index.es200.js.map +1 -1
- package/dist/index.es201.js +4 -36
- package/dist/index.es201.js.map +1 -1
- package/dist/index.es202.js +5 -8
- package/dist/index.es202.js.map +1 -1
- package/dist/index.es203.js +36 -5
- package/dist/index.es203.js.map +1 -1
- package/dist/index.es204.js +5 -4
- package/dist/index.es204.js.map +1 -1
- package/dist/index.es205.js +5 -41
- package/dist/index.es205.js.map +1 -1
- package/dist/index.es206.js +4 -10
- package/dist/index.es206.js.map +1 -1
- package/dist/index.es207.js +39 -239
- package/dist/index.es207.js.map +1 -1
- package/dist/index.es208.js +10 -48
- package/dist/index.es208.js.map +1 -1
- package/dist/index.es209.js +239 -32
- package/dist/index.es209.js.map +1 -1
- package/dist/index.es21.js +25 -34
- package/dist/index.es21.js.map +1 -1
- package/dist/index.es210.js +49 -11
- package/dist/index.es210.js.map +1 -1
- package/dist/index.es211.js +33 -6
- package/dist/index.es211.js.map +1 -1
- package/dist/index.es212.js +12 -6
- package/dist/index.es212.js.map +1 -1
- package/dist/index.es213.js +7 -64
- package/dist/index.es213.js.map +1 -1
- package/dist/index.es214.js +6 -40
- package/dist/index.es214.js.map +1 -1
- package/dist/index.es215.js +63 -30
- package/dist/index.es215.js.map +1 -1
- package/dist/index.es216.js +35 -56
- package/dist/index.es216.js.map +1 -1
- package/dist/index.es217.js +32 -15
- package/dist/index.es217.js.map +1 -1
- package/dist/index.es218.js +60 -21
- package/dist/index.es218.js.map +1 -1
- package/dist/index.es219.js +15 -5
- package/dist/index.es219.js.map +1 -1
- package/dist/index.es22.js +146 -27
- package/dist/index.es22.js.map +1 -1
- package/dist/index.es220.js +21 -15
- package/dist/index.es220.js.map +1 -1
- package/dist/index.es221.js +4 -32
- package/dist/index.es221.js.map +1 -1
- package/dist/index.es222.js +16 -4
- package/dist/index.es222.js.map +1 -1
- package/dist/index.es223.js +32 -4
- package/dist/index.es223.js.map +1 -1
- package/dist/index.es224.js +5 -5
- package/dist/index.es224.js.map +1 -1
- package/dist/index.es225.js +4 -7
- package/dist/index.es225.js.map +1 -1
- package/dist/index.es226.js +4 -91
- package/dist/index.es226.js.map +1 -1
- package/dist/index.es227.js +7 -17
- package/dist/index.es227.js.map +1 -1
- package/dist/index.es228.js +90 -760
- package/dist/index.es228.js.map +1 -1
- package/dist/index.es229.js +18 -66
- package/dist/index.es229.js.map +1 -1
- package/dist/index.es23.js +16 -146
- package/dist/index.es23.js.map +1 -1
- package/dist/index.es230.js +749 -161
- package/dist/index.es230.js.map +1 -1
- package/dist/index.es231.js +66 -38
- package/dist/index.es231.js.map +1 -1
- package/dist/index.es232.js +172 -135
- package/dist/index.es232.js.map +1 -1
- package/dist/index.es233.js +136 -92
- package/dist/index.es233.js.map +1 -1
- package/dist/index.es234.js +92 -32
- package/dist/index.es234.js.map +1 -1
- package/dist/index.es235.js +32 -284
- package/dist/index.es235.js.map +1 -1
- package/dist/index.es236.js +284 -25
- package/dist/index.es236.js.map +1 -1
- package/dist/index.es237.js +22 -20
- package/dist/index.es237.js.map +1 -1
- package/dist/index.es238.js +22 -13
- package/dist/index.es238.js.map +1 -1
- package/dist/index.es239.js +12 -12
- package/dist/index.es239.js.map +1 -1
- package/dist/index.es24.js +58 -295
- package/dist/index.es24.js.map +1 -1
- package/dist/index.es240.js +13 -24
- package/dist/index.es240.js.map +1 -1
- package/dist/index.es241.js +22 -42
- package/dist/index.es241.js.map +1 -1
- package/dist/index.es242.js +45 -11
- package/dist/index.es242.js.map +1 -1
- package/dist/index.es243.js +10 -10
- package/dist/index.es243.js.map +1 -1
- package/dist/index.es244.js +10 -10
- package/dist/index.es244.js.map +1 -1
- package/dist/index.es245.js +11 -14
- package/dist/index.es245.js.map +1 -1
- package/dist/index.es246.js +14 -11
- package/dist/index.es246.js.map +1 -1
- package/dist/index.es247.js +11 -11
- package/dist/index.es247.js.map +1 -1
- package/dist/index.es248.js +10 -10
- package/dist/index.es248.js.map +1 -1
- package/dist/index.es249.js +11 -15
- package/dist/index.es249.js.map +1 -1
- package/dist/index.es25.js +298 -114
- package/dist/index.es25.js.map +1 -1
- package/dist/index.es250.js +15 -11
- package/dist/index.es250.js.map +1 -1
- package/dist/index.es251.js +10 -10
- package/dist/index.es251.js.map +1 -1
- package/dist/index.es252.js +11 -11
- package/dist/index.es252.js.map +1 -1
- package/dist/index.es253.js +10 -10
- package/dist/index.es253.js.map +1 -1
- package/dist/index.es254.js +10 -10
- package/dist/index.es254.js.map +1 -1
- package/dist/index.es255.js +10 -10
- package/dist/index.es255.js.map +1 -1
- package/dist/index.es256.js +10 -10
- package/dist/index.es256.js.map +1 -1
- package/dist/index.es257.js +10 -10
- package/dist/index.es257.js.map +1 -1
- package/dist/index.es258.js +11 -56
- package/dist/index.es258.js.map +1 -1
- package/dist/index.es259.js +53 -46
- package/dist/index.es259.js.map +1 -1
- package/dist/index.es26.js +121 -5
- package/dist/index.es26.js.map +1 -1
- package/dist/index.es260.js +42 -112
- package/dist/index.es260.js.map +1 -1
- package/dist/index.es261.js +87 -352
- package/dist/index.es261.js.map +1 -1
- package/dist/index.es262.js +381 -15
- package/dist/index.es262.js.map +1 -1
- package/dist/index.es263.js +17 -10
- package/dist/index.es263.js.map +1 -1
- package/dist/index.es264.js +10 -30
- package/dist/index.es264.js.map +1 -1
- package/dist/index.es265.js +17 -17
- package/dist/index.es265.js.map +1 -1
- package/dist/index.es266.js +25 -56
- package/dist/index.es266.js.map +1 -1
- package/dist/index.es267.js +59 -14
- package/dist/index.es267.js.map +1 -1
- package/dist/index.es268.js +14 -74
- package/dist/index.es268.js.map +1 -1
- package/dist/index.es269.js +77 -11
- package/dist/index.es269.js.map +1 -1
- package/dist/index.es270.js +10 -10
- package/dist/index.es270.js.map +1 -1
- package/dist/index.es271.js +11 -15
- package/dist/index.es271.js.map +1 -1
- package/dist/index.es272.js +14 -51
- package/dist/index.es272.js.map +1 -1
- package/dist/index.es273.js +44 -158
- package/dist/index.es273.js.map +1 -1
- package/dist/index.es274.js +167 -2
- package/dist/index.es274.js.map +1 -1
- package/dist/index.es275.js +37 -10
- package/dist/index.es275.js.map +1 -1
- package/dist/index.es276.js +2 -20
- package/dist/index.es276.js.map +1 -1
- package/dist/index.es277.js +10 -38
- package/dist/index.es277.js.map +1 -1
- package/dist/index.es278.js +23 -0
- package/dist/index.es278.js.map +1 -0
- package/dist/index.es279.js +42 -0
- package/dist/index.es279.js.map +1 -0
- package/dist/index.es28.js +7 -7
- package/dist/index.es29.js +1 -1
- package/dist/index.es32.js +4 -4
- package/dist/index.es33.js +117 -13
- package/dist/index.es33.js.map +1 -1
- package/dist/index.es34.js +65 -112
- package/dist/index.es34.js.map +1 -1
- package/dist/index.es35.js +18 -71
- package/dist/index.es35.js.map +1 -1
- package/dist/index.es36.js +260 -17
- package/dist/index.es36.js.map +1 -1
- package/dist/index.es37.js +31 -249
- package/dist/index.es37.js.map +1 -1
- package/dist/index.es38.js +199 -27
- package/dist/index.es38.js.map +1 -1
- package/dist/index.es39.js +50 -198
- package/dist/index.es39.js.map +1 -1
- package/dist/index.es40.js +120 -45
- package/dist/index.es40.js.map +1 -1
- package/dist/index.es41.js +14 -132
- package/dist/index.es41.js.map +1 -1
- package/dist/index.es42.js +225 -19
- package/dist/index.es42.js.map +1 -1
- package/dist/index.es43.js +8 -229
- package/dist/index.es43.js.map +1 -1
- package/dist/index.es44.js +1190 -7
- package/dist/index.es44.js.map +1 -1
- package/dist/index.es45.js +6 -1191
- package/dist/index.es45.js.map +1 -1
- package/dist/index.es46.js +146 -6
- package/dist/index.es46.js.map +1 -1
- package/dist/index.es47.js +15 -146
- package/dist/index.es47.js.map +1 -1
- package/dist/index.es49.js +5 -93
- package/dist/index.es49.js.map +1 -1
- package/dist/index.es50.js +8 -4
- package/dist/index.es50.js.map +1 -1
- package/dist/index.es51.js +91 -33
- package/dist/index.es51.js.map +1 -1
- package/dist/index.es52.js +3 -71
- package/dist/index.es52.js.map +1 -1
- package/dist/index.es53.js +34 -36
- package/dist/index.es53.js.map +1 -1
- package/dist/index.es54.js +61 -295
- package/dist/index.es54.js.map +1 -1
- package/dist/index.es55.js +38 -9
- package/dist/index.es55.js.map +1 -1
- package/dist/index.es56.js +296 -81
- package/dist/index.es56.js.map +1 -1
- package/dist/index.es57.js +9 -8
- package/dist/index.es57.js.map +1 -1
- package/dist/index.es58.js +89 -13
- package/dist/index.es58.js.map +1 -1
- package/dist/index.es59.js +6 -141
- package/dist/index.es59.js.map +1 -1
- package/dist/index.es60.js +12 -297
- package/dist/index.es60.js.map +1 -1
- package/dist/index.es61.js +137 -60
- package/dist/index.es61.js.map +1 -1
- package/dist/index.es62.js +247 -160
- package/dist/index.es62.js.map +1 -1
- package/dist/index.es63.js +63 -31
- package/dist/index.es63.js.map +1 -1
- package/dist/index.es64.js +212 -8
- package/dist/index.es64.js.map +1 -1
- package/dist/index.es65.js +32 -10
- package/dist/index.es65.js.map +1 -1
- package/dist/index.es66.js +8 -186
- package/dist/index.es66.js.map +1 -1
- package/dist/index.es67.js +11 -23
- package/dist/index.es67.js.map +1 -1
- package/dist/index.es68.js +183 -1396
- package/dist/index.es68.js.map +1 -1
- package/dist/index.es69.js +24 -9
- package/dist/index.es69.js.map +1 -1
- package/dist/index.es70.js +1400 -8
- package/dist/index.es70.js.map +1 -1
- package/dist/index.es71.js +9 -6
- package/dist/index.es71.js.map +1 -1
- package/dist/index.es72.js +8 -163
- package/dist/index.es72.js.map +1 -1
- package/dist/index.es73.js +6 -672
- package/dist/index.es73.js.map +1 -1
- package/dist/index.es74.js +161 -10
- package/dist/index.es74.js.map +1 -1
- package/dist/index.es75.js +671 -39
- package/dist/index.es75.js.map +1 -1
- package/dist/index.es76.js +10 -32
- package/dist/index.es76.js.map +1 -1
- package/dist/index.es77.js +31 -223
- package/dist/index.es77.js.map +1 -1
- package/dist/index.es78.js +33 -29
- package/dist/index.es78.js.map +1 -1
- package/dist/index.es79.js +193 -36
- package/dist/index.es79.js.map +1 -1
- package/dist/index.es80.js +26 -72
- package/dist/index.es80.js.map +1 -1
- package/dist/index.es81.js +70 -47
- package/dist/index.es81.js.map +1 -1
- package/dist/index.es82.js +72 -26
- package/dist/index.es82.js.map +1 -1
- package/dist/index.es83.js +37 -28
- package/dist/index.es83.js.map +1 -1
- package/dist/index.es84.js +28 -55
- package/dist/index.es84.js.map +1 -1
- package/dist/index.es85.js +43 -13
- package/dist/index.es85.js.map +1 -1
- package/dist/index.es86.js +32 -132
- package/dist/index.es86.js.map +1 -1
- package/dist/index.es87.js +5 -21
- package/dist/index.es87.js.map +1 -1
- package/dist/index.es88.js +61 -170
- package/dist/index.es88.js.map +1 -1
- package/dist/index.es89.js +31 -235
- package/dist/index.es89.js.map +1 -1
- package/dist/index.es90.js +50 -348
- package/dist/index.es90.js.map +1 -1
- package/dist/index.es91.js +13 -137
- package/dist/index.es91.js.map +1 -1
- package/dist/index.es92.js +132 -65
- package/dist/index.es92.js.map +1 -1
- package/dist/index.es93.js +21 -37
- package/dist/index.es93.js.map +1 -1
- package/dist/index.es94.js +179 -34
- package/dist/index.es94.js.map +1 -1
- package/dist/index.es95.js +230 -155
- package/dist/index.es95.js.map +1 -1
- package/dist/index.es96.js +341 -189
- package/dist/index.es96.js.map +1 -1
- package/dist/index.es97.js +136 -13
- package/dist/index.es97.js.map +1 -1
- package/dist/index.es98.js +68 -28
- package/dist/index.es98.js.map +1 -1
- package/dist/index.es99.js +33 -30
- package/dist/index.es99.js.map +1 -1
- package/dist/langgraph-ui-components.css +107 -0
- package/dist/styles.css +1 -1
- package/package.json +8 -11
- package/dist/index.es48.js +0 -11
- package/dist/index.es48.js.map +0 -1
package/dist/index.es228.js
CHANGED
|
@@ -1,765 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
let valid = false;
|
|
91
|
-
for (let i = 0; i < length; i++) {
|
|
92
|
-
if (instanceType === $type[i] || $type[i] === "integer" && instanceType === "number" && instance % 1 === 0 && instance === instance) {
|
|
93
|
-
valid = true;
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (!valid) {
|
|
98
|
-
errors.push({
|
|
99
|
-
instanceLocation,
|
|
100
|
-
keyword: "type",
|
|
101
|
-
keywordLocation: `${schemaLocation}/type`,
|
|
102
|
-
error: `Instance type "${instanceType}" is invalid. Expected "${$type.join('", "')}".`
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
} else if ($type === "integer") {
|
|
106
|
-
if (instanceType !== "number" || instance % 1 || instance !== instance) {
|
|
107
|
-
errors.push({
|
|
108
|
-
instanceLocation,
|
|
109
|
-
keyword: "type",
|
|
110
|
-
keywordLocation: `${schemaLocation}/type`,
|
|
111
|
-
error: `Instance type "${instanceType}" is invalid. Expected "${$type}".`
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
} else if ($type !== void 0 && instanceType !== $type) {
|
|
115
|
-
errors.push({
|
|
116
|
-
instanceLocation,
|
|
117
|
-
keyword: "type",
|
|
118
|
-
keywordLocation: `${schemaLocation}/type`,
|
|
119
|
-
error: `Instance type "${instanceType}" is invalid. Expected "${$type}".`
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
if ($const !== void 0) {
|
|
123
|
-
if (instanceType === "object" || instanceType === "array") {
|
|
124
|
-
if (!deepCompareStrict(instance, $const)) {
|
|
125
|
-
errors.push({
|
|
126
|
-
instanceLocation,
|
|
127
|
-
keyword: "const",
|
|
128
|
-
keywordLocation: `${schemaLocation}/const`,
|
|
129
|
-
error: `Instance does not match ${JSON.stringify($const)}.`
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
} else if (instance !== $const) {
|
|
133
|
-
errors.push({
|
|
134
|
-
instanceLocation,
|
|
135
|
-
keyword: "const",
|
|
136
|
-
keywordLocation: `${schemaLocation}/const`,
|
|
137
|
-
error: `Instance does not match ${JSON.stringify($const)}.`
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
if ($enum !== void 0) {
|
|
142
|
-
if (instanceType === "object" || instanceType === "array") {
|
|
143
|
-
if (!$enum.some((value) => deepCompareStrict(instance, value))) {
|
|
144
|
-
errors.push({
|
|
145
|
-
instanceLocation,
|
|
146
|
-
keyword: "enum",
|
|
147
|
-
keywordLocation: `${schemaLocation}/enum`,
|
|
148
|
-
error: `Instance does not match any of ${JSON.stringify($enum)}.`
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
} else if (!$enum.some((value) => instance === value)) {
|
|
152
|
-
errors.push({
|
|
153
|
-
instanceLocation,
|
|
154
|
-
keyword: "enum",
|
|
155
|
-
keywordLocation: `${schemaLocation}/enum`,
|
|
156
|
-
error: `Instance does not match any of ${JSON.stringify($enum)}.`
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
if ($not !== void 0) {
|
|
161
|
-
const keywordLocation = `${schemaLocation}/not`;
|
|
162
|
-
const result = validate(instance, $not, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, keywordLocation);
|
|
163
|
-
if (result.valid) {
|
|
164
|
-
errors.push({
|
|
165
|
-
instanceLocation,
|
|
166
|
-
keyword: "not",
|
|
167
|
-
keywordLocation,
|
|
168
|
-
error: 'Instance matched "not" schema.'
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
let subEvaluateds = [];
|
|
173
|
-
if ($anyOf !== void 0) {
|
|
174
|
-
const keywordLocation = `${schemaLocation}/anyOf`;
|
|
175
|
-
const errorsLength = errors.length;
|
|
176
|
-
let anyValid = false;
|
|
177
|
-
for (let i = 0; i < $anyOf.length; i++) {
|
|
178
|
-
const subSchema = $anyOf[i];
|
|
179
|
-
const subEvaluated = Object.create(evaluated);
|
|
180
|
-
const result = validate(instance, subSchema, draft, lookup, shortCircuit, $recursiveAnchor === true ? recursiveAnchor : null, instanceLocation, `${keywordLocation}/${i}`, subEvaluated);
|
|
181
|
-
errors.push(...result.errors);
|
|
182
|
-
anyValid = anyValid || result.valid;
|
|
183
|
-
if (result.valid) {
|
|
184
|
-
subEvaluateds.push(subEvaluated);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
if (anyValid) {
|
|
188
|
-
errors.length = errorsLength;
|
|
189
|
-
} else {
|
|
190
|
-
errors.splice(errorsLength, 0, {
|
|
191
|
-
instanceLocation,
|
|
192
|
-
keyword: "anyOf",
|
|
193
|
-
keywordLocation,
|
|
194
|
-
error: "Instance does not match any subschemas."
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
if ($allOf !== void 0) {
|
|
199
|
-
const keywordLocation = `${schemaLocation}/allOf`;
|
|
200
|
-
const errorsLength = errors.length;
|
|
201
|
-
let allValid = true;
|
|
202
|
-
for (let i = 0; i < $allOf.length; i++) {
|
|
203
|
-
const subSchema = $allOf[i];
|
|
204
|
-
const subEvaluated = Object.create(evaluated);
|
|
205
|
-
const result = validate(instance, subSchema, draft, lookup, shortCircuit, $recursiveAnchor === true ? recursiveAnchor : null, instanceLocation, `${keywordLocation}/${i}`, subEvaluated);
|
|
206
|
-
errors.push(...result.errors);
|
|
207
|
-
allValid = allValid && result.valid;
|
|
208
|
-
if (result.valid) {
|
|
209
|
-
subEvaluateds.push(subEvaluated);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
if (allValid) {
|
|
213
|
-
errors.length = errorsLength;
|
|
214
|
-
} else {
|
|
215
|
-
errors.splice(errorsLength, 0, {
|
|
216
|
-
instanceLocation,
|
|
217
|
-
keyword: "allOf",
|
|
218
|
-
keywordLocation,
|
|
219
|
-
error: `Instance does not match every subschema.`
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
if ($oneOf !== void 0) {
|
|
224
|
-
const keywordLocation = `${schemaLocation}/oneOf`;
|
|
225
|
-
const errorsLength = errors.length;
|
|
226
|
-
const matches = $oneOf.filter((subSchema, i) => {
|
|
227
|
-
const subEvaluated = Object.create(evaluated);
|
|
228
|
-
const result = validate(instance, subSchema, draft, lookup, shortCircuit, $recursiveAnchor === true ? recursiveAnchor : null, instanceLocation, `${keywordLocation}/${i}`, subEvaluated);
|
|
229
|
-
errors.push(...result.errors);
|
|
230
|
-
if (result.valid) {
|
|
231
|
-
subEvaluateds.push(subEvaluated);
|
|
232
|
-
}
|
|
233
|
-
return result.valid;
|
|
234
|
-
}).length;
|
|
235
|
-
if (matches === 1) {
|
|
236
|
-
errors.length = errorsLength;
|
|
237
|
-
} else {
|
|
238
|
-
errors.splice(errorsLength, 0, {
|
|
239
|
-
instanceLocation,
|
|
240
|
-
keyword: "oneOf",
|
|
241
|
-
keywordLocation,
|
|
242
|
-
error: `Instance does not match exactly one subschema (${matches} matches).`
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
if (instanceType === "object" || instanceType === "array") {
|
|
247
|
-
Object.assign(evaluated, ...subEvaluateds);
|
|
248
|
-
}
|
|
249
|
-
if ($if !== void 0) {
|
|
250
|
-
const keywordLocation = `${schemaLocation}/if`;
|
|
251
|
-
const conditionResult = validate(instance, $if, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, keywordLocation, evaluated).valid;
|
|
252
|
-
if (conditionResult) {
|
|
253
|
-
if ($then !== void 0) {
|
|
254
|
-
const thenResult = validate(instance, $then, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${schemaLocation}/then`, evaluated);
|
|
255
|
-
if (!thenResult.valid) {
|
|
256
|
-
errors.push({
|
|
257
|
-
instanceLocation,
|
|
258
|
-
keyword: "if",
|
|
259
|
-
keywordLocation,
|
|
260
|
-
error: `Instance does not match "then" schema.`
|
|
261
|
-
}, ...thenResult.errors);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
} else if ($else !== void 0) {
|
|
265
|
-
const elseResult = validate(instance, $else, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${schemaLocation}/else`, evaluated);
|
|
266
|
-
if (!elseResult.valid) {
|
|
267
|
-
errors.push({
|
|
268
|
-
instanceLocation,
|
|
269
|
-
keyword: "if",
|
|
270
|
-
keywordLocation,
|
|
271
|
-
error: `Instance does not match "else" schema.`
|
|
272
|
-
}, ...elseResult.errors);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
if (instanceType === "object") {
|
|
277
|
-
if ($required !== void 0) {
|
|
278
|
-
for (const key of $required) {
|
|
279
|
-
if (!(key in instance)) {
|
|
280
|
-
errors.push({
|
|
281
|
-
instanceLocation,
|
|
282
|
-
keyword: "required",
|
|
283
|
-
keywordLocation: `${schemaLocation}/required`,
|
|
284
|
-
error: `Instance does not have required property "${key}".`
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
const keys = Object.keys(instance);
|
|
290
|
-
if ($minProperties !== void 0 && keys.length < $minProperties) {
|
|
291
|
-
errors.push({
|
|
292
|
-
instanceLocation,
|
|
293
|
-
keyword: "minProperties",
|
|
294
|
-
keywordLocation: `${schemaLocation}/minProperties`,
|
|
295
|
-
error: `Instance does not have at least ${$minProperties} properties.`
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
if ($maxProperties !== void 0 && keys.length > $maxProperties) {
|
|
299
|
-
errors.push({
|
|
300
|
-
instanceLocation,
|
|
301
|
-
keyword: "maxProperties",
|
|
302
|
-
keywordLocation: `${schemaLocation}/maxProperties`,
|
|
303
|
-
error: `Instance does not have at least ${$maxProperties} properties.`
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
if ($propertyNames !== void 0) {
|
|
307
|
-
const keywordLocation = `${schemaLocation}/propertyNames`;
|
|
308
|
-
for (const key in instance) {
|
|
309
|
-
const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
|
|
310
|
-
const result = validate(key, $propertyNames, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, keywordLocation);
|
|
311
|
-
if (!result.valid) {
|
|
312
|
-
errors.push({
|
|
313
|
-
instanceLocation,
|
|
314
|
-
keyword: "propertyNames",
|
|
315
|
-
keywordLocation,
|
|
316
|
-
error: `Property name "${key}" does not match schema.`
|
|
317
|
-
}, ...result.errors);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
if ($dependentRequired !== void 0) {
|
|
322
|
-
const keywordLocation = `${schemaLocation}/dependantRequired`;
|
|
323
|
-
for (const key in $dependentRequired) {
|
|
324
|
-
if (key in instance) {
|
|
325
|
-
const required = $dependentRequired[key];
|
|
326
|
-
for (const dependantKey of required) {
|
|
327
|
-
if (!(dependantKey in instance)) {
|
|
328
|
-
errors.push({
|
|
329
|
-
instanceLocation,
|
|
330
|
-
keyword: "dependentRequired",
|
|
331
|
-
keywordLocation,
|
|
332
|
-
error: `Instance has "${key}" but does not have "${dependantKey}".`
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
if ($dependentSchemas !== void 0) {
|
|
340
|
-
for (const key in $dependentSchemas) {
|
|
341
|
-
const keywordLocation = `${schemaLocation}/dependentSchemas`;
|
|
342
|
-
if (key in instance) {
|
|
343
|
-
const result = validate(instance, $dependentSchemas[key], draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${keywordLocation}/${encodePointer(key)}`, evaluated);
|
|
344
|
-
if (!result.valid) {
|
|
345
|
-
errors.push({
|
|
346
|
-
instanceLocation,
|
|
347
|
-
keyword: "dependentSchemas",
|
|
348
|
-
keywordLocation,
|
|
349
|
-
error: `Instance has "${key}" but does not match dependant schema.`
|
|
350
|
-
}, ...result.errors);
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
if ($dependencies !== void 0) {
|
|
356
|
-
const keywordLocation = `${schemaLocation}/dependencies`;
|
|
357
|
-
for (const key in $dependencies) {
|
|
358
|
-
if (key in instance) {
|
|
359
|
-
const propsOrSchema = $dependencies[key];
|
|
360
|
-
if (Array.isArray(propsOrSchema)) {
|
|
361
|
-
for (const dependantKey of propsOrSchema) {
|
|
362
|
-
if (!(dependantKey in instance)) {
|
|
363
|
-
errors.push({
|
|
364
|
-
instanceLocation,
|
|
365
|
-
keyword: "dependencies",
|
|
366
|
-
keywordLocation,
|
|
367
|
-
error: `Instance has "${key}" but does not have "${dependantKey}".`
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
} else {
|
|
372
|
-
const result = validate(instance, propsOrSchema, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${keywordLocation}/${encodePointer(key)}`);
|
|
373
|
-
if (!result.valid) {
|
|
374
|
-
errors.push({
|
|
375
|
-
instanceLocation,
|
|
376
|
-
keyword: "dependencies",
|
|
377
|
-
keywordLocation,
|
|
378
|
-
error: `Instance has "${key}" but does not match dependant schema.`
|
|
379
|
-
}, ...result.errors);
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
const thisEvaluated = /* @__PURE__ */ Object.create(null);
|
|
386
|
-
let stop = false;
|
|
387
|
-
if ($properties !== void 0) {
|
|
388
|
-
const keywordLocation = `${schemaLocation}/properties`;
|
|
389
|
-
for (const key in $properties) {
|
|
390
|
-
if (!(key in instance)) {
|
|
391
|
-
continue;
|
|
392
|
-
}
|
|
393
|
-
const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
|
|
394
|
-
const result = validate(instance[key], $properties[key], draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, `${keywordLocation}/${encodePointer(key)}`);
|
|
395
|
-
if (result.valid) {
|
|
396
|
-
evaluated[key] = thisEvaluated[key] = true;
|
|
397
|
-
} else {
|
|
398
|
-
stop = shortCircuit;
|
|
399
|
-
errors.push({
|
|
400
|
-
instanceLocation,
|
|
401
|
-
keyword: "properties",
|
|
402
|
-
keywordLocation,
|
|
403
|
-
error: `Property "${key}" does not match schema.`
|
|
404
|
-
}, ...result.errors);
|
|
405
|
-
if (stop)
|
|
406
|
-
break;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
if (!stop && $patternProperties !== void 0) {
|
|
411
|
-
const keywordLocation = `${schemaLocation}/patternProperties`;
|
|
412
|
-
for (const pattern in $patternProperties) {
|
|
413
|
-
const regex = new RegExp(pattern, "u");
|
|
414
|
-
const subSchema = $patternProperties[pattern];
|
|
415
|
-
for (const key in instance) {
|
|
416
|
-
if (!regex.test(key)) {
|
|
417
|
-
continue;
|
|
418
|
-
}
|
|
419
|
-
const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
|
|
420
|
-
const result = validate(instance[key], subSchema, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, `${keywordLocation}/${encodePointer(pattern)}`);
|
|
421
|
-
if (result.valid) {
|
|
422
|
-
evaluated[key] = thisEvaluated[key] = true;
|
|
423
|
-
} else {
|
|
424
|
-
stop = shortCircuit;
|
|
425
|
-
errors.push({
|
|
426
|
-
instanceLocation,
|
|
427
|
-
keyword: "patternProperties",
|
|
428
|
-
keywordLocation,
|
|
429
|
-
error: `Property "${key}" matches pattern "${pattern}" but does not match associated schema.`
|
|
430
|
-
}, ...result.errors);
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
if (!stop && $additionalProperties !== void 0) {
|
|
436
|
-
const keywordLocation = `${schemaLocation}/additionalProperties`;
|
|
437
|
-
for (const key in instance) {
|
|
438
|
-
if (thisEvaluated[key]) {
|
|
439
|
-
continue;
|
|
440
|
-
}
|
|
441
|
-
const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
|
|
442
|
-
const result = validate(instance[key], $additionalProperties, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, keywordLocation);
|
|
443
|
-
if (result.valid) {
|
|
444
|
-
evaluated[key] = true;
|
|
445
|
-
} else {
|
|
446
|
-
stop = shortCircuit;
|
|
447
|
-
errors.push({
|
|
448
|
-
instanceLocation,
|
|
449
|
-
keyword: "additionalProperties",
|
|
450
|
-
keywordLocation,
|
|
451
|
-
error: `Property "${key}" does not match additional properties schema.`
|
|
452
|
-
}, ...result.errors);
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
} else if (!stop && $unevaluatedProperties !== void 0) {
|
|
456
|
-
const keywordLocation = `${schemaLocation}/unevaluatedProperties`;
|
|
457
|
-
for (const key in instance) {
|
|
458
|
-
if (!evaluated[key]) {
|
|
459
|
-
const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
|
|
460
|
-
const result = validate(instance[key], $unevaluatedProperties, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, keywordLocation);
|
|
461
|
-
if (result.valid) {
|
|
462
|
-
evaluated[key] = true;
|
|
463
|
-
} else {
|
|
464
|
-
errors.push({
|
|
465
|
-
instanceLocation,
|
|
466
|
-
keyword: "unevaluatedProperties",
|
|
467
|
-
keywordLocation,
|
|
468
|
-
error: `Property "${key}" does not match unevaluated properties schema.`
|
|
469
|
-
}, ...result.errors);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
} else if (instanceType === "array") {
|
|
475
|
-
if ($maxItems !== void 0 && instance.length > $maxItems) {
|
|
476
|
-
errors.push({
|
|
477
|
-
instanceLocation,
|
|
478
|
-
keyword: "maxItems",
|
|
479
|
-
keywordLocation: `${schemaLocation}/maxItems`,
|
|
480
|
-
error: `Array has too many items (${instance.length} > ${$maxItems}).`
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
if ($minItems !== void 0 && instance.length < $minItems) {
|
|
484
|
-
errors.push({
|
|
485
|
-
instanceLocation,
|
|
486
|
-
keyword: "minItems",
|
|
487
|
-
keywordLocation: `${schemaLocation}/minItems`,
|
|
488
|
-
error: `Array has too few items (${instance.length} < ${$minItems}).`
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
const length = instance.length;
|
|
492
|
-
let i = 0;
|
|
493
|
-
let stop = false;
|
|
494
|
-
if ($prefixItems !== void 0) {
|
|
495
|
-
const keywordLocation = `${schemaLocation}/prefixItems`;
|
|
496
|
-
const length2 = Math.min($prefixItems.length, length);
|
|
497
|
-
for (; i < length2; i++) {
|
|
498
|
-
const result = validate(instance[i], $prefixItems[i], draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, `${keywordLocation}/${i}`);
|
|
499
|
-
evaluated[i] = true;
|
|
500
|
-
if (!result.valid) {
|
|
501
|
-
stop = shortCircuit;
|
|
502
|
-
errors.push({
|
|
503
|
-
instanceLocation,
|
|
504
|
-
keyword: "prefixItems",
|
|
505
|
-
keywordLocation,
|
|
506
|
-
error: `Items did not match schema.`
|
|
507
|
-
}, ...result.errors);
|
|
508
|
-
if (stop)
|
|
509
|
-
break;
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
if ($items !== void 0) {
|
|
514
|
-
const keywordLocation = `${schemaLocation}/items`;
|
|
515
|
-
if (Array.isArray($items)) {
|
|
516
|
-
const length2 = Math.min($items.length, length);
|
|
517
|
-
for (; i < length2; i++) {
|
|
518
|
-
const result = validate(instance[i], $items[i], draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, `${keywordLocation}/${i}`);
|
|
519
|
-
evaluated[i] = true;
|
|
520
|
-
if (!result.valid) {
|
|
521
|
-
stop = shortCircuit;
|
|
522
|
-
errors.push({
|
|
523
|
-
instanceLocation,
|
|
524
|
-
keyword: "items",
|
|
525
|
-
keywordLocation,
|
|
526
|
-
error: `Items did not match schema.`
|
|
527
|
-
}, ...result.errors);
|
|
528
|
-
if (stop)
|
|
529
|
-
break;
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
} else {
|
|
533
|
-
for (; i < length; i++) {
|
|
534
|
-
const result = validate(instance[i], $items, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, keywordLocation);
|
|
535
|
-
evaluated[i] = true;
|
|
536
|
-
if (!result.valid) {
|
|
537
|
-
stop = shortCircuit;
|
|
538
|
-
errors.push({
|
|
539
|
-
instanceLocation,
|
|
540
|
-
keyword: "items",
|
|
541
|
-
keywordLocation,
|
|
542
|
-
error: `Items did not match schema.`
|
|
543
|
-
}, ...result.errors);
|
|
544
|
-
if (stop)
|
|
545
|
-
break;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
if (!stop && $additionalItems !== void 0) {
|
|
550
|
-
const keywordLocation2 = `${schemaLocation}/additionalItems`;
|
|
551
|
-
for (; i < length; i++) {
|
|
552
|
-
const result = validate(instance[i], $additionalItems, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, keywordLocation2);
|
|
553
|
-
evaluated[i] = true;
|
|
554
|
-
if (!result.valid) {
|
|
555
|
-
stop = shortCircuit;
|
|
556
|
-
errors.push({
|
|
557
|
-
instanceLocation,
|
|
558
|
-
keyword: "additionalItems",
|
|
559
|
-
keywordLocation: keywordLocation2,
|
|
560
|
-
error: `Items did not match additional items schema.`
|
|
561
|
-
}, ...result.errors);
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
if ($contains !== void 0) {
|
|
567
|
-
if (length === 0 && $minContains === void 0) {
|
|
568
|
-
errors.push({
|
|
569
|
-
instanceLocation,
|
|
570
|
-
keyword: "contains",
|
|
571
|
-
keywordLocation: `${schemaLocation}/contains`,
|
|
572
|
-
error: `Array is empty. It must contain at least one item matching the schema.`
|
|
573
|
-
});
|
|
574
|
-
} else if ($minContains !== void 0 && length < $minContains) {
|
|
575
|
-
errors.push({
|
|
576
|
-
instanceLocation,
|
|
577
|
-
keyword: "minContains",
|
|
578
|
-
keywordLocation: `${schemaLocation}/minContains`,
|
|
579
|
-
error: `Array has less items (${length}) than minContains (${$minContains}).`
|
|
580
|
-
});
|
|
581
|
-
} else {
|
|
582
|
-
const keywordLocation = `${schemaLocation}/contains`;
|
|
583
|
-
const errorsLength = errors.length;
|
|
584
|
-
let contained = 0;
|
|
585
|
-
for (let j = 0; j < length; j++) {
|
|
586
|
-
const result = validate(instance[j], $contains, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${j}`, keywordLocation);
|
|
587
|
-
if (result.valid) {
|
|
588
|
-
evaluated[j] = true;
|
|
589
|
-
contained++;
|
|
590
|
-
} else {
|
|
591
|
-
errors.push(...result.errors);
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
if (contained >= ($minContains || 0)) {
|
|
595
|
-
errors.length = errorsLength;
|
|
596
|
-
}
|
|
597
|
-
if ($minContains === void 0 && $maxContains === void 0 && contained === 0) {
|
|
598
|
-
errors.splice(errorsLength, 0, {
|
|
599
|
-
instanceLocation,
|
|
600
|
-
keyword: "contains",
|
|
601
|
-
keywordLocation,
|
|
602
|
-
error: `Array does not contain item matching schema.`
|
|
603
|
-
});
|
|
604
|
-
} else if ($minContains !== void 0 && contained < $minContains) {
|
|
605
|
-
errors.push({
|
|
606
|
-
instanceLocation,
|
|
607
|
-
keyword: "minContains",
|
|
608
|
-
keywordLocation: `${schemaLocation}/minContains`,
|
|
609
|
-
error: `Array must contain at least ${$minContains} items matching schema. Only ${contained} items were found.`
|
|
610
|
-
});
|
|
611
|
-
} else if ($maxContains !== void 0 && contained > $maxContains) {
|
|
612
|
-
errors.push({
|
|
613
|
-
instanceLocation,
|
|
614
|
-
keyword: "maxContains",
|
|
615
|
-
keywordLocation: `${schemaLocation}/maxContains`,
|
|
616
|
-
error: `Array may contain at most ${$maxContains} items matching schema. ${contained} items were found.`
|
|
617
|
-
});
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
if (!stop && $unevaluatedItems !== void 0) {
|
|
622
|
-
const keywordLocation = `${schemaLocation}/unevaluatedItems`;
|
|
623
|
-
for (i; i < length; i++) {
|
|
624
|
-
if (evaluated[i]) {
|
|
625
|
-
continue;
|
|
626
|
-
}
|
|
627
|
-
const result = validate(instance[i], $unevaluatedItems, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, keywordLocation);
|
|
628
|
-
evaluated[i] = true;
|
|
629
|
-
if (!result.valid) {
|
|
630
|
-
errors.push({
|
|
631
|
-
instanceLocation,
|
|
632
|
-
keyword: "unevaluatedItems",
|
|
633
|
-
keywordLocation,
|
|
634
|
-
error: `Items did not match unevaluated items schema.`
|
|
635
|
-
}, ...result.errors);
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
if ($uniqueItems) {
|
|
640
|
-
for (let j = 0; j < length; j++) {
|
|
641
|
-
const a = instance[j];
|
|
642
|
-
const ao = typeof a === "object" && a !== null;
|
|
643
|
-
for (let k = 0; k < length; k++) {
|
|
644
|
-
if (j === k) {
|
|
645
|
-
continue;
|
|
646
|
-
}
|
|
647
|
-
const b = instance[k];
|
|
648
|
-
const bo = typeof b === "object" && b !== null;
|
|
649
|
-
if (a === b || ao && bo && deepCompareStrict(a, b)) {
|
|
650
|
-
errors.push({
|
|
651
|
-
instanceLocation,
|
|
652
|
-
keyword: "uniqueItems",
|
|
653
|
-
keywordLocation: `${schemaLocation}/uniqueItems`,
|
|
654
|
-
error: `Duplicate items at indexes ${j} and ${k}.`
|
|
655
|
-
});
|
|
656
|
-
j = Number.MAX_SAFE_INTEGER;
|
|
657
|
-
k = Number.MAX_SAFE_INTEGER;
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
} else if (instanceType === "number") {
|
|
663
|
-
if (draft === "4") {
|
|
664
|
-
if ($minimum !== void 0 && ($exclusiveMinimum === true && instance <= $minimum || instance < $minimum)) {
|
|
665
|
-
errors.push({
|
|
666
|
-
instanceLocation,
|
|
667
|
-
keyword: "minimum",
|
|
668
|
-
keywordLocation: `${schemaLocation}/minimum`,
|
|
669
|
-
error: `${instance} is less than ${$exclusiveMinimum ? "or equal to " : ""} ${$minimum}.`
|
|
670
|
-
});
|
|
671
|
-
}
|
|
672
|
-
if ($maximum !== void 0 && ($exclusiveMaximum === true && instance >= $maximum || instance > $maximum)) {
|
|
673
|
-
errors.push({
|
|
674
|
-
instanceLocation,
|
|
675
|
-
keyword: "maximum",
|
|
676
|
-
keywordLocation: `${schemaLocation}/maximum`,
|
|
677
|
-
error: `${instance} is greater than ${$exclusiveMaximum ? "or equal to " : ""} ${$maximum}.`
|
|
678
|
-
});
|
|
679
|
-
}
|
|
680
|
-
} else {
|
|
681
|
-
if ($minimum !== void 0 && instance < $minimum) {
|
|
682
|
-
errors.push({
|
|
683
|
-
instanceLocation,
|
|
684
|
-
keyword: "minimum",
|
|
685
|
-
keywordLocation: `${schemaLocation}/minimum`,
|
|
686
|
-
error: `${instance} is less than ${$minimum}.`
|
|
687
|
-
});
|
|
688
|
-
}
|
|
689
|
-
if ($maximum !== void 0 && instance > $maximum) {
|
|
690
|
-
errors.push({
|
|
691
|
-
instanceLocation,
|
|
692
|
-
keyword: "maximum",
|
|
693
|
-
keywordLocation: `${schemaLocation}/maximum`,
|
|
694
|
-
error: `${instance} is greater than ${$maximum}.`
|
|
695
|
-
});
|
|
696
|
-
}
|
|
697
|
-
if ($exclusiveMinimum !== void 0 && instance <= $exclusiveMinimum) {
|
|
698
|
-
errors.push({
|
|
699
|
-
instanceLocation,
|
|
700
|
-
keyword: "exclusiveMinimum",
|
|
701
|
-
keywordLocation: `${schemaLocation}/exclusiveMinimum`,
|
|
702
|
-
error: `${instance} is less than ${$exclusiveMinimum}.`
|
|
703
|
-
});
|
|
704
|
-
}
|
|
705
|
-
if ($exclusiveMaximum !== void 0 && instance >= $exclusiveMaximum) {
|
|
706
|
-
errors.push({
|
|
707
|
-
instanceLocation,
|
|
708
|
-
keyword: "exclusiveMaximum",
|
|
709
|
-
keywordLocation: `${schemaLocation}/exclusiveMaximum`,
|
|
710
|
-
error: `${instance} is greater than or equal to ${$exclusiveMaximum}.`
|
|
711
|
-
});
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
if ($multipleOf !== void 0) {
|
|
715
|
-
const remainder = instance % $multipleOf;
|
|
716
|
-
if (Math.abs(0 - remainder) >= 11920929e-14 && Math.abs($multipleOf - remainder) >= 11920929e-14) {
|
|
717
|
-
errors.push({
|
|
718
|
-
instanceLocation,
|
|
719
|
-
keyword: "multipleOf",
|
|
720
|
-
keywordLocation: `${schemaLocation}/multipleOf`,
|
|
721
|
-
error: `${instance} is not a multiple of ${$multipleOf}.`
|
|
722
|
-
});
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
} else if (instanceType === "string") {
|
|
726
|
-
const length = $minLength === void 0 && $maxLength === void 0 ? 0 : ucs2length(instance);
|
|
727
|
-
if ($minLength !== void 0 && length < $minLength) {
|
|
728
|
-
errors.push({
|
|
729
|
-
instanceLocation,
|
|
730
|
-
keyword: "minLength",
|
|
731
|
-
keywordLocation: `${schemaLocation}/minLength`,
|
|
732
|
-
error: `String is too short (${length} < ${$minLength}).`
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
if ($maxLength !== void 0 && length > $maxLength) {
|
|
736
|
-
errors.push({
|
|
737
|
-
instanceLocation,
|
|
738
|
-
keyword: "maxLength",
|
|
739
|
-
keywordLocation: `${schemaLocation}/maxLength`,
|
|
740
|
-
error: `String is too long (${length} > ${$maxLength}).`
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
if ($pattern !== void 0 && !new RegExp($pattern, "u").test(instance)) {
|
|
744
|
-
errors.push({
|
|
745
|
-
instanceLocation,
|
|
746
|
-
keyword: "pattern",
|
|
747
|
-
keywordLocation: `${schemaLocation}/pattern`,
|
|
748
|
-
error: `String does not match pattern.`
|
|
749
|
-
});
|
|
750
|
-
}
|
|
751
|
-
if ($format !== void 0 && format[$format] && !format[$format](instance)) {
|
|
752
|
-
errors.push({
|
|
753
|
-
instanceLocation,
|
|
754
|
-
keyword: "format",
|
|
755
|
-
keywordLocation: `${schemaLocation}/format`,
|
|
756
|
-
error: `String does not match format "${$format}".`
|
|
757
|
-
});
|
|
758
|
-
}
|
|
1
|
+
const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
|
|
2
|
+
const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
3
|
+
const TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
|
|
4
|
+
const HOSTNAME = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;
|
|
5
|
+
const URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
6
|
+
const URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[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;
|
|
7
|
+
const URL_ = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;
|
|
8
|
+
const UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
|
|
9
|
+
const JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
|
|
10
|
+
const JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;
|
|
11
|
+
const RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
|
|
12
|
+
const EMAIL = (input) => {
|
|
13
|
+
if (input[0] === '"')
|
|
14
|
+
return false;
|
|
15
|
+
const [name, host, ...rest] = input.split("@");
|
|
16
|
+
if (!name || !host || rest.length !== 0 || name.length > 64 || host.length > 253)
|
|
17
|
+
return false;
|
|
18
|
+
if (name[0] === "." || name.endsWith(".") || name.includes(".."))
|
|
19
|
+
return false;
|
|
20
|
+
if (!/^[a-z0-9.-]+$/i.test(host) || !/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(name))
|
|
21
|
+
return false;
|
|
22
|
+
return host.split(".").every((part) => /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(part));
|
|
23
|
+
};
|
|
24
|
+
const IPV4 = /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/;
|
|
25
|
+
const IPV6 = /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;
|
|
26
|
+
const DURATION = (input) => input.length > 1 && input.length < 80 && (/^P\d+([.,]\d+)?W$/.test(input) || /^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(input) && /^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(input));
|
|
27
|
+
function bind(r) {
|
|
28
|
+
return r.test.bind(r);
|
|
29
|
+
}
|
|
30
|
+
const format = {
|
|
31
|
+
date,
|
|
32
|
+
time: time.bind(void 0, false),
|
|
33
|
+
"date-time": date_time,
|
|
34
|
+
duration: DURATION,
|
|
35
|
+
uri,
|
|
36
|
+
"uri-reference": bind(URIREF),
|
|
37
|
+
"uri-template": bind(URITEMPLATE),
|
|
38
|
+
url: bind(URL_),
|
|
39
|
+
email: EMAIL,
|
|
40
|
+
hostname: bind(HOSTNAME),
|
|
41
|
+
ipv4: bind(IPV4),
|
|
42
|
+
ipv6: bind(IPV6),
|
|
43
|
+
regex,
|
|
44
|
+
uuid: bind(UUID),
|
|
45
|
+
"json-pointer": bind(JSON_POINTER),
|
|
46
|
+
"json-pointer-uri-fragment": bind(JSON_POINTER_URI_FRAGMENT),
|
|
47
|
+
"relative-json-pointer": bind(RELATIVE_JSON_POINTER)
|
|
48
|
+
};
|
|
49
|
+
function isLeapYear(year) {
|
|
50
|
+
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
51
|
+
}
|
|
52
|
+
function date(str) {
|
|
53
|
+
const matches = str.match(DATE);
|
|
54
|
+
if (!matches)
|
|
55
|
+
return false;
|
|
56
|
+
const year = +matches[1];
|
|
57
|
+
const month = +matches[2];
|
|
58
|
+
const day = +matches[3];
|
|
59
|
+
return month >= 1 && month <= 12 && day >= 1 && day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]);
|
|
60
|
+
}
|
|
61
|
+
function time(full, str) {
|
|
62
|
+
const matches = str.match(TIME);
|
|
63
|
+
if (!matches)
|
|
64
|
+
return false;
|
|
65
|
+
const hour = +matches[1];
|
|
66
|
+
const minute = +matches[2];
|
|
67
|
+
const second = +matches[3];
|
|
68
|
+
const timeZone = !!matches[5];
|
|
69
|
+
return (hour <= 23 && minute <= 59 && second <= 59 || hour == 23 && minute == 59 && second == 60) && (!full || timeZone);
|
|
70
|
+
}
|
|
71
|
+
const DATE_TIME_SEPARATOR = /t|\s/i;
|
|
72
|
+
function date_time(str) {
|
|
73
|
+
const dateTime = str.split(DATE_TIME_SEPARATOR);
|
|
74
|
+
return dateTime.length == 2 && date(dateTime[0]) && time(true, dateTime[1]);
|
|
75
|
+
}
|
|
76
|
+
const NOT_URI_FRAGMENT = /\/|:/;
|
|
77
|
+
const URI_PATTERN = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
78
|
+
function uri(str) {
|
|
79
|
+
return NOT_URI_FRAGMENT.test(str) && URI_PATTERN.test(str);
|
|
80
|
+
}
|
|
81
|
+
const Z_ANCHOR = /[^\\]\\Z/;
|
|
82
|
+
function regex(str) {
|
|
83
|
+
if (Z_ANCHOR.test(str))
|
|
84
|
+
return false;
|
|
85
|
+
try {
|
|
86
|
+
new RegExp(str, "u");
|
|
87
|
+
return true;
|
|
88
|
+
} catch (e) {
|
|
89
|
+
return false;
|
|
759
90
|
}
|
|
760
|
-
return { valid: errors.length === 0, errors };
|
|
761
91
|
}
|
|
762
92
|
export {
|
|
763
|
-
|
|
93
|
+
format
|
|
764
94
|
};
|
|
765
95
|
//# sourceMappingURL=index.es228.js.map
|