lawspec 0.31.0 → 0.31.1
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 +29 -1
- package/README.md +10 -4
- package/bin/lawspec.mjs +13 -3
- package/build.json +9 -9
- package/core.wasm +2 -2
- package/core_jsffi.js +5 -5
- package/learn/adapters.mjs +226 -0
- package/learn/app.mjs +1279 -0
- package/learn/assert.mjs +33 -0
- package/learn/assets.mjs +15 -0
- package/learn/browser-runtime.mjs +58 -0
- package/learn/bundle.mjs +118 -0
- package/learn/compile-worker.mjs +106 -0
- package/learn/compiler.mjs +230 -0
- package/learn/coverage.json +8187 -0
- package/learn/curriculum.json +2952 -0
- package/learn/fantomas-worker.mjs +25 -0
- package/learn/format-worker.mjs +148 -0
- package/learn/fsharp.mjs +83 -0
- package/learn/harness-host.mjs +22 -0
- package/learn/index.html +326 -0
- package/learn/lawspec-core.mjs +223 -0
- package/learn/lawspec-language.mjs +69 -0
- package/learn/node-test.mjs +11 -0
- package/learn/presentation.mjs +73 -0
- package/learn/runner.mjs +72 -0
- package/learn/sandbox-frame.html +34 -0
- package/learn/sandbox.mjs +91 -0
- package/learn/store.mjs +141 -0
- package/learn/story.mjs +42 -0
- package/learn/style-options.json +16 -0
- package/learn/style.css +1023 -0
- package/learn/theme.js +77 -0
- package/learn/typescript.mjs +53 -0
- package/learn/vendor/@fontsource-atkinson-hyperlegible-LICENSE.txt +93 -0
- package/learn/vendor/@fontsource-atkinson-hyperlegible-mono-LICENSE.txt +93 -0
- package/learn/vendor/@fontsource-overpass-LICENSE.txt +93 -0
- package/learn/vendor/assemblies.json +1 -0
- package/learn/vendor/editor-worker.js +30 -0
- package/learn/vendor/editor.css +1 -0
- package/learn/vendor/editor.mjs +931 -0
- package/learn/vendor/esbuild-wasm-LICENSE.txt +21 -0
- package/learn/vendor/esbuild.mjs +2683 -0
- package/learn/vendor/esbuild.wasm +0 -0
- package/learn/vendor/fable-library/Array.js +1347 -0
- package/learn/vendor/fable-library/Async.js +134 -0
- package/learn/vendor/fable-library/AsyncBuilder.js +183 -0
- package/learn/vendor/fable-library/BigInt.js +306 -0
- package/learn/vendor/fable-library/BitConverter.js +138 -0
- package/learn/vendor/fable-library/Boolean.js +22 -0
- package/learn/vendor/fable-library/CHANGELOG.md +242 -0
- package/learn/vendor/fable-library/Char.js +202 -0
- package/learn/vendor/fable-library/Choice.js +184 -0
- package/learn/vendor/fable-library/CollectionUtil.js +182 -0
- package/learn/vendor/fable-library/ConditionalWeakTable.js +21 -0
- package/learn/vendor/fable-library/Date.js +841 -0
- package/learn/vendor/fable-library/DateOffset.js +261 -0
- package/learn/vendor/fable-library/DateOnly.js +124 -0
- package/learn/vendor/fable-library/Decimal.js +238 -0
- package/learn/vendor/fable-library/Double.js +47 -0
- package/learn/vendor/fable-library/Encoding.js +185 -0
- package/learn/vendor/fable-library/Event.js +93 -0
- package/learn/vendor/fable-library/FSharp.Collections.js +45 -0
- package/learn/vendor/fable-library/FSharp.Core.CompilerServices.js +27 -0
- package/learn/vendor/fable-library/FSharp.Core.js +156 -0
- package/learn/vendor/fable-library/Global.js +29 -0
- package/learn/vendor/fable-library/Guid.js +161 -0
- package/learn/vendor/fable-library/Int32.js +135 -0
- package/learn/vendor/fable-library/List.js +1323 -0
- package/learn/vendor/fable-library/Long.js +47 -0
- package/learn/vendor/fable-library/MailboxProcessor.js +94 -0
- package/learn/vendor/fable-library/Map.js +1396 -0
- package/learn/vendor/fable-library/MapUtil.js +130 -0
- package/learn/vendor/fable-library/MutableMap.js +339 -0
- package/learn/vendor/fable-library/MutableSet.js +233 -0
- package/learn/vendor/fable-library/Native.js +14 -0
- package/learn/vendor/fable-library/Numeric.js +75 -0
- package/learn/vendor/fable-library/Observable.js +113 -0
- package/learn/vendor/fable-library/Option.js +104 -0
- package/learn/vendor/fable-library/README.md +3 -0
- package/learn/vendor/fable-library/Random.js +172 -0
- package/learn/vendor/fable-library/Range.js +45 -0
- package/learn/vendor/fable-library/Reflection.js +479 -0
- package/learn/vendor/fable-library/RegExp.js +141 -0
- package/learn/vendor/fable-library/Result.js +165 -0
- package/learn/vendor/fable-library/Seq.js +1417 -0
- package/learn/vendor/fable-library/Seq2.js +111 -0
- package/learn/vendor/fable-library/Set.js +1816 -0
- package/learn/vendor/fable-library/String.js +674 -0
- package/learn/vendor/fable-library/System.Collections.Generic.js +333 -0
- package/learn/vendor/fable-library/System.Text.js +200 -0
- package/learn/vendor/fable-library/System.js +289 -0
- package/learn/vendor/fable-library/TimeOnly.js +122 -0
- package/learn/vendor/fable-library/TimeSpan.js +180 -0
- package/learn/vendor/fable-library/Timer.js +67 -0
- package/learn/vendor/fable-library/Types.js +198 -0
- package/learn/vendor/fable-library/Unicode.13.0.0.js +4 -0
- package/learn/vendor/fable-library/Uri.js +165 -0
- package/learn/vendor/fable-library/Util.js +796 -0
- package/learn/vendor/fable-library/big.d.ts +338 -0
- package/learn/vendor/fable-library/lib/big.js +825 -0
- package/learn/vendor/fable-library/package.json +24 -0
- package/learn/vendor/fable-library/quotation.js +618 -0
- package/learn/vendor/fable.js +430 -0
- package/learn/vendor/fantomas/FSharp.Core.uawo19tl4c.wasm +0 -0
- package/learn/vendor/fantomas/Fantomas.Core.stnanlnpyw.wasm +0 -0
- package/learn/vendor/fantomas/Fantomas.FCS.lqohfu5o9y.wasm +0 -0
- package/learn/vendor/fantomas/LawSpec.Learn.Formatter.5arcua4vy0.wasm +0 -0
- package/learn/vendor/fantomas/LawSpec.Learn.Formatter.u1ne3a6xd2.wasm +0 -0
- package/learn/vendor/fantomas/Microsoft.CSharp.mp8lhr6rez.wasm +0 -0
- package/learn/vendor/fantomas/Microsoft.VisualBasic.0e5fchkecn.wasm +0 -0
- package/learn/vendor/fantomas/Microsoft.VisualBasic.Core.17wn27qal2.wasm +0 -0
- package/learn/vendor/fantomas/Microsoft.Win32.Primitives.9d566sle9e.wasm +0 -0
- package/learn/vendor/fantomas/Microsoft.Win32.Registry.52dy96yk8i.wasm +0 -0
- package/learn/vendor/fantomas/System.AppContext.jwujeh069z.wasm +0 -0
- package/learn/vendor/fantomas/System.Buffers.y0isk1x97h.wasm +0 -0
- package/learn/vendor/fantomas/System.Collections.Concurrent.x5koi7bzem.wasm +0 -0
- package/learn/vendor/fantomas/System.Collections.Immutable.diwg7advch.wasm +0 -0
- package/learn/vendor/fantomas/System.Collections.NonGeneric.4089xs440e.wasm +0 -0
- package/learn/vendor/fantomas/System.Collections.Specialized.hj81u7zblb.wasm +0 -0
- package/learn/vendor/fantomas/System.Collections.nvrdeoknr1.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.Annotations.yatcnfjeuk.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.DataAnnotations.led9l5awu3.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.EventBasedAsync.hpvp6cf4de.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.Primitives.v7cajwpaqo.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.TypeConverter.xk1hnyt762.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.rrnda1lucx.wasm +0 -0
- package/learn/vendor/fantomas/System.Configuration.bn9vghjcq8.wasm +0 -0
- package/learn/vendor/fantomas/System.Console.09ajpiafhz.wasm +0 -0
- package/learn/vendor/fantomas/System.Core.wc649o5mw9.wasm +0 -0
- package/learn/vendor/fantomas/System.Data.Common.s4cowzd9a9.wasm +0 -0
- package/learn/vendor/fantomas/System.Data.DataSetExtensions.5fm360ikxl.wasm +0 -0
- package/learn/vendor/fantomas/System.Data.fsu4j4t4jw.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.Contracts.p74re5oxzn.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.Debug.622sixg49n.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.DiagnosticSource.2j35bc2g2b.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.FileVersionInfo.7n0wdvltaa.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.Process.8iffh49mew.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.StackTrace.1yz88vico8.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.TextWriterTraceListener.ua8iuh2vhj.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.Tools.roy5445ugj.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.TraceSource.6qx1ldzz7g.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.Tracing.b4799zpaas.wasm +0 -0
- package/learn/vendor/fantomas/System.Drawing.8gcjjqj0pu.wasm +0 -0
- package/learn/vendor/fantomas/System.Drawing.Primitives.y2uveru2yk.wasm +0 -0
- package/learn/vendor/fantomas/System.Dynamic.Runtime.023zrvzh9x.wasm +0 -0
- package/learn/vendor/fantomas/System.Formats.Asn1.znpklkbgqv.wasm +0 -0
- package/learn/vendor/fantomas/System.Formats.Tar.5yybjepfi2.wasm +0 -0
- package/learn/vendor/fantomas/System.Globalization.Calendars.10g6hyjy3k.wasm +0 -0
- package/learn/vendor/fantomas/System.Globalization.Extensions.hrinfrismg.wasm +0 -0
- package/learn/vendor/fantomas/System.Globalization.uvs4rah8fk.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.4j645gw40d.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Compression.2z7vdt6tfb.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Compression.Brotli.fv80xs79j3.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Compression.FileSystem.88jdddz3sw.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Compression.ZipFile.jkn9avr4vo.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.FileSystem.AccessControl.yme0uhbu37.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.FileSystem.DriveInfo.qas7wf73rs.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.FileSystem.Primitives.d1jmhkzu0e.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.FileSystem.Watcher.z570derp0d.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.FileSystem.o6jtz51fup.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.IsolatedStorage.hqyeyb5ipe.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.MemoryMappedFiles.zhamjnusxd.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Pipelines.wrmw5vws31.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Pipes.AccessControl.qcancj8gj2.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Pipes.zhcyguvwkr.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.UnmanagedMemoryStream.o8cpjnlard.wasm +0 -0
- package/learn/vendor/fantomas/System.Linq.AsyncEnumerable.hyc0b7okjw.wasm +0 -0
- package/learn/vendor/fantomas/System.Linq.Expressions.ldibvm0efj.wasm +0 -0
- package/learn/vendor/fantomas/System.Linq.Parallel.2buevezvch.wasm +0 -0
- package/learn/vendor/fantomas/System.Linq.Queryable.cvq43g1awj.wasm +0 -0
- package/learn/vendor/fantomas/System.Linq.lz6mvi0hm2.wasm +0 -0
- package/learn/vendor/fantomas/System.Memory.3jekerw0ga.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Http.Json.8k237kkwec.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Http.cityx2bvcl.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.HttpListener.s1jreclykx.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Mail.cmlj4c0gto.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.NameResolution.q3gf18q13l.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.NetworkInformation.xaz5tjw7d0.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Ping.a40atim1h0.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Primitives.i88i20r8sr.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Quic.hx06eo5xkj.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Requests.hkjxlfe5f5.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Security.ch34yya69o.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.ServerSentEvents.0u7o0jk3p1.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.ServicePoint.xbhxnytx4l.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Sockets.hzgzlvkc9l.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.WebClient.84i8nwzbgu.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.WebHeaderCollection.326nl7s9g3.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.WebProxy.oq3mgkkqef.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.WebSockets.2cx1v74vg8.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.WebSockets.Client.rafzkktw8j.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.w1hpj3bo6r.wasm +0 -0
- package/learn/vendor/fantomas/System.Numerics.Vectors.oyv7biw9ux.wasm +0 -0
- package/learn/vendor/fantomas/System.Numerics.lyu36wqn19.wasm +0 -0
- package/learn/vendor/fantomas/System.ObjectModel.kxu80demuu.wasm +0 -0
- package/learn/vendor/fantomas/System.Private.CoreLib.1vy46s12u6.wasm +0 -0
- package/learn/vendor/fantomas/System.Private.DataContractSerialization.ao8k9iu77a.wasm +0 -0
- package/learn/vendor/fantomas/System.Private.Uri.itn0n2zjd0.wasm +0 -0
- package/learn/vendor/fantomas/System.Private.Xml.19nzpxrx8w.wasm +0 -0
- package/learn/vendor/fantomas/System.Private.Xml.Linq.tw5eq1hjvo.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.DispatchProxy.7lajnj8s8c.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Emit.7liz9zln06.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Emit.ILGeneration.1ut3qgacw8.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Emit.Lightweight.d0gvllb1jj.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Extensions.zr5bhwfczd.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Metadata.ff6np6mz2j.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Primitives.igpmvwv78c.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.TypeExtensions.qouojzlnp9.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.mk3jyxvh13.wasm +0 -0
- package/learn/vendor/fantomas/System.Resources.Reader.41ppfyz2vc.wasm +0 -0
- package/learn/vendor/fantomas/System.Resources.ResourceManager.sfwvfmw1ea.wasm +0 -0
- package/learn/vendor/fantomas/System.Resources.Writer.3uvs9tp38z.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.CompilerServices.Unsafe.puz1xm53oc.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.CompilerServices.VisualC.9qdau315py.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Extensions.i7gntui96b.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Handles.00oxj4o6ov.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.InteropServices.JavaScript.9kq1vofond.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.InteropServices.RuntimeInformation.my7qeqbhfh.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.InteropServices.vqp80tnwc7.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Intrinsics.u0samjybfo.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Loader.n6zxw1b98a.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Numerics.o40sjhz59x.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Serialization.Formatters.1esvva4te3.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Serialization.Json.4n7u09advh.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Serialization.Primitives.xs2bo91wvk.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Serialization.Xml.ny21jmziti.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Serialization.qcxaur5wqs.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.odq454d6j9.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.AccessControl.8yfnzmqzaq.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Claims.8ogy0860de.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.Algorithms.8zijp1svfw.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.Cng.yxagtt77no.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.Csp.uhfbvvau84.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.Encoding.2ywrusvy8q.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.OpenSsl.oa268u7i92.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.Primitives.5uhvqe8puk.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.X509Certificates.6i7pxilopt.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.d0quqk1iyr.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Principal.Windows.gpqua4rz29.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Principal.i20kfklf3g.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.SecureString.x2y8tzci3c.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.e83vvh6sl2.wasm +0 -0
- package/learn/vendor/fantomas/System.ServiceModel.Web.poglliv2no.wasm +0 -0
- package/learn/vendor/fantomas/System.ServiceProcess.yro5uj2opo.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.Encoding.CodePages.2wchx40i7z.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.Encoding.Extensions.8utaw61kn5.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.Encoding.cxdyfepnpj.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.Encodings.Web.37ehbi7cye.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.Json.ixiaa8hd3h.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.RegularExpressions.2fhfmkk6vf.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.6pry74a050.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.AccessControl.76zfdfy8go.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Channels.gpxnr01lmp.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Overlapped.aqpl8tzdyc.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Tasks.Dataflow.ytwttt7fzh.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Tasks.Extensions.0deavcb00v.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Tasks.Parallel.tjwtxugso0.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Tasks.fu4qd5h3qy.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Thread.klaua2by9m.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.ThreadPool.mkzm212njz.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Timer.yp49llu5h2.wasm +0 -0
- package/learn/vendor/fantomas/System.Transactions.Local.vz6cgeh4w7.wasm +0 -0
- package/learn/vendor/fantomas/System.Transactions.ipwm3rsy66.wasm +0 -0
- package/learn/vendor/fantomas/System.ValueTuple.7ol6ljuhx8.wasm +0 -0
- package/learn/vendor/fantomas/System.Web.HttpUtility.itlvncjd96.wasm +0 -0
- package/learn/vendor/fantomas/System.Web.np8uzzakvl.wasm +0 -0
- package/learn/vendor/fantomas/System.Windows.18nzio44t3.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.45jprtg1pa.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.Linq.v9v8udncm1.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.ReaderWriter.a9mr08uzci.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.Serialization.03juoguwgc.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.XDocument.c9dhjnzqjb.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.XPath.XDocument.138b12i1pm.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.XPath.pvxm9341ce.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.XmlDocument.450wsyxvl0.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.XmlSerializer.y3t2n0tce7.wasm +0 -0
- package/learn/vendor/fantomas/System.gjriafnqmz.wasm +0 -0
- package/learn/vendor/fantomas/WindowsBase.8zsce9qxfb.wasm +0 -0
- package/learn/vendor/fantomas/cs/FSharp.Core.resources.9ehmavdel7.wasm +0 -0
- package/learn/vendor/fantomas/de/FSharp.Core.resources.2ofmxloa01.wasm +0 -0
- package/learn/vendor/fantomas/dotnet.js +1233 -0
- package/learn/vendor/fantomas/dotnet.native.b6l13xorvf.js +16 -0
- package/learn/vendor/fantomas/dotnet.native.rw4kynp763.wasm +0 -0
- package/learn/vendor/fantomas/dotnet.runtime.v06hirbjsv.js +4 -0
- package/learn/vendor/fantomas/es/FSharp.Core.resources.hkr5ggb4tr.wasm +0 -0
- package/learn/vendor/fantomas/fr/FSharp.Core.resources.43soen28ow.wasm +0 -0
- package/learn/vendor/fantomas/icudt_CJK.tjcz0u77k5.dat +0 -0
- package/learn/vendor/fantomas/icudt_EFIGS.tptq2av103.dat +0 -0
- package/learn/vendor/fantomas/icudt_no_CJK.lfu7j35m59.dat +0 -0
- package/learn/vendor/fantomas/it/FSharp.Core.resources.m60n5ls7oq.wasm +0 -0
- package/learn/vendor/fantomas/ja/FSharp.Core.resources.o6oof69v14.wasm +0 -0
- package/learn/vendor/fantomas/ko/FSharp.Core.resources.q6l4snlu9o.wasm +0 -0
- package/learn/vendor/fantomas/mscorlib.8ptuc08eli.wasm +0 -0
- package/learn/vendor/fantomas/netstandard.eymp85mooh.wasm +0 -0
- package/learn/vendor/fantomas/pl/FSharp.Core.resources.8bni0w6j8b.wasm +0 -0
- package/learn/vendor/fantomas/pt-BR/FSharp.Core.resources.k849vqm41u.wasm +0 -0
- package/learn/vendor/fantomas/ru/FSharp.Core.resources.jz9rhhtsla.wasm +0 -0
- package/learn/vendor/fantomas/tr/FSharp.Core.resources.wn6vbvjm1u.wasm +0 -0
- package/learn/vendor/fantomas/zh-Hans/FSharp.Core.resources.z7zzbso094.wasm +0 -0
- package/learn/vendor/fantomas/zh-Hant/FSharp.Core.resources.iammfsi7ls.wasm +0 -0
- package/learn/vendor/fast-check-LICENSE.txt +21 -0
- package/learn/vendor/fast-check.mjs +37 -0
- package/learn/vendor/fonts/atkinson-hyperlegible-latin-400-normal.woff2 +0 -0
- package/learn/vendor/fonts/atkinson-hyperlegible-latin-700-normal.woff2 +0 -0
- package/learn/vendor/fonts/atkinson-hyperlegible-mono-latin-400-normal.woff2 +0 -0
- package/learn/vendor/fonts/overpass-latin-600-normal.woff2 +0 -0
- package/learn/vendor/fonts/overpass-latin-700-normal.woff2 +0 -0
- package/learn/vendor/formatter-licenses/DotNet-LICENSE.txt +23 -0
- package/learn/vendor/formatter-licenses/DotNet-THIRD-PARTY-NOTICES.txt +1418 -0
- package/learn/vendor/formatter-licenses/FSharp-LICENSE.txt +23 -0
- package/learn/vendor/formatter-licenses/Fantomas-LICENSE.txt +202 -0
- package/learn/vendor/formatter-licenses/README.md +12 -0
- package/learn/vendor/manifest.json +1358 -0
- package/learn/vendor/metadata/Browser.Blob.dll +0 -0
- package/learn/vendor/metadata/Browser.Dom.dll +0 -0
- package/learn/vendor/metadata/Browser.Event.dll +0 -0
- package/learn/vendor/metadata/Browser.Gamepad.dll +0 -0
- package/learn/vendor/metadata/Browser.WebGL.dll +0 -0
- package/learn/vendor/metadata/Browser.WebStorage.dll +0 -0
- package/learn/vendor/metadata/FSharp.Core.dll +0 -0
- package/learn/vendor/metadata/Fable.Core.dll +0 -0
- package/learn/vendor/metadata/Fable.Repl.Lib.dll +0 -0
- package/learn/vendor/metadata/System.Collections.Concurrent.dll +0 -0
- package/learn/vendor/metadata/System.Collections.dll +0 -0
- package/learn/vendor/metadata/System.ComponentModel.Primitives.dll +0 -0
- package/learn/vendor/metadata/System.ComponentModel.TypeConverter.dll +0 -0
- package/learn/vendor/metadata/System.ComponentModel.dll +0 -0
- package/learn/vendor/metadata/System.Console.dll +0 -0
- package/learn/vendor/metadata/System.Core.dll +0 -0
- package/learn/vendor/metadata/System.Diagnostics.Debug.dll +0 -0
- package/learn/vendor/metadata/System.Diagnostics.Tools.dll +0 -0
- package/learn/vendor/metadata/System.Diagnostics.Tracing.dll +0 -0
- package/learn/vendor/metadata/System.Globalization.dll +0 -0
- package/learn/vendor/metadata/System.IO.dll +0 -0
- package/learn/vendor/metadata/System.Net.Requests.dll +0 -0
- package/learn/vendor/metadata/System.Net.WebClient.dll +0 -0
- package/learn/vendor/metadata/System.Numerics.dll +0 -0
- package/learn/vendor/metadata/System.Reflection.Extensions.dll +0 -0
- package/learn/vendor/metadata/System.Reflection.Metadata.dll +0 -0
- package/learn/vendor/metadata/System.Reflection.Primitives.dll +0 -0
- package/learn/vendor/metadata/System.Reflection.TypeExtensions.dll +0 -0
- package/learn/vendor/metadata/System.Reflection.dll +0 -0
- package/learn/vendor/metadata/System.Runtime.Extensions.dll +0 -0
- package/learn/vendor/metadata/System.Runtime.InteropServices.dll +0 -0
- package/learn/vendor/metadata/System.Runtime.Numerics.dll +0 -0
- package/learn/vendor/metadata/System.Runtime.dll +0 -0
- package/learn/vendor/metadata/System.Text.Encoding.Extensions.dll +0 -0
- package/learn/vendor/metadata/System.Text.Encoding.dll +0 -0
- package/learn/vendor/metadata/System.Text.RegularExpressions.dll +0 -0
- package/learn/vendor/metadata/System.Threading.Tasks.dll +0 -0
- package/learn/vendor/metadata/System.Threading.Thread.dll +0 -0
- package/learn/vendor/metadata/System.Threading.dll +0 -0
- package/learn/vendor/metadata/System.ValueTuple.dll +0 -0
- package/learn/vendor/metadata/System.dll +0 -0
- package/learn/vendor/metadata/mscorlib.dll +0 -0
- package/learn/vendor/metadata/netstandard.dll +0 -0
- package/learn/vendor/monaco-editor-LICENSE.txt +21 -0
- package/learn/vendor/prettier/babel.mjs +16 -0
- package/learn/vendor/prettier/brace-style.mjs +376 -0
- package/learn/vendor/prettier/estree.mjs +44 -0
- package/learn/vendor/prettier/standalone.mjs +29 -0
- package/learn/vendor/prettier/typescript.mjs +22 -0
- package/learn/vendor/prettier-LICENSE.txt +7 -0
- package/learn/vendor/prettier-plugin-brace-style-LICENSE.txt +21 -0
- package/learn/vendor/typescript-LICENSE.txt +55 -0
- package/learn/vendor/typescript-libs.json +1 -0
- package/learn/vendor/typescript.mjs +451 -0
- package/learn/vendor/zod-LICENSE.txt +21 -0
- package/learn/web-format.mjs +8 -0
- package/learn.mjs +126 -0
- package/package.json +3 -2
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { Exception, equals } from "./Util.js";
|
|
2
|
+
import { Union } from "./Types.js";
|
|
3
|
+
const CaseRules = {
|
|
4
|
+
None: 0,
|
|
5
|
+
LowerFirst: 1,
|
|
6
|
+
SnakeCase: 2,
|
|
7
|
+
SnakeCaseAllCaps: 3,
|
|
8
|
+
KebabCase: 4,
|
|
9
|
+
LowerAll: 5,
|
|
10
|
+
};
|
|
11
|
+
function dashify(str, separator) {
|
|
12
|
+
return str.replace(/[a-z]?[A-Z]/g, (m) => m.length === 1
|
|
13
|
+
? m.toLowerCase()
|
|
14
|
+
: m.charAt(0) + separator + m.charAt(1).toLowerCase());
|
|
15
|
+
}
|
|
16
|
+
function changeCase(str, caseRule) {
|
|
17
|
+
switch (caseRule) {
|
|
18
|
+
case CaseRules.LowerFirst:
|
|
19
|
+
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
20
|
+
case CaseRules.SnakeCase:
|
|
21
|
+
return dashify(str, "_");
|
|
22
|
+
case CaseRules.SnakeCaseAllCaps:
|
|
23
|
+
return dashify(str, "_").toUpperCase();
|
|
24
|
+
case CaseRules.KebabCase:
|
|
25
|
+
return dashify(str, "-");
|
|
26
|
+
case CaseRules.LowerAll:
|
|
27
|
+
return str.toLowerCase();
|
|
28
|
+
case CaseRules.None:
|
|
29
|
+
default:
|
|
30
|
+
return str;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export function keyValueList(fields, caseRule = CaseRules.None) {
|
|
34
|
+
const obj = {};
|
|
35
|
+
const definedCaseRule = caseRule;
|
|
36
|
+
function fail(kvPair) {
|
|
37
|
+
throw new Exception("Cannot infer key and value of " + String(kvPair));
|
|
38
|
+
}
|
|
39
|
+
function assign(key, caseRule, value) {
|
|
40
|
+
key = changeCase(key, caseRule);
|
|
41
|
+
obj[key] = value;
|
|
42
|
+
}
|
|
43
|
+
for (let kvPair of fields) {
|
|
44
|
+
let caseRule = CaseRules.None;
|
|
45
|
+
if (kvPair == null) {
|
|
46
|
+
fail(kvPair);
|
|
47
|
+
}
|
|
48
|
+
// Deflate unions and use the defined case rule
|
|
49
|
+
if (kvPair instanceof Union) {
|
|
50
|
+
const name = kvPair.cases()[kvPair.tag];
|
|
51
|
+
kvPair = kvPair.fields.length === 0 ? name : [name].concat(kvPair.fields);
|
|
52
|
+
caseRule = definedCaseRule;
|
|
53
|
+
}
|
|
54
|
+
if (Array.isArray(kvPair)) {
|
|
55
|
+
switch (kvPair.length) {
|
|
56
|
+
case 0:
|
|
57
|
+
fail(kvPair);
|
|
58
|
+
break;
|
|
59
|
+
case 1:
|
|
60
|
+
assign(kvPair[0], caseRule, true);
|
|
61
|
+
break;
|
|
62
|
+
case 2:
|
|
63
|
+
const value = kvPair[1];
|
|
64
|
+
assign(kvPair[0], caseRule, value);
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
assign(kvPair[0], caseRule, kvPair.slice(1));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else if (typeof kvPair === "string") {
|
|
71
|
+
assign(kvPair, caseRule, true);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
fail(kvPair);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return obj;
|
|
78
|
+
}
|
|
79
|
+
// TODO: Move these methods to Map and Set modules
|
|
80
|
+
export function containsValue(v, map) {
|
|
81
|
+
for (const kv of map) {
|
|
82
|
+
if (equals(v, kv[1])) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
export function tryGetValue(map, key, defaultValue) {
|
|
89
|
+
if (map.has(key)) {
|
|
90
|
+
defaultValue.contents = map.get(key);
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
export function addToSet(v, set) {
|
|
96
|
+
if (set.has(v)) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
set.add(v);
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
export function tryAddToDict(dict, k, v) {
|
|
103
|
+
if (dict.has(k)) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
dict.set(k, v);
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
export function addToDict(dict, k, v) {
|
|
110
|
+
if (dict.has(k)) {
|
|
111
|
+
throw new Exception("An item with the same key has already been added. Key: " + k);
|
|
112
|
+
}
|
|
113
|
+
dict.set(k, v);
|
|
114
|
+
}
|
|
115
|
+
export function getItemFromDict(map, key) {
|
|
116
|
+
if (map.has(key)) {
|
|
117
|
+
return map.get(key);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
throw new Exception(`The given key '${key}' was not present in the dictionary.`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
export function getItemFromDictOrCreate(map, key, createValue) {
|
|
124
|
+
if (map.has(key)) {
|
|
125
|
+
return map.get(key);
|
|
126
|
+
}
|
|
127
|
+
const value = createValue(key);
|
|
128
|
+
map.set(key, value);
|
|
129
|
+
return value;
|
|
130
|
+
}
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { disposeSafe, defaultOf, equals, toIterator, getEnumerator } from "./Util.js";
|
|
2
|
+
import { iterate, map, delay, toArray, iterateIndexed, concat } from "./Seq.js";
|
|
3
|
+
import { value as value_1 } from "./Option.js";
|
|
4
|
+
import { item as item_1, setItem } from "./Array.js";
|
|
5
|
+
import { FSharpRef } from "./Types.js";
|
|
6
|
+
import { class_type } from "./Reflection.js";
|
|
7
|
+
import { getItemFromDict, tryGetValue } from "./MapUtil.js";
|
|
8
|
+
import { KeyNotFoundException_$ctor_Z721C83C5 } from "./System.Collections.Generic.js";
|
|
9
|
+
import { ArgumentException_$ctor_Z721C83C5 } from "./System.js";
|
|
10
|
+
import { format } from "./String.js";
|
|
11
|
+
export class Dictionary {
|
|
12
|
+
constructor(pairs, comparer) {
|
|
13
|
+
const this$ = new FSharpRef(defaultOf());
|
|
14
|
+
this.comparer = comparer;
|
|
15
|
+
this$.contents = this;
|
|
16
|
+
this.hashMap = (new Map([]));
|
|
17
|
+
this["init@9"] = 1;
|
|
18
|
+
const enumerator = getEnumerator(pairs);
|
|
19
|
+
try {
|
|
20
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
21
|
+
const pair = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
22
|
+
Dictionary__Add_5BDDA1(this$.contents, pair[0], pair[1]);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
disposeSafe(enumerator);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
get [Symbol.toStringTag]() {
|
|
30
|
+
return "Dictionary";
|
|
31
|
+
}
|
|
32
|
+
toJSON() {
|
|
33
|
+
const this$ = this;
|
|
34
|
+
return Array.from(this$);
|
|
35
|
+
}
|
|
36
|
+
"System.Collections.IEnumerable.GetEnumerator"() {
|
|
37
|
+
const this$ = this;
|
|
38
|
+
return getEnumerator(this$);
|
|
39
|
+
}
|
|
40
|
+
GetEnumerator() {
|
|
41
|
+
const this$ = this;
|
|
42
|
+
return getEnumerator(concat(this$.hashMap.values()));
|
|
43
|
+
}
|
|
44
|
+
[Symbol.iterator]() {
|
|
45
|
+
return toIterator(getEnumerator(this));
|
|
46
|
+
}
|
|
47
|
+
"System.Collections.Generic.ICollection`1.Add2B595"(item) {
|
|
48
|
+
const this$ = this;
|
|
49
|
+
Dictionary__Add_5BDDA1(this$, item[0], item[1]);
|
|
50
|
+
}
|
|
51
|
+
"System.Collections.Generic.ICollection`1.Clear"() {
|
|
52
|
+
const this$ = this;
|
|
53
|
+
Dictionary__Clear(this$);
|
|
54
|
+
}
|
|
55
|
+
"System.Collections.Generic.ICollection`1.Contains2B595"(item) {
|
|
56
|
+
const this$ = this;
|
|
57
|
+
const matchValue = Dictionary__TryFind_2B595(this$, item[0]);
|
|
58
|
+
let matchResult = undefined, pair_1 = undefined;
|
|
59
|
+
if (matchValue != null) {
|
|
60
|
+
if (equals(value_1(matchValue)[1], item[1])) {
|
|
61
|
+
matchResult = 0;
|
|
62
|
+
pair_1 = value_1(matchValue);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
matchResult = 1;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
matchResult = 1;
|
|
70
|
+
}
|
|
71
|
+
switch (matchResult) {
|
|
72
|
+
case 0:
|
|
73
|
+
return true;
|
|
74
|
+
default:
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
"System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(array, arrayIndex) {
|
|
79
|
+
const this$ = this;
|
|
80
|
+
iterateIndexed((i, e) => {
|
|
81
|
+
setItem(array, arrayIndex + i, e);
|
|
82
|
+
}, this$);
|
|
83
|
+
}
|
|
84
|
+
"System.Collections.Generic.ICollection`1.get_Count"() {
|
|
85
|
+
const this$ = this;
|
|
86
|
+
return Dictionary__get_Count(this$) | 0;
|
|
87
|
+
}
|
|
88
|
+
"System.Collections.Generic.ICollection`1.get_IsReadOnly"() {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
"System.Collections.Generic.ICollection`1.Remove2B595"(item) {
|
|
92
|
+
const this$ = this;
|
|
93
|
+
const matchValue = Dictionary__TryFind_2B595(this$, item[0]);
|
|
94
|
+
let matchResult = undefined, pair_1 = undefined;
|
|
95
|
+
if (matchValue != null) {
|
|
96
|
+
if (equals(value_1(matchValue)[1], item[1])) {
|
|
97
|
+
matchResult = 0;
|
|
98
|
+
pair_1 = value_1(matchValue);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
matchResult = 1;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
matchResult = 1;
|
|
106
|
+
}
|
|
107
|
+
switch (matchResult) {
|
|
108
|
+
case 0:
|
|
109
|
+
return Dictionary__Remove_2B595(this$, item[0]);
|
|
110
|
+
default:
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
"System.Collections.Generic.IDictionary`2.Add5BDDA1"(key, value) {
|
|
115
|
+
const this$ = this;
|
|
116
|
+
Dictionary__Add_5BDDA1(this$, key, value);
|
|
117
|
+
}
|
|
118
|
+
"System.Collections.Generic.IDictionary`2.ContainsKey2B595"(key) {
|
|
119
|
+
const this$ = this;
|
|
120
|
+
return Dictionary__ContainsKey_2B595(this$, key);
|
|
121
|
+
}
|
|
122
|
+
"System.Collections.Generic.IDictionary`2.get_Item2B595"(key) {
|
|
123
|
+
const this$ = this;
|
|
124
|
+
return Dictionary__get_Item_2B595(this$, key);
|
|
125
|
+
}
|
|
126
|
+
"System.Collections.Generic.IDictionary`2.set_Item5BDDA1"(key, v) {
|
|
127
|
+
const this$ = this;
|
|
128
|
+
Dictionary__set_Item_5BDDA1(this$, key, v);
|
|
129
|
+
}
|
|
130
|
+
"System.Collections.Generic.IDictionary`2.get_Keys"() {
|
|
131
|
+
const this$ = this;
|
|
132
|
+
return toArray(delay(() => map((pair) => pair[0], this$)));
|
|
133
|
+
}
|
|
134
|
+
"System.Collections.Generic.IDictionary`2.Remove2B595"(key) {
|
|
135
|
+
const this$ = this;
|
|
136
|
+
return Dictionary__Remove_2B595(this$, key);
|
|
137
|
+
}
|
|
138
|
+
"System.Collections.Generic.IDictionary`2.TryGetValue6DC89625"(key, value) {
|
|
139
|
+
const this$ = this;
|
|
140
|
+
const matchValue = Dictionary__TryFind_2B595(this$, key);
|
|
141
|
+
if (matchValue != null) {
|
|
142
|
+
const pair = value_1(matchValue);
|
|
143
|
+
value.contents = pair[1];
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
"System.Collections.Generic.IDictionary`2.get_Values"() {
|
|
151
|
+
const this$ = this;
|
|
152
|
+
return toArray(delay(() => map((pair) => pair[1], this$)));
|
|
153
|
+
}
|
|
154
|
+
get size() {
|
|
155
|
+
const this$ = this;
|
|
156
|
+
return Dictionary__get_Count(this$) | 0;
|
|
157
|
+
}
|
|
158
|
+
clear() {
|
|
159
|
+
const this$ = this;
|
|
160
|
+
Dictionary__Clear(this$);
|
|
161
|
+
}
|
|
162
|
+
delete(k) {
|
|
163
|
+
const this$ = this;
|
|
164
|
+
return Dictionary__Remove_2B595(this$, k);
|
|
165
|
+
}
|
|
166
|
+
entries() {
|
|
167
|
+
const this$ = this;
|
|
168
|
+
return map((p) => [p[0], p[1]], this$);
|
|
169
|
+
}
|
|
170
|
+
get(k) {
|
|
171
|
+
const this$ = this;
|
|
172
|
+
return Dictionary__get_Item_2B595(this$, k);
|
|
173
|
+
}
|
|
174
|
+
has(k) {
|
|
175
|
+
const this$ = this;
|
|
176
|
+
return Dictionary__ContainsKey_2B595(this$, k);
|
|
177
|
+
}
|
|
178
|
+
keys() {
|
|
179
|
+
const this$ = this;
|
|
180
|
+
return map((p) => p[0], this$);
|
|
181
|
+
}
|
|
182
|
+
set(k, v) {
|
|
183
|
+
const this$ = this;
|
|
184
|
+
Dictionary__set_Item_5BDDA1(this$, k, v);
|
|
185
|
+
return this$;
|
|
186
|
+
}
|
|
187
|
+
values() {
|
|
188
|
+
const this$ = this;
|
|
189
|
+
return map((p) => p[1], this$);
|
|
190
|
+
}
|
|
191
|
+
forEach(f, thisArg) {
|
|
192
|
+
const this$ = this;
|
|
193
|
+
iterate((p) => {
|
|
194
|
+
f(p[1], p[0], this$);
|
|
195
|
+
}, this$);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
export function Dictionary_$reflection(gen0, gen1) {
|
|
199
|
+
return class_type("Fable.Collections.Dictionary", [gen0, gen1], Dictionary);
|
|
200
|
+
}
|
|
201
|
+
export function Dictionary_$ctor_6623D9B3(pairs, comparer) {
|
|
202
|
+
return new Dictionary(pairs, comparer);
|
|
203
|
+
}
|
|
204
|
+
function Dictionary__TryFindIndex_2B595(this$, k) {
|
|
205
|
+
const h = this$.comparer.GetHashCode(k) | 0;
|
|
206
|
+
let matchValue;
|
|
207
|
+
let outArg = defaultOf();
|
|
208
|
+
matchValue = [tryGetValue(this$.hashMap, h, new FSharpRef(() => outArg, (v) => {
|
|
209
|
+
outArg = v;
|
|
210
|
+
})), outArg];
|
|
211
|
+
if (matchValue[0]) {
|
|
212
|
+
return [true, h, matchValue[1].findIndex((pair) => this$.comparer.Equals(k, pair[0]))];
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
return [false, h, -1];
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
export function Dictionary__TryFind_2B595(this$, k) {
|
|
219
|
+
const matchValue = Dictionary__TryFindIndex_2B595(this$, k);
|
|
220
|
+
let matchResult = undefined;
|
|
221
|
+
if (matchValue[0]) {
|
|
222
|
+
if (matchValue[2] > -1) {
|
|
223
|
+
matchResult = 0;
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
matchResult = 1;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
matchResult = 1;
|
|
231
|
+
}
|
|
232
|
+
switch (matchResult) {
|
|
233
|
+
case 0:
|
|
234
|
+
return item_1(matchValue[2], getItemFromDict(this$.hashMap, matchValue[1]));
|
|
235
|
+
default:
|
|
236
|
+
return undefined;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
export function Dictionary__get_Comparer(this$) {
|
|
240
|
+
return this$.comparer;
|
|
241
|
+
}
|
|
242
|
+
export function Dictionary__Clear(this$) {
|
|
243
|
+
this$.hashMap.clear();
|
|
244
|
+
}
|
|
245
|
+
export function Dictionary__get_Count(this$) {
|
|
246
|
+
let count = 0;
|
|
247
|
+
let enumerator = getEnumerator(this$.hashMap.values());
|
|
248
|
+
try {
|
|
249
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
250
|
+
const pairs = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
251
|
+
count = ((count + pairs.length) | 0);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
finally {
|
|
255
|
+
disposeSafe(enumerator);
|
|
256
|
+
}
|
|
257
|
+
return count | 0;
|
|
258
|
+
}
|
|
259
|
+
export function Dictionary__get_Item_2B595(this$, k) {
|
|
260
|
+
const matchValue = Dictionary__TryFind_2B595(this$, k);
|
|
261
|
+
if (matchValue != null) {
|
|
262
|
+
return value_1(matchValue)[1];
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
throw KeyNotFoundException_$ctor_Z721C83C5("The item was not found in collection");
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
export function Dictionary__set_Item_5BDDA1(this$, k, v) {
|
|
269
|
+
const matchValue = Dictionary__TryFindIndex_2B595(this$, k);
|
|
270
|
+
if (matchValue[0]) {
|
|
271
|
+
if (matchValue[2] > -1) {
|
|
272
|
+
setItem(getItemFromDict(this$.hashMap, matchValue[1]), matchValue[2], [k, v]);
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v]));
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
this$.hashMap.set(matchValue[1], [[k, v]]);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
export function Dictionary__Add_5BDDA1(this$, k, v) {
|
|
283
|
+
const matchValue = Dictionary__TryFindIndex_2B595(this$, k);
|
|
284
|
+
if (matchValue[0]) {
|
|
285
|
+
if (matchValue[2] > -1) {
|
|
286
|
+
throw ArgumentException_$ctor_Z721C83C5(format("An item with the same key has already been added. Key: {0}", k));
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v]));
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
this$.hashMap.set(matchValue[1], [[k, v]]);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
export function Dictionary__ContainsKey_2B595(this$, k) {
|
|
297
|
+
const matchValue = Dictionary__TryFindIndex_2B595(this$, k);
|
|
298
|
+
let matchResult = undefined;
|
|
299
|
+
if (matchValue[0]) {
|
|
300
|
+
if (matchValue[2] > -1) {
|
|
301
|
+
matchResult = 0;
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
matchResult = 1;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
matchResult = 1;
|
|
309
|
+
}
|
|
310
|
+
switch (matchResult) {
|
|
311
|
+
case 0:
|
|
312
|
+
return true;
|
|
313
|
+
default:
|
|
314
|
+
return false;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
export function Dictionary__Remove_2B595(this$, k) {
|
|
318
|
+
const matchValue = Dictionary__TryFindIndex_2B595(this$, k);
|
|
319
|
+
let matchResult = undefined;
|
|
320
|
+
if (matchValue[0]) {
|
|
321
|
+
if (matchValue[2] > -1) {
|
|
322
|
+
matchResult = 0;
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
matchResult = 1;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
matchResult = 1;
|
|
330
|
+
}
|
|
331
|
+
switch (matchResult) {
|
|
332
|
+
case 0: {
|
|
333
|
+
getItemFromDict(this$.hashMap, matchValue[1]).splice(matchValue[2], 1);
|
|
334
|
+
return true;
|
|
335
|
+
}
|
|
336
|
+
default:
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { disposeSafe, defaultOf, toIterator, getEnumerator } from "./Util.js";
|
|
2
|
+
import { iterate, map, iterateIndexed, concat } from "./Seq.js";
|
|
3
|
+
import { item as item_1, setItem } from "./Array.js";
|
|
4
|
+
import { some } from "./Option.js";
|
|
5
|
+
import { FSharpRef } from "./Types.js";
|
|
6
|
+
import { class_type } from "./Reflection.js";
|
|
7
|
+
import { getItemFromDict, tryGetValue } from "./MapUtil.js";
|
|
8
|
+
export class HashSet {
|
|
9
|
+
constructor(items, comparer) {
|
|
10
|
+
const this$ = new FSharpRef(defaultOf());
|
|
11
|
+
this.comparer = comparer;
|
|
12
|
+
this$.contents = this;
|
|
13
|
+
this.hashMap = (new Map([]));
|
|
14
|
+
this["init@9"] = 1;
|
|
15
|
+
const enumerator = getEnumerator(items);
|
|
16
|
+
try {
|
|
17
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
18
|
+
const item = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
19
|
+
HashSet__Add_2B595(this$.contents, item);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
disposeSafe(enumerator);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
get [Symbol.toStringTag]() {
|
|
27
|
+
return "HashSet";
|
|
28
|
+
}
|
|
29
|
+
toJSON() {
|
|
30
|
+
const this$ = this;
|
|
31
|
+
return Array.from(this$);
|
|
32
|
+
}
|
|
33
|
+
"System.Collections.IEnumerable.GetEnumerator"() {
|
|
34
|
+
const this$ = this;
|
|
35
|
+
return getEnumerator(this$);
|
|
36
|
+
}
|
|
37
|
+
GetEnumerator() {
|
|
38
|
+
const this$ = this;
|
|
39
|
+
return getEnumerator(concat(this$.hashMap.values()));
|
|
40
|
+
}
|
|
41
|
+
[Symbol.iterator]() {
|
|
42
|
+
return toIterator(getEnumerator(this));
|
|
43
|
+
}
|
|
44
|
+
"System.Collections.Generic.ICollection`1.Add2B595"(item) {
|
|
45
|
+
const this$ = this;
|
|
46
|
+
HashSet__Add_2B595(this$, item);
|
|
47
|
+
}
|
|
48
|
+
"System.Collections.Generic.ICollection`1.Clear"() {
|
|
49
|
+
const this$ = this;
|
|
50
|
+
HashSet__Clear(this$);
|
|
51
|
+
}
|
|
52
|
+
"System.Collections.Generic.ICollection`1.Contains2B595"(item) {
|
|
53
|
+
const this$ = this;
|
|
54
|
+
return HashSet__Contains_2B595(this$, item);
|
|
55
|
+
}
|
|
56
|
+
"System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(array, arrayIndex) {
|
|
57
|
+
const this$ = this;
|
|
58
|
+
iterateIndexed((i, e) => {
|
|
59
|
+
setItem(array, arrayIndex + i, e);
|
|
60
|
+
}, this$);
|
|
61
|
+
}
|
|
62
|
+
"System.Collections.Generic.ICollection`1.get_Count"() {
|
|
63
|
+
const this$ = this;
|
|
64
|
+
return HashSet__get_Count(this$) | 0;
|
|
65
|
+
}
|
|
66
|
+
"System.Collections.Generic.ICollection`1.get_IsReadOnly"() {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
"System.Collections.Generic.ICollection`1.Remove2B595"(item) {
|
|
70
|
+
const this$ = this;
|
|
71
|
+
return HashSet__Remove_2B595(this$, item);
|
|
72
|
+
}
|
|
73
|
+
get size() {
|
|
74
|
+
const this$ = this;
|
|
75
|
+
return HashSet__get_Count(this$) | 0;
|
|
76
|
+
}
|
|
77
|
+
add(k) {
|
|
78
|
+
const this$ = this;
|
|
79
|
+
HashSet__Add_2B595(this$, k);
|
|
80
|
+
return this$;
|
|
81
|
+
}
|
|
82
|
+
clear() {
|
|
83
|
+
const this$ = this;
|
|
84
|
+
HashSet__Clear(this$);
|
|
85
|
+
}
|
|
86
|
+
delete(k) {
|
|
87
|
+
const this$ = this;
|
|
88
|
+
return HashSet__Remove_2B595(this$, k);
|
|
89
|
+
}
|
|
90
|
+
has(k) {
|
|
91
|
+
const this$ = this;
|
|
92
|
+
return HashSet__Contains_2B595(this$, k);
|
|
93
|
+
}
|
|
94
|
+
keys() {
|
|
95
|
+
const this$ = this;
|
|
96
|
+
return map((x) => x, this$);
|
|
97
|
+
}
|
|
98
|
+
values() {
|
|
99
|
+
const this$ = this;
|
|
100
|
+
return map((x) => x, this$);
|
|
101
|
+
}
|
|
102
|
+
entries() {
|
|
103
|
+
const this$ = this;
|
|
104
|
+
return map((v) => [v, v], this$);
|
|
105
|
+
}
|
|
106
|
+
forEach(f, thisArg) {
|
|
107
|
+
const this$ = this;
|
|
108
|
+
iterate((x) => {
|
|
109
|
+
f(x, x, this$);
|
|
110
|
+
}, this$);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
export function HashSet_$reflection(gen0) {
|
|
114
|
+
return class_type("Fable.Collections.HashSet", [gen0], HashSet);
|
|
115
|
+
}
|
|
116
|
+
export function HashSet_$ctor_Z6150332D(items, comparer) {
|
|
117
|
+
return new HashSet(items, comparer);
|
|
118
|
+
}
|
|
119
|
+
function HashSet__TryFindIndex_2B595(this$, k) {
|
|
120
|
+
const h = this$.comparer.GetHashCode(k) | 0;
|
|
121
|
+
let matchValue;
|
|
122
|
+
let outArg = defaultOf();
|
|
123
|
+
matchValue = [tryGetValue(this$.hashMap, h, new FSharpRef(() => outArg, (v) => {
|
|
124
|
+
outArg = v;
|
|
125
|
+
})), outArg];
|
|
126
|
+
if (matchValue[0]) {
|
|
127
|
+
return [true, h, matchValue[1].findIndex((v_1) => this$.comparer.Equals(k, v_1))];
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
return [false, h, -1];
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function HashSet__TryFind_2B595(this$, k) {
|
|
134
|
+
const matchValue = HashSet__TryFindIndex_2B595(this$, k);
|
|
135
|
+
let matchResult = undefined;
|
|
136
|
+
if (matchValue[0]) {
|
|
137
|
+
if (matchValue[2] > -1) {
|
|
138
|
+
matchResult = 0;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
matchResult = 1;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
matchResult = 1;
|
|
146
|
+
}
|
|
147
|
+
switch (matchResult) {
|
|
148
|
+
case 0:
|
|
149
|
+
return some(item_1(matchValue[2], getItemFromDict(this$.hashMap, matchValue[1])));
|
|
150
|
+
default:
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
export function HashSet__get_Comparer(this$) {
|
|
155
|
+
return this$.comparer;
|
|
156
|
+
}
|
|
157
|
+
export function HashSet__Clear(this$) {
|
|
158
|
+
this$.hashMap.clear();
|
|
159
|
+
}
|
|
160
|
+
export function HashSet__get_Count(this$) {
|
|
161
|
+
let count = 0;
|
|
162
|
+
let enumerator = getEnumerator(this$.hashMap.values());
|
|
163
|
+
try {
|
|
164
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
165
|
+
const items = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
166
|
+
count = ((count + items.length) | 0);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
finally {
|
|
170
|
+
disposeSafe(enumerator);
|
|
171
|
+
}
|
|
172
|
+
return count | 0;
|
|
173
|
+
}
|
|
174
|
+
export function HashSet__Add_2B595(this$, k) {
|
|
175
|
+
const matchValue = HashSet__TryFindIndex_2B595(this$, k);
|
|
176
|
+
if (matchValue[0]) {
|
|
177
|
+
if (matchValue[2] > -1) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push(k));
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
this$.hashMap.set(matchValue[1], [k]);
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
export function HashSet__Contains_2B595(this$, k) {
|
|
191
|
+
const matchValue = HashSet__TryFindIndex_2B595(this$, k);
|
|
192
|
+
let matchResult = undefined;
|
|
193
|
+
if (matchValue[0]) {
|
|
194
|
+
if (matchValue[2] > -1) {
|
|
195
|
+
matchResult = 0;
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
matchResult = 1;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
matchResult = 1;
|
|
203
|
+
}
|
|
204
|
+
switch (matchResult) {
|
|
205
|
+
case 0:
|
|
206
|
+
return true;
|
|
207
|
+
default:
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
export function HashSet__Remove_2B595(this$, k) {
|
|
212
|
+
const matchValue = HashSet__TryFindIndex_2B595(this$, k);
|
|
213
|
+
let matchResult = undefined;
|
|
214
|
+
if (matchValue[0]) {
|
|
215
|
+
if (matchValue[2] > -1) {
|
|
216
|
+
matchResult = 0;
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
matchResult = 1;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
matchResult = 1;
|
|
224
|
+
}
|
|
225
|
+
switch (matchResult) {
|
|
226
|
+
case 0: {
|
|
227
|
+
getItemFromDict(this$.hashMap, matchValue[1]).splice(matchValue[2], 1);
|
|
228
|
+
return true;
|
|
229
|
+
}
|
|
230
|
+
default:
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function Helpers_allocateArrayFromCons(cons, len) {
|
|
2
|
+
if (cons == null) {
|
|
3
|
+
return new Array(len);
|
|
4
|
+
}
|
|
5
|
+
else {
|
|
6
|
+
const cons_1 = cons;
|
|
7
|
+
if ((typeof cons_1) === "function") {
|
|
8
|
+
return new cons_1(len);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
return new Array(len);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|