diff --git a/INFO-1208 (PHP)/Labs/Lab 9/Screenshot 1.png b/INFO-1208 (PHP)/Labs/Lab 9/Screenshot 1.png new file mode 100644 index 0000000..bc31660 Binary files /dev/null and b/INFO-1208 (PHP)/Labs/Lab 9/Screenshot 1.png differ diff --git a/INFO-1208 (PHP)/Labs/Lab 9/Screenshot 2.png b/INFO-1208 (PHP)/Labs/Lab 9/Screenshot 2.png new file mode 100644 index 0000000..bccccc2 Binary files /dev/null and b/INFO-1208 (PHP)/Labs/Lab 9/Screenshot 2.png differ diff --git a/INFO-1208 (PHP)/Labs/Lab 9/Screenshot 3.png b/INFO-1208 (PHP)/Labs/Lab 9/Screenshot 3.png new file mode 100644 index 0000000..88c309d Binary files /dev/null and b/INFO-1208 (PHP)/Labs/Lab 9/Screenshot 3.png differ diff --git a/INFO-1208 (PHP)/Labs/Lab 9/Screenshot 4.png b/INFO-1208 (PHP)/Labs/Lab 9/Screenshot 4.png new file mode 100644 index 0000000..e8f4c43 Binary files /dev/null and b/INFO-1208 (PHP)/Labs/Lab 9/Screenshot 4.png differ diff --git a/INFO-1208 (PHP)/Labs/Lab 9/app/css/styles.css b/INFO-1208 (PHP)/Labs/Lab 9/app/css/styles.css new file mode 100644 index 0000000..9d8a9f7 --- /dev/null +++ b/INFO-1208 (PHP)/Labs/Lab 9/app/css/styles.css @@ -0,0 +1,95 @@ +body { + font-family: "Roboto", sans-serif; + font-style: normal; + font-size: 20px; + margin: 0; + padding: 0; + color: #555555; +} + +/* Header Styles */ +header .logo { + display: flex; + align-items: center; + padding: 0.5rem; +} + +header .logo i { + display: block; + color: teal; + font-size: 3rem; +} + +header .logo span { + color: #666677; + font-size: 2rem; + font-weight: 300; +} + +header .logo span strong { + font-weight: 600; +} + +header nav { + background-color: teal; + padding-top: 5px; +} + +header nav ul { + margin: 0; + padding: 0; + list-style: none; + display: flex; + justify-content: center; + align-items: center; +} + +header nav ul li { + margin: 0; + padding: 0; + display: block; +} + +header nav ul li a { + display: block; + padding: 0.75rem; + color: #ffffff; + text-decoration: none; + font-size: 1.1rem; +} + +header nav ul li a:hover { + text-decoration: underline; +} + +header nav ul li a.active { + color: teal; + background-color: #ffffff; +} + +/* Main Styles */ +main { + display: block; + padding: 2rem; +} + +main h1 { + color: #666677; + padding: 0; + margin: 0; +} + +/* Footer Styles */ +footer { + display: block; + padding: 1.5rem 1rem; + background-color: teal; + color: rgba(255, 255, 255, 0.75); + text-align: center; + font-size: 1rem; +} + +footer strong { + font-weight: 600; + color: rgba(255, 255, 255, 0.85); +} \ No newline at end of file diff --git a/INFO-1208 (PHP)/Labs/Lab 9/app/images/logo.png b/INFO-1208 (PHP)/Labs/Lab 9/app/images/logo.png new file mode 100644 index 0000000..c0ca436 Binary files /dev/null and b/INFO-1208 (PHP)/Labs/Lab 9/app/images/logo.png differ diff --git a/INFO-1208 (PHP)/Labs/Lab 9/app/index.php b/INFO-1208 (PHP)/Labs/Lab 9/app/index.php new file mode 100644 index 0000000..b49da2f --- /dev/null +++ b/INFO-1208 (PHP)/Labs/Lab 9/app/index.php @@ -0,0 +1,4 @@ + + +

This is the content of the home page.

+ \ No newline at end of file diff --git a/INFO-1208 (PHP)/Labs/Lab 9/app/login.php b/INFO-1208 (PHP)/Labs/Lab 9/app/login.php new file mode 100644 index 0000000..8b9ceda --- /dev/null +++ b/INFO-1208 (PHP)/Labs/Lab 9/app/login.php @@ -0,0 +1,46 @@ +Login Form

"); + +$formStart = "
"; +$emailLabel = ""; +$emailInput = ""; +$passLabel = ""; +$passInput = ""; +$submit = ""; +$formEnd = "Email or password is incorrect. Please try again.

" . $stickyForm); + } + } else { + print("

Email and password are required. Please try again.

" . $stickyForm); + } +} else { + print($stickyForm = $formStart . + $emailLabel . $emailInput . + $passLabel . $passInput . + $submit . + $formEnd); +} + +include("template/footer.php"); diff --git a/INFO-1208 (PHP)/Labs/Lab 9/app/logout.php b/INFO-1208 (PHP)/Labs/Lab 9/app/logout.php new file mode 100644 index 0000000..74ff176 --- /dev/null +++ b/INFO-1208 (PHP)/Labs/Lab 9/app/logout.php @@ -0,0 +1,10 @@ + +

You have logged out. Click here to log in again.

+ + \ No newline at end of file diff --git a/INFO-1208 (PHP)/Labs/Lab 9/app/menu.php b/INFO-1208 (PHP)/Labs/Lab 9/app/menu.php new file mode 100644 index 0000000..01eb2e3 --- /dev/null +++ b/INFO-1208 (PHP)/Labs/Lab 9/app/menu.php @@ -0,0 +1,12 @@ + + + + +"; + echo "You logged in at: " . date("l F j, Y, g:i A", $_SESSION['loggedin']); + echo "
"; +?> +Logout + \ No newline at end of file diff --git a/INFO-1208 (PHP)/Labs/Lab 9/app/specials.php b/INFO-1208 (PHP)/Labs/Lab 9/app/specials.php new file mode 100644 index 0000000..d232bd2 --- /dev/null +++ b/INFO-1208 (PHP)/Labs/Lab 9/app/specials.php @@ -0,0 +1,16 @@ +These are our specails for $date:

+

Extra Large Meat Lovers Pizza - $17.99

+

Toppings:

+ "; +include("template/header.php"); +print($message); +include("template/footer.php"); diff --git a/INFO-1208 (PHP)/Labs/Lab 9/app/template/footer.php b/INFO-1208 (PHP)/Labs/Lab 9/app/template/footer.php new file mode 100644 index 0000000..f1414cc --- /dev/null +++ b/INFO-1208 (PHP)/Labs/Lab 9/app/template/footer.php @@ -0,0 +1,14 @@ + + + + \ No newline at end of file diff --git a/INFO-1208 (PHP)/Labs/Lab 9/app/template/header.php b/INFO-1208 (PHP)/Labs/Lab 9/app/template/header.php new file mode 100644 index 0000000..31fd6eb --- /dev/null +++ b/INFO-1208 (PHP)/Labs/Lab 9/app/template/header.php @@ -0,0 +1,44 @@ + + + + + + + + <?php if (defined("TITLE")) { + print(TITLE); + } else { + print("l_mclean215318's Pizza"); + } ?> + + + + + \ No newline at end of file diff --git a/INFO-1208 (PHP)/Labs/Lab 9/app/template/template.html b/INFO-1208 (PHP)/Labs/Lab 9/app/template/template.html new file mode 100644 index 0000000..9683cf6 --- /dev/null +++ b/INFO-1208 (PHP)/Labs/Lab 9/app/template/template.html @@ -0,0 +1,54 @@ + + + + + + + + l_mclean215318's Webpage + + + + + + + +
+

Welcome

+

This is the content of the home page.

+
+ + + + + + \ No newline at end of file diff --git a/INFO-1208 (PHP)/Labs/Lab 9/customize.php b/INFO-1208 (PHP)/Labs/Lab 9/customize.php new file mode 100644 index 0000000..98f739c --- /dev/null +++ b/INFO-1208 (PHP)/Labs/Lab 9/customize.php @@ -0,0 +1,43 @@ + + + + + + + + + Customize Your Settings + + + + +

Use this form to customize your settings:

+ + + + + + + \ No newline at end of file diff --git a/INFO-1208 (PHP)/Labs/Lab 9/info1208-lab9-l_mclean215318.zip b/INFO-1208 (PHP)/Labs/Lab 9/info1208-lab9-l_mclean215318.zip new file mode 100644 index 0000000..fc7f9f5 Binary files /dev/null and b/INFO-1208 (PHP)/Labs/Lab 9/info1208-lab9-l_mclean215318.zip differ diff --git a/INFO-1273 (Databases 1)/Labs/Lab 7/form1.html b/INFO-1273 (Databases 1)/Labs/Lab 7/form1.html new file mode 100644 index 0000000..d401543 --- /dev/null +++ b/INFO-1273 (Databases 1)/Labs/Lab 7/form1.html @@ -0,0 +1,28 @@ + + + + Lab 7 Levi McLean + + + +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ + \ No newline at end of file diff --git a/INFO-1273 (Databases 1)/Labs/Lab 7/lab7-l_mclean215318.zip b/INFO-1273 (Databases 1)/Labs/Lab 7/lab7-l_mclean215318.zip new file mode 100644 index 0000000..094e7fc Binary files /dev/null and b/INFO-1273 (Databases 1)/Labs/Lab 7/lab7-l_mclean215318.zip differ diff --git a/INFO-1273 (Databases 1)/Labs/Lab 7/lab7.sql b/INFO-1273 (Databases 1)/Labs/Lab 7/lab7.sql new file mode 100644 index 0000000..615ea4a --- /dev/null +++ b/INFO-1273 (Databases 1)/Labs/Lab 7/lab7.sql @@ -0,0 +1,58 @@ +CREATE DATABASE IF NOT EXISTS `lab7` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */; +USE `lab7`; +-- MySQL dump 10.13 Distrib 8.0.44, for Win64 (x86_64) +-- +-- Host: 127.0.0.1 Database: lab7 +-- ------------------------------------------------------ +-- Server version 5.5.5-10.4.32-MariaDB + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!50503 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `registration` +-- + +DROP TABLE IF EXISTS `registration`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `registration` ( + `reg_id` int(11) NOT NULL, + `fname` varchar(30) NOT NULL, + `lname` varchar(30) NOT NULL, + `email` varchar(100) NOT NULL, + `password` varchar(255) NOT NULL, + `address` varchar(255) NOT NULL, + `city` varchar(30) NOT NULL, + `country` varchar(30) NOT NULL, + PRIMARY KEY (`reg_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `registration` +-- + +LOCK TABLES `registration` WRITE; +/*!40000 ALTER TABLE `registration` DISABLE KEYS */; +/*!40000 ALTER TABLE `registration` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2026-04-01 19:11:27 diff --git a/INFO-1273 (Databases 1)/Labs/Lab 8/action.php b/INFO-1273 (Databases 1)/Labs/Lab 8/action.php new file mode 100644 index 0000000..2b5fb30 --- /dev/null +++ b/INFO-1273 (Databases 1)/Labs/Lab 8/action.php @@ -0,0 +1,25 @@ + + \ No newline at end of file diff --git a/INFO-1273 (Databases 1)/Labs/Lab 8/form2.html b/INFO-1273 (Databases 1)/Labs/Lab 8/form2.html new file mode 100644 index 0000000..9df77a3 --- /dev/null +++ b/INFO-1273 (Databases 1)/Labs/Lab 8/form2.html @@ -0,0 +1,29 @@ + + + + Lab 7 Levi McLean + + + + +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ + \ No newline at end of file diff --git a/INFO-1273 (Databases 1)/Labs/Lab 8/lab8-l_mclean215318.zip b/INFO-1273 (Databases 1)/Labs/Lab 8/lab8-l_mclean215318.zip new file mode 100644 index 0000000..0922ad2 Binary files /dev/null and b/INFO-1273 (Databases 1)/Labs/Lab 8/lab8-l_mclean215318.zip differ diff --git a/INFO-1273 (Databases 1)/Labs/Lab 8/style.css b/INFO-1273 (Databases 1)/Labs/Lab 8/style.css new file mode 100644 index 0000000..f3702d4 --- /dev/null +++ b/INFO-1273 (Databases 1)/Labs/Lab 8/style.css @@ -0,0 +1,6 @@ +body { + font-family: Arial, Helvetica, sans-serif; + color: black; + font-weight: bold; + background-color: darkred; +} \ No newline at end of file diff --git a/INFO-1273 (Databases 1)/Notes/northwindmysql.sql b/INFO-1273 (Databases 1)/Notes/northwindmysql.sql new file mode 100644 index 0000000..3ea606f --- /dev/null +++ b/INFO-1273 (Databases 1)/Notes/northwindmysql.sql @@ -0,0 +1,3410 @@ +/* +Navicat MySQL Data Transfer + +Source Server : localhost +Source Server Version : 50505 +Source Host : localhost:3307 +Source Database : northwindmysql + +Target Server Type : MYSQL +Target Server Version : 50505 +File Encoding : 65001 + +Date: 2016-04-27 13:53:24 +*/ + +SET FOREIGN_KEY_CHECKS=0; +-- ---------------------------- +-- Table structure for `categories` +-- ---------------------------- +DROP TABLE IF EXISTS `categories`; +CREATE TABLE `categories` ( + `CategoryID` int(11) NOT NULL AUTO_INCREMENT, + `CategoryName` varchar(15) NOT NULL, + `Description` longtext, + `Picture` longblob, + PRIMARY KEY (`CategoryID`), + UNIQUE KEY `CategoryName` (`CategoryName`) +) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of categories +-- ---------------------------- +INSERT INTO categories VALUES ('1', 'Beverages', 'Soft drinks, coffees, teas, beers, and ales', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E5069637475726500010500000200000007000000504272757368000000000000000000A0290000424D98290000000000005600000028000000AC00000078000000010004000000000000000000880B0000880B00000800000008000000FFFFFF0000FFFF00FF00FF000000FF00FFFF000000FF0000FF00000000000000000010000000001000000001001000000000000001010100010000100100000001010001000000100100000100000010101000100000100010000000000000000000001000000001000000000000001000000000000000000000001001001000000000000000000001001001000012507070100000001000000001000100100000010000001000000000100100100000001001010101010000000000000000000001001000100000101010101000000000000000000000000000000000000101020525363777777777777753530100101000100000000001010001001000100100100000000000100000000000000000100010001001010001000000010010000000000000100000000000000000000000000000001014343577777777777777777777777777770100120001010100102000000000000000000000000100100010010000000000100010000000000000000010010000001001001010100000000000000000000000000000001021617777777775757535353525777777777777770150120000100010101000000000000000001000000000000001001001000000000010010000010010010000101001001000000100000001000000000000000000000001417777737617376377775767771707752777777776340161210300000000010000000000010000000000000000000000000000000000000000100000000000100000000000010000100000000000000000000000000100503677577571705014000000101070717775777777775334101400010101010001010010101000000000000000000000000000001000000000000000000000000000000001010001000001000000000000000000000000010357353000000000000000000000000000171777777777470612101000000001000001000000010000000000000000000000000000000100010703010101210000000000000000000000000000000000000000000000101034350000000010653435777570477474700000107757777171000000101001000101000101010000100000000000000000001041477110131035750020040477301000100000000000000000000000000000000000000000010004014176577707000067777777776560404007371734361701400001241000001000000001000020400000200000101747767777000101073777577777775372100000000100000000000000100100000000010000010000037676476700004000577470416717477421405000434140343000565120510100301014002107171370701437777777775777777112103177777777777705757771010000000100000000000000010000100000101000470440440671007477776777777614060600742524001777777747646776752060250003021716737777777777777774747727574777001016777777777767173317703000101010000000010000000001000000000000420460200077427477767777777775677777746474656606767777665746776757151253507166737777733746777577777777572776771100517777777767776015713141030020001000000001001000000000010100067440044047761477767776706767777674765673470657505767375664746757777271252167717733771737776777677567476577577121103775777777776717027753121010101000010000000000100001010000010767060004776747776776777756776777777777042477676067777467474747676777565256531311771177376477777576757777747710110701777777767777401717340000000000100001000000000001000000101004776540666050777677657777677470774777776747664607777376747476777777677717173735377717737747777777777774774770011271077777767777763171735210121010100000000000000000000010000000300406767757676775077006767477774774777774747770476777656706746777657777777777777777777737667777476574774777771001031777777776767741371771000000000010000000000000000000000101005707442567656176006767004770476707700767770000477747734656446745677676777777777777777777375667777777777777777773100010777777777777771753521010101010000000000100010000000010007777712152503004670077774767427047247776577564700076737747670474277777777777777777367777777765777777777777434777750757775377767676770172773100000000001000000000000001000101007170701614204046007746040676167470774167743656777740077776067407465677677777777777757717777737476775716161243410303077777777577775210000011350001001001000000101000100000100002100171525675070074340670005004076700706570757777767770077744746466567777677777777777777777773776777610000000137775350317777773777737750701000101021001000100000000000010100010010300067777761650604065047604760746404776406705656776770077764750474747677777777777777777773733747777773011735777777777777777757777777777767412041001001000001000001000000010001000577744140000607406706767676776777776477756767777447700774076646764777567777777777777737373737764677747753527777776777777777776365735353513010300120301010000000000000000001000107000210006147767674646040404040066667767677775476777046644644044456776767777777777733737373776777776774244777377717712777165357577534242040010010010000010001000000100010000100300050000146664000000101030734352101100065677767077770047604774377676777767777777777373737333756477657075377100770770177776525271673001012101210301001030000000100100000001000005000060046160004000125343510110101000000000007740000047744733737377757677777777777373737377737656757777777373101676770777717775671773001010300000021021010000000000000100000000100077400000414021414000000000000000000000000000300000777777773737377677677777777777373737333735677677777377710177777717774705271767340300000010101000100000100000100100000001014005660000000737560600000000000000000000000000004730777773733373737777747677777777737337353761666777777737737017771677077353777574735310012101000000010010100000100000000010004300065400000000400141254140404000000000000000000037737776773777373733777677777777777677646746565756747777773773017017710765654352735770017010303031010010000000100001001010030704000660000000000000040000000000000000000000000007777514673373373737777777476777777777474644764666776777777772711031076117307374357477373010341050043030012100100010100100012500000047000000000046742000000000000000000000000077776677777377377373733737767777777777767645676507574777657610057121101731611574777637735105270125213010050210100001070210301650000000640000000006776406776464000040641434177777767667614737337337373777777767677777776564767474664667477761775271112116101002331211101052721016120140161034106010173075617770000570047400047400446000000467770504777767173573756767776767737737773737377776777777777776564746765477576777176700774656474731010011000001250165214716170121012011070777173777400063770040000760467600000000740760600777067777777676767676767337333373737377747677777777776767747424676747677157701677677676131331213131301371317310312161525053073077777777700047577700000006006760000640400006474046740777777777676767676737737777373777777767777777777674746767467477777743670175305325352527135335353170143414371617130131211777177777777001737770006760476677047064466400047640077747777777767676767673773373333737373776746777777765467674704747674765375610731773573752534737417017035303130101010030001427777777737770047777770047460704644064400004640067004767077777777767676767673377377773737777776777777777766565665670767767775077007563153347370731013213617034343434307031417121177773777777740257737700027447000064000000000640064006760777777776767767767773373333373737777476777777777746765674464747767763477027172753717175777757757357171717171717433616163777777735737400737773400460660046000000000004000600676747777777776766766767377377777373737777747677777776756567467746765777117100537153353773777777777777777777777777737757737573777773773772047777350000474044600440000000000040047774007777700667677677633333333333737777766767777777777667476564657476760600007353375373177777777777777777777777777777737777377733753777740007177770000664024640640000000000004646700477777007767667666777777777773737777777777777776777446467565676777535373525317137177177777777777777777777777777777775377773753771737700076737350000000474664665646644400400464000077700067677677773333333333373737776676777777777767777766767765677771713175217037173777777777777777777777777775375377173753777377773700057777004007477667764766767667467600000004770000767667666677777777777337777775677777771777772604000404067761171613131535353717777777777777777777737753777777777753773717735374700000500670446677777776777776777776561004661000006767767777333131101100777777666567777567704040505140777716536353147173135371777777777777777777577577777777777777777353753777371700000001776040404040404606076767776170000470000071101100100000000000110157177776777776470124100002530004777111301313017535371777777777771771737377773777377753773717353252165376164464265700400000000000004040040076774000440000777500750000000000000000017347766777746564100000000400300652513530753303170737777775777777777777737777777773777753757035353134317137313533000046440000004400000000053770000000000077343100000000000000000004135777775676176000700000004044213052153115353371357777377737737775777777573757777777353213503161617163521657257000006700060042400000005273710000000000007577000000000000000000531117777665447405244000000040031501313030721353537737775777577753737717737777777777777035343343131303103171317337130100000567000200000031756000000000000000077771012100101101131117133375466747465707047000071502161011531534353517753773737353777737777777777737537713503353170717173561343105307030525370047014161717433700000000000000000000101011770000006402737373767456467777777773065773510137343531317073737773775777773777577375735737577777343375377373673071316352731717173137000007737352713574000000000000000000000000464000000046733737373446647777777777740007373737110310343537171773565373537577177375737777777777773353737717175357727753717163737357770000071735371677700000000000000000000000000460004004676173737374745777777777777004631713112031213131317337177737777777377777777777777777777775377737777377371717353773571747737377617771677773570000000000000000000000000400400000000406337333464673777777777774007733373311001013135317177737775377377777777777777777777777737777573777377777736771773773716717535343373525773700000000000000000000000000000000000000037337374433373777777777700007740010313133173137337357753777777777777777777777777777777737737775375737373717367171653735727367374753737174000000000000000000004600000000000000000373733643773373777777777404073000000000012137331737377777777777777777777777777777777777577773737773757575735317273353531757535737377576300000000000000000000424400000004000040007373375733337333377777770000700000000000000000070477777777777777777777777777777777777737773757753757373737777775357273673373773535737357000000000000000000004406000000000404004037337333773737737377777700400000000000004006404043777777773757777777777777777777777777773773737773777777717371737357171752573473721777340000000000000000000006446400000000004004337337333373337337337777100004705340100016503777747717717757777777777777777777777777773757757773577173577775777577377773777373757777177700000000000660000640047674000000004000003737337373377337373737774040077760004000000044004737777777777777777777777777777777777773773773577377777377377377377537177535757373537710000000000004040004640604600000000000400073733737337333737373777700000047477420000000000435777777777777777777777777777777777777757777777777777777777777777777777737737377577777000000000004600000460064600000004000000000373373337337373737373777600000000000550043617777777777777777777777777777777777777777773777777773777777777777777777777777777777737737777000000000000000000000406400000004040000003373373737337373737373770040000000002777357777777777777777777777777777777777777775777777777773777573717775777777577377777777777777757340400000000000000040004064000000000000000073373373337333373737377750000000000057777777777777777777777777777777177775737577737777777735777773777773773775377377735735735375737737000000000000000044600406060000000000000046337337337373777373733777007460000000377777777777777777777777777777777737737777377777377777737371775353753753777777777777777777737717750000000000000000000000444404400400000000063733737337333337373377774067400000000777777777777777777777777375773777757777177177377735777777777377777777777777777777777777777777777704000000000000000000006000666066000000004433733337337377333377777700676004004407777777777777777777777777777757357375377777775777737777777777777777777777777777777777777777777772010000000000000000000040004404440000000000373737337337337377777777704600674660077777777777777777777777777737777777777773773773777777777777777377377777737777753777777777777777750040000000000000000000000460460000000000463733733733733737777777770047464067000777777777777777777777777777777777777777777777777777771737177777757377377753777777777737757773737000000000000000000000644640000460000000000073373733733733777777773750660760400017777777777777777777777777777777777777777777777777777777777373773777357173775377735737777377757777240000000000000000000606400000000000000000373373773733777777777737604746400406057777777777777777777777777777777777777777775775771733735377757177175737753737537777757777777777750100000000000000000046540000000000000000007337333333777777777771771066067674767677777777777777777777777777777777377777777377737777775737573737736373717375773777373737377777371200400000000000000000046000000000000000000073737373777777777777737700656476464617777777777777777777777777775757777777575757735773735371737357737575357635733577377577777773777775000040000000000000440646000040000000000000733733377777777777777137106606476400077777777777777775777757357777777757577377375777775737777577735737377371735773757073737175777777370000000000000000046764656546400000000000007733737777537777777777774474407467005077777777777775777757377735737717737377777737777371773737373773577535373437073737757577737353777700500000000000004676474266640000000000000047333777074747777777777776567642766027777757537775777371735777777577777777577777775377777777577577777737777577737757757373737777775777000000400000000067407604040000000000000000077777103716173777777737676665646470577757377775777375777777177377777777777357357777773737777777371735737773735753737377777773577377370004000000000000666424604040000000000000000777777007677477777777767676767474003577777777773777777777777777773773573777377773777777577773777777777771775773777757353753577357777770010000000000040406404000244000000000000000777370141477567777777762476767660067777777773777777737773777753777777777777777777777777773777777777375367377375357367767767737673477140240000000000000446400004660000040000000007737520077772757777770040047667767177777757777777777777577737777757777717753717717777777757753535357777775775777777535753735757177357005004000000000000000040400476440464000000007773401616575777777006440004764256777377375775375735737777777737737737773777777777773777777777777771771777777777777773775777377577773000000040000000000400000000000067400000000077771425777367777700400060006765377777377777377737777777735735777777777777777777777757777777777777777777777777777777777777377377353770070040000000000000400000404000040000000000077770525765777777004004040440065773775717377777777377777777777777777777777777777777777777777777777777773737371775377773775657527777500004000000000000000000442424400064000000000777724077576777700400600007000373757373775775375375737777777777777777777777777777777777777737777377373577575777777573575373733771737300700004000000000000004646440000672440000000777507567657775000444040644047777377777773777777777757777777777777777777777777777777757377771777375773737373737373773377753575377577400004000000000000000000400000040440640000004777407757777700404246044604375777757737777777777777777777773777777777777777777777777377775773575737175717175717571757253372734372773007000040000000000000000000004600464000000007772525677777004704064240124373777377577777777777777773773777777573577777777777757377737373777373777737367363727373735356171737177175000400000400000000000000004600000400000000047710477777700676006564640577777777777777777777737773777777577177777777777777777377735775775377757173717535357174352537737373717717730070040000000000000000000040046000000000000077777711357047600446500072777777777737777777377777777573573777777777777777777777737777377377177377757773777377737777343574356773737710060040400400000000000000000400000000000000771571715356770446002470757775773777777377757735735773777777777777777777777777735777377777777777777737573577177535357773777371747527710160000000040000000000000006000000000000007771353777767600056440042735373775377375773777777777777777777777777777777777777777777777777777757377773777377737777735777537577373717700104004000000000000000000440000000000000077171357777674006064214357577775737757777777777777777777777777777777777777777777377777777777777777777777777777777737777373777737577777300424000400000000000000000000000000000000777174777756765404051425373735737777777777777777777777777777777777777777777777777777777777777377777577777777777777777375777737777353777100100400040400000000000000000000000000007717137577764767404061777777777777737737777777777777777377777777737537777777777777777577777777773773777737775377177577737353753737770737100400400000000000000000000000000000000077717177777467760030065377577777777777777777777777377777777777777777777777777777777373735371777775777177753777777737717757775375753573536100050040404040000000000000000000000000771717177720767000043737737737737757737773773777777777777777777777777777777777777577777777777737773777777777777777777773773737737377357753000004200000004040000000000000000000047773537777504004104375777573757777371777777777773777777777777777777777777777777373777777777777777777777777777777777777777757777777377373777200504040404000000400000000000000000077153577770000016075375373777737177777717717777777777777777777777777777777777777777777777777777777777777777777777777777777375373577177573535300100040104004000040400040040004000177353577770070007277377777537777753757777777777777777777777777777777777777777777777777777777757777777773777577777775377537727576377717252734120050040400404040000040000000400007735353777005006535357777737771773777377777777777777777777777777777777777777777777775737777377777717377777777773777777777753753735752771775173500007000040000004004000400400000477717177775004353777737377773777777777777777777777777777777777777777777777777777773737757377173717777773577737777773777773773777773771773136343700000561040405004000400400040400775317777700367771737577537757777777777777777777777777377777777777777777777777775757717777777777737177577377777775777773777353717773771776535353716000047000404004000500050010001735717777761717777573777777777777777777777777777757375777777777777777777777773737737773753777177577737777537537737777757777777771757372537737271717100005252004004040604004040077531717777177777777777777737777777775777777777777777777777777777777777777777757717753757775377737737773777777777777777777177173777737753770775363774320000416524100000400400004773717777777777737777777777777777377377777777777777777777777777777777777777777737773777773777777777577757377377777777377377777753737753771775375757377577600000106141410143405007757537777777777777377737777773777777777777777777777777777777777777777777777777753777737777777777777737777777777777777777777377777573777777377373775373735373000000000400010000077377717777737777757757571777777777777777777777777777777777777777777777777737773777777777777777777777777777777777777777777777777777777737775777777377775777777777161612161637777777101777777771771773777777777777777777777777777777777777777777177577377577757777777777777777777777777777777777737777777777777737737775773737717717771737737537777777777777777775717177777771777777777377773777777777777777777777777777777777777777777777777777777777777777777377377777377777777777377577177537777777373757737737735377735737737377737775773777377717177777777737777777777777777777377777777777777777777777777777777777777777777777357537537777577773775753573577577537377737753757357757357571753777171735735775357537737571777771717577777777777375777375735377377775377777777777777777777777777777777777777777777737777771773753757377377777737777777777773777377737737737377375377777737573537737753773777777777177777777775775737757737777777757377777777777777777777777777777777777777777357777777777777777777777777777777773777777777777777777777777777777777537717773777777777777577777717711737777173737377777377777777177377777777777777777777777777777777777777777777737377777777777777777777777773777777777737775777777777757777775373737777773777377377537737777777710101417777757757377777771735377777777777777777777777777777777777777777777777777777777377777777377377777777777775775775775737777717717371735377575735373757175365737777773737777777773617377373775737773777777777777777777777777777777777777777777777777777777377757177573737777577773575373573737737777773773737777777777777737373777175337637173573537777577717777753775777775377777777777777777777777777777777777777777777777777777777777777773737773777573573753777737777777777773773777577577737353717353577175217437753577377377771737373773777375377375377777777777777777777777777777777777777777777777777777777777777757153471773737373773771737771737377777777777773777737577777777777377737733717373717177737777777577777375377777777777777777777777777777777777777777777777777777777777777777777773737773771757577573577377717777575717377777777777377773717353717357175717577717753777175773773537777777777777777777777777777777777777777777777777777777777777777777777777777777753473535377373717353717171735373737777777777777777737777777777777737737737353735371737737777377777777777777777777777777777777777777777777777777777777777777777777777777777777777773777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777773535000000000000000000000105000000000000C7AD05FE); +INSERT INTO categories VALUES ('2', 'Condiments', 'Sweet and savory sauces, relishes, spreads, and seasonings', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E5069637475726500010500000200000007000000504272757368000000000000000000A0290000424D98290000000000005600000028000000AC00000078000000010004000000000000000000880B0000880B00000800000008000000FFFFFF0000FFFF00FF00FF000000FF00FFFF000000FF0000FF00000000000000777777777737125353313731773543110105302502105313321714317343717135371373147317317171717121135301610131217777777770146765074747776567616774776565774040371737031611737710110100007777777777717435357353531713343030301103112161705353317353343717135371370317717737371734125031131352171777777714066544724767776774747657700577764774340735757100371507530210777777777777777731737317353731704311151303112110431731305317314171731717171354731713535373107131703011317177777770664576076567476404776147676777674174074740573312411002173611137777777777777353167171735337173531163125351615307173171737171707373173733537023177373737351611010113521737777775245006047474747407777777767657775747477416560075141200115351103077777777777777377143161735717353463107113131303343353171317373107177317173171477135353717370737312503173577777344760547061604760777777777777764677776007470774033001010035212100777777777777777173563535335371731053130707071351165343171701773417357717177130177173717717134101713353173777747640076047447000777777777777777775667570467760774040301010101053107777777777777773712531335337171735301531313134334135353361371350735331737137707137353731737433731717377777776040000407647604777777777777777777460547743565054776011001031213010077777777777777353561737534717337161352171712717103737335137137061373573171711073531737171710351171735373777704740460464746777777777777777777777040667746776007751300530101301300777777777777777373071713713717135241311030711317605117533517171075353357373734173173537373735373773777777770460464740406757777777777777777771777640577740457777000131035310701007777173777777775353431613717357131630731713735311637317173737171235353353535725377777777777777777773737777567404706425046777777777777777757777775246577777767711350131030311300177777357777777737350771731171337510531071351613735534317131717305737357377373077777777777777777777777777776540060405646777777777777374777377777774767777747771076035031110121000173735777777773535307131717373513243357317073171163353712571735073171733535735777777777777777777777777777704600564064077577777777777737777777777424577756771147741121161037100017357733577777773731603521725153251071335213317077071335373371732177373573737777777777777777737737777777776460464604046473777777777777777777737777567776657167647421121121103001035775737377777571711613531337353371435135351713131471731171735716171773753777777777737777777773777777777774740405674747777777777777777777377737176567757370470067070121121100010733531717577777371734173535353353107127713631735370371737173537107377373777777777773777377377171377777777444006640464677777777777777777777777777756777774747047741137112116100305737161373777737173107313531735352471713171173537017173717353731637535777777777777777737737737337177777770760650406047777777777777777077777373437777770567674776012101611210010131717135357777713253425343525353131031717373537171617171371717750537737777777777773737737733713537777777744404656440467777777777777777777377771577774764044774470717131071301210161335253077777757131035313137377534721717173537371637171733737343537777777777777777737737753713137377777764604646560457777777777777773777373001777574777764477611301121010001017135131314377773131716317353135313001717353353717165317371713573173777777777777777737573533373353717777777465404006400767777777777777377735000137776067664707640341216131300300035253521707577135271653531161773716173371375335373531717173757316773777777777777773773737377171313773777770460000440066757777777777777773700010577756764100674031311310100010103131313521073777731131052773171371310715377135737171773353353337717777777777777777773773737333131353353777776764007640456006777777777737371000013576644566565671341210131300010103521703170073735371730311173171371352735377335373725357353757177177777777777777777773737377173317173773777344564046466404444056477777537301000373405606746764011331352171001201013523152107177735303504373171357017005335217135307107317371337377777777777777777773377373137317133353353777706400004400676000640677471001000171464767444564031301052117100301001703117211617173531713035316127331710737171717731734071737171777737777777777777777777737377735333531737777717746654047046440044700465700016113000564440676653130171311303001010303152311340217173613530435313513531210717313613535312131713771777577777777777777777373735333337113713131377777344660240404740064000007003012446064000065641301430121217100303010117214341305030713521770035312153431340315251703537140713531737773573777777777777737373737171337311317171771777714540440064600464074764547407644764474661061711131171213001100121311331330433171353713107121713013170071631331353113013073173537752777777777777777773737337373131371731317707377776646600000000400464006460040000476461100121212163011710430103104341170510350307131714035353017317034353153417125240735317537717377373777777777737173537713137113133135371377737771404047400000000440040000046564612110016111211111303013012110331333130343135134352334031251210717107353213717131300131733737777577777777777777737173713737133713717131774353737777776646444600006000046442564670513430031611030301700012112131170552530043032531351307171335313137007153513035211071631535737716173777777777777737373733733531313133713707375737737757474604640746406546442411030301104111210110303104012112533130313134315113171371407135031707110712313253121520031173733537777777777777777737737373717373313533531177165373577777737777574746445652413513125110130012121121210110013152113152531725005303616343160335303521310243535161134112143537371777777173777777777777731737737313171731353137350737173717352573717737353737171343070110212100210130101013020210311612313171134121711311353134135311353531061303116113010013535373537370777777777777773777371737373331371335117340537153717352573737517340707317351130211011201712103103011001312531711725371124301253717135035215271212170171703130313030703535373777757377777777777773735733717171311371333173163537353707142570532717161352513307111211211401113502101211041713030371135363105331301212530431731135353107031100110411000713737177377377777777777773773733771733317131335353170143417217317073173535317071353250303071021120120301311303124330171711371133150435053537171703713107031316053160317031301071371717717734777777777777777377377337371331351733137124331335351700717053530700714351131501103112107111131030105001153012125363757312131303113121051707131716110210110101100300317137373737713777777777777777777777777377373331537174101170535321705713725353507331216121312110710003070125103130061213110133151317052521716161370213134310313514310303121310140307171717735653777777777777777777775341307071331313130060130305313003411310303014105310101012101214311130121103130131412130757377735213171213135105350311251212021030110101030035317337735731777777777777777777757171310101373535317100112535321610613161035110031310130103010131003030013112105007031301011317731730717031711612012135035335310503110212130104713535713737167377777777777777777737310010135153313530003011010511001212117121243001030012101103010051013100301130011030130077737771750731731631350717133031035302110211010121303533733753773177777777777777777777510100000017335331711043030312121041153010101001121031010102103010303100311012100121010010731737773731731711531300316153171307116111035031101433537533771774377777777777777753012110111000015617137200103110311121203103031210021110010030101010000103110121013000130131017771777771471352373053525313317037130612102103121312573713753777377773777777777735035355371731510001717701100314311430100101311011021102031211011010130010100312112100030012003037777737377335375317330131351631713150110311301535017353777377377177777777777773513513130111053351101771130070131303131053170161307050311101030102121000121211010010101013101101777777777716537131731570716331531352352311210713013343773777375377577777777777713171310135371315373103520010113161311032072113131110311212121012110110031101121213030003100100307737777773717137171731310315331707353014301311253353573573717377737377377777773177125353131735335357103131202521135271510113412163105211111113110121210003100111011100101301010177777377775637717331737071735213317317431734121314317373777777777757777777777317313113107173777531737150101013173031133043713353110631777377777373111001310312121030012121000210777777773733171316171611073135351731703101013171733525777777652104277777377731713535341717353537357571310100010351353250310351317377577525010505357730301031010112100210100101037377777777757335735331734353717371371707131343121753177050001040014077777737713713011331357777775337175000100010370351314771377775713400100000000000417531013130313051130100010077777777777345331735353125353310375313430521353531377770000400140014057777777351717351071353771775357331001111111353353211377777434001000000000000000003531051014110030100100210777777737735335731735217103341737137353413110313535377104700106756207747773537371710325175375777317735110110001107317351677771611013400100000000000000000703121313003012100010017777777777773433173131710735333113710305303431073737770777406456065570014777753103535113137773711771101110010100171771737777171607000010001000000000000000130110300611101010011077737777773717717353731730537516371737125313173171777575646747676566756704773757110717757777773773130000111001110771377777516101105010000000000000000000000532131101721000012000777777773777717317353431343133317171717035307173773777775747400456556756701773737711010343571513571110010010001001777777777357343034341010000050000000000000150121001121100010107777777777771635371353735343535353371335431713535377777770006047606677674073777777771711113173753000001000010100177777777535305141000000401070000000000000000313500310100100010077777777777373537037331530173537317137523173773737777777747650460447465677777777777777777777777300001100000010110777777573530530374175353107057310000000000001710071030010101010777777777377753713713573716137131733533507171353777777777774640540761465477777777777777777777575000000000000000007777777753577575031035257053007700000000000003100121121000300007777375777737343711713131716137171753533437173773777777576700766704465625777777777777777777777737000000000000000077777777773537077577561763571001000000000000053010121001000110077777737777773531733536173253717373373711717353777777777755046564476767477777777777777777777777111300000110101000777777753577753712707100142070070000000010010300713110100010000375771777373534371353317315171731717171707353777377777774766474677644747777757777777777777777717370100013000000007777777777777350574100005251007100000000000000611210030001000017737371777773716135271711732533537373737307377177777777777752424464765677777777777777777777777777141010011100000077777777777770712170710301701617000000000130010531031010101001071771735717777136131173731716173531717135353737377777777747654476744644777777777777777777777777713001011010100100777777777777570570110414161600071000000004170003071011000100000371737137773733417373171371217137373737737771777777777777777467444604677777777777777777777777771700000001010010017777777577757353052431201001015340000000012100171121200100101011735717773375353735317137131613717171731717377377777777777600742076565677777777777777777777777737100010110100000077777777777305705251525034000702100000000005037103101100010000037133710775737352135237317350713737371773777377777777777765046546046467777777675777777777777773710113110110110001777777777775730701006125010100050000000010030013103000010001010717717373737735357135117717334353537373773577377777777777567746644650477577775777777777777777750131100000100100077777777771775711753010530400001010000000010010703113100010000003710735357353737037333713317137373757377173737377777773776564745204646757774777777777777777773313010010101110007777777777577771650341252051012104200000000007001352100101000101017373171737373531617171371713435317337537357777777377377756470064404657777777776567777777777751111101000110011377777777777577161035214105200040101000000000101031013010001010000735377335773773535373173173353737737737737373737377375377777447476704677777775777777777777771371301001001011017777777777537577134104034001001000000000000000700033101000100001003171357331771737160152173171351733717373717177775371737776767460446044777777467774777777777771311111001101017777777777777577756134311012161401000100000000010101012121010000000077337335737377373137335353737363573735373737735337173177756104700046567777777757477777777777117131000100113777777777777776717351410401450101000000000000000016017110100010000010357371773177735371613533371353537373737717353173713717775654065400004677777774707757777777735311010112113777777777777777535757161252161210000010001000000010010310210001001010007335377377353773530713535337337173537373735377311713737765670000004004777765656577777777777531311010111777777777777777777536352141010014340100000000000000010000311010100000001071775335377373737170733735717537373717373735317373717775725650000474046777577777677777777773711311313777777777777777777777575757161050000100000000000000000001001210000100000000377335737737777737313571733733717373735353737731353733770567000007400077777677777577777777735311177777777777777777777777573537010116310100000000000000000000000131010010000010105335173353777371353053331353171735373737373713177737777770016140740004777757777747777777777531377777777777777777777777757347753777717400000000000000000000000010103001000001000035736317357357377317271737373735337171737353777333737377716140141003473777776757465777777773537777777777777777777777777775771757761601000000000000000000000000003100000001001010173317717377377373711373535353734737371717371377777777777502112007047377777756777777777777777777777777777777777777777777771777771501000100000000000000000000000003103010001021016317431635377377173727173373371313531373737377737737777733714005001737377777777777777777777777777777777777777777777777775777776142140100000000000000000000000000110001000101012017713173537377737353117317137137343777373737737373773737373737137773777777777777777777777777777777777777777777777777777777775011210010000000000000000000000000001200100010301211431617353717737353353613733537335373337777733737373373737373737737373777777474240567777777777777737173302137777777777777753435341410001010000000000000000000000010010003010101003173617313737573753353435373135337773333777733737373373373373733737773777756101000507777777777777776140500001377777777777753525210250000000000000000000000000000210010010210303117351314771737373371321733173737733337377333373333373373373733773773777714000404070747777777777400000000000400257777777757170714141001000000000000000000000000001003001011010100617335733135377717137152357333773337333333373337373737377373777377377777435777707477175777777700000000000000005377577777716171430300100100000000000000000000000000010021201210311314121353737173737313253333733337333373373337333373377337373337737777710777775077574707777700000000000000011007377757753717071050140000000000000000000000000000001000101310310035737171253537177317353057733737333333333333337373373337373777737777777775475725777770477770000000000000000003005777677757717070102101000000000000000000000000000121010100310311121312135353343737733337373373333373333333737333337373737373373777777777773470052574177777700000000000000000010077575777771751016010000100000000000000000000000000100030310130307171353433035353773731717373333333337337333333373733373737377777777777777747125352757657770000000000000000001250577777753571252501410100000000000000000000000000110001011013010112130313117312777733323323332337333333333737373333737373737737777777777777140016050257407700050000000000000041003777777777357103000000000000000000000000000000002030003071301213353413437017717737373333333333333333333333333373733737373737737777777777777375017257400747100000000000000001000075777577575307505101010000000000000000000000000010101211035351010313703113733337337333333323333333733733733373333373737373737777777777777777477405670067777000000000000000000007743477777737530302500000100000000000000000000000130300313121213013431353673377373323333333333323333333333373333737373737377777777777777776747640424000474775200000000000000007575707705753553141410010100000000000010000000000013011035217131301703137331373333233333323333333333333333373373733737373737737777777777777756777004774770576705700000000000002177677057777777347130012000000000000003500000000000013125035217050131353137337333313333323333233333332337333333333733737373737737777777777464644640004047406700677505000107161756505777000575357316153050101000000000017100000000000707125131213130137333273313332333233333333332333733333373737373733733737737777777777656740000074067640000575767700416500416777777775777777717535214010000001000005370000000000424133530351302130137333323233333333333333333333233333333333333333773377373737777777757474000004656504704756524057470770071257777777777777571771341431001010000010117430000000007406753071034111013273331333323332333333233233333333733733733737373377337377777777774246740047000064704706760077077574774774577777777777777775347131020500010000035210100000000675740243103130303033323233331333333333233333333333333333333733337373337373737377776564404004064000474404004104747724740776776777777777777774735317435102100010015035700000000004642440043101010101331333323333323333233333333233332333333733373733373737373777777706400000670400000000070470477777577074757757777777777775675775701520510521001431500010000000700040056103121312103233333332333333213333323333323333333733337333737373737373777744470000004041640560046747477757556777417677707777777776567467171353413001006143043401000000074000004640210101001033323033333231333333233333333333333733373737373737337373773774676740460000640646406756777477776775774675447407776774052467747257253143525012107100000000000464270047040121303121333333323333323333333333332333333333373333333333337337373377640444004000004004000046777770707756767775677777657574256477567057357057177171410507110100000000054640676740101001003033333132333332332333033333323337333337373737373737373777774040000600004640000470047677434475034774434774750676705657740400645717377753430001214730000000000600004404042101301333323233333333333333333312333333333733733333733373373737376420000004006040420006406767767477042457707407047765774067764740064163717575251010000573500014425604450000046500210130333131323313233333333333333333373333733373733737337373777745400044004040000405447747747577774050604077447747465765044747604776445777775200010101350102467406470640000046041030113233733312333323323323323333233337333373333733737373373774664400000004000000460467767676776770675424770747725046565677654004476064065351777777777770005470474004000600470001012031323333333333333333333333333333333737337373373337377777000400000000000040000006767477676777765702576004765406770464004604700440000577777777777777750076000000000007407646001211733330332332313333333333323333333733333733377373737373744040000000000040647400477676765657656564047645076567656440756425674004704047777777777777777710400007647600540044650030123333333331333233233231233333337333373733737333373737777000040000000000040004000445740400676472470041674004740400042447560470424747677777777777777777760004047044064600000640171130337303233333333333333333333333733333733737373737737765400400000000400046004600064000400400540470047040076000470047646404004740004377777777777777777040077047707400740000740121333331373323333333333333233333333373733373337373733777046400040000000640040074006004367400407601647400764045607404650470576474040654777777777777777770404400746440044674046002117303137133133233231233233337373337333337337737373777704640000040004040000004400440674400046764064740040410065247000006746645647704427777777777777777700600047004704670400674013031377032323333333333333333233337333373733733373773737400000000000004040074567202400460000007400564706776656065646406004007247044046577777777777777777040460057706000400005674001137117313330333333333333333333333373333733737373377740400004400004000004464044047004747440046564006004454045640474654004744064760006777777777777777777400400674147700707604060307032313733333233233213233333373373337373373737377737740004000040000040400070004406640460707656475004006020064047441600474007476500077777777777777777740000000047464064074004400117313073333333333333333333373333337333337333737373770600460004604000007006464640045061046404650640560056440540064674070465647400406477777777777777774000420000760000434007060003313753533723331333333333323333337337373737373737777704700040640004000044050065000460460074004604006544640046700470640470744006647040047777777777777000400404007704000467444044013073312713330323323323323333373333333333337373737377466400404400654060006460460447474050060000460046064740004474400564464024045240640004777777656744000640074047777047446056700053531713733333333333333333333337373737373733737377774400000000047676404746540000746447465440047406704504004467404046746540470564004740046567765656424064040060777744040610674003312731353333333333333333333333333333333333737377777400004440000464640004044604464647676766746560404046000476776767677776004646400404656676646464644400400640404777600004400460011713000000000000000000000105000000000000E0AD05FE); +INSERT INTO categories VALUES ('3', 'Confections', 'Desserts, candies, and sweet breads', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E5069637475726500010500000200000007000000504272757368000000000000000000A0290000424D98290000000000005600000028000000AC00000078000000010004000000000000000000880B0000880B00000800000008000000FFFFFF0000FFFF00FF00FF000000FF00FFFF000000FF0000FF00000000000000113330735737777704000000000000006060000252000014131315311716037070021240161075371617637506357172512171357170173537160000025214002070000012436167777777173333737171773737377700001111131330131357737700000000000010000050040006331131313310705073430040000003070761617433514356537571773171771716167170604076776775677064253437177777737357531737373753537337113313111111113131235777000043712006767773677777711131531311777377077043125361707171177773563737373563777177371374735716771707717735637700016777476777737531333733537371373717531111313130131316131112163035371350007753477177311137133171331777777770734772516177777717777352575777357377717537533173777160277767777777043635673717737533337171353735737353773713111271131130317013111111131131670073677776771733113113135137777777771470777616777777777175377375377357177773573757073577775677777677770365635777677533753537337371737353377377313111123130131313103131313131711770477670777353533133531331177777777763777177717777777777735357377757777737777353353553737737777777777761771637535733533333135317373753371317371271131111313521313310112131171337003717377771313117113171131777777777177716777777777777777777735353773777777777775773365777777777777767160677747673173717117337335373777177775311123103121113130371131317113313143047765767171715331313133137777777777677777734377777777777437577777357777777777737357530735777777777776071777737317371733733531737177313733737131113313113303511130153311311317343077777773131331171353153137777777735377777777777777777777537737177777777777777777737777767777777777717061617717331337313173371737737373573773103111313103132130133071311311313000617277173171731331313111137777777777757175377777777777736527577173757775777775257537171777735361777253525616717373535333171371737717173753713313121011313113113153131131371310000604167113131171131713131177777775353737736535777173773753752767757377737737777736757777177777776165206353735331317337133335373753737373773111311131311301312130331303113131701070127013353133131713113113171773737773571753773527657765274371717737737777773773753637177777707177716535273533173731713717133717377317177373121131111121130313131031313313531600076507711317153131313113117777777717163763777767753717373136161634777577177757757777567075717776353613437473353131737313313353373731373735311131103111131111301731115313313131120012507317133317131713113137773577737753753435373777675756537535736173777737773773577377736777777677617437173337331737313353353753771335337131111110131303121731073131071313134107612771313535313531311313573757373535375377777567743527253473434357677537577375777735717771717171771707167317131733537317311331373337137131103331313113111113113312133131313503071650131313131531311313173757377757777737437773717377775367343717773537777375773737777777777777777167736535333373173731313133537311313313311111121353011303310335313111331312161677373135373133131135311777377777373717537717777777777725357343634777777777773757757777777777777777716573733171317171733313713317331331313331331130313311113311133173311531371753777717131171117173131311777777777757737717777777777777776347757737777777777777377377377777777777777773777173133333373531313313313331331311121773313311031341373053105313171773777771313537133713131311137777777777377777777777777777775357777775777777777777777777777777777777777777777773313713535373313313131331110103131137701710113113131317331333131337777177731731311311317171131177777777777777773717777777777377737373737777737777775777777777777777777777357777131331313331373131313113111010111773371600771213011305313171143171137777777131713131731313171131777777777777777777777777773577737777774770737777173737375777777777777777777775737331313313137353113103113331111117701677000071513131331353133131331177737753131313531371313131117777777773777777777353535777377771773773775737177777775377777777777777777777377735313313131313373113110111131113171607777000072111111134337113131133771777735317113371310117113177777777777777775377777773777535377357177377777777537777735777377777777777777777133313333131313131101011131113111677077700000000003373131013353533713777373131313135135313631317777777777777371737573773777373737717337317737537373773777773777753777777777777737331311113133133313111131353353137777343400000000000113113111312111717357713171313133131717531177777777777375377773771771717171713707531753573735371777373777173777773777777777713173133313113013313131113377377177701353700000000003113713121313131317371371311317173171317131377777737357377735371771373737371771333533723171735373777577777777773777777777777733133113111113101313131757173173343410111313410000041371353135313537375335131731713117135377177777377757377577173773777773535333171713531117373537173537373777737171737777777777313313113131111111311173337357131353131301111343035363131317133113317137133313113313313531631177377753777773313717353121013131717171312113331313312113777753737777777573777777771331333111000101111130311771733110111111110311317525753173113153035337713535317317315313171533157773773735375353717353113313131331310110110131311313101313773573737773771773777771133131311111131331131371373713131313013111311313737371173713131317137713131315317313531373513353577757771337317313133313121111313110110131111111111313033173753773777773577377733133133331331331331011171717311111111303111131353537737113312171313713713135333713713171173711313737331371731313313111111113030101210111110010101011111110313371353737753077777313113131333133131131313373775313011031113013131317777713371713131131311353733171371313107171131131135777137113111101011011011111311113100011110101000010111121131377777377307377131311331013113133713131117131111313503113317035303177353131713171131731311171137131353131213171153131137313313010101001011010101110101111000111010101010101101111317377357757077111131101013313713331133110171031131352115213131313131317131353031311353373371137171313131713133131131331310113111131130121111110313101211310011010101010101100011337177737737173131111101011173735333533331313501013111631131735353173533533313135313135317137313313171713111111111111101011010121012111110101011011131101011001101103710112110101117373773777653113101103137173133533353133131313171313113073130331213353135353131303531733711535353131311313131313170101101111113111101010101101101010311010110110351310153501011237175377771377111130111313313353335373311013113101213713103131131317335131352133533171711733313313131311111111211331130110101010110110101000101101101013030010131031131313531011137337135370527131111333331353335333171313177307335112153171725353711131713313513530337331717317171131313113311017521012110101110010101001101000101111211111101013170170103031210135337377737147131331311133317335373731113111711533113313331131310317131311713313171537171371713131311331311011313113111011101011110101100100110101011131301317010113131311111113331713317777323131131003131331333131337307131130310311213533173131131317173171253133353137131313131131110101353531010101110101101010100111010010101112101101313131310101010312111113351731777507111110313133133113373111711103131135371713413107112111313131311353571373537131311103101013531131211110101010110101010110001011010110111101310101130113111311113010311331733537707331111310113113313171131173171533131313133173133713121713535312133171173533531313111111031121111301011101101010101110111010011010131031310111110112101010121013110311331737737707713111113313013013131103113131013131313111353171353171353131113517137317173173773301013113130311111010101301030112110101011010110103101010101010111101211111312111031173131717127731303311210101313173171311131701616017337335331331313317130353373531733317717311113113011131030301010110131111011010111300101011311131110100110100101101010113101133317173777077775775311111130117113170706070700005200101731731535351731171353173171757733717310313011011011111311110111101031013110101300001011010121010110010110110101100101311111313353177577737737713131111371311777777777716705347253531731313313731135353171373317753311351011101011101010010110101311013101011011101011013131110100010100110101001110100230011311377137037777777777777377770707725777777610634305277353535353731737137137137177731310131331310111010111111310113111011101131011700101101010110110101001010010101000011031371011373131717777077737575775777777777773677761071777520735373713171773535353717313713131013011111011001010101101031101011010110101073113110111011010010100101010113010311301107333013313773770777747773773437577725777777777707767036571737753735371353137353731713731101311303013775311011101111101111011010111111710100010101101111010101001011011131121100331311011311171771777375777777537777776776776777707716537371713717135377377171713533111331113011111313377751001101011100101011010101013311111010101101010011001010101010121101100110101011033735377777777777577777777777777777777070773535373773737735317177373733113131101711300101101113733100101101110101001010111011010101010110101011001110311010111101100110012110103117377527777377777357776776777777777770525313371717353713171737335371713311133133110111110131310357710010101010101100110101701110101101001010101110001101010010100111011111010010335317777574777777775377771725707777772531715373737373717377535771737351311111011310100111010310313371011010100100110010103101010100100101010101011131111011010111211001011311111131237777375777757777777704725707436531713737177173753535377637371713331313111101111101301111131011133010101100100110110111010101101110101111101013013011011010011011111011101313011753777737777777771725073520717753431353537317351373777071757373311111111301110101110110310113101013110100110110011011031001010100110110301111301101101101011001010101101110101071371777777777771704720742577634367125313531717377575707737375311131313131101011101011011013010111010111011011011301101101101010010111011110310110110110110101131310100101011113117177717577753577073512753471777707531753773717737737735357777731113113133101010101011011011110011010101001010101110101100010101010101010110111010110011010101113130110101101013031777773437777770742616343061617707672717177777777777767377371713113111113110101101001011101111011010131011010101010101110110111010111010110101010111011011010111110103101101211771777777577777712755257777777770735357677777777777771735735737313111012111010101101111100110101001010111001011101101010010010101111010110110101010011011001031011010100112111177377777777777757616327777777777777567773577777777777777537773535313100111101101100110010111010111100111010111100110010110101010110101111011011103111101010371713101113111011107313537771717577775257507777777777737377777377777777777773777377331310113121130100110011010001010010110101011010111011010110010111010101013013121101610101217130110101010101103131717771777777171727777727777777777477777777777777777777771735375331010101121110110111010111010111010101010101010001010100101010011101101011011101311371311525110110101013101111310317775257377777507776577777777777777777777777777777777737737137131310171110010011011110101010001010101110101011301010110101011101101011011101131311111703130310110101010110101031753777775777777727353777777777773777777777777777777777353753713571013121011101101101010101001110110110001011110111010000101110110110101010313010112121353411011011011111211113153775375377535776574347777777777757777777777777777777773713331313353535131000110101313110101100010101011101100110101003110110110110110101111011352111531113701101101001011130113317775777777777353774377777777777737737377777777777777757717131777317331031110101101101110101111010111010101110113111577777370110110101100101013131613536111305301011101011010317017737777777774347034167361757772757777777777777777777737313133111371531113111101110110110101011310101011101010301077377377710110110101110113111531353113635130171010173101131713777577777777774373436756572773757737777777777777777773737131011311713101035010101011011013107101011101100101311117737775773130001011101013101213317134311113717217073110113131317777717777777034141617373777677737777777777777777777777777131310303103131131773730101011101313111010110110101010137737727170131101000101101311311037135031701315313152111013112757777775777773436216167567535777777777777777777777777717373531311153110110737777537131031311777713110110110111110737521717310101371310101110311017101131431315311713313011013113737777777777741615250716352773777777777777777777777777777313130107301031013513353173511111035331717017010101001011713537371011135377510101011101713110353171301301110111011101357775777777777216102527777777777777777777777777777777773735773513111111101101315335317301035130101311311110101117727773777710112112537371301010330110317131135311113071121013137775777777777775250753477777777777777777777777777777777775733133717730101121101031535121331134111301711212511121713513773531312113111305377771735110101213170101303011121171101013777735777777702527673477777777777777777377777777777777737717113317531121101311131121711521131215131251113031112513411777701111010311310135371121031117152131310111011103171331357735777777777753473743777773777737777777777777777777777371737353533101110101012107111031110111133111312111103013103121331310101011010533531121113101213111110110101101353131111377777773535777673757777777777777777777777777777777777777773131313305311011101311311213101211031251031011101351710101111010011011101311351317111301531113012111011010101311301257777775777773773747763477777777777777377777777777777777737777131315301011301311131211101311131111131011101370130351310101111071103110130310313161713121013110101011010131301111377777777577777757737573777737777777377777777777777777777177353101311313010110121051303101121012130111010777173111210731101011031101130111310113131211113101112101011031101121071777777777717577763572757777777737777777737777777777777777777777131317101111031111315310101111111011011377353117121177101100101170101111030131211111121301101011117017521113113137777777777777737577257277777777777777777777777777777777773773731121735310101013030130531130301211301777717171303110310110111131371100101111101113030110110301010731713112111735777777777777777572775357777377377777737377377777777777777737753531171717010111011110113130111311101137777131171110357713010101011130111101010111011110113011111310173717110131737777777777777777257276353777777737737777777777777777377377177373713537313510011010131010131010301101777371731121110373053510111010113121101110101010110111012101311173137313031777777777777757775355717777777377777777737777777777777777773777713137717131311011011003111011311110177735331071152117771313210101011010110101010101010310101011101437113717353137777777777777777276373777377377737377737777377777377777777735777313171312535301101101111301301101037771731153121211735311435112111301013131101101011111011131121313310301371311777777777777777775717777777777737777377777777777777737373737737777130317113031710110110101101100101771731521311111317731213112112101111101030110111010101010101105015315301377137777777777777777773777777777737737377377773777777777777777777337777531313111131312110010101101110117771731131303110173111010717117112101101111030103110111011101131211313171313777777777777777777777777777737773777377773777377373777373737371777773131350307105351011101101101010773121121010110017211011313130311251310101001111312113013101301011121371313777777777777777777777777777777777373735737777377777777377777777737777777112131113130107110110110101137112110111011013771101014352535211130713111131271011101110110121130113137357777777777737777777777777777773737771737737777717373777717373737717777773113573773531310351011011101713111011001101073570131313113131213113152121051111101111010111110135711153777777777777777737777777777777777737373437737737777777377637773737377777777313173573535310311211010173010111011100111773171035253143151707352111113121031101211130101735737373377777777773777777777777777777777737717353577777777735737737737377737177777311177777317353535311121110111010011001131077735303513101313131311113030101113103135121413131733757357777777777777737777777777777777773573737377777777777777777771737373773177777173733531735371307030111031001011101110503171521711213531703703130311111313105314103531316113715331737777777737777777777777777777777773772737370777777777717777733717377777177777311773771531735317110101101101010103013113773111211713121311110110121210101121131713535317313331737777737737777377777377377777777777770753573534357777377771717752737377777777777731531731735735317312101101101031111013410717031701107111303110111111311121125371773535371711777777777777735377773777777777777777777377373727373734377577777771737377777777777777773173531737173535351330100111103013101311211101130313030110110103010101113537137177377171377777773777377777777777777777777777777777707773534365737716375357163717377777777777777777313771737753535373513171010101110131071112113011101111011010111113103071717753717717335377777777777737373777777773777777777777773707167335327777714177371727377777777777777777777711335353737137153717177711110311011130113011303101011073711012103113131313353773771737777377777377777773777737777777777773777773737376335353517730115073537377777777777777777777731537353537537371737137370710131030130113101101101033717735317177571615353353573777173777737377737377777377777737777777777737773435317237277735341617317377777777777777777777777773535373537177171717537731313017113513050310110117575773535353713731331357373371317777777777777777737777777737777773777777777773363735353773777535371637777777777777777777777777713137717177713735373573534307121703035371031037773737173735373777171171331317527777773777773737737777777377777777777777377777777170736357353032525637377777777777777777777777777777513737737771773533573531717171753537173537537173537753577717137173131171637177737777373777777777773777777777777777377777377777372537236353533531377777777777777777777777777777737353537531771737537773571777731373537173537537153717373335377173537170675242477773777777377377377777777377377777777777377777773712717737252163777777777777777777777777777777777577737737773173513717353777371435753717173713173735375357533133317373001024107343777373777777777737773777777777377777377777777777371210101217377777777777777777777777777777777773677753537317131371735371777713773335373571717717171737733113100137100000100074347735777377377377773777777377777777777777773777777773737377777777777777777777777777777777777773471757373717707175371735373711757357537173737713737335353531216174213000000000160137737177377777377777777377777777377777777777777777777777737777777777777777777777777777777775773472777573717707025371735353733717337173537531717175737373171706353471000042107162473637376373777373737377773777777737777377777737773777777077777777777777777777777777777777737753577777777770735317171737371753735717353713773737333531370070714253600000010616150377177177377377777777737377377777773777737737777777777307777777777777777777777777777777777777767177777777775040603121317177377173311317777131311010343107347435341041061061777276536363717737173737371677377737777777777777777737773777017377777777777777377777777777777777777167777777777727371707576713177377311060131313371763434340347737767761207161007077573713173771776375675271735377777377777377377737773777707677737777777777777777777777777777777777177777777777525677020753673135311677166072147777140774340377677777741676167077773767776172723377373737377377777777737777777737573777370761737777777777777777777777777777777777777777777777777773577527777172531770167107757375676372537734777777777275347712777677777037017757137373735235237377537773777372777353537777173577737773777737777777777777777377377777777777777771776172577777777607077070777677777314775610477777777720536710657777777770503303323743707073773577733637777377773436777670007677377777777777777777777777777777177777777737777777774176142770776777307077070773776777430637270777777777512416370376775777727765301703353737371212537771703774371773535213170001077377737777777777777737777777777777777777577777777736012147777753574007052525777717763410505003437707176012140505717727035001000600343303030035353637163775377763477637767007000375273773773777377377777737377777777777777777777777610400030707276301000000072504761700020000077410776701600210063600534720000201006304343037020071707707127525353703170716100007737777777777777777777777777777777777777777777777101073001675250534060030104352430170507016125703676010000050002714177043401401400751437070500143163740707703727343767070700001437735373777777777777377377377171777777777777777777777777705207772521014060707617767070305204036571717771610012415636707371423000210727052572002007707307007707163701010070760002053677777737773737777777717777777077777777777777777777777775307077560210110717617167761615314172776707761670717271610707671507014252572572570500740700434300707161677677770107001671737373773777773773771677777717171771777777757775357777777525252105060601671616170105204216357071770101034725777777771060701610777777777252070307077700071616177777777770707707373777777777777777777373777777777777177777777777777070777777777770707171777777777777773573577777777777777773577777777777717770777777777775257770434000000000000000000000105000000000000E1AD05FE); +INSERT INTO categories VALUES ('4', 'Dairy Products', 'Cheeses', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E5069637475726500010500000200000007000000504272757368000000000000000000A0290000424D98290000000000005600000028000000AC00000078000000010004000000000000000000880B0000880B00000800000008000000FFFFFF0000FFFF00FF00FF000000FF00FFFF000000FF0000FF00000000000000777777777777775773775737773773777777577777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777173434716174361735707353436571717377235700007777777737777737777737653777757377177737537537777777777777777777777777777777777777777777747657252103060206042434777777777777777777777777735777375374361705253432163617075727777777737777777737777777777777757775777773573777777777777777777777777777777777777777772524141210000040604004000000000004061677777777777777177763534736175370773527577757777737577777777773777773757717717717717373737771777777777777777777777777777777777777777777127052430200400604200000000000000000000000000077777777777771776773717237077052707271735735677377737357775773577737777777777777757753777777777777777777777777777777777777775251076502410040600600000000000000000000000000000000000007777777777171756757577307371717076734737177777777777773577777777377777777777777777777777777777777777777777777777777777777676107412042000000000004000000000000000000000000000000000077777777773773637075352525617357737576177357777357777737577777775371735737777777777777777777777777777777777777561600000016700604004004004000000000000000000000000000000000000000000777777777177777377677773765725772737777777777737777777357357377777777777777777777777777777777777777777776536177777777650060000000000000404000000000000000000000000000000000000000077777777757377671717075377777577573777377777777777777777777777777777777777777777777777777777777777777172577777777717777040040000200000202004004000000000000000000000000000000000000777777375775777777727171777373577777777777777777777777777777777777777777777777777777777777777777567537775767775600247142006040404040404000000000000000000000000000000000000000000077777777737370707567677774772777777777777777777777777777777777777777777777777777777777777757572536577727757700000164250400000000000000000000000000000000000000000000000000000000007777373775673773717353773577777777777777777777777777777777777777777777777777777777777756376357616767577777700000025020000000000000000000000000000000000000000000000000000000000007777777777174347777775352717777777777777777777777777777777777777777777777777777777777374357635737576167061652007560400000000000000000004020000000000000000000000000000000000000000777757377737716177767757777777777777777777777777777777777777777777777777777777777765374357434777077752161257003434246040000400400000000404004000400000000000000000000000000000000477377347563777071737377777777777777777777777777777777777777777777777777777777775161434243652527777756140007403400004204000000000000000000200200024040000000000000000000000000000377757737356177777756777777777777777777777777777777777777777777777777777777761636342707165256775777777777777000000000425200000040000000040040400402004000000000000000000000000000077373525617271617735377777777777777777777777777777777777777777777777777771775414340564167014707777777343576100000000004752440004000400000000000004204240000000000000000000000000077567773615777725777777777777777777777777777777777777777777777777777777770736340703167047025200777757202172507060000000652060004000400404004004000000040004000000000000000000000077352353634371737177777777777777777777777777777777777777777777777777777670504250746014304004043434275710050725100000000047004000000000000000000404000200000000000000000000000000077775743537477476777777777777777777777777777777777777777777777777777071072435274212420424200240041427060030052473400000000420000000000000000000000404040000400000000000000000000077172353653717353777777777777777777777777777777777777777777777777177477043425010410400004040043607404140061253043612000000040640000000000000000000000040400240400000000000000000176775253777777777777777777777777777777777777777777777777777777776537043471724202420424003043405607024240040243043416100000000060000000000000000000000000240000000000000000000000735077253434353577777777777777777777777777777777777777777777777773467743424014040040000604306521604000000000000100216034000000042500000000000000000000040004000000000000000000000527014343537072777777777777777777777777777777777777777777777770743535360500606034034070434702040000000040040042410501434020000000656504000004000000000004020400000000000000000003714363527707357777777777777777777777777777777777777777777777775347765160610014024072452400504042000400000000000200203030506000000000616160000000000000000400000000000000000000001634107107717777777777377737777777777777777777777777777777577767347724100424204070452521602002004000000000000040004000030314700000000042470040000000000000604000000000000000000061527077316703777777777777777777777777777777777777777777773752577716524612500563472524040040404000000000000000004000404004212520000000000047002400000000000421400004000000000000172016125613757777777777777777777777777777777777777777777765677741607521040256056152434306120102040000000000000000000000000040357340000000000650040000000000060000000000000000000705253573757277777777777777777777777777777777777777777775371777760524747025617256250004404464040000000000000000000000000000000000716707000000065242040000004074000040000000000000725363757257777777777777777777777777777777777777777777765671671702503244707657050656125212120350000000000000000000000000000000000001616520001060546006000002070400000000000000070707577277777777777777777777777777777777777777777777777371677564652645217771616070216525674774301000000000000000000000000000000000700712107700112034610000040470000000000000000170707257753777777777777777777777777777777777777777777776565352535214120747774343417470753537531000010000000000000000000000000000000070041650030677400046000253640000000000000007070737773777777777777777777777777777777777777777777777717374240607420547356534343743773676573000000000100000000000000000000000000000057252121013577777000040643740000000000000007071757777777777777777777777777777777777777777777777777656534343416520347736747343743571777741010000000001000000000000000000000000000217010000203177777742041677740000000000000725242737537777777777777777777777777777777777777777777753737470042430476770571734775376777177300000100000000000000000000000000000000034161001210102777777750000567704000000000003525375776777777777777777777777777777777777777777777777765743004341043177177365777167571677770000000010010000100100000000000000000000003002100010617777777600600000425600000000056102527377177777777777777777777777777777777777777777775363742524242147576525365777772773576710100100000001000000010000000000000000000000100210211037777777007000000000424000001200614357176177777777777777777777777777777777777777777775752542505252167537565372573577577357300000000000000000000000000000000000000000000010010201077777770077000000000000000025300020216177777777777777777777777777777777777777777777727772142525042536743534757777772777774100000001000001010000000100000000000000000000001210121777777700000000000700000000704034175777737777777777777777777777773777777777777777777577054252420356771776777273477777477710010010000000000001000000001000000000000000000000012107777777400000000000000000434303403434341577777777777777777777777777753777777777777777077025241504252563575257577775777177300000000000010000000010000000001000000000000000000001217777770000000000000000000000701612537363777777737773777777777777777777777777777777777167061626143473576377727573777777747100000010010000000000000000000000100000000000000000000357777770000000000000000000000761612535777777777777777777377777777777777777777777777776714161416007076175673572747377777730001000000000000100000000100001000001010000000000000000277777000000000000000000000000170777763777737357353757357777777777777777777777777777753422507241707716437757757775757777500000100000000000010000000000000000000001012400000000000021776000000000000000000000006707343575777777777777377777777777777777777777777777777767450615242506717653672771777377737010000000000010000000100000000000001000000001000000000000404070000000024000004000000016107777377357777777777777777777777777777777777777777777173070625042516705657757767167575770000000100010000000000000000000000000010000001010000000000000040100000176000377000770352525347777777777777777777777777777777777777777777777777656071425252435635270777777772777710010000000000000100000000011000000000000100000000000000000040252400007610004740007077602537737777777777777777777777777777777777777777307757775307406160043463527577757753577707000000000000000000000000000010000000000000010000001000000000025240000007000037000007761757777757777777777777777777777777777777777777774716773776502534165241756752707677767757770000000000000010000000000000010000000000000000010001001200061420000000000000000000003161207052777777777777777777777777777777777777377717617747777702436125260743657753777777257730102100001000000000000000000000000000000000000000001001000061400000000000000002506061657127052777777777777777777777777777777777775770777065707776561405601416165252765777577777100010000000000000000000000000000000000000000000010000102567060000000001773774352100001206107357777777777777777777777777777777177777073701752756177347360560605257653563477777070000100000000000000000000000001100000000000000001001010216100000000000606043437777777777535771677777777777777777777777777777777777775777720253617056704076161425241652577736577710100010000000000100000000000000000000000000000000000001636160000000000000000000424343437763071777777777777777777777777777177777777721747570257077717725036163425243652525777777700010001001000100000000000000000000000000000000000000101404000000000000000000000000000001757277777777577577577777777777777777735773577737051207430653524507041425241616525074743101000000000000000000000000000000000000000000000000010202020600000000000000000000000007477375777777773773737377777777777777775773576777752025070161347770240724340160652567371773300101001000000000000000000000000000000000000000010001040040000700000000000000000000077767777777577777777777377777777777737777777717161743507076146161657070524176050065256563673730000000010000100000000000000000000000000000000001002040075017700003740000020000077772507777773777773573757777777777735777737777007007342100170352573657070524016070024343571733733210100001000000000000000000000000000000000000001000077760077200007600000750000743756173777777773777357373777777735777777765307701635250610616070052725242525607043410706074773773610010000000000000000000000000000000000000100000777777700774000177000017600077774216775777777777737735357777777773777707534160060070521061001725250577752520140707060407434373333321000001001000000000000000000000000000000010137777770007700006770000777005777425621777773737777717373737777777743777777034177171030060125614165252552752576034043470702434277773732301000000000001000000000000000000000000000377777770017200017700003770027777001567377775773537351717537777777705053770436143434070104030612101612416070757434343434707056173773737321210000000000000000000000000000000101007777777430000000035700007761657777023057737736153434370703777777753027777072534341603436737410707061613611616252524340610707256173773737361000100100000000000000000001000000000177777777000000000000000075425367700456375773717273537073171777777361417777050616030141410041271527170040065255352534161460525024377377373337312000000000100000000000000010000103777776740000000002020340702576770612734736157777577577174341777770521257772171616577273430034020142534352101207614216167376167534217337377737631210001000000000000000000000100377777777700000000000140000252753470434717717235377363777373771777770525277576507177775001412535160342100052405205214704175070177777777773337333733733000001000000010010000100007777777576700720000002102141652752430525637777777535757375775277770702525777773777717120302050767050104777253721610610212527416777777773777737773772733312100100010000001000003777777777770057400000056000200256341402527535377353773735777377774030050177677177777772514101200103777777775705050161241470412707777573777373773337337373733250010000010000010177777777767700272000000374000175770002016752777557671775777375775377470276717177777773712037400142057740217737727060041020003040775773777357373377737737372373333431010001010037777777765776105750000007770006027740012452777353353771737177777377737775357777777777657571763002100212710612410535161061434343000737777577777777337333737377373733332303003037777777777777576002700000007740305057730003052557677771777477717377775777777777777777757373070104104000417651251243420107072534000437775737717377377737773737333373736373373377777777775777727770371000000777000026777400006357353777176717353775777777537777771737777377740170000630000377025724103416000057052573775737777777535733773337373776373733337377777777777777477577000000000003770002517772000534727771777717777777777773777777777775717777571270030010750304161407100617070012006100777737753535737773777377737373337333773737777777777777777777777000000000000300142437740002437577177777717357353717777777777777777777773751734000007614300037707010074010401000703717773777737435353717373737377337733777777777777777777777767765200000000300030303474340107437777777777775735777777777717777777777753567721737000000037430070707352037421000125075761777177717737271737373737337731437777577777777777777777757700000000000000404043076120001747777777777777777777777777777777777777777730507430001000753401000006004143100340003773777537712771717535277373717531343777777777777777777777777774100000000100003034307410002567377777777777777777777777777777777777777771752013410025037700000100104002016070000001771737753757172713617116352733077317777777777777777577774777772016000006000007000743600012074777777777777777777777777777777777777771612052412410735700772000000030100010170100070775717371736173753737353711653107057777777777777777775777777750275000016000007000347000074377777777777777777777777777777777777375377775210241277727777050000000000000000700000375363743563537152317071253731357317377777777777777777777777777061760000770000770024370000035677777777777777777777777777777777177777771421434120500143417007006005000000001600017527357377353716375613535352534331707777777777777737777777777776174300007700034740535770003473777777777777777777777777777777777773534163503430752142100025001010206000000000003073717717535341735133573617353531743177777577777776577777775777700374000077700077702476710043657777777777777777777777777777777777577672507701617742104371020060000100100000000000707352712737371736532535343172521343777777777777777777777777777740770000777000777012577600143777777777777777777777777777777771737761743700161614100630407050107050610020102500017716353753525361713533533172531717117777377777777777577777777774300000000700007770607775004256777777777777777777777777777737777770017171700000030601750300216100210061412517211473471735377173534352570347153170707677775767777777777777777657730000000000000017270537760021617777777777777777777777777777777771710024361614000001700250757576014070121612745763771372573433053713753177132352171311774377777577777777777577777430000000000000005027060000525677777377777777777777777777775771671600015300031200000010003002016030052410417320177774173437577070712352117153070352707777777177777577777777777777420000000000000205007030000435777777777777777777777777777737777161001020502404116100700700351701403001243524177777537073713137171751357216357171351377777757767577775277777777770105000000000000125614000161637377777777777777777777777775777712716000012100300600610601617206060340704100617777777253535256517343136131735121214325777357677776776777757757757616720000000500002070200000027477777777777777777777777777377717050705000400100101010071610404101100120120701777773771617037313725307717251123717335167777777775737771777737677777007700000027000014070000025017777777777777777777777777777737773010300001242520002000000030300607740165100777777777771617147707135301717367510714325377777737737757777677777777777475600000077000030770000024247777777777777777777777777757777340200030301010143414003416500010161034020773777777777771707331352717375215313671635101777717577777775777577577777703677000001770000047740000107377777777777777777777777777737534100100000020030201021343212177060002503177775777777535770731475251617031736161101016367777777657777277777777771777077340000077700000375200016074777777777777777777777777777777730000010001010001021000153534317173412147717777777777737771073031631617070517036373614177777777774775761777776775770054300000377600007777000250077777777777777777777777777775735701000001000001001003012153535637173577357777373777377777777071611613435272035014010337777717717777777777734777777770200000000777001007770001607077777777777777777777777777377773000100000010000000100017013531353572717737177775777771777717161631611201017037737775777777677777777537775773577777061000000000000020077700007007777777777777777777777777775773500000010010000010010001213343175727353773577757777377177777776173052163577777777777777777775347753777657777777776776100000000001070000024000700777777777777777777777777777773777000100000000010010001001715317031717757177173737375777777777712141253577373775737777277777777737675777776375777717716000000010020000030521430601477777777777777777777777777775373100000000010000000000121303535371713737177357575773735777777752173773777777737777775777777777577777577177776717777616000000200001210002402417423777777777777777777777777753777700000000100000000010000116152135073752577356737373775737777777777353777357377777573777777777776357276377777777777777017000010000024000052503402547777777777777777777777777777770100100100000000010001010311313437305317125373567175733477777777777771717735777777757777777777357777775777707757677706774000670001434005200342704377777577777777777777777777771734000000000000100000000035230533111735737737173537737577777777777777777737777777777777777777757707757777657777737577707770001775020777205274305216777737735377777777777777735777130000000000100000010000111531417251235017153537525737137777777777777777717777777777717777777777777771617777777577777052770027767403775600774704257577777777777777777777777773777000100001000000000000103030121301375137352370713737537577777777777777777777777777777777777777765727777777775367777770775216177703477761657770705237737777777777777777777777775301000010000000000000000013517171717013615357173757717343777777777777777777777777777777777773777537577777771777777777616563407777442577524377707027777771777777777777777777717373500000000000000100001001312303112317351361307153313717177777777777777777777777777777777777757777777777775777777717777012142147772106776106776524147777777777777777777777777774352101200000000000000000000111116116112351353533747717335377777777777777777777757777777717777777777777757777767777777756042142052142507706107770707071777777777777777777777777317016161100100000000000000016125213513515361353453313635707777777777777777777777777777777777777777777777777777777577777734304343252052052050617070607777777777777777777777777101521613016134301000000000001713531701212121116171335757171357777777777777777777777777777177777773577777777777775777777777400434344047025205261602434167777717637717777777777777702503507107010521210300000035371161735753534312134530317353777777777777777777777777777777675777777777777777777777777777770703434034307504361420410706177777777577771637777777777753503016107030505250103000071673535331361735717133517107103777777777777777777777777777777373757777777777777777777777777770600616034202704161430612506717677773777777577777777777777775210703503031216101717171163525677171723527507343712577777777777777777777777777773577777777757777777777777777777777401771616005614306025070416017777777777777777777777777777777777771410307041610777777777717171103525357353735371717777777777777777777737777753777757777777777777774777777777777776167760414777070615706003601677777777777777377777717777777777777777774101301777777777777777777771717015253437161777777777777777777775777777777577375773773777777777777777774777702570772430776061427741605261777735371777757777777777777777777777777777761777777777777777777777777777771717107127777777777777777771777777777777377737777777777777777777777777777742400412477775243477341615067777777537173777777777777777777777777777777777777777777777777777777777777777777717577777777777777777777717577777735677777577777777777777777777777777053761610077705243777600260135377703677777737777777777777777777777777777777777777777777777777777777777777777777753757777777777777777773777777773537777752577777777777777777777740276160607770425257740165016777577753177777577777777777777777777777777777777777777777777777777777777777777777777777777777777777777676777777777777757772777777777777777777777777705070501607721605277342032407703777777377773537777777777777777777777777777777777777777777777777777777777777777777777777777777777753535677277775773771753617777777777777777777777200020601400401240160104052777757777771437777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777773535757377777777075777777777777777777777774343430703430705216070612410777777777773777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777377777777707377777777777777777777777700040040240060420400000007067777000000000000000000000105000000000000D6AD05FE); +INSERT INTO categories VALUES ('5', 'Grains/Cereals', 'Breads, crackers, pasta, and cereal', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E5069637475726500010500000200000007000000504272757368000000000000000000A0290000424D98290000000000005600000028000000AC00000078000000010004000000000000000000880B0000880B00000800000008000000FFFFFF0000FFFF00FF00FF000000FF00FFFF000000FF0000FF00000000000000777777740043734074373737370737777043707777777777777743777777777000534040673577777500740000400050040042500000777770004217073737373773777730040407073377307373725000043374053000003737373777377604074377777347737377047637777777777777547777777777400750250573177777505350700050000000040004000577770404033773737373773370400040407071214377373736100372000073777777777777377704404427437307377777734341777757777757477077577777771040075000777577777040614340000000040000000003777700007773737737737377040040000007061637373773536173040004003737737373737520404040453774777737373777777767777777777705777777777770004770477737777770051004100000000000000000047777700737373773773737200004004040407173737377373737340004000777777777777736440406404247073737777777737777577777777745761777777777750017770777537777750065000000014000000001040005777733737373773373771604004004000063773773737373730000004040737373737737700406040604007777773737737777777757777777770742777757757777777757777577777601734000000213000000040004167777763737373773773021400004004005373737373737373400404000007777777773753652444040404737373777777777767567777777753475757777377774077777077713777771561410504351750000000000000017771000437373772007003040000400737373737373377240040000040473737373776345340042440573777777377377777577777777777767527077357777717737775775777777770140040037077100000000000040477770703373772253733704304000071637737373737603104000404000777777773617370744044043777373777777777777775777777777577757477737777717777777737177777740000005753176001000000000000077710007373351273773334304037361603737773773506000400000407373373653773773734040772365777373777777777777777757777756770577577777705776177777577777005000127357710040000000000400077705011340361433071214015730001061733770003717000040000377777765343763770704077344032737777777777777777777777777775752777377771377704777737777773001057517375000000000000000007777001340004373737370033723710360273773173733733434004037373640436777377070773734537477777777777777777777777765777525257777777175754007775717777740070030777700000000000000050477775377310000073773207373376004005336036007256352000033507765060470737737707377772407073777777777777777777775775767775417577777737600017737117777101400573777000000005000000000007734170771371052371337373337010033404017373337253434372040430440475617707777737352507775277777777777777757777775775637777777777771404077777357777003537157700000000000000004340007734351005021050077373777373773700004007177373003737370060440440427603737373777777773465657777777777777777777777565547777777757770000077717777775007167375000000000000000000100577515335701507130036373333373340040400436334307773735300440040060471777777777377373746175767777777777777777777777716377357774277040417773777777710731717700000000000500000040000750072571173053711001067777324000000400435430773373723440444044040463737377377377743475677777777777777777777775375657757777714074000617753537777715731775000000000000000000140006734150163413041405031100337004040400400423077377737373040040044041777777377777737443475657757777777775777777567477777777777737434005747777777777777777701000000000000000000000017737350141741030017521110100000000400400437337373737374044444040773737377737377761674367767777777777777775656757777777777777400405521077371777777777771000000000500400000041043775775214170171413710052177111040400440053737737373737340040004376377777737777752574577575757777777777777777771777777777777753540436040777577777777777100502500000000000000104167527101507006121477105010713040000040007377373737373716444074407354241737737372777772567767777777777775777757565775777777777770714054050777357177777777010050050000001000004707573517040350514140717010711771310040040737337373737376300004016777365347737777573737777565777777777777777777767777777777777777777707016177377373535777770500160004014040000015707777071357300717152503537700103610000337024253737373014074407737374074327771636777777777777777777777777775777577777777777777775353757757657777753777777710143505000000000000420077505357314141361050341510153533000707700500273737043233016773777734004776167717777777777777777777777777777577757777777777777777777777735704777735777777052050000056100000000504573417215614170516135170077352700373373042125377352373577737773737737773534407777777777777777777777777777777777757777777777777777717777407707777737777701050000400014000000050030753751701016153050434037135310137377352104037304250732373777777737737772404406572777777777777777777777775777777777777577777777777777777045177777537777701000500050400073040070577053653507317053171714177534316373373734317304000303737773773737773772444061652775777777777777777777777777777777777777677777777777777775067577377777771070050014000077141017500773141250714705257371304712411017377733637724000404343717777777777377040407440657777777777777777777777777777757777777775777777777771777770572777777777771052500400007104040470077714105073531505346525035353104313523773370004040000340273733737377174042443470747777777777777777777777777777777757777777777777777777777770571771777777770014300007314000010140534107014143560734110505107173117703161137004000004040301777777777776377440641474377777777777777777777777777777777777775707777777777777777777765777777777710014005054000000404007717053430501141416350167125776143535377100000404000040773737737371616525341464077777777777777777777777777777777777777776577773777777777777704077735777777771401420000000000000771752140410716100715371711507010000705734340040000400033377777777563773736442537777777777777777777777777777777777775757717477777577777777777507105777777777700040500004004005271456105313410415351040507170100571050143410024000400017377737371736173777753544777577777777777777777777777777777577677657743477773777777777777057604353553777040170500000000005473116535441710430701313507173100071016110037100400403736337777760416773737763777777257777777777777777777777777777775777756543577777777777777777075070402741470004070400007504071457717731061770415061701161775014014017340336030000370034271730406635377761777377347777777777777777777777777777777777757777756777777777777777777743040057121741405000005500007700370571414141051734140534135301731421410037713005377003001760440440576527377777777777777777777777777777777777777777757777561635777775777777777704354100177717353400050520070577144007061735305301531073417770141040143000000347733330040020406044042437757777777777777777777777777777777777777777777777777775777777737777777777507377770377757771004377750525305335711507535377042561717101710350140053053100003777610040340444004040407377777777777777777777777777777777777777775777777575775657777777777777771777777777577737774005770061775254177721703405171010141712500404250143750414000100037361353044044424404777737777777777757777777777777777777777777777777777777777377777777777777777757171737353577700376107577771034351570514176053416077141301001104141000001004000737373204004400440563777773777777777777777777777777777777777777777777775657757777777177777777740257777577677377357414773777777514043052412511241710535035101070004100711250031003737204044420444243777377777777777777777777777777777777777777777777757777767757777777577777777055614016141014014707617571777777717107113414341530417101430417171300001071351410173714000400472405773767777777777777777777777777777777777777777777777777757577777777773577777770061616140164400071417773531743777777577414341041410716101410000471711400050031007373210400444041773743527377777777777777777777777777777777777777777777777777747577777777777777147141450706100165065675353435357077777701617134301570510700005710040043115004140002405200072407773774256577777777777777777777577777777777777777777777777577775777677777777777770434343070414147707173537753777717177777775353410467313050100053050010000401000015013303504041773777375616177777777777777777777777777777777777777777777777775777757777777777777750541404050404165047171653717777777753537777771711107507170521414070140100007100030077372007773777377737777774257777777777777777775737777777777777777777777777757757777777777777070043434252177165377531353717777777777571777777777173516530570101050101710417104103307353073777377737777776174767777777777577775777577777777777777777777777777777775753771771777057041405057416717171775353357777777777777174765777170253501071404340561013710000073733200777377737777372416477777777777773771777777777777777777777777777777777757777777775067774707143077257771777077137714777777777777777735173477535140407400101000104050000005343250177377737777377454657575777777777577773777177577777777777777777777777777775777475707575735707354145735371717357717371777777771734777777753507777311403140540505010000010002143027377737773777773652477676577777737777575777777777577777777777777777777777777577725707725675747777377775377717353715377737775775735775777777717174001571003100005610007710402007737737773777356165257747577777777757357773535777777777777777777777777777777777757577757575377571311177777761757357731177577173777771777777777777717161035040530001710510000053733737773777376737777756777777777757777777357777777177777777777777777777777777777777777777737753361037717171177335371107777737775357777777173777777717537571001041140040004000377373773777377717773777775777777777777577375371777777777773777777777777777777777777777777775771375113117717177175735737717777577777717777777571756571607573431405040000110000172137373777377436727777777777777777777737357775357357771777757777777777777777777777777777573737771133513137777177375734117371737717371717777777777717505170541401210171043500036373637377377700453577777777777777777777757777334357777777571771777757377775377777577377777357535177152103577777717537537701777571775777735777777777707352052070535050404173037100003737377430464367737777777777777777775737715153717717773777777777775777777577377777573571713117310311313735371773753771177777377537353077777777777775757715000143100130103724000073737700440404407777777777777777777737717734357777753571771753535371717777777537753777370171301711311017771717171717537357177537757775352577777771776717771571077300510733100700303720464040604745777777777777777777757771735353573753171773777735377777537177753751775373015311210313117777377777713517777177537371735352567777777717750773700571412513772300007340040404404524277777777777777777775377573537777357375357177771717535773757777353777531117131731533010717775717117752713777777757577137153177077777777104144353000751273373533700000040640460475777777777777777777777537357717535771521737573535353773775353577771753371713073503151137771731753771371477735375373717712714717577577777310000411410303737373360000004404140474377777777777777777777177757717537773173171717171716171757731073775377357130371753710370177775777375377173175777371757713717717052537177777771110061041737373360404000040466340477767777777777777777777717777737153577177175777713531071717771171775317357171171717711310777737175375317171371757573717717537777050547535777777710171103737375300004000140475253777577777777777777777771777753537777357717735371713171173753537771335757317173303711310117777777377175737177777737757770531773777770107677777525752570373737020000000406340527777777777777777777777777175777371753535371353537573017017315373753177573731713511535370311377777535717733531257353577773137373047377377771505043504005017737200105004000075257777777777777777777777777777173575716357771775353753153717171731353737173757171713033531110301777777777735753571377777753757535350004377377777777140105300373610373320000400527737737777777777477777777777757177773515353571371713773717113035775357173577353537171531437111177777777177737713175353537757337535314000377341273777361005343243043343734000037777777777777777577765777777777735717773617777375373757753535301537135317537317131717131353173031777777777717753716377777753735753530704044204377777377777735004004337333000373737737777777777476757577677777771773757771573717317571737373130121717531713753531053530107317513107777717771775353535377757373571373531000003537373737737773400000437432700137343777777777777777756767775777777775757377573577757137377575173511535313531253713413103113115313711377777771717737717375777375753775173530404043737373773773640040400003352177373377777737777777777757576777777777777357773537777357175173735013301317130313535713177117103710353217777777777717535717377777773775377171700017373737373373730040000404040012337373377777777777777777767757777777777775735353507517317777171373515311717115153530353533503111035211177777777773777731717777577777537534371007327373737377342504004040000037373736373737777777777777777757777777777775773577371731371775317177111321703130312135351313571313503531317777777777757377177777777371713717371521720500737373730301600400004003737373737377777777277777777777777777777777773577357535171701735777177771511353510116171310112131103111353135777777777377177717777777777757735173173700300373732161733400004007773737373373777773747477777777777777777777777773717353735301717317777177373771313135317171731717171313071301735377777777577377777777757777371735341373004003725240372733704002120063737373730777244345657777777777777777777777575775757134353715777777777177171617101137371121130131015353137777757777777775777777777777177535121737214001730000127337340003737003003737730003747434727777777777777777777777777737537371711135773777777717537171711312577133513713171331330757357377777777777777777777777753103571733733732040040613730034373500404373732013344346454750747777777777777777777777537575353716135356177753773535313035111352513711711350171117377377377377777777777777717153737171333773737040000000343430733736300003372000272434707256776777777777777777775777777537377717317125310177771535371715137305313153713712135330707537175775737373777777777737357577357773373700000000040000737773737030370040000336454745614757777777777777777767777777757535735711535317717073537011313411137171211351353531175353757737377757777777777777775737317333377370000404000000733733373733770004004037307257165677777777777777777777574777775373537571373130171711353751371371373571315353125313713537777373757737775753753777777773775773777307000400000400537377377377370004000000000745677725777775777777777777777777777777573537377177517170535353131071511053534331353535710172571357753717577373773777577577675033373337030710000000021237337337337000000404004007165747777777777777777777777777757777777777535777173135133531353571123713353135530353137313573767353777773777753577537437737070073777003733250040021373737737377316000000004000377727377777777777777777777777777777777775353537757171733513175271317151351357133535317111777171717775353777577777737773535753007340030733437300003724000323737300401600000000037747777777777777777757577777777777777777177777717737175351343531152531337135373171313535373707771771737777773717371717177737377733000030373730073771000007373702533121000040613737377777777777777777676777777777777777777737717517757125371353171353515113435353535353313571771770775653537577775777377171657173573400437233070373270000037342503363707000031343077777777777777776757575777777777777777775757737717777135357353171312312513133537173171703471771771637777777753737175377173377173773500005030373373303407340002527373000121720000777777777777777675676767577777777777777777777571717717107135352171715353710513113177161771347167171753537537375757377137757176170773700030737373737373300000043713250727372004007777777777777777567757576777777777777777771753773771731713535317073537131131251347537177175737717777377757777572735717771737717735357340373737373737304000040000605233737215000277777777777777777756776577777777777777777777777771717471753537531153513516113161337567177637571707175717736173757563707173535217537717170737373737376000400004000303773737321211777707777777777777756577777777777777777777537175775313531317777773533752137153175773574175737371717377777577577353575352527535737537763737373737373300000004000007733773737373607777777767777777777777777777777777777777777777777777531775777535313571317113317177577377537575670716177777352537777165753517172516153535717337377034014000400005733773373737300007777734347777777777777777777777777777777777577171753175713773771757173531735777777375734347371171617617575777757016133134361615217277173752737303703000400002733377337733734000777775674756777777777777777777777777777777777777773775303753757171377177171777717175775775174777071717763777534357715756717535125017137343737021633737300404310242337733470000007734241434757777777777777777777775777777777777777753777153757317775353353777777777777735734371771617717577773577357020115213434171257417353535001733730700037700004337733032420075676564743647777777777777777777477777777777777757775717717125777735353777757775752535767577576171771773717777147707152527571007055213735373730061673700373730000033610403713100241450470745357777777777777565747777777777777777775373771753537177173777753777773777776117717717707077175775707370535211357000505321756171617050033030377373600005340002372372006564773464767777777777777777767775675777777777777777753573717537177777575775777777534157434717757717167737737757173531525353410125570716135317304043437737373735320000405373310150473775341777777777777777775747675477777777777777777773573737577777577025677777577777353534357375777175775771616516503134353434121534357434315300073733737333734000400020342063773477434777777677777777777777757477777777777777777567777757777777777707571775777757525257357075776177737177141753713040535251000572515235315235173737773737770000000040004017333775773777777477777777777777770743777777777777777777756577775777577777753675777577737753525707777717753757734004005340017253505035251637512521163033733373733120004000004033337777437477773773717775777777777777777775777777777777777777657777577777757775777777357753747734100775701657370400005341153415343005071071410710507115063777373560000000040000377733773737777777777777670747777777777777727777777777777777757777777777777775771435777757775357534175377751774340000007342161617141000570161710712527031003373712134000000001373323737477773777777777741674777777777777777757777747777777777777777777577777777777777577377177735716107577377775100000014105141707107000000101071351117140377250073733000000360307373737777777777777761765453437577777777777777765777777777777777777777757777775777777775756717563475777657717534000004770506170716500100014303125306736037000007372730000173000003373773777777377777560563647467777377777777777536577777777777777777777777757777575777777735763753535717347777400100001536514175010140505211141507510517340040437373730033270000037207777737777773636561441641773777777777736464756577777777777777777777777777777777777775771757777770755353537500404167536170177710100005250003103712500040000043700037731300003000077777773777747573464344377777777777736753574356747777777777777777575677777777777775377077777577775277747743452525353516156150741410001000304341250040004040000737732736331200000737743777737737377504437563477777774757746065670777777777777775657677757775254777777717717357757535705371757341757765251617275100040000100517165000004000004373773373733120000007773743737707777703737776173437777777737357561477777777777777777775757675777734757777737757776376777775777357350717175071757524050100100052050100404000004006377377373372000000043770377604737377747737374467777370737777725477777777777777777775677675777757770757174757753575357717725257657756756177161613531214015000050040003304004003717337373377000000000743777704061677343737777737173706577777774773773775377777777777777565777777775777277731343777774735771757705770735717056140561405001700041000005373030403720727737377300200000000377700404043714377777373777744656277373737777774767777777777777777777777777777575757574315777173577775075773577571653535257170500534001100400337340003171000013773720031000000077707440442404277737377777340614045077747737777773577775777777777777777777777777777777535777777577765777373477537775256525507414341710406500016737370737234040273370177273040000700406160040405377777377377704607064343777777773777774725677777777777777777777777577536525735771077561775753567525775375707143705376501010400030400373737300007340060335370014137440604454040737737377737434740544144777377773777736161475757777777777777777773777777753416567167707176576757357577777525716141735710040400040403777373737737704004075737203633606160100600437673777773563434042424637377737777777456576706777777777777777777475777777777771714141414753571775737252777571657177525705040004000737337373773340000000020201737373604437340443700047373772537737404417477777773773617252414750777777777777767477767677777777777777777770777774165475757773477377470521400004000433737737737374004040404070737373730100737003737070027742563737717707737070737777477777756740777777777777777757475757077777777777777777574757777737773774161037373073773160000537527737373770034000040000073737373737347700737734043770406177734707373742563773743737371614377072777777777375253434257777777777777770707070737737773777352407740407073237000343600000377361073434004040717373737373737077737373737370000404361773777777356177044377777777777777757777777777777747475777777777777777474565654657777777737373700000007373703173373000037302527373300400030233737373737700000000000000000000000105000000000000E5AD05FE); +INSERT INTO categories VALUES ('6', 'Meat/Poultry', 'Prepared meats', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E5069637475726500010500000200000007000000504272757368000000000000000000A0290000424D98290000000000005600000028000000AC00000078000000010004000000000000000000880B0000880B00000800000008000000FFFFFF0000FFFF00FF00FF000000FF00FFFF000000FF0000FF00000000000000733431247777777777777777777777777777777777777777777777777777777777777777777777772577777777777777777777777775677750043507777777717677777776343737737172736373635337373373727300002407477737777377377777777777777777777777777777777777777777777777777777777777777777777777777777777776767777677777775247757777776775761707373737237372737173717377373777363737733477777777777777777777777773777777777777777777777777777777777777777777777777377777777774777777377777777776777767677760104357777775673372737373737737373737373737337373337173732407777377777777777777777777777777777777777777777777777777777777777777777773777524000000000000004165777777777777777527750435677777773734737371737373173737373727372736334737337377777777777777737777773777777777777777777777777777777777777777777777777736140000000000000000000000000040507777777777777770041757777777733737273637376373736373737373713733737637777377777777777777777777777777777777777777777777777777777777777777777734000000000001404160746740040000000040657777777777775241677777377737373737373373727377373737353773737237377777777777777777777777777777777777777777777777777777777777777777735210000000044767773777577353777777652040000043777777777774161577777737725373735367373737317371737233373737737377777777777773777777777777377777377777777777777777777777777774371600000006177737534247043414747416171777737000004077777777770043777777773737373737337371737736372737776373733737777777777777777777377773777777777777777777777777777777777756370700000004577616506461407404740043406060407437760000005777777775241777777373737363737737373633737373733335273573737777777777777777777777777777737777777777777777777777777312777700000407773052507005040400000040040414052525041775340000537777775340777777773727373731737373773737373757337373637777777777777777737777777777777777777777777777777777753434777000000077757047040404004000400040004000404040406524177704000477777774177077777377353772773637373373737373237737373733777777777777777777757777777777777777777777777777437243772500000477725242404000400000000040000000000000400050412407772000057777777407477777737373337337363736537343737773373737377777737773777777777377777777777777777777777775373607346750000047750404140004000004000400000400004000000004040443400577700007777777001477777737277737737353733637373733377363734377777777777777777777777777777777777777777176372577747770000077725257040404004004000600606070745424040040000000400561617700004777777403777737737337337173737737373727771325373737737777777777377777777777777777777777763617253476347370000067745040400000000406574757577577577777577777704000000040040407770001777777754777777737537727372733737373733367373657477777777777777757777777777777777777535375361767356776000047710343400040042456535377777773752713637777757774000000004043430770004777777037777773773633737373773737337177735657727377777777777777777577777777777773537270365763565252710040775644040040042457373765725730577757757577577777777640004000040450776000777777414777777373773737373172527536725727373577777777777777773777777777777373436071675364743363770000077205340040006577707161775735476177343777373776773777740000004000434170400777777434777777373373737363733736717737776563477777777777777777777777770325253437767164733256577400047705404000004753520712577073527717707775252572537575775774000000040042573001777777057777777777373525737747773770771737373777777777777777777777352137563767743706733565777700007714742000407573672171657617161753770773537357357757777777776000004004050774000777777077777373716373737743737167077273434777777777777777777737716376562570752743712567776776000477600144000256171353435753707167370753073435257743727737777577400000004250376007777777007777773737477773776577737717773737777777777777777750730707077576772703725777747776700007705640000057177071253437617343572534771717077717353531653737777700000040040577005777777757777777773716577373727537772377733777777777377301273472777616312171774777567677770000770561040004347712165617561340177353473563435752717073431307171777400000004340370007777777077777777777673635365373673757773777777737163434767747374161631676765677667747776000077524004000534712161731347317037725347172153772710725343574716167177500000404004770007777777517777777773777777737737377337377377777727073777706347436373477777767675767776570007700534000004716774352164357075053534363717257713770125352131616107037600000000700770057777777657777777777577737377737377737375337164177474617716303434767675675675767577437000077564040400034353316171356371237773057170717717703073527074777777777757700000050601740077777777727775757477777737377377737737377727077607273630716777777577567767676747237760007702014000004770774317070757071407307277353653631717143577777777577777774000004041403700577777737575777777737577777377163763576374177670734307076657677676777676775370737461000570655600000061177130707165217121770775317075377143434377757317177775777770000000040477100777777777777777773753777737737771777735777601271616777777767477476767757363437073770007341600400004576174353160177707525371737613777316317177777357736134361677770000004161077007777777777777737170300777735673773737777670761677776776567777677776567347163477477000477041400000037716334343170537103525356535616357316167770537305070537171777770000000040077007777777777773507140500777773777777472731271777567475656776767727037352736752707630043707560400004547357435252077416343036373721775325217577072534373172534361757740000004340770047777777773052500100005777775617617357761677676777767777656350343761674775274731400074040000004056371753121735701735171715717177733535773713535215257053437173773700000404107700777777775705210434770007777773773777777777577476767777257316377341765770725321633041734304000000775772765343521763532070737677375343436570761253725217343107252577400000042407100777775210705070057750007777777777777777676767777652707306716407665361635325333700077054704000007525351734303525172553035253534737353577731743071717053167153173777500000141077005777775615250575257770007777777777777777477773435270724735673725326121633736173000734214000004756572737571613472573257125777273171257713430353521613707316361616176000040060530027777771614377725437741017777777777777767774347361437573467342530713373361337300067425400000401653715257303425357705302537717577617776161735252535241736534171737750000004106700577777777435477752577704777777777777777773337325277462567134312733727353373733400171443404000741745635217753524735737171637773713777717161435353431360512712073577700000004217300777777771603577743077700777777777777774346164775637572126127373633733273370733006721040000000747375735250717134731707031527565703757725363434361655372510717073077400004054075007777777775743477747077750777777777777337357736473402163713731733573537316333700017547040000051617436525377616571743717563577377775737170153537171325052070707147375000000001720077777777777051777705777005777777777776164625653343337373373273273233633737373004770605000004060471753752171770367125752317777537167771617637053436503735371737335700004007427100777777777777476577500777007777777777757735733252373731327337335337373523731734007701424000007147430743717071755707737357707777777771721613537073513752525252525777000000401437007777777777777053577614774047777777777625620707373361727336137337335333731723300037525004000007057717147677072705353434375735775775375717617073527703717173533521774000000400730077777777777777456777403770077777777775733737337353733731737327336336373723737300772434000000447675637717177153652757737073577777777737731743577170750707052503577000000402407500777777777777777251777147770177777777720703333613273363363733732533735233371730005705405000005357177170743416365351271577356377777771653565317217371273735271777704000000050532007777777777777775467776017740777777777737336173377317317331271373373333537323700067007244000004776574173577355734777172357375357775773763737635634375353435370777000000404002710477777777777777777147775077700777777773333337373337237337373363373072732717733700177141000004034717372532516375734352541257377773777777177535735735271617070777740000000025057000777777777777777776147774077704777777736177336374337336327337373273373373323173000716064040000473617577053617527757773375375307177777177737773734377173753777175000000000404330077777777777777777777077770577437777777337333713333631731733633137337317373737270043705500000004775776175301712557765357432525777777777737657257537707161677577770000004040033400777777777777777777774177770777077777777336363377373723733371372735732733631733320047406040000005723573077770353253177273573737177717777753735363753777771777303400000000050471007777777777777777777774077770777577777733713372336173732730373373323733613732737300017014204000025707170014774353043417753575777776777777777777577777777777774353000000040403700477777777777777777777775077743777777777363373173733371373737327373731733733733517000770605400000477716527021775707353771763736573535357777777777777757317777530740000040020070007777777777777777777777770577747777777373372336333536336132733533163363373363172270004350500004000571205710170120775735077170717253777771775777773707374775743070000000004507100477777777777777777777777770777773752536773177337363733737371633727337337343136175370005704244000000775207770052501030437177777777777567777777777757756177777352500000040400071007777777777777777777777777777777763777757336337137333713337333733737137123347436327570007705340040004375301772102161430525071717775363717777777777777777777352017400000002401700077777777777777777777777777734373577777777337723635363727127373731323612547323575716300053404044000004770707170014121043035377773537577777777577777777777775251700000000450070007777777777777777777777777370777577767727337133373337333733737300272561252361756363637400077007000000005771616570612525352527753777777777777177777777777771725364000004040007100677777777777777777777777534777776777353756723673353633773733030735073076777776777735773700437405604000004771610771701020353717677577777777577775777777777773537100004000404370007777777777777777777753736777777737257777773373372333730312163434261677353535737775777773400437005040040000771630777775753757617537475777757145735777777777777774000000400017000777777777777777777773775777777161757777767773353373733437256143737163534372737573777777777000570524140000045775771614361674217343563777777534735777777777777714000004040407710077777777777777716353653677753437776777767777372334330343704307234256352737353773757377377777000770416004000007777577777577535747773757377516043577757777577753400004000005370007777777777777777777777777772777777777777777773373336161720736714737357737537373777277777777777000572407404040007777775777777773731777374777753557577777777757741040000650427100077777777777777777777777473757777767776777767734334072525734716300077371737737353773735777777777400353416050000407777777775777777473475377753502537577777577777361040400407710047777777771657777777777777777777777777777775337336137252721630616737717673633437361773773777777777040770407060400057777777777757777753777575752757757777537717775004161400771004777735256161352535777777777767776777777353637474072725256163073733752773317173737737177377777777777000777054142400077777777777775717777777777175535777536575757534704142573100776150505001050041430375777777777777777257677777737253525236177173477771353737317131737377777777777777400177206414240047777777777777777757405147537777716553577777405256053700007150000000040041001414125377777777737177777777777725207337177372373773777353014307471657075373777777777424057516414340000577777777777777000065217575777616757177707074017770006500000000000010000100210525275777777777777572534333525737373337337377371301201637737373737725477577777777500077701654045042525743452540500400534577777775751777750474057770005010000000000100001050215050105177777777777763773737707333707377273773737525034373731737777771513707757777777740007774006524004000000000000000007507357577771777754707017370000100000000010000010100001000030712107577777777537377373737373736335370343533125373501434143113170755757657777777774004377500416504040434000000000043565737777742570525405775000040000000000000100000010140121411053503177777373773237373707373737336172777043731003471077756740010217717777777777777004137770416165240404040400400043575757775756164007773000141000000000000100010110010100501421052507177777773775737373737371725616252127530047741647077657777435005775757777777777400407773404054165210207040404247177777534004537771000460000000000000000000000001000010121143017107137737777373727373730636163735717753057777064704775357477706135777777777777777740000577771600404444540525041404757752407573752000447140000000010000000000101010011410416105710713577773737373737371671437170763653007004374014707764652574404431577777777777777777400001777773500000004040600000001757777740000477740000000100010012011000001001000121103530171053117777773737330631637436370343743704074774060565735656571606470757777777777777777774000041777777776716350747777777725000004477777400000000101010510010350101041034143501537171070737737773737671477073616177770340416007706560077440617764040435377777777777777777777440000004161753757775352507000000407777777700000010110121013013525201705103501210712507071171773773772731637212525777777075000610477040056775775776504746475777777777777777777777777404000000000000000000000404777777777770400101001201010701210111171013041035070351717127147777377173777077777777777770524041470775076005761474756765777677777777777777777777777777777765616442406146567477777777777777410010101010101010105112530172053171417155071717503177377737373212577777777777735004200420764054065767470757776577771777777777777777777777777777777777777577773577777777777777734010000101010000000000010035153101731713071352513543777737737377777777777777774360404041457704204074543474765677656577777777777777777777777777777777777473043547777777777777777410001010000000000000000001403016171071653161717752177737773637377777777777777735040004160077004702524246056565765656777777777777777777777777777777565173516170034173777777777771000100000000000000000000000105010001711317170735017737773737373777777777777777470040400070774000404004147677775777775777777777777777777777777777777777052710734537575777777777771014100000000000010001010000001061520343435353537017773777373777777777777777777354002404040770400474256157577777757347577777777777777777777777777777777150705010527771775777777775210100000010100001000001010001000140151435357153073773773723777777777777777777004040016016040040005057677757675775734717777777777777777777777775374347070034273417347777777777777530000000000010100010100201601014134303534307705374373173577777777777777777752400040640404004140524775775775777535553575777777777777777777777707535712016531750774737377577777777740001000101020014010011101125030411753411711077737567777777777777777777777712404040160404424240534175376175357563743525777777777757777777777000473417013400301717574577777777777775000300001010010014004004101413061071701077377777777777777777777777777777752400040525024141700434165757075347577577577777777777774777777770071403016701250077073737707575777777777700170500410010010101030521615171307777177757737773737777777777777777777300040000406502524141435716175717537573743757777777777777577777025420350011077006516174771777777777777777750010011041043016161052141034377777777767727777377777777777777777777777174246740440750050343570717521617757575757777775757577777777777503505000000734717217717577717777777777777777161000100105010105214377777577773777773777777563777777777777777777777014777777700050304101034161755705277777757777777777716377777777740300000401413714770737057735777777777777777777770716125252525777777777775777773777717373777777777777777777777777125777777570340102407537161617775417577777777777777757077777777104034000720407217714717365771757777777777777777777777737777777777717637737737757357777777777777777777777777763536535074752050014251716757173565777743757577777777777777535777756010010037053505771771657717677377777777777777737377377777777772536777777777757377777770777777777777777673717176777034347205007061125071307545773777775737777777777777777773777703400007041272125367165341773575777777777777737777777777773773777777377777377377777370777777777777775253747776776777735075703414104025347753731757357776577777775777777777757777410000171005714734177177743577767737777777777777777777777777777777377537367777677347777777777777673677657776773717074777714710034375373312301610307707577575777377777777777773773474040061730037716170773776177177577777777777777777777777737773775737777777673577777777777777777577577777253475677777767771067377337107351171310110713577777775777777777777757752100000173407750777077357717777737757777777777777777777777773777377777771735777777777777353673676772763617767767776776573425736530712730303601013031165375777777777777777777777605200716152570177716534777775177577777777777777777777377377577177777773777777777777777737777577777773757657777777776777571773533377731713101173011103125375777777777735777777777005721712073706136173525347767707737777777777777777777777773777777772577777777777375737777776777437477777677767677777776077373563167723010767753031101134377777777777777777777777701703417161177417761777177177077577577777777777737773773777777253777777777777775377775677777777777777677767777767717617725363353713111771110101410310135357777777757777777775770340147350167701673577707737777757737757777777737777775777677377777777777777277377777477177437776777767777777371716761771737135361774765213031713371431016777777757777777777777774034217236530777143761772577177377577777777777777777777735377777777777772737167767167337677777777767777767757677777343737037635330135771011101215073537353777777777777777777377377041605753053770757177752577757707777777777777777777737777777777777377375777777577737477776777777777707777677767675775277717325136127773012115301102114353777777777777777777777777353731257770177307771777073777777777777777777777377777777777777376377777677673725777777777777437777777777753717327537177735373517157741311210125311613077771777377777777537777735671477730077716571277717757777537777777777777777777777777773717357747777171765777677777777777776777770737363737577373637103016330371770121313530567101777567575777777773777377777167301677716377347571773437777757777777777777777777777377257677777773737777777777767777477777777773373437372733735253127353710534371353101017713533125777777677777777777777777777716771771617771737077577707777777777777777777777777774377777777677365777677777657377777777777353743733737173727773353530343773135161253531277030103527777777777777771777777777777717670777741677525723757771777777777777777777757353777777777717347776777777437371777777737257273737773737373577716303771717170121311727031731135312577777777777771777777777777777771771717377177773577377577777777777777777773727777775763527777777777777373707677777773477737373737336373737377331734770307353177163513177503031253777777777777177777777777777777777072777716177177057777777777777777777757377777777277177777777777732537347777727737777373737737637773727373343523131371307773477353703437313431477777777777125777777777777777777777570707777167777376177777777777777737377577777477377777777677637773657777735773477377777737373737373737367373561343071703477375301713101713167777777770125777777777777777777777777773752537171777177777777777775737777576777773757776777777735737577777347637777377737373567353737371737337373316131371173773537730353330350717776101577777777777777777777777773737775377776772577777777777753777747776777352777677777773437737677737776371777377773777773737373537373537735335731352536313572163531234117077771717777777777677777777777777777777777777716173757777777777773777777777737737777777767777377752777377761735777777733753737373736372736372733363730525373535273173173435137253677777777777753777777777777777767357777777767777577777777777753777767777767735677777777735377172757757725377777777773773773737373737373737373763731731125737331343152173727101057357777777753777737777777774377377737777737177777777777775637777777777737177777777777737736167777777361777777777773753773773727373737373737373373727352112521637336377353116167777777773637777777777377773777757777767527777777777777773737777777775370777767777671771707777777572343777777777775373777373253735373537353713735373736377250575350531710705617377377376177577777377776573577773777767737777777777777772777777776777377777777777777376377777773772357777777777777737773777377373727363727327363736373737337333016177161071737777776356177773737377775373776777776777717777777777777373771777777775377767776777775277717677773752177777777777777253637373377377373737373737737373737373737317373737074377777737252177377737777756717377777777774734377777777777777275271777747743767777777777776375347773770743777777777777716357375777377737377373737373733737373737073034725616527377434361617377733737773737373777777777373737777777777777773707377767767373777777777777712717277736577373777777777777713737737737377373777373737373737373737373737377773773773737773737373737773777737377777777777777777777777777777777773777777777777737777777777777373777777777773737777777777777373777777777777737000000000000000000000105000000000000A2AD05FE); +INSERT INTO categories VALUES ('7', 'Produce', 'Dried fruit and bean curd', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E5069637475726500010500000200000007000000504272757368000000000000000000A0290000424D98290000000000005600000028000000AC00000078000000010004000000000000000000880B0000880B00000800000008000000FFFFFF0000FFFF00FF00FF000000FF00FFFF000000FF0000FF0000000000000033273373337373373373172177765677143477212657777776567776777777747077777777777777777777757777754757777777777777777777377777777777777777777777377777777777777777102136770007770000373373373233373373372173613777767773617717725777776777777677777777771777777777777757777777707746757777777777777777777777777777777777777777777777737777777777777752412576706033277337317373737237337373303763470777675672730737677777677767777777777777777777777777775777740447575677777777777777777777777377777777777777777777777777777777777777771252637616373333733733373333733737337373137377565777574777271756777767776777777777777777777777757777706070047565477777777777777777777777777777777777777777777777777777777777777777701043777337733732737317373373233737337375236377276777617677374347777777676777777777777777577777777405771065772577777777777777777777777737777777777777777777777777777777777777777777300333733732733737237373173733737363373535275752777775367377774777777777777777777777577777777404177774065746577777777777777777777777777777737777737777777777777777777777377777777770733773773373373733273373773733373373733123375656767574737377767777777777777777777775777406546746750074756577777777777777777777777777777777777777777777777777777777777777777777773732333337337333737337333233377377373737734373777776777477737357777777777777577577777560654257757750475656577777777777777777777777777777777777777777777777777377777777777777777773777373732733773337333773737337333372733737343707777777616577737777777777777777777760475604047770640465756567777777777777777777777777777777377777777777777777777737777777777777333337333733733373737633373737337376373773737373770776777777777777777777777777777770045253404047475240434756152767777777777777777777777777777777377777777777777777777777737777777373337273373372373333737337237327337373373737377377717777777777777777577757757774040404645256561764571656747671374767777777777777777777777777777777777777777777377777777777777737333737337137337237373733733737373733737373737737737777777777777777777757777771404250041435614044406774475475277635177777777777777777777777777777777777777777777777737777777377337273337337237337337337273773737337373737373733737737737777777777777777777777642404040040404044000447770477465635267252477777777777777777777777777777777777737777777777777777773737373737337337317337337333733737373736373737773737737777777777777777577777741450404241000000007440777770475747475257353701777777777777777777777777777777777777777777777777777773333373337337337336337337733773373373737373733377373773777777777777577777704067000014104000000740067775740474747765624721676577777777777777777777777777777777777737777777377777373737363733733633737373733373337367373737377377737777377737777775777777770474757645650000000444005776563704657452777752567312047777777777777777777777777777777777773777777777773373337373273733373337333727372737337373737737737737377777777777777777774052474775347050100557000477757447750076544347772524677300677777777777777777777777777777377777777777777737367737373333737377337373737373737373737733737737777377377777777777777006440424675747446577604077774607446774476564342477717077731257777777777777777777777777777777777777777777337333337373733733337237337373373737373733773773737377777777577577777404704250450476400247400407777405440045704056547707047677404673025677777777777777777777777777777777777377777737377737373273363737373733737373737337377377377777737377777777777400474040405246750045404040757040640045426504674763736342567773447312107677777777777777777777777777777777777733333333737373373373337337373373373736737737377373737777777777777740045404040464144244343440577644044040060456714074454775256347477256256313077777777777777777777777777777777777377725213737377377373737273727372737337733737377377773777575777770004061604040564044047440777740040000444040444654565275677365267347356346243066377777777777777777777777777777773333737721235337333373733333737373737733773737737737377377777774004240474104340404004750775674074004140000040407706565477767537124765674716527135677777777777777777777777777777725217470773733733777333777773737373733377377373773777777577774004414043414004770040047777465047504070400004074757744656565777652532126167653652463150767777777777777777777777777737773773470723730337773333373737373777737377773777377777773400004647751000004740000467774164074000500000007404777714742567677777656116347747677167273705777777777777777777777777470163573777561735323577773737373773373777373773777737777740434004041601000016400005777704157700414000000040477777604756565677777776617307247167734203630357777777777777777777773777743675273776727173333737373773777373737777377377777740000470004351140004440007760746576770400000000004077777775504654747676767477765325727756565743070727777777777777777777163572777437577717777637753637737373737777777377777777770004047416405040000400005774054056507440040000044424777657652447565257674767646777430347656376347632531677777777777777777743353437777252773537656371737777777773737377773777777000000507471401100000400776140424075600770040004000577575750657006565647765777776777777737274074771643673134777777777777772777737125277777476777377777737377373777777773777777777000404404743400004000477547465140005405640044000477764774250756506565677767776747677777701277160677743466330147777777777353473777737132537777177777777777737777377773777777777777000000040040004400057706704100000561404040000457760536047740640456474767764765677676767761216770043777114636334176777777737777373777777771777777777777777777777773777777777777771000040004050400047777444410400004044000000057671457654565340477047474356777767647677474777610036764647673652437213677773773337773777773777777777777777777752544644647777777777771000044004770004774340007410000400404250747775440675000044000477447437271667777765777676777773531212716471673707243177777377777773777777377777777776756040400000000000657677777776000004000400177454740001000001400404777777737400770000040404770567473475375677767777656777767470712616674747657343063337733773737377777737777775250000000000100500400040147777771000040000577407604044140000070000077777414440475010000000077774047747276167347767675675646767677251213434717274767377777777377777737777777765000040500725656572571414004004537770000044716565604500401000000404005777750640057105000000447775704776775616735636567767676777747677767343732667477356733776177777777777777775000400070775777777577677777525000405770000004774041406470700000070004064777740040247105000040777770400775677671663570747777676777747477774761617136346657777377373777777777775000002577775774757776575656757777741600570000004704040414040500000440005074477140044041100000077774400043737765675743632342771656766767665676767616137353676177777777777777771400007777656565777773577765475647577774140470000004042407404400000040004774405676564004100000007754000007377771777767765656353077674777767567777677776530343377377777777777777040007774747775777757056175357640757675777701040000004040447340050004004474040065750400471000004750400007777777777070756565361607603436747776677574767777677337777777777777777740000747774145770775311110535375744654567775765000000005040047740400404034074161440675040044040757440000577777777777776372765677761743613716777676776576767464777777777777777770000777744776452577525343010105071741650575777777450000040400440404000004465406560045640040000777400000067665677677777756753774360767253652716056776776756777776777777777777777000177543474453457757115115014100165665676565657777000000040040040000474047500040045000474004757400000054745064040604656777674377574707675247273734677777677777677777777777777100457756744045657775315773701211400157575757575777777500000044000007577404710400005240043777574340000747664646476474464042407777406373465436734342437147677656665677777777777774003776054656161657775771775351521014377777777777565777740000004405047473404400000044160447616504000044747475675656476566546404467770437327657474773432737167657767777777777777000577056404047577757735775571353510015777777777777775777710000000777407446100000000074400775404000056767656674664676474566474424064776035307276676567476163437277777777777777740017747475675774757777773430014116171077777777777777776757740000044750605014100000007040475040400047747474656477475656666747467464046475727307135256353617253617477777777777771004770747477577177777775351117113105105777775357757377575777700000004740560400000004754707504000005674767677777767767677574746746546400066435332523725665765670723030777777777700077775777177177177777775071010141107127777777717777777777757740000007704071000000414604740400004677777777776767777777767676774746656464047663733703071725661671747677777777774007774775777176175357777711075531305105577757175717577777777777700000045704461405040405714400000777776776776777776776777777776767656656474040561733373030721765467253677777777700177577777177535377777771035312150110127775737370753517775657577740000074400040060407740400000777777777777777777777777677676777777765665646044642737373372163127345765777777770047757771717717777577777701515715310300577777754153534775777777777000000470004004047754040000777777767777777777757777777777777767676776566564600470733337333312525272567777777500077675777735717573577771103031710514100775771731356571717775775777000000040040405777400000077777777777767676466656747477677777777777676566564640463737337173733321252777777777007775777535707773577177761511430713012102777775534317775635734775775400000470400777540000077777777777656404405416414707407460656777677776566565604460737033363737373303777577700077577753771717577356177530161151715351057535773515777711577475777770150000405777400000077777777776400441753777111373511701454206467776776506746400452337373333233337337777775004777777775075777375711573117111214311110777777150377717077775777577704770000044540000077777777764004167377777710535751305157335501044677776640656540663733337335373533777707770077757571735717575777771056111715315707017717157357753471757477167777700770000000000007777777764000535357737773131173315121717533757100406777746066400473372536333233633775077500777777775701772535777777157141215217500007777357777413575357477577577505770000000007777777774014171717375777771121753121525733513317711404776756164640407333337337333737770770007775777531771517573577777731315131530011075777777773777307777757757776007770000005777777760407773131617737737131113351151173153051713771004277674674404633737333733733377507700577777717057053756357777777141717077501000177577771715715757575677777750577770000777777764053577115171353777753010377101217351313131353177300467764067404373733163352337770077000775775771317161715777757757170717537011100177777775735777777777575777700777773477777777412537177312135357377331111311315353311511050117357710007777446044333277373337337700770047775777575017571777715353757175753501070100577775775725771777577777577705777747777777440513537371117131335377112117311130357131311317153737737004767065044373333373337377007700077477757353573577775121514377173750351010017777777777577475777777757775077777777777740713712575730311435137313111035301115331011011503717113535006776442407373737273733770077004777777775357757777531510135757775357507103777777777777353527577577777704777767777764171371535337111131303531713013131134337113135303171701711777000767640433372333332377700770007717575777777777773010034131777777773101157777777777757504153777775777705777577777517371113537737312531713433111015131111517111111153531131537377500774640673371737173377007710077777777777777777751711010415377757575177765743577777773534747777777775167777777744357371703111171711311111053131037121303131313012173111103577373700677440173373333373770077400777577775737777777131001011205777777777770171715347777741417175777757760577777774173735121153737331310121101316113753111151111011717310301773317577104767046373373637337710771004777777177575377750100100501577777777777417501534157775350747777777777157777777413535737113131101171113112111111353735103134353131311111173115353777106764413336333732777407770007757575377777777171010013101057777777701777701010015735250153757757774077777734171733713141053171035317313134135371773110113713535312103171301353777107762437337173733771077740017777775075357777171001075317137777577577775340311025775340757777777754777775431311753711313111131131357717131031737777131713773771111173111301353777006740437333333737770777300077577177177777711101005315014577777753777530111400537534110777775777417777743535371371731111210113101373311111173573731713743157131107111311535253777007643337373633377747775000777775715257777170101173503173777777377710153701300753515257775777711777770311317137373110301131315377315313035317353121071317337101311301113131757775076073732373373777377771000771537771177777170053510150157777775747105341141101773705357765777647777541735213530353311110110131117331111013737313513135311577717311312134173777770065233737373377775777770000777575756177777710153100050357357761710717101370065757165777777775177776171313533171353313131311073717121313103533512153535313777771211115135777777775265233333373377777777700004756377375757771753010010315375775110531717161517737357737775777507777705353531353131311317711171113731311111353713111213130777777771130537733535373700703507173373777777777700005304735171777147710105001435047137351741410117777575737575177752577770537313131211312135771103105371153112131331301137173535313131131013531151317577146742333216337777777777700004004577017743105310111011161077505301101014357777777577767777741777543717135171131311037771111301173313111101711112113173313110131117773171314317177106374247313277777777777500004000537417101005710001071540473525357100017761775777577577775177777013737133133111311717373011131153113131317313117373111111311010177113110715377537014377342061777777777777000004000753504110771011353561317751050012177757175777577657777507777701713533113110311173737111131013110771101777101735313130110131137713510351351737770673434356167777777777777000040004775311657170777410110477777535757775777107777755777764177777071713435311131013353537301011311053713377353537531110113013113571713135135277577700343473616377777777577777000005000617571777577751757751177777777777777057753576777775517777741313531316133171353133531311010101373735317337773111313153117077731105137135173777506363061617777777737277777400061000425655377777701777765777777777777757053577557775700777777525713153131531131352513531311010153735737317135371301113353317777735317175735777777417163563607777777777536773000057000441657577771777777104777777775774777770747777560577777770533171317133113113113170171031311253533135313135771135271315351753531737331737777770277352341677737757777771775000007500044753771417775750407777575777577553575777716153777777437117125313110312101353113017125135373717131351177313131101121131377373511153575777717737735373777733777777777737000000771004465753507770142407777371753573747177777450777777777477313111313531111171303111311130117371335311301257011131131111101577711312110313777003733333377757773437377777777140000577300042571153750054465775771770541177777040177777777750771713131713131301131153011311110335371313711311317131131011213533771301111311141777433777727333773373716777767777300000057535014304351005243543477474071777777404177777777777707113153101313101133413111301031017173134311311131313512131371353571311110130170113501373733737773477373737177775777740000007777535011000464444644450517577775040435777777777770771353317130113135311311301131101737317331130103535353335317135373331112533511113577127327373333373337273737253736777735000000477777735315141615353777777770404001777737777777770171315213135311135311211310101317317311113131317737335317135131775112113513737713174007134377377377737373737370735735773700000004057777737777777777777744040005777777777777777561335313517131313131311311131101775717371311111777717135313131577737113533511535777771216337257337233737373737333723527377770000000004056575757474440400000017377777777777777777057113153335353501773531031113177573313131310177731131131716173777713513101313073777007634605327737377373737373773773372537177700000000000000000000000000567777777777777777777770731705315113131357773113105311577371311210137773113103111177777531311311131115357770773561362533737337373737373373377373736371773521000000000000041074777777777737537777777777704711131336317111373535351331130375775311131737353713113121157777131131131112101777506167374356377337373733737373373373737373727777777770707134373777777777777777777773772577777707731141111113017777331011170117131177375777531313713113113017737171161135111101776072525276377337737373773732737373373737373733077777777737671777767777777777777777777777737775077713135313111357735171371131433531357777713105111135311301057713131113533530177717352527525237373373737337373637377737373737377307777777777776537373777777777777777777777773770477713111310131373713011013113353101771337711131213733131111377353537377751111771477777352161737337372733737333736333373373737337737077756777777777775375777777776777777777777730777353301531171171311317311317313111035110353111110177531301577737353531377777770777777777373373737373773737733737772773737377733737343773477377675777737777767777777777777777714757353131171121171711111301735353313131311353131131037371107777373313110177777477777777777737373737373372733733733373373737333773737370347374777776777773477777777677777777777433735317133131113131031311173573311111131111317131101353131377735311300115777750777777777777737373733737737373773377377337373773337737377333433073777777777737377777777776777677057131713511101017131110173373331731307113010731711311173537777131130111217775277777777777773737337373733733732337337337737373377733737337373737352352777777777777777767777777777037531310313110217131313177171731111137311111531311121177757733131537311777765777777777777773737337333773773773737377337337373337737377337373737377373437777777737777777777777775013535311110111371711177373371373107173531037171311110171317531031777711777077777777777777337336337773333373373737337736337376333737337373373373337373734356777777753777777677760713131131010351131373717171331113533713101177317131131311113113177531777707777777777777777337313723337777337373637733737737333773737727337337377737373773735775777777343777767710771717113135303513535313173533313177131137577717173531521301315737777771777777777777777736336363163712337737373733773733737373273733733637736333737373373737273677777773737777740773717353731713103131353113535371317713512577717173531111101337777777747777777777777777313777176163737337337373773373733737373737733773337337737373773737737353736777777771767760753507353531113107171117103531371317773713577313537135311105777777770777777777777777776363737777752527316737373373373763337373733773377337733737373373733373737171777767767173100753535373531711131313311113171131135353151253111107131131137777776577777777777777777777177476377377756733173737377373336737337377337333733377373727737277737373736161757777777400711535313121107135351130107313121777315305351030117353113577777717777777777777777777737737134347777373567133737337373733733737337737273377337373733737333737273737373637777677700773535353131317131253131117371111375311311371110017317101777774777777777777777777777476777773725277777376753437137373733772737733737373372737373737377737273737377373752735637740771311353111317131311101017331307737715341351310017131137777077777777777777777777737137373737737167737735273327237373733373733773737363373737373735333737337373337373373433477300777131313053535351353111735310117771701315331101617135777547777777777777777777777777770737373777373477777756537430373737373773377373737373737373733773373737377737377337373307500477711111301313131311333531311777173171537110101777777540357367777777777777777777373737677577777377347727737473774343537373377337373737373637373373357373737333737337733373733730077773535353711171310573711113777353112157110077777734376347377777777777777777770733437033237377373737527773767377727032353337737373737373737367373373737337733737333777373737370006773131111353011131713713011777353513773110177770457436343436177777777777777737677777747537377777773716161777773777757273733733737337373737337363373637323733737733317373737371214375313531311317565351311177177311357775377700063767757777716252773777777773437716577372761716373777737373436747737725252173373737737373737737373733373737363732373637327332737000435713111131537773121013777753535777777550475353617676777271634343434777777777737074771772737373737377773713707477777777072373533737373733737373737337733733377373337337373733730000757777577577575113577777777777776740247677761707375675674777616732617716577777370777777747743477373777773737343773777756172733737373773737373737333733773337373737337333737373700050577777777777577777777777777010747777677767765271671676347774770727737777777773434743737373725361737337773777074736377252521637373373737373737373733373733733733737373373373371240441675777777777777735614045676777676767776777763434354776076576577777777777777737377777777777373777773777737737777777777773733737373737373737373737373373373373337337337337337333161434565747475656561616377777677777767777677777677637257777677777700000000000000000000010500000000000092AD05FE); +INSERT INTO categories VALUES ('8', 'Seafood', 'Seaweed and fish', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E5069637475726500010500000200000007000000504272757368000000000000000000A0290000424D98290000000000005600000028000000AC00000078000000010004000000000000000000880B0000880B00000800000008000000FFFFFF0000FFFF00FF00FF000000FF00FFFF000000FF0000FF0000000000000021312121001212103012101120511213001003031000000000001001201000031434130127125003036131617112161707121633525212434101612140103000000001000010000001000000000000010000000000000000100102120005212143012525002070011030101770000000000001001200070431030521125306171134303436170643125351431717043523421052136001002010020100200001020100010000000000000100000021310316114104031050307010303401035203003073000000000001002101000031071430161771407072535353717341752534363761634352153525252411700000002100000100000100000000000000010010003000100114211021201343030103430100312121010301710000000001020010001007007021316161302717353434371734367377371717173525257616137171360000100104002100007000000000000000010000200000100316211203104250103016101125061614121201437600000000000103003004101313534313177500717373535773534717535377777174071301216516165170070600030100000000100000000000000000001000000014211251007100212107012306121001303410301371000000000000001001006124252134343137437775373737777707737775375377370477777532735327124010100000001000002001001000000000000000001000211230303112041352101214130106121071211037500000000100010020102043513353437177703753737753537773477777377737537563010103471634716412520210121020001001000000000000100000000000001251014304204120016125013016001413001243772000000000012001012054303614353717371747377777377777347777777777777756357777777177171610252141060000000000000000000000000000000010210130303030311006171212130305210121341301317710000000000000120010025351734353777770777777777777777577777777750602004000000016124371675252161010410002010000000000000000001000000000014316100253000125050030301204120300341377000000000300100121034070361373753777377777777777777767672525004241447420704046004100400435353070212000400000300100000100000000002100003030310351204352121217050341420150350337770000000100010210103007171375357377777477777777777752705464464604766640446464644606460704024347125001000010030000000000000001000010003016100021021001214130103030120013021037577000000012010010121610657375737377777777777777774040644466567600406400040006000000476746424400212534120430000000000000000000000000003000310313521705241212016310161003503143533770000014010030216101341735737777777777777774740404647460406040042040004620040000000440240467504040025000000000001000000000000000030000000021001001200214316110701030402143031777700000212010010107161347737737777777777727000606676764000000047047640000444644640002040000466464040020041200012000000000000000000001010013523121311041310112530303042112035373770000001010201034312170773777777777777600444664404040070416000000750000000000000000046400560000046744004200001001000000000000100000002000001000525060120430612011610015217135377700000520001121011071737777777777774040476767400000206400640425675200000000000000064000046440000046767400101000000000000000000001201010043121312121124131031215201216025125371770000024012120161637353477777777770464676440000700004740400777777700000000000000000007747600674640000446740002000000000000000000001002000000520012121006030011211201007021317377700003070010121311717353777777524476777600067046404006730331777716101031000000000000047777704040000000044664014121000000001001000000100421312113041706011413705205312101350717373000104030120534371717347777444676460420000464006421171531537133131313133130100000000077700000006740000067400002000000000000000000030041000012241130001321300121130404034333717100000603016113137173775775647767400047400470000703417133113313713131135313133100000000160000000000000650467460010000400000000000010000020013041302112430520712161033007135353637000131430314343537371737674766765000420476000065713337113301311317337333737313110010000100000000000000640046540000002000100000020010001010241101306110431110353125013002537351710000161410331353535377747664004067607400404777521111113101353313337737373337333301011300110100000000000000006620100000000001000100200020001302305112003161212102533404353353737000137061371535373777764677000702444660000077760103131212133337311773737377717310313130130213011000000000000476400060100000000010010040010001300121216142125350713001025335371700003703173173737777767777640046740000470527777012112101317352710033773331773001331371011011101301113000000006774000000010000000201200121020305116125000351210330107124137173527000713547357377777777746464000006460000677777730113111203131311300013777373172101073131030121301313011200000004674004000000000001000000000100121301031250215214136103106117173531001733717377777777676400000075000000057777776101313311133737337310003777377317271373130113101310312111100000004460000002001000003004210000016121031304071211213012507017373617000371753777777777767670006746460000773737377300131373733773001717000003377733721037310131213131213013031300000006740000010000001200010003030301007061002121025341703300737171700017537277777777777767400074006777377170737735013137773373100000330000017177773103373013101303031311301110000060474000300000000301000200100001031131121417017110303114343537373016333771777777777664000066470171331333331737720013177773770000000730000002003773737330003121131313331303310000006764000000001000000041002010007060021520013012730707210073777771017533777777777675000000002533131737173737337100113377773773310100110000010001043735300101133133735371101210040047764000100000030001200100210131135132106107251013101777777777073713777177777747760066000173307371313331337373000311377773777770017200000001000331031000031313737731000131012774066400012000001000020120030000021012010612310123716173716577717171777717777777776006500077317133333373733737710013133777777777310031000000000131303130001313373750000000101304600474000000000000007010101001035131215300114313501210370712530777373737777777666440764617337333017371313730333700013113370737777301170100000013131373010001337377300000000310000000460100001001200000020021020012021210706030612353017710712531377777777777777400064001737131373213337331371733000013013510437377773332101007770131343000001777371710170000030040476520012000200041210010000101215141210013011215213710131253075777373717777760000000073733737371217133521333770000100313000347777307310207777100600010000131777373737310013104607764000000001000100061201200021213030300705321521435207701347777777777777766704760007333533733335313313337173300010010312000103773731031177310211111700000127773777777001210070067600010010000420210101000100141203150430120512121370070077131677377777774776007461033733733717333335317133337000000013113000053717731003375311303373700003113777377737101004670447400200000000101020000300303030142130433130717037001701700771177737777766000006043173733733737371303033525373000000013113131313331031177731311153777710003031000077733714000400642000000000012041012100000003152112103050031211770070070077007377777776400474404333733731733331331313132133331000000013131130311213037773131333377777771311021001373773000000076410100000005001020000210100142111250241307125377103107701700377737777740000060031753353373735337130303013353530000000011313311131131377313537377777101107003112121777300600027640000010000020303012100020002112341304170314313770077073037007737777766700067427533373377333337137131313352333531000000131311333123537373313137377777373713103011100070067600474600200000010100400000010100011250301202170307317300701700700137777777777400040442153773337371333131303052317121212100000001311131133137773313777373737737717133313100040047000674101000000202121030120020000341330701407035317770073070077007737377776400200000053333373737337173130313313312131030231201301213523173377111217377773737737733111210000645644046600200001004110102040010100400301010300313521737205701701701773777777460047400601317177373313713313371361371213002113173130331303353337733333137373337373723734331001000066427641001001200210602010121000020330703431140703171771031063077003757777767400246407643737337353733371711131331335213112030217313071301337777310103123777737337370330101001000400465603000000001201050020000200410010303072121717373702560500700173737777767004006046013537333313531333330731731213030317131212353303737337717313131113230717735350733100101000000764000300000001021210101210401213431103100431217177053017037007173777774676470000700533737373733373171731333131303530303031313210313333713731210130311010313133333130100310000064003010000000702500002000000034003070710613353737301300700700173777777767406464046653353735331317137333132712521313211313035311337373731217371000000000000000000103010005600054404300205210210010012000100243413103111210417353535007012071037373737777640006700004217313333737333537317313131303011730301231230133133131213773000100000000000000000420064046676030535301001021212010142041012200710217302412173730300710300435377777765600056400744737371713137313317335313031713231313331331337137131311337777003500000000000000007406400076434777777777773500016030100006015011211210143371217007013007053173737777767000600064072531333373713737337333733121311030310331217133313131337710001003000000000000560040670004677777737337373777353001002000413421217307034215071710700700700317353777774764000052006653535353373373333733531353312133135337131333313131353770000130101000000000466460000600247773733373737337336165102500601200121210117104333173001030042143717377777767000006650040033333371337373533733733313713103033112173131313121333000177773301100000016400077404444777373373333333333337326100010301430007032121214127171070030140313035377377764000000600005735373371737373733731717331373131123312133131313133771137777777721300024600004660067673737373373737373373333107202410421070117110710433512103035000007161737377777400000046460463533135333733733533733331731333733131313073121131373377777777733131110400004640004767777373373333333337337312301401203007012121071243341253070100702317173537777747600250000000771353733373373373373737173121731353533131310076037177777773421713131201240007000067777773737337373737333312330020160500707010713031041371343134310505303173537737766704640400066121273735337373317137333313131373333353031771771002777773770001313101000000046146777777373337333333333327206676160120121021071217070250361343130700305352173717777576000006700041111353337333735337317373735303353131331377777770017777070110313131311101000476777777737377337373733367764747476764106161403031013004335170307071021734317353773776640047606000131271237337373131733737313131313337121035777737701677700016131313131000300006777777773737333733333376767656476747416010030317073701631433031713125052131635373777774000064000003011313533737333731373137337333537313131777733777740100000013131313000310000677777777773737373737276767767767676765601243400013010301433143431617006316171735377357776604000067053073133353337353737373737313533313313137777771777700000000001313111310160647777777777777737333337770746776777777760341212103701711600523131613037105317034377177377756700000006000161053371733333337331337313133353130013733137770600000000000012301316777777777777777777777777575652105274777677740250400010301271073516161343500612527173537357477764600076400007117373333717373537377337335353130017373707310040000000000000311130676777777777777777777775252000040705010677764705203000711635004301235317171253171717353717737373560000640404771331371713335333335333533533313121231131313000470000000060004003447777777777777777777772524040406170707061057776124100041271037125371521612534247373717377737477777744000007600135371333737331737333733313113131001137171057200674056000400067746777777777777777777777440442400004070707165207474030000035005030425231713713716171753777777777777777747640040007131311713537333317331717333717121021121200064004604600000005666777777777777777777775652560404004124143507175707074000430037133516135353071253714373777777777777777777746700000717135331313137171735373331513331101000040006500670067404204467777777777777777777777765646046527424470743707070706021402005030150243534373535734637777777777777777777777746000024373313513173537333333135133371012121000675004646560042777466777777777777777777777764564654746440407065254525257750000010133512335061350353731735777777777777777777777777774404400071313313113313171717133171707000464064460067006000047667777777777777777777777774776565646142400041525273535253774020000150215307073371717777777777777777777777777777777776767600000113537353353313131171060000007604700000040047444677777777777777777777777777777777777746440604061615067617057734161202335721607171737373777777777767677776767676677767774465600007117353371313313132006504640000006000000007766767777777777777777777777777777777777777774740402525637141747257700014115303171617177177777777777647777767677774747766776777464047776025335313171317750076467000000000666040666477777777777777777777777777777777777777777777404041653450772535777701202721617125373737377777777677777777777767676767777677677777464674001731313137004600000046004000007777647777777777773777777777777777777777766676567777777774065257274357707770205013171735205371777777777777777767465445465446506447677676777774646476775210476400004762000676744664677777777777737373733737377777777777720456446474676777777075257174717157750020017121735373737377777477777746476766767466746652704667677677777747647465467674206476740447464767777777777777777737373773737777777777720456444747665474777746165705253676777701012735273707777777777777777476777775777676774765644470047767767777774776766746465447464764765777717777777777777373773737337377777777774046646676765646464777707560725771517770207001735353567373777777777476777777664765656465644767474000767767777774777777777767672574567773777777777777777777373373737737377777777004654656767665646444677563570573472777750106173703733537777777777767777747654765647656065644646476444247677777777777777777177576727137777737777777777777773773773730707777777740076647676767664746404477562537473557777030300353571743773777777767777774764264424244406424740656446765647767777777777777167707717536537773777777777777737377274340577777777774006656767676764746442460656156743143777752505213733373353777777777777746466404402465427650424074240474765007767777777777016750770773753567777777777777777777414121437777777777000765676776767674644644040771635356777772010321471747374777777777777764670404720744067406470004656560464767407767777777756777360777753763577777777777777777616034103077777777740056767776676746465464464640775774357777417070521373317377377777777767464400004446700467400656706606474240767647777777777007757177777761742577777777777777765010121410777777777024667766777676776666464440460734357777770203030527374737177777777774760000464420044474646744642474577065064777427677777770757767774752577173737777777777776121216030301777777747567776776766766674400000000047577777774010141430117373777777777777464404600002466067067476464747466646566540677647777777652775775737377617756777377777773010104101050167777771676776767676677675000000000000077777772000252020343737173717777777746400474606444044040046440046046147416740670477527777770077737737057017727737777777777750306030252120177777647656777777777767664000000000000777777410010000140143777173737777776564020640407600000000006056424066706465724470677477777752477747573077077177017773777776100101011010520777771657677777742460000000000000000007775610000010100212073717735777777746406440060440474241200046460404744470724477465676477777007077773777107716776777777777710342125203021013777567767775402050004014000000000000061430020100202001000173733777777776400044246404604665424000004656476467656452742564777777774747777771710637777517737377773020105010141101257760776776020605224707421604200000000042014100214010000057735753777777747400240040604707466456000004656647647677656740770774777737777777737731777136743777737341052120302124210777756777040414524570617461670700040000010020310010010000233773771777776046074740044424464467601000004656465640477600700646777777477777777777703776537771717776121010150510110703770777740016724724256425641474700007001250100612030030041753773777777754604464600606406470440464000000647467042763476525756777770777777773373377733743173733753403430212030201057547760017605434165070520742434760400000030701014007000303771373777377660472000614040646464706072000000046746174147616476677777777777777777777777775737353175200300101001410102736370056760562506506076474257425700470010000125210300070473775375777775474444044644004044046440640000000037777776747477077477777777777777777773777372517377737500010217030216105756561614163416470616052435607424760670030107100210061031373737377777764600064000607400060076745676100000337777777777477477777777777737777337777777773617137737214210001010012121770047607407430434075250461643560704740042007000430061605375371777377740046706064464006746406046004200004777777765406747767777777777777777773721377353737753744001070120010000167043650743470463434424427074346165647301010301012040301337377177777777460044446446060474404006774761000710677777767677767757777777777777777775014777737527377700000012503021014352525270343434341643430745616434706574000250002010071434371737357377774470604650654042464240046464047100671077777747567476777777777777777777733133573573577773700000000104102034607470564742434060743465261653461656771210303010061021037177173657377376465624644644644004600424065246301277077777676565777777777777777777777737773173773771777560000002112150135616526160743434343461605652470743477701000000010071034037353717377777746564406760674240647407000464777040577777777476167777777777777777777777377777657375377737140000000000212461616507074340656146165770470475256775242101012061025031173673477737377706400676404604404060244052677765330777777776774776777777777777777777737777771335737736770606100000301005356461647006165216705256043063424077721014200004016112143717173437777777446004440604006000444424645667777731777777774076577777777777777777777733777776521617716165752561614161764253461605745275641674252565147077777521210121007212052373477357735377737164002404656444646460464644567777731377777774676777777777777777777777777777737537703353063773777777777756470343420204025250614052066340477743050240103001413050173435253537737777470404740640065646444040606476777713737777677477777777777777777777777377773712501705252573771617617435607444652547525000605256056140077777161211303040703043037357525277773777777646466440006646000600464650477777347776774747777777777777777777777777777773070372525247075271771342570442700056200605670524203616047777706134124050030301303435253347137171737375744000024454040040400044666077777777746776777777777777777777777777717777773070503121437735370377070374240642005470725052535654007777770135216113200414160521525257077173777757367764560406600740766400004506460677777676747777777777777777777777777377777771032506161435370357071470314040404200404024242400025747776120417136141212030130523347307077353737375737576600040464644442464076406574477777654777737777777777777777777777777777325052317063536177217302171634000404002104000500776567774116153212512300417012012157071707134735735727573744406400042000047402440656647777777727777771734777777777777777777777737012341420707253521771657061010400004040612570674657656161601205071614043121705214307030613531731733563773777747604740000046440604644746777777457371777735777777777777777777777015250123505371361171210303112521000000040442467477525252121125303003300352501211211707616563434735734143353775347564600240400604004246746777776377771735737777777777777777777777210270503607071725275346160703071300100000640507472420105025001617141000212161205230611003113531612527375371737736165644740664074644756357737616717373530777777777777777777771705251030340713521735324215130141024070210420170703010052021103161212300615214305301616534707343071371617136173617056577734765416567173635371771653734717371747777777777777771021030343435025252170530501632070212140305021017021050041201104216113434071120121030431003001310317070140617535353737037353435373777073717135275347377137343527077777777777777761525350343025435316172573061053071250210121003021103030210142131030603100016170143413034703424250313136341230370317124437253734353771473716735337047357135307134217537777774777302120352171302525312533070163010010304250121001421701000710300070113143043012170303430001300711214242510061535035617102517352535271243170711635720735234363537004730737737137750714170353070434316173525306107071241000121412121121030400030171034207104216121034130143424070125031311206112303703124253734353073525216171277170142537537153616173071777343046321033034307170713735252534010303000134252102001016107002103143003031530201012507103052000714036130070525053614341716105252531617343704352125217356072530703617100717173773352010507143530703024343431712125630503030000212110307212100012502125341403014303611212143043070124112532132120003310321213407171613071717061353535343314173531713037060703273070316030302100713571435353431617001430341071050500610010510300410341301231343000501201252103004036434350152516142505251525070243061707034370070343070347025252160707502431705347171404341716170343242703421743524343070303024212121210712030012030305251425316070341705214340724110121030301210003121212103005317130713537007135307135310437135313531241352130312120030121213071735071353170312100301010101001210101030301000001010121303130000121030121030030434300000000000000000000010500000000000094AD05FE); + +-- ---------------------------- +-- Table structure for `customers` +-- ---------------------------- +DROP TABLE IF EXISTS `customers`; +CREATE TABLE `customers` ( + `CustomerID` varchar(5) NOT NULL, + `CompanyName` varchar(40) NOT NULL, + `ContactName` varchar(30) DEFAULT NULL, + `ContactTitle` varchar(30) DEFAULT NULL, + `Address` varchar(60) DEFAULT NULL, + `City` varchar(15) DEFAULT NULL, + `Region` varchar(15) DEFAULT NULL, + `PostalCode` varchar(10) DEFAULT NULL, + `Country` varchar(15) DEFAULT NULL, + `Phone` varchar(24) DEFAULT NULL, + `Fax` varchar(24) DEFAULT NULL, + `Image` longblob, + `ImageThumbnail` longblob, + PRIMARY KEY (`CustomerID`), + KEY `City` (`City`), + KEY `CompanyName` (`CompanyName`), + KEY `PostalCode` (`PostalCode`), + KEY `Region` (`Region`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of customers +-- ---------------------------- +INSERT INTO customers VALUES ('ALFKI', 'Alfreds Futterkiste', 'Maria Anders', 'Sales Representative', 'Obere Str. 57', 'Berlin', null, '12209', 'Germany', '030-0074321', '030-0076545', null, null); +INSERT INTO customers VALUES ('ANATR', 'Ana Trujillo Emparedados y helados', 'Ana Trujillo', 'Owner', 'Avda. de la Constitución 2222', 'México D.F.', null, '05021', 'Mexico', '(5) 555-4729', '(5) 555-3745', null, null); +INSERT INTO customers VALUES ('ANTON', 'Antonio Moreno Taquería', 'Antonio Moreno', 'Owner', 'Mataderos 2312', 'México D.F.', null, '05023', 'Mexico', '(5) 555-3932', null, null, null); +INSERT INTO customers VALUES ('AROUT', 'Around the Horn', 'Thomas Hardy', 'Sales Representative', '120 Hanover Sq.', 'London', null, 'WA1 1DP', 'UK', '(171) 555-7788', '(171) 555-6750', null, null); +INSERT INTO customers VALUES ('BERGS', 'Berglunds snabbköp', 'Christina Berglund', 'Order Administrator', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden', '0921-12 34 65', '0921-12 34 67', null, null); +INSERT INTO customers VALUES ('BLAUS', 'Blauer See Delikatessen', 'Hanna Moos', 'Sales Representative', 'Forsterstr. 57', 'Mannheim', null, '68306', 'Germany', '0621-08460', '0621-08924', null, null); +INSERT INTO customers VALUES ('BLONP', 'Blondel père et fils', 'Frédérique Citeaux', 'Marketing Manager', '24, place Kléber', 'Strasbourg', null, '67000', 'France', '88.60.15.31', '88.60.15.32', null, null); +INSERT INTO customers VALUES ('BOLID', 'Bólido Comidas preparadas', 'Martín Sommer', 'Owner', 'C/ Araquil, 67', 'Madrid', null, '28023', 'Spain', '(91) 555 22 82', '(91) 555 91 99', null, null); +INSERT INTO customers VALUES ('BONAP', 'Bon app\'', 'Laurence Lebihan', 'Owner', '12, rue des Bouchers', 'Marseille', null, '13008', 'France', '91.24.45.40', '91.24.45.41', null, null); +INSERT INTO customers VALUES ('BOTTM', 'Bottom-Dollar Markets', 'Elizabeth Lincoln', 'Accounting Manager', '23 Tsawassen Blvd.', 'Tsawassen', 'BC', 'T2F 8M4', 'Canada', '(604) 555-4729', '(604) 555-3745', null, null); +INSERT INTO customers VALUES ('BSBEV', 'B\'s Beverages', 'Victoria Ashworth', 'Sales Representative', 'Fauntleroy Circus', 'London', null, 'EC2 5NT', 'UK', '(171) 555-1212', null, null, null); +INSERT INTO customers VALUES ('CACTU', 'Cactus Comidas para llevar', 'Patricio Simpson', 'Sales Agent', 'Cerrito 333', 'Buenos Aires', null, '1010', 'Argentina', '(1) 135-5555', '(1) 135-4892', null, null); +INSERT INTO customers VALUES ('CENTC', 'Centro comercial Moctezuma', 'Francisco Chang', 'Marketing Manager', 'Sierras de Granada 9993', 'México D.F.', null, '05022', 'Mexico', '(5) 555-3392', '(5) 555-7293', null, null); +INSERT INTO customers VALUES ('CHOPS', 'Chop-suey Chinese', 'Yang Wang', 'Owner', 'Hauptstr. 29', 'Bern', null, '3012', 'Switzerland', '0452-076545', null, null, null); +INSERT INTO customers VALUES ('COMMI', 'Comércio Mineiro', 'Pedro Afonso', 'Sales Associate', 'Av. dos Lusíadas, 23', 'São Paulo', 'SP', '05432-043', 'Brazil', '(11) 555-7647', null, null, null); +INSERT INTO customers VALUES ('CONSH', 'Consolidated Holdings', 'Elizabeth Brown', 'Sales Representative', 'Berkeley Gardens\r\n12 Brewery ', 'London', null, 'WX1 6LT', 'UK', '(171) 555-2282', '(171) 555-9199', null, null); +INSERT INTO customers VALUES ('DRACD', 'Drachenblut Delikatessen', 'Sven Ottlieb', 'Order Administrator', 'Walserweg 21', 'Aachen', null, '52066', 'Germany', '0241-039123', '0241-059428', null, null); +INSERT INTO customers VALUES ('DUMON', 'Du monde entier', 'Janine Labrune', 'Owner', '67, rue des Cinquante Otages', 'Nantes', null, '44000', 'France', '40.67.88.88', '40.67.89.89', null, null); +INSERT INTO customers VALUES ('EASTC', 'Eastern Connection', 'Ann Devon', 'Sales Agent', '35 King George', 'London', null, 'WX3 6FW', 'UK', '(171) 555-0297', '(171) 555-3373', null, null); +INSERT INTO customers VALUES ('ERNSH', 'Ernst Handel', 'Roland Mendel', 'Sales Manager', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria', '7675-3425', '7675-3426', null, null); +INSERT INTO customers VALUES ('FAMIA', 'Familia Arquibaldo', 'Aria Cruz', 'Marketing Assistant', 'Rua Orós, 92', 'São Paulo', 'SP', '05442-030', 'Brazil', '(11) 555-9857', null, null, null); +INSERT INTO customers VALUES ('FISSA', 'FISSA Fabrica Inter. Salchichas S.A.', 'Diego Roel', 'Accounting Manager', 'C/ Moralzarzal, 86', 'Madrid', null, '28034', 'Spain', '(91) 555 94 44', '(91) 555 55 93', null, null); +INSERT INTO customers VALUES ('FOLIG', 'Folies gourmandes', 'Martine Rancé', 'Assistant Sales Agent', '184, chaussée de Tournai', 'Lille', null, '59000', 'France', '20.16.10.16', '20.16.10.17', null, null); +INSERT INTO customers VALUES ('FOLKO', 'Folk och fä HB', 'Maria Larsson', 'Owner', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden', '0695-34 67 21', null, null, null); +INSERT INTO customers VALUES ('FRANK', 'Frankenversand', 'Peter Franken', 'Marketing Manager', 'Berliner Platz 43', 'München', null, '80805', 'Germany', '089-0877310', '089-0877451', null, null); +INSERT INTO customers VALUES ('FRANR', 'France restauration', 'Carine Schmitt', 'Marketing Manager', '54, rue Royale', 'Nantes', null, '44000', 'France', '40.32.21.21', '40.32.21.20', null, null); +INSERT INTO customers VALUES ('FRANS', 'Franchi S.p.A.', 'Paolo Accorti', 'Sales Representative', 'Via Monte Bianco 34', 'Torino', null, '10100', 'Italy', '011-4988260', '011-4988261', null, null); +INSERT INTO customers VALUES ('FURIB', 'Furia Bacalhau e Frutos do Mar', 'Lino Rodriguez ', 'Sales Manager', 'Jardim das rosas n. 32', 'Lisboa', null, '1675', 'Portugal', '(1) 354-2534', '(1) 354-2535', null, null); +INSERT INTO customers VALUES ('GALED', 'Galería del gastrónomo', 'Eduardo Saavedra', 'Marketing Manager', 'Rambla de Cataluña, 23', 'Barcelona', null, '08022', 'Spain', '(93) 203 4560', '(93) 203 4561', null, null); +INSERT INTO customers VALUES ('GODOS', 'Godos Cocina Típica', 'José Pedro Freyre', 'Sales Manager', 'C/ Romero, 33', 'Sevilla', null, '41101', 'Spain', '(95) 555 82 82', null, null, null); +INSERT INTO customers VALUES ('GOURL', 'Gourmet Lanchonetes', 'André Fonseca', 'Sales Associate', 'Av. Brasil, 442', 'Campinas', 'SP', '04876-786', 'Brazil', '(11) 555-9482', null, null, null); +INSERT INTO customers VALUES ('GREAL', 'Great Lakes Food Market', 'Howard Snyder', 'Marketing Manager', '2732 Baker Blvd.', 'Eugene', 'OR', '97403', 'USA', '(503) 555-7555', null, null, null); +INSERT INTO customers VALUES ('GROSR', 'GROSELLA-Restaurante', 'Manuel Pereira', 'Owner', '5ª Ave. Los Palos Grandes', 'Caracas', 'DF', '1081', 'Venezuela', '(2) 283-2951', '(2) 283-3397', null, null); +INSERT INTO customers VALUES ('HANAR', 'Hanari Carnes', 'Mario Pontes', 'Accounting Manager', 'Rua do Paço, 67', 'Rio de Janeiro', 'RJ', '05454-876', 'Brazil', '(21) 555-0091', '(21) 555-8765', null, null); +INSERT INTO customers VALUES ('HILAA', 'HILARIÓN-Abastos', 'Carlos Hernández', 'Sales Representative', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela', '(5) 555-1340', '(5) 555-1948', null, null); +INSERT INTO customers VALUES ('HUNGC', 'Hungry Coyote Import Store', 'Yoshi Latimer', 'Sales Representative', 'City Center Plaza\r\n516 Main St.', 'Elgin', 'OR', '97827', 'USA', '(503) 555-6874', '(503) 555-2376', null, null); +INSERT INTO customers VALUES ('HUNGO', 'Hungry Owl All-Night Grocers', 'Patricia McKenna', 'Sales Associate', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland', '2967 542', '2967 3333', null, null); +INSERT INTO customers VALUES ('ISLAT', 'Island Trading', 'Helen Bennett', 'Marketing Manager', 'Garden House\r\nCrowther Way', 'Cowes', 'Isle of Wight', 'PO31 7PJ', 'UK', '(198) 555-8888', null, null, null); +INSERT INTO customers VALUES ('KOENE', 'Königlich Essen', 'Philip Cramer', 'Sales Associate', 'Maubelstr. 90', 'Brandenburg', null, '14776', 'Germany', '0555-09876', null, null, null); +INSERT INTO customers VALUES ('LACOR', 'La corne d\'abondance', 'Daniel Tonini', 'Sales Representative', '67, avenue de l\'Europe', 'Versailles', null, '78000', 'France', '30.59.84.10', '30.59.85.11', null, null); +INSERT INTO customers VALUES ('LAMAI', 'La maison d\'Asie', 'Annette Roulet', 'Sales Manager', '1 rue Alsace-Lorraine', 'Toulouse', null, '31000', 'France', '61.77.61.10', '61.77.61.11', null, null); +INSERT INTO customers VALUES ('LAUGB', 'Laughing Bacchus Wine Cellars', 'Yoshi Tannamuri', 'Marketing Assistant', '1900 Oak St.', 'Vancouver', 'BC', 'V3F 2K1', 'Canada', '(604) 555-3392', '(604) 555-7293', null, null); +INSERT INTO customers VALUES ('LAZYK', 'Lazy K Kountry Store', 'John Steel', 'Marketing Manager', '12 Orchestra Terrace', 'Walla Walla', 'WA', '99362', 'USA', '(509) 555-7969', '(509) 555-6221', null, null); +INSERT INTO customers VALUES ('LEHMS', 'Lehmanns Marktstand', 'Renate Messner', 'Sales Representative', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany', '069-0245984', '069-0245874', null, null); +INSERT INTO customers VALUES ('LETSS', 'Let\'s Stop N Shop', 'Jaime Yorres', 'Owner', '87 Polk St.\r\nSuite 5', 'San Francisco', 'CA', '94117', 'USA', '(415) 555-5938', null, null, null); +INSERT INTO customers VALUES ('LILAS', 'LILA-Supermercado', 'Carlos González', 'Accounting Manager', 'Carrera 52 con Ave. Bolívar #65-98 Llano Largo', 'Barquisimeto', 'Lara', '3508', 'Venezuela', '(9) 331-6954', '(9) 331-7256', null, null); +INSERT INTO customers VALUES ('LINOD', 'LINO-Delicateses', 'Felipe Izquierdo', 'Owner', 'Ave. 5 de Mayo Porlamar', 'I. de Margarita', 'Nueva Esparta', '4980', 'Venezuela', '(8) 34-56-12', '(8) 34-93-93', null, null); +INSERT INTO customers VALUES ('LONEP', 'Lonesome Pine Restaurant', 'Fran Wilson', 'Sales Manager', '89 Chiaroscuro Rd.', 'Portland', 'OR', '97219', 'USA', '(503) 555-9573', '(503) 555-9646', null, null); +INSERT INTO customers VALUES ('MAGAA', 'Magazzini Alimentari Riuniti', 'Giovanni Rovelli', 'Marketing Manager', 'Via Ludovico il Moro 22', 'Bergamo', null, '24100', 'Italy', '035-640230', '035-640231', null, null); +INSERT INTO customers VALUES ('MAISD', 'Maison Dewey', 'Catherine Dewey', 'Sales Agent', 'Rue Joseph-Bens 532', 'Bruxelles', null, 'B-1180', 'Belgium', '(02) 201 24 67', '(02) 201 24 68', null, null); +INSERT INTO customers VALUES ('MEREP', 'Mère Paillarde', 'Jean Fresnière', 'Marketing Assistant', '43 rue St. Laurent', 'Montréal', 'Québec', 'H1J 1C3', 'Canada', '(514) 555-8054', '(514) 555-8055', null, null); +INSERT INTO customers VALUES ('MORGK', 'Morgenstern Gesundkost', 'Alexander Feuer', 'Marketing Assistant', 'Heerstr. 22', 'Leipzig', null, '04179', 'Germany', '0342-023176', null, null, null); +INSERT INTO customers VALUES ('NORTS', 'North/South', 'Simon Crowther', 'Sales Associate', 'South House\r\n300 Queensbridge', 'London', null, 'SW7 1RZ', 'UK', '(171) 555-7733', '(171) 555-2530', null, null); +INSERT INTO customers VALUES ('OCEAN', 'Océano Atlántico Ltda.', 'Yvonne Moncada', 'Sales Agent', 'Ing. Gustavo Moncada 8585\r\nPiso 20-A', 'Buenos Aires', null, '1010', 'Argentina', '(1) 135-5333', '(1) 135-5535', null, null); +INSERT INTO customers VALUES ('OLDWO', 'Old World Delicatessen', 'Rene Phillips', 'Sales Representative', '2743 Bering St.', 'Anchorage', 'AK', '99508', 'USA', '(907) 555-7584', '(907) 555-2880', null, null); +INSERT INTO customers VALUES ('OTTIK', 'Ottilies Käseladen', 'Henriette Pfalzheim', 'Owner', 'Mehrheimerstr. 369', 'Köln', null, '50739', 'Germany', '0221-0644327', '0221-0765721', null, null); +INSERT INTO customers VALUES ('PARIS', 'Paris spécialités', 'Marie Bertrand', 'Owner', '265, boulevard Charonne', 'Paris', null, '75012', 'France', '(1) 42.34.22.66', '(1) 42.34.22.77', null, null); +INSERT INTO customers VALUES ('PERIC', 'Pericles Comidas clásicas', 'Guillermo Fernández', 'Sales Representative', 'Calle Dr. Jorge Cash 321', 'México D.F.', null, '05033', 'Mexico', '(5) 552-3745', '(5) 545-3745', null, null); +INSERT INTO customers VALUES ('PICCO', 'Piccolo und mehr', 'Georg Pipps', 'Sales Manager', 'Geislweg 14', 'Salzburg', null, '5020', 'Austria', '6562-9722', '6562-9723', null, null); +INSERT INTO customers VALUES ('PRINI', 'Princesa Isabel Vinhos', 'Isabel de Castro', 'Sales Representative', 'Estrada da saúde n. 58', 'Lisboa', null, '1756', 'Portugal', '(1) 356-5634', null, null, null); +INSERT INTO customers VALUES ('QUEDE', 'Que Delícia', 'Bernardo Batista', 'Accounting Manager', 'Rua da Panificadora, 12', 'Rio de Janeiro', 'RJ', '02389-673', 'Brazil', '(21) 555-4252', '(21) 555-4545', null, null); +INSERT INTO customers VALUES ('QUEEN', 'Queen Cozinha', 'Lúcia Carvalho', 'Marketing Assistant', 'Alameda dos Canàrios, 891', 'São Paulo', 'SP', '05487-020', 'Brazil', '(11) 555-1189', null, null, null); +INSERT INTO customers VALUES ('QUICK', 'QUICK-Stop', 'Horst Kloss', 'Accounting Manager', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany', '0372-035188', null, null, null); +INSERT INTO customers VALUES ('RANCH', 'Rancho grande', 'Sergio Gutiérrez', 'Sales Representative', 'Av. del Libertador 900', 'Buenos Aires', null, '1010', 'Argentina', '(1) 123-5555', '(1) 123-5556', null, null); +INSERT INTO customers VALUES ('RATTC', 'Rattlesnake Canyon Grocery', 'Paula Wilson', 'Assistant Sales Representative', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA', '(505) 555-5939', '(505) 555-3620', null, null); +INSERT INTO customers VALUES ('REGGC', 'Reggiani Caseifici', 'Maurizio Moroni', 'Sales Associate', 'Strada Provinciale 124', 'Reggio Emilia', null, '42100', 'Italy', '0522-556721', '0522-556722', null, null); +INSERT INTO customers VALUES ('RICAR', 'Ricardo Adocicados', 'Janete Limeira', 'Assistant Sales Agent', 'Av. Copacabana, 267', 'Rio de Janeiro', 'RJ', '02389-890', 'Brazil', '(21) 555-3412', null, null, null); +INSERT INTO customers VALUES ('RICSU', 'Richter Supermarkt', 'Michael Holz', 'Sales Manager', 'Grenzacherweg 237', 'Genève', null, '1203', 'Switzerland', '0897-034214', null, null, null); +INSERT INTO customers VALUES ('ROMEY', 'Romero y tomillo', 'Alejandra Camino', 'Accounting Manager', 'Gran Vía, 1', 'Madrid', null, '28001', 'Spain', '(91) 745 6200', '(91) 745 6210', null, null); +INSERT INTO customers VALUES ('SANTG', 'Santé Gourmet', 'Jonas Bergulfsen', 'Owner', 'Erling Skakkes gate 78', 'Stavern', null, '4110', 'Norway', '07-98 92 35', '07-98 92 47', null, null); +INSERT INTO customers VALUES ('SAVEA', 'Save-a-lot Markets', 'Jose Pavarotti', 'Sales Representative', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA', '(208) 555-8097', null, null, null); +INSERT INTO customers VALUES ('SEVES', 'Seven Seas Imports', 'Hari Kumar', 'Sales Manager', '90 Wadhurst Rd.', 'London', null, 'OX15 4NB', 'UK', '(171) 555-1717', '(171) 555-5646', null, null); +INSERT INTO customers VALUES ('SIMOB', 'Simons bistro', 'Jytte Petersen', 'Owner', 'Vinbæltet 34', 'København', null, '1734', 'Denmark', '31 12 34 56', '31 13 35 57', null, null); +INSERT INTO customers VALUES ('SPECD', 'Spécialités du monde', 'Dominique Perrier', 'Marketing Manager', '25, rue Lauriston', 'Paris', null, '75016', 'France', '(1) 47.55.60.10', '(1) 47.55.60.20', null, null); +INSERT INTO customers VALUES ('SPLIR', 'Split Rail Beer & Ale', 'Art Braunschweiger', 'Sales Manager', 'P.O. Box 555', 'Lander', 'WY', '82520', 'USA', '(307) 555-4680', '(307) 555-6525', null, null); +INSERT INTO customers VALUES ('SUPRD', 'Suprêmes délices', 'Pascale Cartrain', 'Accounting Manager', 'Boulevard Tirou, 255', 'Charleroi', null, 'B-6000', 'Belgium', '(071) 23 67 22 20', '(071) 23 67 22 21', null, null); +INSERT INTO customers VALUES ('THEBI', 'The Big Cheese', 'Liz Nixon', 'Marketing Manager', '89 Jefferson Way\r\nSuite 2', 'Portland', 'OR', '97201', 'USA', '(503) 555-3612', null, null, null); +INSERT INTO customers VALUES ('THECR', 'The Cracker Box', 'Liu Wong', 'Marketing Assistant', '55 Grizzly Peak Rd.', 'Butte', 'MT', '59801', 'USA', '(406) 555-5834', '(406) 555-8083', null, null); +INSERT INTO customers VALUES ('TOMSP', 'Toms Spezialitäten', 'Karin Josephs', 'Marketing Manager', 'Luisenstr. 48', 'Münster', null, '44087', 'Germany', '0251-031259', '0251-035695', null, null); +INSERT INTO customers VALUES ('TORTU', 'Tortuga Restaurante', 'Miguel Angel Paolino', 'Owner', 'Avda. Azteca 123', 'México D.F.', null, '05033', 'Mexico', '(5) 555-2933', null, null, null); +INSERT INTO customers VALUES ('TRADH', 'Tradição Hipermercados', 'Anabela Domingues', 'Sales Representative', 'Av. Inês de Castro, 414', 'São Paulo', 'SP', '05634-030', 'Brazil', '(11) 555-2167', '(11) 555-2168', null, null); +INSERT INTO customers VALUES ('TRAIH', 'Trail\'s Head Gourmet Provisioners', 'Helvetius Nagy', 'Sales Associate', '722 DaVinci Blvd.', 'Kirkland', 'WA', '98034', 'USA', '(206) 555-8257', '(206) 555-2174', null, null); +INSERT INTO customers VALUES ('VAFFE', 'Vaffeljernet', 'Palle Ibsen', 'Sales Manager', 'Smagsløget 45', 'Århus', null, '8200', 'Denmark', '86 21 32 43', '86 22 33 44', null, null); +INSERT INTO customers VALUES ('VICTE', 'Victuailles en stock', 'Mary Saveley', 'Sales Agent', '2, rue du Commerce', 'Lyon', null, '69004', 'France', '78.32.54.86', '78.32.54.87', null, null); +INSERT INTO customers VALUES ('VINET', 'Vins et alcools Chevalier', 'Paul Henriot', 'Accounting Manager', '59 rue de l\'Abbaye', 'Reims', null, '51100', 'France', '26.47.15.10', '26.47.15.11', null, null); +INSERT INTO customers VALUES ('WANDK', 'Die Wandernde Kuh', 'Rita Müller', 'Sales Representative', 'Adenauerallee 900', 'Stuttgart', null, '70563', 'Germany', '0711-020361', '0711-035428', null, null); +INSERT INTO customers VALUES ('WARTH', 'Wartian Herkku', 'Pirkko Koskitalo', 'Accounting Manager', 'Torikatu 38', 'Oulu', null, '90110', 'Finland', '981-443655', '981-443655', null, null); +INSERT INTO customers VALUES ('WELLI', 'Wellington Importadora', 'Paula Parente', 'Sales Manager', 'Rua do Mercado, 12', 'Resende', 'SP', '08737-363', 'Brazil', '(14) 555-8122', null, null, null); +INSERT INTO customers VALUES ('WHITC', 'White Clover Markets', 'Karl Jablonski', 'Owner', '305 - 14th Ave. S.\r\nSuite 3B', 'Seattle', 'WA', '98128', 'USA', '(206) 555-4112', '(206) 555-4115', null, null); +INSERT INTO customers VALUES ('WILMK', 'Wilman Kala', 'Matti Karttunen', 'Owner/Marketing Assistant', 'Keskuskatu 45', 'Helsinki', null, '21240', 'Finland', '90-224 8858', '90-224 8858', null, null); +INSERT INTO customers VALUES ('WOLZA', 'Wolski Zajazd', 'Zbyszek Piestrzeniewicz', 'Owner', 'ul. Filtrowa 68', 'Warszawa', null, '01-012', 'Poland', '(26) 642-7012', '(26) 642-7012', null, null); + +-- ---------------------------- +-- Table structure for `employees` +-- ---------------------------- +DROP TABLE IF EXISTS `employees`; +CREATE TABLE `employees` ( + `EmployeeID` int(11) NOT NULL AUTO_INCREMENT, + `LastName` varchar(20) NOT NULL, + `FirstName` varchar(10) NOT NULL, + `Title` varchar(30) DEFAULT NULL, + `TitleOfCourtesy` varchar(25) DEFAULT NULL, + `BirthDate` datetime DEFAULT NULL, + `HireDate` datetime DEFAULT NULL, + `Address` varchar(60) DEFAULT NULL, + `City` varchar(15) DEFAULT NULL, + `Region` varchar(15) DEFAULT NULL, + `PostalCode` varchar(10) DEFAULT NULL, + `Country` varchar(15) DEFAULT NULL, + `HomePhone` varchar(24) DEFAULT NULL, + `Extension` varchar(4) DEFAULT NULL, + `Photo` longblob, + `Notes` longtext, + `ReportsTo` int(11) DEFAULT NULL, + PRIMARY KEY (`EmployeeID`), + KEY `LastName` (`LastName`), + KEY `PostalCode` (`PostalCode`) +) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of employees +-- ---------------------------- +INSERT INTO employees VALUES ('1', 'Davolio', 'Nancy', 'Sales Representative', 'Ms.', '1948-12-08 00:00:00', '1992-05-01 00:00:00', '507 - 20th Ave. E.\r\nApt. 2A', 'Seattle', 'WA', '98122', 'USA', '(206) 555-9857', '5467', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E506963747572650001050000020000000700000050427275736800000000000000000020540000424D16540000000000007600000028000000C0000000DF0000000100040000000000A0530000CE0E0000D80E0000000000000000000000000000000080000080000000808000800000008000800080800000C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FF0CB0C9000B090900000A009009000000000909A09A900B09000A90A00000000FFFEFFFFFFFFFFFFFFFFFCB9CFCFEFAFFFFFFFFEDFFFEDEFFDEFEFCFFFFDADA00D900009009009000000000090A00090BC0000900900000000A00ACA0E0E0E0F0E9CA9000A9CB0C00009090E0000009090B0000D009009000000900009A000FFFFFFFFFFFFEFFFFFFFFFCADEBDBDFDFDFFFFFFFFFEFEDFFFEFFFFFFFEFCAF0C9A0A0D00009A0000000000000009090A000B009A9000090000900C0900900900FA90ADA00090B00B000000009000090000009009A9B009009A00000000C000BFFFFFFFFEFFFFFFFFFFFFCF9FBCBEFBFFEBFFFFFFFEFDFFFEFDFFCFFEFFF9BC0B00909000900009000000000000900000909009A0C0B00000B00009A00E0E0E0EFCADA0C90000CB009000009A9A09A000B0090090900D00A9090009090A0000FFFFFFFEFFFEFFFFFFFFFFF0F0FFDFEDADFDFFFFFFFFFEFEFDEFEFFCFDEFEC0F0C9AC00A00A09000000090000000090A900A00009090000A00000CA00C09009090F900DA009A9000DA00D0000009C090000090B000A9A9B090000000AC00000BFFEFFFFFFFFFFFFFFFFFEDA9DF0FF9FFFFFFF0FFFFFFFFFDFEFFDEFFEFDFF9A9A0090909009000900000000000090A9000909A9000A90D090000A9000B0E0CACA0FAE9A9CA000A99A90B00000090B000909000090090D00009A900009000009FFFFFFFFFFFFFEFFFFFFEDADEBCFDEFFDADADFFFFFFFFFFEFEFCBEFDEDBEFCAD0D0E00A000000900000000000009009009000000009000A000090000000009A900DF090CA9009090E90900B00090A9009000090B009A09A90909000090B0009FFFFFFFFFFFEFFFFFFFFFD09E9CFBFBF0FFFFFEFFDEFFFFFFFFDFFDFEBFEFDA90B0A90900A9009000000000000000000000090900090A909000A0000ACB00B0C0E0AF0F0BC09000009ADA9090000090F0000900909009909A9A0900000000000FFFEFFFFEFFFEFFEFFFFEA9E9FBFDEDFFFDFFFDFFFFFCFFFFFEFEFEDFCFDEFC000D0000900000000000000000000009009000A0090090000B00900009000C00A09C0FF0F0BCA0B0A00090F0A9A900090B0900900090000B0D090A900009A000BFFFFFFFFFFFFFFFFFFFFD0F9E9F0FBEF0FAFCBFEFFDFFFFFFFFFDFFAFFAF9EFBC0A9C0A00909000900000000009000000000900000000B0000000A000000B0C90A00F0B0F009C0009000B009C000B00AD000B0099A909A90B00990000009C00FFFFFFFEFFFEFFEFFFFFCA90F0FCFFDFDFFDFFFDFDBEFFFDFFFFFEFCFCFDFEFC00900A9000000A090000000000000000B000900900000900909AC90000A9000A0C09CF00F00DA0090000909F0B909C0099A09009A00000090909A0090009A09FFFFFFFFFFFFFFFDFFFEE99CF0FDBE9EFAFCBE9EFBEFFFDEBFDBFFFFFFF0FEDF0A90AD0009009090000000000000000090090000000000009A00900090000DA0900A0AFADADB009AC900000009000A9009AD00090090909BCB09C9900090009AFFFFFFFFFEFFFEFEFEFFDACB0FDADFFBDF9FFDFDFDFDFFFFFFEFFFFFEFCF0FBED0E9009C0000000000000000000000000000000900000000009A00000090B0C00E9C00FDA90E9AC9A0A90A90A9A909AD009B900AD0A90009090B0A90000090BDFFFFFFFFFFFFFFFFFFFC09AD0B0F0BEDAFE9EFAFBEBFDAFDFFFDBFFFFFFFFCFFE9009A0B00000090A90000000000000090090000000000090009B000000000B0000AD0FADEB9E9000D00090090D0B099A9A0F09009009090B09099000000009EFFFFFFFFFFEFFFFCFFC0F0DAFCF9FD9FDF9FF9FDFDFEFFFFEFDFEDFFFFEFCFFEDE9E09000090000090000000000000000000090090000000099C00900000F000090000FDBADCADA900A9000000B009CA9C099A00B0090A9E900B00A0009009FBFFFFFFFEFFFFEFEFFC0B09AD09ADEBEFE9EF0FCBEF9FBDFFFFFFFFFFFFFFFFEFF000900090000900000000000000000900900000009009009A0A9000000900000ACA0AFAEDABF9ADA900DA9C909E9A99A9C9A9990900900909909900000000BCFFFFFFFFFEFFFDFFCBC0F0DA9EDBFDF9FF9DFBFF9FEDFFEBDFFEDBFFFFFEFFFFEC09ACB00000000909000000000000000000900900000090009000009000A0000000D0FDBEDACFBCBCBA09A0A00909AC9BA99E0A9A90090B00BCA9000000009BFFFFFFFFFFFFFEFF00909E9CB9EDAFCF0FEBCF0FE9FBCFDFFBFFFFCFFFFFFFFFFFE09009000000A0000000000000000000000000000000009A0909000090900000000BFFE9FDBC9E9BC900909900B09B0D9A0999C00090909A0909000090090FFFFFFEFFFFEFFFFC90A900B0DADBDFBFFDBDB9FDBFCFFBFFEDFDBFFBFFFFFFFFFE900B0C009090900900000000000000009000000900000AD090A0009A000000909A09F9FFEBEBEBDADBAD0BCA09C0BCB0BC9B00A9090B0F0990B000000000B9FFFFFFFFFFFDEFCA0C9CAD0DADBEBEDADBEDAFCBFCBDBCFDFFEFFCFDFFFFFFFFED00009A9000000090000000000000000000000000000090000090900000F0900000DAFEADBFDBDF0FAD0A9090B0B0090B0BD0B990000090000900000090090FFFFFFFFEFFEFFFD09A0090B0F0FDF9FFEDBFDFBCBFFFFFAFFBFFFBFBFFFFFFFFFFE09000000000900000000000000000000000000000000900900000909000000A9A9AF9DADAFCBFBCBF9F0B0F090B9A9C90B90E909090B909B0900000000090BFFEFFFFFFFFEFE00909AD0BCBDAFE9FDBCBE9FFDADAFDF9FDFDFFCF9FFFFFFFFFC000090909000B009000000000000009000000900009A009A90000000B09E0900C90FEADADFBF0DBDAF0BC090F90000B0B0DB90B00090000090B0000000009FFFFFFFFFFEFFF090C0AC9ADBDAFDBFEBEFFDFF0FFFFDBFFEFFBFFFFEFFFFFFFFEB000000A0000000000000000000000000000000000B090000009009A9000000090A9F0DFAF0FE9EBEBDBE9B0B0BC090BD09A9A9009A90090B000000009009BFFFFFFEFFFFDFC000A9090F9EFBDBEDBFDF9FE9FFBDBEFFFDBFCFF9F9FFFFFFFFD000000090009090000000000000000000000000009C0000A909A0000009009A00A9CFEA0D0FDBFBC9CADBF090D0B00990B09B9E90090B009090900000000000FEFFFFFFFEFEF00090DAF0F9EDEDBFCFBFE9FFADFEFDFCBFFFFFFFEF9FFFFFFFE90000900000000090000000000000000000000090B000009000000B0F0A0000F0D0BFDFFAFAFEDBFBF9E9EF0BA9ADA0A9C9AD09A0900090000000000000009BDFFFFFFEFFFFE0900A909F0FBFBFDBFDEFFFFDFFBDFBFFFE9FDBDF9FEFFFFFFFFC090000090000000000000000000000000000000F00000909A9090090909AD000000FBEFDFFDBFE9E9A9B9BD09DB90D09B090B909009000B090900000090900FFFEFFFFFFFED000D0CBCBDADEDEFFFFF9FDAFF9FFEDF9FDFEFEFFFF9F9FFFFF9B00000000090090000000000000000000000000B090009000900009F0AC00000A0BCFCF0BEDAFF9F9ADF0FFA9AB00B09E9A9A9E90090900900000000000000FBEFFFFFFFEDF009009B0F0FDFBFBFCBDFFEFFDEFEDFBFFEFBF9FBDF0FFEFFFFFE00000000000000000000000000000000000009F000000009BCA900B00909A0AD0D09FA9EC9AF9EF0ADBAD0BDF9C9F0B09090999A900A09000009000000000909FFFFFFEFFEFC00B0E0F9FFAFDFDFFFFAFDBFFBDFBDFCF9FCFFDFBFFBDBFFFFFD9A0000B0000000900000000000000000000BCB0B000009A0090009E9E0000900A0A0FFCBFEDAF9BFDADBBF0B0BB099DA9F0BCB0D0009009090000000000090B0DFFFEFFFFFF000099F0F0FDFAFEBDFFDFFFCFFFFFEBFFFFBDEBCF9FCBDADFFFAD0000000000000000000000000000000000090D000090090B009F09090B00C090D09FEBFCBADBEF0BDADA9FDBC9FA0B90090099A909000A00000090000000009AFEDFFFFEFC09090E9F9FBEBDFFFFBFFFFFFBDE9FFDF0F0FFBDFBEFBFFDBFFFF0900000000000000000000000000000000B9A9A00090090900FA0BCA0000B0B0E0A0F0F0BEDFEF9BCADADFA9A9A9099E99B0B9A900009009000000000000009ADFFFFDEFFDA000F0BDAFCFDFFF9FFCFFE9FFFFFFF9EBFDFFADEBFDBCBCBE9EF09A00009C000000000000000000000000090C0900900A900B0F909000900D000C090DFACFEDAF9F9EBDB9A9BDBDBDB0B9A90990D0B09009000900000000000909ADEFEFFFEF009009F0F9FBFCBFEFFFF9FFF9FCF9EFFDAF0FDBFD0FDBDBD9F9FF009000A00000000000000000000000000B090E9009090B9C9A00E090C00A000B0CB0FDB0F0F0FBE9CBCF9EDA9A9ADBCB9ADA0B0909A9000900000900000000009BFDFFFFFFC009ACBDAFDEBFFDFBDBFFFDEFFBFF9FAFDFF0F9EBFBEFEFADADBE9000090000000000000000000000000009A090000090B0ABD090900B0A900F0CB0E9F0EDAF9E9E9BBCB9EBBDBDBDB09AD0999090090009000000000000000009A0FFFEFEF00000DBCBDFBFDF0FBDEFFFFBFFDEDFEFDFADADFE9FCBDBD9FBD0BD0B0000CB0000000000000000000000009C90A900A90BC9D00A000B0009C0B09AC090F0B9ADADBF0BCBBCB9DADA9A90BDA9B0A9A09A00900090000090000000909DBEFFFFDE090DB0FBFBEDEBFFFFFFDADFDFBFBFBDFADBFFADBCBDADBEF90BD009000900000000000000000000000009A000900999A90B0A090B9C90F00BC0AC0B0EFB0C09ADA9FDBFCB9EBB9BDBDB90B9099C900990090000000009000000000ADFEDFEF0000A9F0FCFDBDFDFDFBFFFFFBEFDFCFADFBC9ADADBCBF0F90FBCBE9AC000AC0000000000000000000000009A090E90A09E900900BCA9A00B0090090009FDBB0F09F0B0B9BCB9C9E9B0BCB9CBDA9B0900B00090000000000000000090A9FADFEF0090E9F9FAFFBEBEBFDFFFFFFDFEBFDFBCFFEDBDADBCBDAFD0F90909000090000000000000000000000009009090099E900F00909909C900000A9A9E90FBCDF0BE9BDBDADB9E9BBDADB909BB090900090909009000000090000009090FEDFED009ADBCBE9FDADFDFFFEFDBDEDBFDFCBFCBCBDADADB0F9E99AF0BDA00B009000000000000000000000000900900A9B00909B09ADA0E00A00D0B0D0C0000F09BA9F9BCBB0F0BE9BBCBF9B0F9AD90B009090000000000090000000000009E9EF9E000D9ADBDFDAFFFBF9FFBFFFFFFFAFBFCBDBDADADACBDADBCF99E0D090000A0000000000000000000000000B0009000B09A000000900000000C000B00A9FFAD9CB0F9ADBBDB9F0DBF9ADB0B90B99A9A00B09090090000009000000090B9E9EF009A9ADBCBEBFDBDEFFFFDFFFBFFDFDE9FCBE0F9E9DBCB9F0B0DA99A000000D00000000000000000000900900009A90900000090900909090B09A0000900F9FABBDB0F9AD0BCB9B09AF9A9BCBBCBC90900900000000000900000000000009E9CF009E9ADBD9E9FEBFDFFFFFFCFDAFBFFFAFDBDADBE9CBCB0F0BE9E9DA09000000000000000000000000000A9090000009000000A000A000A000009000090FF9FDFBE9BF9BF9B9E9FBD9BD9CB9090B090900090009000000000900000090B09EB009C90F0FEBDFBDFDBFFBFF9FFFFDFCBCF0F0F0F0DA9E9CB0D0909A09000009A000000000000000009000900000909000000909000909009000000090DADFAFFFADBDADBF0F9E9BADBBE9AB09F9B90B0009B009000000009000000000000DAD0D0A09ADBCBDFADFBEFFCFDEFFFF9FEBDF9F0F0F0DA9E90BC9ADA9E0900000000000000000000000000009A009A9000000000000000000000000900900B0BF9EBFFF0BDA9FBDB9AD9BCF9B99B0B09E9009000000009000000000000000909ADA00090F9ADBDADFAFDFFFFFFBFF9FEBFDBEFCBDAD0F0F09E90F090990F0900009000000000000000009009090000000000000900009000000009A090A9BDBFFBDF9FFF9FFBDBEBDBBCBB9F0F0DB9B090900909090000000000090000000000009E00090CBCBFFBDFBFBDBFFFFFFEFFDFADBCBCBCBA9E9E90F09E9E0B000000000000000000000000000000A0090090900000000090009000900009A90BCB9FFEBEFFB0FA9FAF9FBD0BF0FA9B9A9E99A9A90009A000900900000000000000090BC909AC9B0F9E9EBFDEFFFDFFDFFFFDEBDFEBDBCBCDCBC9EB0DA90900D0B009000000000000000000090090900009000000000000000000000A909090F0BFEFF9F9BF0FB9FFF9FBCBBF9F99F9E90B9E90900090009000000000000090000090AC000009A0F9E9FDFDBFDFFFFFFF9FDBFDFE9DACBCB0A90B0D0F009E09A90000000000000000000000900B0900900000000000000000909009090B0F0B09F9F9FBEFC9F90FB9BF0FB9F9E9BFA99F99090900900090000900000000000000000909000900D90F9FAFBEFFBFFFFFFFFFEFFAF9FEF9E90F9E9CA0B09E090000090000000000000000000000000A00090000900090090900000A90B009090DBFBEBFFDFBFEBFF9CFDBF9FADBFBCBDBA9ADB0B0B009000909000009000000000000000000009A0BDADBDFFDBFFFFFFFFFFFFFDFFE9F0F0FA0D0A9D0CB0900B00900000000000000000000000090909000009000000000000900900009ADA9A90F9F9EFA9EDBDB9EBBAF9ABDBE9DB9B0DB9A99C9090009000000090000000000000009090000A90D0BF0FBCBFDFFFFFFFDE9F9EF0FF0F0F0DE9AD0A9A0F9E90D000900000000000000000000900000000000000000000009000B00909E909C9AF9E9E9F9FFAFBEFDBDFDBFDBF9FBE9E9B0BDB09A900090A909090000000000000000000A00909C9AFC9FFDBFFFFFFFFFFFFFEFF9FDADAD0DA9AC9E9C9C90000A090000000000000000000000009A900009000009000909000090090B0090B0BF9E9ADAF00BDBF9BBEBFADBBDAB9F9B9E9DA90B090090009000000000000000000000090900000B0D9BE9AFFDFBFFFFDFFFF9F9EFAFDADA9A9C0B00B0A9A0BD090000900000000000000000009000009000900900900000009A090A9C0B0F0F90F0BDA0BF0FADFFDF9F9FBCBFDBE9E9B9A99F90B090A90009009000900000000000000000000090B0E9FFDBFFFFDFFFFFF9EFEF9CDADBCF0DA9C09E0D0C9C0A009A000000000000000000000000090000000000000000009009009CB090909AFB0F0F09F0B0FFBFBFEBFBDBF0BDBBDBC9F0B0B0D0B09009000900900000000090000009090009A9C9BDADBEDBFFFFFFFFFEF9F0FBBDAF09E0D0A9E09A0B0B09C90090000000000000000000000900000000009009000000A0900B90090B0BBD9CB0F09EF9ADB9FFCB9FF9EBDBDBEDB0BB099F0909090900009009000009000000000000000090009ADADBDFFFFFFFFFFFDF9F0FBCDAF09E0B0AD00900D0D0D00A0900000000000000000000090009000900000000000909090A900A9A9C9FDAFA9BCBE9F0F9FE9BFFF9EBDBBEBF9BF909F0B09A9A9000909000000000000000000000000900009F0F9FBEFBFFDFBFFF9FBEF0F9CBAD0DA0D0D00D0ADB0B0A0B0900009000000000000000000009000000009000909000000090E9090DA9A9AD09FCB9CBE9AF9FFF9AFF9FBDBDF0F0BEDA9BCB90990B90000909000900000009000000090000000090F0DBDF9FBFFDFFFED9FF0F0D0F0BCB0A0F0A900C0C90D0CA9C00000000000000000000000000000000000000000090B0090A9CB09ADBDAF00BCA9FB09FE9A9FFDBFE9E9FBB9F9B9BC9B9CB00900B090A0009000909000000000000090009A9AD0FBFAFFFFCFBFCBDBE90BCB9E9AC9C9C900D0E90B0A9A9090A90000000000000000000090090000000009000B009000900090B90BDA9A90BD0F9FFD0BE9ADEBDBEF9FBFBE9F0FCBC9A90B0A99C90900909000000000090000000009000900D0BFBCFDFE9FBFEDBFDAD9EDA9E09C90B0B0CB0B00B0C9C00A09000000000000000000000000000000000000090000000900B90B0CBC0BCBCBDAF9FFFB0BDBDB9EBFDBFADBDBC9B9B90B9CB99DA0B00009000000900000000000000000000009AD9ADBBF9FFFF9FBDEBDBE9A9C9DA9E0C0CB00C090C90A0F0D0E9009000000000000000000000000000000900009090900A90E9C9B0BDB9E9FEDFFFFFF00ADADBDBEBDF9FAFFBCBCBF90B90F09909090009000900009000900000000090009009AD9FCFEF9F9FFFFF9FF0DF9EBCBC90B09009A90E90AD0900A900B000000000000000000000900000000000090000000B000909A09F0ADF0F0BFDFFFFF0DBCBF0F99FBEF9F9F9BF9090F0B909A090B009A009000009000900000000000000009E9AF0F9F9FFFFFDFFFE9FB0FD0F09E9C9A0D000090E90A0909090C090000000000000000000000000000000000B000B0009DA9A99E9F9A0F9FDFFFFFFB0B0BF0FBEFADBDAFBCBE9A9EB909C9AD9A90090090000090000900000000000000909A90F9FBFBFFFFFFFFDF9FEDFF0BDBE09A0C9A0D0B009000DAC0CA0090000000000000000000900000000090900900900009A009C9E9A9EBDBAFFFFFFDFF00DADF0F9BDBFBF9FBD9BDB9DA90B0900909009009000000900000000000000900000D0F9E9FDFFFFFFFFFBFF9FBCBDEBC9F0D0BC09A00DA00F0009A90B0A0B0000000000000000000000000000000000000909090B09A9AD0BDADF9FFFFFFFF0A9FA9F0FCBDADBE9FBE9E9A99F090B9BC0B09A900909000009090000000000000090B0ADBFBFFFFFFFFFFDFFEDFFDBDEBCBDAD09E09C0090009A00000C90C000000000000000000000000000000009A090000A00909A9F0BBCBDAFFFDFFFFFF09F09E9E9BDAFBF9F0F9B9BDAF09A900099000900900000909000000000000000000009DBDFFFFFFFFFFFFFFF9F9FADBDDF0F9ADA90E9A90CB00C9ADA900090900000000000000009000000000090900000909090BC90F0F0D9FA9FBDBFFFFFB09E9E9A9BFAF9F9EDBFADADA999A9C90B9A09B009A0000900009000000000000009099FBFFFFFFFFFFFFFFFFDFFEFDFFEB0FDAD909E900CA90090000000A9A00000000000000000000000000090000009000A000B00ADA9E9ABE9FDFBEFDFFDF00BF0BDAC9F9FBFBBCBDB9B9CBC90B09000900909009000090900000000000000000EBFFFFFFFFFFFFFFFFFFFF9F9FADBDF9ADACF09ADA9009E0B090909C0090A00000000000000000000000000A90900909090D0909ADB0BDE9AFB9EDBFFFFF000BDA9FBCBEDBCFBF9AFCB0B9A909B0909090B009000090000900000000000000099F9FFFFFFFFFFFFFFFFFFFFFFDFFCBDE9F9B0F0909CBC090CBCA0E0900AD090000000000000900000000009000000000000B00BCB0F90BDBDADEB0E9FCBE0009ADADABDBBFB9F9FDB9F90BD0BC090F0009090A90000090B000000000000000BBFFFFFFFFFFFFFFFFDFFFDFCF9EBDBDADF0FCD9ADADA09BCA9009090A09000000000000000000000000000000009009090B0009090F00F9ADE9A90F9EBFEB009ADBDAD9FADF0F0FA9BCB0F90B909B09099A900900009000000000000000000BDFFFFFFFFFFFFFFFFFFFFFFBFBFDDADEDB0FDB0AD09AC9AC090CBC90009C00B000000000000000000000090900900000A00090900BCB0BB0F0B0F0F0FEFC0F0000A0BDBE9FFBF9F9FADBD90B090B0090B0090A9009000B09000000000000009BFFFFFFFFFFFFFFFFFFFFFFDFDFDAFF9FBCF0BCBD9AD0BC90BCA900A0F00A90000000000000000000000000000009009090B000A090B9C9CB0F0F09AB0FDBFE90BC900BDBE9FDAF0B9F0BBE99F0D090B0090909090000900090000000000009FFBFFFFFFFFFFFFFFFFFFFDFFFFCBD9FE9FBDF0FCBE9AD0BCB09D0F0D00900009000000000000009000009000000000009000909C0B0DAB0BCF0B0BC9CB0ADAB0C0B0A9E9E9FBFBDBDE9F9C9BE9B0B09090A90B09A900000900000000000009FBDFFFFFFFFFFFFFFFFFFFFFFFFDBFFEF9F0FA9F9BC90DA9CB0DA0A09A0BCA9CA00900000000000000000000900090009A0A900009009A9CBCB9CBC0B0B0FDADF00BC0DBCBFBDAF9EB0B9B0BF09900909009900909000090900000000000009BFFFFFFFFFFFFFFFFFFFFFFDFF9EBFC9F9EDF09FCBC9ADA9CB0DA9E99E0D009009CA0000000000000000009000000000900090000B00BCBCB0F9EA90B0E9E9A9AF0000B00B0DAFDFF9FDBE9F90BCA99A9C9A009009009000000900000000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFDF9FF0F9A9DE09ADADBC9F0DAD09CA09ADACB00090000000000000000000000009000009000090009090F090E990F0F9B0F0F0F009C0BC9A9FBFBFFBE9F0BF9B99A0D0B0909A900B00900900000000000009BDBFFFFFFFFFFFFFFFFFFFFFFF0FF9E9F9EDDAB9E90B90E9A0B09ADA9C9E9090C9A00000000000000000000000000000B00A900009000B0B0E9BCACA9F0E0F0B0BB000A90A09E9CBDF0F9F9BD0F0DAD90B0900090900900000090000000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9EBF0F9ABD0F0F0C0F9CBD0DADA9E9A9CBCB9AD0DA90000000000000009000000009009000900A09A0D0BD0A9DB9E0B9F0BC90F0A09CB0DA9EBFAFBDBFAF0B09A9B0B09A9090900900000090000000000BDBFFFFFFFFFFFFFFFFFFFFFFFFFDBDAD9C9090D0F009E9B90AD0FADA9C9A9CA9000C0B0000000000000000000000090000000000000090090BC0A9DA0E9F9E00B0BEFC900BC0BCB9F9F9FBCBDBDB9F9090909C90000B0090009000000000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D9A99A090909F090CAD9AF09E9E9ADA09E9E9A9009E900000000000000009000009009009000900090BCB0D0A9F9ADAD0F0F09B0AC90B0DA0DAF9F0FBCBCBCB0F9E9ADA909A9009009000090000000009DBDFFFFFFFFFFFFFFFDFFFFFFFFFDBE9C90D9D09A0009E9B0AD09E99E9E90DBC9A9C9E9E00A000000000000000000000000000000000090A009CB09DA0FBF00B0B0F0D00B00F0A9FA9FAFBF9FBF9F9F0B909090BC9090090000000000000009FBFFFFFFFFFFFFFFFDBFFFFFFFFD9FC9F9BDA90BC9D09000C9C0F09E9F09E9A0BCBCA9009090D00000000000900000009009000000900000909A009A0BDBCA9E09E900A09FCB0099E9CBF9FDADBDB0B0B9E90B0909000090000000000000000BBFFFFFFFFFFFFFF9FBFFFFFFFDBDFF9F90D090D9090000909A9B0BCB0F0F0F0D0909DACBCBCA0000000000000000000000000900900009A900E90DA0F9E9E9F09E90F0D000B0F00A9BF9FFAFFBDAF9F9CB9BD09A909A9009090000900000009DFDFFFFFFFFFFFFFFFFDFBFFFDBDB99C9E909090090909000090C9CBDF0F9E90BCADA009000909C00000000000000000000900000000900000900B0999E9E9E0DA9A000B0009E9E90E9FADBF9FABDBE9A9CB0B9090B090900000000000000000BFBFFFFFFFFFFFFFF9FAFDFFDBD0D009990F9CBBC9E0909090090A90ADBCBDBE90D0DAD0F0F0A0B00000000000000000090000000000009090A909A0E90F0B9A0F0C900DA0009E9AC9A9FBFDFBDFADBDF9B0F9CB090900009000000000000009BDFFFFFFFFFFFFFFFFFDBFF90009A9FBEFFFEF9CBE0900000000090F9ADBCBC9E9A9A90B0909D000000000000000000900009000009000000090BC909ADAD0E9C090000A9A00B0BDB0BCBDEBBFFBDBFA9B099AB090DA9090000000000000000FFFFFFFFFFFFFFFFFDADAD090099BF0FFFFFFF9AFF09E0F00000000090F9ADA9A9C9E9CB0CBC0A0F000000000000000000000009000009009090F0B0DAD0F0E90B0E0000F00009ADADE9BFBFFDF9EBDB9F0F0BD9DA9090009090000000000009BDBFFFFFFFFFFFFFFFFBDA900000FDFBFDBFEBC9E9E0900000900000ADAFDBDCD0B09A9CA90A9C90000000000000000000900000090000000DA090DA09A9009A0C9000009FA90C09A9BC0FF9FAFF9FADFB9BD0BA99A909900000000000000000BFFDFFFFFFFFFFFFFF9FF9CAD0090B0DAD9BD0B09090090090000090909ADAABCBCBC9E9DAD0A9E9A0000000000000000000900000090090B090A90909DA9E0D00000000E900A9AC9E0BF9FBFFDBFFDBADE90B9DBC90B0A9000000000000000BDBFFFFFFFFFFFFFFFDFF9E99909090999000090900090009000000000BC9ADD9AD009A90A9A9C900D000000000000000000000000000000A000F09ACB0A0C900A0009009B0A90009A0BF9EFFCFBFF0BD9FB9BD0B0B9090900900000000000009FFFBFFFFFFFFFFFFFBF0FFFFFF99090F09BD99C900900990009A90DAD00BDB0AD0BDBC9E9C9E0A0F0A00000000000000900000090000009090909ADB090DB0B0C9000C9EF90A9ADAD000FB9FBDF9FFFAF9BCB0BDBDA9E909000000000000009B9FDFFFFFFFFFFFFFFDFFBDBFFFFFDF99BC909A909D0BC0C90BC0DA090BD0BCBD0F000A909A099C909000000000000000000000000000B0000A0BCB0000B0C0090000B0F00FA009A9AC909EFFFBFE9FBDBCB9DB0B9A90900B000000000000000FFBFFFFFFFFFFFFFFFF9FFADFFFFFFFFFDBDBC9FDA9C9B9ADADB00D0E00AD0BCB09F9C9E9E9E0A9AC0F0000000000000000000900009009090909ADBC90C9A9CA0A90CBCBF00B0A00A9A00B9FADFBFBDBFBDA9AD9ADB9A9090900000000000009BFFBFFFFFFFFFFFFFFFF9FFBFFFFFFFFFFFDFF0BDFBDE0D0900DA0B09F9ADCB0F000B0909099C0D0B0000000000000000090000000000000009A9A090A9AD0B090CA90A090B000B0D000B0FFFFBDBCBF9CB9F99ADBD090D0000000000000009FFDFFFFFFFFFFFDBFDBF9FDBDFFFFFDFFDFFFB09FCBCB099E9E9A9AD0F00DBB0D09E90D0F0F0E0B0B0C000000000000000000000009009009A9E9C909A9000BC0CA0F0E90FA00A90B0BC00DBFF9EFFFF0FBDA9ADB9B0F909A909000000000009BFFFDFFFFFFFFFFFFFFDEBFFFFFFFFFFFFBFFC9E9BDBC9E0900D0D09A9DBAC0F9E99E9A090090900C90B00000000900000000000000000000909ABCB0C00F09A9ADFAF00B0DA90A00B0B0A00BFF9F9FBFDA9F99ADADB09A900000000000000009FBFBFFFFFFFFFFFFDBF9F0F9FDFFFFFFFDFFFF9E9F0B090A9B0B0F0DA0D9BD0A9E909CB0F0CB0F09AD0000000000000090000000000900900BC90909A99000D0AFFDFBC0FA90A90B0DAD09ADEBFFEBDFBFF0BC9B9BBDA909090000000000009FDFFFFFFFFFFFFFDFBFDF9DBFFFFFFFFFFFFDBD09F0D09E9C0C90D0B0DB0F0BFD090F090D09A9C09E00BC0000009A0000000000000000000090B0F09E90A09A0BDFFFECB0B00A00A00B0BCA09BDE9BDFBFF9BDBB0DBD0909A900000000000009BFBDFFFDFFFFFFFFFFDFADBFCBFFFFFFFFFFBFCBE909E0000B9AD0B0DB0F09C90B0F00BCB0A9C0B009F00090009000000000000900900090BCBDA90F09AC90CBCFFFEDBCACB00B09A9AF0F0F0FBFFFA9E9FFEB0DBA9BF9E9009090000000000BDFFFFFFFFFFFFFFFDBFBDBC9BDBFDFFFFDFFFDBD9E9009090000B0D0BCB9CBBCBC90BD090C90B00DA0009C0090A000000000000000009000090A9CB0BC0BCB00F0FDFACB0BCB00A00090B0F0F0F9FEDBFFBF9FB0DBCB09909A00000000000000BDBFFBFFFFFFFFFFFFDF9FBC9BDFFFFFFBFDFBFF99E9000090C90B0D09CB9C9BDBCBCADA9BC0D0B09E90A909E09C00009000000000000090B0990BC9CBC0BCB0BF0E9F9E0EB00A0A9A0A0F09AF0FBDBCB0F9FBDBB99FFB0B0990900000000009BFFFDFFFFFFFFFFFFFFFF9DB9CB9FBDFD09B9FDB0F9000000090009A0F90F9E9E99CB909C09B0090C90E90B00900B000000000000000000009E9E90B009ADA9E00BCA0A09900B0900009A9A009FADAFF9FFFFDAD0FFB90D0900000000000000BDBDBFFFFFFFFFFFFFFDBDBE9CBDFFFFF99F9FDB0FD0E99A909A90DBC990F9E9CB9EBD0CB0B0C0F0A9A09000CB09F000000000000009090909E9A90B0CBCBCBCB0B0B0F09AFB000A0A0A09AC9E09FFFDBEDAFBFFBF9A9FB9AD0B0909000000009BFFFFFFFFFFFFFFFFFFFFDF9B0909FFFFFFFFFFDBFBDAC90F0DA0009F0F0F9FBDE9D0B9C9CB090C9009CADA90E009000000000000000000B09A9EBCBE9ADACB0A0CA00A000FA9009090A09A09A09AFADBBFDFFBDBF9F9E909009000000000009DBDBDFFFFFFFFFFFFFFFFBDFDF9F9FFFFFFFFFFFDADB9AC90B0D09A90BDBCBC9ADA9FCB9A9CB0B009E090090909E0F000000000000000900BC909CBCBCF0B0E9CB09A90B0F00A0A0A0A90A0B0090F9FFFDFBFBDFE9FBE9F9A900090000000000BFFFFFFFFFFFFFFFFDFFFDFBF0F0F9FFFFFFFFFDFFFCD99E9CB009C9E9ADBDBFDBDBA9C0DB09C09E090A90CA09A09009000000009000900909ADA900FFACF0B0A00A00A0090B00900900A090ADAF0FBCBFAFFFFBDBDBDB90909A900000000099F9FBFFFFFFFFFFFFFFFDFFBFDF9F9FFFFFFFFFFFFDB9B0E9CB00B09E9FDADAD0BCBC9DBDB0CB0B090B0D0A909E9D0F9E000000000090009A9ADA9ACBDADF0B0F0B0BCBCB0FA0A0A0A0A090A90B09ADBFFDFFF9FFBFAFBF0B0900090900000009BFDFFFFFFFFFFFFFFFFFBFDFBFFDBFFFDFFFFFFFFFEDE99AD0C90DA9DA9FBDBFDF9FEBCBC9BC9CA9C000D009090A90000000000000000B0D09A9C0BDADA0FCA00E9E9E9EA0F909009000A00A00A900CBFBF9FF0FFF9FDBFDBC9900000000000ADBFFFFFFFFFFFFFFFFFFDFFFDFBFDBDFFFFFFFFFDFDBDE09A9009ADA9F0DAD0B0F099DB0F0CB0900BCB0A9CA00B0F090F000000000090009AD9ABDAFCADA0BDBB0F0FAFDFF0A0A0A0A9A09A09A9E0B0BCFFFFBFBFDFBBF9B09A09090000000099FDBFFFFFFFFFFFFFFFFFFFDFFDFFFFFFFFFFFFFFFBDA9DAC0B0BC90F0FBDBFDF9FFE9E90F90DADA090900A9C90D0BCB000000000900090B0BED0BF00900F0A0CB0F0D0EAB00B09009000A09A000900FFFBFFFFDFBF9EDBCB909000900000009FBFFFFFFFFFFFFFFFFFFFFDBFFFFBFFFFFFFFFFFFFDE9DA099C9CBBFF9E9DADABCB090F9F9ADBC909CAC00900009AD00090000000009A0B09F9AFC0D0EBDA9ADBACBEAFBDCB00A0A0A0A090A0B0B0E900FFF9FFBFFBFBBF9AD09090000000009BFFFFFFFFFFFFFFFFFFDFFFFFBDFFFFFFFFFFFFFFFFBDAD9E00B09C90F9EBDBFDBDFFF9E9AD909ADA099A0090B0000BDA00000090000900FADAD0B0A90C0F09A0DB09000ABCB09009009A00900B0B0EB09AFFFFFBFDFDFBDB9A9A0909000000099FFFFFFFFFFFFFFFDFFFFFFDFFFDFFFFFFFFFFFFDFCBDA09B9CBCBF9E9DADF0FDA9DAF9EDAE9E90DA0C900000909009C900000000900909FADAC0090B0B0F09A00E0BC909A00A0A0A0A00A0A9A00B00CADFBFFDF9FBF9ADBC99090000000009BFFFFFFFFFFFFFFFFFFBFDBDFF9FFFFFFFFFFFFFFFFBDADBC0CB0B09E9EBDB0F9ADFAD9E9BD9E9ADAD0B00000000009A9A0000000000B0DB09A9A90CAC0F00BC9AD0B0A0AE90A0B090B09A909A09ADADA09BDFBFBFBF0BFFB90A900909000009CBFFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFFFFDFCBC9009B0D0DE9F9DBCFDADFA9DAF9E9E9AD09A90C00000900909C0000000090909ABCBC000A090B00B00A90B009A99E09000A00A00A0A0B0B0A9000EBFFFFDA9F99B0F99090000000009BDBFFFFFFFFFFFFFFFFFFFDFBFDFFFFFFFFFFFFFFFFF90F0F0C9ADB9E0FEDB0BDA9DEBD0F9E9ADABC9E9A9000000000A9E00000000000F9CB0BC00D00009AC9ADAC0F0E00A9A0A900B09A9009A0A0B0E9090DBFDBFF9BF0DB9E9DA90900000009BDFFFFFFFFFFFFFFFFFFFFFDFFFDBDFFFFFFFFFFF9EFF090B0D0ACBDB9BEFDAFDA99EBDADBDE9DA9E9C000000009090909000000090B0ABC0009A000ACA0B09A9A9A90B0DA090A0A00A00EB0CB9CA90A000BFFBFF9E90BB9E99A9000090000909FBFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFF90F0D09A9DBC9EFC90BD0BDE99CADACB9E9CB09A900000090000BC000009090009D0B009A0090090900E9EDAC0AC0A90A00090A09A900B00A9CA0900BCBDBFFBDB90DB9A090090000900BDBFFFFFFFFFFFFFFFDFFFFDFFFDFFFFFFFFFFFFFDE9CF09A0A9DACBAD09BFECBDA9ACBF9BDBCBCBC9E9C000000000A9C9A0000000A9B0A00CB0C900C9A0A0A9A9A09A90BDA00A9A0A9A00A0B09A9A09A0909FFFFBF9AD0B90F99090090000900B9FFFFFFFFFFFFFFFFFF0FAFDBEBDFDFFFFFFFFFFFFB0D00D9CADBCDADAC099BC9EDB9CBCBCBCB09E9A000000000909A0C0000009000C9A900000A9A0009090DAC9E0A00AD0B0000000B09E0EADA9A09A0000BDADFF9B909B9ADB090009000990F9BFFFFFFFFFFFBDBE9FDBCBDDFAFBFDFFFFFFFDBCDB0B0A0B009A9DADBCAC0A900FA9CBCBDADFA9C9E9000009000C9B00000000090B0C0BC0B0C09A0A0A0B09A0090B0F0A00B0B0B00EA0B09A0E90ADADA9AFFBFBE9E9A9C9B0900900000009B9FFFFFFFFFFDFDFF9F0BC90A90D9EDBFFFFFFFFFFBC00D090C9E0CA900909090B90DA9DBC9F09CBA900000000090B0C900000009A900B000900B0E0900090A9CB0A0000B00A000000A909ACA9A90A9A900CBDBFDF9990909BC9A9000000099F0DBFDFFFFFFFFFBF0FCBD0BC90F9ADBFFFFFFFFFCBC9090AC0B09099C0BCBCAC0C0CB9EBCBAC9EBC9CA000090AD0A9CB00000090000CB09CB00F009A0A9A0AD0A0BC90AF0B090B0A0B0A0E0B0E9A99E9ACB00BDFAFFA9B0B09B909B0909000099A9BFFFFFFFF9FDFF9BDAD09A90090F9FFFFFFFFFDAC0A09090009E0AD00090B090B0E9CB0DBAD09E9C900000909CB00B900000909A90CA09E9ADA09000909A9AD00A90BC00A00A90090A90E90A0EB0F0BCBC9ADBDBDAD09CB0BC0900000909A9DBCBFDBFFFBFFBCBC009000909ADB0F9FFFFFFFDF9900D0BC9CB09000090000000090B09E0D0BCB0B00000000A0B0F0C000000000DA9BDA0000A0A0A0A00A900A900A0CB0A09A00A0A09A09AD0B00A0B0B0B0BFFBFF99B0909DB900900000909A9BDBFFDBFDF0F0909E0A9C0B0D09DBFBFFFFFFFACA090A00B00DAD0B00000000090009E9B0F0BCBCB0000009C90D00B000009A09A9CA09CBE909009090B00AD0E0BC9B0B00A09A9009A0BE0ABC9A9F0F0F0D0BDBDBCB09B09A9A090900909B99BF9FBDA9DB0909E0000D009C90ADB0FDFFFFFDAD909E090900F0000C00C0090000090F090E90D0F0C000009A00DA90900000009A9CB0F0B0000A0A0A0A00A90A9A00AF009A9A00A0A00000BC0AAD0A9AA0B0F0BFBFB9F0090909B000000009AD09EBDBDA0090FFF00C0000A009009FBFFFFFFFFA000900C0090BC000000000000000009E09EB0F09A00000009A90000000009009EBC90F0A9A00090000A90EB0009E90FA0009A0090A9A000B09A0BCBD9BCB0F9E9FF9B90B09F00F090900909B9999EBD90009BFFE0000AC9E009009F9FFFFFFDFDA009A90000EF0A00000000000009A09F09CB0F0D00000090C0F00F0000000BC90BF0AD0000B0A0B090A900E9A0A0F00B0A00B0A00009A00E0CB0B0AACB0BCBFBF9EBF9090099090000009090BCB9FBE900009C09E0000009009BE9FFFFFFFF09090C000B09000C0000000000009A9CA0BCB0CBCA000000009A0090000090909AFC0E9A0A0B000000A00A0B00090009A0A09A000B00A0090B0B0A0CB990DADBDBFFBD90F099A009A909090B0BDB09FF9D0B0000000000009000BC9FFBFFFFF0F0C00B0090000000000000009009C0CB09DA9CB09000000009A0900900000009AFCB090009000A9A0A09A0900B0A0BFA909A009A00A900A0A0CA00B00EABADBAFDBF9FA9090009A090000090D90BDB9FFA90FF0000000090009F9BF9FFFFFFFF0B0B009C009E900000000000000A9A9CBCACA9CAC0000000009C090A000090B0F9000A0A0A0A000909A000A0A000009E0A09A0A0B00A09009A90F00B090CB09DBBFFF9FB09B090900B090909A99090B9FDF909E9C00090090000FD0F9FFFFFDFE9C00909A0000F09000090900A90C9A90B99CB90B000000000B0000900000090AF00C90900909A0A0A0A9A0090A9A0F0B00A009000B00A0A000A00A00A9A9AFADFF9FBF9F09000090090000B90F9F09FFBEDA909A909000009BDBEBFFFFFDFEBD0B09E0A9C09000E09E000009C0E9AC0F0CABCAD00000000000DAD900000900BD000A0A0A9A0A0000090009A0A00000B00A09A0A0B00A00900B00B09A9A9AD09FFBFFFDB09090900090A9099090B0B9F9F9BFDAD00AC0909BADBCBDF9F9FFFBD0BC0090D090000909009A909E9A90D9B0CB9C09A000000000009A9E00009A0BC0000909A9000009A9A0A00A00090A0F0A09A09A9A0A909A0A00B00A0A00E90B0BFF9FBFFB90B000900990000B099D90BFFFDEBFBFF99BCB0D9E9F9BCBFFFBFCFAD0F0000A0F0BC00A900CADA90D0F0AC0BCA9F0C0000000000009F0000000D09A09A0A000A0A9A000000A900B0A000AD0A00A000F0CAA0009A00A0909A90BE9F9FFFFFBDFA909900000A99909B0B0B99B9FBDF9F9FEF0BDA9E90BC9BDADFF9F9DA90F009000009A9CADB9CBCAD0B0D9AD09E00B00000000000000000000900BC0009A9A0B09000A0A0A90A00000A009A90B09A9A0BA9CBA9A0A90BCA00A009AB0FFBF9FFBD9B009090090A090D099C0BDFBDBDE9E9909009009F09E9ADBFCFFBE9F090F0090000009000E9E9DAF0F0AD0BC9DAC000000000000000000000A90B00CA00CB00AE0B090D00A09A0B009AF0A000A00ADAD0A000009CA0A09A9A9EBC9FBDFFFBF0BC9B00009099909A9B09BDA99CB09A9000009009A09F9BDFBDBFBC9FCBEF090009000000909009A09C9AD0BCB0A0900000000000000000009090BC00B0B0B0CA90900A0A0A90A00000A0AD0A0A0A90A0AE9A9A9A0A909A0000A90BBEFFBFBDFF9B909000000BC90990B9099EB90B09CBC9CBC9E9DBDADF0BDFFFDFE9BD99CBCB00090090A000B0D0F0BCBC0BC0DA000000000000900000000B0F00CB0C0A00B0A0A0A0B0BC0AC9A0A0009AB09090A0909A0CA009A0A0A9E0B09AF0DBFFFFFBFFDAD0B90000909A9A99CB9AD9CBC9CB09A990BF9A9ADB0FFDAFDAF9FCBEFADADCB0F0DA09C900C9A90F0F0BD0B00D00000000000000090009009AD0A0B0B0F00E90DA90000B00A00C9ADABC0A0A0A9A0A00B09A0A0F0BC00B0AC00BA9FBFDBDFBF9B90D090000B909CB9099BFB9B090F9C9AFDAFDFF9FF9EBFDBFDFBBDBDFBDBBDF0FADBE0E9F0ADFE9F0F0AD0DA0000000000000000000900F0F0AD0A00A00B0A0A0ACB0E0A90B0B00A0F0A900B000B00B0AA0F09000A0B0C0B0F09FFDFBFFBFDF0A9A0000099C09B90B0FADBCF0BF9E9BFDBF9F9BCF9F9F9BDFF0FCFDE9DEFCF0FAD9E9F9BCBDF09F0F09DA0B00000000000000000000009090000A90B09A009A090B0A9A9CA0A00A900B00A00A9A0A00A0900A0A9A9A0A9A0A0BE9FAFFDBCBFBD909909A009B900BD9999BDB9D99F9F0DBFDFBCFF9EFFDEFF0FFDBFBFEBF9F9F9DEBDF0FCBE90FE0F0BCAD0C0000000000000000000090ADAD00B0CA0CA09A000A0000000A0900B0CAF0B00B00A090B09A0AB000A00900A900909A9FBFBFBF9EBF0BC909000099B0B0B0D9BDABCB0F9B0F9E9FBDBF9F0F9DBF9FBCFDBDF0FEDAF0DEBCF9FDFFF9F9E9E9B0B000000000000000000000A90B000A0B09A90A00A900A00B0A09ACB0CA90BE00A0A90B0A0A00B000B000A0A00A0A0A0DADFFFDF9FFDBD09A009A99AC0999DB0BCBD9B9F9C9F9FBDBDBCBF9FBFADFADEBDADADFDBFDBFB9DBFCBE9E9E9E9E9C0D000000000000000000009009AF09AD000A00A9A900A909A0090A0A00B00AD09A0900A0A9A90B009A000B0090B009A09A9BFBDBABDBBF9A9090099E99BDA9A9099B0BCBCB9BF9E9FAFDBFCBDAD9F9DFBDBFFFBFBEDBCFCFEFCBE9F9E9E9E9CA9A0000000000000000000000DAD00E00B0A90A90CA0A0A0A00A0A0090A0A90BA000A0B09A000A00A000A0000A000A090A0BC9FFFFDBFDEBDB0090009A9099F9B09E9F99BF9E90F9BDDB9E9BCBDAF9EBC9FCBDBDEDFADBDBF9DBFDADE9F0F9CB9C00000000000000000000009A90F009A000A00A0B0009000A9000B0A9090A0CBA90000A09A0B0B09A09000A00A090A00090BCBFF9E9BF9FBFF909A099F9A9A9D09090F090B9F9BCFB9FF9FDBDBDAF9FBEB9FEDBFBDFFEBCFEBCBDFBDADBCBACA90000000000000000000000A9E9E9AC9A900B0000A9A0A9000A90000A0A000BC9A0A9000A09A00A000A0A900900A000B00A09BDBFFFDBFBDBDAD09000B0DB9FB9A9099BDBD09ADB9EF0BDBADADF9DADF9FEF9FCFDFADBDBDBDFBE9EADBCBC99C00000000000000000000090D09A000B000A000B0A000090A9A00A9A00009A0F0A0000A0A90A00B00A00000A0A0B00B000B099EFFFBDABFDAFB99A90099FB0DB0090B0F09A9BBDB9F9BDBCBDF9F0BFFF9EDF9EFBFAFDFDEDAFE9EDBDDBCBC9E0A00000000000000000000000A0BC9CB00A0000A0090A9A0A0000A00009A0A009B00B00090A90B00A90B0A00000000000A000A09A9FFBFCBFF0FFADA99A09DBA9F900099F9DAD09E9E9CBDBDA9E9FF0F0FFBFF9FDFDBFAFBFDBDF9EDABCBC9A9C0000000000000000000000909F0BA00A09A9A09A0A000900B0A090A0A000000E9A000A0000A00A90A00090A090A0A0A09A09000DBFDFBFDBDF9FDBDAD9E0BDDB9F9900B0B99B9F99BF9BCB9F9BDADBDF9FCBFFBEBFCFDFDAFCBEF9FDE9E9EDA909000000000000000000000A09FC0B00A000000090A0A0A0009A00900A0B0A0BF0B0A00A0000B0A09A0A0000A0090090000A0B9A0BFFFFBFFBE9FFADAB990BA9EB0B0909DAF0B0FBC9DA9BCBCFBDBCBBCFBDE9FDFDBDBCBF9FDDBE9E9F9E9AC0A000000000000000000000909E90BCA900A0A0A0A0090000A0000A0A9000000E000090090A9A0009A0900A0000A00A0A0A00900C9FFBDBCBFFDBFBDBD09E9BDFB9D090B9A999CB909BA9FCBDBBCBCFBCFBDFBFCBFAFFEFFCFFEBE9F9F0E9AD0D000000000000000000909AC9EBCA00000A900900000A00B0000A090000B0A9AB9A0A0A0A00000B0A0A0A00B0A00000000900A0B000FFFFFFBFFF0FBCBDB9E9B9F9A909CBD9E9BDA9E9D0B9F9EDBDBFDFBDAFCFBDFF9F9F9F0F9FDEFADF9EDA0A90000000000000000000090A900C0B0B00000A000B0000000A09A0A9A000000CB09000000A0B00009000900009A0B00B00A09009A90BFBDBDBFFFDF9ABCB9E9E9F9E9A90BA909AD99A9F0F0F9BCBDAF9EFDBFDEBDCFEF0FFF9E9F9CFADA9ED90C00000000000000000000090BC0B0000A00A000A0000A00A900000000B00A00BCA0A090A00000A0B0A9A0A00000000000A00A09AC0BDFFFEBDADBFAFDF9F0F9FBCB9099BD9F0990BE9F0BD9BCBDBE9FEBDAFDBFDFBF9FFDADEFF0FF9FADE9ACB00900000000000000909A00BCA000A0A09A00A0900A0900000A0A9A0A00A900DA9000A09009A09000000000A0A00A0A0009000A0900BF9FBDBFBFFFDA99A9B0F9F9E90BCBE90F0BC990BD0BE9F0F9FDBDFF9FE9FAFDFCFADFBD0FF0F0DF0BC900000000000000000000009DA9009A9090A090000A0000A0A0A000009000000AB0A0A000A0A00A0A0A9A0A9009000900B0A0A9009AD00FFFFFCBDBDFBFEFDADB0FBF9AC9B99A99099A0F90BD9E9F9EF0FF0FE9FEDFDAFBDF0FCBFA9FCBF0BCB000000000000000009009C90AD0CA00A0A0000A9A0000A00000090A0A0A9A0A00CF090B0000000009000090A0A00A0A00000000A0000A90BDBFF9EBBCF9FBFDADB9DAF99ADAD9A09E9990BD0ADB9CF9BF0FF9FF9FBEFDFCBFF9FCFDE9FCBCDAC9E90000000000000000A00A90A909E9000B0A00000A090A9A0B0A090000009000B00A000A900A9A0A0B0A000000A9000B0A9A0009A9AD00BFF9FF9FDBFFF0FBDBCBBDBE909B9AD0B9A0C900B9ADAB9EDFF9CF0FEFDBDADBFCBCBF9EBEDBDBAD9A0000000000009000009009CBC0AA0A0B00090A0A090A000000000A0B0A0A0A0ACB0000A00A00000000000A90A000A9A000009A00000009E9FBEBFCBF0F9FDADAFBCBF990F9E90909C9B0E9D0DB9CFB0F9EFBFB9DBEFFBFCBDFF9EFD9F0E0D0AC90090000000000900900B0B09AC909A00A00A90D0A0009A0B0A9A0A009A00000BCA9A09000B000A90A0B000009A0000A0A9A00A0A9A9C09BDFDF9FA9FAFBFFBDBDBD0FA90B99F0B0000990A9B0FB0DF0FBDCFCFADF9EDBFFEBCFBDAF0F9DAC9000000000009000090A09C0DAC90A0A0F00B00A0A00A0A00000000909A000B0B0B00000A0A000A90A000000A00009A0909000A090000A900EBFBFFBDB9DBCBDFADAFB9FDAF9E900DB09000900C90DB0BF0FBF9BDFA9F9FCBDDF9EDBDADACB9B0F000000000000900090CA9A09A0D0BC00A00A90B0A9090A9A0B0A0A0A0A9A0000CB0A0000900A00000B0A0B00A0A000A0A0A900A0A0900A09CBFDADFCFBC9FAFDBF9FF0BC9A9A9F0000A90009B0DADBC9F9CBCFADFDEFAFDEBFEDBCF9E9F0C00009000000000000B00090009E0CA00A9A90A0A0A00E0A00000009000090000A0AB0000A000A9000A9A000000900000A0009000B0090A0A900BFFFBFBFA99EBDBFE9FE9BFDBDAD90009090009B00B0909EBCFADBDADAF9F9EBDADBEDBCBD0A9090000000000909A900A90A9DA90B00B0000A09009CB009A0A0B0A0A0B0A0A0B090CB00009A0000A900000B0A0A000B000B0A0A0000A00900F909FFFDFBDEF9CBCBDF9BFDB9EB900A9000090000D090CBC9CB9DBCBDBD0F0F9EFDEF9F0F0AC9CA09000000900A000009C09C0A9E00B00A9A090A0A0A09A0009000900000009000A0BC0A000000A00A0A0B0009000A000B00000900A000A09A00E0BDFBCBF9FAF9BFAFFDBFEF9CFBC9009000000B000B09A99CACADADAF9FDAD9A9F0F0F0D90A9000000000009009C90A90A909E9CACB00A0A00009A0A00A9A0A0A0A9A0A0A0A00009A900A000B000009000A00A0900A000A0B0A0A90A900A09A909AFFFDBFFDBE9FDBCBE9F9EB909A9C0009000090000000E9999ADAD0F0ADAFDE9F0F0F0AC9009000000000009A00B00090BCBCA900A00090A9A00900B000090000000900009A0AE000000A0000A9A0A0A90A00A00000A900000000000A09A0090FDFFBEBDAFDFCBFFF9FBFBD0F090A009000090090909090ACAC909A9ADBC90B9E9F00909000000009090909009B0D0F0F0F09000A909A0A00000A0A000A0A0A0B0A00A00A009090A0A09000A000000000009000B0A900A0A0B0A0A000000B0E00BBDFFDBDBFBFFDBFFFCBDAB0BC09000000000000000009090BCBC9C9009E9C090090E00000000000000ACA9E0C0A90B0F0BC0A900A0000000B00900A0900090009A00A9000A0E90000A00009A0A9A9A0A0A0A0000A000900000900B00A0090B0CBFBDFEBDEDBEBF0FBFFFDF90B00B009000900000000000090000A00F009A9E0F0E90900000000000B090909B090F0F90000000A00A9A09A00A0A090A00B0A0A00009000A000BCA90000A9A000000000900090A0000B0A0B0A0A0A00A90A000090FFFBDFBFBDFFDFFFF9FBE9E909000000000000000000000090909000900090009000000000000900C0BCB009E90900F0F000A9000000A0000900A000A000900A0A0A0A09A0CB00A0A000000B0A0A0A0A0A0A090A0000000090000000000A9A0F9FBFFBCBCF9FFF9F0FFF9F99E00909A0000900000000000000000090009000900000000000090A099B090C9E90BCAF0900A0000A00A0000A0A0A090B00B0A0A90000000000B0000090000A000090900009000A09A0A0B00A0A0B0A000A9009000FFDFFFFFBE9BFFFFBCBFBCB09000090000000000000000000000000000000000000000000009C9A0000A9A9AD0BD9AC00900A09000000090009A0A0A0000900A9A009A0A0CBA0A00A0A09A0B0A0A0A0A0A900A009000A900000090A900A0A0909AFBDFBDFFEDAFFFFFFDFBCBCB00000000000000000000000000000000000000000000000000009E9C9C9C09AD0AC0B000A0000A09A0B0A0A0A09009A0B0A000009A00090BC090000900000000009090000E900A0A0000A09A000A00A00009A0E9FFFBFFBDBDBDBFFDBEBDB909C90090000000000000000000000000000000000000000090A9A9090BA9AB9E9EBDA9C0A0090A00000000009000A0A0000000B0A0A00A0A0C90A00A00A0A00A0B0A0A0A90A9A0B0009A0A00A00A00000090A00090FBDFDBFFFFCBCBFFFDFFBCBCA000009009000000000000000000000000000000000009A09C90F0BC9DADCB0900C0B0000A09000A0000A00A0B00900B0A9A00000009000BA00A90A0000090009C0000A00000CA9A0000900090A0A9A0A000B0A90FAFFFCBFFBFFDBFFBF0F9B090900000000000000000000000000000000000000000000F0B0F0F9BEBDBB0F0F0B0000B0000A000A0A09000000A0A0000000B0A9A0A0A0CB0000090A09A0A00A0B0B00A9A0B0000A9A0A0A0A090000000B0009A09FBFBFDADFFBEFDFFFFBC9F000A900000000000000000000000000000000000000090090DA9BCF9F0FC9E9F0C09EB0000A00A900000A0A90A00000A9A0A00000000000BC0B0A0A00000009A0000009000000A0F0000009000A0A0A9A000A000BC0FDFFBFBFDFFBFFF9FFBF09F090090900000000000000000000000000000000009E90F0BDFEB9E9F0BE9BCAB9E9CA0A900000A09000000009A00B000900B0A0A9A090CB00000009A0A90AC9A0A0A0A00A9A9000A0B0A0A0B00900000A090A900B9AFFFDEDBFFFFFFFF0FCBF000000000000000000000000000000000000000000000F0F0FA99EDBE9F9FC0BDCF0A9000A9A0000A0A000A0A009A00A0A0A00090000A0B0A00A90A0000A09A09009000A9000A9A090090000000A0A0A900A00A0B0E9AFFFFBE9FFFBFFFFDBC9AD09000000000000000000000000000000000000900BDA9DFBDEFFADF9EF0BD0FA0F0A9A00000A000009A00000A0000090090A0A00A000E90B00A00A0900A00A0A0A00900A00000A0A0A0A9A0B0009000A000000090990BFFDFBC9EFDFFFBEBDB0F0A9000909000000000000000000000000000000000FABCFB9F9FAFF9EDAFF0F000000A00A009A000000A09000A0A00A0A0900A009A09E000000900A0090B009000A0A009A0A9009009000000A00A0A90A9A09A0A0E0DBFFFCBF9FBFFFFDFADB09C0090000000000000000000000000000000090DBC9DFBDEFEFFDF0FFBFDA00A9A00090090A000A0A00900A000090A0000A0090A000E90A0B0A0A000A0A000A0A00009A00900A0A0A0A0A0A090A090000000000090B0BDBFFFCBCFFFFFFBFDADE9A900000000000000000000000009009000900B0BFEBCBFF9F9EBFF9EDE0CB0009A00A0A000000000A00A00B00A0900A0000A090A09A000000000A90000B00000B0A00000A0090090000900A090A0A0A000A090A90F0FE9FBFDFADBFFEDEBF9BC9CA90900000000000000000000000009000BC0FCBDFFF0FFEFFDADEFAFB0000A00A000000A0A9A000000000A000A009A0B00A0000E9A9A0A00A00A0B0000A0900000A9009A0A0A0A0B0A000A00000900B000A00A09A9BFEDEF9FFCBDFBDFCF0B09000000000000000000000000009A00A000B0BDEBCBFF9FF9EFFF090C0F0B000000A00A9000000B0A09A0009A00B00000000A0A0BC00009000900000BCA90A000B000A00000900900000B000A9A0A00000A00000A09CA9FBFFE9FFFFFFBF9FCBCBC90000000000000900000900900909090DADABDBFDFEF9FFDA09E0BA0000A9A00090000A00000000000A0000000A000A090000CB00A0A0B0A00A0A0000000A000B000A09A0A0A0A09A000B000000A0A9009A0B09A09FFDFFFFE9EFFEDEFA9F009A000900000000000090000DA0D000000AD0BDEF9EBF9EF9A0DA09C90A0A0009A00A0A000A00A00A0A0900A0A0000B000A09A0B0A09000000A90909A0A0A09A0000A90A00009009A000A000A0A00900A0A0000000B000BFFFFFF9F9FF9FDF0DB0DA9000009090900000009A09A0A9E9E9D0FCBDAFDF0F9E0FA000A0A009000A00A00000A90A0000090A0A0090A9A000B000000F09A0A9A0000A0A0009000000B0A000000A9A0A0000A90B090090A000000A00A0A000B0009F9FFEFFFFFFBEFADE99CB0B09C0000A9090F009F090D0009AEB9F0BDAFBFCBF90F09E9A90A0A9000000A09000000A9A000000A000000A0000A0A009E0000000B000009A0A0B0A000009A0A9A000000A9A00A00A0A0A00A90090000000A90000BCFFFFFFFFFFDF9FB9ACB0D0DA0B09090E0909A90F0F0BDAC99CFADFEDBCBF0CAC00A0000A0000A0B00900A000A090000A000000A0A0090A0009000E90A90A0A00A0B0AC0000090A0A0A0000000A9A00009A09A009000000A0A09A09A0000A900FBFFDFFFBEFFFFEDEDFBDA9A090D0ADA99F0BDEF0F0BCABDBEFADFA9BCBCBCB090090B0A900A00000A0A000A000A00A000B00B000900A000A00A0A9A90A00900090000B0B0A0A0090900B0A0B00009A0A00CA0B0A009A0000000000090A90000009FBEFFDFFFFFFFFBDBEDBD9E9AF99CBE9FCBB9F9FDBDDAFDBCBCFDE9E9E9E000A0A0000B000B0A000000009A000009A00A000000A000A09A0000E0A00B0A0A0A0A9000009000A0A0A000900A0A00090A90000000A00A9A00A00A00A0000A90A000FBDFFFFAFFFFFFEDBEBFADF9FEB9DB0BDFCF0F0BFAFDAFDBDBE0BCBDAC9E00900B0A000A00009A00A0B000000A00000000A0A00A0090000A00DBC9A0009000900A9A0A0A9A000090A0A000900A0A090A9ADA9A0000000900000A00A0A900900009EBFFFFFFDBFFFFFDFCFBEFE9FEBCFFAFBFFFFFCF9AFDAFEDBFCBCA09A00B0A00090A900A000009000000A0A90A00A0A009000900A0A00900A00AC0B0A0A0A0ADA09000009A9A0A9000B0A0A90000A00000000B000A0A09A0000090000A00000009FFFFFFEFFFFFBFFFBFDBDBDBDBF9FFDFF9E9FBEFDAFF90FCB0F0DAC0000090A0A000B00A0A0A00A0A000000009009000A00A0A00000A0ADB00B000009009000CA0A9A0A0090009A0000900A0B00B0A0B0A000A09000000A90A000A0090A0000009FDFFFFFFCFFCBDFFFFFEFEFFFFFFBEFFFFEDBDADBCFF0BC0000000B0A0A00000A0009000000000009000A0A0A000A00B0000009A0000ACB00A0A0A0A0A0B0B090AC90A0A90A000A00A00900A0009000D0A000A00A00900000A9000A0000000000AF9FFFFFFFFFFFFFFF9F9FFFFFFFDBF9FFFEFFEFF0E0CBC0000B0009000A9009A00A0A90A0B009A0A00000000A000000A009A000A00F90A090900000900000A009A09000A00B009A09A0A009A00A0A0A90A000900A00A0000000A00B00A00000900F9FFFFFFFFE9F0FFFFFFFADFBFFEFFFFDFFF0BF9F000A0A900A0A0A900A0000A000000000A00000B0090A000B0A0009A000A0900A0E900A0A9A90A0A0B0090A000A0A90A000A00A0009A000A090900A900A0A000000A000A090000909090000F0BC9BFFFFFFFFFFFFFFFDFFFFFFFFFDEBFC09E0E0CB009000A9000000A00A09000A0A00A00000A0000A0090A00900A000A090A0AF90CA000000A000900A0A009A9090A900A0000090A000A0900A0A000A900090A00090A00A000A0A0A009A0000CBFCBCBF9FFFFFFFFFFFFFFCFFDFEA9F0F009FDB00F0A0A900A9A0A00090A0A0090000000A09000A0000A000A0A900A900A0000CAB00B09A0000B00A0900B000E0A00A009A9A0A0000A90A0A000CB0000A00A000B00009000A090000A0000B0090AD0FCFFFFFDEDFFFFFBDBFFFE9FDE0FCA00BEDF000000A00000900B0A0000A0A00B00A900A000000A000A9000A000A0000A90BD0A000A09A9A00B09A0A00B09ADA909A0000900A900000009A9A0A9A0000000A00A00A000000A09000A9000B0AD0B0B0BCA0FBFFFEF0FEFCBC9E00BCB09CBCBFADA9A9000B0A0A0A0000B0090000000000000A09A090A000A9A00B000B0A00AC0A090A00A0000B00A0C90B0FADA9E0A000A00A000A0A0B0A0000000009A00A000000000A90A000A0B000A0A0090AC900CBDFBCB00909E90BCBC00BC9E0EB0BDADA0000A0A009000000B000A0A0A00A00A0A000000000090AD009A000A0009A0BB00A09A900E9ACBE9A9AF0F9FFFF09C0B09A009A00900009A0A9ADA0A00009000B0A9A000000B00000A009000A090ACB0000000000000000000F000A9090ACBDA9A0A00900A0A9A9A00A9E90000000000000B00A000A00A9A0BE0BE9000A000CF090A00A090A9BDBCB0DBFFFFFFFFA9A0AC09A000A0A0A00090E00090A00A00A000000B0A0A000B00090A00B00A0A90000000000000000000A00BCB0A0A09A0AC0009A0A090000000B00A9EB0B0A90A9009000000A009A00F00BDCBE9E90A909A0A090E90A09ADBFF0FFFFFFFFFFFCF09CB0A00A9000900A0A009A0A090A00A00A0A000009000A00A0A000A0090090A9A9A0000000A0900B09CB00009009A090B0B000000A09A0A0000B0F9F00000A00A0A00A000000A0DA0BFCBFF0F0A000AE9E900A90A09ADFFFCBDBFFFFFFFFFFA9EBA0DA900A9A0A900090A09C00A0900900900A000A0A0000000000000A00A0000000A0B090000A0000A0A0B0A0A0000A0000A00A000A0090A9ADFBF0E0A0000000000000A90A09ABDFCBFFDFFADA9A0B000A90A09CA9ABDFBF0FBFFFFFFFFBDF9FDFA00A000000A0B0A000A0B000A0A0A00A900B0000B009A00A9A0A00A00A9A00A090000A0B009ADA909000009A0B00B0A000900B0000A0009A9FCB0900A00A0000A90000090AC9EBFFFFFFDF0E000DBA90A90A0B00DAFBCBBEDFBFBFFFDFBFFFFFDAD0A90A90000009A9000A9000000A000A00A00000A00090000900009000A90A0A0A0000A0A000A0A0A0A00000A00000B0A0000A9000A0A9E9BCA000000000A0000A00A009AB9E9FDFFFFFF9F00BC00A9E9CB00B09F0F0C9BFDE9FBEBFDFFFF9E9A000A00A9A0B0A00A0B0E0B0A9009A000000B000000A00000A009A0A09000000909A0F0909A900090090A00009A0B00000A0000A09000DADA090A09A00A90000A00000A000E9FFFFFFFF0E0A0CA9E90B0B00B0BF0F0DBBE9A9B0F9F9FBFFFEDA00B090B00000000B09000000000A0000A9A000A00A000A0A000A00000A0A0B00A0A0900A0A00A00A00A000A9A0000000B009A0A00A0A9A0B0F0A000090000A000000A0900F9FFFFFFFBCE9090B9A9AF0F09AC9E9FFBEF0DADADF9EB0BDFFDBADA00A0ACA0A0B0B000A0A0B0A0A0000B00000000900900009000000A900000000000A0A00000009000000B0000A0A00A000A00009000009FFF9F000A00A00000A09A000A0B0ABFDFFFEDB0A0A0CF090A90E09A9BFFFF9FFBDBFBFBDADA0BBEDB009A909090900C0BCBC0900009009A000A00A0A0A000A0B000A90A00A0A9000A0B09090B0B00A0A0A0B0000A00090A90A0000A00A0A9A0A9FFE9E9000000A0000000090000BC9BFFFFDAC90000BA9AF9EB90A0FFFFFFFF0FADFDFFCB0BDFDBF0E9A00A0A0A0ADABCB0A9A0B0A0A0A00A09009000000A00000A00A0900000A0B0000A0A00000A90000000A0A90A000000090A0090000009BFFFFF0A00A00000A90A00A0A0A90BEDFEFDA0B0A9A09DAF90B0CA9FBFFFFFDA9F9FBFFDBE9FBFFFFCB000A9E9C9ADABDFBE9E0000900000900A0A00A00A00000A0000000A00A000000A000000A000000A90A09000090A00A00A09000A00A00BEDF9F00000900A90000000000090EBDBF9FA0F000000EB09EBCB09A9FFFFFFFF0A9FFFFFF9FFFFFFFBC0B090BABE9BDFFFDF090B0A0A0B0A0A0000009009009A00B00A9A0000900B0A90A900B00B0A0A00A00A0A0A0A00A09A00A00A00B00B009BBE00A9A000000A00A09A009A0A90EBCF0DA0A0A0009EB90B9E0A9ADFFFFF0DBCA9FFFFFFFFFFFFDFBC00AC9DBDFFFFFFFEFA0009000000090A90A00A00A0000000000009A00A00000000A0000009009000900909000900009000900000000A0C09A900000A00000000000A0090A900B0A0909090A0F90E9E09A9CBBFFFFBFA09BFFFFFFFFFFFFFFF0B0B0BBFFFFFFFFFFF9CB0A0A9A0B0A0A00A00A00A00A00A00A00A0A00A00A00A00A00A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0B09A9A00A00A000A00A00A00A00A0A9A0B0A9A0A0A0A00B0A9A09A00B9FFFFFF000B0FFFFFFFFFFFFFFF9E00BDFFFFFFFFFFFF0A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A000000000000000000000000000000000000000000000000000000000000000010500000000000082AD05FE, 'Education includes a BA in psychology from Colorado State University in 1970. She also completed \"The Art of the Cold Call.\" Nancy is a member of Toastmasters International.', '2'); +INSERT INTO employees VALUES ('2', 'Fuller', 'Andrew', 'Vice President, Sales', 'Dr.', '1952-02-19 00:00:00', '1992-08-14 00:00:00', '908 W. Capital Way', 'Tacoma', 'WA', '98401', 'USA', '(206) 555-9482', '3457', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E506963747572650001050000020000000700000050427275736800000000000000000020540000424D16540000000000007600000028000000C0000000DF0000000100040000000000A0530000CE0E0000D80E0000000000000000000000000000000080000080000000808000800000008000800080800000C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00F00000000000000000000000000000000000000000000000000000000000000000000000000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE000000C00BFE000000A9000FFFFFFFFFFCFFFFFFFC009FFC00000000000000000000000000000000000F0000000000000000000000000000000000000000000000000000000000000000000000000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDB09F00000000FCBFFE9E0BFFFFFFFFFF0FFFFFFC09FFFE0000000000000000000900000000000000000F000000000000000000000000000000000000000000000000000000000000000000000000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE000009009F09FFC0BFFFFFFFFFF0FFFFFFFFEFFFC00000000000000000000000000000000000000F000000000000000000000000000000000000000000000000000000000000000000000000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0F0B00000FF0000000BFFFFFFFFFFFDFFFFFF0F9FE0000000000000000000000000000000900000000F00000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE09FFFC0A9F0000FC00BFFFFFFFFFFFEBFFFFCFFEFC00000000000000000000900000090000000000000F0000000000000000000000000000000000000000000000000000000000000000000000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF009CBE09C00000000BFFFFFFFFFFFFFDFFFCBFC90000000000000000000000000000000000000000000F0000000000000000000000000000000000000000000000000000000000000000000000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0009FF0BFA9F0A9BFFFFFFFFFFFFFEFFFFFFC000000000000000009000000000000000000000000000F000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF009FCBC0DFFFFDFFFFFFFFFFFFFFFF9F0FC000000000000000000C0000000000000000000000000000F000000000000000000000000000000000000000000000000000000000000000000000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00AF0000000000BFFFFFFFFFFFFFFFEFE0000000000000000000D000000000000000000000000000000F00000000000000000000000000000000000000000000000000000000000000000000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9FC00BF0090BFFFFFFFFFFFFFFFFDFC00000000000000000C00000000000000000000000000000000F0000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD09EBFC9ADAFFFFFFFFFFFFFFFFFFFE000000000000000000000000000000000000000000000000000F000000000000000000000000000000000000000000000000000000000000000000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000009FFFFFFFFFFFFFFFFFFFC00000000000000009C0000000000000000000000000000000000F000000000000000000000000000000000000000000000000000000000000000000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0BFDBFFFFFFFFFFFFFFFFFFFFFFF00000000000000090000000000000000000000000000000000000F00000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000000000000F0000000000000000000000000000000000000000000000000000000000000000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F9FDB9FFFFFFFFFFFFFFFFFFFFFFFE00000000000000000000000000000000000000000000000000000F000000000000000000000000000000000000000000000000000000000000000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFDBFFFBFFF99FFFFFFFFFFFFFFFFFFFFFC00000009000000000000000000000000000000000000000000000F000000000000000000000000000000000000000000000000000000000000000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDBBFFF9FDFBDFFF9BFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000000000F00000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9FBFFDFBDFFBFFFBFFFF9FFFFFFFFFFFFFFFFFF0000000000000000000000000090A0009CB0DA9A9AF9E9BE900A00F0000000000000000000000000000000000000000000000000000000000000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9FFFFFFBFFBFBFDFBFFFFF9BFFFFFFFFFFFFFFFFE00000000000000009CA90A90F00C90BDA9ADA9FF9F9E9BD9B0C9C0F0000000000000000000000000000000000000000000000000000000000000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9FFFFBDFFF9FD0F9F9DFBFFFFF9FFFFFFFFFFFFFFFC0000000000000DADA99E09CB0F9BCBDAD9F9BDB0BCB9ADAFCB9A9FF000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFDFBFFBF9FFBDA9F0AD0B0A09DB9BFFFBFFFFFFFFFFFFFFE0900000009CB0B9BDA99F9BDB0F9B0B9AB0F9ADF9BDADB99BCBDA9F00000000000000000000000000000000000000000000000000000000000000BFFFFFFFFFFFFFFFFFFFFFFFFFDBFBFDBFCF0F0FDFCBDAD0D9F0BEFDFBFFFFFFFFFFFFFFFFC000000000009CBCF0BCB0F0BDB9E9F9E9DB9E9B0F0BDB0FE9B9ADBF0000000000000000000000000000000000000000000000000000000000000BFFFFFFFFFFFFFFFFFFFFFFFFDBFFFF9FF0F9FFBCB0BD0F9A9E00D090BDFBFFFFFFFFFFFFFFC0000000C0B9FB9B9BDB9F9BDA9E9B9E99A9E9ADF99F9ADB99F0F9EF0000000000000000000000000000000000000000000000000000000000009FFFFFFFFFFFFFFFFFFFFFFFBDBDBDADEADBDA9C9F9F0FBDADA9DB0F0F9E9DBFFF9FFFFFFFFFE000000B09DA9CBCF09E9A9E9F9BD0F9ADBDB9F9A9E9ADADBE9F0F9F000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFBE9FBFBE9FDBDBCBCBFBC9E9F9E0DBDA0DB09E09E9CB9FFFFFFFFFFFC00009000A9FB99B9F09F9F9B0F0B99E9ADADA9E9F9F9B9AD9A9B0FF00000000000000000000000000000000000000000000000000000000000BFFFFFFFFFFFFFFFFFDF9FDFBCDFDADA9E90B9C9CBFBCBFDBF0F9FBC9E99E9AD0FFFF9FFFFFFFE0000C0DBDB0DAD0F0BC9BCBCF9BCBC9BDB9BDB9F0B0F0F9BE9E9F9F00000000000000000000000000000000000000000000000000000000009FFFFFFFFFFFFFFFFDBBBFFB9CFB0BCB0F09FDE9FA90DB9CBD0F9E9CBF99E90F9A90BFF9FFFFFFC00000B9A9ADB9BF0BDBBCB9B9BCBDBBDA9EDA9E9B9F9F0BC9B9F9AF0000000000000000000000000000000000000000000000000000000009FFFFFFFFFFFFFF9F9BDFCB0DCB0DBC9DBDBF0A9E99FF0FCB0FB9E9FBC9EB0F09EDBCF9BF9BFFFF000909CBDBDB0F09BCB0DBDADADB9A9CBDB9B9F9E9E9A9BDBFCB0F9F9F0F0D000000000000000000000000000000000000000000000000000FFFFFFFFFFFFD9BF9FFB9FCB0BCB0DBE9E90DBDB9E09CB09AD0DBDA9DBD9C99E99E9B0F0FFFFFFFC0F0A9BCBCBCB9F0B9DB0B0F9B9E9DB9B0F0DA9F9F9F9E9A9B9DB0FF9F99BBF990C000000000000000000000000000000000000000000000FFFFFFFFFFFB0BFF0FBCDADBC9E9BCB0D09AF09E0D9F9A9F0DA9E09D0A00F0BCBDA9F0F0F0FB9FFF00009CBDB9F9BCBDF0B0F9F90FCBCB0F0F9BF9F0BCB0F9F9F9EB0F9FB0BDAFDBCF9AD09A0CBCB0000000000000000000000000000000000BFFFFFFFFF0BD9FF9F9C9ADA09F09C9CB0BFD09E99FA9AD9E9F9F99F0F9F99BD9B0FD0FF9F9E9FFFF009ADA9B0F0BCB9B0B0F9E9AF9B9B9F0B90F90B9F9BDB0BCBCB9DB0F9F0BD9A9B0F90F0DB909FF000000000000000000000000000000009FFFFFFFBC9F9EF9F0F0BC9A9DA99E9A9CBD0BFD9E90DFDA9F9BCBCBCBDBCBEDBEDF9BF99F0F9E9BFFC00009C9F9BDB9E9F9D0B9F90F9E9E9F0DB0FBCF0BCBC9F9BFC9A9FBCBDABDBC9B9EB9BADBFA9AF0000000000000000000000000000000FFFFFFE90BDADBF9E90D0BC9E90E90F0F90BD0BA9FFB9A9F9E9F9F9F9F0DBDBCB9FBE9EF0BF9E9E9FF009090B0BCB0D9BCBA9BCB0F9BCB99A9F0BD09B9F9B9BA9E99BE9A9FF909DADB0DB9DAD9BC9DBD9C00000000000000000000000000000FFFFFD09BDFB9F0BC9E9A9C9A90F9CB090BDA9F9DF09FD9FDADBCBDBDE9BFBDFBDCBD9DB9FDFFBFD9FE000E000D0B9FBADBDDADB9F0BCBDAD9F0BCBFBCB9E9E9DB9FAD9BDBF9A9FAB90DA9F0B9ADB9BE9ABC000000000000000000000000000BFFFFCB9BCFB0FD0D0A909CB09CB9CB0FDBCBDF9EBDBF0BE9BDBDBF9E9BFFD0FBDFBF0FB0DBF0FFDBE90009090B0B0DB0D9A9A99EDAD9BDA9BAB9F9B9CB9E9F9F0BCBDBADA9F9DA9D9E9B9E9BC9FA9E99F9CBC00000000000000000000000009FFFE99DADB0DF0B0BD00F0B0FA9C0B9DB0DBDA9F90F9FFFDBDBFFDFF9FDBDBF9FBFDBFF9FBCBF9FAF9FBC000AC00C9ADB0BDBDADB9B0F0BDAD9CF0BCFBDF9B0B0F9BDAD9BDAFABDABD9ADB9E9BC9F99E9AF99B0000000000000000000000000FFF99EBDBDFB09E9C00F09FC90DBDB0F0DBADBD0BFF9F99FBFFDB9B9FFBDFBDBF9F9FDBDFDBDDFFDFFAFDBF090090009A9F0BCB9ADADB9F0BDAB9BDB9F0B0FDBDB0BCB9AD0BDF9DA9DABD0BDBD0B0F9E9BD9AD0F00000000000000000000000BFF09E99ADB0DB0009A99F009BDBCB0F9A9CDBCBFDBDF0FF9BDBFDFFFF9FFBDFFDFFFBFFFBFFBA9FBF9F9FCBC009A090E9C9BDB9CB9F9CB9F909DADADA9F9F9ADADBDBF0F0BCBBDA9FA9D0BCB9AB9F9A9BCBE9BF9B0000000000000000000009FE09F9DAD9ADA0D0F0D9E09FF0F0B9F9E9DBA9DBDB9EBFDBFDFFDBF9F9FFF9FBFBF9FFDBDFF9FDFBDFFDAFBFB0000000909ADA9CBBCB0BBCBCBEB9BDB9F9E9ADB9BC9A9F9BDB9DBDA9DBAF9BCBD0DA9F0DB99E90D0F00000000000000000000FF99BCB0F0E90DA090B0A9DB09F9FDE9E9DA9DEBDADFFDBFDBFBFBFFFFFF9FFFFFDFBDFBFF9FFFF9FFBDBFDBCFF009CB00AC99FB9C9BDBC9F9B990FCB0F0F9BDB0F09BDF0BC9ADFCB9E9D90F9BDA9BDA9F0DA99EB9BCB000000000000000000BF00DB0DB9B0F0090BC9D0BCBDA9A9B9E9A9FBF9F9FB9FBDBFDFDFDFF9FFFFFFFDFFFFFDFBFFBDBFBFDBEFBFFBD9F00000900AC9FABC9ADB0BC9E9B9BDB9F0F0F9F0FA9A9F9BF9AFB9E9BEBD0BDADBCB9F0B9F0F99E9BDF00000000000000000FC0BD0F90D0D00F0D09A9F9BDADBDF0F9F9F0D0F9FBDFFDF9FFBFBFBFFFF9FF9FFBFDFFBFDFFDFFFFFFF9FDBDFBEBF0090C0909B0D9B9F90F9BF0BCBCB0F9BDB9E9BD0F9F0F09E9F9E99E990BDADB0B9E99BDADB9E99F0B0000000000000000BF0BDA99ADA0B0909A9F0F09E9FBCB9F9CBC9FBF9FBDFBDABDBFDFFDFDF9FFBFFFFFFBF9FFFFBFBFDFFDBFFBFEBFFDF0000B00A9ADBA9E9E9B0F09DBDB9F9ADA9E9BDA9BDADB9E9FDB90F9BCBCBDB0DADBCBCB990F9EA9F9F000000000000000FC0DADBC9009C9E0F9CB9F9F9F09FDADBF9FBDBDFF9EBDBFDBDBFF9FBFFFFFDF9F9FDFFFFFBFDFFFBFFBFFFDBDF9FAFF0000909C9A9DBDB9E9F9F9A9BCF0FDB9F9F0BDBCB9F0F9B0BEDB0F0B090BDB9DB0BDBDAF9A99DA9EBC9000000000000BFC09D09AD0DA0099A0BCB0F0F9F9BDF9CBF9E9F09FF9FF9FBDBDBFF9FDF9F9FFFBFFBDFBDFFFFBDFFFFFFDBFFBDFBDBDF0900C0009E9A9E99A9E9F9E9B9B0BCF0F9F9A9BDA9B0F9FF9B0F9BD0BDB0F0BDBD09AD9E9F0B9F999AC00000000000FE09A9BC90B0090F0D9DBDBDBDBFCFBB9B9C9BDBFF9FDBDBDBDBDF9BDBFBFFFF9FDBDFFBFFBDF9FFBDBFBDFFFDFFBDFFBFE00B09A9C90DB9F0DBDB0B9F0F0F9B9BDA9E9F0BDBCB9E9FB0F9BC0BCB0F9BCBDA9BF9A9B0F9E9ADADB0000000000FF0DA9F09000C9E9ADB9EB0FBDAF9BBFCFFCBBDADBDBCB9F9FDBDA9FDBF9FFDB9FFBDBFBFDBFFBFFBFFFDFFBFBFBBDBFF9FF0000000B0FBADADB0B0F9E9F9F9BCBCB9F9F0BDBCB9E9BDF99ADBD09BDBCBBDBDAD0BD0F909BDB090BD000000000FFF09C9E09E9B09F09AF99F0F9F9FDDBDB9BDFDBDFBDBDFBDADF9BDB9F9F9FBDFBDFFDBFDBDFBDBDFDBFFBFFDFFDFFF0FFBDF0000D00909DB9A9F9F0F9F9A9ADBDB0F0F09E9BFCB9BCBCF9DA9A9CBDB9D0B0BDBDABD0FBC9ADBDBCB9000000009FFC9B0900000F09F9DBE9F9FF9FABDBBCFF9BE9BC9FFBDBD9B0FDADBDBDF9FF9FBDBFDFBFBDFFFBFBFBFFFBFBFBF9FF9FFBFF090A09E9A9E9D0BCB90B0F9F9F0F9F9B9FB9E9BDBCBBFB9A9DBDA90BCB0BDBDA9BD0B9909BDB0B09F0E00000000BCA09F0C90D090F0FBC9F9F0BFDDFBFC99BEDBFDBF9D9EBFBDB9F9BDBDB9FF9FDFBDBFBDFFFBDBDFDFDF9FFFFDF9FB9FF0FDF000900009F9F0BDB9E9F9BCBCBB9E9ADA90F9F9ADBD0F9E9FADA9CBDBDBCBD0B9E9BDBE9AF9E9C9FB09000000000099F00B0B0BE9BDBC9F0BF9F0BBBDF9BFFDBDB9F9FBBF9C9F9F99FD0BDFB9FFBFFFFFDF9FBDFBFFBFBFFFF9FBFFF9FF9FBFBC0000D09E9B0BDA9E9DA9E9B9BCF99F9F9F9ADADBE9FF9B099BD0B9E9A99A9F0DBC9A99F90F9B0A9CBC0000000000CB0B000DBC9CBC9BFBFC9F9FFDDF9FF9BBFBDFBF9FD9FBF9F9FFBBDB999F9F9F9F9BFBFDBBFDBDFFFFFFFFFFBFFFFBFFFFFF009A0A09CBD0B9F9A9BDB0DADB9AF0BCB0F9BF9BDA9FEDBCBCBD09BDBCBDA9F0B9E9E90F9AD9D9B99BC900000009AD9C0DA09BF99BFDBD9FBFF9BFBBF9FFDFDBF9F9FBFBDBDB9F9FD9F9FF9F9F9DBDFD9F9FDFBFFFBDBFF9FBFDFDBFFDBBFDBFF009009A9EBD0F0F9ADADB9F9E9DBDB9E9ADB0F0BDADB90B9F9A9E9BC9A9F90BDA99BDB0BDB0BADAF09AC000000099A0909DAD0F0F9BCBFBDADFF9FDBFBDBFBDBFFF9FDFBDBFF9F9BF9F09F0F9EBDB9FF9FFBFFFBFFFFDBFFFFBFBF9FBFDFBFFF000C900999A9BDB0DBDB0F0B9FA9ADB9F9BDB9F9E9FBCB9E9A9CB9E9B9DB0BDA9FBCB09CB0F0D9F99E900000009CBC0B0F0B9F9FDADF9FDBDBF9FDBFBDBDFDFFF99BDBBDBDF9FBFFD9F9F9F9F99F9FF9BFBDBDFFBFBFFFFBDBDFF9FFFDFBDFFF000B00B0FAD0F0BCBA9ADBDBCBDBDB0F0F0F0F0F9BF99E99BDA99F9E9EB0F09F909F9E9BDB99AB9CB9F90900000B909C99BC9A9FBDBBDBF9BF9FFBFDFFFBFB9F9FFFBDFBFFBF9F9FBFDBDBDB0FF9F9FBFDFFFFBDFFDFFBDFFFF9FBDBFBFFFF9FF00000C909BB9F9BD9FDA9ADB9BDA9F9B9BDB9F0BCBE99E9E99E0B9BD9F9BDA9FB0B99E9ADAD9CBBCB0F0A90009CBCA9AC0F9FD0F0DFBFDF9FF9BDFF9F9FFDBFF9F9FBFDBDBFFFF9FBBDBDBD99BDBC9DBF9FBFFFFBFBDFFBDBFBFFFFDFFFFBFFFB09C90AD0D0F0F0B0B9F9F9E9EBDB0F0F9BCB9F9BFDBC9B9BC9BDADA9A9E99F0DBDE99BDB9B0B9CB9F9F9CB909B9090D9B9F0BBDBF9F9FBFBDFFBFBFBFBDFF9BFFF9FDBFBFDBF9FFDFBDADBC9CB9BFBDBFDFFFFBFFFBFBFFBDFDFBFFBF9FFFFBC00A0090B0B9F9E9F9E9A9E9FDB0FDBD0BCBDA9E9FB09BE9E9BDADB9F9F99EB9BF0B9ADADA0DBCB9E9A90B0C0BDA09E9ADADBDFDBDBFFBD9FFFBDBDBDFDBF9FFDB9FDBF9FDBFDBF9F9DBDBDBFB9FDBDBDFBFFBFDF9FDFDFBDFBFBFDBDFFFFF9FF009090BC9BCB09B9E9BDBDB9A9F9A9ABDBDA9F9FF9DAD9F9DA9DBC9ADBCB9CBC9BDADBDBD9A9BD0BDBDBDB90DAD009F9F9F0B9FA9DBDFBFDBDFFFFFFFBFDBDBFDBFBDFFBFFDBDFBFFFBDBDBD9FDBDBDBFDBDFFFBFFBFBDFBFFFFFFFFBFFBFFFF0000E00B0F9F9F0F9F0BCB0F9F0F9F9DBCB9F0B0FFA9A9BA9DA9BBD9A9BCB9FBDA99A9A9AD9CB9F0BCB0BCB0990DA9CB0F9FDADFBFDBDFBFFBDBFFBFDFBFBF9BFF9FB9FDBDBFBDBDBD99F9DBDBDBD9FD9BFBFFFF9FDBFFBDBDBDBFBFDFBDFBFFF0090909C9A9E9B0F9F9BDB0F9F0F0F0BBCB9FDBF09F9FC9DA9F0DA9DBCB9E90BDBC9DBD9A9B9E99F99F9900BE9A9CBDB9E9BFBFDBFFFBDF9FBFF9FFBFFFDFFBD9FBDF9FBFF9FBDB9FFFFFFFF9F9FB9BFDFFFFFBFFBFDBDFFFFFFFFFFBFFFFFBF0000AC9A9F9B9CB9E9E9ADB9EB9FB9BDFBDA9ADF9F09A9BA9FBDB9EB0B9CB9BCBCB9BE9A9CBC9BF0BF0F0F9C90C9B9CBD9FD9D9BFDB9FFBFFDFFFFFFFBDBB9DBFBDFBBFDB9F0DF9FDBFFDBDFDBF9DFFDBFFF9FFF9BDBFFFBF9FF9FFBFFFFFFFF00090909CBCBCB9F9F9BDB0F99F09E9E90BDBDBFB0DBDBC9CBDADA9DBC9BDE9F9BDAD9BDA99BF09F09B0909BCB9ACB9FAF9BFBFDBFFF9FDBFBFBFBFBDFFFDFBDF9F9FD9F0D9B9FD9BDB9F9BF9FDFBDBFFFFFE99FFFDBFBFDFFFFFFDFFFBF9FFF900C0A0B9BDA9CB9E9ADADBDBE9BF9F9BFCBCB0BCBA9ADB9B0F9BDA9F9E9B9A9E9BDAF09DAD90F09F0DBD09F00D9BCB9DBCF9FBF9F9DFBBDFFFDFFDFBFBFFBDBBF9FBF09B9D9F9BD9FDBDFDBDBF9FFDFFFFF9009F9BD9FBBFBFBFBFFFFFFFBDFE09A90C0F0BDB9E9BDB9F0B0F9F0F0BCB9BDBDBDF9DBDBCADB9FE99F0B99E9DB9F0B99FB09B0F9BDA9B0B0FB09A0DBDBBDB9E9FF9FFB9FDFBF9FBDBFFFDFBDBDFDBD9DBD9CB99BDBF9BDB9FDB9DBD9BD990000909ADBF9DFDFDFFFFBF9FFFFFBF00000909BDA9E9BCBCF0F9F9ADB9F9BDE9A9ADFA9ADADB9B9F099E9BD0F9FB0F0BDBE909E9F9BCB9F09CB9C9E9DBF0FDA9FDBF9FBFDFDBFFFFFFFFF9FFBDF9F900000909B9CBD9D99C90909090900909009DBDCBD9F9FFBFFBFDFFFFFFBFFFFF009CB0B9E9BD9ADBDB9B9F0BDB0F0BCB9BDBDAF9C9B9AD0DADBDA9ADA9AF0DB9F9AD9BDA90BCB9E90DB09F0099A9DBF9FF9BFDBF9BFBFFBDFFBDBFFFF9FBDB900B090900909009000909C9AD09099CB09F9BDBBDBFBFF9F9FFBFBF9FFFDFBFFF000000CB9E9ADBDBA9E9E9FDA9F9BDB9FCBCB9FBBC9F9B9BDB0BD09BD99BF0F0BDBBCB9DBDB9CB9E90090BF9AD9F0FDB9EDBDBDFFDBDBDFFBFFFF9FFBFDFBDA9D9BDB0D90D0909B9DBD9BD99F9F9F9DBD9F9FDBF9FDFBFBF9FFFFFFFFFBFFFBFC09A9090F9F9A9AD9F9F9B0BDA9E9ADA9B9BCBFC9BA9F0F0BDF9A9F0B0F09B9F909CB9E90B0FB9E90000FD00DABCB9BDF9BDBFBFBFDBFBFFFFFFBFFBDFBF9F9FBFDBDF9BDB9DBD9F99BD9F9F9BDBDBBDFBDFBFF9FFBFFDFFFF9F9FBFBFFFF9FFB00C0A0F0B0F9F9BE9A9E9FF9BDBDB9F9E9E99B9BC9CB90BDA9AD90B0DBDBFCBCBFB9E90F9DB9C9000099B09B9DB9F0F9BDBF9DBDFFBFDFBDBF9FDBDBFF9F9FBFDBF9BFDB9FBDBDBDBDFBD9DBD9F9DDBF9FBDF9FF9FF9FBDBFFFFFDFFFDBFFFFC09A9099BDF9E9BC9F9F9BCB0F0F0BCBCB9BCBFD09BBDAD0B9F90FBD9A9BC9BDB090F9F90ABC9B9F9F90E90BC9ADF9FCBFF0FFBFF9F9FBFFFFFFFBFFF9FFFFFDBFDFFDBFDF9DBDBDBDBDFFFBDFBDBFBDBFFFBFF9FFFFFFFFFF9FBFBFFBFFFFBFF00000CBCB0B9F9FA9A9ADB9F9B9BDBDB0FCB0BEBC9CB9B9CB0F909AD9E9BF0BCB9F0B0F9D9BD9FDF9F99E9CBF9A9E9BD0FBD9DBFBFF9FDBFDBDFDB9FF9FBFDBDBF9F9F9FFF9FFDBDFFFFFFFFBDFF9FFFFFFF9FFBFDBFDBFDBFDFDFBFFFF9FFBF009CB00BDBCB0F9FDBD9ADF0F0F0B0BDB9BDBF99B0B9E9CB9F9E9F9BA9F09F9B9E9BDB09A9DBFFBFFFF090A90F9F9F9BF9FBFF9FDDBFFBFBFFBFBFFF9FFFDBFF9FFFBDBF9FF9F9FFBFB9F9DBDFBDFFFBFFFFFF9FDBFFFFFBFFBFBFDFFBFFFBDFF000009B0F9F9FA9ADABDB9F9F9BDBDADADA9F0F0D9E90B9E9A99A9C9DA9FBCBCB9E90DAD9FF9DFFDBF90F9DF9E9EBDF9F9DBDFBFBBF9FDFBDF9FDF9FFBDBFDBFFB9FF9F9F9F9BF9FBDFBDBFF9FFFBFDFDBFF9FFBFF9FBFFF9F9FFFBFFFBFFFFF09A09F0F9B0FBD9F9BD9AF9E9ADAF0F9B9F0DB09AB9F9CB9F9E9DAB0BDB0DB99CB9F9B9BF9FFBDBFFDF09E9AD9B9CB9F0FBFBF9FDFFFFBDFBFFFBFFBDFFBDBDBFDF9FF9FBF9FF9FDF9FDBF9FBFBFDBFFBF9FFF9F9FFFDF9FFFFFBFFDFFFDFBFFC09C009BC9FBCBE9ADAF9E9B9F9BDB0F0F0BBDBC9DA9A9E90B9A9D9F0BDB0FA9BCB0F0D9FF9FFBDBFFF909F9AD9FBDE9F9FD9FF9BF9FFFBDBDBFDBDFBDBDBFFD9BDBDBF9DBF9FFBFFFBFDFFFDFDBDFBFDBFF9FFFFF9FBFF9FF9FFFFFFBFFBFFFF0090BC0BB0DBDBD9BD9F9F0F0F0BDB9F9F9FB09B0F9C99BDBC9F0B0BDA9F9DADB9F99FBDBF9BDF9FBF0DB0BDBC9F9BDBF9BFF9FF9FF9BDFFFF9FBFBFBFFFDBBFD9E9F9EBDBFF9FF09FFBFFDBFBFFBDBFDF9FBDBDBFFFDBFBDFBDBFBFFFFFF9FF00A009BD0FB9F9AF0BA9E9BDB9F9F0F0BCBF0DB0DB0B9BCB09B0F09DA9DB0BDB9E90FF9DBDFFF9DBFD0B0FDBCBBF9F9F9FFDB9F9FF9FFFFBDBFBDFFDFDF9FBDDBF99DBD9F9F9FF9FBDBDB9BFD9F9FFDBF9FBDFFFFDBDBFFDBFFFF9FFFBFFFFFFC090F0DA9BDEB0F9F9DF9BCB0F0F0B9FDB9DB9CBB0D9E9BDBC9F9FA9F9ADBCB0F9DB9DBDB9F9FFBDF0DBD9ADB9D0BDBFE9BBFDBF9FFBDBDFBDBDBDBFBFBF9FFBDBBFBDBF9E9FBDF9DBF9FDFDBFBF9FBDFF9FFB9FBFFBFDBFFBDFFFFFFFF9FBFFF0000B0FBCBBDF9B0FAB0F9F9BDBBCF0BCFADA9C9BA99ADB0B0B09DA9F9A9BDB0B09FBFFDBFF9FFBFB00BDB0DABDF0F99FD9FBDBF9FFBFBFDBFFFBD9FDFDBD9FBDFDF0DBDB9D9BFFF9EFBFBFDBDFFDBFBDF9FFFFDBDF9FDBDFBFBFFBFFFFFF9FFA0900909BD9A9E9F9DBDA9BCB0D9B9F9B9FBD0B9C9F0D9AD9C9F9A9F09DBCB0DBDBD99BFF9FFF9FDC9F09F0BD9A9F9FF9FBDFBFDBF9FDF9FFDBDFFFBBFBFFFBDBDB9FB0F9FBFD9F9F99DBDFBFFFBFDBDBFFBDBDBFFBFBFFFBFDFFFFFFFFFBDBFC000DADBCBF9F9F9EBDB9F0F9FBEDA9E9EF90B9E9B09BAD9A9B9E9F09FB0B9DA9BDBFFFDFFBFFFDB0B09F0BDBE9F9BF9FBDBBDDBFDFFFBFF9FFB99BDF9FF9F9F9FBDBDF9FDBDBFFF09CB0F9FFFBD9FFFFDBDFFBDF9FDFDFBDFFFFFFFFFBFFD9FF009A090BF0F0B0FB9E9CB9B9AD9B9F9F99E9C99AD9AD9B0DADA90BDB0D9F0B9FDFDBDBF9FFF9FBF09FE9F9E99F9FCBFBDBFDBBDBF9F9F9FFBDFFFFDBF9FF9F9F9F9DB99BFDBFD99F9B9DBF999FFBDBDBFFFB9FBFFFBFBDFFBFBFFBFFFFFFBFFF000090F9DB9F9F9ADBFB0F0F9BE9E9E9BF9A9EB9AD9AD0B09BDBD0BDBA9ADA9BBFFF9F9FF9FFFDBD009ADB9E9DA9F9FCBDBFDBF9FFBFFF9FFBDF9BF9DBFBFFBF9FE9DBFD9BDBF009FDB9DBFC0909BDBDBDFFFDF9F9FFFBFDFFFFFFFFFBFFFFBFD009E90ABDA9E9F9F09F9BDBC9BDB9F0FFE9099E99ADBBDBC909A9F09DBD99DFDBDBF9FFBFF909F0BDBDB0D9BE9FBDB9FBDBF9FFBDFDBDFF9FFBFF9FF9FDFBDFF99B09DBC0009DB9B9FFBDFB99F9DBF9FF9BDBBFFFBDFFFBFFFFFFFFFFFBDBDFE09A00F9DBBDB9E9BFF0BCB0BF0BCB9F9B99F9E9DADA9C90B0BF9F0BCB09A9FBF9FF9DF9FC909FB0DAD0FD9BE9F9DBFDBDBF9FF9DBFBFF9FFF9FF9FBDB9FBDFB90F9FDB09B9D9AD9FFDBDBBFFF9FBFFFFB9FFFDFDBDBF9FFFFFFFFFFFFFFFFFFF0000909AFCB0F9BCB99F9F9F9FDB9E9BFCB0B9B09BDB9AD9F090BD9BDBC9FBDFF9FFA9F9909BFDA9B9B0BAD99BFBF9BFF9FF9FBFBDF9FFFBFF9FFDFBDF9FBDFDF9FFBDBDBDBD9BFD9FFFDFF9FFFFFFDBDFB9BFBFFFFFFFDBFFFFFFBFFFBDBFFF0090E9BF9BDF9E9BCBE9BCB0FA9ADB0F9F0D0F0F09BCB9A99F9F0BC9A9A99FF9DBFFDB9DBFDBFC9CBDE9C9BE9DA9FFD9BF9FF9FDFBFFF9FFDFFFFBDFBDBBDF9BDBDBDBFFDBCBD9FBFFBFBDFF9BFFFFF9BDDFDFFF9FDBDFFFBFFFFFFFFFFF9FFF90E900D0F0B0BDBDBDBCB9F99FBDADB9FB9A99B9ADA9F0DA90B09F9ADBD9FF9FBFF99DBFFF9FF9A9DA9DBFC9FBDF9BFFF9F9BFBF9FDBFFFFBFFF9FFBDBDDBBFDB9FBDFD9BF99BF9FFFDFFBFFFFFFFF99FBBFFBDBFFFFFBFFFFFFFFFFFFFF9BFFC0909A9B9F9F9ADABF9BDA9AF9FBDBCBF90DBCBC9B9F09B9CBD9F9AD9B0BFBDBDBD9FBDFF9FFD09DA9BE999BF9F9FFDB9FBFDFFDFFBDBDBDFFF9FF9FF9FBFDF09FD9FB9FFD9FF9FFFFF9FFFFFFFFFF9FFFDF9FFFDFBF9FFFFFFFFFFFBFFBDFFBF00AC09EDADA9F9BD09E9F9F9E9CB0BDBCB90B09F0F0F0DA90B0BC9B0D9FDDBFFD9BDFBFFFDBF0B0DBD9BCBDBCBF9FBDFBDFBDBF9F9FFFFBDFFFFFFDBFF99F9F99FF99F90BF9FF9FF9FFDBFFFFBFF9FF9FFBFF9FBFFFFFFFFFFFFFFFFFFF9FDFF0909A9B9B9BDAF0BFF9BCB0F9FB9FDBFBCBDBDA99B99B09F9C99BC9BA9BFB9FFBF9BDF9FFBFF9CBBCBE9F9ADBDBF9FBDFBDFBDBFDF9F9FFF9FBDFFFF9FFBDBDB09BFDBDBDBF9FF9FBDBDFFFFFFFFB9FF9FFFFFFFFDBFFFFFFFFFFFFFFFF9FFFFA0009CADADA9DBD90BCB9F9BF0F0B0FF99090B9CBCBC0F90B9BE99AD9FFD9FFFDFFDBFFFB9FD009C999F09F9FBDFBDBF9FBFDFF9FBFFFBDBFFDFBFBDFF9FFFBD9F99BCBDBD9F99FFDBFFBFFBDBF9FFFBFFF9FFDBFFFFDFBFFFFFFFFFBFFBFFBFD09E099BDBDBA9AFFB9F0BCB0F9FDB9BDA9EB9CB09B9B90F0F099E99BDB9BDFFB9F9FDBFDFFF0BDB0FF0BF0F99FBDBFDBDFDBBDBFFDB9FFFFFFBFDFFBF9FDBD9F09FDB9F9DBF9FFDBFDBFFFFFFFF9FBFDFBFFBFFFDBFFFFFFFFFFFBFFFBDF9FFF0009A9E9A9F9F9F90F0BDB9F9E9A9FF9C99C9A99F0D0CB990BCB90F9FF9FBFFDFBDBFF9F99F090FB09F9DB9FFBDBDFBFBFBDFBD99FFFDBDF9FDBFBDFDFBFFFBDBDA9C9F9A9DBDBFDBFFFFFFFBDBFFDFBDFFFDBFFBFFFFFFFFFFFFFFFFDBFF9FF0090CB9F9E9E9F0BF9F9ADBE9BBDE9EB9A0BD9E90B9B9CB0F99ADB09BDF9FFFBDFBDFFFBFF9F0D9F9F9EBDB9F9FFBD9FDBFBDFFFBDBDFFFBFBFDFFFBF9F9FBDBDBDBB90F9F9FBDBFDBFFFFFFFFFFFBFFBF9FFFFDFFFBFFFFFFFFFFFFFBFFDBFF9A0A90F0B9F9A9FDADADB0DBCDA9BFF9C9D0B090F9E90B9D0B0D099FFF09FBFFF9F9BFDF09F09A90F9F99BCB9FBDFBF9BFDFFBDBDBFBF9BDFFDBF9FDFFBFFDFFFDBDDF99F9F9DBF9FFFFFFBFFFFF9FFDFFFF9FFBFFFFFFFFFFFFFFFFFFFDF9FF0D090F9BD0BFDF9ADB9BCBBDBBDBCBF90B0B9DADB090BD0B09DA90F9B99FBDFFFFF9FFF99F00DBDBDA90FDBDFF9F9FBDFDBDBDFFFFDBDBDFBDBFBDBBF9FD9BFBF9F9AB9FDF9FBFDFBDFFFFFFFFFFFBFBFFFFFFBFFBFFFFFFFBFFFFBFFBFFBDBFF0009B0F0FF9B0BF9ADE9BDA9CBCBDBE9CBCB0909DBC0BD0F9A9A99FDFF9FFFFBDBD9FFCB9F9A90F9BF9B9F9B9FBF9FDBFBFFFBFF9BDFBFBDBF9FFDF9F9BF9FDBF9F9DF9B9BDF9F9FBFFFFFFFBDFBDFDBFDBFFDBDFFFFFFFFFFBFFFFFF0BDBFFC09ACBDB9B9E9FD0F9B9ADBDFB9F9BD9A999ADA9A99B09A900D9D09BF9F9BFBDFFDB0BFD9F00DBDBC9FD0B9FDBDBDBFBDBDBDBDBDFFBDFDF9DFF9BFF9FFDBDBF9FBDB0BD9F9BDB9F9FBFFFF9FFF9FFBFDFBFDBFFBFDBFFBFFFFDFFFBFFC99DBFFE0909BCBCBF9ABF9E9F9A9A9F0BCBBF90E9D09C90E9DADA9B9A00BFF9FD99FFBFBFD99BF00009E9B99AD9EBBDFF9F9FDBFFBDFFBFDFBFBFFBF9FDBDBF9B9F9DBFDBDFDBCBDFBFDBDFFFFFBFF9BFF9FFBBDBFF9FFFFFFBFFFFFFBFFFFFF09BFFD090ADA9F9B0F9F0F9F0F9FF9ADB9FF0CB99A9B0BF9B0999C9C9B99FF9F9BFFBDFFFFF0F900C9BDBDF0F9BD9CFB9FBDBBFDBDBF9F9FBDBDB9F9F9FBFF9FDF9FB9F9BDB99F9F99DBFFBFFFFDF9FFF9FF9FDFDA9FDBF9FFDFFF9FFFFFFFF009DFF0F00DB9F9ADF9F9F9A9B0F90BDB0F9DB90BE9C0D9090BCB0B0BC009BF9FD0BDFF9FFBDF9F09009ADA9B9F9FBB9FD9FBDFDBFFFDFBFF9F9FDF9F9F9F9FFBFBF9DBDBC9BCB9F9FBFF99FFFBFB9FBD9F9ADA9B9F9FBDBFBFBFFFFBFFFBFBFF09BFF00A9A9F0BDB0F0F0F9E9F0FBDADBCBBCBD09B9A0F9AD09C9C99B909FFDBF99BBDF9FF9BF00000999FDDBDA9DF9BF9FDBBF9F9BBD9BDADB0B0F9EBF9F9BDBDBF9F0FBCBDF9DBDF9FFFBFFFFDBDFBFCF9BDFDB9F9FBDBDFFDBFFFFFFFFFF0099FF0D009E9FCBF9BBF9BCB09B9E9F0B9FDB00BC9C990BDA9B9A9AD0D09BF9FDBDFDFBFF0BFD00E900F99A9F09FB9FDBFFBDFBFBFDFBFDBDBDBDF9BD99DBFDBDBDFF9F99F9B9FBDB9FBDFFFFF0BFF9E9BDBDB9BDBF9F9FFBFFBFFFBFFFFFFBF090FF0009E9B9BDAF0DBFCBDBCBDFB9FDA9BC9BD9B0B0BD090DAD0909A90FFDBFD9BFBFDF9DF00900E9BCFBDB9F9FDBBFDB9F9D9FDBB9DA9F9F9F9BDB9EB099BFDBDB9F9F9BFDADBDFF9FBFFFD9FC9BD9F9BDBFFFFFFFFFBFDBFF9FFFFBFFFFC9FFBF0A9E9BCBCBD9FBF0B9B0BDAB0F0B9FFBC00B0D0D9A9F0B909CBD009BFF9F9E9FFFFDBFB0000900DB9DBCF9E9BDBDBDF9FBF9BC9FBDB9FBDBFFBDF9DBDAD9AFBFDBDBC9DBDBDBDBFF9BFFADBB9F9F9BDBDF9BDBFFFFFBFFFFFBFFFFFFFF0B9FFDC909BDBDB9FA9CBDBDAD0BDBDBDADBDB99ADB0B0F9090DA9A90B90F99FF9F99FFFB9FDAD000E09ADABDB9F9F9F9FFBF9DBDF9BF0DBDBDBFDBDFBDBF9BDBD99DBBDADB9BDBDBDBDBDFFFF90DFBDBD9FFDBFFD909A9FFFF9909F9FFFFFFFAD0BFA9E9ADADADA9FFB9E9ADB0DADADBDADF9E0990D0900F0B99C90BC090BFF99FDBBDBDF0BD00009009B9DA9F9FBDBFDBDFBF9BAF0DB9BCBDBDBDB0DBD99DBDBBF9FDBDBDE9BDBFBDBFFBFF09FBFDADBFFFFFD90BDBDFBD0000BDBFBFFFFFF00BFADA90D9BF9BDF0BDE9BDA9F9B9F9AF9BF009BCB0B0DB90D0F0BC99B0B9DF9FF99CBDF9BDA0000009DEDB9F9AD9FBDBBFBF9BD999B9E99BC9FF9FDBF9FFF9DBDDBDBDBDB99DBF9DBFBFDFF9BF9909909090000FFFF900000F9DBFFFFFBFF09E90C90DABAF9ADA9BDA9BCB9F0BCF9AD9BCDB9C09D00B09E90B0909AD09C9BFF99E9BDBF00900000000B9ADBDBDBFADBDFDBDBDBCF0D09F9FF009F9FF9F090BE9EBFBFBFBDF0BD9FBDFDBFFE9DBC09FFF00000909FFF0009090FBFDBF9FFFFF09E900A99D9DBDB9FCBDBCBCB09FB0BDBADBBCB9A0B9C9F09A9DBC909A90B099FF9BDBFDBD00090009000F9BDADBD9F9FBBFF9EDB9900000999BF0000009FFD9999909FDBDBDF9BF9FBFBDBFDA99BB09FF009FE000FC009FFF099DBBDFFBFFFD0000A9CA0BE9E9E9BDA9F9B9EB09F9E9DFADF9C09D09A90BC9CB0B0E990F9F00F9FDBDA900000000000090D0BDBDEB9F9FDB9F9BC9E9900000BFC0000090FFFFFD099F9BD0B9BDF9F9F9FFFFFD0FD9D09000090000000FBFF090BBDFBFDFFFF0ADBC9009C99BF9BDABDB0F0F9DBC9ADBA99BF0B9B0BC90F990B09D099E9090099FB9FFD0000000000009CBB9F9BDB9FDE9BFDBFF9B90A9C9C0000009FC00BFF000BDBDFDBBDFDBBFFFFFFFFFB09BFBFBDBD0C009009F9FF000BDBDFADFBFBFE09B000A90A9AF0BCB9DB0F0F90BCBBF9AD9EFBD000D0BCB90E90DB0B0B9E9AD9A009F990000000000000009CB9F0BDFBB9FF9FB99FCBD909A9DE900009000000AD99F9BF09DB9BDFF9FFBF9FFDF090D9DADBF9FFFFF9BFA90B9FBFF9F9BFFFF9000E0900D09D9BDBCBE9F9B9AF0B0D0BDAF9BFBD9A99090F99A9AD9C9C9909A9C90000009000900900909009CBDBDBD0F090BDFE9BDBEDB0DB090FFDBC009BC99BF99F09FADBDFBDFFF9FFFDBFF9E9A99DBD9FBFFBD00D09F9FC9FBFFF9FFFFF09F9E090A00A9DA9BDBCBDE99BC9BBDA99AD9BD0AD9E9CB09E9C9B0B0B0F90C900000000000B0C000000A0DBBD0F9FBFD9BDF909F9F99BBDB09CB99FFF9FFDBFFDBCB09F9F9FFBDBF9FFFFFBFF9F9BD0B090B990909BF9BF9FBFF0F9CBFFBFFBC00F0DAC90B0F0F9E9BF9A9F0DB0D0BDAD9BEF0B99A90B09F9A9B0D09C900B9B0000000000000B00009C09BC90F9BF9DBADA90BF9E90FDFCBDFBDDA909AD09AD090909F9F9BDBDBFFFFF9FFFF9FB0D0FCBDBC9EDBDBFDBFDAD9E9F9A9BFFFFFFF09FB009000D0B9CB9F0F9F0FB0DABDADBAF9F90F0DA90F090D0D0B90BCB99C0B000000000D09C0900000F0BDB9FCBFA9DBDAD9009F9F09BDFBDFBDBFD9BBD99F9F9FF099E9F9FFFDBFFFFF9FFDDFBB9909F9B9BFFDBFDBFDBFBDBFFF0DBFFFF00BC0F009E90BDABDADB9E9B0DBAD0B9AD9CBBF90B99E99FA9A9B9CB0990E9B00D0C09000000A0000909009CBDA9BD9FF9DB9A0D9E909F099ADB9FBDBFFDFBFF90B999FBDBDBF9D9FFFFF9FFBFBBC9CB9F000C9009BDBF9BD0900090009BFFFFF90F09FE000A00D0BDBCB9E9F09DBDAD9AB9FF9CBC9E90A99C909E90DA0B90D90A0000000C09009C00A009F9B9FDBFBDBFAD0D9A090F00BF0D9E99FFDB9FBD090F9CB09DA9BC9FBBF9F9FFF9FDFD9090D0AD0000000000C00900D00009FFFBFF00BF0F00909C9A9ADA9BDE9B0BCB0BDAF9DA9F0B09B90F9DA9ADA90B09D90F0AC90000000900C000009C9A9BCBDB9F9FBC9FB00090F00BD09BF0F090B0D0000F090B0C9B0DF9BFFDFFFFFFFFFFBFBE0000900900000090000ACB0A909BFBDFFFE9C09E90E00A0D0DB9FDA9BCBDBCBDA909ADFBD0BD0E909AD9009F9C9A9E99090090090000000900900B0DADBDAFCBDBD9F9DF0000909009E0990F00D9000000000C900C990909BFBDFFBFFFDBDBD990000900F0D0000909090909C9BFFFFFFF90BF09E9000900A90FA9F0F90B09B0DBCBDABFBD0B99B0F9ADB9090B0D09E9F00000000000900A00000C09F9EF9BDBFDA9FB0BD000000D009C009090A00D09F090090090A09FF99FFFBFFBDFFFFFFF099E000900000C0A000F0C09A9FFFBFFFFFAD0BF0F0BC0090BC9DA9F0FBCBCBDA9B0BD9F90BC9E0D9AD00DBCB09A9A900900000000000009C0B090B0BDB9FDBDB9F9BDFDBF90009000009E0C009C9A0C0000000000D9FF9FFF9FFDFDFBFFBDBFF9090C000009099C9FB09BBC9FFDFFFFFFD09ADF0F0009AC009BAD0B909B090BF0DADAFF0BC9A999AD9B9B090D099C90F000F0000000000000C0A0DBCB9F0B9E9F9FDBF9AD9F000009A9099A90000090900000009909BFFFDBFFFFFFBFFFDFFF9FFDB900000A09EBF009DADBFFBFF9FFFFA9E9FFF09C000900F0D9F9E9E9CBBD09A99F9BD09B0DAC9A9C0CBDA9ADA9A90000009000000900090090099F0DBDBDBFF9BD0BDBE9BD0009FEBCBCBC909000C9000909BDBFDF9FFFFFFBFFFFFFFBDBDBFFFFFBDBD9DF990BDBE99FFFFFFFBFFFD0B0BF00F0B000090B9A9A909A9C90BC9CB0BFBD0DB99BCB9B9090909090D0BC0000C0000000C0000D09ACBDBF9FDBD9FF0FBDBD9EDBF90909F9090BCBC0F000099DBDFFFBFFFFFFDBFFFDFFFFFFFFFFFFFF9FF9FFBFFFDF9F9BFFFFFBFFFFFFA9C90FF0F00D000000E9ADA9C9A90F0B0B0F0DA0B09E0990F0DBCBCBCBCB0900900000000000090000A0D00A9FE9BFFF99F9FADBF99FFF0009000090BF9B99F9FFFBFFBDFFFFFFF9FFFFFFBFFBDFFBFFF9F9FFFFFBFFFBFFFFFFFFFFFFFFFFFBDA0AFBCBCB0A00000909C90DA9C9E09C90D09BC909E99F0F09B0990909090E900000000000000000090C9B99DB99E9B90F9F9FDB09FBCBFD09E9FDBDF9BDFFBDBFFFFFFFFFFBFFFFFFDFFFFFFFFFFFF9FFFFFFDBFDFDFFFBFFFFFFFBFFFBFFFF09BD9CB0F0C00000000000000000090000000F000090000900000000000090000000090090000009000900F0BDFF9FDF9BF0F9BFDAD9F9BFF99DB9FFBDFFFFFFFBDFFFFFBDFFFF9FFFFBFFFDFFFFFBFFFFFFFBFDBFFBFFFFFFFFFFFFFFFFFFFDE00FAFD09A9000000000000000000000000000F000000000000000000000000F00000000000009000000090D0B09FB9AD9DBDF9BDBBF9FF9FFBFFF99FBDFBDF9FFFBFF9FFFFFFFFFFBFFFFFFBFFFFDFF9FDBFDBFFFFFFFFFFFFFFFFFFBFFFFFB90090BE9EDE00000000000000000000000000F0000000000000000000000009000C00000000D00000000BC09BD9FBDFD9A9FBDEDBDF9FF9F9FDBDBFFFFFBFFBFF9FFFFFFFFFFFFFF9FFFFFFFFFFDBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9CB009F0B9A9E9C000000000000000000000009E000000000000000000000000009A000000900000C000900B009AF0DB0BDFBDB9BFF9FF9FBFFBFBDFF99BDFFFDBFFDBFFFFFBFDBFFFFF9FFF9FFFBFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFBCB000BCBDEDF00000000000000000000000000E9A09000000000000000000000C0000900000000A900090C900D099DB9FDBBCBFFDBDB9BDBDF9FDBF9FFFFBDBFFFFFFFBFFFDFFFFF9FFFFFBFFFBFDFFFBDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBC009F9F0B0BCB000000000000000000000000BC00A0000000000000000000090009000000000000000000AD0BD0BF0F9BC9F999F9FFDBFFBDFBFDFFBDBDFFFDBFDBFFFFDBFBFFBFFBFFFFDFFDFFFBFFFFBFFBFFFFFFFFFFFFFFFFFFFFFFFFFDA90000BE9F09F0C00000000000000000000000CB00000000000000000000000000000000900009C009000909000BC9BDADBF9FFEDFBDBFDBDBFDBFBFDFFFBFFBFFBFDBFFFFFDFFFF9FFBF9FBFBFFBFF9FFFF9FFF9FFBFFFFFFFFFFFFFFFFFFFBF0090BC9BC0BC0B00000000000000000000000BC0000000000B00000000000000C000C00000000000000000FAC909BC9DBD9FDB9BBDBDFBFFFBFFDFDBFBFFDFFFDFFFFF9FFFFFBDBFFDFFFFFFFFFFDBFFFBDBFFFFFDFFFFFFFFFFFFFFFFFFFBD00900FDAC0BF0BD00000000000000000000000CB009A0C00000000000000009E0900090000000090000000009F09C9BA9BFB0BDFFDBFB9F9BDFDBFBFFFFDFBDFBFFFFFFFBFFBDFFFFFFFFFFFFDBDBFFFD9FFFFFBFFFDBFFFFFFFFFFFFFFFFFDAF0E09AF9F00F0DAE0000000000000000000000BC00000900000C00E00A000009000900000000000000D000900B90BC9F9C9FDBF9BF9DFFDFBFBFDFDBF9FBFFBFFF9FBDBFFDFFBFFDBFFBFFFDBFFFFFF9BF99DBFDFBFBFFFFFFFFFFFFFFFFFFF909009F00ADBF0BD00000000000000000000000E9A0000A00000B009009000000000000000000000090A0090009E90B90FBDA9F9FD9FBF9BFDFDBFBFF9FFFDBDF9FFFFFFDFFBDFFFFFFFFDBFBFFBFF9FDE99FBF9FBFFDF9FFFFFFFFFFFFFFFF9E9A090DB0D0F0BFE00000000000000000000000BC0000000000000000000000000000C000000000000090000D009BC90F909FDB9FBFBFDBFDBFBFFDBFFFF9FFBFFFBDBDFBFBFFFFBFFFFBFFFFDFFF9F0099E99FF9FFDBBFFFBFFFFFFFFFFFFBF0BC0F0A00BE9BCD000000000000000000000000DA00A090000000ACA0000009000009000000000000000C0900BC90BC90BF90BDBF9FDBFDFBF9FDBFFDBDBFBFFDBDFFFBFFFDFFBFFFFFDFFFFFBFBD090B9F99F9FFF9BFD999C9B99FFFFFFFFFCF0900090D09C0BE900000000000000000000000E9C000000000009000CA0000000000000000000000000900A09ADC9BBD9CB99ED9F9FDBDBFDFBFF9FFFFFFF9FFFBDBFF9FBFBFDFDBF9BFF9F9FFC99099F09BFDBF9FF9BFE9000FBCBFFFFFFF9F0090FC0BF0BCF00F0000000000000000000000F0A00000A00000000B0000900000000000000000090000009C09A909C0B9F0F9BF9BF9FBFDBDFDBFFBDBDBFFFBFFFFDFFFDFFDBFFFDFFFBFFFF0B00FBF09FDFBD9F09FF090B9D9099FFFFFF9A0BC0A90BC009B0BC00000000000000000000000AC9000000000000E0000000000000000000000000000000900009CBC9B9CBDB9FDBFDFBFDBFBFBFDBDBFFFDFBDFF9FFBFFBFFFFFFBFFDFF0B00909B9D0BBFFBD9B09F909090CA00FFFFFFFF0F9C909CB0F09AC9D0C0000000000000000000000DA00C00000009A090E0000000000000000000000000909000BD0A90B9CB9CBD9FBC9BDFDBDBDBDFBFFDF9FBFFFBFFBFF9FFFDBFFFDFFB9F9D9900C9F09DF9D0B09FBDAD0BC09009BFFFFFFF900A09A0C90BC9B0A000000000000000000C00000F9E0A00000900000009E00000000000000000000000000000009C090FBCB9BCBCBFF9BFBFFDBFBDFDBBFFDF9FFDFFDFFFFFFFFFFB9B9F900B0C99BF09F09FB9FDA9F000900B0009FBFFFFF0F09C0BC9AC9BEF0F9F000000000000000C0000000F0090000000A000AC0000000000000000000000000000009C09F090F09F9E9B9F9DBDF9F9FBDFFFB9FDFBFBFF9FFBFFFFBFBFFF00C09009F009AF909B9FF09C90900909009009BF9FFFFFFF000B000099AC90DA0000000000000000000000C000E00E000000000009A0000000000000000000000000000009000BF090F0BDBCF9FBFF9F9FBDBBD9FFFFBF9FFDFBFFFBFFFDFFBD099BD0BF09DBD9C9F9E9090B09BC90000BC909E9FBFFFF90909C000D0AC9F0B0D0000000000000C0000000000F090000000000000000000000000000000000000000C0AD00A0909CB909E9DB9F9F99FBFFDBDFFBDFBDFDFBFBFF9FFFDBFBFF099BC9A9C9D0B0B09BC9900090BC0000090000E9BFFFFBF9E00000090A90B00BC9A000000000000A00000000000F0A00A00000000000090000000000000000000000009090F090C0090FD09A9F9F9FFF9F9BFDB9FFBDFBFBFFDFFFFFF9FFFFD0F00FF9CB9A009FD0B00A09DBC00900009A90A90B9FF99FFF9000000E900C9F09A9C000000000000000C00C00000AD00900000000000A00A00000000000000000000000000000009A90DA9BF9F0FBF99BDBFDBFFFF9FBFDF9FFBFFFFF9FF99F0B09F90099C099F000D09D90A09090009E0C009DADF900BFF000DA00900000B00E0DA0C000000C00C000000000000DA00C000000000000000000090000000000000000900000090F09CB09DE90F9BDE9FFFBDBF9F9FBDFDBFFF9FF9FFDBF99F09C9E909BC0009F99DB0B00A09000000B00909C0B9FA09FF0000900900009DBC0B99B0000000000000000000000000AD00A0000000000000000000000000000000000000009C000000A09B0B9DF9FDF9F9F9FFF9FFBDFFBFFF9FFFFFFB0BCBF00900900C0B00BCA0000D00D0D09DAD0D0D00009B0F0909F0909A00000000A00900AC0F000000000000000000000000F0A0000000000000000000000000000000000000000000900090D00D9CBA9E9BBDBFBF9BFDB9FBDBDB9FFBDBFFFDBD99F0909BD0909000999CB0900B0000E90B0B009A9E09F0F09F90A00D0000000909000D9B00000000000000000000000000F0D00000000000000000000000000000000000000900000BC0000B00B09DB9F9FBD9DBFDBFFFFDBFFFFFFDFFFF0090F00000F0000AC009AC0900009C090B00F0C9CBAD099BE900F00C909A009000000E00F0ACBC0000000000000000000000000A0000000000000000000000000000000000000000000000000909C909FB0F9ED9FFBFDBDBDBDBFBDBDBDBF9F9090F9090F9000090909C90900D09A09E90C90090B0D9ADAD90BD0009000000000909090F00D900000000000000000000000000F0000000000000000000000000000000000000000000900900C000ADBC0DF9F9BFBDBDBFBFFBFFDFF9FFF9FFF009F90C090000900F0009A00000AC00000909ADA9C9AC99B0E90A09000A90D0000000E0000B0AD0000000000000000000000000AD0000000000000000000000000000000000000000000000000009009B0BDADF0DBFDAD9F9DF9BF9FF9BFFBFC0909CB00AD000009000B00D00900909000000900090900E9B9C9000909C00000000A900090D90A0000000000000A00000000000DA000000000000000000000000000000000000000000C0000900900F0DB0BDB9FBDAFDBF9FB9FF9FF9FDB9FD0B0DA900090000090009C0900000D0000000000090000BF90C0A009A0A0900A000090000B0A0AD0000000000000000000900E000AD0A0A0000000000000000000000000000000000090090000009E0090B0DBDBDF9BD9BFDBF9FF9FBBDBFFFD090909C009000909C00900900900000000909000000AD9C9C009090C9090A00909000C0090C90D000000000A000A000090E000000DA0909CA900000000009A000000000000000000000000009000009000DB9E9FA9FDBFF9F9E9F9F9FDBFBDBF0BC9A09000000000000090000000909090000000F09000B00B00009A0C0D09C00000000000000B000000000090090000000900000E9E0A090000000000CA0C9A0C000000000000000000000000000000909E99F9F9BDF9BF9BDBFFBDBFC9F9FC9900D000090000009000090000900000000000900009000F90E90E0090A00000000900000090BC00000000000A00A000000CA0000F0090CA00C000E9A0909A000B0000000000000000000000000000000009F00F9FCB9FCBDFF9F9FBFDFBDBF00A0D000900000090000000000900000C00000A0000000BD0009009090E90090000000090F00BC00000000000000000000090000000F000B090A0B000C0A0A00F0000000000000000000000000000000000009F9BCB99E9BDAF9BDBDFDB99FF099C9A90000000090000009000000000900090D0090090BD0AD000F00E90009A000900000000BC0B0000000000000000009E0000000F000000E090C0B0A9C00D00000000000000000000000000900000000090009F9F0F9FDBD9FDBFFAFBCBD900A000000000000000000000000000900000000000000F00000BD0090909000009000000009009000000000000A00000000000000000F000090A0A90C90A09A0A0000B000000000000000000000000000000000900F9F9F99EB9ADBF99D9F9BCBD09090900000000000000000000000000090009000000F090900B00F00009C000000009A00F00F0000000000000000000090000000F000A0A09C00A0A090A0090F000000000000000000000000000000000000009DA9E9AF9DFB9F9FFBF9FDB000AC000009000000000000000000000000000000090090000E9BC9F00000A09000900D009009F000000000000000000000000000000A00909C0A0B0909CA00D0E0000000000000000000009000000000000900009ADBDBDBDBBD0F9F9FDADBC0909000000000000000000000000009000000000000090000090C0B000AD009AC0000A000009E000000000000000000000000000000F0DAC00A09000ACA00D0A0000009000000000000000000000000900000000009BDA9F0FC9E99FADBFDBCB0000090000000000000000000000000000000000000BC0000BC090C00900F0009A0009009CB0B0000000A0000000000000000000000DA009A00A0A0D009A0000000000000000000000000C00900000000000009000C09DADB9F99E9FDBF9F9BC0090000000000000000000000000000000000000000000909000A9009E9000000C090000A00D0000000000000000000000000000000AD00A00D090DA0BC0000000000000000000000000009000000000090000000090A9DBDAFCB090FBDBCBC90000900000000000000000000000009000000009000009A00009000B0000090090000C9A90F0000000000000A000000000000000000F0B0C09A0A0A0000000000000000B0000000900000000000000000000000000009CA9E99BC9BF909C9000090000000000000000000000000000000000000000900000009A9E900900F00000B00900C9000000000000000000000000000000000F00A9A0009C90F000000000000A000000000000900F000000000000000000009000909BC09C00AD0B0F90000000000000000000000000000000000000000090E90000000C00090E900000000000B09A0000000000009000000000000000000000F000DADA00A000000000000000009C000000000000009000000000000000000000000090A9090BC90000000000000000000000000000000000000000090CA900000D090B900E9000090BC90090C00D0000000000000A9A00000000000000000F00F0A00000000000000000000000A00000A0900000000000000000000000000009000000D000D00BC90000000000000000000000000000000000000000090000090000AC00D00000AC000000CA90A0000000000000A00C000000900000000000F000000000000000A000000000000009009C00B000000000000000000000000000090009000900900000000000000000000000000000000000000000000000C90C0009090B000BC090A09A09A90090000000B0000B0CB0A00000A0000000000F0B0A900000000000090A0000000009A00000000909000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000BC0AC090009A0090000C000F000000000A00009A0900000000000000000BC0000C00C00900B00A00000B0000000000009000000FE0000000000000000000000000000000000000000000000000000000000000000000000000000900000000090090000CBC09C009C09000900000000000000E09ACA0000000000000000FA90CA0B009000A000000000000000000C90AC0000000C00D090000000000000000000000000000000000000000000000000000000000000000900090000000000000000909A900000000A000BC00000000A09000090E09000000000000000009C0A90000A00A00000000000000000009000900DA00900000000009000000000000000000000000000000000000000000000000000000000000009000000900E9000000AC0000090000000900000000000000A009A0A9AC00000000000000000EBC000000000090000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000000000000000000000900000C9090B0C0000B00F0009C000000000090000009C09A00000000000000000DA9A000000000A0000000000000000000A000B00000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000DA0000000900A009000CB0B0000000000A000000A0AC000000000000000000F0C00000000000C0A000000000A000000000000E900CB0000000000000000000000000000000000000000000000000000000000000000000090C00000000000090009E90000A09C00000B0000000000000000000A00909A00000000000000000DA00000A0000900900000000000000000000009000900090AC09000000000000000000000000000000000000000000000000000000000000000000000000009000090000909000090009C0000000000000A000000900A0000000000000000000F00D00009A0000A0000000000000000000000000000000009000900900000000000000000000000000000000000000000000000000000000000000000090000000000000C0AC90000CB00000000000000090000000A00000000000A000000000AF00A00000CAF0000000000A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009A90000000B0000000000000000000A000A009A000A9C0A0000000A000F000000A0900000000000000000A0000000000000000900000000000000000000000000000000000000000000000000000000000000009009000000000000900009000C000900090000000000000000000A0000900000000C0A090F000B09C000C0000900A000000000009A000000000000A00000B00C0000000000000000000000000000000000000000000000000000000090D00000000000000000000000000E0BDA909E0900BC0000000A00000000000000009A0000B0A900A00000CA000F00000A0000000000000000000000000000000000009A00000000000000000000000000000000000000000000000000000000000009000000009C00900000000009C0000E0000BC000000000000000000000000A0000A000000F0C00000B0000AD000000000B0000000A00000000000000000000000009000000000000000000000000000000000000000000000000000000000090000000000009000000000000009009009000000000000000000000000000000000090A9E00B0000000EBC0DA0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009C0000000000000000000000000090900BCA0009ACB00000000000000000000000000000A09E0C009A0000000A90A0A900000000000000000000000000000000000000000A0C09009C00000000000000000000000000000000000000000000000000000000000000009C00000000000AD00900CB0900000000000000000000000000000090A0B0B0AC000000900F00DA000000000000000000000A0000000000000000000090A00000900000000000000000000000000000000000000000000000900000000000000000A90009CA0F090B000900C000000000000000000000000000A0B0A0D0000009000000ADA000F00000000000000000090A00000000000000A000A0900000F00AC0B0000000000000000000000000000000000000000000000000000000900009A000000009000000D000B00000000000000000000000000900C0CBCA0A00000A000000000F00F0000000000000000000C90009000000000000000000A0900090000C9C00000000000000000000090000000900000009E000000900090000F000C9C0A90B0C00BC00000BC000000000000000000000000000CA9A9009009A0B0000000000B0000F0000000000000000B000AC0A000000000000DA00A0900000000090000000000000000000900000090C0000A0000000090900000000009000900009C0000B090000B0F000000000000000000000000000A0A90000A00000000000A9009A00A0F0000000000000A00000B0090000A00000A09A00C900CA00B00000000000000000000000000009000090009000D00C90000000000000000090A0B000090000000090C90000000000000000000000A0000009000A00000A0000000000A0C000000F0000000000000D00000CA0C0A000000000000B0A000000000B000A090A0D0000009000000000C000000000D0000000000000000090000000000090AC09C000DBCB00000000000000000000000000009A00A00000000000A00000000A0BCB00F00000000000000A00000090A90000A00000000000CB000000C000900009000A000000000090009000000000000090000AD0000900000D00E090DADA9000090F000000000000000000000000A000900A000000000000000090000E9A9000000000000000000009E00A00000000009000000000B0CB000009E9A00000000C0000009000D000009A00C0000000000000009000BC0ACB0F00A0900000000000B00000000000000000000000000000A00A0000000000000000000C90A90CAC9A00A0F00000000000A09009C0000A0000A00900A000000000000000009A0000A900090000000A90E0000090C0B0000F000000000000090000900000000000009000CB0000000000000000000000A0900000000000000000000C0A00A000A09A00A900F0000000000000A0C00A000000A000000000000000000A00A9E000C0B000000000090A9C009000D0A900000900000000000000000000009000C90900F00DA900000000000000000000000000E00000000000000000AC00B09A9AD0DA00000000F000000000090009A0090C090000000A0000000A90009009000BCB00000000B000E0000000000B00000090E0000900900090900009000C009000000900B0000000000000000000000000000000000000000000909A00B00CA0C0A0A0000000A00F000000000A000000000B0E00000000000000000A0A00000EBC00000CB0000090000CB000A0C0009C00A09000000000000000900000090000A9E0BC0BC00000000000000000000000000A0900000000009A9AC0E00B0E9A090A90000B000000F0000000E9000DA000000000090C00000000000000900000A90A9A00B000B000A090B000BC9090A000B0D00009C09C000000000900000A900D00900000000000000000000000000000000000A00000000AC000AB0B0C00000A000000000000000F0900090000A000000000000A09A00000000000000000009E9C00F0000C0090C0AC0ADA0ACA090DA0C0000C0A000000B00000000D09000CA000000000000000000000000000000000000000000A00B000B0E9C00CB09A090000000000000000F00000A000AD00000000000000000000000000000000000000A0B00000B000A09A00BC00D090CA000900B09090090009000900F00A0A00090000000000000000000000000000A0000000000009000000B0009A0B0A00A00A0000000A000A00000A0000000000000000000000000000000000A900000000000B0BC0A0000000000090009A0A0A900900A9C0A000C0A0000C0E0B00BC9C0000000000000000000000000000000000000000000A00A090A0009A00000000000000000000000000A0F000A00009000000000000000000000000000000000000A900C0A9C90009E000000E0A000C9C0AC0AC00000C0A90C0000A909C0F0A000A0000000000000000000000000000000000000000000000A0090A00A90A09A000000000000900000000F0F000CB000A00000000AC00000000000000000000000000B0B00A0A00A009090A09090E9A0009000090A90B00000000900A0B00F00000DA00000000000000000000000000000000000000000000000A000000000000000000000000A0000000F00009A00A00900000000090000000000000000000000A0C0000F000000000A0090A0E00000B00A900A00000000A90000000C0E9000B0000000000000000000000000000000000000000000000000000000000000000000000000000000000000F00AC00C9000000000000A00000000000000009000900900ADA000000000B0CBCBCA900000000000900DA000090009A00090B00000C0B000A000A00000BC000000000000000000000000000000000000000A000000000000000000000000000F0090A90A0000A0000000000000000000000000A000A000A900000B0000B0CB00A09ACB00BC00000A00A00000000000000000090000B0C000000D00000009AC000000000000000000000000000000A000A9000000A0000000000000000000000ADA0000000E09000000000000A00000090DA9AC00C000000000090000900B00B09A09000000009000000009000000000000A00E0A900A90090DA00000000000BC0000000000000000000000000000C00000000000000000000000000000A0000F000000A9090C00A0090A000000000A90AA0C009A9009A000A9A0000A0000AD0CAC9E000000B00A090090A000000000009090B09000F00A00A000000000A0900000000000000000000000000000B0900000000A00000000000000000000000000AC0000000A0A00000A090090000090CA9C9A09A00A0000000000A0900A9E9A0B09A0000000000C000E00000000000B0CA0CAC0ACB0000000000000000000A00A09000000000000000000000090C0A00000A0000000000000000000000000000F09A0000000000D0000000A000000A9A90A00000C000000900C0000000000000000009A09A0009A9A00000000000000900090BC900E90000000000000000000000A0C00000000000000000000A0BC000000000000000000000A0000000000000F0000000000090A000000000A90000C0AD0F00B0B000000ACB0A90A00000B0F000BC00C00C9A0000C90B000B0000000A09A000A0B00A000000000000000000000000A000000000000000000000009E00000000000000000000000000000000000F0000000000A00000000000000A9A9ADA0000000000000000000000000000000000B00B0A00000B0A0000A0000000000000B09C0CBC00000000000000000000000000A000000000000000000000A00000000000000000000000000000000000F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A0B00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105000000000000BFAD05FE, 'Andrew received his BTS commercial in 1974 and a Ph.D. in international marketing from the University of Dallas in 1981. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager in January 1992 and to vice president of sales in March 1993. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.', null); +INSERT INTO employees VALUES ('3', 'Leverling', 'Janet', 'Sales Representative', 'Ms.', '1963-08-30 00:00:00', '1992-04-01 00:00:00', '722 Moss Bay Blvd.', 'Kirkland', 'WA', '98033', 'USA', '(206) 555-3412', '3355', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E506963747572650001050000020000000700000050427275736800000000000000000080540000424D76540000000000007600000028000000C0000000E0000000010004000000000000540000CE0E0000D80E0000000000000000000000000000000080000080000000808000800000008000800080800000C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFB009A00A9009A9AA9A900009AA9ABE9EB0B0BB09A0AB0A9A9B0FA0FA0CBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFE9A09A9EBEBFBB0BB0AB09AC9090AB0BCB0BA9E9AA9A90B000009AAB09009BEB0BAD0EB9E9F9B0C0B0FADB0F0BEB0FCBC0BCBFB0F0BBE0B09BA0BBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0FFA9DABEBFFFADFFADBF0BEBBAFAF0FBBAB9ADABADBE0AB0BCBFBC090E0A9AFA9BC90BB9AFABEE0BB0FA9ABEBE9B0FBA9AB9A9A0FB09E0BDAFA0DBE9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFB0FABFFFAFAFEABCBAA9F09AF0B9BBCBE9EBE9ADA9A990FAB0000BFA9090B09E0BAF00A9ADAB9BCBE9F0BCF0BE9FA9EB9CA90FBEAF0BFBA9ADBA9ABFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9FE99A9FAFFFFEBDA9ADBCBFA9BA9EAFACB0B9AF9A9AFAEB0900BB9A0000A9AF0BBCB0B9E9BADAFAB0BABEBBBC9EAA9EBEABBE90B9B0B0BCBE9A9FADAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFBAFBA9BEBE09ABFEBABAB0F0F0F9DBFBBAFAB0FAF0B090BCBC00090B0B0A0BBE9B0BCA9AF9A9BC9E9FAD00ABAB9FA9CB9C90B0FABFF09ADBFEB00B9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCBE9ABDEFBDBBFFCAB0F0D0FB0BBA0ABF0FDA9F0A90009A09A0B00000000D0BDA9AFADA9BDBEBFABABBADABFBDA9E0BEB9EBABE9A9EB0FE9AB09FAFBAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9B9E9FABADAFEB0BBDE9BABBA9FEDBBF0BFABC0A900BFE0BC0900B090B0B0BFAFE9A9A900A0B0E9CF0C0B0F0CADABF0F0ABBCB0B0BCBEB0A9AFA9A9E9BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFABA9F9FAF0FCBCAB0BE90EDABBABCBFA090B090FBFEF009A0B00A000F0B00B0BE9EBAF9FBFBBBBABB09FABB0F9AFA9FBCFBCB0E9B9A9FAC9F0BC9F0BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCBF0DA0A0FBEBABBDEF9AFBBADA9CB0A0BCA00BAF0BFFE9BA9009090B09ACBBAFF0BADB0A0BADACBDE9CA0BC0BAAF0FBAEB00B0B9A0F9EB9ABAFABABBEBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0BA9BFBACB9EDAB0BAF9AE9A9FA90900090B0F0BFBFE000CB0A00009A9B0ADB0BE900A99ADABFBABEA99A0BF0F9AF0FF0BFADA0E9BABBEBC90BC9E0BCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9E9AF00FBFEBA9EBBC9A09BCA000A09A9ABCB9BFFEE9AF0B009090BAFBEB9BAF0BAFF9ACB0BFACBDBBE0DBFAF9EB0B0BE909A99B00BF0B0AABCBABDBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0BA9AFBCBCBBEBBCABAD000090909009AC90B0AA9FF090B0B00A0BC90F090F9EBCB0AF9ABF0B9BAA9CB0A00FAABCBEBDAFAF0E09BE90FBF9CBB0BCA0DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF0FBDA0BABE90CB9B0FA9AB000A00B0A9A9A9F9EBFE0BC00090900BA9BEB0BABCB0FB0BCB0FBEBDBFA9E9BFADBCBA9A0BE90BBB0E9AFA90FA00BE9A9BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A0B0EBFBCB9EBBAF0F0BC90B0090000909A9E0BBFEE900B0DA000900FA0B0B0BBE9B0BEB0B0AB0A0F0BBC0A99ABAD0BFF9EB0C009A909EBA9E9F0BCADBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9BDBFBB00BE0BAC9AFA9ABFE09A00909A0BCBA9AEBE90AB00A90A9ABFBE9F00FC9AEBC909ADB9EBFB0BC0B09AE9CB0F0A0A90B9EB090FAB0FA9A0FA90ABFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0A000CBE9BE99BFA90F090AB00000009090F0BFBFE0B0DA900090BCBA90AB0BEB90BAFADBA0FB0EBEBABEBC9AA9A9ABF90FA009A9EB09E9AFADA9CA9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCB9FB9A9AE9BEFAF9A9ABEB9EBCB00000A0B0BE9AFF0FA090B00A90B0FADB009BAE9ADBAB0FFB0FBF09BF00B0D0F0EB00AB09EB0DA90A9AF0B0B0CB00B9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0A00EBCB9BEB0BA0F0B09AE90B00B00090A909FFF09009A00090A0F9A9BAB0B0BFADA0D0F0B0BA9A9E00AF0A0BA9BC9E909AB09A09A9CA9ADACA90B0BCFFFF9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9B9BB0BE9E9E909F0BCBEB90B9CB00900BB0FAABEE0B9E090B0BDBBAF0E90C9AE90B0BAB09AFDABE9ADB9A909A9E00A90E90D0A09E0B09A9A090A00009BFE000909FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0CACBE0BA9A9AB00B0B0BC0BCAB0B0000009AFBE9A9E090A0009ABEFABBAB009BADAF09ABE9ABBDAFBAFA9E9AD090B0A90A0A9CB0900B0DADB0B000900BC90000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBB9ADBE9FA9E9EB00F0F9A9E900BCB0B900F90FBEDA9A09090A9A90BC0DB0B09AFB00BCBCB0BCBEB0BDA9E0BC0A0BC090A9090B09A9B00B0A00009000900000000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00A9AA9A0BF0B0BFBA90ACB0B0F0B0B00A90ABAFE90ADA0A0090DAFB0BA0BC0AFAC0BCB0BADAB0B0FEBA90B00B0900BCA9CB0A00A0000B09090900000000009000009BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9BF0F9FADA0BBFF0E90A99ABCB090B0E9000B9FE90E9009009AFAA9A9A9F0A909BBB0B0BC9A9EBDB0B9E0BCA9000BA009A0090B0909A900A0000000000000000090009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9A9AB0BBF0F0B0B9EBDAE90B0E0BC9AF0B00E9F0A9A9A090A9A9FAFCBB0B0B00FAF0E9AB0B0BAB0F0BBF0B0A9A909A9090A0000000009090000000000090009000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBCBE9AF0F09AFAF0A9EA90A90B090B09A90B0BAF090009A0909BE9BA9AFBBC0A90F0B0A9CB0F0DAFABE0000900000000A0A9090A9A900A0000000000000000000000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF09A9ADBF0BBE9B0BBE90BBCA909A009A9AC9A0BEBA0F0009A0BEBBE09F0009A90BABE090B0B0BABBCB090B000090009090900A090000900009000000090000000009009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9A9F0A00ABE9B0FA09ABC0B9E0A9F9ADA9A9E9D00C90A9000F0BDA0DA0FBBE9E09F9FA0B0E0BCBCBAD0A009000000000000009000000090000000000000000000900000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDA9A0B9DA9CB9EB0BDAD0BBC0B09000A90BF0BAA9A9A9009A90BAAFFABBA0A9A9A0A0BDAC9B09A9BE9A909000000000000009000900900000090000000000000000000900FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9ADA0A09AB0A0BE0B0A9E0B00B0B0B0A900F09E09000B000B0BFF0B0F9F9BE9A9E9BEA9BA0DA9E09E9000000000000000000000000000000000000000000000900000009BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE09A9BC9A9CBE9E9F0F0B09A9AD00B09C0B0B0BC9AA9A009A9ADABFADAABABCBCB09EB9C009A9A09B0A00000000009000000000000900000000000000000090000000909C9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF09A9C00A90A09A9A0A0BCBA0D0A0BC9A9A900BE9AC90090BCBFAFABCBADA9BA9A0A9BCAB0F0B090A0090000090900000009000000000090000000009000900000000000BE0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9FFE90A9A90A90B090909A9A0DBA0990B00B9E09F0A9A09A000B0BFDEBE9FBEBEFAD9000B0090A0F0BCB000009000000009000000000000000000000900000000000009000BF0BFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBFFA09000090090000000909A009A0A00B00A90A0F009A09A9ADA0BADBB0A9F09B9A0F0BADB0A990BCB0000900000000000000000000000000009000000000000000000009FE0BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA909090009000000000000000009A00909A09BC0BFF09AC090090BFF0FAE0BF9ABBEE0B0A9F00A900A090090900000090000000000000000000000000000000000009000900BF09FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF909090000000000000000000000900090BF009E00B0BA0A90B0A9AFA9ABA9BFABAD00BFF0900BA9DA0F0B0B00000090900000000000000000000000000000000900000000009A9ED0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000090000000000000900000009000000B0B0B0BECBDA0090CB9EBFF0F009CBBAB0BEBE909E0A9009000B00090000000900000000000000000000000000000000000090000900BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00909000000000900000000000000000009009009A09BF0A090A0B0ABBEBEFAFEBBCB9ADAF00A9AF090A9A9E9009000900000000000000000000000000000000000000900000090009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF09000000900000000000000000000000000000A9A009FEA9BCA9090BB0FFFFABF0BCBEAB0BFEB09E9A0A90009000009000000000000000000000000000000000000000000090090090FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC00000000000000000000000000090000000009000909AF0DA090E0F0FFFEBEDFA9EBA99AF0BF09ABE09009A9A09090000000000000000000000000000000090000000000000000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00009009000000900000000900000000000000009A00BF0BA09A99BBFAABFFBB0BE9BCBA90F0FE090BCA9A0009A000000000000000000000000000090000000000900900000000090D0BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9000000000090000000000000000000000000000090A0BC9AD00A000BFBCBCBEF0BAFBCBAB0BABCBAF09009A9A0900900000000000000090000000000000000000000000000000900A9FEFFFFFFFFFFFFFFCBF9FF9FFFFFFFFD99F9FFFFFFFF000900090000000000000900000000000000000000009BEBE90A909E9F0BBFFA9EBC9B0B0BCF09EF0BC9A09A00090000000000000000000000090000000000000000000000090090A99EBFFFFFFFEF9A9BF9FF9F9F0F0BDBFFFB0FB9F09FFFFE00000900000000000000000000000000000000000090BAE900A90BABBAFAFEA9EB0BAAF0FEB00AFBE9A0900909A00000000000000000000000000000000000000000000000000009C0A9FFFFFFFB9DBDFDBFDBFBF9FBDBE999DDB9CB99A990FF090000900000000000000000000000000000000900009FBAF09A09E9E9E90BCB0E9EBDAB0DAF9CAFFE9E0B0A0090909000000000000000000000000000000000000000009000000B0900BFFFE90DB0FBFFDBFDF9FBD9F9BFFABDBFBDBDB0F90900000009090009000900090000000009000000000000A9E90A09F0BFAFAFEBBCB9E9EBF0BAF0AB9BAFA9A0909A00000000000000000000000000000000000000000000000000000000BCBFC9909B0FBDBFFF9FBE9DAF9FDB9DBBDBDBCBF99ADA00000000000000000000000000000000000000000009BEFA09A00BF0BE9A9E0B0A9A9E0B009EF0E0FE9AC90A000900000900000000000000009000000000000000000000000000900B09009ACBF0F9DBDAF9FBDFFBF9ADB9FFBCBDBDBF09F0909090000000000000000000000000000000000000009A9A909AD0B00ADCB0F0900909A9A9E0A90BFFA9EB0A090900090000000090009000000000000000000000000000000009000909009A09909F9FBFFF9F9FF99F9FDF9FB9DBDA9B99DB0B9000000000000000000000000000009000000000000000AF0E90ABCBFBEB0E9A0B00A000900C90000BEF0F9ADA000900000000000000000000000000000090000000000000000000000000090A9F09B9F9BFBFF9BFF9FBBDBDFFB9F9F9FABD9CB0909090000000000000000000000000000000000000909A90A90DA009BCBB0F00F090900B0000B0009AF0AF009A9000000000000000000009000000000000000000900000000000090009009009BFBCBFDBDF9FCB9FBDF9FB9ADF9F9B0D9A9B90000000909009000009009009000000000000009000009E0B0F0A9FAEAB0CB0B000000000900D0009009AF00B000009090000900090090000000000000000000000000090000000000900090BDBC99FBDBFBF9FB9EF9FBFF0F9F0F9ADF9BBD9E9A90900000000000000000000000000000000000000A9A0BCB0ADA009F0EB0009A900B009AC000000000009A0F0090000000000000000000000000009000000000000000000009000000900090B9AFBDBFFDBF9FDBDFF9F9FFDBF9BDB9BD0B09000000900000000000000000000000000009000000900090009009ADA0B90BCB000090900009C0D00000000090B0009000090000000000000000090000000000000000000000000000000090B9CB9DBFF99F9FB9F9B9FFFB9BF9BE9F0BCBD0B9B9090900900000000000000000000000000000000000B0A9A9A9A09A9E0AD0B09009ACA00000090090000009000090000000009000000000000900000000000000000000000000000000090909B9EBDB9FBFFBCFBFFFBDBDFF9EF9F9FDBB9BD0D0B000000009000090000000000000000000000009090090000009A090900A000A9A90909000000C00090000000000000000000090000090000000000009000000900000000000000900900A9DA9F9F9FF0F9BDB9F9BDBEBF9BD9B9E9B9C99A9A09090900000000000000000000000000000090000A00B00B09A9A09A0A9A9090900090000090090900000000009000009000000000900009000000000000000000000900000000000000099A99F9B0F9BF9FDB9F9FFF9F9FFFFBEDBCF9B0F9C9B09A00090000900000009000900000090000000000900090A00090009000000009090B090000000E000000000000000000900900900000000000000900000000000000000000900000000009E9ADBBDF9B9B9F0BF9B9FBF9B99F9F9B9EDBCB909C090900000000000090000000000900000000009009A0009090009000900909A00A0000000900009000000000000900000000090000900009000000000000000000000000000000000909AD9BDB9DB0F9E9F9F9BDF9BDBFDEF9F0FDB9B9B9CB0B9090090900000000000000000000000000000000A000A0000000000000000009090900900C0D09C09000000000000900000000009000900000000000900000000000000000000000000099BDB9EB9F9F9B0B9F9FB0F9F0BB9ADB9B09E9E9A9090A00900000009000000000000900000000000009009090000000000000900090000009A090A00C0000009000090000000009000000000000009009000000000000000000000000090099A9A9E99DB9B9BDBDB9E99F9A9BDBDF9AFDF9B99C9B0090900000900000000000000000000000000090009000000900000000000090000909A000C0D0D0F0909000900000000090000090000000009000000009000000000900000000090000009DB99FB90DADA9B9F9FB9B9F9BDBA9F99A9EDB0B0D9A900900900000000009000000000000000000000000900900000000090000009090009090900CAC0C0000000000000000000000000000000000000000000000000000000000000000009A9A9F990F9B99BD0B9090D0F9FCBD9F0BE9F990F9B0A9CA90000000000000000090000000009000000000000000000000000000090000009000E0C0C9C909000900009000900000000000009000000000000000000000000000900000000000909D9ADAF9AD0BD0BD0BDB9F9A9B90B0DF990BAF090D9009009000000009000000000909000000000000009000000000000000000000090B00F0D009A000C090000000009000009000000000009009000000900000000090000000000000000909A9BDB99099F0B90BD9B0B0BD0F9F9B9ADABD99BDA9A9009000090000000000000000000000000000000000000900900000000090090000900DE900D0D000000090090000000000009000000000000000000000090000000000000009000000BC9BC9B0BDA9090F90B0C9D90B90B09CB99D0B09CB90D0B00909000000000000000000000000000000000000090000000000000000000009ADAD00C000009C00000000000090000090000900000000000000000000000000000000000000000909B0B9C99090B9F9AB9F9B0BBD0B9F9B90B0F0F0B0F0B0909000000000000000000000000000900000000000000000000000000000000900C0DAD090C90C00000000000000009090000000000900000090000900000000000000000000000090B90D9A9ACB0BD0909C90B0BD90BD00A9CBDA999099909000000000090000000000000000900000000000000000000000000000000000000009ECF0E00C09000090090000900000000900900000000900000000000000000000000000000090090F9BC90999D9A9ADA9A90D09A9A9FBD0B909F0AD00BCB09090909000000009000090000000000000000000000000000000000000000000090009C90D0900009000000090000000000000000900090000000000000000900000000000000000009090B0B0B00B90999909A9B09C9090BD0F9A9990B00909A00000000000000000000000000000000000000000000000000000000000000000009E9C00CAC09C00000000000000090000900900000000090009000900000000000900000900000B0B090099C9BD0F0B0F9F990DB9BDA909B90D0F09090A9C9090000000000000000000000000000000000000000000000000000000090000000900C09E9090000090900000900900000000900900900900000000000000000000000000000000990D009BDA9A90B9BDB90B0F9B9ADADB9E9EB9B09ADA990B0000900900000000000000000000000000000000000009000000000000000000000000FC000C0C0090C0A009000000000900000000000000000000000000090000000000900000090090B9090999B9C999CBD99BC9F9BDBDE909DADA99090090090000000090000000000000000000009000000000900000900009000000090090000909C9090090009C0D000000000900000009009090909009000900000000000000000000000090B009BE90F0DB9BE9B9ADF9B9BDBBDBFFF0B9BDAC9A9A090090090000000000000000000000000000000000000000000000000900000000009000C00AC0C000C9009000000000000000000009000000000000000000000000000000000000009A099B099B9B90F99B9F9B9BDBDBDFFF9F0FDADA99A9C900B0000000000000000000000000000000000000900000000000000000009000000000909C9C9A90C9000C0E90090000900009000000009000009000000000000000000000000000090990B0D0BC9F9F99BDF9BDFDB9BFFFBDFFFB099F9AD90B09009009000000000000000000000900900000000000000000000900090000090909000CCAC00C00000CB0D0C00000000009000900000000900000000000000000009000000090009A90E909B999B09BDBDB9F9BBFFDF9FDFBF9FDFCB0F90A9000900000009000000000000000000000000000000000000000900000009090000000090B0C9E90D0D0B0C0CBC900090000000000090090000900900900009009000000000000000009099BD09FBDF9BDB9BDB9FD99BFFFFFFDFFFBFBDB0F99E9A909090000000000000000000000000000000000000000000000000000000909009A000C9F0C0CAC00C09C9C0E090000090009000000000900000000000000000000000000000000909F09A9B09B9F9F9F9B9DBBFFFDBFDBFFFFBDFDEDB9E9909C00000900000090000000000000000000000000000000000000009000000000000090C9CC0C90909C9CE9E0C9C00009000900009009A0000000000000000000000000000000000900B09BDBD9F0F9FB9BDBDBFD9BDBDFFFFF9FDFFBDB0F9BCB0B0090000000000000000000000000000000000000000000000000000009000090900CBCA0F0CAC0CAC90C9CBC9E9000000009000000090090900090000000000000009009000000B9DB09B09B99B9D9F9BDB99BFDBFBFFFFFFFBF9FE9F0F0BC9090009000000000000000000000000000000000000000000000000090000090000909C0DC0F090D090E9CAC0C0C0C900900000009000000000000000000000090000000000000090B09F0DBF0BD0BB99F9BDBD9BBDBDBF0DB99FFFDBFF9BD9B0BC9000000900000000000000000000900000000000009000000000000000000900000FC0FC0C0C0E0C9C0D0F09C9A0000000090000900090000000009000000000000000000009A999B9B9099DB9D9E90BDA9B9D99F9E9FBDFFF9FBFDBFCBADBC9A09000000000000000000000000000000000000000000000000000009000000000C0DEC0DAD009C9CA9E0C0CA0C09000900009000000009000000000000090000000000000909ADAD9E9F9FB0B9B99B909909A9B0999BDBBBDBFF9E9E9BD909B090000000000000000000000000000000090000000000000000900000090000909C9E90FC0E9EC0E9C09C9009C9CAD000A00009000090009000000009000090000000000000BD9B90B9B9B09DBE9DBCBB90F990D9F0F9FDFDBF9FFBF9F9EB9FC9E0000000000000090000000000000000000000000000000900000000000000000BCCDC0F0D0DAD0E9CA0C9C0009CAD0909000090900000000000000000000000000090000D0B09F9DA99BDB999B0999CBB9EBB0B9B9E9BFF9FBDF9FDAD9E9AB099900000000000000000000000000090000000000000000000000000000900000C9ACBCCADEADE0D0AD0AC00D0C0D0A000090000A000000000000000000000000000000090B9F9A9B9F0DB9ADBC9BCB99D099D9F9F9BF9F9FFDFB9EBDBBDBD9FCA0000900000000000000090000000000000000000000000000009000000009090EDCCCBDE0D0C9CAD0CD0BC00E9E0D009A00000909000000000000000000000090000090B9DB9DBDA99B9F9B99BF9B9F0BDA9B09FFFDFFFFFFBDFF9FBCBDBF0B90D0000000000000000000090090000000000000000000000000009000000000CD0BB0CE0FCADAD00F000C0C90C9E0F000900900000000900000000000000000000000BD9EB90B09B9F9F09F9F999D099999999F99FFFFFF9FFFBDB9F9FBC9F9E900000000090000000000000009000000000000000000000000000000000000DACCC9E9C0FC0CAD00DAD09ACBC0D00BC00B00090009000000000000900000000000000B99B9F9BD9F9B9F9BB9F9A9B9BD9BDF99F99FFFFFFFDFF0F09BCBF9CBDA900000000000000000000000000009000000009000000000000000000000090DAD9E9CAD0BCF0DAD0C0C0C90CB0E9C9A000900009000000000000000000000000009BDAD9E9BF0B0BDB9BDD99999D9D9F999DB9DBDFFFFFDFF9F9BFFBDBFBF0F0F090000000000000000000000000000000000000000000000000000000090C0DCC0E0D0EC90CAC0E0DAC90E90C9C0E90900A0900000000000000000000900000099E9B9B99F99BDB9BDB9B99F9990909999099FDFDFFFFFB9FB9F9BDBF0F9F990000000000000000000000090000000090000000000000000000090009000CBC0AD0F0D09ECBCBC9C0DA0D0EDA0BC900A009000009000000000000000000000090B9F9FDBF9BF99DBDA99CB09999B9B09BF99999FFFDFFDFD90B9FFBDF9DBDBE90000000000000000000000000000000000000000000000000000000000009CF09EC0E0C090C9CA0F0CD0E90CDC00E9009000B090000000000090000000000000BDA9F9BDBD9BE999BDF9999900B9F9BFFFF099099DFDFBFBDBDB9FFBFFBDADF0F0900000000000000000000000000000000000000000000000000000000900CDC9E9C90F0E9E0DC0CB0C9CE9A9AD00F00A9000000000000000000000000000909F9F9AF9BFBD9BE9B9909090B9BFBFFFBFFFFFF9D9B9FD90B90BFFDFDBFFFFBF0000000000000000000000000900000000000000000000000000000000000F0C9E9E0AC0C9C0F0909CC9E090C0D00F0090009000000000000000000000000009F99BDF99F9DBAD99CB090B9F9FFFFFBFFFFFFFFF00999BFBD9F9FFFFFFDBDFC9C90000000000000000000090000000000000000000000000009000000900D0CBECCD0D09E0F0C0CAC0BC0F0E9E0BC0900090009090000000000000000000009A9AF9B9BF9BBD9B9B909009BFF9FFFF9FFFFBFFFFF0000999A99BDBFBF9FFFFFFB0A000000009000000090000000000000000000000000000000000900000EDFC9E9AC0DA9C0F0F009C0BC0D009C0BCE9000090000000000000000000000000BDBDBDBF9BFDFBD0F090009BDBF9BFBC0BDBD09B90B909000990BDBDFDFFFFF9FDF99000000000000000000000000000900090009000090090000090000090000FE9EC9E0CCBDCD00DA9CC9E0F0E0FC090090000900009000000000000000000DB99BDB99F9B9DB9090000B090090909990909909D0000009A09F9BFFFBFFDBFFE9E0000000000000000000000000000000000000009000000000000009000DED09CC9E0D0BCCA0AD0CCE9A0D0C9D009E0000090000000000000000000000099A9FBDB9DA9B9FB009000909909B90999B0F9BDEF90999F9A9C9999BF9BDFDBFFF9F090000000000000000000000000000000000000000000000000009A000DAD0FECBC9CADE0BCDCADA90CDCADACACFC90009000090000000000000000000009F909F9FBDBDF9DB90B9F090909099090999099999F9FFFFDB09F0BDBFDFBBF9FDFBDA900009000000009000000090000000000000000000000000900009000C0F00BCACBC0DCCB0D00CE9A0F0CD0D00E0900009000000000000000000000000B9FB99A99B9B9B99E90B9F9BCB9DA9DB9FDBDF9FFFFFFF9FFDB09BDBDBB9FDDBFBEDBD00000000000000000009000009009000000000000000900000900009A9DCFDC9C9C0F0E9CCA0D09CC90CB0F0FC900000000900000000000000000000090F9DBD9BD9F0F9BC9BD9B9DB99F999B9F9BDBFFBFDFFFFFF9A9DB099BDDB9FBFDFFDBCB0000000000000000000000000000090000000000000000900000090CCAD0CA0F0CBC0D0E90DA0CA9ACF0CC0C000090900000009000000000009BF0099BB9B9BFDBB9B9B99B90BC9B99F9DBF9F9BDBF9DF9FFFF9F0F99B9DBBDABFDBDFBFFFE90090000000000000000000000009000000000090000000000900000C9AD0F0DC0F0C9CAD0CA09C90CD00DA9EDE90000000900000000000000000BF000BD0F0F09B9C9F9DA90BD99A9F9B9B99B9DB999BBFFFFDFF9F9F0D0B9DB9D9FBFD9FDBDF900000000000000000000900000000000090000009000900000009CBCDED000F00F0E9CAD0D0E0E9A0F0CC090C00090090000000000000000000909090B99B9BD9BB99A9D9F9B09D09BC99F9DA90F9D09B9FDBDF99A99B99F9DBF9DFBFFFFFBEDA900000009000009000000000000000000000000009000000000C0C0E9EFC90C90C9C0D00A0909C0D0DA9ECE90000000000000000000000000000000BDBD9F9B0D9F9DB9B909BF9BD09B0B9B99F90B9FDFBDFA9F9F9F0DB9B9F9FFBDFFFFDFDB00090000000000000000000900900900000090000000000090090D0D9C9C0AC9ACB0E90CBC9CACADACE9CC900009000000090000000000000000909B99CB9AD9F9F09B9AD09BD9090B999D99CB09B9FFFFDBFDF0BD09BB9F9FBDFFDFFFFDFFED0900000000000000000000000000000000000000000009000000C0F0CADECD0C900D00F00CA909C0D09CB0C909000900000000000000000000000009CBB9F9DB9B99F9D99B909B9B99E99A9B9090D9BD9FFDBDBDB9B99DB9F9DBDFFFFFFFFDBBC00900000000000000009000000900000900000090000009009E9C0FCDA9AC9E0FC0F0CF09CEDA9E0DE0CDA00000000000000009000009000009090F9DFF9B99F9F99B9BD9F909D9F99A99009B090B0B90FBDF9BD90F9BDBDBFFFFFFFFFFFFDE9900000000000000000000000000009000009000000900000000C9C0BCFCD0E9C09E0DA0DE0900C9CA9CB09000090000090000000000000000000090BB99BDBF9F99F9BDA99090B0990900990990BC90099DB9BDB0999F9F9F9FDFFFFFFFFDFBCA0909000000000009000000090090000000000000000090090D0E9CC9CBCAD0E9E0DACDE0DACAD0E9C0C000900000000000000000000000000909A9BD9BDBD9BDFBDBDB9DA9B909B09C90B099CB99F0909B9BC909B9F9B9FBFFFFFFFFFFFFED0900000000009000000000000000000900000009000009009AC0C90C9EBC0DAC9C0F0C9E0F0C9DAD0CADA90000000900000000900000000000000090DBF9F9FBDB9DBDBDB9D09AD909B00D9B0B99F999BDFFD9B9B99F99FFFDFFFFFFFFFFFFDFF00090000000000000000000000900000000000000090000C0DCBCDACDCF9C9ACBC0F0E9C0F0AC0AD0D0C0090009000000000000000000000000009B99B9FBDFBDBF9BDBDBBD990B0999B09D99B99BDFFFFFF0D09DB9F99FFFFFFFFFFFFFFFFCDA90000000000000000000000000009000000000090000909C09C0CDA9E0CA0CD09E0D0CBC0DC9ED0E0F090000900000000000000009000000090909FFF9BDBDBDBDBDB9F9D9A999099BD9B9BDDF9FFFFFFFC9B9F9BDBFFFDFFFFFFFFFFFFFFFB00000900000000000000000000000000000900000009000A9EC9EBCDE9F09C9A0E0DACBC0DA9AC0F0DC00009000000000000000000000000900009BF9BDF9FBDBDBDBDF9F9B9DB099AD9BDBF9FBFFFFFFFFDB9DB9F9BDBDFFFFFFFFFFFFFFD90D0090000900000000009000000000009000000000000000DCDAF0D0F0FCC0AC0D0BC90C9E0CCDAD0E9AD090A00009009000000000000000000009A99F9F9FBDB9BDBDB9FBF9F90B0999BDBD9BBDFFFFFFFF0D9B9FFFFFFFBFFFFFFFFFFFFFFFF00000000000000000000000000009000000000000000009ADADC9EF0FCB0D09E0D0ED0F090B00DADCE0C0A09009000000000000000000000000909F9BFBF9DBDF9F9BDF9D9F9BD990F90BDBD9FBFFFFFFFF9BDF9BDBDF9FDFFFFFFFFFFFFFFCBF000000000000009000000000090000000000009000000000DAFE9EF0FE000C0DAD00E0CAC0DA0D0BCDE909000000000000900000000000000000B0BD9F9FBDB9B9F9F9FBF9BDB9E999BDB9BD99FFFFFFFD9BBBFDFFFBFFFFFFFFFFFFFFFFFBD0900000000000000000000000000009000000000000000009ED0FF0FFAD0C9ADAC0DE9C9C9A0C9CACDA9C000090000000000000000000900900099F9FFF9F9F9F9F9BDBF9DBDBDB99A9D99F9B9FFFFFFFFFFDFDFFBFDFDBDBDFFFFFFFFFFFDF9E00090000000000000000000000000000900000000900900CB0FE0FF0FF90C00D0F00C0A00D0BCADF0CF09090000090000000000000000000009A99F99FBDBDBDBFDB9F9FBDB9BDBD9B0FB9DBDBDFFFFFFFFFFFBFDFBFFFFFFFFFFFFFFFFFFDE9000000000009000000000000000000000000000000000909CFF9FDAFDAC90E9E00DA0D0C9AC09C00F0CE00000090000090000900000000000009A9FFBDF9F9FDFDF9F9F9BDBF9B9BF999DBD9BDBFFFFFFFFFFFDFFFDF9F99FBDFFFFFFFFFFFF0900000000000000090000000909000000000000000090CAC9CAFAFDAFF00C9C9EDAC90CB0C9ACBCFCE90900090000090000000000000000000009F9FDFBF9B9BD9FB9F9F9BD9F9F90BDB99B9DBDFFFFFFFFFDFFFFFF9F9FFBDFFFFFFFFFFFDE90000000000000000000000000000000000000000000009C9EBDCF0BFCB0E9E0E9C0D0E90C9AC9CBC090000900000000000000000900000000099BDBDBBDDBDBDBFD9B9B99F9F9B99F9A99F9F9BFFFFFFFFFFFFFB9F9F9F9BDBFBFDFFFFFFFE9000000009090000000000900000000000000000009090DE9ECD0EBCFCBFD00D0D0ADAD00DA0D0E9CADE90000000000000000000000000090090009BDBFDBBDBDBDB9FDDBDB99BF9DF9F9DB999F9BFFFFFFFFFFDEDF0F9FBFFFDFDFFFFFFFF9F000000090000000000000000900000900000000000000000C90BC9CDABCF0CF0ACD0C0ECD0DAC9CE9C0000900000090000009000000000000000090BBDBFDBF9F9BDA9BBDA9F099A9B09B99F9F9FDFFFFFFFFFCB9B9F9F9DFFFFBFFFFFBFFFE9090090000000000000009000000900000000000090000090FCDCBCBCDCBC090DC9ADAD09AC0C9E0DCBDE900009000000000000000000000000000009FFBDBDBBDBDB9D0909D09E9D99F9D9F9BDB9BFFFFFFF99BDBC9090B90B9BDFFDFFFFFFD000000000000000000000000000000000000090000009000C0000C0C9E9EFCAC0A0CC0CBCC9E9E0D0AC00000000000000000000000000000000000909B9F9B9BDB9BD9A9A990B0990B0B9AB9BDBDFFFFFFDD0BC990A90B090B9FEFF9FBFDFA9000000000000000000000000000000000000000000000000090DAD0DAD0FC99C9C9CB0F0C0BC0C0DACD0FC9090000000090000000000000000900000909FCBF9F90F9A99D99A9090A90909D0D9BDBF9FFFFEB909A09909C99F9F9F9FFFDBFBDB00090000000000090000000000900000000000000900000900C0C00CDAC9EF0CAC00C90DAC0BCBC0DACD00E000900090000090000000900000000000090BBDBCBFB9D9B0B09099A9909090B9B9DBDBFFFFFD0E909000909A09B0FDFBDEBCBDBC09000000900000000000000090000000000000000000000000900DA0CDAD0FF0D09E9CA0D0D0D0DE0D9ADF090000900000000000000000000000000090099B9B99DB9A9D090B009000A909099FBFBDFFFFDA9909090B9A999CDFBF0F9999B9A0900000000000000000009000000000000000000000009000000C90CD00DE9EC0CAC9C0CDACACACA0D0ECC000009000000000000000000000000000000090B9F0B0B0BD909BC90BD09990B090F99BDFFFFDF090B009090000AFB0D099A09ADBC900000000000000000000000000900000000009000000000000000C90EDE9ED0F0D00ADA0C9C9C9CDAC9E9ED09A0000090000000000000000000000000000909D090900B0F00090BFA00909A99BFDBFFFFE99F00090F0009090DF000099F9B0B0000090000000090000000000000009090000000900000000909C90CC9C0DEBD0CAC9C0D09AC0FCBCDAC9E9CA0D09000000090009000000000090000090090B0B90909090B0900009DF00909099BBDBFFF9E099090BC9000000A9009B090F0D0900000000000000000900000900000000009000000009090C0000C9A0CBCBCDCAD09C09A0E09E00C0ADF0CCB0DA000900909000000000000000000000000000990B0B000BC0000F0BE009A909A9F9FFFFFF99A09009A00909090009E909B90B000000000000000000000000000000000000009000090000C90F0D0C0D0CDCBE09C0E0BC0D0D0C9EDADC0EDBCDE090B0C9A000000000000000000000000000909AD090900900909A090990090B9DBBDBFFF9E009009000000000009E909E9CB009000000000009000000000000009090A90900000900000DA0C0C000D0CBCBED0CBC9C0BC0CA9E090DCAFDAC0E9E000AB0C0000000000000000000000000000909A90099C000000900000900099B9FFBF9FF90909009009000009FE90A99A90900090000000000000000000900000009000000000000090009009E9C0E9CBC9FE9CAC9C0DA9C09CECA9C0EDBE9C9F0DDEB090000000000000000000000000000909ADB0B09090000099B009090F9B9F9FFBDF9CA090090009C9FBD00990BCB009000000090000000000009000900000009009009000000090C9C00C9C0C9CF0F90D0DA9CADC0FCA90DCBC9E0DE9ECBFAFC000090000000000000000000000000090909009BDAD9CB9A0009A09B99FFBFF9F0B9B0900909B0B9A0009BCBF0909000000000000000000000000000009000000000900090000C00009C000DACBCFCCACAC0CE9CAFC09CFCAC9ECDE9ECBDAFC090A000000090000000000000900000909A90B09009A0B000909009B09FB99F9FF9F00900900000900909A09009000000000000000000000009000000000009000900000900909090D0C090D0C9CBCB0D0DAD09CAD0ADE009CBED0F0EDBEFFF900D9C90000000000000000000000000090990D9E0909900900909909DB99FBFF9F90DB0090909090090B09090900000000090000000090000000000090000000900090000000C00C000900E0DACF0FE0E9C0ADAD0FCFADEDE9C9ADAF9EDFBEFEF0A9A009000000000000000000000000000A9A990B000990900000B090F99F9B9E9B0900000009090090000000000000000000009000000900000000000090000000009009090D09C0C0AD0D0D0DE9FC9CADCC00E0F0DADACADEFFDEFBFAFFBDADFED0000000000000000000000009009099090A9090900000900009FB9BF9FFF9F9DAD000000000090909000000090000000000000000000000090000090009090900000000E0C00909C000C0F0DE99CAD00BCF0D0FEF0E9DEBEBEBFEFFFFFEDFADA09A09000000000000000000000000000909090000090000999B999F9FBF9DA9B99A90900000000000000000000009000090000000000009000090000900000000000009C909C00C09CF0F0DE9EE9C0FCC90DAD0D0ED0E9FDFFFFBFFFEFFADFAD009000000090000000000000000909B0009000900009090BE9DADB9F9F9FB9F0F09000090090000000000000000000000000090009009000000000B00900090090009C000C00D090C00D0CF0FFCBED0BCE0C0ADADBEDE0CBEFFEFFEFFBFFEBDA0009009000000000000000000000909B9A09000090CA9C9D9B9B9F9FBDF9F9DB9F9BD9F090090000000000000000009000000000000000000900D00D00A90000009009CD09C00C0C9C0C9E0F0FADCBEC90DADC0CAC9ADCBCBFBFFFFFFEFFBFE0D000A900000000000000000000000909C99A9DBDA999B9FB9FDF9BDBDBFF9BBDB9E90B00090000000000900900000000000000000000000000C9A9FA9ED009090000C0A00C09C00B00BCE9CDADDFAFC9EDE0C9E9C9EDCBCFDFEFFFFBFFFFEFE9000900000000000000009000009090B9B9B9DB9BF9FBDFB9DB9B9FBFFFF9FFDBDF9B9009000900900000000000000000009000000000009000FADFCBDE90F000090090D0D00C090C0DC09CFADFEADBFE9E9CBC0E9E9EADC9AFFFEFFEFFFFFF9E90009A090000000000000000000009099ADB09F99BF9FBDFFBFDF9F9F9FFF9BF0B9FC9009000000090000000000000000000009000000000900DEBFEFBEF0DCB0000C0000D090C09C00FCB0DFA9DECBFEBEDCBC90C0DCACFC9FFFFFFFFEBFEFEFE9009000000000000000000009090B0D9BDBDBF9DBF9FB9BD9FBFBF9FB9FF9F9F09B00000000000000000000000000000009000000090000090DFBFFE9EDACC9CA909C000C090C00D00DCF0DFCADBF0FFFABC0EDADA9CBCBEBFFFFFFFFFFFBFC9000009009000000000000000000909B90B9B99FBD9FBDFFBFBDBDBDBCB9DA9BDB0009000000000000000000009009000000000000000000000FAFFFBFDAD0F0C9C0C09C900C09CDACD0E9EBC9C9ECFFF0FCDE90CC9EFC9EDFEFFEFFEFFFFFCB000909A00000090000000900000909B09F9FF9FB9FBDBDB99F9FDFFBDBD9A9D090909000000000000000000000000009000000000900009000DBDFAFCFADAD0C9C0C90C000D09C000DAC9CBCFCBCF9E9EF0FA9EDEBCC0BCDADBFFFFFFFFFEFBC0900000000000000090000000090909DA9B99B9DBDFBDBDBF9F9B9BDBDBC9B09A90000009009000000900009000000000000000900009000090FAFFBF0FC0C9CAC90C090D000CA0DC0DADEDF0EDACBCF9EFDECBC9CBDCCADCADFBFFFFFEFFFEF00009009000000000000000000009A999F0F9FBBDB9FB9BDB9F9F9CB9A9B00909090000000000000900000000000000000000900000000C0000DFFFFFF0FDE0DC0CB0C000D0D0D00F0CD0F0FFFADFCF0F9FAFBCFACCADADADCFAFFFEFBFFFFFF0F09009000900000000000000000009A99B9B0DDBDBDBDBF9DB9EB99F9D0090B000000000000000000000000000000900900000009000900909EBFFEBCF0C0D009C0C90D000C00C9C9CAD0F0FFFFAFBFEF0FFCF0CDADAD0C0DADFEFFFFFBEFBEF0000000000000900000000000090909DA9DBDBBB9B9F9F99BBD99DB09B0909009090090000000000009000000090000000000000009000000CBFFFBDF0DAD0E9C009C00C0D00D0C0CADCF0FFFBFFFEFBFFEBE9EF0D0DE0F9EDADBFFFEFFFFFFDF0909009000000000000000090009A9BDB9F9F9DBDBDB9DBC99A9B0F09A000900000000000000900000000090000000000090090000009000BDFFFFEBEDC0D0C09C00D09E09E0DAD0DADADF0FEFFFFFEFBDF9E9EBCE0DCCC00DECBFFFFFFFFFAFC0A090000000000000000000000090090B9B9BBDB9BDBB9B9BD0990909090090000000000090000000000000000090000000000000000090CBFFFFFCBCBC0D0C09C00E09C0D00D0E0D0F0FFFFFEBFFDFEEBEFFDEDBDADA9FCAD9FCBFFEFFEFFF090000000000000000900000000909B9BDBDBC9B9F9BD0F9F9A9F09A900090009000900000000090000000000000000090000009009000009EFFFFFBCBCCBC0BCC09C9C00D0CD0C9DE9CF0FFFBFFDAFADBDFBFAFACECADCC0D0ECBEFFBFFFFADAC090009000000000000000009009B0D099B99BDB9BE9B9B0D9900900909090000000000000000000000000009000000000000000B009CC9FFFFEFBCFCC90C9C0A9C000CD00F00FCE0DE9FC9EFCBEDADAFAFEFFFFBDBDADADE9C9CD0FFFFFFFEF9C00900000000000000000000090099BCBDBBDBDAD99BC99A009B09000000000000000000000000000090000000900000090009000000BCFBFFBFEF9E9ED0C0D0C09CD0A9C0CD0D0DE9EFBE9EBC9EDEDFFFBFFFFFEFEDADADE9E0FC9EFBEFFFAFBC00000000000000000000000090A09B09C9B9B9BBD9BC999A090090900090000000000000000000000000000000900000000000900009EFFFFFBFE9C00D0C0C9C00AD0C9C9ACADA9E9CFCFC9EF0FBFAFFFEBFEFFBFFFFFE9EDBCBCBDFFFFBFFCA9000009000000000000000090999009B9BC9BD0D0B90B00900090000900009000090090009000900000090000000900000909000900CBFFFFFFCBEDED0E90D0AD0D0C9CACD0DCDE9EFB0F0FE9FBEFFFAFFFFFBFFFAFFAFFFBEDF0FEFBFEFEDA90090000000000000000090000000A990D09BD9B9B9A900B09090090000000009000000000000000000000000000000000900000000DBFFFFFFEBF0D00D0CC00D0C0C9E0C9C9E9E9EDBCF0F9FFEFFFBFFFFFFFFEFFFFFFFBEFFBEFDBEFFFFBFFC0000000000009000000000009090900B9B099A909C9090900000000090090000000000000000000900900009009000900000000900ADBFFFFFFFCF0CF0D09AD0D0F0C9C9CADCF0DEAFFFFEFAF9FAFEFFFFFFFFFFFFFFFFFFFFFFBEFFBFFFEFBF090000090000000000000000000909009CB0D9BDA99A090090090090000000000000000900000000000090000000000000000900090EFFFFFFFBF0F0C0CC0C0C0C0D0C9E9C0E9EBDF0FFAFBFFEFFFBFFEFBEFFFFBFEFFEFFFEFFFFBFFEFFFBCF00090000000000000000000009000090B099A9C9900900090090000000000009000900000009000000000090090090009000900090DBFFFFFFFFFE9E9CB0D0DAD0D0E9C0C9E9C9CE9FFFDFFCFBFFFFFFFFFFFFFEFFFBFFFFBFFEFFFEFFFBFCFB0900000000000000000000000000090090B090B09A9009000000000090000000000000000000090009000000000000900090000B0EFFFFFFFFFFE9CD0D0C0C0D0E0C9C0CDADCFEFBFFAAF0FBEFFAFFFFFFFFFBFFFFFFFFFFFFFFFFFFFBFEFBFC0A0900000900000000000009000900900909A90B00900090090009000090000000000900000000000000900009000A0090090AD0FDBFFFFFFFFFFFE0C0C9CBC00D0D0D0F0CDA0DADADFFBFEFFBFFFFEBFFFBFFFFFFFFFFFFFFBFFBFFFFFFFEBF09000009000090000000000000000000900090909000900000000000000090009000000090000000000000000009090000000DADAFFFFFFFFFFFFF9F0F0C0C9C90C0CAD0DACDE9CFFAFFEFFBFEFFFFFFFEFFEFFFFBFEFBFFEFFFFEFFFFFFFFFC90090900000000090009000000000900009000090909000900090000000000000000000000090090000000900000000009009AFFFFFFFFFFFFFFFFECD0C9C90CAC9E9C0C0D0F0FBCBDFFFBFFFFFFFBFFFFFFFBFEFFFFFEFBFFEFFFFFEFBFAFCBC0B0000000000000000000000000000000009090000000000000009000000000000000000000000090900000909AC9090009EFFFBFFFFFFFFFFFFE9F00DAC0C9C9C0C0D0F0F0DECBFFAFFFEFFFBFEFFFFFBFFFFBFFFFFFFFFFFBFFFBFFFFFFBE9000B00000900000000000900000000909000000090009000090000000000000000900009000000000000900000900009000BFFFFFFFFFFFFFFFFFC0FC0D0D0C0C9C9CAD0CCFADBFCBFFFFFFFFFFFFFEBFFFFFFFFFFFBFFFFBFFFFFFFFFFFEFF0900090000000000000000000000000000000009000000000000000000000009000000000000009000000000900009000090BDAFFFFFFFFFFFFFFBFC0D0C0CB0CBC0E9C0DA9CDACBFCFFFBFFBEFFBFFFFFEFBEFFFFAFFFFFEFFFFFEFFFAFFBDAC009000900000090000000000009000000000000009000009000000900000900000000900009000000000009009000009000CBFFFFFFFFFFFFFFFEDAD0F0D0C0D0C9C0D0EDCB0FDADBFFFFFFFFFFFFFFFFFFFFFBFFFFFEFBFFFEBFFFFFFFEFFE90900090000000000000000000000000000000000000000000000000000000000000000000000000090009000AC0090B000DBFFFFFFFFFFFFFFFADAD0C0C0C0D0C9C0DAC9CADEDAFFFAFFFAFFFBFEFBFFBFFFFFEFFFFFFFFFFFFFFFFAFFFFFAD00009A00000000000000000000000000000090000000009000000000000000000009000000000009000000090909A000000BCBFFFFFFFFFFFFFFF0DC0D0DAD0CB0CBC0D0E9DCB0FDADFFFFFFFFFFFFFFEFFFFFFFFFFFBFFFFFFFFFBFFFFFFFFEFC00090B09090000000900000000000000000009000000000000900000900000900000009000090000900000000009090900BFFFFFFFFFFFFFFEFF0DAC9C0C9CC9C0D0C9CCADEDAFFAFFFFFFBEFFBFFFFFFEBFFFFBEFFFFFFEBFFFFFFFFEFFFF0B0900000000009000000000900000000000000000900000000000000000090000000009009000000000909000909000000DFFFFFFFFFFFFFFFFBCF0C9E0D0E09C0D0F0E9AD0F0FCBDFFFFFFFFFFFFFFBFFFFFBFFFFFFEFBFFFFFEFFBFFBFFF0FC000909000000000000000000000000000000000000000000000000000000000000000000000000900000009000000B09FBFFFFFFFFFFFFFFFFDE9ED0C9C0C9C0F0C0C9CDCF0FCBFFAFBEFFFFFFFEFFFFFFFFFFFFFBFFFFFFFFFFFFEFFFFEFFBDE9000009000000000000000000000000900000000009000000000090000000009009000000900000000000000009000AFFFFFFFFFFFFFFFFFEF0CD0C9C0D0C0D0C9C9CE0F0FCBF0FFFFFFBFFFBFFFFFEFFFFEFFFFFFFFFFFFFFBFFFFFFFBFEFBCA9090000900000000000000000000900000900000000000000090000900009000000009000000009000B0090900009FFFFFFFFFFFFFFFFFFFBF0ADAC9E0DAC0DAC9E90F0F0FCFF0FFFFFFEFFEFFBFFFBFFFFFBEFFFFFFEBFEFFFFFBFFFFFFBCF9C0A09000000009009000000009000000000009000000090090000000000900000900000000000000900000000099FFFFFFFFFFFFFFFFFFFFFCFD0C9C0D0C9C0D0C0CDC9CF9ADAFFFFFFFFFFFFFFFFFFFBFFFFFBEFBFFFFFFFFFFFFEFFFFBEFBCA909000000900000009000000000000000000000000000000000000000000000000900000009009000909009090FFFFFFFFFFFFFFFFFFFFFEBC0C9CAD0C9C0F0C9CBCADEBCFFFFBFFFBFFBFFBFFFBFFFEFFFFFFFFEFFFFFBFFEFFFFFBEFFFFCF90C009090000000000000000000000000000000000000000009000000900009009000009090090000000000000BFFFFFFFFFFFFFFFFFFFFFBCBCBC9C0D0E9C0D0E9C9DE9CFBCBCFFBEFFFFFFFEFFEFFFFFFBFFFFFFFBFFFFFFBFFFFFFFFFFBFAFB0900000009009000000900000000000900000000090000000000000000000000000900000000009000090909FFFFFFFFFFFFFFFFFFFFFFDFC9C0C9C0D0C9C0D0CAC0DE9CFBFBFFFFFFFEFFFFBFFFBFFBFEFFBFFFFFFFEFFFFFFBFFFFFAFFFFDE9E0909000000000000000000009000000000090900009000000000000090000009000000900900009090000FFFFFFFFFFFFFFFFFFFFFFFFADE9CBC0D00D0E9C9C9CFA9EF0FCFFFFFFBFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFEFFEBFFFEFBEBE09000090000000900000090000000000009000000000000009009000000000000000900000009A9000000FBFFFFFFFFFFFFFFFFFFFFFEBCD0C9C0DACDAC9C0E9ED0DCF0FBFFAFFFFFFFFBFFFFBFEFFFFFFFFFFFFEFFFBFFAFFFFFFFFFFFFFFDBDA09000009000000009000000009000000000000000000000000000000000900009000909090000000090FFFFFFFFFFFFFFFFFFFFFFFDFCADAC9C0D00D0C9C9CCBCEB0FEDADFFFFFFFBFFFFEFFFFFFBFFBFFFFEFFFBFFFFFFFFFFFFFFFFBEFEFADBC09000009000900000000000000090000000000000000000000000000000090000000000C90C9C90CBFFFFFFFFFFFFFFFFFFFFFFFBE9D0D0CBC0D0C9CAD0D0C9CDE9FBFBFFFBEFFFFEFFFFFFFBFEFFFFFFFFBFFFFEFFFFFBFFBFEFBFFFBFBDBCA9000000000000900000000000000000000900090000900000009000900000000090000B000B0A00BFFFFFFFFFFFFFFFFFFFFFFFFEFCED0E9C0DAD0E9C0F0ADE9ADE9EDEFFFFFFEFFFFBFFFFFFFFFEFFFBFFFFBFFFBFFFFFEFFFFFEFFFFFFEFE9009000000000000090090000000000900000000000000900000000000000000900009000BC0009FFFFFFFFFFFFFFFFFFFFFFFFFFF9E90C9C0D0C0C9C0D0CDC9EDE9EFBFBFFFFBFFFFFFFFEBFFFFFBFFFEFFFFEFFFFFEFFFFFFFBFFFEBFEFBF9EF0090000900000000000909090900000000000000000000000000000000900000090090009090AFFFFFFFFFFFFFFFFFFFFFFFFFFFE9CF0C9E0C9C9C0DAC9CBC9E9FF0FCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFBFFFBFCFF9EDA0090000000900000000000000000000000000090000000000000009000090000000090000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9CD0C9C0E9CBC0D0E9CFCBC0FFBFFFFFFFFFBFFFFBFFFFAFFFFFFFFFBFFFFFFFFFFFBFFEFFFFFFFFFFBEFFAD090000009000000090000000900090000090000000009009000090000000000909000090FBFFFFFFFFFFFFFFFFFFFFFFFFFFFFBCF0E9C0D0D0C0D0C9CCBCBCFF0FCBFFFBEFFFFFFEFFFFFFFFFBFEBFFFEFFFFEFBFFFEFFBFFFFFFFEFFAFFDBCF0C000000000000900000090000000090000000000000000000000000090009000009090CBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCF0C9CAD0E0D0D0ADACBC9CBF0FBFFFFFFFFBEFFFFFFFEFFFFFFFFFFBFFFFBFFFFFFFFFFFFFFEFBFFBFFFBEFBFA909090000090000009000000000000000000000090000000090000000000000090000BBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0FD00D0C9C0DACD0C9C0FED0FDE9EBFFFFFFFFFBFFFBFFBFFFFFFFFFFFFFFFFFFFFBFFFFFFBFFFFFFFFFFFBCFCBCA000000000000900900900090000000000000000000000000000900090090000090CBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFC0CF0C9C0D0C90C9CADD09EF0FBFFFFFFFFFFFFFFFFFFFFFFAFFFFFFFBFFFFFFFEFFFFEFFFFFFFFFFEBFFEFFBFCB09090000000000000A000900009000009000000000009000009000000000090900BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF9F0C9E0D00F0CDAC9D0EDE9CFADE9FFFFFBFFBFFFFFFFFFFFFFFFFFFEFFFEFFFFFFFFFFFFFFFFEFFFFFEFFBFFCBC9C0009000090009090900000000009000000000090000000000000900909000ACBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9E0C9C0DACD0CF00DACE9CBCBE9FBFFFFFFFFFFFEFFFFFFEFFFFFEFBFFFFFFFBFFFFFFFFFBEFFBFFBFFFFBFFEBFFFFBE9009000000000000B00900000000000000900000000009000900000000909BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAED0DAC90C90C90CD0C9DE9CF0DFCFBFFFFEFFFEFFFFFFBFFBFFFFFFFFFFFFBFEFFBFEFBFFFFFFFFFFFFFFFFFFFEBCBCBCBC0000000090090000009000000000900000000900900900E0009000000CBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDBCD0D0ED0CBCC90E9CA0DE9EFAFBDEFFFBFFFBFFBFFBEFFFFFFFFBFFFBFFFFFFFFFFFFFFFFFBFFFFFEFBFFEBFFBFFFFFBE9AD0900900A9009090000090000000000000000000000090900009000DBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBEDADE0D00D0C90E9C0DCDE9E9CDBCFBFFFFFFFFFFFFFFFFFFFFEFFFFFFFFBFFFFFFFFFFFFFFFFFEFFFFFEFFFFFFFFFBFBFFFF0B009A0990C9AC00090000090000090090090009090000009000C9FBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEDAD0C9C0DE0D0C9C0DA9E9CBDEBEFBFFFEFFBFFFFFFFFFFFFFFBFFFEBFFEFFFFBFFFFFFFEBFFFFFFFBFFFFFFFFFFAFFFFFBFBFEBC09FACB9E9BC9000900009090000000000900000909000090B0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBCBC9CBC09C0F0C0F0CD0DE9E9F9EDAFFFFFFFEBFFEBFFFBFFFFFFFFFFFFFFFEFFFEFFFFFFFFFFFBFFFFFFBFFFFFFBFFBFFFFFBFB9A9DACB9EBFA9E0C0900000000000900000900000090090CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC9E0C9CC9C0D0D0DACF0DE9ECFBFFFFFBFFFFFFFFFFFFFEFFFFFBFFFFBFFFFFFFBFFFBFFFEBFFFFFEFFFEFFEBFFFFBFFFFBFFFFEDABDBFEFDADE9FBCA9A909009090009000009000000F0FBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0FC9C9E09C09CBC0D0D0DADE9BCF0FBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFEFBFFFBFFFFFBFBFDE9FBFBFFBFFCBDAC00A09000000000090009090F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF9E0D0C9EC9C0C0F0CBCBCF0FCFBFFFFFFEBFFFFFBFFBFFFBFFAFFFBFFFEFFFFFFFFFEFFFFFFFEFFBFFFFFFFFFFBFFFBFFFFFBFFFFAFBEFFFEDAFEBFFEDBF09C0009A90900000000ACBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBC0D9E0D009CAD0D0C9CE9E9EDBBCFBFFFFFFFFFAFFFFEFFFFFFFFFFEFBFFFFFFFFFFBFFFFFFFFBFFFFFFFFFFFFFFFBFFFFBFFFFFBFFFFBFBFBFDBDFAFBE9EF0BDAD00C0AD09000D09FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCE0D0CDCC9C0DAD0F0DCDE9ECFBDEFFFBFFFBFFFFFFFFBFFFFFFFFFFFFFBFEBFFEFFFFFAFFFFFFFEFFFEFFFFFEFBFFBFFFFFFFBFFBFBFFFEFFAFFBFFFFFF0FCADAF0BFCAACC99AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0BD0C9A009C09C0D0CDADA9E9F0FBFBFFFFFFFFFFFBFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFBFFFFFFFBFFFBFFFFFFFBFFBFFFBFFFFFFEFBFBFBFFAFFFBEF0FFADBFCBFCBFDFBFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0FCCCBCDCFC0BCC9CADADADCFDAFDEFFFFFFFEFFBFFEFFFFEFBFFFFFFFFBFFFFFFBFFFBFFFFFFEFFBFFFFFFFEFFBFBFFFFFFBFFFFBFBFBFFEFFEBFFFBFFBFFBCFBCEBDEBCFAFEBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC9A9C00000DC9AC0D0C9CFADADEBDBFFFBFFFFFFFFFFFFBFFFFFEFFFFEFFFBFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFBFBFFFFFFFFFFFFFFBFBFFFFBFFFFFFADBCFBDEBDFBFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9FCD0DEDCD00CC9CBCBCF0DCBCBDEBFFFFFFFBFFFFBFFFFFFFFFBFFFBFFFFEFFFEFFFFFFFBEFFFFFEFFFEFFFFFFEFFFFFFBFFBFBFFFFBFBFFFFBFFFFFFFFEFFEBEDEBCAFCBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0E9E0909AC909C90CD0CF0BCBDEBDEBFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFBFFFFFFBFFFFBFFFBFFFFFBFFBFFFFFFFFFBFBFFFFFFFFFFFFFFFFFBE9E9EBCBFDBEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0F9C0DCCCC9ECCACC9ACF9EDEDE9EBFFFFFBFFFBFFFFFFBFFBFFFFFFFFFFFBFFBFFBFFFFFFFFFFFFFFFFFFFFFFFFFBFFBFFFFFFFFFFFFFFFFFFFFFFFFFFAFE9EDBCF9EDAFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCE9C00B09C909C9BCD90CF09E9FDFBFFFFEFFFFEFBFEFFEFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAFFEFBFFFBFBFBFBFFFFFFFFFFFFFFFFFFDBDE9ECBCE9EDADEFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBD0FCDCC0CCD0CC00ECF0CFCBCBE9FFFFFFFFFFFFFFFFFFFFFEFFBFFBFEFFFEFFFEFFFEFFEBFFEBFFEFBFEBFFFFBFFFBFFFFFFFFFBFFFFFFFFFFFFFEFBEF0FCBDE9FCBCFBFFEFBEFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBECF00090B09A090DD09CF9CBCFE9FEBFFFBFFBFFFFFFBFFBFFBFFFFFFFFBFFBFFBFFBFFBFFFFFFFFBFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFBFBCF9EDADA0F0ADA9E9ADBEDBEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFED90DCFCCCCCCDECCACDE9CADCB9EDBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAFBFFFFBFBFBFBFFFFFFFFFFFFBFEFFBECB0DCEDCEDCEDCEFCE9EDBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0EC0009090900909CBC0CED0FCFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFBFFFFFFFFFFFFFFFFFFBFFBFBEDBFCFAD9E9DAD9E9DADBC9ECBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9DEDCCDCCCDCCD0DCBDBDADADADEBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBE9E9CAC9E0DAC9E0DAC9E9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0CA900B00B00B00E00C0C0DADADBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDEFDEFDEFDEFDFFFFFFFFFFFFFFF0000000000000000000001050000000000005FAD05FE, 'Janet has a BS degree in chemistry from Boston College (1984). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate in 1991 and promoted to sales representative in February 1992.', '2'); +INSERT INTO employees VALUES ('4', 'Peacock', 'Margaret', 'Sales Representative', 'Mrs.', '1937-09-19 00:00:00', '1993-05-03 00:00:00', '4110 Old Redmond Rd.', 'Redmond', 'WA', '98052', 'USA', '(206) 555-8122', '5176', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E506963747572650001050000020000000700000050427275736800000000000000000020540000424D16540000000000007600000028000000C0000000DF0000000100040000000000A0530000CE0E0000D80E0000000000000000000000000000000080000080000000808000800000008000800080800000C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FDB9BFBFFBFB9FBDBBBFDBF9FBFBFBFBFBFBDBFBDBFBBFBFBFFD0000000000000000000000000000000000000000000000000000000000000000BBDBF9BDBF9BB9BFB9FBFB9FB9BBFBBBBFBBFB9F9B9FB9BF9BF9BFBBFBBFBDBF9FBDBF9F9BDBFBFBF9FBB9BDBB9BBF9BBFBFBFBFBFBFBFBFBFBFBFBFFBFBFBBA00000000000000000000000000000000000000000000000000000000000000009BFB9FBB9BBDBFB9BFB9BFFBDBF9BDBDBBDBBFFBFBFBFFBBFFBBF9F9BDB9BBFBBFBBFBFBFBBFFB9F9BB9FBFBB9FBDBFBFBFBF9FBFBDBF9BFBFBFBFBF9FFBFBD00000000000000000000000000000000000000000000000000000000000000000BFB9FBB9FBDBB9BBFBDBF9BBBFBBFBBB9FBBDBB9BFBF9BBDBB9FBFBBFBFBFF9BDB9FB9BDB9F9FBFBBFBFBDB9FB9BB9BFBF9FBFBDBFBFBFBF9FBFBFBFBFBF9FB000000000000000000000000000000000000000000000000000000000000000009BFFBBDBB9B9FBDBDBBFBBF9FBDF9BDBFBDFBBFBF9BFBFFBFBFBDBFF9BFB9BBFBFB9FBFBBFBBF9BDB9FBBBFBBDBDBF9BDBFBFBFBFBFBFBFBFBFBDBFBFBFBFBF0000000000000000000000000000000000000000000000000000000000000000009BBF9BDBF9B9FBBBDB9F9BF9BBBFBB9BBBBF9BFBFB9BB9FBDBFBB9BFB9FBF9BDBFB9F9F9BDBFBFBBFBDBFB9FBBB9BBFBBBDBFBFBDBF9FBFBF9FBFBFBFBFFB0000000000000000000000000000000000000000000000000000000000000000000BDB9FBB9BBFB9BDBBBFBBFBFBDB9BDBF9F9BFF9FBDBFFBFBBFBDBFB9FBBDBFBBB9BFBBBBFBBFB9BDB9BF9BFB9F9FBF9BFFBFBDBFBFBFBDBFBFBFBFBFFBF9BF0000000000000000000000000000000000000000000000000000000000000000009BBFBB9FBDB9BFBBBDB9F9B9FBBBFBB9FBBF9BBBFBFB9BB9F9BBFB9FBBDBBBDBDBFB9FBDB9FFBFBBFBFBFB9FBBBB9BBF9BFBFBFBFBFBFBFBFBFBFBDFBFBFF90000000000000000000000000000000000000000000000000000000000000000000BF9BDB9BB9FB9F9FBBFBFBFBDF9B9FBBF9BBFBF9B9FBFBFBF9F9FBBDBBF9FBFBF9FBDBBFB9FDB9F9B9F9FBBDBDBF9FBFBDBBFBDBF9FBF9FBFBFBFBFBFBBBE00000000000000000000000000000000000000000000000000000000000000000009BFBBFBDBB9FBBB9F9B9BDBBBBBDB9F9BF9FBDBFBFBB9F9BBFBB9FBBDBBF9B9BBB9BBDB9FBFBBFBFBFBBBDBFBBB9BB9BFBF9BBFBFBFBFBFBDBFBFBFFBDFF90000000000000000000000000000000000000000000000000000000000000000000BDBDB90B9FBB9F9FBBFBFBF9F9FBBFBBFBBFBBF9F9F9FBFBDBDBFB9FBBDBBFBF9FBF9BAF9BFBDB9BDB9BDBFB9BDBBDBFBFBFFFBFBFBFBFBFBFBDBFBFBFB9A00000000000000000000000000000000000000000000000000000000000000000009BBBBBFBF9B9FBBB9F9F9B9FBBB9F9BDB9F9BDBBBBBFBB9FBBBFB9FBBDBBDBB9EBB9FBF9BFFBBFBFBFBFBB9BFBBF9BB9FBDBBBDBFBDBF9FBFBFBFBFBFBFF000000000000000000000000000000000000000000000000000000000000000000000BDBDB9B0BFB9F9FBBBBFBFBDBDBBBFBBFBBFBDBDBDBDBF9F9F9FBBDBBDBBDBF9F9E9B9FA9FDB9F9B9F9FBFB9F9BF9FB9BBFFBFBDBFBFBFBFBFBFBFBFBBF0000000000000000000000000000000000000000000000000000000000000000000009BBBDBDB9BDBBB9F9BDBB9BB9BDB9BBDBDB9BBBBFBBB9BBBFBB9FBBDBB9FB9BBBBBF0B9FBFBBFBBFBFBBDB9FBBF9B9BFFFB9FBFBFBFBFBFBDBFBF9FBDF9A000000000000000000000000000000000000000000000000000000000000000000000BDBBBB9FB9BDBFBBFBBDBF9F9BBFBDBBBBFBDBDB9F9FBDB9BDBB9FBF9FB9F9F9E9BBFA00F9FB9F9FB9FBBFBFDBBBFB9B9BFBBFBF9FBDBFBFBFBFBFBFBB0000000000000000000000000090BCBC9F0A9E000000000000000000000000000000009BF9F0FB9BFB9B9F9BDBB9B9BBF9BBFBDFBDBBB9FBFB9BBF9AF9FAB9AB9FAB0B9FBC0000FB9FFBB9FB9F9BDBB9F9BDBFBFBBF9FBFBFBF9FBF9FBFBFBF9000000000000000000000000DA0F0BCBF0FDF9FBFEB00000000000000000000000000009BB9BB9FB9BFBFBFBBDBF9BF9BBDB9BB9BBF9FBB9B9F9E9FB9B9F9FBDAB9DBFA0000000F0B0BDAF9FBBFBBFBFBFBB9BFBDFBFBFBFBFBFBFBFBF9FBDBE00000000000000000000009ABDFDFFBDFF9FAFDF9FDFFAF00000000000000000000000009F9F9A9FBDBB9BBDBB9BF9BF9FBFBDBF9B9B9FBF9ABB9B9FBFA9B0BBDBEB0000000000F0000090B0BDADB9F9B9F9FB9FBBDBBDBBDBFBFBFBFBFBFBF9000000000000000000009EFFDBFA9FDFB9FDF9FAFFBF9F9E9090000000000000000000000BB0BF9B9BBDBF9BBDB99BB9BB9B9BB0BFBFA9A9BDBCBFA9A9BF9FBCA0000000000000B000000000000B0FBFFFBFB9BFBFBFFBFFBFBFBDBFBFBFBFB0000000000000000009BBFFBCBEBDFFFADFEBBFBDF9F9FFFBFFAC000000000000000000000BDBF9BBFBDB9BBE9B0BFBDBF9F9FBDBF09B9BDBCBBB9B9BDBF0A00000000000000000F00000A00000000009A9BDBFFBF9FBBF9BFBDBFBF9FBFBF9BC0000000000000000BEDF9FDFDBDFBF9FF9BDFDFBFFFFDBDFCBDBCB00000000000000000000B9BBDB9BBFBDB9F9F9B9BB9BBB9AB9BBF9E9A9B0F9FBE9A000000000000000000000F000A0000000000000000B0B9FBFBF9FFBFBFBFBFBFF9FBFBB00000000000000BC9BFFEBFBFDAFDFF9FFDBEBDF9E9FFFBFFDBDBCBDAC00000000000000000F0BBDB9FB9BFB9B9BDBBDBDBDBD9E99A9BDBFBF9A00000000000000000000000000D000000000000000000000000B0FBDBBBF9FBF9FBFBBFBFBD00000000000000BCBFFDBDBDE9BF9FADFBCBDBDFBFFBF0BDF9BEBCBDADB0D0000000000000099BD9BBFB9FB99E9BB9BD9BB0B0BB9BFBF0B00000000000000000000000000000000A000000000000000000000000009BFBFDBBF9FBFBF9FBFBDA0000000000000ADBDFDAFFDFBFFDFBDBADBFBDB9FF9FDFFF9FFD9F9A9F0F0A90000000000000BFBBBF9BFBDBFB9F0FB0BADBDBBDBE0000000000000000000000000000000000000F00000000000A0000000000000000BFBBFFBFBFBFBFBF9FA000000000009C9F0FBFBFDBE9FDAFBDFFDBDBCBFF0FFFBF9FF0FBF0F9E9F9F9E90000000000000B9F9BF9B9BB09B9BBDBF9A9BE9A000000000000000000000000000000000000000F000000000000000000000000000000FB9FBFBFB9FBFBFBF00000000000A9E9F9EDFBFDBF0FDBFADBFFF9FDADF9FDFBFBDF9F9F9F90BCBCBCB0000000000009A9FB9FBBC9F0FBDA0000000000000000000000000000000000000000000000000D0000000000000000000000000000009FBBDBF9FBFBDBBF00000000009BCB9BCFBFBDFBDBFBFFDFBD9E9F9BDBBFFBFDFDBFBCB9E9EBDB9F9AD0F00000000009FBB9FB9FBB0B00000000000000000000000000000000000000000000000000000A0000000000000000000000000000000BFFBFBFBFBFBFF90000000000FCBDEFF9FDFEBDAFDFBDFBDAFBF9ADB0FDBFDBFBF0DBDE9F9D0BCBCBDA09E00000000B9B9FB9F0000000000000000000000000000000000000000000000000000000000F000000000000000000000000000000009BFBDBFBDBFBB000000000009BCFBCBFAF9F9FDBBDEBBCBDBD0BDA9F9BDFBEDADBF0B9F9AFBDB9F0B9F09C00000000FBF9FBA0000000000000000000000000000000000000000000000000000000000F000000000000A000000000000000000000BFBFBFBF9FFE0000000000E9BDFBDFDBFFFBFDFBDFDBDADBF0BD00F0B0DBDB0DBDADAD99E9E9BD0F0F0B0000000099BB9F00000000000000000000000000000000000000000000000000000000000D000000000A00000000000000000000000099FBDBFBFBB000000000909FEBFDAFBFDBDF9BFCBFAFBDBC9BCB9F09CB09A9DA09099A9E9B9F0BF9B9E9E0000000BF9FB000000000000000000000000000000000000000000000000000000000000A00000000000000000000000000000000000BFBFBFBFBD00000000000BCBDAFFFDFAFFAFFDBF9F9C9E9BC90F09FBDBE9DA9BDBFA9F090F09F90FCB90D000000B9BB0000000000000000000000000000000000000000000000000000000000000F0000000000000000000000000000000000000BFFBDBFB0000000000C9FFFDBDBFBDBDF9FAD9F0FBF9E9FBF9FF09A909A9C9A90D0BBDB9F9ADB9B9E9AD000000FBC0000000000000000000000000000000000000000000000000000000000000F000000000000000000000000000000000000009BFBFBFC00000000B0A9BFFEFFDFFFBFF9FBEFBD0F9FBDBDA99F0DBDBDA9F9E9B9C9ADB0F9ADADA9F0AC0000B9A000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000FBFBDBA00000000009FFE9F9FAF9FDBFF9F9F0FBFBDFADADBE9FBCBDBDF9E9BCF9BDBCB9E9BDB9E9BDA00000F000000000000000000000000000000000000000000000000000000000000000E00000000000000A00C090C000000000000000009BFBFBD000000009CFEF9FBFFFDFFBFD9E9E9F9FBDEBDBF9FDBC9FBCBF0BDBDB9BCBCB9F9BC9ADB9CA90000B00000000000000000000C0000000000000000000000000000000000000000000F0C00A000000A0900A000A0000000C0000000000009FBDA000000000B9BFFFCF9FBFBDBAFBDBFFBDFF9DBFDF0BFBFDBFD9FDBDADADB9B0F0BDBF9ADAB9E0000000000000000000000CA000000000000000000000000000000000000000000000F0A000C00AC090C0000A000AC0AC000A0A0000AC000BFBF00000000A0FDBCBFBFFF9FFDBDAF9BDFBCBFBCBBDFD9F9FDBFDBFDBDBDADF9F9F0F0F9F9DE99E0000000000A000000C0A0000000E0000000A0C0000000000000000000000000000009000000A000000A00C9C0C900090A0900C9AC00000E9AFB000000000DAFFFFDFF9FFF0FDBDBFFFBDF9FDBFDBFBFFFFBDFBF9F9F9F9B0F0F9F9F9FCBB9FA900000000000000000000000C0A000CA000C000A00000000000000000000000000000E000A000000A00000A0A0A0C0AC00C0C00000B00A000DBF000000000BFFADBFE9FFDBFBBEBFFCBDFBFFBFDBDBFDBDBDFBFDF0F9FBCBDBDBCB0B0FBBCDAD00000000000000AC0A000C0A000000000CA0000000000000000000000000000000000F0000000000000000000000A000A00A0A0AC00C0C90A09BE00000000FBDFFF9FFBFADBDF9F9FBFBDF9FDFBFFDBFFFFFFFDBDBFDE9FDBCB9F9F9F9FDBBDBE000000000000000000A00000000CA0C00000AC000000000000000000000000000000F00000000000000000000000000000000000A00A00C00C0B000000009EBFCBFBDFDFBCBFFFFBDFFBFFBFDF9FFDF9FFF9FBFFDBF9F9ADBDE9E9E9B0FCBBD9F0000000000000000C000000AC00000A00AC00000000000000000000000000000000B0000000A00000A00000000000000000000000000A00A00C00000000FDFFBFDFFBE9FBF9F9FDBF9F9FDFBFFF9FBFF9FFFDF9FDBF9FDBCB9F9F9F0F9BDDAF9E00000000AC00000000E00C000A0000C0C00A000000000000A00000000000000000C0000000000000000000000000000000000000000000000A00000009BFFADFFBCF9FBFDFBFFBF9FFFFFBFDF9FFDFDFFF9FBFF9FDBCB9F9F9CBDADB9FFBF9E9000000C00000CA0000000A0000C0E00A0A0C000000000A00000000000000000000F0000000000000000000000000000000000000000000000000000000FBDFFBDFBFFBDFBFF9FDFFF9F9FDFBFFDBFFBF9FFFDBDBE9F9FFDBCBF0F9F0F0BC9FBDF0000A0000A00000E0000000E000000C00000000A0000000000000000000000000B0000000000000000000000000000000000000000000000000000000FEFBDFF9F9FFBDF9FFBF9FFFFFBFDF9FBDBDFFF9F9F9FDBDBD9ABF9DBDBCBDBDBFBDBBCBC0000000000000000E00C000A00A000C00A00000C0009000000A000000000000F000000000000000000000000000000000000000000000000000000ADBFFEBFEBFF9FFBFF9FFFF9F9FDFBFFFDFFF9F9FFFFF9F9FDAFDF9FBCBDBDBCBD9FEDFBDA00000000000A0000000A00C0C0C0A0A000000000A00E00A00000000000A0000C0000000000000000000000000000000000000000000000000000009FFDF9FDBDF9FBFFDBFFBDBFFFFFBFDF9FBDBFFFFF9F9FFBCBF9F9FE9F9F0F0F9EBF9FBDAD00000A00CA0C0A0C000000000A00C0000000A000000000C00A000A000000000B000000000000000000000000000000000000000000000000000000BBFAFFBFFFBFFFDBFDBDFFFDBF9FDFBFFDFFDF9F9FFFF9FDBD9F0FDBDBCBDBF9F9F9FBDFBDA0000C00000000000AC0CA0A000A00000000000000000000000C00000000A00F000000000000A000000000000000000000000000000000000000000FFDBDE9FBDBDBFDBFFBF9FFDFFBFFDBFBFBFFFFFFBDFF9FFBFBDBF9FBDBE9FBCF9E9FBDFBDBE000000000C000000000C0C0C000000A00000A00A000A0C0000000A000000F0000000000000000000000000000000000000000000000000000009FBFFFBFBDFFFFFBF9FFFFFBFBDFDBFFDFDFDBFFDFDFBDFBDFDFBDADBCBDBDADBDBFDBDBFDAD00000AC000A00E000A009A0B000A900000000000C000000A00A00000000000000000000000000000000000000000000000000000000000000009EFDE9BFDFFFBF9FDFFFDBDBDFDBFBFDFBFFBFFDBFBFBDFBDB0FBDBDBDBDADBDBDBF9F0FFDBF9E000000A0000000E00CA0C0C0E0C0E00CA0B0C0000000000000000000A000F000000000000000000000000000000000000000000000000000000BFBFEDFBF9FDFFBF9FBFFFFFBFFFDFBFDBFDFBFFDFDFBDEBDF9DAF9F0F9F9EBDBCDBFF0BFF9E9E0A0000000C000000000A0A000A00CA00C0A0A0A0A0A0000000C00000000F0000000000000000000000000000000000000000000000000000000FDBFF9FFFBFBDFFFFDF9FDBDBDBFFDBFDBFDF9FBFF9FBDFBFFBD9E9F0F0F9DBFBFDBDF9FFF9F90C000C00A00A00C0A0C9C0BC0D0A9CA9A0C0D0C9C0D0E0E00A00A000000B0000000000000000000000000000000000000000000000000000009BFE9BFF9FDFFFBDBFFBFFBFFFFFDBFFFFFFBFFFDF9FFDBDF9DFFBDBDBDBDAF0FDBFFBDBDBFF9EB000A000000C00A00CA0A0C0A0AC0A0C0CB0A0A0A0A00009C000C0A00E0C000000000000000000000000000000000000000000000000000000FEF9FDF9FFBFF9FFFDBF9FDF9F9FBFFDFBDFFDBDFBFFDBFF0FBA9CBF0F0F0BDBDBF9FDBCBFDBCBD00000000000000009000D0A90C9AC90A00C0C00C00C0BCA0ACA0BC0D00B000000000000000000000000000000000000000000000000000000BDBFFBFFBDF9FFBDBFDFFBFBFFFFDFFBFFBFFFFBFFDBFFDBF9FDFBD9F9F9BDBDBDFFBFF9DBFFF9E9AC00AC0A00B000A0000A00C0A000AC9E0B0ADA0E9AC000C900C00A0A0F000000000000000000000000000000000000000000000000000009EBCBDF9FFBFF9FFFDBFDBDFDFBDBFBDFFDFDBFDFDBFDBFFDBF9BDBEBCBCBDADADB9FDBFBE9FF9F9E90000000C000C000E00000A000C0000000000090000ACA0AC9A0C00C0F00000000000000000000000000000000000000000000000000000E9FFBFBFF9FDBFF9FBF9BFFBFBDFFDFFFBFFBFDBFBDFBDF9FDAFCBD9DBDBDAD9F9EFBFFDF9BDBFFDBCA0000000000A0000000000000A000A0C0AC0AC0AC9009C00AC0B0E9A00000000000000000000000000000000000000000000000000000A9BF9FFDF9FFBFF9FFFDFFDBFDFFBFBFBDFF9FDBFDDAD0F99E99DBDEBFADBCB9F0BF9FDFB9EDFDF9ADA9C00A00A00000000000A000A00000000000000000AC0000000000000F00000000000000000000000000000000000000000000000000000FDEF9FBFFF9F9FFBDBF9FBDBFBDFDFDFBDBEDBF9FBDBD9AD99E9099C99E9BDADBD9FFBDFF9BABFFDBF009000000A000000A0000000000A000A00000000000A00AC00AC0000F00000000000000000000000000000000000000000000000000090BBDBFFDF9FFFFBDFFDBFDFFFDFFBFBFFDEDBD0DFDFFFFDDAD99DBC9BC9F0DBDADBF9FFBDFFDDBDBFD9FAC00000000000A000000000000000000000A0000000000009000A0000000000000000000000000000000000000000000000000000000ADEBFDBFBFF9F9FFBDBDBFBDBFBDFFDF9F9D9FDBFFFDF9F9D9AD0D9BC9A9DBCB9BCBDBDFFBDBBDBFCBE9DA0000000000000000000000000000000A0000A00000000A0000000F0000000000000000000000000000000000000000000000000009FF9FDBFFDF9FFFFBDFBFFBDFFBDFE9FBD0F9E99F9C9090D0B0D09A0C9C9D00BDADBDBFBDBDBFCDBDBF9DA000A00000000000000000000000000000000000A000A0000000000A000000000000000000000000000000000000000000000000000ADBFBFFDFBFFBDBDFFBDF9FFBDFFBDF0DBD0D9FD09B9FDB9BDFBFBDF9AB00BD09DBDBE9FFFFBDBBDBDBEBDBC0000000A0000000000000000000000000000000000000000A000D0000000000000000000000000000000000000000000000000009ADFDBFBFDF9FFFBDBDBFF9FFBDFF9DF0D0B09BFFDFFBFFFFFFFDFBFFDFF009E909BD9F9BDFFFDEBDFD9F0B0C000000000000000000000000000000000000000000000A00000F000000000000000000000000000000000000000000000000000FFBEBFDFFFBFF9FFFFAD9FFF9FF0DF0900BDFFFFFBFFFFDBFFFFBFFFFBF0F0090DBCBFDFDBF9FB9F0BBF0FDB0000A00000000000000000000000000000000000000000000000A00000000000000000000000000000000000000000000000009BF9F9FDBFF9FF9FF9F9DFAFF9FF9F9090F9FFBFFFFFFFFFBEFFFFFFFFBDFFB0900B09BDB0BFDFBDFDBDEDBDA00A00000000000000000000000000000000000000000000000000D0000000000000000000000000000000000000000000000000ADAFFFBFF9FFDBFBDF9FB9F9FFBC90E9EF0FBFDFFFFFBFFFF9BFFFFFFFFFFFC9E090DBCBFFDBF9FF9ADB9BDA9FC000000000000000000000000000000000000000000000000000A00000000000000000000000000000000000000000000000000BDBDFF9FFBFFDFFBFBDE99F9EDBD90B9FF9FFBBFFFDFBFCF0DB9F9BDBDADBF090C0099099F9FF9FFDBCF0FDA9AC0000A000000000000000000000000000000000000000000000F0000000000000000000000000000000000000000000000000BCBFBF9FFFDFBFBDFDF9BDBBF9F00A9FFF9EFFCF9E9B0D9B9DBC90C90DADBC900A909CADBF0FBDFBDBDB9F9AD9F0A000000000000000000000000000000000000000A00000A0000000000000000000000000000000000000000000000000000BDBFDFDFF9FBFDFDF9F9ADAFC9F090DFFE9E9B990BD90D9E9CB09AD99E909090E9909A99BE9DF9F9F0FA9DADF9E0000000000000000000000000000000000000000000000000000F0000000000000000000000000000000000000000000000000ADBFBFBFFFDBFBFBFBDF9D9B90C00B09F099C9E9DADF0BDDBDFDDBAD9BDADBF9F0F0DBC99FB0BDBDBD9EBDA9E9BC00000000000000000000000000000000000000000000000000E000000000A000000000000000000000000000000000000009FADFFDF9FFFFDF9FDFBDBAD0F99BD0F09FE9BF9F9F9FDFBFDBFBFDFBCF9F9CBDAD9B0DBDA9DFDBCBDBD90BDA9EDA90A0000A00000000000000000000000000000A0000000000009000000000000A0000000000000000000000000000000000CABDFBDBFFFBDBFBFFBF9E9DB9ADADBF9FF9BFDFFFFFFFBFDFBFDF9F9FF9F0FBDADBC9F09A9FB9ADBDA9AF9DA9F9A9C000000000000000000000000000000000000000000A000000E0000000000000000000000000000000000000000000909A9BDFBFFFFF9FFFFDFBDF9F9BCBDBDBE9FF9FFDFBF9FDBDFDFBFDFBFFFDBDADF0F9DA9E9BF9DF0FDBDB9FD99A9E9E9CA0000A00000000000000000000000000000A000000000A0000900000000000000000000000000000000000000000000BFFFFBFDF9F9FFFBDBF9FF9E90FBDBCBDFFDAFDBFBDFFBFFBFBFDFBDE9F9ADBDBDBD0BDB90D0FA9F0B9F0F9BCBD990F0BCB00000000000000000000000000000000000000A000000000E000000000000000000000000000000000000000009ADBF9F9EBFFFBF9FDFBDFF9E9FBD9DADBDB9FBDBFDFFBDFDBDFDFBF9FBDFFFFF0FB0FBFCBCB9BD9F99F9E9F9E9BDADA9AD00CA00000000000000000000000000000000000000000000000B00000000000000000000000000000000000000000ADFFDFEFFDF9FDFFFBFDBF9F9F9C9ABD9F9EF9DFF9FBDFFBFFFBFBDFFFDBF9F9DB9DF9C9BD9DE9A90F0BDBDBDBDBC9BC9CBCB0D00000A0000000000000000000000000000000000A000A00C0000000000000000000000000000000000000000BDFBFFBF9FBFFFFBF9FDBF9F9F9E9B9D9BE9F9FBF9FFDFFBDFDBDFDFFBDBF9FF9FADE90FBDA9A9BDBF9BD9F9E9F0F9BCB0B0BC9A00A0000000000000000000000000000000A000000000000B0000000000000000000000000000000000000009FBFFFFDFFDFBF9FDFFBFD9F9F0F9BDA9AD9F9F9E9FDBFBDFFBFFFBF9FDAD9F09E9DB9BF90BDBD9DAD0F0FBDBDBDBDAD9BC9E00FC00000000000000000000000000000000000000000000000E00000000000000000000000000000000000000ADFDFBFFBFBEFDFFBF9FDBEFF0FBDFCBDF9A90F9F9FBFDBDB9DF9F9FFFBDB9E9F99E9FC90FD09CB0BDB99F9EDBFDBDBDADCB09CB0BC0000000000000000000000000000000000000A000B0000900000000000000000000000000000000000009FFBFBFDFFDFFBFBDFFFFBF9F9F9DBB9F9AD9DB9E9F9E9FFFFFBFFFFF9DFBCBBDADA990B9F9A9F9DBD0DAF9DBBDBCBD9F9BBC9EBC0DA00000000000000000000000000000000000A0000000000E000000000000000000000000000000000000BBFBDFFFFBFFBDFDFFF9F9FDF9FBFFBDFDBDF0B0F9F9F9FBDBDBDBD9F9FFADBDCBF9F9E09C909F0BAD0BBD9FFBDFDBDAF0F9C9A900BA00A000000000000000000000000000000000000000000009000000000000000000000000000000000000DFDFFBDFFFDFFBFFFBFFFFBFBFDBDBDF9BF9BF9D0BDBDF9FBDADF9FB9F9F9FDFBF9F0F9F0B0F09D9DBBD9FBDBDF9BF9F9F9E9AD0F00D000000000000000000000000000000000A0000000A00A00E000000000000000000000000000000000000BFBFDFFBFFBFCFFBFDF9F9FDF9FFFDBFFDFFDFBF9CB0BDBDFFF9AD0DADADFBF9FDFF9F09F0F9FA9A9D0BC9FBDBFFDBF9F9F9F9AD0ADAD00A00000000000000000000000000000000000A0000000B000000000000000000000000000000000009F9FDBFFFDFFFBF9FFFBFFEFBFFDBDBDBDBF9F9F9FB9DF9FBC99FDBFFBDBFBDFFFBF9F0F9E99E99C9F0BDFBFDBFDBFD9EDADADADA0D00A0000000000000000000000000000000000A00000090C00C00000000000000000000000000000000000BFFFBFF9FFFF9FFFF9FFDBDBDBDBFBFFFFDBFFF9FD9E9A9F9FBFFBFDBDFFFDFFFFDFFF9F090FB9E9B0F9F9FDBFDBFDBFF9F9F9F90F00BC00000000000000000000000000000000000000000A00A0B00000000000000000000000000000000000FDBDFFFFFBFFF9FAFFFBFFFFFFFFDFDBDBFDF9FFFBF9F9CBD9F9FDBFFFF9FBFFDBF9F9E9F0F0DE90DB9F9FBFDBC90BDB9F9F0F0E90BC0900000000000000000000000000000000000000A0000900E00000000000000000000000000000000000BFFBF9FFFFF9FEFDFBFDBDBF9F9FBFFFFDBFFFBFDF9F9B9EB9CFBFDFBDBFDF9FFDFF9F9F0D0B99E90F9FFD0900BCBC0D0BCBD9F9E90B0E0E0000000000000000000000000000000A000000000000900000000000000000000000000000000009FBDFDFFBFDAFBDBFFCFFFFFDFFFFFDBFBFFDFFDFFFFFFDF9DA9BDFBFDFDAF9FE9FBDFCBCB0BCBC09F9E90BCBDBDBDBF0BC90FADA9CAC09000000000000000000000000000000000000A000A00A00E0000000000000000000000000000000000FDFFBFBFFDFBDFFFFFBFBF9FBFBDBDBFDFFFFBFFBFF9F9F99ADBDF9FDBEBD9FF9FFDBDBDBC9C90B9F0F9CBDBDBDBFDF9FFD0F09DBCB909E0000000000000000000000000000000000000000000000B0000000000000000000000000000000000BFBDFDFDBF9FFF9EBDFFDFFDFFFFFFFFBDF9FFDFFDFFFFBFFDBCB0F9BDBDBFF9FBDBCBDADB09E9C9AD0F9E9F0FBDFBFFD9FBDE9A0BCCA00000A000000000000000000000000000000000000000000C00000000000000000000000000000000000FFBFBDBDADBFFFFFBFBEBFFBDF9FFBDFBFFFFFFBF9F0FDBDBDBDBCF0FDBDADFDFBDBDBDADA90B0F09BCBDBDBDFBDF9FBE9F0BC9C0B9DAC0BC0000000000000000000000000000000000000000000F0000000000000000000000000000000000BDFDFFFFBDBFFBF9FEDFDFDBFFFFFDFFFDFFF9F9CDADF9EDBCBDADB9F9F0FDBFBDFBFDADBC9E9C909E9F9F9FF9BDFBFF9FF9FDBF0BCA0090000000000000000000000000000000000000000000000A0000000000000000000000000000000009FFBFFBDBDBFFFDEFFFBFBFBFDFBFFBFFFBFB9FCFFBF9BDFBDFFF9F9F0FBFDBF9DF9EDBDBC9A9DA90F9F9FF0F9FFFBDF9FF9FFBDCBC090F0ACA0000000000000000000000000000000000000000000D0000000000000000000000000000000000BDF9FFFCBDFDBFBFBDFFFDFFFFDFDFFBDFCDCBBF9FDFFFBDF9FFFDEBDBDFBFDEFBFDBDADA9D0E9E9BDBE9BDBFDBDFBFF9FF9BCBBDBDE0000000000000000000000000000000000000000000000000A0000000000000000000000000000000000BFFFFDBDBFBFFDFDFAF9EBF9FBFFBFDFF0BBFDF9F9F9F9FBFBDBFFFDBDBCDBF9FDBFDBDBDE9B909E9E9DFDBDBFFBDF9FF9FFDFDE9EBFCB0F000000000000000000000000000000000000000000000F0000000000000000000000000000000000FDBFBFFF9FFFEBEBFDFFFDFFFFFFFFFE9FDF9F9FFFBFFFFDFDFBDBDFEBCBBDBF9FFDADADA90C0F99F9FBFBFFF9FFFBFF9FF0FBDBFDBDF0C00000000000000000000000000000000000000000000000000000000000000000000000000000000BFBFDFFF9BFFFBDFFDFBDBFFBDBDFF9E9FBF9FBF9FBDFDBDBFFBDFFBFFD9F9CBDFFDBF9F909E9B0BE9FBDBDBDBFFDBFDBFF9FBDBFCBCBE00AC00000000000000000000000000000000000000000000F0000000000000000000000000000000009FDFFFF9FC9F9EBDABFEFFBDFFFFBEF9FDF9F9FDBDFFBFFFFBDFFBDFF9EBCFBCBF0FF9F0FDA90C9D9F9FFFFFFFDBFFFFFDBFBDFCFBDAD9E0900000000000000000000000000000000000000000000000000000000000000000000000000000000BFBF9FFBFB0F9EFDF9FBDFFBDFFFD0FBFFFFFBFFBFDF9FBDFBFDFF9FFFDBFDBDFF9FFDB00DA9ADADAF9F9FF9FFF9FDBCBDADBBF9E9FACBC0A00000000000000000000000000000000000000000000F000000000000000000000000000000000FFDFDFFDF9DBC9B0BEFFDEBDFFBFDBFFDFBDB9F9FDFBFFFFFBFFBFBFF9FFFCBFBDBFDADFDBAD0DABDBDFBFF9FF9FFFBFFBFDBCF9E9E9DBC00000000000000000000000000000000000000000000A00A000000000000000000000000000000000BDFBFBFFBCADABCFDF9FBFFFBFFDAFDBFBDFFFFFFBFDFBFDBDFDFDFF9FFBCBDBCBFDBFF0B0D00BDDBDBBCF9FDAFFBDFF9F9ADB9E9F9EBE9009C0000000000000000000000000000000000000000000D000000000000000000000000000000009FBFFFFF9F99A9CB0BFFFFBDFFDBFDBFFDFFBDBDBDFBFFDBFFFBFBF9FFBDFFF0DBDBFDBDBCB00D0BADADDF9EBFDBDFBD0F0FDAD0B9E9F09EC00A0000000000000000000000000000000000000000000E000000000000000000000000000000000FDBDFFFFFFF0A9ED0FBFDFBFBFFADFFFBFBFFFBFFBDFBFDBFDF9FFF9FFBBDFCBCBFDBCF9F0DAADDBDBA9BF9F9FFBDFFBDB0BDAD0F9E9F09A0000000000000000000000000000000000000000000000B000000000000000000000000000000000BFFFBDFFFFAD009ABFDEBFDFDFCDAF9FFDFDBDFDBDFBDBFFDBFF9F9FBDFDBFF9FBDBFFBDADA9DABCBDFFF9FFFFFFEBDFADFC09B0BCBDADAC0000000000000000000000000000000000000000000000C00000000000000000000000000000000BFDBFFFF9FDF09AFADFFBFEFBFBFBFFFFFBFBFFFBFBFFFFFDBF99E9FBCBDBEF0DADFFDBDE9F09E9DFFF9F9EFDBF9DBDF0FDA9BF0FC9FADA900000000000000000000000000000000000000000000000B000000000000000000000000000000009FFFDFFFFFBDE000DA9FFDBDFFFC9F9F9FDFDBDBDFF9FFFFBDBFFBF9DBFFF9BE9FB0FBFBDB09E9EB9F0FBD9FBCFFEF0BD0BC9C9F0BF0DBC000000000000000000000000000000000000000000000000F000000000000000000000000000000000B9FABFFFFFADA0F0DAFFFFFBDBFEFFBF9BBFFBFBDFFFFBDFFCBD9FAF9F9FFDF0DFF9FDF9EFDAD0DAD90CAF9E90909CA9FCB0BCBD0BF0CBC000000000000000A0000000000000000000000000000000E000000000000000000000000000000009FF9FDFFDBFDF0000BF9EFFBFEFC9BDE9EDF9FFDFFBDBDFFADBDBE99DFFFF0F0FFBDFBF9E90000B0F0ADB9C00E0E0009CA90D0BC0F09BF0000000000000000000000000000000000000000000000000900000000000000000000000000000000BD09FBFBFFCB0000BF0FFBDFFDBFBCFBFB9AFFDBFBDFEFCBDBCBC99EB09B9FBDA9CFBFDA00090BCD9FDB0CF0F0900E9CA9C00BD0B09EC0C000000000000000000000000000000000000000000000000E000000000000000000000000000000000FBF09FFDBFBE900C0FBFFFFBFF0DBFDFDFDBDADBDFBDBFDA9F9F0F99FEDE9FE9EBFDFFD09ADADBE9BFFFB0CADE0000AD09A9CAC9CA99A0E00000000000000000A00C00000000000000000000000000F00000000000000000000000000000000BDF9F09BED0D0E00B00FDBEDFBFFE9FBFAF9AF9FFFCBC000C0CBCB0F09B9BDADBDFBFFBFFF9F9E9FFFFFFDA900000000000DA90B09CAC0900000000000000000900A0A0000000000000000000000000B000000000000000000000000000000000FBFCBC09A9A900000BDAFDBED009EBDF9FFD9AD0A0C0A90A0BDF0D0BCF0DAD0FFBDFBFDBDE9FBDADFBFFC0EDAD0AC09ADA00CBCBCB000E00000000000000090C0090000000000000000000000000A0C000000000000000000000000000000000BFCB009AD0000000ADAF9FAD0BFFBDE9FF0BED0BFDB09CAD0DA0DA9E9B9EBCBF9FFFDFBFFBF9EDBFFFDB0F90BCAD09ADAC9CBC09000DA00000000000000000A00E00000A0000000000000000000000B0000000000000000000000000000000000FBC0000000000000000A0FBFCFFCFBFE9FD9BFDFFFFE0000AD009F9FCF9CBDFFFBFBFFDBD9F9BDBDBFEDACBCBDACBC090A909E00E9AC9C000000000000CA00090000000000000000000000C0A00C0F000000000000000000000000000000000009A0000000000000000CBDEBFEBF0F9FFAFE90BFFFF0F00000BCBCF9BCB0FBF9FDFF9FFFFADF9E9F0F9FF0F0CADBCBCAD0E0000F0F9A0A0000000000000909E000000000000000000000A000000A0C00000000000A0000000000000000000000AC000000000000000BDBDAFDE9FFF0FDADF9EF9FBFDFDADADBCBCB9EDAC9FDFFFBFDFF9BDF9BE9F9BDA9CE9E9C0000000090F9F9F0C9C000000000000000E0000A00A00000000000000C00A0CA000B000000000A00000000000000000000000090000000000000009E9EBFFFBFFDADEBFF9E99EDFFEFADF9F0F9F9EDA99FBFBDBDFBF9FDFBFFDBF0F0F9F9BC0A00F0DBCBCF0F9E9EB0A00000000000009A000000000000000000000A0A0D00000C0F0000000000000000000000000000000000000000000000000009FFFFCFF9EBFCBCF0F9EFDBE9DBDAFD0F0E0F09CBE9F9FFFBFDFFBFBDBDBDF9FF9F0BCB9D9F9E9AF9FBF0F9E90C900000000000000C09A00000000A000000000000A0AC0A0A0E000000000000000000000000000000000A0000000000000000A00BCFBFEFDFBFCBCF0E9EADBEBCFDAE9F9F00E9BDFBDF9FDFBF9FDBDFFBFBFF9F0F9F9EFADADBC9AD0DADA09E9A0E000000000000A900000000000000000000000C000A00D00D000000000000000000000000000000000000900000000000009CBFFBFDBFFADBBCBDFBDFDFEDCB9AD9E0C00F0FCB9FFBFBFBDFFFBFFBDFDFDBFBF9E9E999BDADBC9A9BF09F0000090000000000000000000AC00000000000000000AC009E0A0B00000000000000000000000000000000A0000A00000000000000BDADFEFDADFCFFFAFDEBFFFDBFCEDAC90BDBDB9FFF9FDFDFFF9FFDBDBFBFBFDFDF9FB9FEF0F9ADADAC09E0E0DA9E000000000000000000000A00000000000000A090ACA000CE000000000000000000000000000000009E00000000000000000BCBFFBFBFFBFBDBDFCBDEF0FFFCBDADBCBC9A9FFF9FFBFFBDBFFDBFFFFFFFDFBFBFFDFF9F9F9FF9F9F9BC909A0C0000000000000000A000000000A000000000000CAC90C0CA0F00000000000000000000000000000000009E00000000000000009CBCFDEDBDEDBCBDBFBD9F9ADBCBCB0BDBFDF9FFFBDF9FFFFDBFF9F9FBDFBFDFDBFBDFFFFFF0FF9FEDBADAC9A9E9E0000000000CA00000A000000000A0000000000A0A0A900B000000000000000000000000000000000A00000000000000000A0BFFBFBFEFBFFBFBCBCBE9EDADBDBDFDBF9FBFF9FDFFFF9F9FFDFFFFFFFFFFBFFFDFFBDBDBDFF9EF9FCDADBC9E9C0000000000B0000000000A0000A00000000A0000C0900E0E00000000000000000000000000000000AD00BC00000000000000DADAFDFFBDF0FDEDBDFBDBFBDBFBDFBFFFFFFDFFFFFBF9FFFBFBFBF9FFFF9FFFFDBFBDFFFDBF9FF9E9BBF9ACB00A000000000000900000000000A0C9000ACA0000E0A0E0E00F0000000000000000000000000000000000A00000000000000009ADBDFFADFBFFBFBFFBCFFFDFFDFFFFFFDFFDFBF9FBFDFFF9FDFDFDFFFDFFFFDBFFFDFFBDBFDBFCBDBEDC9EDBCBD0000000000000000A00000000000ACAC0009CA009C0009A0F00000000000000000000000000000000B0C0009A00000000000000FB0FFBFE9FFDF9FFBDBFFFBFFDBFFFBFFBFFFFFDFF9FBFBFBFBFBDBFBFFFFFFFBFBDFADBFCBDFADBFBE9E9ACAC000000000000A000000000000000000A0A0000A0ADAC0C090000000000600000000000A00000000000A9A000000000000000A90FFBDEDBFF0FBE9FDFFFBDFFBFFFDFFFFFFDFFBFBFFFDFDFDFDFFFFFFDFBFF9FFFDFBDFDFBDBFDBCBDBF9EF90B00000000000000000000000A0DA0A000C0CA00C00000A0AE00000A000000A000A0000000A000000A9AD00C000000000000009CBDBCFFBFDFFFFDFBFFBDFFFDFFFFFBFDFFFBFDFFDF9FBFBFFBFBDBFDFBFFDFFFDBFBDFBFBDFE9ADF9ED0F090AC0000000000000000000A0000000D0C0A90A0C0A0AC0F0C0F00000000A00000000000A00000000000000A0A000000000000000A9EBFF9EFFBF9FBFFFDFBFDFBFF9FFFFFBDFFFFFFFFFFDFDBDFDFFFFBFF9FBFBFFDFDBF9FDAF9FFCBDFBF0DAC90000000000000000000000F00000A0AC0E0C0A90C9A000B0F0000000000A000000000000000000000E00C90000000000000000009E9BF9FFFFFFFF9FFFFFBFFFFFFDFFFFFFFDBF9FBDBFBFFBFBFBDFFFFFFFFDFBFBFDFF9FDBF9FBEB9E9FA9A0000000000000000000B0C000ACA0009A00A90CA0A0CAC0C0B00A000000000A00000A000A00000000909A0000A000000000000009E9EDFFF0FFF9FFFFBDFFFFDBDFBFFBDFFFBFFFFFFFFDF9FFDFDFFBFDBFDFFFBDFDFBF9FFBFCF9F9DE9FC9C0000000000000000000000A000009C9E0C0F0CA00C0CB09A0AE0000A00AC00000000000000000000A0C0AC9A0000000000000000B0A9FBE9FFF9FFFFFFFFFBDFFFFFFFFFFFBFDFFDBDBDBFBFDBFBFBDFFFFFBF9FFFBFBF9FF0FDB9E9FEBDA9A00000000000000000000C0000A9C0A0A000A00A0CB00A0CAC0CF0000000000A0000A0000A0000000000A00000C09000000000000000D9E9FFBFFFFF9FBDFFFFFBFFBFFBDFFFDFFFBFFFFFDFDBFFDFFFFFFF9FFFFF9FDFDFFDBFDBEF9F9BDA9C0000000000000000A00000AD0000A0C00E9E9E0CB0CA9CA000B0F0000000000000000000000000A000009E9A000A00E00000000000000A9E9EDBDBFFFFFFF9FFFFFDFFDFFBDBFFBFDBDFBFBFFF9FBFFDBF9FFF9FFFFBFBF9FBDBBDBDADE9FDA900000000000000000000A00000C009A900A000B0CA0CA0DACAC0900A00000A0000A0000A000A0000000A000C0B000090009000000000B0F9FBFFFFDBFDFBFFFFDFFFFFFFFFFFF9FDFFFFDFDF9FFFDFDBFFFFFFFF9FFFDFFFFDEDFBDADBFF0A9C0000000000000000000AC90A0A0A0E0CAD0F0E0CAD0A0CA0900AE0000A00000AC000000000000C00000009A9AC000000A00A000000000C9AFE9FBFFFFBFFFFFBFFFBFFBFFDFFFFFFBFFBFFFBFFDBFBFFFFFBDBFFFF9FFF9F9FBB9CBDBDB09D0A0000000000000000000000C00D00000B00A0E00B00A9CB00E0BCF000000AC00000000A0C00F000000A00AC0C900B0A000C00000000000BCBDBFCF9FFFFFDFFDFFFDFFFDFBFFF9FFFFFFDFBDFDBFFFFFFBDFFFFF9FFFFBFFFFBDDFBCBDADF0A900000000000000000000000A0000BCBC0E0C00BC0E0CA00CB0E0AF00000C00000000A00900000A00A000C90A00A0C090090090000000090B0F9FBFFFBDFFBFBFFFBFFBFFFFFBFFFFFFDFFFFFBFDFBDFFDFFFFF9FFFFFFFDFBDFBE9F9FF9B0D0C9A00000000000000000A000000A0000A90B0F00A00B0CA0AC09C0B00A000000A000C0000A0A00C00000000A00A09A0C0A00A000000000000DADADBF9FFBFFFFFFFFFFDFFFDFFFFFBDFBFFFDBFFBFFFFBFFFBFDFFFBDFFFBFDFBDBFDB0BCF0A9A0000000000000000000000000000CAC0E0CA0CAD0E0CB0F00ACA0E000000A0000A00000000000000000A90C90C0000A000000000000000ADA9FBFDFFFFFDFFDFBDFFFFFBFFFDFFFFFFFFFBFFDFFFDBFDFBFDFFFBDFFBFDFFBF9FF9ADFDB0F90C0000000000000000000000A9C090A90B00BC0B00A90A0C00ADA0DF0000000000000000AC000C0A0000000A0A9000B0900009C0000000009A9F0FDBEBF9FFFBFFFFFDBFFFFFFFBDFFFFFFDFBFF9FFFFFFFFFFFBFFBFFDBF9FDFFDBDFA9A09C0B0090000000000000000000000A0E00CAC9E00E0DAC0E9CA0E00C0AF000A0000000000A000000A00CA00C00000A9AC00CB0DA00B0000000000CBDAFFDFFFFBFFFFFFBFFFFFFFBFFFFFFFFFFFDFFFFFFFBFFFFFFFDFFFBFFFFFBDFBEBDF9D09B000000000000000000000000000000B000A00F00A0CB00A09E9ADAD0D0000C0000A0C000000A009000000A0009C00C9A0A00000000000000000B0BF9FBFFBDFFDBFDFFFF9FFDFFFFFFFFFDBFFFBFFF9FDFF9FFFFFBFDFFF9FF9FFBDF9F0B00AC000A00000000000000000000000000C0F0DAC0E9CA00E0CAC00CA00AA000000A0000A00000000E00A000090BCA00B000900000000000000009C90F9EFDF9FFFFFFFBFFFFFFFFFDFFFBFFBFFF9FFDBFFFBFFFFFBDFFFBF9FFF9FFBDFBFDBCF99000900000000000000000000000A09A0A00A00A00AC9E90B00F0A90E0F000A000000000000A00000C0000E00000B0C0A00000B0000000000000A0F0F9FBFFFF9FBFFFFDBFFFFFFFFFFDFFFFFFFFFFFFFFFFFFFDFFBDFFFFF9FFBDFFBDFADF0B00000000000000000000000A000000C09C9E0CBCBC9A00AC0E00E0CA9CF00000000000000A00C000A0000900E00000B0900E90000B0000000000090BCBCBDBFFFFFDFFBFFDBFFBFFFFFFFFDFFFFFFFFFFFFDBFBFFFFFBFDBFF9FFBFDFBD009D9E9000000A000000000000000000000A00A00F0000AC0AC9A09E09A0CA0F000000000A0000C0000A000A00A00900F0F0CA000000000000090000090A09F9FFF9FBDBFBDFFFFFFFFDFBFFFFBFBFDBFF9FFFDFFFDFFF9FFFDBFDBFF9FDBF0F0EB0A00000009000A000000A900F000000000A0CA00E9E0B0DAC0E00BC0E90EA00000A000000A0000A000C00000000A00000B0090000000000A000A0000D9F0BE90FEDFFFFFFFFBFDFFFFFDBFDFFFFFFDBFFBFBFBFFF9FFF9FBFDBFF9FFBF0BFB9C09000A0000009000000000A0000A000000D0B00F0A0C0CA00A90AC0A9CA9F00A0000A0000000000000A0C000E000D0BCBC9C0A0000000000000090A00A0BC9FF9BFADBDBFBDFFFFFBFFFFBFFFDFBFFFFFFDFFF9FFFF9FFFDFBFDBF9FDB0DBCF9AC0000900A0000000E00000000C000090A0E0CA00CBA0A0CBC0E90F0CAC0F00000000000000A00000900000090A0A0000A0A009A0900000000000009090DB09AD0BDBFFDFFFFFFBFDFBDFFDBFBFDFBDF9FBF9FFBDBFF9FBFFDBFFDFBAD0F0B0C900900A0009E00090000A09E0A00C000E900A9CAD0C0D0B00AD0AC0A90B0D00000C0000A000000AC0000A00000090CB0BC9090C000000000000000000ACA0DADAF9EFDBFBDBF9FFFFFFFBFBFDFFFBDFFFFFDFF9FFFDBFFDB9FF9EBDFD0D9D09A00A00D00D000090E0009C0C09000A00A00E9CA00A0A0AAC0E00AC9ACAC0EA000A000A000000000000E0000A00E00A00C0BC0A0A0000A00000000009AD0909A0909CB9BEBDFFFFFF9FBDFFDFFFF9FFFFBF9FBF9FFBDBDBDBEFF9F9DA90B0A0AC00D00A000A0000A00000A09A0ACB009000F00A09E0F0D0C9A90AD0AC900F0F0000000000000E000000000C00000000A9ADAAD0090C0000000000000000A0000F0F0BDEDBDAF9FF9FFFFFBFFBDBFFBDBFDFFDE9FDBDAFDAF9F99E9AF9E9C09C9090A90D0B0000B0C900A00000D000E0E0F00AC9E0000A0A0AC0E00E90ACA00F0000000000000000A0000A0000000009C000D0AC000B000000000000000000F00090F0B9E9F9FF0FFBDBFDF9FFFF9FFEDBF0BF9FBF9FDBF9E9FE9FFD0F09A0000AC90CA00C00000000090D0AD0A000900A0BC0A00E9E0CAD0CA09E00E00BCB0F0000A00000A00000000A0C0A0000A0C000A0AD9A9A00000000000000000009009A0F00DA9BCBD0FBDFEFDBFFF9E9E9F9BC9FD0BD09F0BF0F9F09F09AD00E090A0000A909A0009000A0ACA0A00A0D0A0E9C0C0AD0E9A09A0A0B0F00BCBCBC00EA0000000A0000000000000000000000A0A090F0A0C0000000000000000AD00000AC900FADDE9E9FBDADBDBF9F0F9F9F0BCBCB0BDAFF0FF09E9ADFADBCB0900000D09AD0AC009A0CA90C900C900000AC0000A0BC0A0C0CAC90E0C00AC0000ACB0F00A0000000000A000E000A0000A0900090ADAFC9A000000000000000000A000009EF0900B9B9E90F9BDBCFADBC9ACB9CB0BCBDA909F09DF90DA900090E0000000A000C900000000C9A009A00E900009A0E9E00AC9A0A9ACA90A0E9A0E0F0AC0F000000000000000000000C000000E0000C0090AC9ADACA000000000009009AC00090E0DAC0CA9E9ADACB90F00BF900E9C909E9CBF09FAA0F09CA9F0A9000900090F00A000000090A0C0AC00000E09A0C9000F09AC0F00C0CAD0B0C9A9A0C9A0D00000A0000A00000000A000A000000ADA09ACBDB0C009090000000000AC000090BE909A09A90090F0DB0E909F00CBC90B0F090BC90F0D9F09E09C00D00A0000A0000900000A00A0009090BC000000C0A00E000E0A00ADA9A00E0E0E0C0F0E0DA00000000000CA000A00000000000000000AC90A0E9A9E0AC000000000009000A0C90E0000000F0E90B0C9A9E0C9B09AF0F0F0AD9ADADBE0A009A00B0009C00C90F0000C0A09C90C90A0E000B000B00BC0E900E090DAC00AC0E909A009A0A90AF00A0000A0000000000009E000000A900A09A0E9E9ADE9C90A9000000F00AC0000BFE900000F0009CADABC9CB0BC0E9C0DB00F9A0DB00090D000090CA0000A90E0000A9A0D00000A0C00000000000000B00ACA9ACA00B0E0B00ACAC9EAC9CAC0F00000000000000000000000000000CA9C00CB009E09AFAE9CA0000D000000009000FEC09E00090A9C0D0BE9CB0BC9A9E0CB00C9A0CBCBCA09000E90000BC00B0F009C000000A0900B000BC000000CAC0E90BC009CA0CA9C0AD0A9A00DA0BCB0D0000000000A000A000CA00A000000000A0A90CBE9AE9C9F0B0DA00000000000AC9E9A9000000A000B0AD0DA0F0CBADA9B00DA90D0B09090CA00900009C009AD000F0000B0AD00E0000F000A00A0A900B00E00BCAA0F00E0AD0AC0CBCA0CA00CA0000A000000000000000000000A00A0009C00A090C90BAF0FCA00A00A0000BC09A9FC0A00000C9CBCAD0E9ADADB0D0D0C0B090E0BC0A0E9000000000A0B0E000B000A9C00000000000000000009C0CAC0E09AC009C00F0BC0ACB0B0A9CB00FAF0000000A000000000A0000C0000009CACA9E09CBEB0E9C0F0BDAD00000000000ACBCBC0000B00A00909A9AD09E0DA0A9AD0CA090009C90A000000000D0C09000C9A9CA9AC900A9000A00E009C0A0A090A90E0A0E0BCA0C00E90E0CAC0AC9E00F000000000000A000000000A0000000090009A0000CB0EB0FE0F0FAD00000000090E9E9E9000090F0A0E0C0BE09A0DAD000B0D0E90A0000000000000A009A00DA00CA90C00AC000C000900000A9CBCA0C0E00D0B0C0ADA0E90E09A0DA9CA00F0D00A00000000000000000A000000000A0A0A0C00BCB0F00F09F0F0DA0F0000000009E9E00C00CAC00D090B0C09E0F090ADAC0A0000D00AD00000000090A00DA00900000B09000000A0CA000A000A009E0B0F0A0CA9AC00E90E0BC0F00E09EA00A000000000000000000A0C00000000A0D09C0B0BCA0F00F0AF0E9EBED0A90A00000F0E900A0B0090B0ACA0DA9E0900E0D0090090000000000000090AC0D0DA090CA90AC00CA00A000090009C0F00D0E000C0AC0B00CA9E9CA9AC0A00E90E090FF0000A00000A0000A0000000A0000090ACA9E0C09ADADA00D0BDE9C9AD0C00900000A9EE090CBCAC0C090F0C09E0F090A000B00CB00B0000000000009A0A0000A000C900A0C09000000A0C0A00E0A90ACB0AC9E0E0BCA00AC0CBC9CB0CA9E0E0F00000000000000000000000000000C0900A9A0E090F0F0E0E0B0FACBE9A0C0A000AD0900E9A0090A9E000B0E0900CA9CB0C0CB0000000000000A0000D0D000C000A0A09090AC0E0000D0A09A090CAC9AC09A09C9E00DA0DA9A0AA0CA9CA0DA0D0000000A00000A0000A00A0000A09A00AD0C0900E00DAD09AD0E9CBC9AC90AC00000ACA090D0F0AD009E9C090E0B000000B000000000000000000F0A0A00A9000D09C0E00A900000A00000C0CA0B0A0CA9E0CA0A0BE00F0CAC9C9E9CA0DA00CB00000000000000000000000C0000A00F000B0E0A9AFA9E0AD0E9AF00AC9A09090C0BC9000E0A00DA09E00A00E90C09E000000000000000000000000D0000000A9A0A0900C000B00900A000B0A9C0C0CB0E00B0E90C09E00A90E0A0AA9CA0BCBE0A00000000000000000C000A0009C0000A0C0900C009EDBCA09AD0BC9AC000C0A0000E00009C9E00F09AD0F00090A00000000000000000000A09A00000000C00C0D0CA0A9000C00AC000BC00C0A0B0AC00DAC00E9ACA0CBCAC9E0C9C0AD0E00F0000A000000A0000000A0000000A000BC0B0E0F0A9E00ADADBC0AD0AC9A9E0A0900009E9000A09AC0FE0A009E00000000000000000000000090C0DA000090A09A00A90C00ADA0000000C00A9A0C0CB0ADA00ADA0C0BCB0CA9A00B0A0F0A09E0D000000000000000A0000000000AC0B00090090009009F0AD0E9ADA9CBAC0090CACA00000A0000C09A09C9CA0000000000000000000000A00000000000A00009C00000A900C000BC0B0B0000C00B0A0C0A0CBCA0F0BC0ACBC0CAD0E9CAC9E00BB00000000A00000000A000A000090000C0ACA0E0A0E0E0ADAADADA0DA0D0B0CA000900A000009A09AC9E0A09C0000000000000000000090C0CA09A000C00CA00A09E9C00A9A0AC00000C00A90A0C00E9A0DA009C0AC0AD00A0BC0A0CA90A09E0E000000000000000000000000000E000B0009000D0909ADA9CBCBDA0CB0ACB009000A000C0000C00CBE9C00000A000000000000000000000B09A0C09A090009C0000A0BC0C0909A9E000A0C00CB0E90AD0AD0EA0E90F00AF0E09E9CBCAC9CA9CF0000A00000000A0000000000A0000E0000A0E9A00E0000DA00E0EDA00F00CB0E0AC90C9A0000A0B000A000A000000000000000000000A00000C9A0C9ACA90A09A0D000A9A0E0C0009A0900A00000AC0AC0A90DA0E00E90090E00A00A9A0ACA0D00000000000000000000A00000000000CB0C00C0B00A00A0DA909ADAC00F00C90000A000000009C0F0D000000D000000000000000000C090E9A0C9A0C90CA000C0A0E90C0D00A0000C0E0BC0A0CBC9ACB0CACAC90E09E0E0E9CBCBC0C0F09E0B00000000000000000A000000000A000A000B00B0C09C0B0DAC0FACAD09A00B0A0DA0C0000000000B000A00C00A0000000000000000090B0E90C9A0C900A09C90A90900CB0A0B0CA0E0A9000000A00AC90CB009A0E90E0B0F00A0AC0B0A0CA09E000000000A000000000000000000000000C0AC0A0A000C0A0BA0DA9EE0D00C0CA00000A0000000000F0D0000000000000000000C0BCAD0E9E9AC9A0A009CA0AC00CACB00C0C09009090C0E00AD0CAD0E0ACBCACB0CA9AC00F0F0CB0CBC9AD0EF000000000000000000000A00000000000A00000D000A0000C0DA0F09AF0F0B009ADA00C00A000A0CA0A0F0A000000900000009A0BCB9AD9A9E9AC90C9E000090B0A90CA90B0E0ACACA0A000C00A90A90AD00A90CA9C09ACA000B00E00A0CA00F00000A0000000A000000C0000A0000009000E0A00009CA9A0B0C90FAD0A0ACAF0C000900000000009C0000000000E00C0DAC0E0D000C0A0C00000000A00AD00AC0D0A00CA000090000D000A90AC0E0CADACBCACBCA0AC0BCBCACAD0BC0E90F090000000A0000000A000A0000000000000E900900AC00000C00CBAE0C0ADDF0D00FADA0A000000000A09E0AD0CA0000A0B009A900ADA9A9C9A9C09A0000900A0CB00AC90B0C9ACACB0A00A000000A90BC00A00DA009AD0BC00AC900AC0B00E00E000000000000000000000000000000000000AC0000A0A0A9E9AC9C9AF0A0ADACB0DAC00D000000000000D00A9C900090CA0C00E90000C0A0CA0A0CA900CA0CB000090AC00A009000C000C000CA90E0CB0F0F0A0F0E0AC0A0E90E9E90E0DA09EF0000000000000000000000A00000000A00A000A000000D000E9A0AC00D0F0E9ACA0DADA0AC0CA0000000A0F0A0E0F0E90DA9E90ADADA90DA9C900000E0009000BCAC09AC0DACA00000C000A0000E9AA0E000E900A9C0BC0B0EA0A0E90A0CA00F000A0000000000000A0000000000000000000000000000A0D0E9E9A9E0A009ADADA0DA9C90A0000000A00000D09A0BCADACB0E0D00000E000A0E09CB09E0A0E0009A9E09A0090C0A000B00C090E00C9C0ADA0E0F0E0AC0F0C90D0E00E9E90F0900000000000000000000000000000000000000000000A000A0BC0ADE09CADAC09A0DA0E0A000000AC00C00C0A0E09C09AC90E09A0CBCB090F0090A000E09C090F0AC000AC0AC0A000A000000A000F0A0F0AC90B0C0BC9A00A0E0A90E9A00E00E000000000A000A000000A000000000000000A000000000000000F00BE0B0A0BCAC9ACB0D0F0D0E00000000A9009CA0AC00A0900CB000C0E00C0AD00E0900B0E00D00CA900900090C00C00A0000F0A0DA0C9ACAC0BE0AC0E9CB0F0CB0C0CB0CAF000000000000000000000000000000000A0000000000000000000E909C0F09CB00E90C0A000A09000A9A0900E0000D0A90D00CA00F0A0090A900A0090A0E090F0ACA90C00E00A00A00000C00000C9A0CB0E090AC00D0A90A0C00A0CA9A0CA90F00000A000000000000A000000000000000000000000000000000000ACAF00E00CB00E9AD0E00000E00C00A0000AC9A0D0E0A0A9000090A0000AC0DA00C900E00009000A00000C00000A0000ACA0A0CB00E90EADACA0AD0E9E0AD0F00E0DA0CA900000000000000000000000000000000000000000000000000000A0DA909E09EB0FE9AC0A90E0A009000C00C9000AC00A0BC90C0E00E0D0E9C09A00C0B00F00BC00CA000A000A0000000A0000900DAC0E90E9000B09CACA00BC0A00E90A0DACE000000000000000000000A0000000000000A000000000000000000000E0E9E00C009E0BD0E090C000A0A000A0E0900F09C00E0A90F090A000A00000B00E00000A0A0009C0009000CA000000000E0A09A0CA0CADACACA090DAC9E0CB0CAD0A90FA000000000000000000000000000000000000000000000000000000A00B0E9E9ADA09E0A09ACA90AC9C00B00000E000E0AC909C0000E000A90AC9E00F00BCAC0000B0CA00A0C00A00000000A000D0E00F09E90AD00ADA0E00A00F0CB00AC0E0D000000000000A0000A000000000000000A00000000000000000000000D0090A0CA0DE0F0F0C90CAD0A0BC0CBCB000F00090ACA0A0A000D00C090A00C0000009AC00C0A000000A00000CA0000CA0A09AD0AC0AC0A0F000E90F0DA00A0CBC9A00B000000000000000000000000000000000000000000000000000000000A0A0E9CB0DA090E0F0ADA90AC9CADA000E0F00BC0ACB0D0D0C9A0A0A00AC09A0AC0B0E00A90000000000000000000000090CAC0AC0BC9A9C0A9E90E00A00E9CA00AC9EE0000A000000000000000A00000000000000000000000000000000000000C900AC0A9CAC900BCA0CBC9EB009E9E900AC0AD0000A0A9AC00D0DAD09AC009A0C00900CA000C0A000000A00000000ACB09AC0B0CAC0E0F0C0E00AC9E90A0DAC9A00F00000000A000000000000000000000000000000000000000000000000000A009AD0A09A0E009C0BCA09CF0E000E0D0000ACBC0C0C09ADA0A000A000A0C0B0AC0000000000000A000000000A0000CAC0BC0A09A0900A900F09A00E0DA00AC0F0D000000000000000000000000000000000A00000000000000000000000A000C0AC0ADAC0F09E0A9E0DACA009ADA9A0ADA0090A9A9A0C000C000AC0F00DA0C000A000000A00000000000A00000000A90AC0F0DAC0E0E9E0E0CAC0F00A0CBC9A00B00000000000000000A00000000000000000000000000000000000000000000000BC009A00E009E90A0B0ADAC000CBC00DACA0C00C0A0A00B0E90000A00000900CA0000000000000000000000A9E0CAD0B00A00F0B000A90A90B00F0CB00AC0EE00000000000000000000A00000000000000A000000000000000000000000A00000B0E00CB0BCA0E09C0D0009ADA00BCA000C900A0000D0000000A0000000ACA0000A0000000A000A0000A000000B000AC0E0DA00CACBC0E0E0CAC0A0CAC0A90F000000000000A0000000000000000000000000000000000000000000000000A000090E9AC00BC09E0A0AE90C00090090F00A0E0DA09000AC00C000000CA0000000000000A0000000000000000000E9C0B09A0CB0AD00A0900B00BC9A09AD0E0D00000000000000000000000000000000000000000000000000000000000000000C0AE9C00AC00A000D0D00A0A00E0E0E00F0000000E000000A0000E0000000000000000000000000000000000E0E9A0AC0E0DA0C0A0E9CACAC0E00AC0E00A00B000000000000000000000000000000000A000000000000000000000000000000A00D00A00900B0D0B0A000C90C000900000000A00000A000000000000000000A000000000000C0000000000A00900CAD0A09A0C0B0D00A0B00B00BC0B00AD0FE0000000A00000000A0000000000000000000000000000000000000000000000000A0F009ACA0C0AC0C000A0000B0000ADA000000CA00000000000000000A00000000A000000A00A000A0000000ACA90AC9E0CA9AC0A0E9C0F0CAC0A0CAD0A00F000A0000000000000000A0000000000000000000000000000000000000000000000000E000000000A00A0000A0000E0000CA00000000000A000A0000000000000000000000000000000000000C09CAC9A00B0CA09E090A000A09AC9A00AC9E0D000000000000000000000000000000000000000000000000000000000000000000000A000000A000000000000C000000A0000000000000000000000A000000000000000A0000000000000A000A00A0A0C9E0CAD0E0CAC0F0E9CAC0AC9E00A00A00000000000000000000000000000000000A000000000000000000000000000000000000000000000000000A00A00000C0000000A00000000000000000000000000000000000000000000000090E9C9C0A00B00A00B09A000A00A9C0A09AC9EF00000000000000000000000000000000A000000000000000000000000000000000000000A0000000000000000000A00A00000A00000A000000000000000000A000A00000000A0000000000000E00A0A9E9E0CAC0F0CAC0CAC9E9CA0BCAC0A00F000000000A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A00000000000000000A0000000A00000000000000000000A000000000F0C0A000B09A00A90A909A000A0C009AC9E0D000000000000000A0000A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A000000000000000000000A00000000000000000A000A9ACACAC0E0DAC0E0E0E0E0E9E9ACA0A000A00000000000000000A0000000000000000A000000000000000000000000000000000000000000000000A000000000000000000000000000000000000A0000000000000000000000000000000009E0C09090A090A09A090009090000000D0C9EF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A0000000000000000000000000A000000000000000000A0000E009ACACAD0E0E0E0CACADACACACBCADA0A0A0F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A00000A00000000000000000000000000000000000000000000A000A000000000000E0090A00A90090A090000A00000A00CBC0D0D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A000000000A0000A000A00000000A000000000000000000000000009A00E0E9CAC0E0E0DACACAD0DADAC0DA000A0AA000000000000000000A00000000000000A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A000000000A0000000000000000000AC0DA9000A09A0900A000B000A00090A00CA9C0F0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A0CADAC9E0CACAD0CBC0CAC0E0E0E0E0BCA0AF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090A000A000B000A000A090B090900090000D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ACADACBCADACADACBCADACACACACADACADACA0F0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010500000000000016AD05FE, 'Margaret holds a BA in English literature from Concordia College (1958) and an MA from the American Institute of Culinary Arts (1966). She was assigned to the London office temporarily from July through November 1992.', '2'); +INSERT INTO employees VALUES ('5', 'Buchanan', 'Steven', 'Sales Manager', 'Mr.', '1955-03-04 00:00:00', '1993-10-17 00:00:00', '14 Garrett Hill', 'London', null, 'SW1 8JR', 'UK', '(71) 555-4848', '3453', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E506963747572650001050000020000000700000050427275736800000000000000000020540000424D16540000000000007600000028000000C0000000DF0000000100040000000000A0530000CE0E0000D80E0000000000000000000000000000000080000080000000808000800000008000800080800000C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C00000000000000A0000000000000000000000E900000000C9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000D000C000000000000000000000000000000000E000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A000A90000000000000000000000CA0000000E900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A0000000C00000000C00000000000000090000000000000000C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A0000000000A000000000000000000000CA00000000000000000A00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C00000000000000000000000000000000909000000000000000C00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000CA0000C000000000000000000C000000E0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A000C90000000000000000CA9000000E90900000000000000D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A00000000000000000AC0000000000009000000A0000E0E000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900CA0000000000000000B00E900CB0900000000C00000C00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C000000E000000000000000000CA00F0000DA00000000000000000CACA90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009CA0000000000000000C0000000A90CA9C9090000009000C0C000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C0000C0B0000000000CA000E0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A0000000000000000000000000000CA09009000000000000E9000000000000000000000000000000000000000000000000000009A0000000000000000000000000000000000000000000000000000000000000000000000000000000000C0000C90000000000000000000000000C000DA09000000000000C9CE0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C000000000000C0CA00000000CB0D000000000000000EA9000000000000000000000000000000000000000000000000000A0B000000000000000000000000000000000000000000000000000000000000000000000000000B00000000000A000000000C0000C0000C0D00C0F09CB0B09000000000000DE0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000D0000000000000CA9E9F0B0F0B9CBCB0D0000000000000000CF0000000000000000000000000000000000000000000000000000A00000000000000000000000000000000000000000000000000000000000000000000000000000C00000000000000000000000CB9C0D0A9C9ADCB9AD0B090000000000000EFA9000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000000000000000C0A90000000000A00000000E0DE90CB9AD9CB0DB0F0DBC900000000000000000C000000000000000000000000000000000000000000000000000E00000000000000000000000000000000000000000000000000000000000000000000090000B0000000000000C0000000C9CA90F9AD0DA9AD9AD90F00BCB09000000000000C00000000000000000000000000000000000000000000000000000A9A0000000000B000A00000000000000000000000000000000000000000000000000000000000000000000000009000E0F0BDCB0F9A9A9C90BC9AD0F9C909000000000000000E000000000000000000000000000000000000000000000000000000000000000000A0000000000000000000000000000000000000000000000000000000000000000000000000000C0C90DAD0B0D0C9C9CBCBC9A9CB9CB0E900000000000000E0900000000000000000000000000000000000000000000000000B00B00000000A000900A00000000000000000000000000000000000000000000000000E00000000000000000000A0B0E9A9AD0F0B9A9A90909ADF99CBC99CA900000000000C0C0000000000000000000000000000000000000000000000000B00A0000000000000A0000B0000000000000000000000000000000000000000000000A000900000000C0000000000C0CB0D0D9A99C0D0D9E9E9C900FCBDBE99C09000000000000A0000000000000000000000000000000000000000000000090C00900000000000090000C000000A0000000000000000000000000000000000000000C0900000000000000C0000C09090DA9AC9CA9B0B009090B0F90BC0D9E9B00000000000000D0000000000000000000000000000000000000000009A900A0090A0000000000A0A00000A000000000000000000000000000000000000000000000000E0E000000000000000C000ADADA90DB9A9D0C90F9E0F0D90F0DBFADAC9000000000000CA000000000000000000000000000000000000000900000000DA0000000A0A0B0090000000000A0000E90000000000000000000000000000000000ACB000900000000000C0000AD090090DA9C0D00B9E900990B0E90DBC0DBDBC90000000000DAD000000000000000000000000000000000000C0A000000CB0090000C0F090000A000000A900009A000A900000000000000000000000000000000C90000000000000000000CA9000ADADA9CB9A9BC0090B00E90D9EBC9F9EDADB0900000000CACA0000000000000000000000000000000090A0B0000B0DA000A000ECBA00A0A009000000000A0000000C0000000000000000000000000000000000000000A0000000000000000090D09090B0C9009A90C0D090F0A9C9ACB9ADBCF000000000000D00000000000000000000000000A0B0CB0C000090000000090D00FF0C9E9090A00000000000000000CB00000900000000000000000000000000CB000000C900000000000090CBCB0BCBC9C9B00F0D00B909AD009C9BC9FCDBE9B0900000000EDA00000000000000000000000ADAC90090009000ACB000090E00A00EBEA0ACA9000000A00A009A00000E90000EB000000000000000000000000000000000000000000900E0090009C909A9A00C909A9D00AD009F0BC0ADA9BC9FCB000000000000000000000000000000000EFDFBDADA00A009A9000009A009A90000C9EF9ACA0000A90090000000000ACB0000F000000000000000000000000CA0000000000000E000E9000A9F0B0F00D09DA9AC900A9D0A9E00D0BD9ADE9FE9FC9000000000C0000000000000000009EFFFFEBCB0090090A0009009A000000C0000AEF0E090000A000A000A0000000CB00000CB0000000000000000000000009000000000000009E0000909C09C909A09CA9C900F90CA9C099F0F00ED09E0DBCBB00000000CA000000000000000CEFEFFFFFBDF0DA0000090C0A0000090E09A00000DEBC9A00B0000A90A000000000FE90000A90000000000000000000000000000000000900000090F0BCB0B0B09AD9A09090B900A99090F0009AD9A9E9F9EDE90000000CA90000000000000CFFFFFFFEFDEFA0B090E9000B0090A9000900090000A0EB00A009A9000009000000000FF00000E0000000000000000000000CA000000000A09A9E00000D0909C90BC900C9ADA9CAD09000F90E9F0DA0DAD0FADBDE90000000C000000000000CEFFFFFFFFFFBF9FD00A900A0000000C00A0009E00000000000DAE000A0A9A000000000ECBC90000B00000000000000000000090900000000C0C0000F09B0B0DA09C0B09A900900900BC9F0009000B0DA9DAD0F0E9F0000000000000000000CFFFFFFFFFFFFFFEF0BC9000090900F09000900A09000900000A0E09ACA090000000000000FFB00000CB0000000000000000000E0E0000000009A0000909E909C909A900D090F90E9A09090090BC990C9A9CBCBCDBFDA90000000E000000CFEFFFFFFFFFFFFEFFFF9FA9A09A9C0A0000A090009C0A0000A09A00FA9AC90B0A00000000000EFE9A0000A00A0000000000000000C0900000000000090ADA9E90DA9A9C90F90AC900090C909A09AD000E09E9CBCBCB0EDADB000000C0000CFFFFFFFEFFFFFFFFFFFEDFAC0D09000000900900A0CA000D000000000000CFFEAC00900000000000FFF9000009000A00000000000000ADA9000000000E000909099A909090A90A99B00B009000C09C009A90900F0F09EDF9EDFC000000000EFFFFFFFFFFFFFFFFEFFFFFBFDBB0A00000B000A00900090B0A0A0000A00000ACADB0A0A0000900000C0FFEB0000A0000000000000000000C0E000000000900DA9CBC9C9AC9A90C90C0090090A90B09A90BC0090F0090F09A0F9A9B000000E0CFFFFFFFFFFFFEFFFFFFFFFFFEBC9D00DA90000900A009000009000A0090000000F0E09000000A000000FEFF900B00000000000000000000CA9000000000000B909B09A90990C90B09A90F090C900000000009AC009E0F0FCFDADFCF900000D0FFFFFFFFFFFFFFFFFFFFFEFDF9FFA0B0000090F009C9000A0D0E000900A00000A000A9A000000000000CEFFE9A00000A900000000000000CB00000000000ACBD0F0C9099A90A900900900000A900090900900000ADA090D0B9A9E9E900000CAEFFFFFFFFFFFEFFFFFFFFFFFEBEF00D09A09A000000000A0900A900A00009000900A00000000090000000FFDB00000000A0000000000000000F0000000000990B99B90BC0DAC90B0C0BC909090009000000090909000D0E9EDEDE9E9F000000CFFFFFFFFFFFFFFFFFFFFFFFFFFDBF9A000000900090A00900090000000A0A00000090000C0000E0900000E0B000A09A0D0B0000000000000AC0F00000000CADBCBC0BC99A0990009A90909A009000090090000000000A90B00B0FCBCFB0000CFFFFFFFFFFFFFFFFFFFFFFFFFFFADAD0B0909CA09A09090000A09E0090A0900000A0A00000A90000A00000B000B0000000A00000000000000DE900000000C9B90999909A090A09090900A0009000900000000000009000C0C9EDE9F0F090000EFFFFFFFFFFFFFFFFFFFFFFFEFBFFFB0B00CA0009000000A0DA9C0090A00000A9A00000000A9000B000000000000000000000000000000000CE9A0000000E9BD0F9A0E9AD90D090BC0009090900900000000000000000909A9AD09AE9E9E900CFFFFFFFFFFFFFFFEFFFFFFFFFFEDB9CBC90090900009A009000000B000090A0C00000B000000A000D09A00A00A0000EB00A0EB00000000000CBC09C000099F09B9C99909009A900090B000000000000000000000000000000C0A0FD9E9E9000EFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFA900B000A90B0009009000B0C00A0A009A9A90000A00000000A00000900000CAF0B00CFFF9000000000ACBE000000E99F9CB9E9A909A900F09A0090900090000090000000000000000000DA0AD0F9E90CEFFFFFFFFFFFFFFFFFFFFFFFFFFFBFDBCB000900000C900E00A9000B0090000A00000A0090009A0E909A0B00A090EBE90000FFFFB00000000C0F0900000F9BF9B99090D0B0D0990900900000000009000000000000000000900900D0AD0EDA0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDADB009A00C9A90A0909000C09000A090A00000009A0000E0F9ACA00000000A0090000EFFFFFF00000000FE9E0009DB9E9DADADA9A9C90B0000090090090900000000000000000000000000C00BC9E9B0DEFFFFFFFFFFFFFFFEFFFFFFFFFFEFBEBF0CB0090B000009A000000BC00000A09090A00A0C0A000F0ECBDADA0A9000B000A0CFFFFFFFFB00000E0F00900CAFDBDB99909C909A90090B0000000000000000000000000000000000009AC00E9ECFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBC9B0C0000000090000090B000B00B000A0A000000A9000000B0CA009000A0000A000FFFFFFFFFFFF9000C0FA0009F9F9BCBDA9A90B090DB000909090000009009000000000000000000000009C09A909FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFBE9B909A9009A0B0090A0090000000B000000009000E900A000A9E0AC0A09A09000EFFFFFFFFFFFFF000AF09000F9FBF9B9A9D090D00B000900000A0909090000000000009090000000000000A9C0DACCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFCBC00A000A9000C0B00900CA09000A000A90000A0A00A00C90A9CA900B00000000FFFFFFFFFFFFFFFB00C90000FFFBD9F09D9A90B0B9090900900909A00000000000090000000000900000E090C0B00FBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCBD0B09090D009090C0000A090A0A09009000A00000B0DA00AC00ADEFA09E0B00EFFFFFFFFFFFFFFFFF90CA000CF9F9FB9F0BC9AD09C0090A900900000909000900090009009A90900A90090C00B0CAD0CFFFFFFFFFFFFFFFFFEFFFFFFFFFFFBFBA90000A000A00A009A090009009E00A00A90090000A00000B00000EDF0000EFFFFFFFFFFFFFFFFFFFFB0D0009FFFBDBDBD9B090B09B009009A090900000090090009C0090000DA90009009A9C09000B0CFFFFFFFFFFFFFFFFFFFFFFFFFFEFDEDADBCB090B0909090090090A000A90B00A000A00A0009A9000CA9A90AA0FFFFFFFFFFFFFFFFFFFFFFFFF9A000EFBFDBDB09AD9E909009009000900009090B00900DA09090D090000909C9C09CA9E9AD0DAFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFBDA090C000000A00A000A0009009CA00009A0D0000B0ACA000A9C00AC9CBEFFFFFFEFFFFFFFFFFFFFFFFBC090FFFDBBCBDBD0A9090090A90909009090A09009009009A909A9E9099AD0B0A9CA9C00C00ADEFFFFFFFFFFFFFFFFFFFFFFFFFFFFBCBC9A00B090B090909090C900A9A09E09A0000A900C009C0000E0BC9A0ACBDFFFFBFFFFFFFFFFFFFFFFFFBC00FFFBFDB909A9909ACB0C90A00090A00909E990A9A90C90BC9090B0C9090D9E09CBCB0BC90DFFFFFFFFFFFFFFFFFFFFFFFFFFFFDB0B009000A000CA000A000A09009E09E00A0A9C0B00A0A0B0009E0A0D0F0AEBEFBCFFFFFFFFFFFFFFFFA90B0CFFFF9BDFBD9E9909009009090BC9090F090AD90D09B9AD0BCBD0DB0DB0F0B9FE9CBCD0BCA0FFFFFFFFFFFFFFFEFFFFFFFFFFFBEFF09A090909C909009009000000C90E9A90900A9C0B0900000A00F0DA000D00CB0EFFFFFFFFFFF9FA90000C0BFFDBFDB9CB090E90090A9090000909A90F990ADA9E9C99F9BD0B0C9B0D0FDE9DEBDA9AC90DEFFFFFFFFFFFFFFFFFFFFFFFFFAFDB0DA90A0000A000A9000A090A9090A9A000A00D0A90C0A09A000E0EA9CBFABCB0B09E9CAD0A900A00000000BCFFBFDBBDB99E990B9090900F909A0F0DB09CBD99C90BDA90D0BD09B0DBF9CBDEBDECBC9ADA0FFFFFFFFFFFFFFFFFFFFFFFFFFDBADB0C0909A909A9000090000000A9C0C9A00A0A09E9A90A0090900D0A0C0DEB0C00A00B0A900000090009000CFFFDBFDA9E990A900A9000900F0990B9CBCB9ADA9BD09DBDBD9ADBCB0D0FBCFFDADBCBC90DACFFFFFFFFFFFFFFFFFFFFFFFFFBFDA009A00C000000D09A009A9090CA90AC909090E00C0E9000A0A00AFCB0E0F9A0FFCB00000A9A90000CFA900CFFBFBDBDB90E9090D0090B09009E0D0A99BC99AD90BDA9090BC90D9D9AD0D0F0FDADF0BCB09ACFFFFFFFFFFFEFFFFFFFFFFFFFAFDB00909A90B0900A0090000E00090A90A0A00090B0B00B0A0000AD09E09A00CFFFFFFBCB0000CA9ACB900000FFFFDFBDBCB99C0B090A9C90B9A99A9DBC9B9E9B0F9B9DBDBDBDB9A9E99F9F9FFADF0FDADAD09EFFFFFFFFFFFFFFFFFFFFFFEDF9ADA90A000000A090900A0909009E0D0A09000A0E09C0F0C909A000AFE9AC90FFFFFFFFFFFFFFB9D0DA000000FFBDBBDB09900A909090900B0C9DA9DB09F9C909D90D9A9ADBC9BC9F99E9E9EDADF0FF0BC909E9FFFFFFFFFFFFFFFFFFFFFFFBFAD0900090090909000A0D00A00B090A0D0A0A9009CA9A00B0E009A9C0BE90A0CBEFFFFFFFFFFFFF0BEF90000CFFFFFDB9DBCB09090A090A9C99B0DB09F090B9F9ADB9F9D909B0D9F9EF9F9F9F9E9FE9EDB0F09ACFFFFFFFFFFFFFFFFFFFFFFF9F0B0AD0A9A0A0000B09009090900E900AD0000A0A0D090C0B0F00CA0C0FEFDA009ADAFFFFFFFADA0CFFF90000FBF9FBDA909090DA99C0990B0F0B09F0BDBD090F990F9A9F90DB0B0D9EBD0FCBCBD0DF9EDB9E0D9AFFFFFFFFFFFFFFFFFFFFBFE9F0D00900909C9A000000A00E00090E900A9E00C0B0A0CA9C00BCBCBFFFFFFFFBC00000CB0BC9A9CFFFF00000FFFFFDBDBCB0F009009B0C90909DBC990909BDB9ADB90D909F00D0DA9990F99F9DAFF0F90FC9F0ACDFFFFFFFFEFFFFFFFFFFFFBF0B0B00090000A09C9A9090909A9E090A0D009A0B0C90A9CA9FCBCBFFEFFFFFFFFFFFFEBCFE9E9EBFFDA9000CFFBDB9A9090900B90B000B0F0BCB0B9E9A9F0B09D99C9A90900900B0D9EDBDE9FCBD0FD0F09B00D9EFFFFFFFFFFFFFFFFFFFF0F0BC900A9A0A90900A0000AC0A09090AD09A9A0D0C9A0BCA0DA09EFDEFFFFFFFFFFFFFFFFFFFFFFBCFFBDA0000FFFBFD90F0B0090C9090909099909D099D09D9DB0B0B900F009A90D0B09BC9BCBBCBF9AF0FADADA09EFFFFFFFFFFFFFFFFFFFFFF90A090009C0A09090909090D00CA900AC00DA0B0C9C09CB0DAC9AFFFFFFFFFFFFFFFFFFFFFBDFF9CFFF99000FFDFBBC909090090A9CB0DA9E9ADA9BCB0B0B909D9D0D9009000C9A9C9E9BCBDDBD0FCDBD09090DA9CFFFFFFFFFFFFFFFFFFFFBDE9DA09C0090900A000A000A0B0A90E909A900D09A0B0F00FADAFCFEFFFFFFFFFFFFFFFFFFFFFF9EBFFF0000CFBFBDB9A90F09A090900909090D90D099D9D9CB9A909A0900090900CB090DBDAF0FF9FADA9E9E9BCF09EFFFFFFFFFFFFFFFFF9EB9A009A0B0A00A9090909A090009C090A0C0E9A0E0D0E00F0D0F0FFFFFFFFFFFFFFFFFFFFFFFFEBDFFF0B0000FFDFB9C0DA9090DB09A90B909A9A9A9E9A9A9B9C99A9090909000009090DADAD9FF9F0DB9E9C9AC90BCFFFFFFFFFFFFFFFFFFFF9E909009000909000A00C0900F00BCA0D0B090C909A090F00FADEFFFFFFFFFFFFFFFFFFFFFFFBDF9ACB90000CFFF9F09B09090B000090D0A00D09C9999D99C09BD09C90000C9090900F0BC9DFFD9E9FF9E90B0D9E9CBCFFFFFFFFFFFFFFFFBF0B0F00B000900A0DA909A900E90900900A9C0A0B0E0DACB0F00F0FEFFFFFFFFFFFFFFFFFFFFFDFFEFBDEF90000FFBF9F09BCB0D099BC0B090D0A90B0E0B0DB99C90B090B9090A9090F90D0FA90FAFDF9AD9E9CB0A9E9CBEFFFFFFFFFFFFFFFFFFF90B009E0A90D00000000B000A09E0AD00A9C9C090A09C00F09EFFFFFFFFFFFFFFFFFFFFFFFFADBD0B090000EFFFDA9BC9999A9A00990909090909999D9B090B9F9DB900D099CBDA90F9F9DFF9FDBDEDB090B0D9E9EBD0FFFFFFFFFFFFFFFFFBDAF00900900A00B09A090009AD0000909E90A09ACBC9CB0F0FEFFFFFFFFFFFFFFFFFFFFFFFFFF9E9E9C00000DFB9B99C90F0AD90D09A09A09A9E9E90F0B0D9BC909A9CBDB9BCB90DBDF9E9FBCFDBCBB90BCBCB0E9CBD0FFFFFFFFFFFFFFFFFBCF900BCA90A900900009A009E000E90CA000C9AC900B0A0F00F9EFFFFFFFFFFFFFFFFFFFFFFFFFFBDA09A0000EFFF9CA9A90990090900D009C90909A999D9BC9BDBD9F9909C99C9F9CB0DBDEDBF0FF9DAD09F0C99BCADADEFFFFFFFFFFFFFFFFBA9E9090090090A90B0009A009A990B09C9A0C90E9C0D090F00EDFFFFFFFFFFFFFFFFFFFFFFFFFFCBDB009000DFBDBBD99F9E9B090B90B09A90B0909CA9B09BD099A99E9DB9DA9F0F9DBEDBDFDFF9FE990F09F9EADBCBCB9FFFFFFFFFFFFFFFFFDA9A0090A9CA900C09A009000C00E000A009A0A90A9A0F00F0FBEFFFFFFFFFFFFFFFFFFFFFFFFBFF0F090000EFF90DA9E9099C90B0C9090909D0BC9B9D0DBCBDBD9DB99A9CB9D090DAD9FCFADE9F99DA90DADA9DADBDBCFEFFFFFFFFFFFFFFF0F9C90B0A9009009A9009C0A9A900909AD0F00C90E9C0F00F0FDEFFFFFFFFFFFFFFFFFFFFFFFFFFFFF900000CFF9ADBD990BDA9B0D09B09E90B0090B0909A99909BCB900909000090909CADF9F9F0BCA9DA9BDBDADACBCB0FFFFFFFFFFFFFFF9FB0B0BC0900B00B000090A09C00B0AC000000B0E900B00E90F0EFFFFFFFFFFFFFFFFFFFFFFFFFFBDBDE900000FFBDA9ADAD9AD09B0B00909AD09B0909CB99DADBC9909090000990000000909C000D0990090DA9CBC9FDBCF09EFFFFFFFFFFFFFEDAD00900F00B0CB090A09000BC0D09ADA9AC090E9C0F09E00F9EFFFFFFFFFFFFFFFFFFFFFFFFFFFEBFF90000FFBDF9DB9AD9BD0D09BCB090B0D000DB00F099009000000909C0AD0BC909C0A909000009A0F9FA99F0F0F9F0F9EFFFFFFFFFFFFBF9A9A0B009009000A90009A90B00A00000C9AC090A900E99F0EFFFFFFFFFFFFFFFFFFFFFFFFFFFF99E9A090CFBCB9FB0D9BC9A9B9C990DA99DA9B900990900090090D09C9C999909009A99C9E9A900000D009D0F0F0F9E9F0FDFFFFFFFFFFFBF9E9C0900B009A9090C0B000C00009C90F09A00B0E9C0F09E0EFFFFFFFFFFFFFFFFFFFFFFFFFFFF9EF0909000F9DBDA9DBBC9B9D0A9A09A9C9A900009000000909B0B0909A9B0F0F9F9FD9E9BDAD0B090DB0BF0F0F9F9EDBCFFFFFFFFFFFFFFFCB090B0A900B000A09A90CB0B09E0A0A00000D0C900A90BC0F9EFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0BE90B900AFF9F9BC99BD0B9D09BC99A9909909000909BCB09D9BDBD9D0909909E9AF9FCBDB0D0DAD09C9B9DADADFADBCFDFFFFFFFFFFFBFBDA90D00B0CA90D000090000A09D09C9A9E0A9A0F0C0E0B0E9EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD99FD099C9BCBDADBDADBD0B99E99E99E90000000009C990F0BC909A9A9E90E909D9CF9F0FDB0A90BF09EDAF9FDADF0F9FFFFFFFFFFFFFFADADA0A90C9090A09A90A9090DA00A000C00900C900B09C0F0EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF9B9B909FDBDBDB0BF9B0BC0B90B90B9090D0A909E0B0F99999B9C90D090900BCBCBDADFCB0D9DED09E9BD9E9EDBEDBCBDFFFFFFFFFFFFDBB09C90A9A9A909A00A90AC009009C9A90B0CA9A0F0CE9E9ADFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBDBDBD09CFBDBDADBD9FCBD9BD0F90F9090A909C00990D09AD0AD0B09000009D09CBDADBCB9E9ACB9B099EDAF9F9EDBCBDBFFFFFFFFFFFBFBC9A9A0900000A0900D0009A9AC00A0CA0C0900D009A9A0DE9EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDBDB99B0BDB9EBDBDBE9B09A9A99E909CB090909A9009A9090D909090090900ADADAD9ECBDE9D9BD0C9EF9BD0DAFDBEDE9FFDFFFFFFFFFFCBAD009B0A9E90D009A009A00009F090909A0ADA0BC0D0DA0ADFEFFFFFFFFFFFFFFFFFFFFFFFFFFBFB9F9F999FFFBDB9E9F9F9F9D0DA99B9B9090DA90909AD0BDA909E99A90000909090DADBDA9DA0FCB90990F0FBFD0BCBF9E9FFFFFFFFFFFFBDBAB00C9C090A0BC090A0909CA000E0AC00D000D09A0A0D0F0EFFFFFFFFFFFFFFFFFFFFFFFFFFFF9DB9F9F9CFBDFBDA9F0F9F0B0B99F0D09090009C909E9090990B0900D0909000C9E9AD0DADF0D9090090F99F9C9EFDFD0FDFF9FFFFFFFFFFFF0D09B0A9A0B0900B009C0A0A900A90909A00E9A0E0D0F0F0FBDFFFFFFFFFFFFFFFFFFFFFFFFFFBDB9F9FB9FBDFBDBDF9F9FBD9F9CB09B9F9A0900B0A9090B0DAD0990B0090090DB090DCBCBD0B9CA90BCB9CFADBFBDADAFF0F9FEFFFFFFFFB0B9A9E009009C00A900B00A9C9009C00CA0D0900D09A0F00F0DEFFFFFFFFFFFFFFFFFFFFFFFFFF9DBDBDB9DBDFFBDBCB9BDAF9A90B99F0D0909909009D0909C9090900D0900C90000D0F0BDAD0BCA990C90C9B9DBCD0FDBDADFB0DFFFFFFFFFFFCBD09CB0BCA9A90A9C0090000F0A90B090A0E9A0E0D00F0BE0FEFFFFFFFFFFFFFFFFFFFFFFFFBA9F9FBDB9BDFBFF9F9F0F9DF9F9CB09B9B0900F0900009E09A90B0DB0909A909090A90DCBDADD9DA9909B9C9E9FBFDBEFFDBCFF0DFFFFFFFFFBF0BA0900090090D0A900A90B000000C0AC9090C909ACB0C0DADBFFFFFFFFFFFFFFFFFFFFFFFF9D990D9BDBDFFFDBF9F0F9FB9F9B99F90D0DB99090090B0990D09090090909090909D0F0BD0DB0B09CA90D0B9DBCDFBCF9CBEF909FFFFFFFFFBFDBC90A9E9A0B0A0900A900C00B00F0A90900E0B00E090E9FADEFFFFFFFFFFFFFFFFFFFFFFFF9B0B0FBBF99BFFFBF9E9F9FB0F9AD9E9F99B90CA9009009C90B09F9099090D090BD0F0F99C0FF0F9D099C90BCDADFBEDF9FBFD9FBDEFFFFFFFFFCBA09AD0900D0C09A09000A90BC900900ACB0900F09CAD0A0DADEFFFFFFFFFFFFFFFFFFFFFFFF9909DBD9BFFFFFF9F9F9FBDF9F9BDB99AD0B9990990B009A9C900090009A9B9D0B99D9EDB9099090B009A9D9BDBFDF9FFCF0FADF9DFFFFFFFFFBD9F00B0A9B0B0B09CA9090000009A09C900CAD009E09AD0F0FAFFFFFFFFFFFFFFFFFFFFFFFFB90909FBD90DFFFFF9F9F0DBFF9F0BDAD9B9C9A9D009090009099909099C90DA9D9E9ADBFDAD0F9E90900DA9E9FD9FFF0FF9FDB0FBFFFFFFFFBFBEB0B009C000090CA900E090F0B00C90A0CB090ADA09E0ADAD0DEFFFFFFFFFFFFFFFFFFFFFFF90DBDB9090DBFFF9FF0F9FBDB9FBDB9F9BD9B9D9A9B0909090B000B0DADB9F9DB0F9FFDFDFDFB909090F909D9F0FFF9FDF9EDADFF9CFFFFFFFFFF9BC9CB0B0F0B0B0909090A000000B0E90B00AC9009E90DA9EBEFFFFFFFFFFFFFFFFFFFFFFFB9DB909090B0FFFFFF9FDBFDBDFF9F9F9BDB0D9A999C90C909090DB9DB9BDBDBB9DBDBDBFFFFBD0DA90990DF0BDFFFDFFFBEDBF9F9DBFFFFFFFFF9BCA9A900909C0000A0A000909AD0009C009C90E0F00ADA0DBCFFFFFFFFFFFFFFFFFFFFFFFF90999909090DFFFFFBF9BDFBFF99F9F9BD0DBBD9F0909990B000909DBD9F9DB9DFBDBDFFDFFFDFB990DACBB9FDBDFFFDFDFDBDE9EFBDFFFFFFFFBFEB9000E9A0A0B0F09090B0CA0009E00A9A0A090009E90DAE0F0FFFFFFFFFFFFFFFFFFFFFFFB9CBCB090909FFFFFDFFFBDF9FFBDF9F9BB9D9B09DBDA9A909D909A99BD9FBDB99DBDBDFFFDFFF90DA999D0DADFFDFFFBFFBDBDB9FD0FFFFFFFFE9BCBDB9009C900900AC000909CB000909C9C9CA0F0E09EAD0F0FFFFFFFFFFFFFFFFFFFFFFFF99B99990909FFFFFFBF9FDBFF9FDBFDB9DDBBD9F9A999D09D0A09C9DBD0BD9F9F9BDBDBDFFFFDBDA99CBCBDBDBFDFFFFFDEDFEF0DFB9FFFFFFFFBFF9A00CB9A9A9E0A9090B00A000009AC0A0A0B0D0009E090F0FFEFFFFFFFFFFFFFFFFFFFFFB9C9DB90090F9FFFFFFDFFBDF9F9BF9BDF9B9D9B9D9BC9A99A999B09A9B9DBF9F9BDADFDFFDBDBD090DB9F9F9FDFFFFFDFFBFDB9DBF9CFFFFFFFFFF0BC90B00000090909A00009090BAC0B09C90C0A90F00F0F0F0FFFFFFFFFFFFFFFFFFFFFFF999FB909900DBDFFFFFBDBDBFFBFF9FDB9F9F9BD9AD9B99C9090D099D0DB9C9F9F99DB9FFFFFEDBDBF0FDBDBCFFDFDFFFDFDBFDEBDFB9DFFFFFFFF9F09AD0ADA9E9A0A0C009E000E00909C0A00B009E00F00F0F0FEFFFFFFFFFFFFFFFFFFFFFBF909DBD0990FBFFFFFFFFFFF9F9FDB9FDB9F9F9BD9BD9E9B9DB9A9CB9B9CB9F9F9F9BDFDFDFDBDAD9DB9F0FDBDFBFFDFBFFFDAF9E9FFBCFFFFFFBFFAF09A90090009C90A90090B00900A00909AC0F090F09ECA9E9FFFFFFFFFFFFFFFFFFFFFFF999FB909009CBDFFFFFFFFF9FF9FBDF9BDF9F9BD9BD9A99C9A9D99B9C9DB9DBDB9DBDB9FFFBFFFDBEBDEDBDBDBDFDFFFDFDFFFDF9FF999FFFFFFFF0F9CB00F9A9A90A0090A000009A00D0BCAC00900CA00E0B9E9EFEFFFFFFFFFFFFFFFFFFFFB9ADBD9B9090FFFFFFFFF9F9FF9FF9F9BDB9B9BD9F90B9DB9B9DA9E9DBDB9FBDB9FB99DFDFDFDFDBF9DF9BDBDFDFFFFBDFFFBD9F0FFFB0FDFFFFFFBFB0B0E9000C90A90B0009009A0000A00090B0ACB0DAD0D0E0F0FFFFFFFFFFFFFFFFFFFFFF9D99FBD9A9090FFFFFFFFFFFDBDB9F9BD9BDDBDBB0DBDB9D0DA99990B9BD9C99FD9DBFBDFFFFFFFFDFF9FCBDE9FBDBDFFDFDFFEBFDFFD99FFFFFFFFF0F0900B0B0A9C0000000A009C9090DA000C9090A09A9ADAD0FCFFFFFFFFFFFFFFFFFFFFFB90F9FB9D09009BFFFFFFFFBFFFDB9FDBDB9BD9D9B999CB9B9DBCBD9D9CBB9FB9BF9D9F9FDBDFFF9FDADBF9F9F0DFFF9FFFBDBD9EFFFBDADFFFFFFF9F0F0B9C00900B0F00B0900C00A00A00D0B00CAC9CAC0DA9ADAFFFFFFFFFFFFFFFFFFFFFF9999DBDB9B909CFFFFFFFFFFDB9BDF9BE9DBDB9B9DBDB99D09B0990B0B9D9F9DBD9BBD9FDFFFF9FFFBDBD9F9BDBF9F9FF9FFEFFFDFFFF99FFFFFFF0FBA90C0B0F0A900009000090A9000D090AC0B0090A90FA9EDADEFFFFFFFFFFFFFFFFFFFF99E9FBFBD9909A9FFFFFFFFFDBFFDB9BD99B999F0DB099BCB9F99F9F9D9F9BD9BDBF9D9F9FFFDFFDDADBDFAD0F0F9FDFFDFFDFDADAFFF99EDFFFFFFFF09CB0B09009C90B000000A000000A0E9090CB0AD0CB00D0ADEFFFFFFFFFFFFFFFFFFFFFB9999DBDBF9F99C9FFFFFFFFFFF9BDBDBDBDBDB9B99DAD99D90F09090B99F0BBDBD9F9BDFFDFBDBFBDBF09DBD9F9CBE9FFFFFBFFFF9FFF09FFFFFFFBDFA90900CB0A0A0000A09000909090900CA900D0A9ACBCAF0B0FFFFFFFFFFFFFFFFFFFFFF99E99FBDBF9BF9FFFFFFFFFBDFF9F9BDB99DAD9DB999A9B0B99F9BDBDAD9D9DA9F9BD9BDFFDFFDEDBD9F0B0A90FBDFF9FDFDFDBDFFF9F909FFFFFFFADAB0E9A00D09090900000900CA00C0B0B00A9A9C0C9CBC0FCFEFFFFFFFFFFFFFFFFFFFFB9099F9DB9DBD9B9DFFFFFFFFFBFDB9DB9F0B99B09CB99D09D0B09C99099B9BD9F9F99FDFFFFF9F9BDA909C9DAD9CFBDFFBFFFFFF0FCF9F90FFFFFFBFBD0C9090B0A0E0A00900A00A0000B00C09C90C0A0B0B0DB0FAFFFFFFFFFFFFFFFFFFFFF9D90F9FBFDBB9F0FBFFFFFFFDBFDBBDB0D9BD9F9D9B9CB0B9A9C909B0F9BCBD9B99F9F9BFF9F0FA9D00D0B09A90ADBCF0DFDBCF9009FB090FEFFFFFFE90B9A0E0090909C00000000909000B090A0E9AD0D0E9EA0F0FDFFFFFFFFFFFFFFFFFFFFBB99099F9B9DF9F09000FFFFFFFBFDBD9BD0B090B0DA9090C9090B0C99C999B9F9F9B9DFDFFBD990099AD09C9E9DADF9FBFFFFFFB0EDFF909FFFFFF9F9E00090B0AC000090090090000090C0AD09000A9A90C9EDADAEFFFFFFFFFFFFFFFFFFFFF909AD9BDB9B9B9F09000FFFBDFDBF9BD0B99DB9090909C909A09C9000B09E909F9FDB9FFFDFBCBDA09009A9090BDADEDE9FDF9FC90FFFF90DFFFFBFEB9E9E09C909A9A00A0000000E000F09000A0D0D0C0FA090F0DFFFFFFFFFFFFFFFFFFFFFFF99D9ADBDBDFBD90009DFFFFFBBF9FB9B9C9A0DB0909A909009090B0909C99F99F9BDBDFFF9990090009090BCBDADBDBDF0FFFFB0E9FFFFFFFFFFFF9BC9090A000A00090000000A90900000ACBC9A0A09A90DAE9EBEFFFFFFFFFFFFFFFFFFFFFB90909090F9B99A0BCBEFFFFFDFDBD9C9CB999909AD090A9090000090090B09BF9BDBDFF9B0F009090909E9C9CADBCBEDADFBCF0D90BFFFFFFFFFFBFCA9A0A90BC90D0000900090000090B09000090DAC9ECBC9ACFFFFFFFFFFFFFFFFFFFFFFFF99090BDB9F9F00D000DFFFFFFBB9BB9B90BC9A909A90990D09090909A090F9C9BDBDBDFFD90090000000009A9D0FBC9ADAFDFFB0EFDBDFFFFFFFFDA9B0C900C0A000A0900000000A00AC0CA90B0E009A09A0F0F9A9EFFFFFFFFFFFFFFFFFFFFFFB9BDDBDB990900F0F0FF9FBFDBD9C90099B0DBD09DA0D0900B0000090090B9F9F9F9FFBFB9ADB90D0BD9BC90A90DBD90DEBEDF9EFFFFFFFFFFFBFF0F0B0DA9090B090A0009000009009A90C0C090BC0DAC9AD0EDEFFFFFFFFFFFFFFFFFFFFFFFFFDBB9B9F00009000FFFFFFFBDBA9B9000C9B09B0099A0B0D090909C900909BDBDBDFDF90D9000909000000F0DE9CA0CBDFDFB0CFFFFFFFFFFFFEBF0900A00AC000C0090000A0D0000000B0B09AC009AC9AD0AF0FFFFFFFFFFFFFFFFFFFFFFFFFFB9DBD900000A00F9FFFF9FDB9D9D09009B0D900900090909090009A99E9FDB9F9FFFBC9A09090A00000000DA9A090BCFBEFC0FFFFFFFFFFFFF9F090E90D090B09A90000009000A09A9C000A09ADAC90BC0F90F0FFFFFFFFFFFFFFFFFFFFFFFFFFFB90009000C90CFFFFFFFBD0B0B90900090A9000000CA90000900900909B9FBDBDF9B0DB000009000000CAD09000CBCDFFB9EFFFFFFFFFFFFFADA900A0A000C000C0A9000000900C0B0D09C0009ADACB00E09E9EFFFFFFFFFFFFFFFFFFFFFFFFFF090000090000FFFFFFFFBD9F0BD090000900000000DEB900090090BD0FD9DBDFFF9B00900900000000ACB00C09CFBE9FF0CFFFFFFFFFFFFBDBCA9090DA90B00A9000000000000B000A0E0BCBC00090F090E9EFFFFFFFFFFFFFFFFFFFFFFFFFF90000000000F0FFFF9F9FB9A99C9B0900000000000DA9000900090AC9B9BBF9FBDF9C900090000000000900090CBD0DEF00FFFFFFFFFFFFBDEB090E00000A009000900900B000000AD09090009ACB0E090E90FADFFFFFFFFFFFFFFFFFFFFFFFFB000900000000FFFFFFFF9F9D0BB0D000900000000000009009000999ADFD9FFDFB09A0900009000000000090E9FCBF0F90CFFFFFFFFFFFFFB09CA90B09C90CA00A00000000E09C9000A00E9AC90C909E09AD0FFEFFFFFFFFFFFFFFFFFFFFFFF90000000009C9EFFFFBDFF90B90D9B0900900000000009000000909E9F9BBF9FBFDBD90090000000900009ACBDF0F0CFDA9EFFFFFFFFFFFBCBDA9000C00A009000900A000009000A90D0900090A90AC09AC0AD0FFFFFFFFFFFFFFFFFFFFFFFFF900000000000A9FFFFDFBFBD0F0BCBDBD000090000090000B009009090F9D9F9F9F9A9D0A990090000D0C099EFBF9F0EF90CFFFFFFFFFFFFFDADA9CB0B0900A0D0009000090000B0CA0ACA90E0D0BC9AC090DADADFFFFFFFFFFFFFFFFFFFFFFFB000900900000CFFFFBFDFFB909090909B99DA0909A0C9A9009A09A0BD9FBFDBFF9E90A90CA9D00909A9BF0FDBC9E0DF9A0CFFFFFFFFFFFFBE900000000CA9000A0000090A0000C0090909C009A0000009ACA0FFFFFFFFFFFFFFFFFFFFFFFFFF9000000000900FFFFBDFFBD9CB0CB0F9E9CB099B0D09B0900900909D09AD9DBDF9B990909090A09ADADAD0DA9E9E0DEBE900FFFFFFFFFFFBE90E9A90D0A90C00090000000C0B090B00AC00A9A00F09ADA0909FADFFFFFFFFFFFFFFFFFFFFFFFF90000000000000FFFFFFFFFB900909009A90BCBCB0B0090900900900F9FBAF9B9F0F0F000009090909090B0D00009ADF900CEFFFFFFFFFFFBDB00CA0A900000B00009000000000009090BC90D000AC0090E00CFAFFFFFFFFFFFFFFFFFFFFFFFFB000000000CA90CFFFFBFFFFF9B00A9009009090909090009009009A090D99F9E9F99099A90000000000000090DAC9EEF000FFFFFFFFFFFDFADB009000CB0B0000A00000090000B0CA00000A0AD090B00C90FADFFFFFFFFFFFFFFFFFFFFFFFFF90000090009000FFFFFFDFF9F9C90900900900000000000000000BC9DBDA9E9E9FDBDB0D0090000000000000A0009EDF9000EFFFFFFFFFFFADA0DA0C0B000000D0900090A000000009C90B09C900AC0CA9ADADBFFFFFFFFFFFFFFFFFFFFFFFFFB000000000000E9FFFFFFFFFFB90D0000000000000000000909C9090B099F9BDBDB0BC9A99C0900000000C90C9ADEDFB0000FFFFFFFFFFFBFDA9090A90090C90A000000000A909CB00A00C0A00AD09A900CBEFEFFFFFFFFFFFFFFFFFFFFFFFFF900000000000900FFFFFBFFFF9FB09909A90090900000090C0B0BCBD9FAD0FDBDADBD9F9F0B909C90900900F0FCFFFFF9000EFFFFFFFFFFF9A9CA0D000E0A0A00000000090000000909CB09CB00A0C0A9E9C9FFFFFFFFFFFFFFFFFFFFFFFFFFF9000000000000900FFFFFFFFFF9F9AD9C90900A009090009BC9F990BC9DB9BCBF9BCBF9E9F0F9EBE9CBCADADFFFFFFFFA900DFFFFFFFFFFFEDA900A09090090090B0900000000090E00A00000C9C9A9C00EAFEFFFFFFFFFFFFFFFFFFFFFFFFFF900000000009AC0BDFFFFFFFFFBDBDB0B0F0BD909CB09F9E9FBCBDBDBFBCFDBFDFDBDBF9BF9FF9F9FBDBDFFFFFFFFFF90000EFFFFFFFFFFFBF9CB090CA00C00A00000000000900A0909009E90B0A00C0BCBDFFFFFFFFFFFFFFFFFFFFFFFFFFFB00000000000C090D0FFFFBFFFFDBDFBDBD9BC90F9BCBDBDBDB9F9BDADBDBDBF9B9BDBDFDFDFF9FFFDFFFFFDFFFFFFFDE900CFFFFFFFFFFFBC9A0000A9000B00D0000000009A000900A0DA00E00D0F0B0CBCEBFFFFFFFFFFFFFFFFFFFFFFFFFFF900000000009A90A9FFFFFFFFFBFBBDBDBF9BF9BCB9BF9E9F9F9EDBDBDBF9F9FFDFFBFBFBF9FFF9FFFFFDFFFFFFFFBFB0000FFFFFFFFFFFFFAD0F0D000B009A00C9000900000000C9C0090909A000009ACBDEFFFFFFFFFFFFFFFFFFFFFFFFFFB000000000000C09CA9BFFDBFFFFDF9F9BDBDDBFDBDFDADBDBCB9BDBF9FDBF9F9FB9FDFDBDFFDBDF9FFFFFFFFFFFFFDFFB000EFFFFFFFFFFBDAB000A90C00C00090A09000000000B000B0C0A00C9A9E9E09EAFFFFFFFFFFFFFFFFFFFFFFFFFFFF9000000000909A090FDFFFFFFFFBFBDBF9FBBDBBDB9BDB9BDBDBDBDF9FBDFFFF9FF9F9FFFBDBFFBFFFDFFFFFFFFFFFF9C90CFFFFFFFFFFFFF9CB0900A90B0090A000000000090000B000A90DA9AC00009E9DFEFFFFFFFFFFFFFFFFFFFFFFFFFB000000000000AC90FCBF9FFDFF9F9DBF9F9FDB9DB9FDB9FDBDBDF9F9FBDFBDBDBF9FBFF9FDFF9FDFDFFFFFFFFFFFDFBCB000FFFFFFFFFFBEBCB00CAC900000E0009000000B00009009C90C000C909E9E00EADFFFFFFFFFFFFFFFFFFFFFFFFFFF90090000000009E09ADFFFBFFFF9FBF9F9F9BDBF9F9BDF9B9ADB9FBDF9FBDBDBDBF9F9FFBF9FFFBFBFFFFFFFFFFFFEDBD00CFFFFFFFFFFFDB9CB00900A0CB09090000090000000AC00A00B0B000E0009E9DAEFFFFFFFFFFFFFFFFFFFFFFFFFFF900000000000D09C09ADBDFFFFFBD9F9F9BFDBD9F9F9BDF9FDBDBDBF9F9F9FBDBD9F9FDBDFFDBFDFDFFFFFFFFFFFFFFFAD000FFFFFFFFFFFEB0C9A0009000000A00A900000000009A909000C0B090F0000E9DAFFFFFFFFFFFFFFFFFFFFFFFFFF000000000900000B0F9FFFBDBF9FBB9F9F9BBDBF9B9FDB9DB9F9F9F9FBCBF9FBDBFBDBBDFBDBF9FBFFFFFFFFFFFFDFFFB000EFFFFFFFFFFBF9CB0C90BC0B00AC09000000000900900000E90A9C0E000ADADAEFFFFFFFFFFFFFFFFFFFFFFFFFFF90000000000B00F0D9E9FBDFFFFB9DDBF9FDF9BDBDF9B9FB9F9F9F9FF9DBDF9F9F9DBFDFBDBFDFFFDFFFFFFFFFFFFFFD0900FFFFFFFFFFFDBCB009A00000C90900000000090000CA0CB000D00A909AD00DADBFFFFFFFFFFFFFFFFFFFFFFFFFFF90000000000C0090ADBF9FFBF9F9FBBD9F9B9FDB9B9F9F99F9F9BDBF9FBF9BF9F9FBD9FBDBF9FBDBFFDFFFFFFFFFFFFFF000CFFFFFFFFFBF0F09A0C90B09A00A000009000A000A90900090A9C00AC0A9E0AEDEFFFFFFFFFFFFFFFFFFFFFFFFFFB900E00000009E0BCBC9F9FDFFBF9DBBDBFDB9BDFDBDB9FF9F9FDBDDBD9FF9DBDBDBFBDBFDFBDFFDBFFFFFFFFFFFFFFF0F000EBFFFFFFFFFF0BC90A00C0009000B000000000000000090A000A9C909C009C9EFFFFFFFFFFFFFFFFFFFFFFFFFFF900090000009009C9FBFFBFBF9F9FBD9F9B9FF9B9BDBDBF9F9F9BDBBDBF9FFBDBDBDBDBDBBFDBBDBFDFFFFFFFFFFFFFF9000ADEFFFFFFFFF9BCA0090E09AC0C9000900009009000B00E0C90D00A0E0A0F0FAFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0000000900E09E9EBDF9FDFDFBF9DBB9BDF99BDBDB9B9DF9F9BDBBD9F9F9B9F9F9F9BDBDFDBFDFF9FFFFFFFFFFFFFFE0000DFFFFFFFFFBCBC909E00900090A0000000000000000C909000A0B0D090D0009DEFFFFFFFFFFFFFFFFFFFFFFFFFFFB000C0000009E90BDFBFFBFBFBD9FB9DFDB9FF9FDB9F9F9B9BDBF9FBF9FBFDFBDBF9FDBDB9BDBF9FFFFFFFFFFFFFFFF99000EF9EFFFFFFFBF0B000B00B00A090E900000000000B00A000B000C0A0E0ADACA0FEFFFFFFFFFFFFFFFFFFFFFFFFFFFB000D0000000F0DADF9FDFDFFBF9FB9B9FB9F9B9F9FB9F9F9F99FBDBDBDBF9FBDBF9FBDFF9FDBF9FDFFFFFFFFFFFFFF00000EFDFFFFFFF9F0DA90C00C09000000A90009009000090C0900D09090909009F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFF9000A00000CB0F0FBFFBFBFBDF9F9FBDF9F9BDBFDB99F9F9F9FBDBF9F9DBDBDBFD9FBDBF9F9FFDFFFFFFFFFFFFFFFF0B000CFBEFFFFFFBEFB00CA90B00AC9A900000000000A000009A000A0A0E00E0E9E0EFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9000090000000DBFDF9FDFDFFBF9F9DB9BDBDBF99BDFB9B9F9BDBD9FBDBFBDFBDBFF9FF9FFFF9F9FFFFFFFFFFFFFFB9000DBF9EFFFFFFFF90CB090000090000000000000000090B0000F090D090909000FDEFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0000000000D0BCFBFFBFBFFBD9F9FBDBDBFBD9FBDB9DF9F9BDBDBBDBFF9DF9FBDBDF9BF9F9FFFFDFFFFFFFFFFFFFC00000EF0DFFFFFBF0FB00A00AD0A00A00A9009000000900C000D0000A00A0E0E9E0AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9000000090A9CBDF9FFDFBDFBF9F9FBDBD9FBF9F9FBB9F9FDBDBDF9D9BFB9F9FBDBFFDFFFFDBDBFFFFFFFFFFFFFDB900000CBEFFFFFFFF0F9D090000D0900D00000000900000009A000B0D0D0D09000DCEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF009C0000000000FFFFBFFFFBDBF9F9DBDBF9F9F9F9F9F9F9BDBD9BFBFDBDFBFDBFDBDBF9F9FFFFDFFFFFFFFFFFFB000000FF0FFFFFFFF9F0A00CA90A00AC90000000000000009A00090C000A00A00E9EBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB900000000009EDBDBFDFFFBDBF9F9FBFBF9BDB9F9F9F9BDBF9E9FF9F9BDBDBDBFDBFFDBFDBF9FDFFFFFFFFFFFFD000000FE9FCFFFFFF9EF0DA900C090090A00B0000000090000009C0B00A90B09E900EDEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00A0000000009A9FDBFDBDFFF9F9FBD9F9FDBDBDB9F9BDBF9F9FA9F9FF9FBDFBDBFDBFDFBDFFBFFFFFFFFFFFFFB00000C0FEBFFFFFFFFB9B00A09A00AC0009000900000000000D00A0009C0C0C000F09AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB9090000000000CBADBFFBDBDFBF9FBF9FB9FBDBF9BDFBD9F9F9DBDB9FF9FBDFBDBBDBF9FBDFFDFFFFFFFFFFFF0900000F0DFEFFFFFFFEDAD09C090009A00000000000000000B009000000B09A0BC00EDFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00C000000000909DBDBDFBFBDF9F9F9F9FFBDBDBFDB9FBF9DBFBDBDF9FF9DBBDFFDFF9FFDFBDBFFFFFFFFFFF900000000BEFFFFFFFFFB9E9A00A0CB0009CA90000900900000000009ADA000A09C00BCBEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB00000000000000DA9F0FBDBDB9FBF9FBFDB9F9F9DB9F9F9FBF99F9FBFB9FBFDFB9FB9FF9FBDFFFDFFFFFFFBD00000000FEDBFFFFFFFBDE900090900000000C0000000009000009E0000909C9C00B0CBCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9000000000009ADA9DBDBDBFFBDBF9F9BFF9FBFB9F9F9BDBDBF9F9F9DF9F9FBDFBDFF9FFDBF9FFFFFFFFCF00000000D0FFFFFFFFFFFA9AC9AC0A009E9A900A900000000000900900000E0A09A00CBCBEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB00900B000000009C9ADB9E99E9FDBF9FDB9F9F9FDBF9FDBDBDBDBDBFBDFBF9FBDFBF9F9BFDFF9FDADFFFFB90000000ACFBEFFFFFFBFDF9A00900D000000A900000000000000A000B0009000C0D0B0ACFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB00E000000000000BC90F9FF9DBBD9FBBDFBF9F9B9FB9BDB9F9FBF9DBFBD9F9FBDF9FBFDBF9FFFFFFF0F9000000000CFBCFFFFFFFFFBAC9C9A00A0A900C00000000090090009000C0BC00D0B00A0CDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF90000C900000090900BC90B99FBDFBF9DB9F9BDBDF9DBDBDF9FBD9FBF9DBFBFBDB9F9FDBF9FFE9F9F0F9090000000ADADEFFFFFFFBF0DB0A0C09090C00B000090000000000000A90000B0A00A9C9EAFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0090000000000000909AD9CB9CB9D9FBDBDBDBDB9FBDBDB9BFDBFBDDBF9FDBDBFEBFDBD9E9F9F0F090000000000C9EF9FFFFFFFFFFFAC90090AC000B0009A00000000000000900A900090D0C0A09CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF90C000000000000000090A9CB9FBAD9FBDADBADBF0F9F9FF99BC9FBBDBF9ADF9BD9DBEBF9E9F0F0F090000000000CBEEFFFFFFFFF9F9BCB0A090A900C0A000000000090009AC000C00C00A090D0EBEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0009009000000000900090B0D09DB099B9BD9BD9F9F9F99FFDBF9CFBD9FDBBFDBFB9D90F09CB090000000000000FC9FFFFFFFFFFFBE900C900000A90900090000000000000009000B0A090CA00FCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9000CA0000000000009009090BDB0BCBC9D0BD0BDB9F0BFB09B90B990B09AD09AD0DA0F09CA0000000000000CCEFBFEFFFFFFFFF9E90E900CA0D0000A000000009000000009000B0009C0A90DA9EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0000C0000000000000000000000909090AD00BDA9E9F009DBC0F9CBC9CBDB0F00B0900000909000000000000BFBCFFFFFFFFFFFFBE90A0B0900BC090C9A0000000000000000A0000C009C0A0C0FEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9000900900000000000000900900900A909A90090909F0B00B90B009A000900900009009000000000000000CEFDEFFFFFFFFFFFEDBE9C00000000A000000900000090009A009C009A0A0090CBEFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFF90000000000000000900000900000900009090000000900900000900900000009000000000000000000000FB0FFFFFFFFFFFFBFBC9A090ACB009000A000000000000000000009AC090DA0E9EDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB000C00000000000000009000009090009000000900090090009090090090090000000000000000000009CEBCFFFFFFFFFFFFFFDE9A90AC9000A0C090900000000000000009A000000000900FEFFFFFFFFFFBFBFFFFFFFFFFFFFFFFFFFFFFFFFFF009A00000000000000000000000009009009000090000000000000000000000000000000000000000E0FFFFEFFFFFFFFFFFFFBBF0C9000009009A00000000000000000900000900F0ACADA9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9A0C0000000000000000009009000000000000000000000000000000000000000000000000000000C0F09CFFFFFFFFFFFFFFFFD0B0A09A0AC0A000A090090000090000A00C9A009009000CEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF900900000000000000000000009000000000000000000000000000000000000000000000000000000CEFEFFFFFFFFFFFFFFF9EBC9C0C09009000D0000000000000000009000C0A00C0BCBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000ACFFFFFFFFFFFFFFFFFFFFFEBD0A9000000009A0000000000000000090A000090C0B000CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBC00000000000000000000000000000000000000000000000000000000000000000000000000CFFFFFFFFFFFFFFFFFFFFFBDBA90A9A00B0AC0000A90000000900000000009A009000CB0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBDAC9000000000000000000000000000000000000000000000000000000000000000000000CFFFFFFFFFFFFFFFFFFFFFFFFDAD0C009C00900009000000000000000009000000AC90B0CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000000000000000000000000000CFFFFFFFFFFFFFFFFFFFFFFFFBAF0B009A00000B0000000000000000090000000C900A0C0FEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFBCD9000000090E000C00900000000000000000E09A00900BCBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9A000000000000000000000000000000000000000000000000000000000000000000EFFFFFFFFFFFFFFFFFFFFFFFFFFBAE9A9E000A009009A0000000000900000B0090000A0C000CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBCD00000000000000000000000000000000000000000000000000000000000000000CFFFFFFFFFFFFFFFFFFFFFFFFFFFFDB0C0090C09000A0000A000009000000000000009C0A90E9EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBA0B00000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF9AD0B00A0900E000090090000000000009000009000900C9EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0D9C000000000000000000000000000000000000000000000000000000000000CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBEDA900000000090000000000000000000000900A000A90A0BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A9E090000000000000000000000000000000000000000000000000000000EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBDB9CA09C900B000AD0A00000000009000000A0000C9000C9C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF0090C00000000000000000000000000000000000000000000000000000EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFB90CA00AC0000000000900000000000090000900A0C0A00FEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9E90A9A09000000000000000000000000000000000000000000000000CFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFBDADA9000000090000900000000000000000000009009000FCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9CAD00D00A90000000000000000000000000000000000000000000CFFFFFFFFFFFFFFFFFFFFFFFBEFFFFFFFFFFBFDAD000090090AC0900000000000000000000090A0000A09E0BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBDA9009A0A900D0E000000000000C00000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFB0B9000E0000000A0000000000000000009000000D00000D0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF9E9E0D0C0F0A9009C90000C90CA000C0000000000000000C00DEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0FC0E9A00000900000900000000090000900000900A00C0A0EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDA900B0B9A0D0E0F0A0CBCBADA90C90000CBC9000000000CBFDAFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFB9B0000900000900000000000000000000000000000909C9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9CAD0C0C0F0B090B0DBE9FDA9BCBEFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFCFFFFFFFFFFBFFB0DAC09000A000A0000000000000000000000090009000A00E0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBDA09A9A9A900C9E0C9A0DAB0BC0F9FFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFBFFB09000000900000900000000000000000090000000000009E9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9DBC00C0DADA9A9A90DA0DEBDB9A9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBEFFFFFFFFFFDBDE9E9A090000090000000000000000000000000000090000C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBA09ADA9A009C0C90E09EB9E9E9DEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFFFFBFEB9A900000000000000000000000000000000000000000090BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBC09E0090C0F0A0B0E90F0DEDBF9EBFFFFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFFFF0FFBFFFFFBFFEFB9E900000000000000000000000000000000000090000000C0CBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F0090E9A909C9C900F0FFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFBEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFF9FBDBC9E09000090000900000000000000000000000000000000A9ACBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9E0E900DACA9A0ADA9E0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBCFFFFF9FFFFBFB09A009000000000000000000000000000000000000090000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBD09090E9A909C9C900CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFF9FFFFFFFFFFFFFFFFFFFFFFFFFBFFFFBDFFEBF9E9E9E9000000000000000000000000000000000000000000000FAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDADA0E090C00E0A0ADAF0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0FEFFBEFFFFFFFFFFFFFFFFFFFBFCFBFFFBFBDFFBF9A900009900000000000000000000000000000000000000DADFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB90909ACB0B0909C909CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9E90DADFBFFFFFFFFFFFFFFFFFFFDFBCF0FBEDFBE9E9AD00000000000000000000000000000000000000000000000ADFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9E0C900C0DACA9E0A9EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBEB0DADF0FBFFFFFFFFFFFFFFFFEBFBFFFDBBEDBF9F9A9090000000000000000000000000000000000000000000ADAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0B09A0ADA9A090009C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9CA9A0F0DEBEFFFFFFFFFFFFBFDFCBFBFFDBBDBE9AD0A00000000000000000000000000000000000000000000D0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBD00E90D0000D0E0BCAF0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFBDA0A90CBCBEBDFFFFFFFFFFFFFFFBEBFDFADBFCBE9BDA0900000000000000000000000000000000000000000000ADADBFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDA9E900A0A9E9A90D090DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F9CB009009E9ADBFFFFFFFFF9EDBDAF9FADBBF9E90900000000000000000000000000000000000000000000000BCBDBDEBFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFF09A9C09C000CA0ACA0ACDAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9E90DA0BC9ACBEDBEBFBFFDFFBF0F9AFDBFCBCB9E9A90900000000000000000000000000000000000000000090C0BCBFBDBF9FFFBFFDFFFFFFFFFFFFFFFFFFFFFFBFFFFFBDB0F0C0A9A0BCB09C909C9ABFFFFFFFFFFFFFFFFFFFFFFFFFFFEF9FDA9E09C000C909ADBDEFEBFBCF0F0FD9AD0BDB9E9AD000000000000000000000000000000000000000000000009ADAF0DAD0BCB0F9EBF9FBEDFBFFFFFBFFBFFFFFFFFBFBFEBC90B09C0D000C0A00E9ACDEDBFFFBFAFEBFFFEFFFBFFFFFBFDBEDA9E99A90B09ADADADE9FBDFCB0B90F0AF0BF0BCB090A0000000000000000000000000000000000000000000000000909A09ADA9E9E9E0FADBDADAD0F0F0F0F9CBC9E9CBC9090A00E0B0A0F0B0DA90009A9AC9E9CBD99E9ADB0F0F0F0B0F0BCB0F09A0C000C000000A9A0DAB09C0E90BD9AD0FCBC9E90900000000000000000000000000000000000000000000000000090000000000900000A009A09A09AD0A09A00B00BCB0C9C90C09C90C0900CBCA0D09A09A00ACB0F0ACB0F0F0F0F0F0BCB0F0D0B0D0B0D0BC90C9E9C0F0B090E0AD0B0B09B090000000000000000000000000000000000000000000000000000000009009000900900900900000900000900900000000B0A0A9A0A0A9A0ADA0090A0009009000000090000000000000000000A000A000A000A09A00A900000A9090BCBCBC0F0A9000000000000000000000000000000000000000000000000000000000000000000000000009000000900000000900BC009C90C90C90C090009C0090000000900090009009009009009009009009009009009000009009009000E0C09A90B0090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009E0ACB0E9ACA9E0E9E0A90000000000000000000000000000000000000000000000000009000000000090B0BC9E9CB000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090009009000900090000000000000000000000000000000000000000000000000000000000000000000090B09A9090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBDFADFBCFBDEBDFADFBCFBDFBEDBF00000000000000000000010500000000000040AD05FE, 'Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree in 1976. Upon joining the company as a sales representative in 1992, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London. He was promoted to sales manager in March 1993. Mr. Buchanan has completed the courses \"Successful Telemarketing\" and \"International Sales Management.\" He is fluent in French.', '2'); +INSERT INTO employees VALUES ('6', 'Suyama', 'Michael', 'Sales Representative', 'Mr.', '1963-07-02 00:00:00', '1993-10-17 00:00:00', 'Coventry House\r\nMiner Rd.', 'London', null, 'EC2 7JR', 'UK', '(71) 555-7773', '428', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E506963747572650001050000020000000700000050427275736800000000000000000020540000424D16540000000000007600000028000000C0000000DF0000000100040000000000A0530000CE0E0000D80E0000000000000000000000000000000080000080000000808000800000008000800080800000C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCF9A9FBCBFFD0000000000000C0BCF9BDF0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0FCF0EFDE9A00000000000000BCB0FCA0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A9A9F9EBFC0000000000000AD0BCF0BDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0DACBE9F0A000000000000090BCB0BCBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0F0DA0FD000000000000000ADADE90FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC909A9F0A000000000000000000B0EBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00A0C0000000000000000000BCBC9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0DA9E9000000000000000000009BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000B00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF900B0000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0000000000000000000000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00000000000000000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC00000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000BEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000009AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000A0009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000A0BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000BF9ED0BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000900A0A9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF090FFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000B0E909000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000009A0A00000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF90090F0DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000A0BC0900B0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDBC009090000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000090A9A0A00000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE909A0DA9B0900DBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000009A090000009000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF090B09909009A90BCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A0000000000000BE9A000000009A9DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD09A09090A9090909009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0F0090000000000A009E9E000000000AA90FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00909D09A9909A090090009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDA0F0A000B000000090A09A9A9000000009AF0BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF09A9A09A900090900B00B0009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE000F009A0000000000000ACB0A00A00009AD0A00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0B0D09900909A00009009090900BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000900F00A000000000000090B0E9E900009A0BA90B0ACFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9090909B0090B00900B0090900A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0A9A0A0F0000000000000000A009A9A0A000009F0BC090900FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF90B090B000B0009009009000A09909009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCB0B000000F09A000000000000000000090CB000A0ADABA0A00009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA0909A90990090000000009A09000909009BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0B0A0FA9A90F0A0900000000A90000A00A00B0000090A0C9ADA9A000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0909F0909A0090A909A090000900B000A9000FBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A090F0B00E00AF090E0000000000A00000000B0000000A909A0000000A9C9FFFFFFFFFFFFFFFFFFFFFFFFFFFF0909A090B0D0B0090900900B0900900B9900B09FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A90BCAA9E9A09A0F00B0B0A900000000090000000A00000000A0B0B000BCBAA90FFFFFFFFFFFFFFFFFFFFFFFFF009F099A909A90BC00A09A90C9A9AC90000090900BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA090AC0B0DA0ADA000F0A0DAF9EBCB00000000000000900000000090E09A0090DA00009FFFFFFFFFFFFFFFFFFFFF09B09B099E909AC09A900000B000909A9C90B09CB090FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE90DA009A00A00F0A9AF0F000A90F0B00000000A00000000A0000000B0A9A0000ABA900900FBFFFFFFFFFFFFFFFFFF09B09B09AD09E09000000B00900B0A9A90B0909A909090FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A9A0A000A0DADAB0ADAC0AF0009AFAF0A00000000000000A09000009A00F00A00B0D00A00A9B0FFFFFFFFFFFFFFFFFF0B0DB0DA9B0B0900B009000900900D09CA9A900090B0DA9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00A90CB090090A00000F0A0B0F00000090F0A00000000A00009A00000000BB0B00900A0BC00000F0B00BFFFFFFFFFFFFF0999A99A9DAD00A90090A090A00A09A0B090DA9B9A90B90909FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF009A9EBBF00000ADABADA00B00AF00A09A00009A0000A900900000B00000A00DACB00009A0B0A09A0F0B0000FFFFFFFFFFE9BE99AF9A909A90090A09000900900900B0B09E099090B0B90BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00A000B0F0FFA00A000C0A9A0CAD0F0900000B00000000000000000BCA9A009AFA900000000BA90900BA000000BFFFFFFFFF9BC90BD9ADA9A900B009000B000900900909C9A9BCA9F09909B09FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00A9000A9FBFFF0009CA9ABC0CBA9A0F0A0000000B0090A000A00A00B0A90090A9090A00A000B9E9A00E900000B0F0FFFFFFFA9F9BBF0B09090DA900900090009A09A9ADA90B090B9B099A9F09BDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC00000000ADFFFFF00000A90E00AB0000AF00000000000A00090009000000BCA0A00A0A000900FADA9E0A090A9000090BFFFFFFFDB0BC90BCB9E9A909B90B0B0909009009090B00B0F09E9AD909B0909FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000A90000009AFFFFFF00000A000B00A9EB0F0000000000000000A00000000B0B9000B09000A0A90BADA909A0BCA00000B0BFFFFFFBF9FBAD9B0B909A9C0B0909A09A9CB9A90B09B0D90B09B9A9B09B9B90FFFFFFFFFFFFFFFFFFFFFFFFFD0000A000000A0009BFFFFF000A9CA9A0F0E00CAF00B0000000000000000A000000BCA00900A000909EBDBA9A0009A09000A000FFFFFF9F9A90DB0F09A9F9AB99A9B0D9A90B09D0B09AD9A0BC9ADADBC9AD09A9BDFFFFFFFFFFFFFFFFFFFFF000A0090000A090000AFFFFFF00090A90CA009ABA9F0000000A000000A0000000000BDA9000AB0B00A0A90A0000000A09A00000B0BFFFFFBCBF9FB0B09F9A9AD99E9F090B0DB09A0B0FA99A9B90B9099A9B99BE999AFFFFFFFFFFFFFFFFFFF0000090000900000000BDFFFFF0000AC0A0A90A0E0C0F00A9A0000900000009A0900000A00A0B000000000A9000000A90F0000000009FFFF9FB90B09F99B09DB9BEB99ADBB09B09BDB9999DA90DA99EB0F9F0B099B0F90FFFFFFFFFFFFFFFFF0000A000A000A00000000BFFFFFE0000B0CB00E9A90BAF09009A090A00A09A000A0A000B0B0000BFA9A0B090009A00000A0BCA090A000FFFFE9EBD0B09AD0BA9AD99EB9B90DB09F09A9AFA9A9B9A9E090B0B9F0F099B9B9BFFFFFFFFFFFFFFFE0009000000A0090A00A000BFFFFFA0000B00F0000A000F000A0A9AE90B00009A0900000000000B0A9A9A00A0A000009009FA900000009FFFF9B99ABDB09A99DB9A9A99E9AB0BDA9BBDBD99BBD0B909B9F090A9B9B9E9ADA99FFFFFFFFFFFFFF000A000A00900000000090FFFFFF9009A00A00AB0E09E0F0A09090A90A009A000000009000000B0F9B0F00F0900000000FAA90A9A09000FFFCB0FAD900F99B0A909099A99D9990B9D0BB0BBC90BDA9B090B9F9BDADA90B9B9EBFFFFFFFFFFFF0A900000900000A00000000BFFFFFE0000CAD0BC0090A00F0000A0AD0B0B0A0FA00A0000A00A000B0BEB0BB0CA000000A9AD9A00000A000BFFBDB990B9B0A9C9909A9B0D0B0ADA9DA9BC9BC9B0B00900F0BC9A90B9B9B9DBDBBDBFFFFFFFFFFF000A09A0000A0000090A00ADFFFFF9000A90A0A0FA0A0A0F09A09A9AB0A09A90B0900A000B009000B0B0BCBB0000000000BAF0F0B0000A00F0B0FB0BC0999A9A9E090D0B099099A99A9B90B09F9B9B99099B09F90F0BCB09AD9B9BFFFFFFFFFFC0000000A00000000A00009ABFFFFF00000B009000F0C90F0A0000000F0BADABCBAF000F9ADA00A009A9AB0FA00000A00BDF090000B0900B9F9F90F9B9A9E9B0999A909090A9009099090B99A909E9A9B0B0B09AF09F9F9B9BBCBDBFFFFFFFF00A90A00900090000000090ADFFFFFE0000E0A0E0B00A0A0FA9CB00B0B09A90BCB9E909B9ADA9A090BAB0F0F090000090BEBA00A09A00A0B0F9A9AB9090DA9909B0A90B009090099A9E99B09E9A9B90DB09DB9DB999BB0B0BCBDB9B0FFFFFFFC9A00E90A000A00A0B000A000BFFFFF0000B00C09A0CA900AF9AB0B00B0BADAF0B0F0FAACAFB0A90A0090B0B9A090A000ADBC9A09A009A9BDB0F9F9CB0A9A9B0BD09990909A009A00909B0DB99B9C9A9B09A900B0F0BC9DBD9B9B9FBDBFFFFFF0A9A90A0000000000000900A9FFFFFFF0000A0B0A00A00E90F09ADADA0C90B0BB00A9090B9ADBDABCB0AB0B0A9E0009A00A9A00000B0000EBDB9A9B9990909090B9ADA909090009090909B09A90B9B0909A9B99B99B0B0B0BE9E9F0BB9BFFFFFAC0CA09E9A000000000A000000FFFFDA0000D00ACB09A00A0F00A9A009A0ADBC00000A0000F0A000B0A90B0ADA9ABDA0090009000000A0F9FBCBDB0BE9BCB0F9B9099090A00090000A90909BD9BDA9DB0F90DA90FA9F9BDB99BB9BBDF0FFFFF00B0B0F000000000B000000000BFFFFFF000A0A0090E009A00F009009A0009A00B0A9000A0B0A90BB09B0A0090B0BDA0D0A00A0A00B0090B0B0B9A9F99009099AD0B9A9A909090009090B09B09A9A99A099A9A9DB999B0B09EBC9DBDBB9BFFFE0F0A0A0A00009000000000000BFFFFFF0009009CB0A000A09EF000A00000000B00000A09000000A0CBA00900A00BFADBA00009E9B00A0A9FBDBDBDB0B0B9A9A999B9C9090909A909A0090B0DB99B9B099A90999A90BE9DBDB99BAB0B9FADFFF000AD0D090A000A0000B0009A00FFFFFFA000E0A00E00B0C0A0F0000000900B00A0B0F9A00000000B00DBA0B000009BE9F0B0B09EBF0900B9CB9A9A9BD90909DAB0DBB9BDB9F9DB99D9B090B09E9CBDB0F0BDA9A9B999BA9A9E9D9F9FB99BFFDB0B0A0A000000000000000A00009FFFFDF0000B0A90B0CA9A9AF0000000000000090FBADA00A00000BBA09A00000A0F9A0A000BFBDFA00BDBB9F9F9F0B0F0B0B9DB909ADB9E9B09F0B999B99B99B99A9B990909D90F0B09BDB9A9A9A9BEBFFFE00CBCB00A0900000A0000000009AFFFFFA00000C0AACA0000C0F0009A00A0000090BBADB0B000009AD009A0000B0DB0000900BFFFFADA9F0F0DA9B9A99909C990B9ADBDB9F9BDBF9B9E9F9CB90B09A9909A9A99A9B9BD9F9A909BDBDBDB9FFF00AB0A0000000A00900A0000000AFFFFFE0000B0A9E90090A0BAF000000000B000A0ADBEFBC0900A00BAFA900000A00A00000BDBFFFDA9A9B9BB9BCBDABA909A9F0B9B99BDB9F9F9F9F9B0B9C9BDB9DA9F09090B9ADA9A9A99BDB09A9A9FBFF09AD0E90F0BCA900000009A000009BFFFFFD0000D0A00A0AC9AC0F000000900000000B0BB9ABA0000000900A0B0009A09000000ADBFFFFDBDA9CBDB9B99D00B09099C90F9F0F9B999BDBDBDBB9B0B0BB9A9B0B0F099B9F9B9F0B09F09F9B9BFFAC0A9AE00A0BCACA0A0B00000A00ADFFFFFA0000A9CB09A00A0B0F0000000000000900B0DAF09A0090B0A0900000B0000000000BFFFFBFA9B9B9B0BDABB0B909A0B0B9F9B09990090099BDB9D9F99F909D909C909B0B9B9E90BD9B09B09E9FF090B0E909ADBCA9090000CB0A09000BFFFFFD00A00AA00E09A0000F000A900A0000000B0BAB9FA000000000A000000000000000BDFFFFEF9F0F0F0BDA9D090000090909090990BC9A090009BDBB09B0B9B0A9A9A9B0F9E90B9B90B09B0DB9BE0ACA0E9A0E0A0A90A00000A0000000BEFFFFA00009E90CB00E00FABF0000000009000A90A90FB0FB000000900000B000000A00000BFFFFBDA9B9B9B9B99A9A900900000090C0A90B990F0B9090D9F9D90D0990909A9B9B9FB99C9B9BC9B0BCB90009A9E0B09AD0A0CA09A0900B00A09FFFFFF0000A00BA00B09A000F000000000A00000B0A90FBF0FA000A0000000A9A0000900000DBFFDBDA9E9ADB0FB90DA9A000000009B90F90E9A9BCB909099A9A9B0A90B099CB9A99BEB9A9C9B0999BCB0B00CA9E0AC0A9C9000000A00000000BFFFFFF0009A0CA9E0AE0BE0F0090A0900000090A9A0BBCBF00900000000B0000090000000BFFFFFB9BDB9DB0B909A909090000000000B00B909099BE90B00909009000090A99F9BAD99F9B9B09F0B0B9A0CB0BCB0D0B00A0A0000000000000ADFFFFF0000ACB09A0B09A00BF000000009000A0A9090BCBF0B00000000B000900000000009FFFFF09E9A9AB0BD0B0909000090B09A909099000090BC90B09000009009090B99B09F99BBA90B0DB090B9C09A0BCBE9AA0DA0909A000000000009FFFFFE0000090EACB0CA0DA0F000000A00009009A0A90B0B00A0A090000090A000A000000A9FFFFFB9BDBD990B9DA9A9A9A9090BC90909009099A90B009000000000000A909ADBB0BB0D99F9B099B9C9B0A9ADADAF9CBADA0E09A0000A00000AFFFFFF000B0AB09AC0A90A0AF000009000A0009A9B0A000DA900900A0000A0000000000009EBFFF9E9A90B0F90B0909C9090B099B9A9A990B909009090A909090000000909A990F90FBA9A909B0BCB9A9B0CBAFBCAFBCBADA9AC009009000009BFFFFFF0000C0A09A90A0090F000B0000900A000A09A9A9A9ACB0AD00B0F0900090000A0009FFFDB9BDBB9B90B9B09A9A90B09F0B9D990BC90F09909099900B00A0009009E90B99BB999BDBBD09B99A9C9A90DADBDACBFCB0FA9A00A00000000FFFFFF00000B0CA000E0BCA0F00000A90A0090A9B9E9C9E09090C90BC0900A00000090000BFFFBA9F0B0D090BD090B0999A90B09E9BB0B9B9B99B09A9F9A9B909000B00B090F9ABC99AF0B090B9F9AD9BADAEBFEBEBF9EB0F0C0000000A00B0FBFFFF00009A00B0F0A900A00F0A0090A009A009A0A90A90B0F0A9A009A0BC090A0A00090A9BFFFDB9BD9B9F90B0BC9B0F09E90B99AD9F9E9F9FBDBBDB0B9D009009009090B90B99B0F99B99BBDB0B9B099ADBCBFDBCFEDFE9AB000A9A090000BFFFFFF00000F00A000A0B09AF009A00900000A0909A90A900090090B0900B00090900A0900AFFFBDA9B09A9A99B9B0990B09BD0A99A9B99B0B9A9DB9BDBA9B0A900900B090B99E99B0B09AD09A9BDB0B0F9ABFCBEFBFBFADAD0F000000A00000FFFFFFF000A0BC0ADA000E00F0000000A909A90ABA0009009A0000000A0B00A0000A090A0BDFFF9A9F0FB999F0909B9A99B090BD0BDB0DA9D00DBA9E909D0099CB0A9A9DA90DA9BA99F9BDBBD9BCB0F9B09FDEBFFBCFDEDADAA0000000000A09BFFFFF000A000A90A09EB00AF00009A090A090A9009A000A000009A0B09009090A0090A909FBF0B9F9B90DAB09B9A9E9CBC9AB90B0909A90A99B0D99B9B0B9B0B099909A909A990D9A9A9A990B0B9B9BC9BFEBFF0FFBEBAF0F09A00A0000900FFFFFF000090FA90A90A000B0F00B00CB0B0B0ADA0B0900900900A099C000000A0090A0000BEFFBDB0B0B9B999BC999B9B9BBD0F90B0B90909A009B0B0BCB90C9090F0B909B99A9B0B9B9F9A9BDB9BDA99B0BFFFFFFEFFDF0B0E000009A00000BFFFFFF0000A000E00E0B0E00FB000B0BCF9ADB0B00A0A009A00900A9B0B00B009000090009BDF9A9F9F9F0BDA9B0F090BC99B9A9F99CB0B0090B09B0D090B9B0B0B0B0F90DA99A990F090BDA9A9F0BDABCB0DBEFFF9FAF0F0B9A09000000A000BFFFFFA0009A0B0B0900B0B0F09A909FBBCB00B09B09090A90B00900000000000A000A000A9FABDB9A9A9B9A9F9B9B9F9BBEBDB9A9A909C0B0C90F09B0B9CB0BDBD99F9A9A9BC99A99BBB90B99B9B9B99B9BAFDBEBFEDBE9ACAC00A00000000BDFFFFF000A0AD0A0A0AC000AF9F09EBE9DA90B00A000B0A90B00B0A90B00B00B0009000A99FB9DB0BDBDB0DB990B09A90BD99ABC90D00B09090B090B0BD0B9F99A9BA909B99099E99A9C90B9DABCBCBCB0DADFBEDFE9BE0BCB09A00000A9000FFFFFF00000D00AC09A9AADA9FA9A0B9BFA90B0F09A90009AD090009000000000000A09000FBCBB9F9B0B9BBDAFB99F99B0BFBD9B9A9A900B00900B0D909F9F9EBDA9DB9B0DA9B09AD99B9F90B99B9B9B99B0B0FFBCBFE9F0ADA0000900000B0BFFFFFF0000A0B0B0E0090A00FBE9B0F9ADA00B0B00A09009A9A9000B09A90B00B0000A00B9FBDA9ADB9F0DB999BFA9A9C990BBD0900909009A90909A9B0BB0B9B9FA90B09A909B99A9A9A9BB0F0BDBA9F0BD0F0FFBCBDADA9ADA00A0A00A0000FFFFFFB0009AC00B0A0E09A0F0900F0BCB09E0000B00A00909009A900000A000009090090BF9B9F9B9F9BB9FBAD99B99B9A9900B0090A090900A09A90DB9DBDBDB99BBD9B99BD0B09BD9B90DB9B9B0F9A9B0BAFBCFBFAFA9E9A090000900000BFFFFFE000A00B0A009A90AC0F0B0B0B0909A090B000000B0DA090090B0B0909A9A0A0A00BF9B9FB9BE9BF9FAD9BABD0B009D0B900000900A009090090B9FAB9ABA9BC90B09A90BDB9A9AD0BB0B9E9F99F9E9ADBCFAF0F09E9AD0A00000A09A0BFFFFF900000F0AD00E00A0BAF00000000A090A00B009000B09A0B0A900000A000000909ADBBCBB0F99BF0BB9BF9D9BD99B9A9909000009909000090090099DBD9D099BB9BD99B99AD9B99BD9BDB9B9AB0B9B9AFFBDAF9EB0E9A000A9A00000BDFFFFFE0009A00A0AB00AD000F0090009000A0900000A0009AD9909DA909A09A9A0B00A09BDB9F9FBFBDBDBDBDBBB0B9A90990BDB09000A0909A900000900B09B0B9A909D0B0BDA99B0DBA9A9A9BCB9DBDA9E9DAFCBDAF0F9ADADA900009A000ABFFFFF900A0F09000A90A0B0F00A090A09090A000000090A90A0B0A90A0090000900B00BEFBF9B9B9FBFBFBFB0F9F9A9F9A0B9A99A9F999A990000A99BDB09A09099B9B0B9B9A9BE9BB9DB9F9B0B9AB9B9F9B0B9BFAF0F0ADA9A00A00A0000ADFFFFFE000000A0EB0DA09AC0F0900000000000000A09A0A90B09009A009A0A09A00B009F9B09BFBCFBDB9F9F9F9B9BDB90999F9FA9B90BC90B09A990B09099099B0F9E9B9F9F9FB99BD0BB0B9E9BDBDA9F0B0BD0F0BDA9ADABCA0B09A90A9A9BFFFFF9000BCA9A900A00A00AF0009009000A09009000909A09A00B009A0909A09B009A9BBDBF09FB9FBFFBFBFBF9EB90B9B0BFB99D0B9B9B99F99BDBD9B90A9BC9B99B0F9B90B9DBE9BF9DBDB9B9A9B9B9B9F9BB9BCBADA9E9AD00A00000000FFFFFFE000090E00EA90F00B0F00A00000B09000A00B0A9ADA09A00B009A00A9A00B000B0DB9BFB9FBBDB9F9F9F9F9FB9F0D909FFAB9BC9B0FA9B0B0BBF0BD909B09A9B9B9EBDBAB9BF9BB99A9BDB9F0F9E9A9BDBF9BC9ACB0F9ABC9A00A00000FFFFFF0000A90B090E00BC0AF0900900A0000A09000090B09A09A90B0A09B009A90B0BDB9AF9B9FBDFBFFBFBFBFBB9FB9B9A9FB9F9FDBBDB99F9F9FBDBF9A9909BDBDBDBF9BB9F9FB9E9FABDBCB9FB9B0B9F9FADBBDBE9A0F0AD00A09009A09BFFFFFB000A00A0EA090A0A90F00090A9090A9090A90B0B09A09AD0B0B09A00BA9A0009B0BF9B9FBDB9BF9F9F9F9BDF09F0B99BDF9FFBBDBFBFBFBFBDFB9909A9B9B9B0BB9FBDF9FB9F9BBD9BB9B0B09F9BDA9B9B9F9A9ADB0ADA0A000A0000AFFFFFFC0009CBCB009AACB00AF0B0A9909A900000000090A09A09AB0B09A09B0D00B0BF9F9BDAF9FBBFDBFBFBFBFFBBFBBDBCB9BBFBBDFBF9F9F9F9FB9FF0B99BDBCBF9F9F9FBBBDBFBDBDBBC9F9F9FB0B0B9F9F9F9FBDA0E9FA90090000A090FFFFFFB000A0A00B0E09A0AD0F9099EBB09A9B9A90090A9DA09A090B0B09A00A0B00909B9FBBDBB9F9BF9FBDBDB9BFDBDBB9B9E9FFDFBF9FBFFBFFB9FB9090BDA9BBDBBBFBFBDFBF9FBFBBDBB9AB9B9B9F9A9B90B9A9B0F9A09EAD0A0A0900A09FFFFFF00009A9E0B0A09E0AAF0B9A9B0BF9000000A0A90A90A90A9CB0B09A90909A0BF0F9F9BDBEBFB9FBDBFBFFF9BFBDBF9F9B9BFBDBFF9FBFBDFF9DB9B99B9F9FBDBDBDBDBBF9FBDBDFADBF9DBE9F9B9DBCBBBDBDBF0ADAF09A00090A0900BFFFFFC000A0CA0BCADA00B00F90B9B9BB0BA9B0909090A9B090A9AB09A9A900A0A09F99BB9FFBF99F9FBDBBDBDB9FFD9FADBBFBFDFFBFDBFFDFDBB9AB9E9DABFBFBDBFBFBFFBDFBF9FBFB9B9B9BB9B0BCBAB9BD09B9B9E90B0DA0090A00000BFFFFFFA0009CB0F0A9A9EB0CBFA9AFBBCBB09000A000A0900A0909099A9A90B09090A9B9F0F9BDBBFBF9BF9FBFBFF9BBFB9BBDBDBB9FDBFFBFBFBF9FBDB9BBDF9B9FBF9F9FBDBF9FFBF9BDBDBDBE9F9F9B990F9BBBDAF9BCADAA900A00090A09FFFFFFD000A0A00BCACA0CBA0F9090B9B90B0B0900B090A9090A0B0AA9A9A90B0B090BDA9FBFBFDBF9FBDBF9A9B9BFDB9FF9FBCBDFBFBFFBDFFBF9FBDBFBDBB9FFBF9FBFF9FBFBFB9FBFBBDBA9B9B9A9B0BF9B09DA99BCBB0BD0E900000A0000AFFFFFE00009CBCA9A90B009AF0A9A90B0B0000A09000090B0A900B999A9E9B0B00A9F09FB9F9BBF9BBDBB0F9F9E9BB9FB9FF9BFBBDBFDBFFBDBDBF9BF9FBDBFB9F9BF9FBFBDBDBDFBDBDFBDBF9F9F9F9F90BDB0B9FBDB9CACAF00000B00000B9FFFFFB0000A0A09E0AC0AF00F09000A00000000000000A000900B90AA9B0BA9B0B9B9B9B9FBF9F9BFDBB9DB9B099B0FB9FB9BF9BDBFBFFBFFFFBF9BFDBBDBFBDBFBF9FBBDBFFFBF9BF9BB9BF9B0BB9B9A9BDB099FB0B99AB9B00A0000000900FFFFFF0009AD00DA0090A900FFA0900090000000900009009A00B00B99A9BB9EB9A0F90FBFBDBBFBDBBBDAB9A9B9AD9A9EBDAF9FBFBDFBFDBF9BDBBDBBDFB0BDBDB9FFBDFBDB9BDBBDBBFDBF9BFBD9BCB9A9B9F0B9BD90F90E0F0090000000A9FFFFFFC00000B0A09E0B0E0A0F9A0A90000000900090A09B09A90B00A90B0BA90B9B0B909FBBFDBFBFCBBDB9F0DB9A9999B9F9B9D0FBBDBFFFFFBDBFDBB9FBDBBBFB9FBBDBFFFBBDFBDBBBDBF99BBE9B9F9E9A9F9FBBB90BDB0A00A000000000BFFFFFBA000AC09A00AC09A90FA9900000B00A000A0090A00B00B0B09AB9BB9BA00BDB9BFBDF9BF9F9BF9B9A99B0990F0B0B9BDBBB9F9FFBF9B9FBF9BF9FB9B9F9BDA9F9B9B9BDFBBDBDF9BF9EBD9BBDA99B9FB9A99C99B9A0F0F000000B0009FFFFFFC000A9A9E09A90B00CAF90A00B0B009000090B0B09B00B0009ABDBE9A099B099CBF9FBBF9FBBD9F0F99B099A9090D9BE9A99FBFFBDFBFFBF9AF9EB9F9F0BCB9B9ADBDAFB9BDBBB9BF9BB9BFBD9B9BE9B909009BE9A9F0B00000B000A9AFFFFFF00090C0A09AC0A0E0B0FA09A00009A000B0A00B09A00B0A9A009A9BADBA00B09B9BFBFDBE9BDBBB9B0B09E909A90B099F9FB9F9BFBF9B9F9FB9B9F9BA9B9B9BCB9A9B9BDBFBDBDBF9BF9FB99AB9E99F9FB09B099F9A0F00A9A000A90A9FFFFFFA000A9E90E09AD0B000F9A0900B009A00000B00B0BBA09000B0A9A9B00B0BD909F9F9BF9BFBBDADBDBDB90B0909090B0B90BDBFF9FBFFB9B9DBF9BD9B0D909B9BDB9F9FB9BDBFBDBFDBB9FBF9F9BB0BB09F099A99F9B0F0000B0B0EB0A9FFFFDF0000A0A90AA0A00BE0F0900A90B0009009000B0B0090A0B0009ADA0B0090B09ABFBFF9F9909A9B0B0000909A90B09090B99BB9BFBDB9FADBB0B9A9AD9B0BD090B9AB9BDBFBBDBBF9BF9F9B9B9BDBDBC9B090009A90F0B0B0000ADB0DBFFFFFFA00009E9E0D09CBC00BF00A090A90B00A0000B0009A0A90000B0A9A90A9AB0909F9BF9AB9A090909009A900000000B09B9FAD9FF9FFBF99BB9DB0DB90B0900B9F09BDAFBDBFDBBFDBF9BBE9BFBCB0B99B090A999F9B0B0E00A0A9A0FAFFFFFFF000B0EB0B0A0AB0A0B0F9009A99E009090A00009A09000000000900A9000D9009BFDBFBDB9F000000000A00000090000D099BA9BFB9F9BF9DAB0B9009090B9909BDB9B9BBDBBFDBBBDBF9BF909B9B0F00B00900B9BCBCA9000900DBE90FFFFFFC00009EBCB0BC0A9AC0FA9000A909A00000000A09A00000000000B00A9A9AB09A0BF9BDB090B00000009000000000009A9A99F9F9FFBF9BA99D90B9A900000A909B0BDBCBBDBBBDFBBF9F9BFBFB9F9B9009009009B9A9E0A9000A00BEBBFFFFFB000AD9EB0E0B0CA0B0F000A9CA9A09A900090000000000000000000000090909DB9FFF0FB9090000000000000000000990DA9BBFB9B9BC9B0B0000009A90909A90F9BB9BDBFDFBBDBDBBFDB9B0F09F090009099F9A9E9A00A0000B000FFFFFFC0009AE0BE9A0A90F0AF00090A90090000000000000000000000000B000000000BBFFB9B9909A900000000000000000B009B9BBDB9F0F09B0B9000090000000000B9B0DBFBF9BBBDBFBBF9B9F9F9BB000009090B09F0BC00000000009BFFFFFB000A0E9BC000F00A000F09A0000000A000000000000000000000A90000B0000009EB9F0FADB90B0909A00000000000909B090D9ADB9B9B09D0090000B0000000900009A9909BF9FB9F9F9BE9BB0B0DB90090B0999A9E0B0B00000000A0FFFFFF00009A0A0A9A0AC9ADAF0000A90A9009A00000000000000000000000B0000000099DBFB9BB0F90B0B090D99A90900900009A9A9B9AD09DB0B90A000000000000000000000B090B9EBBFBF9BF9BDB9B09B9A90B0F990BDAC000009A0009BFFFFFF0000D0CB000900A000F0090000000000090000000000000000000A00000000000FB9BDBD0B9A999090B000900A09A090909990D099B0B09009090000000000000000009A99B9FB9F9BDBBDBBCB9A9FBC99F999B09B0A90A0000000000FFFFFF000A0A0A00E0A0A00A0F000090A00A00000000000000000000000090000000000BB9E9FA9BF09DA09A909A90090900909A9AD0B9B9A0909009090090000000000000090099ADBB9BFBDBBDBBDB9ADB099B090FB099E0BCB0000000000BFFFFFE000900B00B00CA9CB09F000A000090000000000000000000000000000000000000DBBF99F09B0B9B0DA90900B00009000909A9900099B09A9A9A9009090909A9A9A9909B0B90BCBDB9BDBBF9A9E90B9A90B9B9090B9E9AC90A0000000BFFFFFDA000E00AC00B000A0A0F0A90009000090000000000000000000000000000000009AD9FA90B0DB0D0B090B099090B00B0909090B9BDA9090909090B00A9A9A9D09090CB09D0B9B9BBFFBBCB9BDB9B90BDB090FB0090B0E9A00000000000BFFFFFD0000BC0B0A0B0B0C9AF00000A00000000000000000000000000000000000000009BB090009A9B0B90B090A000909009A9B09B090909A90090009090909C90B9A9A9B09A9B9E9BC9B9ADBDBF9AD0AD0909AD900999E9A9CB0000A0000BDFFFFFA00B00A90AD0E00A9A0F00009000A0000000000000000000000000000000000000BE9F0000000000000000090B009A900909BC90B9B9C9A90A90B00909A9A900909909B9B0B9BDBBFBDBBBB09B0B990B9099B0909A9A9EA000B000A90FFFFFF000000F0ACB0A09ADA0FF090A0000900000000000000000000000000A000000000099B9F00000000000000000009A090B9CB09B9F909A909009090090B0909A9B0F0B9AD0BD9F0BF9BDB9DBDBE9900A90A9B00000B9ADA09A000009000BFFFFFF0000A09A9A0B0A0A0B0F00000090000A09000000000000000000000900000000000F9B0B000000000000000000090B90B99B09A9BD09B0B090A090A909A909A99990B9B99AB9F9BE9BFBA9B99A9A9009009900099E90FBC09A00A00B00BFFFFFF0009ACB0F9CBCB0F0BF000900A00009000000000000000000000000000000000009ADBD00000000000000000000BD0B90BCB9B90B9B090D0B0900900909E990B0BF9E9AD99A9BF9FB9BDBDA00000000000A099DA00A00B0000900000BFFFFFE0009E0B0E0A0A00E0ACF000009009000000000000000000000000900000000000009B9A9A000000000000000009090B9EB9B9D09F9BCB09A90900B00B0A909CB9F0909A909ADBD9BBDADB9A90000000000009B0B00BCBF0A00000B00BDFFFFFB00000B0F9A9E90B0B0BF090A000000000000000000009000000000A00000000000000F9F9C000000000000900A0F9B0B99F9AB9A9A999F90B00B00900090B0B0B0B0B090B09B9ABF9B9B9B900000000000000090000B00D009A000000BFFFFFF000A9E00ACA00AC0AC0F0A090A90A9A90A900000009000000000000000000000000009A9AB90900000000A009909AD9EB9AD9BDB9DB0B0B90900000000000090090000000009F9F9E9BCBCB00000000000000000090AFA0B0000000000FFFFFCB00009E9A90AD0A90B0F009000000000000000900000000000000000000000000000099F99ADA9A9F0F0B99B0F9B9BB99F9BBDA9B9A9F99E9A9000000000000000000000009A9B9BB9F9B90000000000000000009A0D09E000000B000BFFFFFF0000A0A00A0CA00E00AF00A0090090009000000000000000000000000000000000009A9A9E9B9F9F0B99BDAFDB9ADA9DBA9BC9B9E9BDB0B909000000000000000000000009FBDBCBDBB090000000000000000000AC9ABE0000000000BCFFFFFA0000090CBC0B09A00BCF0900000A009A090090A00000A900A009009000000000000009F9B9BDA9E9BDAF9BF9A9FB9DBAD9F9BBDB9F9B9F0B9F0990000000000000000909A9A9B9B9B0D9A000000000000000000009AD00B0000000000BFFFFFF000B0E9A0A00A0CB00AF00090A900A000A00000900000000090000A0000000000000009ADA9BDBBF9BDBE9BF9F9FBBDBB9BF9BADB9F0B9BDA9BA9A900900900000000009DBDBCBF9F9A9000000000000000000000A0ABC0B0000000000FFFFFDB00000A009AC0A00E90F00A000000909A900A00000900000900A00000000000000000A99B9B0B9DABFB9FBF9BFB0F9F9F0F9BDFBBCBBDBDB9F0DB9F0B00000090000B9FAB9B9B99A9A900000000000000000000009E9CB000000A0000BFFFFFE0000F00DA009A00A00AF0000A90A00A0000009000A0090B000090090000000000000090BC9E9F0BBDB9F9BDAFB9F9FA9BF9BCBB9DBBDB0B9FB9BBCB9D09ADA90009B9EB99E9F9BE99000000000000000000000009A00B0E0000000009FFFFFFB000A000A0C0A0DA90E0F090900909000909000A090000009A00000A00000000000000090B9909BD9BDABF9BF9DBFB9FBF9FBB9FBBF9BF9FB09FADBDABBF9B90FBDB0F99FB9B9E990000000000000000000000000ADA9E09A000000000BFFFFFC00090E90A9A0A00A09AF00A00A0000BCA0A000000090A00009A0900000000000000009A90B0B09A90B9DAF9BBBDBDB9B9F0F9B9CB9E9BBDBBF9BB9BDBD9FBFB9B0F9BFB0BDAB9B0B000000000000000000000000000A9AC00000000000FFFFFFB000A00E00C90AC0A00F0009000A000090909000A000900000000000000000000000000000090B09F9FB9BF9F0B9ABDBDBB9BDBB9F9BDBA9F9BD9FBF9AFBCBDAF9BBDB0F9B9F9E900000000000000000000000000BAD0F0B000000000BFFFFFE000009A09A0A090B0CAF090000900B0B0A00A0B0900A00A90000000000000000000000000000009B0B09BDB0B9FB9DB0BB99E9ADBBBDBB9F9BDBFA99BFBDBDBF9FBDA9F9BCB9A900000000000000000000000000F0C0B0A00000000A9FFFFFF9000BCA00A0000CA00B0F0A0A0A000000909000000B090000A0000A0000000000000000000000000099BF9ADBDB9C9A9B09CB99B99C9A9DB9FBA9BDBFB9DBBBB9BA9BF9B9B99F90900000000000000000000000000B0B0E9000A000000BFFFFFE0000900BCACA9A0E00AF00909009A9ADA000900000000900000000000000000000000000000000000090B9B9A9A99909F9B0B09A9B99BADB0DBF9B9BFBBDBD9F9DB9BDBCBB0B9A00000000000000000000000000A0F0B0AC0000000000FFFFFF900A0AC000900090BC0F00000A90000009A0A09A9A9A0A0090009000000000000000000000000000009FBCB09090A0B090099F99B0BC99B9BB9B9FBC9DAB9AB9BBBCBB9B9DBDA90000000000000000000000000B0F00AD0B000000000FFFFFFE000009A0B0A0E0A000AF00B0A90000B0B009090000C0909A00A00000000000000000000009A0000009A909000000090909BDA90B0D9B9BADBDB0FB9BBBB9FBDAF9DBBDADBA9A9000000000000000000000000000F00BDAA000000000B9FFFFF9000BCA00CA009AC00A9F0009000A900009A000A00A9A0A0000000000000000000000000000090900009B000000000000B09099BD9AB9AD9B0BDBBCBF9F9FB9BB9ABF9B9B9DB9000000000000000000000000000B0B00A9C0000000000FFFFFFE0000000B00DA00B0BCAF900A9E000A9AC090B09090090DA900000A00000000000000000000000A90000000000000009009A9A90B99BDBB9FB9BDB9B9F9B9F9F9F9B9E9F9AB0F9B0000000000000000000000000CA0F0CA9A000000000AFFFFFF000A9AC0A000A000000F0090009000009A0000A000A0A000A0900900000000000000000000009009A900000009000000090990B0BCB09CB99E9B9FBDABDA9A9B9BDB9B0BD990000000000000000000000000000B0F09A9E00000000009FFFFFB0000C09A09A0D0E0A9AF0A00B00A9009A00B0B09A90909A09000000000000000000000000090A090000000000000000900B9CB999909BB90B9B0F90B9DBB9FBF0FB9BDB9A9A900000000000000000000000000BCB0AA9E09A0000000BFFFFFFC00B0B0A0E00A0A090E0F0090000009A0000000000000A09C0A0000B000000000000000000000090B000000000000000A009A990F0B9F909BDBDB9BBDBBBDB9B9BB0F9AD0909A000000000000000000000000000BCB0DA9AC90000A000FFFFFFA00000C009E00090A000F90A00A90A00B0BC9A9E909A900A90009A0000000000000000000000000900000000A0009A00900090A99B0B0BDB0B0BDADBBDB0BFBCBDB9BB9A9A0090000000000000000000000000000BCA09E9A00B0009A9BFFFFFF000A0B0A00BCAA0CB0AF00909000090C000000000A00E900A9000000000000000000000000000900090909A9000090000090B99A9D9B9A9F9B9B9B9CB9F999B9B9F9CB9090000000000000000000000000000000E9BCA9E9EB0E9AC00FFFFFFF0009CAC9AF0A9CB0AC9F0A00A0B09A00B00B0B0B009090A0900009A00000000000000000000090A00A0000000000000000A90DA9A9A9E9B9BCB9FBDBBF9BBEB9E9B0B90B0000000000000000000000000000000B9ACA9E9A9CA90F0BFFFFFFF00000A9BEF0AFCBE9E9AF09AC00C000B00900000090A0A090000B000000000000000000000000009009000009090000000909B099DB99BD9E9BDBA9BF99AD9BDB9E9B9AD909000000000000000000000000000000E9A9E9E9EBDAF0BCBFFFFFFF00ADAECB0FDABE9E9AFF000B09A09009A0B09E90009090A90A00000B00000000000000000000000090B090B09E900900000099A9A9E90BB9B9AD9F0BF9FBF9BF9BE9D9A9A000000000000000000000000000000B0F00A9ADACBCBCA9CBFFFFDA000099EFFAFDADAFEDAF09000009A0909000A00A9000000009000B0000000000000000000000000000000090B09A00000009A090909B990BCB9BB9BDBB9B9AD9B99B0B9090000000000000000000000000000000F0BCBCBE9FADA9FAFFFFFFFF0000AE9F0F9EFBF0BFFF0A0A9A9009A0E0A900900A00A9CA0009000C000000000000000000000000090009A000900000000009A09A9ADAF99BDBCBDBE9F0BF9BADB090000000000000000000000000000000000BCBCB0AF9FADAFFE9FFFFFFF000B0F9FAFFAF0FCBFE0F909C000B0009090C0A0A00090A09C00A00B00000000000000000000000000000009090A90000000000900909999ADB0B99BF9B9F99A990090A9000000000000000000000000000000000B0A0BDAF0FBF9E9F0FFFFFFE0000EBCF0FDFFBFEDBFF0B0B0F009A00B00B00C09000000A090000000000000000000000000000000000000009000000000000000000A099A9DB0B0BDA9ABD9E9B0A900000000000000000000000000000000000CBDACB9EBCF0FBEBFFFFFFFB000B0FBFFBEBCF0FADFF0000000B009000000B000A0009000A00900B000000000000000000000000000000000000000000000000000090A090B0F9F9B9D990B90909000000000000000000000000000000000000BA09A0CBCBAFBCF0FBFFFFFC0000BCFEBCFFFBFFFFAF00B00B00000000B0000B00900A0090000A0000000000000000000000000000000000000000000000000000000009A0909A900B09A900A000000000000000000000000000000000000009E09E0FBE9ADE9E9ADFFFFFF000A9EBF9FFBCBEF0F0FF00090000090A9000B0000000000A0000000000000000000000000000000000000000000000000000000000000000090B090B90B09A909000000000000000000000000000000000000000BCA0B009E9A9EBCBAFFFFFFA000CBCFAF0FFFDBFFFFF900000090A00000000000000909000000090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A0B00CBE0ACBE9E00DBFFFFFD009A0BCDAF0FAFCBE9EF0CB0B09AC900009090BC900A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000F0CBA09ADADEBCB0AFFFFFFA0000BEBAE9EBDEBE9EBFAB9EDAB09A9B0B0FAF0B0BF90B09A9F0ADAF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000F09A00DAF0BFADA00FFFFFFF0000F0CBC9E9FEBF0FADFDFFFBDFFBFCB09FBDBFDFF0FFCB0DADF9FF9F00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B0A09ABDAFE9FA0A0BFFFFFF00000ABCAEBEF9E0F0FAFBFFFFFBDFBFFFADFFFFBFFFBDBFBFBFFFFFFFF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ADADA0C0ADBFEDE90D0FFFFFFF00A9CA90BCBEF9EAF0FFFFFFFFFFFFFFBDBFFFFFFFFFFFDBCFFFFFFFFE000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B0B00F0BFAFCBFA0EABFFFFFF00000A9EADAFDAADADAFFFDFFFFFEBFDBDAFFFFFFFFFFFFAFFBFFFFFFFF00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000BCAC0B00BCFFFFE9FADFFFFFFF0009CBCA9E9FAEDA0FAFFBEBFFBDBDFAF09FBFFFDFFF9F9F9BDFFFFBFBF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B9BC0A9EBDEBE9EADADFFFFFF000A0A0F0BEDE9A9FADFF9BC9F0F0B9F0B00DADAF0FBE9E9A9A9FADFCFDA00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E0A090E9EBFCBE9EBEBFFFFFFF0009CA0FCBEBE0E0FAFF00B00A90000900B09A90B0090B0D00B09A9A9A00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000F0F0BACB0BCBADAE9E9FFFFFFF0000A0BCABFCF0F0FADFF00000000A9000000000000000000A9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B0B0BC090ADABCEBDA9EFFFFFFCA0090BCAFDEBABCBADFAF0900090000A000900900009A0090909A0900A090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000F0E09A0BDACE9A0ACABFFFFFFF000ACAFDBEBDEDACFAFFF000B00090000900A00A09A0090A00A00000900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000F00B0BC9E0A9B0E9E9AD0BFFFFFFF00090AAFDEBAFFAFDAFF0A0000A000900A009000000000000909000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009A9ACBCAA0BCACB0E0ACAFEFFFFFF0000A0FDAFBCF0ADBEFFF090909009000009000000000000900A00A0000A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009E0E0B0A90D0B0F0F0BCBF9FFFFFFB000ADBFADFCFBEFFE9E0F0000A00000A0000000900900B000A0909090090900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A09AD0F00A0ACB0A9ACB0EBFFFFFFF00000E0FEAFACBDAFFBFF09A900B0B00900000A0000A00000900A000A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FA09A00BC0B09ADACBACBCA9FFFFFFE009A9F9FDBFBEFDADEBF0000090000000A900000A00000000090909000A00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B09E00F00A900ACA9AC0B09EFFFFFFE90000EAEFAE0E9EBFEBCF000B000000000000900000000900B0A00A009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000F0CA09A0A9000E9A9E00B00E9BFFFFF9000ACB9F9ADB9FAFCB9EF00000B0090A00000000900900A000090909A0009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000AB09A0C90ACA900CA0B0CA00ADFFFFFF0009A0E0ACACACA9ACA0F0090009A00000090A000000A00000000A9090900A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A0DAE0CB0A09000A9090CA009A9AFFFFFEF0009A9E9A9A9ADA9ADAF00A0900000090A00090A0000000900B090000A00000900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009A90B00090A00A00ACA090A000FFFFFFF000A0CA0ACACACA0E0A0F0009A0009000000000000A009000A0000A0B090A900A0BC00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B0EACA0A00E000900B00000AC00ADBFFFF90000CB09E90A9A9E9E0FF0900009A00A00900900909000A00090909000090000009FF00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009AD00A90000000C00B0000A09FFFFFFE000B0ACA0ADACACA0B00F00B09A000900000A00A000000000000A0090B0000B09A0BFF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A0F00A0D00A9A00A0A0000A0090A0FFFFFF9A0090BCB0A9A0BCA0FAF000000909009A00009000A09000900090A0000B0000009FFFF000000000000000000000000000000000000000000000000000000000000000000000000000000000000E9090AF00A00000009009000090000FFFFFFF000CACA0AC0E0F0A9E00F9009A90A0A00009000009000C000A900009A9000900A9ADFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000009A00A0AF00B00BC0A000000A0000A0A9FBFFFF0000A0B09E9A09A0BCA0FFADBE9AD909F9B0F9ADB0E9AB0BBC9ADA9AD0F9B0CBC90FBFFFFFA00000000000000000000000000000000000000000000000000000000000000000000000000A000A009ADAD0BACB00A9090A0A0000A00000FFFFFFF000900EA00B0E9E0ADA0FB0F9FFAFBCBCFDAFDADB9FDFF0FBE9FFF9ABF0F9A9BFADFFFFFFDB00000000000000000000000000000000000000000000000000000000000000000000A0000000ADACA00BAFC9A0E90A0E0090A9A0D0A90A9FFFFFF90A0E90DA0CB0A9E9ADAFFFFFF9FDAFBFBFFDBFBEFFBFDFFDFFF9FEDF0FBE9FE9FBFFFFFF0E0B000000000A000000000000000000000000000000000000000000000000000000A00000009E9A0B0FACB0BE9E9AE9A09A0E90CB0A9CA9FFFFFFE00009A0A0B00E9E0BCADFFFFFFFFBFDFFFFFFFFDFFFFFFBFFFFFFFBFBFFDFBDBFFFFFFFF0FBDE0000000000000000000000000000000000000000000000000000000000A9000000000A0BE0A9CBCBCB0FE9E9AF90F0ADA90EBACBCA9EFFFFFFB0000ACB0F0EA9A0BCA9AF9FBFFFFFBFFFFDBFFFBF9FFFFFFFBFFFFDFFFBF9EFFFDBFFFFFF00A9FAC00000000000000000000000000000000000000000000000000000A9CA0A0090A9C9E90F0FAFADA9EB9EB0F0AE9F0A9EFBCFBEBFEBFFFFFFC000B0BCA0A90E9E0A9E0FFFDFBFFDFFDBFFFFFFFFFFFFFFFFFFFFFBF9FFFF9FBBEFFFFFFFFBCACBA000000000000000000000000000000000000000000000000000000AA900BCA09AA0AEB0BCBCFAFE9EF0FE0F9A0A9E90AFBCF9E9F0FFFFFFFB000CA9E9EA9A0BC0A9AFFBFFFFFBFBFFFFFFFFDFBFFFFFFFFFFFBFFFFFFBFBCF9BFFFFFF0CB0BCF00000000000000000000000000000000000000000000000000000F0DACBCA9EAC9E900F0FBFADA9E9AFA9B0E9E9E0AF9EFBEFFAFFFFFFFFE0000B0CBA9CBCBCBADACFBFFFFFFFFFFFFBFFFFBFFFFFFFFBFFFFFFDFBFFFDBFBFFFFFFF0FB0ACB0AC00000000000000000000000000000000000000000000000000FA0A0B0A9E909AB0EFBEBCE9E9EBEDA9CACB0B0A9F9EDBCBDAFCBFFFFFF9009E0FBEDEBEAE9ADA0BFFDBFFFFF9FBFFFFFFFFFFFFFFFFFFFFFFFBFFFFFBCBDBDFFFFFF00F0B0F0BA000000000000000000000000000000000000000000000000B0BCBE0F9E0BEAD0FB0F0FBBFBEBDFADAA9A0E09CA0ABAFBFADBBFBFFFFFE0000B0E9A9E9BDAE9AF0FFFF9FFFFFFDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFBFBFFFFFBF00F0F0E9CB0000000000000000000000000000000000000000000000BCBCB09E0A9E09ABE0EBCBEDE9E9EA0FADAC9A9A0B0F0CBCBCBEDEFFFFFFFF00A0CB0FAF0ECBDBEDAFFFBFFFBFFBFBFFFFFFFBFFFFFFFFFFFFFFFFBDFBFBDBCFFFFFFFFCBF0F0FBEBCB0C000000000000000000000000000000000000000000BCBE0EBE9E9E9BE9E9FBCAF9AFEBE9FFADA9A00000000BADBEBE9AB0FFFFFFB0000B0F0F0FBBEACBADAFFFFFFFFBDFFFFDFBFFFFFFFFFFFFFFFBFBFFFFDFDABFBFFFFFFF0B0FBEBCF0F0FA900000000000000000000000000000000000000ACBCBCA9BC9A9EB0E0F0FACBFDAFF9F0FAE9EBCBC0B0CA9A9CBE0F0FADFFFFFFFC000B0E0B0E9ACA9FADADFFF9FBDFFFBFBFBFFDFFFFFFFFFDBFFFFFDFFFBFBFFDBDFFFFF9E9EF0FDFBFBFF9EDAD0000000000000000000000000000000000A90B0A9ADACBEDABCBDBEBCBF0FAFDAFAFBDBFADA0B00A900EAFADBCBADABFFFFFFB00009ABCA9ACB9EA9EB0FFFFFFFFBFFDFFFFBFBFFFFFFFFFFFFFFFFFBFFFFFBFBFBFFFFFFA90FAFBCFCBEFBEBEFBE90000A000000000000000000A9009AC0AF0F0EDA9A9A9EDAEADAFBCAF0FAFFCBCAE9EDADA0F00AB09ADFAFBCB0F0FFFFFFF00A0C0A9E0B00E9CB0FAFFFFBFBFDF9FBFFFFFFFFBFFFFBFFFFDBFBFFDFFBFDFF9FFFFFFEDAF9F9EBFBFDADBDF0E9EBE9E9000A000A009A00090AC0AA00B0D0A0B0A9EFCAF0BDBDADADBF9EBDA9FEFBDEBAFADA0AF0CBE9EBDACBEA9FBFFFFFE009CBADA9ACAF0AB0E00FFFFDFFFFAFFFF9FF9FFFFFFFFFFFFBFFDFFFFBDFFBF0FFFFFFF9BADAFEFFCFCBFFEFAFBFDADAF0E9E09009CAC09A0A090A9C9AC00A09E0F0E9ABDAFAEAFADAF0EBDAFFE9BCAF0FC9ADAF09BE9EBCBEB9E9FEFFFFFF9000A0CBCAD0B00F0E90BFFFBFF9FBFBF9FFBFFFFFFFFBDFFFFFFFBFFFFFFFFFFFBBFFFFFE0DAF9F0FBFBEDADBDF0BEFBCBDBE9FADA0A99A09000A900A009A09E00B0B9ADFEBCDBDADADAF9FADBCBFEBDAF0BACB09EAE0BCBFE9FEBEBFFFFFFFE0000FBCB0AACAF0EBCA0FFFFFFFFDFDFFBFFFBFFFFFFFFBFFFFFFFFBFFFFBFDBFDFFFFFFBF09EBFF0FDEBFFAFAFFCBEDBEBCBE9EBCBCAE9EACBC0E0B09A00000B00E0E0B00BAA0F0FAF0AF0FAFBE9E0F9EBCB0FEADB0F0BCBFEADFBCBFFFFFFB00B00EBCF09ADAF90BCAFFFFFFBFBFBFFDF9FFFFFFFFFFFFFFFFDBFFFFFFFFBFFBFFFFFDF0BFBCFAFBEBDADFDF0FBF9EF9EBDBADA9A9F9E9F9A9B0BC0A000A0000F0B0BCAF0DADAA9E9F9EAF9EF9EBDAE9E9AF0BDA0DA9EBE9BDBEDFFFFFFFFC000CB0EB0FADADAEBCA9FFFFFFFDFFFFBFBFFFFFFFFFFFFFFFBFFFFFFFFFFDFF9FBFFFFFA0F0CFBDFEDFEFBEBEBFADAF9EBCBEDADACF0EBF0EDAE0F0BC0B090A9A000A00900A90A9CB0AE0BDAF0FADAADB0EF0BCAADA0E9ADFEFEBFAFFFFFFFB00A9ADB0FADAFADBCA9EFFFFFFFBF9FFDFFFFFFFFFFFFFFFFFFFBFDFFFFFBFFBEDFFFFFF0F0FB0FADBE9FBCFDBCFDADFADBFCBBCBDBAF9FCFB0F9F0F0BC00A00C90A9C9A0A90A9C0A0E90F0E9FACB0E9AEF9AFCBC9A9A9EFEBFBFCFF0FFFFFFC000ACA0F0FADADAE9AF0FFFFFFFFFFFBFBDBFFFFFFFFFBFFFFFFFFBFFFFFFFBDBFBFFFFFF0B0FBEDADBE9FBEBEBEBFADBEDABCE9EAD9EBABCFBCB0F0F0B090B0ACBCA0A9C0AC0A0B090A00B0ADB0E90F9ACF0B0BAC0ACB0B9EDEBFAFFFFFFFFB0090BCBEBCBEBE9EBCAFFFFFFFFFFBFFFFBFFBFFFFFFFFFFFFFFDFFFFFFFDFFFFDFFFFFF9E9EDADBFEBDACDBCBDBCBDADABDE9BE9BAF0FDEBF0FADAF0BCACAC9A9A90BCA0B0B09000E090BC09A0F0A0ACBA9E0E0CB0DA0FFEFBFDEF0FBFFFFFE000A0BCBCBE9E9E9CBDAFFFFFFFBDFDBF9FDBFFFFFFFFFFFFFFBFBFFBFFFFBFBFBFFFFF9EB0FBFFFEBCBEBBAF9EAF9EBEBDEBBEDACF0F9EBF0FADAF0BCB09A9ADADAFC9ADAC0F0E0B09A00ABE0F0A0DA9AD0A9A0B0A0BDE0FBEDAF9FFFFFFFF00A0C9EBCBE9E9EBEABEBFFFFFFFFBFBDEBFBDFFFFFFBFFFFFFFFFFFFFFBFFFFFDFFFFFFE90FEDFEBDFBE9FCF0E9F0EB0FDABDE9ADB0FBE9F0F0F0BCBCBCA0DACADAF0BEDA9AB0A9ACA00E90090A9CA00E00F00D0009E0ABF9CBEB0FAFFFFFFF9009AB0FADAFAE9E9FCFCFFFFFFFFDBFBFDBFBFDBFFFDFFFFFFFFBF9FFFFFFF9FBFBFFFFFFA9FBFDFFFDFFAF9FBE9F0DA0ADABCFAADB0CBEBFAF0F0BCB0BCB09B0F09E9ABCBC9E9E90BCB0A9E0F0A90A90B00A0A0F0A09C0AAF00FACB0FFFFFFE0000CBCBE9CB0F0EBABFFFFFFFFFBE9FBFF9FBFFFFBFFBFFFFFFFDFFBDFFBFFFE9FFFFFF0DADEFBEFAFBDFFEFFDEFBADBDAD0B0D9ACBBDBCBDBCBE9BF0F00F0E9AFA9EDABCBADA9EBCB0E9E9AB0F0A90A00B09000009A0BC90AD00B0FFFFFFFF000A9EBCBEBCFAFBCFCAFFFFFBDBFDBFDF9EBDFFBDFFFFFFFBF9FBFBFFBFFFFF9FFFFFFE9A9FBFFFFFFEFEFBDEBF0FCB0EA9EBCBAE9BCBEBCBEBCBCE0F00B0A9ADADE9A9CBCF0BE9CA9E9A9AF0F0BC0BC9E00A0A000000000A000B0CBFFFFFF000BCAB0F0ADABCBCFAB9FFFFFFFFBFFFBFBDBFBFFFFBFFFFFFFFFFFDFFFFFFDBFBFFFFF9E0FEFCFFDFFFFFFFFFFFFBFFF9FFADAC09ACB0BDADA9E9BBDA9AC9EBCBCB0F0FADA9AD0BA9E9ADAD0FAD0BCA0A9AD0D00B0A0900090A000A9FFFFFF00009C9E9ADAFCBEB0FCAFFFFFFFDF9FFDFFFBDFDBFFFFFFFFFFFDBFBFFFFFFFFFDBFFFFF9A9BFBFAFADFF9EFBDEFDEBCBF0FDBFBF0F9EDAF9ADA9ECBE9E9A09A9EBCB0F0F0F0FAF0F0BCB0FAF0FAF0BCBDA0A0A900C0000A00090090AFFFFFFF000A0A0ACA9ABCBCB0BCFFFFFFBFBFFBFBDBDBFBFFFFFFFFFFFBFFFFFFFFFFBF9FFFFFFCBC0F0FFFFFFAFFFFEFBFFFFFFEFFAFCBCB0A9A9E0F0BCBBCBCBC0F0F0F0BCBE9AF0BCB0F0BCB0F0BCBDADACBCA9E9E9EB0B0B0A90A00A0009FFFFFFA00A9CB0DA9CBCBCBCBCBFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFB00BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF0F0BCBCB00B0B0F0BCBCB0F0BCB0F0BCB0F0BCBFADA9A9A9E9A9A00000000000000000BFFFFFF00000A00A00A00A0A0A0A000000000000000000000105000000000000D4AD05FE, 'Michael is a graduate of Sussex University (MA, economics, 1983) and the University of California at Los Angeles (MBA, marketing, 1986). He has also taken the courses \"Multi-Cultural Selling\" and \"Time Management for the Sales Professional.\" He is fluent in Japanese and can read and write French, Portuguese, and Spanish.', '5'); +INSERT INTO employees VALUES ('7', 'King', 'Robert', 'Sales Representative', 'Mr.', '1960-05-29 00:00:00', '1994-01-02 00:00:00', 'Edgeham Hollow\r\nWinchester Way', 'London', null, 'RG1 9SP', 'UK', '(71) 555-5598', '465', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E506963747572650001050000020000000700000050427275736800000000000000000020540000424D16540000000000007600000028000000C0000000DF0000000100040000000000A0530000CE0E0000D80E0000000000000000000000000000000080000080000000808000800000008000800080800000C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FEDECDACFEFCEADE0ECECBCE0CEFEFECFFEFCFEEEDEFEFEFCDEBCEFFEFCFEDEFCFEFECFDEFFC000C0A0C0CE0EDFE0FCE9FDFCBF9F9FCFCEFCF0FC000000EFCE0CE0CE0FCBE0F0EDECACBCAECACEF0FCE0FCCACE9E0FEEDE0E0E0EEDACEC0CEDEFCACAECE0CAEDEECFCACFCEDEFE0EDEFECFCFEDFFEFFFCFEEECEEFCE0EFEDFEDEFFEDFEFEFE900000C9E9CADEFE0FCBDFCBDBD0FCF9F9FFDEFFCAF0000C0CADCAC0E9ECACCFCECACADECEDEFCF0EECACECAEDE0ECECEDACFCFCEDEACF0FEF0EEFACEDCADEFED0ECBCADEEEFAEEDEFEEFCFEEFEFEEFEFEFEDACBCF0EFEDE0FEFEFECFEEFEFFF00C0CE0EC0EDEFACFCBDBCBDFE9FDB9E9E90EFFCAC0CA00C0EFCACCECEC0ECACE0FCEDECBCAC0E0ED0CEDEBCDE0FCF0E9EEFEE0E9E0DE0ECACEFDFCCCAFCEECFEEFCECECE9ECFCFEFCE9EEFEDEDEFDEFFFEDEDECEEFEDFEFEFEFFCFFEFDEFDEFF00000DE9ECEFEDE9EDADFDAF9F09EDF99CF9EFFFCAC0900CC0EC0E9CACE9CF0EC0F0E0ECFCFECFCEEBCACCEACECACECECFCBCFCECEECFCEDEDEEFEBCECBC0FCFCAF0F0ECEDEEFCFEFEFEDEFEFEFEFFEEFFEACEFCFCEEFFCFEFCFEEFEEFFEFFEFB0C0E0F00DEBCE9E9FDADBDCF0F99ADEB90D0FEFFDECA000ACDAC0ECDACE0EC9ECECFCFE0ECBECADCECEBCCE9ECECADEACECFACBEC9EE0FCEADEF0CEFECEFEEBEFCECEDACAEDEAFCEDECFEDACFEFEEDFEDFCE9EE0EDFEEFEDEFEFDEDFEFFEFFF00000C0CFEFCDAD9E9EDBCFBDF9CBD99C9F0FCFDEFBCC000CCACFC0EACCACCACCACAC0E0FCECCBCEADACCE9ECE9E9ECEDEFEDEFCCBECDEEBEDEFFCAC0CEFEFDECCCAC0EECEDECFCFFEFFEFEFFEDEFFFEFEAEDEECFEFEEFFFFEBEDEEFEFFCFEFCF000CAEEDEBCBC9E9CBDADBDE9A9C9CE9E09D0FEFCFE9A00CACF00E0CCADCADEADEDEEDECE0FEECFCECFE0ECE0ECECF0ECADEECFEECFAEDEDEFEFFCBCAC0CEEFEBEDEF0CBCAEFEFEEF0EDEDECFEFEFEFDEDCAEDACFEFFDEFEFCFEFFFEEFFEDEFFBC00CDFAFCBDAD9CBD0FDCBFDF90A99C9FCBCBCEFCFED000CACECCEDACE0E0CCACAC0EDAFCAC9E0E9E0DECACFCACACEDEFEE9E0F9EECFEEFEEDFFFEFCBC0C0CECEACEFECECCECEFDEFEEFEFEFEFDEFEFEEFCCECEFFCFEFEDEEDEECFFDEFFFEFEFBC0EEDCBC9C9E9D0FDAF9CBDAD9C0BD090D0D90EE9EFE900CBCBC0EC0CECE0ECECFE0ECECFECEFCECEACEDE0ECFCE0ECE9EEDEEEDEF0FCFFFAFFEDFEFEFBCAD0CCE0EDF0FACFFEEFCFCFCEDEDEFEFFEF0EEF0EFDEFEFEDEFFEFFFEFEFEFEDEFFC00CB0BC9E9E9E9F09D9EDDADBC90C0FCF0F0E0DCEDEF000CCEC0E0CE0C9CECBCACCFCBCBC0F0CACADCE9CACC9E0FCFADECFECFCEBCEEFEB00FEFEEDFCFCEDEECA9CCEEECCFECEDEFEFAEFEFEFEFFEDFEDACEFFEFFFEFFEFCEFCEFEFEFCFEFFEFFCE0FC9E9E9CDBC9E9E9FADF09A90B9090D099CAFEEDA900EF0E0CE0CACE0DECFCBEECECEECEECDECE0CECFAEECE0ECEEFACBCEFCEDFFB000FFCFFEEFEEFEE9FCEF0C0CFE0EFFEFEDEDE0FEFEFFEFE0ECEDEFEFEFEDFEDEFFEFFEFCFFEFFFCFEFF0D09E9D0F9ACBD0F9E9DE9F99C9C0DAD0BC09C0CFEF00CECFCE0C0ECACEACACEED0EDAC0F0DAE0E9EACACC0CBCECFEDEDEEFACFFEF0C0E0FEFECFFCFDEDEEEFCEEBCE0EDEEDEEFEFEFECFCFEFFFFECBCEFEFFFEFEFEFECFFEFCFFEDEEFEFEFCAF0F0DADBCF9DADBC9F0F9E9E0909A0DAD09E00E0CFEB00CFAD0E0C0CC0DEDEF0EEFCACECCECCECECCCFCACECCACBCF0EEDECFCEFFEB000EFFEDFECBEEBEFDECBEDEE9C0ECFEFDEFEDEDEEFEFEDECFECEFCFEFCFCFEDEFFEDFEFFEFFFFFCFEDAD0D0F0DAD90F0D0DBC0F09F09DA00D0090F0909CEFED000FEDEC0CACACECACECED0CACDACACAC0F0E0E0ECACACFCEEEFE9E0FEFFBC90E0F0FEFEEFFEEDEDAEEFEDEEDEFE0CE0FEEDEFEEFCFEFFEFFACEFFFEFEFFEFEFEFEFEEFFEFEFEFEFBCADAD0F0DE9DADF9E9F0DBD9FC9F09C909F0D0900CEFF0CACFEF0E0E0C0CE9ECF0F0ECACEACEDACCE0ECE0EC0CCE0E0FCBCFCEFEFFACA0E0E00FCFCFCEDFEFEDEDECE9EFEDEF0ECEFFEFCADEFEFEFFECF0FEFEFDEFEFCFEFCFEFFFEDEFCFEDECFC0D0F0DBC9E9E0D9F0DBC9E99F0F0BC0000B0C9000CEFFCFE9EF0C0C0E0CEDACECF0EDACCCACCE0EC00CC9EDEBCFCFEFCE0EFDE9E9000000A0FFEFAFEEDECFEFAFEFEDEFACFE9E0CEFEFDECEDEDEFFECEFDEFEFEFCFEFCEFEDEFEFFEFEFFEFCA9CBC9F0F9F9F9F0F0F0DBC9E0D90D09B0D0C90A900FCEFFEFECCFE0E0CE0ECFCACAC0ECA0FCAC0C0ECEBEECACCE0ECCACFFDEFFFA0A00A0000FEFCFCF0EF0ECEDEDEEFECFFECFEFCACFEEEBEFEFFEF0FEFEFDFEDEFEDEFFEFFFEFDEFCFCEFCB0C9CF0DF9EF0FCBDBD9F0D0F9F9E9A9C0D009A90C000EDEFCFCBE0C0CCACEF0E0DECCE0CCEC0C0EFE0C0CC0BC0E0CCBEFFEFEFEA00000000000FFFEEEFEFCEFE9EEFEDECBCECFEDE9C0EFFDEDEFFEFCEFCFEFEEFEFCFEFFEDFEEFFEEFEFEFCF0F9EB9DEBCF9DF9F0F0F0F0F9C9E9C9CA90A900C0900CEBCFEBEEDE0CA0CE9CE0EE0E00CCAC0E0EC0C0E0E0ECEECFFEFEDEFCFF0900000000000FCFFFDEDEEFCEEDE0FEFFEEFEFEFEFFFCCEEEFEFEFFEFEFCFEFFEDEFEFCFEFEFDFEFFCFEDE0909C9DEBDDB0FADE9FDBDBD99E9E9F0F99C900D0900000CEEFDEDECAC0CE0CEACC0CC0ECA0C0ECE0CACECEDEDEDAFE0FCFEFEF00A00A000000000FACFEFEFE9EF9ECEFCEEDEDEDACFCEEFAF0DEEDEFEDEFFEEDFCFEFFCFEFEFEDEFEFCFEDEFBCBCADADDEBCDFDDBDE9E9E9EDAD0D09D0F0B0D00A0090000DCEFECBEDAC0CFC0CACE0EC0ECEEC0C0CACBCBCE0E0EDEDEFECFCFEB00A000000000A0FCF0FFEFCFECEFE9CEDAEFEFEFFEFFDEFCECADEFFEFEFCFFEEFFFEFEFFEDFEFFEFEFEFFE009C99FDBE9DBF0FADF9FDF9F9BDF9ADADB0D0DA90D090000CEAFCADECEC0CACACC0C0E00E0C0C0EADEDECCECADECEEFEFCFFEBA0A0A0000000000C0FE900EFFFECFFEDEFAEDEDEDEDECFEEFFEF0CEEFEFFCFEFEFFFEEDEFCEFEEFFEFDEFCFE09FCBCFCBD9FFEDFFDFBEDF9EF9ED09CBC90D0F09C000000000EDCEFE9E90EEDAC0AC0ECDECC0E9EFCCACADACBCECFADEDEFEAE0000000A000000000AF0F0000FEFFECFAECFCEEFEEFEFFCFFEFFEFF0CCFEFFEDEFCFEDFEFEFFCFFFCFFEFEF0C9C09CBDBDEFE9FBDFBDFDBEDBCFDBDE9D9ADBD0F09090C00000CEBCFCECEC0C0C0CCECF0E0CADCE0CBEDECECECEDAEDEBEDAFC9A0A0A0000A00B00A90BE0A000CFEFFFCFEFCFDECF0EFEFFEDEFCFEDEACCFFEFEFFFEFEFEDEFEFEFEFEFEDEEF9A9CBDEDEDBDFFDFEDFE9FDBFDBDADB9E9CDADAD0F0CA90900000CE0EF0F0FCACACA0CA0C0E0EE0FECCAE0F0E9E0ECFECEEFCAA0C9000A0000000A00A0F09000000DFEFEFCAFEAFEEFEDEFEFEFEFEFEFD0EFEFEDEFEFEFCEFFCFEFEFEFCFEFD00D0FCBDBFBDFBCFFBFFFFFFDEBDF9FCF9FA9D0DAD0990000000000CFE0FCECAC0C0CCACCACECD0EC0FEDCFCEDECFCBC0FFCEA9C0A0A00000000A009A0AF0A000000FEFFEDEFFCFCF0FCFEFDEFFCFCFEFFEFFFCFEFEFCFEFFEEFEFCFFCFEFA90E9CBCBDEFDEFFFFFFDFBDFBCFBDE9E9F9F0DDADBD09F0009000000CE0CFCEAD0CACACACCADE9E0EDACE0CEACE0E0E0ECFECA9000BC0000000000000A090FF0C0090009EFFFECEFEFEFEEFEFEFCFEFEDFEEFFEEFFFEDFEDEFEDFEFFEDEFEFCFC09E9FDFF9FFDFEDFFFFFFFDFBFDBDBDF0F0DB09E9CBC0AD0C090000ACFEE0FCE0C0CCCCADE0CECE0ECBCFACCBCCFCECFEF0B0A0A00A900000000000000A0FEB09A00A0000AFFFECFCFCFFEDEFEFEFEFEFDEFFDEFEFFEEFEFCFEFDEFFEFEDEF0BC90F0F0FFDFBFFFFFFFFFFFFDFADFCBDF9FBCFD9E9DBD9090000000C0C9EF0E9E0CAF0FCACE0F0EDACE0CE9ECAE0CFE9EACA0900AC0A000000000000A000FEDA000090000ECFEDEFAEFECFEEDEFEDFEFEEFEFEFEFDEFDEFFFEFEFFEFEDEFE09C9EFCFDFFEBFFDFFFDFFDFFBCBFDBDBDADAD0B9AC9AD00F0E90000000E0ECECFCC0ECCACACDACCEC0CE0EC0ECADCEFE9E90000A0900A00B0A0A00A0A00000F9A000900000000EFFFEDEDEFFEFFEDEFEDEFFFFCFFFEFEFEFEFEFEFFEDEFEF090D0F9DBFFFFDFDEFFFFFFFFFDFFFDBDEDADBD9FC0D9FDADF9090090000CC0E0FCACACFCACEDCAC0E00CE0CC0ECADEEBCB0A0A9000000A09A000000000000000BE90900A00000000EEFFEFEFEFFCEFEF0EEFCFEFFEDEFEFFEFFEFDEFEFEFCFE9CBCBCFEFDF0FFFFFFFFFFFFBFFBF9FEB9BDBC9E99F9E90F09AD0D000000CACFCADEFCAC0DE0CACEC0ECE0EF0E9ECECFDA000000AD00E000A0A0A000A0E0F0B00F0A00A090000000000CFEDFEFCFFFCFEFDEFEFFEFFEFFFCFFEFFEFFEFFFEFEDA0D0F9FDFAFFFFFFFFDFFFFFDFFDFF9FDEDADBF9E90F9ED9FC90B0B000000C0CFCAC0FCACACFEC00EC0E0D0CECECFFBE0F0A000E0AF009A000000A00000A00000F90009000000000000ACFEEDEFEFEFEDEEFCFFEDFEFFEEFFEFFEFEFFCFEFED00DADCFCBFDFFDFFFFFFFFFDFFFFFFDEF9F9F9C9E9E9D09AD0BDE9C09000000EE0EDEFCADECE0C0EC0AC0ECEC0FEB00C0FA0000ADFC9EBE0A0B0A000000000A0A000090000000000000000EFFFEFFEDFEFEF0FEFFFEFFEFFFEFFEDFFFEFEFDE90DADBFFFFFFFFFFFDFFFFFFFFFFF9FBF9F9E9E9E999DA9ED9BC09909000000EC0CFCACADE0C0C0EC0ECCF0E0EFE90000A00000AC0A0A00009A0A000A0000000009F000000000000000000000EFFFEFEEFFEDEEFEFEFEFFEDEFEFFEEFEFEDEE00E9DEDEBDFFFFFFFFFFFFFFFFFFDFFDFDF0F9F9F9ECF09C9BCDBDBCBC900000C0FE0ECFCE0CE0E0CAC0DACECFE900000000000000A000E0F0A0000A0000000000A0AB000000000000000000000ACFFFFFCEFEDECFFFFFEFFEFFFEFFFEDFFEDF9C9E9FBDFFFDFFFDFFFFFFFFFFBFFBEFBFFDBDAD09990F0BC0B0DAD909A900000C0ECBCAFCAC0CCE0CEECECFFCB0000000000000000000000A0BA0000AC000000000D00000000000000000000000ACFEFEFFFFEFEFEFEFFFEFFEFDEFEFEFEFE00DADFCFFFFFFFFFFFFFFFFFFFFFFDFDFFCBFEF9FF9EDB9CD9F0F90BCBC9000000EC9CECFC0C0E0E0ED0CEFB00000000A0A000000000000A0E90000A0AC0A00000000A0000000000000000000000000EFFFFEFEDEFFFEFFFEFFEFFEFFFFFEDA90DADEFFFFFFFFFFFFFFFFFFFFFDFFFFBFDBFDF9F99E900DA9A0D90FD9C9000000CC0EEDACACAC0F0CCAEFB000000000C0000000000000000000A00A0009A0000A00A09A000000000000000000000000000EFFFFFEFEFFFEFFEFFEFFEFEFEFE90DADFDBFDFFDFFFFFFFFFFFFFFFFFF9FDFFF9F9EDEF9F9F09C9DACF9A0BCB900000ADC0ECF0CCACCCAFCF0000000000A0A000A000000000A00A00A090ACA0000000000E9000000000000C0B0A00000000000EFFEFFFFFEFFFEFEFDEFFEFFDEF00D0FAFDFFFFFFFFFFFFFFFFFFFFFFFFFFF9FFFF9F9F0F09F0BC99B0D9C99C09000C0E0DADECACCACECFA90000000000C090A0000000000000000900AC90CBCA000A900BE000000000E009A0000000000000000EFFEFEFFFEFFFFFEFFEFEFEF00DAFDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFF09FF9F9F99E99C9E9C9ADBCA99000000C0ECEBC0CACFAF00000000000000AC000000A00000000A0A00000A000090A90000F09000A0A0E9CB00000000000000000C9EFFFFFEFFFFEFEFFEFFFEF09E9EDFFFFFFFFFFFFFFFFFFFFFFFFFFFF9FDF9FFF0F0FC9E99E9A9C9AD909D9E00000E0EC0FC0DEEDAD0000000000000A000A0E0000000000000000A00000A00A0000000FCA00000000A00A0000000000000000A0000EFFFEFEFFFFEFFEFEDF000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFF9F9FBDB9F9F090D0BC9BCBDA099000C0C0CEACEE9E90000000000000000A0AC000A000000000000A00A0A0000000000000AF0000000A00A000000000000000000000000CFFFFFFEFEFEFFFFEA9CBCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDAFF9E9DADA909F9E9C9BC9909DBCB0000C0CBCDE9E9000000000000000000000A0A000000A000A000000000A0E0000900000FE9A000000000000000000A00000000C0A0000FEFEFEFFFFFEFEFF900DFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFFBFF9FE9FB99F9F09090B0C9ACBCB0909000ACACEA0A0000000000000000000A0AA00000A0A000A0000000A00AC090A00000000FA00000A0A0A00000000A000A0000A0A0C0000CFFFFFFFEFEFFFFC0CFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9FDF9F99F9C9E0D09ADAD0D9AD9D90DAD0000C0CCAD0000000000000000000000000000A000000000000000000000A0900000000FF00000000000A0A0000000000000000A000A00CFFEFEFFFFFEFCB9ADFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFBFBDB0F90BC990BC9090B00900BCBD9B000C0E0FCA000A000000A0000000000A0A0A00000A0A0A00A000000000A00A00A000000FEB0000000000000000000A00000000C0A0C0000CFFFFEFEFFFEF00CFFFFFFFFFFFFDFFFFFFFFFFFFFFFFDFFDFDAF9F9E9DBCBC9BCBC9DBC9BC090AD09000C0CE0E000009A00000A0A000000000000000000000000000A000000000000000000FBC00000000000A0000000000A00000A00CA0009EFEFFFFFFEFFE90FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFBF99EDADBE99DB9C9DBDAD9A090C9D0F000C00E0DA9A00FAC9A0000000A000000A00A000A000A0A00000000000000000000A000FEB0000000000000000A000000000000C0B00E00CFFFFFEFEFFE90FFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFBDBC9EFDBDF9DBDADE9FBC9F9FC99E900A990C0ACCFA000CFAC9AC90A00A00000000000000000000000A00000000000000000A0C0AF000000000000000A000000A00000000AC0E00A00EFFEFFFFEFCE9CFFFFFFFFFFFFFFFFDFFFFFFFFFFDBDBDF9FF9FADF0FF0F9B9F0DFE9E99F090BC9C0000CAC0CA00A0CBE90A0CA000000000000A00000000000000A00000000000000000A00FFB000000000000000000A00000000000A00E0CA09CFFFEFFFFF90FFFFFFFFFFFFFFFFFBFFFFFFFF9FFFF0BCF0FFDFBFF9FFFCFDBFBDBDFF9F9E9090B090C0CEB00A00A000A009ACB0A0A0000000000A0000000000000A00A0000A00000000A0B00000000000000000A000C0A000000000CA9CA9CA0EFFFFEFEB0EFFFFFFFFFFFFFFFDFFFFFDFBDFFF90FFDBFFFDBFDFDFF9FBFBCDFFFFBCF9F9DBC90D0C00F9000000000009A000000000000A00000000000000000000000000000A00000A00F0000000000000000000A0A0000000A000A0EA0CADADFFEFFFFC9CFFFFFFFFFFFFFFFFFFFDFFFFFAF0FFFDBFFDBFFFFBFBDFFDFDFBE9FDFF9EBDA90BCB0B0EC0000000000000000A000B000A00000000000000000000000A00A00A0000A00000AD000000A00000000000000A000000C0A00C00DA0000CFFFFEFB0FFFFFFFFFFFFFFFFFFFFFFBFF9FDFBDBFFDFFFFDFFDFFFFFFFBFDFFBF9FFDDB9F9D09C9CCB00000A0000E0ACB000A000E9000A0000000A000000A000A00E90A000000000000FADA00A000A00000000000000A0A0000DA00ACACB0000CFEFFFE9CFFFFFFFFFFFFFFFFBFFFFFDBFFBDFFFFFFFFFFFFFFFDFFFFFDFBDFDFF9FBFDE9A9F09A9A9000000000A0E9ACB0000A00A000000000A0000A00000000000E00000A000A0000FFA00000000000000000000A9C0000A0A00A000000A000FFFFED0EFFFFFFFFFFFFFFFFFDFBFBFFDBDFFDFFFFFFFFFFFFFFFFDFBFFFFBFF9E9F0F9FDB0DAD0D000A00000A0CBCE90A00A00A00A00A00A00000000000CA000CA00A0A0000000000FA00000A0000000000000A0C00AC0A00000000A0A00000EFFEFB0DFFFFFFFFFFFFFFFFFFFDFDFFFFFFBFFFFFFFFFFFFFFFFFBFDFFDFDF9FFFDBDBF9ADB99CB00000A00000ACA9A00000000000CA00A00000A00000A00000A000000000A000000FF90A00000000000000000A0A00A00C000000000000009CFFFFC00FFFFFFFFFFFFFFFFFFFFFFF9FFFFFFFFFFFFFFFFFFFFFFFFFDFBFBFFDBDBDBC9FDB0DA90D00A000000000AC0A00A00A000A00F0000A000000A00000A0000A0000000000000FCA000000000000A000000000A00A0A0A000000000A000A0DEFFBCFFFFFFFFFFFFFFFFFBDBFBFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFDFDBFDBCF9FF0F9F0DB09A9000000A0000A000000000A00E00A0A000A00A000A00C0000000000000000000AB0000A000000000000A00000000000C000000000000A000EFFED0FFFFFFFFFFFFFFFFDFFFDFFFFFFFFFFFFFFFFFFFFFFFFFDFFFDFFFBFDBFF9F99F9F99BC9F000A0A0A00A0000A00000AC00A00A0000E000A000000A000A0000000000000000F00A00000000A0E0A00000000000A0A0A0000000CB00000CDEFF0EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF9FDBE9DBDADBCBCBCB909DA000000E000A0000A0ACA9A0A000A0A0A0A000A00000A0000000000000000000E0CA0000000C0AC9A000000000000000000A90A0C0F009A0FEFE9EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF9FDFF9F9DBF0F9F9BDB99DADA09000A0A00A0000000000EA000A0000000000A00000A0000000A00000A000000B9A0CB00000A0E9A000A0A00000000A000A000090B000A00ACFFFCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFBF9F9FBD9F9FBCFDADAF099DAD0A00000ACB0A0A00A0000A0000A0A0A00A000000000A00A000000000000000E000AC0A000000A000A0000000000A0000000000A00A0000CBCFEBCFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFDFFFBDF9F9F0DAF9F9CB9BDBD9BDA990B0000A000000000000A0A0A0A0000000A000A00000000000000E0A00000000B00AC0B00000A000A000000000000000A00900A000000000ACAFFCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF9FDF9E9F99F999C9B9FCBF9ADA9C9E900A000A0A0A00A00000000000A0A0A00000000A000000000000A000000000E0000AC0B0A000A00C0E0A000000000000000000000000A00ADCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFF9FBDBD9E99F0F9FDCB9D0BDBD9B09D09C00000000A0000A00A0A0A000000A00000A00A000000000A000A00000009A0000AC000000000A900000000000A0000000000A00000000A0EFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F9FBD9F09D0B0B9DEBDDADAD0F0B0A0B0A000000A0A000000000A00A000000000000000000A0000A000000000E0000000A000000A00CACA0000000C00000A000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFDBF9F999F9DB99D9D0B9DABDBDB999C9D000000A000000000000A0000000000000A0A000000000000000A000000090000A0000A0000000A009000000E0B00000CA00000A0000000A0EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDBD9D90DF0B909DA90BD0F9D9E9F09E9F0A00000000A0A0000000000000000000000C0A0000000000A0A000000000E0A0000A000000A0AC0F0ECB0A0000EB000A0C00A0000000000009CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFBDBF9FDB9D9F9F999D09F09EB9F9F090099000000000000000000000000000000000A90000000A0000000A00A0000B0000A00A000A00A0A000ACE9000A0C0E9C09A0C0A0A0A90A00000AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFDFFDFF9FDBDF9D9FCB99C9F99DADB9F9F90F0A0A00A00000A00A000000000000000000E0A000000000000000000000CA00000000A00000000EADA9E00000A000A0AC0B0C00C00000000ACFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFDBD9F9FDB9F0B999CB909CB9DBCF9090F090000000A0A000000000A0000000000A0000000A0000A00A0A0A000000B0000000000000A0A0A000E00A000000A00D00AC00B0A0A000A9E0DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFFFDB9BDBF9F9B0D99D090990BDB9EBDF90F9F090A0A00A00000A0A000000000000000000E0ADA0000A0000000000A0000E0000000000000000A0A0A0A00A0000000A0AD00E0C00900A0000AEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFBFDBFDFD9D9FFFDFBE9B90DB0D09C99CB9FF9099E90000000A0A00000A00000A00000000000000000000000000E0A0000009A0000A0000000000000A000A0000000000000A09A0F00A000A009CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFDFFDB99FFFFFFFBDFFDEFB0D90909E9BDADBF9E99E90A0A000000A0A0000000000000000A00ACA0000000A000A00D0A00A0E9000A00000A00000A0A00A000A0A00000000A0DAC000E00E900A0AFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F9FDFFDFFFBDBDFFFFFFFFFFFFFBDF9FB0009090DBDBF9E9F090000000A00A00000000000A00000000000000A00A00000A0CA0A00000B0000000000C90A000000A0A0A000000000A000A00B0E90E00CAD0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBD9DEFFFFFFFFFFF9FFF9EB9E9900009DBC9F9F990DADA0000000A000A00000A00000000A00ACA0A000000000000A0E00CA00E00A0000A0A0A000000A000000A0A0A0000000B0B0000CB09EB0ACBFFFFFFFFFFFFFFFFFFFFFFFFFFBF9F9FBDF9DAFBFFFBFFFBDFFFBDB9B9C99CB00000099E9E9F0F90900000A0000A000000000000000000000C0000000A0A00000CADA90A0DB00000000CADA0A0000A0A0A00000000A000A0A0A000ACAC9CB0ACFFFFFFFFFFFFFFFFFFFFFFFFFFFFBEFDFFBF9DFDBFFFDBFFBFB990D0D0900909000000B9F9FDB0F9F0A0A000A000A0000A00A00ACA000000A0CAC0A0000000000ACACA000EACA00000000000000A0900000A0A0A0A090A00000000000A0A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFDB9FF9009EFBDFF9BD90D9CBD9B9B909F0909090090D0F9B9D090900000000A000A0000000000000A0A000A00B0000000000A000AC9A0F00000A0000A0A000000A00A0A000A00000A00000000A00B09000F0FFFFFFFFFFFFFFFFFFFFFFFFFFF9BDF909090F99FF9F9DBDBDBDB9C9D0BD090D09A99000B90FDA9ADA90A00A0000A000000A000A0A0A0C00000CAC09A00A0000000A00A00EBE0E09A0A0000A000000000000A0000A0A0000A000000000A0000FFFFFFFFFFFFFFFFFFFFFFFFFFFBFDB0F900009F9F9F9FBDBDBDBDFBF9FDB9DB9BD9D0D99CBD9BD9C9CA000000A000A000A000A00C0000A0000A000E0CA000A0CA00000000FCB00E009000000000A00A00E009E9A0000A9A090A0000B000B00ACFFFFFFFFFFFFFFFFFFFFFFFFFFFB9DB99BD9DBDF9FDF9FFFFFF9F9DBF99E9E9C9ADA9A0909AD9B0B9900A0000000000000000000A0A000A0A000A00EADA0C0A00F0000000FBCEB0F0A0A00000A000900F0BE00A00A0B0000A000B0000900000FFFFFFFFFFFFFFFFFFFFFFFFFFFF9DB9CBDBFFFFFFFFFFFFFDBDF0FBD0FBDB9FB9DB9D9990F99E9D9E9B0000A000000000000000A0000A000000000A0CA0F0AC0E00A00000FCB00C0A9C9000009000A0F0AC00B000900E0A000B000A00A00A0FEFFFFFFFFFFFFFFFFFFFFFFFFFFB9A9CBDFFFFFFFFFFFFF9FBFFBDBC9F9C99E9DCB0DBCBCB90F9F9A9C000A00000000000000000000A0000000000000A9E0E09A0A0000000AB0DA9AD0ACA00A00A90000E90B0000A0A09E900000A00900B0900FFFFFFFFFFFFFFFFFFFFFFFFFFFF9D9BDFFFFFFFFFFFFFFFFDF9DBD9B099E99A9B9DA9909C990F0D9CB900000A0000000A0000000000A0A00A000000000000A0C90A000000DEA0000A90B00000000A0000A000A00000E00EB0A000F0A000ACBCEFFFFFFFFFFFFFFFFFFFFFFFFFBDB0BD0BDFFFFFFFFFFFFFBFBFBDAD99A0909D09CBDADB9BCBD9B0B90DA000000A090000000000A0000000000A0A00A00A09CA0E090A0000A90000000ACADA00A0AC0B00000000000A0AD00009AE0E90A00000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF990FFFFFFFFFFFFFFFFDFDBDBDB9C990F009E990990D0990FDBD0F0900000000A00CADA000000000000000C000000000A00F0A0000000F000A000A909A00000DAF0000000000A09C0A00A0AC9EBCA00A0AFEFFFFFFFFFFFFFFFFFFFFFFFFBDF990FF9FFFFFFFFFFFFBDBFBDBDBD0B909009909E9F0F9B90F9090F99000A00A0A00E9A00000AC0000A0A00A00A000000AC0E00000000009A00900900A0000000AC0A09A0000000A0B00A00000E0EA900000CFFFFFFFFFFFFFFFFFFFFFFFFFFFBFF990F9FFFDFFFDFBDFBD9DBDBFBD9E9099E090909909CBD9F9F990F090000000000AC9A0A000ADA0900000A0009000000B0A00A0000E0E9A00B000090A900000AC9A000A00000000E009A00A0EDEEB000A0FFFFFFFFFFFFFFFFFFFFFFFFFFFDBDF999F9FFBFFBFFFBD9B9BDFFDBF9DB9C990DA99E9F990F90F0F9D0B0F0A00A0A000AA0000A0000ACA0A00CACA00900A00000000B0E9EB000000B00000CA000090A00A000A0A0A0A90E00000CA0E9E9A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF9F09FBDFDFFF9FDBFFDFFBDFF9FBDA9AD9BD9C9909E99EDBD9E9BDD0000A0000A0000A0A00A0A0090000A09000A0000000A000C0CACA09A0F00000ADA90000A00CF0E9A00000900E9A0A00A0E9ECA0E9FFFFFFFFFFFFFFFFFFFFFFFFFFFFBDFDF9F90DFFBFDBFFFFFFFFFFFF9FBDBD9D9BCB09A09E99F9B9DB9F0D9A9A00000000A0A0000A00000E0A0A0CA0A900C0EABC90A0A0ACFF0000090A000A000000000A0F0E00A0A0A0B0AC9090000A0BCB0CAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFBF9F9A9FDBFDFFFFFFFFFFFFFFDFF9E9AD9BF99DB9DF0FDFADE9DABD0000000A0A00000A00000009000C0BC9C000B09C0A00000EDAE9A000ACB0F0C90A900000BCEFF0F000000A009A0A0A000000ADB9DBFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFF9F9F99AFDBFFFFFFFFFFFFFFFBDFBDBDBCD9E90DB9F9B9D9BDB9DCBDB000A0000A000000A0000A000A000A0ACB00A0BC9A00000ACFE9000DACF09A0AC0090A9CAF0FA00A00B00A0A000000A000FDBDFFDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F9F9DBDFFFFFFFFFFFFFFFFFBDBDADBBF99FBCF9FDEBFDBDE9BDA00A0000A0000A0A000A00000A09A00C090E90000A0000A0CB0B00A0ACB00A000900AC9CAD0F09CB0CA00A90000A0B090FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9FFBDBDBFBDFFFFFFFFFFFFFFBFDF9F9DBD90F0D9BCB9BDDB0F9BDF0B00000A000A090000000A0A900000A0BEE90F0009000000A0ECA0D0000A000000A900A0B0A0E0E0EB0E900A000000CADFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFF9FBDFFFFFFFFFFFFFFFFDFBDBC9E9E9F9FBFDBDFDBBDF9FDA9F00000000A000E9E9A00000000A00000C0FFE9A000000000000BDA0A0A000A00A0000900009E9ADADE9A0AC90A09A00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFDFBDFF9FFFFFFFFFFFFFFFF9F9B99E9F9F9FDB9FDE9FF0FDADA90000000A000000000A00A00900000AC0EBE9A00000000000CA0000000A000D0B0A0A90000000A0A0000B0AD0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFDFBFFFFFFFFFFFFFFFF9FBDBC9F9F0F9E9BDF0F9FDBF9BDB0000000A000A0A0A0A000000A00A00009A9C9000900000A00AB000A00AC090A0B0C9C900A0A0A000000CACAD0A0CFFFFFFFFFFDBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFDFFFFFFFFFFFFFFBDFBDAD9F0F9BDBDBDF9F9F9BC9FC9AD0A0000000A00000000000000000000A0000A090A000A000ACE9000000A0A090009A0E000900000A00A0F0FAF0F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFBFFFFFFFFFFFFFFFFFBDBDB09F9FDBDBDF0F9F9FDBF99F9AD0A0A00A00A00000900A00900900A9000B09A000A00000000FAB0A0A0E0CA0B0A0090A000E90A000000EEFCB00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFF9FF9BDF9F0BDADFB9F9F9EBD9CFA909A9090A00A000A00A0A000A00A0A00E9E9CAC9A0000000A0A0BD0000009EB000090B0090A000A0000A0ACBCB0CBFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFBFFFDFFFFFFFFFFFFFFFFFFF9FDA9E9F9FDB9CF9F9F9DBFB99F909E0E000A00A000000C0B09009009E000A09A000A0000A0000F0A9A0A0E0009000000A0A00A0000A000CBEB0E9EFF9FFFFFB9DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFFFFF9F0B9F9F9F9B9FB9BD0F9FAD9CF09CB0B000A00A0A0000A0B00ACBC0A0000A00A000000A00000A0A90000000A90090000000000000A0000A000000ADFFFFFFFF9FBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFF9FFFFDBFFFFFFFFFFFF9FF9F9D09E9E9C90D9CB9E9D9E9B9DA90000A00E00000A9090000909A90A0A000000A00000000A00AFE9A9A0A000A00009000000000000A000A0A0000FFFFF9FFBD9DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF9FFDBFF9FFBFFDFFFFFFFFFFFFF9F9A9F99F9B9F90B9099A999E9E99F9A000A00ADA090A0A0B0A0E0E000000000000000000000A00B909000000A0DA9A000000000000000000000A09FFFB9FDFDBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9FF9FFF9FFFFFFFFFFFFFFFFFFBC9D0F990909090D9BC9DADBD9BC90000009E0A0A0AD000C0900909A000000000000000A00000AF0A00000A00DAC0D0000000000000A0A000A000CFF9D9FBFBF9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBDFB9F9BDBF9FFFFBFFFFFFFFFFFBDBD9B0B90C90D0BC90BC99AD9D0BC9A9A0CA0E000000DAB0A9ACADACA00A0000000000000000A0A0A909A00000A0A9A0B000A000000000000A00000FFF9BDDFFDFFFFFFF9FFFFFFFFFFFFFFFFFFFFFFFFFFFFBDBCBDBC9F9F9FDFFFFFFFFFFFFBDB0D9D0B909BD99BD99AD90B0BDB0D00B0CA00A000A00CBCADADA9000000000000A0000A0000000DA0000000000000000A0000A000000000000A00CFFF9AF9FFFFFFBFFF0FFFFFFFFFFFFFFFFFFFFFFFBDB9DBDB909B90F9FBFFBDBFFFFFFFFDBDB009009F099E9CBD09A99C909DB0F00A0CB000A00A0000CACACA0A00000000000000000A000A0A90090000000A00A00000A000000A0A0000A000FFFB9D9F9BDFFFBDB09DFFFFFFFFFFFFFFFFFFFFFFFFFFBF9F9F9C9B909C9FDFFFFFFFFFBFF9099A99099F099B90BD9CB09F090D0F0CFACA0000000A0A0A0A00000A0000000A0000000000000F00A000000000000000A00000000000CA9A00CFFFF9D9B9DFFBDB9E90FEFFFFFFFFFFFFFFFFFFBFFF9FF9F9FDB9F9BD0999B9FBFDFFFFFFDF909F0C9ED9F0F9E9CBD90B0DB09E90B0A0A000A00000000000000A0000000000A0000000000000A0F090A0000000A0A0A000A000000A0A000C9CBFFFFBB9CB9F9FFDF9B09FFFFFFFFFFFFFFFFFFFFF9FFBFFFFFBFF9F99B9F09CBDBFFFFFFFFBF90099990E990909900090900D09E9C00000A000000A00A00A00000A0A0000A00000A0A0A00A000B0A000000000000000A0000000A0000A0A0A0CF9FFFDB990F09FBF0900DFFFFFFFFFFFFFFFFFFFFFFFFFFFFDF9E9CBC9099DBDBDFFFFFFF9F9F9000A990000000090000090B00909A0A00000A00000000000A000000A0000000A0000000000A0E900000000A0A0A0A000A00A0000A00000000FBFFFFF9F9999F9F9909CFFFFFFFFFFFFFFFFFFF9FFFFFDFFFFF9F9F9B9F9A99E9F9FFFFFFFFA90090D00000000000000C90909F9000000000000A0A00000000000000000000A00000A0A0A0000B000A000000000000A0A00A0000000A00A0DFBDDFFFFFF990FFF9CA90ADFFFFFFFFFFFFFFFBF9FFFF9FFBDB9909090D0909CB9F9FFFFFFFF9D9090000000900000C090B00F0D0000000A000A0A000000000A00A0000A00A000000A0000000A00A0000000000000A0A000A000A0A0000000A0EDBFFFFFFFFB9090B9900DBFFFFFFFFFFFFFBF9FFB999B0090000000009009090D0FFFFFFFF9FB090090900000000909E909090B9B0000000A00000A0A000000E90E0A00000000A000A0A0A00000DA0000000000A0000A0E0F00000000000000FFDFFFFFFBF9E990000900DFFFFFFFFFFFFFDFF9FDBE9DBD0900000000090B090B99FDFFFFFF9F9E900009E909ADBCB9090090D0C090000000A0A000000000000A000CA0000000000000000A0000A00000000000000A000000A0A00000000000E9F9FFFFB090900909000D0FFFFFFFFFFFFFBFFFFBD9FBDBFBD0900B00BC909099CFBFFFFFFFF99909090009CBC90900909BCB09B900000000000A0A00000A0A0C0A0A00A0A0000A00A0A0000A0000000000000000000A0A0A0000000000000ADF9FDBFB0D09009000009AFFFFFFFFFFFFFFFF9F9FFB9CFFDFFFB9D0D9090909E9FBDFBFFFDB0F0F9A90090009090909CAC00909C00000000A00A0000000000C00A0000000000A00000000A0000AF00000000000000000000000000000000000FBDFFFD99000900000000CDFFFFFFFFFFFFFFFFFFFF9F999F99FDFB9A909090F9DBDBFDF9FBFDB90D90090909009ACB0999990DA0900000000A000A0000A0000A000000A0000000000A0A00A0A00A000000000000000000A00000000000000000FB9DBF099900009000009AFFFFFFFFFFFFFFFFFF9FFBF9A9F0B09C990090F99BF9E9FBFF9F99FF9ADB90009090990DBCBCADB0900900000000A0000A00000A00A0A0A000A0A000A0000000000A0F00000000000000000000000000000000000F9DBF999E009A90000909ADFFFFFFFFFFFFFFFFFFFF9FFFDF9F9F9B09DBCB9AD09F9F9F9FF0FF09F990DA90000000909909900900000000000000A000000A0000C000000000000000A0A0A000000000000000000000A00000000000000000000E9BD9C9E99F9900000000CDFFFFFFFFFFFFFFFFDFFFFFDBFBF9F9FDBDA9990D09F0B0F9FF9FF9FF9F0F990900000000000000900009000000000000A00A000ACA0A0A00A000000000000000A00A0A00000000000000000000000000000000000DF9E9BDBDF9E9900000009AFFFFFFFFFFFFFFFFBFBDFFFFDFDFBDA909000090F90D9DBC9FFF9FF9E9F9F0DAD0000000000000000CB0000000000000000000000000000000A0A0A00A00A0A00A0CAB00000A0000000000000000000000A0000000E9990DFBF990009000000D9FFFFFFFFFFFFFFFFDFADBDFBB090090009090DA9E90F0FBF9FDFBDF9FDADB09099A90000000000090990000000000000000A0A0A0A0A000000000000000000000000CA00000000000000000000000000000000000FBDEFFBD90090000000000FFFFFFFFFFFFFFFFFF9DBDA9D090090090000009D9FF9FDFDFFBFDFBFFBDBFDBDAD09C900009000C09C0000000000000000A00000000000A0000A0A000A0A00A0A0A0A0000000000000000A00000000000000000000999990909000000000090FCFFFFFFFFFFFFFFFFFB909009E09C0F0BC9E9FFFFF9FFFFBFDFDBFDFBDBD0BF0F9FDB0D0F9E0909B0A900000000000000000000000B00000A0A0000000000A0000009E00A000000000A000000000000000000000000000090000000000000009FFFFFFFFFFFFFFFFFFFFDF9F99DBBD9FDBDBDF9F9FFDFFFDBFBFFBFDFFFFFFDBDF0BC9A9009D0F00C90000000000000000000A00A000A000000A0A0A000A000A0A00A90000A0A000A000000000000000A00000000000000000000000000000009FFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFBFF9FFFFFFDFFBFDF9F9FDADF9BD99F90B009090900000000000000000000000A000A9A00000000A00A0000000EA0A0000000A0000A0A000000000000009000000000000000000090000000DBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFDFDBFFDFFBFFFFFBDB9C9A9E90C9090000000000000000000000000A00000A0000A0A0A0000000A0A000B0000A0000A000A000000000000A000000000000000000000000000000909FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFDFF9FDBDBD09BD0900B090009000000000000000000000000A0A0000A00000000000A00000A0E00A00A0A000000000000000A0000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFF9FFDFFFFFFFFBDB09F09090909000B000900000000000000000000A0009A0A000A0A0A0000000A000009A00000000A0A00A0A00000000B00000000900000000000000000000000009CBDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFBFF9FFF9DB09909A0C90900090000000000000000000000000A00000A00000000A00000000000E000A00A0A00000000000000A00000000000000000000000000000000000909FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFBFFF9FFDFDFFFF99B0909E909DB9000900900000000000000000000000A00A0A000A0A0A00000A00000000B00000000000A000000A0A0000000000000009000000000000000000000000BCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFBFFDFB9F0D9F990DA900090C0900900000000000000000000000000000A000000A0000000000000A0000A0A0A000A0A000009A0B000000000000000000000000000000000090D9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFDFFFBF9D099B09A909D099009A900000000000000000000000000A00A0A00A00A0000A00000A00A0F000A0000000000000ACA000000000000000000000000000000000000090C90AD9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFBFFDFFBB900090D09A99E90009009000000000000000000000000000000A00A000A00000A00000000A000000000A0000000090A0A00000000D000900000000000000000000009A9DBEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDBFFBFDFFBF9D90DB9DB90BC9A90090909000000000000000000000000A0A00A000A000A0000A0000000E0F0000A0A0A00000A000A0A0900000009000900000000900000000000900909DA9DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFDFFFBFDF9A0DB9CB900D9909090000000000000000000000000000000000000A00A0000A000000A0A90AB00000000000A000A00000A09009000090000009000000000000000009E9E9DEBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9FDFFB99DBC9BDA9990A90000909000000000000000000000000000A00A0A0A0000000000A000000ACA0A000000000000000A0A00A00000000000909000000000000000000C0909A99DADFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBDBF00BDBF09900F99090900009000000000000000000000000A000000C000A00A00A0000000A00B0000A0A0A00A00A00000000000000000090000000000000000000900900F0D9EFDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFF9FFFFFF99D9F09F9CB909AD0909090000000000000000000000000000A0000A0AE9000000CA00A00000A000000000000000000B0A0A00009000000000000000009000000000DAD9090FBDBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFBDBF99E9E99F9A990F09090000000000000000000000000000000A00000E0CF000A09E0B00000A00AF0000000000000000A000900090000000000000900000000090000000900B0F0DEDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFF9F099BDA9C90909009A09090000000000000000000000000090A00A00BE0FA0C0E0E09A00000000A00000000000A0A00A00A00A00000000090090000000000000000000B09C90F9FBDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFBDFF9B0D0BDB9BDA9099090000000000000000000000000000000C0F000000E0DA9ACBCA00A000000F0000A00A00000000A00A00A00900000090000000000000000900000D09A90D0FDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFBDF9C9F909C909C9AC909090000000000000000000000000000ACA0A0A0F0EA000A0A9A000A0A00A00000000000A00A000A09A09000900000009000900000000000000000C000FBCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDBFFDBDFB0B9ADBDB9B909090000000000000000000000000000000CACBE090C00A9000A0000000A0000A900A000000000000A0000ACA00000090009000000000000000000090090909C9F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFBD90D909090DA90900909000000000000000000000000000A9E0FCE0B0ACA0A00000A0A0000A00EA000A0A0A000A0000000090A90000090C00000000000000000090000000CB0DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFDBDFBF9ADBCB9909CB09000000000000000000000000000000000A0A9AECB000C00A000000A000000B0000000000000000000A0A000000000090900000000000000000000000900DAFDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFBFBDF9F90999CA9099090900000000000000000000000000000A090CEE9A00A0A0A000A0A090A090A000A0A0000000000000000000000000000000000000900000000000009000DAFDAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDBFDFDF0F90DBC909DA90000000900000000000000000000000000C0ACAA9A0A00AC00000000C0A90A00E000000A000A000000000000A00000000000000900000000009009090000009DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFBF9FBDB909A900900900000000000000000000000000000CA0A000000000A00A9A09A00A9E9A00A0B00000000000000000000A0000000000000900000000000000000000009090CADFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFBDBDFBFDBDF0F909B00900090000000000000000000000000000CE9A00BCA0A00A0C0CA00000A0E9E900CA0000000A0000000A00000000000000090000000000000000009000900000BDAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFDFFFFBD9BDB09909C090009000000090000000000000000000009A0AC0A000000A00A0ACACA900EDA9A0AA000A00E090A0000000A000A00000000000000000000000900000090000090D0FDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9FBDFAF0F9F0B0090090000000000000000000000000000000A0C09A0A0A90A00A0AD0B000ACB0A0090B0000000AA000A000000000000000000009000000000000000000000090000ADFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBDFFF9FFFDB9D99909D90909009000000000000900000000000000000CA0E000000A00A00000AC9A090E9C9A0ACA0000A000E9000000000000A0090000000900000000000000900000000900909EDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9FFBDBFFFBFF9F090B00000000000090090000009000000000000900B0A90A000A90A0A000AC0A000A00090B0000000AC0A000000000A00000A0000090C090909000000000000000000090DEBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9FF9E9F09A99AD09009000090090000000000000000000000900E0C00A00E0CA000000A00B00E0E9A0A000A0000AC0A00A000A00900A000090000000BC90C000909000000000090A90ADBDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFBDBDFF9F9F9DBD9090909000900000000000000000000000000000AC90A9AC0B00A000A00A09AC0ADADA0000E000A0000A9A000A900A0A900000000000090900909000000000000000909C90DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFDFFFFBDBF9F9A909CB0900009000000000900900000000000000009C9A0E0000ACAE09A00009CA00ACACA0E9A0B00000A00C00A0C0A00000A0A0000900000000000000000000000000000C0090BC9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF9FBDBDBE9F9F9B090090900000000090000000900000000000000000009A000009E00E09A00CAC0E0BCB0000E0A0A00CA0A000A000A0A0000000000000C09000000900000000000090090B0C9FFFDBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDBCBD99090909009000009090009C0900000000000000000090B0A0A000B0E0E0B000A0CA90B0A9CA00ACBA00C000A00000000A0000000000000000090CA90000009000000000000000C0B9E9FFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFF9FDB0BDB909A9090090900090000000000B009090000000000000000000000A0000B0000FAD0B0CAC00CA0A0CA09E0ADA000A9A0A00000000A00A90000900009000000000000000000000009090C9F9FFDFFFFFFFFFFFFFFFFFFFFFFFFFFF9FFFBF9F9090909000090000900909000909000DA9CB0000000000009C900A0A0C0A0E00B0E0CA00E00ADA0000A90AA900A00AC000000A000A0000000909000000090909000000000000000090000090DBDBFFFFFFFFFFFFFFFFFFFFFFFFFDBFFBDBD9F9F90B00090900090000000009000090009009009000000000000A00C0A9AC00E0000FADAE0ED0ADA9A90A00E0A000A00A0A00A00B00000000CA00000000000000090000000000000000000900BCBDF9FBFDFFFFFFFFFFFFFFBFBDFBFDADBCFA9909D09900000900000090909000000000000009000000000090B00E0FCACB0F0F0BE00E09A0AECAAC0CACA0B000A00000000000E00000000A099E90090000000000000000000000000D0090A9C9BCBFFFFFFFFFFFFFFFFFFFDFFFBFDBF9F999DAD9A900090000000909000000000900900900009000000090E90CE0FA0A90E0E0E00CE90E00EDADC0EA0900E0000000A00000A000A00000090C09E9000000090C900900000000000000900C90BC9F0D9F9F9FBFFFFBFFBDFBF9F9F9BD9F0BCB09B090090000000000000900000000000000000009000090090A0A9EEDEDEA9E0F0E9A0E00AC0ACAAE90E0A09A0000A000000000A000000000A9EC90F00090000000000000000000000000000090099AD0FBFDF9F0FDB9FB0DBF9E9F9B099990900909009000000000090000000090090900000000900000009C00E0AEBA9CA9E0F0E0B0A9CACACCDAEC0AC0E0000000000000000000000A000009E900D000900900000000000000090090909C0BD0AD0BD09A9E9F9BCB9CB9099990009000000900000000000000000000000000000000000000000090090B09AC0FCBCCEF0CA0E00E00CA00ACAAAC0ABC0A9A000000000000A000000A900A0A9E900F909000000900000000000000000000009000909009AD9909009009009000000900900900090090000090000000000000900009000000000900000A9C0E09A0ACEAF0AADEDAF000AC0ECCACC0E0C0ACA000000000000000000000009000000909E90D0090009000000000090000000090090900009090009009090090090009000000000000000000000000000000009000090000000000000909C9CBCBCA0ECBCF0E9CACAC0A0F00E0BAC0AE0E0E00F0A00000000000000A00000A0000A090009E9A9A090000000000000000000000000000090000090009000000000009000000000000000000000000000000009000090E9000900000009000B09CACB090ACAEFEADEBEBCA00E0ECCAE0C9A0A0E0A0000000000000000000A0B09A0000A09C090D0D9CA909000000000000000000009009000900900900009090090000000000000000000000000000000000000000900909A9CA00900CA90D0DADEBCA0E9EEDE9EACE00E9CE0E0A0C0EA0C0C000A000000000000000000000000000000000B0DA9A009C00090000000000000000000000000000000000900000000000000000000000000000000000000000000090009000009090009090B09A0E00F0D0E0FAFEFDEB0F00E0ADACE0AC0CA0A0A0F00000000000000000A0900A00A00A0E90DA0D0D9F09AD000900000000000000000000090090009000000000000000090000000000000000000000000009009009CB000090090D090B0D090C09EFAEAE0ECEEDAEBCE00E0ACACA0E00A00000000A00000000000000A000A00000009000A00DB0F0090C9A900C09000000000000090000000000900090090000000000000000000900000000000009000000000900909090000009AD090B0E9A000EDADAF0EFAFFCEBCACADE0CACACBC0ACA0000F000000000000000000A0000000A0A0A9CB00D0DB0F90C0DA900090900000000000090000000000000000000000000000000000000900000000000000000090C9A0000000000B090B0D0D0000EEDAFECAEBCFEEFFE9E0CA0ECAC0AC0AC000A000000000000000000000000000A0000000A00DBCBCD0009B090009A0000000000000000000000000900900000000000000900000000009009000000000900F0090909000000B090E9C9A9A90ADADAEE0F0ECEFEFFACAC0E0ECA0E0E0E0A0A0000A00000000000000A00000A000000A00A0000009CB0F9D0C909C90D9000000900009000000900900000000000000900900000900000000000909000000009009A90000000D09C099A90D00A00ACACE9EACFAFEFFEFFA9E0E0A0DA00000C0000009A0000000000000000000000000000000A9A0E9AD90E9B0F090DA0DA09000000000900000000000909C0090090C000009C00009000900900000000000D0090D0900090B00009BC0DADAD00000E0F0E0E0ECAFEFFEFCA0E0E9E0CACA0A0A00A00E00000000000000000A00000000000000000090DADB9E0D0DAFA9DA99000000009000900000000900090900000009C9000B0000090000000000090900A090B000090C0090B9009B090E0A0CA09E0E0E9E0EFEFFEFE9E00E0E00A0000C0000000000000000000000000000000000000000A0A0ACAD09C9DB0F9C9DA9D000900009009000000090C00C909A0090909000090009A09C000009090900000909AD0900B00090000CB9F09CF009E90CEACAF0E0FECFFEFE9E00E0000E00A00A00AC0A0B000000000000000A00000000000000A000000090BCB0F0D9E9B09CBCB00900000F090090000009A90A0D0900000A09C090D090009009000000000000D09000900090090DB9C909CA0F0E0E0B0CBC0E0E0FEEFFFFEBCA0A0E0000C0000000000E000A00000000A000A0A000A0000000000A0B0A0009C90F090C9E90090D000000009C90C0900900009C909E9090D090900000C9000000009000090090B0090009090900B0DBB0BC9CACADA9E0E0EACADACADEFEFFEDAC0C00A0A00A00A00A000B0A0000000000000000000000000000000000000E0B0F90F0F9090C9CB090900D09A9A90900000900C0B0090F0909E9E9D0B090A90900900090900F090DB090F000A09F0F0D0D090ACBCACE0F0F0CBCACAEEFEFFEDA0A0A000000000A00C00A0A000000A0000A00A00A00A0000000000A0ADA0B0900D00F9F9CBCB9A909AC009A0C9C900090090009090C9CF0D0AD0909A0090C90CA000009E9E0909F090009009C9DB099B09A9A09E0E0E9E0E0EAC0E0EDEFFEFFEAD0C00AC00E00C000A00C0F0000A000A00000000000000000000000000000A0EB0BD0C9A909D0D09C90900090B0F9B0090C090000909A99AD9090F099D0A9009090F0D0909F9F00B0090009A90BC9E9CB090CAC0ACBCACBCAD0EACBCAFEFFEFBC0A0A000A000A0AC00A0A00A0A0000000A0A0000A0A0B0A00A0A0000A0A0A000C9CB9BCDE9E0B0DA9CB09C9AD0D0C9D0A990090900F0D0E90F0F090E0090090090090BCBD090990090A9090DBD0B90F9CBCB09ACF0EACACACAC00E0ACAFEFFEFEF0C0CA000A0000A00C000F00000A0A0A00000A000000000000000A00000D0F0B0A0D0B99F99C9AD0A90CB0D09A9BCBBD00B0C9E9F09A909E909DAD99009000900B9C990B9E9A0D909D0FBDB0A9D0F9E0DA0CACA0E0CBCADACADA0ACEDEFFEFF00A0A000E00CA0000A000AA000A000900000A00000A00A00A00000000BCA0A0AC00F0BDADE9E9AD9A9D090D0B00DCB9C90F0D9E90090D09E9DBDA9900AD090F009C0B9AD9C9ADDBADB0F9C90D9F0BCBCBAC9EAD0ECBACA0E0A0A0C0CAEFFEFFE9E0C00A000A000CA000A009A00000A000A000000A00A00000000A00A000DA9000B00E9ADB9FBD9A0D00BCB090D0B0CF9AD99A09F9BC900090A0BDE9F990F090DB09BCBDA0BD99AD90DB90B0F0F0F90DA0DAE0CAF0ACCACA00D0CA0A0CFEFFFEBE0A0E0C0A0000A000A0C00E00000000A000A00A00090000000000000ACAC0E9A0CA900F0E9C9BC990F909DADA09C9B0F9AC9DF09C9ADB09C99C099A9E990DA90DBC99C9D90BCB9ADB0DA9DB9F9F0FA0FE0CAF0CAC0A000DA0A00000A0EFEFFFEDAC00A000CA0000AC000A09A0000000000000A00A0A0A000000A00A9009A90000000A00090B0CB0E900C0E909CA90C90D99E90F0BD9ADBC9A090009C9000B9CBBC9BCB0BCBDB0D9BCB99CB0E9E0F09E00FACCAAC0BCACA00000A00C0E9EFFEFFADA0E00A0A00E00000A000A0000A00A0A0A00000000000000A090A0000A0A0A0A0A0009A0A00B0D99CB909C9E99009ADA9E9E909D0AD9C9B0D09E900B0909009C9BCB9DF9BCBDBEDBDBCB0ADACBC9EB0EAC0A0D0AC09000ACA000A0ACEFEFFFACAC000AC000000CA0AC0A0E00000000C0000A000A000000000CA0900A0000090000A0A000000000CA90AD0B09A0D0C909C909C90AD9B0B9C90B00DBD09A9CB00B0F90FA9EDBDA99A9A9A9ADA0F0BAC0E9C0BC0AE0A0A0E00000AC00CBEFFFFEFF0ACA0000E0A0A000000009A0000A0A9A00000A000A0E9000000E0A000000A0A0000000A000A00A90C900D0D0D09A909A9CB09E900C09CA909090009AD9009D00D0FD9F9BCB9DB0DB0DA0F0F0ADCBAF0E0E0AC009C00000A00C00A00CEEFEFFE9E900E0A000C00A0A00A00E00A00C90000A00000000000A00A0B090000A000000A00A0A00A00000CA90C9A9A90BC90F0D0BD0F90F9B9090DAD0090DADB0990B9DBF9AF0F9BDA9ADA0FA9F0B0F9ABC0CADA00CB0E0A0A0A000A0A000ACAFFFFEFE0CA00000A0A000C0CA0CE90000A0A00A00000000000B000000C0A00A000A0A00000000000000A0A909A90DC9C00BC990AD0BD0F90C0F0DA90ADE9099CBFCBC9E9CBD9FDADA90F0BDB0FA9EDA0EC0EACA0F0A0000000C00E000000E0EFFFEFFEB0ACA0ACA0000A0A0A0FE0A9000090A0000A000000A00A000A9A000000000000A00A0A90A00000D0CE09C9A9A90900CADD9EDAD0F9BD0F0DE9D09E9CA9C9BDBF9FF9EF0BDB9EB0BCBEBCBE9ACF0AE09AC0AC0ACA0E0A0A000A0CA000CEEFFFFFCE00C0000C0AC0C0ECE0FEEA0A0A0000000000000000000000009A0000000000000090E00A00A0A0A9E0AD0E90F090900ADBCBFBDADAD9F0DA9F0F9FDB0F0F09E9BF99FDACB9E9EB0BCBCADA0EC90E00BC0B00000000000A00A00A0A0FEFFEFCBDA0A0A00A00ACAE9EFEEFB000900A00A0000A00000B0A00000A000A00A00A000000AC0BC90A0000F0AD0A090F0DADCFF90DBC9CAD9F9E9FBDF0BCF0BCF990DF9F090F0ADBE0BA0FADA09E0CB0AAC9AC0A0C0A0A00ACA0000C0000C0EEFFFFFBEACAC0C0A0CACACFEFEFFFC00A0A0000000A000A00A00000A0A0000000000000000AC0BE0A00000A00F0A900E0CBCBA909E9E90B99A9EBDBC9A9DBDBDF99ADB9A909E9ADB00B0DB090A9E0EB0E9C0A00A000A0000E0000CA0A00A00ACFEFEFFEF0900A0ACEBCFEFFEFFFFEBE000000000A0000000000000000090A009000000A0A009AC090A00A00A0000CA009A0B0D0F0909B90DADB9DADBF9CBCBCB9FFDBCBDADA9ADACEBCBACB0ADA0B0CB00A90E00DA00C0A00000A0000A0CA0CAEFFFFFF00E0E0ECBCEEFEFEFEFEFF0B0B0A00A0000A0A0DA0A000000000000A0A000000000000B0A000009000A0B009A0000A000A0E00C90900909E9CBF9BDBDA09EFBCB0FBCB09A9CBC9A0F00F0CB0CB00E00B000A0A00A00A00A000C0000ACFEFFFEFFE0E9E9EEFFEFFFFFFFFEFBC000000000A00900A0000A000000A00900000A00090A0A0C000A0BCA00B0000A000A0000B09090B0A0009E0B09B09E9E9A9FA9ADBCFBCBCBE9EFEBE9EBFFBFBFFBE9A90AC0A0C0000C0AC00C0A0A0A00CBCFFFFFFACBCEEEFFEFFFEFEFFEFFFE0A0A0A00A0000A0BC0B0000000A000CA0000000A0A00C00A0A9C0000CAC0CB0000000A0A000A0A0090A9A09C0E00F0B0BCB09BCBEFBFBFBF9EFADADBFFFFFFFFFFB9A0A00A000A0A0A000A0A000000CA0EEFEFFEFEFEEFFFFEFEFEFFFFEFFEFB00090000000A0000A000000000000B000A000000000B0A09000A0A0A09A9A0E9A00000090A090000A00000A0B0BCADADABCBACBFBFFFFFFBFBDFEFEFFFFFFFFFFFFF90CA90CA000C000A0000A0AC0A00E0FFFEFFFFEFFEFEFFFFFFFFEFFFFFFCB0A0A9A00A00000000A0A00A00A0000B009A0000000009A0A0000D0DAC0E900009A09A00090A00B00A0A090E0F0B0B0BCB009ADFFFFFFFFFFFAFCBFFFFFFFFFFFFFBFA90A000B0A0A0C00E00C00A000E0EEFFFFFFEFEFFFFEFFEFFEFFFEFEFFF0A000000B00A0A00A9000000000CACA00A000A00A0A0000000A0A0AA0B000E9A0000000A0A09000009090E09A0ADAF0FB0B9EBAFFFFFFFFFFFFFFEFFFFFFFFFFFFFF9A0AC0B0C00000A0A00A0A000E0BCEFEFFFFFFFFFEFFFFEFFEFFFEFFFEBA009A000A0000000000A000A0000A0B0CADA000000900A000B0090C9C90A9A9000A00A090090A0000A0E0A90AC9F0F0BBCBDABDFFBFFFFFFBFFFFAFFFFFFFFFFFFFFBA9C90A00A00A0A00C0A000C0E0ECEFFFFFFEFEFEFFFEFFFFFFFFEBFACBCF0A000A0000A0000A0000A0000A0D0CA900DA0000000000A000ACA0A0A0000A0A90090A0BCA00A0A000090A909A0B0BE9BEBDAFBFFFFFBFFFFBFEF0F9FBFFFFFFFFFF9A0A00E00A00C000A00CACAF0FEFFFEFFFFFFFFFFEFFFEFEFEFAFCCFACAA900A000A0000A0000B00000A000A0900A000B000A0A000000A0900000B00000C0A00000009E090000B0AD0A0A9CAD0BE9FBFF9E9FBFBFBFBFFFFFFAFBFBFFFFFFFFBE900E90A00E0A0E00E0ACBCEEFFEFFFFFFFFFFFEFFFEFFFFEFADABA0000F0A0000000A000000000000B000A00A0A90A000A0000000A0A9CA0B0B000A0A00A00A00B0A009A0A0A0CB0A9000A9ABDBFFFBFBFBFBFFFFBFBFFEFECBCBFFFFFFFFFB9A0B0A00DA000000E9ECFEFFFEFFFEFFFFFFFEFFFEFFFEAF0BCAC0C0E0AA0000A0A0000000A0A00A0000000000000009009000A0B00000A000000A00900A90909000900A000900B09000A900FDAFBFBFBFFFFFFBFBFFFFEFF0BFBFFFFFFFFFFBCB0C00CA0090E9EE9EEFEFEFEFFEFFFEFFFFFFFBEFFECAF00E000A0A00CF00A0000A000A00000000ACA0B00A000000A00A0000000A9A0A9A9A0A000ACA900A0A0A0A0A90A9A0A000A9A900B9ABFFFFFFFBFFBFBFBFBFBFFFEFDAFFBFFFFFFFFA900A0A90AE0E0E0FEFFFFFFFFFFFEFFFFFFFFEFEFACABC0EA0E0AC0CACA0B000A0000A0000009000090000000A00A0000009A000000000000000A90000E00000009000A0000090A0900E9E0E9FBFFBFBFFBFFFFFFFFFFFFFBEBF0FFFFFFFFFFBF0B0D0AC90E9EFFEFEFEFFEFFEFFFFFFFFFFFFEF0FAC0A00C00C0ACACACF0A0A0A0A00000A0A0A0A0A0A0A0A0000000A0A0A000A0A0A0A0A0A0B0A0B0B0B0B0B0B0A9A0B0A9A0A90A0F9BB9BFFFFFFFFFFFFBFBFBFBFBFFEFFCBFBFFFFFFFFFF0B0E0ADAEEFEFEFFFFFFFFFFEFFEFEFFFFFFFE9EE0E0E0E0A0E0E0E0ECAA00000000000000000000000000000000000000000000000000000000000000000000000000000000000A9FBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBFBFFFFFFFFFFB9ACBCFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEE0E0E0E0E0E0E0E0E0A000000000000000000000010500000000000070AD05FE, 'Robert King served in the Peace Corps and traveled extensively before completing his degree in English at the University of Michigan in 1992, the year he joined the company. After completing a course entitled \"Selling in Europe,\" he was transferred to the London office in March 1993.', '5'); +INSERT INTO employees VALUES ('8', 'Callahan', 'Laura', 'Inside Sales Coordinator', 'Ms.', '1958-01-09 00:00:00', '1994-03-05 00:00:00', '4726 - 11th Ave. N.E.', 'Seattle', 'WA', '98105', 'USA', '(206) 555-1189', '2344', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E506963747572650001050000020000000700000050427275736800000000000000000020540000424D16540000000000007600000028000000C0000000DF0000000100040000000000A0530000CE0E0000D80E0000000000000000000000000000000080000080000000808000800000008000800080800000C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00F00900000000000009090FB0000900000090000000909BFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0009C90C0F9E9BE000090009000D09009009000000000000000B0900000000900000FF009CD00000009000090900000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0B0D0900909E9FC9000900900FBFA90000000090000909000000D00B0000000000009000009B00000000090900000909BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0900B00009E9E09000900F9DFFFF090009000090000090090B09090000000000009F00000F0000009000009000000BFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AC90009009090C9000099E00D0FFFE900000000090009000F000000000000000009E90090F00000090090900009C9BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00900000000900900009F00090909ED009090900000090090000090000000000009E0009F0000000000000909E90FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFBFFFFFFFFFFFF90D00909090909000900BC90900009BDA90000000000BEFFE00000000000000000090F09A0009000090000900090BFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFCBBF00000000000090009FE00000000FFC000900909DFBD0B0000000000000000000099ED00009000090009F00009BFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFC9F000000909000000099E00000090B0090090000BFC00D00000000909A00000000009000000000000900BF009ADFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFBFFFFFFFFFFF9E9FF90000009090090009BD0B0909C900000090900900B00000000000900000000000009000090000000900009BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFBFFFFFFFFF09F0009000900000000000FBC9000A00909000009F000F0000000090000900000000000000000000900009F009EFBFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDBFFEFFFFF0F009000000900000000090DAFDBD0900009009FE000900000000009000900000000000000000000009090FC9BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFBDFBFFFFFBFFFFFFF0000000000000000009000090000000000000090000F000000000000000900000000000000000000000090009FFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFBFFFFFFFFFFFF090909090090000000000009000900090000000000B0090000000009000A0000000000000000F00009000900BFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFBFFBFDFFFDFBFFBFFFF00000000000000009090090000900000009BF00990F00000000090000909000000000000000900F9E0009009FDFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFCBDFFBDBFFFDFFFBFFC000900900000000000000000900090009CFC9FF0EB09090000000900000000000000000009009009A000009BFBFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFBFFFEBFFFFDFFFFFD0009009090DBDB00000000000000090FBFFADAD0F90009A00900009090900000000000000F00090D9000000FDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFBFFFBFDFF9FFFDBFBFFFEF9EB00000000F0FADFBCBC90000090000BCFFCF0F00F0090090900909000000000000000000090000000009009BFFBFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBDFFBFFFFFFFFFFFFBFBFFD000900099A9DF0FFFFBCF000000090BD0B09000B09A90900090A090900000000000000009E00009000009AFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDAFFFFFFFFFFF9FBDBFBDFBDFDFBCBA000099FEDFE09F0D0FFBC00000900D0A9C0000F0BDA09A9000900009000000000000000099E000B0090099FDFDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9AFDBFFBDBFEFFFFCFBDFAFBCFFDFD00000FFF0F9C009E09CBC00009E9AFD000000F900D009C09009000090900900000000000090000000000BFBFBFBFFFFFFFFFFDFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFDBEF9FFEF9F9F9FBDFADF9FBDBEBFE909009BD009B0F9FE9F0900009C900000000B09F0090B900000900000000000000000000090990000009FFFFFFFFFFFFFFBFFBFFFFFFF9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFBFFFFBFF9F099EB9F9FBCBE9FABDBFEFFEFFDFBC00090FE9AFEF9E09F000000000000000000F0900B09000090000009090000009000000000000000009FF9FBFFFDFBFFBDFCBFFFBFFF0FFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFEFFFFBE90FDFADBF9F9FDFCBFDBF9FBFFF00000090DBDFFED00000000000000000000B0B909F090B000000000000000000A90000000000009000BFFFDBFFBFDBDFBFBFDBFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFBFFDFBDBE9F9F9B0BDFF0FBEFAFBDBFDFFFFFEFF0009000000909090090000000000000000F9CB00BFC90900900000909009009C0900000000000000099FAFF9FF0FAB0F9FBEF9FFFDBFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFBFFDFBFFFFFFFFEFCB0B9FBDF9FDBFFEBFAFFFBDBFF000900090000000000000000000009000F09099E90B00900000000000900909ADA900000000000090BFDB9E90B9D9F9ADBDBFFFBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFBFFFFBFFBFF9FADBDBDBCBCFBAFBBE9F9FFDFBCFFFFFF90000000000000000000000000000000B0A9E099E9C090B090000090009000900000000000000000909BC99BCDBEBFFFFFFFFADFFFFFFFFFFFFFFFFFFBFFFBFFFFFFFFFFFFFFFBFFFBFFCFBFFFFDFBFFDBFFFAF90B9FFDFFDFFFFBFFFFFFFBDAC0000000000000000000000000000000F9090B0090B0009A000000009000C000900000000000000000009AE9BBF9FDBFBFBFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFBFFDFFFDFFBDFBDBFAFDEBFFBCBDEBD9E9FBCBFBFADFFBFFFBFEFF909F0000000000000000000000000090FC909C900909000909009090000B9090C0900000000000000000999E9CBFAFDFDFFFFDBFFFFFFFFFFFFFFFFFFFFBFF9FFFBFFFFFFFFFBFF0FFBFFBFFFEDFBFDFADFBDBDBEF9F0FFF0FDFFBFCFBDEDBDAF009F9F9000000000000000000000000FB09A90A90000900900900009090000A9000000000000000000000B9FBDBDBFBFBFFDBFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFBDFEFBFFBDFADF9FBFBDFBFDBEDAFBCBDAFBF9FFFBF9EDBFFFBFFFF9F000000090000000000000000000000B0F0900900B0900000B009090B00090900000090000000000900099CBCBDBFADFFFFBFFFFFFFFFFFFFFFFFFFFFFDFBFBF9FDFBFFFFFF9FFF9FFBDFBEFF9FEBE9BE9BF9CBFBF9F0FADBCBFFBFFF0FF0F9E0000000000000000000000000000090F09F0A90090000090909E0000000000000900000000000000000000B9BDAF9FFBFBFFFFFFFFFFFFFFFFFFFFFFFFBFFDFFFFBFFDBDFBFF9FBFF0FFBDBDBE9FDFFDBFF0FBF9E9EDBDBFFFDBDFE9FFDBFBC9FA00000000000000000000000000000F90BD9E9009000000000909090909000900000009000000000000090E9BDBF9FFFDF9FBFFFFFFFFFFFFFFFFFFFFFBFFBDFFFFBFFBFCBFFDF0FF9EFADBDBFBB9AF9ADBCBCBDBBEBF09BFAFBDBF0FAD0FBC9D09000000000000000000000009000B090B0909A009000909009A0000000090009000000000000000000099ADADAFBDBFABFFFFFFFFFFFFFFFFFFFFBFDFF9FFB9F9FFFFFBFDABFFBDFB9FBEBDADEFDBEDF0BDBFADF9F0F0F0FDEFF9FBDBF09B0A90000000000000000000000000000F00B0DA9090000000009000090090000000000000000009000000009ADB9BDBCBEDBDFFFFFFFFFFFFFFFFFFFFFFFFBFFE9FEFF9FF9FDBFFCBDAF9FE9F9E9FB9BADB0BDADADBDAFF9F9FFB9B0F9E9F0DBC0900000000000000000000000000000F09CB09AD0B00000000090900900000000009000000090009000000090F9E9FBDBF0BFBFFFFFFFFFFFFFFFFFFFFBFCF9FFDBDBF9FFBFE9FBFBF9EB9F0F9FADEFDBCBCB9F9FABDB0FAF0BDEFF0F9E0B00B9000000000000000000000000000090BE9009090909009000000009009009000000000000000E00009000009B0F9B0FBDBDBDFFBFFFFFFFFFFFFFFFFFFFFBFFBFFFBCBE9FE9FF0DBCBDBDE9FADB9B9BCB9DBCB0F9FDADBDB9F0A90F9ADBC9F000000000000000000000000000000000F90B00F0B0C00900900900900900B09000000900000909000000000000DBC9F9CBF0BFBFFFBFFFFFFFFFFFFFFFFDFFFBFCBDFFFDFB9FB9FBDBFADA9F0DBCFCFCBDAA99ADBE9ADBCBCF099FBBCB099A0900000000000000000000000000000000B0F09B0909B09000000009000009000090000000009000000000900009BA9FADBF09EBDFBFFFFFFFFFFFFFFFFFFFBF9FDBFEBF9FBDFF0FF9E9E9F9F0FB0F9B0BB0F9DADBC9BDBE9F9B9E009C90DA009000000000000000000000000009000000F09BC09A900900900900009A000009B0000000900000909000090F00090DA99ABCB9BEBDFFFFFFFFFFFFFFFFFBFFFFFEBF9BDFF0FBCBFDAF9F9F9ADF09F9ADBC9F09A9A9BADA9DA9E9E9900BCB00900000000000000000000000000000000900F009B09C0B00B0000009000090000009000000000000000090009000009BDAD9DBC9D9FADFBFFFFFFFFFFFFFFFFFDBFDFCFFADBFDFBDBF9FADB0F9A9F0BD9ADBE9F0D0D09DADA9F9B09ACB090090000000000000000000000000000000000000F09A0F099090D0900000090900090090B00000090000000000000900000009A0B0B0BF9FBFFFFBFFFFFFFFFFFFFBFFFBFBF9FBDBF0FBE9FBDBCBDADB0F0BE9F09B0B0B0BDA9BBCBC0F0D90009000000000000000000000000000000000900000B00D990B0009A000009090000900000000000000000000000000000000099B9F9F09ADBFBDBFFFFFFFFFFFFFFFFFFF0FDF0FBCBE9FBD9F0DADBDADB0F9BC9DA9E9E9C9BDA90D0990B909A0000000000000000000000000000000000000000000F09A0A090B00900000000909000000909000000090000000000000000000000909E9DAF9FEFBFFFFFFFFFFFFFFFDBFFFA9F0DBF9FBDBEBFBF0F0B0DB0D0B0B0F9A90B0009CB0F0A9C0B009000000000000000000000000000000000000090000FB09909E9C900900009000000000000009090000000000000000000000000900B090BDBE9BFFFFFFFFFFFFFFFFFFF9FFDFBFBCBDE9E9F9CF9F9F9FADB0F9E9F0D9F099F0B09909D0B00900000000000000000000000000000000000000000000F00009A90B0B000009009000900000000000000000000000000000000000000909A09AD9FF9FBFFFFFFFFFFFFFBEFFF0FADBCBDA9BFBCBB9E9A9E99B0F09B90BAB0BCA09C9ACB0A9090000000000000000000000000000000000000000000000F99E909DA9000900000B0000009009009090009000000000000000000000000009090BDBE9FFFFFFFFFFFFFFFFFF9E9F9DBCB9EBDF0DBFDE9F9F90F0DADBC0F0D0D00990A9090090000000000000000000000000000000900000000009090009BE09A9A0DAD900000900990000000000000900000900000000000000000000000000090B9FBFFFFFFFFFFFFFFFFFFFFBFADB0F9DA9FAD0B9F0DA9F0B90B09B09B0B090AD909A9009000000000000000000000000000000000900000000009000F9F0909B09AB000000900A900000009000000000000000000000000000000000000090BCBCBFBFFFFFFFFFFFFFFBDBDADFADF0B9F0DBF9E9FBADA9F0F9CB0DB0DAD9A9000B000900000000000000000000000000000000090000000000000000F0B0F0000F9C900000090900900000000090900000000000000000000000000000000009B9FDFFFFFFFFFFFFFFFEFEBDB0DB0FAD0BA90FDB0D9BF09B0B99E9ADA90AD09B00090000000000000000000000000000000000000000000900090000B00F90B0B90B0000099AD0000000090900000000090000000000000000000000000000090FFBFFFFFFFFFFFFFFDBDBDB0FB0F9D0F0D9F0B0DBAD0DBCBC0E909090F9000009000000000000000000000000000000000000090900000000000000F909A9090CBC90000000B0909009000000090900000000000000000000000000000000009A9FFFFFFFFFFFFFFFFFBF09F0DB0B0B9B0B0BDBAD0B9A9B09B9BCBCB0000B0900900000000000000000000000000000000000000000000000900000FA9ADA90B9A9A9000090000000000090900000000000000000000000000000000000000009FBFFFFFFFFFFFFFFBDE9FE9B0DBCB0F09C909C9BD0F9C9E9C90909C9B9900090000000000000000000000000000000000009090000000000090000F0009ADA009C900B00009A90090009000000090900900000000000000000000000000000009FFFFFFFFFFFFFFFFFBF09BC9A990D09E9ADA9A9A90B0B9A9ADA9A9AC0009000000000000000000000000000000000000000000000009009000000B09BBD0909A9AC909000090000000009000090000000000000000000000000000000000009BFFFFFFFFFFFFFBEBDBC9BC9AD0E9A9A909B09D0D0BCB9C9AD09C90909A90000000000000000000000000000000000000009000000900000000000F000CBFAD00C9B090A0900000090009A000000900000000000000000000000000000000000BFFFFFFFFFFFDFD9FADBF0B90B990D0D0BC0DA0B0F09CB0F9A9A90F090000000000000000000000000000000000000000000000000000009090000F9A9090B0B0B00F099000000000090090900000090000000000000000000000000000000009FFFFFFFFBD9A9E90D090D0BD0A9A90B099A99C909B090B0D09CB090A9090000000000000000000000000000000000000000000000000000000000F090B0BDBC90090BC009000000000090900000900090000000000000000000000000000009BFFFFFF9FCBFDB9BDB9B0B9C0BD090B0DA090A9A90C9AD90B0B09CB0D0000000000000000000000000000000000000000000000000000009000000B0AF0D0BCB9A90BCB090090000000900A90000000000000000000000000000000000000000BFFFFDFBDBFCB9EDB0FC99CB9900BC90909CB900DA9B090F09C9A90900090000000000000000000000000000000000000000000000009090000090F9090B0F9BC900090F00000000090000909000000000000000000000000000000000000009FFFFFBFFFDBFFFB0FDB9FA90BCB909A90B0900DB090C9E90F0BC90B00B000000000000000000000000000000000000000000000900000000000000FA90BCB0F0BE909A9A9F000000000909000B00090900000000000000000000000000000000BFFFFFDFFFF9FFDFBFE99F9F090CB0DA9CB09A09A9B090B09909A9C900900000000000000000000000000000000000000000000000000900000900F9E0909E9F99AD090DA9090000000000090009000000000000000000000000000000000009BFFFFFBFBDFFF9FBDF9FE9F09E9B090909090900D009A9C9ACB0D0B090000000000000000000000000000000000000000000000000000000090000F09B00A99A9E9B0CB09E900000000000900090000000000000000000000000000000000009FFFFFFFFFFBDBFFFFBFF9FA9F9BC9B0A9A90F09A90F090B90990B09000900000000000000000000000000000000000000000000000090000000009BAC0909ACBE9FCB90A90B09090000000009000909000000000000000000000000000000009FFFFFFFFFFFFFFF9FEDBFDFF0F0BC0D90D0909090090F90CB0E9090E90000000000000000000000000000000000000000000000000000000090900F9B0AD09099A9BCB9C009CA00000000000090000009000000000000000000000000000000BFFFFFFFFFFFFDFFFF9FDAF9FBDF9B9A90B0A9E90B09000B09909E09009000000000000000000000000000000000000000000000000000000000090F0AD90A0B0ADBCB0F9A90B90900000000090009000000000000000000000000000000000BFFFFFFFFFFFFFFBFFBFFBFDBFDA9E9E90F09D0900D00B09090A0909B09A000000000000000000000000000000000000000000000000000000900000B0990A9D009BCB9F00909000000000000009B00000000000000000000000000000000009FFFFFFFFFFFFFFFFDFDF9F9BFCBFDBDB0F909A09A9009090DA0D9A090C09000000000000000000000000000000000000000000000000000000009090F00AC90A9F00BCB09B09E90900090000000009000900000000000000000000000000009BFFFFFFFFFFFFFFFFFBFBFEFDFBDFADBCB00F09B9C90B009A099A09F00900000000000000000000000000000000000000000000000000000000000009AB099A900BD09ADAD0F090000000000000000000000000000000000000000000000000BFFFFFFFFFFFFFFFDBFDEDBDBE9FB9FBCBDBB0F0C0B0909E09000900090A90900000000000000000000000000000000000000000000090000000090900F0A0A09A90A909B9A909A090000000000000009000000000000000000000000000000BFFFFFFFFFFFFFFFBFFDBF9FBDB9EDFBCBDAD0D0B9B0DBC90909A9CB09A090000000000000000000000000000000000000000000000000000009000009BB00909E9E99F0F0E90F09000000000000000000000000000000000000000000000009BFFFFFFFFFFFBDBDFBDAF9FAD9EDB9A9F9E9ADBBDAC9A09A90A09000900D009000000000000000000000000000000000000000000000900009000909A9CF0A0B0009A00B099F00B0000009000000000000000000000000000000000000000009FFFFFFFFFFFFFFFADF9F9E9DA9B0ADBD0F9BDB0DA9BC9B0909090909E0909A000000000000000000000000000000000000000000000000000000000990BB0090B9A09A9CBE09B0D000000090000000000000000000000000000000000000009FFFFFFFFFFFFBDF9F9BE9F9EBDAD9B0DA9AD0BCBBDE9B0DADA9C000B090A0090900000000000000000000000000000000000000000000000000900000AD0F00A00ADA0D0B09BC9DA90000000000000000000009000000000000000000000009BFFFFFFFFFFFFFEBF9F0DB099099A9C9B0D9A9DB0DA9F0DA9090B09000090900000000000000000000000000000000000000000000000000000000000B09BA0009A99090A9CBCB0A90000009090000000000000000000000000000000000000BFFBFFFFFFFFFFDBD0DADB09F0F9AD09BCB9A9CBADB9F09A909E9090090900000900000000000000000000000000000000000000000000000000900090D0BCF0A0A9AA9A09A9A90F900000000000090000000000000000000000000000000009FFFFFFFFFFFFFBFDBFB990F0909C90F09090D0B9DADADFF90F09E9090000A90B000000000000000000000000000000000000000000000000000009000B0B09B009009AD0BC09CB90BD000000000900000000090000000000000000000000000BBFFFBFFFFFFFDFBC90DAD990F90B090BCBCB090E99B9A9DA909A90F09A090000909000000000000000000000000000000000000000000000000000009090F0B00A0A0B0BC9A9A9E9CB000000909000090000000000000000000000000000009FFFFFFFFFFFFFF9DB9F9DBCF99090DAD09090DA990F0F9FADA9AD0B9000900090000000000000000000000000000000000000000000000000000909009ADB00E000090B000B009E9AB900000000009000090090000000000000000000000009FFFDFBFFFFFFDF9FBDFFDBFDBDADA9099A9BC9B0D0B0B9EBDB9C90BCA90900090090000000000000000000000000000000000000000000000000000A0B090009B0000A90BB00DA09BD0E9000000090090000000000000000000000000000000BBFFBFDFFFFFFBFFDFFDBFFDBDBD9DB9009C9A9C9AD09C99FADA9A9099CB009000009000000000000000000000000000000000000000000000000009090F0090BB00A00A000B0A9F00B99A0000000090A0000009000000000000000000000009FFFFFBFBFFFFFFFFFDBC9009090B09CBDB0909A909A9A9ADBDBD0D0BCB0090009000000000000000000000000000000000000000000000000000000090909A090F0A00A9A9A099009F0FAD09000000009090009A00000000000000000000009FFFFF9E9FFFFFFFDBCB09BD9A9AD09E9090DAD090F09C90909BFAB0BC90DB0E90009000900000000000000000000000000000000000000000000000900F00090CBA0000000A09A0E9B0B0909000900009000000000000000000000000000000BFFBF9F9FFFFFFFDBC99FFFFADFF9E909009099ADB09A9ADA9BCF9D090B0B00900000000000000000000000000000000000000000000000000000000009090B09B0B00A00B00B0B09ACBDE9A9E90000000090000909000000000000000000009FBFFDA9BFBFFFBD9BFFFFFFFFFFEFF0F090A900900F0D090909B9EB0F09C90909090009000000000000000000000000000000000000000000000000909A0000000BF0000A0A0000B09B0B9C909A900900000090000000000000000000000000BFFFFBDA9FFFFFD0BFFFFFFFFFFFFFF9BFAD9AD00990B0F0BC9ADBDF90B0B0DA9A009000000000000000000000000000000000000000000000000000090909090900B000A0900A0B0B00F9E90B09C09000000900009900000000000000000009FFBF0F99FFFFF00BFFFFFFFFF9EBFF0BCFDA9F009000909909AD0BEB0F0909A90C90000000000000000000000000000000000000000000000000000000B0000A009AA000000A00000BCB9E9A90C9A90000000000000A0000000000000000009FFFFFF90BF9A9909FFFFFF9F009BDB0F0FBA9CB09AD00909E9A90BDB9D0BDA9090909A900000000000000000000000000000000000000000000000000090009090BA9F0A00A000A0B00B00B09A9B09A000000000900990000000000000000009BFDF990BDFFDF09BFFF9E9E99D000090909C0B0F009A000090DA99ADFA990DA9E9A0000000000000000000000000000000000000000000000000000009A900000009AB00000B00000A90F90F0D09A9D9000000000000E909000000000000000BFFBFE9A9B090900F9F9F9F9E9BD9B0CB090900909009090090090F9B0F00B0909090900900000000000000000000000000000000000000000000000090009009000B0F0000B0000000A9A0B09A9E9E0A9000000000009000000000000000009FFFF0909D09A909B9F9F9F9F9FCB0D99090B09909090000000090B00DFBDBC9ADA9CB00900000000000000000000000000000000000000000000000000090000009BCBB00A000A000A9A9AD09E9F90999C09000009009A90900000000000009FFF90B9F9A9FDFBFFFFFFFFFFFFBFDBF0BDA9CB0A90AD909090909909B90009A9090900900000000000000000000000000000000000000000000000009000000900B0A0A0000A00A00000B0BDA90ADB00A900000000000000000000000000000BFBE9090F9FFBFFFFFFFFFFFBFFDBF09F09DA9BD9E99A09A9A9A9ACB09E9B9AD09A9A09A0000000000000000000000000000000000000000000000090009000009009A9F00000B0000A00A00BCBD9ADBD00B0900009090909000000000000009FDF9900B0FADFFFFFFFFFFBDF9FBCBF09F0BDADA99E9DA9C90D099090B9C0D90B09C90D090900000000000000000000000000000000000000000000000000000009A00AB00A0000A000000B0B9A9ADA9A9009A0000000000000000000000000BFFBBCB099BDBFBFFFFFFBFFFAF9FBD09A0909909F09A99E9A9A90090900B9A0F09A990A90000000000000000000000000000000000000000000000000090000090A0B09F0000A9A0000A0B009ADADA9AD09000000090009090000000000000BFFDBC9909BCBFFFFFFFFFFFDBD9F0D0B9C99ADA9F09AD0F090D09E9B09E9900990D09A09009000000000000000000000000000000000000000000900000000090BC9000AA000000000000000B0DBDB0D09E9E909000000000000000000000099FBFDBF0BC099BDBFBFFFFDFBCA909A9009AC909B0BD0B90B0B0B0990F90B0F9E0B0B0C909A000000000000000000000000000000000000000000000000000900009A9AB0B0A000A000A00B000000BCBADA909A0090000000009000000000000BFFFBDBD9B9A9FADFFFFFFF9F99E09009A99A9B0C9CBD0F0D9C90B0FB0BD0909900909B00C90909000000000000000000000000000000000000000000000000009000A90BF0000A90000000000A9B0BD0B09E909000000000090000000000009FFFFFFFBF09D09FFBDFFFFBE9F099009000090C9B9A9A99B0B9BD9F90D0B9E9A0BDA9009A90000000000000000000000000000000000000000000000000009009ADA90A00B000000A0000A0A00900FF0B0DA90F000000000000000000000009BFFFBFDBD0DBA9BF9FFFFF9FDBE9B00900909009BC0DBD0F09CBC9E90F9BDA909D9009E9090A9000000000000000000000000000000000000000000000009000900900B0FBA0A00B000000000A00A90B9E9A9E90B00000000009090000000000FFFFFFFFBFBD9E99FBFFFFFBFDF9C9BC9B09C9B009B09A90F9BDBFBDB9E90DADB0A9B09A90900900000000000000000000000000000000000000000000000090A90A0B0B0AF00000A000000000009A9CBDAD09AD090000000000000000000009BFFFFFBDFDBE99F0BDBFFFFFFBFFBC9B0DA9A090909F09F90F0F99CBCB9F9B90D9C0D0900F0900090000000909000000000000000000000000000000000009009090B00AB9B0000A0000000A00B0A9A90B9A9E90BC000000000009000000000BFFFFFFFFBFF9FE9BDBFFFFFFFFDBCBD0F09D9F0F09A09E90FBDBEFBDBDA9E9E9A9B9A9A90900B0900009009E9ADA0000000000000000000000000000000000A900AB0A900EA0000900000000000A0B09E9E9F09A900000000000900000000009FFFFFFBFFF9FF9BCBDFFFFFFFFBFDB0B09F0B099009DB9BFBDBF9BDB0F9F9B9F9AD0D09C9009000009000B0909090000000000000000000000000000000090909A9009A9ABF0A0A0A00000000A09000A90BCBCBD09000000000000909000000FFFFFFFFF9FFF9FDBFBFFFFFFFFDFADF9DB0BC9E0D9A9CBD9DBCBFDBDF9E9E9E9C9A9A9A9A9A0900900009C909009B00000000000000000000000000000000900A90ABE0A00B0000A9000000000A0A0B0BC9A9B0AF0000000000000000000009BFFFFFFFFFFFBFBFDBDBFFFFFFFFBDB0F0DBDBB99A09B9EBEBFBF9FE9FBDB9F9B9BDB0D9090900900009009A90B00C90000000000000000000000000000000A909A990B00B0F00009A00A0A0000000900B0BCBCBD00900000000009000000000BFFFFFFFFFBDFFF9FFFFFFFFFFFBDFFDB9A909C9A99FCBDBDF9FDF9BFBC9F9ADE9E90F0BD0B09A00900009090C909B00000000000000000000000000000009009E0A0B00B0AA0A00A0A0909000A9A0A0B0F09A9B0B9E09000000000000000009FFFFFFFFFFFFF9FFFFBFFFFFFFFDFBCB9E9CBCB0D0F0B9F9FBF9FAFFDBDBE9F9B99CB990A9C9000900909A09090F000000000000000000000000000000000090BA90B00B0A0F0000B009AAA0000000000B0A90C9C009A0000000000900000000BFFFFFFFFFBFFFFBFFFFFFFFFFFBDDBDE90B909B0B9BDF9EBDEFBDF9ADBF9F0F0F0BC9E9DA900900000009000B09090000000000000000000000000000009A9AD0A9AA00A00B0A000BAE9000000A000090B9E9A09B90D9000000000000000009FFFFFFFFFFFFFBFFFFFFFFFFFFFFBE9A9F90FBCBD0F9A9F9FBDBFBDFF9F0F9F9F9F9B09A909A90909000009A90BCB00000000000000000000000000000000909A90090B00B0F0000B0B0A0A0A0A000A0A0A09A99AC09A0900000000000000000BFFFFFFFFFFFFFFFFFFFFFFFFFFDF9F9F0BD09909B9CBDADBDBFDFBDBF9F9F09E90BC9F9E9E900A000909009C909000000000000000000000000000000009CADA0B0A000B00A000A0A00000000000000090BBC9E090BCB000000000000000009FFFFFFFFFFFFFFFBFFFFFFFFFFFFBCBD0BD0BDADB0FBDBFFFFDBFBDBF0F9F0BDB0BD9A9090909090900000900000900000000000000000000900000000009A90900A09A000AB000000000000A000A0000A000B09B09090B00000009000000009BFFFFFFFFFFFFFFFFFFFFFFFFFFFDF0BDA0F9A9BCB0DAF9BCBFCBDEBDBFE9F9AD9CBADADA9A9E9000000090B000000000000000000000000000000000009009A0B09A00A0A0F0000000A0A0000A0000A00A9A9F0D009A9C90000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFBF9F09DB09D099DBDBDFFBDBFFBDBFDB9F9F9BA9D909B0D09009090000000900000000000000000000000000000000000B00900A00B0009AA000000000009A000A00000000A0B9A9000B0000000000000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCBDA09F9A9E9A9ADAF9FFF9FDBFDADFADAD0DB0BDAD9A909A000090000900000000000000000000000000000000009009E0A900A00A9A0B000000A0A00A000A000000B0B9BCAC00090C9000009000000009FFFFFFFFFDBFFBFFFFFFFFFFFFFFDBDA99F0AD0909FDBD9F0B0F0BFCB9FB9DB9FB0BDA9A090F0909000000900B00000000000000000000000000000009009009000A90A0000E00A0A090000000A9000A000A0A0B99090A90A00000000000009BFFFFFFBFFFFFFFFFFFFFFFFFFFFBF909F00990B9FA9ADBEBDBD9BD9BDFBDFADE90F099C9F09090DA90000000900000000000000000000000090000000A09A90A9A900A9A9A0B000000A0000A000A0A00000B0F0ACB0090090900009090000000BFFFFFFFFBDADBDBFFBFFFFFFFFDFFFA9BDADBC09FDBC99DADAF0BE9BDEBDB9BF99F0BB09A9A9A0000000000090000000000000000000000000000000900C0B000A0A000A00F00000A0000A000B0A0000A00BA90B00909000000000000000009FFFFFFFFBCB9B0BC9FDFFFFFFFFFF09D0909099BC9A9B0F0F9D9FD9FCB9DADFC9AD0BD0F0D09C9909000000000000000000000000000000000000000909A9900B00000A900AB0A00B0000A000A0A000A000B000B0DA00A009000009090000009FFFFFFFF9F9F0D99BDAFBFFFFFFFF9F0BCB0BCBC9A9C0F9B0B0A90B0B9FABDA9BDABD0B909A909A0000000000000000000000000000000000000000000090A0B0A00A90A0B0A00A000A0000000090A0000A0A9A9A0D009900000000000000009BFFFFFFFFFFBF9E90B99FDBFFFFF9E90909C909A909B90D0D09909090909DA9DABD09F0CB0D0B0090000000000000000000000000000000009000009099AC9A090B00A0B000F090A00000A00000A9A00009A000A9A0900AC0900900090000000BFFFFFFFFFEDBF9F9CBCBFFFFFFFFDBDB0B90B090DAD0B0B0F0FBCBCBC9A99E9D0F9A9B909A9090000000000000000000000000000000000000000000A09B09A0A00B000A00A9A000000A0000A00A00A00A00A09A90B00990000000900000000FFFFDFFFF9FBCBCBCB99F9FFFFFFFBE909C09C90B090BC9F9BD0090909AD0B9B0B9ADAD0F090CB09000000000000000000000000000000000000000090DA0A090B0A0A9A90AB0000A00A0000090A00000B00009ADAD0C900A000009000000009BFF9BBFF0FBC909099ACBDBFFFFFBD99CB09A9AC9BCBDBBD0F0F9BCB0909ADACBDAD990B090B90000000000000000000000000000000000009000009A9A9009AA00009A0A00FA000000000000A000000A0000A0BA9A9BC9090000000000000009FFFC909FFC0000000990B9BFFFFFADA9090009900909C0FBC900090BCB09099909ADAD09A90009000000000000000000000000000000000000000B0C9A0B0A090B0A000000B0A0A00A0000000A0000000A00000F0F00B0F0900000000000000BFF90090BFF00000000090FDFFFFDFBCB0E99000B090B9F0FE00000090090000090909A9C90DA900000000000000000000000000000000000000090B909A0F9A0A0A9A0B0A0F000000000000A0000000000000A9AA9BD0B09A000090000000009FBCB0009EF0900000090F9BFFFFFBD9099000B9D00900BFF00000000900090B0A9A9A9CB0B0900000000000000000000000000000000000900090900EB09A00B009A9A0000B00000A00000000000000A000A09E090F0ADAD000000000000000FFFFDA9009000000099A9B0FFFFFBC9A090009000BD009FFC0900000000000909D090D9A909000900000000000000000000000000000000000900DAC9B00A9AB0B0A0A9A000F0A0A000A0000000000000A0000ABFAB0F909A9000090900000099FFFBDA9000000900009C9FBFFFFFFE9DA0F009090A9F000F000000000009A0900B09A0900009000000000000000000000000000000000900009A09B00BE9A00A000B000A00B00000A000000000000000000000009AB0F09C00900000A900000ADBFFFFBD0B0900909C9B09FFFFFFBDA9900900D090090900000000009000900B09E99CA909000000000000000000000000000000000000090009000B00B09A90BA00A090A0F000000000000000000A00000000BAA90F9E9A900000009000009BFFFBFDFFBDF0F0A99A9CBFFFFFF9FF9CB09A90A90090F0F090009000090909090C90A900000000000000000000000000000000000000000000900BD0B0A0A9A0000A90A000A00A00000000000000000A00000A0090A9A090090000000000000BFFFFFFBE9E9B9F9DA9DBBDFBFFFFE9CB0C90099009000909CA9900D99CB09AD0B90B909000000000000000000000000000000000000009000000090A0B0A9ACAB0A90A0000B0000000000000000000000000009A0A9ADBE90000090009000090F9FFBFDF9F9E90B099A9FFFFFBFF9FBC9B00900090B0909A99CA990A0909C9A9CA90C00900000000000000000000000000000000000000000090B0A9A0B00AB0000A000000F0000A0000000000000000000000A9A00009009090000000000009FAF9E9ADA0909009AC9E9BFFFFFBFCBB0C9F0F0B09090BC90B99CB990B0B0090900B0900000000000000000000000000000000000000000000000D0A9A0B000B00A9A0A000B0A000000000000000000000000A0A09A90ADB00009B000090009BFF9E9C9090000090D9B9FFFFFDFFFBD0F9A090900000909A9C9A900E90D09F09A9D09A900000000000000000000000000000000000000900009090A9A090A9A00A00000000A000A00000000000000000000000900A0009000909000000000009FFFF9B00000909ADBAFFDFBFFBFFADAF90090000090909AD09ADBCB99E9A000090A00000000000000000000000000000000000000000000000000A9A0B0A9A00A00A0A0000F0A000000000000000000000000A0A000B0009000090900090900BFFFFFFFBDB9FBFFBDF9FBFF9FFFDFBDFE990090900000090BC90090009090909E090909000000000000000000000000000000000000000000909ADA900B000A00000000000B00A000000000000000000000000B0A9000F00B9000A0900000909FFFFFFFFFFFFFF9FBFFFFFFFFFFBFFBF9EBD0A000000000009A9A9CB000000B0900000000000000000000000000000000000000000000000000090A0A9EBA09A0A00000000F00000A00000000000000000000B0000A090090C0909000000000BFFFFFFFFFFFFFFFFFFFBFFFFBFFFFFDFFFDAF99090900900900D00900909090900909090000000000000000000000000000000000000000009A90A9E9A900AA000000A0000A0A00000000000000000000000A000A00000B009B000090000009FFFFFFFFFFFFFFBFFFFFFFFFFFFFFFBFFFBFFFDEF0B009009009009009CB09000000000000000000000000000000000000000000000000000000009A9A0A0A900A000000000F00A00000000000000000000000BA900A00900B00F090009000909FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFBDBCBDA09A09A09A90B00000000000090000000000000000000000000000000000000900009090FA00090000A00000000000B00000000000000000000000000000A900009009009E9A0009009FFFFFFFFFFFFFFFFFFFFFFFBFFFBFFFFFFFFFBFFFFBCBDBC9F0900009090000000000000000000000000000000000000000000000000000900A0900B0A00A00000000000000E00000000000000000000000000B0A00A0000090B00909909009ABFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFADFF9E9B0000090900000900000000000000000000000000000000000000000000000090090DA0B0A90A000000000000000B0A00000000000000000000000A0A000000A9B0090B0BCA00A909FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFDFFB9EBD0090900000000000000000000000000000000000000000000000000000000090000B09A0090A0000000000000000F000000000000000000000000000000000000099AD0D09090900BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFBF9EF9009009090900000000000000000000000000000000000000000000000000009000090DA00B0A000000000000000000A0000000000000000000000000000000000000AC9A90B000009C9BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDBFFFF9DE900900A090000009000000000000000000000000000000000000000000009000090A909A90B0A00000000000000000F00000000000000000000000000000000000090909CB0D0B0009BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFDAF9EB900DA90900000090000000000000000000000000000000000000000000000000000090BC90A00000000000000000000B000000000000000000000000000000000000A90B0B09A90090B0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFBF9F9000B0900090009000000000000000000000000000000000000000000000090000090A9AD00B000000000000000000000E00000000000000000000000000000000000090090DAD0900009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDBDFDBCB090090909000000000900000000000000000000000000000000000000000000000009C90BA0A00000000000000000000B00000000000000000000000000000000000009ADA90B00F009A9BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0BCBD0090B00B09000900900090000000000000000000000000000000000000900000900A90BD090000000000000000000000F00000000000000000000000000000000000A009090BCBD090009FFFFFFFFFFFBFFFFFFFFFFFFFFFFFFBFFFA90F9DB9A090D00900009000000000000000000000000000000000000000000000000000900090F00A0A000000000000000000000A0000000000000000000000000000000000000B0B0F0900B0099BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9FF9DA9C0909A90090000090900900000000000000000000000000000000000009000000000BDA9A9000000000000000000000000B000000000000000000000000000000A00000909C909EBD00B0C9BFFFFFFFFFDBFFFFFFFFFFFFFFFFFFFFBD909EBDA90009009009009000000000000000000000000000000000000000000000000090090009C00B00000000000000A00000000E000000000000000000000000000000000000009ADB090AD009A0FBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9FBDB0F0900B900900000909000090000000000000000000000000000000000000000000009BCA9A0000000000000000000A00000B000000000000000000000000000000000000B0A909F9F9A900999FFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFDA9FADF90009C0000900900000900000000000000000000000000000000000009000090000B00990900A0000000000000000000000A00000000000000000000000000000000000000D0BE9A00DAD090BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFF090F9F90009A9090B0090090090000009000000000000000000000000000000000000009AD9E90E00A000000000000000000000000F00000000000000000000000000000000000B09A909E9F9A909A9E9FFFFFFFF9FFFFFFFFFFFFFFFFFFFDFF09F9F9A900090009000009090000900000000000000000000000000000000000000000000A09009000000000000000000000000000A000000000000000000000000000000000000009E9E9A9C9E90909BDBFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9A9E9ED000909000900900009090000000000000000000000000000000000090000000099D0A9A0A09A00000000000000000000000B00000000000000000000000000000000000A09A909F9E9A90F09BCBFFFFFFFDBFFFFFFFFFFFFFFFFFFFFBC09BDA90909A00090000090900A0900009000000000000000000000000000000000000BCA009C9000A000000000000000000000000E0000000000000000000000000000000000099AD00B0A9E9E90BC0B9FBFFFFFAFFFFFFFFFFFFFFFFFFF9FC99FDA9000090909000909A0009090009000000000000009000000000000090000000090090B0B0A009000000000000000000000000B000000000000000000000000000000000A0A0DAFD099E909E90BD0F9FFFFFFDBFFFFFFFFFFFFFFFFFFFBF009A909009E0009A9000090900000000000090000000000000000000000000000009A0F009CBC000A00A0000000000000000000000B000000000000000000000000000000000090B09A9AC99FA99AD0B9ADABFFFFBFFFFFFFFFFFFFFFFFFFFDE900D0009009900000090900090909009000000000000000009000000000000000000D9009A90B00090000000000000000000000000E000000000000000A000000000000000000000DADADB0E9DAD09BC09BDF9FFFF9FFFFFFFFFFFFFFFFFFFAF099B09000B000909000009090000000000900090000000000000000000090000000B0AD0B0DA00000A000000000000000000000000B00000000000000000000000000000000000A9B0BDB0E9FADA9BCBDBCB9FFFF0FFFFFFFFFFFFFFFFFBF9FD0BC0009009009A900090900A09A9000900000000000000000000000000000000099C090B0DA9A09A00000000000000000000000000A00A0000000000A00000000000000A0000000009CB0F9B09F9E9B0B09ADBFFFFDBFFFFFFFFBFFFFFFFFFF0C0B0B000909000009000009090000900000090000009A0090000000000000000000BDA9C9A000A0000A00000000000000000000000F0000000000000000A0000000000000000000BCA9CBCF0F0BCBCE9CB0DADBFFFADBFFFDFFFFFFBFFFDBDFB09C909009E0900900090900009090000000000000000900009000000009000000B0009A0F9A009A000000000000000000000000000B00000000000000000000A00000A0000000000090B9B0F9E909B99A9CB9A9FFBDBFFDFBFFFFFFFFFFBEFBC9A900000090009000000009090000090009000009000000000000000B0000000909E90D90009A00000000000000000000000000000A0000000000000000000000A000000000A0000B000C0FDA90BCBCAFDB90FDFBDCBFFFFFFFDFFFDFBDFDBC9090B090090909009090909000A9000000000909000A900009000000900000009ADA90F00A0B0000000A00000000000000000000000F00000000000000A000000000000000000000000B0909ADF090DBD9A9E99A9FFB9FFBFFBFBFBFBFDAFBDB0000000090A0000000000000090009000009000A0090000000000000C90000900909E90B00000A00000000000000000000000000000B00000000000000000A00A000A000000000A000000A909ADF0B0FADDA9EBDA9FED9FF9FDFFFFDFAF9DAFCB0090000090900900000900900900000900009090000009000000090A00000009A090E900A9A0000A00000000000000000000000000A000000000000A000A0000000000A000000000A009000A9A0F0F9FAB9C90B9EDB9A9FFFBFADBFFD9EBDB9C090090090000900009000000000000000909000009009000900000090000000AD0F090A90000000000000000000000000000000000F000000000000000000000000000000000000009A009E9C9F9F0F0D0DA9E9C9B9E9FFDBDFDFFDB9A99F9E90000000000900000000009090090009000A000000000000900000090000000990B09A000A00000A0000A0000000A00000000000000A00000000000000A00000000000000000A0000000B0090B00B0F9FAFAD09A9E9E9ADBBEFBF9FBED0FF0F0000900009000000000009000000000000909000009A90000000009A0000900BCAD0A00A00000A00000000000A00000000000000A000B00000000000000000000A0000A00000000000A0000B00090CBCAD9F9A9C90909C9ADF9FDBF0F9A90BD9F00000000090090000000000000000900B00C09090000000900000090000009090A90B009A0000000000000000000000000000000000E000000000000A00A00A0000000000A0000000000A9009E0B09F9AF0DF09ADA9A909B0F9ADAF9E99F9A909090000000000000000000900009000900B000000900090000009000009009E0900A00B0000000A000000A00000000000000A0A0000B000000000000000000000000000000009000A000000B00909ADAD09A09A909C90E90DB0FDBDBC9E9A9DA00000009000000000090000009000A900D09009C90E900000009A0090900DA09A0B09A0000B00000000000000000000000000000000A00000000000000000B00000B000A0000A0A009000B00900C000BEDADBC9CB0009090BC9B0BC9B090DA090000000000000000000000000009090E9A0090A0A900000000000000000B00B0B00A0000A000A0000A0000000000000000000000000B000000000000000A000A0A00000000000009000A000A00B009099A90F0B0CB0B00090BC9D0BC9ADB0900000000000000000000000000900000900900090900900000009000900BC0B0B00F09A9A00000900A000A000A000000000000A000A00E000000000000A0000A00000A0A000A000000A00000000900B00009E90FCB09C0090E909A0BC9A9009000000000000000000000000090000B09A9D0B9E0000B00000009000000F00B000F0A0A000900A0A00090000000000000A000000000000B000000000000000000000000000A000A00A0000000000009009E9E90F0B0D0A900A90000909AD090000900000000000000000000000A09D0DAC9A00000009C00000900A009E900B0BEB0A909A9A0A09000A00A0000000000A00000000000000A0000000000000000A0000A000000090000000A000A000000090090CB0C9CBC9C9FD0009000009E000000000000009000900000009090900B0900090D009E9000000A0909A09A9B0A90090A0A000000A00000000000A000000900000090A0000F0000000000000000000A00000A000A00000009000000A00000B00B0F9B0B09A000AD00000090090000000000900000D009009000A00D0B0090BCBCB00B00000000900000DAD0ACBCA9A0B09000A9A000A00B0000000000000A0A00000000000A00000000000A000000A09000A000A000A000000A00000900000000900C00DAD09FF00000000E9000000000000009CB0000000090909A90DADA90900090000009000009CB090B0B0A90E9ACA0B000009009000A0000000000000000000A00000B0000000000000A00A900A0A000000000000A9A00000000A0000909A0FBC9A90FF000000000090009090000090C9A0000B00BC9A9E9E90CB000000000009009000009B0B0D0A0B009AA900B000A9A00A00A00000A000000000000000A0000000E000000000000000000A90000009A00A0000000000000A09A9000009090B0DCB00F090000090009A0009009000B00909000900BC9009CB0000000000000090A000900C9CB0B0DA9A0900B009A9000000B00A0A000000000A00A0000000000000B0000000000A000000000A00A000000000A0009A0000000000A00000000DAA9CB00009CB00C9AD0909E090CB0000000099E0F9000BCA0000009000000900A90000E9A9A9C9EB0000BCB00A000A0B0A00000900000000000000000000000A0000A0000000A00000A0000A009000A00A09A090A0000A0000000A90000090F09D0BC90B0E90FDBAD0ACBC09A0900D0D0B0F0E90000BC009000090000000900D00090900D0DA9B00B0FB0A00B0B0A090009000A000A000000000000000000A000000F000000000000000A000000A00000000000000A000000000000A0A000A0900A09AD009BE9A0C9AD9C0B0C9009A90BC90090D0E90090000000000090F00B00000A0BDA9A9AC0BCB0000B00000900A00A0A000A0000A0000A00A000A0000000000A00000A0000A000000000A00A000B00A000A0000000000000000000B0900B0D9EDA0D009C9DBC9A0B9CB0EBDADAD00AD000A9000000C009000000A000D000009C9009E9E9A90A0B0B00A9A9A0B00A00090A00000000000000000000000000000B0000000000000A00B00000900A000090A00000000000A00000000000A000A0B0FDAAF0F0A00ADDACB0D90E90000AD000AD00000009A000000000909A0090B00B0F09B09A0A9000A0B0000000000900A0090A90A000000000000000000A00000E0000000A0000B00000A9A0A000000A000000A000009000000000000009A0900B0BDD0D09D099A0BD0E0AD000009000009000000000090000000D0E0090A0C90C90BE0A00900A9A0900B0A0B0A000A000A0000000B0A000A000A0A0A00000000B0000000000A0000A00000000000A0000000000000A00000000000000A0090A0000FABEBEACA0C9C0A9090000000000900000000909000000909A90900C909ADBAF0090B0A0B0009A0A00900009A0009A90A0A00000000000000009000000000A000000000000A0000A9A9A00A000000A00A090A00000000A00000000000A09A9A909C9C9DBD09A09C00CB000000090000000000000000000AC00000D0BCBC9A090B0A000900A9A0009A0A0A9A0009A00A09009A000000000000B0A000000000B00000000000009A000A000B0000000900000A0000000A000000A0000000000000A0A9A0A00BE090A90090F090900A00000000000000000BC9090900A9090BE9AAC090A9A0A90000A00090B0009A000B09A0A000000A00000000009A00A00000E00000000000B0A000009A000000A00A000900000000000000000000000000A00000900909FC9CADC0F00009E000909AD0A000000009CB0000A0AC9E90F0F0B0D0B0A0900900A09000A9E000B0A00A000A0900A00A0000000000A9A000000000B000000000A000000A90A0000A00000000A0A0000000000000000000000000000000A00A0A0BFADB0B09CB0F00C00000009000009ADA00C9CB09C9A90F0BA90A0B0B090A0A0000A0B09A009A00000900B000A90000000000000B0000000000A0A00000000000A0A00000000A000B00A900000000A00A00A00A000000000000000000000009000DADEDE0AC90F9B000000000909BC909F09A90D0B09E9AF0DA09A0000A00000A90000A00B0A90A09A0A00900000000000000000000A0A0000090B00000000000000900A0A090B0000000A00900A000000000000A00A00000000A00000000000B0B0B0BD090000ACBCB09090DADADAFCA9E9CB0AD0FE9E90BA9A09A9A000000000A09A9A00B0AF9A00000A0A000A00000A000A00000900000A000E00000000000000A0A0909A000B0A90000A0000009A000000000000000A0000000A00A0000A0000000ADA0B00D90F0DADAFADADAD9BDE9FADFDAF09A9A00000000009A00000000000A0B00BB0A00B0B00000000000A0000000000A000000000AB0000000000000A000000A0A9A0000A00000A009A00000000000000000000A00000000000000A9A0B0900D0DB0ACB0F9E90D0F9ADAE0BDAD9A0B09A000000B0A00B0A000A90000B0B090A9ACB09A00009000000000000000000A000A000009A9A0000000000A0090B00A9A90000B00090A9000000000A09000000A0000000000A000090A000900000000B09A0D09C9ACBCB0B0ADAD9F0A90A0B0A09A9A9A0000B009000000A0A00000A00A9A0A009A0A0A00A000A0000000000000000000A000B0000000000000A0000000A0A900A00A000A9A0A000000A000000000A00A000000000A00000A00B0A0B00A09A09A009000000D090A009000900000000009A0900A0A0B00000090A9A90A9009009A009000000000000B000000009A90A0000000E000000000000000A000A90090A9000009A9009000A0000000A0009000000000000A0000000000009000900A09A0900A9A009A0A090A0A9A00090A00A00000A000000000A9A9A00000A90A0A00A09A0A9A090000A9A00A000A00A00000000A00B00000000000A00000A900A0A00009A0B00A0A00B00000000000A00A0000000000000000A0000009A0A0A0B09A0A00B00090A09000A909AC0A0A090009A00000009A9A0B0000009A0B00A0909A90A009000A0A090000B000000A90A0000A0000A0000000000000A00000A0900B00A0000A90900000090A00A00000000A00000000000A00009A0A0009090000A909000000A09A00B090A00B009000A000000B00A00000009A0A0A0000B090A0A0A009AA0B000000A00BA0A00000009A00000B00F00000000000000000009A0A00A90B0B00A0A0B000A0000000000000900A0000A00000009000090A0A000B090A000B000000A9A00A0B0B00B0A0B009A000000900A9A0A9A90090A9A00A00000909A090000A90009A0090000000A00000000000A0000000000000000A0A00090B0A00000B090000B00000B0000A00A0000000000000009A0A0900A9000A000A000A000B0B0090000900000B009000A000B0000A00000900A0A9A09A0B090B0B0A0A09A09A090A0A0000A0000A00000000000A00B000000000000000000900B0A0090A0B0000A90A0090A0009A0000000A0000A000000A00000A0A0000009A0090000A00000A0A9A00A0B0B0000A9A9000000A000009A0A9009009A9000A000009009A0BA00A0009000000A0000000A0000A0000E00000000000000000A0B0000B0A0900B0A90A0900A0000A0000090009000090000A900000900900A90A09A000A09000A00090000000000A0A900000B0A00090A0A000000A0A0A0A9A90A0A9A0A0A0BC9A900000A000B000000A0090A00009A0B000000000000000000000A900090A00000000A0000009000000A00A0A0000000A0000000A00A00000000000A000A00900000A000000009090A00A00009000A0900000000090900000A09000000090BA00A0B0A090000A9A00000A000000A000A0000000000000000000A900A9A0A90B0000B000A90A00000A000000900A000A0000A000B00090A90A09A0000090000000A00000B0000A0A0009A90A0A00A000000A09A090A0A0A90B0BA0A0B09A0A09A9000000A000A90000009000000009A0F000000000000000000000A000009A000B00009000000A00900009A000009A00009000A0000A000000000090000A000A000009000000B009009A0009000000B0A00000000A009090A0B0090000A0909A00A9A0A900A0B0A00000000A00000A00A0000000000000000000000A9A9A00B000A0000A00A9000A0000A0000A00000000A000900090A00A09A000A00A000B00000000A00A00000A0A00000A000000000B000A0A0090A00A9B0BA0B0B000A0ADA9000900A09009AB00A00A0000000000B0000000000000000000A09000A9A00A900B00000000000000B0000A900A0090A000A00A0A0000090009A000000000009A00A000000B0000090A9A009A000A0B00A0090900A900A0ABADB00A0B090A900A0B0A0000A0B0BCB000000000000000E000000000000000000000A0009A09A90A000A000000A000000009A000900A000000900900009A0A0A00000A90A900A00000000009000A9000A0009A000A9000BA90A0A0A000A09090BA0AB0000A09A0B000000B00000A9A0000009A00000A00B00000000000000000000000A9A09A00A09000000A0000A00A00A0000A009000000A00A0000A0090090A000000000B00A000000A0A00000A0B090A000000009ABCA0009009A0900A0FA00909A0B09A0B000A09A00A09A9A0A0000A0000000000A0000000000000000000000000DA009A9A0A00000000000000000000900A00A00A9000000A9000000000B0B0A00A00090000A009009A0B00000A90A00000A0A90B009A0A000A0A09A009A0A0900A09AC0B09A09A09A0000090A00000A00A0000B000000000000000000000A9A0A9A000090000A0000A00000000900A00000000000A090A000A9A0A0A00000090090A0A0A00000000000000B0B0A909A000900A9A90A909A09090A09A0A9000A090A09A00A00A0B0000A0B0A00B000000000000E0000000000000000000000009A0009A9A000000000000000A00A0000A900000A0090A009000000900900A0000A00900090B00A0A9A09A0B00A9A0A000A0000000AADA0A00A00A90A0900E9A90AC90A09A90B0900A9A90009AB000A00000A000B0000000000000000000A00A9A009A000000A000000000A0000000A0000A09A0090A00000A900A00A00A900A0090A00B00A009000000A0000A9000000000A0B0A9A90A900000A90A90A0A9A00A9A0A09A00A000A000000A9E000A0000A00000BA000000000000000A000090000B000A00A00000000000000000A09009A00A0000A0000A0000A090900000A09A0A00000A0000A00B0B090B0B0A9A9A9A0090000009AA9A9A9A90A90A09A9A9A900B09A00B090A0009A0B09A9A00000009A00000F000000000000000000000A9A00A0000000000000000000000000A00009090A9000B0900B0090A0A09A9090000090B0009A90000000A0000009A000000A000009A090A00000A90A09A000009A090AA0B00A009000A090A00A9A090000000000AA00000000000000000000A0000000000000000000000000000000000A0A00A00A9A00A0000A000000A00A0A9A9A0A00B0A00A9A9A9A90B0B0B09A9A00B00A00A00B0A9A9A0B00B0B09A9A9A00BA909000B00A0A0B09AB0BA9A000A0B0A0000A9B00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A000A00A000000000000000000000B00B0A00A000A00B000A0A9A000000000A000000000000000000000000000000000000000000105000000000000DFAD05FE, 'Laura received a BA in psychology from the University of Washington. She has also completed a course in business French. She reads and writes French.', '2'); +INSERT INTO employees VALUES ('9', 'Dodsworth', 'Anne', 'Sales Representative', 'Ms.', '1966-01-27 00:00:00', '1994-11-15 00:00:00', '7 Houndstooth Rd.', 'London', null, 'WG2 7LT', 'UK', '(71) 555-4444', '452', 0x151C2F00020000000D000E0014002100FFFFFFFF4269746D617020496D616765005061696E742E506963747572650001050000020000000700000050427275736800000000000000000020540000424D16540000000000007600000028000000C0000000DF0000000100040000000000A0530000CE0E0000D80E0000000000000000000000000000000080000080000000808000800000008000800080800000C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00D999D999999D9D999DB99DD9F9D9D9D99D99D9F9D999BD9FD9D9D9D9D9DFD9F9F9DBDBD9DBD9DB9FD9FDFFFFFFFFFFFFFFFFFFF9D9F9DB9D9DFD9DB9F9BDF9F9D9DBD9BD9F99DBD99999999D9DBDBD9BDDD9F9DBDBD9F9D9D99D9BD999D99D9D99DB99D999D9F9D9F9D9D9999D9B9BDBD99F9D9999D9DBD9FDBDBDBDBDBD9F9D9DBD9D99FD9F9DD9FDD9FFFFFFFFFFFFFFFFFFDBDF9DBDD9F9DBD9DD9DD9D9DDBD9D9DD9D9D99D99999D99D9F9D9D9DD99BD9D9D9D9F9DBD9FD9DD999DB9DBD99D99D999D999D9BD9D9DBDBDD9D9DD9D9DD999999999FD9F9D9FD9D9D9D9F9D9F9D9DBDF99F9DF9F9F9FFFFFFFFFFFFFFFFFFFFD99DF9DB9DF9D9D9F9F9F9F9BD9F99F9F9DBDF9D99D999D9D9D9D9F99BDD9D9F9F9F9D9D9D99BD999999D9D9F99D999999D9F9D9D99F99DD99B9D999D9B99D999D9D99FD9DBDD9DFDBDBD9D9D9F9F9D99DF9FD9FD9FDFFFFFFFFFFFFFFFFFFFFBDF99D9DFD9F9DBD9D9D9D9DD9D9DD9D9D9D99F99999999B9DBDBD9D9D99DBD9D9D9D9F9F9D9D9BD999D9F9D99DBD9D999BD9D99D9D9D999D9D99F9F9D9DB9D9999BD99F9DDB9F99D9DD9F9F9D9D9DBD99D9DBD9FD9FFFFFFFFFFFFFFFFFFFFFD9DDBDB9DBD9F9DBDBDBDBD99F9F99F9F9F9D99D9999D99D99D9D9DBD9F9D99F9DBDBD9D9DBD9DD9F99999DBD9999999F9D9DBD9BDBD9FD9BD99D9D9D9D9D999999D9DFD9F9DD9DF9F9DBD9D9F9D9D9D9FDF9DFD9FDDFFFFFFFFFFFFFFFFFFFFF9F9D9DDBD9F9D9D9D9D9D9FD9D9DF9D9D9DBD9F999999D99D9DBD9D9D9DBD9D9D9D9DBD9D9D9B9D999D9D9D99D9D9999D9F99D9D9D99D99D99F9D99DB999999D9D9DF99F9DDBDF9D9DBD9D9F9DBDBDBDDB9DBD9F9FFFFFFFFFFFFFFFFFFFFFFFD9FDBDBDBD9D9DBDBDF9F9D9BD9F9D9F9F9D9D999D9D999DBDBD9F9DBD9D9F9DBD9F9D9F9DBD9D9D9999BD9F9B99999D99D9D9BD9D9D9BD99D9D9BD99D99D999F9F99FD9DBD9D9D9F9D9DBD9D9D9D9D99DDBDF9DD9FFFFFFFFFFFFFFFFFFFFFF9F99D9D9DFD9F9D9DD9DD9FDD9D9DBD9D9D9DBD999999D99D9D9D9D9DBD9D9D9DBD9F9D9D9D99D9F999D9D9DD9D99999FD9F9D9D9BDBDD9DF99F9D9D9BD99999D9DD9D9F9DBDBDBD9F9F9D9F9F9F9DBD9BDDBDF9FDFFFFFFFFFFFFFFFFFFFFFFDDF9FDBD9DBD9DBDB9F9BD99F9F9D9D9F9DBD9FD999D9BD99D9F9DBD9D9F9DBD9D9D9DBD9F9D9BD9D99999F99D999D9D99D9DB99FD9D99D99DD9D9DB9D9999DBDDB9DBD9DBDDD9D9D9D9DBD9D9D9DBD9FD9FD9DF9FFFFFFFFFFFFFFFFFFFFFFFFBDD9DD9F9D9D9D9DD9DD9FD9D9D9F9F9D9D9D9999D99D9D99F9D9D9F9D9DBD9F9DBDBD9D9DB9D9F99999D9D999999DBDF9D99D9D99D9F9BDDB9DBD9D99D9D9D9B9DBD9DBDDB9F9F9F9FD9D9F9F9F9D9D9FDBDF9DFFFFFFFFFFFFFFFFFFFFFFFFD99F99F9DBDBDF9F9FDB9D99F9F9D9D9DBD9F9D9999D999BD9D9F9F9D9F9D9D9DBD9D9DBD9DD9D9D999D9D9D999D99D99DB9DBD9D9F9D9D99DBD99D9999B9DBDDD9DDF9DF9DDD9D9DD9BDBD9D9D9DBDBDBDDBDFFFFFFFFFFFFFFFFFFFFFFFFFFDFD9FDDBD9D9D9D9DD9DF9FD9D9F9D9F9D9D9F99D9DB9D9D99BD9D9DBD9DBDBD9DD9DF9DBD99F9F9D9999F999999F99D9D9D9D9DBD9D9D9FD9D9D9BD9D99D9D9BD9B9D999F9F9F9F99DD9DBDBDBD9D9D9DBDD9DDFFFFFFFFFFFFFFFFFFFFFFFFF9FD9BDDBD9F9F9F9BD99D9F9D9D9F9D9DB9D9D99B9D99D9DD99F9D9DBD9D9DBDB9F99D9D9F99D9DB99999D99999D9F9F9DBD9F9D9F9F9D99D9DBD99999D9DBDDD9DDBDFD9D9D9D9DF99F9D9D9D9F9F9F9DF9F9FFFFFFFFFFFFFFFFFFFFFFFFFFD9DFDBDD9D9D9D9DD9DF9D9DBD9D9D9BD9D9F99D9D9F99F99D9D9F9DD9F9F9D9DD9DF9F9D9DD99F9D99D9999D9F9D9D9D9D9D9D9D9D99D9F9D9D9D999D9F9D99B9F99D9D9F9F9F9F99F9D9F9F9F9D9D9DF9FDFFFFFFFFFFFFFFFFFFFFFFFFFFFFDBD9DB9F9F9FDBDBDB9DBDBD9F9DBDD9D9F9D99999D9D99D9FDBD9F9BD9D9DBDBDB9D9DBD9B9D9D9999BD999D9DBD9DBD9DBD9DBD9D9F9D9BD9999D9BD9F9FDD9DFDBDBDD9DD9D99D9DBD9D9D9DBD9DBDF99FFFFFFFFFFFFFFFFFFFFFFFFFFFF9DBDFDD9D9DD9D9D9DD9D9D9D9D9D99F9D9DB9D9DF9D99DBD99D9D9DDDBDF9D9D9DD9F9D9D9D9F9D999D9999BD9D9F9D9F9D9F9D9DBD9D9D9DF9D99D9D9DD9BD999DD9D99F9DBDFD9D9D9F9F9D9DBDBD9DFDDFFFFFFFFFFFFFFFFFFFFFFFFFFFFDD9DB9DBDB9F9F9F9BDBD9F9DBD9D9DDB9DD99999DBDD999D9FDBDBD9D9DBDBDB9FD9D9F9DBD9DBD999D99D9D9D9D9DBD9F9D9DBD9D9F9D999999D9D9F9BDD99DF99DBDF9DBD999F9F9D99D9F9FD9D9F9DBFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9BDBDD9D9DD9D9D9DD9D9F9D9D9F9D99D99F9D9DDD99BD9DBD99D9D9F9F9D9DDDD9DF9F9D9D9DBD999D99D9DBDBD9F9D9D9DF9F9D9F9D9BD9D99D9BDBD9DD999F99FD9D9DBD9D9D9D9D9FD9F9D99F9F9FFDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDDD9DB9F9DBDBDF9F9F9FD9DBD9D9F9D9DF999F9B99DD9D9D9FD9DBD9D9D9FDB9BDB9D9DF9DBD9DD999B9B9D9D99D9F9D9F99D9D9D99D9D999D9BD9D9DD9BD99DDD99F9F9D9DBDBDBDBD9BD9D9FD99DFD9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB9FD9D9F9D9DD9D9D9DD9F9DBD9D9F9F99D9D99DDF99DB9D999F9DBDBDBDD9DDD9DD9FD9D99DBDBD99D9D99F9DBD99DBDDDBD9DBDD9BD9F999D99D9F9BDD999B9DF9D9D9DBD9D9D9D9FDD9F9F9FDF9FFDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDD9FD9D9DBDB9F9F9F9BD9D9D9F9D9D9D9F99D999D9F9D9BDDD9D9D9D9DB9F9BDDBDF9BDBD9D99DBD9999DF9D9D9DF9D9F9D9F9D9BD99D99D999DBD9DD9BD99DD99D9F9F99D9BDBDBD99BD9D9D9D99D9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F99F9DBD9DD9D9D9DD9F9F99D999D99DD9DBD9D9D9D9DD9B9DBDBDBD9DD9DDDBD99DD9D9F9DDBD9999DF99DBDBD9D9F9DBD99D9DD9D99D99BD9DDBDBDD999DB9DBD9D9DDBDD9D9D9FDD9F9F9F9BDFFDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D9D9DBD9DBDBDBDBDBD9D9DD9FDF99F9BD9D9DBDBD9F999DD9D9D9D9F9F9F9BD9FDDBDBD9DB9D9D99D99DF9D9D9DBD9D9D9D9F999DB9D99D9D9F9D9D99D99D9D9D9DBDB9D9BDBDBD99BD9D9D9DD9D9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9F9F9D9F9D9D9DD9D99F9F9BD9999D9DDB99F9D99D99DBD99BD9BDBD9D9DDDDBD9F9DD9DBD9DBDBD9DF9D9DBD9F9DBD9F9DBD9DF99D99F99DBD9DBD9DB999BD9DBD9D9D99D9D9D9DFD9F9F9FDBD9FDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDD99DBD9F9F9F9F9FDD9D9DD9DD9D9999D9D9D9DDBDD9D9FD99DD9DBDBDB99FDBD9F9F9D9D9D9D9D9BDDBD9D9D9D9D9F9D9D9D99D999D99D9D9F9D9BD9D99D999D9F9D9F99D9F9F999D9D9D9DD9F9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F9DBD9D9D9D9D9D9DBDBD99F9BD9F9DDF99DBDB9D9BD9D99DDB9D9D9D9DDF9D9DF9D9DBDBDBDFDBDDDBD9F9F9F9F9F9DBD9F9FD9F9D9D9F9D9D9F9D9999D99DF9D9DBD9DBDBD9D9DDBDBDBDB9F9DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9F9D9F9F9F9F9F9F9D9D9FD99D9D9DB99D9D9D9D99D9DB9DB99D9F9F9F9F9F9DF9F9DBD9D99D99DBF9DF9DD9DD9DD9D9D9D9D99D99F99D9D9F9D9D99D999BD99DBD99D99D9D9DBDB9D9D9D9DD9DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9DBD9D9D9D9D9D9F9F9D999D9F9999DF99F9D9F9F9D99D9D9DBD9D9D9D9D9FD9D9FDD9F9DDBDFDDDF9DF99F9BDB9F9F9DBD9D99D99DBD9FD9F9D9DB9D99D9D99D9FD9F99F9F9D9D9F9F9F99F9BDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F9DBDBDBDBD9F9D9D9F9DDF9D9DFD99DF9D9BD9D9DBDDBD9D9D9DBDBDBD9F9BDBD9BD9D9B9D99BDF9DF9DF9DDDDD9D9DD9DBDBD99D9D9D99D9DB999D999D99BD9D99D99D9D9DBDBD9D9D9DF9DDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9D9D9D9D9D9F9DBD9D9DB99D9D999D99D99DD9F9D9D999DB9D9F9D9DD9DBDDD9D9FDDF9DDDBDFD9DDF9DF9DBDB9BDBDB9F9D9D9D9F9DBD9FD999D9D9999F99D9DB9D99DBDB9F9D9DBDBDBD99F9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9DBD9F9F9F9D9D9DBDBD9DD9F99DDB9DB9DB9D9DBDBD9D99D9D99DBDBDBDDB9F9FD9F9DBDBD9D9F9F9F99FDD9DDD9D9DD9D9D9DBD9D9D9D99F9D9D9BD9D99D9D99D9F9D99DD9DBD9D9D9D9FD9DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D9F9DD9D9F9F9F9D9D9DB9D99DB99D9D99DF9F9D9D9F9FD9F99D9D9D9DF9DD9D99F9F9D9DBDBDDFDDDFD9F9DB9FDBDBDF9F9F9D9DBDBDBD99D999D9999D999BDDBD999D9BDBD9DB9DBDBD9BD9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D9DBDBD9D9DD9F9F9F9DF9DF9D9D99FD99D9D9F9D9D999D9D9F9BDBD99F9F9FD9DD9F9FD9DDBDDBDBDBD9DBDD9DD9D9DD9D9D9F9D9D9D9D99DBD99D99BD9FD99D9DDB9D99D9F9D9BD9D9FD9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9DBDBD9D9F9DB9F9D9D9D99D99D9F99D99D999F9D9F9DBDDB9F99DD9D9FD9D9D9DF9BDD9DBDF9DFFDFDDDFDF9D9F99F9F9BDBD9F9D9F9D9DB9D99D9F99DD9D999F99B99D9D9F9D9BDDDBDBD9DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF99D9D9F9D9F9DD9D9F9DBDDBD9D99DB9D99FD9DBD9D9D999D99D999F9D9F9F9DB9DDDBDBDF9DBD9F9F9F9D9DF9DFD9D9DDD99D9DBD9D9F9D99D9999D999B99DD9D9D9D9DBD999DD9B9D9D9F9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDF9DBD9F99D999F9D9D9D99D9B99D99DB9D99F9D9DBD9D9D9D999FD9DBD9D9F9DDBDBD9DD9FDFDFDFDF9FDF9DF9DBDBDB9FDBDD9D9DBD9D9D99F9D9BD9D9D9B9D9D9D9B9D9DDB99DD9F9F9DDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9DBD9D9DDF9DF9D9F9DBDF99DDD9B9D9D99D99DBD9D9F9F9F9DF999D9D9F9D9F99D9DBDBDF9DBDDBDBDFDBDDBDDBDDD9DD99D9BD9DBD9D9F99D9D99D999D99DDB9F9BDD99DB9D9DB9F9D9DBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D9F9F999D99DBD9D9D99DF99BD9D99D999D9F9D9F9D99D9DB9D9F9F9F9DBD9DFDBDDBDD9FFDFFFDFDF9DDBD9F9DB9FDB9DF9DDBD9D9BD99F9999D999F99D999D99D999F99D9DBDD9DBDBDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDDBD9D9FDF9FD9DBDBD9FD99DD9D999F99DB9D9F9D9D9D99D9D9D9D9D9DBD9DBD9DDBDDBDBD9F9DFDBDF9FDF9DF9DD99DD99DB9D9D9DD9D99D9DB9D999D99DBD9D9D9D99D9999D99F9D9DDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D9DBD999D99F9D9DBD99FDB9D9BD9D999D99D9DBD9F9F9F99F99DD9F9D9F9D9F9FDDBDFDFFD009FDFDF9FDF9DF9DFDBDF9DD9F9F9BD9F9D999D9BD9D9D99D99F99B9D9BD9F99F9D9F99FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9DB9DBDDBD9D9D9D9D9D999D9BD99D9D999D9BD9DBD9D9D9DD9DB9BD9F9DD9F9DF9F9DF9FDFF909BDF9FDF9DFD9DBD9D99DB9D9D9DD99D99F9D99D99F99BD9F999D9DB9D9999F9DBD9DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9DD9D99D9FD9F9BD9F9DD99D99D9B9F99DB9D99D9DBD99F9BD9D9D9D9DBDF9FD9FDFD9FDBDF09909FFFDBDFDBDFD9F9FDF9DF9DBD9BD99D9999D99D999D999D9D9D99D99D9D9D9D9FD9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9DB9DBDBD9999D9D9D9DB9DB9D999D99D99D9DF9F9D9F9D9D9D9D9F9DBD99DD9F9DBDFDFDFD90D999DDFDF9FD9DBDD9D99D99D9D99D9DB9D9F99D999D999D9999B9999D9B99F9BD999FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF99D9D9D99DFD9D9BD999D9D9BD9D9D999D9B99D9F9D9DBD9DBDBD9F9DDFDF9FDDFDBDBFDFF0B00D09B9FFD9FF9DBDBDF9FD9F99FD9D9D99D9D9B9DB9D9B9D9F9D99D99D9D99DDBDF9DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9DDBD9D9F9999F9D99F9DB99D99999F99D9D9D9D99DBD9D9F9D9D9D9DB9DBDF9FF9FDFDFFDFC9D9099009DFFD9DF9DD99D99D9DF99F9D99D9999D999D99D9999999DB999999D99D99DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9BDDB9D9D9D99DBD99D9D9D9D9D9BD9DB999DB9DDBD9D9BD9DBD9F9FDDBD9DFD9FDF9FDFFF9B9099C900BD9FDF9DF9FDF9FD9D99D9D9BD9B9D99999999999D9999999DBD9D9BD99F9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D999DB99F99D999D9D99DB99B99D9999D9D99D999D9F9D9DBD9F9D9DBDDFBDBFDBDFDFFFD00E909909009F9FDF9D9D99D99DB9D99D9D99D99D999D9999D9999D99D99999BD99FD9DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9D9F9D9D9D9BD9D999BD9DD9D9999D9D9DB9D9BDDB9D9D9D9D9D9FDBDDBDDFDDFDFFDFDFFB990DA9D0900099B9FF9DFD9DBD9DBD9B999999999D999D99999999999999D9D9D99D99FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9BD999D9999D999DBD9999999D9D9BD9B9D99D99D9D9F9F9F9F9D9FDBD9F9FBFDF9FFDFDF00CB990990DB00009D9F999F9D9D9D99D999D99D9999999999999999999D99999BD9B9DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D9D9F99DBD9DBD99999B9999999BD99D99D9BD99DF9D9D9D9D9FD9FDDFDFDDDBDFDFFFFF9DB000990F00009E90BD9FD9D99F999D99D9999999999999999999999D9999BD9D99DDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD99BD99F9D999999999D9DBD999D99D999DB9D99F999D9F9F9F9D9FD9F9F9FFFFFDFFDFDFDA909090999000090909999DBD999D9999999999999999999999999999999D9999F999FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D99D9999999D999D9999999B99D99D9F99D99D99DDBD9D9DDF9F9DFDFDFDBDFDFDFFFFF09000909090099009000999999D999999999999999999990990999999999999D9D9D99FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF999999D999DB999999D99999D999F9999D999F9D9B9DBDBDB9DF9F9FDBDFDFFDFFFDFFFF909A9090F09D000000900099999999999099999909999999909909999999D99999999DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9D9F9999D99999D99999D99999999D999F9D999F9D9D9D9DDBDDDFDBDF9FFDFFDFFFFF99000000C990B0900900000009999999999909999999099090909999999999999BD9F9BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF999999D99999D999999999D99D9D999D999999D9D9DBDBDDBDDBF9FDFDFFDFFDFFFFD9D9A0009DB0090000000000000000000099999909999999090909090909999999D99999DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9999D99F99D999999999999999999999999D9DBD9BD9D9F9D9FDDF9F9FDFFDFFFF9B9BF9C900E909099009A900000000000000000099909090990000909999999999999999D9BFFFFFFFFFFFFBFFFBFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D9B99999999999999999999999999999999999D9DBDD9FFD9F9DFDFDFDFFFFF99DC9D0900B090000900000000000000000000000000909090000900909099909999999D999DFFFFFFFFBFFBDF9FFDFF9FBF9FFBFFFFFFFFFFFFFFFFFFFFFFFD9999D99999999999999909999999999099999D99D9D9BD9DBFDFF9FFDFFFF999C9A9FF9909090A0990090900000000000000000000000000000000090909909999999999999FFFFFFFBFFFBFFBBFBFFBFBF9FB9BDBDBF9FFBFFFFFFFFFFFFFFF99999999999D9999909999990990999999D99BDF9F9FDFDBDDDBDFFDFFF909F09FDFF990B00B09000990A000000000000000000000000000000009009990999909099999999FFFFFFDF9FBF9BDFFFBBDBDBFBDBF9BBDBFBDFDBBDBFFFFFFFFFFD99D999999999909999999999090909999999D99D9D9D9BDDBFDFDFFB909909DF9BDFF9D09000B0900B90900000000000000000000000000000000900909090999909999999DFFFFBBFFBDFFFBDBFDFBFBDBFBDBFDBDBDBBBFDBFF9BFBFFFFFFF9999999D99909999990990909090990999999D9F9F9FDDBDDFFFF090900090B9C9B9D909000909E9BC09000000000000000000000000000000000009099909909990990999FFFFB9DB9FFBF9FBFDBBDBDBDBDBF9BFBFBDFDBFF9FFF9FBDBFFFF999999999999999909990999999999999999DBD9D9D99FDBF999099000900B0DB0D0B09090D000900990000000000000000000000000000000000000090099099099909909FFF99FBFFFBF9FBF9FBDBFBFBFBDBBDF9F9FBBBF9FBF9BF9F9FFFF999999999999999099900990999999999D999D9F9DBDFDBD9900900090009099090BD99C09BDA90900B0000000000000000000000000000000000000000900909909999990BFFA9B9BDBDBFBDBFB9F9F9FDBDBDFBFBFFBDFDBFBDBFDBFBF9BFF990999999099999990999999999909999B9D9F9DBD9999990000090909090900909D909B000990000090900000000000000000000000000000000000000090090990990999DF999BDBBFBDBFBDBFFBFBF9BFBFB9F9F9FBFBF9F9F9BBDBDBF9DBF9990999999999099909999909099099D99999999900900009000090000900B90F0AD0909990CF909090000000000000000000000000000000000000000000900909999909FB09B0B9F9FBF9FBF9BDBDBFF9FFFFBFFBFDBDBFBFBFDBBF9F9BB9099999999990999990909099999999999999990900000000000000090F900900099D990D9000B9A0000900000000000000000000000000000000000000000000909909999F0090999FDBFBDBDBDBDFBFBF9FF9FBDF9FDBFBFDBDBDB9F9BF9F990909999990999090999999990999999999900000000000000000009099009099B90909900009090BC900000000000000000000000000000000000000000000000000909099F909B9B9BBDBBFBFBFBBDBDBFBFF9FFBFFBFBDBFFFBFBF9FB9B9A990990990999999990090999999990990900000000090909009000009AD090B000F0F909DB09090C9009090000000000000000000000000000000000000000000000099990DB090090BDBBDBDBDBDFBFBFFFDBFBF9F9FF9FF9FB9F9FB9BDBD99A9909909990909099990990999099990900000000000000000000009099A90099099CB90B00000B90B000000000000000000000000000000000000000000000000000000909000909B9BBDBFBFBFBBDFDBF9BF9F9FBFBDFBFFBDFBF9FFDB9BB99909099909999999090990999090000000000000000009000000000000090990AD0F9D09090909909009009000000000000000000000000000000000000000000000000900900909099BDBDBDFBDBDFBBF9FF9FBFBDF9FBFDBDFBF9FB9B9F99DB0909090990909909009099909000000000000000000000090900000909009A099B9FBD09A000009090090000000000000000000000000000000000000000000000000000000000090BDBBFBF9FBFFBFDBF9BBB9BDBBFBDBFFFBDBF9DBFB99A909000909099990909090909000000000000000000000000000000000090A909900CF0DBD9900900B009A090090000000000000000000000000000000000000000000000090000000090B9F9FBF9F9FB9BDBF9DBF9BDB9FBDB9FBF9FBBD9FB99B9B99090990909009000090000000000000000000000000000090090000900DADB999FB909E90A09090090000000000000000000000000000000000000000000000000000000000009099F9FBDBFBFBDBFB9BBB99BDBDBBDBFFFDFBF9FBF9DB090900009009090900090000000000000000000000000000090900000090090B90D00B9D09999909A90090009090000000000000000000000000000000000000000000000000000000009BBFBDBFBDBDBDB9F9D99FB9B9BDBBDB9BBBDB9F9BB999B00909009909000090000000000000000000000000000000000000090A90990F909DCB9090C90090B0009A0000000000000000000000000000000000000000000000000000000000090DBDBFBDBBDBB9F99BB9B999BDB9F9BFFFDFBDBBF9DB090900009000000090000000000000000000000000000000000000090009090A90F90B90909B9090B009000909009000000000000000000000000000000000000000000000000000000099BF9BFBDBF9F9BBD99B9BDB9B9B9F99B9BF9F99FBBDB090900000900090000000000000000000000000000000000000000009009A9909090DFBA9009A90909009000000000000000000000000000000000000000000000000000000000000900BF9FBDBF99B9BD9B9BDBDB9F9F9F9BF9FB9FBFB9F9B9909000000000000000000000000000000000000000000000000090000A909C0B0F9CB9D900B009C00A9000090B0000000000000000000000000000000000000000000000000000000009B9FBDBB9BBBDB9B9BDBDBDF9BF9F9F99B9F99B9FF9B00900000000000000000000000000000000000000000000000090009090909A9099090DF09009A9B90909090000900000000000000000000000000000000000000000000000000000000BDB9FBF9F9D9B9B9F9BDBDBBFDBF9F9FBDB9FF9F9BF9B9000000000000000000000000000000000000000000000000000000000009099BC9F9AD90090900990900A90090000000000000000000000000000000000000000000000000000000000BFBDB9B9BB99D9F9F9BFFDFBFDBFBF9F9DB9BF9F9BF9090000000000000000000000000000000000000000000000000000009090A9AD09AD99FB0909A9B00A00990B000900000000000000000000000000000000000000000000000000000009BDBBDBDB9DB9BB9FFFFDBFFFFFFDFFFBFBF9F9BB9F9B90000000000000000000000000000000000000000000000090000090000BD090BD9FE9F9C90B9A90999F000909000000000000000000000000000000000000000000000000000000009BDBBDB9B99B9FBDFFBDFBFFBDBFFBFF9FDF9F9BD9FBDB00000000000000000000000000000000000000000900000000000000090900B9DAF990FB90B09090F0B0D0B00090000000000000000000000000000000000000000000000000000000ADBDBB9B9DB9F9FF9FFBFFFFFFFFFFFFFFBFFFBDBB9B9F9000000000000000000000000000000000000000000000900000000090009900F9DFD9D0B90D00A90909B00090000000000000000000000000000000000000000000000000000000009B9BDBDB9B9FBF9FFFFFFFFFFFFFFFFFFFFFBDFBD9BDB9B0000000000000000000000000000000000000000009000000090090A9000BD9DF9FA99909DA9B9E909A909000900000000000000000000000000000000000000000000000000000009BFB9B999BDBDFFFFFFFFFFFFFFFFFFFFFFFFFFFFBDB9F900000000000000000000000000000000000000009000009090000AC900B000B0FDFD9C099A9B00990A909090000000000000000000000000000000000000000000009000000000009F9BDB09BBDBFBFFBFFFFFFFFFFFFFFFFFFFFFFBDBDBDB9000000000000000000000000000000000000009000090900C0000909909090999FFF909BB0900090090090B009000000000000000000000000000000000000000000B0F00000000000BF9BD9BD9BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFBDB9000000000000000000000000000000000000000090000F9F0090090A09CBDBC9DFDBD99BB99A90B0000A9C90090000000000000000000000000000000000000000009AF000000000B9BDB9B9BFDBDFBFDBFFFFFBFFFFFFFFFFFFFFFFFFFF9F9B0000000000000000000000000000000000000000009000F0900000990B0909909FF9E9B900A90B900090099000000000000000000000000000000000000000000000090F000000009F9B9B9FBDBFFBFFFFFFFFFFFFBFFBFBFFFFFBFFFFFDFBFD00000000900000000000000000000000000000000900909000B09000D09ADF0F9F9E9900BD9DB00900009A009000000000000000000000000000000000000000000AD0FB90000000F9BBDBDBDBFFFFFFBFFBFFBFF9FF9FFFFFFBFFDFBFFBF9FB9000000000000000000000000000000000000909009B000009090009A9ADB9F9C9E9909F0B0B0900B009009000000000000000000000000000000000000000000909A090CF000009BBD9B9FBFFFBFFBDFBDFBFDBFFBFFBF9FBDFFFBFFFFFFF9FF00000000000000000000000000000000000000A900009090000090BD9DBDE9F999BC9D9F9F9FAB009CA90A90000000000000000000000000000000000000000000090FB9BB000009BB9DB9FBFFFBFFBFFBFDBFF9FF9FFFFFFFBFFFFBFFFFFFBDF0000009B0000000000000000000000000000000090000090900090F09DBDFFCBC9BDAF9B09090B0A990900090000000000000000000000000000000000000009AF9A90FF000009F99FBFFFFDBFDFBFBDFFBFDBFFBFF9F9FBFFDBFFDFBF9F9FFB90000000000000000000000000000000900009090090900000090F9B0BDBD9F99DF999D0909BA9E990000900000000000000000000000000000000000000009E09009EF900009BB9FBDBDBFBFFFBDFDBF9FFBFDBDB9FBFFFDBFFDFBFFFFFFFBDF90000D000000000000000000000000000090000000000009090F9909D0FBFF9CB9CBDB99A90DA9A09BB0A9000000000000000000000000000000000000000B9B090FFF00000099F9BFBFFFFFFBFFBFFFFB9DB99B9F9DBDBFFFFBFFBDBFBF9FFBF0000B000000000000000000000000000009000909090900B090B0FCBDFDDBF9E99ABC9D00B999900909000000000000000000000000000000000000000000000A9FF9000000F9BFDBDBF9FBFDBDFBF9BDB99B9DB9B99BDBDBFFFFFFFFFFF9BDBF00090000000000000000000000000000009000000A009009A9099FF9FBD0F9909B99B09B090A099A0009000000000000000000000000000000000000000000000FB0000009B9F9BFBFFFFF9FFBFDBF9B9FDDFBDFDFFDBDBFDBDBDBDBDBFFFFFDA000000000000000000000000000000000000900909009909090F9FFD9E9FF990BDA9DB0B9090B00090000000000000000000000000000000000000000000009B90000000BDFBFF9FBDBF9FFBF9BD99FDFBFBDBDBBDBFFDFBFFFBFBFFFF9F9FB90000000000000000000000000000090090A9009C090B9A90BCB9DBFFFDFD00ADA9BB0990B0090A900090000000000000000000000000000000000000000000000000000DBB9F9BFDFBFBFFBDBDB9FFFBDBDFFBFFDBF99B9DBDBDBDBF9FFFFFFF909000000000000000000000000000000900090B9F99C9BC999CB990FBFFBD9FB0DAB009B9B09009B000000900000000000000000000000000000000000000900000000BDFBFF9FBDFFDBF9F9BDB99DBFFBFFDBFFFFF9F99B9FB9BDBFBFBFBFDF000000000000000000000000000000000900A90B00B909B0A9BDADBDF9FFFDF9BB90DBBFB9009B9A90000000000000000000000000000000000000000000000000000BDB9F9BFBFBF9BF9F9F999FB9FFBFFFBFFF9FFFFBD099909BFFFDFDFFBF00000000000000000000000000000090000BD0909990BD0B9C99DFDBDFF9FBD9A9B0B9FB9B0B00090000000000000000000000000000000000000000000000000000BDBFFFFFFDFFDBF9F9B999BF9FFBDFFB9FBFFFFBFF900099BFFDBFBFBDFF9000000000000000000000009000000009090B09A9CBD0B909B0F9FFDF9F090BBB0B0B9B0B9090B09A000000900000000000000000000000000000000000000000009BDBF9FBFBFBFB99B9900BDBF9F9B9B9999B99F9BB900009F9FBFFFFFFBFB0000000000000000000000000090000009E90BD0B90B990B0D99F9FFBFFD990BEB09099A9B9A9CB0900090000000000000000000000000000000000000009000000FBF9FFBDBDFDBDB9900090BFB9B9999D9B999999999999F9BBFDBFBDBFDFFD0000000000000000000000000000909090BD0A90F90DA90B090F909DBDB09BDB90A9A9B009DA99A9A900000000000000000000000000000000000000000000000BF9FFFBFFFBFBFB990000099999999BD9B9D9F9B9D9DBFB9BDBDBBDFFFFBFFBB000000000000000000000009000000009D0B9B09A9B09A99FD9EBFBCB0900BB0A909B0DB9A99A9B0000009000000000000000000000000000000000000F90000F9FFB9F9FBDBF99F9B9D999999999F9FBFDBF9F9FBDFBFDBDBDBFDBF9F9FFFD000000000000000000000090000090A9F9AF90C9A9090B9B0F9F9D0099D09B9A9BFA9A9B0F9F0900B000000000000000000000000000000000000000000000000BFBFFFFBDBBDBFB9BDBBDB9FDBFFFFBDB9B9FBFFDFBFDFBF9B9B9B9FBBFFFBFD00000000000000000000000009000900FD0DB9B09B0B0BC9FFCBAB9A90B00B00A9B09A9BB909F9A9B09000900000000000000000000000000000000000B00009F9F9FBDBBD9B99FBDBDBFDFBFDBF9B9B09999B9FBFFBFBDBF9BDB9F9FDBBDFFB0000000000000000000000000A9000909BD909DBCBD9F9B00F9D90090B9F09ABDB090990009AB09000009000000000000000000000000000000000000090000BFBFFBDBDBBF9FB9B9B9F9FBFFBF9F0999F9BD9F9F9FFFDBDB99B9F9F9BDFBFF9A0000000000000000000000090000009F09090F0BDAF9F099FF9E9F9EDE90ABDAC900000090B909A909A0000000000000000000000000000000000000000009F9FDBDBFB9F99B9DBDBFBFBFDBDB9B9BDB99F9B9BFFF9FBDB99F9F9F9BFF9FFFBD00000000000000000009009000909B90999CBD9F9B9B00B09DBDF9A9B99B09A9B9A09A000900B00A0009090000000000000000000000000000000000F0000ABFBFBB9F9F9FBDB9B9F99FDBFBF9B999B9FF9F9F999BF9FB9B9BDBFBFDF9FBFFF9000000000000000000009000900000C9E9A90F9F0909090DABC9FDFF9A9000000F9A090000000B090900A000000000000000000000000000000000009B9B9D9FBDFDB9B9F9FBDB99BFFBF9F9B99999F9FFFFF9F9F9FF9F99F9FDBDBFBF9F9FF9000000000000000000000000090009090909900FD00A9A9FDDBDBFDFDFF0000099A9A00090000000A009900000000000000000000000000000000009F9F9FBFBDBB9BDBF9F9FBF9B99BDBFBF9F9FBFFFFFFFFFFFFFDBB99B9FFBFFFDFFFFFFFF00000000000000000000009000009A90909A09F90B09C9F9FBFF9CBFFFD000999AB00000000009009090009000000000000000000000000000000F0FFBFFBDF9FBDBF9F9FFBDF9F99BDBF9F9F9FFDFFFFFFFFFFFFFFBDB9DFDBFDFFBF9FF9FBDA000000000000000000090000000000BDA9090909090B9BCBD9999F9FFF000000090000900000000000090000000000000000000000000000000099FBDFBDBBFBDBF9BFBF9FFBF9F9999FB9FFFFBFFFFFFFFFFFFFFF999BFBFFFFBDFFFFFFFFF900000000000000000000000900909909C90000B009BD0D9FB09A9DFFDF00009000000900000A0009A09A90090000000000000000000000000000B9FFBFFBDBDBF9FFDBDFFBDFFFFFB9B9DB9FFFFFFFFFFFFFFFFFFFB9F9FFFFFFFFFFFFFFFFFF0000000000000000000009000000E99F9E9090DB0D0F999D0BC90BDBBF009000F009A00009A900000900000000000000000000000000000000009FF9FB9DBFBF9FBDBFFBDFFBDFF9FF99B9FFFBDFFFFFFFFFFFFFF999FFFFFFFFFFFFFFFFFBFB000000000000000000000000090090FCB909FA90DB990D09F09BD9ADDF00009A9E00090000000090900000000000000000000000000000000000FFBFB9FBF9FDBFFBFFFFFBFFFBFFF9F999FBDFFFFFFFFFFFFFFFDBFFFFFFFFFFFFFFFFFFFFDF90000000000000000009000900090BDBDE9EBD9DBC0099B9F90F9090BF00000909A090000A000000A0900900000000000000000000000000000BDBDBDB9BDBFBF9FFDBFDFF9FFFFFFFFBF99FBFFBFFFFFFFFFFFBF9FFFFFFFFFFFFFFFFFFFFFFB00000000000000000000900000C9090B9F9D909DF9B009D0BD0F9009909A900009909000900000090090000000000000000000000000000000FBFFFBDBDBDBDBFBFFFFBFFFFFFFFFFFFFBF9F9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFF0000000000000000000000000B00B09090B0B90BDFDFF0990BDF0B9C900000B09000009A000000909000000900000000000000000000000009BDFB9FB9BBFBFFFDFFFFFFFFFFFFFFFFFFFFF9FBDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDB00000000000000000090900909900B0D909009CFFDF90B09090909B90000B00A09009A9A0000900A09090000000000000000000000000000BDFBDB9B9FDBDBDBFFBFFFFFFFFFFFFFFFFFDBFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF90000000000000000000009A9009909B09A9F9BB9BB9090909AB0F090000090900B000090090A909000A0000000000000000000000000000FBFFB9FDB9BFFFFFFFFFFBFFBFFFFFFFFFFBFFBDBFDFFFFFFFFFFFFFFFFFFBDFFFFFFFFFFFFFFFDBF00000000000000009000909A0B00B09DB90909C900A9CB9B090F9B0B000A000900B0B009A09C90090909090000000000000000000000009FF9F9BB99B9BFFBFBFDFFDFFFFFFFFFFFDFFF9FFFBFFFFFFFFFFFFFFFFBFFFFBFFFFFFFFFFFFFFBDB00000000000009000090A909909E9F0DCBDADBBF99CB90C09A9CBD900B0900009A0900B00909A90A000000000000000000000000000000FB9B9BDBB90FFDBFFFFBFBFFFFFFBFDBFFBFFBFFBDFFBFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFF9BD0000000000000000000090F0A9F9909B9FD9F0D90FFDADB9A9FB90B0B0B00B09A09A0B0A9CA90090090B09000000000000000000000009FBDB9F9F90F9FBFDF9FFFFFBFFFFDFBFF9FFBDF9FFF9FFFFFFFFFFFFBF9FBDFFBFBFFFFFFFFFFFF99B0000000000000000900B0909DB9A90B0DFBFFDBDDF9A9B90DFF9CF00009B009090A9A090B0909A0000000000000000000000000000000FF9B90BB099BFFFFBFFBF9FFFDBFBBFFDBFB9FBFF9FBFFFFFFFFFBFDBDBF9FB99F9FBFFFFFFFFFFFB0F900000000000000000900B0A9009C909B0D9DBDFBFDF90DB90FDB9BB0A0B90000B009A00AB090900B09090000000000000000000000009B9B9909B009FBFFFBFFFFBDFFFFDFB9BDBDBDB9BFDFBDFFFFFFFFFBFB9B999B99BDF9FFBFFFFFFFD9B0000000000000000900990990BDB9A9C9B90DFFFDBDB090D99DB0C90000B00909CBA90BFB90B009A00A00000000000000000000000000F9090909009B9FDBDFF9FBFFBF9BB99B9A9B9B9F9BBFDBFFFFFFFDBD9BD9B9BDB9F9BFBFDFFFFFFFB9F9000000000000090009A090AD0B0D90B000BFF9DBDF9D09FD9A9D9A0A9B0BF0BABADBA9A90A9A9A90909000000000000000000000000BB0900090909FFFBFFBFFBFDBF9BD99F999999909BDF9BFFFFFFFBBFBB99B9BD9BDBBFFDFFFFFFFFF90B000000000000000009009DAD9B0909090B9D99DA9DB09BDF9099A900000B09B0F9FBCBB9A90B9A9A0A9A900000000000000000000000990909000000B9FFBFF9FDFBDBF9B9B9A9F9B099B9B9FFDFFFFFFDF999B90990B9A9D9BBFBFFFBFFF9F9B0000000000000090090B09B00B09A9090099CBDFF090D9FF9009A900A9AB0B0BB0FB9A9A00B00B90900A000000000000000000000000990D0909009DB9FDFBFBFBFB9B09B999B9999B9090B9BBBFFFFFBFF0909FB090090B99999B9FFFFF0B900000000000009000BC909E9F90F090B0FA9DBDBDBD090D9DAD0DDFA09A90B0B90BFFA9A9B000B00B00B9000000000000000000000009A9BB9A90000BFFBFB9F9B9999099090909ADB909B99F9FDFFFFFDB9B90BD09000009000DB9F9FFFF9909000000000000000009A90909EB90B09C9909D9EFDB0099FF99BBF909BA9B0B00AFFF900F0A0000B090000000000000000000000000909F9F9090009F9BDF9F9B990000000000009F0009099BDBBFBFFFB909090B00009000009A9DBFFFFF000000000000000000999090F009B9CBC9FBF09F9BD900090FF9CA090B0A0900A9AB0BBFEBBFF0B00B0BA9A9000000000000000000000090B9B09000009BFFBFBFBDBDB000000000000B990090B9BDFFFFBDBDB90900000000000DB9BFFFFFFB00000000000000009000A9A90B9009B9FBC9DBD0D0BDB90B9ADB999E99B000B00A9A90DFFCBFFFCFA9ADBCDA0000000000000000000000909B990900000DBDBDBF9BFB9F900000000000009009CB9B9FBFFFFBD09090900000A9B90999FBFFFF90000000000009000B99C909D0B90D0909FBC99999D90090DFFDBC99A9000A00A9A9ABBB9BFFFFBB0FFFFBB090000000000000000000000990000000000BBF9BFDFF9F9B9090900000009000999B9FBFDF9FBDBB9009909A9B9900B9FBDFFFFD000000000000000090009A9E99C0D0B09A90BD9DAD09D9FFFFDFDBDA900B090BB9A9B9009A9BBBBDFFFF0FD000000000000000000000009000900000009BD9ABDBB9B9B909B00090090000A9B0B9F9F9FBFBDB990B000099000099DBF9FBFFFB0000000000009009009B09090F9DB900090BD90B909FFFFDBFBFBC9D0900FBA9E0F000BA000909BABB9FBFA000C000000000000000000090900000000009BBD9B9090909B909B90900900990999B9FBFBDBDBBDB999990009099A9B90FBDFFF90000000000000000A900909090F909909AD9099D90FFDF9A9009DBDB09A9A9E9BBA9A00B00A0009900A90B909A9A9000000000000000000BA9000000000099B9900000000090909090099099B0DB999F9BFBDB9FBC9A99000900909B990B9FFF900000000000000900B09A9F090F9009C9FFFF09CBDFBDF9FFF0909D900FBFBFADBAC9AD0B00B0A00000000000000000000000000000000990000000009B9B000090090009000000009009A909B9FBF9F9BDB9F99B990090000909090BFDFFB900000000000000B009C90D909BD90F9FDFDF9099DF9FDF9FDBD0F909090BB09A9B0B9AB0B0000000A0090900000900000000000000000000000000000009000099B000090000000000009090DBDB9F9BDBDBDBBDA90909000900009ADFDBFF9F0000000000000900909B0B09F0FFFDFFBBBFD90FF9FBF9BDBC9F9CB099BCBB000A90A9000000000009A00A00090A09000000000000000000000000000000900B0B0F90000000000000000909A9B9F9F9B9B9BD9BD99A90A90A009D099BFF9FB900000000090000900A90D0B009099A999C0DBE9D9FC99C90990F9F9F09BB000000000B00B0000009009A0900009000000000000000000000000000000000000999909B0000000009009A90B99BDB9B9F9F9B9B9BBFBDBD9F99FDA9FBE9BDBDB0900000000000000B009A909B09909DBCB990D90FD9B00BDB0BD9E9F9F90BB000000000000000000A0000F0CB0000B00000000000000000000000000000000090B0B9B0900909909D09BDB909F99BDBDB9B909DAD990BDBF9FF9BDB9099FB0B900000000000000B0090090B099A0F909909A99099BD09D909090BDBD090000000000000000000000000FFFFF0A009000000000000000000000000000000000009099099000090009A9B09909B9B0F9B9B9DA99B99BFBF9F9FB9BDB90B9F099900000000000000900D09B09C9AC9990B9C90D0000BD0BC9E9AD09990090900000000B00000000000009AFFFFFFDA000000000000000000000000000000000000009A9B0B9000009A999090B90909B9BDBDA99900909999B9F90909909909B900900000000000000090A000B9E9BE9E900B0B09B0909D99F9FDBD000B9AD0000000000A000000000000ADFFFFFFFDF0000000000000000000000000000000000000090990900000090B99B9000090090B9B9BB9000B00B9F9BFB9000B09090B9B0000000000000009A99090099099F9E99090909909F90D9F9ADBD900DBD9000000BA9000000000000A9FFFFFFFFFB000000000000000000000000000000000000099090000009000909A909900009099A9D9009909909D0BD99000B99A90B090000000000000090000090DB0F0BD9F9E0A9DA9A0DBDA9909C9FF9A9DBC9B00000B0000000000000B09ABBBFFDEBF0000000000000000000000000000000000000000000000090090009909B00009009F99A90900CB090B9F9B09009909090900900000000000000909B00B0909D0A9FDBD0BC909B009D09DBFDBD09A9990000000B0000000000000A000900BFBD900090000000000000000000000000000000000000000000090099000909F90000909B990090B99B009B99090B090B900009000000000000000B00909099A9909900BDA9F9F0B09B9B90BDFF90B09A90900000A0B00000000000B000000000BA00000F000000000000000000000000000000000000000000909009900B909900090B0DA909009A9C900FB900909A9009090000000000000000009A0B0B090DA90990FFDB0F9BDBC900D90FF9F9DA9DAD9000000000000000000B00000AC09A09009FF000D00000000000000000000000000000000000000B090B9000990B9B0090099B9900099DBB9099900B09090900000090000000000000000909090B0990DA0BFFB0FF09ADBDBDF0990FDFFFDA99000000000A00090000000000BCB0A09009EB09A9A0000000000000000000000000000000000000909099000B0909900000909090009A9A99090B09099B090000009000000000000000090900B0F099A9099FFFFDF99DF9FDFDBD90F9E9FFFF90B0000A0009A00A00000000000B0909A000BDB0000000000000000000000000000000000000000009000000909A9000000009A9000099999090F9009B09000000000000000000000000000A90999CBEDA99E9FF9A9F0BDF9F0BD0B09D90F9FFD9000009A0000B00B00000000009A000090000F09E90000000000000000000000000000000000090009090900909909000009090B00000000BC90B9009B9900000000000000000000000009000E0B99FBDADFEBD099090B90D9DB990B0B0BCBFBCB000000000000B000000000B00000000009B09E900B000000000000000000000000000000000009000000090B000B00009000990009099B9B999009B00000090000000000000000090000090990FCBDAF9B9FA9FA0B09099FF9F99C9909B9C9BD00000B00000B00000000A0000000000000ADA0B000000000000000000000000000000000000000009090909909900009009090900009A9090000009909009000000000000000000009009A000BDBDBF90FFFDFF999009FDF0B90A99A0F0DB9CB0000B0000A00000000A00B0000000000009A9BCBD00000000000000000000000000000000000009000000900000900009000000000009090B09000000000009000000000000000000000009B90FFB090B09FBFFF0A9B099DBDA990BD99F9C9B000000A9000000000000B0000000000A0009AC9BCBE90000000000000000000000000000000000000090000B900000000090000090090000090090000090900000000000000000000000900000B9FDE909FF9DFFFFD00FC9FDBDA99EBE9FFBCF900B0090A0900000000000000000000900009B0FBDB0000000000000000000000000000000000000000090900009000000000000000009090009000000000000090000000000000000090090900FFB90BEFFFFFFDFA9FBDBDBC9F9A9D9FFBCBDA0000A0A9A00000000000000000000B0090000090B000000000000000000000000000000000000000090000909000090A90000909B0000009000000000000090000090000000000900900A00009BFF90B99FFFFFBFDFFDF9D99F909DB0B99F9FD0000000090000000000000000A0A00000000000000000000000000000000000000000000000000000000900009090090D09900A9099009000900000000000000000A900000000000A00090909A09FCB0FA9FF9F9BFDFB9D0D90D9E9FD9FA9CBB00A9A90A0000000000000000090900B09000A00000000000000000000000000000000000000000000000090000B090090B09F9009AC990B090009000000000000000000000000900909000090900BFDFDFFFFFF099F0DB990FDFDBF9F009B090000000A9A00000000000000000A0A900A0B009000000000000000000000000000000000000000000000090000000009A999A90990990B09000900000000000000009000090000000000A900A00009FFFFFFFFDBF0FBDBC9DBDB9AD9FA9B0DBCB0000B0009000000A000000000A9090A90900900B0A900000000000000000000000000000000000000000000009909009900999A009A909009000000000000000000000000000000090090099C9000FFFBFFFFBF09ADF09DB999ADB0B9D09A9A900000B000000000000A9A0000000000000B0A00090C9000000000000000000000000000000000000000000000009090009B0B0D90090090900B00000000000000900000000000000000009A0B00000BFDBFFBCD99DBDFD909E90BCBDBA90909000A0000000000000000B0B000000A090A0090900A9A0A9000000000000000000000000000000000000000000000000990099090B009900A0909090000000000000000000000090090009009C0F9009F0FCB9FB90A99FFBDB09BD999CDB0900F00000B000A00000A09A9A9000000A00009000000B00909000000000000000000000000000000000000000000000000900B0000B09090A9090000000000000000000000000000000000900090B90B000A9BB9ED09BD9E9FD9DBD09E9CB90F09B09000B00A090000009A9A00000000090A0000000000900000000000000000000000000000000000000000000000000000900909909000909000090000000000000000000000000909000009A900AD000D9000B90F0BF9DFF90909F9FF90B90FCBF0000B09A0000000A00000000000000900090A0900000000000000000000000000000000000000000000000000000090090000090B0900000900000000000000000000000000000A000B00009090B00BEFF99099D00FBDFF9A909FDBB09A99BFD000000A9A0000000B0000A000000A00A90A090000000000000000000000000000000000000000000000000000000000009009A900009000000000000000000000000000000000009000090BCB009009FFFE9F0AFBD0FBD9C90F09FD0BC9EB09F00A000900000000000A09090000090090000000090B00000000000000000000000000000000000000000000000000000000900009000090000000000000000000000000000900900090900C9009A09FFFFFF0BDFFFB9DB09DF9909ABDBF90FF9000000A0000000B0BA900A000000000000909090A0000000000000000000000000000900000000000000000000000000000000900000000000000000000000000009000000000009A000A090B0090CFFFFFFF9BFFB09A09DBBD0F9FDFFF0FFDB000000000A9A0000000B9000000000B0B000A9A900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090909A90DA09BFFFFFFB0A9FFFF990B00BDF0BFBDBF9BFD0000000B00000B0B09A0A00A0000A00009A90000090000000000000000000900090000000000000000000000000000000000000000000000000000000000000000000900000000900090000FB0D0CFFFFFFF99C909FBA909BDDFB90DDF09F09F0000A9A00000A000A009000009A90000A0000B0F00009000000000000000B0000000000000000000000000000000000000000000000000000000000000000000000000000000000000A90BD00FBFFFFFFFF9AFB09BF9B0FBCBFB90FBE9BFADF9000009A9A00B900B000000000A000009090A90C9000000000000000000900009000000000000000000000000000000000000000000000000000000000000000000000000000000009090C90BDBDFFFFFFFFFDF90BE9F9FB9B9B09A9F9FDEDBD9000A9A0009A0AB00000A00000090B000A0900BFAF0900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B0B09EFF9FFFFFFFFFFB099FFFFFC9009ADA990B9B0B900000000000900000A090A9000A000A09A0B0FDFBC0000000000000000000900A00000000000000000000000000000000000009000000000000000000000000000000000000000009A9090E9B09FFFFFFFFFFFF909FDFF99F9B0999009009D000009A9A9A00000000900000000900009A900A9EBD9A90000000000000000900009000000000000000000000000000000000000000000000000000000000000000000000000000900000F0B900BE9ADFFFFFFFFFFF09B9A9E9009E000D0DB0A99090A000A000A00000A0A000A000A00A0F00B9F9F0A000000000000000090000900000900000000090000000000000000000900000000000000000000000000000000000000000009C9B009000099FFFFFFFFFFFFFF09A9D9BD9F9B0B0B90D99A0A00BB09000090A09000A9090B009090B0B000A09090000000000000000A0000000000000000000000000000000000000000000A9000000000000000000000000000000000000000B0090009000A9BFFFFFFFFFFFFF0D9AD0F90F090D0909F0900000BA00000A090A0090A0A00B0A000000B099A09A9000000000000000090000000000000090000000000000000000000000000C0900000000000000000000000000000000000009F00900000090CFFFFFFFFFFFFBB0BDB90F90BDABB09F0F00000B09A000090A090B0A900B000000000900A099A000000000000000090000000000000000000000000000000000000000000090B000000000000000000000000000000000A00090090A009000009BFFFFFFFFFF90990BD9F90B909D0BC9F990009A9A90000A009AA09000B00B090000A0009BEA090000000000000000000B0000000000000000000000000000000000000000A0000000000000000000000000000000000090000B90090900090B00B9B9F9BF990A00AD0D00B0D0B0B0BB09A000A000000A900A090B009A09A000A0B009A9A099000000900900000000000000000000000000B00000000000000000000000900000000000000000000000000000000000000900900F000009000090009A9A90A00000999A900B0B0B099CB90900900000000009A00000A9A09BA0900B90009A0A000000000000000000000009000A0000000000900B0000000000000000000009000000000000000000000000000000000000000909900000B09000000009A9000000A09009B0B909A0B90900A00A00A000A0BA90000A9A90A0900A90A0B0A090900909000000000009000900A0900000000000A0000000000000000000000000000000000000000000000000000000000009009A90A00000090B0000000000000000090B9A0BDA90F9EB00B0000000000009A9A00900000B0B0A009A909AD0000000000900000000000000009000C00900000090000000000000000000000000000000000000000000000000000000009A90A900009000099E900000000A0000000900BD00B9BBDBDB9B0B9A0A900000000A9B00A0009A9ADA90B0A9E9A9A09000B0000A900000000000000000009000000000000900000000000000000000000000000000000000000000000000000000009009F09C009A09A000000009A0A0000A0090900A9FBF00B99CB0900A0A000A09AF0B9A90A000B0A9E9B0B0B09A0B00000B0000000000000000000000A00009000000000000000000000000000000000000000000000000000000000000009009090009A909090990000000000900A000909B0909A9B99ACB0900A0B0009A09AB0BB0B00A9A9AB09EB0A9AF0F09000909000009000000000090000090000000000000000000000000000000000000000000000000000000000000000090090A9ACADA9090B0009A0000000000A0A900F90AD090009A90B99090B009A9A9A0BBA9BB0B00B9A9AB9BA90909A9B0A0090A000009000000000000000000000900000000000000000000000000000000000000000000000000000000000000A0B009090909000D090F00900000000009000F0099090A09000B09A90BB09A9A9A9BF09A9A90BA9A9A9BE9BB0BBA9A0909A00009A90A0000000000000000000000000000000000000000000000000000000000000009000000000000000000A909090F0F09A9009A9090B9A900000000A0B0B09B009F000A0009A9C9A99BA9A09AB0BBE9A9A009A9A9A9BA9AF0F0F9A000000900000090000090000000000000000000000000000000000000000000000A000000000A00000000000000000900900C0909F9C9A009CB0B09000000000000000AC09A00F99000009A90DAB09AB0AF9FB0BB9A9A9AA9B0FA99BF9BB9A090A90900A90090000090000090000000000000000000000000000000C0B0000000F000000AD0000000000000000000000000B0B0B090B0D09A90090000000000009A00099B00999A000000F9E9A99BAB90B9BA9BB0A9A9AB9BEBB9BAB0BB00A9000000A090000000900A0000009000000000000000009FD000000009000000009A00C0F0000090000000D0090F00009009E9C90D090BDB0B009090B0000000000A0000B0A0A90DA000009B00B9BDA9F0BFAFB9A0B09A9AB9A9B9BA9B9B009A90A09090900009A909A90090000000900000009000000000A9A90A0000A90000A00C909A00000A000000A009A0009090A9009A9A9A9AD09CB0DA90A090A00000000000B0090900A90DB00000BB0A9A9ABB0B9BA9BA9A0FB9EB9ABA9B0B09ADADA90000A009A90000A000900A9009A0000000000000000009000000900900C000DEF00AC90C900000000009009F0B00A900B00909A9C9A90BDB09A990A909A00000009A0B9A0A90900090B0000DB9E909A9BFBA9B0900BB0BB9A9B9A9A9A09A9A9A009A90A0000009009A0A900000090B090000000000000000000000C0ADBDEFFFFFDFFEFF0E90C09CA900A900909A9C090090B090B90DB9009AD00B00000900000A00BCA09D000999E90000BA9A99BA9ABB09A0A00BBCBB9ABB9A9A000BA9A0B009000000000A0009A00909A0B00000000000009000000000900000B0D0A0B0F9B9BF99B9A90F90CB9C0090E9ADAD0B9A09A000DA9E9B0009090A9090009A0009000B0B09B0A009A09A000009090A09A909A00090B0BBB0B09AB0B09A9000090A00A0000090009A000900A090090A0900000000000000000009A0900E90C9C9AD0A000A009A90A0B00B9EA090909A90090099A9A990009D00A0900A00B0009A00A9A00A9A090A9C9B00900000A0B9BB9A9A90000A9B0BFBBB090A0B09A9A9A0900000000A0A90000A00A900A90A090A09A9000000A00090000090A0900B0BACB0BC9A90000009090B0009CB0F0B09A9AC9A00909E99A90B0090A90900099009A09A9A90A9A0090BC9B0090B00900A90A9A00A00A90A9B0B000A090A0A000000A0B0900B000000000900000B0009000900000090090000000000C909E9F0909B0BCB000000000A0A00F0B0B090B0DA9090B09A0B090A909990009000A90A00900B0A09AF0A9A90B09A000A000A0A90AB9B0B000000A9A0B09A0000A90000000B0B00A000000000A90A0000000000A09A0A9A00000009090AD0F9A9EB09A0F0B0A9A90B000000A9090B0B0009ABC9A9CA9A09AD9099AD9A0D009000A090009B0B0B0B0BA9A9A90A09900B0090A9090A90A0B0090000000B0A00900B00B000000000A90B00A90B00000000000000B09A0090090A00F00A0A900B00909C9A9B0F9A9CB0000A00000CA0A9009A9AD0B9DAB9A9A090ADA090AD9A9000A0090A9B00900B0B9E9A9ADA90900B0090A90A00A909BA900A0A09A0B0B0B0A0B0B0000009A0B0A000090000000000000A00000A090A0B0A9000009090A909BAF0A90BCA9A0DA90B0000900B0B0B0AB0A9A0B90BA90FAD0B0B99990B9AD9D09090BA9009B09B0F9AB9A90A9AAD0BD0B0000A90B00A9A900A00090A09000B0B0B0B0B0A90B0000090B0A00A00000000000000A0909A909009E9E9A9A0B09B0A0D0BDAF0B9E9BB0AB0B090A0000A90BC9A9ADB0A909EFBDABCB00A0CB00909A9090B090B9E90BCBBAB9A90A9A9B0B09B0B0B09A00009AB0A0009A0A900A0BCB0B9A9A009AA0A09A9AA0090090A0A00A009A90A90A0A00A009A9A90000B0AB0A99BAFAFDAF0B0B0B90009AA909AB9AB0BA9E9B0F9F0BFBDEBDBB0BDB99A90B099E90909E9A9B9E9B0BDAB0A9ADB0B09A0B0000A0000B090900B0A090A9009EBDB0A9A9A9A0909A00A90B0A00A00909000A00A90A9009A90B0A9A90A9A9CBF0B9A0009FFFFDB0BCB0ADABA90AA000A9CB09A9B0BB0BFBDFF9FAFCB0B0F0B000F9A999A9A9AB0B0BA0B9A90BCB0BA9E9A9F0A00000B000A9A0B0009AA90A0A0BEFFB9A9A9A9A0B00B00A9A9A9A0B0A0A0000B00A90A9000000B0B0A9000A909B009A0B0FFFFFEF0B0B0B09AB909B0B0AB0B0B0A90A90B0FBFFFFFBFB09990B909A9AABC9BDB9F9F9BB0BBA9AB0B0BB0BDA9B09A09000009A0B0B0B009A0090B9FF9EBF9A90A9A00B00B00B0BE9B0B0B09A9000B0A900000B0B0B0B00A909ABA09A0090BFFFFFFFF0B0A0BE90EBA0B0B90A9A0B9AB9AB0BBCFBDFFFF0F0B0F9EB0DB999BA9ABA9ABA90B90A9B0B0B00B0A9A9A000A00A09A9A9A0B0A9A00B0A9EFFEFF0A9AA90B0B00B0AB0B90BCB0A09A00A0B009A00A0B0B0B0B09A90A0B009A00B0BFFFFFFFFF0B099A9ABB90B9A00A9A0B90A9CADFADFFEFFFFFFFF0BBFB9DBBFBEBDB9A9B9A9BBA0A90A9A9A9A9A90BE090B00909ADB9A9A0A9A9A9A9BBFBFFFFFF009AB0B0FA0B00F0AB0B0A90A0B0900ABA9A99A0BCB0B0A000A9B0B0A90B0A9EFFFFFFFFF0B0A9A9A9EB0A9B09A090AB9BBFFFFFFFFFFFFFFFF909B9A9BFB9B9AFA9A9A9A9009000B0B0000000A90B0A0B0A0A9B0000909A0B0B0F0FCFFFFFFFBA90B0E90B00A9A90BCABCA9A90AA9009A9A0A9A9B0B0F9B0B0A0B0B0B0A9BB9FFFFFFFFFACB0A9ADA90B0A9AA9AA900BCBFFFFFFFDFFFFFFFFB009A909B9EBB9B9ADAB0BAB00000000B0090009A90B00009A9ABBB0B0A00B0FFFBFBFFFFFFFFEDBA9A9A000F9A9AC0A90A9A9EB90ABBE9A9B0A9ACBCB0A0F0B9BD0A9A9B0BCBFFFFFFFFFF9A09ADA9AB0B0A09A90A0BFBFFFFFFFFFBFFFFFFF000A9CB0BFB9EB0F9A90B09000000000000A000000A00B0BA9A9A90A0009ADFFFBCFFFFFFFFFFFB0000000E9A0AC0A900E90A9A90AF909A9A0A900B0B0B09A0BCB0B9B0BADBF9FFFFFFFFFFE9FA9A90E09A9E9AADA9FFFFFFFFFFFBFDFFFFFFF00090B0BDA9A99B00B0BA9A900000000000909000090B0BCBDA909FFBB0ADAFFFFFDFEFFFFFFFF00F00000000B0B00A0000B0A90A90AFABC09000E0E0F0E00F0B0B0A0B09AF9EFFFFFFFFFF9A00E0A090ACBFFF9AFFFFFFFFFFFFFDFEFFFFFFF0000B090B9B9A00A90B0900000000000000000000000BCBF0B0000FFCFB0BFFFFFBEBDFFFFFFFFF00A00A00A0C00C00CA900D0A9CA90090B0A000009A9A9E00BCBC90BCBB9EF9BFFFFFFFFFFDA909C0AC9ACFFFFFFFFFFFFFFFFFBFF9FFFFFFFB000000000009A90000000000000000000000000000A0B0FF00000FFFB0FFFFFFFDFFFFFFFFFFFE0000000000A00A00A0CA00AC0A0CA0E00000000E0F0F00F0CB09A9E900CBDEDFFFFFFFFF0A0E0A0A00A0FFFFFFFFFFFFFFFFFFDE9FFFFFFFF0000000000000000000000000000000000000000000090DADB0000FFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000000000000B0F00E00A90B0000A9BFFFBFFFFFFFFFF00000000000FFFFFFFFFFFFFFFFFFFBFFFFFFFFF0000000000000000000000000000000000000000000000BFF00000000000000000000000000105000000000000AEAD05FE, 'Anne has a BA degree in English from St. Lawrence College. She is fluent in French and German.', '5'); + +-- ---------------------------- +-- Table structure for `order details` +-- ---------------------------- +DROP TABLE IF EXISTS `order details`; +CREATE TABLE `order details` ( + `OrderID` int(11) NOT NULL, + `ProductID` int(11) NOT NULL, + `UnitPrice` decimal(19,4) NOT NULL DEFAULT '0.0000', + `Quantity` int(11) NOT NULL DEFAULT '1', + `Discount` float NOT NULL DEFAULT '0', + PRIMARY KEY (`OrderID`,`ProductID`), + KEY `OrderID` (`OrderID`), + KEY `ProductID` (`ProductID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of order details +-- ---------------------------- +INSERT INTO `order details`VALUES ('10248', '11', '14.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10248', '42', '9.8000', '10', '0'); +INSERT INTO `order details`VALUES ('10248', '72', '34.8000', '5', '0'); +INSERT INTO `order details`VALUES ('10249', '14', '18.6000', '9', '0'); +INSERT INTO `order details`VALUES ('10249', '51', '42.4000', '40', '0'); +INSERT INTO `order details`VALUES ('10250', '41', '7.7000', '10', '0'); +INSERT INTO `order details`VALUES ('10250', '51', '42.4000', '35', '0.15'); +INSERT INTO `order details`VALUES ('10250', '65', '16.8000', '15', '0.15'); +INSERT INTO `order details`VALUES ('10251', '22', '16.8000', '6', '0.05'); +INSERT INTO `order details`VALUES ('10251', '57', '15.6000', '15', '0.05'); +INSERT INTO `order details`VALUES ('10251', '65', '16.8000', '20', '0'); +INSERT INTO `order details`VALUES ('10252', '20', '64.8000', '40', '0.05'); +INSERT INTO `order details`VALUES ('10252', '33', '2.0000', '25', '0.05'); +INSERT INTO `order details`VALUES ('10252', '60', '27.2000', '40', '0'); +INSERT INTO `order details`VALUES ('10253', '31', '10.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10253', '39', '14.4000', '42', '0'); +INSERT INTO `order details`VALUES ('10253', '49', '16.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10254', '24', '3.6000', '15', '0.15'); +INSERT INTO `order details`VALUES ('10254', '55', '19.2000', '21', '0.15'); +INSERT INTO `order details`VALUES ('10254', '74', '8.0000', '21', '0'); +INSERT INTO `order details`VALUES ('10255', '2', '15.2000', '20', '0'); +INSERT INTO `order details`VALUES ('10255', '16', '13.9000', '35', '0'); +INSERT INTO `order details`VALUES ('10255', '36', '15.2000', '25', '0'); +INSERT INTO `order details`VALUES ('10255', '59', '44.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10256', '53', '26.2000', '15', '0'); +INSERT INTO `order details`VALUES ('10256', '77', '10.4000', '12', '0'); +INSERT INTO `order details`VALUES ('10257', '27', '35.1000', '25', '0'); +INSERT INTO `order details`VALUES ('10257', '39', '14.4000', '6', '0'); +INSERT INTO `order details`VALUES ('10257', '77', '10.4000', '15', '0'); +INSERT INTO `order details`VALUES ('10258', '2', '15.2000', '50', '0.2'); +INSERT INTO `order details`VALUES ('10258', '5', '17.0000', '65', '0.2'); +INSERT INTO `order details`VALUES ('10258', '32', '25.6000', '6', '0.2'); +INSERT INTO `order details`VALUES ('10259', '21', '8.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10259', '37', '20.8000', '1', '0'); +INSERT INTO `order details`VALUES ('10260', '41', '7.7000', '16', '0.25'); +INSERT INTO `order details`VALUES ('10260', '57', '15.6000', '50', '0'); +INSERT INTO `order details`VALUES ('10260', '62', '39.4000', '15', '0.25'); +INSERT INTO `order details`VALUES ('10260', '70', '12.0000', '21', '0.25'); +INSERT INTO `order details`VALUES ('10261', '21', '8.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10261', '35', '14.4000', '20', '0'); +INSERT INTO `order details`VALUES ('10262', '5', '17.0000', '12', '0.2'); +INSERT INTO `order details`VALUES ('10262', '7', '24.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10262', '56', '30.4000', '2', '0'); +INSERT INTO `order details`VALUES ('10263', '16', '13.9000', '60', '0.25'); +INSERT INTO `order details`VALUES ('10263', '24', '3.6000', '28', '0'); +INSERT INTO `order details`VALUES ('10263', '30', '20.7000', '60', '0.25'); +INSERT INTO `order details`VALUES ('10263', '74', '8.0000', '36', '0.25'); +INSERT INTO `order details`VALUES ('10264', '2', '15.2000', '35', '0'); +INSERT INTO `order details`VALUES ('10264', '41', '7.7000', '25', '0.15'); +INSERT INTO `order details`VALUES ('10265', '17', '31.2000', '30', '0'); +INSERT INTO `order details`VALUES ('10265', '70', '12.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10266', '12', '30.4000', '12', '0.05'); +INSERT INTO `order details`VALUES ('10267', '40', '14.7000', '50', '0'); +INSERT INTO `order details`VALUES ('10267', '59', '44.0000', '70', '0.15'); +INSERT INTO `order details`VALUES ('10267', '76', '14.4000', '15', '0.15'); +INSERT INTO `order details`VALUES ('10268', '29', '99.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10268', '72', '27.8000', '4', '0'); +INSERT INTO `order details`VALUES ('10269', '33', '2.0000', '60', '0.05'); +INSERT INTO `order details`VALUES ('10269', '72', '27.8000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10270', '36', '15.2000', '30', '0'); +INSERT INTO `order details`VALUES ('10270', '43', '36.8000', '25', '0'); +INSERT INTO `order details`VALUES ('10271', '33', '2.0000', '24', '0'); +INSERT INTO `order details`VALUES ('10272', '20', '64.8000', '6', '0'); +INSERT INTO `order details`VALUES ('10272', '31', '10.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10272', '72', '27.8000', '24', '0'); +INSERT INTO `order details`VALUES ('10273', '10', '24.8000', '24', '0.05'); +INSERT INTO `order details`VALUES ('10273', '31', '10.0000', '15', '0.05'); +INSERT INTO `order details`VALUES ('10273', '33', '2.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10273', '40', '14.7000', '60', '0.05'); +INSERT INTO `order details`VALUES ('10273', '76', '14.4000', '33', '0.05'); +INSERT INTO `order details`VALUES ('10274', '71', '17.2000', '20', '0'); +INSERT INTO `order details`VALUES ('10274', '72', '27.8000', '7', '0'); +INSERT INTO `order details`VALUES ('10275', '24', '3.6000', '12', '0.05'); +INSERT INTO `order details`VALUES ('10275', '59', '44.0000', '6', '0.05'); +INSERT INTO `order details`VALUES ('10276', '10', '24.8000', '15', '0'); +INSERT INTO `order details`VALUES ('10276', '13', '4.8000', '10', '0'); +INSERT INTO `order details`VALUES ('10277', '28', '36.4000', '20', '0'); +INSERT INTO `order details`VALUES ('10277', '62', '39.4000', '12', '0'); +INSERT INTO `order details`VALUES ('10278', '44', '15.5000', '16', '0'); +INSERT INTO `order details`VALUES ('10278', '59', '44.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10278', '63', '35.1000', '8', '0'); +INSERT INTO `order details`VALUES ('10278', '73', '12.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10279', '17', '31.2000', '15', '0.25'); +INSERT INTO `order details`VALUES ('10280', '24', '3.6000', '12', '0'); +INSERT INTO `order details`VALUES ('10280', '55', '19.2000', '20', '0'); +INSERT INTO `order details`VALUES ('10280', '75', '6.2000', '30', '0'); +INSERT INTO `order details`VALUES ('10281', '19', '7.3000', '1', '0'); +INSERT INTO `order details`VALUES ('10281', '24', '3.6000', '6', '0'); +INSERT INTO `order details`VALUES ('10281', '35', '14.4000', '4', '0'); +INSERT INTO `order details`VALUES ('10282', '30', '20.7000', '6', '0'); +INSERT INTO `order details`VALUES ('10282', '57', '15.6000', '2', '0'); +INSERT INTO `order details`VALUES ('10283', '15', '12.4000', '20', '0'); +INSERT INTO `order details`VALUES ('10283', '19', '7.3000', '18', '0'); +INSERT INTO `order details`VALUES ('10283', '60', '27.2000', '35', '0'); +INSERT INTO `order details`VALUES ('10283', '72', '27.8000', '3', '0'); +INSERT INTO `order details`VALUES ('10284', '27', '35.1000', '15', '0.25'); +INSERT INTO `order details`VALUES ('10284', '44', '15.5000', '21', '0'); +INSERT INTO `order details`VALUES ('10284', '60', '27.2000', '20', '0.25'); +INSERT INTO `order details`VALUES ('10284', '67', '11.2000', '5', '0.25'); +INSERT INTO `order details`VALUES ('10285', '1', '14.4000', '45', '0.2'); +INSERT INTO `order details`VALUES ('10285', '40', '14.7000', '40', '0.2'); +INSERT INTO `order details`VALUES ('10285', '53', '26.2000', '36', '0.2'); +INSERT INTO `order details`VALUES ('10286', '35', '14.4000', '100', '0'); +INSERT INTO `order details`VALUES ('10286', '62', '39.4000', '40', '0'); +INSERT INTO `order details`VALUES ('10287', '16', '13.9000', '40', '0.15'); +INSERT INTO `order details`VALUES ('10287', '34', '11.2000', '20', '0'); +INSERT INTO `order details`VALUES ('10287', '46', '9.6000', '15', '0.15'); +INSERT INTO `order details`VALUES ('10288', '54', '5.9000', '10', '0.1'); +INSERT INTO `order details`VALUES ('10288', '68', '10.0000', '3', '0.1'); +INSERT INTO `order details`VALUES ('10289', '3', '8.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10289', '64', '26.6000', '9', '0'); +INSERT INTO `order details`VALUES ('10290', '5', '17.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10290', '29', '99.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10290', '49', '16.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10290', '77', '10.4000', '10', '0'); +INSERT INTO `order details`VALUES ('10291', '13', '4.8000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10291', '44', '15.5000', '24', '0.1'); +INSERT INTO `order details`VALUES ('10291', '51', '42.4000', '2', '0.1'); +INSERT INTO `order details`VALUES ('10292', '20', '64.8000', '20', '0'); +INSERT INTO `order details`VALUES ('10293', '18', '50.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10293', '24', '3.6000', '10', '0'); +INSERT INTO `order details`VALUES ('10293', '63', '35.1000', '5', '0'); +INSERT INTO `order details`VALUES ('10293', '75', '6.2000', '6', '0'); +INSERT INTO `order details`VALUES ('10294', '1', '14.4000', '18', '0'); +INSERT INTO `order details`VALUES ('10294', '17', '31.2000', '15', '0'); +INSERT INTO `order details`VALUES ('10294', '43', '36.8000', '15', '0'); +INSERT INTO `order details`VALUES ('10294', '60', '27.2000', '21', '0'); +INSERT INTO `order details`VALUES ('10294', '75', '6.2000', '6', '0'); +INSERT INTO `order details`VALUES ('10295', '56', '30.4000', '4', '0'); +INSERT INTO `order details`VALUES ('10296', '11', '16.8000', '12', '0'); +INSERT INTO `order details`VALUES ('10296', '16', '13.9000', '30', '0'); +INSERT INTO `order details`VALUES ('10296', '69', '28.8000', '15', '0'); +INSERT INTO `order details`VALUES ('10297', '39', '14.4000', '60', '0'); +INSERT INTO `order details`VALUES ('10297', '72', '27.8000', '20', '0'); +INSERT INTO `order details`VALUES ('10298', '2', '15.2000', '40', '0'); +INSERT INTO `order details`VALUES ('10298', '36', '15.2000', '40', '0.25'); +INSERT INTO `order details`VALUES ('10298', '59', '44.0000', '30', '0.25'); +INSERT INTO `order details`VALUES ('10298', '62', '39.4000', '15', '0'); +INSERT INTO `order details`VALUES ('10299', '19', '7.3000', '15', '0'); +INSERT INTO `order details`VALUES ('10299', '70', '12.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10300', '66', '13.6000', '30', '0'); +INSERT INTO `order details`VALUES ('10300', '68', '10.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10301', '40', '14.7000', '10', '0'); +INSERT INTO `order details`VALUES ('10301', '56', '30.4000', '20', '0'); +INSERT INTO `order details`VALUES ('10302', '17', '31.2000', '40', '0'); +INSERT INTO `order details`VALUES ('10302', '28', '36.4000', '28', '0'); +INSERT INTO `order details`VALUES ('10302', '43', '36.8000', '12', '0'); +INSERT INTO `order details`VALUES ('10303', '40', '14.7000', '40', '0.1'); +INSERT INTO `order details`VALUES ('10303', '65', '16.8000', '30', '0.1'); +INSERT INTO `order details`VALUES ('10303', '68', '10.0000', '15', '0.1'); +INSERT INTO `order details`VALUES ('10304', '49', '16.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10304', '59', '44.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10304', '71', '17.2000', '2', '0'); +INSERT INTO `order details`VALUES ('10305', '18', '50.0000', '25', '0.1'); +INSERT INTO `order details`VALUES ('10305', '29', '99.0000', '25', '0.1'); +INSERT INTO `order details`VALUES ('10305', '39', '14.4000', '30', '0.1'); +INSERT INTO `order details`VALUES ('10306', '30', '20.7000', '10', '0'); +INSERT INTO `order details`VALUES ('10306', '53', '26.2000', '10', '0'); +INSERT INTO `order details`VALUES ('10306', '54', '5.9000', '5', '0'); +INSERT INTO `order details`VALUES ('10307', '62', '39.4000', '10', '0'); +INSERT INTO `order details`VALUES ('10307', '68', '10.0000', '3', '0'); +INSERT INTO `order details`VALUES ('10308', '69', '28.8000', '1', '0'); +INSERT INTO `order details`VALUES ('10308', '70', '12.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10309', '4', '17.6000', '20', '0'); +INSERT INTO `order details`VALUES ('10309', '6', '20.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10309', '42', '11.2000', '2', '0'); +INSERT INTO `order details`VALUES ('10309', '43', '36.8000', '20', '0'); +INSERT INTO `order details`VALUES ('10309', '71', '17.2000', '3', '0'); +INSERT INTO `order details`VALUES ('10310', '16', '13.9000', '10', '0'); +INSERT INTO `order details`VALUES ('10310', '62', '39.4000', '5', '0'); +INSERT INTO `order details`VALUES ('10311', '42', '11.2000', '6', '0'); +INSERT INTO `order details`VALUES ('10311', '69', '28.8000', '7', '0'); +INSERT INTO `order details`VALUES ('10312', '28', '36.4000', '4', '0'); +INSERT INTO `order details`VALUES ('10312', '43', '36.8000', '24', '0'); +INSERT INTO `order details`VALUES ('10312', '53', '26.2000', '20', '0'); +INSERT INTO `order details`VALUES ('10312', '75', '6.2000', '10', '0'); +INSERT INTO `order details`VALUES ('10313', '36', '15.2000', '12', '0'); +INSERT INTO `order details`VALUES ('10314', '32', '25.6000', '40', '0.1'); +INSERT INTO `order details`VALUES ('10314', '58', '10.6000', '30', '0.1'); +INSERT INTO `order details`VALUES ('10314', '62', '39.4000', '25', '0.1'); +INSERT INTO `order details`VALUES ('10315', '34', '11.2000', '14', '0'); +INSERT INTO `order details`VALUES ('10315', '70', '12.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10316', '41', '7.7000', '10', '0'); +INSERT INTO `order details`VALUES ('10316', '62', '39.4000', '70', '0'); +INSERT INTO `order details`VALUES ('10317', '1', '14.4000', '20', '0'); +INSERT INTO `order details`VALUES ('10318', '41', '7.7000', '20', '0'); +INSERT INTO `order details`VALUES ('10318', '76', '14.4000', '6', '0'); +INSERT INTO `order details`VALUES ('10319', '17', '31.2000', '8', '0'); +INSERT INTO `order details`VALUES ('10319', '28', '36.4000', '14', '0'); +INSERT INTO `order details`VALUES ('10319', '76', '14.4000', '30', '0'); +INSERT INTO `order details`VALUES ('10320', '71', '17.2000', '30', '0'); +INSERT INTO `order details`VALUES ('10321', '35', '14.4000', '10', '0'); +INSERT INTO `order details`VALUES ('10322', '52', '5.6000', '20', '0'); +INSERT INTO `order details`VALUES ('10323', '15', '12.4000', '5', '0'); +INSERT INTO `order details`VALUES ('10323', '25', '11.2000', '4', '0'); +INSERT INTO `order details`VALUES ('10323', '39', '14.4000', '4', '0'); +INSERT INTO `order details`VALUES ('10324', '16', '13.9000', '21', '0.15'); +INSERT INTO `order details`VALUES ('10324', '35', '14.4000', '70', '0.15'); +INSERT INTO `order details`VALUES ('10324', '46', '9.6000', '30', '0'); +INSERT INTO `order details`VALUES ('10324', '59', '44.0000', '40', '0.15'); +INSERT INTO `order details`VALUES ('10324', '63', '35.1000', '80', '0.15'); +INSERT INTO `order details`VALUES ('10325', '6', '20.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10325', '13', '4.8000', '12', '0'); +INSERT INTO `order details`VALUES ('10325', '14', '18.6000', '9', '0'); +INSERT INTO `order details`VALUES ('10325', '31', '10.0000', '4', '0'); +INSERT INTO `order details`VALUES ('10325', '72', '27.8000', '40', '0'); +INSERT INTO `order details`VALUES ('10326', '4', '17.6000', '24', '0'); +INSERT INTO `order details`VALUES ('10326', '57', '15.6000', '16', '0'); +INSERT INTO `order details`VALUES ('10326', '75', '6.2000', '50', '0'); +INSERT INTO `order details`VALUES ('10327', '2', '15.2000', '25', '0.2'); +INSERT INTO `order details`VALUES ('10327', '11', '16.8000', '50', '0.2'); +INSERT INTO `order details`VALUES ('10327', '30', '20.7000', '35', '0.2'); +INSERT INTO `order details`VALUES ('10327', '58', '10.6000', '30', '0.2'); +INSERT INTO `order details`VALUES ('10328', '59', '44.0000', '9', '0'); +INSERT INTO `order details`VALUES ('10328', '65', '16.8000', '40', '0'); +INSERT INTO `order details`VALUES ('10328', '68', '10.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10329', '19', '7.3000', '10', '0.05'); +INSERT INTO `order details`VALUES ('10329', '30', '20.7000', '8', '0.05'); +INSERT INTO `order details`VALUES ('10329', '38', '210.8000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10329', '56', '30.4000', '12', '0.05'); +INSERT INTO `order details`VALUES ('10330', '26', '24.9000', '50', '0.15'); +INSERT INTO `order details`VALUES ('10330', '72', '27.8000', '25', '0.15'); +INSERT INTO `order details`VALUES ('10331', '54', '5.9000', '15', '0'); +INSERT INTO `order details`VALUES ('10332', '18', '50.0000', '40', '0.2'); +INSERT INTO `order details`VALUES ('10332', '42', '11.2000', '10', '0.2'); +INSERT INTO `order details`VALUES ('10332', '47', '7.6000', '16', '0.2'); +INSERT INTO `order details`VALUES ('10333', '14', '18.6000', '10', '0'); +INSERT INTO `order details`VALUES ('10333', '21', '8.0000', '10', '0.1'); +INSERT INTO `order details`VALUES ('10333', '71', '17.2000', '40', '0.1'); +INSERT INTO `order details`VALUES ('10334', '52', '5.6000', '8', '0'); +INSERT INTO `order details`VALUES ('10334', '68', '10.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10335', '2', '15.2000', '7', '0.2'); +INSERT INTO `order details`VALUES ('10335', '31', '10.0000', '25', '0.2'); +INSERT INTO `order details`VALUES ('10335', '32', '25.6000', '6', '0.2'); +INSERT INTO `order details`VALUES ('10335', '51', '42.4000', '48', '0.2'); +INSERT INTO `order details`VALUES ('10336', '4', '17.6000', '18', '0.1'); +INSERT INTO `order details`VALUES ('10337', '23', '7.2000', '40', '0'); +INSERT INTO `order details`VALUES ('10337', '26', '24.9000', '24', '0'); +INSERT INTO `order details`VALUES ('10337', '36', '15.2000', '20', '0'); +INSERT INTO `order details`VALUES ('10337', '37', '20.8000', '28', '0'); +INSERT INTO `order details`VALUES ('10337', '72', '27.8000', '25', '0'); +INSERT INTO `order details`VALUES ('10338', '17', '31.2000', '20', '0'); +INSERT INTO `order details`VALUES ('10338', '30', '20.7000', '15', '0'); +INSERT INTO `order details`VALUES ('10339', '4', '17.6000', '10', '0'); +INSERT INTO `order details`VALUES ('10339', '17', '31.2000', '70', '0.05'); +INSERT INTO `order details`VALUES ('10339', '62', '39.4000', '28', '0'); +INSERT INTO `order details`VALUES ('10340', '18', '50.0000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10340', '41', '7.7000', '12', '0.05'); +INSERT INTO `order details`VALUES ('10340', '43', '36.8000', '40', '0.05'); +INSERT INTO `order details`VALUES ('10341', '33', '2.0000', '8', '0'); +INSERT INTO `order details`VALUES ('10341', '59', '44.0000', '9', '0.15'); +INSERT INTO `order details`VALUES ('10342', '2', '15.2000', '24', '0.2'); +INSERT INTO `order details`VALUES ('10342', '31', '10.0000', '56', '0.2'); +INSERT INTO `order details`VALUES ('10342', '36', '15.2000', '40', '0.2'); +INSERT INTO `order details`VALUES ('10342', '55', '19.2000', '40', '0.2'); +INSERT INTO `order details`VALUES ('10343', '64', '26.6000', '50', '0'); +INSERT INTO `order details`VALUES ('10343', '68', '10.0000', '4', '0.05'); +INSERT INTO `order details`VALUES ('10343', '76', '14.4000', '15', '0'); +INSERT INTO `order details`VALUES ('10344', '4', '17.6000', '35', '0'); +INSERT INTO `order details`VALUES ('10344', '8', '32.0000', '70', '0.25'); +INSERT INTO `order details`VALUES ('10345', '8', '32.0000', '70', '0'); +INSERT INTO `order details`VALUES ('10345', '19', '7.3000', '80', '0'); +INSERT INTO `order details`VALUES ('10345', '42', '11.2000', '9', '0'); +INSERT INTO `order details`VALUES ('10346', '17', '31.2000', '36', '0.1'); +INSERT INTO `order details`VALUES ('10346', '56', '30.4000', '20', '0'); +INSERT INTO `order details`VALUES ('10347', '25', '11.2000', '10', '0'); +INSERT INTO `order details`VALUES ('10347', '39', '14.4000', '50', '0.15'); +INSERT INTO `order details`VALUES ('10347', '40', '14.7000', '4', '0'); +INSERT INTO `order details`VALUES ('10347', '75', '6.2000', '6', '0.15'); +INSERT INTO `order details`VALUES ('10348', '1', '14.4000', '15', '0.15'); +INSERT INTO `order details`VALUES ('10348', '23', '7.2000', '25', '0'); +INSERT INTO `order details`VALUES ('10349', '54', '5.9000', '24', '0'); +INSERT INTO `order details`VALUES ('10350', '50', '13.0000', '15', '0.1'); +INSERT INTO `order details`VALUES ('10350', '69', '28.8000', '18', '0.1'); +INSERT INTO `order details`VALUES ('10351', '38', '210.8000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10351', '41', '7.7000', '13', '0'); +INSERT INTO `order details`VALUES ('10351', '44', '15.5000', '77', '0.05'); +INSERT INTO `order details`VALUES ('10351', '65', '16.8000', '10', '0.05'); +INSERT INTO `order details`VALUES ('10352', '24', '3.6000', '10', '0'); +INSERT INTO `order details`VALUES ('10352', '54', '5.9000', '20', '0.15'); +INSERT INTO `order details`VALUES ('10353', '11', '16.8000', '12', '0.2'); +INSERT INTO `order details`VALUES ('10353', '38', '210.8000', '50', '0.2'); +INSERT INTO `order details`VALUES ('10354', '1', '14.4000', '12', '0'); +INSERT INTO `order details`VALUES ('10354', '29', '99.0000', '4', '0'); +INSERT INTO `order details`VALUES ('10355', '24', '3.6000', '25', '0'); +INSERT INTO `order details`VALUES ('10355', '57', '15.6000', '25', '0'); +INSERT INTO `order details`VALUES ('10356', '31', '10.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10356', '55', '19.2000', '12', '0'); +INSERT INTO `order details`VALUES ('10356', '69', '28.8000', '20', '0'); +INSERT INTO `order details`VALUES ('10357', '10', '24.8000', '30', '0.2'); +INSERT INTO `order details`VALUES ('10357', '26', '24.9000', '16', '0'); +INSERT INTO `order details`VALUES ('10357', '60', '27.2000', '8', '0.2'); +INSERT INTO `order details`VALUES ('10358', '24', '3.6000', '10', '0.05'); +INSERT INTO `order details`VALUES ('10358', '34', '11.2000', '10', '0.05'); +INSERT INTO `order details`VALUES ('10358', '36', '15.2000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10359', '16', '13.9000', '56', '0.05'); +INSERT INTO `order details`VALUES ('10359', '31', '10.0000', '70', '0.05'); +INSERT INTO `order details`VALUES ('10359', '60', '27.2000', '80', '0.05'); +INSERT INTO `order details`VALUES ('10360', '28', '36.4000', '30', '0'); +INSERT INTO `order details`VALUES ('10360', '29', '99.0000', '35', '0'); +INSERT INTO `order details`VALUES ('10360', '38', '210.8000', '10', '0'); +INSERT INTO `order details`VALUES ('10360', '49', '16.0000', '35', '0'); +INSERT INTO `order details`VALUES ('10360', '54', '5.9000', '28', '0'); +INSERT INTO `order details`VALUES ('10361', '39', '14.4000', '54', '0.1'); +INSERT INTO `order details`VALUES ('10361', '60', '27.2000', '55', '0.1'); +INSERT INTO `order details`VALUES ('10362', '25', '11.2000', '50', '0'); +INSERT INTO `order details`VALUES ('10362', '51', '42.4000', '20', '0'); +INSERT INTO `order details`VALUES ('10362', '54', '5.9000', '24', '0'); +INSERT INTO `order details`VALUES ('10363', '31', '10.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10363', '75', '6.2000', '12', '0'); +INSERT INTO `order details`VALUES ('10363', '76', '14.4000', '12', '0'); +INSERT INTO `order details`VALUES ('10364', '69', '28.8000', '30', '0'); +INSERT INTO `order details`VALUES ('10364', '71', '17.2000', '5', '0'); +INSERT INTO `order details`VALUES ('10365', '11', '16.8000', '24', '0'); +INSERT INTO `order details`VALUES ('10366', '65', '16.8000', '5', '0'); +INSERT INTO `order details`VALUES ('10366', '77', '10.4000', '5', '0'); +INSERT INTO `order details`VALUES ('10367', '34', '11.2000', '36', '0'); +INSERT INTO `order details`VALUES ('10367', '54', '5.9000', '18', '0'); +INSERT INTO `order details`VALUES ('10367', '65', '16.8000', '15', '0'); +INSERT INTO `order details`VALUES ('10367', '77', '10.4000', '7', '0'); +INSERT INTO `order details`VALUES ('10368', '21', '8.0000', '5', '0.1'); +INSERT INTO `order details`VALUES ('10368', '28', '36.4000', '13', '0.1'); +INSERT INTO `order details`VALUES ('10368', '57', '15.6000', '25', '0'); +INSERT INTO `order details`VALUES ('10368', '64', '26.6000', '35', '0.1'); +INSERT INTO `order details`VALUES ('10369', '29', '99.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10369', '56', '30.4000', '18', '0.25'); +INSERT INTO `order details`VALUES ('10370', '1', '14.4000', '15', '0.15'); +INSERT INTO `order details`VALUES ('10370', '64', '26.6000', '30', '0'); +INSERT INTO `order details`VALUES ('10370', '74', '8.0000', '20', '0.15'); +INSERT INTO `order details`VALUES ('10371', '36', '15.2000', '6', '0.2'); +INSERT INTO `order details`VALUES ('10372', '20', '64.8000', '12', '0.25'); +INSERT INTO `order details`VALUES ('10372', '38', '210.8000', '40', '0.25'); +INSERT INTO `order details`VALUES ('10372', '60', '27.2000', '70', '0.25'); +INSERT INTO `order details`VALUES ('10372', '72', '27.8000', '42', '0.25'); +INSERT INTO `order details`VALUES ('10373', '58', '10.6000', '80', '0.2'); +INSERT INTO `order details`VALUES ('10373', '71', '17.2000', '50', '0.2'); +INSERT INTO `order details`VALUES ('10374', '31', '10.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10374', '58', '10.6000', '15', '0'); +INSERT INTO `order details`VALUES ('10375', '14', '18.6000', '15', '0'); +INSERT INTO `order details`VALUES ('10375', '54', '5.9000', '10', '0'); +INSERT INTO `order details`VALUES ('10376', '31', '10.0000', '42', '0.05'); +INSERT INTO `order details`VALUES ('10377', '28', '36.4000', '20', '0.15'); +INSERT INTO `order details`VALUES ('10377', '39', '14.4000', '20', '0.15'); +INSERT INTO `order details`VALUES ('10378', '71', '17.2000', '6', '0'); +INSERT INTO `order details`VALUES ('10379', '41', '7.7000', '8', '0.1'); +INSERT INTO `order details`VALUES ('10379', '63', '35.1000', '16', '0.1'); +INSERT INTO `order details`VALUES ('10379', '65', '16.8000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10380', '30', '20.7000', '18', '0.1'); +INSERT INTO `order details`VALUES ('10380', '53', '26.2000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10380', '60', '27.2000', '6', '0.1'); +INSERT INTO `order details`VALUES ('10380', '70', '12.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10381', '74', '8.0000', '14', '0'); +INSERT INTO `order details`VALUES ('10382', '5', '17.0000', '32', '0'); +INSERT INTO `order details`VALUES ('10382', '18', '50.0000', '9', '0'); +INSERT INTO `order details`VALUES ('10382', '29', '99.0000', '14', '0'); +INSERT INTO `order details`VALUES ('10382', '33', '2.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10382', '74', '8.0000', '50', '0'); +INSERT INTO `order details`VALUES ('10383', '13', '4.8000', '20', '0'); +INSERT INTO `order details`VALUES ('10383', '50', '13.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10383', '56', '30.4000', '20', '0'); +INSERT INTO `order details`VALUES ('10384', '20', '64.8000', '28', '0'); +INSERT INTO `order details`VALUES ('10384', '60', '27.2000', '15', '0'); +INSERT INTO `order details`VALUES ('10385', '7', '24.0000', '10', '0.2'); +INSERT INTO `order details`VALUES ('10385', '60', '27.2000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10385', '68', '10.0000', '8', '0.2'); +INSERT INTO `order details`VALUES ('10386', '24', '3.6000', '15', '0'); +INSERT INTO `order details`VALUES ('10386', '34', '11.2000', '10', '0'); +INSERT INTO `order details`VALUES ('10387', '24', '3.6000', '15', '0'); +INSERT INTO `order details`VALUES ('10387', '28', '36.4000', '6', '0'); +INSERT INTO `order details`VALUES ('10387', '59', '44.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10387', '71', '17.2000', '15', '0'); +INSERT INTO `order details`VALUES ('10388', '45', '7.6000', '15', '0.2'); +INSERT INTO `order details`VALUES ('10388', '52', '5.6000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10388', '53', '26.2000', '40', '0'); +INSERT INTO `order details`VALUES ('10389', '10', '24.8000', '16', '0'); +INSERT INTO `order details`VALUES ('10389', '55', '19.2000', '15', '0'); +INSERT INTO `order details`VALUES ('10389', '62', '39.4000', '20', '0'); +INSERT INTO `order details`VALUES ('10389', '70', '12.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10390', '31', '10.0000', '60', '0.1'); +INSERT INTO `order details`VALUES ('10390', '35', '14.4000', '40', '0.1'); +INSERT INTO `order details`VALUES ('10390', '46', '9.6000', '45', '0'); +INSERT INTO `order details`VALUES ('10390', '72', '27.8000', '24', '0.1'); +INSERT INTO `order details`VALUES ('10391', '13', '4.8000', '18', '0'); +INSERT INTO `order details`VALUES ('10392', '69', '28.8000', '50', '0'); +INSERT INTO `order details`VALUES ('10393', '2', '15.2000', '25', '0.25'); +INSERT INTO `order details`VALUES ('10393', '14', '18.6000', '42', '0.25'); +INSERT INTO `order details`VALUES ('10393', '25', '11.2000', '7', '0.25'); +INSERT INTO `order details`VALUES ('10393', '26', '24.9000', '70', '0.25'); +INSERT INTO `order details`VALUES ('10393', '31', '10.0000', '32', '0'); +INSERT INTO `order details`VALUES ('10394', '13', '4.8000', '10', '0'); +INSERT INTO `order details`VALUES ('10394', '62', '39.4000', '10', '0'); +INSERT INTO `order details`VALUES ('10395', '46', '9.6000', '28', '0.1'); +INSERT INTO `order details`VALUES ('10395', '53', '26.2000', '70', '0.1'); +INSERT INTO `order details`VALUES ('10395', '69', '28.8000', '8', '0'); +INSERT INTO `order details`VALUES ('10396', '23', '7.2000', '40', '0'); +INSERT INTO `order details`VALUES ('10396', '71', '17.2000', '60', '0'); +INSERT INTO `order details`VALUES ('10396', '72', '27.8000', '21', '0'); +INSERT INTO `order details`VALUES ('10397', '21', '8.0000', '10', '0.15'); +INSERT INTO `order details`VALUES ('10397', '51', '42.4000', '18', '0.15'); +INSERT INTO `order details`VALUES ('10398', '35', '14.4000', '30', '0'); +INSERT INTO `order details`VALUES ('10398', '55', '19.2000', '120', '0.1'); +INSERT INTO `order details`VALUES ('10399', '68', '10.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10399', '71', '17.2000', '30', '0'); +INSERT INTO `order details`VALUES ('10399', '76', '14.4000', '35', '0'); +INSERT INTO `order details`VALUES ('10399', '77', '10.4000', '14', '0'); +INSERT INTO `order details`VALUES ('10400', '29', '99.0000', '21', '0'); +INSERT INTO `order details`VALUES ('10400', '35', '14.4000', '35', '0'); +INSERT INTO `order details`VALUES ('10400', '49', '16.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10401', '30', '20.7000', '18', '0'); +INSERT INTO `order details`VALUES ('10401', '56', '30.4000', '70', '0'); +INSERT INTO `order details`VALUES ('10401', '65', '16.8000', '20', '0'); +INSERT INTO `order details`VALUES ('10401', '71', '17.2000', '60', '0'); +INSERT INTO `order details`VALUES ('10402', '23', '7.2000', '60', '0'); +INSERT INTO `order details`VALUES ('10402', '63', '35.1000', '65', '0'); +INSERT INTO `order details`VALUES ('10403', '16', '13.9000', '21', '0.15'); +INSERT INTO `order details`VALUES ('10403', '48', '10.2000', '70', '0.15'); +INSERT INTO `order details`VALUES ('10404', '26', '24.9000', '30', '0.05'); +INSERT INTO `order details`VALUES ('10404', '42', '11.2000', '40', '0.05'); +INSERT INTO `order details`VALUES ('10404', '49', '16.0000', '30', '0.05'); +INSERT INTO `order details`VALUES ('10405', '3', '8.0000', '50', '0'); +INSERT INTO `order details`VALUES ('10406', '1', '14.4000', '10', '0'); +INSERT INTO `order details`VALUES ('10406', '21', '8.0000', '30', '0.1'); +INSERT INTO `order details`VALUES ('10406', '28', '36.4000', '42', '0.1'); +INSERT INTO `order details`VALUES ('10406', '36', '15.2000', '5', '0.1'); +INSERT INTO `order details`VALUES ('10406', '40', '14.7000', '2', '0.1'); +INSERT INTO `order details`VALUES ('10407', '11', '16.8000', '30', '0'); +INSERT INTO `order details`VALUES ('10407', '69', '28.8000', '15', '0'); +INSERT INTO `order details`VALUES ('10407', '71', '17.2000', '15', '0'); +INSERT INTO `order details`VALUES ('10408', '37', '20.8000', '10', '0'); +INSERT INTO `order details`VALUES ('10408', '54', '5.9000', '6', '0'); +INSERT INTO `order details`VALUES ('10408', '62', '39.4000', '35', '0'); +INSERT INTO `order details`VALUES ('10409', '14', '18.6000', '12', '0'); +INSERT INTO `order details`VALUES ('10409', '21', '8.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10410', '33', '2.0000', '49', '0'); +INSERT INTO `order details`VALUES ('10410', '59', '44.0000', '16', '0'); +INSERT INTO `order details`VALUES ('10411', '41', '7.7000', '25', '0.2'); +INSERT INTO `order details`VALUES ('10411', '44', '15.5000', '40', '0.2'); +INSERT INTO `order details`VALUES ('10411', '59', '44.0000', '9', '0.2'); +INSERT INTO `order details`VALUES ('10412', '14', '18.6000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10413', '1', '14.4000', '24', '0'); +INSERT INTO `order details`VALUES ('10413', '62', '39.4000', '40', '0'); +INSERT INTO `order details`VALUES ('10413', '76', '14.4000', '14', '0'); +INSERT INTO `order details`VALUES ('10414', '19', '7.3000', '18', '0.05'); +INSERT INTO `order details`VALUES ('10414', '33', '2.0000', '50', '0'); +INSERT INTO `order details`VALUES ('10415', '17', '31.2000', '2', '0'); +INSERT INTO `order details`VALUES ('10415', '33', '2.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10416', '19', '7.3000', '20', '0'); +INSERT INTO `order details`VALUES ('10416', '53', '26.2000', '10', '0'); +INSERT INTO `order details`VALUES ('10416', '57', '15.6000', '20', '0'); +INSERT INTO `order details`VALUES ('10417', '38', '210.8000', '50', '0'); +INSERT INTO `order details`VALUES ('10417', '46', '9.6000', '2', '0.25'); +INSERT INTO `order details`VALUES ('10417', '68', '10.0000', '36', '0.25'); +INSERT INTO `order details`VALUES ('10417', '77', '10.4000', '35', '0'); +INSERT INTO `order details`VALUES ('10418', '2', '15.2000', '60', '0'); +INSERT INTO `order details`VALUES ('10418', '47', '7.6000', '55', '0'); +INSERT INTO `order details`VALUES ('10418', '61', '22.8000', '16', '0'); +INSERT INTO `order details`VALUES ('10418', '74', '8.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10419', '60', '27.2000', '60', '0.05'); +INSERT INTO `order details`VALUES ('10419', '69', '28.8000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10420', '9', '77.6000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10420', '13', '4.8000', '2', '0.1'); +INSERT INTO `order details`VALUES ('10420', '70', '12.0000', '8', '0.1'); +INSERT INTO `order details`VALUES ('10420', '73', '12.0000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10421', '19', '7.3000', '4', '0.15'); +INSERT INTO `order details`VALUES ('10421', '26', '24.9000', '30', '0'); +INSERT INTO `order details`VALUES ('10421', '53', '26.2000', '15', '0.15'); +INSERT INTO `order details`VALUES ('10421', '77', '10.4000', '10', '0.15'); +INSERT INTO `order details`VALUES ('10422', '26', '24.9000', '2', '0'); +INSERT INTO `order details`VALUES ('10423', '31', '10.0000', '14', '0'); +INSERT INTO `order details`VALUES ('10423', '59', '44.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10424', '35', '14.4000', '60', '0.2'); +INSERT INTO `order details`VALUES ('10424', '38', '210.8000', '49', '0.2'); +INSERT INTO `order details`VALUES ('10424', '68', '10.0000', '30', '0.2'); +INSERT INTO `order details`VALUES ('10425', '55', '19.2000', '10', '0.25'); +INSERT INTO `order details`VALUES ('10425', '76', '14.4000', '20', '0.25'); +INSERT INTO `order details`VALUES ('10426', '56', '30.4000', '5', '0'); +INSERT INTO `order details`VALUES ('10426', '64', '26.6000', '7', '0'); +INSERT INTO `order details`VALUES ('10427', '14', '18.6000', '35', '0'); +INSERT INTO `order details`VALUES ('10428', '46', '9.6000', '20', '0'); +INSERT INTO `order details`VALUES ('10429', '50', '13.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10429', '63', '35.1000', '35', '0.25'); +INSERT INTO `order details`VALUES ('10430', '17', '31.2000', '45', '0.2'); +INSERT INTO `order details`VALUES ('10430', '21', '8.0000', '50', '0'); +INSERT INTO `order details`VALUES ('10430', '56', '30.4000', '30', '0'); +INSERT INTO `order details`VALUES ('10430', '59', '44.0000', '70', '0.2'); +INSERT INTO `order details`VALUES ('10431', '17', '31.2000', '50', '0.25'); +INSERT INTO `order details`VALUES ('10431', '40', '14.7000', '50', '0.25'); +INSERT INTO `order details`VALUES ('10431', '47', '7.6000', '30', '0.25'); +INSERT INTO `order details`VALUES ('10432', '26', '24.9000', '10', '0'); +INSERT INTO `order details`VALUES ('10432', '54', '5.9000', '40', '0'); +INSERT INTO `order details`VALUES ('10433', '56', '30.4000', '28', '0'); +INSERT INTO `order details`VALUES ('10434', '11', '16.8000', '6', '0'); +INSERT INTO `order details`VALUES ('10434', '76', '14.4000', '18', '0.15'); +INSERT INTO `order details`VALUES ('10435', '2', '15.2000', '10', '0'); +INSERT INTO `order details`VALUES ('10435', '22', '16.8000', '12', '0'); +INSERT INTO `order details`VALUES ('10435', '72', '27.8000', '10', '0'); +INSERT INTO `order details`VALUES ('10436', '46', '9.6000', '5', '0'); +INSERT INTO `order details`VALUES ('10436', '56', '30.4000', '40', '0.1'); +INSERT INTO `order details`VALUES ('10436', '64', '26.6000', '30', '0.1'); +INSERT INTO `order details`VALUES ('10436', '75', '6.2000', '24', '0.1'); +INSERT INTO `order details`VALUES ('10437', '53', '26.2000', '15', '0'); +INSERT INTO `order details`VALUES ('10438', '19', '7.3000', '15', '0.2'); +INSERT INTO `order details`VALUES ('10438', '34', '11.2000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10438', '57', '15.6000', '15', '0.2'); +INSERT INTO `order details`VALUES ('10439', '12', '30.4000', '15', '0'); +INSERT INTO `order details`VALUES ('10439', '16', '13.9000', '16', '0'); +INSERT INTO `order details`VALUES ('10439', '64', '26.6000', '6', '0'); +INSERT INTO `order details`VALUES ('10439', '74', '8.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10440', '2', '15.2000', '45', '0.15'); +INSERT INTO `order details`VALUES ('10440', '16', '13.9000', '49', '0.15'); +INSERT INTO `order details`VALUES ('10440', '29', '99.0000', '24', '0.15'); +INSERT INTO `order details`VALUES ('10440', '61', '22.8000', '90', '0.15'); +INSERT INTO `order details`VALUES ('10441', '27', '35.1000', '50', '0'); +INSERT INTO `order details`VALUES ('10442', '11', '16.8000', '30', '0'); +INSERT INTO `order details`VALUES ('10442', '54', '5.9000', '80', '0'); +INSERT INTO `order details`VALUES ('10442', '66', '13.6000', '60', '0'); +INSERT INTO `order details`VALUES ('10443', '11', '16.8000', '6', '0.2'); +INSERT INTO `order details`VALUES ('10443', '28', '36.4000', '12', '0'); +INSERT INTO `order details`VALUES ('10444', '17', '31.2000', '10', '0'); +INSERT INTO `order details`VALUES ('10444', '26', '24.9000', '15', '0'); +INSERT INTO `order details`VALUES ('10444', '35', '14.4000', '8', '0'); +INSERT INTO `order details`VALUES ('10444', '41', '7.7000', '30', '0'); +INSERT INTO `order details`VALUES ('10445', '39', '14.4000', '6', '0'); +INSERT INTO `order details`VALUES ('10445', '54', '5.9000', '15', '0'); +INSERT INTO `order details`VALUES ('10446', '19', '7.3000', '12', '0.1'); +INSERT INTO `order details`VALUES ('10446', '24', '3.6000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10446', '31', '10.0000', '3', '0.1'); +INSERT INTO `order details`VALUES ('10446', '52', '5.6000', '15', '0.1'); +INSERT INTO `order details`VALUES ('10447', '19', '7.3000', '40', '0'); +INSERT INTO `order details`VALUES ('10447', '65', '16.8000', '35', '0'); +INSERT INTO `order details`VALUES ('10447', '71', '17.2000', '2', '0'); +INSERT INTO `order details`VALUES ('10448', '26', '24.9000', '6', '0'); +INSERT INTO `order details`VALUES ('10448', '40', '14.7000', '20', '0'); +INSERT INTO `order details`VALUES ('10449', '10', '24.8000', '14', '0'); +INSERT INTO `order details`VALUES ('10449', '52', '5.6000', '20', '0'); +INSERT INTO `order details`VALUES ('10449', '62', '39.4000', '35', '0'); +INSERT INTO `order details`VALUES ('10450', '10', '24.8000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10450', '54', '5.9000', '6', '0.2'); +INSERT INTO `order details`VALUES ('10451', '55', '19.2000', '120', '0.1'); +INSERT INTO `order details`VALUES ('10451', '64', '26.6000', '35', '0.1'); +INSERT INTO `order details`VALUES ('10451', '65', '16.8000', '28', '0.1'); +INSERT INTO `order details`VALUES ('10451', '77', '10.4000', '55', '0.1'); +INSERT INTO `order details`VALUES ('10452', '28', '36.4000', '15', '0'); +INSERT INTO `order details`VALUES ('10452', '44', '15.5000', '100', '0.05'); +INSERT INTO `order details`VALUES ('10453', '48', '10.2000', '15', '0.1'); +INSERT INTO `order details`VALUES ('10453', '70', '12.0000', '25', '0.1'); +INSERT INTO `order details`VALUES ('10454', '16', '13.9000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10454', '33', '2.0000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10454', '46', '9.6000', '10', '0.2'); +INSERT INTO `order details`VALUES ('10455', '39', '14.4000', '20', '0'); +INSERT INTO `order details`VALUES ('10455', '53', '26.2000', '50', '0'); +INSERT INTO `order details`VALUES ('10455', '61', '22.8000', '25', '0'); +INSERT INTO `order details`VALUES ('10455', '71', '17.2000', '30', '0'); +INSERT INTO `order details`VALUES ('10456', '21', '8.0000', '40', '0.15'); +INSERT INTO `order details`VALUES ('10456', '49', '16.0000', '21', '0.15'); +INSERT INTO `order details`VALUES ('10457', '59', '44.0000', '36', '0'); +INSERT INTO `order details`VALUES ('10458', '26', '24.9000', '30', '0'); +INSERT INTO `order details`VALUES ('10458', '28', '36.4000', '30', '0'); +INSERT INTO `order details`VALUES ('10458', '43', '36.8000', '20', '0'); +INSERT INTO `order details`VALUES ('10458', '56', '30.4000', '15', '0'); +INSERT INTO `order details`VALUES ('10458', '71', '17.2000', '50', '0'); +INSERT INTO `order details`VALUES ('10459', '7', '24.0000', '16', '0.05'); +INSERT INTO `order details`VALUES ('10459', '46', '9.6000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10459', '72', '27.8000', '40', '0'); +INSERT INTO `order details`VALUES ('10460', '68', '10.0000', '21', '0.25'); +INSERT INTO `order details`VALUES ('10460', '75', '6.2000', '4', '0.25'); +INSERT INTO `order details`VALUES ('10461', '21', '8.0000', '40', '0.25'); +INSERT INTO `order details`VALUES ('10461', '30', '20.7000', '28', '0.25'); +INSERT INTO `order details`VALUES ('10461', '55', '19.2000', '60', '0.25'); +INSERT INTO `order details`VALUES ('10462', '13', '4.8000', '1', '0'); +INSERT INTO `order details`VALUES ('10462', '23', '7.2000', '21', '0'); +INSERT INTO `order details`VALUES ('10463', '19', '7.3000', '21', '0'); +INSERT INTO `order details`VALUES ('10463', '42', '11.2000', '50', '0'); +INSERT INTO `order details`VALUES ('10464', '4', '17.6000', '16', '0.2'); +INSERT INTO `order details`VALUES ('10464', '43', '36.8000', '3', '0'); +INSERT INTO `order details`VALUES ('10464', '56', '30.4000', '30', '0.2'); +INSERT INTO `order details`VALUES ('10464', '60', '27.2000', '20', '0'); +INSERT INTO `order details`VALUES ('10465', '24', '3.6000', '25', '0'); +INSERT INTO `order details`VALUES ('10465', '29', '99.0000', '18', '0.1'); +INSERT INTO `order details`VALUES ('10465', '40', '14.7000', '20', '0'); +INSERT INTO `order details`VALUES ('10465', '45', '7.6000', '30', '0.1'); +INSERT INTO `order details`VALUES ('10465', '50', '13.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10466', '11', '16.8000', '10', '0'); +INSERT INTO `order details`VALUES ('10466', '46', '9.6000', '5', '0'); +INSERT INTO `order details`VALUES ('10467', '24', '3.6000', '28', '0'); +INSERT INTO `order details`VALUES ('10467', '25', '11.2000', '12', '0'); +INSERT INTO `order details`VALUES ('10468', '30', '20.7000', '8', '0'); +INSERT INTO `order details`VALUES ('10468', '43', '36.8000', '15', '0'); +INSERT INTO `order details`VALUES ('10469', '2', '15.2000', '40', '0.15'); +INSERT INTO `order details`VALUES ('10469', '16', '13.9000', '35', '0.15'); +INSERT INTO `order details`VALUES ('10469', '44', '15.5000', '2', '0.15'); +INSERT INTO `order details`VALUES ('10470', '18', '50.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10470', '23', '7.2000', '15', '0'); +INSERT INTO `order details`VALUES ('10470', '64', '26.6000', '8', '0'); +INSERT INTO `order details`VALUES ('10471', '7', '24.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10471', '56', '30.4000', '20', '0'); +INSERT INTO `order details`VALUES ('10472', '24', '3.6000', '80', '0.05'); +INSERT INTO `order details`VALUES ('10472', '51', '42.4000', '18', '0'); +INSERT INTO `order details`VALUES ('10473', '33', '2.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10473', '71', '17.2000', '12', '0'); +INSERT INTO `order details`VALUES ('10474', '14', '18.6000', '12', '0'); +INSERT INTO `order details`VALUES ('10474', '28', '36.4000', '18', '0'); +INSERT INTO `order details`VALUES ('10474', '40', '14.7000', '21', '0'); +INSERT INTO `order details`VALUES ('10474', '75', '6.2000', '10', '0'); +INSERT INTO `order details`VALUES ('10475', '31', '10.0000', '35', '0.15'); +INSERT INTO `order details`VALUES ('10475', '66', '13.6000', '60', '0.15'); +INSERT INTO `order details`VALUES ('10475', '76', '14.4000', '42', '0.15'); +INSERT INTO `order details`VALUES ('10476', '55', '19.2000', '2', '0.05'); +INSERT INTO `order details`VALUES ('10476', '70', '12.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10477', '1', '14.4000', '15', '0'); +INSERT INTO `order details`VALUES ('10477', '21', '8.0000', '21', '0.25'); +INSERT INTO `order details`VALUES ('10477', '39', '14.4000', '20', '0.25'); +INSERT INTO `order details`VALUES ('10478', '10', '24.8000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10479', '38', '210.8000', '30', '0'); +INSERT INTO `order details`VALUES ('10479', '53', '26.2000', '28', '0'); +INSERT INTO `order details`VALUES ('10479', '59', '44.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10479', '64', '26.6000', '30', '0'); +INSERT INTO `order details`VALUES ('10480', '47', '7.6000', '30', '0'); +INSERT INTO `order details`VALUES ('10480', '59', '44.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10481', '49', '16.0000', '24', '0'); +INSERT INTO `order details`VALUES ('10481', '60', '27.2000', '40', '0'); +INSERT INTO `order details`VALUES ('10482', '40', '14.7000', '10', '0'); +INSERT INTO `order details`VALUES ('10483', '34', '11.2000', '35', '0.05'); +INSERT INTO `order details`VALUES ('10483', '77', '10.4000', '30', '0.05'); +INSERT INTO `order details`VALUES ('10484', '21', '8.0000', '14', '0'); +INSERT INTO `order details`VALUES ('10484', '40', '14.7000', '10', '0'); +INSERT INTO `order details`VALUES ('10484', '51', '42.4000', '3', '0'); +INSERT INTO `order details`VALUES ('10485', '2', '15.2000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10485', '3', '8.0000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10485', '55', '19.2000', '30', '0.1'); +INSERT INTO `order details`VALUES ('10485', '70', '12.0000', '60', '0.1'); +INSERT INTO `order details`VALUES ('10486', '11', '16.8000', '5', '0'); +INSERT INTO `order details`VALUES ('10486', '51', '42.4000', '25', '0'); +INSERT INTO `order details`VALUES ('10486', '74', '8.0000', '16', '0'); +INSERT INTO `order details`VALUES ('10487', '19', '7.3000', '5', '0'); +INSERT INTO `order details`VALUES ('10487', '26', '24.9000', '30', '0'); +INSERT INTO `order details`VALUES ('10487', '54', '5.9000', '24', '0.25'); +INSERT INTO `order details`VALUES ('10488', '59', '44.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10488', '73', '12.0000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10489', '11', '16.8000', '15', '0.25'); +INSERT INTO `order details`VALUES ('10489', '16', '13.9000', '18', '0'); +INSERT INTO `order details`VALUES ('10490', '59', '44.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10490', '68', '10.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10490', '75', '6.2000', '36', '0'); +INSERT INTO `order details`VALUES ('10491', '44', '15.5000', '15', '0.15'); +INSERT INTO `order details`VALUES ('10491', '77', '10.4000', '7', '0.15'); +INSERT INTO `order details`VALUES ('10492', '25', '11.2000', '60', '0.05'); +INSERT INTO `order details`VALUES ('10492', '42', '11.2000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10493', '65', '16.8000', '15', '0.1'); +INSERT INTO `order details`VALUES ('10493', '66', '13.6000', '10', '0.1'); +INSERT INTO `order details`VALUES ('10493', '69', '28.8000', '10', '0.1'); +INSERT INTO `order details`VALUES ('10494', '56', '30.4000', '30', '0'); +INSERT INTO `order details`VALUES ('10495', '23', '7.2000', '10', '0'); +INSERT INTO `order details`VALUES ('10495', '41', '7.7000', '20', '0'); +INSERT INTO `order details`VALUES ('10495', '77', '10.4000', '5', '0'); +INSERT INTO `order details`VALUES ('10496', '31', '10.0000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10497', '56', '30.4000', '14', '0'); +INSERT INTO `order details`VALUES ('10497', '72', '27.8000', '25', '0'); +INSERT INTO `order details`VALUES ('10497', '77', '10.4000', '25', '0'); +INSERT INTO `order details`VALUES ('10498', '24', '4.5000', '14', '0'); +INSERT INTO `order details`VALUES ('10498', '40', '18.4000', '5', '0'); +INSERT INTO `order details`VALUES ('10498', '42', '14.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10499', '28', '45.6000', '20', '0'); +INSERT INTO `order details`VALUES ('10499', '49', '20.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10500', '15', '15.5000', '12', '0.05'); +INSERT INTO `order details`VALUES ('10500', '28', '45.6000', '8', '0.05'); +INSERT INTO `order details`VALUES ('10501', '54', '7.4500', '20', '0'); +INSERT INTO `order details`VALUES ('10502', '45', '9.5000', '21', '0'); +INSERT INTO `order details`VALUES ('10502', '53', '32.8000', '6', '0'); +INSERT INTO `order details`VALUES ('10502', '67', '14.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10503', '14', '23.2500', '70', '0'); +INSERT INTO `order details`VALUES ('10503', '65', '21.0500', '20', '0'); +INSERT INTO `order details`VALUES ('10504', '2', '19.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10504', '21', '10.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10504', '53', '32.8000', '10', '0'); +INSERT INTO `order details`VALUES ('10504', '61', '28.5000', '25', '0'); +INSERT INTO `order details`VALUES ('10505', '62', '49.3000', '3', '0'); +INSERT INTO `order details`VALUES ('10506', '25', '14.0000', '18', '0.1'); +INSERT INTO `order details`VALUES ('10506', '70', '15.0000', '14', '0.1'); +INSERT INTO `order details`VALUES ('10507', '43', '46.0000', '15', '0.15'); +INSERT INTO `order details`VALUES ('10507', '48', '12.7500', '15', '0.15'); +INSERT INTO `order details`VALUES ('10508', '13', '6.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10508', '39', '18.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10509', '28', '45.6000', '3', '0'); +INSERT INTO `order details`VALUES ('10510', '29', '123.7900', '36', '0'); +INSERT INTO `order details`VALUES ('10510', '75', '7.7500', '36', '0.1'); +INSERT INTO `order details`VALUES ('10511', '4', '22.0000', '50', '0.15'); +INSERT INTO `order details`VALUES ('10511', '7', '30.0000', '50', '0.15'); +INSERT INTO `order details`VALUES ('10511', '8', '40.0000', '10', '0.15'); +INSERT INTO `order details`VALUES ('10512', '24', '4.5000', '10', '0.15'); +INSERT INTO `order details`VALUES ('10512', '46', '12.0000', '9', '0.15'); +INSERT INTO `order details`VALUES ('10512', '47', '9.5000', '6', '0.15'); +INSERT INTO `order details`VALUES ('10512', '60', '34.0000', '12', '0.15'); +INSERT INTO `order details`VALUES ('10513', '21', '10.0000', '40', '0.2'); +INSERT INTO `order details`VALUES ('10513', '32', '32.0000', '50', '0.2'); +INSERT INTO `order details`VALUES ('10513', '61', '28.5000', '15', '0.2'); +INSERT INTO `order details`VALUES ('10514', '20', '81.0000', '39', '0'); +INSERT INTO `order details`VALUES ('10514', '28', '45.6000', '35', '0'); +INSERT INTO `order details`VALUES ('10514', '56', '38.0000', '70', '0'); +INSERT INTO `order details`VALUES ('10514', '65', '21.0500', '39', '0'); +INSERT INTO `order details`VALUES ('10514', '75', '7.7500', '50', '0'); +INSERT INTO `order details`VALUES ('10515', '9', '97.0000', '16', '0.15'); +INSERT INTO `order details`VALUES ('10515', '16', '17.4500', '50', '0'); +INSERT INTO `order details`VALUES ('10515', '27', '43.9000', '120', '0'); +INSERT INTO `order details`VALUES ('10515', '33', '2.5000', '16', '0.15'); +INSERT INTO `order details`VALUES ('10515', '60', '34.0000', '84', '0.15'); +INSERT INTO `order details`VALUES ('10516', '18', '62.5000', '25', '0.1'); +INSERT INTO `order details`VALUES ('10516', '41', '9.6500', '80', '0.1'); +INSERT INTO `order details`VALUES ('10516', '42', '14.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10517', '52', '7.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10517', '59', '55.0000', '4', '0'); +INSERT INTO `order details`VALUES ('10517', '70', '15.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10518', '24', '4.5000', '5', '0'); +INSERT INTO `order details`VALUES ('10518', '38', '263.5000', '15', '0'); +INSERT INTO `order details`VALUES ('10518', '44', '19.4500', '9', '0'); +INSERT INTO `order details`VALUES ('10519', '10', '31.0000', '16', '0.05'); +INSERT INTO `order details`VALUES ('10519', '56', '38.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10519', '60', '34.0000', '10', '0.05'); +INSERT INTO `order details`VALUES ('10520', '24', '4.5000', '8', '0'); +INSERT INTO `order details`VALUES ('10520', '53', '32.8000', '5', '0'); +INSERT INTO `order details`VALUES ('10521', '35', '18.0000', '3', '0'); +INSERT INTO `order details`VALUES ('10521', '41', '9.6500', '10', '0'); +INSERT INTO `order details`VALUES ('10521', '68', '12.5000', '6', '0'); +INSERT INTO `order details`VALUES ('10522', '1', '18.0000', '40', '0.2'); +INSERT INTO `order details`VALUES ('10522', '8', '40.0000', '24', '0'); +INSERT INTO `order details`VALUES ('10522', '30', '25.8900', '20', '0.2'); +INSERT INTO `order details`VALUES ('10522', '40', '18.4000', '25', '0.2'); +INSERT INTO `order details`VALUES ('10523', '17', '39.0000', '25', '0.1'); +INSERT INTO `order details`VALUES ('10523', '20', '81.0000', '15', '0.1'); +INSERT INTO `order details`VALUES ('10523', '37', '26.0000', '18', '0.1'); +INSERT INTO `order details`VALUES ('10523', '41', '9.6500', '6', '0.1'); +INSERT INTO `order details`VALUES ('10524', '10', '31.0000', '2', '0'); +INSERT INTO `order details`VALUES ('10524', '30', '25.8900', '10', '0'); +INSERT INTO `order details`VALUES ('10524', '43', '46.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10524', '54', '7.4500', '15', '0'); +INSERT INTO `order details`VALUES ('10525', '36', '19.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10525', '40', '18.4000', '15', '0.1'); +INSERT INTO `order details`VALUES ('10526', '1', '18.0000', '8', '0.15'); +INSERT INTO `order details`VALUES ('10526', '13', '6.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10526', '56', '38.0000', '30', '0.15'); +INSERT INTO `order details`VALUES ('10527', '4', '22.0000', '50', '0.1'); +INSERT INTO `order details`VALUES ('10527', '36', '19.0000', '30', '0.1'); +INSERT INTO `order details`VALUES ('10528', '11', '21.0000', '3', '0'); +INSERT INTO `order details`VALUES ('10528', '33', '2.5000', '8', '0.2'); +INSERT INTO `order details`VALUES ('10528', '72', '34.8000', '9', '0'); +INSERT INTO `order details`VALUES ('10529', '55', '24.0000', '14', '0'); +INSERT INTO `order details`VALUES ('10529', '68', '12.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10529', '69', '36.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10530', '17', '39.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10530', '43', '46.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10530', '61', '28.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10530', '76', '18.0000', '50', '0'); +INSERT INTO `order details`VALUES ('10531', '59', '55.0000', '2', '0'); +INSERT INTO `order details`VALUES ('10532', '30', '25.8900', '15', '0'); +INSERT INTO `order details`VALUES ('10532', '66', '17.0000', '24', '0'); +INSERT INTO `order details`VALUES ('10533', '4', '22.0000', '50', '0.05'); +INSERT INTO `order details`VALUES ('10533', '72', '34.8000', '24', '0'); +INSERT INTO `order details`VALUES ('10533', '73', '15.0000', '24', '0.05'); +INSERT INTO `order details`VALUES ('10534', '30', '25.8900', '10', '0'); +INSERT INTO `order details`VALUES ('10534', '40', '18.4000', '10', '0.2'); +INSERT INTO `order details`VALUES ('10534', '54', '7.4500', '10', '0.2'); +INSERT INTO `order details`VALUES ('10535', '11', '21.0000', '50', '0.1'); +INSERT INTO `order details`VALUES ('10535', '40', '18.4000', '10', '0.1'); +INSERT INTO `order details`VALUES ('10535', '57', '19.5000', '5', '0.1'); +INSERT INTO `order details`VALUES ('10535', '59', '55.0000', '15', '0.1'); +INSERT INTO `order details`VALUES ('10536', '12', '38.0000', '15', '0.25'); +INSERT INTO `order details`VALUES ('10536', '31', '12.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10536', '33', '2.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10536', '60', '34.0000', '35', '0.25'); +INSERT INTO `order details`VALUES ('10537', '31', '12.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10537', '51', '53.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10537', '58', '13.2500', '20', '0'); +INSERT INTO `order details`VALUES ('10537', '72', '34.8000', '21', '0'); +INSERT INTO `order details`VALUES ('10537', '73', '15.0000', '9', '0'); +INSERT INTO `order details`VALUES ('10538', '70', '15.0000', '7', '0'); +INSERT INTO `order details`VALUES ('10538', '72', '34.8000', '1', '0'); +INSERT INTO `order details`VALUES ('10539', '13', '6.0000', '8', '0'); +INSERT INTO `order details`VALUES ('10539', '21', '10.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10539', '33', '2.5000', '15', '0'); +INSERT INTO `order details`VALUES ('10539', '49', '20.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10540', '3', '10.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10540', '26', '31.2300', '40', '0'); +INSERT INTO `order details`VALUES ('10540', '38', '263.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10540', '68', '12.5000', '35', '0'); +INSERT INTO `order details`VALUES ('10541', '24', '4.5000', '35', '0.1'); +INSERT INTO `order details`VALUES ('10541', '38', '263.5000', '4', '0.1'); +INSERT INTO `order details`VALUES ('10541', '65', '21.0500', '36', '0.1'); +INSERT INTO `order details`VALUES ('10541', '71', '21.5000', '9', '0.1'); +INSERT INTO `order details`VALUES ('10542', '11', '21.0000', '15', '0.05'); +INSERT INTO `order details`VALUES ('10542', '54', '7.4500', '24', '0.05'); +INSERT INTO `order details`VALUES ('10543', '12', '38.0000', '30', '0.15'); +INSERT INTO `order details`VALUES ('10543', '23', '9.0000', '70', '0.15'); +INSERT INTO `order details`VALUES ('10544', '28', '45.6000', '7', '0'); +INSERT INTO `order details`VALUES ('10544', '67', '14.0000', '7', '0'); +INSERT INTO `order details`VALUES ('10545', '11', '21.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10546', '7', '30.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10546', '35', '18.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10546', '62', '49.3000', '40', '0'); +INSERT INTO `order details`VALUES ('10547', '32', '32.0000', '24', '0.15'); +INSERT INTO `order details`VALUES ('10547', '36', '19.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10548', '34', '14.0000', '10', '0.25'); +INSERT INTO `order details`VALUES ('10548', '41', '9.6500', '14', '0'); +INSERT INTO `order details`VALUES ('10549', '31', '12.5000', '55', '0.15'); +INSERT INTO `order details`VALUES ('10549', '45', '9.5000', '100', '0.15'); +INSERT INTO `order details`VALUES ('10549', '51', '53.0000', '48', '0.15'); +INSERT INTO `order details`VALUES ('10550', '17', '39.0000', '8', '0.1'); +INSERT INTO `order details`VALUES ('10550', '19', '9.2000', '10', '0'); +INSERT INTO `order details`VALUES ('10550', '21', '10.0000', '6', '0.1'); +INSERT INTO `order details`VALUES ('10550', '61', '28.5000', '10', '0.1'); +INSERT INTO `order details`VALUES ('10551', '16', '17.4500', '40', '0.15'); +INSERT INTO `order details`VALUES ('10551', '35', '18.0000', '20', '0.15'); +INSERT INTO `order details`VALUES ('10551', '44', '19.4500', '40', '0'); +INSERT INTO `order details`VALUES ('10552', '69', '36.0000', '18', '0'); +INSERT INTO `order details`VALUES ('10552', '75', '7.7500', '30', '0'); +INSERT INTO `order details`VALUES ('10553', '11', '21.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10553', '16', '17.4500', '14', '0'); +INSERT INTO `order details`VALUES ('10553', '22', '21.0000', '24', '0'); +INSERT INTO `order details`VALUES ('10553', '31', '12.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10553', '35', '18.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10554', '16', '17.4500', '30', '0.05'); +INSERT INTO `order details`VALUES ('10554', '23', '9.0000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10554', '62', '49.3000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10554', '77', '13.0000', '10', '0.05'); +INSERT INTO `order details`VALUES ('10555', '14', '23.2500', '30', '0.2'); +INSERT INTO `order details`VALUES ('10555', '19', '9.2000', '35', '0.2'); +INSERT INTO `order details`VALUES ('10555', '24', '4.5000', '18', '0.2'); +INSERT INTO `order details`VALUES ('10555', '51', '53.0000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10555', '56', '38.0000', '40', '0.2'); +INSERT INTO `order details`VALUES ('10556', '72', '34.8000', '24', '0'); +INSERT INTO `order details`VALUES ('10557', '64', '33.2500', '30', '0'); +INSERT INTO `order details`VALUES ('10557', '75', '7.7500', '20', '0'); +INSERT INTO `order details`VALUES ('10558', '47', '9.5000', '25', '0'); +INSERT INTO `order details`VALUES ('10558', '51', '53.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10558', '52', '7.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10558', '53', '32.8000', '18', '0'); +INSERT INTO `order details`VALUES ('10558', '73', '15.0000', '3', '0'); +INSERT INTO `order details`VALUES ('10559', '41', '9.6500', '12', '0.05'); +INSERT INTO `order details`VALUES ('10559', '55', '24.0000', '18', '0.05'); +INSERT INTO `order details`VALUES ('10560', '30', '25.8900', '20', '0'); +INSERT INTO `order details`VALUES ('10560', '62', '49.3000', '15', '0.25'); +INSERT INTO `order details`VALUES ('10561', '44', '19.4500', '10', '0'); +INSERT INTO `order details`VALUES ('10561', '51', '53.0000', '50', '0'); +INSERT INTO `order details`VALUES ('10562', '33', '2.5000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10562', '62', '49.3000', '10', '0.1'); +INSERT INTO `order details`VALUES ('10563', '36', '19.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10563', '52', '7.0000', '70', '0'); +INSERT INTO `order details`VALUES ('10564', '17', '39.0000', '16', '0.05'); +INSERT INTO `order details`VALUES ('10564', '31', '12.5000', '6', '0.05'); +INSERT INTO `order details`VALUES ('10564', '55', '24.0000', '25', '0.05'); +INSERT INTO `order details`VALUES ('10565', '24', '4.5000', '25', '0.1'); +INSERT INTO `order details`VALUES ('10565', '64', '33.2500', '18', '0.1'); +INSERT INTO `order details`VALUES ('10566', '11', '21.0000', '35', '0.15'); +INSERT INTO `order details`VALUES ('10566', '18', '62.5000', '18', '0.15'); +INSERT INTO `order details`VALUES ('10566', '76', '18.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10567', '31', '12.5000', '60', '0.2'); +INSERT INTO `order details`VALUES ('10567', '51', '53.0000', '3', '0'); +INSERT INTO `order details`VALUES ('10567', '59', '55.0000', '40', '0.2'); +INSERT INTO `order details`VALUES ('10568', '10', '31.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10569', '31', '12.5000', '35', '0.2'); +INSERT INTO `order details`VALUES ('10569', '76', '18.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10570', '11', '21.0000', '15', '0.05'); +INSERT INTO `order details`VALUES ('10570', '56', '38.0000', '60', '0.05'); +INSERT INTO `order details`VALUES ('10571', '14', '23.2500', '11', '0.15'); +INSERT INTO `order details`VALUES ('10571', '42', '14.0000', '28', '0.15'); +INSERT INTO `order details`VALUES ('10572', '16', '17.4500', '12', '0.1'); +INSERT INTO `order details`VALUES ('10572', '32', '32.0000', '10', '0.1'); +INSERT INTO `order details`VALUES ('10572', '40', '18.4000', '50', '0'); +INSERT INTO `order details`VALUES ('10572', '75', '7.7500', '15', '0.1'); +INSERT INTO `order details`VALUES ('10573', '17', '39.0000', '18', '0'); +INSERT INTO `order details`VALUES ('10573', '34', '14.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10573', '53', '32.8000', '25', '0'); +INSERT INTO `order details`VALUES ('10574', '33', '2.5000', '14', '0'); +INSERT INTO `order details`VALUES ('10574', '40', '18.4000', '2', '0'); +INSERT INTO `order details`VALUES ('10574', '62', '49.3000', '10', '0'); +INSERT INTO `order details`VALUES ('10574', '64', '33.2500', '6', '0'); +INSERT INTO `order details`VALUES ('10575', '59', '55.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10575', '63', '43.9000', '6', '0'); +INSERT INTO `order details`VALUES ('10575', '72', '34.8000', '30', '0'); +INSERT INTO `order details`VALUES ('10575', '76', '18.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10576', '1', '18.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10576', '31', '12.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10576', '44', '19.4500', '21', '0'); +INSERT INTO `order details`VALUES ('10577', '39', '18.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10577', '75', '7.7500', '20', '0'); +INSERT INTO `order details`VALUES ('10577', '77', '13.0000', '18', '0'); +INSERT INTO `order details`VALUES ('10578', '35', '18.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10578', '57', '19.5000', '6', '0'); +INSERT INTO `order details`VALUES ('10579', '15', '15.5000', '10', '0'); +INSERT INTO `order details`VALUES ('10579', '75', '7.7500', '21', '0'); +INSERT INTO `order details`VALUES ('10580', '14', '23.2500', '15', '0.05'); +INSERT INTO `order details`VALUES ('10580', '41', '9.6500', '9', '0.05'); +INSERT INTO `order details`VALUES ('10580', '65', '21.0500', '30', '0.05'); +INSERT INTO `order details`VALUES ('10581', '75', '7.7500', '50', '0.2'); +INSERT INTO `order details`VALUES ('10582', '57', '19.5000', '4', '0'); +INSERT INTO `order details`VALUES ('10582', '76', '18.0000', '14', '0'); +INSERT INTO `order details`VALUES ('10583', '29', '123.7900', '10', '0'); +INSERT INTO `order details`VALUES ('10583', '60', '34.0000', '24', '0.15'); +INSERT INTO `order details`VALUES ('10583', '69', '36.0000', '10', '0.15'); +INSERT INTO `order details`VALUES ('10584', '31', '12.5000', '50', '0.05'); +INSERT INTO `order details`VALUES ('10585', '47', '9.5000', '15', '0'); +INSERT INTO `order details`VALUES ('10586', '52', '7.0000', '4', '0.15'); +INSERT INTO `order details`VALUES ('10587', '26', '31.2300', '6', '0'); +INSERT INTO `order details`VALUES ('10587', '35', '18.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10587', '77', '13.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10588', '18', '62.5000', '40', '0.2'); +INSERT INTO `order details`VALUES ('10588', '42', '14.0000', '100', '0.2'); +INSERT INTO `order details`VALUES ('10589', '35', '18.0000', '4', '0'); +INSERT INTO `order details`VALUES ('10590', '1', '18.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10590', '77', '13.0000', '60', '0.05'); +INSERT INTO `order details`VALUES ('10591', '3', '10.0000', '14', '0'); +INSERT INTO `order details`VALUES ('10591', '7', '30.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10591', '54', '7.4500', '50', '0'); +INSERT INTO `order details`VALUES ('10592', '15', '15.5000', '25', '0.05'); +INSERT INTO `order details`VALUES ('10592', '26', '31.2300', '5', '0.05'); +INSERT INTO `order details`VALUES ('10593', '20', '81.0000', '21', '0.2'); +INSERT INTO `order details`VALUES ('10593', '69', '36.0000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10593', '76', '18.0000', '4', '0.2'); +INSERT INTO `order details`VALUES ('10594', '52', '7.0000', '24', '0'); +INSERT INTO `order details`VALUES ('10594', '58', '13.2500', '30', '0'); +INSERT INTO `order details`VALUES ('10595', '35', '18.0000', '30', '0.25'); +INSERT INTO `order details`VALUES ('10595', '61', '28.5000', '120', '0.25'); +INSERT INTO `order details`VALUES ('10595', '69', '36.0000', '65', '0.25'); +INSERT INTO `order details`VALUES ('10596', '56', '38.0000', '5', '0.2'); +INSERT INTO `order details`VALUES ('10596', '63', '43.9000', '24', '0.2'); +INSERT INTO `order details`VALUES ('10596', '75', '7.7500', '30', '0.2'); +INSERT INTO `order details`VALUES ('10597', '24', '4.5000', '35', '0.2'); +INSERT INTO `order details`VALUES ('10597', '57', '19.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10597', '65', '21.0500', '12', '0.2'); +INSERT INTO `order details`VALUES ('10598', '27', '43.9000', '50', '0'); +INSERT INTO `order details`VALUES ('10598', '71', '21.5000', '9', '0'); +INSERT INTO `order details`VALUES ('10599', '62', '49.3000', '10', '0'); +INSERT INTO `order details`VALUES ('10600', '54', '7.4500', '4', '0'); +INSERT INTO `order details`VALUES ('10600', '73', '15.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10601', '13', '6.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10601', '59', '55.0000', '35', '0'); +INSERT INTO `order details`VALUES ('10602', '77', '13.0000', '5', '0.25'); +INSERT INTO `order details`VALUES ('10603', '22', '21.0000', '48', '0'); +INSERT INTO `order details`VALUES ('10603', '49', '20.0000', '25', '0.05'); +INSERT INTO `order details`VALUES ('10604', '48', '12.7500', '6', '0.1'); +INSERT INTO `order details`VALUES ('10604', '76', '18.0000', '10', '0.1'); +INSERT INTO `order details`VALUES ('10605', '16', '17.4500', '30', '0.05'); +INSERT INTO `order details`VALUES ('10605', '59', '55.0000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10605', '60', '34.0000', '70', '0.05'); +INSERT INTO `order details`VALUES ('10605', '71', '21.5000', '15', '0.05'); +INSERT INTO `order details`VALUES ('10606', '4', '22.0000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10606', '55', '24.0000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10606', '62', '49.3000', '10', '0.2'); +INSERT INTO `order details`VALUES ('10607', '7', '30.0000', '45', '0'); +INSERT INTO `order details`VALUES ('10607', '17', '39.0000', '100', '0'); +INSERT INTO `order details`VALUES ('10607', '33', '2.5000', '14', '0'); +INSERT INTO `order details`VALUES ('10607', '40', '18.4000', '42', '0'); +INSERT INTO `order details`VALUES ('10607', '72', '34.8000', '12', '0'); +INSERT INTO `order details`VALUES ('10608', '56', '38.0000', '28', '0'); +INSERT INTO `order details`VALUES ('10609', '1', '18.0000', '3', '0'); +INSERT INTO `order details`VALUES ('10609', '10', '31.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10609', '21', '10.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10610', '36', '19.0000', '21', '0.25'); +INSERT INTO `order details`VALUES ('10611', '1', '18.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10611', '2', '19.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10611', '60', '34.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10612', '10', '31.0000', '70', '0'); +INSERT INTO `order details`VALUES ('10612', '36', '19.0000', '55', '0'); +INSERT INTO `order details`VALUES ('10612', '49', '20.0000', '18', '0'); +INSERT INTO `order details`VALUES ('10612', '60', '34.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10612', '76', '18.0000', '80', '0'); +INSERT INTO `order details`VALUES ('10613', '13', '6.0000', '8', '0.1'); +INSERT INTO `order details`VALUES ('10613', '75', '7.7500', '40', '0'); +INSERT INTO `order details`VALUES ('10614', '11', '21.0000', '14', '0'); +INSERT INTO `order details`VALUES ('10614', '21', '10.0000', '8', '0'); +INSERT INTO `order details`VALUES ('10614', '39', '18.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10615', '55', '24.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10616', '38', '263.5000', '15', '0.05'); +INSERT INTO `order details`VALUES ('10616', '56', '38.0000', '14', '0'); +INSERT INTO `order details`VALUES ('10616', '70', '15.0000', '15', '0.05'); +INSERT INTO `order details`VALUES ('10616', '71', '21.5000', '15', '0.05'); +INSERT INTO `order details`VALUES ('10617', '59', '55.0000', '30', '0.15'); +INSERT INTO `order details`VALUES ('10618', '6', '25.0000', '70', '0'); +INSERT INTO `order details`VALUES ('10618', '56', '38.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10618', '68', '12.5000', '15', '0'); +INSERT INTO `order details`VALUES ('10619', '21', '10.0000', '42', '0'); +INSERT INTO `order details`VALUES ('10619', '22', '21.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10620', '24', '4.5000', '5', '0'); +INSERT INTO `order details`VALUES ('10620', '52', '7.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10621', '19', '9.2000', '5', '0'); +INSERT INTO `order details`VALUES ('10621', '23', '9.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10621', '70', '15.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10621', '71', '21.5000', '15', '0'); +INSERT INTO `order details`VALUES ('10622', '2', '19.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10622', '68', '12.5000', '18', '0.2'); +INSERT INTO `order details`VALUES ('10623', '14', '23.2500', '21', '0'); +INSERT INTO `order details`VALUES ('10623', '19', '9.2000', '15', '0.1'); +INSERT INTO `order details`VALUES ('10623', '21', '10.0000', '25', '0.1'); +INSERT INTO `order details`VALUES ('10623', '24', '4.5000', '3', '0'); +INSERT INTO `order details`VALUES ('10623', '35', '18.0000', '30', '0.1'); +INSERT INTO `order details`VALUES ('10624', '28', '45.6000', '10', '0'); +INSERT INTO `order details`VALUES ('10624', '29', '123.7900', '6', '0'); +INSERT INTO `order details`VALUES ('10624', '44', '19.4500', '10', '0'); +INSERT INTO `order details`VALUES ('10625', '14', '23.2500', '3', '0'); +INSERT INTO `order details`VALUES ('10625', '42', '14.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10625', '60', '34.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10626', '53', '32.8000', '12', '0'); +INSERT INTO `order details`VALUES ('10626', '60', '34.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10626', '71', '21.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10627', '62', '49.3000', '15', '0'); +INSERT INTO `order details`VALUES ('10627', '73', '15.0000', '35', '0.15'); +INSERT INTO `order details`VALUES ('10628', '1', '18.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10629', '29', '123.7900', '20', '0'); +INSERT INTO `order details`VALUES ('10629', '64', '33.2500', '9', '0'); +INSERT INTO `order details`VALUES ('10630', '55', '24.0000', '12', '0.05'); +INSERT INTO `order details`VALUES ('10630', '76', '18.0000', '35', '0'); +INSERT INTO `order details`VALUES ('10631', '75', '7.7500', '8', '0.1'); +INSERT INTO `order details`VALUES ('10632', '2', '19.0000', '30', '0.05'); +INSERT INTO `order details`VALUES ('10632', '33', '2.5000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10633', '12', '38.0000', '36', '0.15'); +INSERT INTO `order details`VALUES ('10633', '13', '6.0000', '13', '0.15'); +INSERT INTO `order details`VALUES ('10633', '26', '31.2300', '35', '0.15'); +INSERT INTO `order details`VALUES ('10633', '62', '49.3000', '80', '0.15'); +INSERT INTO `order details`VALUES ('10634', '7', '30.0000', '35', '0'); +INSERT INTO `order details`VALUES ('10634', '18', '62.5000', '50', '0'); +INSERT INTO `order details`VALUES ('10634', '51', '53.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10634', '75', '7.7500', '2', '0'); +INSERT INTO `order details`VALUES ('10635', '4', '22.0000', '10', '0.1'); +INSERT INTO `order details`VALUES ('10635', '5', '21.3500', '15', '0.1'); +INSERT INTO `order details`VALUES ('10635', '22', '21.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10636', '4', '22.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10636', '58', '13.2500', '6', '0'); +INSERT INTO `order details`VALUES ('10637', '11', '21.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10637', '50', '16.2500', '25', '0.05'); +INSERT INTO `order details`VALUES ('10637', '56', '38.0000', '60', '0.05'); +INSERT INTO `order details`VALUES ('10638', '45', '9.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10638', '65', '21.0500', '21', '0'); +INSERT INTO `order details`VALUES ('10638', '72', '34.8000', '60', '0'); +INSERT INTO `order details`VALUES ('10639', '18', '62.5000', '8', '0'); +INSERT INTO `order details`VALUES ('10640', '69', '36.0000', '20', '0.25'); +INSERT INTO `order details`VALUES ('10640', '70', '15.0000', '15', '0.25'); +INSERT INTO `order details`VALUES ('10641', '2', '19.0000', '50', '0'); +INSERT INTO `order details`VALUES ('10641', '40', '18.4000', '60', '0'); +INSERT INTO `order details`VALUES ('10642', '21', '10.0000', '30', '0.2'); +INSERT INTO `order details`VALUES ('10642', '61', '28.5000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10643', '28', '45.6000', '15', '0.25'); +INSERT INTO `order details`VALUES ('10643', '39', '18.0000', '21', '0.25'); +INSERT INTO `order details`VALUES ('10643', '46', '12.0000', '2', '0.25'); +INSERT INTO `order details`VALUES ('10644', '18', '62.5000', '4', '0.1'); +INSERT INTO `order details`VALUES ('10644', '43', '46.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10644', '46', '12.0000', '21', '0.1'); +INSERT INTO `order details`VALUES ('10645', '18', '62.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10645', '36', '19.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10646', '1', '18.0000', '15', '0.25'); +INSERT INTO `order details`VALUES ('10646', '10', '31.0000', '18', '0.25'); +INSERT INTO `order details`VALUES ('10646', '71', '21.5000', '30', '0.25'); +INSERT INTO `order details`VALUES ('10646', '77', '13.0000', '35', '0.25'); +INSERT INTO `order details`VALUES ('10647', '19', '9.2000', '30', '0'); +INSERT INTO `order details`VALUES ('10647', '39', '18.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10648', '22', '21.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10648', '24', '4.5000', '15', '0.15'); +INSERT INTO `order details`VALUES ('10649', '28', '45.6000', '20', '0'); +INSERT INTO `order details`VALUES ('10649', '72', '34.8000', '15', '0'); +INSERT INTO `order details`VALUES ('10650', '30', '25.8900', '30', '0'); +INSERT INTO `order details`VALUES ('10650', '53', '32.8000', '25', '0.05'); +INSERT INTO `order details`VALUES ('10650', '54', '7.4500', '30', '0'); +INSERT INTO `order details`VALUES ('10651', '19', '9.2000', '12', '0.25'); +INSERT INTO `order details`VALUES ('10651', '22', '21.0000', '20', '0.25'); +INSERT INTO `order details`VALUES ('10652', '30', '25.8900', '2', '0.25'); +INSERT INTO `order details`VALUES ('10652', '42', '14.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10653', '16', '17.4500', '30', '0.1'); +INSERT INTO `order details`VALUES ('10653', '60', '34.0000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10654', '4', '22.0000', '12', '0.1'); +INSERT INTO `order details`VALUES ('10654', '39', '18.0000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10654', '54', '7.4500', '6', '0.1'); +INSERT INTO `order details`VALUES ('10655', '41', '9.6500', '20', '0.2'); +INSERT INTO `order details`VALUES ('10656', '14', '23.2500', '3', '0.1'); +INSERT INTO `order details`VALUES ('10656', '44', '19.4500', '28', '0.1'); +INSERT INTO `order details`VALUES ('10656', '47', '9.5000', '6', '0.1'); +INSERT INTO `order details`VALUES ('10657', '15', '15.5000', '50', '0'); +INSERT INTO `order details`VALUES ('10657', '41', '9.6500', '24', '0'); +INSERT INTO `order details`VALUES ('10657', '46', '12.0000', '45', '0'); +INSERT INTO `order details`VALUES ('10657', '47', '9.5000', '10', '0'); +INSERT INTO `order details`VALUES ('10657', '56', '38.0000', '45', '0'); +INSERT INTO `order details`VALUES ('10657', '60', '34.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10658', '21', '10.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10658', '40', '18.4000', '70', '0.05'); +INSERT INTO `order details`VALUES ('10658', '60', '34.0000', '55', '0.05'); +INSERT INTO `order details`VALUES ('10658', '77', '13.0000', '70', '0.05'); +INSERT INTO `order details`VALUES ('10659', '31', '12.5000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10659', '40', '18.4000', '24', '0.05'); +INSERT INTO `order details`VALUES ('10659', '70', '15.0000', '40', '0.05'); +INSERT INTO `order details`VALUES ('10660', '20', '81.0000', '21', '0'); +INSERT INTO `order details`VALUES ('10661', '39', '18.0000', '3', '0.2'); +INSERT INTO `order details`VALUES ('10661', '58', '13.2500', '49', '0.2'); +INSERT INTO `order details`VALUES ('10662', '68', '12.5000', '10', '0'); +INSERT INTO `order details`VALUES ('10663', '40', '18.4000', '30', '0.05'); +INSERT INTO `order details`VALUES ('10663', '42', '14.0000', '30', '0.05'); +INSERT INTO `order details`VALUES ('10663', '51', '53.0000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10664', '10', '31.0000', '24', '0.15'); +INSERT INTO `order details`VALUES ('10664', '56', '38.0000', '12', '0.15'); +INSERT INTO `order details`VALUES ('10664', '65', '21.0500', '15', '0.15'); +INSERT INTO `order details`VALUES ('10665', '51', '53.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10665', '59', '55.0000', '1', '0'); +INSERT INTO `order details`VALUES ('10665', '76', '18.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10666', '29', '123.7900', '36', '0'); +INSERT INTO `order details`VALUES ('10666', '65', '21.0500', '10', '0'); +INSERT INTO `order details`VALUES ('10667', '69', '36.0000', '45', '0.2'); +INSERT INTO `order details`VALUES ('10667', '71', '21.5000', '14', '0.2'); +INSERT INTO `order details`VALUES ('10668', '31', '12.5000', '8', '0.1'); +INSERT INTO `order details`VALUES ('10668', '55', '24.0000', '4', '0.1'); +INSERT INTO `order details`VALUES ('10668', '64', '33.2500', '15', '0.1'); +INSERT INTO `order details`VALUES ('10669', '36', '19.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10670', '23', '9.0000', '32', '0'); +INSERT INTO `order details`VALUES ('10670', '46', '12.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10670', '67', '14.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10670', '73', '15.0000', '50', '0'); +INSERT INTO `order details`VALUES ('10670', '75', '7.7500', '25', '0'); +INSERT INTO `order details`VALUES ('10671', '16', '17.4500', '10', '0'); +INSERT INTO `order details`VALUES ('10671', '62', '49.3000', '10', '0'); +INSERT INTO `order details`VALUES ('10671', '65', '21.0500', '12', '0'); +INSERT INTO `order details`VALUES ('10672', '38', '263.5000', '15', '0.1'); +INSERT INTO `order details`VALUES ('10672', '71', '21.5000', '12', '0'); +INSERT INTO `order details`VALUES ('10673', '16', '17.4500', '3', '0'); +INSERT INTO `order details`VALUES ('10673', '42', '14.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10673', '43', '46.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10674', '23', '9.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10675', '14', '23.2500', '30', '0'); +INSERT INTO `order details`VALUES ('10675', '53', '32.8000', '10', '0'); +INSERT INTO `order details`VALUES ('10675', '58', '13.2500', '30', '0'); +INSERT INTO `order details`VALUES ('10676', '10', '31.0000', '2', '0'); +INSERT INTO `order details`VALUES ('10676', '19', '9.2000', '7', '0'); +INSERT INTO `order details`VALUES ('10676', '44', '19.4500', '21', '0'); +INSERT INTO `order details`VALUES ('10677', '26', '31.2300', '30', '0.15'); +INSERT INTO `order details`VALUES ('10677', '33', '2.5000', '8', '0.15'); +INSERT INTO `order details`VALUES ('10678', '12', '38.0000', '100', '0'); +INSERT INTO `order details`VALUES ('10678', '33', '2.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10678', '41', '9.6500', '120', '0'); +INSERT INTO `order details`VALUES ('10678', '54', '7.4500', '30', '0'); +INSERT INTO `order details`VALUES ('10679', '59', '55.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10680', '16', '17.4500', '50', '0.25'); +INSERT INTO `order details`VALUES ('10680', '31', '12.5000', '20', '0.25'); +INSERT INTO `order details`VALUES ('10680', '42', '14.0000', '40', '0.25'); +INSERT INTO `order details`VALUES ('10681', '19', '9.2000', '30', '0.1'); +INSERT INTO `order details`VALUES ('10681', '21', '10.0000', '12', '0.1'); +INSERT INTO `order details`VALUES ('10681', '64', '33.2500', '28', '0'); +INSERT INTO `order details`VALUES ('10682', '33', '2.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10682', '66', '17.0000', '4', '0'); +INSERT INTO `order details`VALUES ('10682', '75', '7.7500', '30', '0'); +INSERT INTO `order details`VALUES ('10683', '52', '7.0000', '9', '0'); +INSERT INTO `order details`VALUES ('10684', '40', '18.4000', '20', '0'); +INSERT INTO `order details`VALUES ('10684', '47', '9.5000', '40', '0'); +INSERT INTO `order details`VALUES ('10684', '60', '34.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10685', '10', '31.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10685', '41', '9.6500', '4', '0'); +INSERT INTO `order details`VALUES ('10685', '47', '9.5000', '15', '0'); +INSERT INTO `order details`VALUES ('10686', '17', '39.0000', '30', '0.2'); +INSERT INTO `order details`VALUES ('10686', '26', '31.2300', '15', '0'); +INSERT INTO `order details`VALUES ('10687', '9', '97.0000', '50', '0.25'); +INSERT INTO `order details`VALUES ('10687', '29', '123.7900', '10', '0'); +INSERT INTO `order details`VALUES ('10687', '36', '19.0000', '6', '0.25'); +INSERT INTO `order details`VALUES ('10688', '10', '31.0000', '18', '0.1'); +INSERT INTO `order details`VALUES ('10688', '28', '45.6000', '60', '0.1'); +INSERT INTO `order details`VALUES ('10688', '34', '14.0000', '14', '0'); +INSERT INTO `order details`VALUES ('10689', '1', '18.0000', '35', '0.25'); +INSERT INTO `order details`VALUES ('10690', '56', '38.0000', '20', '0.25'); +INSERT INTO `order details`VALUES ('10690', '77', '13.0000', '30', '0.25'); +INSERT INTO `order details`VALUES ('10691', '1', '18.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10691', '29', '123.7900', '40', '0'); +INSERT INTO `order details`VALUES ('10691', '43', '46.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10691', '44', '19.4500', '24', '0'); +INSERT INTO `order details`VALUES ('10691', '62', '49.3000', '48', '0'); +INSERT INTO `order details`VALUES ('10692', '63', '43.9000', '20', '0'); +INSERT INTO `order details`VALUES ('10693', '9', '97.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10693', '54', '7.4500', '60', '0.15'); +INSERT INTO `order details`VALUES ('10693', '69', '36.0000', '30', '0.15'); +INSERT INTO `order details`VALUES ('10693', '73', '15.0000', '15', '0.15'); +INSERT INTO `order details`VALUES ('10694', '7', '30.0000', '90', '0'); +INSERT INTO `order details`VALUES ('10694', '59', '55.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10694', '70', '15.0000', '50', '0'); +INSERT INTO `order details`VALUES ('10695', '8', '40.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10695', '12', '38.0000', '4', '0'); +INSERT INTO `order details`VALUES ('10695', '24', '4.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10696', '17', '39.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10696', '46', '12.0000', '18', '0'); +INSERT INTO `order details`VALUES ('10697', '19', '9.2000', '7', '0.25'); +INSERT INTO `order details`VALUES ('10697', '35', '18.0000', '9', '0.25'); +INSERT INTO `order details`VALUES ('10697', '58', '13.2500', '30', '0.25'); +INSERT INTO `order details`VALUES ('10697', '70', '15.0000', '30', '0.25'); +INSERT INTO `order details`VALUES ('10698', '11', '21.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10698', '17', '39.0000', '8', '0.05'); +INSERT INTO `order details`VALUES ('10698', '29', '123.7900', '12', '0.05'); +INSERT INTO `order details`VALUES ('10698', '65', '21.0500', '65', '0.05'); +INSERT INTO `order details`VALUES ('10698', '70', '15.0000', '8', '0.05'); +INSERT INTO `order details`VALUES ('10699', '47', '9.5000', '12', '0'); +INSERT INTO `order details`VALUES ('10700', '1', '18.0000', '5', '0.2'); +INSERT INTO `order details`VALUES ('10700', '34', '14.0000', '12', '0.2'); +INSERT INTO `order details`VALUES ('10700', '68', '12.5000', '40', '0.2'); +INSERT INTO `order details`VALUES ('10700', '71', '21.5000', '60', '0.2'); +INSERT INTO `order details`VALUES ('10701', '59', '55.0000', '42', '0.15'); +INSERT INTO `order details`VALUES ('10701', '71', '21.5000', '20', '0.15'); +INSERT INTO `order details`VALUES ('10701', '76', '18.0000', '35', '0.15'); +INSERT INTO `order details`VALUES ('10702', '3', '10.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10702', '76', '18.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10703', '2', '19.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10703', '59', '55.0000', '35', '0'); +INSERT INTO `order details`VALUES ('10703', '73', '15.0000', '35', '0'); +INSERT INTO `order details`VALUES ('10704', '4', '22.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10704', '24', '4.5000', '35', '0'); +INSERT INTO `order details`VALUES ('10704', '48', '12.7500', '24', '0'); +INSERT INTO `order details`VALUES ('10705', '31', '12.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10705', '32', '32.0000', '4', '0'); +INSERT INTO `order details`VALUES ('10706', '16', '17.4500', '20', '0'); +INSERT INTO `order details`VALUES ('10706', '43', '46.0000', '24', '0'); +INSERT INTO `order details`VALUES ('10706', '59', '55.0000', '8', '0'); +INSERT INTO `order details`VALUES ('10707', '55', '24.0000', '21', '0'); +INSERT INTO `order details`VALUES ('10707', '57', '19.5000', '40', '0'); +INSERT INTO `order details`VALUES ('10707', '70', '15.0000', '28', '0.15'); +INSERT INTO `order details`VALUES ('10708', '5', '21.3500', '4', '0'); +INSERT INTO `order details`VALUES ('10708', '36', '19.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10709', '8', '40.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10709', '51', '53.0000', '28', '0'); +INSERT INTO `order details`VALUES ('10709', '60', '34.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10710', '19', '9.2000', '5', '0'); +INSERT INTO `order details`VALUES ('10710', '47', '9.5000', '5', '0'); +INSERT INTO `order details`VALUES ('10711', '19', '9.2000', '12', '0'); +INSERT INTO `order details`VALUES ('10711', '41', '9.6500', '42', '0'); +INSERT INTO `order details`VALUES ('10711', '53', '32.8000', '120', '0'); +INSERT INTO `order details`VALUES ('10712', '53', '32.8000', '3', '0.05'); +INSERT INTO `order details`VALUES ('10712', '56', '38.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10713', '10', '31.0000', '18', '0'); +INSERT INTO `order details`VALUES ('10713', '26', '31.2300', '30', '0'); +INSERT INTO `order details`VALUES ('10713', '45', '9.5000', '110', '0'); +INSERT INTO `order details`VALUES ('10713', '46', '12.0000', '24', '0'); +INSERT INTO `order details`VALUES ('10714', '2', '19.0000', '30', '0.25'); +INSERT INTO `order details`VALUES ('10714', '17', '39.0000', '27', '0.25'); +INSERT INTO `order details`VALUES ('10714', '47', '9.5000', '50', '0.25'); +INSERT INTO `order details`VALUES ('10714', '56', '38.0000', '18', '0.25'); +INSERT INTO `order details`VALUES ('10714', '58', '13.2500', '12', '0.25'); +INSERT INTO `order details`VALUES ('10715', '10', '31.0000', '21', '0'); +INSERT INTO `order details`VALUES ('10715', '71', '21.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10716', '21', '10.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10716', '51', '53.0000', '7', '0'); +INSERT INTO `order details`VALUES ('10716', '61', '28.5000', '10', '0'); +INSERT INTO `order details`VALUES ('10717', '21', '10.0000', '32', '0.05'); +INSERT INTO `order details`VALUES ('10717', '54', '7.4500', '15', '0'); +INSERT INTO `order details`VALUES ('10717', '69', '36.0000', '25', '0.05'); +INSERT INTO `order details`VALUES ('10718', '12', '38.0000', '36', '0'); +INSERT INTO `order details`VALUES ('10718', '16', '17.4500', '20', '0'); +INSERT INTO `order details`VALUES ('10718', '36', '19.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10718', '62', '49.3000', '20', '0'); +INSERT INTO `order details`VALUES ('10719', '18', '62.5000', '12', '0.25'); +INSERT INTO `order details`VALUES ('10719', '30', '25.8900', '3', '0.25'); +INSERT INTO `order details`VALUES ('10719', '54', '7.4500', '40', '0.25'); +INSERT INTO `order details`VALUES ('10720', '35', '18.0000', '21', '0'); +INSERT INTO `order details`VALUES ('10720', '71', '21.5000', '8', '0'); +INSERT INTO `order details`VALUES ('10721', '44', '19.4500', '50', '0.05'); +INSERT INTO `order details`VALUES ('10722', '2', '19.0000', '3', '0'); +INSERT INTO `order details`VALUES ('10722', '31', '12.5000', '50', '0'); +INSERT INTO `order details`VALUES ('10722', '68', '12.5000', '45', '0'); +INSERT INTO `order details`VALUES ('10722', '75', '7.7500', '42', '0'); +INSERT INTO `order details`VALUES ('10723', '26', '31.2300', '15', '0'); +INSERT INTO `order details`VALUES ('10724', '10', '31.0000', '16', '0'); +INSERT INTO `order details`VALUES ('10724', '61', '28.5000', '5', '0'); +INSERT INTO `order details`VALUES ('10725', '41', '9.6500', '12', '0'); +INSERT INTO `order details`VALUES ('10725', '52', '7.0000', '4', '0'); +INSERT INTO `order details`VALUES ('10725', '55', '24.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10726', '4', '22.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10726', '11', '21.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10727', '17', '39.0000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10727', '56', '38.0000', '10', '0.05'); +INSERT INTO `order details`VALUES ('10727', '59', '55.0000', '10', '0.05'); +INSERT INTO `order details`VALUES ('10728', '30', '25.8900', '15', '0'); +INSERT INTO `order details`VALUES ('10728', '40', '18.4000', '6', '0'); +INSERT INTO `order details`VALUES ('10728', '55', '24.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10728', '60', '34.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10729', '1', '18.0000', '50', '0'); +INSERT INTO `order details`VALUES ('10729', '21', '10.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10729', '50', '16.2500', '40', '0'); +INSERT INTO `order details`VALUES ('10730', '16', '17.4500', '15', '0.05'); +INSERT INTO `order details`VALUES ('10730', '31', '12.5000', '3', '0.05'); +INSERT INTO `order details`VALUES ('10730', '65', '21.0500', '10', '0.05'); +INSERT INTO `order details`VALUES ('10731', '21', '10.0000', '40', '0.05'); +INSERT INTO `order details`VALUES ('10731', '51', '53.0000', '30', '0.05'); +INSERT INTO `order details`VALUES ('10732', '76', '18.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10733', '14', '23.2500', '16', '0'); +INSERT INTO `order details`VALUES ('10733', '28', '45.6000', '20', '0'); +INSERT INTO `order details`VALUES ('10733', '52', '7.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10734', '6', '25.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10734', '30', '25.8900', '15', '0'); +INSERT INTO `order details`VALUES ('10734', '76', '18.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10735', '61', '28.5000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10735', '77', '13.0000', '2', '0.1'); +INSERT INTO `order details`VALUES ('10736', '65', '21.0500', '40', '0'); +INSERT INTO `order details`VALUES ('10736', '75', '7.7500', '20', '0'); +INSERT INTO `order details`VALUES ('10737', '13', '6.0000', '4', '0'); +INSERT INTO `order details`VALUES ('10737', '41', '9.6500', '12', '0'); +INSERT INTO `order details`VALUES ('10738', '16', '17.4500', '3', '0'); +INSERT INTO `order details`VALUES ('10739', '36', '19.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10739', '52', '7.0000', '18', '0'); +INSERT INTO `order details`VALUES ('10740', '28', '45.6000', '5', '0.2'); +INSERT INTO `order details`VALUES ('10740', '35', '18.0000', '35', '0.2'); +INSERT INTO `order details`VALUES ('10740', '45', '9.5000', '40', '0.2'); +INSERT INTO `order details`VALUES ('10740', '56', '38.0000', '14', '0.2'); +INSERT INTO `order details`VALUES ('10741', '2', '19.0000', '15', '0.2'); +INSERT INTO `order details`VALUES ('10742', '3', '10.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10742', '60', '34.0000', '50', '0'); +INSERT INTO `order details`VALUES ('10742', '72', '34.8000', '35', '0'); +INSERT INTO `order details`VALUES ('10743', '46', '12.0000', '28', '0.05'); +INSERT INTO `order details`VALUES ('10744', '40', '18.4000', '50', '0.2'); +INSERT INTO `order details`VALUES ('10745', '18', '62.5000', '24', '0'); +INSERT INTO `order details`VALUES ('10745', '44', '19.4500', '16', '0'); +INSERT INTO `order details`VALUES ('10745', '59', '55.0000', '45', '0'); +INSERT INTO `order details`VALUES ('10745', '72', '34.8000', '7', '0'); +INSERT INTO `order details`VALUES ('10746', '13', '6.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10746', '42', '14.0000', '28', '0'); +INSERT INTO `order details`VALUES ('10746', '62', '49.3000', '9', '0'); +INSERT INTO `order details`VALUES ('10746', '69', '36.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10747', '31', '12.5000', '8', '0'); +INSERT INTO `order details`VALUES ('10747', '41', '9.6500', '35', '0'); +INSERT INTO `order details`VALUES ('10747', '63', '43.9000', '9', '0'); +INSERT INTO `order details`VALUES ('10747', '69', '36.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10748', '23', '9.0000', '44', '0'); +INSERT INTO `order details`VALUES ('10748', '40', '18.4000', '40', '0'); +INSERT INTO `order details`VALUES ('10748', '56', '38.0000', '28', '0'); +INSERT INTO `order details`VALUES ('10749', '56', '38.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10749', '59', '55.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10749', '76', '18.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10750', '14', '23.2500', '5', '0.15'); +INSERT INTO `order details`VALUES ('10750', '45', '9.5000', '40', '0.15'); +INSERT INTO `order details`VALUES ('10750', '59', '55.0000', '25', '0.15'); +INSERT INTO `order details`VALUES ('10751', '26', '31.2300', '12', '0.1'); +INSERT INTO `order details`VALUES ('10751', '30', '25.8900', '30', '0'); +INSERT INTO `order details`VALUES ('10751', '50', '16.2500', '20', '0.1'); +INSERT INTO `order details`VALUES ('10751', '73', '15.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10752', '1', '18.0000', '8', '0'); +INSERT INTO `order details`VALUES ('10752', '69', '36.0000', '3', '0'); +INSERT INTO `order details`VALUES ('10753', '45', '9.5000', '4', '0'); +INSERT INTO `order details`VALUES ('10753', '74', '10.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10754', '40', '18.4000', '3', '0'); +INSERT INTO `order details`VALUES ('10755', '47', '9.5000', '30', '0.25'); +INSERT INTO `order details`VALUES ('10755', '56', '38.0000', '30', '0.25'); +INSERT INTO `order details`VALUES ('10755', '57', '19.5000', '14', '0.25'); +INSERT INTO `order details`VALUES ('10755', '69', '36.0000', '25', '0.25'); +INSERT INTO `order details`VALUES ('10756', '18', '62.5000', '21', '0.2'); +INSERT INTO `order details`VALUES ('10756', '36', '19.0000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10756', '68', '12.5000', '6', '0.2'); +INSERT INTO `order details`VALUES ('10756', '69', '36.0000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10757', '34', '14.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10757', '59', '55.0000', '7', '0'); +INSERT INTO `order details`VALUES ('10757', '62', '49.3000', '30', '0'); +INSERT INTO `order details`VALUES ('10757', '64', '33.2500', '24', '0'); +INSERT INTO `order details`VALUES ('10758', '26', '31.2300', '20', '0'); +INSERT INTO `order details`VALUES ('10758', '52', '7.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10758', '70', '15.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10759', '32', '32.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10760', '25', '14.0000', '12', '0.25'); +INSERT INTO `order details`VALUES ('10760', '27', '43.9000', '40', '0'); +INSERT INTO `order details`VALUES ('10760', '43', '46.0000', '30', '0.25'); +INSERT INTO `order details`VALUES ('10761', '25', '14.0000', '35', '0.25'); +INSERT INTO `order details`VALUES ('10761', '75', '7.7500', '18', '0'); +INSERT INTO `order details`VALUES ('10762', '39', '18.0000', '16', '0'); +INSERT INTO `order details`VALUES ('10762', '47', '9.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10762', '51', '53.0000', '28', '0'); +INSERT INTO `order details`VALUES ('10762', '56', '38.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10763', '21', '10.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10763', '22', '21.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10763', '24', '4.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10764', '3', '10.0000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10764', '39', '18.0000', '130', '0.1'); +INSERT INTO `order details`VALUES ('10765', '65', '21.0500', '80', '0.1'); +INSERT INTO `order details`VALUES ('10766', '2', '19.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10766', '7', '30.0000', '35', '0'); +INSERT INTO `order details`VALUES ('10766', '68', '12.5000', '40', '0'); +INSERT INTO `order details`VALUES ('10767', '42', '14.0000', '2', '0'); +INSERT INTO `order details`VALUES ('10768', '22', '21.0000', '4', '0'); +INSERT INTO `order details`VALUES ('10768', '31', '12.5000', '50', '0'); +INSERT INTO `order details`VALUES ('10768', '60', '34.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10768', '71', '21.5000', '12', '0'); +INSERT INTO `order details`VALUES ('10769', '41', '9.6500', '30', '0.05'); +INSERT INTO `order details`VALUES ('10769', '52', '7.0000', '15', '0.05'); +INSERT INTO `order details`VALUES ('10769', '61', '28.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10769', '62', '49.3000', '15', '0'); +INSERT INTO `order details`VALUES ('10770', '11', '21.0000', '15', '0.25'); +INSERT INTO `order details`VALUES ('10771', '71', '21.5000', '16', '0'); +INSERT INTO `order details`VALUES ('10772', '29', '123.7900', '18', '0'); +INSERT INTO `order details`VALUES ('10772', '59', '55.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10773', '17', '39.0000', '33', '0'); +INSERT INTO `order details`VALUES ('10773', '31', '12.5000', '70', '0.2'); +INSERT INTO `order details`VALUES ('10773', '75', '7.7500', '7', '0.2'); +INSERT INTO `order details`VALUES ('10774', '31', '12.5000', '2', '0.25'); +INSERT INTO `order details`VALUES ('10774', '66', '17.0000', '50', '0'); +INSERT INTO `order details`VALUES ('10775', '10', '31.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10775', '67', '14.0000', '3', '0'); +INSERT INTO `order details`VALUES ('10776', '31', '12.5000', '16', '0.05'); +INSERT INTO `order details`VALUES ('10776', '42', '14.0000', '12', '0.05'); +INSERT INTO `order details`VALUES ('10776', '45', '9.5000', '27', '0.05'); +INSERT INTO `order details`VALUES ('10776', '51', '53.0000', '120', '0.05'); +INSERT INTO `order details`VALUES ('10777', '42', '14.0000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10778', '41', '9.6500', '10', '0'); +INSERT INTO `order details`VALUES ('10779', '16', '17.4500', '20', '0'); +INSERT INTO `order details`VALUES ('10779', '62', '49.3000', '20', '0'); +INSERT INTO `order details`VALUES ('10780', '70', '15.0000', '35', '0'); +INSERT INTO `order details`VALUES ('10780', '77', '13.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10781', '54', '7.4500', '3', '0.2'); +INSERT INTO `order details`VALUES ('10781', '56', '38.0000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10781', '74', '10.0000', '35', '0'); +INSERT INTO `order details`VALUES ('10782', '31', '12.5000', '1', '0'); +INSERT INTO `order details`VALUES ('10783', '31', '12.5000', '10', '0'); +INSERT INTO `order details`VALUES ('10783', '38', '263.5000', '5', '0'); +INSERT INTO `order details`VALUES ('10784', '36', '19.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10784', '39', '18.0000', '2', '0.15'); +INSERT INTO `order details`VALUES ('10784', '72', '34.8000', '30', '0.15'); +INSERT INTO `order details`VALUES ('10785', '10', '31.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10785', '75', '7.7500', '10', '0'); +INSERT INTO `order details`VALUES ('10786', '8', '40.0000', '30', '0.2'); +INSERT INTO `order details`VALUES ('10786', '30', '25.8900', '15', '0.2'); +INSERT INTO `order details`VALUES ('10786', '75', '7.7500', '42', '0.2'); +INSERT INTO `order details`VALUES ('10787', '2', '19.0000', '15', '0.05'); +INSERT INTO `order details`VALUES ('10787', '29', '123.7900', '20', '0.05'); +INSERT INTO `order details`VALUES ('10788', '19', '9.2000', '50', '0.05'); +INSERT INTO `order details`VALUES ('10788', '75', '7.7500', '40', '0.05'); +INSERT INTO `order details`VALUES ('10789', '18', '62.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10789', '35', '18.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10789', '63', '43.9000', '30', '0'); +INSERT INTO `order details`VALUES ('10789', '68', '12.5000', '18', '0'); +INSERT INTO `order details`VALUES ('10790', '7', '30.0000', '3', '0.15'); +INSERT INTO `order details`VALUES ('10790', '56', '38.0000', '20', '0.15'); +INSERT INTO `order details`VALUES ('10791', '29', '123.7900', '14', '0.05'); +INSERT INTO `order details`VALUES ('10791', '41', '9.6500', '20', '0.05'); +INSERT INTO `order details`VALUES ('10792', '2', '19.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10792', '54', '7.4500', '3', '0'); +INSERT INTO `order details`VALUES ('10792', '68', '12.5000', '15', '0'); +INSERT INTO `order details`VALUES ('10793', '41', '9.6500', '14', '0'); +INSERT INTO `order details`VALUES ('10793', '52', '7.0000', '8', '0'); +INSERT INTO `order details`VALUES ('10794', '14', '23.2500', '15', '0.2'); +INSERT INTO `order details`VALUES ('10794', '54', '7.4500', '6', '0.2'); +INSERT INTO `order details`VALUES ('10795', '16', '17.4500', '65', '0'); +INSERT INTO `order details`VALUES ('10795', '17', '39.0000', '35', '0.25'); +INSERT INTO `order details`VALUES ('10796', '26', '31.2300', '21', '0.2'); +INSERT INTO `order details`VALUES ('10796', '44', '19.4500', '10', '0'); +INSERT INTO `order details`VALUES ('10796', '64', '33.2500', '35', '0.2'); +INSERT INTO `order details`VALUES ('10796', '69', '36.0000', '24', '0.2'); +INSERT INTO `order details`VALUES ('10797', '11', '21.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10798', '62', '49.3000', '2', '0'); +INSERT INTO `order details`VALUES ('10798', '72', '34.8000', '10', '0'); +INSERT INTO `order details`VALUES ('10799', '13', '6.0000', '20', '0.15'); +INSERT INTO `order details`VALUES ('10799', '24', '4.5000', '20', '0.15'); +INSERT INTO `order details`VALUES ('10799', '59', '55.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10800', '11', '21.0000', '50', '0.1'); +INSERT INTO `order details`VALUES ('10800', '51', '53.0000', '10', '0.1'); +INSERT INTO `order details`VALUES ('10800', '54', '7.4500', '7', '0.1'); +INSERT INTO `order details`VALUES ('10801', '17', '39.0000', '40', '0.25'); +INSERT INTO `order details`VALUES ('10801', '29', '123.7900', '20', '0.25'); +INSERT INTO `order details`VALUES ('10802', '30', '25.8900', '25', '0.25'); +INSERT INTO `order details`VALUES ('10802', '51', '53.0000', '30', '0.25'); +INSERT INTO `order details`VALUES ('10802', '55', '24.0000', '60', '0.25'); +INSERT INTO `order details`VALUES ('10802', '62', '49.3000', '5', '0.25'); +INSERT INTO `order details`VALUES ('10803', '19', '9.2000', '24', '0.05'); +INSERT INTO `order details`VALUES ('10803', '25', '14.0000', '15', '0.05'); +INSERT INTO `order details`VALUES ('10803', '59', '55.0000', '15', '0.05'); +INSERT INTO `order details`VALUES ('10804', '10', '31.0000', '36', '0'); +INSERT INTO `order details`VALUES ('10804', '28', '45.6000', '24', '0'); +INSERT INTO `order details`VALUES ('10804', '49', '20.0000', '4', '0.15'); +INSERT INTO `order details`VALUES ('10805', '34', '14.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10805', '38', '263.5000', '10', '0'); +INSERT INTO `order details`VALUES ('10806', '2', '19.0000', '20', '0.25'); +INSERT INTO `order details`VALUES ('10806', '65', '21.0500', '2', '0'); +INSERT INTO `order details`VALUES ('10806', '74', '10.0000', '15', '0.25'); +INSERT INTO `order details`VALUES ('10807', '40', '18.4000', '1', '0'); +INSERT INTO `order details`VALUES ('10808', '56', '38.0000', '20', '0.15'); +INSERT INTO `order details`VALUES ('10808', '76', '18.0000', '50', '0.15'); +INSERT INTO `order details`VALUES ('10809', '52', '7.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10810', '13', '6.0000', '7', '0'); +INSERT INTO `order details`VALUES ('10810', '25', '14.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10810', '70', '15.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10811', '19', '9.2000', '15', '0'); +INSERT INTO `order details`VALUES ('10811', '23', '9.0000', '18', '0'); +INSERT INTO `order details`VALUES ('10811', '40', '18.4000', '30', '0'); +INSERT INTO `order details`VALUES ('10812', '31', '12.5000', '16', '0.1'); +INSERT INTO `order details`VALUES ('10812', '72', '34.8000', '40', '0.1'); +INSERT INTO `order details`VALUES ('10812', '77', '13.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10813', '2', '19.0000', '12', '0.2'); +INSERT INTO `order details`VALUES ('10813', '46', '12.0000', '35', '0'); +INSERT INTO `order details`VALUES ('10814', '41', '9.6500', '20', '0'); +INSERT INTO `order details`VALUES ('10814', '43', '46.0000', '20', '0.15'); +INSERT INTO `order details`VALUES ('10814', '48', '12.7500', '8', '0.15'); +INSERT INTO `order details`VALUES ('10814', '61', '28.5000', '30', '0.15'); +INSERT INTO `order details`VALUES ('10815', '33', '2.5000', '16', '0'); +INSERT INTO `order details`VALUES ('10816', '38', '263.5000', '30', '0.05'); +INSERT INTO `order details`VALUES ('10816', '62', '49.3000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10817', '26', '31.2300', '40', '0.15'); +INSERT INTO `order details`VALUES ('10817', '38', '263.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10817', '40', '18.4000', '60', '0.15'); +INSERT INTO `order details`VALUES ('10817', '62', '49.3000', '25', '0.15'); +INSERT INTO `order details`VALUES ('10818', '32', '32.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10818', '41', '9.6500', '20', '0'); +INSERT INTO `order details`VALUES ('10819', '43', '46.0000', '7', '0'); +INSERT INTO `order details`VALUES ('10819', '75', '7.7500', '20', '0'); +INSERT INTO `order details`VALUES ('10820', '56', '38.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10821', '35', '18.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10821', '51', '53.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10822', '62', '49.3000', '3', '0'); +INSERT INTO `order details`VALUES ('10822', '70', '15.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10823', '11', '21.0000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10823', '57', '19.5000', '15', '0'); +INSERT INTO `order details`VALUES ('10823', '59', '55.0000', '40', '0.1'); +INSERT INTO `order details`VALUES ('10823', '77', '13.0000', '15', '0.1'); +INSERT INTO `order details`VALUES ('10824', '41', '9.6500', '12', '0'); +INSERT INTO `order details`VALUES ('10824', '70', '15.0000', '9', '0'); +INSERT INTO `order details`VALUES ('10825', '26', '31.2300', '12', '0'); +INSERT INTO `order details`VALUES ('10825', '53', '32.8000', '20', '0'); +INSERT INTO `order details`VALUES ('10826', '31', '12.5000', '35', '0'); +INSERT INTO `order details`VALUES ('10826', '57', '19.5000', '15', '0'); +INSERT INTO `order details`VALUES ('10827', '10', '31.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10827', '39', '18.0000', '21', '0'); +INSERT INTO `order details`VALUES ('10828', '20', '81.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10828', '38', '263.5000', '2', '0'); +INSERT INTO `order details`VALUES ('10829', '2', '19.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10829', '8', '40.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10829', '13', '6.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10829', '60', '34.0000', '21', '0'); +INSERT INTO `order details`VALUES ('10830', '6', '25.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10830', '39', '18.0000', '28', '0'); +INSERT INTO `order details`VALUES ('10830', '60', '34.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10830', '68', '12.5000', '24', '0'); +INSERT INTO `order details`VALUES ('10831', '19', '9.2000', '2', '0'); +INSERT INTO `order details`VALUES ('10831', '35', '18.0000', '8', '0'); +INSERT INTO `order details`VALUES ('10831', '38', '263.5000', '8', '0'); +INSERT INTO `order details`VALUES ('10831', '43', '46.0000', '9', '0'); +INSERT INTO `order details`VALUES ('10832', '13', '6.0000', '3', '0.2'); +INSERT INTO `order details`VALUES ('10832', '25', '14.0000', '10', '0.2'); +INSERT INTO `order details`VALUES ('10832', '44', '19.4500', '16', '0.2'); +INSERT INTO `order details`VALUES ('10832', '64', '33.2500', '3', '0'); +INSERT INTO `order details`VALUES ('10833', '7', '30.0000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10833', '31', '12.5000', '9', '0.1'); +INSERT INTO `order details`VALUES ('10833', '53', '32.8000', '9', '0.1'); +INSERT INTO `order details`VALUES ('10834', '29', '123.7900', '8', '0.05'); +INSERT INTO `order details`VALUES ('10834', '30', '25.8900', '20', '0.05'); +INSERT INTO `order details`VALUES ('10835', '59', '55.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10835', '77', '13.0000', '2', '0.2'); +INSERT INTO `order details`VALUES ('10836', '22', '21.0000', '52', '0'); +INSERT INTO `order details`VALUES ('10836', '35', '18.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10836', '57', '19.5000', '24', '0'); +INSERT INTO `order details`VALUES ('10836', '60', '34.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10836', '64', '33.2500', '30', '0'); +INSERT INTO `order details`VALUES ('10837', '13', '6.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10837', '40', '18.4000', '25', '0'); +INSERT INTO `order details`VALUES ('10837', '47', '9.5000', '40', '0.25'); +INSERT INTO `order details`VALUES ('10837', '76', '18.0000', '21', '0.25'); +INSERT INTO `order details`VALUES ('10838', '1', '18.0000', '4', '0.25'); +INSERT INTO `order details`VALUES ('10838', '18', '62.5000', '25', '0.25'); +INSERT INTO `order details`VALUES ('10838', '36', '19.0000', '50', '0.25'); +INSERT INTO `order details`VALUES ('10839', '58', '13.2500', '30', '0.1'); +INSERT INTO `order details`VALUES ('10839', '72', '34.8000', '15', '0.1'); +INSERT INTO `order details`VALUES ('10840', '25', '14.0000', '6', '0.2'); +INSERT INTO `order details`VALUES ('10840', '39', '18.0000', '10', '0.2'); +INSERT INTO `order details`VALUES ('10841', '10', '31.0000', '16', '0'); +INSERT INTO `order details`VALUES ('10841', '56', '38.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10841', '59', '55.0000', '50', '0'); +INSERT INTO `order details`VALUES ('10841', '77', '13.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10842', '11', '21.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10842', '43', '46.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10842', '68', '12.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10842', '70', '15.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10843', '51', '53.0000', '4', '0.25'); +INSERT INTO `order details`VALUES ('10844', '22', '21.0000', '35', '0'); +INSERT INTO `order details`VALUES ('10845', '23', '9.0000', '70', '0.1'); +INSERT INTO `order details`VALUES ('10845', '35', '18.0000', '25', '0.1'); +INSERT INTO `order details`VALUES ('10845', '42', '14.0000', '42', '0.1'); +INSERT INTO `order details`VALUES ('10845', '58', '13.2500', '60', '0.1'); +INSERT INTO `order details`VALUES ('10845', '64', '33.2500', '48', '0'); +INSERT INTO `order details`VALUES ('10846', '4', '22.0000', '21', '0'); +INSERT INTO `order details`VALUES ('10846', '70', '15.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10846', '74', '10.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10847', '1', '18.0000', '80', '0.2'); +INSERT INTO `order details`VALUES ('10847', '19', '9.2000', '12', '0.2'); +INSERT INTO `order details`VALUES ('10847', '37', '26.0000', '60', '0.2'); +INSERT INTO `order details`VALUES ('10847', '45', '9.5000', '36', '0.2'); +INSERT INTO `order details`VALUES ('10847', '60', '34.0000', '45', '0.2'); +INSERT INTO `order details`VALUES ('10847', '71', '21.5000', '55', '0.2'); +INSERT INTO `order details`VALUES ('10848', '5', '21.3500', '30', '0'); +INSERT INTO `order details`VALUES ('10848', '9', '97.0000', '3', '0'); +INSERT INTO `order details`VALUES ('10849', '3', '10.0000', '49', '0'); +INSERT INTO `order details`VALUES ('10849', '26', '31.2300', '18', '0.15'); +INSERT INTO `order details`VALUES ('10850', '25', '14.0000', '20', '0.15'); +INSERT INTO `order details`VALUES ('10850', '33', '2.5000', '4', '0.15'); +INSERT INTO `order details`VALUES ('10850', '70', '15.0000', '30', '0.15'); +INSERT INTO `order details`VALUES ('10851', '2', '19.0000', '5', '0.05'); +INSERT INTO `order details`VALUES ('10851', '25', '14.0000', '10', '0.05'); +INSERT INTO `order details`VALUES ('10851', '57', '19.5000', '10', '0.05'); +INSERT INTO `order details`VALUES ('10851', '59', '55.0000', '42', '0.05'); +INSERT INTO `order details`VALUES ('10852', '2', '19.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10852', '17', '39.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10852', '62', '49.3000', '50', '0'); +INSERT INTO `order details`VALUES ('10853', '18', '62.5000', '10', '0'); +INSERT INTO `order details`VALUES ('10854', '10', '31.0000', '100', '0.15'); +INSERT INTO `order details`VALUES ('10854', '13', '6.0000', '65', '0.15'); +INSERT INTO `order details`VALUES ('10855', '16', '17.4500', '50', '0'); +INSERT INTO `order details`VALUES ('10855', '31', '12.5000', '14', '0'); +INSERT INTO `order details`VALUES ('10855', '56', '38.0000', '24', '0'); +INSERT INTO `order details`VALUES ('10855', '65', '21.0500', '15', '0.15'); +INSERT INTO `order details`VALUES ('10856', '2', '19.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10856', '42', '14.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10857', '3', '10.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10857', '26', '31.2300', '35', '0.25'); +INSERT INTO `order details`VALUES ('10857', '29', '123.7900', '10', '0.25'); +INSERT INTO `order details`VALUES ('10858', '7', '30.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10858', '27', '43.9000', '10', '0'); +INSERT INTO `order details`VALUES ('10858', '70', '15.0000', '4', '0'); +INSERT INTO `order details`VALUES ('10859', '24', '4.5000', '40', '0.25'); +INSERT INTO `order details`VALUES ('10859', '54', '7.4500', '35', '0.25'); +INSERT INTO `order details`VALUES ('10859', '64', '33.2500', '30', '0.25'); +INSERT INTO `order details`VALUES ('10860', '51', '53.0000', '3', '0'); +INSERT INTO `order details`VALUES ('10860', '76', '18.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10861', '17', '39.0000', '42', '0'); +INSERT INTO `order details`VALUES ('10861', '18', '62.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10861', '21', '10.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10861', '33', '2.5000', '35', '0'); +INSERT INTO `order details`VALUES ('10861', '62', '49.3000', '3', '0'); +INSERT INTO `order details`VALUES ('10862', '11', '21.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10862', '52', '7.0000', '8', '0'); +INSERT INTO `order details`VALUES ('10863', '1', '18.0000', '20', '0.15'); +INSERT INTO `order details`VALUES ('10863', '58', '13.2500', '12', '0.15'); +INSERT INTO `order details`VALUES ('10864', '35', '18.0000', '4', '0'); +INSERT INTO `order details`VALUES ('10864', '67', '14.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10865', '38', '263.5000', '60', '0.05'); +INSERT INTO `order details`VALUES ('10865', '39', '18.0000', '80', '0.05'); +INSERT INTO `order details`VALUES ('10866', '2', '19.0000', '21', '0.25'); +INSERT INTO `order details`VALUES ('10866', '24', '4.5000', '6', '0.25'); +INSERT INTO `order details`VALUES ('10866', '30', '25.8900', '40', '0.25'); +INSERT INTO `order details`VALUES ('10867', '53', '32.8000', '3', '0'); +INSERT INTO `order details`VALUES ('10868', '26', '31.2300', '20', '0'); +INSERT INTO `order details`VALUES ('10868', '35', '18.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10868', '49', '20.0000', '42', '0.1'); +INSERT INTO `order details`VALUES ('10869', '1', '18.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10869', '11', '21.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10869', '23', '9.0000', '50', '0'); +INSERT INTO `order details`VALUES ('10869', '68', '12.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10870', '35', '18.0000', '3', '0'); +INSERT INTO `order details`VALUES ('10870', '51', '53.0000', '2', '0'); +INSERT INTO `order details`VALUES ('10871', '6', '25.0000', '50', '0.05'); +INSERT INTO `order details`VALUES ('10871', '16', '17.4500', '12', '0.05'); +INSERT INTO `order details`VALUES ('10871', '17', '39.0000', '16', '0.05'); +INSERT INTO `order details`VALUES ('10872', '55', '24.0000', '10', '0.05'); +INSERT INTO `order details`VALUES ('10872', '62', '49.3000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10872', '64', '33.2500', '15', '0.05'); +INSERT INTO `order details`VALUES ('10872', '65', '21.0500', '21', '0.05'); +INSERT INTO `order details`VALUES ('10873', '21', '10.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10873', '28', '45.6000', '3', '0'); +INSERT INTO `order details`VALUES ('10874', '10', '31.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10875', '19', '9.2000', '25', '0'); +INSERT INTO `order details`VALUES ('10875', '47', '9.5000', '21', '0.1'); +INSERT INTO `order details`VALUES ('10875', '49', '20.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10876', '46', '12.0000', '21', '0'); +INSERT INTO `order details`VALUES ('10876', '64', '33.2500', '20', '0'); +INSERT INTO `order details`VALUES ('10877', '16', '17.4500', '30', '0.25'); +INSERT INTO `order details`VALUES ('10877', '18', '62.5000', '25', '0'); +INSERT INTO `order details`VALUES ('10878', '20', '81.0000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10879', '40', '18.4000', '12', '0'); +INSERT INTO `order details`VALUES ('10879', '65', '21.0500', '10', '0'); +INSERT INTO `order details`VALUES ('10879', '76', '18.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10880', '23', '9.0000', '30', '0.2'); +INSERT INTO `order details`VALUES ('10880', '61', '28.5000', '30', '0.2'); +INSERT INTO `order details`VALUES ('10880', '70', '15.0000', '50', '0.2'); +INSERT INTO `order details`VALUES ('10881', '73', '15.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10882', '42', '14.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10882', '49', '20.0000', '20', '0.15'); +INSERT INTO `order details`VALUES ('10882', '54', '7.4500', '32', '0.15'); +INSERT INTO `order details`VALUES ('10883', '24', '4.5000', '8', '0'); +INSERT INTO `order details`VALUES ('10884', '21', '10.0000', '40', '0.05'); +INSERT INTO `order details`VALUES ('10884', '56', '38.0000', '21', '0.05'); +INSERT INTO `order details`VALUES ('10884', '65', '21.0500', '12', '0.05'); +INSERT INTO `order details`VALUES ('10885', '2', '19.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10885', '24', '4.5000', '12', '0'); +INSERT INTO `order details`VALUES ('10885', '70', '15.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10885', '77', '13.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10886', '10', '31.0000', '70', '0'); +INSERT INTO `order details`VALUES ('10886', '31', '12.5000', '35', '0'); +INSERT INTO `order details`VALUES ('10886', '77', '13.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10887', '25', '14.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10888', '2', '19.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10888', '68', '12.5000', '18', '0'); +INSERT INTO `order details`VALUES ('10889', '11', '21.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10889', '38', '263.5000', '40', '0'); +INSERT INTO `order details`VALUES ('10890', '17', '39.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10890', '34', '14.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10890', '41', '9.6500', '14', '0'); +INSERT INTO `order details`VALUES ('10891', '30', '25.8900', '15', '0.05'); +INSERT INTO `order details`VALUES ('10892', '59', '55.0000', '40', '0.05'); +INSERT INTO `order details`VALUES ('10893', '8', '40.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10893', '24', '4.5000', '10', '0'); +INSERT INTO `order details`VALUES ('10893', '29', '123.7900', '24', '0'); +INSERT INTO `order details`VALUES ('10893', '30', '25.8900', '35', '0'); +INSERT INTO `order details`VALUES ('10893', '36', '19.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10894', '13', '6.0000', '28', '0.05'); +INSERT INTO `order details`VALUES ('10894', '69', '36.0000', '50', '0.05'); +INSERT INTO `order details`VALUES ('10894', '75', '7.7500', '120', '0.05'); +INSERT INTO `order details`VALUES ('10895', '24', '4.5000', '110', '0'); +INSERT INTO `order details`VALUES ('10895', '39', '18.0000', '45', '0'); +INSERT INTO `order details`VALUES ('10895', '40', '18.4000', '91', '0'); +INSERT INTO `order details`VALUES ('10895', '60', '34.0000', '100', '0'); +INSERT INTO `order details`VALUES ('10896', '45', '9.5000', '15', '0'); +INSERT INTO `order details`VALUES ('10896', '56', '38.0000', '16', '0'); +INSERT INTO `order details`VALUES ('10897', '29', '123.7900', '80', '0'); +INSERT INTO `order details`VALUES ('10897', '30', '25.8900', '36', '0'); +INSERT INTO `order details`VALUES ('10898', '13', '6.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10899', '39', '18.0000', '8', '0.15'); +INSERT INTO `order details`VALUES ('10900', '70', '15.0000', '3', '0.25'); +INSERT INTO `order details`VALUES ('10901', '41', '9.6500', '30', '0'); +INSERT INTO `order details`VALUES ('10901', '71', '21.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10902', '55', '24.0000', '30', '0.15'); +INSERT INTO `order details`VALUES ('10902', '62', '49.3000', '6', '0.15'); +INSERT INTO `order details`VALUES ('10903', '13', '6.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10903', '65', '21.0500', '21', '0'); +INSERT INTO `order details`VALUES ('10903', '68', '12.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10904', '58', '13.2500', '15', '0'); +INSERT INTO `order details`VALUES ('10904', '62', '49.3000', '35', '0'); +INSERT INTO `order details`VALUES ('10905', '1', '18.0000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10906', '61', '28.5000', '15', '0'); +INSERT INTO `order details`VALUES ('10907', '75', '7.7500', '14', '0'); +INSERT INTO `order details`VALUES ('10908', '7', '30.0000', '20', '0.05'); +INSERT INTO `order details`VALUES ('10908', '52', '7.0000', '14', '0.05'); +INSERT INTO `order details`VALUES ('10909', '7', '30.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10909', '16', '17.4500', '15', '0'); +INSERT INTO `order details`VALUES ('10909', '41', '9.6500', '5', '0'); +INSERT INTO `order details`VALUES ('10910', '19', '9.2000', '12', '0'); +INSERT INTO `order details`VALUES ('10910', '49', '20.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10910', '61', '28.5000', '5', '0'); +INSERT INTO `order details`VALUES ('10911', '1', '18.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10911', '17', '39.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10911', '67', '14.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10912', '11', '21.0000', '40', '0.25'); +INSERT INTO `order details`VALUES ('10912', '29', '123.7900', '60', '0.25'); +INSERT INTO `order details`VALUES ('10913', '4', '22.0000', '30', '0.25'); +INSERT INTO `order details`VALUES ('10913', '33', '2.5000', '40', '0.25'); +INSERT INTO `order details`VALUES ('10913', '58', '13.2500', '15', '0'); +INSERT INTO `order details`VALUES ('10914', '71', '21.5000', '25', '0'); +INSERT INTO `order details`VALUES ('10915', '17', '39.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10915', '33', '2.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10915', '54', '7.4500', '10', '0'); +INSERT INTO `order details`VALUES ('10916', '16', '17.4500', '6', '0'); +INSERT INTO `order details`VALUES ('10916', '32', '32.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10916', '57', '19.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10917', '30', '25.8900', '1', '0'); +INSERT INTO `order details`VALUES ('10917', '60', '34.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10918', '1', '18.0000', '60', '0.25'); +INSERT INTO `order details`VALUES ('10918', '60', '34.0000', '25', '0.25'); +INSERT INTO `order details`VALUES ('10919', '16', '17.4500', '24', '0'); +INSERT INTO `order details`VALUES ('10919', '25', '14.0000', '24', '0'); +INSERT INTO `order details`VALUES ('10919', '40', '18.4000', '20', '0'); +INSERT INTO `order details`VALUES ('10920', '50', '16.2500', '24', '0'); +INSERT INTO `order details`VALUES ('10921', '35', '18.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10921', '63', '43.9000', '40', '0'); +INSERT INTO `order details`VALUES ('10922', '17', '39.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10922', '24', '4.5000', '35', '0'); +INSERT INTO `order details`VALUES ('10923', '42', '14.0000', '10', '0.2'); +INSERT INTO `order details`VALUES ('10923', '43', '46.0000', '10', '0.2'); +INSERT INTO `order details`VALUES ('10923', '67', '14.0000', '24', '0.2'); +INSERT INTO `order details`VALUES ('10924', '10', '31.0000', '20', '0.1'); +INSERT INTO `order details`VALUES ('10924', '28', '45.6000', '30', '0.1'); +INSERT INTO `order details`VALUES ('10924', '75', '7.7500', '6', '0'); +INSERT INTO `order details`VALUES ('10925', '36', '19.0000', '25', '0.15'); +INSERT INTO `order details`VALUES ('10925', '52', '7.0000', '12', '0.15'); +INSERT INTO `order details`VALUES ('10926', '11', '21.0000', '2', '0'); +INSERT INTO `order details`VALUES ('10926', '13', '6.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10926', '19', '9.2000', '7', '0'); +INSERT INTO `order details`VALUES ('10926', '72', '34.8000', '10', '0'); +INSERT INTO `order details`VALUES ('10927', '20', '81.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10927', '52', '7.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10927', '76', '18.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10928', '47', '9.5000', '5', '0'); +INSERT INTO `order details`VALUES ('10928', '76', '18.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10929', '21', '10.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10929', '75', '7.7500', '49', '0'); +INSERT INTO `order details`VALUES ('10929', '77', '13.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10930', '21', '10.0000', '36', '0'); +INSERT INTO `order details`VALUES ('10930', '27', '43.9000', '25', '0'); +INSERT INTO `order details`VALUES ('10930', '55', '24.0000', '25', '0.2'); +INSERT INTO `order details`VALUES ('10930', '58', '13.2500', '30', '0.2'); +INSERT INTO `order details`VALUES ('10931', '13', '6.0000', '42', '0.15'); +INSERT INTO `order details`VALUES ('10931', '57', '19.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10932', '16', '17.4500', '30', '0.1'); +INSERT INTO `order details`VALUES ('10932', '62', '49.3000', '14', '0.1'); +INSERT INTO `order details`VALUES ('10932', '72', '34.8000', '16', '0'); +INSERT INTO `order details`VALUES ('10932', '75', '7.7500', '20', '0.1'); +INSERT INTO `order details`VALUES ('10933', '53', '32.8000', '2', '0'); +INSERT INTO `order details`VALUES ('10933', '61', '28.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10934', '6', '25.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10935', '1', '18.0000', '21', '0'); +INSERT INTO `order details`VALUES ('10935', '18', '62.5000', '4', '0.25'); +INSERT INTO `order details`VALUES ('10935', '23', '9.0000', '8', '0.25'); +INSERT INTO `order details`VALUES ('10936', '36', '19.0000', '30', '0.2'); +INSERT INTO `order details`VALUES ('10937', '28', '45.6000', '8', '0'); +INSERT INTO `order details`VALUES ('10937', '34', '14.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10938', '13', '6.0000', '20', '0.25'); +INSERT INTO `order details`VALUES ('10938', '43', '46.0000', '24', '0.25'); +INSERT INTO `order details`VALUES ('10938', '60', '34.0000', '49', '0.25'); +INSERT INTO `order details`VALUES ('10938', '71', '21.5000', '35', '0.25'); +INSERT INTO `order details`VALUES ('10939', '2', '19.0000', '10', '0.15'); +INSERT INTO `order details`VALUES ('10939', '67', '14.0000', '40', '0.15'); +INSERT INTO `order details`VALUES ('10940', '7', '30.0000', '8', '0'); +INSERT INTO `order details`VALUES ('10940', '13', '6.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10941', '31', '12.5000', '44', '0.25'); +INSERT INTO `order details`VALUES ('10941', '62', '49.3000', '30', '0.25'); +INSERT INTO `order details`VALUES ('10941', '68', '12.5000', '80', '0.25'); +INSERT INTO `order details`VALUES ('10941', '72', '34.8000', '50', '0'); +INSERT INTO `order details`VALUES ('10942', '49', '20.0000', '28', '0'); +INSERT INTO `order details`VALUES ('10943', '13', '6.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10943', '22', '21.0000', '21', '0'); +INSERT INTO `order details`VALUES ('10943', '46', '12.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10944', '11', '21.0000', '5', '0.25'); +INSERT INTO `order details`VALUES ('10944', '44', '19.4500', '18', '0.25'); +INSERT INTO `order details`VALUES ('10944', '56', '38.0000', '18', '0'); +INSERT INTO `order details`VALUES ('10945', '13', '6.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10945', '31', '12.5000', '10', '0'); +INSERT INTO `order details`VALUES ('10946', '10', '31.0000', '25', '0'); +INSERT INTO `order details`VALUES ('10946', '24', '4.5000', '25', '0'); +INSERT INTO `order details`VALUES ('10946', '77', '13.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10947', '59', '55.0000', '4', '0'); +INSERT INTO `order details`VALUES ('10948', '50', '16.2500', '9', '0'); +INSERT INTO `order details`VALUES ('10948', '51', '53.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10948', '55', '24.0000', '4', '0'); +INSERT INTO `order details`VALUES ('10949', '6', '25.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10949', '10', '31.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10949', '17', '39.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10949', '62', '49.3000', '60', '0'); +INSERT INTO `order details`VALUES ('10950', '4', '22.0000', '5', '0'); +INSERT INTO `order details`VALUES ('10951', '33', '2.5000', '15', '0.05'); +INSERT INTO `order details`VALUES ('10951', '41', '9.6500', '6', '0.05'); +INSERT INTO `order details`VALUES ('10951', '75', '7.7500', '50', '0.05'); +INSERT INTO `order details`VALUES ('10952', '6', '25.0000', '16', '0.05'); +INSERT INTO `order details`VALUES ('10952', '28', '45.6000', '2', '0'); +INSERT INTO `order details`VALUES ('10953', '20', '81.0000', '50', '0.05'); +INSERT INTO `order details`VALUES ('10953', '31', '12.5000', '50', '0.05'); +INSERT INTO `order details`VALUES ('10954', '16', '17.4500', '28', '0.15'); +INSERT INTO `order details`VALUES ('10954', '31', '12.5000', '25', '0.15'); +INSERT INTO `order details`VALUES ('10954', '45', '9.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10954', '60', '34.0000', '24', '0.15'); +INSERT INTO `order details`VALUES ('10955', '75', '7.7500', '12', '0.2'); +INSERT INTO `order details`VALUES ('10956', '21', '10.0000', '12', '0'); +INSERT INTO `order details`VALUES ('10956', '47', '9.5000', '14', '0'); +INSERT INTO `order details`VALUES ('10956', '51', '53.0000', '8', '0'); +INSERT INTO `order details`VALUES ('10957', '30', '25.8900', '30', '0'); +INSERT INTO `order details`VALUES ('10957', '35', '18.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10957', '64', '33.2500', '8', '0'); +INSERT INTO `order details`VALUES ('10958', '5', '21.3500', '20', '0'); +INSERT INTO `order details`VALUES ('10958', '7', '30.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10958', '72', '34.8000', '5', '0'); +INSERT INTO `order details`VALUES ('10959', '75', '7.7500', '20', '0.15'); +INSERT INTO `order details`VALUES ('10960', '24', '4.5000', '10', '0.25'); +INSERT INTO `order details`VALUES ('10960', '41', '9.6500', '24', '0'); +INSERT INTO `order details`VALUES ('10961', '52', '7.0000', '6', '0.05'); +INSERT INTO `order details`VALUES ('10961', '76', '18.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10962', '7', '30.0000', '45', '0'); +INSERT INTO `order details`VALUES ('10962', '13', '6.0000', '77', '0'); +INSERT INTO `order details`VALUES ('10962', '53', '32.8000', '20', '0'); +INSERT INTO `order details`VALUES ('10962', '69', '36.0000', '9', '0'); +INSERT INTO `order details`VALUES ('10962', '76', '18.0000', '44', '0'); +INSERT INTO `order details`VALUES ('10963', '60', '34.0000', '2', '0.15'); +INSERT INTO `order details`VALUES ('10964', '18', '62.5000', '6', '0'); +INSERT INTO `order details`VALUES ('10964', '38', '263.5000', '5', '0'); +INSERT INTO `order details`VALUES ('10964', '69', '36.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10965', '51', '53.0000', '16', '0'); +INSERT INTO `order details`VALUES ('10966', '37', '26.0000', '8', '0'); +INSERT INTO `order details`VALUES ('10966', '56', '38.0000', '12', '0.15'); +INSERT INTO `order details`VALUES ('10966', '62', '49.3000', '12', '0.15'); +INSERT INTO `order details`VALUES ('10967', '19', '9.2000', '12', '0'); +INSERT INTO `order details`VALUES ('10967', '49', '20.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10968', '12', '38.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10968', '24', '4.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10968', '64', '33.2500', '4', '0'); +INSERT INTO `order details`VALUES ('10969', '46', '12.0000', '9', '0'); +INSERT INTO `order details`VALUES ('10970', '52', '7.0000', '40', '0.2'); +INSERT INTO `order details`VALUES ('10971', '29', '123.7900', '14', '0'); +INSERT INTO `order details`VALUES ('10972', '17', '39.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10972', '33', '2.5000', '7', '0'); +INSERT INTO `order details`VALUES ('10973', '26', '31.2300', '5', '0'); +INSERT INTO `order details`VALUES ('10973', '41', '9.6500', '6', '0'); +INSERT INTO `order details`VALUES ('10973', '75', '7.7500', '10', '0'); +INSERT INTO `order details`VALUES ('10974', '63', '43.9000', '10', '0'); +INSERT INTO `order details`VALUES ('10975', '8', '40.0000', '16', '0'); +INSERT INTO `order details`VALUES ('10975', '75', '7.7500', '10', '0'); +INSERT INTO `order details`VALUES ('10976', '28', '45.6000', '20', '0'); +INSERT INTO `order details`VALUES ('10977', '39', '18.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10977', '47', '9.5000', '30', '0'); +INSERT INTO `order details`VALUES ('10977', '51', '53.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10977', '63', '43.9000', '20', '0'); +INSERT INTO `order details`VALUES ('10978', '8', '40.0000', '20', '0.15'); +INSERT INTO `order details`VALUES ('10978', '21', '10.0000', '40', '0.15'); +INSERT INTO `order details`VALUES ('10978', '40', '18.4000', '10', '0'); +INSERT INTO `order details`VALUES ('10978', '44', '19.4500', '6', '0.15'); +INSERT INTO `order details`VALUES ('10979', '7', '30.0000', '18', '0'); +INSERT INTO `order details`VALUES ('10979', '12', '38.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10979', '24', '4.5000', '80', '0'); +INSERT INTO `order details`VALUES ('10979', '27', '43.9000', '30', '0'); +INSERT INTO `order details`VALUES ('10979', '31', '12.5000', '24', '0'); +INSERT INTO `order details`VALUES ('10979', '63', '43.9000', '35', '0'); +INSERT INTO `order details`VALUES ('10980', '75', '7.7500', '40', '0.2'); +INSERT INTO `order details`VALUES ('10981', '38', '263.5000', '60', '0'); +INSERT INTO `order details`VALUES ('10982', '7', '30.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10982', '43', '46.0000', '9', '0'); +INSERT INTO `order details`VALUES ('10983', '13', '6.0000', '84', '0.15'); +INSERT INTO `order details`VALUES ('10983', '57', '19.5000', '15', '0'); +INSERT INTO `order details`VALUES ('10984', '16', '17.4500', '55', '0'); +INSERT INTO `order details`VALUES ('10984', '24', '4.5000', '20', '0'); +INSERT INTO `order details`VALUES ('10984', '36', '19.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10985', '16', '17.4500', '36', '0.1'); +INSERT INTO `order details`VALUES ('10985', '18', '62.5000', '8', '0.1'); +INSERT INTO `order details`VALUES ('10985', '32', '32.0000', '35', '0.1'); +INSERT INTO `order details`VALUES ('10986', '11', '21.0000', '30', '0'); +INSERT INTO `order details`VALUES ('10986', '20', '81.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10986', '76', '18.0000', '10', '0'); +INSERT INTO `order details`VALUES ('10986', '77', '13.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10987', '7', '30.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10987', '43', '46.0000', '6', '0'); +INSERT INTO `order details`VALUES ('10987', '72', '34.8000', '20', '0'); +INSERT INTO `order details`VALUES ('10988', '7', '30.0000', '60', '0'); +INSERT INTO `order details`VALUES ('10988', '62', '49.3000', '40', '0.1'); +INSERT INTO `order details`VALUES ('10989', '6', '25.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10989', '11', '21.0000', '15', '0'); +INSERT INTO `order details`VALUES ('10989', '41', '9.6500', '4', '0'); +INSERT INTO `order details`VALUES ('10990', '21', '10.0000', '65', '0'); +INSERT INTO `order details`VALUES ('10990', '34', '14.0000', '60', '0.15'); +INSERT INTO `order details`VALUES ('10990', '55', '24.0000', '65', '0.15'); +INSERT INTO `order details`VALUES ('10990', '61', '28.5000', '66', '0.15'); +INSERT INTO `order details`VALUES ('10991', '2', '19.0000', '50', '0.2'); +INSERT INTO `order details`VALUES ('10991', '70', '15.0000', '20', '0.2'); +INSERT INTO `order details`VALUES ('10991', '76', '18.0000', '90', '0.2'); +INSERT INTO `order details`VALUES ('10992', '72', '34.8000', '2', '0'); +INSERT INTO `order details`VALUES ('10993', '29', '123.7900', '50', '0.25'); +INSERT INTO `order details`VALUES ('10993', '41', '9.6500', '35', '0.25'); +INSERT INTO `order details`VALUES ('10994', '59', '55.0000', '18', '0.05'); +INSERT INTO `order details`VALUES ('10995', '51', '53.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10995', '60', '34.0000', '4', '0'); +INSERT INTO `order details`VALUES ('10996', '42', '14.0000', '40', '0'); +INSERT INTO `order details`VALUES ('10997', '32', '32.0000', '50', '0'); +INSERT INTO `order details`VALUES ('10997', '46', '12.0000', '20', '0.25'); +INSERT INTO `order details`VALUES ('10997', '52', '7.0000', '20', '0.25'); +INSERT INTO `order details`VALUES ('10998', '24', '4.5000', '12', '0'); +INSERT INTO `order details`VALUES ('10998', '61', '28.5000', '7', '0'); +INSERT INTO `order details`VALUES ('10998', '74', '10.0000', '20', '0'); +INSERT INTO `order details`VALUES ('10998', '75', '7.7500', '30', '0'); +INSERT INTO `order details`VALUES ('10999', '41', '9.6500', '20', '0.05'); +INSERT INTO `order details`VALUES ('10999', '51', '53.0000', '15', '0.05'); +INSERT INTO `order details`VALUES ('10999', '77', '13.0000', '21', '0.05'); +INSERT INTO `order details`VALUES ('11000', '4', '22.0000', '25', '0.25'); +INSERT INTO `order details`VALUES ('11000', '24', '4.5000', '30', '0.25'); +INSERT INTO `order details`VALUES ('11000', '77', '13.0000', '30', '0'); +INSERT INTO `order details`VALUES ('11001', '7', '30.0000', '60', '0'); +INSERT INTO `order details`VALUES ('11001', '22', '21.0000', '25', '0'); +INSERT INTO `order details`VALUES ('11001', '46', '12.0000', '25', '0'); +INSERT INTO `order details`VALUES ('11001', '55', '24.0000', '6', '0'); +INSERT INTO `order details`VALUES ('11002', '13', '6.0000', '56', '0'); +INSERT INTO `order details`VALUES ('11002', '35', '18.0000', '15', '0.15'); +INSERT INTO `order details`VALUES ('11002', '42', '14.0000', '24', '0.15'); +INSERT INTO `order details`VALUES ('11002', '55', '24.0000', '40', '0'); +INSERT INTO `order details`VALUES ('11003', '1', '18.0000', '4', '0'); +INSERT INTO `order details`VALUES ('11003', '40', '18.4000', '10', '0'); +INSERT INTO `order details`VALUES ('11003', '52', '7.0000', '10', '0'); +INSERT INTO `order details`VALUES ('11004', '26', '31.2300', '6', '0'); +INSERT INTO `order details`VALUES ('11004', '76', '18.0000', '6', '0'); +INSERT INTO `order details`VALUES ('11005', '1', '18.0000', '2', '0'); +INSERT INTO `order details`VALUES ('11005', '59', '55.0000', '10', '0'); +INSERT INTO `order details`VALUES ('11006', '1', '18.0000', '8', '0'); +INSERT INTO `order details`VALUES ('11006', '29', '123.7900', '2', '0.25'); +INSERT INTO `order details`VALUES ('11007', '8', '40.0000', '30', '0'); +INSERT INTO `order details`VALUES ('11007', '29', '123.7900', '10', '0'); +INSERT INTO `order details`VALUES ('11007', '42', '14.0000', '14', '0'); +INSERT INTO `order details`VALUES ('11008', '28', '45.6000', '70', '0.05'); +INSERT INTO `order details`VALUES ('11008', '34', '14.0000', '90', '0.05'); +INSERT INTO `order details`VALUES ('11008', '71', '21.5000', '21', '0'); +INSERT INTO `order details`VALUES ('11009', '24', '4.5000', '12', '0'); +INSERT INTO `order details`VALUES ('11009', '36', '19.0000', '18', '0.25'); +INSERT INTO `order details`VALUES ('11009', '60', '34.0000', '9', '0'); +INSERT INTO `order details`VALUES ('11010', '7', '30.0000', '20', '0'); +INSERT INTO `order details`VALUES ('11010', '24', '4.5000', '10', '0'); +INSERT INTO `order details`VALUES ('11011', '58', '13.2500', '40', '0.05'); +INSERT INTO `order details`VALUES ('11011', '71', '21.5000', '20', '0'); +INSERT INTO `order details`VALUES ('11012', '19', '9.2000', '50', '0.05'); +INSERT INTO `order details`VALUES ('11012', '60', '34.0000', '36', '0.05'); +INSERT INTO `order details`VALUES ('11012', '71', '21.5000', '60', '0.05'); +INSERT INTO `order details`VALUES ('11013', '23', '9.0000', '10', '0'); +INSERT INTO `order details`VALUES ('11013', '42', '14.0000', '4', '0'); +INSERT INTO `order details`VALUES ('11013', '45', '9.5000', '20', '0'); +INSERT INTO `order details`VALUES ('11013', '68', '12.5000', '2', '0'); +INSERT INTO `order details`VALUES ('11014', '41', '9.6500', '28', '0.1'); +INSERT INTO `order details`VALUES ('11015', '30', '25.8900', '15', '0'); +INSERT INTO `order details`VALUES ('11015', '77', '13.0000', '18', '0'); +INSERT INTO `order details`VALUES ('11016', '31', '12.5000', '15', '0'); +INSERT INTO `order details`VALUES ('11016', '36', '19.0000', '16', '0'); +INSERT INTO `order details`VALUES ('11017', '3', '10.0000', '25', '0'); +INSERT INTO `order details`VALUES ('11017', '59', '55.0000', '110', '0'); +INSERT INTO `order details`VALUES ('11017', '70', '15.0000', '30', '0'); +INSERT INTO `order details`VALUES ('11018', '12', '38.0000', '20', '0'); +INSERT INTO `order details`VALUES ('11018', '18', '62.5000', '10', '0'); +INSERT INTO `order details`VALUES ('11018', '56', '38.0000', '5', '0'); +INSERT INTO `order details`VALUES ('11019', '46', '12.0000', '3', '0'); +INSERT INTO `order details`VALUES ('11019', '49', '20.0000', '2', '0'); +INSERT INTO `order details`VALUES ('11020', '10', '31.0000', '24', '0.15'); +INSERT INTO `order details`VALUES ('11021', '2', '19.0000', '11', '0.25'); +INSERT INTO `order details`VALUES ('11021', '20', '81.0000', '15', '0'); +INSERT INTO `order details`VALUES ('11021', '26', '31.2300', '63', '0'); +INSERT INTO `order details`VALUES ('11021', '51', '53.0000', '44', '0.25'); +INSERT INTO `order details`VALUES ('11021', '72', '34.8000', '35', '0'); +INSERT INTO `order details`VALUES ('11022', '19', '9.2000', '35', '0'); +INSERT INTO `order details`VALUES ('11022', '69', '36.0000', '30', '0'); +INSERT INTO `order details`VALUES ('11023', '7', '30.0000', '4', '0'); +INSERT INTO `order details`VALUES ('11023', '43', '46.0000', '30', '0'); +INSERT INTO `order details`VALUES ('11024', '26', '31.2300', '12', '0'); +INSERT INTO `order details`VALUES ('11024', '33', '2.5000', '30', '0'); +INSERT INTO `order details`VALUES ('11024', '65', '21.0500', '21', '0'); +INSERT INTO `order details`VALUES ('11024', '71', '21.5000', '50', '0'); +INSERT INTO `order details`VALUES ('11025', '1', '18.0000', '10', '0.1'); +INSERT INTO `order details`VALUES ('11025', '13', '6.0000', '20', '0.1'); +INSERT INTO `order details`VALUES ('11026', '18', '62.5000', '8', '0'); +INSERT INTO `order details`VALUES ('11026', '51', '53.0000', '10', '0'); +INSERT INTO `order details`VALUES ('11027', '24', '4.5000', '30', '0.25'); +INSERT INTO `order details`VALUES ('11027', '62', '49.3000', '21', '0.25'); +INSERT INTO `order details`VALUES ('11028', '55', '24.0000', '35', '0'); +INSERT INTO `order details`VALUES ('11028', '59', '55.0000', '24', '0'); +INSERT INTO `order details`VALUES ('11029', '56', '38.0000', '20', '0'); +INSERT INTO `order details`VALUES ('11029', '63', '43.9000', '12', '0'); +INSERT INTO `order details`VALUES ('11030', '2', '19.0000', '100', '0.25'); +INSERT INTO `order details`VALUES ('11030', '5', '21.3500', '70', '0'); +INSERT INTO `order details`VALUES ('11030', '29', '123.7900', '60', '0.25'); +INSERT INTO `order details`VALUES ('11030', '59', '55.0000', '100', '0.25'); +INSERT INTO `order details`VALUES ('11031', '1', '18.0000', '45', '0'); +INSERT INTO `order details`VALUES ('11031', '13', '6.0000', '80', '0'); +INSERT INTO `order details`VALUES ('11031', '24', '4.5000', '21', '0'); +INSERT INTO `order details`VALUES ('11031', '64', '33.2500', '20', '0'); +INSERT INTO `order details`VALUES ('11031', '71', '21.5000', '16', '0'); +INSERT INTO `order details`VALUES ('11032', '36', '19.0000', '35', '0'); +INSERT INTO `order details`VALUES ('11032', '38', '263.5000', '25', '0'); +INSERT INTO `order details`VALUES ('11032', '59', '55.0000', '30', '0'); +INSERT INTO `order details`VALUES ('11033', '53', '32.8000', '70', '0.1'); +INSERT INTO `order details`VALUES ('11033', '69', '36.0000', '36', '0.1'); +INSERT INTO `order details`VALUES ('11034', '21', '10.0000', '15', '0.1'); +INSERT INTO `order details`VALUES ('11034', '44', '19.4500', '12', '0'); +INSERT INTO `order details`VALUES ('11034', '61', '28.5000', '6', '0'); +INSERT INTO `order details`VALUES ('11035', '1', '18.0000', '10', '0'); +INSERT INTO `order details`VALUES ('11035', '35', '18.0000', '60', '0'); +INSERT INTO `order details`VALUES ('11035', '42', '14.0000', '30', '0'); +INSERT INTO `order details`VALUES ('11035', '54', '7.4500', '10', '0'); +INSERT INTO `order details`VALUES ('11036', '13', '6.0000', '7', '0'); +INSERT INTO `order details`VALUES ('11036', '59', '55.0000', '30', '0'); +INSERT INTO `order details`VALUES ('11037', '70', '15.0000', '4', '0'); +INSERT INTO `order details`VALUES ('11038', '40', '18.4000', '5', '0.2'); +INSERT INTO `order details`VALUES ('11038', '52', '7.0000', '2', '0'); +INSERT INTO `order details`VALUES ('11038', '71', '21.5000', '30', '0'); +INSERT INTO `order details`VALUES ('11039', '28', '45.6000', '20', '0'); +INSERT INTO `order details`VALUES ('11039', '35', '18.0000', '24', '0'); +INSERT INTO `order details`VALUES ('11039', '49', '20.0000', '60', '0'); +INSERT INTO `order details`VALUES ('11039', '57', '19.5000', '28', '0'); +INSERT INTO `order details`VALUES ('11040', '21', '10.0000', '20', '0'); +INSERT INTO `order details`VALUES ('11041', '2', '19.0000', '30', '0.2'); +INSERT INTO `order details`VALUES ('11041', '63', '43.9000', '30', '0'); +INSERT INTO `order details`VALUES ('11042', '44', '19.4500', '15', '0'); +INSERT INTO `order details`VALUES ('11042', '61', '28.5000', '4', '0'); +INSERT INTO `order details`VALUES ('11043', '11', '21.0000', '10', '0'); +INSERT INTO `order details`VALUES ('11044', '62', '49.3000', '12', '0'); +INSERT INTO `order details`VALUES ('11045', '33', '2.5000', '15', '0'); +INSERT INTO `order details`VALUES ('11045', '51', '53.0000', '24', '0'); +INSERT INTO `order details`VALUES ('11046', '12', '38.0000', '20', '0.05'); +INSERT INTO `order details`VALUES ('11046', '32', '32.0000', '15', '0.05'); +INSERT INTO `order details`VALUES ('11046', '35', '18.0000', '18', '0.05'); +INSERT INTO `order details`VALUES ('11047', '1', '18.0000', '25', '0.25'); +INSERT INTO `order details`VALUES ('11047', '5', '21.3500', '30', '0.25'); +INSERT INTO `order details`VALUES ('11048', '68', '12.5000', '42', '0'); +INSERT INTO `order details`VALUES ('11049', '2', '19.0000', '10', '0.2'); +INSERT INTO `order details`VALUES ('11049', '12', '38.0000', '4', '0.2'); +INSERT INTO `order details`VALUES ('11050', '76', '18.0000', '50', '0.1'); +INSERT INTO `order details`VALUES ('11051', '24', '4.5000', '10', '0.2'); +INSERT INTO `order details`VALUES ('11052', '43', '46.0000', '30', '0.2'); +INSERT INTO `order details`VALUES ('11052', '61', '28.5000', '10', '0.2'); +INSERT INTO `order details`VALUES ('11053', '18', '62.5000', '35', '0.2'); +INSERT INTO `order details`VALUES ('11053', '32', '32.0000', '20', '0'); +INSERT INTO `order details`VALUES ('11053', '64', '33.2500', '25', '0.2'); +INSERT INTO `order details`VALUES ('11054', '33', '2.5000', '10', '0'); +INSERT INTO `order details`VALUES ('11054', '67', '14.0000', '20', '0'); +INSERT INTO `order details`VALUES ('11055', '24', '4.5000', '15', '0'); +INSERT INTO `order details`VALUES ('11055', '25', '14.0000', '15', '0'); +INSERT INTO `order details`VALUES ('11055', '51', '53.0000', '20', '0'); +INSERT INTO `order details`VALUES ('11055', '57', '19.5000', '20', '0'); +INSERT INTO `order details`VALUES ('11056', '7', '30.0000', '40', '0'); +INSERT INTO `order details`VALUES ('11056', '55', '24.0000', '35', '0'); +INSERT INTO `order details`VALUES ('11056', '60', '34.0000', '50', '0'); +INSERT INTO `order details`VALUES ('11057', '70', '15.0000', '3', '0'); +INSERT INTO `order details`VALUES ('11058', '21', '10.0000', '3', '0'); +INSERT INTO `order details`VALUES ('11058', '60', '34.0000', '21', '0'); +INSERT INTO `order details`VALUES ('11058', '61', '28.5000', '4', '0'); +INSERT INTO `order details`VALUES ('11059', '13', '6.0000', '30', '0'); +INSERT INTO `order details`VALUES ('11059', '17', '39.0000', '12', '0'); +INSERT INTO `order details`VALUES ('11059', '60', '34.0000', '35', '0'); +INSERT INTO `order details`VALUES ('11060', '60', '34.0000', '4', '0'); +INSERT INTO `order details`VALUES ('11060', '77', '13.0000', '10', '0'); +INSERT INTO `order details`VALUES ('11061', '60', '34.0000', '15', '0'); +INSERT INTO `order details`VALUES ('11062', '53', '32.8000', '10', '0.2'); +INSERT INTO `order details`VALUES ('11062', '70', '15.0000', '12', '0.2'); +INSERT INTO `order details`VALUES ('11063', '34', '14.0000', '30', '0'); +INSERT INTO `order details`VALUES ('11063', '40', '18.4000', '40', '0.1'); +INSERT INTO `order details`VALUES ('11063', '41', '9.6500', '30', '0.1'); +INSERT INTO `order details`VALUES ('11064', '17', '39.0000', '77', '0.1'); +INSERT INTO `order details`VALUES ('11064', '41', '9.6500', '12', '0'); +INSERT INTO `order details`VALUES ('11064', '53', '32.8000', '25', '0.1'); +INSERT INTO `order details`VALUES ('11064', '55', '24.0000', '4', '0.1'); +INSERT INTO `order details`VALUES ('11064', '68', '12.5000', '55', '0'); +INSERT INTO `order details`VALUES ('11065', '30', '25.8900', '4', '0.25'); +INSERT INTO `order details`VALUES ('11065', '54', '7.4500', '20', '0.25'); +INSERT INTO `order details`VALUES ('11066', '16', '17.4500', '3', '0'); +INSERT INTO `order details`VALUES ('11066', '19', '9.2000', '42', '0'); +INSERT INTO `order details`VALUES ('11066', '34', '14.0000', '35', '0'); +INSERT INTO `order details`VALUES ('11067', '41', '9.6500', '9', '0'); +INSERT INTO `order details`VALUES ('11068', '28', '45.6000', '8', '0.15'); +INSERT INTO `order details`VALUES ('11068', '43', '46.0000', '36', '0.15'); +INSERT INTO `order details`VALUES ('11068', '77', '13.0000', '28', '0.15'); +INSERT INTO `order details`VALUES ('11069', '39', '18.0000', '20', '0'); +INSERT INTO `order details`VALUES ('11070', '1', '18.0000', '40', '0.15'); +INSERT INTO `order details`VALUES ('11070', '2', '19.0000', '20', '0.15'); +INSERT INTO `order details`VALUES ('11070', '16', '17.4500', '30', '0.15'); +INSERT INTO `order details`VALUES ('11070', '31', '12.5000', '20', '0'); +INSERT INTO `order details`VALUES ('11071', '7', '30.0000', '15', '0.05'); +INSERT INTO `order details`VALUES ('11071', '13', '6.0000', '10', '0.05'); +INSERT INTO `order details`VALUES ('11072', '2', '19.0000', '8', '0'); +INSERT INTO `order details`VALUES ('11072', '41', '9.6500', '40', '0'); +INSERT INTO `order details`VALUES ('11072', '50', '16.2500', '22', '0'); +INSERT INTO `order details`VALUES ('11072', '64', '33.2500', '130', '0'); +INSERT INTO `order details`VALUES ('11073', '11', '21.0000', '10', '0'); +INSERT INTO `order details`VALUES ('11073', '24', '4.5000', '20', '0'); +INSERT INTO `order details`VALUES ('11074', '16', '17.4500', '14', '0.05'); +INSERT INTO `order details`VALUES ('11075', '2', '19.0000', '10', '0.15'); +INSERT INTO `order details`VALUES ('11075', '46', '12.0000', '30', '0.15'); +INSERT INTO `order details`VALUES ('11075', '76', '18.0000', '2', '0.15'); +INSERT INTO `order details`VALUES ('11076', '6', '25.0000', '20', '0.25'); +INSERT INTO `order details`VALUES ('11076', '14', '23.2500', '20', '0.25'); +INSERT INTO `order details`VALUES ('11076', '19', '9.2000', '10', '0.25'); +INSERT INTO `order details`VALUES ('11077', '2', '19.0000', '24', '0.2'); +INSERT INTO `order details`VALUES ('11077', '3', '10.0000', '4', '0'); +INSERT INTO `order details`VALUES ('11077', '4', '22.0000', '1', '0'); +INSERT INTO `order details`VALUES ('11077', '6', '25.0000', '1', '0.02'); +INSERT INTO `order details`VALUES ('11077', '7', '30.0000', '1', '0.05'); +INSERT INTO `order details`VALUES ('11077', '8', '40.0000', '2', '0.1'); +INSERT INTO `order details`VALUES ('11077', '10', '31.0000', '1', '0'); +INSERT INTO `order details`VALUES ('11077', '12', '38.0000', '2', '0.05'); +INSERT INTO `order details`VALUES ('11077', '13', '6.0000', '4', '0'); +INSERT INTO `order details`VALUES ('11077', '14', '23.2500', '1', '0.03'); +INSERT INTO `order details`VALUES ('11077', '16', '17.4500', '2', '0.03'); +INSERT INTO `order details`VALUES ('11077', '20', '81.0000', '1', '0.04'); +INSERT INTO `order details`VALUES ('11077', '23', '9.0000', '2', '0'); +INSERT INTO `order details`VALUES ('11077', '32', '32.0000', '1', '0'); +INSERT INTO `order details`VALUES ('11077', '39', '18.0000', '2', '0.05'); +INSERT INTO `order details`VALUES ('11077', '41', '9.6500', '3', '0'); +INSERT INTO `order details`VALUES ('11077', '46', '12.0000', '3', '0.02'); +INSERT INTO `order details`VALUES ('11077', '52', '7.0000', '2', '0'); +INSERT INTO `order details`VALUES ('11077', '55', '24.0000', '2', '0'); +INSERT INTO `order details`VALUES ('11077', '60', '34.0000', '2', '0.06'); +INSERT INTO `order details`VALUES ('11077', '64', '33.2500', '2', '0.03'); +INSERT INTO `order details`VALUES ('11077', '66', '17.0000', '1', '0'); +INSERT INTO `order details`VALUES ('11077', '73', '15.0000', '2', '0.01'); +INSERT INTO `order details`VALUES ('11077', '75', '7.7500', '4', '0'); +INSERT INTO `order details`VALUES ('11077', '77', '13.0000', '2', '0'); + +-- ---------------------------- +-- Table structure for `orders` +-- ---------------------------- +DROP TABLE IF EXISTS `orders`; +CREATE TABLE `orders` ( + `OrderID` int(11) NOT NULL AUTO_INCREMENT, + `CustomerID` varchar(5) DEFAULT NULL, + `EmployeeID` int(11) DEFAULT NULL, + `OrderDate` datetime DEFAULT NULL, + `RequiredDate` datetime DEFAULT NULL, + `ShippedDate` datetime DEFAULT NULL, + `ShipVia` int(11) DEFAULT NULL, + `Freight` decimal(19,4) DEFAULT '0.0000', + `ShipName` varchar(40) DEFAULT NULL, + `ShipAddress` varchar(60) DEFAULT NULL, + `ShipCity` varchar(15) DEFAULT NULL, + `ShipRegion` varchar(15) DEFAULT NULL, + `ShipPostalCode` varchar(10) DEFAULT NULL, + `ShipCountry` varchar(15) DEFAULT NULL, + PRIMARY KEY (`OrderID`), + KEY `CustomerID` (`CustomerID`), + KEY `EmployeeID` (`EmployeeID`), + KEY `OrderDate` (`OrderDate`), + KEY `ShippedDate` (`ShippedDate`), + KEY `ShipPostalCode` (`ShipPostalCode`) +) ENGINE=MyISAM AUTO_INCREMENT=11078 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of orders +-- ---------------------------- +INSERT INTO orders VALUES ('10248', 'VINET', '5', '1994-08-04 00:00:00', '1994-09-01 00:00:00', '1994-08-16 00:00:00', '3', '32.3800', 'Vins et alcools Chevalier', '59 rue de l\'Abbaye', 'Reims', null, '51100', 'France'); +INSERT INTO orders VALUES ('10249', 'TOMSP', '6', '1994-08-05 00:00:00', '1994-09-16 00:00:00', '1994-08-10 00:00:00', '1', '11.6100', 'Toms Spezialitäten', 'Luisenstr. 48', 'Münster', null, '44087', 'Germany'); +INSERT INTO orders VALUES ('10250', 'HANAR', '4', '1994-08-08 00:00:00', '1994-09-05 00:00:00', '1994-08-12 00:00:00', '2', '65.8300', 'Hanari Carnes', 'Rua do Paço, 67', 'Rio de Janeiro', 'RJ', '05454-876', 'Brazil'); +INSERT INTO orders VALUES ('10251', 'VICTE', '3', '1994-08-08 00:00:00', '1994-09-05 00:00:00', '1994-08-15 00:00:00', '1', '41.3400', 'Victuailles en stock', '2, rue du Commerce', 'Lyon', null, '69004', 'France'); +INSERT INTO orders VALUES ('10252', 'SUPRD', '4', '1994-08-09 00:00:00', '1994-09-06 00:00:00', '1994-08-11 00:00:00', '2', '51.3000', 'Suprêmes délices', 'Boulevard Tirou, 255', 'Charleroi', null, 'B-6000', 'Belgium'); +INSERT INTO orders VALUES ('10253', 'HANAR', '3', '1994-08-10 00:00:00', '1994-08-24 00:00:00', '1994-08-16 00:00:00', '2', '58.1700', 'Hanari Carnes', 'Rua do Paço, 67', 'Rio de Janeiro', 'RJ', '05454-876', 'Brazil'); +INSERT INTO orders VALUES ('10254', 'CHOPS', '5', '1994-08-11 00:00:00', '1994-09-08 00:00:00', '1994-08-23 00:00:00', '2', '22.9800', 'Chop-suey Chinese', 'Hauptstr. 31', 'Bern', null, '3012', 'Switzerland'); +INSERT INTO orders VALUES ('10255', 'RICSU', '9', '1994-08-12 00:00:00', '1994-09-09 00:00:00', '1994-08-15 00:00:00', '3', '148.3300', 'Richter Supermarkt', 'Starenweg 5', 'Genève', null, '1204', 'Switzerland'); +INSERT INTO orders VALUES ('10256', 'WELLI', '3', '1994-08-15 00:00:00', '1994-09-12 00:00:00', '1994-08-17 00:00:00', '2', '13.9700', 'Wellington Importadora', 'Rua do Mercado, 12', 'Resende', 'SP', '08737-363', 'Brazil'); +INSERT INTO orders VALUES ('10257', 'HILAA', '4', '1994-08-16 00:00:00', '1994-09-13 00:00:00', '1994-08-22 00:00:00', '3', '81.9100', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10258', 'ERNSH', '1', '1994-08-17 00:00:00', '1994-09-14 00:00:00', '1994-08-23 00:00:00', '1', '140.5100', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10259', 'CENTC', '4', '1994-08-18 00:00:00', '1994-09-15 00:00:00', '1994-08-25 00:00:00', '3', '3.2500', 'Centro comercial Moctezuma', 'Sierras de Granada 9993', 'México D.F.', null, '05022', 'Mexico'); +INSERT INTO orders VALUES ('10260', 'OTTIK', '4', '1994-08-19 00:00:00', '1994-09-16 00:00:00', '1994-08-29 00:00:00', '1', '55.0900', 'Ottilies Käseladen', 'Mehrheimerstr. 369', 'Köln', null, '50739', 'Germany'); +INSERT INTO orders VALUES ('10261', 'QUEDE', '4', '1994-08-19 00:00:00', '1994-09-16 00:00:00', '1994-08-30 00:00:00', '2', '3.0500', 'Que Delícia', 'Rua da Panificadora, 12', 'Rio de Janeiro', 'RJ', '02389-673', 'Brazil'); +INSERT INTO orders VALUES ('10262', 'RATTC', '8', '1994-08-22 00:00:00', '1994-09-19 00:00:00', '1994-08-25 00:00:00', '3', '48.2900', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10263', 'ERNSH', '9', '1994-08-23 00:00:00', '1994-09-20 00:00:00', '1994-08-31 00:00:00', '3', '146.0600', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10264', 'FOLKO', '6', '1994-08-24 00:00:00', '1994-09-21 00:00:00', '1994-09-23 00:00:00', '3', '3.6700', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10265', 'BLONP', '2', '1994-08-25 00:00:00', '1994-09-22 00:00:00', '1994-09-12 00:00:00', '1', '55.2800', 'Blondel père et fils', '24, place Kléber', 'Strasbourg', null, '67000', 'France'); +INSERT INTO orders VALUES ('10266', 'WARTH', '3', '1994-08-26 00:00:00', '1994-10-07 00:00:00', '1994-08-31 00:00:00', '3', '25.7300', 'Wartian Herkku', 'Torikatu 38', 'Oulu', null, '90110', 'Finland'); +INSERT INTO orders VALUES ('10267', 'FRANK', '4', '1994-08-29 00:00:00', '1994-09-26 00:00:00', '1994-09-06 00:00:00', '1', '208.5800', 'Frankenversand', 'Berliner Platz 43', 'München', null, '80805', 'Germany'); +INSERT INTO orders VALUES ('10268', 'GROSR', '8', '1994-08-30 00:00:00', '1994-09-27 00:00:00', '1994-09-02 00:00:00', '3', '66.2900', 'GROSELLA-Restaurante', '5ª Ave. Los Palos Grandes', 'Caracas', 'DF', '1081', 'Venezuela'); +INSERT INTO orders VALUES ('10269', 'WHITC', '5', '1994-08-31 00:00:00', '1994-09-14 00:00:00', '1994-09-09 00:00:00', '1', '4.5600', 'White Clover Markets', '1029 - 12th Ave. S.', 'Seattle', 'WA', '98124', 'USA'); +INSERT INTO orders VALUES ('10270', 'WARTH', '1', '1994-09-01 00:00:00', '1994-09-29 00:00:00', '1994-09-02 00:00:00', '1', '136.5400', 'Wartian Herkku', 'Torikatu 38', 'Oulu', null, '90110', 'Finland'); +INSERT INTO orders VALUES ('10271', 'SPLIR', '6', '1994-09-01 00:00:00', '1994-09-29 00:00:00', '1994-09-30 00:00:00', '2', '4.5400', 'Split Rail Beer & Ale', 'P.O. Box 555', 'Lander', 'WY', '82520', 'USA'); +INSERT INTO orders VALUES ('10272', 'RATTC', '6', '1994-09-02 00:00:00', '1994-09-30 00:00:00', '1994-09-06 00:00:00', '2', '98.0300', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10273', 'QUICK', '3', '1994-09-05 00:00:00', '1994-10-03 00:00:00', '1994-09-12 00:00:00', '3', '76.0700', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10274', 'VINET', '6', '1994-09-06 00:00:00', '1994-10-04 00:00:00', '1994-09-16 00:00:00', '1', '6.0100', 'Vins et alcools Chevalier', '59 rue de l\'Abbaye', 'Reims', null, '51100', 'France'); +INSERT INTO orders VALUES ('10275', 'MAGAA', '1', '1994-09-07 00:00:00', '1994-10-05 00:00:00', '1994-09-09 00:00:00', '1', '26.9300', 'Magazzini Alimentari Riuniti', 'Via Ludovico il Moro 22', 'Bergamo', null, '24100', 'Italy'); +INSERT INTO orders VALUES ('10276', 'TORTU', '8', '1994-09-08 00:00:00', '1994-09-22 00:00:00', '1994-09-14 00:00:00', '3', '13.8400', 'Tortuga Restaurante', 'Avda. Azteca 123', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('10277', 'MORGK', '2', '1994-09-09 00:00:00', '1994-10-07 00:00:00', '1994-09-13 00:00:00', '3', '125.7700', 'Morgenstern Gesundkost', 'Heerstr. 22', 'Leipzig', null, '04179', 'Germany'); +INSERT INTO orders VALUES ('10278', 'BERGS', '8', '1994-09-12 00:00:00', '1994-10-10 00:00:00', '1994-09-16 00:00:00', '2', '92.6900', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10279', 'LEHMS', '8', '1994-09-13 00:00:00', '1994-10-11 00:00:00', '1994-09-16 00:00:00', '2', '25.8300', 'Lehmanns Marktstand', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany'); +INSERT INTO orders VALUES ('10280', 'BERGS', '2', '1994-09-14 00:00:00', '1994-10-12 00:00:00', '1994-10-13 00:00:00', '1', '8.9800', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10281', 'ROMEY', '4', '1994-09-14 00:00:00', '1994-09-28 00:00:00', '1994-09-21 00:00:00', '1', '2.9400', 'Romero y tomillo', 'Gran Vía, 1', 'Madrid', null, '28001', 'Spain'); +INSERT INTO orders VALUES ('10282', 'ROMEY', '4', '1994-09-15 00:00:00', '1994-10-13 00:00:00', '1994-09-21 00:00:00', '1', '12.6900', 'Romero y tomillo', 'Gran Vía, 1', 'Madrid', null, '28001', 'Spain'); +INSERT INTO orders VALUES ('10283', 'LILAS', '3', '1994-09-16 00:00:00', '1994-10-14 00:00:00', '1994-09-23 00:00:00', '3', '84.8100', 'LILA-Supermercado', 'Carrera 52 con Ave. Bolívar #65-98 Llano Largo', 'Barquisimeto', 'Lara', '3508', 'Venezuela'); +INSERT INTO orders VALUES ('10284', 'LEHMS', '4', '1994-09-19 00:00:00', '1994-10-17 00:00:00', '1994-09-27 00:00:00', '1', '76.5600', 'Lehmanns Marktstand', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany'); +INSERT INTO orders VALUES ('10285', 'QUICK', '1', '1994-09-20 00:00:00', '1994-10-18 00:00:00', '1994-09-26 00:00:00', '2', '76.8300', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10286', 'QUICK', '8', '1994-09-21 00:00:00', '1994-10-19 00:00:00', '1994-09-30 00:00:00', '3', '229.2400', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10287', 'RICAR', '8', '1994-09-22 00:00:00', '1994-10-20 00:00:00', '1994-09-28 00:00:00', '3', '12.7600', 'Ricardo Adocicados', 'Av. Copacabana, 267', 'Rio de Janeiro', 'RJ', '02389-890', 'Brazil'); +INSERT INTO orders VALUES ('10288', 'REGGC', '4', '1994-09-23 00:00:00', '1994-10-21 00:00:00', '1994-10-04 00:00:00', '1', '7.4500', 'Reggiani Caseifici', 'Strada Provinciale 124', 'Reggio Emilia', null, '42100', 'Italy'); +INSERT INTO orders VALUES ('10289', 'BSBEV', '7', '1994-09-26 00:00:00', '1994-10-24 00:00:00', '1994-09-28 00:00:00', '3', '22.7700', 'B\'s Beverages', 'Fauntleroy Circus', 'London', null, 'EC2 5NT', 'UK'); +INSERT INTO orders VALUES ('10290', 'COMMI', '8', '1994-09-27 00:00:00', '1994-10-25 00:00:00', '1994-10-04 00:00:00', '1', '79.7000', 'Comércio Mineiro', 'Av. dos Lusíadas, 23', 'São Paulo', 'SP', '05432-043', 'Brazil'); +INSERT INTO orders VALUES ('10291', 'QUEDE', '6', '1994-09-27 00:00:00', '1994-10-25 00:00:00', '1994-10-05 00:00:00', '2', '6.4000', 'Que Delícia', 'Rua da Panificadora, 12', 'Rio de Janeiro', 'RJ', '02389-673', 'Brazil'); +INSERT INTO orders VALUES ('10292', 'TRADH', '1', '1994-09-28 00:00:00', '1994-10-26 00:00:00', '1994-10-03 00:00:00', '2', '1.3500', 'Tradição Hipermercados', 'Av. Inês de Castro, 414', 'São Paulo', 'SP', '05634-030', 'Brazil'); +INSERT INTO orders VALUES ('10293', 'TORTU', '1', '1994-09-29 00:00:00', '1994-10-27 00:00:00', '1994-10-12 00:00:00', '3', '21.1800', 'Tortuga Restaurante', 'Avda. Azteca 123', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('10294', 'RATTC', '4', '1994-09-30 00:00:00', '1994-10-28 00:00:00', '1994-10-06 00:00:00', '2', '147.2600', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10295', 'VINET', '2', '1994-10-03 00:00:00', '1994-10-31 00:00:00', '1994-10-11 00:00:00', '2', '1.1500', 'Vins et alcools Chevalier', '59 rue de l\'Abbaye', 'Reims', null, '51100', 'France'); +INSERT INTO orders VALUES ('10296', 'LILAS', '6', '1994-10-04 00:00:00', '1994-11-01 00:00:00', '1994-10-12 00:00:00', '1', '0.1200', 'LILA-Supermercado', 'Carrera 52 con Ave. Bolívar #65-98 Llano Largo', 'Barquisimeto', 'Lara', '3508', 'Venezuela'); +INSERT INTO orders VALUES ('10297', 'BLONP', '5', '1994-10-05 00:00:00', '1994-11-16 00:00:00', '1994-10-11 00:00:00', '2', '5.7400', 'Blondel père et fils', '24, place Kléber', 'Strasbourg', null, '67000', 'France'); +INSERT INTO orders VALUES ('10298', 'HUNGO', '6', '1994-10-06 00:00:00', '1994-11-03 00:00:00', '1994-10-12 00:00:00', '2', '168.2200', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10299', 'RICAR', '4', '1994-10-07 00:00:00', '1994-11-04 00:00:00', '1994-10-14 00:00:00', '2', '29.7600', 'Ricardo Adocicados', 'Av. Copacabana, 267', 'Rio de Janeiro', 'RJ', '02389-890', 'Brazil'); +INSERT INTO orders VALUES ('10300', 'MAGAA', '2', '1994-10-10 00:00:00', '1994-11-07 00:00:00', '1994-10-19 00:00:00', '2', '17.6800', 'Magazzini Alimentari Riuniti', 'Via Ludovico il Moro 22', 'Bergamo', null, '24100', 'Italy'); +INSERT INTO orders VALUES ('10301', 'WANDK', '8', '1994-10-10 00:00:00', '1994-11-07 00:00:00', '1994-10-18 00:00:00', '2', '45.0800', 'Die Wandernde Kuh', 'Adenauerallee 900', 'Stuttgart', null, '70563', 'Germany'); +INSERT INTO orders VALUES ('10302', 'SUPRD', '4', '1994-10-11 00:00:00', '1994-11-08 00:00:00', '1994-11-09 00:00:00', '2', '6.2700', 'Suprêmes délices', 'Boulevard Tirou, 255', 'Charleroi', null, 'B-6000', 'Belgium'); +INSERT INTO orders VALUES ('10303', 'GODOS', '7', '1994-10-12 00:00:00', '1994-11-09 00:00:00', '1994-10-19 00:00:00', '2', '107.8300', 'Godos Cocina Típica', 'C/ Romero, 33', 'Sevilla', null, '41101', 'Spain'); +INSERT INTO orders VALUES ('10304', 'TORTU', '1', '1994-10-13 00:00:00', '1994-11-10 00:00:00', '1994-10-18 00:00:00', '2', '63.7900', 'Tortuga Restaurante', 'Avda. Azteca 123', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('10305', 'OLDWO', '8', '1994-10-14 00:00:00', '1994-11-11 00:00:00', '1994-11-09 00:00:00', '3', '257.6200', 'Old World Delicatessen', '2743 Bering St.', 'Anchorage', 'AK', '99508', 'USA'); +INSERT INTO orders VALUES ('10306', 'ROMEY', '1', '1994-10-17 00:00:00', '1994-11-14 00:00:00', '1994-10-24 00:00:00', '3', '7.5600', 'Romero y tomillo', 'Gran Vía, 1', 'Madrid', null, '28001', 'Spain'); +INSERT INTO orders VALUES ('10307', 'LONEP', '2', '1994-10-18 00:00:00', '1994-11-15 00:00:00', '1994-10-26 00:00:00', '2', '0.5600', 'Lonesome Pine Restaurant', '89 Chiaroscuro Rd.', 'Portland', 'OR', '97219', 'USA'); +INSERT INTO orders VALUES ('10308', 'ANATR', '7', '1994-10-19 00:00:00', '1994-11-16 00:00:00', '1994-10-25 00:00:00', '3', '1.6100', 'Ana Trujillo Emparedados y helados', 'Avda. de la Constitución 2222', 'México D.F.', null, '05021', 'Mexico'); +INSERT INTO orders VALUES ('10309', 'HUNGO', '3', '1994-10-20 00:00:00', '1994-11-17 00:00:00', '1994-11-23 00:00:00', '1', '47.3000', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10310', 'THEBI', '8', '1994-10-21 00:00:00', '1994-11-18 00:00:00', '1994-10-28 00:00:00', '2', '17.5200', 'The Big Cheese', '89 Jefferson Way\r\nSuite 2', 'Portland', 'OR', '97201', 'USA'); +INSERT INTO orders VALUES ('10311', 'DUMON', '1', '1994-10-21 00:00:00', '1994-11-04 00:00:00', '1994-10-27 00:00:00', '3', '24.6900', 'Du monde entier', '67, rue des Cinquante Otages', 'Nantes', null, '44000', 'France'); +INSERT INTO orders VALUES ('10312', 'WANDK', '2', '1994-10-24 00:00:00', '1994-11-21 00:00:00', '1994-11-03 00:00:00', '2', '40.2600', 'Die Wandernde Kuh', 'Adenauerallee 900', 'Stuttgart', null, '70563', 'Germany'); +INSERT INTO orders VALUES ('10313', 'QUICK', '2', '1994-10-25 00:00:00', '1994-11-22 00:00:00', '1994-11-04 00:00:00', '2', '1.9600', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10314', 'RATTC', '1', '1994-10-26 00:00:00', '1994-11-23 00:00:00', '1994-11-04 00:00:00', '2', '74.1600', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10315', 'ISLAT', '4', '1994-10-27 00:00:00', '1994-11-24 00:00:00', '1994-11-03 00:00:00', '2', '41.7600', 'Island Trading', 'Garden House\r\nCrowther Way', 'Cowes', 'Isle of Wight', 'PO31 7PJ', 'UK'); +INSERT INTO orders VALUES ('10316', 'RATTC', '1', '1994-10-28 00:00:00', '1994-11-25 00:00:00', '1994-11-08 00:00:00', '3', '150.1500', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10317', 'LONEP', '6', '1994-10-31 00:00:00', '1994-11-28 00:00:00', '1994-11-10 00:00:00', '1', '12.6900', 'Lonesome Pine Restaurant', '89 Chiaroscuro Rd.', 'Portland', 'OR', '97219', 'USA'); +INSERT INTO orders VALUES ('10318', 'ISLAT', '8', '1994-11-01 00:00:00', '1994-11-29 00:00:00', '1994-11-04 00:00:00', '2', '4.7300', 'Island Trading', 'Garden House\r\nCrowther Way', 'Cowes', 'Isle of Wight', 'PO31 7PJ', 'UK'); +INSERT INTO orders VALUES ('10319', 'TORTU', '7', '1994-11-02 00:00:00', '1994-11-30 00:00:00', '1994-11-11 00:00:00', '3', '64.5000', 'Tortuga Restaurante', 'Avda. Azteca 123', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('10320', 'WARTH', '5', '1994-11-03 00:00:00', '1994-11-17 00:00:00', '1994-11-18 00:00:00', '3', '34.5700', 'Wartian Herkku', 'Torikatu 38', 'Oulu', null, '90110', 'Finland'); +INSERT INTO orders VALUES ('10321', 'ISLAT', '3', '1994-11-03 00:00:00', '1994-12-01 00:00:00', '1994-11-11 00:00:00', '2', '3.4300', 'Island Trading', 'Garden House\r\nCrowther Way', 'Cowes', 'Isle of Wight', 'PO31 7PJ', 'UK'); +INSERT INTO orders VALUES ('10322', 'PERIC', '7', '1994-11-04 00:00:00', '1994-12-02 00:00:00', '1994-11-23 00:00:00', '3', '0.4000', 'Pericles Comidas clásicas', 'Calle Dr. Jorge Cash 321', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('10323', 'KOENE', '4', '1994-11-07 00:00:00', '1994-12-05 00:00:00', '1994-11-14 00:00:00', '1', '4.8800', 'Königlich Essen', 'Maubelstr. 90', 'Brandenburg', null, '14776', 'Germany'); +INSERT INTO orders VALUES ('10324', 'SAVEA', '9', '1994-11-08 00:00:00', '1994-12-06 00:00:00', '1994-11-10 00:00:00', '1', '214.2700', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10325', 'KOENE', '1', '1994-11-09 00:00:00', '1994-11-23 00:00:00', '1994-11-14 00:00:00', '3', '64.8600', 'Königlich Essen', 'Maubelstr. 90', 'Brandenburg', null, '14776', 'Germany'); +INSERT INTO orders VALUES ('10326', 'BOLID', '4', '1994-11-10 00:00:00', '1994-12-08 00:00:00', '1994-11-14 00:00:00', '2', '77.9200', 'Bólido Comidas preparadas', 'C/ Araquil, 67', 'Madrid', null, '28023', 'Spain'); +INSERT INTO orders VALUES ('10327', 'FOLKO', '2', '1994-11-11 00:00:00', '1994-12-09 00:00:00', '1994-11-14 00:00:00', '1', '63.3600', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10328', 'FURIB', '4', '1994-11-14 00:00:00', '1994-12-12 00:00:00', '1994-11-17 00:00:00', '3', '87.0300', 'Furia Bacalhau e Frutos do Mar', 'Jardim das rosas n. 32', 'Lisboa', null, '1675', 'Portugal'); +INSERT INTO orders VALUES ('10329', 'SPLIR', '4', '1994-11-15 00:00:00', '1994-12-27 00:00:00', '1994-11-23 00:00:00', '2', '191.6700', 'Split Rail Beer & Ale', 'P.O. Box 555', 'Lander', 'WY', '82520', 'USA'); +INSERT INTO orders VALUES ('10330', 'LILAS', '3', '1994-11-16 00:00:00', '1994-12-14 00:00:00', '1994-11-28 00:00:00', '1', '12.7500', 'LILA-Supermercado', 'Carrera 52 con Ave. Bolívar #65-98 Llano Largo', 'Barquisimeto', 'Lara', '3508', 'Venezuela'); +INSERT INTO orders VALUES ('10331', 'BONAP', '9', '1994-11-16 00:00:00', '1994-12-28 00:00:00', '1994-11-21 00:00:00', '1', '10.1900', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10332', 'MEREP', '3', '1994-11-17 00:00:00', '1994-12-29 00:00:00', '1994-11-21 00:00:00', '2', '52.8400', 'Mère Paillarde', '43 rue St. Laurent', 'Montréal', 'Québec', 'H1J 1C3', 'Canada'); +INSERT INTO orders VALUES ('10333', 'WARTH', '5', '1994-11-18 00:00:00', '1994-12-16 00:00:00', '1994-11-25 00:00:00', '3', '0.5900', 'Wartian Herkku', 'Torikatu 38', 'Oulu', null, '90110', 'Finland'); +INSERT INTO orders VALUES ('10334', 'VICTE', '8', '1994-11-21 00:00:00', '1994-12-19 00:00:00', '1994-11-28 00:00:00', '2', '8.5600', 'Victuailles en stock', '2, rue du Commerce', 'Lyon', null, '69004', 'France'); +INSERT INTO orders VALUES ('10335', 'HUNGO', '7', '1994-11-22 00:00:00', '1994-12-20 00:00:00', '1994-11-24 00:00:00', '2', '42.1100', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10336', 'PRINI', '7', '1994-11-23 00:00:00', '1994-12-21 00:00:00', '1994-11-25 00:00:00', '2', '15.5100', 'Princesa Isabel Vinhos', 'Estrada da saúde n. 58', 'Lisboa', null, '1756', 'Portugal'); +INSERT INTO orders VALUES ('10337', 'FRANK', '4', '1994-11-24 00:00:00', '1994-12-22 00:00:00', '1994-11-29 00:00:00', '3', '108.2600', 'Frankenversand', 'Berliner Platz 43', 'München', null, '80805', 'Germany'); +INSERT INTO orders VALUES ('10338', 'OLDWO', '4', '1994-11-25 00:00:00', '1994-12-23 00:00:00', '1994-11-29 00:00:00', '3', '84.2100', 'Old World Delicatessen', '2743 Bering St.', 'Anchorage', 'AK', '99508', 'USA'); +INSERT INTO orders VALUES ('10339', 'MEREP', '2', '1994-11-28 00:00:00', '1994-12-26 00:00:00', '1994-12-05 00:00:00', '2', '15.6600', 'Mère Paillarde', '43 rue St. Laurent', 'Montréal', 'Québec', 'H1J 1C3', 'Canada'); +INSERT INTO orders VALUES ('10340', 'BONAP', '1', '1994-11-29 00:00:00', '1994-12-27 00:00:00', '1994-12-09 00:00:00', '3', '166.3100', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10341', 'SIMOB', '7', '1994-11-29 00:00:00', '1994-12-27 00:00:00', '1994-12-06 00:00:00', '3', '26.7800', 'Simons bistro', 'Vinbæltet 34', 'København', null, '1734', 'Denmark'); +INSERT INTO orders VALUES ('10342', 'FRANK', '4', '1994-11-30 00:00:00', '1994-12-14 00:00:00', '1994-12-05 00:00:00', '2', '54.8300', 'Frankenversand', 'Berliner Platz 43', 'München', null, '80805', 'Germany'); +INSERT INTO orders VALUES ('10343', 'LEHMS', '4', '1994-12-01 00:00:00', '1994-12-29 00:00:00', '1994-12-07 00:00:00', '1', '110.3700', 'Lehmanns Marktstand', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany'); +INSERT INTO orders VALUES ('10344', 'WHITC', '4', '1994-12-02 00:00:00', '1994-12-30 00:00:00', '1994-12-06 00:00:00', '2', '23.2900', 'White Clover Markets', '1029 - 12th Ave. S.', 'Seattle', 'WA', '98124', 'USA'); +INSERT INTO orders VALUES ('10345', 'QUICK', '2', '1994-12-05 00:00:00', '1995-01-02 00:00:00', '1994-12-12 00:00:00', '2', '249.0600', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10346', 'RATTC', '3', '1994-12-06 00:00:00', '1995-01-17 00:00:00', '1994-12-09 00:00:00', '3', '142.0800', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10347', 'FAMIA', '4', '1994-12-07 00:00:00', '1995-01-04 00:00:00', '1994-12-09 00:00:00', '3', '3.1000', 'Familia Arquibaldo', 'Rua Orós, 92', 'São Paulo', 'SP', '05442-030', 'Brazil'); +INSERT INTO orders VALUES ('10348', 'WANDK', '4', '1994-12-08 00:00:00', '1995-01-05 00:00:00', '1994-12-16 00:00:00', '2', '0.7800', 'Die Wandernde Kuh', 'Adenauerallee 900', 'Stuttgart', null, '70563', 'Germany'); +INSERT INTO orders VALUES ('10349', 'SPLIR', '7', '1994-12-09 00:00:00', '1995-01-06 00:00:00', '1994-12-16 00:00:00', '1', '8.6300', 'Split Rail Beer & Ale', 'P.O. Box 555', 'Lander', 'WY', '82520', 'USA'); +INSERT INTO orders VALUES ('10350', 'LAMAI', '6', '1994-12-12 00:00:00', '1995-01-09 00:00:00', '1995-01-03 00:00:00', '2', '64.1900', 'La maison d\'Asie', '1 rue Alsace-Lorraine', 'Toulouse', null, '31000', 'France'); +INSERT INTO orders VALUES ('10351', 'ERNSH', '1', '1994-12-12 00:00:00', '1995-01-09 00:00:00', '1994-12-21 00:00:00', '1', '162.3300', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10352', 'FURIB', '3', '1994-12-13 00:00:00', '1994-12-27 00:00:00', '1994-12-19 00:00:00', '3', '1.3000', 'Furia Bacalhau e Frutos do Mar', 'Jardim das rosas n. 32', 'Lisboa', null, '1675', 'Portugal'); +INSERT INTO orders VALUES ('10353', 'PICCO', '7', '1994-12-14 00:00:00', '1995-01-11 00:00:00', '1994-12-26 00:00:00', '3', '360.6300', 'Piccolo und mehr', 'Geislweg 14', 'Salzburg', null, '5020', 'Austria'); +INSERT INTO orders VALUES ('10354', 'PERIC', '8', '1994-12-15 00:00:00', '1995-01-12 00:00:00', '1994-12-21 00:00:00', '3', '53.8000', 'Pericles Comidas clásicas', 'Calle Dr. Jorge Cash 321', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('10355', 'AROUT', '6', '1994-12-16 00:00:00', '1995-01-13 00:00:00', '1994-12-21 00:00:00', '1', '41.9500', 'Around the Horn', 'Brook Farm\r\nStratford St. Mary', 'Colchester', 'Essex', 'CO7 6JX', 'UK'); +INSERT INTO orders VALUES ('10356', 'WANDK', '6', '1994-12-19 00:00:00', '1995-01-16 00:00:00', '1994-12-28 00:00:00', '2', '36.7100', 'Die Wandernde Kuh', 'Adenauerallee 900', 'Stuttgart', null, '70563', 'Germany'); +INSERT INTO orders VALUES ('10357', 'LILAS', '1', '1994-12-20 00:00:00', '1995-01-17 00:00:00', '1995-01-02 00:00:00', '3', '34.8800', 'LILA-Supermercado', 'Carrera 52 con Ave. Bolívar #65-98 Llano Largo', 'Barquisimeto', 'Lara', '3508', 'Venezuela'); +INSERT INTO orders VALUES ('10358', 'LAMAI', '5', '1994-12-21 00:00:00', '1995-01-18 00:00:00', '1994-12-28 00:00:00', '1', '19.6400', 'La maison d\'Asie', '1 rue Alsace-Lorraine', 'Toulouse', null, '31000', 'France'); +INSERT INTO orders VALUES ('10359', 'SEVES', '5', '1994-12-22 00:00:00', '1995-01-19 00:00:00', '1994-12-27 00:00:00', '3', '288.4300', 'Seven Seas Imports', '90 Wadhurst Rd.', 'London', null, 'OX15 4NB', 'UK'); +INSERT INTO orders VALUES ('10360', 'BLONP', '4', '1994-12-23 00:00:00', '1995-01-20 00:00:00', '1995-01-02 00:00:00', '3', '131.7000', 'Blondel père et fils', '24, place Kléber', 'Strasbourg', null, '67000', 'France'); +INSERT INTO orders VALUES ('10361', 'QUICK', '1', '1994-12-23 00:00:00', '1995-01-20 00:00:00', '1995-01-03 00:00:00', '2', '183.1700', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10362', 'BONAP', '3', '1994-12-26 00:00:00', '1995-01-23 00:00:00', '1994-12-29 00:00:00', '1', '96.0400', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10363', 'DRACD', '4', '1994-12-27 00:00:00', '1995-01-24 00:00:00', '1995-01-04 00:00:00', '3', '30.5400', 'Drachenblut Delikatessen', 'Walserweg 21', 'Aachen', null, '52066', 'Germany'); +INSERT INTO orders VALUES ('10364', 'EASTC', '1', '1994-12-27 00:00:00', '1995-02-07 00:00:00', '1995-01-04 00:00:00', '1', '71.9700', 'Eastern Connection', '35 King George', 'London', null, 'WX3 6FW', 'UK'); +INSERT INTO orders VALUES ('10365', 'ANTON', '3', '1994-12-28 00:00:00', '1995-01-25 00:00:00', '1995-01-02 00:00:00', '2', '22.0000', 'Antonio Moreno Taquería', 'Mataderos 2312', 'México D.F.', null, '05023', 'Mexico'); +INSERT INTO orders VALUES ('10366', 'GALED', '8', '1994-12-29 00:00:00', '1995-02-09 00:00:00', '1995-01-30 00:00:00', '2', '10.1400', 'Galería del gastronómo', 'Rambla de Cataluña, 23', 'Barcelona', null, '8022', 'Spain'); +INSERT INTO orders VALUES ('10367', 'VAFFE', '7', '1994-12-29 00:00:00', '1995-01-26 00:00:00', '1995-01-02 00:00:00', '3', '13.5500', 'Vaffeljernet', 'Smagsløget 45', 'Århus', null, '8200', 'Denmark'); +INSERT INTO orders VALUES ('10368', 'ERNSH', '2', '1994-12-30 00:00:00', '1995-01-27 00:00:00', '1995-01-02 00:00:00', '2', '101.9500', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10369', 'SPLIR', '8', '1995-01-02 00:00:00', '1995-01-30 00:00:00', '1995-01-09 00:00:00', '2', '195.6800', 'Split Rail Beer & Ale', 'P.O. Box 555', 'Lander', 'WY', '82520', 'USA'); +INSERT INTO orders VALUES ('10370', 'CHOPS', '6', '1995-01-03 00:00:00', '1995-01-31 00:00:00', '1995-01-27 00:00:00', '2', '1.1700', 'Chop-suey Chinese', 'Hauptstr. 31', 'Bern', null, '3012', 'Switzerland'); +INSERT INTO orders VALUES ('10371', 'LAMAI', '1', '1995-01-03 00:00:00', '1995-01-31 00:00:00', '1995-01-24 00:00:00', '1', '0.4500', 'La maison d\'Asie', '1 rue Alsace-Lorraine', 'Toulouse', null, '31000', 'France'); +INSERT INTO orders VALUES ('10372', 'QUEEN', '5', '1995-01-04 00:00:00', '1995-02-01 00:00:00', '1995-01-09 00:00:00', '2', '890.7800', 'Queen Cozinha', 'Alameda dos Canàrios, 891', 'São Paulo', 'SP', '05487-020', 'Brazil'); +INSERT INTO orders VALUES ('10373', 'HUNGO', '4', '1995-01-05 00:00:00', '1995-02-02 00:00:00', '1995-01-11 00:00:00', '3', '124.1200', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10374', 'WOLZA', '1', '1995-01-05 00:00:00', '1995-02-02 00:00:00', '1995-01-09 00:00:00', '3', '3.9400', 'Wolski Zajazd', 'ul. Filtrowa 68', 'Warszawa', null, '01-012', 'Poland'); +INSERT INTO orders VALUES ('10375', 'HUNGC', '3', '1995-01-06 00:00:00', '1995-02-03 00:00:00', '1995-01-09 00:00:00', '2', '20.1200', 'Hungry Coyote Import Store', 'City Center Plaza\r\n516 Main St.', 'Elgin', 'OR', '97827', 'USA'); +INSERT INTO orders VALUES ('10376', 'MEREP', '1', '1995-01-09 00:00:00', '1995-02-06 00:00:00', '1995-01-13 00:00:00', '2', '20.3900', 'Mère Paillarde', '43 rue St. Laurent', 'Montréal', 'Québec', 'H1J 1C3', 'Canada'); +INSERT INTO orders VALUES ('10377', 'SEVES', '1', '1995-01-09 00:00:00', '1995-02-06 00:00:00', '1995-01-13 00:00:00', '3', '22.2100', 'Seven Seas Imports', '90 Wadhurst Rd.', 'London', null, 'OX15 4NB', 'UK'); +INSERT INTO orders VALUES ('10378', 'FOLKO', '5', '1995-01-10 00:00:00', '1995-02-07 00:00:00', '1995-01-19 00:00:00', '3', '5.4400', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10379', 'QUEDE', '2', '1995-01-11 00:00:00', '1995-02-08 00:00:00', '1995-01-13 00:00:00', '1', '45.0300', 'Que Delícia', 'Rua da Panificadora, 12', 'Rio de Janeiro', 'RJ', '02389-673', 'Brazil'); +INSERT INTO orders VALUES ('10380', 'HUNGO', '8', '1995-01-12 00:00:00', '1995-02-09 00:00:00', '1995-02-16 00:00:00', '3', '35.0300', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10381', 'LILAS', '3', '1995-01-12 00:00:00', '1995-02-09 00:00:00', '1995-01-13 00:00:00', '3', '7.9900', 'LILA-Supermercado', 'Carrera 52 con Ave. Bolívar #65-98 Llano Largo', 'Barquisimeto', 'Lara', '3508', 'Venezuela'); +INSERT INTO orders VALUES ('10382', 'ERNSH', '4', '1995-01-13 00:00:00', '1995-02-10 00:00:00', '1995-01-16 00:00:00', '1', '94.7700', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10383', 'AROUT', '8', '1995-01-16 00:00:00', '1995-02-13 00:00:00', '1995-01-18 00:00:00', '3', '34.2400', 'Around the Horn', 'Brook Farm\r\nStratford St. Mary', 'Colchester', 'Essex', 'CO7 6JX', 'UK'); +INSERT INTO orders VALUES ('10384', 'BERGS', '3', '1995-01-16 00:00:00', '1995-02-13 00:00:00', '1995-01-20 00:00:00', '3', '168.6400', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10385', 'SPLIR', '1', '1995-01-17 00:00:00', '1995-02-14 00:00:00', '1995-01-23 00:00:00', '2', '30.9600', 'Split Rail Beer & Ale', 'P.O. Box 555', 'Lander', 'WY', '82520', 'USA'); +INSERT INTO orders VALUES ('10386', 'FAMIA', '9', '1995-01-18 00:00:00', '1995-02-01 00:00:00', '1995-01-25 00:00:00', '3', '13.9900', 'Familia Arquibaldo', 'Rua Orós, 92', 'São Paulo', 'SP', '05442-030', 'Brazil'); +INSERT INTO orders VALUES ('10387', 'SANTG', '1', '1995-01-18 00:00:00', '1995-02-15 00:00:00', '1995-01-20 00:00:00', '2', '93.6300', 'Santé Gourmet', 'Erling Skakkes gate 78', 'Stavern', null, '4110', 'Norway'); +INSERT INTO orders VALUES ('10388', 'SEVES', '2', '1995-01-19 00:00:00', '1995-02-16 00:00:00', '1995-01-20 00:00:00', '1', '34.8600', 'Seven Seas Imports', '90 Wadhurst Rd.', 'London', null, 'OX15 4NB', 'UK'); +INSERT INTO orders VALUES ('10389', 'BOTTM', '4', '1995-01-20 00:00:00', '1995-02-17 00:00:00', '1995-01-24 00:00:00', '2', '47.4200', 'Bottom-Dollar Markets', '23 Tsawassen Blvd.', 'Tsawassen', 'BC', 'T2F 8M4', 'Canada'); +INSERT INTO orders VALUES ('10390', 'ERNSH', '6', '1995-01-23 00:00:00', '1995-02-20 00:00:00', '1995-01-26 00:00:00', '1', '126.3800', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10391', 'DRACD', '3', '1995-01-23 00:00:00', '1995-02-20 00:00:00', '1995-01-31 00:00:00', '3', '5.4500', 'Drachenblut Delikatessen', 'Walserweg 21', 'Aachen', null, '52066', 'Germany'); +INSERT INTO orders VALUES ('10392', 'PICCO', '2', '1995-01-24 00:00:00', '1995-02-21 00:00:00', '1995-02-01 00:00:00', '3', '122.4600', 'Piccolo und mehr', 'Geislweg 14', 'Salzburg', null, '5020', 'Austria'); +INSERT INTO orders VALUES ('10393', 'SAVEA', '1', '1995-01-25 00:00:00', '1995-02-22 00:00:00', '1995-02-03 00:00:00', '3', '126.5600', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10394', 'HUNGC', '1', '1995-01-25 00:00:00', '1995-02-22 00:00:00', '1995-02-03 00:00:00', '3', '30.3400', 'Hungry Coyote Import Store', 'City Center Plaza\r\n516 Main St.', 'Elgin', 'OR', '97827', 'USA'); +INSERT INTO orders VALUES ('10395', 'HILAA', '6', '1995-01-26 00:00:00', '1995-02-23 00:00:00', '1995-02-03 00:00:00', '1', '184.4100', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10396', 'FRANK', '1', '1995-01-27 00:00:00', '1995-02-10 00:00:00', '1995-02-06 00:00:00', '3', '135.3500', 'Frankenversand', 'Berliner Platz 43', 'München', null, '80805', 'Germany'); +INSERT INTO orders VALUES ('10397', 'PRINI', '5', '1995-01-27 00:00:00', '1995-02-24 00:00:00', '1995-02-02 00:00:00', '1', '60.2600', 'Princesa Isabel Vinhos', 'Estrada da saúde n. 58', 'Lisboa', null, '1756', 'Portugal'); +INSERT INTO orders VALUES ('10398', 'SAVEA', '2', '1995-01-30 00:00:00', '1995-02-27 00:00:00', '1995-02-09 00:00:00', '3', '89.1600', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10399', 'VAFFE', '8', '1995-01-31 00:00:00', '1995-02-14 00:00:00', '1995-02-08 00:00:00', '3', '27.3600', 'Vaffeljernet', 'Smagsløget 45', 'Århus', null, '8200', 'Denmark'); +INSERT INTO orders VALUES ('10400', 'EASTC', '1', '1995-02-01 00:00:00', '1995-03-01 00:00:00', '1995-02-16 00:00:00', '3', '83.9300', 'Eastern Connection', '35 King George', 'London', null, 'WX3 6FW', 'UK'); +INSERT INTO orders VALUES ('10401', 'RATTC', '1', '1995-02-01 00:00:00', '1995-03-01 00:00:00', '1995-02-10 00:00:00', '1', '12.5100', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10402', 'ERNSH', '8', '1995-02-02 00:00:00', '1995-03-16 00:00:00', '1995-02-10 00:00:00', '2', '67.8800', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10403', 'ERNSH', '4', '1995-02-03 00:00:00', '1995-03-03 00:00:00', '1995-02-09 00:00:00', '3', '73.7900', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10404', 'MAGAA', '2', '1995-02-03 00:00:00', '1995-03-03 00:00:00', '1995-02-08 00:00:00', '1', '155.9700', 'Magazzini Alimentari Riuniti', 'Via Ludovico il Moro 22', 'Bergamo', null, '24100', 'Italy'); +INSERT INTO orders VALUES ('10405', 'LINOD', '1', '1995-02-06 00:00:00', '1995-03-06 00:00:00', '1995-02-22 00:00:00', '1', '34.8200', 'LINO-Delicateses', 'Ave. 5 de Mayo Porlamar', 'I. de Margarita', 'Nueva Esparta', '4980', 'Venezuela'); +INSERT INTO orders VALUES ('10406', 'QUEEN', '7', '1995-02-07 00:00:00', '1995-03-21 00:00:00', '1995-02-13 00:00:00', '1', '108.0400', 'Queen Cozinha', 'Alameda dos Canàrios, 891', 'São Paulo', 'SP', '05487-020', 'Brazil'); +INSERT INTO orders VALUES ('10407', 'OTTIK', '2', '1995-02-07 00:00:00', '1995-03-07 00:00:00', '1995-03-02 00:00:00', '2', '91.4800', 'Ottilies Käseladen', 'Mehrheimerstr. 369', 'Köln', null, '50739', 'Germany'); +INSERT INTO orders VALUES ('10408', 'FOLIG', '8', '1995-02-08 00:00:00', '1995-03-08 00:00:00', '1995-02-14 00:00:00', '1', '11.2600', 'Folies gourmandes', '184, chaussée de Tournai', 'Lille', null, '59000', 'France'); +INSERT INTO orders VALUES ('10409', 'OCEAN', '3', '1995-02-09 00:00:00', '1995-03-09 00:00:00', '1995-02-14 00:00:00', '1', '29.8300', 'Océano Atlántico Ltda.', 'Ing. Gustavo Moncada 8585\r\nPiso 20-A', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('10410', 'BOTTM', '3', '1995-02-10 00:00:00', '1995-03-10 00:00:00', '1995-02-15 00:00:00', '3', '2.4000', 'Bottom-Dollar Markets', '23 Tsawassen Blvd.', 'Tsawassen', 'BC', 'T2F 8M4', 'Canada'); +INSERT INTO orders VALUES ('10411', 'BOTTM', '9', '1995-02-10 00:00:00', '1995-03-10 00:00:00', '1995-02-21 00:00:00', '3', '23.6500', 'Bottom-Dollar Markets', '23 Tsawassen Blvd.', 'Tsawassen', 'BC', 'T2F 8M4', 'Canada'); +INSERT INTO orders VALUES ('10412', 'WARTH', '8', '1995-02-13 00:00:00', '1995-03-13 00:00:00', '1995-02-15 00:00:00', '2', '3.7700', 'Wartian Herkku', 'Torikatu 38', 'Oulu', null, '90110', 'Finland'); +INSERT INTO orders VALUES ('10413', 'LAMAI', '3', '1995-02-14 00:00:00', '1995-03-14 00:00:00', '1995-02-16 00:00:00', '2', '95.6600', 'La maison d\'Asie', '1 rue Alsace-Lorraine', 'Toulouse', null, '31000', 'France'); +INSERT INTO orders VALUES ('10414', 'FAMIA', '2', '1995-02-14 00:00:00', '1995-03-14 00:00:00', '1995-02-17 00:00:00', '3', '21.4800', 'Familia Arquibaldo', 'Rua Orós, 92', 'São Paulo', 'SP', '05442-030', 'Brazil'); +INSERT INTO orders VALUES ('10415', 'HUNGC', '3', '1995-02-15 00:00:00', '1995-03-15 00:00:00', '1995-02-24 00:00:00', '1', '0.2000', 'Hungry Coyote Import Store', 'City Center Plaza\r\n516 Main St.', 'Elgin', 'OR', '97827', 'USA'); +INSERT INTO orders VALUES ('10416', 'WARTH', '8', '1995-02-16 00:00:00', '1995-03-16 00:00:00', '1995-02-27 00:00:00', '3', '22.7200', 'Wartian Herkku', 'Torikatu 38', 'Oulu', null, '90110', 'Finland'); +INSERT INTO orders VALUES ('10417', 'SIMOB', '4', '1995-02-16 00:00:00', '1995-03-16 00:00:00', '1995-02-28 00:00:00', '3', '70.2900', 'Simons bistro', 'Vinbæltet 34', 'København', null, '1734', 'Denmark'); +INSERT INTO orders VALUES ('10418', 'QUICK', '4', '1995-02-17 00:00:00', '1995-03-17 00:00:00', '1995-02-24 00:00:00', '1', '17.5500', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10419', 'RICSU', '4', '1995-02-20 00:00:00', '1995-03-20 00:00:00', '1995-03-02 00:00:00', '2', '137.3500', 'Richter Supermarkt', 'Starenweg 5', 'Genève', null, '1204', 'Switzerland'); +INSERT INTO orders VALUES ('10420', 'WELLI', '3', '1995-02-21 00:00:00', '1995-03-21 00:00:00', '1995-02-27 00:00:00', '1', '44.1200', 'Wellington Importadora', 'Rua do Mercado, 12', 'Resende', 'SP', '08737-363', 'Brazil'); +INSERT INTO orders VALUES ('10421', 'QUEDE', '8', '1995-02-21 00:00:00', '1995-04-04 00:00:00', '1995-02-27 00:00:00', '1', '99.2300', 'Que Delícia', 'Rua da Panificadora, 12', 'Rio de Janeiro', 'RJ', '02389-673', 'Brazil'); +INSERT INTO orders VALUES ('10422', 'FRANS', '2', '1995-02-22 00:00:00', '1995-03-22 00:00:00', '1995-03-03 00:00:00', '1', '3.0200', 'Franchi S.p.A.', 'Via Monte Bianco 34', 'Torino', null, '10100', 'Italy'); +INSERT INTO orders VALUES ('10423', 'GOURL', '6', '1995-02-23 00:00:00', '1995-03-09 00:00:00', '1995-03-27 00:00:00', '3', '24.5000', 'Gourmet Lanchonetes', 'Av. Brasil, 442', 'Campinas', 'SP', '04876-786', 'Brazil'); +INSERT INTO orders VALUES ('10424', 'MEREP', '7', '1995-02-23 00:00:00', '1995-03-23 00:00:00', '1995-02-27 00:00:00', '2', '370.6100', 'Mère Paillarde', '43 rue St. Laurent', 'Montréal', 'Québec', 'H1J 1C3', 'Canada'); +INSERT INTO orders VALUES ('10425', 'LAMAI', '6', '1995-02-24 00:00:00', '1995-03-24 00:00:00', '1995-03-17 00:00:00', '2', '7.9300', 'La maison d\'Asie', '1 rue Alsace-Lorraine', 'Toulouse', null, '31000', 'France'); +INSERT INTO orders VALUES ('10426', 'GALED', '4', '1995-02-27 00:00:00', '1995-03-27 00:00:00', '1995-03-09 00:00:00', '1', '18.6900', 'Galería del gastronómo', 'Rambla de Cataluña, 23', 'Barcelona', null, '8022', 'Spain'); +INSERT INTO orders VALUES ('10427', 'PICCO', '4', '1995-02-27 00:00:00', '1995-03-27 00:00:00', '1995-04-03 00:00:00', '2', '31.2900', 'Piccolo und mehr', 'Geislweg 14', 'Salzburg', null, '5020', 'Austria'); +INSERT INTO orders VALUES ('10428', 'REGGC', '7', '1995-02-28 00:00:00', '1995-03-28 00:00:00', '1995-03-07 00:00:00', '1', '11.0900', 'Reggiani Caseifici', 'Strada Provinciale 124', 'Reggio Emilia', null, '42100', 'Italy'); +INSERT INTO orders VALUES ('10429', 'HUNGO', '3', '1995-03-01 00:00:00', '1995-04-12 00:00:00', '1995-03-10 00:00:00', '2', '56.6300', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10430', 'ERNSH', '4', '1995-03-02 00:00:00', '1995-03-16 00:00:00', '1995-03-06 00:00:00', '1', '458.7800', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10431', 'BOTTM', '4', '1995-03-02 00:00:00', '1995-03-16 00:00:00', '1995-03-10 00:00:00', '2', '44.1700', 'Bottom-Dollar Markets', '23 Tsawassen Blvd.', 'Tsawassen', 'BC', 'T2F 8M4', 'Canada'); +INSERT INTO orders VALUES ('10432', 'SPLIR', '3', '1995-03-03 00:00:00', '1995-03-17 00:00:00', '1995-03-10 00:00:00', '2', '4.3400', 'Split Rail Beer & Ale', 'P.O. Box 555', 'Lander', 'WY', '82520', 'USA'); +INSERT INTO orders VALUES ('10433', 'PRINI', '3', '1995-03-06 00:00:00', '1995-04-03 00:00:00', '1995-04-04 00:00:00', '3', '73.8300', 'Princesa Isabel Vinhos', 'Estrada da saúde n. 58', 'Lisboa', null, '1756', 'Portugal'); +INSERT INTO orders VALUES ('10434', 'FOLKO', '3', '1995-03-06 00:00:00', '1995-04-03 00:00:00', '1995-03-16 00:00:00', '2', '17.9200', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10435', 'CONSH', '8', '1995-03-07 00:00:00', '1995-04-18 00:00:00', '1995-03-10 00:00:00', '2', '9.2100', 'Consolidated Holdings', 'Berkeley Gardens\r\n12 Brewery ', 'London', null, 'WX1 6LT', 'UK'); +INSERT INTO orders VALUES ('10436', 'BLONP', '3', '1995-03-08 00:00:00', '1995-04-05 00:00:00', '1995-03-14 00:00:00', '2', '156.6600', 'Blondel père et fils', '24, place Kléber', 'Strasbourg', null, '67000', 'France'); +INSERT INTO orders VALUES ('10437', 'WARTH', '8', '1995-03-08 00:00:00', '1995-04-05 00:00:00', '1995-03-15 00:00:00', '1', '19.9700', 'Wartian Herkku', 'Torikatu 38', 'Oulu', null, '90110', 'Finland'); +INSERT INTO orders VALUES ('10438', 'TOMSP', '3', '1995-03-09 00:00:00', '1995-04-06 00:00:00', '1995-03-17 00:00:00', '2', '8.2400', 'Toms Spezialitäten', 'Luisenstr. 48', 'Münster', null, '44087', 'Germany'); +INSERT INTO orders VALUES ('10439', 'MEREP', '6', '1995-03-10 00:00:00', '1995-04-07 00:00:00', '1995-03-13 00:00:00', '3', '4.0700', 'Mère Paillarde', '43 rue St. Laurent', 'Montréal', 'Québec', 'H1J 1C3', 'Canada'); +INSERT INTO orders VALUES ('10440', 'SAVEA', '4', '1995-03-13 00:00:00', '1995-04-10 00:00:00', '1995-03-31 00:00:00', '2', '86.5300', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10441', 'OLDWO', '3', '1995-03-13 00:00:00', '1995-04-24 00:00:00', '1995-04-14 00:00:00', '2', '73.0200', 'Old World Delicatessen', '2743 Bering St.', 'Anchorage', 'AK', '99508', 'USA'); +INSERT INTO orders VALUES ('10442', 'ERNSH', '3', '1995-03-14 00:00:00', '1995-04-11 00:00:00', '1995-03-21 00:00:00', '2', '47.9400', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10443', 'REGGC', '8', '1995-03-15 00:00:00', '1995-04-12 00:00:00', '1995-03-17 00:00:00', '1', '13.9500', 'Reggiani Caseifici', 'Strada Provinciale 124', 'Reggio Emilia', null, '42100', 'Italy'); +INSERT INTO orders VALUES ('10444', 'BERGS', '3', '1995-03-15 00:00:00', '1995-04-12 00:00:00', '1995-03-24 00:00:00', '3', '3.5000', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10445', 'BERGS', '3', '1995-03-16 00:00:00', '1995-04-13 00:00:00', '1995-03-23 00:00:00', '1', '9.3000', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10446', 'TOMSP', '6', '1995-03-17 00:00:00', '1995-04-14 00:00:00', '1995-03-22 00:00:00', '1', '14.6800', 'Toms Spezialitäten', 'Luisenstr. 48', 'Münster', null, '44087', 'Germany'); +INSERT INTO orders VALUES ('10447', 'RICAR', '4', '1995-03-17 00:00:00', '1995-04-14 00:00:00', '1995-04-07 00:00:00', '2', '68.6600', 'Ricardo Adocicados', 'Av. Copacabana, 267', 'Rio de Janeiro', 'RJ', '02389-890', 'Brazil'); +INSERT INTO orders VALUES ('10448', 'RANCH', '4', '1995-03-20 00:00:00', '1995-04-17 00:00:00', '1995-03-27 00:00:00', '2', '38.8200', 'Rancho grande', 'Av. del Libertador 900', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('10449', 'BLONP', '3', '1995-03-21 00:00:00', '1995-04-18 00:00:00', '1995-03-30 00:00:00', '2', '53.3000', 'Blondel père et fils', '24, place Kléber', 'Strasbourg', null, '67000', 'France'); +INSERT INTO orders VALUES ('10450', 'VICTE', '8', '1995-03-22 00:00:00', '1995-04-19 00:00:00', '1995-04-11 00:00:00', '2', '7.2300', 'Victuailles en stock', '2, rue du Commerce', 'Lyon', null, '69004', 'France'); +INSERT INTO orders VALUES ('10451', 'QUICK', '4', '1995-03-22 00:00:00', '1995-04-05 00:00:00', '1995-04-12 00:00:00', '3', '189.0900', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10452', 'SAVEA', '8', '1995-03-23 00:00:00', '1995-04-20 00:00:00', '1995-03-29 00:00:00', '1', '140.2600', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10453', 'AROUT', '1', '1995-03-24 00:00:00', '1995-04-21 00:00:00', '1995-03-29 00:00:00', '2', '25.3600', 'Around the Horn', 'Brook Farm\r\nStratford St. Mary', 'Colchester', 'Essex', 'CO7 6JX', 'UK'); +INSERT INTO orders VALUES ('10454', 'LAMAI', '4', '1995-03-24 00:00:00', '1995-04-21 00:00:00', '1995-03-28 00:00:00', '3', '2.7400', 'La maison d\'Asie', '1 rue Alsace-Lorraine', 'Toulouse', null, '31000', 'France'); +INSERT INTO orders VALUES ('10455', 'WARTH', '8', '1995-03-27 00:00:00', '1995-05-08 00:00:00', '1995-04-03 00:00:00', '2', '180.4500', 'Wartian Herkku', 'Torikatu 38', 'Oulu', null, '90110', 'Finland'); +INSERT INTO orders VALUES ('10456', 'KOENE', '8', '1995-03-28 00:00:00', '1995-05-09 00:00:00', '1995-03-31 00:00:00', '2', '8.1200', 'Königlich Essen', 'Maubelstr. 90', 'Brandenburg', null, '14776', 'Germany'); +INSERT INTO orders VALUES ('10457', 'KOENE', '2', '1995-03-28 00:00:00', '1995-04-25 00:00:00', '1995-04-03 00:00:00', '1', '11.5700', 'Königlich Essen', 'Maubelstr. 90', 'Brandenburg', null, '14776', 'Germany'); +INSERT INTO orders VALUES ('10458', 'SUPRD', '7', '1995-03-29 00:00:00', '1995-04-26 00:00:00', '1995-04-04 00:00:00', '3', '147.0600', 'Suprêmes délices', 'Boulevard Tirou, 255', 'Charleroi', null, 'B-6000', 'Belgium'); +INSERT INTO orders VALUES ('10459', 'VICTE', '4', '1995-03-30 00:00:00', '1995-04-27 00:00:00', '1995-03-31 00:00:00', '2', '25.0900', 'Victuailles en stock', '2, rue du Commerce', 'Lyon', null, '69004', 'France'); +INSERT INTO orders VALUES ('10460', 'FOLKO', '8', '1995-03-31 00:00:00', '1995-04-28 00:00:00', '1995-04-03 00:00:00', '1', '16.2700', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10461', 'LILAS', '1', '1995-03-31 00:00:00', '1995-04-28 00:00:00', '1995-04-05 00:00:00', '3', '148.6100', 'LILA-Supermercado', 'Carrera 52 con Ave. Bolívar #65-98 Llano Largo', 'Barquisimeto', 'Lara', '3508', 'Venezuela'); +INSERT INTO orders VALUES ('10462', 'CONSH', '2', '1995-04-03 00:00:00', '1995-05-01 00:00:00', '1995-04-18 00:00:00', '1', '6.1700', 'Consolidated Holdings', 'Berkeley Gardens\r\n12 Brewery ', 'London', null, 'WX1 6LT', 'UK'); +INSERT INTO orders VALUES ('10463', 'SUPRD', '5', '1995-04-04 00:00:00', '1995-05-02 00:00:00', '1995-04-06 00:00:00', '3', '14.7800', 'Suprêmes délices', 'Boulevard Tirou, 255', 'Charleroi', null, 'B-6000', 'Belgium'); +INSERT INTO orders VALUES ('10464', 'FURIB', '4', '1995-04-04 00:00:00', '1995-05-02 00:00:00', '1995-04-14 00:00:00', '2', '89.0000', 'Furia Bacalhau e Frutos do Mar', 'Jardim das rosas n. 32', 'Lisboa', null, '1675', 'Portugal'); +INSERT INTO orders VALUES ('10465', 'VAFFE', '1', '1995-04-05 00:00:00', '1995-05-03 00:00:00', '1995-04-14 00:00:00', '3', '145.0400', 'Vaffeljernet', 'Smagsløget 45', 'Århus', null, '8200', 'Denmark'); +INSERT INTO orders VALUES ('10466', 'COMMI', '4', '1995-04-06 00:00:00', '1995-05-04 00:00:00', '1995-04-13 00:00:00', '1', '11.9300', 'Comércio Mineiro', 'Av. dos Lusíadas, 23', 'São Paulo', 'SP', '05432-043', 'Brazil'); +INSERT INTO orders VALUES ('10467', 'MAGAA', '8', '1995-04-06 00:00:00', '1995-05-04 00:00:00', '1995-04-11 00:00:00', '2', '4.9300', 'Magazzini Alimentari Riuniti', 'Via Ludovico il Moro 22', 'Bergamo', null, '24100', 'Italy'); +INSERT INTO orders VALUES ('10468', 'KOENE', '3', '1995-04-07 00:00:00', '1995-05-05 00:00:00', '1995-04-12 00:00:00', '3', '44.1200', 'Königlich Essen', 'Maubelstr. 90', 'Brandenburg', null, '14776', 'Germany'); +INSERT INTO orders VALUES ('10469', 'WHITC', '1', '1995-04-10 00:00:00', '1995-05-08 00:00:00', '1995-04-14 00:00:00', '1', '60.1800', 'White Clover Markets', '1029 - 12th Ave. S.', 'Seattle', 'WA', '98124', 'USA'); +INSERT INTO orders VALUES ('10470', 'BONAP', '4', '1995-04-11 00:00:00', '1995-05-09 00:00:00', '1995-04-14 00:00:00', '2', '64.5600', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10471', 'BSBEV', '2', '1995-04-11 00:00:00', '1995-05-09 00:00:00', '1995-04-18 00:00:00', '3', '45.5900', 'B\'s Beverages', 'Fauntleroy Circus', 'London', null, 'EC2 5NT', 'UK'); +INSERT INTO orders VALUES ('10472', 'SEVES', '8', '1995-04-12 00:00:00', '1995-05-10 00:00:00', '1995-04-19 00:00:00', '1', '4.2000', 'Seven Seas Imports', '90 Wadhurst Rd.', 'London', null, 'OX15 4NB', 'UK'); +INSERT INTO orders VALUES ('10473', 'ISLAT', '1', '1995-04-13 00:00:00', '1995-04-27 00:00:00', '1995-04-21 00:00:00', '3', '16.3700', 'Island Trading', 'Garden House\r\nCrowther Way', 'Cowes', 'Isle of Wight', 'PO31 7PJ', 'UK'); +INSERT INTO orders VALUES ('10474', 'PERIC', '5', '1995-04-13 00:00:00', '1995-05-11 00:00:00', '1995-04-21 00:00:00', '2', '83.4900', 'Pericles Comidas clásicas', 'Calle Dr. Jorge Cash 321', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('10475', 'SUPRD', '9', '1995-04-14 00:00:00', '1995-05-12 00:00:00', '1995-05-05 00:00:00', '1', '68.5200', 'Suprêmes délices', 'Boulevard Tirou, 255', 'Charleroi', null, 'B-6000', 'Belgium'); +INSERT INTO orders VALUES ('10476', 'HILAA', '8', '1995-04-17 00:00:00', '1995-05-15 00:00:00', '1995-04-24 00:00:00', '3', '4.4100', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10477', 'PRINI', '5', '1995-04-17 00:00:00', '1995-05-15 00:00:00', '1995-04-25 00:00:00', '2', '13.0200', 'Princesa Isabel Vinhos', 'Estrada da saúde n. 58', 'Lisboa', null, '1756', 'Portugal'); +INSERT INTO orders VALUES ('10478', 'VICTE', '2', '1995-04-18 00:00:00', '1995-05-02 00:00:00', '1995-04-26 00:00:00', '3', '4.8100', 'Victuailles en stock', '2, rue du Commerce', 'Lyon', null, '69004', 'France'); +INSERT INTO orders VALUES ('10479', 'RATTC', '3', '1995-04-19 00:00:00', '1995-05-17 00:00:00', '1995-04-21 00:00:00', '3', '708.9500', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10480', 'FOLIG', '6', '1995-04-20 00:00:00', '1995-05-18 00:00:00', '1995-04-24 00:00:00', '2', '1.3500', 'Folies gourmandes', '184, chaussée de Tournai', 'Lille', null, '59000', 'France'); +INSERT INTO orders VALUES ('10481', 'RICAR', '8', '1995-04-20 00:00:00', '1995-05-18 00:00:00', '1995-04-25 00:00:00', '2', '64.3300', 'Ricardo Adocicados', 'Av. Copacabana, 267', 'Rio de Janeiro', 'RJ', '02389-890', 'Brazil'); +INSERT INTO orders VALUES ('10482', 'LAZYK', '1', '1995-04-21 00:00:00', '1995-05-19 00:00:00', '1995-05-11 00:00:00', '3', '7.4800', 'Lazy K Kountry Store', '12 Orchestra Terrace', 'Walla Walla', 'WA', '99362', 'USA'); +INSERT INTO orders VALUES ('10483', 'WHITC', '7', '1995-04-24 00:00:00', '1995-05-22 00:00:00', '1995-05-26 00:00:00', '2', '15.2800', 'White Clover Markets', '1029 - 12th Ave. S.', 'Seattle', 'WA', '98124', 'USA'); +INSERT INTO orders VALUES ('10484', 'BSBEV', '3', '1995-04-24 00:00:00', '1995-05-22 00:00:00', '1995-05-02 00:00:00', '3', '6.8800', 'B\'s Beverages', 'Fauntleroy Circus', 'London', null, 'EC2 5NT', 'UK'); +INSERT INTO orders VALUES ('10485', 'LINOD', '4', '1995-04-25 00:00:00', '1995-05-09 00:00:00', '1995-05-01 00:00:00', '2', '64.4500', 'LINO-Delicateses', 'Ave. 5 de Mayo Porlamar', 'I. de Margarita', 'Nueva Esparta', '4980', 'Venezuela'); +INSERT INTO orders VALUES ('10486', 'HILAA', '1', '1995-04-26 00:00:00', '1995-05-24 00:00:00', '1995-05-03 00:00:00', '2', '30.5300', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10487', 'QUEEN', '2', '1995-04-26 00:00:00', '1995-05-24 00:00:00', '1995-04-28 00:00:00', '2', '71.0700', 'Queen Cozinha', 'Alameda dos Canàrios, 891', 'São Paulo', 'SP', '05487-020', 'Brazil'); +INSERT INTO orders VALUES ('10488', 'FRANK', '8', '1995-04-27 00:00:00', '1995-05-25 00:00:00', '1995-05-03 00:00:00', '2', '4.9300', 'Frankenversand', 'Berliner Platz 43', 'München', null, '80805', 'Germany'); +INSERT INTO orders VALUES ('10489', 'PICCO', '6', '1995-04-28 00:00:00', '1995-05-26 00:00:00', '1995-05-10 00:00:00', '2', '5.2900', 'Piccolo und mehr', 'Geislweg 14', 'Salzburg', null, '5020', 'Austria'); +INSERT INTO orders VALUES ('10490', 'HILAA', '7', '1995-05-01 00:00:00', '1995-05-29 00:00:00', '1995-05-04 00:00:00', '2', '210.1900', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10491', 'FURIB', '8', '1995-05-01 00:00:00', '1995-05-29 00:00:00', '1995-05-09 00:00:00', '3', '16.9600', 'Furia Bacalhau e Frutos do Mar', 'Jardim das rosas n. 32', 'Lisboa', null, '1675', 'Portugal'); +INSERT INTO orders VALUES ('10492', 'BOTTM', '3', '1995-05-02 00:00:00', '1995-05-30 00:00:00', '1995-05-12 00:00:00', '1', '62.8900', 'Bottom-Dollar Markets', '23 Tsawassen Blvd.', 'Tsawassen', 'BC', 'T2F 8M4', 'Canada'); +INSERT INTO orders VALUES ('10493', 'LAMAI', '4', '1995-05-03 00:00:00', '1995-05-31 00:00:00', '1995-05-11 00:00:00', '3', '10.6400', 'La maison d\'Asie', '1 rue Alsace-Lorraine', 'Toulouse', null, '31000', 'France'); +INSERT INTO orders VALUES ('10494', 'COMMI', '4', '1995-05-03 00:00:00', '1995-05-31 00:00:00', '1995-05-10 00:00:00', '2', '65.9900', 'Comércio Mineiro', 'Av. dos Lusíadas, 23', 'São Paulo', 'SP', '05432-043', 'Brazil'); +INSERT INTO orders VALUES ('10495', 'LAUGB', '3', '1995-05-04 00:00:00', '1995-06-01 00:00:00', '1995-05-12 00:00:00', '3', '4.6500', 'Laughing Bacchus Wine Cellars', '2319 Elm St.', 'Vancouver', 'BC', 'V3F 2K1', 'Canada'); +INSERT INTO orders VALUES ('10496', 'TRADH', '7', '1995-05-05 00:00:00', '1995-06-02 00:00:00', '1995-05-08 00:00:00', '2', '46.7700', 'Tradição Hipermercados', 'Av. Inês de Castro, 414', 'São Paulo', 'SP', '05634-030', 'Brazil'); +INSERT INTO orders VALUES ('10497', 'LEHMS', '7', '1995-05-05 00:00:00', '1995-06-02 00:00:00', '1995-05-08 00:00:00', '1', '36.2100', 'Lehmanns Marktstand', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany'); +INSERT INTO orders VALUES ('10498', 'HILAA', '8', '1995-05-08 00:00:00', '1995-06-05 00:00:00', '1995-05-12 00:00:00', '2', '29.7500', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10499', 'LILAS', '4', '1995-05-09 00:00:00', '1995-06-06 00:00:00', '1995-05-17 00:00:00', '2', '102.0200', 'LILA-Supermercado', 'Carrera 52 con Ave. Bolívar #65-98 Llano Largo', 'Barquisimeto', 'Lara', '3508', 'Venezuela'); +INSERT INTO orders VALUES ('10500', 'LAMAI', '6', '1995-05-10 00:00:00', '1995-06-07 00:00:00', '1995-05-18 00:00:00', '1', '42.6800', 'La maison d\'Asie', '1 rue Alsace-Lorraine', 'Toulouse', null, '31000', 'France'); +INSERT INTO orders VALUES ('10501', 'BLAUS', '9', '1995-05-10 00:00:00', '1995-06-07 00:00:00', '1995-05-17 00:00:00', '3', '8.8500', 'Blauer See Delikatessen', 'Forsterstr. 57', 'Mannheim', null, '68306', 'Germany'); +INSERT INTO orders VALUES ('10502', 'PERIC', '2', '1995-05-11 00:00:00', '1995-06-08 00:00:00', '1995-05-30 00:00:00', '1', '69.3200', 'Pericles Comidas clásicas', 'Calle Dr. Jorge Cash 321', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('10503', 'HUNGO', '6', '1995-05-12 00:00:00', '1995-06-09 00:00:00', '1995-05-17 00:00:00', '2', '16.7400', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10504', 'WHITC', '4', '1995-05-12 00:00:00', '1995-06-09 00:00:00', '1995-05-19 00:00:00', '3', '59.1300', 'White Clover Markets', '1029 - 12th Ave. S.', 'Seattle', 'WA', '98124', 'USA'); +INSERT INTO orders VALUES ('10505', 'MEREP', '3', '1995-05-15 00:00:00', '1995-06-12 00:00:00', '1995-05-22 00:00:00', '3', '7.1300', 'Mère Paillarde', '43 rue St. Laurent', 'Montréal', 'Québec', 'H1J 1C3', 'Canada'); +INSERT INTO orders VALUES ('10506', 'KOENE', '9', '1995-05-16 00:00:00', '1995-06-13 00:00:00', '1995-06-02 00:00:00', '2', '21.1900', 'Königlich Essen', 'Maubelstr. 90', 'Brandenburg', null, '14776', 'Germany'); +INSERT INTO orders VALUES ('10507', 'ANTON', '7', '1995-05-16 00:00:00', '1995-06-13 00:00:00', '1995-05-23 00:00:00', '1', '47.4500', 'Antonio Moreno Taquería', 'Mataderos 2312', 'México D.F.', null, '05023', 'Mexico'); +INSERT INTO orders VALUES ('10508', 'OTTIK', '1', '1995-05-17 00:00:00', '1995-06-14 00:00:00', '1995-06-13 00:00:00', '2', '4.9900', 'Ottilies Käseladen', 'Mehrheimerstr. 369', 'Köln', null, '50739', 'Germany'); +INSERT INTO orders VALUES ('10509', 'BLAUS', '4', '1995-05-18 00:00:00', '1995-06-15 00:00:00', '1995-05-30 00:00:00', '1', '0.1500', 'Blauer See Delikatessen', 'Forsterstr. 57', 'Mannheim', null, '68306', 'Germany'); +INSERT INTO orders VALUES ('10510', 'SAVEA', '6', '1995-05-19 00:00:00', '1995-06-16 00:00:00', '1995-05-29 00:00:00', '3', '367.6300', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10511', 'BONAP', '4', '1995-05-19 00:00:00', '1995-06-16 00:00:00', '1995-05-22 00:00:00', '3', '350.6400', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10512', 'FAMIA', '7', '1995-05-22 00:00:00', '1995-06-19 00:00:00', '1995-05-25 00:00:00', '2', '3.5300', 'Familia Arquibaldo', 'Rua Orós, 92', 'São Paulo', 'SP', '05442-030', 'Brazil'); +INSERT INTO orders VALUES ('10513', 'WANDK', '7', '1995-05-23 00:00:00', '1995-07-04 00:00:00', '1995-05-29 00:00:00', '1', '105.6500', 'Die Wandernde Kuh', 'Adenauerallee 900', 'Stuttgart', null, '70563', 'Germany'); +INSERT INTO orders VALUES ('10514', 'ERNSH', '3', '1995-05-23 00:00:00', '1995-06-20 00:00:00', '1995-06-16 00:00:00', '2', '789.9500', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10515', 'QUICK', '2', '1995-05-24 00:00:00', '1995-06-07 00:00:00', '1995-06-23 00:00:00', '1', '204.4700', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10516', 'HUNGO', '2', '1995-05-25 00:00:00', '1995-06-22 00:00:00', '1995-06-01 00:00:00', '3', '62.7800', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10517', 'NORTS', '3', '1995-05-25 00:00:00', '1995-06-22 00:00:00', '1995-05-30 00:00:00', '3', '32.0700', 'North/South', 'South House\r\n300 Queensbridge', 'London', null, 'SW7 1RZ', 'UK'); +INSERT INTO orders VALUES ('10518', 'TORTU', '4', '1995-05-26 00:00:00', '1995-06-09 00:00:00', '1995-06-05 00:00:00', '2', '218.1500', 'Tortuga Restaurante', 'Avda. Azteca 123', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('10519', 'CHOPS', '6', '1995-05-29 00:00:00', '1995-06-26 00:00:00', '1995-06-01 00:00:00', '3', '91.7600', 'Chop-suey Chinese', 'Hauptstr. 31', 'Bern', null, '3012', 'Switzerland'); +INSERT INTO orders VALUES ('10520', 'SANTG', '7', '1995-05-30 00:00:00', '1995-06-27 00:00:00', '1995-06-01 00:00:00', '1', '13.3700', 'Santé Gourmet', 'Erling Skakkes gate 78', 'Stavern', null, '4110', 'Norway'); +INSERT INTO orders VALUES ('10521', 'CACTU', '8', '1995-05-30 00:00:00', '1995-06-27 00:00:00', '1995-06-02 00:00:00', '2', '17.2200', 'Cactus Comidas para llevar', 'Cerrito 333', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('10522', 'LEHMS', '4', '1995-05-31 00:00:00', '1995-06-28 00:00:00', '1995-06-06 00:00:00', '1', '45.3300', 'Lehmanns Marktstand', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany'); +INSERT INTO orders VALUES ('10523', 'SEVES', '7', '1995-06-01 00:00:00', '1995-06-29 00:00:00', '1995-06-30 00:00:00', '2', '77.6300', 'Seven Seas Imports', '90 Wadhurst Rd.', 'London', null, 'OX15 4NB', 'UK'); +INSERT INTO orders VALUES ('10524', 'BERGS', '1', '1995-06-01 00:00:00', '1995-06-29 00:00:00', '1995-06-07 00:00:00', '2', '244.7900', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10525', 'BONAP', '1', '1995-06-02 00:00:00', '1995-06-30 00:00:00', '1995-06-23 00:00:00', '2', '11.0600', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10526', 'WARTH', '4', '1995-06-05 00:00:00', '1995-07-03 00:00:00', '1995-06-15 00:00:00', '2', '58.5900', 'Wartian Herkku', 'Torikatu 38', 'Oulu', null, '90110', 'Finland'); +INSERT INTO orders VALUES ('10527', 'QUICK', '7', '1995-06-05 00:00:00', '1995-07-03 00:00:00', '1995-06-07 00:00:00', '1', '41.9000', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10528', 'GREAL', '6', '1995-06-06 00:00:00', '1995-06-20 00:00:00', '1995-06-09 00:00:00', '2', '3.3500', 'Great Lakes Food Market', '2732 Baker Blvd.', 'Eugene', 'OR', '97403', 'USA'); +INSERT INTO orders VALUES ('10529', 'MAISD', '5', '1995-06-07 00:00:00', '1995-07-05 00:00:00', '1995-06-09 00:00:00', '2', '66.6900', 'Maison Dewey', 'Rue Joseph-Bens 532', 'Bruxelles', null, 'B-1180', 'Belgium'); +INSERT INTO orders VALUES ('10530', 'PICCO', '3', '1995-06-08 00:00:00', '1995-07-06 00:00:00', '1995-06-12 00:00:00', '2', '339.2200', 'Piccolo und mehr', 'Geislweg 14', 'Salzburg', null, '5020', 'Austria'); +INSERT INTO orders VALUES ('10531', 'OCEAN', '7', '1995-06-08 00:00:00', '1995-07-06 00:00:00', '1995-06-19 00:00:00', '1', '8.1200', 'Océano Atlántico Ltda.', 'Ing. Gustavo Moncada 8585\r\nPiso 20-A', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('10532', 'EASTC', '7', '1995-06-09 00:00:00', '1995-07-07 00:00:00', '1995-06-12 00:00:00', '3', '74.4600', 'Eastern Connection', '35 King George', 'London', null, 'WX3 6FW', 'UK'); +INSERT INTO orders VALUES ('10533', 'FOLKO', '8', '1995-06-12 00:00:00', '1995-07-10 00:00:00', '1995-06-22 00:00:00', '1', '188.0400', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10534', 'LEHMS', '8', '1995-06-12 00:00:00', '1995-07-10 00:00:00', '1995-06-14 00:00:00', '2', '27.9400', 'Lehmanns Marktstand', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany'); +INSERT INTO orders VALUES ('10535', 'ANTON', '4', '1995-06-13 00:00:00', '1995-07-11 00:00:00', '1995-06-21 00:00:00', '1', '15.6400', 'Antonio Moreno Taquería', 'Mataderos 2312', 'México D.F.', null, '05023', 'Mexico'); +INSERT INTO orders VALUES ('10536', 'LEHMS', '3', '1995-06-14 00:00:00', '1995-07-12 00:00:00', '1995-07-07 00:00:00', '2', '58.8800', 'Lehmanns Marktstand', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany'); +INSERT INTO orders VALUES ('10537', 'RICSU', '1', '1995-06-14 00:00:00', '1995-06-28 00:00:00', '1995-06-19 00:00:00', '1', '78.8500', 'Richter Supermarkt', 'Starenweg 5', 'Genève', null, '1204', 'Switzerland'); +INSERT INTO orders VALUES ('10538', 'BSBEV', '9', '1995-06-15 00:00:00', '1995-07-13 00:00:00', '1995-06-16 00:00:00', '3', '4.8700', 'B\'s Beverages', 'Fauntleroy Circus', 'London', null, 'EC2 5NT', 'UK'); +INSERT INTO orders VALUES ('10539', 'BSBEV', '6', '1995-06-16 00:00:00', '1995-07-14 00:00:00', '1995-06-23 00:00:00', '3', '12.3600', 'B\'s Beverages', 'Fauntleroy Circus', 'London', null, 'EC2 5NT', 'UK'); +INSERT INTO orders VALUES ('10540', 'QUICK', '3', '1995-06-19 00:00:00', '1995-07-17 00:00:00', '1995-07-14 00:00:00', '3', '1007.6400', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10541', 'HANAR', '2', '1995-06-19 00:00:00', '1995-07-17 00:00:00', '1995-06-29 00:00:00', '1', '68.6500', 'Hanari Carnes', 'Rua do Paço, 67', 'Rio de Janeiro', 'RJ', '05454-876', 'Brazil'); +INSERT INTO orders VALUES ('10542', 'KOENE', '1', '1995-06-20 00:00:00', '1995-07-18 00:00:00', '1995-06-26 00:00:00', '3', '10.9500', 'Königlich Essen', 'Maubelstr. 90', 'Brandenburg', null, '14776', 'Germany'); +INSERT INTO orders VALUES ('10543', 'LILAS', '8', '1995-06-21 00:00:00', '1995-07-19 00:00:00', '1995-06-23 00:00:00', '2', '48.1700', 'LILA-Supermercado', 'Carrera 52 con Ave. Bolívar #65-98 Llano Largo', 'Barquisimeto', 'Lara', '3508', 'Venezuela'); +INSERT INTO orders VALUES ('10544', 'LONEP', '4', '1995-06-21 00:00:00', '1995-07-19 00:00:00', '1995-06-30 00:00:00', '1', '24.9100', 'Lonesome Pine Restaurant', '89 Chiaroscuro Rd.', 'Portland', 'OR', '97219', 'USA'); +INSERT INTO orders VALUES ('10545', 'LAZYK', '8', '1995-06-22 00:00:00', '1995-07-20 00:00:00', '1995-07-27 00:00:00', '2', '11.9200', 'Lazy K Kountry Store', '12 Orchestra Terrace', 'Walla Walla', 'WA', '99362', 'USA'); +INSERT INTO orders VALUES ('10546', 'VICTE', '1', '1995-06-23 00:00:00', '1995-07-21 00:00:00', '1995-06-27 00:00:00', '3', '194.7200', 'Victuailles en stock', '2, rue du Commerce', 'Lyon', null, '69004', 'France'); +INSERT INTO orders VALUES ('10547', 'SEVES', '3', '1995-06-23 00:00:00', '1995-07-21 00:00:00', '1995-07-03 00:00:00', '2', '178.4300', 'Seven Seas Imports', '90 Wadhurst Rd.', 'London', null, 'OX15 4NB', 'UK'); +INSERT INTO orders VALUES ('10548', 'TOMSP', '3', '1995-06-26 00:00:00', '1995-07-24 00:00:00', '1995-07-03 00:00:00', '2', '1.4300', 'Toms Spezialitäten', 'Luisenstr. 48', 'Münster', null, '44087', 'Germany'); +INSERT INTO orders VALUES ('10549', 'QUICK', '5', '1995-06-27 00:00:00', '1995-07-11 00:00:00', '1995-06-30 00:00:00', '1', '171.2400', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10550', 'GODOS', '7', '1995-06-28 00:00:00', '1995-07-26 00:00:00', '1995-07-07 00:00:00', '3', '4.3200', 'Godos Cocina Típica', 'C/ Romero, 33', 'Sevilla', null, '41101', 'Spain'); +INSERT INTO orders VALUES ('10551', 'FURIB', '4', '1995-06-28 00:00:00', '1995-08-09 00:00:00', '1995-07-07 00:00:00', '3', '72.9500', 'Furia Bacalhau e Frutos do Mar', 'Jardim das rosas n. 32', 'Lisboa', null, '1675', 'Portugal'); +INSERT INTO orders VALUES ('10552', 'HILAA', '2', '1995-06-29 00:00:00', '1995-07-27 00:00:00', '1995-07-06 00:00:00', '1', '83.2200', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10553', 'WARTH', '2', '1995-06-30 00:00:00', '1995-07-28 00:00:00', '1995-07-04 00:00:00', '2', '149.4900', 'Wartian Herkku', 'Torikatu 38', 'Oulu', null, '90110', 'Finland'); +INSERT INTO orders VALUES ('10554', 'OTTIK', '4', '1995-06-30 00:00:00', '1995-07-28 00:00:00', '1995-07-06 00:00:00', '3', '120.9700', 'Ottilies Käseladen', 'Mehrheimerstr. 369', 'Köln', null, '50739', 'Germany'); +INSERT INTO orders VALUES ('10555', 'SAVEA', '6', '1995-07-03 00:00:00', '1995-07-31 00:00:00', '1995-07-05 00:00:00', '3', '252.4900', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10556', 'SIMOB', '2', '1995-07-04 00:00:00', '1995-08-15 00:00:00', '1995-07-14 00:00:00', '1', '9.8000', 'Simons bistro', 'Vinbæltet 34', 'København', null, '1734', 'Denmark'); +INSERT INTO orders VALUES ('10557', 'LEHMS', '9', '1995-07-04 00:00:00', '1995-07-18 00:00:00', '1995-07-07 00:00:00', '2', '96.7200', 'Lehmanns Marktstand', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany'); +INSERT INTO orders VALUES ('10558', 'AROUT', '1', '1995-07-05 00:00:00', '1995-08-02 00:00:00', '1995-07-11 00:00:00', '2', '72.9700', 'Around the Horn', 'Brook Farm\r\nStratford St. Mary', 'Colchester', 'Essex', 'CO7 6JX', 'UK'); +INSERT INTO orders VALUES ('10559', 'BLONP', '6', '1995-07-06 00:00:00', '1995-08-03 00:00:00', '1995-07-14 00:00:00', '1', '8.0500', 'Blondel père et fils', '24, place Kléber', 'Strasbourg', null, '67000', 'France'); +INSERT INTO orders VALUES ('10560', 'FRANK', '8', '1995-07-07 00:00:00', '1995-08-04 00:00:00', '1995-07-10 00:00:00', '1', '36.6500', 'Frankenversand', 'Berliner Platz 43', 'München', null, '80805', 'Germany'); +INSERT INTO orders VALUES ('10561', 'FOLKO', '2', '1995-07-07 00:00:00', '1995-08-04 00:00:00', '1995-07-10 00:00:00', '2', '242.2100', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10562', 'REGGC', '1', '1995-07-10 00:00:00', '1995-08-07 00:00:00', '1995-07-13 00:00:00', '1', '22.9500', 'Reggiani Caseifici', 'Strada Provinciale 124', 'Reggio Emilia', null, '42100', 'Italy'); +INSERT INTO orders VALUES ('10563', 'RICAR', '2', '1995-07-11 00:00:00', '1995-08-22 00:00:00', '1995-07-25 00:00:00', '2', '60.4300', 'Ricardo Adocicados', 'Av. Copacabana, 267', 'Rio de Janeiro', 'RJ', '02389-890', 'Brazil'); +INSERT INTO orders VALUES ('10564', 'RATTC', '4', '1995-07-11 00:00:00', '1995-08-08 00:00:00', '1995-07-17 00:00:00', '3', '13.7500', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10565', 'MEREP', '8', '1995-07-12 00:00:00', '1995-08-09 00:00:00', '1995-07-19 00:00:00', '2', '7.1500', 'Mère Paillarde', '43 rue St. Laurent', 'Montréal', 'Québec', 'H1J 1C3', 'Canada'); +INSERT INTO orders VALUES ('10566', 'BLONP', '9', '1995-07-13 00:00:00', '1995-08-10 00:00:00', '1995-07-19 00:00:00', '1', '88.4000', 'Blondel père et fils', '24, place Kléber', 'Strasbourg', null, '67000', 'France'); +INSERT INTO orders VALUES ('10567', 'HUNGO', '1', '1995-07-13 00:00:00', '1995-08-10 00:00:00', '1995-07-18 00:00:00', '1', '33.9700', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10568', 'GALED', '3', '1995-07-14 00:00:00', '1995-08-11 00:00:00', '1995-08-09 00:00:00', '3', '6.5400', 'Galería del gastronómo', 'Rambla de Cataluña, 23', 'Barcelona', null, '8022', 'Spain'); +INSERT INTO orders VALUES ('10569', 'RATTC', '5', '1995-07-17 00:00:00', '1995-08-14 00:00:00', '1995-08-11 00:00:00', '1', '58.9800', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10570', 'MEREP', '3', '1995-07-18 00:00:00', '1995-08-15 00:00:00', '1995-07-20 00:00:00', '3', '188.9900', 'Mère Paillarde', '43 rue St. Laurent', 'Montréal', 'Québec', 'H1J 1C3', 'Canada'); +INSERT INTO orders VALUES ('10571', 'ERNSH', '8', '1995-07-18 00:00:00', '1995-08-29 00:00:00', '1995-08-04 00:00:00', '3', '26.0600', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10572', 'BERGS', '3', '1995-07-19 00:00:00', '1995-08-16 00:00:00', '1995-07-26 00:00:00', '2', '116.4300', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10573', 'ANTON', '7', '1995-07-20 00:00:00', '1995-08-17 00:00:00', '1995-07-21 00:00:00', '3', '84.8400', 'Antonio Moreno Taquería', 'Mataderos 2312', 'México D.F.', null, '05023', 'Mexico'); +INSERT INTO orders VALUES ('10574', 'TRAIH', '4', '1995-07-20 00:00:00', '1995-08-17 00:00:00', '1995-07-31 00:00:00', '2', '37.6000', 'Trail\'s Head Gourmet Provisioners', '722 DaVinci Blvd.', 'Kirkland', 'WA', '98034', 'USA'); +INSERT INTO orders VALUES ('10575', 'MORGK', '5', '1995-07-21 00:00:00', '1995-08-04 00:00:00', '1995-07-31 00:00:00', '1', '127.3400', 'Morgenstern Gesundkost', 'Heerstr. 22', 'Leipzig', null, '04179', 'Germany'); +INSERT INTO orders VALUES ('10576', 'TORTU', '3', '1995-07-24 00:00:00', '1995-08-07 00:00:00', '1995-07-31 00:00:00', '3', '18.5600', 'Tortuga Restaurante', 'Avda. Azteca 123', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('10577', 'TRAIH', '9', '1995-07-24 00:00:00', '1995-09-04 00:00:00', '1995-07-31 00:00:00', '2', '25.4100', 'Trail\'s Head Gourmet Provisioners', '722 DaVinci Blvd.', 'Kirkland', 'WA', '98034', 'USA'); +INSERT INTO orders VALUES ('10578', 'BSBEV', '4', '1995-07-25 00:00:00', '1995-08-22 00:00:00', '1995-08-25 00:00:00', '3', '29.6000', 'B\'s Beverages', 'Fauntleroy Circus', 'London', null, 'EC2 5NT', 'UK'); +INSERT INTO orders VALUES ('10579', 'LETSS', '1', '1995-07-26 00:00:00', '1995-08-23 00:00:00', '1995-08-04 00:00:00', '2', '13.7300', 'Let\'s Stop N Shop', '87 Polk St.\r\nSuite 5', 'San Francisco', 'CA', '94117', 'USA'); +INSERT INTO orders VALUES ('10580', 'OTTIK', '4', '1995-07-27 00:00:00', '1995-08-24 00:00:00', '1995-08-01 00:00:00', '3', '75.8900', 'Ottilies Käseladen', 'Mehrheimerstr. 369', 'Köln', null, '50739', 'Germany'); +INSERT INTO orders VALUES ('10581', 'FAMIA', '3', '1995-07-27 00:00:00', '1995-08-24 00:00:00', '1995-08-02 00:00:00', '1', '3.0100', 'Familia Arquibaldo', 'Rua Orós, 92', 'São Paulo', 'SP', '05442-030', 'Brazil'); +INSERT INTO orders VALUES ('10582', 'BLAUS', '3', '1995-07-28 00:00:00', '1995-08-25 00:00:00', '1995-08-14 00:00:00', '2', '27.7100', 'Blauer See Delikatessen', 'Forsterstr. 57', 'Mannheim', null, '68306', 'Germany'); +INSERT INTO orders VALUES ('10583', 'WARTH', '2', '1995-07-31 00:00:00', '1995-08-28 00:00:00', '1995-08-04 00:00:00', '2', '7.2800', 'Wartian Herkku', 'Torikatu 38', 'Oulu', null, '90110', 'Finland'); +INSERT INTO orders VALUES ('10584', 'BLONP', '4', '1995-07-31 00:00:00', '1995-08-28 00:00:00', '1995-08-04 00:00:00', '1', '59.1400', 'Blondel père et fils', '24, place Kléber', 'Strasbourg', null, '67000', 'France'); +INSERT INTO orders VALUES ('10585', 'WELLI', '7', '1995-08-01 00:00:00', '1995-08-29 00:00:00', '1995-08-10 00:00:00', '1', '13.4100', 'Wellington Importadora', 'Rua do Mercado, 12', 'Resende', 'SP', '08737-363', 'Brazil'); +INSERT INTO orders VALUES ('10586', 'REGGC', '9', '1995-08-02 00:00:00', '1995-08-30 00:00:00', '1995-08-09 00:00:00', '1', '0.4800', 'Reggiani Caseifici', 'Strada Provinciale 124', 'Reggio Emilia', null, '42100', 'Italy'); +INSERT INTO orders VALUES ('10587', 'QUEDE', '1', '1995-08-02 00:00:00', '1995-08-30 00:00:00', '1995-08-09 00:00:00', '1', '62.5200', 'Que Delícia', 'Rua da Panificadora, 12', 'Rio de Janeiro', 'RJ', '02389-673', 'Brazil'); +INSERT INTO orders VALUES ('10588', 'QUICK', '2', '1995-08-03 00:00:00', '1995-08-31 00:00:00', '1995-08-10 00:00:00', '3', '194.6700', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10589', 'GREAL', '8', '1995-08-04 00:00:00', '1995-09-01 00:00:00', '1995-08-14 00:00:00', '2', '4.4200', 'Great Lakes Food Market', '2732 Baker Blvd.', 'Eugene', 'OR', '97403', 'USA'); +INSERT INTO orders VALUES ('10590', 'MEREP', '4', '1995-08-07 00:00:00', '1995-09-04 00:00:00', '1995-08-14 00:00:00', '3', '44.7700', 'Mère Paillarde', '43 rue St. Laurent', 'Montréal', 'Québec', 'H1J 1C3', 'Canada'); +INSERT INTO orders VALUES ('10591', 'VAFFE', '1', '1995-08-07 00:00:00', '1995-08-21 00:00:00', '1995-08-16 00:00:00', '1', '55.9200', 'Vaffeljernet', 'Smagsløget 45', 'Århus', null, '8200', 'Denmark'); +INSERT INTO orders VALUES ('10592', 'LEHMS', '3', '1995-08-08 00:00:00', '1995-09-05 00:00:00', '1995-08-16 00:00:00', '1', '32.1000', 'Lehmanns Marktstand', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany'); +INSERT INTO orders VALUES ('10593', 'LEHMS', '7', '1995-08-09 00:00:00', '1995-09-06 00:00:00', '1995-09-13 00:00:00', '2', '174.2000', 'Lehmanns Marktstand', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany'); +INSERT INTO orders VALUES ('10594', 'OLDWO', '3', '1995-08-09 00:00:00', '1995-09-06 00:00:00', '1995-08-16 00:00:00', '2', '5.2400', 'Old World Delicatessen', '2743 Bering St.', 'Anchorage', 'AK', '99508', 'USA'); +INSERT INTO orders VALUES ('10595', 'ERNSH', '2', '1995-08-10 00:00:00', '1995-09-07 00:00:00', '1995-08-14 00:00:00', '1', '96.7800', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10596', 'WHITC', '8', '1995-08-11 00:00:00', '1995-09-08 00:00:00', '1995-09-12 00:00:00', '1', '16.3400', 'White Clover Markets', '1029 - 12th Ave. S.', 'Seattle', 'WA', '98124', 'USA'); +INSERT INTO orders VALUES ('10597', 'PICCO', '7', '1995-08-11 00:00:00', '1995-09-08 00:00:00', '1995-08-18 00:00:00', '3', '35.1200', 'Piccolo und mehr', 'Geislweg 14', 'Salzburg', null, '5020', 'Austria'); +INSERT INTO orders VALUES ('10598', 'RATTC', '1', '1995-08-14 00:00:00', '1995-09-11 00:00:00', '1995-08-18 00:00:00', '3', '44.4200', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10599', 'BSBEV', '6', '1995-08-15 00:00:00', '1995-09-26 00:00:00', '1995-08-21 00:00:00', '3', '29.9800', 'B\'s Beverages', 'Fauntleroy Circus', 'London', null, 'EC2 5NT', 'UK'); +INSERT INTO orders VALUES ('10600', 'HUNGC', '4', '1995-08-16 00:00:00', '1995-09-13 00:00:00', '1995-08-21 00:00:00', '1', '45.1300', 'Hungry Coyote Import Store', 'City Center Plaza\r\n516 Main St.', 'Elgin', 'OR', '97827', 'USA'); +INSERT INTO orders VALUES ('10601', 'HILAA', '7', '1995-08-16 00:00:00', '1995-09-27 00:00:00', '1995-08-22 00:00:00', '1', '58.3000', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10602', 'VAFFE', '8', '1995-08-17 00:00:00', '1995-09-14 00:00:00', '1995-08-22 00:00:00', '2', '2.9200', 'Vaffeljernet', 'Smagsløget 45', 'Århus', null, '8200', 'Denmark'); +INSERT INTO orders VALUES ('10603', 'SAVEA', '8', '1995-08-18 00:00:00', '1995-09-15 00:00:00', '1995-09-08 00:00:00', '2', '48.7700', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10604', 'FURIB', '1', '1995-08-18 00:00:00', '1995-09-15 00:00:00', '1995-08-29 00:00:00', '1', '7.4600', 'Furia Bacalhau e Frutos do Mar', 'Jardim das rosas n. 32', 'Lisboa', null, '1675', 'Portugal'); +INSERT INTO orders VALUES ('10605', 'MEREP', '1', '1995-08-21 00:00:00', '1995-09-18 00:00:00', '1995-08-29 00:00:00', '2', '379.1300', 'Mère Paillarde', '43 rue St. Laurent', 'Montréal', 'Québec', 'H1J 1C3', 'Canada'); +INSERT INTO orders VALUES ('10606', 'TRADH', '4', '1995-08-22 00:00:00', '1995-09-19 00:00:00', '1995-08-31 00:00:00', '3', '79.4000', 'Tradição Hipermercados', 'Av. Inês de Castro, 414', 'São Paulo', 'SP', '05634-030', 'Brazil'); +INSERT INTO orders VALUES ('10607', 'SAVEA', '5', '1995-08-22 00:00:00', '1995-09-19 00:00:00', '1995-08-25 00:00:00', '1', '200.2400', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10608', 'TOMSP', '4', '1995-08-23 00:00:00', '1995-09-20 00:00:00', '1995-09-01 00:00:00', '2', '27.7900', 'Toms Spezialitäten', 'Luisenstr. 48', 'Münster', null, '44087', 'Germany'); +INSERT INTO orders VALUES ('10609', 'DUMON', '7', '1995-08-24 00:00:00', '1995-09-21 00:00:00', '1995-08-30 00:00:00', '2', '1.8500', 'Du monde entier', '67, rue des Cinquante Otages', 'Nantes', null, '44000', 'France'); +INSERT INTO orders VALUES ('10610', 'LAMAI', '8', '1995-08-25 00:00:00', '1995-09-22 00:00:00', '1995-09-06 00:00:00', '1', '26.7800', 'La maison d\'Asie', '1 rue Alsace-Lorraine', 'Toulouse', null, '31000', 'France'); +INSERT INTO orders VALUES ('10611', 'WOLZA', '6', '1995-08-25 00:00:00', '1995-09-22 00:00:00', '1995-09-01 00:00:00', '2', '80.6500', 'Wolski Zajazd', 'ul. Filtrowa 68', 'Warszawa', null, '01-012', 'Poland'); +INSERT INTO orders VALUES ('10612', 'SAVEA', '1', '1995-08-28 00:00:00', '1995-09-25 00:00:00', '1995-09-01 00:00:00', '2', '544.0800', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10613', 'HILAA', '4', '1995-08-29 00:00:00', '1995-09-26 00:00:00', '1995-09-01 00:00:00', '2', '8.1100', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10614', 'BLAUS', '8', '1995-08-29 00:00:00', '1995-09-26 00:00:00', '1995-09-01 00:00:00', '3', '1.9300', 'Blauer See Delikatessen', 'Forsterstr. 57', 'Mannheim', null, '68306', 'Germany'); +INSERT INTO orders VALUES ('10615', 'WILMK', '2', '1995-08-30 00:00:00', '1995-09-27 00:00:00', '1995-09-06 00:00:00', '3', '0.7500', 'Wilman Kala', 'Keskuskatu 45', 'Helsinki', null, '21240', 'Finland'); +INSERT INTO orders VALUES ('10616', 'GREAL', '1', '1995-08-31 00:00:00', '1995-09-28 00:00:00', '1995-09-05 00:00:00', '2', '116.5300', 'Great Lakes Food Market', '2732 Baker Blvd.', 'Eugene', 'OR', '97403', 'USA'); +INSERT INTO orders VALUES ('10617', 'GREAL', '4', '1995-08-31 00:00:00', '1995-09-28 00:00:00', '1995-09-04 00:00:00', '2', '18.5300', 'Great Lakes Food Market', '2732 Baker Blvd.', 'Eugene', 'OR', '97403', 'USA'); +INSERT INTO orders VALUES ('10618', 'MEREP', '1', '1995-09-01 00:00:00', '1995-10-13 00:00:00', '1995-09-08 00:00:00', '1', '154.6800', 'Mère Paillarde', '43 rue St. Laurent', 'Montréal', 'Québec', 'H1J 1C3', 'Canada'); +INSERT INTO orders VALUES ('10619', 'MEREP', '3', '1995-09-04 00:00:00', '1995-10-02 00:00:00', '1995-09-07 00:00:00', '3', '91.0500', 'Mère Paillarde', '43 rue St. Laurent', 'Montréal', 'Québec', 'H1J 1C3', 'Canada'); +INSERT INTO orders VALUES ('10620', 'LAUGB', '2', '1995-09-05 00:00:00', '1995-10-03 00:00:00', '1995-09-14 00:00:00', '3', '0.9400', 'Laughing Bacchus Wine Cellars', '2319 Elm St.', 'Vancouver', 'BC', 'V3F 2K1', 'Canada'); +INSERT INTO orders VALUES ('10621', 'ISLAT', '4', '1995-09-05 00:00:00', '1995-10-03 00:00:00', '1995-09-11 00:00:00', '2', '23.7300', 'Island Trading', 'Garden House\r\nCrowther Way', 'Cowes', 'Isle of Wight', 'PO31 7PJ', 'UK'); +INSERT INTO orders VALUES ('10622', 'RICAR', '4', '1995-09-06 00:00:00', '1995-10-04 00:00:00', '1995-09-11 00:00:00', '3', '50.9700', 'Ricardo Adocicados', 'Av. Copacabana, 267', 'Rio de Janeiro', 'RJ', '02389-890', 'Brazil'); +INSERT INTO orders VALUES ('10623', 'FRANK', '8', '1995-09-07 00:00:00', '1995-10-05 00:00:00', '1995-09-12 00:00:00', '2', '97.1800', 'Frankenversand', 'Berliner Platz 43', 'München', null, '80805', 'Germany'); +INSERT INTO orders VALUES ('10624', 'THECR', '4', '1995-09-07 00:00:00', '1995-10-05 00:00:00', '1995-09-19 00:00:00', '2', '94.8000', 'The Cracker Box', '55 Grizzly Peak Rd.', 'Butte', 'MT', '59801', 'USA'); +INSERT INTO orders VALUES ('10625', 'ANATR', '3', '1995-09-08 00:00:00', '1995-10-06 00:00:00', '1995-09-14 00:00:00', '1', '43.9000', 'Ana Trujillo Emparedados y helados', 'Avda. de la Constitución 2222', 'México D.F.', null, '05021', 'Mexico'); +INSERT INTO orders VALUES ('10626', 'BERGS', '1', '1995-09-11 00:00:00', '1995-10-09 00:00:00', '1995-09-20 00:00:00', '2', '138.6900', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10627', 'SAVEA', '8', '1995-09-11 00:00:00', '1995-10-23 00:00:00', '1995-09-21 00:00:00', '3', '107.4600', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10628', 'BLONP', '4', '1995-09-12 00:00:00', '1995-10-10 00:00:00', '1995-09-20 00:00:00', '3', '30.3600', 'Blondel père et fils', '24, place Kléber', 'Strasbourg', null, '67000', 'France'); +INSERT INTO orders VALUES ('10629', 'GODOS', '4', '1995-09-12 00:00:00', '1995-10-10 00:00:00', '1995-09-20 00:00:00', '3', '85.4600', 'Godos Cocina Típica', 'C/ Romero, 33', 'Sevilla', null, '41101', 'Spain'); +INSERT INTO orders VALUES ('10630', 'KOENE', '1', '1995-09-13 00:00:00', '1995-10-11 00:00:00', '1995-09-19 00:00:00', '2', '32.3500', 'Königlich Essen', 'Maubelstr. 90', 'Brandenburg', null, '14776', 'Germany'); +INSERT INTO orders VALUES ('10631', 'LAMAI', '8', '1995-09-14 00:00:00', '1995-10-12 00:00:00', '1995-09-15 00:00:00', '1', '0.8700', 'La maison d\'Asie', '1 rue Alsace-Lorraine', 'Toulouse', null, '31000', 'France'); +INSERT INTO orders VALUES ('10632', 'WANDK', '8', '1995-09-14 00:00:00', '1995-10-12 00:00:00', '1995-09-19 00:00:00', '1', '41.3800', 'Die Wandernde Kuh', 'Adenauerallee 900', 'Stuttgart', null, '70563', 'Germany'); +INSERT INTO orders VALUES ('10633', 'ERNSH', '7', '1995-09-15 00:00:00', '1995-10-13 00:00:00', '1995-09-18 00:00:00', '3', '477.9000', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10634', 'FOLIG', '4', '1995-09-15 00:00:00', '1995-10-13 00:00:00', '1995-09-21 00:00:00', '3', '487.3800', 'Folies gourmandes', '184, chaussée de Tournai', 'Lille', null, '59000', 'France'); +INSERT INTO orders VALUES ('10635', 'MAGAA', '8', '1995-09-18 00:00:00', '1995-10-16 00:00:00', '1995-09-21 00:00:00', '3', '47.4600', 'Magazzini Alimentari Riuniti', 'Via Ludovico il Moro 22', 'Bergamo', null, '24100', 'Italy'); +INSERT INTO orders VALUES ('10636', 'WARTH', '4', '1995-09-19 00:00:00', '1995-10-17 00:00:00', '1995-09-26 00:00:00', '1', '1.1500', 'Wartian Herkku', 'Torikatu 38', 'Oulu', null, '90110', 'Finland'); +INSERT INTO orders VALUES ('10637', 'QUEEN', '6', '1995-09-19 00:00:00', '1995-10-17 00:00:00', '1995-09-26 00:00:00', '1', '201.2900', 'Queen Cozinha', 'Alameda dos Canàrios, 891', 'São Paulo', 'SP', '05487-020', 'Brazil'); +INSERT INTO orders VALUES ('10638', 'LINOD', '3', '1995-09-20 00:00:00', '1995-10-18 00:00:00', '1995-10-02 00:00:00', '1', '158.4400', 'LINO-Delicateses', 'Ave. 5 de Mayo Porlamar', 'I. de Margarita', 'Nueva Esparta', '4980', 'Venezuela'); +INSERT INTO orders VALUES ('10639', 'SANTG', '7', '1995-09-20 00:00:00', '1995-10-18 00:00:00', '1995-09-27 00:00:00', '3', '38.6400', 'Santé Gourmet', 'Erling Skakkes gate 78', 'Stavern', null, '4110', 'Norway'); +INSERT INTO orders VALUES ('10640', 'WANDK', '4', '1995-09-21 00:00:00', '1995-10-19 00:00:00', '1995-09-28 00:00:00', '1', '23.5500', 'Die Wandernde Kuh', 'Adenauerallee 900', 'Stuttgart', null, '70563', 'Germany'); +INSERT INTO orders VALUES ('10641', 'HILAA', '4', '1995-09-22 00:00:00', '1995-10-20 00:00:00', '1995-09-26 00:00:00', '2', '179.6100', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10642', 'SIMOB', '7', '1995-09-22 00:00:00', '1995-10-20 00:00:00', '1995-10-06 00:00:00', '3', '41.8900', 'Simons bistro', 'Vinbæltet 34', 'København', null, '1734', 'Denmark'); +INSERT INTO orders VALUES ('10643', 'ALFKI', '6', '1995-09-25 00:00:00', '1995-10-23 00:00:00', '1995-10-03 00:00:00', '1', '29.4600', 'Alfreds Futterkiste', 'Obere Str. 57', 'Berlin', null, '12209', 'Germany'); +INSERT INTO orders VALUES ('10644', 'WELLI', '3', '1995-09-25 00:00:00', '1995-10-23 00:00:00', '1995-10-02 00:00:00', '2', '0.1400', 'Wellington Importadora', 'Rua do Mercado, 12', 'Resende', 'SP', '08737-363', 'Brazil'); +INSERT INTO orders VALUES ('10645', 'HANAR', '4', '1995-09-26 00:00:00', '1995-10-24 00:00:00', '1995-10-03 00:00:00', '1', '12.4100', 'Hanari Carnes', 'Rua do Paço, 67', 'Rio de Janeiro', 'RJ', '05454-876', 'Brazil'); +INSERT INTO orders VALUES ('10646', 'HUNGO', '9', '1995-09-27 00:00:00', '1995-11-08 00:00:00', '1995-10-04 00:00:00', '3', '142.3300', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10647', 'QUEDE', '4', '1995-09-27 00:00:00', '1995-10-11 00:00:00', '1995-10-04 00:00:00', '2', '45.5400', 'Que Delícia', 'Rua da Panificadora, 12', 'Rio de Janeiro', 'RJ', '02389-673', 'Brazil'); +INSERT INTO orders VALUES ('10648', 'RICAR', '5', '1995-09-28 00:00:00', '1995-11-09 00:00:00', '1995-10-10 00:00:00', '2', '14.2500', 'Ricardo Adocicados', 'Av. Copacabana, 267', 'Rio de Janeiro', 'RJ', '02389-890', 'Brazil'); +INSERT INTO orders VALUES ('10649', 'MAISD', '5', '1995-09-28 00:00:00', '1995-10-26 00:00:00', '1995-09-29 00:00:00', '3', '6.2000', 'Maison Dewey', 'Rue Joseph-Bens 532', 'Bruxelles', null, 'B-1180', 'Belgium'); +INSERT INTO orders VALUES ('10650', 'FAMIA', '5', '1995-09-29 00:00:00', '1995-10-27 00:00:00', '1995-10-04 00:00:00', '3', '176.8100', 'Familia Arquibaldo', 'Rua Orós, 92', 'São Paulo', 'SP', '05442-030', 'Brazil'); +INSERT INTO orders VALUES ('10651', 'WANDK', '8', '1995-10-02 00:00:00', '1995-10-30 00:00:00', '1995-10-12 00:00:00', '2', '20.6000', 'Die Wandernde Kuh', 'Adenauerallee 900', 'Stuttgart', null, '70563', 'Germany'); +INSERT INTO orders VALUES ('10652', 'GOURL', '4', '1995-10-02 00:00:00', '1995-10-30 00:00:00', '1995-10-09 00:00:00', '2', '7.1400', 'Gourmet Lanchonetes', 'Av. Brasil, 442', 'Campinas', 'SP', '04876-786', 'Brazil'); +INSERT INTO orders VALUES ('10653', 'FRANK', '1', '1995-10-03 00:00:00', '1995-10-31 00:00:00', '1995-10-20 00:00:00', '1', '93.2500', 'Frankenversand', 'Berliner Platz 43', 'München', null, '80805', 'Germany'); +INSERT INTO orders VALUES ('10654', 'BERGS', '5', '1995-10-03 00:00:00', '1995-10-31 00:00:00', '1995-10-12 00:00:00', '1', '55.2600', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10655', 'REGGC', '1', '1995-10-04 00:00:00', '1995-11-01 00:00:00', '1995-10-12 00:00:00', '2', '4.4100', 'Reggiani Caseifici', 'Strada Provinciale 124', 'Reggio Emilia', null, '42100', 'Italy'); +INSERT INTO orders VALUES ('10656', 'GREAL', '6', '1995-10-05 00:00:00', '1995-11-02 00:00:00', '1995-10-11 00:00:00', '1', '57.1500', 'Great Lakes Food Market', '2732 Baker Blvd.', 'Eugene', 'OR', '97403', 'USA'); +INSERT INTO orders VALUES ('10657', 'SAVEA', '2', '1995-10-05 00:00:00', '1995-11-02 00:00:00', '1995-10-16 00:00:00', '2', '352.6900', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10658', 'QUICK', '4', '1995-10-06 00:00:00', '1995-11-03 00:00:00', '1995-10-09 00:00:00', '1', '364.1500', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10659', 'QUEEN', '7', '1995-10-06 00:00:00', '1995-11-03 00:00:00', '1995-10-11 00:00:00', '2', '105.8100', 'Queen Cozinha', 'Alameda dos Canàrios, 891', 'São Paulo', 'SP', '05487-020', 'Brazil'); +INSERT INTO orders VALUES ('10660', 'HUNGC', '8', '1995-10-09 00:00:00', '1995-11-06 00:00:00', '1995-11-15 00:00:00', '1', '111.2900', 'Hungry Coyote Import Store', 'City Center Plaza\r\n516 Main St.', 'Elgin', 'OR', '97827', 'USA'); +INSERT INTO orders VALUES ('10661', 'HUNGO', '7', '1995-10-10 00:00:00', '1995-11-07 00:00:00', '1995-10-16 00:00:00', '3', '17.5500', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10662', 'LONEP', '3', '1995-10-10 00:00:00', '1995-11-07 00:00:00', '1995-10-19 00:00:00', '2', '1.2800', 'Lonesome Pine Restaurant', '89 Chiaroscuro Rd.', 'Portland', 'OR', '97219', 'USA'); +INSERT INTO orders VALUES ('10663', 'BONAP', '2', '1995-10-11 00:00:00', '1995-10-25 00:00:00', '1995-11-03 00:00:00', '2', '113.1500', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10664', 'FURIB', '1', '1995-10-11 00:00:00', '1995-11-08 00:00:00', '1995-10-20 00:00:00', '3', '1.2700', 'Furia Bacalhau e Frutos do Mar', 'Jardim das rosas n. 32', 'Lisboa', null, '1675', 'Portugal'); +INSERT INTO orders VALUES ('10665', 'LONEP', '1', '1995-10-12 00:00:00', '1995-11-09 00:00:00', '1995-10-18 00:00:00', '2', '26.3100', 'Lonesome Pine Restaurant', '89 Chiaroscuro Rd.', 'Portland', 'OR', '97219', 'USA'); +INSERT INTO orders VALUES ('10666', 'RICSU', '7', '1995-10-13 00:00:00', '1995-11-10 00:00:00', '1995-10-23 00:00:00', '2', '232.4200', 'Richter Supermarkt', 'Starenweg 5', 'Genève', null, '1204', 'Switzerland'); +INSERT INTO orders VALUES ('10667', 'ERNSH', '7', '1995-10-13 00:00:00', '1995-11-10 00:00:00', '1995-10-20 00:00:00', '1', '78.0900', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10668', 'WANDK', '1', '1995-10-16 00:00:00', '1995-11-13 00:00:00', '1995-10-24 00:00:00', '2', '47.2200', 'Die Wandernde Kuh', 'Adenauerallee 900', 'Stuttgart', null, '70563', 'Germany'); +INSERT INTO orders VALUES ('10669', 'SIMOB', '2', '1995-10-16 00:00:00', '1995-11-13 00:00:00', '1995-10-23 00:00:00', '1', '24.3900', 'Simons bistro', 'Vinbæltet 34', 'København', null, '1734', 'Denmark'); +INSERT INTO orders VALUES ('10670', 'FRANK', '4', '1995-10-17 00:00:00', '1995-11-14 00:00:00', '1995-10-19 00:00:00', '1', '203.4800', 'Frankenversand', 'Berliner Platz 43', 'München', null, '80805', 'Germany'); +INSERT INTO orders VALUES ('10671', 'FRANR', '1', '1995-10-18 00:00:00', '1995-11-15 00:00:00', '1995-10-25 00:00:00', '1', '30.3400', 'France restauration', '54, rue Royale', 'Nantes', null, '44000', 'France'); +INSERT INTO orders VALUES ('10672', 'BERGS', '9', '1995-10-18 00:00:00', '1995-11-01 00:00:00', '1995-10-27 00:00:00', '2', '95.7500', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10673', 'WILMK', '2', '1995-10-19 00:00:00', '1995-11-16 00:00:00', '1995-10-20 00:00:00', '1', '22.7600', 'Wilman Kala', 'Keskuskatu 45', 'Helsinki', null, '21240', 'Finland'); +INSERT INTO orders VALUES ('10674', 'ISLAT', '4', '1995-10-19 00:00:00', '1995-11-16 00:00:00', '1995-10-31 00:00:00', '2', '0.9000', 'Island Trading', 'Garden House\r\nCrowther Way', 'Cowes', 'Isle of Wight', 'PO31 7PJ', 'UK'); +INSERT INTO orders VALUES ('10675', 'FRANK', '5', '1995-10-20 00:00:00', '1995-11-17 00:00:00', '1995-10-24 00:00:00', '2', '31.8500', 'Frankenversand', 'Berliner Platz 43', 'München', null, '80805', 'Germany'); +INSERT INTO orders VALUES ('10676', 'TORTU', '2', '1995-10-23 00:00:00', '1995-11-20 00:00:00', '1995-10-30 00:00:00', '2', '2.0100', 'Tortuga Restaurante', 'Avda. Azteca 123', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('10677', 'ANTON', '1', '1995-10-23 00:00:00', '1995-11-20 00:00:00', '1995-10-27 00:00:00', '3', '4.0300', 'Antonio Moreno Taquería', 'Mataderos 2312', 'México D.F.', null, '05023', 'Mexico'); +INSERT INTO orders VALUES ('10678', 'SAVEA', '7', '1995-10-24 00:00:00', '1995-11-21 00:00:00', '1995-11-16 00:00:00', '3', '388.9800', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10679', 'BLONP', '8', '1995-10-24 00:00:00', '1995-11-21 00:00:00', '1995-10-31 00:00:00', '3', '27.9400', 'Blondel père et fils', '24, place Kléber', 'Strasbourg', null, '67000', 'France'); +INSERT INTO orders VALUES ('10680', 'OLDWO', '1', '1995-10-25 00:00:00', '1995-11-22 00:00:00', '1995-10-27 00:00:00', '1', '26.6100', 'Old World Delicatessen', '2743 Bering St.', 'Anchorage', 'AK', '99508', 'USA'); +INSERT INTO orders VALUES ('10681', 'GREAL', '3', '1995-10-26 00:00:00', '1995-11-23 00:00:00', '1995-10-31 00:00:00', '3', '76.1300', 'Great Lakes Food Market', '2732 Baker Blvd.', 'Eugene', 'OR', '97403', 'USA'); +INSERT INTO orders VALUES ('10682', 'ANTON', '3', '1995-10-26 00:00:00', '1995-11-23 00:00:00', '1995-11-01 00:00:00', '2', '36.1300', 'Antonio Moreno Taquería', 'Mataderos 2312', 'México D.F.', null, '05023', 'Mexico'); +INSERT INTO orders VALUES ('10683', 'DUMON', '2', '1995-10-27 00:00:00', '1995-11-24 00:00:00', '1995-11-01 00:00:00', '1', '4.4000', 'Du monde entier', '67, rue des Cinquante Otages', 'Nantes', null, '44000', 'France'); +INSERT INTO orders VALUES ('10684', 'OTTIK', '3', '1995-10-27 00:00:00', '1995-11-24 00:00:00', '1995-10-31 00:00:00', '1', '145.6300', 'Ottilies Käseladen', 'Mehrheimerstr. 369', 'Köln', null, '50739', 'Germany'); +INSERT INTO orders VALUES ('10685', 'GOURL', '4', '1995-10-30 00:00:00', '1995-11-13 00:00:00', '1995-11-03 00:00:00', '2', '33.7500', 'Gourmet Lanchonetes', 'Av. Brasil, 442', 'Campinas', 'SP', '04876-786', 'Brazil'); +INSERT INTO orders VALUES ('10686', 'PICCO', '2', '1995-10-31 00:00:00', '1995-11-28 00:00:00', '1995-11-08 00:00:00', '1', '96.5000', 'Piccolo und mehr', 'Geislweg 14', 'Salzburg', null, '5020', 'Austria'); +INSERT INTO orders VALUES ('10687', 'HUNGO', '9', '1995-10-31 00:00:00', '1995-11-28 00:00:00', '1995-11-30 00:00:00', '2', '296.4300', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10688', 'VAFFE', '4', '1995-11-01 00:00:00', '1995-11-15 00:00:00', '1995-11-07 00:00:00', '2', '299.0900', 'Vaffeljernet', 'Smagsløget 45', 'Århus', null, '8200', 'Denmark'); +INSERT INTO orders VALUES ('10689', 'BERGS', '1', '1995-11-01 00:00:00', '1995-11-29 00:00:00', '1995-11-07 00:00:00', '2', '13.4200', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10690', 'HANAR', '1', '1995-11-02 00:00:00', '1995-11-30 00:00:00', '1995-11-03 00:00:00', '1', '15.8000', 'Hanari Carnes', 'Rua do Paço, 67', 'Rio de Janeiro', 'RJ', '05454-876', 'Brazil'); +INSERT INTO orders VALUES ('10691', 'QUICK', '2', '1995-11-03 00:00:00', '1995-12-15 00:00:00', '1995-11-22 00:00:00', '2', '810.0500', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10692', 'ALFKI', '4', '1995-11-03 00:00:00', '1995-12-01 00:00:00', '1995-11-13 00:00:00', '2', '61.0200', 'Alfred\'s Futterkiste', 'Obere Str. 57', 'Berlin', null, '12209', 'Germany'); +INSERT INTO orders VALUES ('10693', 'WHITC', '3', '1995-11-06 00:00:00', '1995-11-20 00:00:00', '1995-11-10 00:00:00', '3', '139.3400', 'White Clover Markets', '1029 - 12th Ave. S.', 'Seattle', 'WA', '98124', 'USA'); +INSERT INTO orders VALUES ('10694', 'QUICK', '8', '1995-11-06 00:00:00', '1995-12-04 00:00:00', '1995-11-09 00:00:00', '3', '398.3600', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10695', 'WILMK', '7', '1995-11-07 00:00:00', '1995-12-19 00:00:00', '1995-11-14 00:00:00', '1', '16.7200', 'Wilman Kala', 'Keskuskatu 45', 'Helsinki', null, '21240', 'Finland'); +INSERT INTO orders VALUES ('10696', 'WHITC', '8', '1995-11-08 00:00:00', '1995-12-20 00:00:00', '1995-11-14 00:00:00', '3', '102.5500', 'White Clover Markets', '1029 - 12th Ave. S.', 'Seattle', 'WA', '98124', 'USA'); +INSERT INTO orders VALUES ('10697', 'LINOD', '3', '1995-11-08 00:00:00', '1995-12-06 00:00:00', '1995-11-14 00:00:00', '1', '45.5200', 'LINO-Delicateses', 'Ave. 5 de Mayo Porlamar', 'I. de Margarita', 'Nueva Esparta', '4980', 'Venezuela'); +INSERT INTO orders VALUES ('10698', 'ERNSH', '4', '1995-11-09 00:00:00', '1995-12-07 00:00:00', '1995-11-17 00:00:00', '1', '272.4700', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10699', 'MORGK', '3', '1995-11-09 00:00:00', '1995-12-07 00:00:00', '1995-11-13 00:00:00', '3', '0.5800', 'Morgenstern Gesundkost', 'Heerstr. 22', 'Leipzig', null, '04179', 'Germany'); +INSERT INTO orders VALUES ('10700', 'SAVEA', '3', '1995-11-10 00:00:00', '1995-12-08 00:00:00', '1995-11-16 00:00:00', '1', '65.1000', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10701', 'HUNGO', '6', '1995-11-13 00:00:00', '1995-11-27 00:00:00', '1995-11-15 00:00:00', '3', '220.3100', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10702', 'ALFKI', '4', '1995-11-13 00:00:00', '1995-12-25 00:00:00', '1995-11-21 00:00:00', '1', '23.9400', 'Alfred\'s Futterkiste', 'Obere Str. 57', 'Berlin', null, '12209', 'Germany'); +INSERT INTO orders VALUES ('10703', 'FOLKO', '6', '1995-11-14 00:00:00', '1995-12-12 00:00:00', '1995-11-20 00:00:00', '2', '152.3000', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10704', 'QUEEN', '6', '1995-11-14 00:00:00', '1995-12-12 00:00:00', '1995-12-08 00:00:00', '1', '4.7800', 'Queen Cozinha', 'Alameda dos Canàrios, 891', 'São Paulo', 'SP', '05487-020', 'Brazil'); +INSERT INTO orders VALUES ('10705', 'HILAA', '9', '1995-11-15 00:00:00', '1995-12-13 00:00:00', '1995-12-19 00:00:00', '2', '3.5200', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10706', 'OLDWO', '8', '1995-11-16 00:00:00', '1995-12-14 00:00:00', '1995-11-21 00:00:00', '3', '135.6300', 'Old World Delicatessen', '2743 Bering St.', 'Anchorage', 'AK', '99508', 'USA'); +INSERT INTO orders VALUES ('10707', 'AROUT', '4', '1995-11-16 00:00:00', '1995-11-30 00:00:00', '1995-11-23 00:00:00', '3', '21.7400', 'Around the Horn', 'Brook Farm\r\nStratford St. Mary', 'Colchester', 'Essex', 'CO7 6JX', 'UK'); +INSERT INTO orders VALUES ('10708', 'THEBI', '6', '1995-11-17 00:00:00', '1995-12-29 00:00:00', '1995-12-06 00:00:00', '2', '2.9600', 'The Big Cheese', '89 Jefferson Way\r\nSuite 2', 'Portland', 'OR', '97201', 'USA'); +INSERT INTO orders VALUES ('10709', 'GOURL', '1', '1995-11-17 00:00:00', '1995-12-15 00:00:00', '1995-12-21 00:00:00', '3', '210.8000', 'Gourmet Lanchonetes', 'Av. Brasil, 442', 'Campinas', 'SP', '04876-786', 'Brazil'); +INSERT INTO orders VALUES ('10710', 'FRANS', '1', '1995-11-20 00:00:00', '1995-12-18 00:00:00', '1995-11-23 00:00:00', '1', '4.9800', 'Franchi S.p.A.', 'Via Monte Bianco 34', 'Torino', null, '10100', 'Italy'); +INSERT INTO orders VALUES ('10711', 'SAVEA', '5', '1995-11-21 00:00:00', '1996-01-02 00:00:00', '1995-11-29 00:00:00', '2', '52.4100', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10712', 'HUNGO', '3', '1995-11-21 00:00:00', '1995-12-19 00:00:00', '1995-12-01 00:00:00', '1', '89.9300', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10713', 'SAVEA', '1', '1995-11-22 00:00:00', '1995-12-20 00:00:00', '1995-11-24 00:00:00', '1', '167.0500', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10714', 'SAVEA', '5', '1995-11-22 00:00:00', '1995-12-20 00:00:00', '1995-11-27 00:00:00', '3', '24.4900', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10715', 'BONAP', '3', '1995-11-23 00:00:00', '1995-12-07 00:00:00', '1995-11-29 00:00:00', '1', '63.2000', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10716', 'RANCH', '4', '1995-11-24 00:00:00', '1995-12-22 00:00:00', '1995-11-27 00:00:00', '2', '22.5700', 'Rancho grande', 'Av. del Libertador 900', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('10717', 'FRANK', '1', '1995-11-24 00:00:00', '1995-12-22 00:00:00', '1995-11-29 00:00:00', '2', '59.2500', 'Frankenversand', 'Berliner Platz 43', 'München', null, '80805', 'Germany'); +INSERT INTO orders VALUES ('10718', 'KOENE', '1', '1995-11-27 00:00:00', '1995-12-25 00:00:00', '1995-11-29 00:00:00', '3', '170.8800', 'Königlich Essen', 'Maubelstr. 90', 'Brandenburg', null, '14776', 'Germany'); +INSERT INTO orders VALUES ('10719', 'LETSS', '8', '1995-11-27 00:00:00', '1995-12-25 00:00:00', '1995-12-06 00:00:00', '2', '51.4400', 'Let\'s Stop N Shop', '87 Polk St.\r\nSuite 5', 'San Francisco', 'CA', '94117', 'USA'); +INSERT INTO orders VALUES ('10720', 'QUEDE', '8', '1995-11-28 00:00:00', '1995-12-12 00:00:00', '1995-12-06 00:00:00', '2', '9.5300', 'Que Delícia', 'Rua da Panificadora, 12', 'Rio de Janeiro', 'RJ', '02389-673', 'Brazil'); +INSERT INTO orders VALUES ('10721', 'QUICK', '5', '1995-11-29 00:00:00', '1995-12-27 00:00:00', '1995-12-01 00:00:00', '3', '48.9200', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10722', 'SAVEA', '8', '1995-11-29 00:00:00', '1996-01-10 00:00:00', '1995-12-05 00:00:00', '1', '74.5800', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10723', 'WHITC', '3', '1995-11-30 00:00:00', '1995-12-28 00:00:00', '1995-12-26 00:00:00', '1', '21.7200', 'White Clover Markets', '1029 - 12th Ave. S.', 'Seattle', 'WA', '98124', 'USA'); +INSERT INTO orders VALUES ('10724', 'MEREP', '8', '1995-11-30 00:00:00', '1996-01-11 00:00:00', '1995-12-06 00:00:00', '2', '57.7500', 'Mère Paillarde', '43 rue St. Laurent', 'Montréal', 'Québec', 'H1J 1C3', 'Canada'); +INSERT INTO orders VALUES ('10725', 'FAMIA', '4', '1995-12-01 00:00:00', '1995-12-29 00:00:00', '1995-12-06 00:00:00', '3', '10.8300', 'Familia Arquibaldo', 'Rua Orós, 92', 'São Paulo', 'SP', '05442-030', 'Brazil'); +INSERT INTO orders VALUES ('10726', 'EASTC', '4', '1995-12-04 00:00:00', '1995-12-18 00:00:00', '1996-01-05 00:00:00', '1', '16.5600', 'Eastern Connection', '35 King George', 'London', null, 'WX3 6FW', 'UK'); +INSERT INTO orders VALUES ('10727', 'REGGC', '2', '1995-12-04 00:00:00', '1996-01-01 00:00:00', '1996-01-05 00:00:00', '1', '89.9000', 'Reggiani Caseifici', 'Strada Provinciale 124', 'Reggio Emilia', null, '42100', 'Italy'); +INSERT INTO orders VALUES ('10728', 'QUEEN', '4', '1995-12-05 00:00:00', '1996-01-02 00:00:00', '1995-12-12 00:00:00', '2', '58.3300', 'Queen Cozinha', 'Alameda dos Canàrios, 891', 'São Paulo', 'SP', '05487-020', 'Brazil'); +INSERT INTO orders VALUES ('10729', 'LINOD', '8', '1995-12-05 00:00:00', '1996-01-16 00:00:00', '1995-12-15 00:00:00', '3', '141.0600', 'LINO-Delicateses', 'Ave. 5 de Mayo Porlamar', 'I. de Margarita', 'Nueva Esparta', '4980', 'Venezuela'); +INSERT INTO orders VALUES ('10730', 'BONAP', '5', '1995-12-06 00:00:00', '1996-01-03 00:00:00', '1995-12-15 00:00:00', '1', '20.1200', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10731', 'CHOPS', '7', '1995-12-07 00:00:00', '1996-01-04 00:00:00', '1995-12-15 00:00:00', '1', '96.6500', 'Chop-suey Chinese', 'Hauptstr. 31', 'Bern', null, '3012', 'Switzerland'); +INSERT INTO orders VALUES ('10732', 'BONAP', '3', '1995-12-07 00:00:00', '1996-01-04 00:00:00', '1995-12-08 00:00:00', '1', '16.9700', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10733', 'BERGS', '1', '1995-12-08 00:00:00', '1996-01-05 00:00:00', '1995-12-11 00:00:00', '3', '110.1100', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10734', 'GOURL', '2', '1995-12-08 00:00:00', '1996-01-05 00:00:00', '1995-12-13 00:00:00', '3', '1.6300', 'Gourmet Lanchonetes', 'Av. Brasil, 442', 'Campinas', 'SP', '04876-786', 'Brazil'); +INSERT INTO orders VALUES ('10735', 'LETSS', '6', '1995-12-11 00:00:00', '1996-01-08 00:00:00', '1995-12-22 00:00:00', '2', '45.9700', 'Let\'s Stop N Shop', '87 Polk St.\r\nSuite 5', 'San Francisco', 'CA', '94117', 'USA'); +INSERT INTO orders VALUES ('10736', 'HUNGO', '9', '1995-12-12 00:00:00', '1996-01-09 00:00:00', '1995-12-22 00:00:00', '2', '44.1000', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10737', 'VINET', '2', '1995-12-12 00:00:00', '1996-01-09 00:00:00', '1995-12-19 00:00:00', '2', '7.7900', 'Vins et alcools Chevalier', '59 rue de l\'Abbaye', 'Reims', null, '51100', 'France'); +INSERT INTO orders VALUES ('10738', 'SPECD', '2', '1995-12-13 00:00:00', '1996-01-10 00:00:00', '1995-12-19 00:00:00', '1', '2.9100', 'Spécialités du monde', '25, rue Lauriston', 'Paris', null, '75016', 'France'); +INSERT INTO orders VALUES ('10739', 'VINET', '3', '1995-12-13 00:00:00', '1996-01-10 00:00:00', '1995-12-18 00:00:00', '3', '11.0800', 'Vins et alcools Chevalier', '59 rue de l\'Abbaye', 'Reims', null, '51100', 'France'); +INSERT INTO orders VALUES ('10740', 'WHITC', '4', '1995-12-14 00:00:00', '1996-01-11 00:00:00', '1995-12-26 00:00:00', '2', '81.8800', 'White Clover Markets', '1029 - 12th Ave. S.', 'Seattle', 'WA', '98124', 'USA'); +INSERT INTO orders VALUES ('10741', 'AROUT', '4', '1995-12-15 00:00:00', '1995-12-29 00:00:00', '1995-12-19 00:00:00', '3', '10.9600', 'Around the Horn', 'Brook Farm\r\nStratford St. Mary', 'Colchester', 'Essex', 'CO7 6JX', 'UK'); +INSERT INTO orders VALUES ('10742', 'BOTTM', '3', '1995-12-15 00:00:00', '1996-01-12 00:00:00', '1995-12-19 00:00:00', '3', '243.7300', 'Bottom-Dollar Markets', '23 Tsawassen Blvd.', 'Tsawassen', 'BC', 'T2F 8M4', 'Canada'); +INSERT INTO orders VALUES ('10743', 'AROUT', '1', '1995-12-18 00:00:00', '1996-01-15 00:00:00', '1995-12-22 00:00:00', '2', '23.7200', 'Around the Horn', 'Brook Farm\r\nStratford St. Mary', 'Colchester', 'Essex', 'CO7 6JX', 'UK'); +INSERT INTO orders VALUES ('10744', 'VAFFE', '6', '1995-12-18 00:00:00', '1996-01-15 00:00:00', '1995-12-25 00:00:00', '1', '69.1900', 'Vaffeljernet', 'Smagsløget 45', 'Århus', null, '8200', 'Denmark'); +INSERT INTO orders VALUES ('10745', 'QUICK', '9', '1995-12-19 00:00:00', '1996-01-16 00:00:00', '1995-12-28 00:00:00', '1', '3.5200', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10746', 'CHOPS', '1', '1995-12-20 00:00:00', '1996-01-17 00:00:00', '1995-12-22 00:00:00', '3', '31.4300', 'Chop-suey Chinese', 'Hauptstr. 31', 'Bern', null, '3012', 'Switzerland'); +INSERT INTO orders VALUES ('10747', 'PICCO', '6', '1995-12-20 00:00:00', '1996-01-17 00:00:00', '1995-12-27 00:00:00', '1', '117.3300', 'Piccolo und mehr', 'Geislweg 14', 'Salzburg', null, '5020', 'Austria'); +INSERT INTO orders VALUES ('10748', 'SAVEA', '3', '1995-12-21 00:00:00', '1996-01-18 00:00:00', '1995-12-29 00:00:00', '1', '232.5500', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10749', 'ISLAT', '4', '1995-12-21 00:00:00', '1996-01-18 00:00:00', '1996-01-19 00:00:00', '2', '61.5300', 'Island Trading', 'Garden House\r\nCrowther Way', 'Cowes', 'Isle of Wight', 'PO31 7PJ', 'UK'); +INSERT INTO orders VALUES ('10750', 'WARTH', '9', '1995-12-22 00:00:00', '1996-01-19 00:00:00', '1995-12-25 00:00:00', '1', '79.3000', 'Wartian Herkku', 'Torikatu 38', 'Oulu', null, '90110', 'Finland'); +INSERT INTO orders VALUES ('10751', 'RICSU', '3', '1995-12-25 00:00:00', '1996-01-22 00:00:00', '1996-01-03 00:00:00', '3', '130.7900', 'Richter Supermarkt', 'Starenweg 5', 'Genève', null, '1204', 'Switzerland'); +INSERT INTO orders VALUES ('10752', 'NORTS', '2', '1995-12-25 00:00:00', '1996-01-22 00:00:00', '1995-12-29 00:00:00', '3', '1.3900', 'North/South', 'South House\r\n300 Queensbridge', 'London', null, 'SW7 1RZ', 'UK'); +INSERT INTO orders VALUES ('10753', 'FRANS', '3', '1995-12-26 00:00:00', '1996-01-23 00:00:00', '1995-12-28 00:00:00', '1', '7.7000', 'Franchi S.p.A.', 'Via Monte Bianco 34', 'Torino', null, '10100', 'Italy'); +INSERT INTO orders VALUES ('10754', 'MAGAA', '6', '1995-12-26 00:00:00', '1996-01-23 00:00:00', '1995-12-28 00:00:00', '3', '2.3800', 'Magazzini Alimentari Riuniti', 'Via Ludovico il Moro 22', 'Bergamo', null, '24100', 'Italy'); +INSERT INTO orders VALUES ('10755', 'BONAP', '4', '1995-12-27 00:00:00', '1996-01-24 00:00:00', '1995-12-29 00:00:00', '2', '16.7100', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10756', 'SPLIR', '8', '1995-12-28 00:00:00', '1996-01-25 00:00:00', '1996-01-02 00:00:00', '2', '73.2100', 'Split Rail Beer & Ale', 'P.O. Box 555', 'Lander', 'WY', '82520', 'USA'); +INSERT INTO orders VALUES ('10757', 'SAVEA', '6', '1995-12-28 00:00:00', '1996-01-25 00:00:00', '1996-01-15 00:00:00', '1', '8.1900', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10758', 'RICSU', '3', '1995-12-29 00:00:00', '1996-01-26 00:00:00', '1996-01-04 00:00:00', '3', '138.1700', 'Richter Supermarkt', 'Starenweg 5', 'Genève', null, '1204', 'Switzerland'); +INSERT INTO orders VALUES ('10759', 'ANATR', '3', '1995-12-29 00:00:00', '1996-01-26 00:00:00', '1996-01-12 00:00:00', '3', '11.9900', 'Ana Trujillo Emparedados y helados', 'Avda. de la Constitución 2222', 'México D.F.', null, '05021', 'Mexico'); +INSERT INTO orders VALUES ('10760', 'MAISD', '4', '1996-01-01 00:00:00', '1996-01-29 00:00:00', '1996-01-10 00:00:00', '1', '155.6400', 'Maison Dewey', 'Rue Joseph-Bens 532', 'Bruxelles', null, 'B-1180', 'Belgium'); +INSERT INTO orders VALUES ('10761', 'RATTC', '5', '1996-01-02 00:00:00', '1996-01-30 00:00:00', '1996-01-08 00:00:00', '2', '18.6600', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10762', 'FOLKO', '3', '1996-01-02 00:00:00', '1996-01-30 00:00:00', '1996-01-09 00:00:00', '1', '328.7400', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10763', 'FOLIG', '3', '1996-01-03 00:00:00', '1996-01-31 00:00:00', '1996-01-08 00:00:00', '3', '37.3500', 'Folies gourmandes', '184, chaussée de Tournai', 'Lille', null, '59000', 'France'); +INSERT INTO orders VALUES ('10764', 'ERNSH', '6', '1996-01-03 00:00:00', '1996-01-31 00:00:00', '1996-01-08 00:00:00', '3', '145.4500', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10765', 'QUICK', '3', '1996-01-04 00:00:00', '1996-02-01 00:00:00', '1996-01-09 00:00:00', '3', '42.7400', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10766', 'OTTIK', '4', '1996-01-05 00:00:00', '1996-02-02 00:00:00', '1996-01-09 00:00:00', '1', '157.5500', 'Ottilies Käseladen', 'Mehrheimerstr. 369', 'Köln', null, '50739', 'Germany'); +INSERT INTO orders VALUES ('10767', 'SUPRD', '4', '1996-01-05 00:00:00', '1996-02-02 00:00:00', '1996-01-15 00:00:00', '3', '1.5900', 'Suprêmes délices', 'Boulevard Tirou, 255', 'Charleroi', null, 'B-6000', 'Belgium'); +INSERT INTO orders VALUES ('10768', 'AROUT', '3', '1996-01-08 00:00:00', '1996-02-05 00:00:00', '1996-01-15 00:00:00', '2', '146.3200', 'Around the Horn', 'Brook Farm\r\nStratford St. Mary', 'Colchester', 'Essex', 'CO7 6JX', 'UK'); +INSERT INTO orders VALUES ('10769', 'VAFFE', '3', '1996-01-08 00:00:00', '1996-02-05 00:00:00', '1996-01-12 00:00:00', '1', '65.0600', 'Vaffeljernet', 'Smagsløget 45', 'Århus', null, '8200', 'Denmark'); +INSERT INTO orders VALUES ('10770', 'HANAR', '8', '1996-01-09 00:00:00', '1996-02-06 00:00:00', '1996-01-17 00:00:00', '3', '5.3200', 'Hanari Carnes', 'Rua do Paço, 67', 'Rio de Janeiro', 'RJ', '05454-876', 'Brazil'); +INSERT INTO orders VALUES ('10771', 'ERNSH', '9', '1996-01-10 00:00:00', '1996-02-07 00:00:00', '1996-02-02 00:00:00', '2', '11.1900', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10772', 'LEHMS', '3', '1996-01-10 00:00:00', '1996-02-07 00:00:00', '1996-01-19 00:00:00', '2', '91.2800', 'Lehmanns Marktstand', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany'); +INSERT INTO orders VALUES ('10773', 'ERNSH', '1', '1996-01-11 00:00:00', '1996-02-08 00:00:00', '1996-01-16 00:00:00', '3', '96.4300', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10774', 'FOLKO', '4', '1996-01-11 00:00:00', '1996-01-25 00:00:00', '1996-01-12 00:00:00', '1', '48.2000', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10775', 'THECR', '7', '1996-01-12 00:00:00', '1996-02-09 00:00:00', '1996-01-26 00:00:00', '1', '20.2500', 'The Cracker Box', '55 Grizzly Peak Rd.', 'Butte', 'MT', '59801', 'USA'); +INSERT INTO orders VALUES ('10776', 'ERNSH', '1', '1996-01-15 00:00:00', '1996-02-12 00:00:00', '1996-01-18 00:00:00', '3', '351.5300', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10777', 'GOURL', '7', '1996-01-15 00:00:00', '1996-01-29 00:00:00', '1996-02-21 00:00:00', '2', '3.0100', 'Gourmet Lanchonetes', 'Av. Brasil, 442', 'Campinas', 'SP', '04876-786', 'Brazil'); +INSERT INTO orders VALUES ('10778', 'BERGS', '3', '1996-01-16 00:00:00', '1996-02-13 00:00:00', '1996-01-24 00:00:00', '1', '6.7900', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10779', 'MORGK', '3', '1996-01-16 00:00:00', '1996-02-13 00:00:00', '1996-02-14 00:00:00', '2', '58.1300', 'Morgenstern Gesundkost', 'Heerstr. 22', 'Leipzig', null, '04179', 'Germany'); +INSERT INTO orders VALUES ('10780', 'LILAS', '2', '1996-01-16 00:00:00', '1996-01-30 00:00:00', '1996-01-25 00:00:00', '1', '42.1300', 'LILA-Supermercado', 'Carrera 52 con Ave. Bolívar #65-98 Llano Largo', 'Barquisimeto', 'Lara', '3508', 'Venezuela'); +INSERT INTO orders VALUES ('10781', 'WARTH', '2', '1996-01-17 00:00:00', '1996-02-14 00:00:00', '1996-01-19 00:00:00', '3', '73.1600', 'Wartian Herkku', 'Torikatu 38', 'Oulu', null, '90110', 'Finland'); +INSERT INTO orders VALUES ('10782', 'CACTU', '9', '1996-01-17 00:00:00', '1996-02-14 00:00:00', '1996-01-22 00:00:00', '3', '1.1000', 'Cactus Comidas para llevar', 'Cerrito 333', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('10783', 'HANAR', '4', '1996-01-18 00:00:00', '1996-02-15 00:00:00', '1996-01-19 00:00:00', '2', '124.9800', 'Hanari Carnes', 'Rua do Paço, 67', 'Rio de Janeiro', 'RJ', '05454-876', 'Brazil'); +INSERT INTO orders VALUES ('10784', 'MAGAA', '4', '1996-01-18 00:00:00', '1996-02-15 00:00:00', '1996-01-22 00:00:00', '3', '70.0900', 'Magazzini Alimentari Riuniti', 'Via Ludovico il Moro 22', 'Bergamo', null, '24100', 'Italy'); +INSERT INTO orders VALUES ('10785', 'GROSR', '1', '1996-01-18 00:00:00', '1996-02-15 00:00:00', '1996-01-24 00:00:00', '3', '1.5100', 'GROSELLA-Restaurante', '5ª Ave. Los Palos Grandes', 'Caracas', 'DF', '1081', 'Venezuela'); +INSERT INTO orders VALUES ('10786', 'QUEEN', '8', '1996-01-19 00:00:00', '1996-02-16 00:00:00', '1996-01-23 00:00:00', '1', '110.8700', 'Queen Cozinha', 'Alameda dos Canàrios, 891', 'São Paulo', 'SP', '05487-020', 'Brazil'); +INSERT INTO orders VALUES ('10787', 'LAMAI', '2', '1996-01-19 00:00:00', '1996-02-02 00:00:00', '1996-01-26 00:00:00', '1', '249.9300', 'La maison d\'Asie', '1 rue Alsace-Lorraine', 'Toulouse', null, '31000', 'France'); +INSERT INTO orders VALUES ('10788', 'QUICK', '1', '1996-01-22 00:00:00', '1996-02-19 00:00:00', '1996-02-19 00:00:00', '2', '42.7000', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10789', 'FOLIG', '1', '1996-01-22 00:00:00', '1996-02-19 00:00:00', '1996-01-31 00:00:00', '2', '100.6000', 'Folies gourmandes', '184, chaussée de Tournai', 'Lille', null, '59000', 'France'); +INSERT INTO orders VALUES ('10790', 'GOURL', '6', '1996-01-22 00:00:00', '1996-02-19 00:00:00', '1996-01-26 00:00:00', '1', '28.2300', 'Gourmet Lanchonetes', 'Av. Brasil, 442', 'Campinas', 'SP', '04876-786', 'Brazil'); +INSERT INTO orders VALUES ('10791', 'FRANK', '6', '1996-01-23 00:00:00', '1996-02-20 00:00:00', '1996-02-01 00:00:00', '2', '16.8500', 'Frankenversand', 'Berliner Platz 43', 'München', null, '80805', 'Germany'); +INSERT INTO orders VALUES ('10792', 'WOLZA', '1', '1996-01-23 00:00:00', '1996-02-20 00:00:00', '1996-01-31 00:00:00', '3', '23.7900', 'Wolski Zajazd', 'ul. Filtrowa 68', 'Warszawa', null, '01-012', 'Poland'); +INSERT INTO orders VALUES ('10793', 'AROUT', '3', '1996-01-24 00:00:00', '1996-02-21 00:00:00', '1996-02-08 00:00:00', '3', '4.5200', 'Around the Horn', 'Brook Farm\r\nStratford St. Mary', 'Colchester', 'Essex', 'CO7 6JX', 'UK'); +INSERT INTO orders VALUES ('10794', 'QUEDE', '6', '1996-01-24 00:00:00', '1996-02-21 00:00:00', '1996-02-02 00:00:00', '1', '21.4900', 'Que Delícia', 'Rua da Panificadora, 12', 'Rio de Janeiro', 'RJ', '02389-673', 'Brazil'); +INSERT INTO orders VALUES ('10795', 'ERNSH', '8', '1996-01-24 00:00:00', '1996-02-21 00:00:00', '1996-02-20 00:00:00', '2', '126.6600', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10796', 'HILAA', '3', '1996-01-25 00:00:00', '1996-02-22 00:00:00', '1996-02-14 00:00:00', '1', '26.5200', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10797', 'DRACD', '7', '1996-01-25 00:00:00', '1996-02-22 00:00:00', '1996-02-05 00:00:00', '2', '33.3500', 'Drachenblut Delikatessen', 'Walserweg 21', 'Aachen', null, '52066', 'Germany'); +INSERT INTO orders VALUES ('10798', 'ISLAT', '2', '1996-01-26 00:00:00', '1996-02-23 00:00:00', '1996-02-05 00:00:00', '1', '2.3300', 'Island Trading', 'Garden House\r\nCrowther Way', 'Cowes', 'Isle of Wight', 'PO31 7PJ', 'UK'); +INSERT INTO orders VALUES ('10799', 'KOENE', '9', '1996-01-26 00:00:00', '1996-03-08 00:00:00', '1996-02-05 00:00:00', '3', '30.7600', 'Königlich Essen', 'Maubelstr. 90', 'Brandenburg', null, '14776', 'Germany'); +INSERT INTO orders VALUES ('10800', 'SEVES', '1', '1996-01-26 00:00:00', '1996-02-23 00:00:00', '1996-02-05 00:00:00', '3', '137.4400', 'Seven Seas Imports', '90 Wadhurst Rd.', 'London', null, 'OX15 4NB', 'UK'); +INSERT INTO orders VALUES ('10801', 'BOLID', '4', '1996-01-29 00:00:00', '1996-02-26 00:00:00', '1996-01-31 00:00:00', '2', '97.0900', 'Bólido Comidas preparadas', 'C/ Araquil, 67', 'Madrid', null, '28023', 'Spain'); +INSERT INTO orders VALUES ('10802', 'SIMOB', '4', '1996-01-29 00:00:00', '1996-02-26 00:00:00', '1996-02-02 00:00:00', '2', '257.2600', 'Simons bistro', 'Vinbæltet 34', 'København', null, '1734', 'Denmark'); +INSERT INTO orders VALUES ('10803', 'WELLI', '4', '1996-01-30 00:00:00', '1996-02-27 00:00:00', '1996-02-06 00:00:00', '1', '55.2300', 'Wellington Importadora', 'Rua do Mercado, 12', 'Resende', 'SP', '08737-363', 'Brazil'); +INSERT INTO orders VALUES ('10804', 'SEVES', '6', '1996-01-30 00:00:00', '1996-02-27 00:00:00', '1996-02-07 00:00:00', '2', '27.3300', 'Seven Seas Imports', '90 Wadhurst Rd.', 'London', null, 'OX15 4NB', 'UK'); +INSERT INTO orders VALUES ('10805', 'THEBI', '2', '1996-01-30 00:00:00', '1996-02-27 00:00:00', '1996-02-09 00:00:00', '3', '237.3400', 'The Big Cheese', '89 Jefferson Way\r\nSuite 2', 'Portland', 'OR', '97201', 'USA'); +INSERT INTO orders VALUES ('10806', 'VICTE', '3', '1996-01-31 00:00:00', '1996-02-28 00:00:00', '1996-02-05 00:00:00', '2', '22.1100', 'Victuailles en stock', '2, rue du Commerce', 'Lyon', null, '69004', 'France'); +INSERT INTO orders VALUES ('10807', 'FRANS', '4', '1996-01-31 00:00:00', '1996-02-28 00:00:00', '1996-03-01 00:00:00', '1', '1.3600', 'Franchi S.p.A.', 'Via Monte Bianco 34', 'Torino', null, '10100', 'Italy'); +INSERT INTO orders VALUES ('10808', 'OLDWO', '2', '1996-02-01 00:00:00', '1996-02-29 00:00:00', '1996-02-09 00:00:00', '3', '45.5300', 'Old World Delicatessen', '2743 Bering St.', 'Anchorage', 'AK', '99508', 'USA'); +INSERT INTO orders VALUES ('10809', 'WELLI', '7', '1996-02-01 00:00:00', '1996-02-29 00:00:00', '1996-02-07 00:00:00', '1', '4.8700', 'Wellington Importadora', 'Rua do Mercado, 12', 'Resende', 'SP', '08737-363', 'Brazil'); +INSERT INTO orders VALUES ('10810', 'LAUGB', '2', '1996-02-01 00:00:00', '1996-02-29 00:00:00', '1996-02-07 00:00:00', '3', '4.3300', 'Laughing Bacchus Wine Cellars', '2319 Elm St.', 'Vancouver', 'BC', 'V3F 2K1', 'Canada'); +INSERT INTO orders VALUES ('10811', 'LINOD', '8', '1996-02-02 00:00:00', '1996-03-01 00:00:00', '1996-02-08 00:00:00', '1', '31.2200', 'LINO-Delicateses', 'Ave. 5 de Mayo Porlamar', 'I. de Margarita', 'Nueva Esparta', '4980', 'Venezuela'); +INSERT INTO orders VALUES ('10812', 'REGGC', '5', '1996-02-02 00:00:00', '1996-03-01 00:00:00', '1996-02-12 00:00:00', '1', '59.7800', 'Reggiani Caseifici', 'Strada Provinciale 124', 'Reggio Emilia', null, '42100', 'Italy'); +INSERT INTO orders VALUES ('10813', 'RICAR', '1', '1996-02-05 00:00:00', '1996-03-04 00:00:00', '1996-02-09 00:00:00', '1', '47.3800', 'Ricardo Adocicados', 'Av. Copacabana, 267', 'Rio de Janeiro', 'RJ', '02389-890', 'Brazil'); +INSERT INTO orders VALUES ('10814', 'VICTE', '3', '1996-02-05 00:00:00', '1996-03-04 00:00:00', '1996-02-14 00:00:00', '3', '130.9400', 'Victuailles en stock', '2, rue du Commerce', 'Lyon', null, '69004', 'France'); +INSERT INTO orders VALUES ('10815', 'SAVEA', '2', '1996-02-05 00:00:00', '1996-03-04 00:00:00', '1996-02-14 00:00:00', '3', '14.6200', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10816', 'GREAL', '4', '1996-02-06 00:00:00', '1996-03-05 00:00:00', '1996-03-06 00:00:00', '2', '719.7800', 'Great Lakes Food Market', '2732 Baker Blvd.', 'Eugene', 'OR', '97403', 'USA'); +INSERT INTO orders VALUES ('10817', 'KOENE', '3', '1996-02-06 00:00:00', '1996-02-20 00:00:00', '1996-02-13 00:00:00', '2', '306.0700', 'Königlich Essen', 'Maubelstr. 90', 'Brandenburg', null, '14776', 'Germany'); +INSERT INTO orders VALUES ('10818', 'MAGAA', '7', '1996-02-07 00:00:00', '1996-03-06 00:00:00', '1996-02-12 00:00:00', '3', '65.4800', 'Magazzini Alimentari Riuniti', 'Via Ludovico il Moro 22', 'Bergamo', null, '24100', 'Italy'); +INSERT INTO orders VALUES ('10819', 'CACTU', '2', '1996-02-07 00:00:00', '1996-03-06 00:00:00', '1996-02-16 00:00:00', '3', '19.7600', 'Cactus Comidas para llevar', 'Cerrito 333', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('10820', 'RATTC', '3', '1996-02-07 00:00:00', '1996-03-06 00:00:00', '1996-02-13 00:00:00', '2', '37.5200', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10821', 'SPLIR', '1', '1996-02-08 00:00:00', '1996-03-07 00:00:00', '1996-02-15 00:00:00', '1', '36.6800', 'Split Rail Beer & Ale', 'P.O. Box 555', 'Lander', 'WY', '82520', 'USA'); +INSERT INTO orders VALUES ('10822', 'TRAIH', '6', '1996-02-08 00:00:00', '1996-03-07 00:00:00', '1996-02-16 00:00:00', '3', '7.0000', 'Trail\'s Head Gourmet Provisioners', '722 DaVinci Blvd.', 'Kirkland', 'WA', '98034', 'USA'); +INSERT INTO orders VALUES ('10823', 'LILAS', '5', '1996-02-09 00:00:00', '1996-03-08 00:00:00', '1996-02-13 00:00:00', '2', '163.9700', 'LILA-Supermercado', 'Carrera 52 con Ave. Bolívar #65-98 Llano Largo', 'Barquisimeto', 'Lara', '3508', 'Venezuela'); +INSERT INTO orders VALUES ('10824', 'FOLKO', '8', '1996-02-09 00:00:00', '1996-03-08 00:00:00', '1996-03-01 00:00:00', '1', '1.2300', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10825', 'DRACD', '1', '1996-02-09 00:00:00', '1996-03-08 00:00:00', '1996-02-14 00:00:00', '1', '79.2500', 'Drachenblut Delikatessen', 'Walserweg 21', 'Aachen', null, '52066', 'Germany'); +INSERT INTO orders VALUES ('10826', 'BLONP', '6', '1996-02-12 00:00:00', '1996-03-11 00:00:00', '1996-03-08 00:00:00', '1', '7.0900', 'Blondel père et fils', '24, place Kléber', 'Strasbourg', null, '67000', 'France'); +INSERT INTO orders VALUES ('10827', 'BONAP', '1', '1996-02-12 00:00:00', '1996-02-26 00:00:00', '1996-03-08 00:00:00', '2', '63.5400', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10828', 'RANCH', '9', '1996-02-13 00:00:00', '1996-02-27 00:00:00', '1996-03-06 00:00:00', '1', '90.8500', 'Rancho grande', 'Av. del Libertador 900', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('10829', 'ISLAT', '9', '1996-02-13 00:00:00', '1996-03-12 00:00:00', '1996-02-23 00:00:00', '1', '154.7200', 'Island Trading', 'Garden House\r\nCrowther Way', 'Cowes', 'Isle of Wight', 'PO31 7PJ', 'UK'); +INSERT INTO orders VALUES ('10830', 'TRADH', '4', '1996-02-13 00:00:00', '1996-03-26 00:00:00', '1996-02-21 00:00:00', '2', '81.8300', 'Tradição Hipermercados', 'Av. Inês de Castro, 414', 'São Paulo', 'SP', '05634-030', 'Brazil'); +INSERT INTO orders VALUES ('10831', 'SANTG', '3', '1996-02-14 00:00:00', '1996-03-13 00:00:00', '1996-02-23 00:00:00', '2', '72.1900', 'Santé Gourmet', 'Erling Skakkes gate 78', 'Stavern', null, '4110', 'Norway'); +INSERT INTO orders VALUES ('10832', 'LAMAI', '2', '1996-02-14 00:00:00', '1996-03-13 00:00:00', '1996-02-19 00:00:00', '2', '43.2600', 'La maison d\'Asie', '1 rue Alsace-Lorraine', 'Toulouse', null, '31000', 'France'); +INSERT INTO orders VALUES ('10833', 'OTTIK', '6', '1996-02-15 00:00:00', '1996-03-14 00:00:00', '1996-02-23 00:00:00', '2', '71.4900', 'Ottilies Käseladen', 'Mehrheimerstr. 369', 'Köln', null, '50739', 'Germany'); +INSERT INTO orders VALUES ('10834', 'TRADH', '1', '1996-02-15 00:00:00', '1996-03-14 00:00:00', '1996-02-19 00:00:00', '3', '29.7800', 'Tradição Hipermercados', 'Av. Inês de Castro, 414', 'São Paulo', 'SP', '05634-030', 'Brazil'); +INSERT INTO orders VALUES ('10835', 'ALFKI', '1', '1996-02-15 00:00:00', '1996-03-14 00:00:00', '1996-02-21 00:00:00', '3', '69.5300', 'Alfred\'s Futterkiste', 'Obere Str. 57', 'Berlin', null, '12209', 'Germany'); +INSERT INTO orders VALUES ('10836', 'ERNSH', '7', '1996-02-16 00:00:00', '1996-03-15 00:00:00', '1996-02-21 00:00:00', '1', '411.8800', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10837', 'BERGS', '9', '1996-02-16 00:00:00', '1996-03-15 00:00:00', '1996-02-23 00:00:00', '3', '13.3200', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10838', 'LINOD', '3', '1996-02-19 00:00:00', '1996-03-18 00:00:00', '1996-02-23 00:00:00', '3', '59.2800', 'LINO-Delicateses', 'Ave. 5 de Mayo Porlamar', 'I. de Margarita', 'Nueva Esparta', '4980', 'Venezuela'); +INSERT INTO orders VALUES ('10839', 'TRADH', '3', '1996-02-19 00:00:00', '1996-03-18 00:00:00', '1996-02-22 00:00:00', '3', '35.4300', 'Tradição Hipermercados', 'Av. Inês de Castro, 414', 'São Paulo', 'SP', '05634-030', 'Brazil'); +INSERT INTO orders VALUES ('10840', 'LINOD', '4', '1996-02-19 00:00:00', '1996-04-01 00:00:00', '1996-03-18 00:00:00', '2', '2.7100', 'LINO-Delicateses', 'Ave. 5 de Mayo Porlamar', 'I. de Margarita', 'Nueva Esparta', '4980', 'Venezuela'); +INSERT INTO orders VALUES ('10841', 'SUPRD', '5', '1996-02-20 00:00:00', '1996-03-19 00:00:00', '1996-02-29 00:00:00', '2', '424.3000', 'Suprêmes délices', 'Boulevard Tirou, 255', 'Charleroi', null, 'B-6000', 'Belgium'); +INSERT INTO orders VALUES ('10842', 'TORTU', '1', '1996-02-20 00:00:00', '1996-03-19 00:00:00', '1996-02-29 00:00:00', '3', '54.4200', 'Tortuga Restaurante', 'Avda. Azteca 123', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('10843', 'VICTE', '4', '1996-02-21 00:00:00', '1996-03-20 00:00:00', '1996-02-26 00:00:00', '2', '9.2600', 'Victuailles en stock', '2, rue du Commerce', 'Lyon', null, '69004', 'France'); +INSERT INTO orders VALUES ('10844', 'PICCO', '8', '1996-02-21 00:00:00', '1996-03-20 00:00:00', '1996-02-26 00:00:00', '2', '25.2200', 'Piccolo und mehr', 'Geislweg 14', 'Salzburg', null, '5020', 'Austria'); +INSERT INTO orders VALUES ('10845', 'QUICK', '8', '1996-02-21 00:00:00', '1996-03-06 00:00:00', '1996-03-01 00:00:00', '1', '212.9800', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10846', 'SUPRD', '2', '1996-02-22 00:00:00', '1996-04-04 00:00:00', '1996-02-23 00:00:00', '3', '56.4600', 'Suprêmes délices', 'Boulevard Tirou, 255', 'Charleroi', null, 'B-6000', 'Belgium'); +INSERT INTO orders VALUES ('10847', 'SAVEA', '4', '1996-02-22 00:00:00', '1996-03-07 00:00:00', '1996-03-12 00:00:00', '3', '487.5700', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10848', 'CONSH', '7', '1996-02-23 00:00:00', '1996-03-22 00:00:00', '1996-02-29 00:00:00', '2', '38.2400', 'Consolidated Holdings', 'Berkeley Gardens\r\n12 Brewery ', 'London', null, 'WX1 6LT', 'UK'); +INSERT INTO orders VALUES ('10849', 'KOENE', '9', '1996-02-23 00:00:00', '1996-03-22 00:00:00', '1996-03-01 00:00:00', '2', '0.5600', 'Königlich Essen', 'Maubelstr. 90', 'Brandenburg', null, '14776', 'Germany'); +INSERT INTO orders VALUES ('10850', 'VICTE', '1', '1996-02-23 00:00:00', '1996-04-05 00:00:00', '1996-03-01 00:00:00', '1', '49.1900', 'Victuailles en stock', '2, rue du Commerce', 'Lyon', null, '69004', 'France'); +INSERT INTO orders VALUES ('10851', 'RICAR', '5', '1996-02-26 00:00:00', '1996-03-25 00:00:00', '1996-03-04 00:00:00', '1', '160.5500', 'Ricardo Adocicados', 'Av. Copacabana, 267', 'Rio de Janeiro', 'RJ', '02389-890', 'Brazil'); +INSERT INTO orders VALUES ('10852', 'RATTC', '8', '1996-02-26 00:00:00', '1996-03-11 00:00:00', '1996-03-01 00:00:00', '1', '174.0500', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10853', 'BLAUS', '9', '1996-02-27 00:00:00', '1996-03-26 00:00:00', '1996-03-05 00:00:00', '2', '53.8300', 'Blauer See Delikatessen', 'Forsterstr. 57', 'Mannheim', null, '68306', 'Germany'); +INSERT INTO orders VALUES ('10854', 'ERNSH', '3', '1996-02-27 00:00:00', '1996-03-26 00:00:00', '1996-03-07 00:00:00', '2', '100.2200', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10855', 'OLDWO', '3', '1996-02-27 00:00:00', '1996-03-26 00:00:00', '1996-03-06 00:00:00', '1', '170.9700', 'Old World Delicatessen', '2743 Bering St.', 'Anchorage', 'AK', '99508', 'USA'); +INSERT INTO orders VALUES ('10856', 'ANTON', '3', '1996-02-28 00:00:00', '1996-03-27 00:00:00', '1996-03-12 00:00:00', '2', '58.4300', 'Antonio Moreno Taquería', 'Mataderos 2312', 'México D.F.', null, '05023', 'Mexico'); +INSERT INTO orders VALUES ('10857', 'BERGS', '8', '1996-02-28 00:00:00', '1996-03-27 00:00:00', '1996-03-08 00:00:00', '2', '188.8500', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10858', 'LACOR', '2', '1996-02-29 00:00:00', '1996-03-28 00:00:00', '1996-03-05 00:00:00', '1', '52.5100', 'La corne d\'abondance', '67, avenue de l\'Europe', 'Versailles', null, '78000', 'France'); +INSERT INTO orders VALUES ('10859', 'FRANK', '1', '1996-02-29 00:00:00', '1996-03-28 00:00:00', '1996-03-04 00:00:00', '2', '76.1000', 'Frankenversand', 'Berliner Platz 43', 'München', null, '80805', 'Germany'); +INSERT INTO orders VALUES ('10860', 'FRANR', '3', '1996-02-29 00:00:00', '1996-03-28 00:00:00', '1996-03-06 00:00:00', '3', '19.2600', 'France restauration', '54, rue Royale', 'Nantes', null, '44000', 'France'); +INSERT INTO orders VALUES ('10861', 'WHITC', '4', '1996-03-01 00:00:00', '1996-03-29 00:00:00', '1996-03-19 00:00:00', '2', '14.9300', 'White Clover Markets', '1029 - 12th Ave. S.', 'Seattle', 'WA', '98124', 'USA'); +INSERT INTO orders VALUES ('10862', 'LEHMS', '8', '1996-03-01 00:00:00', '1996-04-12 00:00:00', '1996-03-04 00:00:00', '2', '53.2300', 'Lehmanns Marktstand', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany'); +INSERT INTO orders VALUES ('10863', 'HILAA', '4', '1996-03-04 00:00:00', '1996-04-01 00:00:00', '1996-03-19 00:00:00', '2', '30.2600', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10864', 'AROUT', '4', '1996-03-04 00:00:00', '1996-04-01 00:00:00', '1996-03-11 00:00:00', '2', '3.0400', 'Around the Horn', 'Brook Farm\r\nStratford St. Mary', 'Colchester', 'Essex', 'CO7 6JX', 'UK'); +INSERT INTO orders VALUES ('10865', 'QUICK', '2', '1996-03-04 00:00:00', '1996-03-18 00:00:00', '1996-03-14 00:00:00', '1', '348.1400', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10866', 'BERGS', '5', '1996-03-05 00:00:00', '1996-04-02 00:00:00', '1996-03-14 00:00:00', '1', '109.1100', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10867', 'LONEP', '6', '1996-03-05 00:00:00', '1996-04-16 00:00:00', '1996-03-13 00:00:00', '1', '1.9300', 'Lonesome Pine Restaurant', '89 Chiaroscuro Rd.', 'Portland', 'OR', '97219', 'USA'); +INSERT INTO orders VALUES ('10868', 'QUEEN', '7', '1996-03-06 00:00:00', '1996-04-03 00:00:00', '1996-03-25 00:00:00', '2', '191.2700', 'Queen Cozinha', 'Alameda dos Canàrios, 891', 'São Paulo', 'SP', '05487-020', 'Brazil'); +INSERT INTO orders VALUES ('10869', 'SEVES', '5', '1996-03-06 00:00:00', '1996-04-03 00:00:00', '1996-03-11 00:00:00', '1', '143.2800', 'Seven Seas Imports', '90 Wadhurst Rd.', 'London', null, 'OX15 4NB', 'UK'); +INSERT INTO orders VALUES ('10870', 'WOLZA', '5', '1996-03-06 00:00:00', '1996-04-03 00:00:00', '1996-03-15 00:00:00', '3', '12.0400', 'Wolski Zajazd', 'ul. Filtrowa 68', 'Warszawa', null, '01-012', 'Poland'); +INSERT INTO orders VALUES ('10871', 'BONAP', '9', '1996-03-07 00:00:00', '1996-04-04 00:00:00', '1996-03-12 00:00:00', '2', '112.2700', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10872', 'GODOS', '5', '1996-03-07 00:00:00', '1996-04-04 00:00:00', '1996-03-11 00:00:00', '2', '175.3200', 'Godos Cocina Típica', 'C/ Romero, 33', 'Sevilla', null, '41101', 'Spain'); +INSERT INTO orders VALUES ('10873', 'WILMK', '4', '1996-03-08 00:00:00', '1996-04-05 00:00:00', '1996-03-11 00:00:00', '1', '0.8200', 'Wilman Kala', 'Keskuskatu 45', 'Helsinki', null, '21240', 'Finland'); +INSERT INTO orders VALUES ('10874', 'GODOS', '5', '1996-03-08 00:00:00', '1996-04-05 00:00:00', '1996-03-13 00:00:00', '2', '19.5800', 'Godos Cocina Típica', 'C/ Romero, 33', 'Sevilla', null, '41101', 'Spain'); +INSERT INTO orders VALUES ('10875', 'BERGS', '4', '1996-03-08 00:00:00', '1996-04-05 00:00:00', '1996-04-02 00:00:00', '2', '32.3700', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10876', 'BONAP', '7', '1996-03-11 00:00:00', '1996-04-08 00:00:00', '1996-03-14 00:00:00', '3', '60.4200', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10877', 'RICAR', '1', '1996-03-11 00:00:00', '1996-04-08 00:00:00', '1996-03-21 00:00:00', '1', '38.0600', 'Ricardo Adocicados', 'Av. Copacabana, 267', 'Rio de Janeiro', 'RJ', '02389-890', 'Brazil'); +INSERT INTO orders VALUES ('10878', 'QUICK', '4', '1996-03-12 00:00:00', '1996-04-09 00:00:00', '1996-03-14 00:00:00', '1', '46.6900', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10879', 'WILMK', '3', '1996-03-12 00:00:00', '1996-04-09 00:00:00', '1996-03-14 00:00:00', '3', '8.5000', 'Wilman Kala', 'Keskuskatu 45', 'Helsinki', null, '21240', 'Finland'); +INSERT INTO orders VALUES ('10880', 'FOLKO', '7', '1996-03-12 00:00:00', '1996-04-23 00:00:00', '1996-03-20 00:00:00', '1', '88.0100', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10881', 'CACTU', '4', '1996-03-13 00:00:00', '1996-04-10 00:00:00', '1996-03-20 00:00:00', '1', '2.8400', 'Cactus Comidas para llevar', 'Cerrito 333', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('10882', 'SAVEA', '4', '1996-03-13 00:00:00', '1996-04-10 00:00:00', '1996-03-22 00:00:00', '3', '23.1000', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10883', 'LONEP', '8', '1996-03-14 00:00:00', '1996-04-11 00:00:00', '1996-03-22 00:00:00', '3', '0.5300', 'Lonesome Pine Restaurant', '89 Chiaroscuro Rd.', 'Portland', 'OR', '97219', 'USA'); +INSERT INTO orders VALUES ('10884', 'LETSS', '4', '1996-03-14 00:00:00', '1996-04-11 00:00:00', '1996-03-15 00:00:00', '2', '90.9700', 'Let\'s Stop N Shop', '87 Polk St.\r\nSuite 5', 'San Francisco', 'CA', '94117', 'USA'); +INSERT INTO orders VALUES ('10885', 'SUPRD', '6', '1996-03-14 00:00:00', '1996-04-11 00:00:00', '1996-03-20 00:00:00', '3', '5.6400', 'Suprêmes délices', 'Boulevard Tirou, 255', 'Charleroi', null, 'B-6000', 'Belgium'); +INSERT INTO orders VALUES ('10886', 'HANAR', '1', '1996-03-15 00:00:00', '1996-04-12 00:00:00', '1996-04-01 00:00:00', '1', '4.9900', 'Hanari Carnes', 'Rua do Paço, 67', 'Rio de Janeiro', 'RJ', '05454-876', 'Brazil'); +INSERT INTO orders VALUES ('10887', 'GALED', '8', '1996-03-15 00:00:00', '1996-04-12 00:00:00', '1996-03-18 00:00:00', '3', '1.2500', 'Galería del gastronómo', 'Rambla de Cataluña, 23', 'Barcelona', null, '8022', 'Spain'); +INSERT INTO orders VALUES ('10888', 'GODOS', '1', '1996-03-18 00:00:00', '1996-04-15 00:00:00', '1996-03-25 00:00:00', '2', '51.8700', 'Godos Cocina Típica', 'C/ Romero, 33', 'Sevilla', null, '41101', 'Spain'); +INSERT INTO orders VALUES ('10889', 'RATTC', '9', '1996-03-18 00:00:00', '1996-04-15 00:00:00', '1996-03-25 00:00:00', '3', '280.6100', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10890', 'DUMON', '7', '1996-03-18 00:00:00', '1996-04-15 00:00:00', '1996-03-20 00:00:00', '1', '32.7600', 'Du monde entier', '67, rue des Cinquante Otages', 'Nantes', null, '44000', 'France'); +INSERT INTO orders VALUES ('10891', 'LEHMS', '7', '1996-03-19 00:00:00', '1996-04-16 00:00:00', '1996-03-21 00:00:00', '2', '20.3700', 'Lehmanns Marktstand', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany'); +INSERT INTO orders VALUES ('10892', 'MAISD', '4', '1996-03-19 00:00:00', '1996-04-16 00:00:00', '1996-03-21 00:00:00', '2', '120.2700', 'Maison Dewey', 'Rue Joseph-Bens 532', 'Bruxelles', null, 'B-1180', 'Belgium'); +INSERT INTO orders VALUES ('10893', 'KOENE', '9', '1996-03-20 00:00:00', '1996-04-17 00:00:00', '1996-03-22 00:00:00', '2', '77.7800', 'Königlich Essen', 'Maubelstr. 90', 'Brandenburg', null, '14776', 'Germany'); +INSERT INTO orders VALUES ('10894', 'SAVEA', '1', '1996-03-20 00:00:00', '1996-04-17 00:00:00', '1996-03-22 00:00:00', '1', '116.1300', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10895', 'ERNSH', '3', '1996-03-20 00:00:00', '1996-04-17 00:00:00', '1996-03-25 00:00:00', '1', '162.7500', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10896', 'MAISD', '7', '1996-03-21 00:00:00', '1996-04-18 00:00:00', '1996-03-29 00:00:00', '3', '32.4500', 'Maison Dewey', 'Rue Joseph-Bens 532', 'Bruxelles', null, 'B-1180', 'Belgium'); +INSERT INTO orders VALUES ('10897', 'HUNGO', '3', '1996-03-21 00:00:00', '1996-04-18 00:00:00', '1996-03-27 00:00:00', '2', '603.5400', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10898', 'OCEAN', '4', '1996-03-22 00:00:00', '1996-04-19 00:00:00', '1996-04-05 00:00:00', '2', '1.2700', 'Océano Atlántico Ltda.', 'Ing. Gustavo Moncada 8585\r\nPiso 20-A', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('10899', 'LILAS', '5', '1996-03-22 00:00:00', '1996-04-19 00:00:00', '1996-03-28 00:00:00', '3', '1.2100', 'LILA-Supermercado', 'Carrera 52 con Ave. Bolívar #65-98 Llano Largo', 'Barquisimeto', 'Lara', '3508', 'Venezuela'); +INSERT INTO orders VALUES ('10900', 'WELLI', '1', '1996-03-22 00:00:00', '1996-04-19 00:00:00', '1996-04-03 00:00:00', '2', '1.6600', 'Wellington Importadora', 'Rua do Mercado, 12', 'Resende', 'SP', '08737-363', 'Brazil'); +INSERT INTO orders VALUES ('10901', 'HILAA', '4', '1996-03-25 00:00:00', '1996-04-22 00:00:00', '1996-03-28 00:00:00', '1', '62.0900', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10902', 'FOLKO', '1', '1996-03-25 00:00:00', '1996-04-22 00:00:00', '1996-04-02 00:00:00', '1', '44.1500', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10903', 'HANAR', '3', '1996-03-26 00:00:00', '1996-04-23 00:00:00', '1996-04-03 00:00:00', '3', '36.7100', 'Hanari Carnes', 'Rua do Paço, 67', 'Rio de Janeiro', 'RJ', '05454-876', 'Brazil'); +INSERT INTO orders VALUES ('10904', 'WHITC', '3', '1996-03-26 00:00:00', '1996-04-23 00:00:00', '1996-03-29 00:00:00', '3', '162.9500', 'White Clover Markets', '1029 - 12th Ave. S.', 'Seattle', 'WA', '98124', 'USA'); +INSERT INTO orders VALUES ('10905', 'WELLI', '9', '1996-03-26 00:00:00', '1996-04-23 00:00:00', '1996-04-05 00:00:00', '2', '13.7200', 'Wellington Importadora', 'Rua do Mercado, 12', 'Resende', 'SP', '08737-363', 'Brazil'); +INSERT INTO orders VALUES ('10906', 'WOLZA', '4', '1996-03-27 00:00:00', '1996-04-10 00:00:00', '1996-04-02 00:00:00', '3', '26.2900', 'Wolski Zajazd', 'ul. Filtrowa 68', 'Warszawa', null, '01-012', 'Poland'); +INSERT INTO orders VALUES ('10907', 'SPECD', '6', '1996-03-27 00:00:00', '1996-04-24 00:00:00', '1996-03-29 00:00:00', '3', '9.1900', 'Spécialités du monde', '25, rue Lauriston', 'Paris', null, '75016', 'France'); +INSERT INTO orders VALUES ('10908', 'REGGC', '4', '1996-03-28 00:00:00', '1996-04-25 00:00:00', '1996-04-05 00:00:00', '2', '32.9600', 'Reggiani Caseifici', 'Strada Provinciale 124', 'Reggio Emilia', null, '42100', 'Italy'); +INSERT INTO orders VALUES ('10909', 'SANTG', '1', '1996-03-28 00:00:00', '1996-04-25 00:00:00', '1996-04-09 00:00:00', '2', '53.0500', 'Santé Gourmet', 'Erling Skakkes gate 78', 'Stavern', null, '4110', 'Norway'); +INSERT INTO orders VALUES ('10910', 'WILMK', '1', '1996-03-28 00:00:00', '1996-04-25 00:00:00', '1996-04-03 00:00:00', '3', '38.1100', 'Wilman Kala', 'Keskuskatu 45', 'Helsinki', null, '21240', 'Finland'); +INSERT INTO orders VALUES ('10911', 'GODOS', '3', '1996-03-28 00:00:00', '1996-04-25 00:00:00', '1996-04-04 00:00:00', '1', '38.1900', 'Godos Cocina Típica', 'C/ Romero, 33', 'Sevilla', null, '41101', 'Spain'); +INSERT INTO orders VALUES ('10912', 'HUNGO', '2', '1996-03-28 00:00:00', '1996-04-25 00:00:00', '1996-04-17 00:00:00', '2', '580.9100', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10913', 'QUEEN', '4', '1996-03-28 00:00:00', '1996-04-25 00:00:00', '1996-04-03 00:00:00', '1', '33.0500', 'Queen Cozinha', 'Alameda dos Canàrios, 891', 'São Paulo', 'SP', '05487-020', 'Brazil'); +INSERT INTO orders VALUES ('10914', 'QUEEN', '6', '1996-03-29 00:00:00', '1996-04-26 00:00:00', '1996-04-01 00:00:00', '1', '21.1900', 'Queen Cozinha', 'Alameda dos Canàrios, 891', 'São Paulo', 'SP', '05487-020', 'Brazil'); +INSERT INTO orders VALUES ('10915', 'TORTU', '2', '1996-03-29 00:00:00', '1996-04-26 00:00:00', '1996-04-01 00:00:00', '2', '3.5100', 'Tortuga Restaurante', 'Avda. Azteca 123', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('10916', 'RANCH', '1', '1996-03-29 00:00:00', '1996-04-26 00:00:00', '1996-04-08 00:00:00', '2', '63.7700', 'Rancho grande', 'Av. del Libertador 900', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('10917', 'ROMEY', '4', '1996-04-01 00:00:00', '1996-04-29 00:00:00', '1996-04-10 00:00:00', '2', '8.2900', 'Romero y tomillo', 'Gran Vía, 1', 'Madrid', null, '28001', 'Spain'); +INSERT INTO orders VALUES ('10918', 'BOTTM', '3', '1996-04-01 00:00:00', '1996-04-29 00:00:00', '1996-04-10 00:00:00', '3', '48.8300', 'Bottom-Dollar Markets', '23 Tsawassen Blvd.', 'Tsawassen', 'BC', 'T2F 8M4', 'Canada'); +INSERT INTO orders VALUES ('10919', 'LINOD', '2', '1996-04-01 00:00:00', '1996-04-29 00:00:00', '1996-04-03 00:00:00', '2', '19.8000', 'LINO-Delicateses', 'Ave. 5 de Mayo Porlamar', 'I. de Margarita', 'Nueva Esparta', '4980', 'Venezuela'); +INSERT INTO orders VALUES ('10920', 'AROUT', '4', '1996-04-02 00:00:00', '1996-04-30 00:00:00', '1996-04-08 00:00:00', '2', '29.6100', 'Around the Horn', 'Brook Farm\r\nStratford St. Mary', 'Colchester', 'Essex', 'CO7 6JX', 'UK'); +INSERT INTO orders VALUES ('10921', 'VAFFE', '1', '1996-04-02 00:00:00', '1996-05-14 00:00:00', '1996-04-08 00:00:00', '1', '176.4800', 'Vaffeljernet', 'Smagsløget 45', 'Århus', null, '8200', 'Denmark'); +INSERT INTO orders VALUES ('10922', 'HANAR', '5', '1996-04-02 00:00:00', '1996-04-30 00:00:00', '1996-04-04 00:00:00', '3', '62.7400', 'Hanari Carnes', 'Rua do Paço, 67', 'Rio de Janeiro', 'RJ', '05454-876', 'Brazil'); +INSERT INTO orders VALUES ('10923', 'LAMAI', '7', '1996-04-02 00:00:00', '1996-05-14 00:00:00', '1996-04-12 00:00:00', '3', '68.2600', 'La maison d\'Asie', '1 rue Alsace-Lorraine', 'Toulouse', null, '31000', 'France'); +INSERT INTO orders VALUES ('10924', 'BERGS', '3', '1996-04-03 00:00:00', '1996-05-01 00:00:00', '1996-05-08 00:00:00', '2', '151.5200', 'Berglunds snabbköp', 'Berguvsvägen 8', 'Luleå', null, 'S-958 22', 'Sweden'); +INSERT INTO orders VALUES ('10925', 'HANAR', '3', '1996-04-03 00:00:00', '1996-05-01 00:00:00', '1996-04-12 00:00:00', '1', '2.2700', 'Hanari Carnes', 'Rua do Paço, 67', 'Rio de Janeiro', 'RJ', '05454-876', 'Brazil'); +INSERT INTO orders VALUES ('10926', 'ANATR', '4', '1996-04-03 00:00:00', '1996-05-01 00:00:00', '1996-04-10 00:00:00', '3', '39.9200', 'Ana Trujillo Emparedados y helados', 'Avda. de la Constitución 2222', 'México D.F.', null, '05021', 'Mexico'); +INSERT INTO orders VALUES ('10927', 'LACOR', '4', '1996-04-04 00:00:00', '1996-05-02 00:00:00', '1996-05-08 00:00:00', '1', '19.7900', 'La corne d\'abondance', '67, avenue de l\'Europe', 'Versailles', null, '78000', 'France'); +INSERT INTO orders VALUES ('10928', 'GALED', '1', '1996-04-04 00:00:00', '1996-05-02 00:00:00', '1996-04-17 00:00:00', '1', '1.3600', 'Galería del gastronómo', 'Rambla de Cataluña, 23', 'Barcelona', null, '8022', 'Spain'); +INSERT INTO orders VALUES ('10929', 'FRANK', '6', '1996-04-04 00:00:00', '1996-05-02 00:00:00', '1996-04-11 00:00:00', '1', '33.9300', 'Frankenversand', 'Berliner Platz 43', 'München', null, '80805', 'Germany'); +INSERT INTO orders VALUES ('10930', 'SUPRD', '4', '1996-04-05 00:00:00', '1996-05-17 00:00:00', '1996-04-17 00:00:00', '3', '15.5500', 'Suprêmes délices', 'Boulevard Tirou, 255', 'Charleroi', null, 'B-6000', 'Belgium'); +INSERT INTO orders VALUES ('10931', 'RICSU', '4', '1996-04-05 00:00:00', '1996-04-19 00:00:00', '1996-04-18 00:00:00', '2', '13.6000', 'Richter Supermarkt', 'Starenweg 5', 'Genève', null, '1204', 'Switzerland'); +INSERT INTO orders VALUES ('10932', 'BONAP', '8', '1996-04-05 00:00:00', '1996-05-03 00:00:00', '1996-04-23 00:00:00', '1', '134.6400', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10933', 'ISLAT', '6', '1996-04-05 00:00:00', '1996-05-03 00:00:00', '1996-04-15 00:00:00', '3', '54.1500', 'Island Trading', 'Garden House\r\nCrowther Way', 'Cowes', 'Isle of Wight', 'PO31 7PJ', 'UK'); +INSERT INTO orders VALUES ('10934', 'LEHMS', '3', '1996-04-08 00:00:00', '1996-05-06 00:00:00', '1996-04-11 00:00:00', '3', '32.0100', 'Lehmanns Marktstand', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany'); +INSERT INTO orders VALUES ('10935', 'WELLI', '4', '1996-04-08 00:00:00', '1996-05-06 00:00:00', '1996-04-17 00:00:00', '3', '47.5900', 'Wellington Importadora', 'Rua do Mercado, 12', 'Resende', 'SP', '08737-363', 'Brazil'); +INSERT INTO orders VALUES ('10936', 'GREAL', '3', '1996-04-08 00:00:00', '1996-05-06 00:00:00', '1996-04-17 00:00:00', '2', '33.6800', 'Great Lakes Food Market', '2732 Baker Blvd.', 'Eugene', 'OR', '97403', 'USA'); +INSERT INTO orders VALUES ('10937', 'CACTU', '7', '1996-04-09 00:00:00', '1996-04-23 00:00:00', '1996-04-12 00:00:00', '3', '31.5100', 'Cactus Comidas para llevar', 'Cerrito 333', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('10938', 'QUICK', '3', '1996-04-09 00:00:00', '1996-05-07 00:00:00', '1996-04-15 00:00:00', '2', '31.8900', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10939', 'MAGAA', '2', '1996-04-09 00:00:00', '1996-05-07 00:00:00', '1996-04-12 00:00:00', '2', '76.3300', 'Magazzini Alimentari Riuniti', 'Via Ludovico il Moro 22', 'Bergamo', null, '24100', 'Italy'); +INSERT INTO orders VALUES ('10940', 'BONAP', '8', '1996-04-10 00:00:00', '1996-05-08 00:00:00', '1996-04-22 00:00:00', '3', '19.7700', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('10941', 'SAVEA', '7', '1996-04-10 00:00:00', '1996-05-08 00:00:00', '1996-04-19 00:00:00', '2', '400.8100', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10942', 'REGGC', '9', '1996-04-10 00:00:00', '1996-05-08 00:00:00', '1996-04-17 00:00:00', '3', '17.9500', 'Reggiani Caseifici', 'Strada Provinciale 124', 'Reggio Emilia', null, '42100', 'Italy'); +INSERT INTO orders VALUES ('10943', 'BSBEV', '4', '1996-04-10 00:00:00', '1996-05-08 00:00:00', '1996-04-18 00:00:00', '2', '2.1700', 'B\'s Beverages', 'Fauntleroy Circus', 'London', null, 'EC2 5NT', 'UK'); +INSERT INTO orders VALUES ('10944', 'BOTTM', '6', '1996-04-11 00:00:00', '1996-04-25 00:00:00', '1996-04-12 00:00:00', '3', '52.9200', 'Bottom-Dollar Markets', '23 Tsawassen Blvd.', 'Tsawassen', 'BC', 'T2F 8M4', 'Canada'); +INSERT INTO orders VALUES ('10945', 'MORGK', '4', '1996-04-11 00:00:00', '1996-05-09 00:00:00', '1996-04-17 00:00:00', '1', '10.2200', 'Morgenstern Gesundkost', 'Heerstr. 22', 'Leipzig', null, '04179', 'Germany'); +INSERT INTO orders VALUES ('10946', 'VAFFE', '1', '1996-04-11 00:00:00', '1996-05-09 00:00:00', '1996-04-18 00:00:00', '2', '27.2000', 'Vaffeljernet', 'Smagsløget 45', 'Århus', null, '8200', 'Denmark'); +INSERT INTO orders VALUES ('10947', 'BSBEV', '3', '1996-04-12 00:00:00', '1996-05-10 00:00:00', '1996-04-15 00:00:00', '2', '3.2600', 'B\'s Beverages', 'Fauntleroy Circus', 'London', null, 'EC2 5NT', 'UK'); +INSERT INTO orders VALUES ('10948', 'GODOS', '3', '1996-04-12 00:00:00', '1996-05-10 00:00:00', '1996-04-18 00:00:00', '3', '23.3900', 'Godos Cocina Típica', 'C/ Romero, 33', 'Sevilla', null, '41101', 'Spain'); +INSERT INTO orders VALUES ('10949', 'BOTTM', '2', '1996-04-12 00:00:00', '1996-05-10 00:00:00', '1996-04-16 00:00:00', '3', '74.4400', 'Bottom-Dollar Markets', '23 Tsawassen Blvd.', 'Tsawassen', 'BC', 'T2F 8M4', 'Canada'); +INSERT INTO orders VALUES ('10950', 'MAGAA', '1', '1996-04-15 00:00:00', '1996-05-13 00:00:00', '1996-04-22 00:00:00', '2', '2.5000', 'Magazzini Alimentari Riuniti', 'Via Ludovico il Moro 22', 'Bergamo', null, '24100', 'Italy'); +INSERT INTO orders VALUES ('10951', 'RICSU', '9', '1996-04-15 00:00:00', '1996-05-27 00:00:00', '1996-05-07 00:00:00', '2', '30.8500', 'Richter Supermarkt', 'Starenweg 5', 'Genève', null, '1204', 'Switzerland'); +INSERT INTO orders VALUES ('10952', 'ALFKI', '1', '1996-04-15 00:00:00', '1996-05-27 00:00:00', '1996-04-23 00:00:00', '1', '40.4200', 'Alfred\'s Futterkiste', 'Obere Str. 57', 'Berlin', null, '12209', 'Germany'); +INSERT INTO orders VALUES ('10953', 'AROUT', '9', '1996-04-15 00:00:00', '1996-04-29 00:00:00', '1996-04-24 00:00:00', '2', '23.7200', 'Around the Horn', 'Brook Farm\r\nStratford St. Mary', 'Colchester', 'Essex', 'CO7 6JX', 'UK'); +INSERT INTO orders VALUES ('10954', 'LINOD', '5', '1996-04-16 00:00:00', '1996-05-28 00:00:00', '1996-04-19 00:00:00', '1', '27.9100', 'LINO-Delicateses', 'Ave. 5 de Mayo Porlamar', 'I. de Margarita', 'Nueva Esparta', '4980', 'Venezuela'); +INSERT INTO orders VALUES ('10955', 'FOLKO', '8', '1996-04-16 00:00:00', '1996-05-14 00:00:00', '1996-04-19 00:00:00', '2', '3.2600', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10956', 'BLAUS', '6', '1996-04-16 00:00:00', '1996-05-28 00:00:00', '1996-04-19 00:00:00', '2', '44.6500', 'Blauer See Delikatessen', 'Forsterstr. 57', 'Mannheim', null, '68306', 'Germany'); +INSERT INTO orders VALUES ('10957', 'HILAA', '8', '1996-04-17 00:00:00', '1996-05-15 00:00:00', '1996-04-26 00:00:00', '3', '105.3600', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10958', 'OCEAN', '7', '1996-04-17 00:00:00', '1996-05-15 00:00:00', '1996-04-26 00:00:00', '2', '49.5600', 'Océano Atlántico Ltda.', 'Ing. Gustavo Moncada 8585\r\nPiso 20-A', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('10959', 'GOURL', '6', '1996-04-17 00:00:00', '1996-05-29 00:00:00', '1996-04-22 00:00:00', '2', '4.9800', 'Gourmet Lanchonetes', 'Av. Brasil, 442', 'Campinas', 'SP', '04876-786', 'Brazil'); +INSERT INTO orders VALUES ('10960', 'HILAA', '3', '1996-04-18 00:00:00', '1996-05-02 00:00:00', '1996-05-08 00:00:00', '1', '2.0800', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10961', 'QUEEN', '8', '1996-04-18 00:00:00', '1996-05-16 00:00:00', '1996-04-29 00:00:00', '1', '104.4700', 'Queen Cozinha', 'Alameda dos Canàrios, 891', 'São Paulo', 'SP', '05487-020', 'Brazil'); +INSERT INTO orders VALUES ('10962', 'QUICK', '8', '1996-04-18 00:00:00', '1996-05-16 00:00:00', '1996-04-22 00:00:00', '2', '275.7900', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10963', 'FURIB', '9', '1996-04-18 00:00:00', '1996-05-16 00:00:00', '1996-04-25 00:00:00', '3', '2.7000', 'Furia Bacalhau e Frutos do Mar', 'Jardim das rosas n. 32', 'Lisboa', null, '1675', 'Portugal'); +INSERT INTO orders VALUES ('10964', 'SPECD', '3', '1996-04-19 00:00:00', '1996-05-17 00:00:00', '1996-04-23 00:00:00', '2', '87.3800', 'Spécialités du monde', '25, rue Lauriston', 'Paris', null, '75016', 'France'); +INSERT INTO orders VALUES ('10965', 'OLDWO', '6', '1996-04-19 00:00:00', '1996-05-17 00:00:00', '1996-04-29 00:00:00', '3', '144.3800', 'Old World Delicatessen', '2743 Bering St.', 'Anchorage', 'AK', '99508', 'USA'); +INSERT INTO orders VALUES ('10966', 'CHOPS', '4', '1996-04-19 00:00:00', '1996-05-17 00:00:00', '1996-05-08 00:00:00', '1', '27.1900', 'Chop-suey Chinese', 'Hauptstr. 31', 'Bern', null, '3012', 'Switzerland'); +INSERT INTO orders VALUES ('10967', 'TOMSP', '2', '1996-04-22 00:00:00', '1996-05-20 00:00:00', '1996-05-02 00:00:00', '2', '62.2200', 'Toms Spezialitäten', 'Luisenstr. 48', 'Münster', null, '44087', 'Germany'); +INSERT INTO orders VALUES ('10968', 'ERNSH', '1', '1996-04-22 00:00:00', '1996-05-20 00:00:00', '1996-05-01 00:00:00', '3', '74.6000', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10969', 'COMMI', '1', '1996-04-22 00:00:00', '1996-05-20 00:00:00', '1996-04-29 00:00:00', '2', '0.2100', 'Comércio Mineiro', 'Av. dos Lusíadas, 23', 'São Paulo', 'SP', '05432-043', 'Brazil'); +INSERT INTO orders VALUES ('10970', 'BOLID', '9', '1996-04-23 00:00:00', '1996-05-07 00:00:00', '1996-05-24 00:00:00', '1', '16.1600', 'Bólido Comidas preparadas', 'C/ Araquil, 67', 'Madrid', null, '28023', 'Spain'); +INSERT INTO orders VALUES ('10971', 'FRANR', '2', '1996-04-23 00:00:00', '1996-05-21 00:00:00', '1996-05-02 00:00:00', '2', '121.8200', 'France restauration', '54, rue Royale', 'Nantes', null, '44000', 'France'); +INSERT INTO orders VALUES ('10972', 'LACOR', '4', '1996-04-23 00:00:00', '1996-05-21 00:00:00', '1996-04-25 00:00:00', '2', '0.0200', 'La corne d\'abondance', '67, avenue de l\'Europe', 'Versailles', null, '78000', 'France'); +INSERT INTO orders VALUES ('10973', 'LACOR', '6', '1996-04-23 00:00:00', '1996-05-21 00:00:00', '1996-04-26 00:00:00', '2', '15.1700', 'La corne d\'abondance', '67, avenue de l\'Europe', 'Versailles', null, '78000', 'France'); +INSERT INTO orders VALUES ('10974', 'SPLIR', '3', '1996-04-24 00:00:00', '1996-05-08 00:00:00', '1996-05-03 00:00:00', '3', '12.9600', 'Split Rail Beer & Ale', 'P.O. Box 555', 'Lander', 'WY', '82520', 'USA'); +INSERT INTO orders VALUES ('10975', 'BOTTM', '1', '1996-04-24 00:00:00', '1996-05-22 00:00:00', '1996-04-26 00:00:00', '3', '32.2700', 'Bottom-Dollar Markets', '23 Tsawassen Blvd.', 'Tsawassen', 'BC', 'T2F 8M4', 'Canada'); +INSERT INTO orders VALUES ('10976', 'HILAA', '1', '1996-04-24 00:00:00', '1996-06-05 00:00:00', '1996-05-03 00:00:00', '1', '37.9700', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('10977', 'FOLKO', '8', '1996-04-25 00:00:00', '1996-05-23 00:00:00', '1996-05-10 00:00:00', '3', '208.5000', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10978', 'MAISD', '9', '1996-04-25 00:00:00', '1996-05-23 00:00:00', '1996-05-23 00:00:00', '2', '32.8200', 'Maison Dewey', 'Rue Joseph-Bens 532', 'Bruxelles', null, 'B-1180', 'Belgium'); +INSERT INTO orders VALUES ('10979', 'ERNSH', '8', '1996-04-25 00:00:00', '1996-05-23 00:00:00', '1996-04-30 00:00:00', '2', '353.0700', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10980', 'FOLKO', '4', '1996-04-26 00:00:00', '1996-06-07 00:00:00', '1996-05-17 00:00:00', '1', '1.2600', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10981', 'HANAR', '1', '1996-04-26 00:00:00', '1996-05-24 00:00:00', '1996-05-02 00:00:00', '2', '193.3700', 'Hanari Carnes', 'Rua do Paço, 67', 'Rio de Janeiro', 'RJ', '05454-876', 'Brazil'); +INSERT INTO orders VALUES ('10982', 'BOTTM', '2', '1996-04-26 00:00:00', '1996-05-24 00:00:00', '1996-05-08 00:00:00', '1', '14.0100', 'Bottom-Dollar Markets', '23 Tsawassen Blvd.', 'Tsawassen', 'BC', 'T2F 8M4', 'Canada'); +INSERT INTO orders VALUES ('10983', 'SAVEA', '2', '1996-04-26 00:00:00', '1996-05-24 00:00:00', '1996-05-06 00:00:00', '2', '657.5400', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10984', 'SAVEA', '1', '1996-04-29 00:00:00', '1996-05-27 00:00:00', '1996-05-03 00:00:00', '3', '211.2200', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('10985', 'HUNGO', '2', '1996-04-29 00:00:00', '1996-05-27 00:00:00', '1996-05-02 00:00:00', '1', '91.5100', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('10986', 'OCEAN', '8', '1996-04-29 00:00:00', '1996-05-27 00:00:00', '1996-05-21 00:00:00', '2', '217.8600', 'Océano Atlántico Ltda.', 'Ing. Gustavo Moncada 8585\r\nPiso 20-A', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('10987', 'EASTC', '8', '1996-04-30 00:00:00', '1996-05-28 00:00:00', '1996-05-06 00:00:00', '1', '185.4800', 'Eastern Connection', '35 King George', 'London', null, 'WX3 6FW', 'UK'); +INSERT INTO orders VALUES ('10988', 'RATTC', '3', '1996-04-30 00:00:00', '1996-05-28 00:00:00', '1996-05-10 00:00:00', '2', '61.1400', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('10989', 'QUEDE', '2', '1996-04-30 00:00:00', '1996-05-28 00:00:00', '1996-05-02 00:00:00', '1', '34.7600', 'Que Delícia', 'Rua da Panificadora, 12', 'Rio de Janeiro', 'RJ', '02389-673', 'Brazil'); +INSERT INTO orders VALUES ('10990', 'ERNSH', '2', '1996-05-01 00:00:00', '1996-06-12 00:00:00', '1996-05-07 00:00:00', '3', '117.6100', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('10991', 'QUICK', '1', '1996-05-01 00:00:00', '1996-05-29 00:00:00', '1996-05-07 00:00:00', '1', '38.5100', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10992', 'THEBI', '1', '1996-05-01 00:00:00', '1996-05-29 00:00:00', '1996-05-03 00:00:00', '3', '4.2700', 'The Big Cheese', '89 Jefferson Way\r\nSuite 2', 'Portland', 'OR', '97201', 'USA'); +INSERT INTO orders VALUES ('10993', 'FOLKO', '7', '1996-05-01 00:00:00', '1996-05-29 00:00:00', '1996-05-10 00:00:00', '3', '8.8100', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('10994', 'VAFFE', '2', '1996-05-02 00:00:00', '1996-05-16 00:00:00', '1996-05-09 00:00:00', '3', '65.5300', 'Vaffeljernet', 'Smagsløget 45', 'Århus', null, '8200', 'Denmark'); +INSERT INTO orders VALUES ('10995', 'PERIC', '1', '1996-05-02 00:00:00', '1996-05-30 00:00:00', '1996-05-06 00:00:00', '3', '46.0000', 'Pericles Comidas clásicas', 'Calle Dr. Jorge Cash 321', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('10996', 'QUICK', '4', '1996-05-02 00:00:00', '1996-05-30 00:00:00', '1996-05-10 00:00:00', '2', '1.1200', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('10997', 'LILAS', '8', '1996-05-03 00:00:00', '1996-06-14 00:00:00', '1996-05-13 00:00:00', '2', '73.9100', 'LILA-Supermercado', 'Carrera 52 con Ave. Bolívar #65-98 Llano Largo', 'Barquisimeto', 'Lara', '3508', 'Venezuela'); +INSERT INTO orders VALUES ('10998', 'WOLZA', '8', '1996-05-03 00:00:00', '1996-05-17 00:00:00', '1996-05-17 00:00:00', '2', '20.3100', 'Wolski Zajazd', 'ul. Filtrowa 68', 'Warszawa', null, '01-012', 'Poland'); +INSERT INTO orders VALUES ('10999', 'OTTIK', '6', '1996-05-03 00:00:00', '1996-05-31 00:00:00', '1996-05-10 00:00:00', '2', '96.3500', 'Ottilies Käseladen', 'Mehrheimerstr. 369', 'Köln', null, '50739', 'Germany'); +INSERT INTO orders VALUES ('11000', 'RATTC', '2', '1996-05-06 00:00:00', '1996-06-03 00:00:00', '1996-05-14 00:00:00', '3', '55.1200', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); +INSERT INTO orders VALUES ('11001', 'FOLKO', '2', '1996-05-06 00:00:00', '1996-06-03 00:00:00', '1996-05-14 00:00:00', '2', '197.3000', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('11002', 'SAVEA', '4', '1996-05-06 00:00:00', '1996-06-03 00:00:00', '1996-05-16 00:00:00', '1', '141.1600', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('11003', 'THECR', '3', '1996-05-06 00:00:00', '1996-06-03 00:00:00', '1996-05-08 00:00:00', '3', '14.9100', 'The Cracker Box', '55 Grizzly Peak Rd.', 'Butte', 'MT', '59801', 'USA'); +INSERT INTO orders VALUES ('11004', 'MAISD', '3', '1996-05-07 00:00:00', '1996-06-04 00:00:00', '1996-05-20 00:00:00', '1', '44.8400', 'Maison Dewey', 'Rue Joseph-Bens 532', 'Bruxelles', null, 'B-1180', 'Belgium'); +INSERT INTO orders VALUES ('11005', 'WILMK', '2', '1996-05-07 00:00:00', '1996-06-04 00:00:00', '1996-05-10 00:00:00', '1', '0.7500', 'Wilman Kala', 'Keskuskatu 45', 'Helsinki', null, '21240', 'Finland'); +INSERT INTO orders VALUES ('11006', 'GREAL', '3', '1996-05-07 00:00:00', '1996-06-04 00:00:00', '1996-05-15 00:00:00', '2', '25.1900', 'Great Lakes Food Market', '2732 Baker Blvd.', 'Eugene', 'OR', '97403', 'USA'); +INSERT INTO orders VALUES ('11007', 'PRINI', '8', '1996-05-08 00:00:00', '1996-06-05 00:00:00', '1996-05-13 00:00:00', '2', '202.2400', 'Princesa Isabel Vinhos', 'Estrada da saúde n. 58', 'Lisboa', null, '1756', 'Portugal'); +INSERT INTO orders VALUES ('11008', 'ERNSH', '7', '1996-05-08 00:00:00', '1996-06-05 00:00:00', null, '3', '79.4600', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('11009', 'GODOS', '2', '1996-05-08 00:00:00', '1996-06-05 00:00:00', '1996-05-10 00:00:00', '1', '59.1100', 'Godos Cocina Típica', 'C/ Romero, 33', 'Sevilla', null, '41101', 'Spain'); +INSERT INTO orders VALUES ('11010', 'REGGC', '2', '1996-05-09 00:00:00', '1996-06-06 00:00:00', '1996-05-21 00:00:00', '2', '28.7100', 'Reggiani Caseifici', 'Strada Provinciale 124', 'Reggio Emilia', null, '42100', 'Italy'); +INSERT INTO orders VALUES ('11011', 'ALFKI', '3', '1996-05-09 00:00:00', '1996-06-06 00:00:00', '1996-05-13 00:00:00', '1', '1.2100', 'Alfred\'s Futterkiste', 'Obere Str. 57', 'Berlin', null, '12209', 'Germany'); +INSERT INTO orders VALUES ('11012', 'FRANK', '1', '1996-05-09 00:00:00', '1996-05-23 00:00:00', '1996-05-17 00:00:00', '3', '242.9500', 'Frankenversand', 'Berliner Platz 43', 'München', null, '80805', 'Germany'); +INSERT INTO orders VALUES ('11013', 'ROMEY', '2', '1996-05-09 00:00:00', '1996-06-06 00:00:00', '1996-05-10 00:00:00', '1', '32.9900', 'Romero y tomillo', 'Gran Vía, 1', 'Madrid', null, '28001', 'Spain'); +INSERT INTO orders VALUES ('11014', 'LINOD', '2', '1996-05-10 00:00:00', '1996-06-07 00:00:00', '1996-05-15 00:00:00', '3', '23.6000', 'LINO-Delicateses', 'Ave. 5 de Mayo Porlamar', 'I. de Margarita', 'Nueva Esparta', '4980', 'Venezuela'); +INSERT INTO orders VALUES ('11015', 'SANTG', '2', '1996-05-10 00:00:00', '1996-05-24 00:00:00', '1996-05-20 00:00:00', '2', '4.6200', 'Santé Gourmet', 'Erling Skakkes gate 78', 'Stavern', null, '4110', 'Norway'); +INSERT INTO orders VALUES ('11016', 'AROUT', '9', '1996-05-10 00:00:00', '1996-06-07 00:00:00', '1996-05-13 00:00:00', '2', '33.8000', 'Around the Horn', 'Brook Farm\r\nStratford St. Mary', 'Colchester', 'Essex', 'CO7 6JX', 'UK'); +INSERT INTO orders VALUES ('11017', 'ERNSH', '9', '1996-05-13 00:00:00', '1996-06-10 00:00:00', '1996-05-20 00:00:00', '2', '754.2600', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('11018', 'LONEP', '4', '1996-05-13 00:00:00', '1996-06-10 00:00:00', '1996-05-16 00:00:00', '2', '11.6500', 'Lonesome Pine Restaurant', '89 Chiaroscuro Rd.', 'Portland', 'OR', '97219', 'USA'); +INSERT INTO orders VALUES ('11019', 'RANCH', '6', '1996-05-13 00:00:00', '1996-06-10 00:00:00', null, '3', '3.1700', 'Rancho grande', 'Av. del Libertador 900', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('11020', 'OTTIK', '2', '1996-05-14 00:00:00', '1996-06-11 00:00:00', '1996-05-16 00:00:00', '2', '43.3000', 'Ottilies Käseladen', 'Mehrheimerstr. 369', 'Köln', null, '50739', 'Germany'); +INSERT INTO orders VALUES ('11021', 'QUICK', '3', '1996-05-14 00:00:00', '1996-06-11 00:00:00', '1996-05-21 00:00:00', '1', '297.1800', 'QUICK-Stop', 'Taucherstraße 10', 'Cunewalde', null, '01307', 'Germany'); +INSERT INTO orders VALUES ('11022', 'HANAR', '9', '1996-05-14 00:00:00', '1996-06-11 00:00:00', '1996-06-03 00:00:00', '2', '6.2700', 'Hanari Carnes', 'Rua do Paço, 67', 'Rio de Janeiro', 'RJ', '05454-876', 'Brazil'); +INSERT INTO orders VALUES ('11023', 'BSBEV', '1', '1996-05-14 00:00:00', '1996-05-28 00:00:00', '1996-05-24 00:00:00', '2', '123.8300', 'B\'s Beverages', 'Fauntleroy Circus', 'London', null, 'EC2 5NT', 'UK'); +INSERT INTO orders VALUES ('11024', 'EASTC', '4', '1996-05-15 00:00:00', '1996-06-12 00:00:00', '1996-05-20 00:00:00', '1', '74.3600', 'Eastern Connection', '35 King George', 'London', null, 'WX3 6FW', 'UK'); +INSERT INTO orders VALUES ('11025', 'WARTH', '6', '1996-05-15 00:00:00', '1996-06-12 00:00:00', '1996-05-24 00:00:00', '3', '29.1700', 'Wartian Herkku', 'Torikatu 38', 'Oulu', null, '90110', 'Finland'); +INSERT INTO orders VALUES ('11026', 'FRANS', '4', '1996-05-15 00:00:00', '1996-06-12 00:00:00', '1996-05-28 00:00:00', '1', '47.0900', 'Franchi S.p.A.', 'Via Monte Bianco 34', 'Torino', null, '10100', 'Italy'); +INSERT INTO orders VALUES ('11027', 'BOTTM', '1', '1996-05-16 00:00:00', '1996-06-13 00:00:00', '1996-05-20 00:00:00', '1', '52.5200', 'Bottom-Dollar Markets', '23 Tsawassen Blvd.', 'Tsawassen', 'BC', 'T2F 8M4', 'Canada'); +INSERT INTO orders VALUES ('11028', 'KOENE', '2', '1996-05-16 00:00:00', '1996-06-13 00:00:00', '1996-05-22 00:00:00', '1', '29.5900', 'Königlich Essen', 'Maubelstr. 90', 'Brandenburg', null, '14776', 'Germany'); +INSERT INTO orders VALUES ('11029', 'CHOPS', '4', '1996-05-16 00:00:00', '1996-06-13 00:00:00', '1996-05-27 00:00:00', '1', '47.8400', 'Chop-suey Chinese', 'Hauptstr. 31', 'Bern', null, '3012', 'Switzerland'); +INSERT INTO orders VALUES ('11030', 'SAVEA', '7', '1996-05-17 00:00:00', '1996-06-14 00:00:00', '1996-05-27 00:00:00', '2', '830.7500', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('11031', 'SAVEA', '6', '1996-05-17 00:00:00', '1996-06-14 00:00:00', '1996-05-24 00:00:00', '2', '227.2200', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('11032', 'WHITC', '2', '1996-05-17 00:00:00', '1996-06-14 00:00:00', '1996-05-23 00:00:00', '3', '606.1900', 'White Clover Markets', '1029 - 12th Ave. S.', 'Seattle', 'WA', '98124', 'USA'); +INSERT INTO orders VALUES ('11033', 'RICSU', '7', '1996-05-17 00:00:00', '1996-06-14 00:00:00', '1996-05-23 00:00:00', '3', '84.7400', 'Richter Supermarkt', 'Starenweg 5', 'Genève', null, '1204', 'Switzerland'); +INSERT INTO orders VALUES ('11034', 'OLDWO', '8', '1996-05-20 00:00:00', '1996-07-01 00:00:00', '1996-05-27 00:00:00', '1', '40.3200', 'Old World Delicatessen', '2743 Bering St.', 'Anchorage', 'AK', '99508', 'USA'); +INSERT INTO orders VALUES ('11035', 'SUPRD', '2', '1996-05-20 00:00:00', '1996-06-17 00:00:00', '1996-05-24 00:00:00', '2', '0.1700', 'Suprêmes délices', 'Boulevard Tirou, 255', 'Charleroi', null, 'B-6000', 'Belgium'); +INSERT INTO orders VALUES ('11036', 'DRACD', '8', '1996-05-20 00:00:00', '1996-06-17 00:00:00', '1996-05-22 00:00:00', '3', '149.4700', 'Drachenblut Delikatessen', 'Walserweg 21', 'Aachen', null, '52066', 'Germany'); +INSERT INTO orders VALUES ('11037', 'GODOS', '7', '1996-05-21 00:00:00', '1996-06-18 00:00:00', '1996-05-27 00:00:00', '1', '3.2000', 'Godos Cocina Típica', 'C/ Romero, 33', 'Sevilla', null, '41101', 'Spain'); +INSERT INTO orders VALUES ('11038', 'SUPRD', '1', '1996-05-21 00:00:00', '1996-06-18 00:00:00', '1996-05-30 00:00:00', '2', '29.5900', 'Suprêmes délices', 'Boulevard Tirou, 255', 'Charleroi', null, 'B-6000', 'Belgium'); +INSERT INTO orders VALUES ('11039', 'LINOD', '1', '1996-05-21 00:00:00', '1996-06-18 00:00:00', null, '2', '65.0000', 'LINO-Delicateses', 'Ave. 5 de Mayo Porlamar', 'I. de Margarita', 'Nueva Esparta', '4980', 'Venezuela'); +INSERT INTO orders VALUES ('11040', 'GREAL', '4', '1996-05-22 00:00:00', '1996-06-19 00:00:00', null, '3', '18.8400', 'Great Lakes Food Market', '2732 Baker Blvd.', 'Eugene', 'OR', '97403', 'USA'); +INSERT INTO orders VALUES ('11041', 'CHOPS', '3', '1996-05-22 00:00:00', '1996-06-19 00:00:00', '1996-05-28 00:00:00', '2', '48.2200', 'Chop-suey Chinese', 'Hauptstr. 31', 'Bern', null, '3012', 'Switzerland'); +INSERT INTO orders VALUES ('11042', 'COMMI', '2', '1996-05-22 00:00:00', '1996-06-05 00:00:00', '1996-05-31 00:00:00', '1', '29.9900', 'Comércio Mineiro', 'Av. dos Lusíadas, 23', 'São Paulo', 'SP', '05432-043', 'Brazil'); +INSERT INTO orders VALUES ('11043', 'SPECD', '5', '1996-05-22 00:00:00', '1996-06-19 00:00:00', '1996-05-29 00:00:00', '2', '8.8000', 'Spécialités du monde', '25, rue Lauriston', 'Paris', null, '75016', 'France'); +INSERT INTO orders VALUES ('11044', 'WOLZA', '4', '1996-05-23 00:00:00', '1996-06-20 00:00:00', '1996-05-31 00:00:00', '1', '8.7200', 'Wolski Zajazd', 'ul. Filtrowa 68', 'Warszawa', null, '01-012', 'Poland'); +INSERT INTO orders VALUES ('11045', 'BOTTM', '6', '1996-05-23 00:00:00', '1996-06-20 00:00:00', null, '2', '70.5800', 'Bottom-Dollar Markets', '23 Tsawassen Blvd.', 'Tsawassen', 'BC', 'T2F 8M4', 'Canada'); +INSERT INTO orders VALUES ('11046', 'WANDK', '8', '1996-05-23 00:00:00', '1996-06-20 00:00:00', '1996-05-24 00:00:00', '2', '71.6400', 'Die Wandernde Kuh', 'Adenauerallee 900', 'Stuttgart', null, '70563', 'Germany'); +INSERT INTO orders VALUES ('11047', 'EASTC', '7', '1996-05-24 00:00:00', '1996-06-21 00:00:00', '1996-05-31 00:00:00', '3', '46.6200', 'Eastern Connection', '35 King George', 'London', null, 'WX3 6FW', 'UK'); +INSERT INTO orders VALUES ('11048', 'BOTTM', '7', '1996-05-24 00:00:00', '1996-06-21 00:00:00', '1996-05-30 00:00:00', '3', '24.1200', 'Bottom-Dollar Markets', '23 Tsawassen Blvd.', 'Tsawassen', 'BC', 'T2F 8M4', 'Canada'); +INSERT INTO orders VALUES ('11049', 'GOURL', '3', '1996-05-24 00:00:00', '1996-06-21 00:00:00', '1996-06-03 00:00:00', '1', '8.3400', 'Gourmet Lanchonetes', 'Av. Brasil, 442', 'Campinas', 'SP', '04876-786', 'Brazil'); +INSERT INTO orders VALUES ('11050', 'FOLKO', '8', '1996-05-27 00:00:00', '1996-06-24 00:00:00', '1996-06-04 00:00:00', '2', '59.4100', 'Folk och fä HB', 'Åkergatan 24', 'Bräcke', null, 'S-844 67', 'Sweden'); +INSERT INTO orders VALUES ('11051', 'LAMAI', '7', '1996-05-27 00:00:00', '1996-06-24 00:00:00', null, '3', '2.7900', 'La maison d\'Asie', '1 rue Alsace-Lorraine', 'Toulouse', null, '31000', 'France'); +INSERT INTO orders VALUES ('11052', 'HANAR', '3', '1996-05-27 00:00:00', '1996-06-24 00:00:00', '1996-05-31 00:00:00', '1', '67.2600', 'Hanari Carnes', 'Rua do Paço, 67', 'Rio de Janeiro', 'RJ', '05454-876', 'Brazil'); +INSERT INTO orders VALUES ('11053', 'PICCO', '2', '1996-05-27 00:00:00', '1996-06-24 00:00:00', '1996-05-29 00:00:00', '2', '53.0500', 'Piccolo und mehr', 'Geislweg 14', 'Salzburg', null, '5020', 'Austria'); +INSERT INTO orders VALUES ('11054', 'CACTU', '8', '1996-05-28 00:00:00', '1996-06-25 00:00:00', null, '1', '0.3300', 'Cactus Comidas para llevar', 'Cerrito 333', 'Buenos Aires', null, '1010', 'Argentina'); +INSERT INTO orders VALUES ('11055', 'HILAA', '7', '1996-05-28 00:00:00', '1996-06-25 00:00:00', '1996-06-04 00:00:00', '2', '120.9200', 'HILARIÓN-Abastos', 'Carrera 22 con Ave. Carlos Soublette #8-35', 'San Cristóbal', 'Táchira', '5022', 'Venezuela'); +INSERT INTO orders VALUES ('11056', 'EASTC', '8', '1996-05-28 00:00:00', '1996-06-11 00:00:00', '1996-05-31 00:00:00', '2', '278.9600', 'Eastern Connection', '35 King George', 'London', null, 'WX3 6FW', 'UK'); +INSERT INTO orders VALUES ('11057', 'NORTS', '3', '1996-05-29 00:00:00', '1996-06-26 00:00:00', '1996-05-31 00:00:00', '3', '4.1300', 'North/South', 'South House\r\n300 Queensbridge', 'London', null, 'SW7 1RZ', 'UK'); +INSERT INTO orders VALUES ('11058', 'BLAUS', '9', '1996-05-29 00:00:00', '1996-06-26 00:00:00', null, '3', '31.1400', 'Blauer See Delikatessen', 'Forsterstr. 57', 'Mannheim', null, '68306', 'Germany'); +INSERT INTO orders VALUES ('11059', 'RICAR', '2', '1996-05-29 00:00:00', '1996-07-10 00:00:00', null, '2', '85.8000', 'Ricardo Adocicados', 'Av. Copacabana, 267', 'Rio de Janeiro', 'RJ', '02389-890', 'Brazil'); +INSERT INTO orders VALUES ('11060', 'FRANS', '2', '1996-05-30 00:00:00', '1996-06-27 00:00:00', '1996-06-03 00:00:00', '2', '10.9800', 'Franchi S.p.A.', 'Via Monte Bianco 34', 'Torino', null, '10100', 'Italy'); +INSERT INTO orders VALUES ('11061', 'GREAL', '4', '1996-05-30 00:00:00', '1996-07-11 00:00:00', null, '3', '14.0100', 'Great Lakes Food Market', '2732 Baker Blvd.', 'Eugene', 'OR', '97403', 'USA'); +INSERT INTO orders VALUES ('11062', 'REGGC', '4', '1996-05-30 00:00:00', '1996-06-27 00:00:00', null, '2', '29.9300', 'Reggiani Caseifici', 'Strada Provinciale 124', 'Reggio Emilia', null, '42100', 'Italy'); +INSERT INTO orders VALUES ('11063', 'HUNGO', '3', '1996-05-30 00:00:00', '1996-06-27 00:00:00', '1996-06-05 00:00:00', '2', '81.7300', 'Hungry Owl All-Night Grocers', '8 Johnstown Road', 'Cork', 'Co. Cork', null, 'Ireland'); +INSERT INTO orders VALUES ('11064', 'SAVEA', '1', '1996-05-31 00:00:00', '1996-06-28 00:00:00', '1996-06-03 00:00:00', '1', '30.0900', 'Save-a-lot Markets', '187 Suffolk Ln.', 'Boise', 'ID', '83720', 'USA'); +INSERT INTO orders VALUES ('11065', 'LILAS', '8', '1996-05-31 00:00:00', '1996-06-28 00:00:00', null, '1', '12.9100', 'LILA-Supermercado', 'Carrera 52 con Ave. Bolívar #65-98 Llano Largo', 'Barquisimeto', 'Lara', '3508', 'Venezuela'); +INSERT INTO orders VALUES ('11066', 'WHITC', '7', '1996-05-31 00:00:00', '1996-06-28 00:00:00', '1996-06-03 00:00:00', '2', '44.7200', 'White Clover Markets', '1029 - 12th Ave. S.', 'Seattle', 'WA', '98124', 'USA'); +INSERT INTO orders VALUES ('11067', 'DRACD', '1', '1996-06-03 00:00:00', '1996-06-17 00:00:00', '1996-06-05 00:00:00', '2', '7.9800', 'Drachenblut Delikatessen', 'Walserweg 21', 'Aachen', null, '52066', 'Germany'); +INSERT INTO orders VALUES ('11068', 'QUEEN', '8', '1996-06-03 00:00:00', '1996-07-01 00:00:00', null, '2', '81.7500', 'Queen Cozinha', 'Alameda dos Canàrios, 891', 'São Paulo', 'SP', '05487-020', 'Brazil'); +INSERT INTO orders VALUES ('11069', 'TORTU', '1', '1996-06-03 00:00:00', '1996-07-01 00:00:00', '1996-06-05 00:00:00', '2', '15.6700', 'Tortuga Restaurante', 'Avda. Azteca 123', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('11070', 'LEHMS', '2', '1996-06-04 00:00:00', '1996-07-02 00:00:00', null, '1', '136.0000', 'Lehmanns Marktstand', 'Magazinweg 7', 'Frankfurt a.M. ', null, '60528', 'Germany'); +INSERT INTO orders VALUES ('11071', 'LILAS', '1', '1996-06-04 00:00:00', '1996-07-02 00:00:00', null, '1', '0.9300', 'LILA-Supermercado', 'Carrera 52 con Ave. Bolívar #65-98 Llano Largo', 'Barquisimeto', 'Lara', '3508', 'Venezuela'); +INSERT INTO orders VALUES ('11072', 'ERNSH', '4', '1996-06-04 00:00:00', '1996-07-02 00:00:00', null, '2', '258.6400', 'Ernst Handel', 'Kirchgasse 6', 'Graz', null, '8010', 'Austria'); +INSERT INTO orders VALUES ('11073', 'PERIC', '2', '1996-06-04 00:00:00', '1996-07-02 00:00:00', null, '2', '24.9500', 'Pericles Comidas clásicas', 'Calle Dr. Jorge Cash 321', 'México D.F.', null, '05033', 'Mexico'); +INSERT INTO orders VALUES ('11074', 'SIMOB', '7', '1996-06-05 00:00:00', '1996-07-03 00:00:00', null, '2', '18.4400', 'Simons bistro', 'Vinbæltet 34', 'København', null, '1734', 'Denmark'); +INSERT INTO orders VALUES ('11075', 'RICSU', '8', '1996-06-05 00:00:00', '1996-07-03 00:00:00', null, '2', '6.1900', 'Richter Supermarkt', 'Starenweg 5', 'Genève', null, '1204', 'Switzerland'); +INSERT INTO orders VALUES ('11076', 'BONAP', '4', '1996-06-05 00:00:00', '1996-07-03 00:00:00', null, '2', '38.2800', 'Bon app\'', '12, rue des Bouchers', 'Marseille', null, '13008', 'France'); +INSERT INTO orders VALUES ('11077', 'RATTC', '1', '1996-06-05 00:00:00', '1996-07-03 00:00:00', null, '2', '8.5300', 'Rattlesnake Canyon Grocery', '2817 Milton Dr.', 'Albuquerque', 'NM', '87110', 'USA'); + +-- ---------------------------- +-- Table structure for `products` +-- ---------------------------- +DROP TABLE IF EXISTS `products`; +CREATE TABLE `products` ( + `ProductID` int(11) NOT NULL AUTO_INCREMENT, + `ProductName` varchar(40) NOT NULL, + `SupplierID` int(11) DEFAULT NULL, + `CategoryID` int(11) DEFAULT NULL, + `QuantityPerUnit` varchar(20) DEFAULT NULL, + `UnitPrice` decimal(19,4) DEFAULT '0.0000', + `UnitsInStock` int(11) DEFAULT '0', + `UnitsOnOrder` int(11) DEFAULT '0', + `ReorderLevel` int(11) DEFAULT '0', + `Discontinued` tinyint(1) DEFAULT '0', + PRIMARY KEY (`ProductID`), + KEY `CategoryID` (`CategoryID`), + KEY `ProductName` (`ProductName`), + KEY `SupplierID` (`SupplierID`) +) ENGINE=MyISAM AUTO_INCREMENT=78 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of products +-- ---------------------------- +INSERT INTO products VALUES ('1', 'Chai', '1', '1', '10 boxes x 20 bags', '18.0000', '39', '0', '10', '0'); +INSERT INTO products VALUES ('2', 'Chang', '1', '1', '24 - 12 oz bottles', '19.0000', '17', '40', '25', '0'); +INSERT INTO products VALUES ('3', 'Aniseed Syrup', '1', '2', '12 - 550 ml bottles', '10.0000', '13', '70', '25', '0'); +INSERT INTO products VALUES ('4', 'Chef Anton\'s Cajun Seasoning', '2', '2', '48 - 6 oz jars', '22.0000', '53', '0', '0', '0'); +INSERT INTO products VALUES ('5', 'Chef Anton\'s Gumbo Mix', '2', '2', '36 boxes', '21.3500', '0', '0', '0', '1'); +INSERT INTO products VALUES ('6', 'Grandma\'s Boysenberry Spread', '3', '2', '12 - 8 oz jars', '25.0000', '120', '0', '25', '0'); +INSERT INTO products VALUES ('7', 'Uncle Bob\'s Organic Dried Pears', '3', '7', '12 - 1 lb pkgs.', '30.0000', '15', '0', '10', '0'); +INSERT INTO products VALUES ('8', 'Northwoods Cranberry Sauce', '3', '2', '12 - 12 oz jars', '40.0000', '6', '0', '0', '0'); +INSERT INTO products VALUES ('9', 'Mishi Kobe Niku', '4', '6', '18 - 500 g pkgs.', '97.0000', '29', '0', '0', '1'); +INSERT INTO products VALUES ('10', 'Ikura', '4', '8', '12 - 200 ml jars', '31.0000', '31', '0', '0', '0'); +INSERT INTO products VALUES ('11', 'Queso Cabrales', '5', '4', '1 kg pkg.', '21.0000', '22', '30', '30', '0'); +INSERT INTO products VALUES ('12', 'Queso Manchego La Pastora', '5', '4', '10 - 500 g pkgs.', '38.0000', '86', '0', '0', '0'); +INSERT INTO products VALUES ('13', 'Konbu', '6', '8', '2 kg box', '6.0000', '24', '0', '5', '0'); +INSERT INTO products VALUES ('14', 'Tofu', '6', '7', '40 - 100 g pkgs.', '23.2500', '35', '0', '0', '0'); +INSERT INTO products VALUES ('15', 'Genen Shouyu', '6', '2', '24 - 250 ml bottles', '15.5000', '39', '0', '5', '0'); +INSERT INTO products VALUES ('16', 'Pavlova', '7', '3', '32 - 500 g boxes', '17.4500', '29', '0', '10', '0'); +INSERT INTO products VALUES ('17', 'Alice Mutton', '7', '6', '20 - 1 kg tins', '39.0000', '0', '0', '0', '1'); +INSERT INTO products VALUES ('18', 'Carnarvon Tigers', '7', '8', '16 kg pkg.', '62.5000', '42', '0', '0', '0'); +INSERT INTO products VALUES ('19', 'Teatime Chocolate Biscuits', '8', '3', '10 boxes x 12 pieces', '9.2000', '25', '0', '5', '0'); +INSERT INTO products VALUES ('20', 'Sir Rodney\'s Marmalade', '8', '3', '30 gift boxes', '81.0000', '40', '0', '0', '0'); +INSERT INTO products VALUES ('21', 'Sir Rodney\'s Scones', '8', '3', '24 pkgs. x 4 pieces', '10.0000', '3', '40', '5', '0'); +INSERT INTO products VALUES ('22', 'Gustaf\'s Knäckebröd', '9', '5', '24 - 500 g pkgs.', '21.0000', '104', '0', '25', '0'); +INSERT INTO products VALUES ('23', 'Tunnbröd', '9', '5', '12 - 250 g pkgs.', '9.0000', '61', '0', '25', '0'); +INSERT INTO products VALUES ('24', 'Guaraná Fantástica', '10', '1', '12 - 355 ml cans', '4.5000', '20', '0', '0', '1'); +INSERT INTO products VALUES ('25', 'NuNuCa Nuß-Nougat-Creme', '11', '3', '20 - 450 g glasses', '14.0000', '76', '0', '30', '0'); +INSERT INTO products VALUES ('26', 'Gumbär Gummibärchen', '11', '3', '100 - 250 g bags', '31.2300', '15', '0', '0', '0'); +INSERT INTO products VALUES ('27', 'Schoggi Schokolade', '11', '3', '100 - 100 g pieces', '43.9000', '49', '0', '30', '0'); +INSERT INTO products VALUES ('28', 'Rössle Sauerkraut', '12', '7', '25 - 825 g cans', '45.6000', '26', '0', '0', '1'); +INSERT INTO products VALUES ('29', 'Thüringer Rostbratwurst', '12', '6', '50 bags x 30 sausgs.', '123.7900', '0', '0', '0', '1'); +INSERT INTO products VALUES ('30', 'Nord-Ost Matjeshering', '13', '8', '10 - 200 g glasses', '25.8900', '10', '0', '15', '0'); +INSERT INTO products VALUES ('31', 'Gorgonzola Telino', '14', '4', '12 - 100 g pkgs', '12.5000', '0', '70', '20', '0'); +INSERT INTO products VALUES ('32', 'Mascarpone Fabioli', '14', '4', '24 - 200 g pkgs.', '32.0000', '9', '40', '25', '0'); +INSERT INTO products VALUES ('33', 'Geitost', '15', '4', '500 g', '2.5000', '112', '0', '20', '0'); +INSERT INTO products VALUES ('34', 'Sasquatch Ale', '16', '1', '24 - 12 oz bottles', '14.0000', '111', '0', '15', '0'); +INSERT INTO products VALUES ('35', 'Steeleye Stout', '16', '1', '24 - 12 oz bottles', '18.0000', '20', '0', '15', '0'); +INSERT INTO products VALUES ('36', 'Inlagd Sill', '17', '8', '24 - 250 g jars', '19.0000', '112', '0', '20', '0'); +INSERT INTO products VALUES ('37', 'Gravad lax', '17', '8', '12 - 500 g pkgs.', '26.0000', '11', '50', '25', '0'); +INSERT INTO products VALUES ('38', 'Côte de Blaye', '18', '1', '12 - 75 cl bottles', '263.5000', '17', '0', '15', '0'); +INSERT INTO products VALUES ('39', 'Chartreuse verte', '18', '1', '750 cc per bottle', '18.0000', '69', '0', '5', '0'); +INSERT INTO products VALUES ('40', 'Boston Crab Meat', '19', '8', '24 - 4 oz tins', '18.4000', '123', '0', '30', '0'); +INSERT INTO products VALUES ('41', 'Jack\'s New England Clam Chowder', '19', '8', '12 - 12 oz cans', '9.6500', '85', '0', '10', '0'); +INSERT INTO products VALUES ('42', 'Singaporean Hokkien Fried Mee', '20', '5', '32 - 1 kg pkgs.', '14.0000', '26', '0', '0', '1'); +INSERT INTO products VALUES ('43', 'Ipoh Coffee', '20', '1', '16 - 500 g tins', '46.0000', '17', '10', '25', '0'); +INSERT INTO products VALUES ('44', 'Gula Malacca', '20', '2', '20 - 2 kg bags', '19.4500', '27', '0', '15', '0'); +INSERT INTO products VALUES ('45', 'Røgede sild', '21', '8', '1k pkg.', '9.5000', '5', '70', '15', '0'); +INSERT INTO products VALUES ('46', 'Spegesild', '21', '8', '4 - 450 g glasses', '12.0000', '95', '0', '0', '0'); +INSERT INTO products VALUES ('47', 'Zaanse koeken', '22', '3', '10 - 4 oz boxes', '9.5000', '36', '0', '0', '0'); +INSERT INTO products VALUES ('48', 'Chocolade', '22', '3', '10 pkgs.', '12.7500', '15', '70', '25', '0'); +INSERT INTO products VALUES ('49', 'Maxilaku', '23', '3', '24 - 50 g pkgs.', '20.0000', '10', '60', '15', '0'); +INSERT INTO products VALUES ('50', 'Valkoinen suklaa', '23', '3', '12 - 100 g bars', '16.2500', '65', '0', '30', '0'); +INSERT INTO products VALUES ('51', 'Manjimup Dried Apples', '24', '7', '50 - 300 g pkgs.', '53.0000', '20', '0', '10', '0'); +INSERT INTO products VALUES ('52', 'Filo Mix', '24', '5', '16 - 2 kg boxes', '7.0000', '38', '0', '25', '0'); +INSERT INTO products VALUES ('53', 'Perth Pasties', '24', '6', '48 pieces', '32.8000', '0', '0', '0', '1'); +INSERT INTO products VALUES ('54', 'Tourtière', '25', '6', '16 pies', '7.4500', '21', '0', '10', '0'); +INSERT INTO products VALUES ('55', 'Pâté chinois', '25', '6', '24 boxes x 2 pies', '24.0000', '115', '0', '20', '0'); +INSERT INTO products VALUES ('56', 'Gnocchi di nonna Alice', '26', '5', '24 - 250 g pkgs.', '38.0000', '21', '10', '30', '0'); +INSERT INTO products VALUES ('57', 'Ravioli Angelo', '26', '5', '24 - 250 g pkgs.', '19.5000', '36', '0', '20', '0'); +INSERT INTO products VALUES ('58', 'Escargots de Bourgogne', '27', '8', '24 pieces', '13.2500', '62', '0', '20', '0'); +INSERT INTO products VALUES ('59', 'Raclette Courdavault', '28', '4', '5 kg pkg.', '55.0000', '79', '0', '0', '0'); +INSERT INTO products VALUES ('60', 'Camembert Pierrot', '28', '4', '15 - 300 g rounds', '34.0000', '19', '0', '0', '0'); +INSERT INTO products VALUES ('61', 'Sirop d\'érable', '29', '2', '24 - 500 ml bottles', '28.5000', '113', '0', '25', '0'); +INSERT INTO products VALUES ('62', 'Tarte au sucre', '29', '3', '48 pies', '49.3000', '17', '0', '0', '0'); +INSERT INTO products VALUES ('63', 'Vegie-spread', '7', '2', '15 - 625 g jars', '43.9000', '24', '0', '5', '0'); +INSERT INTO products VALUES ('64', 'Wimmers gute Semmelknödel', '12', '5', '20 bags x 4 pieces', '33.2500', '22', '80', '30', '0'); +INSERT INTO products VALUES ('65', 'Louisiana Fiery Hot Pepper Sauce', '2', '2', '32 - 8 oz bottles', '21.0500', '76', '0', '0', '0'); +INSERT INTO products VALUES ('66', 'Louisiana Hot Spiced Okra', '2', '2', '24 - 8 oz jars', '17.0000', '4', '100', '20', '0'); +INSERT INTO products VALUES ('67', 'Laughing Lumberjack Lager', '16', '1', '24 - 12 oz bottles', '14.0000', '52', '0', '10', '0'); +INSERT INTO products VALUES ('68', 'Scottish Longbreads', '8', '3', '10 boxes x 8 pieces', '12.5000', '6', '10', '15', '0'); +INSERT INTO products VALUES ('69', 'Gudbrandsdalsost', '15', '4', '10 kg pkg.', '36.0000', '26', '0', '15', '0'); +INSERT INTO products VALUES ('70', 'Outback Lager', '7', '1', '24 - 355 ml bottles', '15.0000', '15', '10', '30', '0'); +INSERT INTO products VALUES ('71', 'Fløtemysost', '15', '4', '10 - 500 g pkgs.', '21.5000', '26', '0', '0', '0'); +INSERT INTO products VALUES ('72', 'Mozzarella di Giovanni', '14', '4', '24 - 200 g pkgs.', '34.8000', '14', '0', '0', '0'); +INSERT INTO products VALUES ('73', 'Röd Kaviar', '17', '8', '24 - 150 g jars', '15.0000', '101', '0', '5', '0'); +INSERT INTO products VALUES ('74', 'Longlife Tofu', '4', '7', '5 kg pkg.', '10.0000', '4', '20', '5', '0'); +INSERT INTO products VALUES ('75', 'Rhönbräu Klosterbier', '12', '1', '24 - 0.5 l bottles', '7.7500', '125', '0', '25', '0'); +INSERT INTO products VALUES ('76', 'Lakkalikööri', '23', '1', '500 ml', '18.0000', '57', '0', '20', '0'); +INSERT INTO products VALUES ('77', 'Original Frankfurter grüne Soße', '12', '2', '12 boxes', '13.0000', '32', '0', '15', '0'); + +-- ---------------------------- +-- Table structure for `shippers` +-- ---------------------------- +DROP TABLE IF EXISTS `shippers`; +CREATE TABLE `shippers` ( + `ShipperID` int(11) NOT NULL AUTO_INCREMENT, + `CompanyName` varchar(40) NOT NULL, + `Phone` varchar(24) DEFAULT NULL, + PRIMARY KEY (`ShipperID`) +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of shippers +-- ---------------------------- +INSERT INTO shippers VALUES ('1', 'Speedy Express', '(503) 555-9831'); +INSERT INTO shippers VALUES ('2', 'United Package', '(503) 555-3199'); +INSERT INTO shippers VALUES ('3', 'Federal Shipping', '(503) 555-9931'); + +-- ---------------------------- +-- Table structure for `suppliers` +-- ---------------------------- +DROP TABLE IF EXISTS `suppliers`; +CREATE TABLE `suppliers` ( + `SupplierID` int(11) NOT NULL AUTO_INCREMENT, + `CompanyName` varchar(40) NOT NULL, + `ContactName` varchar(30) DEFAULT NULL, + `ContactTitle` varchar(30) DEFAULT NULL, + `Address` varchar(60) DEFAULT NULL, + `City` varchar(15) DEFAULT NULL, + `Region` varchar(15) DEFAULT NULL, + `PostalCode` varchar(10) DEFAULT NULL, + `Country` varchar(15) DEFAULT NULL, + `Phone` varchar(24) DEFAULT NULL, + `Fax` varchar(24) DEFAULT NULL, + `HomePage` longtext, + PRIMARY KEY (`SupplierID`), + KEY `CompanyName` (`CompanyName`), + KEY `PostalCode` (`PostalCode`) +) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of suppliers +-- ---------------------------- +INSERT INTO suppliers VALUES ('1', 'Exotic Liquids', 'Charlotte Cooper', 'Purchasing Manager', '49 Gilbert St.', 'London', null, 'EC1 4SD', 'UK', '(171) 555-2222', null, null); +INSERT INTO suppliers VALUES ('2', 'New Orleans Cajun Delights', 'Shelley Burke', 'Order Administrator', 'P.O. Box 78934', 'New Orleans', 'LA', '70117', 'USA', '(100) 555-4822', null, '#CAJUN.HTM#'); +INSERT INTO suppliers VALUES ('3', 'Grandma Kelly\'s Homestead', 'Regina Murphy', 'Sales Representative', '707 Oxford Rd.', 'Ann Arbor', 'MI', '48104', 'USA', '(313) 555-5735', '(313) 555-3349', null); +INSERT INTO suppliers VALUES ('4', 'Tokyo Traders', 'Yoshi Nagase', 'Marketing Manager', '9-8 Sekimai\r\nMusashino-shi', 'Tokyo', null, '100', 'Japan', '(03) 3555-5011', null, null); +INSERT INTO suppliers VALUES ('5', 'Cooperativa de Quesos \'Las Cabras\'', 'Antonio del Valle Saavedra ', 'Export Administrator', 'Calle del Rosal 4', 'Oviedo', 'Asturias', '33007', 'Spain', '(98) 598 76 54', null, null); +INSERT INTO suppliers VALUES ('6', 'Mayumi\'s', 'Mayumi Ohno', 'Marketing Representative', '92 Setsuko\r\nChuo-ku', 'Osaka', null, '545', 'Japan', '(06) 431-7877', null, 'Mayumi\'s (on the World Wide Web)#http://www.microsoft.com/accessdev/sampleapps/mayumi.htm#'); +INSERT INTO suppliers VALUES ('7', 'Pavlova, Ltd.', 'Ian Devling', 'Marketing Manager', '74 Rose St.\r\nMoonie Ponds', 'Melbourne', 'Victoria', '3058', 'Australia', '(03) 444-2343', '(03) 444-6588', null); +INSERT INTO suppliers VALUES ('8', 'Specialty Biscuits, Ltd.', 'Peter Wilson', 'Sales Representative', '29 King\'s Way', 'Manchester', null, 'M14 GSD', 'UK', '(161) 555-4448', null, null); +INSERT INTO suppliers VALUES ('9', 'PB Knäckebröd AB', 'Lars Peterson', 'Sales Agent', 'Kaloadagatan 13', 'Göteborg', null, 'S-345 67', 'Sweden ', '031-987 65 43', '031-987 65 91', null); +INSERT INTO suppliers VALUES ('10', 'Refrescos Americanas LTDA', 'Carlos Diaz', 'Marketing Manager', 'Av. das Americanas 12.890', 'São Paulo', null, '5442', 'Brazil', '(11) 555 4640', null, null); +INSERT INTO suppliers VALUES ('11', 'Heli Süßwaren GmbH & Co. KG', 'Petra Winkler', 'Sales Manager', 'Tiergartenstraße 5', 'Berlin', null, '10785', 'Germany', '(010) 9984510', null, null); +INSERT INTO suppliers VALUES ('12', 'Plutzer Lebensmittelgroßmärkte AG', 'Martin Bein', 'International Marketing Mgr.', 'Bogenallee 51', 'Frankfurt', null, '60439', 'Germany', '(069) 992755', null, 'Plutzer (on the World Wide Web)#http://www.microsoft.com/accessdev/sampleapps/plutzer.htm#'); +INSERT INTO suppliers VALUES ('13', 'Nord-Ost-Fisch Handelsgesellschaft mbH', 'Sven Petersen', 'Coordinator Foreign Markets', 'Frahmredder 112a', 'Cuxhaven', null, '27478', 'Germany', '(04721) 8713', '(04721) 8714', null); +INSERT INTO suppliers VALUES ('14', 'Formaggi Fortini s.r.l.', 'Elio Rossi', 'Sales Representative', 'Viale Dante, 75', 'Ravenna', null, '48100', 'Italy', '(0544) 60323', '(0544) 60603', '#FORMAGGI.HTM#'); +INSERT INTO suppliers VALUES ('15', 'Norske Meierier', 'Beate Vileid', 'Marketing Manager', 'Hatlevegen 5', 'Sandvika', null, '1320', 'Norway', '(0)2-953010', null, null); +INSERT INTO suppliers VALUES ('16', 'Bigfoot Breweries', 'Cheryl Saylor', 'Regional Account Rep.', '3400 - 8th Avenue\r\nSuite 210', 'Bend', 'OR', '97101', 'USA', '(503) 555-9931', null, null); +INSERT INTO suppliers VALUES ('17', 'Svensk Sjöföda AB', 'Michael Björn', 'Sales Representative', 'Brovallavägen 231', 'Stockholm', null, 'S-123 45', 'Sweden', '08-123 45 67', null, null); +INSERT INTO suppliers VALUES ('18', 'Aux joyeux ecclésiastiques', 'Guylène Nodier', 'Sales Manager', '203, Rue des Francs-Bourgeois', 'Paris', null, '75004', 'France', '(1) 03.83.00.68', '(1) 03.83.00.62', null); +INSERT INTO suppliers VALUES ('19', 'New England Seafood Cannery', 'Robb Merchant', 'Wholesale Account Agent', 'Order Processing Dept.\r\n2100 Paul Revere Blvd.', 'Boston', 'MA', '02134', 'USA', '(617) 555-3267', '(617) 555-3389', null); +INSERT INTO suppliers VALUES ('20', 'Leka Trading', 'Chandra Leka', 'Owner', '471 Serangoon Loop, Suite #402', 'Singapore', null, '0512', 'Singapore', '555-8787', null, null); +INSERT INTO suppliers VALUES ('21', 'Lyngbysild', 'Niels Petersen', 'Sales Manager', 'Lyngbysild\r\nFiskebakken 10', 'Lyngby', null, '2800', 'Denmark', '43844108', '43844115', null); +INSERT INTO suppliers VALUES ('22', 'Zaanse Snoepfabriek', 'Dirk Luchte', 'Accounting Manager', 'Verkoop\r\nRijnweg 22', 'Zaandam', null, '9999 ZZ', 'Netherlands', '(12345) 1212', '(12345) 1210', null); +INSERT INTO suppliers VALUES ('23', 'Karkki Oy', 'Anne Heikkonen', 'Product Manager', 'Valtakatu 12', 'Lappeenranta', null, '53120', 'Finland', '(953) 10956', null, null); +INSERT INTO suppliers VALUES ('24', 'G\'day, Mate', 'Wendy Mackenzie', 'Sales Representative', '170 Prince Edward Parade\r\nHunter\'s Hill', 'Sydney', 'NSW', '2042', 'Australia', '(02) 555-5914', '(02) 555-4873', 'G\'day Mate (on the World Wide Web)#http://www.microsoft.com/accessdev/sampleapps/gdaymate.htm#'); +INSERT INTO suppliers VALUES ('25', 'Ma Maison', 'Jean-Guy Lauzon', 'Marketing Manager', '2960 Rue St. Laurent', 'Montréal', 'Québec', 'H1J 1C3', 'Canada', '(514) 555-9022', null, null); +INSERT INTO suppliers VALUES ('26', 'Pasta Buttini s.r.l.', 'Giovanni Giudici', 'Order Administrator', 'Via dei Gelsomini, 153', 'Salerno', null, '84100', 'Italy', '(089) 6547665', '(089) 6547667', null); +INSERT INTO suppliers VALUES ('27', 'Escargots Nouveaux', 'Marie Delamare', 'Sales Manager', '22, rue H. Voiron', 'Montceau', null, '71300', 'France', '85.57.00.07', null, null); +INSERT INTO suppliers VALUES ('28', 'Gai pâturage', 'Eliane Noz', 'Sales Representative', 'Bat. B\r\n3, rue des Alpes', 'Annecy', null, '74000', 'France', '38.76.98.06', '38.76.98.58', null); +INSERT INTO suppliers VALUES ('29', 'Forêts d\'érables', 'Chantal Goulet', 'Accounting Manager', '148 rue Chasseur', 'Ste-Hyacinthe', 'Québec', 'J2S 7S8', 'Canada', '(514) 555-2955', '(514) 555-2921', null); diff --git a/INFO-1273 (Databases 1)/Project/project_ip.sql b/INFO-1273 (Databases 1)/Project/project_ip.sql new file mode 100644 index 0000000..d85dfc5 --- /dev/null +++ b/INFO-1273 (Databases 1)/Project/project_ip.sql @@ -0,0 +1,125 @@ +/* +Create and use database Rebu +*/ +CREATE DATABASE IF NOT EXISTS Rebu; +USE Rebu; + +/* +Create table for drivers +*/ +DROP TABLE IF EXISTS drivers; +CREATE TABLE IF NOT EXISTS drivers( + driver_id INT NOT NULL PRIMARY KEY, + salutation VARCHAR(3) NOT NULL, + fname VARCHAR(30) NOT NULL, + lname VARCHAR(30) NOT NULL, + `address` VARCHAR(100) NOT NULL, + phone VARCHAR(20) NOT NULL UNIQUE, + email VARCHAR(100) NOT NULL UNIQUE, + insurance_provider VARCHAR(30) NOT NULL, + policy_number VARCHAR(15) NOT NULL UNIQUE, + speeding_tickers INT, + accidents INT +); + +/* +Create table for vehicles, in case a driver has two or more +*/ +DROP TABLE IF EXISTS vehicles; +CREATE TABLE IF NOT EXISTS vehicles( + vehicle_id INT NOT NULL PRIMARY KEY, + driver_id INT NOT NULL, + vehicle_make VARCHAR(30) NOT NULL, + vehicle_model VARCHAR(30) NOT NULL, + vehicle_year VARCHAR(4) NOT NULL, + license_plate VARCHAR(7) NOT NULL, + FOREIGN KEY (driver_id) REFERENCES drivers(driver_id) +); + +/* +Create table for payment cards, in case rider has multiple +*/ +DROP TABLE IF EXISTS cards; +CREATE TABLE IF NOT EXISTS cards( + card_id INT NOT NULL PRIMARY KEY, + rider_id INT NOT NULL, + card_number VARCHAR(12) NOT NULL, + card_name VARCHAR(100) NOT NULL, + card_expiry VARCHAR(12) NOT NULL, + FOREIGN KEY (rider_id) REFERENCES riders(rider_id) +); + +/* +Create table for riders +*/ +DROP TABLE IF EXISTS riders; +CREATE TABLE IF NOT EXISTS riders( + rider_id INT NOT NULL PRIMARY KEY, + `address` VARCHAR(100) NOT NULL, + phone VARCHAR(20) NOT NULL UNIQUE +); + +/* +Create table for the actual ride information +*/ +DROP TABLE IF EXISTS rides; +CREATE TABLE IF NOT EXISTS rides( + ride_id INT NOT NULL PRIMARY KEY, + pickup_location VARCHAR(100) NOT NULL, + pickup_date DATE NOT NULL, + pickup_time TIME NOT NULL, + dropoff_location VARCHAR(100) NOT NULL, + base_cost DECIMAL(5,2) NOT NULL, + hst DECIMAL(5,2) GENERATED ALWAYS AS (ROUND(base_cost * 0.13,2)) STORED, + total_cost DECIMAL(5,2) GENERATED ALWAYS AS (ROUND(base_cost * 1.13,2)) STORED, + driver_id INT NOT NULL, + driver_satisfaction INT NOT NULL CHECK (driver_satisfaction BETWEEN 1 AND 5), + rider_id INT NOT NULL, + card_id INT NOT NULL, + FOREIGN KEY (driver_id) REFERENCES drivers(driver_id), + FOREIGN KEY (card_id) REFERENCES cards(card_id) +); + +/* +Some simple select and join statements for testing and demonstration purposes +*/ +INSERT INTO drivers VALUES +(1, 'Mr', 'John', 'Doe', '123 Main St', '111-111-1111', 'john@example.com', 'StateFarm', 'POL123', 1, 0), +(2, 'Ms', 'Jane', 'Smith', '456 Oak Ave', '222-222-2222', 'jane@example.com', 'Allianz', 'POL456', 0, 1), +(3, 'Mr', 'Mike', 'Brown', '789 Pine Rd', '333-333-3333', 'mike@example.com', 'Geico', 'POL789', 2, 2); + +INSERT INTO vehicles VALUES +(1, 1, 'Toyota', 'Camry', '2020', 'ABC1234'), +(2, 2, 'Honda', 'Civic', '2019', 'XYZ5678'), +(3, 3, 'Ford', 'Focus', '2018', 'LMN9101'); + +INSERT INTO riders VALUES +(1, '12 King St', '444-444-4444'), +(2, '34 Queen St', '555-555-5555'), +(3, '56 Prince St', '666-666-6666'); + +INSERT INTO cards VALUES +(1, 1, '123456789012', 'John Doe', '12/27'), +(2, 2, '234567890123', 'Jane Smith', '11/26'), +(3, 3, '345678901234', 'Mike Brown', '10/25'); + +INSERT INTO rides (ride_id, pickup_location, pickup_date, pickup_time, dropoff_location, base_cost, driver_id, driver_satisfaction, card_id, rider_id) VALUES +(1, 'Downtown', '2026-03-01', '08:00:00', 'Airport', 20.00, 1, 5, 1, 1), +(2, 'Mall', '2026-03-02', '09:30:00', 'University', 15.50, 2, 4, 2, 2), +(3, 'Station', '2026-03-03', '11:00:00', 'Hotel', 30.00, 3, 3, 3, 3); + +SELECT * FROM drivers; +SELECT * FROM vehicles; +SELECT * FROM riders; +SELECT * FROM cards; +SELECT * FROM rides; + +SELECT * FROM drivers +INNER JOIN vehicles ON drivers.driver_id = vehicles.driver_id; + +SELECT * FROM riders +INNER JOIN cards ON riders.rider_id = cards.rider_id; + +SELECT * FROM rides +INNER JOIN drivers ON rides.driver_id = drivers.driver_id +INNER JOIN riders ON rides.rider_id = riders.rider_id; \ No newline at end of file diff --git a/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Lab-8-l_mclean215318.pptx b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Lab-8-l_mclean215318.pptx new file mode 100644 index 0000000..3955f70 Binary files /dev/null and b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Lab-8-l_mclean215318.pptx differ diff --git a/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 1.png b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 1.png new file mode 100644 index 0000000..ae576bd Binary files /dev/null and b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 1.png differ diff --git a/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 2.png b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 2.png new file mode 100644 index 0000000..eb99e3f Binary files /dev/null and b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 2.png differ diff --git a/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 3.png b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 3.png new file mode 100644 index 0000000..201becd Binary files /dev/null and b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 3.png differ diff --git a/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 4.png b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 4.png new file mode 100644 index 0000000..49a725f Binary files /dev/null and b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 4.png differ diff --git a/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 5.png b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 5.png new file mode 100644 index 0000000..5505a0d Binary files /dev/null and b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 5.png differ diff --git a/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 6.png b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 6.png new file mode 100644 index 0000000..7c5bb06 Binary files /dev/null and b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 6.png differ diff --git a/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 7.png b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 7.png new file mode 100644 index 0000000..cbe89aa Binary files /dev/null and b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 7.png differ diff --git a/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 8.png b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 8.png new file mode 100644 index 0000000..8394888 Binary files /dev/null and b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 8.png differ diff --git a/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 9.png b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 9.png new file mode 100644 index 0000000..ffdfa98 Binary files /dev/null and b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/Screenshot 9.png differ diff --git a/INFO-3163 (CMS Web Dev)/Labs/Lab 8/post1.png b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/post1.png new file mode 100644 index 0000000..e2a21c9 Binary files /dev/null and b/INFO-3163 (CMS Web Dev)/Labs/Lab 8/post1.png differ diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5-l_mclean215318.zip b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5-l_mclean215318.zip new file mode 100644 index 0000000..dec3428 Binary files /dev/null and b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5-l_mclean215318.zip differ diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/config/db.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/config/db.js new file mode 100644 index 0000000..f1ad4ea --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/config/db.js @@ -0,0 +1,8 @@ +import mysql from "mysql2/promise"; +const pool = mysql.createPool({ + host: "localhost", + user: "root", + database: "customers_db" +}); + +export default pool; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/controllers/customerController.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/controllers/customerController.js new file mode 100644 index 0000000..ee9d55e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/controllers/customerController.js @@ -0,0 +1,54 @@ +import { + getCustomers, + addCustomer, + updateCustomer, + deleteCustomer +} from "../models/customerModel.js"; + +export const getAllCustomers = async (req, res) => { + try { + const data = await getCustomers(); + res.json(data); + } catch (error) { + res.status(500).json({ error: error.message }); + } +}; + +export const createCustomer = async (req, res) => { + try { + const { name, email, phone } = req.body; + + if (!name || !email || !phone) { + return res.status(400).json({ message: "Name, Email and Phone required" }); + } + + const result = await addCustomer({ name, email, phone }); + res.json({ message: "Customer added", result}); + } catch (error) { + res.status(500).json({ error: error.message }); + } +}; + +export const editCustomer = async (req, res) => { + try { + const id = req.params.id; + const { name, email, phone } = req.body; + + const result = await updateCustomer(id, { name, email, phone }); + res.json({ message: "Customer updated", result}); + } catch (error) { + res.status(500).json({ error: error.message }); + } +}; + +export const removeCustomer = async (req, res) => { + try { + const id = req.params.id; + const result = await deleteCustomer(id); + + res.json({ message: "Customer deleted", result }); + } catch (error) { + res.status(500).json({ error: error.message }); + } +} + diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/models/customerModel.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/models/customerModel.js new file mode 100644 index 0000000..7e22b66 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/models/customerModel.js @@ -0,0 +1,30 @@ +import db from "../config/db.js"; + +export const getCustomers = async (customer) => { + const [rows] = await db.query("SELECT * FROM customers"); + return rows; +}; + +export const addCustomer = async (customer) => { + const[result] = await db.query( + "INSERT INTO customers (name, email, phone) VALUES (?, ?, ?)", + [customer.name, customer.email, customer.phone] + ); + return result; +}; + +export const updateCustomer = async(id, customer) => { + const [result] = await db.query( + "UPDATE customers SET name = ?, email = ?, phone = ? WHERE customer_id = ?", + [customer.name, customer.email, customer.phone, id] + ); + return result; +}; + +export const deleteCustomer = async (id) => { + const[result] = await db.query( + "DELETE FROM customers WHERE customer_id = ?", + [id] + ); + return result; +}; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodemon b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodemon new file mode 100644 index 0000000..c477a18 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodemon @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../nodemon/bin/nodemon.js" "$@" +else + exec node "$basedir/../nodemon/bin/nodemon.js" "$@" +fi diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodemon.cmd b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodemon.cmd new file mode 100644 index 0000000..55acf8a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodemon.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nodemon\bin\nodemon.js" %* diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodemon.ps1 b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodemon.ps1 new file mode 100644 index 0000000..d4e3f5d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodemon.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../nodemon/bin/nodemon.js" $args + } else { + & "$basedir/node$exe" "$basedir/../nodemon/bin/nodemon.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../nodemon/bin/nodemon.js" $args + } else { + & "node$exe" "$basedir/../nodemon/bin/nodemon.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodetouch b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodetouch new file mode 100644 index 0000000..3e146b4 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodetouch @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../touch/bin/nodetouch.js" "$@" +else + exec node "$basedir/../touch/bin/nodetouch.js" "$@" +fi diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodetouch.cmd b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodetouch.cmd new file mode 100644 index 0000000..8298b91 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodetouch.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\touch\bin\nodetouch.js" %* diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodetouch.ps1 b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodetouch.ps1 new file mode 100644 index 0000000..5f68b4c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/nodetouch.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../touch/bin/nodetouch.js" $args + } else { + & "$basedir/node$exe" "$basedir/../touch/bin/nodetouch.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../touch/bin/nodetouch.js" $args + } else { + & "node$exe" "$basedir/../touch/bin/nodetouch.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/semver b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/semver new file mode 100644 index 0000000..97c5327 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/semver @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@" +else + exec node "$basedir/../semver/bin/semver.js" "$@" +fi diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/semver.cmd b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/semver.cmd new file mode 100644 index 0000000..9913fa9 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/semver.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver.js" %* diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/semver.ps1 b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/semver.ps1 new file mode 100644 index 0000000..314717a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.bin/semver.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.package-lock.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.package-lock.json new file mode 100644 index 0000000..6063383 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/.package-lock.json @@ -0,0 +1,1247 @@ +{ + "name": "lab5", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@types/node": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.5.0.tgz", + "integrity": "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==", + "license": "MIT", + "peer": true, + "dependencies": { + "undici-types": "~7.18.0" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/aws-ssl-profiles": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz", + "integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", + "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.1", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/brace-expansion": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", + "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/content-disposition": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", + "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "license": "MIT", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "license": "ISC" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==", + "license": "MIT" + }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0" + }, + "node_modules/lru.min": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.4.tgz", + "integrity": "sha512-DqC6n3QQ77zdFpCMASA1a3Jlb64Hv2N2DciFGkO/4L9+q/IpIAuRlKOvCXabtRW6cQf8usbmM6BE/TOPysCdIA==", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=1.30.0", + "node": ">=8.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/minimatch": { + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.5" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/mysql2": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.20.0.tgz", + "integrity": "sha512-eCLUs7BNbgA6nf/MZXsaBO1SfGs0LtLVrJD3WeWq+jPLDWkSufTD+aGMwykfUVPdZnblaUK1a8G/P63cl9FkKg==", + "license": "MIT", + "dependencies": { + "aws-ssl-profiles": "^1.1.2", + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.7.2", + "long": "^5.3.2", + "lru.min": "^1.1.4", + "named-placeholders": "^1.1.6", + "sql-escaper": "^1.3.3" + }, + "engines": { + "node": ">= 8.0" + }, + "peerDependencies": { + "@types/node": ">= 8" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.6.tgz", + "integrity": "sha512-Tz09sEL2EEuv5fFowm419c1+a/jSMiBjI9gHxVLrVdbUkkNUUfjsVYs9pVZu5oCon/kmRh9TfLEObFtkVxmY0w==", + "license": "MIT", + "dependencies": { + "lru.min": "^1.1.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nodemon": { + "version": "3.1.14", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.14.tgz", + "integrity": "sha512-jakjZi93UtB3jHMWsXL68FXSAosbLfY0In5gtKq3niLSkrWznrVBzXFNOEMJUfc9+Ke7SHWoAZsiMkNP3vq6Jw==", + "license": "MIT", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^10.2.1", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "license": "MIT" + }, + "node_modules/qs": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz", + "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sql-escaper": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/sql-escaper/-/sql-escaper-1.3.3.tgz", + "integrity": "sha512-BsTCV265VpTp8tm1wyIm1xqQCS+Q9NHx2Sr+WcnUrgLrQ6yiDIvHYJV5gHxsj1lMBy2zm5twLaZao8Jd+S8JJw==", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=2.0.0", + "node": ">=12.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/mysqljs/sql-escaper?sponsor=1" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "license": "ISC", + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "license": "MIT", + "peer": true + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + } + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/README.md new file mode 100644 index 0000000..6fd6ea8 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/node` + +# Summary +This package contains type definitions for node (https://nodejs.org/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. + +### Additional Details + * Last updated: Thu, 12 Mar 2026 15:47:58 GMT + * Dependencies: [undici-types](https://npmjs.com/package/undici-types) + +# Credits +These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky), [René](https://github.com/Renegade334), and [Yagiz Nizipli](https://github.com/anonrig). diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/assert.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/assert.d.ts new file mode 100644 index 0000000..9b7144e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/assert.d.ts @@ -0,0 +1,955 @@ +/** + * The `node:assert` module provides a set of assertion functions for verifying + * invariants. + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/assert.js) + */ +declare module "node:assert" { + import strict = require("node:assert/strict"); + /** + * An alias of {@link assert.ok}. + * @since v0.5.9 + * @param value The input that is checked for being truthy. + */ + function assert(value: unknown, message?: string | Error): asserts value; + const kOptions: unique symbol; + namespace assert { + type AssertMethodNames = + | "deepEqual" + | "deepStrictEqual" + | "doesNotMatch" + | "doesNotReject" + | "doesNotThrow" + | "equal" + | "fail" + | "ifError" + | "match" + | "notDeepEqual" + | "notDeepStrictEqual" + | "notEqual" + | "notStrictEqual" + | "ok" + | "partialDeepStrictEqual" + | "rejects" + | "strictEqual" + | "throws"; + interface AssertOptions { + /** + * If set to `'full'`, shows the full diff in assertion errors. + * @default 'simple' + */ + diff?: "simple" | "full" | undefined; + /** + * If set to `true`, non-strict methods behave like their + * corresponding strict methods. + * @default true + */ + strict?: boolean | undefined; + /** + * If set to `true`, skips prototype and constructor + * comparison in deep equality checks. + * @since v24.9.0 + * @default false + */ + skipPrototype?: boolean | undefined; + } + interface Assert extends Pick { + readonly [kOptions]: AssertOptions & { strict: false }; + } + interface AssertStrict extends Pick { + readonly [kOptions]: AssertOptions & { strict: true }; + } + /** + * The `Assert` class allows creating independent assertion instances with custom options. + * @since v24.6.0 + */ + var Assert: { + /** + * Creates a new assertion instance. The `diff` option controls the verbosity of diffs in assertion error messages. + * + * ```js + * const { Assert } = require('node:assert'); + * const assertInstance = new Assert({ diff: 'full' }); + * assertInstance.deepStrictEqual({ a: 1 }, { a: 2 }); + * // Shows a full diff in the error message. + * ``` + * + * **Important**: When destructuring assertion methods from an `Assert` instance, + * the methods lose their connection to the instance's configuration options (such + * as `diff`, `strict`, and `skipPrototype` settings). + * The destructured methods will fall back to default behavior instead. + * + * ```js + * const myAssert = new Assert({ diff: 'full' }); + * + * // This works as expected - uses 'full' diff + * myAssert.strictEqual({ a: 1 }, { b: { c: 1 } }); + * + * // This loses the 'full' diff setting - falls back to default 'simple' diff + * const { strictEqual } = myAssert; + * strictEqual({ a: 1 }, { b: { c: 1 } }); + * ``` + * + * The `skipPrototype` option affects all deep equality methods: + * + * ```js + * class Foo { + * constructor(a) { + * this.a = a; + * } + * } + * + * class Bar { + * constructor(a) { + * this.a = a; + * } + * } + * + * const foo = new Foo(1); + * const bar = new Bar(1); + * + * // Default behavior - fails due to different constructors + * const assert1 = new Assert(); + * assert1.deepStrictEqual(foo, bar); // AssertionError + * + * // Skip prototype comparison - passes if properties are equal + * const assert2 = new Assert({ skipPrototype: true }); + * assert2.deepStrictEqual(foo, bar); // OK + * ``` + * + * When destructured, methods lose access to the instance's `this` context and revert to default assertion behavior + * (diff: 'simple', non-strict mode). + * To maintain custom options when using destructured methods, avoid + * destructuring and call methods directly on the instance. + * @since v24.6.0 + */ + new( + options?: AssertOptions & { strict?: true | undefined }, + ): AssertStrict; + new( + options: AssertOptions, + ): Assert; + }; + interface AssertionErrorOptions { + /** + * If provided, the error message is set to this value. + */ + message?: string | undefined; + /** + * The `actual` property on the error instance. + */ + actual?: unknown; + /** + * The `expected` property on the error instance. + */ + expected?: unknown; + /** + * The `operator` property on the error instance. + */ + operator?: string | undefined; + /** + * If provided, the generated stack trace omits frames before this function. + */ + stackStartFn?: Function | undefined; + /** + * If set to `'full'`, shows the full diff in assertion errors. + * @default 'simple' + */ + diff?: "simple" | "full" | undefined; + } + /** + * Indicates the failure of an assertion. All errors thrown by the `node:assert` module will be instances of the `AssertionError` class. + */ + class AssertionError extends Error { + constructor(options: AssertionErrorOptions); + /** + * Set to the `actual` argument for methods such as {@link assert.strictEqual()}. + */ + actual: unknown; + /** + * Set to the `expected` argument for methods such as {@link assert.strictEqual()}. + */ + expected: unknown; + /** + * Indicates if the message was auto-generated (`true`) or not. + */ + generatedMessage: boolean; + /** + * Value is always `ERR_ASSERTION` to show that the error is an assertion error. + */ + code: "ERR_ASSERTION"; + /** + * Set to the passed in operator value. + */ + operator: string; + } + type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error; + /** + * Throws an `AssertionError` with the provided error message or a default + * error message. If the `message` parameter is an instance of an `Error` then + * it will be thrown instead of the `AssertionError`. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.fail(); + * // AssertionError [ERR_ASSERTION]: Failed + * + * assert.fail('boom'); + * // AssertionError [ERR_ASSERTION]: boom + * + * assert.fail(new TypeError('need array')); + * // TypeError: need array + * ``` + * @since v0.1.21 + * @param [message='Failed'] + */ + function fail(message?: string | Error): never; + /** + * Tests if `value` is truthy. It is equivalent to `assert.equal(!!value, true, message)`. + * + * If `value` is not truthy, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is `undefined`, a default + * error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown instead of the `AssertionError`. + * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. + * + * Be aware that in the `repl` the error message will be different to the one + * thrown in a file! See below for further details. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.ok(true); + * // OK + * assert.ok(1); + * // OK + * + * assert.ok(); + * // AssertionError: No value argument passed to `assert.ok()` + * + * assert.ok(false, 'it\'s false'); + * // AssertionError: it's false + * + * // In the repl: + * assert.ok(typeof 123 === 'string'); + * // AssertionError: false == true + * + * // In a file (e.g. test.js): + * assert.ok(typeof 123 === 'string'); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert.ok(typeof 123 === 'string') + * + * assert.ok(false); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert.ok(false) + * + * assert.ok(0); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert.ok(0) + * ``` + * + * ```js + * import assert from 'node:assert/strict'; + * + * // Using `assert()` works the same: + * assert(2 + 2 > 5);; + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert(2 + 2 > 5) + * ``` + * @since v0.1.21 + */ + function ok(value: unknown, message?: string | Error): asserts value; + /** + * **Strict assertion mode** + * + * An alias of {@link strictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link strictEqual} instead. + * + * Tests shallow, coercive equality between the `actual` and `expected` parameters + * using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled + * and treated as being identical if both sides are `NaN`. + * + * ```js + * import assert from 'node:assert'; + * + * assert.equal(1, 1); + * // OK, 1 == 1 + * assert.equal(1, '1'); + * // OK, 1 == '1' + * assert.equal(NaN, NaN); + * // OK + * + * assert.equal(1, 2); + * // AssertionError: 1 == 2 + * assert.equal({ a: { b: 1 } }, { a: { b: 1 } }); + * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } + * ``` + * + * If the values are not equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default + * error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown instead of the `AssertionError`. + * @since v0.1.21 + */ + function equal(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * **Strict assertion mode** + * + * An alias of {@link notStrictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. + * + * Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is + * specially handled and treated as being identical if both sides are `NaN`. + * + * ```js + * import assert from 'node:assert'; + * + * assert.notEqual(1, 2); + * // OK + * + * assert.notEqual(1, 1); + * // AssertionError: 1 != 1 + * + * assert.notEqual(1, '1'); + * // AssertionError: 1 != '1' + * ``` + * + * If the values are equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default error + * message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown instead of the `AssertionError`. + * @since v0.1.21 + */ + function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * **Strict assertion mode** + * + * An alias of {@link deepStrictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead. + * + * Tests for deep equality between the `actual` and `expected` parameters. Consider + * using {@link deepStrictEqual} instead. {@link deepEqual} can have + * surprising results. + * + * _Deep equality_ means that the enumerable "own" properties of child objects + * are also recursively evaluated by the following rules. + * @since v0.1.21 + */ + function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * **Strict assertion mode** + * + * An alias of {@link notDeepStrictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead. + * + * Tests for any deep inequality. Opposite of {@link deepEqual}. + * + * ```js + * import assert from 'node:assert'; + * + * const obj1 = { + * a: { + * b: 1, + * }, + * }; + * const obj2 = { + * a: { + * b: 2, + * }, + * }; + * const obj3 = { + * a: { + * b: 1, + * }, + * }; + * const obj4 = { __proto__: obj1 }; + * + * assert.notDeepEqual(obj1, obj1); + * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } + * + * assert.notDeepEqual(obj1, obj2); + * // OK + * + * assert.notDeepEqual(obj1, obj3); + * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } + * + * assert.notDeepEqual(obj1, obj4); + * // OK + * ``` + * + * If the values are deeply equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default + * error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v0.1.21 + */ + function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * Tests strict equality between the `actual` and `expected` parameters as + * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.strictEqual(1, 2); + * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: + * // + * // 1 !== 2 + * + * assert.strictEqual(1, 1); + * // OK + * + * assert.strictEqual('Hello foobar', 'Hello World!'); + * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: + * // + actual - expected + * // + * // + 'Hello foobar' + * // - 'Hello World!' + * // ^ + * + * const apples = 1; + * const oranges = 2; + * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`); + * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2 + * + * assert.strictEqual(1, '1', new TypeError('Inputs are not identical')); + * // TypeError: Inputs are not identical + * ``` + * + * If the values are not strictly equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a + * default error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v0.1.21 + */ + function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; + /** + * Tests strict inequality between the `actual` and `expected` parameters as + * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.notStrictEqual(1, 2); + * // OK + * + * assert.notStrictEqual(1, 1); + * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to: + * // + * // 1 + * + * assert.notStrictEqual(1, '1'); + * // OK + * ``` + * + * If the values are strictly equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a + * default error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v0.1.21 + */ + function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * Tests for deep equality between the `actual` and `expected` parameters. + * "Deep" equality means that the enumerable "own" properties of child objects + * are recursively evaluated also by the following rules. + * @since v1.2.0 + */ + function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; + /** + * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); + * // OK + * ``` + * + * If the values are deeply and strictly equal, an `AssertionError` is thrown + * with a `message` property set equal to the value of the `message` parameter. If + * the `message` parameter is undefined, a default error message is assigned. If + * the `message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v1.2.0 + */ + function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * Expects the function `fn` to throw an error. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, + * a validation object where each property will be tested for strict deep equality, + * or an instance of error where each property will be tested for strict deep + * equality including the non-enumerable `message` and `name` properties. When + * using an object, it is also possible to use a regular expression, when + * validating against a string property. See below for examples. + * + * If specified, `message` will be appended to the message provided by the `AssertionError` if the `fn` call fails to throw or in case the error validation + * fails. + * + * Custom validation object/error instance: + * + * ```js + * import assert from 'node:assert/strict'; + * + * const err = new TypeError('Wrong value'); + * err.code = 404; + * err.foo = 'bar'; + * err.info = { + * nested: true, + * baz: 'text', + * }; + * err.reg = /abc/i; + * + * assert.throws( + * () => { + * throw err; + * }, + * { + * name: 'TypeError', + * message: 'Wrong value', + * info: { + * nested: true, + * baz: 'text', + * }, + * // Only properties on the validation object will be tested for. + * // Using nested objects requires all properties to be present. Otherwise + * // the validation is going to fail. + * }, + * ); + * + * // Using regular expressions to validate error properties: + * assert.throws( + * () => { + * throw err; + * }, + * { + * // The `name` and `message` properties are strings and using regular + * // expressions on those will match against the string. If they fail, an + * // error is thrown. + * name: /^TypeError$/, + * message: /Wrong/, + * foo: 'bar', + * info: { + * nested: true, + * // It is not possible to use regular expressions for nested properties! + * baz: 'text', + * }, + * // The `reg` property contains a regular expression and only if the + * // validation object contains an identical regular expression, it is going + * // to pass. + * reg: /abc/i, + * }, + * ); + * + * // Fails due to the different `message` and `name` properties: + * assert.throws( + * () => { + * const otherErr = new Error('Not found'); + * // Copy all enumerable properties from `err` to `otherErr`. + * for (const [key, value] of Object.entries(err)) { + * otherErr[key] = value; + * } + * throw otherErr; + * }, + * // The error's `message` and `name` properties will also be checked when using + * // an error as validation object. + * err, + * ); + * ``` + * + * Validate instanceof using constructor: + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.throws( + * () => { + * throw new Error('Wrong value'); + * }, + * Error, + * ); + * ``` + * + * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions): + * + * Using a regular expression runs `.toString` on the error object, and will + * therefore also include the error name. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.throws( + * () => { + * throw new Error('Wrong value'); + * }, + * /^Error: Wrong value$/, + * ); + * ``` + * + * Custom error validation: + * + * The function must return `true` to indicate all internal validations passed. + * It will otherwise fail with an `AssertionError`. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.throws( + * () => { + * throw new Error('Wrong value'); + * }, + * (err) => { + * assert(err instanceof Error); + * assert(/value/.test(err)); + * // Avoid returning anything from validation functions besides `true`. + * // Otherwise, it's not clear what part of the validation failed. Instead, + * // throw an error about the specific validation that failed (as done in this + * // example) and add as much helpful debugging information to that error as + * // possible. + * return true; + * }, + * 'unexpected error', + * ); + * ``` + * + * `error` cannot be a string. If a string is provided as the second + * argument, then `error` is assumed to be omitted and the string will be used for `message` instead. This can lead to easy-to-miss mistakes. Using the same + * message as the thrown error message is going to result in an `ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using + * a string as the second argument gets considered: + * + * ```js + * import assert from 'node:assert/strict'; + * + * function throwingFirst() { + * throw new Error('First'); + * } + * + * function throwingSecond() { + * throw new Error('Second'); + * } + * + * function notThrowing() {} + * + * // The second argument is a string and the input function threw an Error. + * // The first case will not throw as it does not match for the error message + * // thrown by the input function! + * assert.throws(throwingFirst, 'Second'); + * // In the next example the message has no benefit over the message from the + * // error and since it is not clear if the user intended to actually match + * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error. + * assert.throws(throwingSecond, 'Second'); + * // TypeError [ERR_AMBIGUOUS_ARGUMENT] + * + * // The string is only used (as message) in case the function does not throw: + * assert.throws(notThrowing, 'Second'); + * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second + * + * // If it was intended to match for the error message do this instead: + * // It does not throw because the error messages match. + * assert.throws(throwingSecond, /Second$/); + * + * // If the error message does not match, an AssertionError is thrown. + * assert.throws(throwingFirst, /Second$/); + * // AssertionError [ERR_ASSERTION] + * ``` + * + * Due to the confusing error-prone notation, avoid a string as the second + * argument. + * @since v0.1.21 + */ + function throws(block: () => unknown, message?: string | Error): void; + function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void; + /** + * Asserts that the function `fn` does not throw an error. + * + * Using `assert.doesNotThrow()` is actually not useful because there + * is no benefit in catching an error and then rethrowing it. Instead, consider + * adding a comment next to the specific code path that should not throw and keep + * error messages as expressive as possible. + * + * When `assert.doesNotThrow()` is called, it will immediately call the `fn` function. + * + * If an error is thrown and it is the same type as that specified by the `error` parameter, then an `AssertionError` is thrown. If the error is of a + * different type, or if the `error` parameter is undefined, the error is + * propagated back to the caller. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation + * function. See {@link throws} for more details. + * + * The following, for instance, will throw the `TypeError` because there is no + * matching error type in the assertion: + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.doesNotThrow( + * () => { + * throw new TypeError('Wrong value'); + * }, + * SyntaxError, + * ); + * ``` + * + * However, the following will result in an `AssertionError` with the message + * 'Got unwanted exception...': + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.doesNotThrow( + * () => { + * throw new TypeError('Wrong value'); + * }, + * TypeError, + * ); + * ``` + * + * If an `AssertionError` is thrown and a value is provided for the `message` parameter, the value of `message` will be appended to the `AssertionError` message: + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.doesNotThrow( + * () => { + * throw new TypeError('Wrong value'); + * }, + * /Wrong value/, + * 'Whoops', + * ); + * // Throws: AssertionError: Got unwanted exception: Whoops + * ``` + * @since v0.1.21 + */ + function doesNotThrow(block: () => unknown, message?: string | Error): void; + function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void; + /** + * Throws `value` if `value` is not `undefined` or `null`. This is useful when + * testing the `error` argument in callbacks. The stack trace contains all frames + * from the error passed to `ifError()` including the potential new frames for `ifError()` itself. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.ifError(null); + * // OK + * assert.ifError(0); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0 + * assert.ifError('error'); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error' + * assert.ifError(new Error()); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error + * + * // Create some random error frames. + * let err; + * (function errorFrame() { + * err = new Error('test error'); + * })(); + * + * (function ifErrorFrame() { + * assert.ifError(err); + * })(); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error + * // at ifErrorFrame + * // at errorFrame + * ``` + * @since v0.1.97 + */ + function ifError(value: unknown): asserts value is null | undefined; + /** + * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately + * calls the function and awaits the returned promise to complete. It will then + * check that the promise is rejected. + * + * If `asyncFn` is a function and it throws an error synchronously, `assert.rejects()` will return a rejected `Promise` with that error. If the + * function does not return a promise, `assert.rejects()` will return a rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v25.x/api/errors.html#err_invalid_return_value) + * error. In both cases the error handler is skipped. + * + * Besides the async nature to await the completion behaves identically to {@link throws}. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, + * an object where each property will be tested for, or an instance of error where + * each property will be tested for including the non-enumerable `message` and `name` properties. + * + * If specified, `message` will be the message provided by the `{@link AssertionError}` if the `asyncFn` fails to reject. + * + * ```js + * import assert from 'node:assert/strict'; + * + * await assert.rejects( + * async () => { + * throw new TypeError('Wrong value'); + * }, + * { + * name: 'TypeError', + * message: 'Wrong value', + * }, + * ); + * ``` + * + * ```js + * import assert from 'node:assert/strict'; + * + * await assert.rejects( + * async () => { + * throw new TypeError('Wrong value'); + * }, + * (err) => { + * assert.strictEqual(err.name, 'TypeError'); + * assert.strictEqual(err.message, 'Wrong value'); + * return true; + * }, + * ); + * ``` + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.rejects( + * Promise.reject(new Error('Wrong value')), + * Error, + * ).then(() => { + * // ... + * }); + * ``` + * + * `error` cannot be a string. If a string is provided as the second argument, then `error` is assumed to + * be omitted and the string will be used for `message` instead. This can lead to easy-to-miss mistakes. Please read the + * example in {@link throws} carefully if using a string as the second argument gets considered. + * @since v10.0.0 + */ + function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; + function rejects( + block: (() => Promise) | Promise, + error: AssertPredicate, + message?: string | Error, + ): Promise; + /** + * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately + * calls the function and awaits the returned promise to complete. It will then + * check that the promise is not rejected. + * + * If `asyncFn` is a function and it throws an error synchronously, `assert.doesNotReject()` will return a rejected `Promise` with that error. If + * the function does not return a promise, `assert.doesNotReject()` will return a + * rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v25.x/api/errors.html#err_invalid_return_value) error. In both cases + * the error handler is skipped. + * + * Using `assert.doesNotReject()` is actually not useful because there is little + * benefit in catching a rejection and then rejecting it again. Instead, consider + * adding a comment next to the specific code path that should not reject and keep + * error messages as expressive as possible. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation + * function. See {@link throws} for more details. + * + * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. + * + * ```js + * import assert from 'node:assert/strict'; + * + * await assert.doesNotReject( + * async () => { + * throw new TypeError('Wrong value'); + * }, + * SyntaxError, + * ); + * ``` + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) + * .then(() => { + * // ... + * }); + * ``` + * @since v10.0.0 + */ + function doesNotReject( + block: (() => Promise) | Promise, + message?: string | Error, + ): Promise; + function doesNotReject( + block: (() => Promise) | Promise, + error: AssertPredicate, + message?: string | Error, + ): Promise; + /** + * Expects the `string` input to match the regular expression. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.match('I will fail', /pass/); + * // AssertionError [ERR_ASSERTION]: The input did not match the regular ... + * + * assert.match(123, /pass/); + * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. + * + * assert.match('I will pass', /pass/); + * // OK + * ``` + * + * If the values do not match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal + * to the value of the `message` parameter. If the `message` parameter is + * undefined, a default error message is assigned. If the `message` parameter is an + * instance of an [Error](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`. + * @since v13.6.0, v12.16.0 + */ + function match(value: string, regExp: RegExp, message?: string | Error): void; + /** + * Expects the `string` input not to match the regular expression. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.doesNotMatch('I will fail', /fail/); + * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... + * + * assert.doesNotMatch(123, /pass/); + * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. + * + * assert.doesNotMatch('I will pass', /different/); + * // OK + * ``` + * + * If the values do match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal + * to the value of the `message` parameter. If the `message` parameter is + * undefined, a default error message is assigned. If the `message` parameter is an + * instance of an [Error](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`. + * @since v13.6.0, v12.16.0 + */ + function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; + /** + * Tests for partial deep equality between the `actual` and `expected` parameters. + * "Deep" equality means that the enumerable "own" properties of child objects + * are recursively evaluated also by the following rules. "Partial" equality means + * that only properties that exist on the `expected` parameter are going to be + * compared. + * + * This method always passes the same test cases as `assert.deepStrictEqual()`, + * behaving as a super set of it. + * @since v22.13.0 + */ + function partialDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; + } + namespace assert { + export { strict }; + } + export = assert; +} +declare module "assert" { + import assert = require("node:assert"); + export = assert; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/assert/strict.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/assert/strict.d.ts new file mode 100644 index 0000000..51bb352 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/assert/strict.d.ts @@ -0,0 +1,105 @@ +/** + * In strict assertion mode, non-strict methods behave like their corresponding + * strict methods. For example, `assert.deepEqual()` will behave like + * `assert.deepStrictEqual()`. + * + * In strict assertion mode, error messages for objects display a diff. In legacy + * assertion mode, error messages for objects display the objects, often truncated. + * + * To use strict assertion mode: + * + * ```js + * import { strict as assert } from 'node:assert'; + * ``` + * + * ```js + * import assert from 'node:assert/strict'; + * ``` + * + * Example error diff: + * + * ```js + * import { strict as assert } from 'node:assert'; + * + * assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]); + * // AssertionError: Expected inputs to be strictly deep-equal: + * // + actual - expected ... Lines skipped + * // + * // [ + * // [ + * // ... + * // 2, + * // + 3 + * // - '3' + * // ], + * // ... + * // 5 + * // ] + * ``` + * + * To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS` + * environment variables. This will also deactivate the colors in the REPL. For + * more on color support in terminal environments, read the tty + * [`getColorDepth()`](https://nodejs.org/docs/latest-v25.x/api/tty.html#writestreamgetcolordepthenv) documentation. + * @since v15.0.0 + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/assert/strict.js) + */ +declare module "node:assert/strict" { + import { + Assert, + AssertionError, + AssertionErrorOptions, + AssertOptions, + AssertPredicate, + AssertStrict, + deepStrictEqual, + doesNotMatch, + doesNotReject, + doesNotThrow, + fail, + ifError, + match, + notDeepStrictEqual, + notStrictEqual, + ok, + partialDeepStrictEqual, + rejects, + strictEqual, + throws, + } from "node:assert"; + function strict(value: unknown, message?: string | Error): asserts value; + namespace strict { + export { + Assert, + AssertionError, + AssertionErrorOptions, + AssertOptions, + AssertPredicate, + AssertStrict, + deepStrictEqual, + deepStrictEqual as deepEqual, + doesNotMatch, + doesNotReject, + doesNotThrow, + fail, + ifError, + match, + notDeepStrictEqual, + notDeepStrictEqual as notDeepEqual, + notStrictEqual, + notStrictEqual as notEqual, + ok, + partialDeepStrictEqual, + rejects, + strict, + strictEqual, + strictEqual as equal, + throws, + }; + } + export = strict; +} +declare module "assert/strict" { + import strict = require("node:assert/strict"); + export = strict; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/async_hooks.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/async_hooks.d.ts new file mode 100644 index 0000000..aa692c1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/async_hooks.d.ts @@ -0,0 +1,623 @@ +/** + * We strongly discourage the use of the `async_hooks` API. + * Other APIs that can cover most of its use cases include: + * + * * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v25.x/api/async_context.html#class-asynclocalstorage) tracks async context + * * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v25.x/api/process.html#processgetactiveresourcesinfo) tracks active resources + * + * The `node:async_hooks` module provides an API to track asynchronous resources. + * It can be accessed using: + * + * ```js + * import async_hooks from 'node:async_hooks'; + * ``` + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/async_hooks.js) + */ +declare module "node:async_hooks" { + /** + * ```js + * import { executionAsyncId } from 'node:async_hooks'; + * import fs from 'node:fs'; + * + * console.log(executionAsyncId()); // 1 - bootstrap + * const path = '.'; + * fs.open(path, 'r', (err, fd) => { + * console.log(executionAsyncId()); // 6 - open() + * }); + * ``` + * + * The ID returned from `executionAsyncId()` is related to execution timing, not + * causality (which is covered by `triggerAsyncId()`): + * + * ```js + * const server = net.createServer((conn) => { + * // Returns the ID of the server, not of the new connection, because the + * // callback runs in the execution scope of the server's MakeCallback(). + * async_hooks.executionAsyncId(); + * + * }).listen(port, () => { + * // Returns the ID of a TickObject (process.nextTick()) because all + * // callbacks passed to .listen() are wrapped in a nextTick(). + * async_hooks.executionAsyncId(); + * }); + * ``` + * + * Promise contexts may not get precise `executionAsyncIds` by default. + * See the section on [promise execution tracking](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#promise-execution-tracking). + * @since v8.1.0 + * @return The `asyncId` of the current execution context. Useful to track when something calls. + */ + function executionAsyncId(): number; + /** + * Resource objects returned by `executionAsyncResource()` are most often internal + * Node.js handle objects with undocumented APIs. Using any functions or properties + * on the object is likely to crash your application and should be avoided. + * + * Using `executionAsyncResource()` in the top-level execution context will + * return an empty object as there is no handle or request object to use, + * but having an object representing the top-level can be helpful. + * + * ```js + * import { open } from 'node:fs'; + * import { executionAsyncId, executionAsyncResource } from 'node:async_hooks'; + * + * console.log(executionAsyncId(), executionAsyncResource()); // 1 {} + * open(new URL(import.meta.url), 'r', (err, fd) => { + * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap + * }); + * ``` + * + * This can be used to implement continuation local storage without the + * use of a tracking `Map` to store the metadata: + * + * ```js + * import { createServer } from 'node:http'; + * import { + * executionAsyncId, + * executionAsyncResource, + * createHook, + * } from 'node:async_hooks'; + * const sym = Symbol('state'); // Private symbol to avoid pollution + * + * createHook({ + * init(asyncId, type, triggerAsyncId, resource) { + * const cr = executionAsyncResource(); + * if (cr) { + * resource[sym] = cr[sym]; + * } + * }, + * }).enable(); + * + * const server = createServer((req, res) => { + * executionAsyncResource()[sym] = { state: req.url }; + * setTimeout(function() { + * res.end(JSON.stringify(executionAsyncResource()[sym])); + * }, 100); + * }).listen(3000); + * ``` + * @since v13.9.0, v12.17.0 + * @return The resource representing the current execution. Useful to store data within the resource. + */ + function executionAsyncResource(): object; + /** + * ```js + * const server = net.createServer((conn) => { + * // The resource that caused (or triggered) this callback to be called + * // was that of the new connection. Thus the return value of triggerAsyncId() + * // is the asyncId of "conn". + * async_hooks.triggerAsyncId(); + * + * }).listen(port, () => { + * // Even though all callbacks passed to .listen() are wrapped in a nextTick() + * // the callback itself exists because the call to the server's .listen() + * // was made. So the return value would be the ID of the server. + * async_hooks.triggerAsyncId(); + * }); + * ``` + * + * Promise contexts may not get valid `triggerAsyncId`s by default. See + * the section on [promise execution tracking](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#promise-execution-tracking). + * @return The ID of the resource responsible for calling the callback that is currently being executed. + */ + function triggerAsyncId(): number; + interface HookCallbacks { + /** + * Called when a class is constructed that has the possibility to emit an asynchronous event. + * @param asyncId A unique ID for the async resource + * @param type The type of the async resource + * @param triggerAsyncId The unique ID of the async resource in whose execution context this async resource was created + * @param resource Reference to the resource representing the async operation, needs to be released during destroy + */ + init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; + /** + * When an asynchronous operation is initiated or completes a callback is called to notify the user. + * The before callback is called just before said callback is executed. + * @param asyncId the unique identifier assigned to the resource about to execute the callback. + */ + before?(asyncId: number): void; + /** + * Called immediately after the callback specified in `before` is completed. + * + * If an uncaught exception occurs during execution of the callback, then `after` will run after the `'uncaughtException'` event is emitted or a `domain`'s handler runs. + * @param asyncId the unique identifier assigned to the resource which has executed the callback. + */ + after?(asyncId: number): void; + /** + * Called when a promise has resolve() called. This may not be in the same execution id + * as the promise itself. + * @param asyncId the unique id for the promise that was resolve()d. + */ + promiseResolve?(asyncId: number): void; + /** + * Called after the resource corresponding to asyncId is destroyed + * @param asyncId a unique ID for the async resource + */ + destroy?(asyncId: number): void; + } + interface AsyncHook { + /** + * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. + */ + enable(): this; + /** + * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. + */ + disable(): this; + } + /** + * Registers functions to be called for different lifetime events of each async + * operation. + * + * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the + * respective asynchronous event during a resource's lifetime. + * + * All callbacks are optional. For example, if only resource cleanup needs to + * be tracked, then only the `destroy` callback needs to be passed. The + * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section. + * + * ```js + * import { createHook } from 'node:async_hooks'; + * + * const asyncHook = createHook({ + * init(asyncId, type, triggerAsyncId, resource) { }, + * destroy(asyncId) { }, + * }); + * ``` + * + * The callbacks will be inherited via the prototype chain: + * + * ```js + * class MyAsyncCallbacks { + * init(asyncId, type, triggerAsyncId, resource) { } + * destroy(asyncId) {} + * } + * + * class MyAddedCallbacks extends MyAsyncCallbacks { + * before(asyncId) { } + * after(asyncId) { } + * } + * + * const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); + * ``` + * + * Because promises are asynchronous resources whose lifecycle is tracked + * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises. + * @since v8.1.0 + * @param callbacks The `Hook Callbacks` to register + * @return Instance used for disabling and enabling hooks + */ + function createHook(callbacks: HookCallbacks): AsyncHook; + interface AsyncResourceOptions { + /** + * The ID of the execution context that created this async event. + * @default executionAsyncId() + */ + triggerAsyncId?: number | undefined; + /** + * Disables automatic `emitDestroy` when the object is garbage collected. + * This usually does not need to be set (even if `emitDestroy` is called + * manually), unless the resource's `asyncId` is retrieved and the + * sensitive API's `emitDestroy` is called with it. + * @default false + */ + requireManualDestroy?: boolean | undefined; + } + /** + * The class `AsyncResource` is designed to be extended by the embedder's async + * resources. Using this, users can easily trigger the lifetime events of their + * own resources. + * + * The `init` hook will trigger when an `AsyncResource` is instantiated. + * + * The following is an overview of the `AsyncResource` API. + * + * ```js + * import { AsyncResource, executionAsyncId } from 'node:async_hooks'; + * + * // AsyncResource() is meant to be extended. Instantiating a + * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then + * // async_hook.executionAsyncId() is used. + * const asyncResource = new AsyncResource( + * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false }, + * ); + * + * // Run a function in the execution context of the resource. This will + * // * establish the context of the resource + * // * trigger the AsyncHooks before callbacks + * // * call the provided function `fn` with the supplied arguments + * // * trigger the AsyncHooks after callbacks + * // * restore the original execution context + * asyncResource.runInAsyncScope(fn, thisArg, ...args); + * + * // Call AsyncHooks destroy callbacks. + * asyncResource.emitDestroy(); + * + * // Return the unique ID assigned to the AsyncResource instance. + * asyncResource.asyncId(); + * + * // Return the trigger ID for the AsyncResource instance. + * asyncResource.triggerAsyncId(); + * ``` + */ + class AsyncResource { + /** + * AsyncResource() is meant to be extended. Instantiating a + * new AsyncResource() also triggers init. If triggerAsyncId is omitted then + * async_hook.executionAsyncId() is used. + * @param type The type of async event. + * @param triggerAsyncId The ID of the execution context that created + * this async event (default: `executionAsyncId()`), or an + * AsyncResourceOptions object (since v9.3.0) + */ + constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions); + /** + * Binds the given function to the current execution context. + * @since v14.8.0, v12.19.0 + * @param fn The function to bind to the current execution context. + * @param type An optional name to associate with the underlying `AsyncResource`. + */ + static bind any, ThisArg>( + fn: Func, + type?: string, + thisArg?: ThisArg, + ): Func; + /** + * Binds the given function to execute to this `AsyncResource`'s scope. + * @since v14.8.0, v12.19.0 + * @param fn The function to bind to the current `AsyncResource`. + */ + bind any>(fn: Func): Func; + /** + * Call the provided function with the provided arguments in the execution context + * of the async resource. This will establish the context, trigger the AsyncHooks + * before callbacks, call the function, trigger the AsyncHooks after callbacks, and + * then restore the original execution context. + * @since v9.6.0 + * @param fn The function to call in the execution context of this async resource. + * @param thisArg The receiver to be used for the function call. + * @param args Optional arguments to pass to the function. + */ + runInAsyncScope( + fn: (this: This, ...args: any[]) => Result, + thisArg?: This, + ...args: any[] + ): Result; + /** + * Call all `destroy` hooks. This should only ever be called once. An error will + * be thrown if it is called more than once. This **must** be manually called. If + * the resource is left to be collected by the GC then the `destroy` hooks will + * never be called. + * @return A reference to `asyncResource`. + */ + emitDestroy(): this; + /** + * @return The unique `asyncId` assigned to the resource. + */ + asyncId(): number; + /** + * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor. + */ + triggerAsyncId(): number; + } + interface AsyncLocalStorageOptions { + /** + * The default value to be used when no store is provided. + */ + defaultValue?: any; + /** + * A name for the `AsyncLocalStorage` value. + */ + name?: string | undefined; + } + /** + * This class creates stores that stay coherent through asynchronous operations. + * + * While you can create your own implementation on top of the `node:async_hooks` module, `AsyncLocalStorage` should be preferred as it is a performant and memory + * safe implementation that involves significant optimizations that are non-obvious + * to implement. + * + * The following example uses `AsyncLocalStorage` to build a simple logger + * that assigns IDs to incoming HTTP requests and includes them in messages + * logged within each request. + * + * ```js + * import http from 'node:http'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const asyncLocalStorage = new AsyncLocalStorage(); + * + * function logWithId(msg) { + * const id = asyncLocalStorage.getStore(); + * console.log(`${id !== undefined ? id : '-'}:`, msg); + * } + * + * let idSeq = 0; + * http.createServer((req, res) => { + * asyncLocalStorage.run(idSeq++, () => { + * logWithId('start'); + * // Imagine any chain of async operations here + * setImmediate(() => { + * logWithId('finish'); + * res.end(); + * }); + * }); + * }).listen(8080); + * + * http.get('http://localhost:8080'); + * http.get('http://localhost:8080'); + * // Prints: + * // 0: start + * // 0: finish + * // 1: start + * // 1: finish + * ``` + * + * Each instance of `AsyncLocalStorage` maintains an independent storage context. + * Multiple instances can safely exist simultaneously without risk of interfering + * with each other's data. + * @since v13.10.0, v12.17.0 + */ + class AsyncLocalStorage { + /** + * Creates a new instance of `AsyncLocalStorage`. Store is only provided within a + * `run()` call or after an `enterWith()` call. + */ + constructor(options?: AsyncLocalStorageOptions); + /** + * Binds the given function to the current execution context. + * @since v19.8.0 + * @param fn The function to bind to the current execution context. + * @return A new function that calls `fn` within the captured execution context. + */ + static bind any>(fn: Func): Func; + /** + * Captures the current execution context and returns a function that accepts a + * function as an argument. Whenever the returned function is called, it + * calls the function passed to it within the captured context. + * + * ```js + * const asyncLocalStorage = new AsyncLocalStorage(); + * const runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot()); + * const result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore())); + * console.log(result); // returns 123 + * ``` + * + * AsyncLocalStorage.snapshot() can replace the use of AsyncResource for simple + * async context tracking purposes, for example: + * + * ```js + * class Foo { + * #runInAsyncScope = AsyncLocalStorage.snapshot(); + * + * get() { return this.#runInAsyncScope(() => asyncLocalStorage.getStore()); } + * } + * + * const foo = asyncLocalStorage.run(123, () => new Foo()); + * console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123 + * ``` + * @since v19.8.0 + * @return A new function with the signature `(fn: (...args) : R, ...args) : R`. + */ + static snapshot(): (fn: (...args: TArgs) => R, ...args: TArgs) => R; + /** + * Disables the instance of `AsyncLocalStorage`. All subsequent calls + * to `asyncLocalStorage.getStore()` will return `undefined` until `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. + * + * When calling `asyncLocalStorage.disable()`, all current contexts linked to the + * instance will be exited. + * + * Calling `asyncLocalStorage.disable()` is required before the `asyncLocalStorage` can be garbage collected. This does not apply to stores + * provided by the `asyncLocalStorage`, as those objects are garbage collected + * along with the corresponding async resources. + * + * Use this method when the `asyncLocalStorage` is not in use anymore + * in the current process. + * @since v13.10.0, v12.17.0 + * @experimental + */ + disable(): void; + /** + * Returns the current store. + * If called outside of an asynchronous context initialized by + * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it + * returns `undefined`. + * @since v13.10.0, v12.17.0 + */ + getStore(): T | undefined; + /** + * The name of the `AsyncLocalStorage` instance if provided. + * @since v24.0.0 + */ + readonly name: string; + /** + * Runs a function synchronously within a context and returns its + * return value. The store is not accessible outside of the callback function. + * The store is accessible to any asynchronous operations created within the + * callback. + * + * The optional `args` are passed to the callback function. + * + * If the callback function throws an error, the error is thrown by `run()` too. + * The stacktrace is not impacted by this call and the context is exited. + * + * Example: + * + * ```js + * const store = { id: 2 }; + * try { + * asyncLocalStorage.run(store, () => { + * asyncLocalStorage.getStore(); // Returns the store object + * setTimeout(() => { + * asyncLocalStorage.getStore(); // Returns the store object + * }, 200); + * throw new Error(); + * }); + * } catch (e) { + * asyncLocalStorage.getStore(); // Returns undefined + * // The error will be caught here + * } + * ``` + * @since v13.10.0, v12.17.0 + */ + run(store: T, callback: () => R): R; + run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R; + /** + * Runs a function synchronously outside of a context and returns its + * return value. The store is not accessible within the callback function or + * the asynchronous operations created within the callback. Any `getStore()` call done within the callback function will always return `undefined`. + * + * The optional `args` are passed to the callback function. + * + * If the callback function throws an error, the error is thrown by `exit()` too. + * The stacktrace is not impacted by this call and the context is re-entered. + * + * Example: + * + * ```js + * // Within a call to run + * try { + * asyncLocalStorage.getStore(); // Returns the store object or value + * asyncLocalStorage.exit(() => { + * asyncLocalStorage.getStore(); // Returns undefined + * throw new Error(); + * }); + * } catch (e) { + * asyncLocalStorage.getStore(); // Returns the same object or value + * // The error will be caught here + * } + * ``` + * @since v13.10.0, v12.17.0 + * @experimental + */ + exit(callback: (...args: TArgs) => R, ...args: TArgs): R; + /** + * Transitions into the context for the remainder of the current + * synchronous execution and then persists the store through any following + * asynchronous calls. + * + * Example: + * + * ```js + * const store = { id: 1 }; + * // Replaces previous store with the given store object + * asyncLocalStorage.enterWith(store); + * asyncLocalStorage.getStore(); // Returns the store object + * someAsyncOperation(() => { + * asyncLocalStorage.getStore(); // Returns the same object + * }); + * ``` + * + * This transition will continue for the _entire_ synchronous execution. + * This means that if, for example, the context is entered within an event + * handler subsequent event handlers will also run within that context unless + * specifically bound to another context with an `AsyncResource`. That is why `run()` should be preferred over `enterWith()` unless there are strong reasons + * to use the latter method. + * + * ```js + * const store = { id: 1 }; + * + * emitter.on('my-event', () => { + * asyncLocalStorage.enterWith(store); + * }); + * emitter.on('my-event', () => { + * asyncLocalStorage.getStore(); // Returns the same object + * }); + * + * asyncLocalStorage.getStore(); // Returns undefined + * emitter.emit('my-event'); + * asyncLocalStorage.getStore(); // Returns the same object + * ``` + * @since v13.11.0, v12.17.0 + * @experimental + */ + enterWith(store: T): void; + } + /** + * @since v17.2.0, v16.14.0 + * @return A map of provider types to the corresponding numeric id. + * This map contains all the event types that might be emitted by the `async_hooks.init()` event. + */ + namespace asyncWrapProviders { + const NONE: number; + const DIRHANDLE: number; + const DNSCHANNEL: number; + const ELDHISTOGRAM: number; + const FILEHANDLE: number; + const FILEHANDLECLOSEREQ: number; + const FIXEDSIZEBLOBCOPY: number; + const FSEVENTWRAP: number; + const FSREQCALLBACK: number; + const FSREQPROMISE: number; + const GETADDRINFOREQWRAP: number; + const GETNAMEINFOREQWRAP: number; + const HEAPSNAPSHOT: number; + const HTTP2SESSION: number; + const HTTP2STREAM: number; + const HTTP2PING: number; + const HTTP2SETTINGS: number; + const HTTPINCOMINGMESSAGE: number; + const HTTPCLIENTREQUEST: number; + const JSSTREAM: number; + const JSUDPWRAP: number; + const MESSAGEPORT: number; + const PIPECONNECTWRAP: number; + const PIPESERVERWRAP: number; + const PIPEWRAP: number; + const PROCESSWRAP: number; + const PROMISE: number; + const QUERYWRAP: number; + const SHUTDOWNWRAP: number; + const SIGNALWRAP: number; + const STATWATCHER: number; + const STREAMPIPE: number; + const TCPCONNECTWRAP: number; + const TCPSERVERWRAP: number; + const TCPWRAP: number; + const TTYWRAP: number; + const UDPSENDWRAP: number; + const UDPWRAP: number; + const SIGINTWATCHDOG: number; + const WORKER: number; + const WORKERHEAPSNAPSHOT: number; + const WRITEWRAP: number; + const ZLIB: number; + const CHECKPRIMEREQUEST: number; + const PBKDF2REQUEST: number; + const KEYPAIRGENREQUEST: number; + const KEYGENREQUEST: number; + const KEYEXPORTREQUEST: number; + const CIPHERREQUEST: number; + const DERIVEBITSREQUEST: number; + const HASHREQUEST: number; + const RANDOMBYTESREQUEST: number; + const RANDOMPRIMEREQUEST: number; + const SCRYPTREQUEST: number; + const SIGNREQUEST: number; + const TLSWRAP: number; + const VERIFYREQUEST: number; + } +} +declare module "async_hooks" { + export * from "node:async_hooks"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/buffer.buffer.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/buffer.buffer.d.ts new file mode 100644 index 0000000..a3c2304 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/buffer.buffer.d.ts @@ -0,0 +1,466 @@ +declare module "node:buffer" { + type ImplicitArrayBuffer> = T extends + { valueOf(): infer V extends ArrayBufferLike } ? V : T; + global { + interface BufferConstructor { + // see buffer.d.ts for implementation shared with all TypeScript versions + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. + */ + new(str: string, encoding?: BufferEncoding): Buffer; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). + */ + new(size: number): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + new(array: ArrayLike): Buffer; + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}/{SharedArrayBuffer}. + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. + */ + new(arrayBuffer: TArrayBuffer): Buffer; + /** + * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. + * Array entries outside that range will be truncated to fit into it. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. + * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + * ``` + * + * If `array` is an `Array`-like object (that is, one with a `length` property of + * type `number`), it is treated as if it is an array, unless it is a `Buffer` or + * a `Uint8Array`. This means all other `TypedArray` variants get treated as an + * `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use + * `Buffer.copyBytesFrom()`. + * + * A `TypeError` will be thrown if `array` is not an `Array` or another type + * appropriate for `Buffer.from()` variants. + * + * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal + * `Buffer` pool like `Buffer.allocUnsafe()` does. + * @since v5.10.0 + */ + from(array: WithImplicitCoercion>): Buffer; + /** + * This creates a view of the `ArrayBuffer` without copying the underlying + * memory. For example, when passed a reference to the `.buffer` property of a + * `TypedArray` instance, the newly created `Buffer` will share the same + * allocated memory as the `TypedArray`'s underlying `ArrayBuffer`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const arr = new Uint16Array(2); + * + * arr[0] = 5000; + * arr[1] = 4000; + * + * // Shares memory with `arr`. + * const buf = Buffer.from(arr.buffer); + * + * console.log(buf); + * // Prints: + * + * // Changing the original Uint16Array changes the Buffer also. + * arr[1] = 6000; + * + * console.log(buf); + * // Prints: + * ``` + * + * The optional `byteOffset` and `length` arguments specify a memory range within + * the `arrayBuffer` that will be shared by the `Buffer`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const ab = new ArrayBuffer(10); + * const buf = Buffer.from(ab, 0, 2); + * + * console.log(buf.length); + * // Prints: 2 + * ``` + * + * A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer` or a + * `SharedArrayBuffer` or another type appropriate for `Buffer.from()` + * variants. + * + * It is important to remember that a backing `ArrayBuffer` can cover a range + * of memory that extends beyond the bounds of a `TypedArray` view. A new + * `Buffer` created using the `buffer` property of a `TypedArray` may extend + * beyond the range of the `TypedArray`: + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const arrA = Uint8Array.from([0x63, 0x64, 0x65, 0x66]); // 4 elements + * const arrB = new Uint8Array(arrA.buffer, 1, 2); // 2 elements + * console.log(arrA.buffer === arrB.buffer); // true + * + * const buf = Buffer.from(arrB.buffer); + * console.log(buf); + * // Prints: + * ``` + * @since v5.10.0 + * @param arrayBuffer An `ArrayBuffer`, `SharedArrayBuffer`, for example the + * `.buffer` property of a `TypedArray`. + * @param byteOffset Index of first byte to expose. **Default:** `0`. + * @param length Number of bytes to expose. **Default:** + * `arrayBuffer.byteLength - byteOffset`. + */ + from>( + arrayBuffer: TArrayBuffer, + byteOffset?: number, + length?: number, + ): Buffer>; + /** + * Creates a new `Buffer` containing `string`. The `encoding` parameter identifies + * the character encoding to be used when converting `string` into bytes. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from('this is a tést'); + * const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); + * + * console.log(buf1.toString()); + * // Prints: this is a tést + * console.log(buf2.toString()); + * // Prints: this is a tést + * console.log(buf1.toString('latin1')); + * // Prints: this is a tést + * ``` + * + * A `TypeError` will be thrown if `string` is not a string or another type + * appropriate for `Buffer.from()` variants. + * + * `Buffer.from(string)` may also use the internal `Buffer` pool like + * `Buffer.allocUnsafe()` does. + * @since v5.10.0 + * @param string A string to encode. + * @param encoding The encoding of `string`. **Default:** `'utf8'`. + */ + from(string: WithImplicitCoercion, encoding?: BufferEncoding): Buffer; + from(arrayOrString: WithImplicitCoercion | string>): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param values to create a new Buffer + */ + of(...items: number[]): Buffer; + /** + * Returns a new `Buffer` which is the result of concatenating all the `Buffer` instances in the `list` together. + * + * If the list has no items, or if the `totalLength` is 0, then a new zero-length `Buffer` is returned. + * + * If `totalLength` is not provided, it is calculated from the `Buffer` instances + * in `list` by adding their lengths. + * + * If `totalLength` is provided, it is coerced to an unsigned integer. If the + * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is + * truncated to `totalLength`. If the combined length of the `Buffer`s in `list` is + * less than `totalLength`, the remaining space is filled with zeros. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Create a single `Buffer` from a list of three `Buffer` instances. + * + * const buf1 = Buffer.alloc(10); + * const buf2 = Buffer.alloc(14); + * const buf3 = Buffer.alloc(18); + * const totalLength = buf1.length + buf2.length + buf3.length; + * + * console.log(totalLength); + * // Prints: 42 + * + * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); + * + * console.log(bufA); + * // Prints: + * console.log(bufA.length); + * // Prints: 42 + * ``` + * + * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. + * @since v0.7.11 + * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. + * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. + */ + concat(list: readonly Uint8Array[], totalLength?: number): Buffer; + /** + * Copies the underlying memory of `view` into a new `Buffer`. + * + * ```js + * const u16 = new Uint16Array([0, 0xffff]); + * const buf = Buffer.copyBytesFrom(u16, 1, 1); + * u16[1] = 0; + * console.log(buf.length); // 2 + * console.log(buf[0]); // 255 + * console.log(buf[1]); // 255 + * ``` + * @since v19.8.0 + * @param view The {TypedArray} to copy. + * @param [offset=0] The starting offset within `view`. + * @param [length=view.length - offset] The number of elements from `view` to copy. + */ + copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer; + /** + * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.alloc(5); + * + * console.log(buf); + * // Prints: + * ``` + * + * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. + * + * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.alloc(5, 'a'); + * + * console.log(buf); + * // Prints: + * ``` + * + * If both `fill` and `encoding` are specified, the allocated `Buffer` will be + * initialized by calling `buf.fill(fill, encoding)`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); + * + * console.log(buf); + * // Prints: + * ``` + * + * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance + * contents will never contain sensitive data from previous allocations, including + * data that might not have been allocated for `Buffer`s. + * + * A `TypeError` will be thrown if `size` is not a number. + * @since v5.10.0 + * @param size The desired length of the new `Buffer`. + * @param [fill=0] A value to pre-fill the new `Buffer` with. + * @param [encoding='utf8'] If `fill` is a string, this is its encoding. + */ + alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer; + /** + * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. + * + * The underlying memory for `Buffer` instances created in this way is _not_ + * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(10); + * + * console.log(buf); + * // Prints (contents may vary): + * + * buf.fill(0); + * + * console.log(buf); + * // Prints: + * ``` + * + * A `TypeError` will be thrown if `size` is not a number. + * + * The `Buffer` module pre-allocates an internal `Buffer` instance of + * size `Buffer.poolSize` that is used as a pool for the fast allocation of new `Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, + * and `Buffer.concat()` only when `size` is less than `Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two). + * + * Use of this pre-allocated internal memory pool is a key difference between + * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. + * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less + * than or equal to half `Buffer.poolSize`. The + * difference is subtle but can be important when an application requires the + * additional performance that `Buffer.allocUnsafe()` provides. + * @since v5.10.0 + * @param size The desired length of the new `Buffer`. + */ + allocUnsafe(size: number): Buffer; + /** + * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if + * `size` is 0. + * + * The underlying memory for `Buffer` instances created in this way is _not_ + * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize + * such `Buffer` instances with zeroes. + * + * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, + * allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This + * allows applications to avoid the garbage collection overhead of creating many + * individually allocated `Buffer` instances. This approach improves both + * performance and memory usage by eliminating the need to track and clean up as + * many individual `ArrayBuffer` objects. + * + * However, in the case where a developer may need to retain a small chunk of + * memory from a pool for an indeterminate amount of time, it may be appropriate + * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and + * then copying out the relevant bits. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Need to keep around a few small chunks of memory. + * const store = []; + * + * socket.on('readable', () => { + * let data; + * while (null !== (data = readable.read())) { + * // Allocate for retained data. + * const sb = Buffer.allocUnsafeSlow(10); + * + * // Copy the data into the new allocation. + * data.copy(sb, 0, 0, 10); + * + * store.push(sb); + * } + * }); + * ``` + * + * A `TypeError` will be thrown if `size` is not a number. + * @since v5.12.0 + * @param size The desired length of the new `Buffer`. + */ + allocUnsafeSlow(size: number): Buffer; + } + interface Buffer extends Uint8Array { + // see buffer.d.ts for implementation shared with all TypeScript versions + + /** + * Returns a new `Buffer` that references the same memory as the original, but + * offset and cropped by the `start` and `end` indices. + * + * This method is not compatible with the `Uint8Array.prototype.slice()`, + * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('buffer'); + * + * const copiedBuf = Uint8Array.prototype.slice.call(buf); + * copiedBuf[0]++; + * console.log(copiedBuf.toString()); + * // Prints: cuffer + * + * console.log(buf.toString()); + * // Prints: buffer + * + * // With buf.slice(), the original buffer is modified. + * const notReallyCopiedBuf = buf.slice(); + * notReallyCopiedBuf[0]++; + * console.log(notReallyCopiedBuf.toString()); + * // Prints: cuffer + * console.log(buf.toString()); + * // Also prints: cuffer (!) + * ``` + * @since v0.3.0 + * @deprecated Use `subarray` instead. + * @param [start=0] Where the new `Buffer` will start. + * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). + */ + slice(start?: number, end?: number): Buffer; + /** + * Returns a new `Buffer` that references the same memory as the original, but + * offset and cropped by the `start` and `end` indices. + * + * Specifying `end` greater than `buf.length` will return the same result as + * that of `end` equal to `buf.length`. + * + * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). + * + * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte + * // from the original `Buffer`. + * + * const buf1 = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * const buf2 = buf1.subarray(0, 3); + * + * console.log(buf2.toString('ascii', 0, buf2.length)); + * // Prints: abc + * + * buf1[0] = 33; + * + * console.log(buf2.toString('ascii', 0, buf2.length)); + * // Prints: !bc + * ``` + * + * Specifying negative indexes causes the slice to be generated relative to the + * end of `buf` rather than the beginning. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('buffer'); + * + * console.log(buf.subarray(-6, -1).toString()); + * // Prints: buffe + * // (Equivalent to buf.subarray(0, 5).) + * + * console.log(buf.subarray(-6, -2).toString()); + * // Prints: buff + * // (Equivalent to buf.subarray(0, 4).) + * + * console.log(buf.subarray(-5, -2).toString()); + * // Prints: uff + * // (Equivalent to buf.subarray(1, 4).) + * ``` + * @since v3.0.0 + * @param [start=0] Where the new `Buffer` will start. + * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). + */ + subarray(start?: number, end?: number): Buffer; + } + // TODO: remove globals in future version + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedBuffer = Buffer; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type AllowSharedBuffer = Buffer; + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/buffer.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/buffer.d.ts new file mode 100644 index 0000000..bb0f004 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/buffer.d.ts @@ -0,0 +1,1810 @@ +/** + * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many + * Node.js APIs support `Buffer`s. + * + * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and + * extends it with methods that cover additional use cases. Node.js APIs accept + * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well. + * + * While the `Buffer` class is available within the global scope, it is still + * recommended to explicitly reference it via an import or require statement. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Creates a zero-filled Buffer of length 10. + * const buf1 = Buffer.alloc(10); + * + * // Creates a Buffer of length 10, + * // filled with bytes which all have the value `1`. + * const buf2 = Buffer.alloc(10, 1); + * + * // Creates an uninitialized buffer of length 10. + * // This is faster than calling Buffer.alloc() but the returned + * // Buffer instance might contain old data that needs to be + * // overwritten using fill(), write(), or other functions that fill the Buffer's + * // contents. + * const buf3 = Buffer.allocUnsafe(10); + * + * // Creates a Buffer containing the bytes [1, 2, 3]. + * const buf4 = Buffer.from([1, 2, 3]); + * + * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries + * // are all truncated using `(value & 255)` to fit into the range 0–255. + * const buf5 = Buffer.from([257, 257.5, -255, '1']); + * + * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést': + * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation) + * // [116, 195, 169, 115, 116] (in decimal notation) + * const buf6 = Buffer.from('tést'); + * + * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. + * const buf7 = Buffer.from('tést', 'latin1'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/buffer.js) + */ +declare module "node:buffer" { + import { ReadableStream } from "node:stream/web"; + /** + * This function returns `true` if `input` contains only valid UTF-8-encoded data, + * including the case in which `input` is empty. + * + * Throws if the `input` is a detached array buffer. + * @since v19.4.0, v18.14.0 + * @param input The input to validate. + */ + export function isUtf8(input: ArrayBuffer | NodeJS.TypedArray): boolean; + /** + * This function returns `true` if `input` contains only valid ASCII-encoded data, + * including the case in which `input` is empty. + * + * Throws if the `input` is a detached array buffer. + * @since v19.6.0, v18.15.0 + * @param input The input to validate. + */ + export function isAscii(input: ArrayBuffer | NodeJS.TypedArray): boolean; + export let INSPECT_MAX_BYTES: number; + export const kMaxLength: number; + export const kStringMaxLength: number; + export const constants: { + MAX_LENGTH: number; + MAX_STRING_LENGTH: number; + }; + export type TranscodeEncoding = + | "ascii" + | "utf8" + | "utf-8" + | "utf16le" + | "utf-16le" + | "ucs2" + | "ucs-2" + | "latin1" + | "binary"; + /** + * Re-encodes the given `Buffer` or `Uint8Array` instance from one character + * encoding to another. Returns a new `Buffer` instance. + * + * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if + * conversion from `fromEnc` to `toEnc` is not permitted. + * + * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`, `'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. + * + * The transcoding process will use substitution characters if a given byte + * sequence cannot be adequately represented in the target encoding. For instance: + * + * ```js + * import { Buffer, transcode } from 'node:buffer'; + * + * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii'); + * console.log(newBuf.toString('ascii')); + * // Prints: '?' + * ``` + * + * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced + * with `?` in the transcoded `Buffer`. + * @since v7.1.0 + * @param source A `Buffer` or `Uint8Array` instance. + * @param fromEnc The current encoding. + * @param toEnc To target encoding. + */ + export function transcode( + source: Uint8Array, + fromEnc: TranscodeEncoding, + toEnc: TranscodeEncoding, + ): NonSharedBuffer; + /** + * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using + * a prior call to `URL.createObjectURL()`. + * @since v16.7.0 + * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. + */ + export function resolveObjectURL(id: string): Blob | undefined; + export { type AllowSharedBuffer, Buffer, type NonSharedBuffer }; + /** @deprecated This alias will be removed in a future version. Use the canonical `BlobPropertyBag` instead. */ + // TODO: remove in future major + export interface BlobOptions extends BlobPropertyBag {} + /** @deprecated This alias will be removed in a future version. Use the canonical `FilePropertyBag` instead. */ + export interface FileOptions extends FilePropertyBag {} + export type WithImplicitCoercion = + | T + | { valueOf(): T } + | (T extends string ? { [Symbol.toPrimitive](hint: "string"): T } : never); + global { + namespace NodeJS { + export { BufferEncoding }; + } + // Buffer class + type BufferEncoding = + | "ascii" + | "utf8" + | "utf-8" + | "utf16le" + | "utf-16le" + | "ucs2" + | "ucs-2" + | "base64" + | "base64url" + | "latin1" + | "binary" + | "hex"; + /** + * Raw data is stored in instances of the Buffer class. + * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. + * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex' + */ + interface BufferConstructor { + // see buffer.buffer.d.ts for implementation specific to TypeScript 5.7 and later + // see ts5.6/buffer.buffer.d.ts for implementation specific to TypeScript 5.6 and earlier + + /** + * Returns `true` if `obj` is a `Buffer`, `false` otherwise. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * Buffer.isBuffer(Buffer.alloc(10)); // true + * Buffer.isBuffer(Buffer.from('foo')); // true + * Buffer.isBuffer('a string'); // false + * Buffer.isBuffer([]); // false + * Buffer.isBuffer(new Uint8Array(1024)); // false + * ``` + * @since v0.1.101 + */ + isBuffer(obj: any): obj is Buffer; + /** + * Returns `true` if `encoding` is the name of a supported character encoding, + * or `false` otherwise. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * console.log(Buffer.isEncoding('utf8')); + * // Prints: true + * + * console.log(Buffer.isEncoding('hex')); + * // Prints: true + * + * console.log(Buffer.isEncoding('utf/8')); + * // Prints: false + * + * console.log(Buffer.isEncoding('')); + * // Prints: false + * ``` + * @since v0.9.1 + * @param encoding A character encoding name to check. + */ + isEncoding(encoding: string): encoding is BufferEncoding; + /** + * Returns the byte length of a string when encoded using `encoding`. + * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account + * for the encoding that is used to convert the string into bytes. + * + * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. + * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the + * return value might be greater than the length of a `Buffer` created from the + * string. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const str = '\u00bd + \u00bc = \u00be'; + * + * console.log(`${str}: ${str.length} characters, ` + + * `${Buffer.byteLength(str, 'utf8')} bytes`); + * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes + * ``` + * + * When `string` is a + * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- + * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- + * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. + * @since v0.1.90 + * @param string A value to calculate the length of. + * @param [encoding='utf8'] If `string` is a string, this is its encoding. + * @return The number of bytes contained within `string`. + */ + byteLength( + string: string | NodeJS.ArrayBufferView | ArrayBufferLike, + encoding?: BufferEncoding, + ): number; + /** + * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of `Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from('1234'); + * const buf2 = Buffer.from('0123'); + * const arr = [buf1, buf2]; + * + * console.log(arr.sort(Buffer.compare)); + * // Prints: [ , ] + * // (This result is equal to: [buf2, buf1].) + * ``` + * @since v0.11.13 + * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details. + */ + compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1; + /** + * This is the size (in bytes) of pre-allocated internal `Buffer` instances used + * for pooling. This value may be modified. + * @since v0.11.3 + */ + poolSize: number; + } + interface Buffer { + // see buffer.buffer.d.ts for implementation specific to TypeScript 5.7 and later + // see ts5.6/buffer.buffer.d.ts for implementation specific to TypeScript 5.6 and earlier + + /** + * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did + * not contain enough space to fit the entire string, only part of `string` will be + * written. However, partially encoded characters will not be written. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.alloc(256); + * + * const len = buf.write('\u00bd + \u00bc = \u00be', 0); + * + * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); + * // Prints: 12 bytes: ½ + ¼ = ¾ + * + * const buffer = Buffer.alloc(10); + * + * const length = buffer.write('abcd', 8); + * + * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); + * // Prints: 2 bytes : ab + * ``` + * @since v0.1.90 + * @param string String to write to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write `string`. + * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). + * @param [encoding='utf8'] The character encoding of `string`. + * @return Number of bytes written. + */ + write(string: string, encoding?: BufferEncoding): number; + write(string: string, offset: number, encoding?: BufferEncoding): number; + write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; + /** + * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. + * + * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, + * then each invalid byte is replaced with the replacement character `U+FFFD`. + * + * The maximum length of a string instance (in UTF-16 code units) is available + * as {@link constants.MAX_STRING_LENGTH}. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * console.log(buf1.toString('utf8')); + * // Prints: abcdefghijklmnopqrstuvwxyz + * console.log(buf1.toString('utf8', 0, 5)); + * // Prints: abcde + * + * const buf2 = Buffer.from('tést'); + * + * console.log(buf2.toString('hex')); + * // Prints: 74c3a97374 + * console.log(buf2.toString('utf8', 0, 3)); + * // Prints: té + * console.log(buf2.toString(undefined, 0, 3)); + * // Prints: té + * ``` + * @since v0.1.90 + * @param [encoding='utf8'] The character encoding to use. + * @param [start=0] The byte offset to start decoding at. + * @param [end=buf.length] The byte offset to stop decoding at (not inclusive). + */ + toString(encoding?: BufferEncoding, start?: number, end?: number): string; + /** + * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls + * this function when stringifying a `Buffer` instance. + * + * `Buffer.from()` accepts objects in the format returned from this method. + * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); + * const json = JSON.stringify(buf); + * + * console.log(json); + * // Prints: {"type":"Buffer","data":[1,2,3,4,5]} + * + * const copy = JSON.parse(json, (key, value) => { + * return value && value.type === 'Buffer' ? + * Buffer.from(value) : + * value; + * }); + * + * console.log(copy); + * // Prints: + * ``` + * @since v0.9.2 + */ + toJSON(): { + type: "Buffer"; + data: number[]; + }; + /** + * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from('ABC'); + * const buf2 = Buffer.from('414243', 'hex'); + * const buf3 = Buffer.from('ABCD'); + * + * console.log(buf1.equals(buf2)); + * // Prints: true + * console.log(buf1.equals(buf3)); + * // Prints: false + * ``` + * @since v0.11.13 + * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`. + */ + equals(otherBuffer: Uint8Array): boolean; + /** + * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. + * Comparison is based on the actual sequence of bytes in each `Buffer`. + * + * * `0` is returned if `target` is the same as `buf` + * * `1` is returned if `target` should come _before_`buf` when sorted. + * * `-1` is returned if `target` should come _after_`buf` when sorted. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from('ABC'); + * const buf2 = Buffer.from('BCD'); + * const buf3 = Buffer.from('ABCD'); + * + * console.log(buf1.compare(buf1)); + * // Prints: 0 + * console.log(buf1.compare(buf2)); + * // Prints: -1 + * console.log(buf1.compare(buf3)); + * // Prints: -1 + * console.log(buf2.compare(buf1)); + * // Prints: 1 + * console.log(buf2.compare(buf3)); + * // Prints: 1 + * console.log([buf1, buf2, buf3].sort(Buffer.compare)); + * // Prints: [ , , ] + * // (This result is equal to: [buf1, buf3, buf2].) + * ``` + * + * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd` arguments can be used to limit the comparison to specific ranges within `target` and `buf` respectively. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); + * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); + * + * console.log(buf1.compare(buf2, 5, 9, 0, 4)); + * // Prints: 0 + * console.log(buf1.compare(buf2, 0, 6, 4)); + * // Prints: -1 + * console.log(buf1.compare(buf2, 5, 6, 5)); + * // Prints: 1 + * ``` + * + * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`, `targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. + * @since v0.11.13 + * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. + * @param [targetStart=0] The offset within `target` at which to begin comparison. + * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive). + * @param [sourceStart=0] The offset within `buf` at which to begin comparison. + * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). + */ + compare( + target: Uint8Array, + targetStart?: number, + targetEnd?: number, + sourceStart?: number, + sourceEnd?: number, + ): -1 | 0 | 1; + /** + * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. + * + * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available + * for all TypedArrays, including Node.js `Buffer`s, although it takes + * different function arguments. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Create two `Buffer` instances. + * const buf1 = Buffer.allocUnsafe(26); + * const buf2 = Buffer.allocUnsafe(26).fill('!'); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. + * buf1.copy(buf2, 8, 16, 20); + * // This is equivalent to: + * // buf2.set(buf1.subarray(16, 20), 8); + * + * console.log(buf2.toString('ascii', 0, 25)); + * // Prints: !!!!!!!!qrst!!!!!!!!!!!!! + * ``` + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Create a `Buffer` and copy data from one region to an overlapping region + * // within the same `Buffer`. + * + * const buf = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf[i] = i + 97; + * } + * + * buf.copy(buf, 0, 4, 10); + * + * console.log(buf.toString()); + * // Prints: efghijghijklmnopqrstuvwxyz + * ``` + * @since v0.1.90 + * @param target A `Buffer` or {@link Uint8Array} to copy into. + * @param [targetStart=0] The offset within `target` at which to begin writing. + * @param [sourceStart=0] The offset within `buf` from which to begin copying. + * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive). + * @return The number of bytes copied. + */ + copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. + * + * `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigInt64BE(0x0102030405060708n, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigInt64BE(value: bigint, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. + * + * `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigInt64LE(0x0102030405060708n, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigInt64LE(value: bigint, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. + * + * This function is also available under the `writeBigUint64BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigUInt64BE(0xdecafafecacefaden, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigUInt64BE(value: bigint, offset?: number): number; + /** + * @alias Buffer.writeBigUInt64BE + * @since v14.10.0, v12.19.0 + */ + writeBigUint64BE(value: bigint, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigUInt64LE(0xdecafafecacefaden, 0); + * + * console.log(buf); + * // Prints: + * ``` + * + * This function is also available under the `writeBigUint64LE` alias. + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigUInt64LE(value: bigint, offset?: number): number; + /** + * @alias Buffer.writeBigUInt64LE + * @since v14.10.0, v12.19.0 + */ + writeBigUint64LE(value: bigint, offset?: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined + * when `value` is anything other than an unsigned integer. + * + * This function is also available under the `writeUintLE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeUIntLE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeUIntLE(value: number, offset: number, byteLength: number): number; + /** + * @alias Buffer.writeUIntLE + * @since v14.9.0, v12.19.0 + */ + writeUintLE(value: number, offset: number, byteLength: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined + * when `value` is anything other than an unsigned integer. + * + * This function is also available under the `writeUintBE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeUIntBE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeUIntBE(value: number, offset: number, byteLength: number): number; + /** + * @alias Buffer.writeUIntBE + * @since v14.9.0, v12.19.0 + */ + writeUintBE(value: number, offset: number, byteLength: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined + * when `value` is anything other than a signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeIntLE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeIntLE(value: number, offset: number, byteLength: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a + * signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeIntBE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeIntBE(value: number, offset: number, byteLength: number): number; + /** + * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readBigUint64BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); + * + * console.log(buf.readBigUInt64BE(0)); + * // Prints: 4294967295n + * ``` + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigUInt64BE(offset?: number): bigint; + /** + * @alias Buffer.readBigUInt64BE + * @since v14.10.0, v12.19.0 + */ + readBigUint64BE(offset?: number): bigint; + /** + * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readBigUint64LE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); + * + * console.log(buf.readBigUInt64LE(0)); + * // Prints: 18446744069414584320n + * ``` + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigUInt64LE(offset?: number): bigint; + /** + * @alias Buffer.readBigUInt64LE + * @since v14.10.0, v12.19.0 + */ + readBigUint64LE(offset?: number): bigint; + /** + * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed + * values. + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigInt64BE(offset?: number): bigint; + /** + * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed + * values. + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigInt64LE(offset?: number): bigint; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned, little-endian integer supporting + * up to 48 bits of accuracy. + * + * This function is also available under the `readUintLE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readUIntLE(0, 6).toString(16)); + * // Prints: ab9078563412 + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readUIntLE(offset: number, byteLength: number): number; + /** + * @alias Buffer.readUIntLE + * @since v14.9.0, v12.19.0 + */ + readUintLE(offset: number, byteLength: number): number; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned big-endian integer supporting + * up to 48 bits of accuracy. + * + * This function is also available under the `readUintBE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readUIntBE(0, 6).toString(16)); + * // Prints: 1234567890ab + * console.log(buf.readUIntBE(1, 6).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readUIntBE(offset: number, byteLength: number): number; + /** + * @alias Buffer.readUIntBE + * @since v14.9.0, v12.19.0 + */ + readUintBE(offset: number, byteLength: number): number; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as a little-endian, two's complement signed value + * supporting up to 48 bits of accuracy. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readIntLE(0, 6).toString(16)); + * // Prints: -546f87a9cbee + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readIntLE(offset: number, byteLength: number): number; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as a big-endian, two's complement signed value + * supporting up to 48 bits of accuracy. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readIntBE(0, 6).toString(16)); + * // Prints: 1234567890ab + * console.log(buf.readIntBE(1, 6).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * console.log(buf.readIntBE(1, 0).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readIntBE(offset: number, byteLength: number): number; + /** + * Reads an unsigned 8-bit integer from `buf` at the specified `offset`. + * + * This function is also available under the `readUint8` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([1, -2]); + * + * console.log(buf.readUInt8(0)); + * // Prints: 1 + * console.log(buf.readUInt8(1)); + * // Prints: 254 + * console.log(buf.readUInt8(2)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. + */ + readUInt8(offset?: number): number; + /** + * @alias Buffer.readUInt8 + * @since v14.9.0, v12.19.0 + */ + readUint8(offset?: number): number; + /** + * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified `offset`. + * + * This function is also available under the `readUint16LE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56]); + * + * console.log(buf.readUInt16LE(0).toString(16)); + * // Prints: 3412 + * console.log(buf.readUInt16LE(1).toString(16)); + * // Prints: 5634 + * console.log(buf.readUInt16LE(2).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readUInt16LE(offset?: number): number; + /** + * @alias Buffer.readUInt16LE + * @since v14.9.0, v12.19.0 + */ + readUint16LE(offset?: number): number; + /** + * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint16BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56]); + * + * console.log(buf.readUInt16BE(0).toString(16)); + * // Prints: 1234 + * console.log(buf.readUInt16BE(1).toString(16)); + * // Prints: 3456 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readUInt16BE(offset?: number): number; + /** + * @alias Buffer.readUInt16BE + * @since v14.9.0, v12.19.0 + */ + readUint16BE(offset?: number): number; + /** + * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint32LE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); + * + * console.log(buf.readUInt32LE(0).toString(16)); + * // Prints: 78563412 + * console.log(buf.readUInt32LE(1).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readUInt32LE(offset?: number): number; + /** + * @alias Buffer.readUInt32LE + * @since v14.9.0, v12.19.0 + */ + readUint32LE(offset?: number): number; + /** + * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint32BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); + * + * console.log(buf.readUInt32BE(0).toString(16)); + * // Prints: 12345678 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readUInt32BE(offset?: number): number; + /** + * @alias Buffer.readUInt32BE + * @since v14.9.0, v12.19.0 + */ + readUint32BE(offset?: number): number; + /** + * Reads a signed 8-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([-1, 5]); + * + * console.log(buf.readInt8(0)); + * // Prints: -1 + * console.log(buf.readInt8(1)); + * // Prints: 5 + * console.log(buf.readInt8(2)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. + */ + readInt8(offset?: number): number; + /** + * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0, 5]); + * + * console.log(buf.readInt16LE(0)); + * // Prints: 1280 + * console.log(buf.readInt16LE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readInt16LE(offset?: number): number; + /** + * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0, 5]); + * + * console.log(buf.readInt16BE(0)); + * // Prints: 5 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readInt16BE(offset?: number): number; + /** + * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0, 0, 0, 5]); + * + * console.log(buf.readInt32LE(0)); + * // Prints: 83886080 + * console.log(buf.readInt32LE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readInt32LE(offset?: number): number; + /** + * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0, 0, 0, 5]); + * + * console.log(buf.readInt32BE(0)); + * // Prints: 5 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readInt32BE(offset?: number): number; + /** + * Reads a 32-bit, little-endian float from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4]); + * + * console.log(buf.readFloatLE(0)); + * // Prints: 1.539989614439558e-36 + * console.log(buf.readFloatLE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readFloatLE(offset?: number): number; + /** + * Reads a 32-bit, big-endian float from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4]); + * + * console.log(buf.readFloatBE(0)); + * // Prints: 2.387939260590663e-38 + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readFloatBE(offset?: number): number; + /** + * Reads a 64-bit, little-endian double from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); + * + * console.log(buf.readDoubleLE(0)); + * // Prints: 5.447603722011605e-270 + * console.log(buf.readDoubleLE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. + */ + readDoubleLE(offset?: number): number; + /** + * Reads a 64-bit, big-endian double from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); + * + * console.log(buf.readDoubleBE(0)); + * // Prints: 8.20788039913184e-304 + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. + */ + readDoubleBE(offset?: number): number; + reverse(): this; + /** + * Interprets `buf` as an array of unsigned 16-bit integers and swaps the + * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + * + * console.log(buf1); + * // Prints: + * + * buf1.swap16(); + * + * console.log(buf1); + * // Prints: + * + * const buf2 = Buffer.from([0x1, 0x2, 0x3]); + * + * buf2.swap16(); + * // Throws ERR_INVALID_BUFFER_SIZE. + * ``` + * + * One convenient use of `buf.swap16()` is to perform a fast in-place conversion + * between UTF-16 little-endian and UTF-16 big-endian: + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); + * buf.swap16(); // Convert to big-endian UTF-16 text. + * ``` + * @since v5.10.0 + * @return A reference to `buf`. + */ + swap16(): this; + /** + * Interprets `buf` as an array of unsigned 32-bit integers and swaps the + * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + * + * console.log(buf1); + * // Prints: + * + * buf1.swap32(); + * + * console.log(buf1); + * // Prints: + * + * const buf2 = Buffer.from([0x1, 0x2, 0x3]); + * + * buf2.swap32(); + * // Throws ERR_INVALID_BUFFER_SIZE. + * ``` + * @since v5.10.0 + * @return A reference to `buf`. + */ + swap32(): this; + /** + * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. + * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + * + * console.log(buf1); + * // Prints: + * + * buf1.swap64(); + * + * console.log(buf1); + * // Prints: + * + * const buf2 = Buffer.from([0x1, 0x2, 0x3]); + * + * buf2.swap64(); + * // Throws ERR_INVALID_BUFFER_SIZE. + * ``` + * @since v6.3.0 + * @return A reference to `buf`. + */ + swap64(): this; + /** + * Writes `value` to `buf` at the specified `offset`. `value` must be a + * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything + * other than an unsigned 8-bit integer. + * + * This function is also available under the `writeUint8` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt8(0x3, 0); + * buf.writeUInt8(0x4, 1); + * buf.writeUInt8(0x23, 2); + * buf.writeUInt8(0x42, 3); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. + * @return `offset` plus the number of bytes written. + */ + writeUInt8(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt8 + * @since v14.9.0, v12.19.0 + */ + writeUint8(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is + * anything other than an unsigned 16-bit integer. + * + * This function is also available under the `writeUint16LE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt16LE(0xdead, 0); + * buf.writeUInt16LE(0xbeef, 2); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeUInt16LE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt16LE + * @since v14.9.0, v12.19.0 + */ + writeUint16LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an + * unsigned 16-bit integer. + * + * This function is also available under the `writeUint16BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt16BE(0xdead, 0); + * buf.writeUInt16BE(0xbeef, 2); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeUInt16BE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt16BE + * @since v14.9.0, v12.19.0 + */ + writeUint16BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is + * anything other than an unsigned 32-bit integer. + * + * This function is also available under the `writeUint32LE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt32LE(0xfeedface, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeUInt32LE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt32LE + * @since v14.9.0, v12.19.0 + */ + writeUint32LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an + * unsigned 32-bit integer. + * + * This function is also available under the `writeUint32BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt32BE(0xfeedface, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeUInt32BE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt32BE + * @since v14.9.0, v12.19.0 + */ + writeUint32BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset`. `value` must be a valid + * signed 8-bit integer. Behavior is undefined when `value` is anything other than + * a signed 8-bit integer. + * + * `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(2); + * + * buf.writeInt8(2, 0); + * buf.writeInt8(-2, 1); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. + * @return `offset` plus the number of bytes written. + */ + writeInt8(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid signed 16-bit integer. Behavior is undefined when `value` is + * anything other than a signed 16-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(2); + * + * buf.writeInt16LE(0x0304, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeInt16LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid signed 16-bit integer. Behavior is undefined when `value` is + * anything other than a signed 16-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(2); + * + * buf.writeInt16BE(0x0102, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeInt16BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid signed 32-bit integer. Behavior is undefined when `value` is + * anything other than a signed 32-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeInt32LE(0x05060708, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeInt32LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid signed 32-bit integer. Behavior is undefined when `value` is + * anything other than a signed 32-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeInt32BE(0x01020304, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeInt32BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is + * undefined when `value` is anything other than a JavaScript number. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeFloatLE(0xcafebabe, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeFloatLE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is + * undefined when `value` is anything other than a JavaScript number. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeFloatBE(0xcafebabe, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeFloatBE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a JavaScript number. Behavior is undefined when `value` is anything + * other than a JavaScript number. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeDoubleLE(123.456, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeDoubleLE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a JavaScript number. Behavior is undefined when `value` is anything + * other than a JavaScript number. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeDoubleBE(123.456, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeDoubleBE(value: number, offset?: number): number; + /** + * Fills `buf` with the specified `value`. If the `offset` and `end` are not given, + * the entire `buf` will be filled: + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Fill a `Buffer` with the ASCII character 'h'. + * + * const b = Buffer.allocUnsafe(50).fill('h'); + * + * console.log(b.toString()); + * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh + * + * // Fill a buffer with empty string + * const c = Buffer.allocUnsafe(5).fill(''); + * + * console.log(c.fill('')); + * // Prints: + * ``` + * + * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or + * integer. If the resulting integer is greater than `255` (decimal), `buf` will be + * filled with `value & 255`. + * + * If the final write of a `fill()` operation falls on a multi-byte character, + * then only the bytes of that character that fit into `buf` are written: + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Fill a `Buffer` with character that takes up two bytes in UTF-8. + * + * console.log(Buffer.allocUnsafe(5).fill('\u0222')); + * // Prints: + * ``` + * + * If `value` contains invalid characters, it is truncated; if no valid + * fill data remains, an exception is thrown: + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(5); + * + * console.log(buf.fill('a')); + * // Prints: + * console.log(buf.fill('aazz', 'hex')); + * // Prints: + * console.log(buf.fill('zz', 'hex')); + * // Throws an exception. + * ``` + * @since v0.5.0 + * @param value The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`. + * @param [offset=0] Number of bytes to skip before starting to fill `buf`. + * @param [end=buf.length] Where to stop filling `buf` (not inclusive). + * @param [encoding='utf8'] The encoding for `value` if `value` is a string. + * @return A reference to `buf`. + */ + fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; + fill(value: string | Uint8Array | number, offset: number, encoding: BufferEncoding): this; + fill(value: string | Uint8Array | number, encoding: BufferEncoding): this; + /** + * If `value` is: + * + * * a string, `value` is interpreted according to the character encoding in `encoding`. + * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. + * To compare a partial `Buffer`, use `buf.subarray`. + * * a number, `value` will be interpreted as an unsigned 8-bit integer + * value between `0` and `255`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('this is a buffer'); + * + * console.log(buf.indexOf('this')); + * // Prints: 0 + * console.log(buf.indexOf('is')); + * // Prints: 2 + * console.log(buf.indexOf(Buffer.from('a buffer'))); + * // Prints: 8 + * console.log(buf.indexOf(97)); + * // Prints: 8 (97 is the decimal ASCII value for 'a') + * console.log(buf.indexOf(Buffer.from('a buffer example'))); + * // Prints: -1 + * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); + * // Prints: 8 + * + * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); + * + * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); + * // Prints: 4 + * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); + * // Prints: 6 + * ``` + * + * If `value` is not a string, number, or `Buffer`, this method will throw a `TypeError`. If `value` is a number, it will be coerced to a valid byte value, + * an integer between 0 and 255. + * + * If `byteOffset` is not a number, it will be coerced to a number. If the result + * of coercion is `NaN` or `0`, then the entire buffer will be searched. This + * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const b = Buffer.from('abcdef'); + * + * // Passing a value that's a number, but not a valid byte. + * // Prints: 2, equivalent to searching for 99 or 'c'. + * console.log(b.indexOf(99.9)); + * console.log(b.indexOf(256 + 99)); + * + * // Passing a byteOffset that coerces to NaN or 0. + * // Prints: 1, searching the whole buffer. + * console.log(b.indexOf('b', undefined)); + * console.log(b.indexOf('b', {})); + * console.log(b.indexOf('b', null)); + * console.log(b.indexOf('b', [])); + * ``` + * + * If `value` is an empty string or empty `Buffer` and `byteOffset` is less + * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. + * @since v1.5.0 + * @param value What to search for. + * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. + * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. + * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. + */ + indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + indexOf(value: string | number | Uint8Array, encoding: BufferEncoding): number; + /** + * Identical to `buf.indexOf()`, except the last occurrence of `value` is found + * rather than the first occurrence. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('this buffer is a buffer'); + * + * console.log(buf.lastIndexOf('this')); + * // Prints: 0 + * console.log(buf.lastIndexOf('buffer')); + * // Prints: 17 + * console.log(buf.lastIndexOf(Buffer.from('buffer'))); + * // Prints: 17 + * console.log(buf.lastIndexOf(97)); + * // Prints: 15 (97 is the decimal ASCII value for 'a') + * console.log(buf.lastIndexOf(Buffer.from('yolo'))); + * // Prints: -1 + * console.log(buf.lastIndexOf('buffer', 5)); + * // Prints: 5 + * console.log(buf.lastIndexOf('buffer', 4)); + * // Prints: -1 + * + * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); + * + * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); + * // Prints: 6 + * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); + * // Prints: 4 + * ``` + * + * If `value` is not a string, number, or `Buffer`, this method will throw a `TypeError`. If `value` is a number, it will be coerced to a valid byte value, + * an integer between 0 and 255. + * + * If `byteOffset` is not a number, it will be coerced to a number. Any arguments + * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. + * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const b = Buffer.from('abcdef'); + * + * // Passing a value that's a number, but not a valid byte. + * // Prints: 2, equivalent to searching for 99 or 'c'. + * console.log(b.lastIndexOf(99.9)); + * console.log(b.lastIndexOf(256 + 99)); + * + * // Passing a byteOffset that coerces to NaN. + * // Prints: 1, searching the whole buffer. + * console.log(b.lastIndexOf('b', undefined)); + * console.log(b.lastIndexOf('b', {})); + * + * // Passing a byteOffset that coerces to 0. + * // Prints: -1, equivalent to passing 0. + * console.log(b.lastIndexOf('b', null)); + * console.log(b.lastIndexOf('b', [])); + * ``` + * + * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. + * @since v6.0.0 + * @param value What to search for. + * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. + * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. + * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. + */ + lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + lastIndexOf(value: string | number | Uint8Array, encoding: BufferEncoding): number; + /** + * Equivalent to `buf.indexOf() !== -1`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('this is a buffer'); + * + * console.log(buf.includes('this')); + * // Prints: true + * console.log(buf.includes('is')); + * // Prints: true + * console.log(buf.includes(Buffer.from('a buffer'))); + * // Prints: true + * console.log(buf.includes(97)); + * // Prints: true (97 is the decimal ASCII value for 'a') + * console.log(buf.includes(Buffer.from('a buffer example'))); + * // Prints: false + * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); + * // Prints: true + * console.log(buf.includes('this', 4)); + * // Prints: false + * ``` + * @since v5.3.0 + * @param value What to search for. + * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. + * @param [encoding='utf8'] If `value` is a string, this is its encoding. + * @return `true` if `value` was found in `buf`, `false` otherwise. + */ + includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; + includes(value: string | number | Buffer, encoding: BufferEncoding): boolean; + } + var Buffer: BufferConstructor; + } + // #region web types + export type BlobPart = NodeJS.BufferSource | Blob | string; + export interface BlobPropertyBag { + endings?: "native" | "transparent"; + type?: string; + } + export interface FilePropertyBag extends BlobPropertyBag { + lastModified?: number; + } + export interface Blob { + readonly size: number; + readonly type: string; + arrayBuffer(): Promise; + bytes(): Promise; + slice(start?: number, end?: number, contentType?: string): Blob; + stream(): ReadableStream; + text(): Promise; + } + export var Blob: { + prototype: Blob; + new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob; + }; + export interface File extends Blob { + readonly lastModified: number; + readonly name: string; + readonly webkitRelativePath: string; + } + export var File: { + prototype: File; + new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File; + }; + export import atob = globalThis.atob; + export import btoa = globalThis.btoa; + // #endregion +} +declare module "buffer" { + export * from "node:buffer"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/child_process.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/child_process.d.ts new file mode 100644 index 0000000..d71fed1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/child_process.d.ts @@ -0,0 +1,1433 @@ +/** + * The `node:child_process` module provides the ability to spawn subprocesses in + * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability + * is primarily provided by the {@link spawn} function: + * + * ```js + * import { spawn } from 'node:child_process'; + * import { once } from 'node:events'; + * const ls = spawn('ls', ['-lh', '/usr']); + * + * ls.stdout.on('data', (data) => { + * console.log(`stdout: ${data}`); + * }); + * + * ls.stderr.on('data', (data) => { + * console.error(`stderr: ${data}`); + * }); + * + * const [code] = await once(ls, 'close'); + * console.log(`child process exited with code ${code}`); + * ``` + * + * By default, pipes for `stdin`, `stdout`, and `stderr` are established between + * the parent Node.js process and the spawned subprocess. These pipes have + * limited (and platform-specific) capacity. If the subprocess writes to + * stdout in excess of that limit without the output being captured, the + * subprocess blocks, waiting for the pipe buffer to accept more data. This is + * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }` option if the output will not be consumed. + * + * The command lookup is performed using the `options.env.PATH` environment + * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is + * used. If `options.env` is set without `PATH`, lookup on Unix is performed + * on a default search path search of `/usr/bin:/bin` (see your operating system's + * manual for execvpe/execvp), on Windows the current processes environment + * variable `PATH` is used. + * + * On Windows, environment variables are case-insensitive. Node.js + * lexicographically sorts the `env` keys and uses the first one that + * case-insensitively matches. Only first (in lexicographic order) entry will be + * passed to the subprocess. This might lead to issues on Windows when passing + * objects to the `env` option that have multiple variants of the same key, such as `PATH` and `Path`. + * + * The {@link spawn} method spawns the child process asynchronously, + * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks + * the event loop until the spawned process either exits or is terminated. + * + * For convenience, the `node:child_process` module provides a handful of + * synchronous and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on + * top of {@link spawn} or {@link spawnSync}. + * + * * {@link exec}: spawns a shell and runs a command within that + * shell, passing the `stdout` and `stderr` to a callback function when + * complete. + * * {@link execFile}: similar to {@link exec} except + * that it spawns the command directly without first spawning a shell by + * default. + * * {@link fork}: spawns a new Node.js process and invokes a + * specified module with an IPC communication channel established that allows + * sending messages between parent and child. + * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop. + * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop. + * + * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, + * the synchronous methods can have significant impact on performance due to + * stalling the event loop while spawned processes complete. + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/child_process.js) + */ +declare module "node:child_process" { + import { NonSharedBuffer } from "node:buffer"; + import * as dgram from "node:dgram"; + import { Abortable, EventEmitter, InternalEventEmitter } from "node:events"; + import * as net from "node:net"; + import { Readable, Stream, Writable } from "node:stream"; + import { URL } from "node:url"; + type Serializable = string | object | number | boolean | bigint; + type SendHandle = net.Socket | net.Server | dgram.Socket | undefined; + interface ChildProcessEventMap { + "close": [code: number | null, signal: NodeJS.Signals | null]; + "disconnect": []; + "error": [err: Error]; + "exit": [code: number | null, signal: NodeJS.Signals | null]; + "message": [message: Serializable, sendHandle: SendHandle]; + "spawn": []; + } + /** + * Instances of the `ChildProcess` represent spawned child processes. + * + * Instances of `ChildProcess` are not intended to be created directly. Rather, + * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create + * instances of `ChildProcess`. + * @since v2.2.0 + */ + class ChildProcess implements EventEmitter { + /** + * A `Writable Stream` that represents the child process's `stdin`. + * + * If a child process waits to read all of its input, the child will not continue + * until this stream has been closed via `end()`. + * + * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, + * then this will be `null`. + * + * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will + * refer to the same value. + * + * The `subprocess.stdin` property can be `null` or `undefined` if the child process could not be successfully spawned. + * @since v0.1.90 + */ + stdin: Writable | null; + /** + * A `Readable Stream` that represents the child process's `stdout`. + * + * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, + * then this will be `null`. + * + * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will + * refer to the same value. + * + * ```js + * import { spawn } from 'node:child_process'; + * + * const subprocess = spawn('ls'); + * + * subprocess.stdout.on('data', (data) => { + * console.log(`Received chunk ${data}`); + * }); + * ``` + * + * The `subprocess.stdout` property can be `null` or `undefined` if the child process could not be successfully spawned. + * @since v0.1.90 + */ + stdout: Readable | null; + /** + * A `Readable Stream` that represents the child process's `stderr`. + * + * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, + * then this will be `null`. + * + * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will + * refer to the same value. + * + * The `subprocess.stderr` property can be `null` or `undefined` if the child process could not be successfully spawned. + * @since v0.1.90 + */ + stderr: Readable | null; + /** + * The `subprocess.channel` property is a reference to the child's IPC channel. If + * no IPC channel exists, this property is `undefined`. + * @since v7.1.0 + */ + readonly channel?: Control | null; + /** + * A sparse array of pipes to the child process, corresponding with positions in + * the `stdio` option passed to {@link spawn} that have been set + * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and `subprocess.stdio[2]` are also available as `subprocess.stdin`, `subprocess.stdout`, and `subprocess.stderr`, + * respectively. + * + * In the following example, only the child's fd `1` (stdout) is configured as a + * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values + * in the array are `null`. + * + * ```js + * import assert from 'node:assert'; + * import fs from 'node:fs'; + * import child_process from 'node:child_process'; + * + * const subprocess = child_process.spawn('ls', { + * stdio: [ + * 0, // Use parent's stdin for child. + * 'pipe', // Pipe child's stdout to parent. + * fs.openSync('err.out', 'w'), // Direct child's stderr to a file. + * ], + * }); + * + * assert.strictEqual(subprocess.stdio[0], null); + * assert.strictEqual(subprocess.stdio[0], subprocess.stdin); + * + * assert(subprocess.stdout); + * assert.strictEqual(subprocess.stdio[1], subprocess.stdout); + * + * assert.strictEqual(subprocess.stdio[2], null); + * assert.strictEqual(subprocess.stdio[2], subprocess.stderr); + * ``` + * + * The `subprocess.stdio` property can be `undefined` if the child process could + * not be successfully spawned. + * @since v0.7.10 + */ + readonly stdio: [ + Writable | null, + // stdin + Readable | null, + // stdout + Readable | null, + // stderr + Readable | Writable | null | undefined, + // extra + Readable | Writable | null | undefined, // extra + ]; + /** + * The `subprocess.killed` property indicates whether the child process + * successfully received a signal from `subprocess.kill()`. The `killed` property + * does not indicate that the child process has been terminated. + * @since v0.5.10 + */ + readonly killed: boolean; + /** + * Returns the process identifier (PID) of the child process. If the child process + * fails to spawn due to errors, then the value is `undefined` and `error` is + * emitted. + * + * ```js + * import { spawn } from 'node:child_process'; + * const grep = spawn('grep', ['ssh']); + * + * console.log(`Spawned child pid: ${grep.pid}`); + * grep.stdin.end(); + * ``` + * @since v0.1.90 + */ + readonly pid?: number | undefined; + /** + * The `subprocess.connected` property indicates whether it is still possible to + * send and receive messages from a child process. When `subprocess.connected` is `false`, it is no longer possible to send or receive messages. + * @since v0.7.2 + */ + readonly connected: boolean; + /** + * The `subprocess.exitCode` property indicates the exit code of the child process. + * If the child process is still running, the field will be `null`. + * + * When the child process is terminated by a signal, `subprocess.exitCode` will be + * `null` and `subprocess.signalCode` will be set. To get the corresponding + * POSIX exit code, use + * `util.convertProcessSignalToExitCode(subprocess.signalCode)`. + */ + readonly exitCode: number | null; + /** + * The `subprocess.signalCode` property indicates the signal received by + * the child process if any, else `null`. + */ + readonly signalCode: NodeJS.Signals | null; + /** + * The `subprocess.spawnargs` property represents the full list of command-line + * arguments the child process was launched with. + */ + readonly spawnargs: string[]; + /** + * The `subprocess.spawnfile` property indicates the executable file name of + * the child process that is launched. + * + * For {@link fork}, its value will be equal to `process.execPath`. + * For {@link spawn}, its value will be the name of + * the executable file. + * For {@link exec}, its value will be the name of the shell + * in which the child process is launched. + */ + readonly spawnfile: string; + /** + * The `subprocess.kill()` method sends a signal to the child process. If no + * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function + * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise. + * + * ```js + * import { spawn } from 'node:child_process'; + * const grep = spawn('grep', ['ssh']); + * + * grep.on('close', (code, signal) => { + * console.log( + * `child process terminated due to receipt of signal ${signal}`); + * }); + * + * // Send SIGHUP to process. + * grep.kill('SIGHUP'); + * ``` + * + * The `ChildProcess` object may emit an `'error'` event if the signal + * cannot be delivered. Sending a signal to a child process that has already exited + * is not an error but may have unforeseen consequences. Specifically, if the + * process identifier (PID) has been reassigned to another process, the signal will + * be delivered to that process instead which can have unexpected results. + * + * While the function is called `kill`, the signal delivered to the child process + * may not actually terminate the process. + * + * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. + * + * On Windows, where POSIX signals do not exist, the `signal` argument will be + * ignored, and the process will be killed forcefully and abruptly (similar to `'SIGKILL'`). + * See `Signal Events` for more details. + * + * On Linux, child processes of child processes will not be terminated + * when attempting to kill their parent. This is likely to happen when running a + * new process in a shell or with the use of the `shell` option of `ChildProcess`: + * + * ```js + * 'use strict'; + * import { spawn } from 'node:child_process'; + * + * const subprocess = spawn( + * 'sh', + * [ + * '-c', + * `node -e "setInterval(() => { + * console.log(process.pid, 'is alive') + * }, 500);"`, + * ], { + * stdio: ['inherit', 'inherit', 'inherit'], + * }, + * ); + * + * setTimeout(() => { + * subprocess.kill(); // Does not terminate the Node.js process in the shell. + * }, 2000); + * ``` + * @since v0.1.90 + */ + kill(signal?: NodeJS.Signals | number): boolean; + /** + * Calls {@link ChildProcess.kill} with `'SIGTERM'`. + * @since v20.5.0 + */ + [Symbol.dispose](): void; + /** + * When an IPC channel has been established between the parent and child ( + * i.e. when using {@link fork}), the `subprocess.send()` method can + * be used to send messages to the child process. When the child process is a + * Node.js instance, these messages can be received via the `'message'` event. + * + * The message goes through serialization and parsing. The resulting + * message might not be the same as what is originally sent. + * + * For example, in the parent script: + * + * ```js + * import cp from 'node:child_process'; + * const n = cp.fork(`${__dirname}/sub.js`); + * + * n.on('message', (m) => { + * console.log('PARENT got message:', m); + * }); + * + * // Causes the child to print: CHILD got message: { hello: 'world' } + * n.send({ hello: 'world' }); + * ``` + * + * And then the child script, `'sub.js'` might look like this: + * + * ```js + * process.on('message', (m) => { + * console.log('CHILD got message:', m); + * }); + * + * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null } + * process.send({ foo: 'bar', baz: NaN }); + * ``` + * + * Child Node.js processes will have a `process.send()` method of their own + * that allows the child to send messages back to the parent. + * + * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages + * containing a `NODE_` prefix in the `cmd` property are reserved for use within + * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the `'internalMessage'` event and are consumed internally by Node.js. + * Applications should avoid using such messages or listening for `'internalMessage'` events as it is subject to change without notice. + * + * The optional `sendHandle` argument that may be passed to `subprocess.send()` is + * for passing a TCP server or socket object to the child process. The child will + * receive the object as the second argument passed to the callback function + * registered on the `'message'` event. Any data that is received and buffered in + * the socket will not be sent to the child. Sending IPC sockets is not supported on Windows. + * + * The optional `callback` is a function that is invoked after the message is + * sent but before the child may have received it. The function is called with a + * single argument: `null` on success, or an `Error` object on failure. + * + * If no `callback` function is provided and the message cannot be sent, an `'error'` event will be emitted by the `ChildProcess` object. This can + * happen, for instance, when the child process has already exited. + * + * `subprocess.send()` will return `false` if the channel has closed or when the + * backlog of unsent messages exceeds a threshold that makes it unwise to send + * more. Otherwise, the method returns `true`. The `callback` function can be + * used to implement flow control. + * + * #### Example: sending a server object + * + * The `sendHandle` argument can be used, for instance, to pass the handle of + * a TCP server object to the child process as illustrated in the example below: + * + * ```js + * import { createServer } from 'node:net'; + * import { fork } from 'node:child_process'; + * const subprocess = fork('subprocess.js'); + * + * // Open up the server object and send the handle. + * const server = createServer(); + * server.on('connection', (socket) => { + * socket.end('handled by parent'); + * }); + * server.listen(1337, () => { + * subprocess.send('server', server); + * }); + * ``` + * + * The child would then receive the server object as: + * + * ```js + * process.on('message', (m, server) => { + * if (m === 'server') { + * server.on('connection', (socket) => { + * socket.end('handled by child'); + * }); + * } + * }); + * ``` + * + * Once the server is now shared between the parent and child, some connections + * can be handled by the parent and some by the child. + * + * While the example above uses a server created using the `node:net` module, `node:dgram` module servers use exactly the same workflow with the exceptions of + * listening on a `'message'` event instead of `'connection'` and using `server.bind()` instead of `server.listen()`. This is, however, only + * supported on Unix platforms. + * + * #### Example: sending a socket object + * + * Similarly, the `sendHandler` argument can be used to pass the handle of a + * socket to the child process. The example below spawns two children that each + * handle connections with "normal" or "special" priority: + * + * ```js + * import { createServer } from 'node:net'; + * import { fork } from 'node:child_process'; + * const normal = fork('subprocess.js', ['normal']); + * const special = fork('subprocess.js', ['special']); + * + * // Open up the server and send sockets to child. Use pauseOnConnect to prevent + * // the sockets from being read before they are sent to the child process. + * const server = createServer({ pauseOnConnect: true }); + * server.on('connection', (socket) => { + * + * // If this is special priority... + * if (socket.remoteAddress === '74.125.127.100') { + * special.send('socket', socket); + * return; + * } + * // This is normal priority. + * normal.send('socket', socket); + * }); + * server.listen(1337); + * ``` + * + * The `subprocess.js` would receive the socket handle as the second argument + * passed to the event callback function: + * + * ```js + * process.on('message', (m, socket) => { + * if (m === 'socket') { + * if (socket) { + * // Check that the client socket exists. + * // It is possible for the socket to be closed between the time it is + * // sent and the time it is received in the child process. + * socket.end(`Request handled with ${process.argv[2]} priority`); + * } + * } + * }); + * ``` + * + * Do not use `.maxConnections` on a socket that has been passed to a subprocess. + * The parent cannot track when the socket is destroyed. + * + * Any `'message'` handlers in the subprocess should verify that `socket` exists, + * as the connection may have been closed during the time it takes to send the + * connection to the child. + * @since v0.5.9 + * @param sendHandle `undefined`, or a [`net.Socket`](https://nodejs.org/docs/latest-v25.x/api/net.html#class-netsocket), [`net.Server`](https://nodejs.org/docs/latest-v25.x/api/net.html#class-netserver), or [`dgram.Socket`](https://nodejs.org/docs/latest-v25.x/api/dgram.html#class-dgramsocket) object. + * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: + */ + send(message: Serializable, callback?: (error: Error | null) => void): boolean; + send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; + send( + message: Serializable, + sendHandle?: SendHandle, + options?: MessageOptions, + callback?: (error: Error | null) => void, + ): boolean; + /** + * Closes the IPC channel between parent and child, allowing the child to exit + * gracefully once there are no other connections keeping it alive. After calling + * this method the `subprocess.connected` and `process.connected` properties in + * both the parent and child (respectively) will be set to `false`, and it will be + * no longer possible to pass messages between the processes. + * + * The `'disconnect'` event will be emitted when there are no messages in the + * process of being received. This will most often be triggered immediately after + * calling `subprocess.disconnect()`. + * + * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked + * within the child process to close the IPC channel as well. + * @since v0.7.2 + */ + disconnect(): void; + /** + * By default, the parent will wait for the detached child to exit. To prevent the + * parent from waiting for a given `subprocess` to exit, use the `subprocess.unref()` method. Doing so will cause the parent's event loop to not + * include the child in its reference count, allowing the parent to exit + * independently of the child, unless there is an established IPC channel between + * the child and the parent. + * + * ```js + * import { spawn } from 'node:child_process'; + * + * const subprocess = spawn(process.argv[0], ['child_program.js'], { + * detached: true, + * stdio: 'ignore', + * }); + * + * subprocess.unref(); + * ``` + * @since v0.7.10 + */ + unref(): void; + /** + * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will + * restore the removed reference count for the child process, forcing the parent + * to wait for the child to exit before exiting itself. + * + * ```js + * import { spawn } from 'node:child_process'; + * + * const subprocess = spawn(process.argv[0], ['child_program.js'], { + * detached: true, + * stdio: 'ignore', + * }); + * + * subprocess.unref(); + * subprocess.ref(); + * ``` + * @since v0.7.10 + */ + ref(): void; + } + interface ChildProcess extends InternalEventEmitter {} + // return this object when stdio option is undefined or not specified + interface ChildProcessWithoutNullStreams extends ChildProcess { + stdin: Writable; + stdout: Readable; + stderr: Readable; + readonly stdio: [ + Writable, + Readable, + Readable, + // stderr + Readable | Writable | null | undefined, + // extra, no modification + Readable | Writable | null | undefined, // extra, no modification + ]; + } + // return this object when stdio option is a tuple of 3 + interface ChildProcessByStdio + extends ChildProcess + { + stdin: I; + stdout: O; + stderr: E; + readonly stdio: [ + I, + O, + E, + Readable | Writable | null | undefined, + // extra, no modification + Readable | Writable | null | undefined, // extra, no modification + ]; + } + interface Control extends EventEmitter { + ref(): void; + unref(): void; + } + interface MessageOptions { + keepOpen?: boolean | undefined; + } + type IOType = "overlapped" | "pipe" | "ignore" | "inherit"; + type StdioOptions = IOType | Array; + type SerializationType = "json" | "advanced"; + interface MessagingOptions extends Abortable { + /** + * Specify the kind of serialization used for sending messages between processes. + * @default 'json' + */ + serialization?: SerializationType | undefined; + /** + * The signal value to be used when the spawned process will be killed by the abort signal. + * @default 'SIGTERM' + */ + killSignal?: NodeJS.Signals | number | undefined; + /** + * In milliseconds the maximum amount of time the process is allowed to run. + */ + timeout?: number | undefined; + } + interface ProcessEnvOptions { + uid?: number | undefined; + gid?: number | undefined; + cwd?: string | URL | undefined; + env?: NodeJS.ProcessEnv | undefined; + } + interface CommonOptions extends ProcessEnvOptions { + /** + * @default false + */ + windowsHide?: boolean | undefined; + /** + * @default 0 + */ + timeout?: number | undefined; + } + interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { + argv0?: string | undefined; + /** + * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. + * If passed as an array, the first element is used for `stdin`, the second for + * `stdout`, and the third for `stderr`. A fourth element can be used to + * specify the `stdio` behavior beyond the standard streams. See + * {@link ChildProcess.stdio} for more information. + * + * @default 'pipe' + */ + stdio?: StdioOptions | undefined; + shell?: boolean | string | undefined; + windowsVerbatimArguments?: boolean | undefined; + } + interface SpawnOptions extends CommonSpawnOptions { + detached?: boolean | undefined; + } + interface SpawnOptionsWithoutStdio extends SpawnOptions { + stdio?: StdioPipeNamed | StdioPipe[] | undefined; + } + type StdioNull = "inherit" | "ignore" | Stream; + type StdioPipeNamed = "pipe" | "overlapped"; + type StdioPipe = undefined | null | StdioPipeNamed; + interface SpawnOptionsWithStdioTuple< + Stdin extends StdioNull | StdioPipe, + Stdout extends StdioNull | StdioPipe, + Stderr extends StdioNull | StdioPipe, + > extends SpawnOptions { + stdio: [Stdin, Stdout, Stderr]; + } + /** + * The `child_process.spawn()` method spawns a new process using the given `command`, with command-line arguments in `args`. If omitted, `args` defaults + * to an empty array. + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * + * A third argument may be used to specify additional options, with these defaults: + * + * ```js + * const defaults = { + * cwd: undefined, + * env: process.env, + * }; + * ``` + * + * Use `cwd` to specify the working directory from which the process is spawned. + * If not given, the default is to inherit the current working directory. If given, + * but the path does not exist, the child process emits an `ENOENT` error + * and exits immediately. `ENOENT` is also emitted when the command + * does not exist. + * + * Use `env` to specify environment variables that will be visible to the new + * process, the default is `process.env`. + * + * `undefined` values in `env` will be ignored. + * + * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the + * exit code: + * + * ```js + * import { spawn } from 'node:child_process'; + * import { once } from 'node:events'; + * const ls = spawn('ls', ['-lh', '/usr']); + * + * ls.stdout.on('data', (data) => { + * console.log(`stdout: ${data}`); + * }); + * + * ls.stderr.on('data', (data) => { + * console.error(`stderr: ${data}`); + * }); + * + * const [code] = await once(ls, 'close'); + * console.log(`child process exited with code ${code}`); + * ``` + * + * Example: A very elaborate way to run `ps ax | grep ssh` + * + * ```js + * import { spawn } from 'node:child_process'; + * const ps = spawn('ps', ['ax']); + * const grep = spawn('grep', ['ssh']); + * + * ps.stdout.on('data', (data) => { + * grep.stdin.write(data); + * }); + * + * ps.stderr.on('data', (data) => { + * console.error(`ps stderr: ${data}`); + * }); + * + * ps.on('close', (code) => { + * if (code !== 0) { + * console.log(`ps process exited with code ${code}`); + * } + * grep.stdin.end(); + * }); + * + * grep.stdout.on('data', (data) => { + * console.log(data.toString()); + * }); + * + * grep.stderr.on('data', (data) => { + * console.error(`grep stderr: ${data}`); + * }); + * + * grep.on('close', (code) => { + * if (code !== 0) { + * console.log(`grep process exited with code ${code}`); + * } + * }); + * ``` + * + * Example of checking for failed `spawn`: + * + * ```js + * import { spawn } from 'node:child_process'; + * const subprocess = spawn('bad_command'); + * + * subprocess.on('error', (err) => { + * console.error('Failed to start subprocess.'); + * }); + * ``` + * + * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process + * title while others (Windows, SunOS) will use `command`. + * + * Node.js overwrites `argv[0]` with `process.execPath` on startup, so `process.argv[0]` in a Node.js child process will not match the `argv0` parameter passed to `spawn` from the parent. Retrieve + * it with the `process.argv0` property instead. + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * import { spawn } from 'node:child_process'; + * const controller = new AbortController(); + * const { signal } = controller; + * const grep = spawn('grep', ['ssh'], { signal }); + * grep.on('error', (err) => { + * // This will be called with err being an AbortError if the controller aborts + * }); + * controller.abort(); // Stops the child process + * ``` + * @since v0.1.90 + * @param command The command to run. + * @param args List of string arguments. + */ + function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptions): ChildProcess; + // overloads of spawn with 'args' + function spawn( + command: string, + args?: readonly string[], + options?: SpawnOptionsWithoutStdio, + ): ChildProcessWithoutNullStreams; + function spawn( + command: string, + args: readonly string[], + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + args: readonly string[], + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + args: readonly string[], + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + args: readonly string[], + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + args: readonly string[], + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + args: readonly string[], + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + args: readonly string[], + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + args: readonly string[], + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn(command: string, args: readonly string[], options: SpawnOptions): ChildProcess; + interface ExecOptions extends CommonOptions { + shell?: string | undefined; + signal?: AbortSignal | undefined; + maxBuffer?: number | undefined; + killSignal?: NodeJS.Signals | number | undefined; + encoding?: string | null | undefined; + } + interface ExecOptionsWithStringEncoding extends ExecOptions { + encoding?: BufferEncoding | undefined; + } + interface ExecOptionsWithBufferEncoding extends ExecOptions { + encoding: "buffer" | null; // specify `null`. + } + // TODO: Just Plain Wrong™ (see also nodejs/node#57392) + interface ExecException extends Error { + cmd?: string; + killed?: boolean; + code?: number; + signal?: NodeJS.Signals; + stdout?: string; + stderr?: string; + } + /** + * Spawns a shell then executes the `command` within that shell, buffering any + * generated output. The `command` string passed to the exec function is processed + * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) + * need to be dealt with accordingly: + * + * ```js + * import { exec } from 'node:child_process'; + * + * exec('"/path/to/test file/test.sh" arg1 arg2'); + * // Double quotes are used so that the space in the path is not interpreted as + * // a delimiter of multiple arguments. + * + * exec('echo "The \\$HOME variable is $HOME"'); + * // The $HOME variable is escaped in the first instance, but not in the second. + * ``` + * + * **Never pass unsanitized user input to this function. Any input containing shell** + * **metacharacters may be used to trigger arbitrary command execution.** + * + * If a `callback` function is provided, it is called with the arguments `(error, stdout, stderr)`. On success, `error` will be `null`. On error, `error` will be an instance of `Error`. The + * `error.code` property will be + * the exit code of the process. By convention, any exit code other than `0` indicates an error. `error.signal` will be the signal that terminated the + * process. + * + * The `stdout` and `stderr` arguments passed to the callback will contain the + * stdout and stderr output of the child process. By default, Node.js will decode + * the output as UTF-8 and pass strings to the callback. The `encoding` option + * can be used to specify the character encoding used to decode the stdout and + * stderr output. If `encoding` is `'buffer'`, or an unrecognized character + * encoding, `Buffer` objects will be passed to the callback instead. + * + * ```js + * import { exec } from 'node:child_process'; + * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => { + * if (error) { + * console.error(`exec error: ${error}`); + * return; + * } + * console.log(`stdout: ${stdout}`); + * console.error(`stderr: ${stderr}`); + * }); + * ``` + * + * If `timeout` is greater than `0`, the parent will send the signal + * identified by the `killSignal` property (the default is `'SIGTERM'`) if the + * child runs longer than `timeout` milliseconds. + * + * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace + * the existing process and uses a shell to execute the command. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned `ChildProcess` instance is attached to the `Promise` as a `child` property. In + * case of an error (including any error resulting in an exit code other than 0), a + * rejected promise is returned, with the same `error` object given in the + * callback, but with two additional properties `stdout` and `stderr`. + * + * ```js + * import util from 'node:util'; + * import child_process from 'node:child_process'; + * const exec = util.promisify(child_process.exec); + * + * async function lsExample() { + * const { stdout, stderr } = await exec('ls'); + * console.log('stdout:', stdout); + * console.error('stderr:', stderr); + * } + * lsExample(); + * ``` + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * import { exec } from 'node:child_process'; + * const controller = new AbortController(); + * const { signal } = controller; + * const child = exec('grep ssh', { signal }, (error) => { + * console.error(error); // an AbortError + * }); + * controller.abort(); + * ``` + * @since v0.1.90 + * @param command The command to run, with space-separated arguments. + * @param callback called with the output when process terminates. + */ + function exec( + command: string, + callback?: (error: ExecException | null, stdout: string, stderr: string) => void, + ): ChildProcess; + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + function exec( + command: string, + options: ExecOptionsWithBufferEncoding, + callback?: (error: ExecException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void, + ): ChildProcess; + // `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`. + function exec( + command: string, + options: ExecOptionsWithStringEncoding, + callback?: (error: ExecException | null, stdout: string, stderr: string) => void, + ): ChildProcess; + // fallback if nothing else matches. Worst case is always `string | Buffer`. + function exec( + command: string, + options: ExecOptions | undefined | null, + callback?: ( + error: ExecException | null, + stdout: string | NonSharedBuffer, + stderr: string | NonSharedBuffer, + ) => void, + ): ChildProcess; + interface PromiseWithChild extends Promise { + child: ChildProcess; + } + namespace exec { + function __promisify__(command: string): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + command: string, + options: ExecOptionsWithBufferEncoding, + ): PromiseWithChild<{ + stdout: NonSharedBuffer; + stderr: NonSharedBuffer; + }>; + function __promisify__( + command: string, + options: ExecOptionsWithStringEncoding, + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + command: string, + options: ExecOptions | undefined | null, + ): PromiseWithChild<{ + stdout: string | NonSharedBuffer; + stderr: string | NonSharedBuffer; + }>; + } + interface ExecFileOptions extends CommonOptions, Abortable { + maxBuffer?: number | undefined; + killSignal?: NodeJS.Signals | number | undefined; + windowsVerbatimArguments?: boolean | undefined; + shell?: boolean | string | undefined; + signal?: AbortSignal | undefined; + encoding?: string | null | undefined; + } + interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { + encoding?: BufferEncoding | undefined; + } + interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { + encoding: "buffer" | null; + } + /** @deprecated Use `ExecFileOptions` instead. */ + interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {} + // TODO: execFile exceptions can take many forms... this accurately describes none of them + type ExecFileException = + & Omit + & Omit + & { code?: string | number | null }; + /** + * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified + * executable `file` is spawned directly as a new process making it slightly more + * efficient than {@link exec}. + * + * The same options as {@link exec} are supported. Since a shell is + * not spawned, behaviors such as I/O redirection and file globbing are not + * supported. + * + * ```js + * import { execFile } from 'node:child_process'; + * const child = execFile('node', ['--version'], (error, stdout, stderr) => { + * if (error) { + * throw error; + * } + * console.log(stdout); + * }); + * ``` + * + * The `stdout` and `stderr` arguments passed to the callback will contain the + * stdout and stderr output of the child process. By default, Node.js will decode + * the output as UTF-8 and pass strings to the callback. The `encoding` option + * can be used to specify the character encoding used to decode the stdout and + * stderr output. If `encoding` is `'buffer'`, or an unrecognized character + * encoding, `Buffer` objects will be passed to the callback instead. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned `ChildProcess` instance is attached to the `Promise` as a `child` property. In + * case of an error (including any error resulting in an exit code other than 0), a + * rejected promise is returned, with the same `error` object given in the + * callback, but with two additional properties `stdout` and `stderr`. + * + * ```js + * import util from 'node:util'; + * import child_process from 'node:child_process'; + * const execFile = util.promisify(child_process.execFile); + * async function getVersion() { + * const { stdout } = await execFile('node', ['--version']); + * console.log(stdout); + * } + * getVersion(); + * ``` + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * import { execFile } from 'node:child_process'; + * const controller = new AbortController(); + * const { signal } = controller; + * const child = execFile('node', ['--version'], { signal }, (error) => { + * console.error(error); // an AbortError + * }); + * controller.abort(); + * ``` + * @since v0.1.91 + * @param file The name or path of the executable file to run. + * @param args List of string arguments. + * @param callback Called with the output when process terminates. + */ + // no `options` definitely means stdout/stderr are `string`. + function execFile( + file: string, + callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void, + ): ChildProcess; + function execFile( + file: string, + args: readonly string[] | undefined | null, + callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void, + ): ChildProcess; + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + function execFile( + file: string, + options: ExecFileOptionsWithBufferEncoding, + callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void, + ): ChildProcess; + function execFile( + file: string, + args: readonly string[] | undefined | null, + options: ExecFileOptionsWithBufferEncoding, + callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void, + ): ChildProcess; + // `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`. + function execFile( + file: string, + options: ExecFileOptionsWithStringEncoding, + callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void, + ): ChildProcess; + function execFile( + file: string, + args: readonly string[] | undefined | null, + options: ExecFileOptionsWithStringEncoding, + callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void, + ): ChildProcess; + // fallback if nothing else matches. Worst case is always `string | Buffer`. + function execFile( + file: string, + options: ExecFileOptions | undefined | null, + callback: + | (( + error: ExecFileException | null, + stdout: string | NonSharedBuffer, + stderr: string | NonSharedBuffer, + ) => void) + | undefined + | null, + ): ChildProcess; + function execFile( + file: string, + args: readonly string[] | undefined | null, + options: ExecFileOptions | undefined | null, + callback: + | (( + error: ExecFileException | null, + stdout: string | NonSharedBuffer, + stderr: string | NonSharedBuffer, + ) => void) + | undefined + | null, + ): ChildProcess; + namespace execFile { + function __promisify__(file: string): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + args: readonly string[] | undefined | null, + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + options: ExecFileOptionsWithBufferEncoding, + ): PromiseWithChild<{ + stdout: NonSharedBuffer; + stderr: NonSharedBuffer; + }>; + function __promisify__( + file: string, + args: readonly string[] | undefined | null, + options: ExecFileOptionsWithBufferEncoding, + ): PromiseWithChild<{ + stdout: NonSharedBuffer; + stderr: NonSharedBuffer; + }>; + function __promisify__( + file: string, + options: ExecFileOptionsWithStringEncoding, + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + args: readonly string[] | undefined | null, + options: ExecFileOptionsWithStringEncoding, + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + options: ExecFileOptions | undefined | null, + ): PromiseWithChild<{ + stdout: string | NonSharedBuffer; + stderr: string | NonSharedBuffer; + }>; + function __promisify__( + file: string, + args: readonly string[] | undefined | null, + options: ExecFileOptions | undefined | null, + ): PromiseWithChild<{ + stdout: string | NonSharedBuffer; + stderr: string | NonSharedBuffer; + }>; + } + interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { + execPath?: string | undefined; + execArgv?: string[] | undefined; + silent?: boolean | undefined; + /** + * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. + * If passed as an array, the first element is used for `stdin`, the second for + * `stdout`, and the third for `stderr`. A fourth element can be used to + * specify the `stdio` behavior beyond the standard streams. See + * {@link ChildProcess.stdio} for more information. + * + * @default 'pipe' + */ + stdio?: StdioOptions | undefined; + detached?: boolean | undefined; + windowsVerbatimArguments?: boolean | undefined; + } + /** + * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes. + * Like {@link spawn}, a `ChildProcess` object is returned. The + * returned `ChildProcess` will have an additional communication channel + * built-in that allows messages to be passed back and forth between the parent and + * child. See `subprocess.send()` for details. + * + * Keep in mind that spawned Node.js child processes are + * independent of the parent with exception of the IPC communication channel + * that is established between the two. Each process has its own memory, with + * their own V8 instances. Because of the additional resource allocations + * required, spawning a large number of child Node.js processes is not + * recommended. + * + * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the `options` object allows for an alternative + * execution path to be used. + * + * Node.js processes launched with a custom `execPath` will communicate with the + * parent process using the file descriptor (fd) identified using the + * environment variable `NODE_CHANNEL_FD` on the child process. + * + * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the + * current process. + * + * The `shell` option available in {@link spawn} is not supported by `child_process.fork()` and will be ignored if set. + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * if (process.argv[2] === 'child') { + * setTimeout(() => { + * console.log(`Hello from ${process.argv[2]}!`); + * }, 1_000); + * } else { + * import { fork } from 'node:child_process'; + * const controller = new AbortController(); + * const { signal } = controller; + * const child = fork(__filename, ['child'], { signal }); + * child.on('error', (err) => { + * // This will be called with err being an AbortError if the controller aborts + * }); + * controller.abort(); // Stops the child process + * } + * ``` + * @since v0.5.0 + * @param modulePath The module to run in the child. + * @param args List of string arguments. + */ + function fork(modulePath: string | URL, options?: ForkOptions): ChildProcess; + function fork(modulePath: string | URL, args?: readonly string[], options?: ForkOptions): ChildProcess; + interface SpawnSyncOptions extends CommonSpawnOptions { + input?: string | NodeJS.ArrayBufferView | undefined; + maxBuffer?: number | undefined; + encoding?: BufferEncoding | "buffer" | null | undefined; + } + interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { + encoding: BufferEncoding; + } + interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { + encoding?: "buffer" | null | undefined; + } + interface SpawnSyncReturns { + pid: number; + output: Array; + stdout: T; + stderr: T; + status: number | null; + signal: NodeJS.Signals | null; + error?: Error; + } + /** + * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return + * until the child process has fully closed. When a timeout has been encountered + * and `killSignal` is sent, the method won't return until the process has + * completely exited. If the process intercepts and handles the `SIGTERM` signal + * and doesn't exit, the parent process will wait until the child process has + * exited. + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * @since v0.11.12 + * @param command The command to run. + * @param args List of string arguments. + */ + function spawnSync(command: string): SpawnSyncReturns; + function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; + function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns; + function spawnSync( + command: string, + args: readonly string[], + options: SpawnSyncOptionsWithStringEncoding, + ): SpawnSyncReturns; + function spawnSync( + command: string, + args: readonly string[], + options: SpawnSyncOptionsWithBufferEncoding, + ): SpawnSyncReturns; + function spawnSync( + command: string, + args?: readonly string[], + options?: SpawnSyncOptions, + ): SpawnSyncReturns; + interface CommonExecOptions extends CommonOptions { + input?: string | NodeJS.ArrayBufferView | undefined; + /** + * Can be set to 'pipe', 'inherit, or 'ignore', or an array of these strings. + * If passed as an array, the first element is used for `stdin`, the second for + * `stdout`, and the third for `stderr`. A fourth element can be used to + * specify the `stdio` behavior beyond the standard streams. See + * {@link ChildProcess.stdio} for more information. + * + * @default 'pipe' + */ + stdio?: StdioOptions | undefined; + killSignal?: NodeJS.Signals | number | undefined; + maxBuffer?: number | undefined; + encoding?: BufferEncoding | "buffer" | null | undefined; + } + interface ExecSyncOptions extends CommonExecOptions { + shell?: string | undefined; + } + interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { + encoding: BufferEncoding; + } + interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { + encoding?: "buffer" | null | undefined; + } + /** + * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return + * until the child process has fully closed. When a timeout has been encountered + * and `killSignal` is sent, the method won't return until the process has + * completely exited. If the child process intercepts and handles the `SIGTERM` signal and doesn't exit, the parent process will wait until the child process + * has exited. + * + * If the process times out or has a non-zero exit code, this method will throw. + * The `Error` object will contain the entire result from {@link spawnSync}. + * + * **Never pass unsanitized user input to this function. Any input containing shell** + * **metacharacters may be used to trigger arbitrary command execution.** + * @since v0.11.12 + * @param command The command to run. + * @return The stdout from the command. + */ + function execSync(command: string): NonSharedBuffer; + function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string; + function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): NonSharedBuffer; + function execSync(command: string, options?: ExecSyncOptions): string | NonSharedBuffer; + interface ExecFileSyncOptions extends CommonExecOptions { + shell?: boolean | string | undefined; + } + interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { + encoding: BufferEncoding; + } + interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { + encoding?: "buffer" | null | undefined; // specify `null`. + } + /** + * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not + * return until the child process has fully closed. When a timeout has been + * encountered and `killSignal` is sent, the method won't return until the process + * has completely exited. + * + * If the child process intercepts and handles the `SIGTERM` signal and + * does not exit, the parent process will still wait until the child process has + * exited. + * + * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}. + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * @since v0.11.12 + * @param file The name or path of the executable file to run. + * @param args List of string arguments. + * @return The stdout from the command. + */ + function execFileSync(file: string): NonSharedBuffer; + function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string; + function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): NonSharedBuffer; + function execFileSync(file: string, options?: ExecFileSyncOptions): string | NonSharedBuffer; + function execFileSync(file: string, args: readonly string[]): NonSharedBuffer; + function execFileSync( + file: string, + args: readonly string[], + options: ExecFileSyncOptionsWithStringEncoding, + ): string; + function execFileSync( + file: string, + args: readonly string[], + options: ExecFileSyncOptionsWithBufferEncoding, + ): NonSharedBuffer; + function execFileSync( + file: string, + args?: readonly string[], + options?: ExecFileSyncOptions, + ): string | NonSharedBuffer; +} +declare module "child_process" { + export * from "node:child_process"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/cluster.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/cluster.d.ts new file mode 100644 index 0000000..4e5efbf --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/cluster.d.ts @@ -0,0 +1,486 @@ +/** + * Clusters of Node.js processes can be used to run multiple instances of Node.js + * that can distribute workloads among their application threads. When process isolation + * is not needed, use the [`worker_threads`](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html) + * module instead, which allows running multiple application threads within a single Node.js instance. + * + * The cluster module allows easy creation of child processes that all share + * server ports. + * + * ```js + * import cluster from 'node:cluster'; + * import http from 'node:http'; + * import { availableParallelism } from 'node:os'; + * import process from 'node:process'; + * + * const numCPUs = availableParallelism(); + * + * if (cluster.isPrimary) { + * console.log(`Primary ${process.pid} is running`); + * + * // Fork workers. + * for (let i = 0; i < numCPUs; i++) { + * cluster.fork(); + * } + * + * cluster.on('exit', (worker, code, signal) => { + * console.log(`worker ${worker.process.pid} died`); + * }); + * } else { + * // Workers can share any TCP connection + * // In this case it is an HTTP server + * http.createServer((req, res) => { + * res.writeHead(200); + * res.end('hello world\n'); + * }).listen(8000); + * + * console.log(`Worker ${process.pid} started`); + * } + * ``` + * + * Running Node.js will now share port 8000 between the workers: + * + * ```console + * $ node server.js + * Primary 3596 is running + * Worker 4324 started + * Worker 4520 started + * Worker 6056 started + * Worker 5644 started + * ``` + * + * On Windows, it is not yet possible to set up a named pipe server in a worker. + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/cluster.js) + */ +declare module "node:cluster" { + import * as child_process from "node:child_process"; + import { EventEmitter, InternalEventEmitter } from "node:events"; + class Worker implements EventEmitter { + constructor(options?: cluster.WorkerOptions); + /** + * Each new worker is given its own unique id, this id is stored in the `id`. + * + * While a worker is alive, this is the key that indexes it in `cluster.workers`. + * @since v0.8.0 + */ + id: number; + /** + * All workers are created using [`child_process.fork()`](https://nodejs.org/docs/latest-v25.x/api/child_process.html#child_processforkmodulepath-args-options), the returned object + * from this function is stored as `.process`. In a worker, the global `process` is stored. + * + * See: [Child Process module](https://nodejs.org/docs/latest-v25.x/api/child_process.html#child_processforkmodulepath-args-options). + * + * Workers will call `process.exit(0)` if the `'disconnect'` event occurs + * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against + * accidental disconnection. + * @since v0.7.0 + */ + process: child_process.ChildProcess; + /** + * Send a message to a worker or primary, optionally with a handle. + * + * In the primary, this sends a message to a specific worker. It is identical to [`ChildProcess.send()`](https://nodejs.org/docs/latest-v25.x/api/child_process.html#subprocesssendmessage-sendhandle-options-callback). + * + * In a worker, this sends a message to the primary. It is identical to `process.send()`. + * + * This example will echo back all messages from the primary: + * + * ```js + * if (cluster.isPrimary) { + * const worker = cluster.fork(); + * worker.send('hi there'); + * + * } else if (cluster.isWorker) { + * process.on('message', (msg) => { + * process.send(msg); + * }); + * } + * ``` + * @since v0.7.0 + * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. + */ + send(message: child_process.Serializable, callback?: (error: Error | null) => void): boolean; + send( + message: child_process.Serializable, + sendHandle: child_process.SendHandle, + callback?: (error: Error | null) => void, + ): boolean; + send( + message: child_process.Serializable, + sendHandle: child_process.SendHandle, + options?: child_process.MessageOptions, + callback?: (error: Error | null) => void, + ): boolean; + /** + * This function will kill the worker. In the primary worker, it does this by + * disconnecting the `worker.process`, and once disconnected, killing with `signal`. In the worker, it does it by killing the process with `signal`. + * + * The `kill()` function kills the worker process without waiting for a graceful + * disconnect, it has the same behavior as `worker.process.kill()`. + * + * This method is aliased as `worker.destroy()` for backwards compatibility. + * + * In a worker, `process.kill()` exists, but it is not this function; + * it is [`kill()`](https://nodejs.org/docs/latest-v25.x/api/process.html#processkillpid-signal). + * @since v0.9.12 + * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. + */ + kill(signal?: string): void; + destroy(signal?: string): void; + /** + * In a worker, this function will close all servers, wait for the `'close'` event + * on those servers, and then disconnect the IPC channel. + * + * In the primary, an internal message is sent to the worker causing it to call `.disconnect()` on itself. + * + * Causes `.exitedAfterDisconnect` to be set. + * + * After a server is closed, it will no longer accept new connections, + * but connections may be accepted by any other listening worker. Existing + * connections will be allowed to close as usual. When no more connections exist, + * see `server.close()`, the IPC channel to the worker will close allowing it + * to die gracefully. + * + * The above applies _only_ to server connections, client connections are not + * automatically closed by workers, and disconnect does not wait for them to close + * before exiting. + * + * In a worker, `process.disconnect` exists, but it is not this function; + * it is `disconnect()`. + * + * Because long living server connections may block workers from disconnecting, it + * may be useful to send a message, so application specific actions may be taken to + * close them. It also may be useful to implement a timeout, killing a worker if + * the `'disconnect'` event has not been emitted after some time. + * + * ```js + * import net from 'node:net'; + * + * if (cluster.isPrimary) { + * const worker = cluster.fork(); + * let timeout; + * + * worker.on('listening', (address) => { + * worker.send('shutdown'); + * worker.disconnect(); + * timeout = setTimeout(() => { + * worker.kill(); + * }, 2000); + * }); + * + * worker.on('disconnect', () => { + * clearTimeout(timeout); + * }); + * + * } else if (cluster.isWorker) { + * const server = net.createServer((socket) => { + * // Connections never end + * }); + * + * server.listen(8000); + * + * process.on('message', (msg) => { + * if (msg === 'shutdown') { + * // Initiate graceful close of any connections to server + * } + * }); + * } + * ``` + * @since v0.7.7 + * @return A reference to `worker`. + */ + disconnect(): this; + /** + * This function returns `true` if the worker is connected to its primary via its + * IPC channel, `false` otherwise. A worker is connected to its primary after it + * has been created. It is disconnected after the `'disconnect'` event is emitted. + * @since v0.11.14 + */ + isConnected(): boolean; + /** + * This function returns `true` if the worker's process has terminated (either + * because of exiting or being signaled). Otherwise, it returns `false`. + * + * ```js + * import cluster from 'node:cluster'; + * import http from 'node:http'; + * import { availableParallelism } from 'node:os'; + * import process from 'node:process'; + * + * const numCPUs = availableParallelism(); + * + * if (cluster.isPrimary) { + * console.log(`Primary ${process.pid} is running`); + * + * // Fork workers. + * for (let i = 0; i < numCPUs; i++) { + * cluster.fork(); + * } + * + * cluster.on('fork', (worker) => { + * console.log('worker is dead:', worker.isDead()); + * }); + * + * cluster.on('exit', (worker, code, signal) => { + * console.log('worker is dead:', worker.isDead()); + * }); + * } else { + * // Workers can share any TCP connection. In this case, it is an HTTP server. + * http.createServer((req, res) => { + * res.writeHead(200); + * res.end(`Current process\n ${process.pid}`); + * process.kill(process.pid); + * }).listen(8000); + * } + * ``` + * @since v0.11.14 + */ + isDead(): boolean; + /** + * This property is `true` if the worker exited due to `.disconnect()`. + * If the worker exited any other way, it is `false`. If the + * worker has not exited, it is `undefined`. + * + * The boolean `worker.exitedAfterDisconnect` allows distinguishing between + * voluntary and accidental exit, the primary may choose not to respawn a worker + * based on this value. + * + * ```js + * cluster.on('exit', (worker, code, signal) => { + * if (worker.exitedAfterDisconnect === true) { + * console.log('Oh, it was just voluntary – no need to worry'); + * } + * }); + * + * // kill worker + * worker.kill(); + * ``` + * @since v6.0.0 + */ + exitedAfterDisconnect: boolean; + } + interface Worker extends InternalEventEmitter {} + type _Worker = Worker; + namespace cluster { + interface Worker extends _Worker {} + interface WorkerOptions { + id?: number | undefined; + process?: child_process.ChildProcess | undefined; + state?: string | undefined; + } + interface WorkerEventMap { + "disconnect": []; + "error": [error: Error]; + "exit": [code: number, signal: string]; + "listening": [address: Address]; + "message": [message: any, handle: child_process.SendHandle]; + "online": []; + } + interface ClusterSettings { + /** + * List of string arguments passed to the Node.js executable. + * @default process.execArgv + */ + execArgv?: string[] | undefined; + /** + * File path to worker file. + * @default process.argv[1] + */ + exec?: string | undefined; + /** + * String arguments passed to worker. + * @default process.argv.slice(2) + */ + args?: readonly string[] | undefined; + /** + * Whether or not to send output to parent's stdio. + * @default false + */ + silent?: boolean | undefined; + /** + * Configures the stdio of forked processes. Because the cluster module relies on IPC to function, this configuration must + * contain an `'ipc'` entry. When this option is provided, it overrides `silent`. See [`child_prcess.spawn()`](https://nodejs.org/docs/latest-v25.x/api/child_process.html#child_processspawncommand-args-options)'s + * [`stdio`](https://nodejs.org/docs/latest-v25.x/api/child_process.html#optionsstdio). + */ + stdio?: any[] | undefined; + /** + * Sets the user identity of the process. (See [`setuid(2)`](https://man7.org/linux/man-pages/man2/setuid.2.html).) + */ + uid?: number | undefined; + /** + * Sets the group identity of the process. (See [`setgid(2)`](https://man7.org/linux/man-pages/man2/setgid.2.html).) + */ + gid?: number | undefined; + /** + * Sets inspector port of worker. This can be a number, or a function that takes no arguments and returns a number. + * By default each worker gets its own port, incremented from the primary's `process.debugPort`. + */ + inspectPort?: number | (() => number) | undefined; + /** + * Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`. + * See [Advanced serialization for `child_process`](https://nodejs.org/docs/latest-v25.x/api/child_process.html#advanced-serialization) for more details. + * @default false + */ + serialization?: "json" | "advanced" | undefined; + /** + * Current working directory of the worker process. + * @default undefined (inherits from parent process) + */ + cwd?: string | undefined; + /** + * Hide the forked processes console window that would normally be created on Windows systems. + * @default false + */ + windowsHide?: boolean | undefined; + } + interface Address { + address: string; + port: number; + /** + * The `addressType` is one of: + * + * * `4` (TCPv4) + * * `6` (TCPv6) + * * `-1` (Unix domain socket) + * * `'udp4'` or `'udp6'` (UDPv4 or UDPv6) + */ + addressType: 4 | 6 | -1 | "udp4" | "udp6"; + } + interface ClusterEventMap { + "disconnect": [worker: Worker]; + "exit": [worker: Worker, code: number, signal: string]; + "fork": [worker: Worker]; + "listening": [worker: Worker, address: Address]; + "message": [worker: Worker, message: any, handle: child_process.SendHandle]; + "online": [worker: Worker]; + "setup": [settings: ClusterSettings]; + } + interface Cluster extends InternalEventEmitter { + /** + * A `Worker` object contains all public information and method about a worker. + * In the primary it can be obtained using `cluster.workers`. In a worker + * it can be obtained using `cluster.worker`. + * @since v0.7.0 + */ + Worker: typeof Worker; + disconnect(callback?: () => void): void; + /** + * Spawn a new worker process. + * + * This can only be called from the primary process. + * @param env Key/value pairs to add to worker process environment. + * @since v0.6.0 + */ + fork(env?: any): Worker; + /** @deprecated since v16.0.0 - use isPrimary. */ + readonly isMaster: boolean; + /** + * True if the process is a primary. This is determined by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID` + * is undefined, then `isPrimary` is `true`. + * @since v16.0.0 + */ + readonly isPrimary: boolean; + /** + * True if the process is not a primary (it is the negation of `cluster.isPrimary`). + * @since v0.6.0 + */ + readonly isWorker: boolean; + /** + * The scheduling policy, either `cluster.SCHED_RR` for round-robin or `cluster.SCHED_NONE` to leave it to the operating system. This is a + * global setting and effectively frozen once either the first worker is spawned, or [`.setupPrimary()`](https://nodejs.org/docs/latest-v25.x/api/cluster.html#clustersetupprimarysettings) + * is called, whichever comes first. + * + * `SCHED_RR` is the default on all operating systems except Windows. Windows will change to `SCHED_RR` once libuv is able to effectively distribute + * IOCP handles without incurring a large performance hit. + * + * `cluster.schedulingPolicy` can also be set through the `NODE_CLUSTER_SCHED_POLICY` environment variable. Valid values are `'rr'` and `'none'`. + * @since v0.11.2 + */ + schedulingPolicy: number; + /** + * After calling [`.setupPrimary()`](https://nodejs.org/docs/latest-v25.x/api/cluster.html#clustersetupprimarysettings) + * (or [`.fork()`](https://nodejs.org/docs/latest-v25.x/api/cluster.html#clusterforkenv)) this settings object will contain + * the settings, including the default values. + * + * This object is not intended to be changed or set manually. + * @since v0.7.1 + */ + readonly settings: ClusterSettings; + /** @deprecated since v16.0.0 - use [`.setupPrimary()`](https://nodejs.org/docs/latest-v25.x/api/cluster.html#clustersetupprimarysettings) instead. */ + setupMaster(settings?: ClusterSettings): void; + /** + * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in `cluster.settings`. + * + * Any settings changes only affect future calls to [`.fork()`](https://nodejs.org/docs/latest-v25.x/api/cluster.html#clusterforkenv) + * and have no effect on workers that are already running. + * + * The only attribute of a worker that cannot be set via `.setupPrimary()` is the `env` passed to + * [`.fork()`](https://nodejs.org/docs/latest-v25.x/api/cluster.html#clusterforkenv). + * + * The defaults above apply to the first call only; the defaults for later calls are the current values at the time of + * `cluster.setupPrimary()` is called. + * + * ```js + * import cluster from 'node:cluster'; + * + * cluster.setupPrimary({ + * exec: 'worker.js', + * args: ['--use', 'https'], + * silent: true, + * }); + * cluster.fork(); // https worker + * cluster.setupPrimary({ + * exec: 'worker.js', + * args: ['--use', 'http'], + * }); + * cluster.fork(); // http worker + * ``` + * + * This can only be called from the primary process. + * @since v16.0.0 + */ + setupPrimary(settings?: ClusterSettings): void; + /** + * A reference to the current worker object. Not available in the primary process. + * + * ```js + * import cluster from 'node:cluster'; + * + * if (cluster.isPrimary) { + * console.log('I am primary'); + * cluster.fork(); + * cluster.fork(); + * } else if (cluster.isWorker) { + * console.log(`I am worker #${cluster.worker.id}`); + * } + * ``` + * @since v0.7.0 + */ + readonly worker?: Worker; + /** + * A hash that stores the active worker objects, keyed by `id` field. This makes it easy to loop through all the workers. It is only available in the primary process. + * + * A worker is removed from `cluster.workers` after the worker has disconnected _and_ exited. The order between these two events cannot be determined in advance. However, it + * is guaranteed that the removal from the `cluster.workers` list happens before the last `'disconnect'` or `'exit'` event is emitted. + * + * ```js + * import cluster from 'node:cluster'; + * + * for (const worker of Object.values(cluster.workers)) { + * worker.send('big announcement to all workers'); + * } + * ``` + * @since v0.7.0 + */ + readonly workers?: NodeJS.Dict; + readonly SCHED_NONE: number; + readonly SCHED_RR: number; + } + } + var cluster: cluster.Cluster; + export = cluster; +} +declare module "cluster" { + import cluster = require("node:cluster"); + export = cluster; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/compatibility/iterators.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/compatibility/iterators.d.ts new file mode 100644 index 0000000..156e785 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/compatibility/iterators.d.ts @@ -0,0 +1,21 @@ +// Backwards-compatible iterator interfaces, augmented with iterator helper methods by lib.esnext.iterator in TypeScript 5.6. +// The IterableIterator interface does not contain these methods, which creates assignability issues in places where IteratorObjects +// are expected (eg. DOM-compatible APIs) if lib.esnext.iterator is loaded. +// Also ensures that iterators returned by the Node API, which inherit from Iterator.prototype, correctly expose the iterator helper methods +// if lib.esnext.iterator is loaded. +// TODO: remove once this package no longer supports TS 5.5, and replace NodeJS.BuiltinIteratorReturn with BuiltinIteratorReturn. + +// Placeholders for TS <5.6 +interface IteratorObject {} +interface AsyncIteratorObject {} + +declare namespace NodeJS { + // Populate iterator methods for TS <5.6 + interface Iterator extends globalThis.Iterator {} + interface AsyncIterator extends globalThis.AsyncIterator {} + + // Polyfill for TS 5.6's instrinsic BuiltinIteratorReturn type, required for DOM-compatible iterators + type BuiltinIteratorReturn = ReturnType extends + globalThis.Iterator ? TReturn + : any; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/console.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/console.d.ts new file mode 100644 index 0000000..3943442 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/console.d.ts @@ -0,0 +1,151 @@ +/** + * The `node:console` module provides a simple debugging console that is similar to + * the JavaScript console mechanism provided by web browsers. + * + * The module exports two specific components: + * + * * A `Console` class with methods such as `console.log()`, `console.error()`, and `console.warn()` that can be used to write to any Node.js stream. + * * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstdout) and + * [`process.stderr`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module. + * + * _**Warning**_: The global console object's methods are neither consistently + * synchronous like the browser APIs they resemble, nor are they consistently + * asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v25.x/api/process.html#a-note-on-process-io) for + * more information. + * + * Example using the global `console`: + * + * ```js + * console.log('hello world'); + * // Prints: hello world, to stdout + * console.log('hello %s', 'world'); + * // Prints: hello world, to stdout + * console.error(new Error('Whoops, something bad happened')); + * // Prints error message and stack trace to stderr: + * // Error: Whoops, something bad happened + * // at [eval]:5:15 + * // at Script.runInThisContext (node:vm:132:18) + * // at Object.runInThisContext (node:vm:309:38) + * // at node:internal/process/execution:77:19 + * // at [eval]-wrapper:6:22 + * // at evalScript (node:internal/process/execution:76:60) + * // at node:internal/main/eval_string:23:3 + * + * const name = 'Will Robinson'; + * console.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to stderr + * ``` + * + * Example using the `Console` class: + * + * ```js + * const out = getStreamSomehow(); + * const err = getStreamSomehow(); + * const myConsole = new console.Console(out, err); + * + * myConsole.log('hello world'); + * // Prints: hello world, to out + * myConsole.log('hello %s', 'world'); + * // Prints: hello world, to out + * myConsole.error(new Error('Whoops, something bad happened')); + * // Prints: [Error: Whoops, something bad happened], to err + * + * const name = 'Will Robinson'; + * myConsole.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to err + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/console.js) + */ +declare module "node:console" { + import { InspectOptions } from "node:util"; + namespace console { + interface ConsoleOptions { + stdout: NodeJS.WritableStream; + stderr?: NodeJS.WritableStream | undefined; + /** + * Ignore errors when writing to the underlying streams. + * @default true + */ + ignoreErrors?: boolean | undefined; + /** + * Set color support for this `Console` instance. Setting to true enables coloring while inspecting + * values. Setting to `false` disables coloring while inspecting values. Setting to `'auto'` makes color + * support depend on the value of the `isTTY` property and the value returned by `getColorDepth()` on the + * respective stream. This option can not be used, if `inspectOptions.colors` is set as well. + * @default 'auto' + */ + colorMode?: boolean | "auto" | undefined; + /** + * Specifies options that are passed along to + * [`util.inspect()`](https://nodejs.org/docs/latest-v25.x/api/util.html#utilinspectobject-options). + */ + inspectOptions?: InspectOptions | ReadonlyMap | undefined; + /** + * Set group indentation. + * @default 2 + */ + groupIndentation?: number | undefined; + } + interface Console { + readonly Console: { + prototype: Console; + new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; + new(options: ConsoleOptions): Console; + }; + assert(condition?: unknown, ...data: any[]): void; + clear(): void; + count(label?: string): void; + countReset(label?: string): void; + debug(...data: any[]): void; + dir(item?: any, options?: InspectOptions): void; + dirxml(...data: any[]): void; + error(...data: any[]): void; + group(...data: any[]): void; + groupCollapsed(...data: any[]): void; + groupEnd(): void; + info(...data: any[]): void; + log(...data: any[]): void; + table(tabularData?: any, properties?: string[]): void; + time(label?: string): void; + timeEnd(label?: string): void; + timeLog(label?: string, ...data: any[]): void; + trace(...data: any[]): void; + warn(...data: any[]): void; + /** + * This method does not display anything unless used in the inspector. The `console.profile()` + * method starts a JavaScript CPU profile with an optional label until {@link profileEnd} + * is called. The profile is then added to the Profile panel of the inspector. + * + * ```js + * console.profile('MyLabel'); + * // Some code + * console.profileEnd('MyLabel'); + * // Adds the profile 'MyLabel' to the Profiles panel of the inspector. + * ``` + * @since v8.0.0 + */ + profile(label?: string): void; + /** + * This method does not display anything unless used in the inspector. Stops the current + * JavaScript CPU profiling session if one has been started and prints the report to the + * Profiles panel of the inspector. See {@link profile} for an example. + * + * If this method is called without a label, the most recently started profile is stopped. + * @since v8.0.0 + */ + profileEnd(label?: string): void; + /** + * This method does not display anything unless used in the inspector. The `console.timeStamp()` + * method adds an event with the label `'label'` to the Timeline panel of the inspector. + * @since v8.0.0 + */ + timeStamp(label?: string): void; + } + } + var console: console.Console; + export = console; +} +declare module "console" { + import console = require("node:console"); + export = console; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/constants.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/constants.d.ts new file mode 100644 index 0000000..c24ad98 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/constants.d.ts @@ -0,0 +1,20 @@ +/** + * @deprecated The `node:constants` module is deprecated. When requiring access to constants + * relevant to specific Node.js builtin modules, developers should instead refer + * to the `constants` property exposed by the relevant module. For instance, + * `require('node:fs').constants` and `require('node:os').constants`. + */ +declare module "node:constants" { + const constants: + & typeof import("node:os").constants.dlopen + & typeof import("node:os").constants.errno + & typeof import("node:os").constants.priority + & typeof import("node:os").constants.signals + & typeof import("node:fs").constants + & typeof import("node:crypto").constants; + export = constants; +} +declare module "constants" { + import constants = require("node:constants"); + export = constants; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/crypto.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/crypto.d.ts new file mode 100644 index 0000000..15b46ce --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/crypto.d.ts @@ -0,0 +1,4065 @@ +/** + * The `node:crypto` module provides cryptographic functionality that includes a + * set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify + * functions. + * + * ```js + * const { createHmac } = await import('node:crypto'); + * + * const secret = 'abcdefg'; + * const hash = createHmac('sha256', secret) + * .update('I love cupcakes') + * .digest('hex'); + * console.log(hash); + * // Prints: + * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/crypto.js) + */ +declare module "node:crypto" { + import { NonSharedBuffer } from "node:buffer"; + import * as stream from "node:stream"; + import { PeerCertificate } from "node:tls"; + /** + * SPKAC is a Certificate Signing Request mechanism originally implemented by + * Netscape and was specified formally as part of HTML5's `keygen` element. + * + * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects + * should not use this element anymore. + * + * The `node:crypto` module provides the `Certificate` class for working with SPKAC + * data. The most common usage is handling output generated by the HTML5 `` element. Node.js uses [OpenSSL's SPKAC + * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally. + * @since v0.11.8 + */ + class Certificate { + /** + * ```js + * const { Certificate } = await import('node:crypto'); + * const spkac = getSpkacSomehow(); + * const challenge = Certificate.exportChallenge(spkac); + * console.log(challenge.toString('utf8')); + * // Prints: the challenge as a UTF8 string + * ``` + * @since v9.0.0 + * @param encoding The `encoding` of the `spkac` string. + * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge. + */ + static exportChallenge(spkac: BinaryLike): NonSharedBuffer; + /** + * ```js + * const { Certificate } = await import('node:crypto'); + * const spkac = getSpkacSomehow(); + * const publicKey = Certificate.exportPublicKey(spkac); + * console.log(publicKey); + * // Prints: the public key as + * ``` + * @since v9.0.0 + * @param encoding The `encoding` of the `spkac` string. + * @return The public key component of the `spkac` data structure, which includes a public key and a challenge. + */ + static exportPublicKey(spkac: BinaryLike, encoding?: string): NonSharedBuffer; + /** + * ```js + * import { Buffer } from 'node:buffer'; + * const { Certificate } = await import('node:crypto'); + * + * const spkac = getSpkacSomehow(); + * console.log(Certificate.verifySpkac(Buffer.from(spkac))); + * // Prints: true or false + * ``` + * @since v9.0.0 + * @param encoding The `encoding` of the `spkac` string. + * @return `true` if the given `spkac` data structure is valid, `false` otherwise. + */ + static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; + /** + * @deprecated + * @param spkac + * @returns The challenge component of the `spkac` data structure, + * which includes a public key and a challenge. + */ + exportChallenge(spkac: BinaryLike): NonSharedBuffer; + /** + * @deprecated + * @param spkac + * @param encoding The encoding of the spkac string. + * @returns The public key component of the `spkac` data structure, + * which includes a public key and a challenge. + */ + exportPublicKey(spkac: BinaryLike, encoding?: string): NonSharedBuffer; + /** + * @deprecated + * @param spkac + * @returns `true` if the given `spkac` data structure is valid, + * `false` otherwise. + */ + verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; + } + namespace constants { + // https://nodejs.org/dist/latest-v25.x/docs/api/crypto.html#crypto-constants + const OPENSSL_VERSION_NUMBER: number; + /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ + const SSL_OP_ALL: number; + /** Instructs OpenSSL to allow a non-[EC]DHE-based key exchange mode for TLS v1.3 */ + const SSL_OP_ALLOW_NO_DHE_KEX: number; + /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ + const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; + /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ + const SSL_OP_CIPHER_SERVER_PREFERENCE: number; + /** Instructs OpenSSL to use Cisco's version identifier of DTLS_BAD_VER. */ + const SSL_OP_CISCO_ANYCONNECT: number; + /** Instructs OpenSSL to turn on cookie exchange. */ + const SSL_OP_COOKIE_EXCHANGE: number; + /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ + const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; + /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ + const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; + /** Allows initial connection to servers that do not support RI. */ + const SSL_OP_LEGACY_SERVER_CONNECT: number; + /** Instructs OpenSSL to disable support for SSL/TLS compression. */ + const SSL_OP_NO_COMPRESSION: number; + /** Instructs OpenSSL to disable encrypt-then-MAC. */ + const SSL_OP_NO_ENCRYPT_THEN_MAC: number; + const SSL_OP_NO_QUERY_MTU: number; + /** Instructs OpenSSL to disable renegotiation. */ + const SSL_OP_NO_RENEGOTIATION: number; + /** Instructs OpenSSL to always start a new session when performing renegotiation. */ + const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + /** Instructs OpenSSL to turn off SSL v2 */ + const SSL_OP_NO_SSLv2: number; + /** Instructs OpenSSL to turn off SSL v3 */ + const SSL_OP_NO_SSLv3: number; + /** Instructs OpenSSL to disable use of RFC4507bis tickets. */ + const SSL_OP_NO_TICKET: number; + /** Instructs OpenSSL to turn off TLS v1 */ + const SSL_OP_NO_TLSv1: number; + /** Instructs OpenSSL to turn off TLS v1.1 */ + const SSL_OP_NO_TLSv1_1: number; + /** Instructs OpenSSL to turn off TLS v1.2 */ + const SSL_OP_NO_TLSv1_2: number; + /** Instructs OpenSSL to turn off TLS v1.3 */ + const SSL_OP_NO_TLSv1_3: number; + /** Instructs OpenSSL server to prioritize ChaCha20-Poly1305 when the client does. This option has no effect if `SSL_OP_CIPHER_SERVER_PREFERENCE` is not enabled. */ + const SSL_OP_PRIORITIZE_CHACHA: number; + /** Instructs OpenSSL to disable version rollback attack detection. */ + const SSL_OP_TLS_ROLLBACK_BUG: number; + const ENGINE_METHOD_RSA: number; + const ENGINE_METHOD_DSA: number; + const ENGINE_METHOD_DH: number; + const ENGINE_METHOD_RAND: number; + const ENGINE_METHOD_EC: number; + const ENGINE_METHOD_CIPHERS: number; + const ENGINE_METHOD_DIGESTS: number; + const ENGINE_METHOD_PKEY_METHS: number; + const ENGINE_METHOD_PKEY_ASN1_METHS: number; + const ENGINE_METHOD_ALL: number; + const ENGINE_METHOD_NONE: number; + const DH_CHECK_P_NOT_SAFE_PRIME: number; + const DH_CHECK_P_NOT_PRIME: number; + const DH_UNABLE_TO_CHECK_GENERATOR: number; + const DH_NOT_SUITABLE_GENERATOR: number; + const RSA_PKCS1_PADDING: number; + const RSA_SSLV23_PADDING: number; + const RSA_NO_PADDING: number; + const RSA_PKCS1_OAEP_PADDING: number; + const RSA_X931_PADDING: number; + const RSA_PKCS1_PSS_PADDING: number; + /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ + const RSA_PSS_SALTLEN_DIGEST: number; + /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ + const RSA_PSS_SALTLEN_MAX_SIGN: number; + /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ + const RSA_PSS_SALTLEN_AUTO: number; + const POINT_CONVERSION_COMPRESSED: number; + const POINT_CONVERSION_UNCOMPRESSED: number; + const POINT_CONVERSION_HYBRID: number; + /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ + const defaultCoreCipherList: string; + /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ + const defaultCipherList: string; + } + interface HashOptions extends stream.TransformOptions { + /** + * For XOF hash functions such as `shake256`, the + * outputLength option can be used to specify the desired output length in bytes. + */ + outputLength?: number | undefined; + } + /** @deprecated since v10.0.0 */ + const fips: boolean; + /** + * Creates and returns a `Hash` object that can be used to generate hash digests + * using the given `algorithm`. Optional `options` argument controls stream + * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option + * can be used to specify the desired output length in bytes. + * + * The `algorithm` is dependent on the available algorithms supported by the + * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. + * On recent releases of OpenSSL, `openssl list -digest-algorithms` will + * display the available digest algorithms. + * + * Example: generating the sha256 sum of a file + * + * ```js + * import { + * createReadStream, + * } from 'node:fs'; + * import { argv } from 'node:process'; + * const { + * createHash, + * } = await import('node:crypto'); + * + * const filename = argv[2]; + * + * const hash = createHash('sha256'); + * + * const input = createReadStream(filename); + * input.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = input.read(); + * if (data) + * hash.update(data); + * else { + * console.log(`${hash.digest('hex')} ${filename}`); + * } + * }); + * ``` + * @since v0.1.92 + * @param options `stream.transform` options + */ + function createHash(algorithm: string, options?: HashOptions): Hash; + /** + * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. + * Optional `options` argument controls stream behavior. + * + * The `algorithm` is dependent on the available algorithms supported by the + * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. + * On recent releases of OpenSSL, `openssl list -digest-algorithms` will + * display the available digest algorithms. + * + * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is + * a `KeyObject`, its type must be `secret`. If it is a string, please consider `caveats when using strings as inputs to cryptographic APIs`. If it was + * obtained from a cryptographically secure source of entropy, such as {@link randomBytes} or {@link generateKey}, its length should not + * exceed the block size of `algorithm` (e.g., 512 bits for SHA-256). + * + * Example: generating the sha256 HMAC of a file + * + * ```js + * import { + * createReadStream, + * } from 'node:fs'; + * import { argv } from 'node:process'; + * const { + * createHmac, + * } = await import('node:crypto'); + * + * const filename = argv[2]; + * + * const hmac = createHmac('sha256', 'a secret'); + * + * const input = createReadStream(filename); + * input.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = input.read(); + * if (data) + * hmac.update(data); + * else { + * console.log(`${hmac.digest('hex')} ${filename}`); + * } + * }); + * ``` + * @since v0.1.94 + * @param options `stream.transform` options + */ + function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; + // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings + type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary"; + type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "utf-16le" | "latin1"; + type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2"; + type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; + type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid"; + /** + * The `Hash` class is a utility for creating hash digests of data. It can be + * used in one of two ways: + * + * * As a `stream` that is both readable and writable, where data is written + * to produce a computed hash digest on the readable side, or + * * Using the `hash.update()` and `hash.digest()` methods to produce the + * computed hash. + * + * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword. + * + * Example: Using `Hash` objects as streams: + * + * ```js + * const { + * createHash, + * } = await import('node:crypto'); + * + * const hash = createHash('sha256'); + * + * hash.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = hash.read(); + * if (data) { + * console.log(data.toString('hex')); + * // Prints: + * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 + * } + * }); + * + * hash.write('some data to hash'); + * hash.end(); + * ``` + * + * Example: Using `Hash` and piped streams: + * + * ```js + * import { createReadStream } from 'node:fs'; + * import { stdout } from 'node:process'; + * const { createHash } = await import('node:crypto'); + * + * const hash = createHash('sha256'); + * + * const input = createReadStream('test.js'); + * input.pipe(hash).setEncoding('hex').pipe(stdout); + * ``` + * + * Example: Using the `hash.update()` and `hash.digest()` methods: + * + * ```js + * const { + * createHash, + * } = await import('node:crypto'); + * + * const hash = createHash('sha256'); + * + * hash.update('some data to hash'); + * console.log(hash.digest('hex')); + * // Prints: + * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 + * ``` + * @since v0.1.92 + */ + class Hash extends stream.Transform { + private constructor(); + /** + * Creates a new `Hash` object that contains a deep copy of the internal state + * of the current `Hash` object. + * + * The optional `options` argument controls stream behavior. For XOF hash + * functions such as `'shake256'`, the `outputLength` option can be used to + * specify the desired output length in bytes. + * + * An error is thrown when an attempt is made to copy the `Hash` object after + * its `hash.digest()` method has been called. + * + * ```js + * // Calculate a rolling hash. + * const { + * createHash, + * } = await import('node:crypto'); + * + * const hash = createHash('sha256'); + * + * hash.update('one'); + * console.log(hash.copy().digest('hex')); + * + * hash.update('two'); + * console.log(hash.copy().digest('hex')); + * + * hash.update('three'); + * console.log(hash.copy().digest('hex')); + * + * // Etc. + * ``` + * @since v13.1.0 + * @param options `stream.transform` options + */ + copy(options?: HashOptions): Hash; + /** + * Updates the hash content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `encoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.92 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): Hash; + update(data: string, inputEncoding: Encoding): Hash; + /** + * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method). + * If `encoding` is provided a string will be returned; otherwise + * a `Buffer` is returned. + * + * The `Hash` object can not be used again after `hash.digest()` method has been + * called. Multiple calls will cause an error to be thrown. + * @since v0.1.92 + * @param encoding The `encoding` of the return value. + */ + digest(): NonSharedBuffer; + digest(encoding: BinaryToTextEncoding): string; + } + /** + * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can + * be used in one of two ways: + * + * * As a `stream` that is both readable and writable, where data is written + * to produce a computed HMAC digest on the readable side, or + * * Using the `hmac.update()` and `hmac.digest()` methods to produce the + * computed HMAC digest. + * + * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword. + * + * Example: Using `Hmac` objects as streams: + * + * ```js + * const { + * createHmac, + * } = await import('node:crypto'); + * + * const hmac = createHmac('sha256', 'a secret'); + * + * hmac.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = hmac.read(); + * if (data) { + * console.log(data.toString('hex')); + * // Prints: + * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e + * } + * }); + * + * hmac.write('some data to hash'); + * hmac.end(); + * ``` + * + * Example: Using `Hmac` and piped streams: + * + * ```js + * import { createReadStream } from 'node:fs'; + * import { stdout } from 'node:process'; + * const { + * createHmac, + * } = await import('node:crypto'); + * + * const hmac = createHmac('sha256', 'a secret'); + * + * const input = createReadStream('test.js'); + * input.pipe(hmac).pipe(stdout); + * ``` + * + * Example: Using the `hmac.update()` and `hmac.digest()` methods: + * + * ```js + * const { + * createHmac, + * } = await import('node:crypto'); + * + * const hmac = createHmac('sha256', 'a secret'); + * + * hmac.update('some data to hash'); + * console.log(hmac.digest('hex')); + * // Prints: + * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e + * ``` + * @since v0.1.94 + */ + class Hmac extends stream.Transform { + private constructor(); + /** + * Updates the `Hmac` content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `encoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.94 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): Hmac; + update(data: string, inputEncoding: Encoding): Hmac; + /** + * Calculates the HMAC digest of all of the data passed using `hmac.update()`. + * If `encoding` is + * provided a string is returned; otherwise a `Buffer` is returned; + * + * The `Hmac` object can not be used again after `hmac.digest()` has been + * called. Multiple calls to `hmac.digest()` will result in an error being thrown. + * @since v0.1.94 + * @param encoding The `encoding` of the return value. + */ + digest(): NonSharedBuffer; + digest(encoding: BinaryToTextEncoding): string; + } + type KeyFormat = "pem" | "der" | "jwk"; + type KeyObjectType = "secret" | "public" | "private"; + type PublicKeyExportType = "pkcs1" | "spki"; + type PrivateKeyExportType = "pkcs1" | "pkcs8" | "sec1"; + type KeyExportOptions = + | SymmetricKeyExportOptions + | PublicKeyExportOptions + | PrivateKeyExportOptions + | JwkKeyExportOptions; + interface SymmetricKeyExportOptions { + format?: "buffer" | undefined; + } + interface PublicKeyExportOptions { + type: T; + format: Exclude; + } + interface PrivateKeyExportOptions { + type: T; + format: Exclude; + cipher?: string | undefined; + passphrase?: string | Buffer | undefined; + } + interface JwkKeyExportOptions { + format: "jwk"; + } + interface KeyPairExportOptions< + TPublic extends PublicKeyExportType = PublicKeyExportType, + TPrivate extends PrivateKeyExportType = PrivateKeyExportType, + > { + publicKeyEncoding?: PublicKeyExportOptions | JwkKeyExportOptions | undefined; + privateKeyEncoding?: PrivateKeyExportOptions | JwkKeyExportOptions | undefined; + } + type KeyExportResult = T extends { format: infer F extends KeyFormat } + ? { der: NonSharedBuffer; jwk: webcrypto.JsonWebKey; pem: string }[F] + : Default; + interface KeyPairExportResult { + publicKey: KeyExportResult; + privateKey: KeyExportResult; + } + type KeyPairExportCallback = ( + err: Error | null, + publicKey: KeyExportResult, + privateKey: KeyExportResult, + ) => void; + type MLDSAKeyType = `ml-dsa-${44 | 65 | 87}`; + type MLKEMKeyType = `ml-kem-${1024 | 512 | 768}`; + type SLHDSAKeyType = `slh-dsa-${"sha2" | "shake"}-${128 | 192 | 256}${"f" | "s"}`; + type AsymmetricKeyType = + | "dh" + | "dsa" + | "ec" + | "ed25519" + | "ed448" + | MLDSAKeyType + | MLKEMKeyType + | "rsa-pss" + | "rsa" + | SLHDSAKeyType + | "x25519" + | "x448"; + interface AsymmetricKeyDetails { + /** + * Key size in bits (RSA, DSA). + */ + modulusLength?: number; + /** + * Public exponent (RSA). + */ + publicExponent?: bigint; + /** + * Name of the message digest (RSA-PSS). + */ + hashAlgorithm?: string; + /** + * Name of the message digest used by MGF1 (RSA-PSS). + */ + mgf1HashAlgorithm?: string; + /** + * Minimal salt length in bytes (RSA-PSS). + */ + saltLength?: number; + /** + * Size of q in bits (DSA). + */ + divisorLength?: number; + /** + * Name of the curve (EC). + */ + namedCurve?: string; + } + /** + * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, + * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject` + * objects are not to be created directly using the `new`keyword. + * + * Most applications should consider using the new `KeyObject` API instead of + * passing keys as strings or `Buffer`s due to improved security features. + * + * `KeyObject` instances can be passed to other threads via `postMessage()`. + * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to + * be listed in the `transferList` argument. + * @since v11.6.0 + */ + class KeyObject { + private constructor(); + /** + * Example: Converting a `CryptoKey` instance to a `KeyObject`: + * + * ```js + * const { KeyObject } = await import('node:crypto'); + * const { subtle } = globalThis.crypto; + * + * const key = await subtle.generateKey({ + * name: 'HMAC', + * hash: 'SHA-256', + * length: 256, + * }, true, ['sign', 'verify']); + * + * const keyObject = KeyObject.from(key); + * console.log(keyObject.symmetricKeySize); + * // Prints: 32 (symmetric key size in bytes) + * ``` + * @since v15.0.0 + */ + static from(key: webcrypto.CryptoKey): KeyObject; + /** + * For asymmetric keys, this property represents the type of the key. See the + * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types). + * + * This property is `undefined` for unrecognized `KeyObject` types and symmetric + * keys. + * @since v11.6.0 + */ + asymmetricKeyType?: AsymmetricKeyType; + /** + * This property exists only on asymmetric keys. Depending on the type of the key, + * this object contains information about the key. None of the information obtained + * through this property can be used to uniquely identify a key or to compromise + * the security of the key. + * + * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, + * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be + * set. + * + * Other key details might be exposed via this API using additional attributes. + * @since v15.7.0 + */ + asymmetricKeyDetails?: AsymmetricKeyDetails; + /** + * For symmetric keys, the following encoding options can be used: + * + * For public keys, the following encoding options can be used: + * + * For private keys, the following encoding options can be used: + * + * The result type depends on the selected encoding format, when PEM the + * result is a string, when DER it will be a buffer containing the data + * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. + * + * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are + * ignored. + * + * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of + * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be + * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for + * encrypted private keys. Since PKCS#8 defines its own + * encryption mechanism, PEM-level encryption is not supported when encrypting + * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for + * PKCS#1 and SEC1 encryption. + * @since v11.6.0 + */ + export(options?: T): KeyExportResult; + /** + * Returns `true` or `false` depending on whether the keys have exactly the same + * type, value, and parameters. This method is not [constant time](https://en.wikipedia.org/wiki/Timing_attack). + * @since v17.7.0, v16.15.0 + * @param otherKeyObject A `KeyObject` with which to compare `keyObject`. + */ + equals(otherKeyObject: KeyObject): boolean; + /** + * For secret keys, this property represents the size of the key in bytes. This + * property is `undefined` for asymmetric keys. + * @since v11.6.0 + */ + symmetricKeySize?: number; + /** + * Converts a `KeyObject` instance to a `CryptoKey`. + * @since 22.10.0 + */ + toCryptoKey( + algorithm: + | webcrypto.AlgorithmIdentifier + | webcrypto.RsaHashedImportParams + | webcrypto.EcKeyImportParams + | webcrypto.HmacImportParams, + extractable: boolean, + keyUsages: readonly webcrypto.KeyUsage[], + ): webcrypto.CryptoKey; + /** + * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys + * or `'private'` for private (asymmetric) keys. + * @since v11.6.0 + */ + type: KeyObjectType; + } + type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm"; + type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm"; + type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb"; + type CipherChaCha20Poly1305Types = "chacha20-poly1305"; + type BinaryLike = string | NodeJS.ArrayBufferView; + type CipherKey = BinaryLike | KeyObject; + interface CipherCCMOptions extends stream.TransformOptions { + authTagLength: number; + } + interface CipherGCMOptions extends stream.TransformOptions { + authTagLength?: number | undefined; + } + interface CipherOCBOptions extends stream.TransformOptions { + authTagLength: number; + } + interface CipherChaCha20Poly1305Options extends stream.TransformOptions { + /** @default 16 */ + authTagLength?: number | undefined; + } + /** + * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and + * initialization vector (`iv`). + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication + * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On + * recent OpenSSL releases, `openssl list -cipher-algorithms` will + * display the available cipher algorithms. + * + * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded + * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be + * a `KeyObject` of type `secret`. If the cipher does not need + * an initialization vector, `iv` may be `null`. + * + * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * Initialization vectors should be unpredictable and unique; ideally, they will be + * cryptographically random. They do not have to be secret: IVs are typically just + * added to ciphertext messages unencrypted. It may sound contradictory that + * something has to be unpredictable and unique, but does not have to be secret; + * remember that an attacker must not be able to predict ahead of time what a + * given IV will be. + * @since v0.1.94 + * @param options `stream.transform` options + */ + function createCipheriv( + algorithm: CipherCCMTypes, + key: CipherKey, + iv: BinaryLike, + options: CipherCCMOptions, + ): CipherCCM; + function createCipheriv( + algorithm: CipherOCBTypes, + key: CipherKey, + iv: BinaryLike, + options: CipherOCBOptions, + ): CipherOCB; + function createCipheriv( + algorithm: CipherGCMTypes, + key: CipherKey, + iv: BinaryLike, + options?: CipherGCMOptions, + ): CipherGCM; + function createCipheriv( + algorithm: CipherChaCha20Poly1305Types, + key: CipherKey, + iv: BinaryLike, + options?: CipherChaCha20Poly1305Options, + ): CipherChaCha20Poly1305; + function createCipheriv( + algorithm: string, + key: CipherKey, + iv: BinaryLike | null, + options?: stream.TransformOptions, + ): Cipheriv; + /** + * Instances of the `Cipheriv` class are used to encrypt data. The class can be + * used in one of two ways: + * + * * As a `stream` that is both readable and writable, where plain unencrypted + * data is written to produce encrypted data on the readable side, or + * * Using the `cipher.update()` and `cipher.final()` methods to produce + * the encrypted data. + * + * The {@link createCipheriv} method is + * used to create `Cipheriv` instances. `Cipheriv` objects are not to be created + * directly using the `new` keyword. + * + * Example: Using `Cipheriv` objects as streams: + * + * ```js + * const { + * scrypt, + * randomFill, + * createCipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * + * // First, we'll generate the key. The key length is dependent on the algorithm. + * // In this case for aes192, it is 24 bytes (192 bits). + * scrypt(password, 'salt', 24, (err, key) => { + * if (err) throw err; + * // Then, we'll generate a random initialization vector + * randomFill(new Uint8Array(16), (err, iv) => { + * if (err) throw err; + * + * // Once we have the key and iv, we can create and use the cipher... + * const cipher = createCipheriv(algorithm, key, iv); + * + * let encrypted = ''; + * cipher.setEncoding('hex'); + * + * cipher.on('data', (chunk) => encrypted += chunk); + * cipher.on('end', () => console.log(encrypted)); + * + * cipher.write('some clear text data'); + * cipher.end(); + * }); + * }); + * ``` + * + * Example: Using `Cipheriv` and piped streams: + * + * ```js + * import { + * createReadStream, + * createWriteStream, + * } from 'node:fs'; + * + * import { + * pipeline, + * } from 'node:stream'; + * + * const { + * scrypt, + * randomFill, + * createCipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * + * // First, we'll generate the key. The key length is dependent on the algorithm. + * // In this case for aes192, it is 24 bytes (192 bits). + * scrypt(password, 'salt', 24, (err, key) => { + * if (err) throw err; + * // Then, we'll generate a random initialization vector + * randomFill(new Uint8Array(16), (err, iv) => { + * if (err) throw err; + * + * const cipher = createCipheriv(algorithm, key, iv); + * + * const input = createReadStream('test.js'); + * const output = createWriteStream('test.enc'); + * + * pipeline(input, cipher, output, (err) => { + * if (err) throw err; + * }); + * }); + * }); + * ``` + * + * Example: Using the `cipher.update()` and `cipher.final()` methods: + * + * ```js + * const { + * scrypt, + * randomFill, + * createCipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * + * // First, we'll generate the key. The key length is dependent on the algorithm. + * // In this case for aes192, it is 24 bytes (192 bits). + * scrypt(password, 'salt', 24, (err, key) => { + * if (err) throw err; + * // Then, we'll generate a random initialization vector + * randomFill(new Uint8Array(16), (err, iv) => { + * if (err) throw err; + * + * const cipher = createCipheriv(algorithm, key, iv); + * + * let encrypted = cipher.update('some clear text data', 'utf8', 'hex'); + * encrypted += cipher.final('hex'); + * console.log(encrypted); + * }); + * }); + * ``` + * @since v0.1.94 + */ + class Cipheriv extends stream.Transform { + private constructor(); + /** + * Updates the cipher with `data`. If the `inputEncoding` argument is given, + * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or `DataView`. If `data` is a `Buffer`, + * `TypedArray`, or `DataView`, then `inputEncoding` is ignored. + * + * The `outputEncoding` specifies the output format of the enciphered + * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. + * + * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being + * thrown. + * @since v0.1.94 + * @param inputEncoding The `encoding` of the data. + * @param outputEncoding The `encoding` of the return value. + */ + update(data: BinaryLike): NonSharedBuffer; + update(data: string, inputEncoding: Encoding): NonSharedBuffer; + update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; + update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; + /** + * Once the `cipher.final()` method has been called, the `Cipheriv` object can no + * longer be used to encrypt data. Attempts to call `cipher.final()` more than + * once will result in an error being thrown. + * @since v0.1.94 + * @param outputEncoding The `encoding` of the return value. + * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. + */ + final(): NonSharedBuffer; + final(outputEncoding: BufferEncoding): string; + /** + * When using block encryption algorithms, the `Cipheriv` class will automatically + * add padding to the input data to the appropriate block size. To disable the + * default padding call `cipher.setAutoPadding(false)`. + * + * When `autoPadding` is `false`, the length of the entire input data must be a + * multiple of the cipher's block size or `cipher.final()` will throw an error. + * Disabling automatic padding is useful for non-standard padding, for instance + * using `0x0` instead of PKCS padding. + * + * The `cipher.setAutoPadding()` method must be called before `cipher.final()`. + * @since v0.7.1 + * @param [autoPadding=true] + * @return for method chaining. + */ + setAutoPadding(autoPadding?: boolean): this; + } + interface CipherCCM extends Cipheriv { + setAAD( + buffer: NodeJS.ArrayBufferView, + options: { + plaintextLength: number; + }, + ): this; + getAuthTag(): NonSharedBuffer; + } + interface CipherGCM extends Cipheriv { + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + }, + ): this; + getAuthTag(): NonSharedBuffer; + } + interface CipherOCB extends Cipheriv { + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + }, + ): this; + getAuthTag(): NonSharedBuffer; + } + interface CipherChaCha20Poly1305 extends Cipheriv { + setAAD( + buffer: NodeJS.ArrayBufferView, + options: { + plaintextLength: number; + }, + ): this; + getAuthTag(): NonSharedBuffer; + } + /** + * Creates and returns a `Decipheriv` object that uses the given `algorithm`, `key` and initialization vector (`iv`). + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the `authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength` option is not required but can be used to restrict accepted authentication tags + * to those with the specified length. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On + * recent OpenSSL releases, `openssl list -cipher-algorithms` will + * display the available cipher algorithms. + * + * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded + * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be + * a `KeyObject` of type `secret`. If the cipher does not need + * an initialization vector, `iv` may be `null`. + * + * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * Initialization vectors should be unpredictable and unique; ideally, they will be + * cryptographically random. They do not have to be secret: IVs are typically just + * added to ciphertext messages unencrypted. It may sound contradictory that + * something has to be unpredictable and unique, but does not have to be secret; + * remember that an attacker must not be able to predict ahead of time what a given + * IV will be. + * @since v0.1.94 + * @param options `stream.transform` options + */ + function createDecipheriv( + algorithm: CipherCCMTypes, + key: CipherKey, + iv: BinaryLike, + options: CipherCCMOptions, + ): DecipherCCM; + function createDecipheriv( + algorithm: CipherOCBTypes, + key: CipherKey, + iv: BinaryLike, + options: CipherOCBOptions, + ): DecipherOCB; + function createDecipheriv( + algorithm: CipherGCMTypes, + key: CipherKey, + iv: BinaryLike, + options?: CipherGCMOptions, + ): DecipherGCM; + function createDecipheriv( + algorithm: CipherChaCha20Poly1305Types, + key: CipherKey, + iv: BinaryLike, + options?: CipherChaCha20Poly1305Options, + ): DecipherChaCha20Poly1305; + function createDecipheriv( + algorithm: string, + key: CipherKey, + iv: BinaryLike | null, + options?: stream.TransformOptions, + ): Decipheriv; + /** + * Instances of the `Decipheriv` class are used to decrypt data. The class can be + * used in one of two ways: + * + * * As a `stream` that is both readable and writable, where plain encrypted + * data is written to produce unencrypted data on the readable side, or + * * Using the `decipher.update()` and `decipher.final()` methods to + * produce the unencrypted data. + * + * The {@link createDecipheriv} method is + * used to create `Decipheriv` instances. `Decipheriv` objects are not to be created + * directly using the `new` keyword. + * + * Example: Using `Decipheriv` objects as streams: + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { + * scryptSync, + * createDecipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * // Key length is dependent on the algorithm. In this case for aes192, it is + * // 24 bytes (192 bits). + * // Use the async `crypto.scrypt()` instead. + * const key = scryptSync(password, 'salt', 24); + * // The IV is usually passed along with the ciphertext. + * const iv = Buffer.alloc(16, 0); // Initialization vector. + * + * const decipher = createDecipheriv(algorithm, key, iv); + * + * let decrypted = ''; + * decipher.on('readable', () => { + * let chunk; + * while (null !== (chunk = decipher.read())) { + * decrypted += chunk.toString('utf8'); + * } + * }); + * decipher.on('end', () => { + * console.log(decrypted); + * // Prints: some clear text data + * }); + * + * // Encrypted with same algorithm, key and iv. + * const encrypted = + * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; + * decipher.write(encrypted, 'hex'); + * decipher.end(); + * ``` + * + * Example: Using `Decipheriv` and piped streams: + * + * ```js + * import { + * createReadStream, + * createWriteStream, + * } from 'node:fs'; + * import { Buffer } from 'node:buffer'; + * const { + * scryptSync, + * createDecipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * // Use the async `crypto.scrypt()` instead. + * const key = scryptSync(password, 'salt', 24); + * // The IV is usually passed along with the ciphertext. + * const iv = Buffer.alloc(16, 0); // Initialization vector. + * + * const decipher = createDecipheriv(algorithm, key, iv); + * + * const input = createReadStream('test.enc'); + * const output = createWriteStream('test.js'); + * + * input.pipe(decipher).pipe(output); + * ``` + * + * Example: Using the `decipher.update()` and `decipher.final()` methods: + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { + * scryptSync, + * createDecipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * // Use the async `crypto.scrypt()` instead. + * const key = scryptSync(password, 'salt', 24); + * // The IV is usually passed along with the ciphertext. + * const iv = Buffer.alloc(16, 0); // Initialization vector. + * + * const decipher = createDecipheriv(algorithm, key, iv); + * + * // Encrypted using same algorithm, key and iv. + * const encrypted = + * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; + * let decrypted = decipher.update(encrypted, 'hex', 'utf8'); + * decrypted += decipher.final('utf8'); + * console.log(decrypted); + * // Prints: some clear text data + * ``` + * @since v0.1.94 + */ + class Decipheriv extends stream.Transform { + private constructor(); + /** + * Updates the decipher with `data`. If the `inputEncoding` argument is given, + * the `data` argument is a string using the specified encoding. If the `inputEncoding` argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is + * ignored. + * + * The `outputEncoding` specifies the output format of the enciphered + * data. If the `outputEncoding` is specified, a string using the specified encoding is returned. If no `outputEncoding` is provided, a `Buffer` is returned. + * + * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error + * being thrown. + * @since v0.1.94 + * @param inputEncoding The `encoding` of the `data` string. + * @param outputEncoding The `encoding` of the return value. + */ + update(data: NodeJS.ArrayBufferView): NonSharedBuffer; + update(data: string, inputEncoding: Encoding): NonSharedBuffer; + update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; + update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; + /** + * Once the `decipher.final()` method has been called, the `Decipheriv` object can + * no longer be used to decrypt data. Attempts to call `decipher.final()` more + * than once will result in an error being thrown. + * @since v0.1.94 + * @param outputEncoding The `encoding` of the return value. + * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. + */ + final(): NonSharedBuffer; + final(outputEncoding: BufferEncoding): string; + /** + * When data has been encrypted without standard block padding, calling `decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and + * removing padding. + * + * Turning auto padding off will only work if the input data's length is a + * multiple of the ciphers block size. + * + * The `decipher.setAutoPadding()` method must be called before `decipher.final()`. + * @since v0.7.1 + * @param [autoPadding=true] + * @return for method chaining. + */ + setAutoPadding(auto_padding?: boolean): this; + } + interface DecipherCCM extends Decipheriv { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options: { + plaintextLength: number; + }, + ): this; + } + interface DecipherGCM extends Decipheriv { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + }, + ): this; + } + interface DecipherOCB extends Decipheriv { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + }, + ): this; + } + interface DecipherChaCha20Poly1305 extends Decipheriv { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options: { + plaintextLength: number; + }, + ): this; + } + interface PrivateKeyInput { + key: string | Buffer; + format?: KeyFormat | undefined; + type?: PrivateKeyExportType | undefined; + passphrase?: string | Buffer | undefined; + encoding?: string | undefined; + } + interface PublicKeyInput { + key: string | Buffer; + format?: KeyFormat | undefined; + type?: PublicKeyExportType | undefined; + encoding?: string | undefined; + } + /** + * Asynchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`. + * + * ```js + * const { + * generateKey, + * } = await import('node:crypto'); + * + * generateKey('hmac', { length: 512 }, (err, key) => { + * if (err) throw err; + * console.log(key.export().toString('hex')); // 46e..........620 + * }); + * ``` + * + * The size of a generated HMAC key should not exceed the block size of the + * underlying hash function. See {@link createHmac} for more information. + * @since v15.0.0 + * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. + */ + function generateKey( + type: "hmac" | "aes", + options: { + length: number; + }, + callback: (err: Error | null, key: KeyObject) => void, + ): void; + /** + * Synchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`. + * + * ```js + * const { + * generateKeySync, + * } = await import('node:crypto'); + * + * const key = generateKeySync('hmac', { length: 512 }); + * console.log(key.export().toString('hex')); // e89..........41e + * ``` + * + * The size of a generated HMAC key should not exceed the block size of the + * underlying hash function. See {@link createHmac} for more information. + * @since v15.0.0 + * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. + */ + function generateKeySync( + type: "hmac" | "aes", + options: { + length: number; + }, + ): KeyObject; + interface JsonWebKeyInput { + key: webcrypto.JsonWebKey; + format: "jwk"; + } + /** + * Creates and returns a new key object containing a private key. If `key` is a + * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key` must be an object with the properties described above. + * + * If the private key is encrypted, a `passphrase` must be specified. The length + * of the passphrase is limited to 1024 bytes. + * @since v11.6.0 + */ + function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; + /** + * Creates and returns a new key object containing a public key. If `key` is a + * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject` with type `'private'`, the public key is derived from the given private key; + * otherwise, `key` must be an object with the properties described above. + * + * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. + * + * Because public keys can be derived from private keys, a private key may be + * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the + * returned `KeyObject` will be `'public'` and that the private key cannot be + * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type `'private'` is given, a new `KeyObject` with type `'public'` will be returned + * and it will be impossible to extract the private key from the returned object. + * @since v11.6.0 + */ + function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject; + /** + * Creates and returns a new key object containing a secret key for symmetric + * encryption or `Hmac`. + * @since v11.6.0 + * @param encoding The string encoding when `key` is a string. + */ + function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; + function createSecretKey(key: string, encoding: BufferEncoding): KeyObject; + /** + * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms. + * Optional `options` argument controls the `stream.Writable` behavior. + * + * In some cases, a `Sign` instance can be created using the name of a signature + * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use + * the corresponding digest algorithm. This does not work for all signature + * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest + * algorithm names. + * @since v0.1.92 + * @param options `stream.Writable` options + */ + // TODO: signing algorithm type + function createSign(algorithm: string, options?: stream.WritableOptions): Sign; + type DSAEncoding = "der" | "ieee-p1363"; + interface SigningOptions { + /** + * @see crypto.constants.RSA_PKCS1_PADDING + */ + padding?: number | undefined; + saltLength?: number | undefined; + dsaEncoding?: DSAEncoding | undefined; + context?: ArrayBuffer | NodeJS.ArrayBufferView | undefined; + } + interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {} + interface SignKeyObjectInput extends SigningOptions { + key: KeyObject; + } + interface SignJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {} + interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {} + interface VerifyKeyObjectInput extends SigningOptions { + key: KeyObject; + } + interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {} + type KeyLike = string | Buffer | KeyObject; + /** + * The `Sign` class is a utility for generating signatures. It can be used in one + * of two ways: + * + * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or + * * Using the `sign.update()` and `sign.sign()` methods to produce the + * signature. + * + * The {@link createSign} method is used to create `Sign` instances. The + * argument is the string name of the hash function to use. `Sign` objects are not + * to be created directly using the `new` keyword. + * + * Example: Using `Sign` and `Verify` objects as streams: + * + * ```js + * const { + * generateKeyPairSync, + * createSign, + * createVerify, + * } = await import('node:crypto'); + * + * const { privateKey, publicKey } = generateKeyPairSync('ec', { + * namedCurve: 'sect239k1', + * }); + * + * const sign = createSign('SHA256'); + * sign.write('some data to sign'); + * sign.end(); + * const signature = sign.sign(privateKey, 'hex'); + * + * const verify = createVerify('SHA256'); + * verify.write('some data to sign'); + * verify.end(); + * console.log(verify.verify(publicKey, signature, 'hex')); + * // Prints: true + * ``` + * + * Example: Using the `sign.update()` and `verify.update()` methods: + * + * ```js + * const { + * generateKeyPairSync, + * createSign, + * createVerify, + * } = await import('node:crypto'); + * + * const { privateKey, publicKey } = generateKeyPairSync('rsa', { + * modulusLength: 2048, + * }); + * + * const sign = createSign('SHA256'); + * sign.update('some data to sign'); + * sign.end(); + * const signature = sign.sign(privateKey); + * + * const verify = createVerify('SHA256'); + * verify.update('some data to sign'); + * verify.end(); + * console.log(verify.verify(publicKey, signature)); + * // Prints: true + * ``` + * @since v0.1.92 + */ + class Sign extends stream.Writable { + private constructor(); + /** + * Updates the `Sign` content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `encoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.92 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): this; + update(data: string, inputEncoding: Encoding): this; + /** + * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. + * + * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the following additional properties can be passed: + * + * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. + * + * The `Sign` object can not be again used after `sign.sign()` method has been + * called. Multiple calls to `sign.sign()` will result in an error being thrown. + * @since v0.1.92 + */ + sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput): NonSharedBuffer; + sign( + privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput, + outputFormat: BinaryToTextEncoding, + ): string; + } + /** + * Creates and returns a `Verify` object that uses the given algorithm. + * Use {@link getHashes} to obtain an array of names of the available + * signing algorithms. Optional `options` argument controls the `stream.Writable` behavior. + * + * In some cases, a `Verify` instance can be created using the name of a signature + * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use + * the corresponding digest algorithm. This does not work for all signature + * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest + * algorithm names. + * @since v0.1.92 + * @param options `stream.Writable` options + */ + function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; + /** + * The `Verify` class is a utility for verifying signatures. It can be used in one + * of two ways: + * + * * As a writable `stream` where written data is used to validate against the + * supplied signature, or + * * Using the `verify.update()` and `verify.verify()` methods to verify + * the signature. + * + * The {@link createVerify} method is used to create `Verify` instances. `Verify` objects are not to be created directly using the `new` keyword. + * + * See `Sign` for examples. + * @since v0.1.92 + */ + class Verify extends stream.Writable { + private constructor(); + /** + * Updates the `Verify` content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `inputEncoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or `DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.92 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): Verify; + update(data: string, inputEncoding: Encoding): Verify; + /** + * Verifies the provided data using the given `object` and `signature`. + * + * If `object` is not a `KeyObject`, this function behaves as if `object` had been passed to {@link createPublicKey}. If it is an + * object, the following additional properties can be passed: + * + * The `signature` argument is the previously calculated signature for the data, in + * the `signatureEncoding`. + * If a `signatureEncoding` is specified, the `signature` is expected to be a + * string; otherwise `signature` is expected to be a `Buffer`, `TypedArray`, or `DataView`. + * + * The `verify` object can not be used again after `verify.verify()` has been + * called. Multiple calls to `verify.verify()` will result in an error being + * thrown. + * + * Because public keys can be derived from private keys, a private key may + * be passed instead of a public key. + * @since v0.1.92 + */ + verify( + object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, + signature: NodeJS.ArrayBufferView, + ): boolean; + verify( + object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, + signature: string, + signature_format?: BinaryToTextEncoding, + ): boolean; + } + /** + * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an + * optional specific `generator`. + * + * The `generator` argument can be a number, string, or `Buffer`. If `generator` is not specified, the value `2` is used. + * + * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise + * a `Buffer`, `TypedArray`, or `DataView` is expected. + * + * If `generatorEncoding` is specified, `generator` is expected to be a string; + * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected. + * @since v0.11.12 + * @param primeEncoding The `encoding` of the `prime` string. + * @param [generator=2] + * @param generatorEncoding The `encoding` of the `generator` string. + */ + function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman; + function createDiffieHellman( + prime: ArrayBuffer | NodeJS.ArrayBufferView, + generator?: number | ArrayBuffer | NodeJS.ArrayBufferView, + ): DiffieHellman; + function createDiffieHellman( + prime: ArrayBuffer | NodeJS.ArrayBufferView, + generator: string, + generatorEncoding: BinaryToTextEncoding, + ): DiffieHellman; + function createDiffieHellman( + prime: string, + primeEncoding: BinaryToTextEncoding, + generator?: number | ArrayBuffer | NodeJS.ArrayBufferView, + ): DiffieHellman; + function createDiffieHellman( + prime: string, + primeEncoding: BinaryToTextEncoding, + generator: string, + generatorEncoding: BinaryToTextEncoding, + ): DiffieHellman; + /** + * The `DiffieHellman` class is a utility for creating Diffie-Hellman key + * exchanges. + * + * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function. + * + * ```js + * import assert from 'node:assert'; + * + * const { + * createDiffieHellman, + * } = await import('node:crypto'); + * + * // Generate Alice's keys... + * const alice = createDiffieHellman(2048); + * const aliceKey = alice.generateKeys(); + * + * // Generate Bob's keys... + * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator()); + * const bobKey = bob.generateKeys(); + * + * // Exchange and generate the secret... + * const aliceSecret = alice.computeSecret(bobKey); + * const bobSecret = bob.computeSecret(aliceKey); + * + * // OK + * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); + * ``` + * @since v0.5.0 + */ + class DiffieHellman { + private constructor(); + /** + * Generates private and public Diffie-Hellman key values unless they have been + * generated or computed already, and returns + * the public key in the specified `encoding`. This key should be + * transferred to the other party. + * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. + * + * This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular, + * once a private key has been generated or set, calling this function only updates + * the public key but does not generate a new private key. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + generateKeys(): NonSharedBuffer; + generateKeys(encoding: BinaryToTextEncoding): string; + /** + * Computes the shared secret using `otherPublicKey` as the other + * party's public key and returns the computed shared secret. The supplied + * key is interpreted using the specified `inputEncoding`, and secret is + * encoded using specified `outputEncoding`. + * If the `inputEncoding` is not + * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`. + * + * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. + * @since v0.5.0 + * @param inputEncoding The `encoding` of an `otherPublicKey` string. + * @param outputEncoding The `encoding` of the return value. + */ + computeSecret( + otherPublicKey: NodeJS.ArrayBufferView, + inputEncoding?: null, + outputEncoding?: null, + ): NonSharedBuffer; + computeSecret( + otherPublicKey: string, + inputEncoding: BinaryToTextEncoding, + outputEncoding?: null, + ): NonSharedBuffer; + computeSecret( + otherPublicKey: NodeJS.ArrayBufferView, + inputEncoding: null, + outputEncoding: BinaryToTextEncoding, + ): string; + computeSecret( + otherPublicKey: string, + inputEncoding: BinaryToTextEncoding, + outputEncoding: BinaryToTextEncoding, + ): string; + /** + * Returns the Diffie-Hellman prime in the specified `encoding`. + * If `encoding` is provided a string is + * returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getPrime(): NonSharedBuffer; + getPrime(encoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman generator in the specified `encoding`. + * If `encoding` is provided a string is + * returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getGenerator(): NonSharedBuffer; + getGenerator(encoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman public key in the specified `encoding`. + * If `encoding` is provided a + * string is returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getPublicKey(): NonSharedBuffer; + getPublicKey(encoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman private key in the specified `encoding`. + * If `encoding` is provided a + * string is returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getPrivateKey(): NonSharedBuffer; + getPrivateKey(encoding: BinaryToTextEncoding): string; + /** + * Sets the Diffie-Hellman public key. If the `encoding` argument is provided, `publicKey` is expected + * to be a string. If no `encoding` is provided, `publicKey` is expected + * to be a `Buffer`, `TypedArray`, or `DataView`. + * @since v0.5.0 + * @param encoding The `encoding` of the `publicKey` string. + */ + setPublicKey(publicKey: NodeJS.ArrayBufferView): void; + setPublicKey(publicKey: string, encoding: BufferEncoding): void; + /** + * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected + * to be a string. If no `encoding` is provided, `privateKey` is expected + * to be a `Buffer`, `TypedArray`, or `DataView`. + * + * This function does not automatically compute the associated public key. Either `diffieHellman.setPublicKey()` or `diffieHellman.generateKeys()` can be + * used to manually provide the public key or to automatically derive it. + * @since v0.5.0 + * @param encoding The `encoding` of the `privateKey` string. + */ + setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; + setPrivateKey(privateKey: string, encoding: BufferEncoding): void; + /** + * A bit field containing any warnings and/or errors resulting from a check + * performed during initialization of the `DiffieHellman` object. + * + * The following values are valid for this property (as defined in `node:constants` module): + * + * * `DH_CHECK_P_NOT_SAFE_PRIME` + * * `DH_CHECK_P_NOT_PRIME` + * * `DH_UNABLE_TO_CHECK_GENERATOR` + * * `DH_NOT_SUITABLE_GENERATOR` + * @since v0.11.12 + */ + verifyError: number; + } + /** + * The `DiffieHellmanGroup` class takes a well-known modp group as its argument. + * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation. + * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods. + * + * ```js + * const { createDiffieHellmanGroup } = await import('node:crypto'); + * const dh = createDiffieHellmanGroup('modp1'); + * ``` + * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt): + * ```bash + * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h + * modp1 # 768 bits + * modp2 # 1024 bits + * modp5 # 1536 bits + * modp14 # 2048 bits + * modp15 # etc. + * modp16 + * modp17 + * modp18 + * ``` + * @since v0.7.5 + */ + const DiffieHellmanGroup: DiffieHellmanGroupConstructor; + interface DiffieHellmanGroupConstructor { + new(name: string): DiffieHellmanGroup; + (name: string): DiffieHellmanGroup; + readonly prototype: DiffieHellmanGroup; + } + type DiffieHellmanGroup = Omit; + /** + * Creates a predefined `DiffieHellmanGroup` key exchange object. The + * supported groups are listed in the documentation for `DiffieHellmanGroup`. + * + * The returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing + * the keys (with `diffieHellman.setPublicKey()`, for example). The + * advantage of using this method is that the parties do not have to + * generate nor exchange a group modulus beforehand, saving both processor + * and communication time. + * + * Example (obtaining a shared secret): + * + * ```js + * const { + * getDiffieHellman, + * } = await import('node:crypto'); + * const alice = getDiffieHellman('modp14'); + * const bob = getDiffieHellman('modp14'); + * + * alice.generateKeys(); + * bob.generateKeys(); + * + * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); + * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); + * + * // aliceSecret and bobSecret should be the same + * console.log(aliceSecret === bobSecret); + * ``` + * @since v0.7.5 + */ + function getDiffieHellman(groupName: string): DiffieHellmanGroup; + /** + * An alias for {@link getDiffieHellman} + * @since v0.9.3 + */ + function createDiffieHellmanGroup(name: string): DiffieHellmanGroup; + /** + * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) + * implementation. A selected HMAC digest algorithm specified by `digest` is + * applied to derive a key of the requested byte length (`keylen`) from the `password`, `salt` and `iterations`. + * + * The supplied `callback` function is called with two arguments: `err` and `derivedKey`. If an error occurs while deriving the key, `err` will be set; + * otherwise `err` will be `null`. By default, the successfully generated `derivedKey` will be passed to the callback as a `Buffer`. An error will be + * thrown if any of the input arguments specify invalid values or types. + * + * The `iterations` argument must be a number set as high as possible. The + * higher the number of iterations, the more secure the derived key will be, + * but will take a longer amount of time to complete. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * ```js + * const { + * pbkdf2, + * } = await import('node:crypto'); + * + * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' + * }); + * ``` + * + * An array of supported digest functions can be retrieved using {@link getHashes}. + * + * This API uses libuv's threadpool, which can have surprising and + * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. + * @since v0.5.5 + */ + function pbkdf2( + password: BinaryLike, + salt: BinaryLike, + iterations: number, + keylen: number, + digest: string, + callback: (err: Error | null, derivedKey: NonSharedBuffer) => void, + ): void; + /** + * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) + * implementation. A selected HMAC digest algorithm specified by `digest` is + * applied to derive a key of the requested byte length (`keylen`) from the `password`, `salt` and `iterations`. + * + * If an error occurs an `Error` will be thrown, otherwise the derived key will be + * returned as a `Buffer`. + * + * The `iterations` argument must be a number set as high as possible. The + * higher the number of iterations, the more secure the derived key will be, + * but will take a longer amount of time to complete. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * ```js + * const { + * pbkdf2Sync, + * } = await import('node:crypto'); + * + * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); + * console.log(key.toString('hex')); // '3745e48...08d59ae' + * ``` + * + * An array of supported digest functions can be retrieved using {@link getHashes}. + * @since v0.9.3 + */ + function pbkdf2Sync( + password: BinaryLike, + salt: BinaryLike, + iterations: number, + keylen: number, + digest: string, + ): NonSharedBuffer; + /** + * Generates cryptographically strong pseudorandom data. The `size` argument + * is a number indicating the number of bytes to generate. + * + * If a `callback` function is provided, the bytes are generated asynchronously + * and the `callback` function is invoked with two arguments: `err` and `buf`. + * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The `buf` argument is a `Buffer` containing the generated bytes. + * + * ```js + * // Asynchronous + * const { + * randomBytes, + * } = await import('node:crypto'); + * + * randomBytes(256, (err, buf) => { + * if (err) throw err; + * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); + * }); + * ``` + * + * If the `callback` function is not provided, the random bytes are generated + * synchronously and returned as a `Buffer`. An error will be thrown if + * there is a problem generating the bytes. + * + * ```js + * // Synchronous + * const { + * randomBytes, + * } = await import('node:crypto'); + * + * const buf = randomBytes(256); + * console.log( + * `${buf.length} bytes of random data: ${buf.toString('hex')}`); + * ``` + * + * The `crypto.randomBytes()` method will not complete until there is + * sufficient entropy available. + * This should normally never take longer than a few milliseconds. The only time + * when generating the random bytes may conceivably block for a longer period of + * time is right after boot, when the whole system is still low on entropy. + * + * This API uses libuv's threadpool, which can have surprising and + * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. + * + * The asynchronous version of `crypto.randomBytes()` is carried out in a single + * threadpool request. To minimize threadpool task length variation, partition + * large `randomBytes` requests when doing so as part of fulfilling a client + * request. + * @since v0.5.8 + * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`. + * @return if the `callback` function is not provided. + */ + function randomBytes(size: number): NonSharedBuffer; + function randomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void; + function pseudoRandomBytes(size: number): NonSharedBuffer; + function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void; + /** + * Return a random integer `n` such that `min <= n < max`. This + * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). + * + * The range (`max - min`) must be less than 2**48. `min` and `max` must + * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). + * + * If the `callback` function is not provided, the random integer is + * generated synchronously. + * + * ```js + * // Asynchronous + * const { + * randomInt, + * } = await import('node:crypto'); + * + * randomInt(3, (err, n) => { + * if (err) throw err; + * console.log(`Random number chosen from (0, 1, 2): ${n}`); + * }); + * ``` + * + * ```js + * // Synchronous + * const { + * randomInt, + * } = await import('node:crypto'); + * + * const n = randomInt(3); + * console.log(`Random number chosen from (0, 1, 2): ${n}`); + * ``` + * + * ```js + * // With `min` argument + * const { + * randomInt, + * } = await import('node:crypto'); + * + * const n = randomInt(1, 7); + * console.log(`The dice rolled: ${n}`); + * ``` + * @since v14.10.0, v12.19.0 + * @param [min=0] Start of random range (inclusive). + * @param max End of random range (exclusive). + * @param callback `function(err, n) {}`. + */ + function randomInt(max: number): number; + function randomInt(min: number, max: number): number; + function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; + function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; + /** + * Synchronous version of {@link randomFill}. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { randomFillSync } = await import('node:crypto'); + * + * const buf = Buffer.alloc(10); + * console.log(randomFillSync(buf).toString('hex')); + * + * randomFillSync(buf, 5); + * console.log(buf.toString('hex')); + * + * // The above is equivalent to the following: + * randomFillSync(buf, 5, 5); + * console.log(buf.toString('hex')); + * ``` + * + * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { randomFillSync } = await import('node:crypto'); + * + * const a = new Uint32Array(10); + * console.log(Buffer.from(randomFillSync(a).buffer, + * a.byteOffset, a.byteLength).toString('hex')); + * + * const b = new DataView(new ArrayBuffer(10)); + * console.log(Buffer.from(randomFillSync(b).buffer, + * b.byteOffset, b.byteLength).toString('hex')); + * + * const c = new ArrayBuffer(10); + * console.log(Buffer.from(randomFillSync(c)).toString('hex')); + * ``` + * @since v7.10.0, v6.13.0 + * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. + * @param [offset=0] + * @param [size=buffer.length - offset] + * @return The object passed as `buffer` argument. + */ + function randomFillSync(buffer: T, offset?: number, size?: number): T; + /** + * This function is similar to {@link randomBytes} but requires the first + * argument to be a `Buffer` that will be filled. It also + * requires that a callback is passed in. + * + * If the `callback` function is not provided, an error will be thrown. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { randomFill } = await import('node:crypto'); + * + * const buf = Buffer.alloc(10); + * randomFill(buf, (err, buf) => { + * if (err) throw err; + * console.log(buf.toString('hex')); + * }); + * + * randomFill(buf, 5, (err, buf) => { + * if (err) throw err; + * console.log(buf.toString('hex')); + * }); + * + * // The above is equivalent to the following: + * randomFill(buf, 5, 5, (err, buf) => { + * if (err) throw err; + * console.log(buf.toString('hex')); + * }); + * ``` + * + * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as `buffer`. + * + * While this includes instances of `Float32Array` and `Float64Array`, this + * function should not be used to generate random floating-point numbers. The + * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array + * contains finite numbers only, they are not drawn from a uniform random + * distribution and have no meaningful lower or upper bounds. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { randomFill } = await import('node:crypto'); + * + * const a = new Uint32Array(10); + * randomFill(a, (err, buf) => { + * if (err) throw err; + * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) + * .toString('hex')); + * }); + * + * const b = new DataView(new ArrayBuffer(10)); + * randomFill(b, (err, buf) => { + * if (err) throw err; + * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) + * .toString('hex')); + * }); + * + * const c = new ArrayBuffer(10); + * randomFill(c, (err, buf) => { + * if (err) throw err; + * console.log(Buffer.from(buf).toString('hex')); + * }); + * ``` + * + * This API uses libuv's threadpool, which can have surprising and + * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. + * + * The asynchronous version of `crypto.randomFill()` is carried out in a single + * threadpool request. To minimize threadpool task length variation, partition + * large `randomFill` requests when doing so as part of fulfilling a client + * request. + * @since v7.10.0, v6.13.0 + * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. + * @param [offset=0] + * @param [size=buffer.length - offset] + * @param callback `function(err, buf) {}`. + */ + function randomFill( + buffer: T, + callback: (err: Error | null, buf: T) => void, + ): void; + function randomFill( + buffer: T, + offset: number, + callback: (err: Error | null, buf: T) => void, + ): void; + function randomFill( + buffer: T, + offset: number, + size: number, + callback: (err: Error | null, buf: T) => void, + ): void; + interface ScryptOptions { + cost?: number | undefined; + blockSize?: number | undefined; + parallelization?: number | undefined; + N?: number | undefined; + r?: number | undefined; + p?: number | undefined; + maxmem?: number | undefined; + } + /** + * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based + * key derivation function that is designed to be expensive computationally and + * memory-wise in order to make brute-force attacks unrewarding. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * The `callback` function is called with two arguments: `err` and `derivedKey`. `err` is an exception object when key derivation fails, otherwise `err` is `null`. `derivedKey` is passed to the + * callback as a `Buffer`. + * + * An exception is thrown when any of the input arguments specify invalid values + * or types. + * + * ```js + * const { + * scrypt, + * } = await import('node:crypto'); + * + * // Using the factory defaults. + * scrypt('password', 'salt', 64, (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' + * }); + * // Using a custom N parameter. Must be a power of two. + * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34' + * }); + * ``` + * @since v10.5.0 + */ + function scrypt( + password: BinaryLike, + salt: BinaryLike, + keylen: number, + callback: (err: Error | null, derivedKey: NonSharedBuffer) => void, + ): void; + function scrypt( + password: BinaryLike, + salt: BinaryLike, + keylen: number, + options: ScryptOptions, + callback: (err: Error | null, derivedKey: NonSharedBuffer) => void, + ): void; + /** + * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based + * key derivation function that is designed to be expensive computationally and + * memory-wise in order to make brute-force attacks unrewarding. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * An exception is thrown when key derivation fails, otherwise the derived key is + * returned as a `Buffer`. + * + * An exception is thrown when any of the input arguments specify invalid values + * or types. + * + * ```js + * const { + * scryptSync, + * } = await import('node:crypto'); + * // Using the factory defaults. + * + * const key1 = scryptSync('password', 'salt', 64); + * console.log(key1.toString('hex')); // '3745e48...08d59ae' + * // Using a custom N parameter. Must be a power of two. + * const key2 = scryptSync('password', 'salt', 64, { N: 1024 }); + * console.log(key2.toString('hex')); // '3745e48...aa39b34' + * ``` + * @since v10.5.0 + */ + function scryptSync( + password: BinaryLike, + salt: BinaryLike, + keylen: number, + options?: ScryptOptions, + ): NonSharedBuffer; + interface RsaPublicKey { + key: KeyLike; + padding?: number | undefined; + } + interface RsaPrivateKey { + key: KeyLike; + passphrase?: string | undefined; + /** + * @default 'sha1' + */ + oaepHash?: string | undefined; + oaepLabel?: NodeJS.TypedArray | undefined; + padding?: number | undefined; + } + /** + * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using + * the corresponding private key, for example using {@link privateDecrypt}. + * + * If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`. + * + * Because RSA public keys can be derived from private keys, a private key may + * be passed instead of a public key. + * @since v0.11.14 + */ + function publicEncrypt( + key: RsaPublicKey | RsaPrivateKey | KeyLike, + buffer: NodeJS.ArrayBufferView | string, + ): NonSharedBuffer; + /** + * Decrypts `buffer` with `key`.`buffer` was previously encrypted using + * the corresponding private key, for example using {@link privateEncrypt}. + * + * If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`. + * + * Because RSA public keys can be derived from private keys, a private key may + * be passed instead of a public key. + * @since v1.1.0 + */ + function publicDecrypt( + key: RsaPublicKey | RsaPrivateKey | KeyLike, + buffer: NodeJS.ArrayBufferView | string, + ): NonSharedBuffer; + /** + * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using + * the corresponding public key, for example using {@link publicEncrypt}. + * + * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`. + * @since v0.11.14 + */ + function privateDecrypt( + privateKey: RsaPrivateKey | KeyLike, + buffer: NodeJS.ArrayBufferView | string, + ): NonSharedBuffer; + /** + * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using + * the corresponding public key, for example using {@link publicDecrypt}. + * + * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`. + * @since v1.1.0 + */ + function privateEncrypt( + privateKey: RsaPrivateKey | KeyLike, + buffer: NodeJS.ArrayBufferView | string, + ): NonSharedBuffer; + /** + * ```js + * const { + * getCiphers, + * } = await import('node:crypto'); + * + * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] + * ``` + * @since v0.9.3 + * @return An array with the names of the supported cipher algorithms. + */ + function getCiphers(): string[]; + /** + * ```js + * const { + * getCurves, + * } = await import('node:crypto'); + * + * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] + * ``` + * @since v2.3.0 + * @return An array with the names of the supported elliptic curves. + */ + function getCurves(): string[]; + /** + * @since v10.0.0 + * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. + */ + function getFips(): 1 | 0; + /** + * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. + * Throws an error if FIPS mode is not available. + * @since v10.0.0 + * @param bool `true` to enable FIPS mode. + */ + function setFips(bool: boolean): void; + /** + * ```js + * const { + * getHashes, + * } = await import('node:crypto'); + * + * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] + * ``` + * @since v0.9.3 + * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. + */ + function getHashes(): string[]; + /** + * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) + * key exchanges. + * + * Instances of the `ECDH` class can be created using the {@link createECDH} function. + * + * ```js + * import assert from 'node:assert'; + * + * const { + * createECDH, + * } = await import('node:crypto'); + * + * // Generate Alice's keys... + * const alice = createECDH('secp521r1'); + * const aliceKey = alice.generateKeys(); + * + * // Generate Bob's keys... + * const bob = createECDH('secp521r1'); + * const bobKey = bob.generateKeys(); + * + * // Exchange and generate the secret... + * const aliceSecret = alice.computeSecret(bobKey); + * const bobSecret = bob.computeSecret(aliceKey); + * + * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); + * // OK + * ``` + * @since v0.11.14 + */ + class ECDH { + private constructor(); + /** + * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the + * format specified by `format`. The `format` argument specifies point encoding + * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is + * interpreted using the specified `inputEncoding`, and the returned key is encoded + * using the specified `outputEncoding`. + * + * Use {@link getCurves} to obtain a list of available curve names. + * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display + * the name and description of each available elliptic curve. + * + * If `format` is not specified the point will be returned in `'uncompressed'` format. + * + * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`, `TypedArray`, or `DataView`. + * + * Example (uncompressing a key): + * + * ```js + * const { + * createECDH, + * ECDH, + * } = await import('node:crypto'); + * + * const ecdh = createECDH('secp256k1'); + * ecdh.generateKeys(); + * + * const compressedKey = ecdh.getPublicKey('hex', 'compressed'); + * + * const uncompressedKey = ECDH.convertKey(compressedKey, + * 'secp256k1', + * 'hex', + * 'hex', + * 'uncompressed'); + * + * // The converted key and the uncompressed public key should be the same + * console.log(uncompressedKey === ecdh.getPublicKey('hex')); + * ``` + * @since v10.0.0 + * @param inputEncoding The `encoding` of the `key` string. + * @param outputEncoding The `encoding` of the return value. + * @param [format='uncompressed'] + */ + static convertKey( + key: BinaryLike, + curve: string, + inputEncoding?: BinaryToTextEncoding, + outputEncoding?: "latin1" | "hex" | "base64" | "base64url", + format?: "uncompressed" | "compressed" | "hybrid", + ): NonSharedBuffer | string; + /** + * Generates private and public EC Diffie-Hellman key values, and returns + * the public key in the specified `format` and `encoding`. This key should be + * transferred to the other party. + * + * The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. + * + * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. + * @since v0.11.14 + * @param encoding The `encoding` of the return value. + * @param [format='uncompressed'] + */ + generateKeys(): NonSharedBuffer; + generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; + /** + * Computes the shared secret using `otherPublicKey` as the other + * party's public key and returns the computed shared secret. The supplied + * key is interpreted using specified `inputEncoding`, and the returned secret + * is encoded using the specified `outputEncoding`. + * If the `inputEncoding` is not + * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`. + * + * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. + * + * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey` lies outside of the elliptic curve. Since `otherPublicKey` is + * usually supplied from a remote user over an insecure network, + * be sure to handle this exception accordingly. + * @since v0.11.14 + * @param inputEncoding The `encoding` of the `otherPublicKey` string. + * @param outputEncoding The `encoding` of the return value. + */ + computeSecret(otherPublicKey: NodeJS.ArrayBufferView): NonSharedBuffer; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): NonSharedBuffer; + computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; + computeSecret( + otherPublicKey: string, + inputEncoding: BinaryToTextEncoding, + outputEncoding: BinaryToTextEncoding, + ): string; + /** + * If `encoding` is specified, a string is returned; otherwise a `Buffer` is + * returned. + * @since v0.11.14 + * @param encoding The `encoding` of the return value. + * @return The EC Diffie-Hellman in the specified `encoding`. + */ + getPrivateKey(): NonSharedBuffer; + getPrivateKey(encoding: BinaryToTextEncoding): string; + /** + * The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. + * + * If `encoding` is specified, a string is returned; otherwise a `Buffer` is + * returned. + * @since v0.11.14 + * @param encoding The `encoding` of the return value. + * @param [format='uncompressed'] + * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`. + */ + getPublicKey(encoding?: null, format?: ECDHKeyFormat): NonSharedBuffer; + getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; + /** + * Sets the EC Diffie-Hellman private key. + * If `encoding` is provided, `privateKey` is expected + * to be a string; otherwise `privateKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`. + * + * If `privateKey` is not valid for the curve specified when the `ECDH` object was + * created, an error is thrown. Upon setting the private key, the associated + * public point (key) is also generated and set in the `ECDH` object. + * @since v0.11.14 + * @param encoding The `encoding` of the `privateKey` string. + */ + setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; + setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void; + } + /** + * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a + * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent + * OpenSSL releases, `openssl ecparam -list_curves` will also display the name + * and description of each available elliptic curve. + * @since v0.11.14 + */ + function createECDH(curveName: string): ECDH; + /** + * This function compares the underlying bytes that represent the given `ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time + * algorithm. + * + * This function does not leak timing information that + * would allow an attacker to guess one of the values. This is suitable for + * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). + * + * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they + * must have the same byte length. An error is thrown if `a` and `b` have + * different byte lengths. + * + * If at least one of `a` and `b` is a `TypedArray` with more than one byte per + * entry, such as `Uint16Array`, the result will be computed using the platform + * byte order. + * + * **When both of the inputs are `Float32Array`s or `Float64Array`s, this function might return unexpected results due to IEEE 754** + * **encoding of floating-point numbers. In particular, neither `x === y` nor `Object.is(x, y)` implies that the byte representations of two floating-point** + * **numbers `x` and `y` are equal.** + * + * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code + * is timing-safe. Care should be taken to ensure that the surrounding code does + * not introduce timing vulnerabilities. + * @since v6.6.0 + */ + function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; + interface DHKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> { + /** + * The prime parameter + */ + prime?: Buffer | undefined; + /** + * Prime length in bits + */ + primeLength?: number | undefined; + /** + * Custom generator + * @default 2 + */ + generator?: number | undefined; + /** + * Diffie-Hellman group name + * @see {@link getDiffieHellman} + */ + groupName?: string | undefined; + } + interface DSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Size of q in bits + */ + divisorLength: number; + } + interface ECKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8" | "sec1"> { + /** + * Name of the curve to use + */ + namedCurve: string; + /** + * Must be `'named'` or `'explicit'` + * @default 'named' + */ + paramEncoding?: "explicit" | "named" | undefined; + } + interface ED25519KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} + interface ED448KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} + interface MLDSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} + interface MLKEMKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} + interface RSAPSSKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + /** + * Name of the message digest + */ + hashAlgorithm?: string | undefined; + /** + * Name of the message digest used by MGF1 + */ + mgf1HashAlgorithm?: string | undefined; + /** + * Minimal salt length in bytes + */ + saltLength?: string | undefined; + } + interface RSAKeyPairOptions extends KeyPairExportOptions<"pkcs1" | "spki", "pkcs1" | "pkcs8"> { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + } + interface SLHDSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} + interface X25519KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} + interface X448KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} + /** + * Generates a new asymmetric key pair of the given `type`. See the + * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types). + * + * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function + * behaves as if `keyObject.export()` had been called on its result. Otherwise, + * the respective part of the key is returned as a `KeyObject`. + * + * When encoding public keys, it is recommended to use `'spki'`. When encoding + * private keys, it is recommended to use `'pkcs8'` with a strong passphrase, + * and to keep the passphrase confidential. + * + * ```js + * const { + * generateKeyPairSync, + * } = await import('node:crypto'); + * + * const { + * publicKey, + * privateKey, + * } = generateKeyPairSync('rsa', { + * modulusLength: 4096, + * publicKeyEncoding: { + * type: 'spki', + * format: 'pem', + * }, + * privateKeyEncoding: { + * type: 'pkcs8', + * format: 'pem', + * cipher: 'aes-256-cbc', + * passphrase: 'top secret', + * }, + * }); + * ``` + * + * The return value `{ publicKey, privateKey }` represents the generated key pair. + * When PEM encoding was selected, the respective key will be a string, otherwise + * it will be a buffer containing the data encoded as DER. + * @since v10.12.0 + * @param type The asymmetric key type to generate. See the + * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types). + */ + function generateKeyPairSync( + type: "dh", + options: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: "dsa", + options: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: "ec", + options: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: "ed25519", + options?: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: "ed448", + options?: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: MLDSAKeyType, + options?: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: MLKEMKeyType, + options?: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: "rsa-pss", + options: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: "rsa", + options: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: SLHDSAKeyType, + options?: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: "x25519", + options?: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: "x448", + options?: T, + ): KeyPairExportResult; + /** + * Generates a new asymmetric key pair of the given `type`. See the + * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types). + * + * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function + * behaves as if `keyObject.export()` had been called on its result. Otherwise, + * the respective part of the key is returned as a `KeyObject`. + * + * It is recommended to encode public keys as `'spki'` and private keys as `'pkcs8'` with encryption for long-term storage: + * + * ```js + * const { + * generateKeyPair, + * } = await import('node:crypto'); + * + * generateKeyPair('rsa', { + * modulusLength: 4096, + * publicKeyEncoding: { + * type: 'spki', + * format: 'pem', + * }, + * privateKeyEncoding: { + * type: 'pkcs8', + * format: 'pem', + * cipher: 'aes-256-cbc', + * passphrase: 'top secret', + * }, + * }, (err, publicKey, privateKey) => { + * // Handle errors and use the generated key pair. + * }); + * ``` + * + * On completion, `callback` will be called with `err` set to `undefined` and `publicKey` / `privateKey` representing the generated key pair. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. + * @since v10.12.0 + * @param type The asymmetric key type to generate. See the + * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types). + */ + function generateKeyPair( + type: "dh", + options: T, + callback: KeyPairExportCallback, + ): void; + function generateKeyPair( + type: "dsa", + options: T, + callback: KeyPairExportCallback, + ): void; + function generateKeyPair( + type: "ec", + options: T, + callback: KeyPairExportCallback, + ): void; + function generateKeyPair( + type: "ed25519", + options: T | undefined, + callback: KeyPairExportCallback, + ): void; + function generateKeyPair( + type: "ed448", + options: T | undefined, + callback: KeyPairExportCallback, + ): void; + function generateKeyPair( + type: MLDSAKeyType, + options: T | undefined, + callback: KeyPairExportCallback, + ): void; + function generateKeyPair( + type: MLKEMKeyType, + options: T | undefined, + callback: KeyPairExportCallback, + ): void; + function generateKeyPair( + type: "rsa-pss", + options: T, + callback: KeyPairExportCallback, + ): void; + function generateKeyPair( + type: "rsa", + options: T, + callback: KeyPairExportCallback, + ): void; + function generateKeyPair( + type: SLHDSAKeyType, + options: T | undefined, + callback: KeyPairExportCallback, + ): void; + function generateKeyPair( + type: "x25519", + options: T | undefined, + callback: KeyPairExportCallback, + ): void; + function generateKeyPair( + type: "x448", + options: T | undefined, + callback: KeyPairExportCallback, + ): void; + namespace generateKeyPair { + function __promisify__( + type: "dh", + options: T, + ): Promise>; + function __promisify__( + type: "dsa", + options: T, + ): Promise>; + function __promisify__( + type: "ec", + options: T, + ): Promise>; + function __promisify__( + type: "ed25519", + options?: T, + ): Promise>; + function __promisify__( + type: "ed448", + options?: T, + ): Promise>; + function __promisify__( + type: MLDSAKeyType, + options?: T, + ): Promise>; + function __promisify__( + type: MLKEMKeyType, + options?: T, + ): Promise>; + function __promisify__( + type: "rsa-pss", + options: T, + ): Promise>; + function __promisify__( + type: "rsa", + options: T, + ): Promise>; + function __promisify__( + type: SLHDSAKeyType, + options?: T, + ): Promise>; + function __promisify__( + type: "x25519", + options?: T, + ): Promise>; + function __promisify__( + type: "x448", + options?: T, + ): Promise>; + } + /** + * Calculates and returns the signature for `data` using the given private key and + * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is + * dependent upon the key type. + * + * `algorithm` is required to be `null` or `undefined` for Ed25519, Ed448, and + * ML-DSA. + * + * If `key` is not a `KeyObject`, this function behaves as if `key` had been + * passed to {@link createPrivateKey}. If it is an object, the following + * additional properties can be passed: + * + * If the `callback` function is provided this function uses libuv's threadpool. + * @since v12.0.0 + */ + function sign( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput, + ): NonSharedBuffer; + function sign( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput, + callback: (error: Error | null, data: NonSharedBuffer) => void, + ): void; + /** + * Verifies the given signature for `data` using the given key and algorithm. If + * `algorithm` is `null` or `undefined`, then the algorithm is dependent upon the + * key type. + * + * `algorithm` is required to be `null` or `undefined` for Ed25519, Ed448, and + * ML-DSA. + * + * If `key` is not a `KeyObject`, this function behaves as if `key` had been + * passed to {@link createPublicKey}. If it is an object, the following + * additional properties can be passed: + * + * The `signature` argument is the previously calculated signature for the `data`. + * + * Because public keys can be derived from private keys, a private key or a public + * key may be passed for `key`. + * + * If the `callback` function is provided this function uses libuv's threadpool. + * @since v12.0.0 + */ + function verify( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, + signature: NodeJS.ArrayBufferView, + ): boolean; + function verify( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, + signature: NodeJS.ArrayBufferView, + callback: (error: Error | null, result: boolean) => void, + ): void; + /** + * Key decapsulation using a KEM algorithm with a private key. + * + * Supported key types and their KEM algorithms are: + * + * * `'rsa'` RSA Secret Value Encapsulation + * * `'ec'` DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256) + * * `'x25519'` DHKEM(X25519, HKDF-SHA256) + * * `'x448'` DHKEM(X448, HKDF-SHA512) + * * `'ml-kem-512'` ML-KEM + * * `'ml-kem-768'` ML-KEM + * * `'ml-kem-1024'` ML-KEM + * + * If `key` is not a {@link KeyObject}, this function behaves as if `key` had been + * passed to `crypto.createPrivateKey()`. + * + * If the `callback` function is provided this function uses libuv's threadpool. + * @since v24.7.0 + */ + function decapsulate( + key: KeyLike | PrivateKeyInput | JsonWebKeyInput, + ciphertext: ArrayBuffer | NodeJS.ArrayBufferView, + ): NonSharedBuffer; + function decapsulate( + key: KeyLike | PrivateKeyInput | JsonWebKeyInput, + ciphertext: ArrayBuffer | NodeJS.ArrayBufferView, + callback: (err: Error, sharedKey: NonSharedBuffer) => void, + ): void; + /** + * Computes the Diffie-Hellman shared secret based on a `privateKey` and a `publicKey`. + * Both keys must have the same `asymmetricKeyType` and must support either the DH or + * ECDH operation. + * + * If the `callback` function is provided this function uses libuv's threadpool. + * @since v13.9.0, v12.17.0 + */ + function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): NonSharedBuffer; + function diffieHellman( + options: { privateKey: KeyObject; publicKey: KeyObject }, + callback: (err: Error | null, secret: NonSharedBuffer) => void, + ): void; + /** + * Key encapsulation using a KEM algorithm with a public key. + * + * Supported key types and their KEM algorithms are: + * + * * `'rsa'` RSA Secret Value Encapsulation + * * `'ec'` DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256) + * * `'x25519'` DHKEM(X25519, HKDF-SHA256) + * * `'x448'` DHKEM(X448, HKDF-SHA512) + * * `'ml-kem-512'` ML-KEM + * * `'ml-kem-768'` ML-KEM + * * `'ml-kem-1024'` ML-KEM + * + * If `key` is not a {@link KeyObject}, this function behaves as if `key` had been + * passed to `crypto.createPublicKey()`. + * + * If the `callback` function is provided this function uses libuv's threadpool. + * @since v24.7.0 + */ + function encapsulate( + key: KeyLike | PublicKeyInput | JsonWebKeyInput, + ): { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer }; + function encapsulate( + key: KeyLike | PublicKeyInput | JsonWebKeyInput, + callback: (err: Error, result: { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer }) => void, + ): void; + interface OneShotDigestOptions { + /** + * Encoding used to encode the returned digest. + * @default 'hex' + */ + outputEncoding?: BinaryToTextEncoding | "buffer" | undefined; + /** + * For XOF hash functions such as 'shake256', the outputLength option + * can be used to specify the desired output length in bytes. + */ + outputLength?: number | undefined; + } + interface OneShotDigestOptionsWithStringEncoding extends OneShotDigestOptions { + outputEncoding?: BinaryToTextEncoding | undefined; + } + interface OneShotDigestOptionsWithBufferEncoding extends OneShotDigestOptions { + outputEncoding: "buffer"; + } + /** + * A utility for creating one-shot hash digests of data. It can be faster than + * the object-based `crypto.createHash()` when hashing a smaller amount of data + * (<= 5MB) that's readily available. If the data can be big or if it is streamed, + * it's still recommended to use `crypto.createHash()` instead. + * + * The `algorithm` is dependent on the available algorithms supported by the + * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. + * On recent releases of OpenSSL, `openssl list -digest-algorithms` will + * display the available digest algorithms. + * + * If `options` is a string, then it specifies the `outputEncoding`. + * + * Example: + * + * ```js + * import crypto from 'node:crypto'; + * import { Buffer } from 'node:buffer'; + * + * // Hashing a string and return the result as a hex-encoded string. + * const string = 'Node.js'; + * // 10b3493287f831e81a438811a1ffba01f8cec4b7 + * console.log(crypto.hash('sha1', string)); + * + * // Encode a base64-encoded string into a Buffer, hash it and return + * // the result as a buffer. + * const base64 = 'Tm9kZS5qcw=='; + * // + * console.log(crypto.hash('sha1', Buffer.from(base64, 'base64'), 'buffer')); + * ``` + * @since v21.7.0, v20.12.0 + * @param data When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different + * input encoding is desired for a string input, user could encode the string + * into a `TypedArray` using either `TextEncoder` or `Buffer.from()` and passing + * the encoded `TypedArray` into this API instead. + */ + function hash( + algorithm: string, + data: BinaryLike, + options?: OneShotDigestOptionsWithStringEncoding | BinaryToTextEncoding, + ): string; + function hash( + algorithm: string, + data: BinaryLike, + options: OneShotDigestOptionsWithBufferEncoding | "buffer", + ): NonSharedBuffer; + function hash( + algorithm: string, + data: BinaryLike, + options: OneShotDigestOptions | BinaryToTextEncoding | "buffer", + ): string | NonSharedBuffer; + type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts"; + interface CipherInfoOptions { + /** + * A test key length. + */ + keyLength?: number | undefined; + /** + * A test IV length. + */ + ivLength?: number | undefined; + } + interface CipherInfo { + /** + * The name of the cipher. + */ + name: string; + /** + * The nid of the cipher. + */ + nid: number; + /** + * The block size of the cipher in bytes. + * This property is omitted when mode is 'stream'. + */ + blockSize?: number | undefined; + /** + * The expected or default initialization vector length in bytes. + * This property is omitted if the cipher does not use an initialization vector. + */ + ivLength?: number | undefined; + /** + * The expected or default key length in bytes. + */ + keyLength: number; + /** + * The cipher mode. + */ + mode: CipherMode; + } + /** + * Returns information about a given cipher. + * + * Some ciphers accept variable length keys and initialization vectors. By default, + * the `crypto.getCipherInfo()` method will return the default values for these + * ciphers. To test if a given key length or iv length is acceptable for given + * cipher, use the `keyLength` and `ivLength` options. If the given values are + * unacceptable, `undefined` will be returned. + * @since v15.0.0 + * @param nameOrNid The name or nid of the cipher to query. + */ + function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; + /** + * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. + * + * The supplied `callback` function is called with two arguments: `err` and `derivedKey`. If an errors occurs while deriving the key, `err` will be set; + * otherwise `err` will be `null`. The successfully generated `derivedKey` will + * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any + * of the input arguments specify invalid values or types. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { + * hkdf, + * } = await import('node:crypto'); + * + * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => { + * if (err) throw err; + * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' + * }); + * ``` + * @since v15.0.0 + * @param digest The digest algorithm to use. + * @param ikm The input keying material. Must be provided but can be zero-length. + * @param salt The salt value. Must be provided but can be zero-length. + * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. + * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` + * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). + */ + function hkdf( + digest: string, + irm: BinaryLike | KeyObject, + salt: BinaryLike, + info: BinaryLike, + keylen: number, + callback: (err: Error | null, derivedKey: ArrayBuffer) => void, + ): void; + /** + * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The + * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. + * + * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). + * + * An error will be thrown if any of the input arguments specify invalid values or + * types, or if the derived key cannot be generated. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { + * hkdfSync, + * } = await import('node:crypto'); + * + * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64); + * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' + * ``` + * @since v15.0.0 + * @param digest The digest algorithm to use. + * @param ikm The input keying material. Must be provided but can be zero-length. + * @param salt The salt value. Must be provided but can be zero-length. + * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. + * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` + * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). + */ + function hkdfSync( + digest: string, + ikm: BinaryLike | KeyObject, + salt: BinaryLike, + info: BinaryLike, + keylen: number, + ): ArrayBuffer; + interface SecureHeapUsage { + /** + * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. + */ + total: number; + /** + * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. + */ + min: number; + /** + * The total number of bytes currently allocated from the secure heap. + */ + used: number; + /** + * The calculated ratio of `used` to `total` allocated bytes. + */ + utilization: number; + } + /** + * @since v15.6.0 + */ + function secureHeapUsed(): SecureHeapUsage; + interface RandomUUIDOptions { + /** + * By default, to improve performance, + * Node.js will pre-emptively generate and persistently cache enough + * random data to generate up to 128 random UUIDs. To generate a UUID + * without using the cache, set `disableEntropyCache` to `true`. + * + * @default `false` + */ + disableEntropyCache?: boolean | undefined; + } + type UUID = `${string}-${string}-${string}-${string}-${string}`; + /** + * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a + * cryptographic pseudorandom number generator. + * @since v15.6.0, v14.17.0 + */ + function randomUUID(options?: RandomUUIDOptions): UUID; + interface X509CheckOptions { + /** + * @default 'always' + */ + subject?: "always" | "default" | "never" | undefined; + /** + * @default true + */ + wildcards?: boolean | undefined; + /** + * @default true + */ + partialWildcards?: boolean | undefined; + /** + * @default false + */ + multiLabelWildcards?: boolean | undefined; + /** + * @default false + */ + singleLabelSubdomains?: boolean | undefined; + } + /** + * Encapsulates an X509 certificate and provides read-only access to + * its information. + * + * ```js + * const { X509Certificate } = await import('node:crypto'); + * + * const x509 = new X509Certificate('{... pem encoded cert ...}'); + * + * console.log(x509.subject); + * ``` + * @since v15.6.0 + */ + class X509Certificate { + /** + * Will be \`true\` if this is a Certificate Authority (CA) certificate. + * @since v15.6.0 + */ + readonly ca: boolean; + /** + * The SHA-1 fingerprint of this certificate. + * + * Because SHA-1 is cryptographically broken and because the security of SHA-1 is + * significantly worse than that of algorithms that are commonly used to sign + * certificates, consider using `x509.fingerprint256` instead. + * @since v15.6.0 + */ + readonly fingerprint: string; + /** + * The SHA-256 fingerprint of this certificate. + * @since v15.6.0 + */ + readonly fingerprint256: string; + /** + * The SHA-512 fingerprint of this certificate. + * + * Because computing the SHA-256 fingerprint is usually faster and because it is + * only half the size of the SHA-512 fingerprint, `x509.fingerprint256` may be + * a better choice. While SHA-512 presumably provides a higher level of security in + * general, the security of SHA-256 matches that of most algorithms that are + * commonly used to sign certificates. + * @since v17.2.0, v16.14.0 + */ + readonly fingerprint512: string; + /** + * The complete subject of this certificate. + * @since v15.6.0 + */ + readonly subject: string; + /** + * The subject alternative name specified for this certificate. + * + * This is a comma-separated list of subject alternative names. Each entry begins + * with a string identifying the kind of the subject alternative name followed by + * a colon and the value associated with the entry. + * + * Earlier versions of Node.js incorrectly assumed that it is safe to split this + * property at the two-character sequence `', '` (see [CVE-2021-44532](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44532)). However, + * both malicious and legitimate certificates can contain subject alternative names + * that include this sequence when represented as a string. + * + * After the prefix denoting the type of the entry, the remainder of each entry + * might be enclosed in quotes to indicate that the value is a JSON string literal. + * For backward compatibility, Node.js only uses JSON string literals within this + * property when necessary to avoid ambiguity. Third-party code should be prepared + * to handle both possible entry formats. + * @since v15.6.0 + */ + readonly subjectAltName: string | undefined; + /** + * A textual representation of the certificate's authority information access + * extension. + * + * This is a line feed separated list of access descriptions. Each line begins with + * the access method and the kind of the access location, followed by a colon and + * the value associated with the access location. + * + * After the prefix denoting the access method and the kind of the access location, + * the remainder of each line might be enclosed in quotes to indicate that the + * value is a JSON string literal. For backward compatibility, Node.js only uses + * JSON string literals within this property when necessary to avoid ambiguity. + * Third-party code should be prepared to handle both possible entry formats. + * @since v15.6.0 + */ + readonly infoAccess: string | undefined; + /** + * An array detailing the key usages for this certificate. + * @since v15.6.0 + */ + readonly keyUsage: string[]; + /** + * The issuer identification included in this certificate. + * @since v15.6.0 + */ + readonly issuer: string; + /** + * The issuer certificate or `undefined` if the issuer certificate is not + * available. + * @since v15.9.0 + */ + readonly issuerCertificate: X509Certificate | undefined; + /** + * The public key `KeyObject` for this certificate. + * @since v15.6.0 + */ + readonly publicKey: KeyObject; + /** + * A `Buffer` containing the DER encoding of this certificate. + * @since v15.6.0 + */ + readonly raw: NonSharedBuffer; + /** + * The serial number of this certificate. + * + * Serial numbers are assigned by certificate authorities and do not uniquely + * identify certificates. Consider using `x509.fingerprint256` as a unique + * identifier instead. + * @since v15.6.0 + */ + readonly serialNumber: string; + /** + * The algorithm used to sign the certificate or `undefined` if the signature algorithm is unknown by OpenSSL. + * @since v24.9.0 + */ + readonly signatureAlgorithm: string | undefined; + /** + * The OID of the algorithm used to sign the certificate. + * @since v24.9.0 + */ + readonly signatureAlgorithmOid: string; + /** + * The date/time from which this certificate is considered valid. + * @since v15.6.0 + */ + readonly validFrom: string; + /** + * The date/time from which this certificate is valid, encapsulated in a `Date` object. + * @since v22.10.0 + */ + readonly validFromDate: Date; + /** + * The date/time until which this certificate is considered valid. + * @since v15.6.0 + */ + readonly validTo: string; + /** + * The date/time until which this certificate is valid, encapsulated in a `Date` object. + * @since v22.10.0 + */ + readonly validToDate: Date; + constructor(buffer: BinaryLike); + /** + * Checks whether the certificate matches the given email address. + * + * If the `'subject'` option is undefined or set to `'default'`, the certificate + * subject is only considered if the subject alternative name extension either does + * not exist or does not contain any email addresses. + * + * If the `'subject'` option is set to `'always'` and if the subject alternative + * name extension either does not exist or does not contain a matching email + * address, the certificate subject is considered. + * + * If the `'subject'` option is set to `'never'`, the certificate subject is never + * considered, even if the certificate contains no subject alternative names. + * @since v15.6.0 + * @return Returns `email` if the certificate matches, `undefined` if it does not. + */ + checkEmail(email: string, options?: Pick): string | undefined; + /** + * Checks whether the certificate matches the given host name. + * + * If the certificate matches the given host name, the matching subject name is + * returned. The returned name might be an exact match (e.g., `foo.example.com`) + * or it might contain wildcards (e.g., `*.example.com`). Because host name + * comparisons are case-insensitive, the returned subject name might also differ + * from the given `name` in capitalization. + * + * If the `'subject'` option is undefined or set to `'default'`, the certificate + * subject is only considered if the subject alternative name extension either does + * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS"). + * + * If the `'subject'` option is set to `'always'` and if the subject alternative + * name extension either does not exist or does not contain a matching DNS name, + * the certificate subject is considered. + * + * If the `'subject'` option is set to `'never'`, the certificate subject is never + * considered, even if the certificate contains no subject alternative names. + * @since v15.6.0 + * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`. + */ + checkHost(name: string, options?: X509CheckOptions): string | undefined; + /** + * Checks whether the certificate matches the given IP address (IPv4 or IPv6). + * + * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they + * must match the given `ip` address exactly. Other subject alternative names as + * well as the subject field of the certificate are ignored. + * @since v15.6.0 + * @return Returns `ip` if the certificate matches, `undefined` if it does not. + */ + checkIP(ip: string): string | undefined; + /** + * Checks whether this certificate was potentially issued by the given `otherCert` + * by comparing the certificate metadata. + * + * This is useful for pruning a list of possible issuer certificates which have been + * selected using a more rudimentary filtering routine, i.e. just based on subject + * and issuer names. + * + * Finally, to verify that this certificate's signature was produced by a private key + * corresponding to `otherCert`'s public key use `x509.verify(publicKey)` + * with `otherCert`'s public key represented as a `KeyObject` + * like so + * + * ```js + * if (!x509.verify(otherCert.publicKey)) { + * throw new Error('otherCert did not issue x509'); + * } + * ``` + * @since v15.6.0 + */ + checkIssued(otherCert: X509Certificate): boolean; + /** + * Checks whether the public key for this certificate is consistent with + * the given private key. + * @since v15.6.0 + * @param privateKey A private key. + */ + checkPrivateKey(privateKey: KeyObject): boolean; + /** + * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded + * certificate. + * @since v15.6.0 + */ + toJSON(): string; + /** + * Returns information about this certificate using the legacy `certificate object` encoding. + * @since v15.6.0 + */ + toLegacyObject(): PeerCertificate; + /** + * Returns the PEM-encoded certificate. + * @since v15.6.0 + */ + toString(): string; + /** + * Verifies that this certificate was signed by the given public key. + * Does not perform any other validation checks on the certificate. + * @since v15.6.0 + * @param publicKey A public key. + */ + verify(publicKey: KeyObject): boolean; + } + type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint; + interface GeneratePrimeOptions { + add?: LargeNumberLike | undefined; + rem?: LargeNumberLike | undefined; + /** + * @default false + */ + safe?: boolean | undefined; + bigint?: boolean | undefined; + } + interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions { + bigint: true; + } + interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions { + bigint?: false | undefined; + } + /** + * Generates a pseudorandom prime of `size` bits. + * + * If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime. + * + * The `options.add` and `options.rem` parameters can be used to enforce additional + * requirements, e.g., for Diffie-Hellman: + * + * * If `options.add` and `options.rem` are both set, the prime will satisfy the + * condition that `prime % add = rem`. + * * If only `options.add` is set and `options.safe` is not `true`, the prime will + * satisfy the condition that `prime % add = 1`. + * * If only `options.add` is set and `options.safe` is set to `true`, the prime + * will instead satisfy the condition that `prime % add = 3`. This is necessary + * because `prime % add = 1` for `options.add > 2` would contradict the condition + * enforced by `options.safe`. + * * `options.rem` is ignored if `options.add` is not given. + * + * Both `options.add` and `options.rem` must be encoded as big-endian sequences + * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or `DataView`. + * + * By default, the prime is encoded as a big-endian sequence of octets + * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a + * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. + * @since v15.8.0 + * @param size The size (in bits) of the prime to generate. + */ + function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void; + function generatePrime( + size: number, + options: GeneratePrimeOptionsBigInt, + callback: (err: Error | null, prime: bigint) => void, + ): void; + function generatePrime( + size: number, + options: GeneratePrimeOptionsArrayBuffer, + callback: (err: Error | null, prime: ArrayBuffer) => void, + ): void; + function generatePrime( + size: number, + options: GeneratePrimeOptions, + callback: (err: Error | null, prime: ArrayBuffer | bigint) => void, + ): void; + /** + * Generates a pseudorandom prime of `size` bits. + * + * If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime. + * + * The `options.add` and `options.rem` parameters can be used to enforce additional + * requirements, e.g., for Diffie-Hellman: + * + * * If `options.add` and `options.rem` are both set, the prime will satisfy the + * condition that `prime % add = rem`. + * * If only `options.add` is set and `options.safe` is not `true`, the prime will + * satisfy the condition that `prime % add = 1`. + * * If only `options.add` is set and `options.safe` is set to `true`, the prime + * will instead satisfy the condition that `prime % add = 3`. This is necessary + * because `prime % add = 1` for `options.add > 2` would contradict the condition + * enforced by `options.safe`. + * * `options.rem` is ignored if `options.add` is not given. + * + * Both `options.add` and `options.rem` must be encoded as big-endian sequences + * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or `DataView`. + * + * By default, the prime is encoded as a big-endian sequence of octets + * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a + * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. + * @since v15.8.0 + * @param size The size (in bits) of the prime to generate. + */ + function generatePrimeSync(size: number): ArrayBuffer; + function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint; + function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer; + function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint; + interface CheckPrimeOptions { + /** + * The number of Miller-Rabin probabilistic primality iterations to perform. + * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input. + * Care must be used when selecting a number of checks. + * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details. + * + * @default 0 + */ + checks?: number | undefined; + } + /** + * Checks the primality of the `candidate`. + * @since v15.8.0 + * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. + */ + function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void; + function checkPrime( + value: LargeNumberLike, + options: CheckPrimeOptions, + callback: (err: Error | null, result: boolean) => void, + ): void; + /** + * Checks the primality of the `candidate`. + * @since v15.8.0 + * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. + * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`. + */ + function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean; + /** + * Load and set the `engine` for some or all OpenSSL functions (selected by flags). + * + * `engine` could be either an id or a path to the engine's shared library. + * + * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags` is a bit field taking one of or a mix of the following flags (defined in `crypto.constants`): + * + * * `crypto.constants.ENGINE_METHOD_RSA` + * * `crypto.constants.ENGINE_METHOD_DSA` + * * `crypto.constants.ENGINE_METHOD_DH` + * * `crypto.constants.ENGINE_METHOD_RAND` + * * `crypto.constants.ENGINE_METHOD_EC` + * * `crypto.constants.ENGINE_METHOD_CIPHERS` + * * `crypto.constants.ENGINE_METHOD_DIGESTS` + * * `crypto.constants.ENGINE_METHOD_PKEY_METHS` + * * `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS` + * * `crypto.constants.ENGINE_METHOD_ALL` + * * `crypto.constants.ENGINE_METHOD_NONE` + * @since v0.11.11 + * @param flags + */ + function setEngine(engine: string, flags?: number): void; + /** + * A convenient alias for {@link webcrypto.getRandomValues}. This + * implementation is not compliant with the Web Crypto spec, to write + * web-compatible code use {@link webcrypto.getRandomValues} instead. + * @since v17.4.0 + * @return Returns `typedArray`. + */ + function getRandomValues< + T extends Exclude< + NodeJS.NonSharedTypedArray, + NodeJS.NonSharedFloat16Array | NodeJS.NonSharedFloat32Array | NodeJS.NonSharedFloat64Array + >, + >(typedArray: T): T; + type Argon2Algorithm = "argon2d" | "argon2i" | "argon2id"; + interface Argon2Parameters { + /** + * REQUIRED, this is the password for password hashing applications of Argon2. + */ + message: string | ArrayBuffer | NodeJS.ArrayBufferView; + /** + * REQUIRED, must be at least 8 bytes long. This is the salt for password hashing applications of Argon2. + */ + nonce: string | ArrayBuffer | NodeJS.ArrayBufferView; + /** + * REQUIRED, degree of parallelism determines how many computational chains (lanes) + * can be run. Must be greater than 1 and less than `2**24-1`. + */ + parallelism: number; + /** + * REQUIRED, the length of the key to generate. Must be greater than 4 and + * less than `2**32-1`. + */ + tagLength: number; + /** + * REQUIRED, memory cost in 1KiB blocks. Must be greater than + * `8 * parallelism` and less than `2**32-1`. The actual number of blocks is rounded + * down to the nearest multiple of `4 * parallelism`. + */ + memory: number; + /** + * REQUIRED, number of passes (iterations). Must be greater than 1 and less + * than `2**32-1`. + */ + passes: number; + /** + * OPTIONAL, Random additional input, + * similar to the salt, that should **NOT** be stored with the derived key. This is known as pepper in + * password hashing applications. If used, must have a length not greater than `2**32-1` bytes. + */ + secret?: string | ArrayBuffer | NodeJS.ArrayBufferView | undefined; + /** + * OPTIONAL, Additional data to + * be added to the hash, functionally equivalent to salt or secret, but meant for + * non-random data. If used, must have a length not greater than `2**32-1` bytes. + */ + associatedData?: string | ArrayBuffer | NodeJS.ArrayBufferView | undefined; + } + /** + * Provides an asynchronous [Argon2](https://www.rfc-editor.org/rfc/rfc9106.html) implementation. Argon2 is a password-based + * key derivation function that is designed to be expensive computationally and + * memory-wise in order to make brute-force attacks unrewarding. + * + * The `nonce` should be as unique as possible. It is recommended that a nonce is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `message`, `nonce`, `secret` or `associatedData`, please + * consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v25.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis). + * + * The `callback` function is called with two arguments: `err` and `derivedKey`. + * `err` is an exception object when key derivation fails, otherwise `err` is + * `null`. `derivedKey` is passed to the callback as a `Buffer`. + * + * An exception is thrown when any of the input arguments specify invalid values + * or types. + * + * ```js + * const { argon2, randomBytes } = await import('node:crypto'); + * + * const parameters = { + * message: 'password', + * nonce: randomBytes(16), + * parallelism: 4, + * tagLength: 64, + * memory: 65536, + * passes: 3, + * }; + * + * argon2('argon2id', parameters, (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // 'af91dad...9520f15' + * }); + * ``` + * @since v24.7.0 + * @param algorithm Variant of Argon2, one of `"argon2d"`, `"argon2i"` or `"argon2id"`. + * @experimental + */ + function argon2( + algorithm: Argon2Algorithm, + parameters: Argon2Parameters, + callback: (err: Error | null, derivedKey: NonSharedBuffer) => void, + ): void; + /** + * Provides a synchronous [Argon2][] implementation. Argon2 is a password-based + * key derivation function that is designed to be expensive computationally and + * memory-wise in order to make brute-force attacks unrewarding. + * + * The `nonce` should be as unique as possible. It is recommended that a nonce is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `message`, `nonce`, `secret` or `associatedData`, please + * consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v25.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis). + * + * An exception is thrown when key derivation fails, otherwise the derived key is + * returned as a `Buffer`. + * + * An exception is thrown when any of the input arguments specify invalid values + * or types. + * + * ```js + * const { argon2Sync, randomBytes } = await import('node:crypto'); + * + * const parameters = { + * message: 'password', + * nonce: randomBytes(16), + * parallelism: 4, + * tagLength: 64, + * memory: 65536, + * passes: 3, + * }; + * + * const derivedKey = argon2Sync('argon2id', parameters); + * console.log(derivedKey.toString('hex')); // 'af91dad...9520f15' + * ``` + * @since v24.7.0 + * @experimental + */ + function argon2Sync(algorithm: Argon2Algorithm, parameters: Argon2Parameters): NonSharedBuffer; + /** + * A convenient alias for `crypto.webcrypto.subtle`. + * @since v17.4.0 + */ + const subtle: webcrypto.SubtleCrypto; + /** + * An implementation of the Web Crypto API standard. + * + * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details. + * @since v15.0.0 + */ + const webcrypto: webcrypto.Crypto; + namespace webcrypto { + type AlgorithmIdentifier = Algorithm | string; + type BigInteger = NodeJS.NonSharedUint8Array; + type KeyFormat = "jwk" | "pkcs8" | "raw" | "raw-public" | "raw-secret" | "raw-seed" | "spki"; + type KeyType = "private" | "public" | "secret"; + type KeyUsage = + | "decapsulateBits" + | "decapsulateKey" + | "decrypt" + | "deriveBits" + | "deriveKey" + | "encapsulateBits" + | "encapsulateKey" + | "encrypt" + | "sign" + | "unwrapKey" + | "verify" + | "wrapKey"; + type HashAlgorithmIdentifier = AlgorithmIdentifier; + type NamedCurve = string; + interface AeadParams extends Algorithm { + additionalData?: NodeJS.BufferSource; + iv: NodeJS.BufferSource; + tagLength: number; + } + interface AesCbcParams extends Algorithm { + iv: NodeJS.BufferSource; + } + interface AesCtrParams extends Algorithm { + counter: NodeJS.BufferSource; + length: number; + } + interface AesDerivedKeyParams extends Algorithm { + length: number; + } + interface AesKeyAlgorithm extends KeyAlgorithm { + length: number; + } + interface AesKeyGenParams extends Algorithm { + length: number; + } + interface Algorithm { + name: string; + } + interface Argon2Params extends Algorithm { + associatedData?: NodeJS.BufferSource; + memory: number; + nonce: NodeJS.BufferSource; + parallelism: number; + passes: number; + secretValue?: NodeJS.BufferSource; + version?: number; + } + interface CShakeParams extends Algorithm { + customization?: NodeJS.BufferSource; + functionName?: NodeJS.BufferSource; + length: number; + } + interface ContextParams extends Algorithm { + context?: NodeJS.BufferSource; + } + interface EcKeyAlgorithm extends KeyAlgorithm { + namedCurve: NamedCurve; + } + interface EcKeyGenParams extends Algorithm { + namedCurve: NamedCurve; + } + interface EcKeyImportParams extends Algorithm { + namedCurve: NamedCurve; + } + interface EcdhKeyDeriveParams extends Algorithm { + public: CryptoKey; + } + interface EcdsaParams extends Algorithm { + hash: HashAlgorithmIdentifier; + } + interface HkdfParams extends Algorithm { + hash: HashAlgorithmIdentifier; + info: NodeJS.BufferSource; + salt: NodeJS.BufferSource; + } + interface HmacImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; + } + interface HmacKeyAlgorithm extends KeyAlgorithm { + hash: KeyAlgorithm; + length: number; + } + interface HmacKeyGenParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; + } + interface JsonWebKey { + alg?: string; + crv?: string; + d?: string; + dp?: string; + dq?: string; + e?: string; + ext?: boolean; + k?: string; + key_ops?: string[]; + kty?: string; + n?: string; + oth?: RsaOtherPrimesInfo[]; + p?: string; + q?: string; + qi?: string; + use?: string; + x?: string; + y?: string; + } + interface KeyAlgorithm { + name: string; + } + interface KmacImportParams extends Algorithm { + length?: number; + } + interface KmacKeyAlgorithm extends KeyAlgorithm { + length: number; + } + interface KmacKeyGenParams extends Algorithm { + length?: number; + } + interface KmacParams extends Algorithm { + customization?: NodeJS.BufferSource; + length: number; + } + interface Pbkdf2Params extends Algorithm { + hash: HashAlgorithmIdentifier; + iterations: number; + salt: NodeJS.BufferSource; + } + interface RsaHashedImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; + } + interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { + hash: KeyAlgorithm; + } + interface RsaHashedKeyGenParams extends RsaKeyGenParams { + hash: HashAlgorithmIdentifier; + } + interface RsaKeyAlgorithm extends KeyAlgorithm { + modulusLength: number; + publicExponent: BigInteger; + } + interface RsaKeyGenParams extends Algorithm { + modulusLength: number; + publicExponent: BigInteger; + } + interface RsaOaepParams extends Algorithm { + label?: NodeJS.BufferSource; + } + interface RsaOtherPrimesInfo { + d?: string; + r?: string; + t?: string; + } + interface RsaPssParams extends Algorithm { + saltLength: number; + } + interface Crypto { + readonly subtle: SubtleCrypto; + getRandomValues< + T extends Exclude< + NodeJS.NonSharedTypedArray, + NodeJS.NonSharedFloat16Array | NodeJS.NonSharedFloat32Array | NodeJS.NonSharedFloat64Array + >, + >( + typedArray: T, + ): T; + randomUUID(): UUID; + } + interface CryptoKey { + readonly algorithm: KeyAlgorithm; + readonly extractable: boolean; + readonly type: KeyType; + readonly usages: KeyUsage[]; + } + interface CryptoKeyPair { + privateKey: CryptoKey; + publicKey: CryptoKey; + } + interface EncapsulatedBits { + sharedKey: ArrayBuffer; + ciphertext: ArrayBuffer; + } + interface EncapsulatedKey { + sharedKey: CryptoKey; + ciphertext: ArrayBuffer; + } + interface SubtleCrypto { + decapsulateBits( + decapsulationAlgorithm: AlgorithmIdentifier, + decapsulationKey: CryptoKey, + ciphertext: NodeJS.BufferSource, + ): Promise; + decapsulateKey( + decapsulationAlgorithm: AlgorithmIdentifier, + decapsulationKey: CryptoKey, + ciphertext: NodeJS.BufferSource, + sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams, + extractable: boolean, + usages: KeyUsage[], + ): Promise; + decrypt( + algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams, + key: CryptoKey, + data: NodeJS.BufferSource, + ): Promise; + deriveBits( + algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params, + baseKey: CryptoKey, + length?: number | null, + ): Promise; + deriveKey( + algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params, + baseKey: CryptoKey, + derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | KmacImportParams, + extractable: boolean, + keyUsages: readonly KeyUsage[], + ): Promise; + digest(algorithm: AlgorithmIdentifier | CShakeParams, data: NodeJS.BufferSource): Promise; + encapsulateBits( + encapsulationAlgorithm: AlgorithmIdentifier, + encapsulationKey: CryptoKey, + ): Promise; + encapsulateKey( + encapsulationAlgorithm: AlgorithmIdentifier, + encapsulationKey: CryptoKey, + sharedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | KmacImportParams, + extractable: boolean, + usages: KeyUsage[], + ): Promise; + encrypt( + algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams, + key: CryptoKey, + data: NodeJS.BufferSource, + ): Promise; + exportKey(format: "jwk", key: CryptoKey): Promise; + exportKey(format: Exclude, key: CryptoKey): Promise; + exportKey(format: KeyFormat, key: CryptoKey): Promise; + generateKey( + algorithm: RsaHashedKeyGenParams | EcKeyGenParams, + extractable: boolean, + keyUsages: KeyUsage[], + ): Promise; + generateKey( + algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params | KmacKeyGenParams, + extractable: boolean, + keyUsages: KeyUsage[], + ): Promise; + generateKey( + algorithm: AlgorithmIdentifier, + extractable: boolean, + keyUsages: KeyUsage[], + ): Promise; + getPublicKey(key: CryptoKey, keyUsages: KeyUsage[]): Promise; + importKey( + format: "jwk", + keyData: JsonWebKey, + algorithm: + | AlgorithmIdentifier + | RsaHashedImportParams + | EcKeyImportParams + | HmacImportParams + | AesKeyAlgorithm + | KmacImportParams, + extractable: boolean, + keyUsages: KeyUsage[], + ): Promise; + importKey( + format: Exclude, + keyData: NodeJS.BufferSource, + algorithm: + | AlgorithmIdentifier + | RsaHashedImportParams + | EcKeyImportParams + | HmacImportParams + | AesKeyAlgorithm + | KmacImportParams, + extractable: boolean, + keyUsages: KeyUsage[], + ): Promise; + sign( + algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams, + key: CryptoKey, + data: NodeJS.BufferSource, + ): Promise; + unwrapKey( + format: KeyFormat, + wrappedKey: NodeJS.BufferSource, + unwrappingKey: CryptoKey, + unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams, + unwrappedKeyAlgorithm: + | AlgorithmIdentifier + | RsaHashedImportParams + | EcKeyImportParams + | HmacImportParams + | AesKeyAlgorithm + | KmacImportParams, + extractable: boolean, + keyUsages: KeyUsage[], + ): Promise; + verify( + algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams, + key: CryptoKey, + signature: NodeJS.BufferSource, + data: NodeJS.BufferSource, + ): Promise; + wrapKey( + format: KeyFormat, + key: CryptoKey, + wrappingKey: CryptoKey, + wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams, + ): Promise; + } + } +} +declare module "crypto" { + export * from "node:crypto"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/dgram.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/dgram.d.ts new file mode 100644 index 0000000..3672e08 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/dgram.d.ts @@ -0,0 +1,564 @@ +/** + * The `node:dgram` module provides an implementation of UDP datagram sockets. + * + * ```js + * import dgram from 'node:dgram'; + * + * const server = dgram.createSocket('udp4'); + * + * server.on('error', (err) => { + * console.error(`server error:\n${err.stack}`); + * server.close(); + * }); + * + * server.on('message', (msg, rinfo) => { + * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); + * }); + * + * server.on('listening', () => { + * const address = server.address(); + * console.log(`server listening ${address.address}:${address.port}`); + * }); + * + * server.bind(41234); + * // Prints: server listening 0.0.0.0:41234 + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/dgram.js) + */ +declare module "node:dgram" { + import { NonSharedBuffer } from "node:buffer"; + import * as dns from "node:dns"; + import { Abortable, EventEmitter, InternalEventEmitter } from "node:events"; + import { AddressInfo, BlockList } from "node:net"; + interface RemoteInfo { + address: string; + family: "IPv4" | "IPv6"; + port: number; + size: number; + } + interface BindOptions { + port?: number | undefined; + address?: string | undefined; + exclusive?: boolean | undefined; + fd?: number | undefined; + } + type SocketType = "udp4" | "udp6"; + interface SocketOptions extends Abortable { + type: SocketType; + reuseAddr?: boolean | undefined; + reusePort?: boolean | undefined; + /** + * @default false + */ + ipv6Only?: boolean | undefined; + recvBufferSize?: number | undefined; + sendBufferSize?: number | undefined; + lookup?: + | (( + hostname: string, + options: dns.LookupOneOptions, + callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, + ) => void) + | undefined; + receiveBlockList?: BlockList | undefined; + sendBlockList?: BlockList | undefined; + } + /** + * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram + * messages. When `address` and `port` are not passed to `socket.bind()` the + * method will bind the socket to the "all interfaces" address on a random port + * (it does the right thing for both `udp4` and `udp6` sockets). The bound address + * and port can be retrieved using `socket.address().address` and `socket.address().port`. + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.close()` on the socket: + * + * ```js + * const controller = new AbortController(); + * const { signal } = controller; + * const server = dgram.createSocket({ type: 'udp4', signal }); + * server.on('message', (msg, rinfo) => { + * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); + * }); + * // Later, when you want to close the server. + * controller.abort(); + * ``` + * @since v0.11.13 + * @param options Available options are: + * @param callback Attached as a listener for `'message'` events. Optional. + */ + function createSocket(type: SocketType, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket; + function createSocket(options: SocketOptions, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket; + interface SocketEventMap { + "close": []; + "connect": []; + "error": [err: Error]; + "listening": []; + "message": [msg: NonSharedBuffer, rinfo: RemoteInfo]; + } + /** + * Encapsulates the datagram functionality. + * + * New instances of `dgram.Socket` are created using {@link createSocket}. + * The `new` keyword is not to be used to create `dgram.Socket` instances. + * @since v0.1.99 + */ + class Socket implements EventEmitter { + /** + * Tells the kernel to join a multicast group at the given `multicastAddress` and `multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the `multicastInterface` argument is not + * specified, the operating system will choose + * one interface and will add membership to it. To add membership to every + * available interface, call `addMembership` multiple times, once per interface. + * + * When called on an unbound socket, this method will implicitly bind to a random + * port, listening on all interfaces. + * + * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur: + * + * ```js + * import cluster from 'node:cluster'; + * import dgram from 'node:dgram'; + * + * if (cluster.isPrimary) { + * cluster.fork(); // Works ok. + * cluster.fork(); // Fails with EADDRINUSE. + * } else { + * const s = dgram.createSocket('udp4'); + * s.bind(1234, () => { + * s.addMembership('224.0.0.114'); + * }); + * } + * ``` + * @since v0.6.9 + */ + addMembership(multicastAddress: string, multicastInterface?: string): void; + /** + * Returns an object containing the address information for a socket. + * For UDP sockets, this object will contain `address`, `family`, and `port` properties. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.1.99 + */ + address(): AddressInfo; + /** + * For UDP sockets, causes the `dgram.Socket` to listen for datagram + * messages on a named `port` and optional `address`. If `port` is not + * specified or is `0`, the operating system will attempt to bind to a + * random port. If `address` is not specified, the operating system will + * attempt to listen on all addresses. Once binding is complete, a `'listening'` event is emitted and the optional `callback` function is + * called. + * + * Specifying both a `'listening'` event listener and passing a `callback` to the `socket.bind()` method is not harmful but not very + * useful. + * + * A bound datagram socket keeps the Node.js process running to receive + * datagram messages. + * + * If binding fails, an `'error'` event is generated. In rare case (e.g. + * attempting to bind with a closed socket), an `Error` may be thrown. + * + * Example of a UDP server listening on port 41234: + * + * ```js + * import dgram from 'node:dgram'; + * + * const server = dgram.createSocket('udp4'); + * + * server.on('error', (err) => { + * console.error(`server error:\n${err.stack}`); + * server.close(); + * }); + * + * server.on('message', (msg, rinfo) => { + * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); + * }); + * + * server.on('listening', () => { + * const address = server.address(); + * console.log(`server listening ${address.address}:${address.port}`); + * }); + * + * server.bind(41234); + * // Prints: server listening 0.0.0.0:41234 + * ``` + * @since v0.1.99 + * @param callback with no parameters. Called when binding is complete. + */ + bind(port?: number, address?: string, callback?: () => void): this; + bind(port?: number, callback?: () => void): this; + bind(callback?: () => void): this; + bind(options: BindOptions, callback?: () => void): this; + /** + * Close the underlying socket and stop listening for data on it. If a callback is + * provided, it is added as a listener for the `'close'` event. + * @since v0.1.99 + * @param callback Called when the socket has been closed. + */ + close(callback?: () => void): this; + /** + * Associates the `dgram.Socket` to a remote address and port. Every + * message sent by this handle is automatically sent to that destination. Also, + * the socket will only receive messages from that remote peer. + * Trying to call `connect()` on an already connected socket will result + * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not + * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) + * will be used by default. Once the connection is complete, a `'connect'` event + * is emitted and the optional `callback` function is called. In case of failure, + * the `callback` is called or, failing this, an `'error'` event is emitted. + * @since v12.0.0 + * @param callback Called when the connection is completed or on error. + */ + connect(port: number, address?: string, callback?: () => void): void; + connect(port: number, callback: () => void): void; + /** + * A synchronous function that disassociates a connected `dgram.Socket` from + * its remote address. Trying to call `disconnect()` on an unbound or already + * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception. + * @since v12.0.0 + */ + disconnect(): void; + /** + * Instructs the kernel to leave a multicast group at `multicastAddress` using the `IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the + * kernel when the socket is closed or the process terminates, so most apps will + * never have reason to call this. + * + * If `multicastInterface` is not specified, the operating system will attempt to + * drop membership on all valid interfaces. + * @since v0.6.9 + */ + dropMembership(multicastAddress: string, multicastInterface?: string): void; + /** + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + * @return the `SO_RCVBUF` socket receive buffer size in bytes. + */ + getRecvBufferSize(): number; + /** + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + * @return the `SO_SNDBUF` socket send buffer size in bytes. + */ + getSendBufferSize(): number; + /** + * @since v18.8.0, v16.19.0 + * @return Number of bytes queued for sending. + */ + getSendQueueSize(): number; + /** + * @since v18.8.0, v16.19.0 + * @return Number of send requests currently in the queue awaiting to be processed. + */ + getSendQueueCount(): number; + /** + * By default, binding a socket will cause it to block the Node.js process from + * exiting as long as the socket is open. The `socket.unref()` method can be used + * to exclude the socket from the reference counting that keeps the Node.js + * process active. The `socket.ref()` method adds the socket back to the reference + * counting and restores the default behavior. + * + * Calling `socket.ref()` multiples times will have no additional effect. + * + * The `socket.ref()` method returns a reference to the socket so calls can be + * chained. + * @since v0.9.1 + */ + ref(): this; + /** + * Returns an object containing the `address`, `family`, and `port` of the remote + * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception + * if the socket is not connected. + * @since v12.0.0 + */ + remoteAddress(): AddressInfo; + /** + * Broadcasts a datagram on the socket. + * For connectionless sockets, the destination `port` and `address` must be + * specified. Connected sockets, on the other hand, will use their associated + * remote endpoint, so the `port` and `address` arguments must not be set. + * + * The `msg` argument contains the message to be sent. + * Depending on its type, different behavior can apply. If `msg` is a `Buffer`, + * any `TypedArray` or a `DataView`, + * the `offset` and `length` specify the offset within the `Buffer` where the + * message begins and the number of bytes in the message, respectively. + * If `msg` is a `String`, then it is automatically converted to a `Buffer` with `'utf8'` encoding. With messages that + * contain multi-byte characters, `offset` and `length` will be calculated with + * respect to `byte length` and not the character position. + * If `msg` is an array, `offset` and `length` must not be specified. + * + * The `address` argument is a string. If the value of `address` is a host name, + * DNS will be used to resolve the address of the host. If `address` is not + * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) will be used by default. + * + * If the socket has not been previously bound with a call to `bind`, the socket + * is assigned a random port number and is bound to the "all interfaces" address + * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) + * + * An optional `callback` function may be specified to as a way of reporting + * DNS errors or for determining when it is safe to reuse the `buf` object. + * DNS lookups delay the time to send for at least one tick of the + * Node.js event loop. + * + * The only way to know for sure that the datagram has been sent is by using a `callback`. If an error occurs and a `callback` is given, the error will be + * passed as the first argument to the `callback`. If a `callback` is not given, + * the error is emitted as an `'error'` event on the `socket` object. + * + * Offset and length are optional but both _must_ be set if either are used. + * They are supported only when the first argument is a `Buffer`, a `TypedArray`, + * or a `DataView`. + * + * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket. + * + * Example of sending a UDP packet to a port on `localhost`; + * + * ```js + * import dgram from 'node:dgram'; + * import { Buffer } from 'node:buffer'; + * + * const message = Buffer.from('Some bytes'); + * const client = dgram.createSocket('udp4'); + * client.send(message, 41234, 'localhost', (err) => { + * client.close(); + * }); + * ``` + * + * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`; + * + * ```js + * import dgram from 'node:dgram'; + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from('Some '); + * const buf2 = Buffer.from('bytes'); + * const client = dgram.createSocket('udp4'); + * client.send([buf1, buf2], 41234, (err) => { + * client.close(); + * }); + * ``` + * + * Sending multiple buffers might be faster or slower depending on the + * application and operating system. Run benchmarks to + * determine the optimal strategy on a case-by-case basis. Generally speaking, + * however, sending multiple buffers is faster. + * + * Example of sending a UDP packet using a socket connected to a port on `localhost`: + * + * ```js + * import dgram from 'node:dgram'; + * import { Buffer } from 'node:buffer'; + * + * const message = Buffer.from('Some bytes'); + * const client = dgram.createSocket('udp4'); + * client.connect(41234, 'localhost', (err) => { + * client.send(message, (err) => { + * client.close(); + * }); + * }); + * ``` + * @since v0.1.99 + * @param msg Message to be sent. + * @param offset Offset in the buffer where the message starts. + * @param length Number of bytes in the message. + * @param port Destination port. + * @param address Destination host name or IP address. + * @param callback Called when the message has been sent. + */ + send( + msg: string | NodeJS.ArrayBufferView | readonly any[], + port?: number, + address?: string, + callback?: (error: Error | null, bytes: number) => void, + ): void; + send( + msg: string | NodeJS.ArrayBufferView | readonly any[], + port?: number, + callback?: (error: Error | null, bytes: number) => void, + ): void; + send( + msg: string | NodeJS.ArrayBufferView | readonly any[], + callback?: (error: Error | null, bytes: number) => void, + ): void; + send( + msg: string | NodeJS.ArrayBufferView, + offset: number, + length: number, + port?: number, + address?: string, + callback?: (error: Error | null, bytes: number) => void, + ): void; + send( + msg: string | NodeJS.ArrayBufferView, + offset: number, + length: number, + port?: number, + callback?: (error: Error | null, bytes: number) => void, + ): void; + send( + msg: string | NodeJS.ArrayBufferView, + offset: number, + length: number, + callback?: (error: Error | null, bytes: number) => void, + ): void; + /** + * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP + * packets may be sent to a local interface's broadcast address. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.6.9 + */ + setBroadcast(flag: boolean): void; + /** + * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC + * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_ + * _with a scope index is written as `'IP%scope'` where scope is an interface name_ + * _or interface number._ + * + * Sets the default outgoing multicast interface of the socket to a chosen + * interface or back to system interface selection. The `multicastInterface` must + * be a valid string representation of an IP from the socket's family. + * + * For IPv4 sockets, this should be the IP configured for the desired physical + * interface. All packets sent to multicast on the socket will be sent on the + * interface determined by the most recent successful use of this call. + * + * For IPv6 sockets, `multicastInterface` should include a scope to indicate the + * interface as in the examples that follow. In IPv6, individual `send` calls can + * also use explicit scope in addresses, so only packets sent to a multicast + * address without specifying an explicit scope are affected by the most recent + * successful use of this call. + * + * This method throws `EBADF` if called on an unbound socket. + * + * #### Example: IPv6 outgoing multicast interface + * + * On most systems, where scope format uses the interface name: + * + * ```js + * const socket = dgram.createSocket('udp6'); + * + * socket.bind(1234, () => { + * socket.setMulticastInterface('::%eth1'); + * }); + * ``` + * + * On Windows, where scope format uses an interface number: + * + * ```js + * const socket = dgram.createSocket('udp6'); + * + * socket.bind(1234, () => { + * socket.setMulticastInterface('::%2'); + * }); + * ``` + * + * #### Example: IPv4 outgoing multicast interface + * + * All systems use an IP of the host on the desired physical interface: + * + * ```js + * const socket = dgram.createSocket('udp4'); + * + * socket.bind(1234, () => { + * socket.setMulticastInterface('10.0.0.2'); + * }); + * ``` + * @since v8.6.0 + */ + setMulticastInterface(multicastInterface: string): void; + /** + * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, + * multicast packets will also be received on the local interface. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.3.8 + */ + setMulticastLoopback(flag: boolean): boolean; + /** + * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for + * "Time to Live", in this context it specifies the number of IP hops that a + * packet is allowed to travel through, specifically for multicast traffic. Each + * router or gateway that forwards a packet decrements the TTL. If the TTL is + * decremented to 0 by a router, it will not be forwarded. + * + * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.3.8 + */ + setMulticastTTL(ttl: number): number; + /** + * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer + * in bytes. + * + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + */ + setRecvBufferSize(size: number): void; + /** + * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer + * in bytes. + * + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + */ + setSendBufferSize(size: number): void; + /** + * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", + * in this context it specifies the number of IP hops that a packet is allowed to + * travel through. Each router or gateway that forwards a packet decrements the + * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. + * Changing TTL values is typically done for network probes or when multicasting. + * + * The `ttl` argument may be between 1 and 255\. The default on most systems + * is 64. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.1.101 + */ + setTTL(ttl: number): number; + /** + * By default, binding a socket will cause it to block the Node.js process from + * exiting as long as the socket is open. The `socket.unref()` method can be used + * to exclude the socket from the reference counting that keeps the Node.js + * process active, allowing the process to exit even if the socket is still + * listening. + * + * Calling `socket.unref()` multiple times will have no additional effect. + * + * The `socket.unref()` method returns a reference to the socket so calls can be + * chained. + * @since v0.9.1 + */ + unref(): this; + /** + * Tells the kernel to join a source-specific multicast channel at the given `sourceAddress` and `groupAddress`, using the `multicastInterface` with the `IP_ADD_SOURCE_MEMBERSHIP` socket + * option. If the `multicastInterface` argument + * is not specified, the operating system will choose one interface and will add + * membership to it. To add membership to every available interface, call `socket.addSourceSpecificMembership()` multiple times, once per interface. + * + * When called on an unbound socket, this method will implicitly bind to a random + * port, listening on all interfaces. + * @since v13.1.0, v12.16.0 + */ + addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; + /** + * Instructs the kernel to leave a source-specific multicast channel at the given `sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP` socket option. This method is + * automatically called by the kernel when the + * socket is closed or the process terminates, so most apps will never have + * reason to call this. + * + * If `multicastInterface` is not specified, the operating system will attempt to + * drop membership on all valid interfaces. + * @since v13.1.0, v12.16.0 + */ + dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; + /** + * Calls `socket.close()` and returns a promise that fulfills when the socket has closed. + * @since v20.5.0 + */ + [Symbol.asyncDispose](): Promise; + } + interface Socket extends InternalEventEmitter {} +} +declare module "dgram" { + export * from "node:dgram"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/diagnostics_channel.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/diagnostics_channel.d.ts new file mode 100644 index 0000000..206592b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/diagnostics_channel.d.ts @@ -0,0 +1,576 @@ +/** + * The `node:diagnostics_channel` module provides an API to create named channels + * to report arbitrary message data for diagnostics purposes. + * + * It can be accessed using: + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * ``` + * + * It is intended that a module writer wanting to report diagnostics messages + * will create one or many top-level channels to report messages through. + * Channels may also be acquired at runtime but it is not encouraged + * due to the additional overhead of doing so. Channels may be exported for + * convenience, but as long as the name is known it can be acquired anywhere. + * + * If you intend for your module to produce diagnostics data for others to + * consume it is recommended that you include documentation of what named + * channels are used along with the shape of the message data. Channel names + * should generally include the module name to avoid collisions with data from + * other modules. + * @since v15.1.0, v14.17.0 + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/diagnostics_channel.js) + */ +declare module "node:diagnostics_channel" { + import { AsyncLocalStorage } from "node:async_hooks"; + /** + * Check if there are active subscribers to the named channel. This is helpful if + * the message you want to send might be expensive to prepare. + * + * This API is optional but helpful when trying to publish messages from very + * performance-sensitive code. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * if (diagnostics_channel.hasSubscribers('my-channel')) { + * // There are subscribers, prepare and publish message + * } + * ``` + * @since v15.1.0, v14.17.0 + * @param name The channel name + * @return If there are active subscribers + */ + function hasSubscribers(name: string | symbol): boolean; + /** + * This is the primary entry-point for anyone wanting to publish to a named + * channel. It produces a channel object which is optimized to reduce overhead at + * publish time as much as possible. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * ``` + * @since v15.1.0, v14.17.0 + * @param name The channel name + * @return The named channel object + */ + function channel(name: string | symbol): Channel; + type ChannelListener = (message: unknown, name: string | symbol) => void; + /** + * Register a message handler to subscribe to this channel. This message handler + * will be run synchronously whenever a message is published to the channel. Any + * errors thrown in the message handler will trigger an `'uncaughtException'`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * diagnostics_channel.subscribe('my-channel', (message, name) => { + * // Received data + * }); + * ``` + * @since v18.7.0, v16.17.0 + * @param name The channel name + * @param onMessage The handler to receive channel messages + */ + function subscribe(name: string | symbol, onMessage: ChannelListener): void; + /** + * Remove a message handler previously registered to this channel with {@link subscribe}. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * function onMessage(message, name) { + * // Received data + * } + * + * diagnostics_channel.subscribe('my-channel', onMessage); + * + * diagnostics_channel.unsubscribe('my-channel', onMessage); + * ``` + * @since v18.7.0, v16.17.0 + * @param name The channel name + * @param onMessage The previous subscribed handler to remove + * @return `true` if the handler was found, `false` otherwise. + */ + function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean; + /** + * Creates a `TracingChannel` wrapper for the given `TracingChannel Channels`. If a name is given, the corresponding tracing + * channels will be created in the form of `tracing:${name}:${eventType}` where `eventType` corresponds to the types of `TracingChannel Channels`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channelsByName = diagnostics_channel.tracingChannel('my-channel'); + * + * // or... + * + * const channelsByCollection = diagnostics_channel.tracingChannel({ + * start: diagnostics_channel.channel('tracing:my-channel:start'), + * end: diagnostics_channel.channel('tracing:my-channel:end'), + * asyncStart: diagnostics_channel.channel('tracing:my-channel:asyncStart'), + * asyncEnd: diagnostics_channel.channel('tracing:my-channel:asyncEnd'), + * error: diagnostics_channel.channel('tracing:my-channel:error'), + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param nameOrChannels Channel name or object containing all the `TracingChannel Channels` + * @return Collection of channels to trace with + */ + function tracingChannel< + StoreType = unknown, + ContextType extends object = StoreType extends object ? StoreType : object, + >( + nameOrChannels: string | TracingChannelCollection, + ): TracingChannel; + /** + * The class `Channel` represents an individual named channel within the data + * pipeline. It is used to track subscribers and to publish messages when there + * are subscribers present. It exists as a separate object to avoid channel + * lookups at publish time, enabling very fast publish speeds and allowing + * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly + * with `new Channel(name)` is not supported. + * @since v15.1.0, v14.17.0 + */ + class Channel { + readonly name: string | symbol; + /** + * Check if there are active subscribers to this channel. This is helpful if + * the message you want to send might be expensive to prepare. + * + * This API is optional but helpful when trying to publish messages from very + * performance-sensitive code. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * if (channel.hasSubscribers) { + * // There are subscribers, prepare and publish message + * } + * ``` + * @since v15.1.0, v14.17.0 + */ + readonly hasSubscribers: boolean; + private constructor(name: string | symbol); + /** + * Publish a message to any subscribers to the channel. This will trigger + * message handlers synchronously so they will execute within the same context. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.publish({ + * some: 'message', + * }); + * ``` + * @since v15.1.0, v14.17.0 + * @param message The message to send to the channel subscribers + */ + publish(message: unknown): void; + /** + * Register a message handler to subscribe to this channel. This message handler + * will be run synchronously whenever a message is published to the channel. Any + * errors thrown in the message handler will trigger an `'uncaughtException'`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.subscribe((message, name) => { + * // Received data + * }); + * ``` + * @since v15.1.0, v14.17.0 + * @param onMessage The handler to receive channel messages + */ + subscribe(onMessage: ChannelListener): void; + /** + * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * function onMessage(message, name) { + * // Received data + * } + * + * channel.subscribe(onMessage); + * + * channel.unsubscribe(onMessage); + * ``` + * @since v15.1.0, v14.17.0 + * @param onMessage The previous subscribed handler to remove + * @return `true` if the handler was found, `false` otherwise. + */ + unsubscribe(onMessage: ChannelListener): void; + /** + * When `channel.runStores(context, ...)` is called, the given context data + * will be applied to any store bound to the channel. If the store has already been + * bound the previous `transform` function will be replaced with the new one. + * The `transform` function may be omitted to set the given context data as the + * context directly. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const store = new AsyncLocalStorage(); + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.bindStore(store, (data) => { + * return { data }; + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param store The store to which to bind the context data + * @param transform Transform context data before setting the store context + */ + bindStore(store: AsyncLocalStorage, transform?: (context: ContextType) => StoreType): void; + /** + * Remove a message handler previously registered to this channel with `channel.bindStore(store)`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const store = new AsyncLocalStorage(); + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.bindStore(store); + * channel.unbindStore(store); + * ``` + * @since v19.9.0 + * @experimental + * @param store The store to unbind from the channel. + * @return `true` if the store was found, `false` otherwise. + */ + unbindStore(store: AsyncLocalStorage): boolean; + /** + * Applies the given data to any AsyncLocalStorage instances bound to the channel + * for the duration of the given function, then publishes to the channel within + * the scope of that data is applied to the stores. + * + * If a transform function was given to `channel.bindStore(store)` it will be + * applied to transform the message data before it becomes the context value for + * the store. The prior storage context is accessible from within the transform + * function in cases where context linking is required. + * + * The context applied to the store should be accessible in any async code which + * continues from execution which began during the given function, however + * there are some situations in which `context loss` may occur. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const store = new AsyncLocalStorage(); + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.bindStore(store, (message) => { + * const parent = store.getStore(); + * return new Span(message, parent); + * }); + * channel.runStores({ some: 'message' }, () => { + * store.getStore(); // Span({ some: 'message' }) + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param context Message to send to subscribers and bind to stores + * @param fn Handler to run within the entered storage context + * @param thisArg The receiver to be used for the function call. + * @param args Optional arguments to pass to the function. + */ + runStores( + context: ContextType, + fn: (this: ThisArg, ...args: Args) => Result, + thisArg?: ThisArg, + ...args: Args + ): Result; + } + interface TracingChannelSubscribers { + start: (message: ContextType) => void; + end: ( + message: ContextType & { + error?: unknown; + result?: unknown; + }, + ) => void; + asyncStart: ( + message: ContextType & { + error?: unknown; + result?: unknown; + }, + ) => void; + asyncEnd: ( + message: ContextType & { + error?: unknown; + result?: unknown; + }, + ) => void; + error: ( + message: ContextType & { + error: unknown; + }, + ) => void; + } + interface TracingChannelCollection { + start: Channel; + end: Channel; + asyncStart: Channel; + asyncEnd: Channel; + error: Channel; + } + /** + * The class `TracingChannel` is a collection of `TracingChannel Channels` which + * together express a single traceable action. It is used to formalize and + * simplify the process of producing events for tracing application flow. {@link tracingChannel} is used to construct a `TracingChannel`. As with `Channel` it is recommended to create and reuse a + * single `TracingChannel` at the top-level of the file rather than creating them + * dynamically. + * @since v19.9.0 + * @experimental + */ + class TracingChannel implements TracingChannelCollection { + start: Channel; + end: Channel; + asyncStart: Channel; + asyncEnd: Channel; + error: Channel; + /** + * Helper to subscribe a collection of functions to the corresponding channels. + * This is the same as calling `channel.subscribe(onMessage)` on each channel + * individually. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.subscribe({ + * start(message) { + * // Handle start message + * }, + * end(message) { + * // Handle end message + * }, + * asyncStart(message) { + * // Handle asyncStart message + * }, + * asyncEnd(message) { + * // Handle asyncEnd message + * }, + * error(message) { + * // Handle error message + * }, + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param subscribers Set of `TracingChannel Channels` subscribers + */ + subscribe(subscribers: TracingChannelSubscribers): void; + /** + * Helper to unsubscribe a collection of functions from the corresponding channels. + * This is the same as calling `channel.unsubscribe(onMessage)` on each channel + * individually. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.unsubscribe({ + * start(message) { + * // Handle start message + * }, + * end(message) { + * // Handle end message + * }, + * asyncStart(message) { + * // Handle asyncStart message + * }, + * asyncEnd(message) { + * // Handle asyncEnd message + * }, + * error(message) { + * // Handle error message + * }, + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param subscribers Set of `TracingChannel Channels` subscribers + * @return `true` if all handlers were successfully unsubscribed, and `false` otherwise. + */ + unsubscribe(subscribers: TracingChannelSubscribers): void; + /** + * Trace a synchronous function call. This will always produce a `start event` and `end event` around the execution and may produce an `error event` if the given function throws an error. + * This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all + * events should have any bound stores set to match this trace context. + * + * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions + * which are added after the trace begins will not receive future events from that trace, only future traces will be seen. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.traceSync(() => { + * // Do something + * }, { + * some: 'thing', + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param fn Function to wrap a trace around + * @param context Shared object to correlate events through + * @param thisArg The receiver to be used for the function call + * @param args Optional arguments to pass to the function + * @return The return value of the given function + */ + traceSync( + fn: (this: ThisArg, ...args: Args) => Result, + context?: ContextType, + thisArg?: ThisArg, + ...args: Args + ): Result; + /** + * Trace a promise-returning function call. This will always produce a `start event` and `end event` around the synchronous portion of the + * function execution, and will produce an `asyncStart event` and `asyncEnd event` when a promise continuation is reached. It may also + * produce an `error event` if the given function throws an error or the + * returned promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all + * events should have any bound stores set to match this trace context. + * + * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions + * which are added after the trace begins will not receive future events from that trace, only future traces will be seen. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.tracePromise(async () => { + * // Do something + * }, { + * some: 'thing', + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param fn Promise-returning function to wrap a trace around + * @param context Shared object to correlate trace events through + * @param thisArg The receiver to be used for the function call + * @param args Optional arguments to pass to the function + * @return Chained from promise returned by the given function + */ + tracePromise( + fn: (this: ThisArg, ...args: Args) => Promise, + context?: ContextType, + thisArg?: ThisArg, + ...args: Args + ): Promise; + /** + * Trace a callback-receiving function call. This will always produce a `start event` and `end event` around the synchronous portion of the + * function execution, and will produce a `asyncStart event` and `asyncEnd event` around the callback execution. It may also produce an `error event` if the given function throws an error or + * the returned + * promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all + * events should have any bound stores set to match this trace context. + * + * The `position` will be -1 by default to indicate the final argument should + * be used as the callback. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.traceCallback((arg1, callback) => { + * // Do something + * callback(null, 'result'); + * }, 1, { + * some: 'thing', + * }, thisArg, arg1, callback); + * ``` + * + * The callback will also be run with `channel.runStores(context, ...)` which + * enables context loss recovery in some cases. + * + * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions + * which are added after the trace begins will not receive future events from that trace, only future traces will be seen. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * const myStore = new AsyncLocalStorage(); + * + * // The start channel sets the initial store data to something + * // and stores that store data value on the trace context object + * channels.start.bindStore(myStore, (data) => { + * const span = new Span(data); + * data.span = span; + * return span; + * }); + * + * // Then asyncStart can restore from that data it stored previously + * channels.asyncStart.bindStore(myStore, (data) => { + * return data.span; + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param fn callback using function to wrap a trace around + * @param position Zero-indexed argument position of expected callback + * @param context Shared object to correlate trace events through + * @param thisArg The receiver to be used for the function call + * @param args Optional arguments to pass to the function + * @return The return value of the given function + */ + traceCallback( + fn: (this: ThisArg, ...args: Args) => Result, + position?: number, + context?: ContextType, + thisArg?: ThisArg, + ...args: Args + ): Result; + /** + * `true` if any of the individual channels has a subscriber, `false` if not. + * + * This is a helper method available on a {@link TracingChannel} instance to check + * if any of the [TracingChannel Channels](https://nodejs.org/api/diagnostics_channel.html#tracingchannel-channels) have subscribers. + * A `true` is returned if any of them have at least one subscriber, a `false` is returned otherwise. + * + * ```js + * const diagnostics_channel = require('node:diagnostics_channel'); + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * if (channels.hasSubscribers) { + * // Do something + * } + * ``` + * @since v22.0.0, v20.13.0 + */ + readonly hasSubscribers: boolean; + } +} +declare module "diagnostics_channel" { + export * from "node:diagnostics_channel"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/dns.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/dns.d.ts new file mode 100644 index 0000000..80a2272 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/dns.d.ts @@ -0,0 +1,922 @@ +/** + * The `node:dns` module enables name resolution. For example, use it to look up IP + * addresses of host names. + * + * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the + * DNS protocol for lookups. {@link lookup} uses the operating system + * facilities to perform name resolution. It may not need to perform any network + * communication. To perform name resolution the way other applications on the same + * system do, use {@link lookup}. + * + * ```js + * import dns from 'node:dns'; + * + * dns.lookup('example.org', (err, address, family) => { + * console.log('address: %j family: IPv%s', address, family); + * }); + * // address: "93.184.216.34" family: IPv4 + * ``` + * + * All other functions in the `node:dns` module connect to an actual DNS server to + * perform name resolution. They will always use the network to perform DNS + * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform + * DNS queries, bypassing other name-resolution facilities. + * + * ```js + * import dns from 'node:dns'; + * + * dns.resolve4('archive.org', (err, addresses) => { + * if (err) throw err; + * + * console.log(`addresses: ${JSON.stringify(addresses)}`); + * + * addresses.forEach((a) => { + * dns.reverse(a, (err, hostnames) => { + * if (err) { + * throw err; + * } + * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); + * }); + * }); + * }); + * ``` + * + * See the [Implementation considerations section](https://nodejs.org/docs/latest-v25.x/api/dns.html#implementation-considerations) for more information. + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/dns.js) + */ +declare module "node:dns" { + // Supported getaddrinfo flags. + /** + * Limits returned address types to the types of non-loopback addresses configured on the system. For example, IPv4 addresses are + * only returned if the current system has at least one IPv4 address configured. + */ + const ADDRCONFIG: number; + /** + * If the IPv6 family was specified, but no IPv6 addresses were found, then return IPv4 mapped IPv6 addresses. It is not supported + * on some operating systems (e.g. FreeBSD 10.1). + */ + const V4MAPPED: number; + /** + * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as + * well as IPv4 mapped IPv6 addresses. + */ + const ALL: number; + interface LookupOptions { + /** + * The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons, `'IPv4'` and `'IPv6'` are interpreted + * as `4` and `6` respectively. The value 0 indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used + * with `{ all: true } (see below)`, both IPv4 and IPv6 addresses are returned. + * @default 0 + */ + family?: number | "IPv4" | "IPv6" | undefined; + /** + * One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-v25.x/api/dns.html#supported-getaddrinfo-flags) flags. Multiple flags may be + * passed by bitwise `OR`ing their values. + */ + hints?: number | undefined; + /** + * When `true`, the callback returns all resolved addresses in an array. Otherwise, returns a single address. + * @default false + */ + all?: boolean | undefined; + /** + * When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted + * by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6 + * addresses before IPv4 addresses. Default value is configurable using + * {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--dns-result-orderorder). + * @default `verbatim` (addresses are not reordered) + * @since v22.1.0 + */ + order?: "ipv4first" | "ipv6first" | "verbatim" | undefined; + /** + * When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 + * addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified, + * `order` has higher precedence. New code should only use `order`. Default value is configurable using {@link setDefaultResultOrder} + * @default true (addresses are not reordered) + * @deprecated Please use `order` option + */ + verbatim?: boolean | undefined; + } + interface LookupOneOptions extends LookupOptions { + all?: false | undefined; + } + interface LookupAllOptions extends LookupOptions { + all: true; + } + interface LookupAddress { + /** + * A string representation of an IPv4 or IPv6 address. + */ + address: string; + /** + * `4` or `6`, denoting the family of `address`, or `0` if the address is not an IPv4 or IPv6 address. `0` is a likely indicator of a + * bug in the name resolution service used by the operating system. + */ + family: number; + } + /** + * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or + * AAAA (IPv6) record. All `option` properties are optional. If `options` is an + * integer, then it must be `4` or `6` – if `options` is `0` or not provided, then + * IPv4 and IPv6 addresses are both returned if found. + * + * With the `all` option set to `true`, the arguments for `callback` change to `(err, addresses)`, with `addresses` being an array of objects with the + * properties `address` and `family`. + * + * On error, `err` is an `Error` object, where `err.code` is the error code. + * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when + * the host name does not exist but also when the lookup fails in other ways + * such as no available file descriptors. + * + * `dns.lookup()` does not necessarily have anything to do with the DNS protocol. + * The implementation uses an operating system facility that can associate names + * with addresses and vice versa. This implementation can have subtle but + * important consequences on the behavior of any Node.js program. Please take some + * time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v25.x/api/dns.html#implementation-considerations) + * before using `dns.lookup()`. + * + * Example usage: + * + * ```js + * import dns from 'node:dns'; + * const options = { + * family: 6, + * hints: dns.ADDRCONFIG | dns.V4MAPPED, + * }; + * dns.lookup('example.com', options, (err, address, family) => + * console.log('address: %j family: IPv%s', address, family)); + * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 + * + * // When options.all is true, the result will be an Array. + * options.all = true; + * dns.lookup('example.com', options, (err, addresses) => + * console.log('addresses: %j', addresses)); + * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] + * ``` + * + * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v25.x/api/util.html#utilpromisifyoriginal) ed + * version, and `all` is not set to `true`, it returns a `Promise` for an `Object` with `address` and `family` properties. + * @since v0.1.90 + */ + function lookup( + hostname: string, + family: number, + callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, + ): void; + function lookup( + hostname: string, + options: LookupOneOptions, + callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, + ): void; + function lookup( + hostname: string, + options: LookupAllOptions, + callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void, + ): void; + function lookup( + hostname: string, + options: LookupOptions, + callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void, + ): void; + function lookup( + hostname: string, + callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, + ): void; + namespace lookup { + function __promisify__(hostname: string, options: LookupAllOptions): Promise; + function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; + function __promisify__(hostname: string, options: LookupOptions): Promise; + } + /** + * Resolves the given `address` and `port` into a host name and service using + * the operating system's underlying `getnameinfo` implementation. + * + * If `address` is not a valid IP address, a `TypeError` will be thrown. + * The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown. + * + * On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-error) object, + * where `err.code` is the error code. + * + * ```js + * import dns from 'node:dns'; + * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { + * console.log(hostname, service); + * // Prints: localhost ssh + * }); + * ``` + * + * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v25.x/api/util.html#utilpromisifyoriginal) ed + * version, it returns a `Promise` for an `Object` with `hostname` and `service` properties. + * @since v0.11.14 + */ + function lookupService( + address: string, + port: number, + callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void, + ): void; + namespace lookupService { + function __promisify__( + address: string, + port: number, + ): Promise<{ + hostname: string; + service: string; + }>; + } + interface ResolveOptions { + ttl: boolean; + } + interface ResolveWithTtlOptions extends ResolveOptions { + ttl: true; + } + interface RecordWithTtl { + address: string; + ttl: number; + } + interface AnyARecord extends RecordWithTtl { + type: "A"; + } + interface AnyAaaaRecord extends RecordWithTtl { + type: "AAAA"; + } + interface CaaRecord { + critical: number; + issue?: string | undefined; + issuewild?: string | undefined; + iodef?: string | undefined; + contactemail?: string | undefined; + contactphone?: string | undefined; + } + interface AnyCaaRecord extends CaaRecord { + type: "CAA"; + } + interface MxRecord { + priority: number; + exchange: string; + } + interface AnyMxRecord extends MxRecord { + type: "MX"; + } + interface NaptrRecord { + flags: string; + service: string; + regexp: string; + replacement: string; + order: number; + preference: number; + } + interface AnyNaptrRecord extends NaptrRecord { + type: "NAPTR"; + } + interface SoaRecord { + nsname: string; + hostmaster: string; + serial: number; + refresh: number; + retry: number; + expire: number; + minttl: number; + } + interface AnySoaRecord extends SoaRecord { + type: "SOA"; + } + interface SrvRecord { + priority: number; + weight: number; + port: number; + name: string; + } + interface AnySrvRecord extends SrvRecord { + type: "SRV"; + } + interface TlsaRecord { + certUsage: number; + selector: number; + match: number; + data: ArrayBuffer; + } + interface AnyTlsaRecord extends TlsaRecord { + type: "TLSA"; + } + interface AnyTxtRecord { + type: "TXT"; + entries: string[]; + } + interface AnyNsRecord { + type: "NS"; + value: string; + } + interface AnyPtrRecord { + type: "PTR"; + value: string; + } + interface AnyCnameRecord { + type: "CNAME"; + value: string; + } + type AnyRecord = + | AnyARecord + | AnyAaaaRecord + | AnyCaaRecord + | AnyCnameRecord + | AnyMxRecord + | AnyNaptrRecord + | AnyNsRecord + | AnyPtrRecord + | AnySoaRecord + | AnySrvRecord + | AnyTlsaRecord + | AnyTxtRecord; + /** + * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array + * of the resource records. The `callback` function has arguments `(err, records)`. When successful, `records` will be an array of resource + * records. The type and structure of individual results varies based on `rrtype`: + * + * + * + * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-error) object, + * where `err.code` is one of the `DNS error codes`. + * @since v0.1.27 + * @param hostname Host name to resolve. + * @param [rrtype='A'] Resource record type. + */ + function resolve( + hostname: string, + callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, + ): void; + function resolve( + hostname: string, + rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR", + callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, + ): void; + function resolve( + hostname: string, + rrtype: "ANY", + callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, + ): void; + function resolve( + hostname: string, + rrtype: "CAA", + callback: (err: NodeJS.ErrnoException | null, address: CaaRecord[]) => void, + ): void; + function resolve( + hostname: string, + rrtype: "MX", + callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, + ): void; + function resolve( + hostname: string, + rrtype: "NAPTR", + callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void, + ): void; + function resolve( + hostname: string, + rrtype: "SOA", + callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void, + ): void; + function resolve( + hostname: string, + rrtype: "SRV", + callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, + ): void; + function resolve( + hostname: string, + rrtype: "TLSA", + callback: (err: NodeJS.ErrnoException | null, addresses: TlsaRecord[]) => void, + ): void; + function resolve( + hostname: string, + rrtype: "TXT", + callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, + ): void; + function resolve( + hostname: string, + rrtype: string, + callback: ( + err: NodeJS.ErrnoException | null, + addresses: + | string[] + | CaaRecord[] + | MxRecord[] + | NaptrRecord[] + | SoaRecord + | SrvRecord[] + | TlsaRecord[] + | string[][] + | AnyRecord[], + ) => void, + ): void; + namespace resolve { + function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; + function __promisify__(hostname: string, rrtype: "ANY"): Promise; + function __promisify__(hostname: string, rrtype: "CAA"): Promise; + function __promisify__(hostname: string, rrtype: "MX"): Promise; + function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; + function __promisify__(hostname: string, rrtype: "SOA"): Promise; + function __promisify__(hostname: string, rrtype: "SRV"): Promise; + function __promisify__(hostname: string, rrtype: "TLSA"): Promise; + function __promisify__(hostname: string, rrtype: "TXT"): Promise; + function __promisify__( + hostname: string, + rrtype: string, + ): Promise< + | string[] + | CaaRecord[] + | MxRecord[] + | NaptrRecord[] + | SoaRecord + | SrvRecord[] + | TlsaRecord[] + | string[][] + | AnyRecord[] + >; + } + /** + * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the `hostname`. The `addresses` argument passed to the `callback` function + * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). + * @since v0.1.16 + * @param hostname Host name to resolve. + */ + function resolve4( + hostname: string, + callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, + ): void; + function resolve4( + hostname: string, + options: ResolveWithTtlOptions, + callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, + ): void; + function resolve4( + hostname: string, + options: ResolveOptions, + callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, + ): void; + namespace resolve4 { + function __promisify__(hostname: string): Promise; + function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + /** + * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. The `addresses` argument passed to the `callback` function + * will contain an array of IPv6 addresses. + * @since v0.1.16 + * @param hostname Host name to resolve. + */ + function resolve6( + hostname: string, + callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, + ): void; + function resolve6( + hostname: string, + options: ResolveWithTtlOptions, + callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, + ): void; + function resolve6( + hostname: string, + options: ResolveOptions, + callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, + ): void; + namespace resolve6 { + function __promisify__(hostname: string): Promise; + function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + /** + * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The `addresses` argument passed to the `callback` function + * will contain an array of canonical name records available for the `hostname` (e.g. `['bar.example.com']`). + * @since v0.3.2 + */ + function resolveCname( + hostname: string, + callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, + ): void; + namespace resolveCname { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The `addresses` argument passed to the `callback` function + * will contain an array of certification authority authorization records + * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). + * @since v15.0.0, v14.17.0 + */ + function resolveCaa( + hostname: string, + callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void, + ): void; + namespace resolveCaa { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. The `addresses` argument passed to the `callback` function will + * contain an array of objects containing both a `priority` and `exchange` property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). + * @since v0.1.27 + */ + function resolveMx( + hostname: string, + callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, + ): void; + namespace resolveMx { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of + * objects with the following properties: + * + * * `flags` + * * `service` + * * `regexp` + * * `replacement` + * * `order` + * * `preference` + * + * ```js + * { + * flags: 's', + * service: 'SIP+D2U', + * regexp: '', + * replacement: '_sip._udp.example.com', + * order: 30, + * preference: 100 + * } + * ``` + * @since v0.9.12 + */ + function resolveNaptr( + hostname: string, + callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void, + ): void; + namespace resolveNaptr { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. The `addresses` argument passed to the `callback` function will + * contain an array of name server records available for `hostname` (e.g. `['ns1.example.com', 'ns2.example.com']`). + * @since v0.1.90 + */ + function resolveNs( + hostname: string, + callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, + ): void; + namespace resolveNs { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will + * be an array of strings containing the reply records. + * @since v6.0.0 + */ + function resolvePtr( + hostname: string, + callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, + ): void; + namespace resolvePtr { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for + * the `hostname`. The `address` argument passed to the `callback` function will + * be an object with the following properties: + * + * * `nsname` + * * `hostmaster` + * * `serial` + * * `refresh` + * * `retry` + * * `expire` + * * `minttl` + * + * ```js + * { + * nsname: 'ns.example.com', + * hostmaster: 'root.example.com', + * serial: 2013101809, + * refresh: 10000, + * retry: 2400, + * expire: 604800, + * minttl: 3600 + * } + * ``` + * @since v0.11.10 + */ + function resolveSoa( + hostname: string, + callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void, + ): void; + namespace resolveSoa { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. The `addresses` argument passed to the `callback` function will + * be an array of objects with the following properties: + * + * * `priority` + * * `weight` + * * `port` + * * `name` + * + * ```js + * { + * priority: 10, + * weight: 5, + * port: 21223, + * name: 'service.example.com' + * } + * ``` + * @since v0.1.27 + */ + function resolveSrv( + hostname: string, + callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, + ): void; + namespace resolveSrv { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve certificate associations (`TLSA` records) for + * the `hostname`. The `records` argument passed to the `callback` function is an + * array of objects with these properties: + * + * * `certUsage` + * * `selector` + * * `match` + * * `data` + * + * ```js + * { + * certUsage: 3, + * selector: 1, + * match: 1, + * data: [ArrayBuffer] + * } + * ``` + * @since v23.9.0, v22.15.0 + */ + function resolveTlsa( + hostname: string, + callback: (err: NodeJS.ErrnoException | null, addresses: TlsaRecord[]) => void, + ): void; + namespace resolveTlsa { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. The `records` argument passed to the `callback` function is a + * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of + * one record. Depending on the use case, these could be either joined together or + * treated separately. + * @since v0.1.27 + */ + function resolveTxt( + hostname: string, + callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, + ): void; + namespace resolveTxt { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). + * The `ret` argument passed to the `callback` function will be an array containing + * various types of records. Each object has a property `type` that indicates the + * type of the current record. And depending on the `type`, additional properties + * will be present on the object: + * + * + * + * Here is an example of the `ret` object passed to the callback: + * + * ```js + * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, + * { type: 'CNAME', value: 'example.com' }, + * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, + * { type: 'NS', value: 'ns1.example.com' }, + * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, + * { type: 'SOA', + * nsname: 'ns1.example.com', + * hostmaster: 'admin.example.com', + * serial: 156696742, + * refresh: 900, + * retry: 900, + * expire: 1800, + * minttl: 60 } ] + * ``` + * + * DNS server operators may choose not to respond to `ANY` queries. It may be better to call individual methods like {@link resolve4}, {@link resolveMx}, and so on. For more details, see + * [RFC 8482](https://tools.ietf.org/html/rfc8482). + */ + function resolveAny( + hostname: string, + callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, + ): void; + namespace resolveAny { + function __promisify__(hostname: string): Promise; + } + /** + * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an + * array of host names. + * + * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-error) object, where `err.code` is + * one of the [DNS error codes](https://nodejs.org/docs/latest-v25.x/api/dns.html#error-codes). + * @since v0.1.16 + */ + function reverse( + ip: string, + callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void, + ): void; + /** + * Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v25.x/api/dns.html#dnspromiseslookuphostname-options). + * The value could be: + * + * * `ipv4first`: for `order` defaulting to `ipv4first`. + * * `ipv6first`: for `order` defaulting to `ipv6first`. + * * `verbatim`: for `order` defaulting to `verbatim`. + * @since v18.17.0 + */ + function getDefaultResultOrder(): "ipv4first" | "ipv6first" | "verbatim"; + /** + * Sets the IP address and port of servers to be used when performing DNS + * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted + * addresses. If the port is the IANA default DNS port (53) it can be omitted. + * + * ```js + * dns.setServers([ + * '4.4.4.4', + * '[2001:4860:4860::8888]', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ]); + * ``` + * + * An error will be thrown if an invalid address is provided. + * + * The `dns.setServers()` method must not be called while a DNS query is in + * progress. + * + * The {@link setServers} method affects only {@link resolve}, `dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). + * + * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). + * That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with + * subsequent servers provided. Fallback DNS servers will only be used if the + * earlier ones time out or result in some other error. + * @since v0.11.3 + * @param servers array of [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952#section-6) formatted addresses + */ + function setServers(servers: readonly string[]): void; + /** + * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), + * that are currently configured for DNS resolution. A string will include a port + * section if a custom port is used. + * + * ```js + * [ + * '4.4.4.4', + * '2001:4860:4860::8888', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ] + * ``` + * @since v0.11.3 + */ + function getServers(): string[]; + /** + * Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v25.x/api/dns.html#dnspromiseslookuphostname-options). + * The value could be: + * + * * `ipv4first`: sets default `order` to `ipv4first`. + * * `ipv6first`: sets default `order` to `ipv6first`. + * * `verbatim`: sets default `order` to `verbatim`. + * + * The default is `verbatim` and {@link setDefaultResultOrder} have higher + * priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--dns-result-orderorder). When using + * [worker threads](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main + * thread won't affect the default dns orders in workers. + * @since v16.4.0, v14.18.0 + * @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`. + */ + function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void; + // Error codes + const NODATA: "ENODATA"; + const FORMERR: "EFORMERR"; + const SERVFAIL: "ESERVFAIL"; + const NOTFOUND: "ENOTFOUND"; + const NOTIMP: "ENOTIMP"; + const REFUSED: "EREFUSED"; + const BADQUERY: "EBADQUERY"; + const BADNAME: "EBADNAME"; + const BADFAMILY: "EBADFAMILY"; + const BADRESP: "EBADRESP"; + const CONNREFUSED: "ECONNREFUSED"; + const TIMEOUT: "ETIMEOUT"; + const EOF: "EOF"; + const FILE: "EFILE"; + const NOMEM: "ENOMEM"; + const DESTRUCTION: "EDESTRUCTION"; + const BADSTR: "EBADSTR"; + const BADFLAGS: "EBADFLAGS"; + const NONAME: "ENONAME"; + const BADHINTS: "EBADHINTS"; + const NOTINITIALIZED: "ENOTINITIALIZED"; + const LOADIPHLPAPI: "ELOADIPHLPAPI"; + const ADDRGETNETWORKPARAMS: "EADDRGETNETWORKPARAMS"; + const CANCELLED: "ECANCELLED"; + interface ResolverOptions { + /** + * Query timeout in milliseconds, or `-1` to use the default timeout. + */ + timeout?: number | undefined; + /** + * The number of tries the resolver will try contacting each name server before giving up. + * @default 4 + */ + tries?: number | undefined; + /** + * The max retry timeout, in milliseconds. + * @default 0 + */ + maxTimeout?: number | undefined; + } + /** + * An independent resolver for DNS requests. + * + * Creating a new resolver uses the default server settings. Setting + * the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v25.x/api/dns.html#dnssetserversservers) does not affect + * other resolvers: + * + * ```js + * import { Resolver } from 'node:dns'; + * const resolver = new Resolver(); + * resolver.setServers(['4.4.4.4']); + * + * // This request will use the server at 4.4.4.4, independent of global settings. + * resolver.resolve4('example.org', (err, addresses) => { + * // ... + * }); + * ``` + * + * The following methods from the `node:dns` module are available: + * + * * `resolver.getServers()` + * * `resolver.resolve()` + * * `resolver.resolve4()` + * * `resolver.resolve6()` + * * `resolver.resolveAny()` + * * `resolver.resolveCaa()` + * * `resolver.resolveCname()` + * * `resolver.resolveMx()` + * * `resolver.resolveNaptr()` + * * `resolver.resolveNs()` + * * `resolver.resolvePtr()` + * * `resolver.resolveSoa()` + * * `resolver.resolveSrv()` + * * `resolver.resolveTxt()` + * * `resolver.reverse()` + * * `resolver.setServers()` + * @since v8.3.0 + */ + class Resolver { + constructor(options?: ResolverOptions); + /** + * Cancel all outstanding DNS queries made by this resolver. The corresponding + * callbacks will be called with an error with code `ECANCELLED`. + * @since v8.3.0 + */ + cancel(): void; + getServers: typeof getServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCaa: typeof resolveCaa; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTlsa: typeof resolveTlsa; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + /** + * The resolver instance will send its requests from the specified IP address. + * This allows programs to specify outbound interfaces when used on multi-homed + * systems. + * + * If a v4 or v6 address is not specified, it is set to the default and the + * operating system will choose a local address automatically. + * + * The resolver will use the v4 local address when making requests to IPv4 DNS + * servers, and the v6 local address when making requests to IPv6 DNS servers. + * The `rrtype` of resolution requests has no impact on the local address used. + * @since v15.1.0, v14.17.0 + * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. + * @param [ipv6='::0'] A string representation of an IPv6 address. + */ + setLocalAddress(ipv4?: string, ipv6?: string): void; + setServers: typeof setServers; + } +} +declare module "node:dns" { + export * as promises from "node:dns/promises"; +} +declare module "dns" { + export * from "node:dns"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/dns/promises.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/dns/promises.d.ts new file mode 100644 index 0000000..8d5f989 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/dns/promises.d.ts @@ -0,0 +1,503 @@ +/** + * The `dns.promises` API provides an alternative set of asynchronous DNS methods + * that return `Promise` objects rather than using callbacks. The API is accessible + * via `import { promises as dnsPromises } from 'node:dns'` or `import dnsPromises from 'node:dns/promises'`. + * @since v10.6.0 + */ +declare module "node:dns/promises" { + import { + AnyRecord, + CaaRecord, + LookupAddress, + LookupAllOptions, + LookupOneOptions, + LookupOptions, + MxRecord, + NaptrRecord, + RecordWithTtl, + ResolveOptions, + ResolverOptions, + ResolveWithTtlOptions, + SoaRecord, + SrvRecord, + TlsaRecord, + } from "node:dns"; + /** + * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), + * that are currently configured for DNS resolution. A string will include a port + * section if a custom port is used. + * + * ```js + * [ + * '4.4.4.4', + * '2001:4860:4860::8888', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ] + * ``` + * @since v10.6.0 + */ + function getServers(): string[]; + /** + * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or + * AAAA (IPv6) record. All `option` properties are optional. If `options` is an + * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 + * and IPv6 addresses are both returned if found. + * + * With the `all` option set to `true`, the `Promise` is resolved with `addresses` being an array of objects with the properties `address` and `family`. + * + * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code. + * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when + * the host name does not exist but also when the lookup fails in other ways + * such as no available file descriptors. + * + * [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options) does not necessarily have anything to do with the DNS + * protocol. The implementation uses an operating system facility that can + * associate names with addresses and vice versa. This implementation can have + * subtle but important consequences on the behavior of any Node.js program. Please + * take some time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) before + * using `dnsPromises.lookup()`. + * + * Example usage: + * + * ```js + * import dns from 'node:dns'; + * const dnsPromises = dns.promises; + * const options = { + * family: 6, + * hints: dns.ADDRCONFIG | dns.V4MAPPED, + * }; + * + * dnsPromises.lookup('example.com', options).then((result) => { + * console.log('address: %j family: IPv%s', result.address, result.family); + * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 + * }); + * + * // When options.all is true, the result will be an Array. + * options.all = true; + * dnsPromises.lookup('example.com', options).then((result) => { + * console.log('addresses: %j', result); + * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] + * }); + * ``` + * @since v10.6.0 + */ + function lookup(hostname: string, family: number): Promise; + function lookup(hostname: string, options: LookupOneOptions): Promise; + function lookup(hostname: string, options: LookupAllOptions): Promise; + function lookup(hostname: string, options: LookupOptions): Promise; + function lookup(hostname: string): Promise; + /** + * Resolves the given `address` and `port` into a host name and service using + * the operating system's underlying `getnameinfo` implementation. + * + * If `address` is not a valid IP address, a `TypeError` will be thrown. + * The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown. + * + * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code. + * + * ```js + * import dnsPromises from 'node:dns'; + * dnsPromises.lookupService('127.0.0.1', 22).then((result) => { + * console.log(result.hostname, result.service); + * // Prints: localhost ssh + * }); + * ``` + * @since v10.6.0 + */ + function lookupService( + address: string, + port: number, + ): Promise<{ + hostname: string; + service: string; + }>; + /** + * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array + * of the resource records. When successful, the `Promise` is resolved with an + * array of resource records. The type and structure of individual results vary + * based on `rrtype`: + * + * + * + * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` + * is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes). + * @since v10.6.0 + * @param hostname Host name to resolve. + * @param [rrtype='A'] Resource record type. + */ + function resolve(hostname: string): Promise; + function resolve(hostname: string, rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; + function resolve(hostname: string, rrtype: "ANY"): Promise; + function resolve(hostname: string, rrtype: "CAA"): Promise; + function resolve(hostname: string, rrtype: "MX"): Promise; + function resolve(hostname: string, rrtype: "NAPTR"): Promise; + function resolve(hostname: string, rrtype: "SOA"): Promise; + function resolve(hostname: string, rrtype: "SRV"): Promise; + function resolve(hostname: string, rrtype: "TLSA"): Promise; + function resolve(hostname: string, rrtype: "TXT"): Promise; + function resolve(hostname: string, rrtype: string): Promise< + | string[] + | CaaRecord[] + | MxRecord[] + | NaptrRecord[] + | SoaRecord + | SrvRecord[] + | TlsaRecord[] + | string[][] + | AnyRecord[] + >; + /** + * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4 + * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). + * @since v10.6.0 + * @param hostname Host name to resolve. + */ + function resolve4(hostname: string): Promise; + function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; + function resolve4(hostname: string, options: ResolveOptions): Promise; + /** + * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv6 + * addresses. + * @since v10.6.0 + * @param hostname Host name to resolve. + */ + function resolve6(hostname: string): Promise; + function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; + function resolve6(hostname: string, options: ResolveOptions): Promise; + /** + * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). + * On success, the `Promise` is resolved with an array containing various types of + * records. Each object has a property `type` that indicates the type of the + * current record. And depending on the `type`, additional properties will be + * present on the object: + * + * + * + * Here is an example of the result object: + * + * ```js + * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, + * { type: 'CNAME', value: 'example.com' }, + * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, + * { type: 'NS', value: 'ns1.example.com' }, + * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, + * { type: 'SOA', + * nsname: 'ns1.example.com', + * hostmaster: 'admin.example.com', + * serial: 156696742, + * refresh: 900, + * retry: 900, + * expire: 1800, + * minttl: 60 } ] + * ``` + * @since v10.6.0 + */ + function resolveAny(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, + * the `Promise` is resolved with an array of objects containing available + * certification authority authorization records available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). + * @since v15.0.0, v14.17.0 + */ + function resolveCaa(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, + * the `Promise` is resolved with an array of canonical name records available for + * the `hostname` (e.g. `['bar.example.com']`). + * @since v10.6.0 + */ + function resolveCname(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects + * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). + * @since v10.6.0 + */ + function resolveMx(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. On success, the `Promise` is resolved with an array + * of objects with the following properties: + * + * * `flags` + * * `service` + * * `regexp` + * * `replacement` + * * `order` + * * `preference` + * + * ```js + * { + * flags: 's', + * service: 'SIP+D2U', + * regexp: '', + * replacement: '_sip._udp.example.com', + * order: 30, + * preference: 100 + * } + * ``` + * @since v10.6.0 + */ + function resolveNaptr(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. On success, the `Promise` is resolved with an array of name server + * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). + * @since v10.6.0 + */ + function resolveNs(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. On success, the `Promise` is resolved with an array of strings + * containing the reply records. + * @since v10.6.0 + */ + function resolvePtr(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for + * the `hostname`. On success, the `Promise` is resolved with an object with the + * following properties: + * + * * `nsname` + * * `hostmaster` + * * `serial` + * * `refresh` + * * `retry` + * * `expire` + * * `minttl` + * + * ```js + * { + * nsname: 'ns.example.com', + * hostmaster: 'root.example.com', + * serial: 2013101809, + * refresh: 10000, + * retry: 2400, + * expire: 604800, + * minttl: 3600 + * } + * ``` + * @since v10.6.0 + */ + function resolveSoa(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects with + * the following properties: + * + * * `priority` + * * `weight` + * * `port` + * * `name` + * + * ```js + * { + * priority: 10, + * weight: 5, + * port: 21223, + * name: 'service.example.com' + * } + * ``` + * @since v10.6.0 + */ + function resolveSrv(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve certificate associations (`TLSA` records) for + * the `hostname`. On success, the `Promise` is resolved with an array of objectsAdd commentMore actions + * with these properties: + * + * * `certUsage` + * * `selector` + * * `match` + * * `data` + * + * ```js + * { + * certUsage: 3, + * selector: 1, + * match: 1, + * data: [ArrayBuffer] + * } + * ``` + * @since v23.9.0, v22.15.0 + */ + function resolveTlsa(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array + * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of + * one record. Depending on the use case, these could be either joined together or + * treated separately. + * @since v10.6.0 + */ + function resolveTxt(hostname: string): Promise; + /** + * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an + * array of host names. + * + * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` + * is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes). + * @since v10.6.0 + */ + function reverse(ip: string): Promise; + /** + * Get the default value for `verbatim` in {@link lookup} and [dnsPromises.lookup()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options). + * The value could be: + * + * * `ipv4first`: for `verbatim` defaulting to `false`. + * * `verbatim`: for `verbatim` defaulting to `true`. + * @since v20.1.0 + */ + function getDefaultResultOrder(): "ipv4first" | "verbatim"; + /** + * Sets the IP address and port of servers to be used when performing DNS + * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted + * addresses. If the port is the IANA default DNS port (53) it can be omitted. + * + * ```js + * dnsPromises.setServers([ + * '4.4.4.4', + * '[2001:4860:4860::8888]', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ]); + * ``` + * + * An error will be thrown if an invalid address is provided. + * + * The `dnsPromises.setServers()` method must not be called while a DNS query is in + * progress. + * + * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). + * That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with + * subsequent servers provided. Fallback DNS servers will only be used if the + * earlier ones time out or result in some other error. + * @since v10.6.0 + * @param servers array of `RFC 5952` formatted addresses + */ + function setServers(servers: readonly string[]): void; + /** + * Set the default value of `order` in `dns.lookup()` and `{@link lookup}`. The value could be: + * + * * `ipv4first`: sets default `order` to `ipv4first`. + * * `ipv6first`: sets default `order` to `ipv6first`. + * * `verbatim`: sets default `order` to `verbatim`. + * + * The default is `verbatim` and [dnsPromises.setDefaultResultOrder()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder) + * have higher priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). + * When using [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), [`dnsPromises.setDefaultResultOrder()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder) + * from the main thread won't affect the default dns orders in workers. + * @since v16.4.0, v14.18.0 + * @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`. + */ + function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void; + // Error codes + const NODATA: "ENODATA"; + const FORMERR: "EFORMERR"; + const SERVFAIL: "ESERVFAIL"; + const NOTFOUND: "ENOTFOUND"; + const NOTIMP: "ENOTIMP"; + const REFUSED: "EREFUSED"; + const BADQUERY: "EBADQUERY"; + const BADNAME: "EBADNAME"; + const BADFAMILY: "EBADFAMILY"; + const BADRESP: "EBADRESP"; + const CONNREFUSED: "ECONNREFUSED"; + const TIMEOUT: "ETIMEOUT"; + const EOF: "EOF"; + const FILE: "EFILE"; + const NOMEM: "ENOMEM"; + const DESTRUCTION: "EDESTRUCTION"; + const BADSTR: "EBADSTR"; + const BADFLAGS: "EBADFLAGS"; + const NONAME: "ENONAME"; + const BADHINTS: "EBADHINTS"; + const NOTINITIALIZED: "ENOTINITIALIZED"; + const LOADIPHLPAPI: "ELOADIPHLPAPI"; + const ADDRGETNETWORKPARAMS: "EADDRGETNETWORKPARAMS"; + const CANCELLED: "ECANCELLED"; + + /** + * An independent resolver for DNS requests. + * + * Creating a new resolver uses the default server settings. Setting + * the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetserversservers) does not affect + * other resolvers: + * + * ```js + * import { promises } from 'node:dns'; + * const resolver = new promises.Resolver(); + * resolver.setServers(['4.4.4.4']); + * + * // This request will use the server at 4.4.4.4, independent of global settings. + * resolver.resolve4('example.org').then((addresses) => { + * // ... + * }); + * + * // Alternatively, the same code can be written using async-await style. + * (async function() { + * const addresses = await resolver.resolve4('example.org'); + * })(); + * ``` + * + * The following methods from the `dnsPromises` API are available: + * + * * `resolver.getServers()` + * * `resolver.resolve()` + * * `resolver.resolve4()` + * * `resolver.resolve6()` + * * `resolver.resolveAny()` + * * `resolver.resolveCaa()` + * * `resolver.resolveCname()` + * * `resolver.resolveMx()` + * * `resolver.resolveNaptr()` + * * `resolver.resolveNs()` + * * `resolver.resolvePtr()` + * * `resolver.resolveSoa()` + * * `resolver.resolveSrv()` + * * `resolver.resolveTxt()` + * * `resolver.reverse()` + * * `resolver.setServers()` + * @since v10.6.0 + */ + class Resolver { + constructor(options?: ResolverOptions); + /** + * Cancel all outstanding DNS queries made by this resolver. The corresponding + * callbacks will be called with an error with code `ECANCELLED`. + * @since v8.3.0 + */ + cancel(): void; + getServers: typeof getServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCaa: typeof resolveCaa; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTlsa: typeof resolveTlsa; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + /** + * The resolver instance will send its requests from the specified IP address. + * This allows programs to specify outbound interfaces when used on multi-homed + * systems. + * + * If a v4 or v6 address is not specified, it is set to the default and the + * operating system will choose a local address automatically. + * + * The resolver will use the v4 local address when making requests to IPv4 DNS + * servers, and the v6 local address when making requests to IPv6 DNS servers. + * The `rrtype` of resolution requests has no impact on the local address used. + * @since v15.1.0, v14.17.0 + * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. + * @param [ipv6='::0'] A string representation of an IPv6 address. + */ + setLocalAddress(ipv4?: string, ipv6?: string): void; + setServers: typeof setServers; + } +} +declare module "dns/promises" { + export * from "node:dns/promises"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/domain.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/domain.d.ts new file mode 100644 index 0000000..24a0981 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/domain.d.ts @@ -0,0 +1,166 @@ +/** + * **This module is pending deprecation.** Once a replacement API has been + * finalized, this module will be fully deprecated. Most developers should + * **not** have cause to use this module. Users who absolutely must have + * the functionality that domains provide may rely on it for the time being + * but should expect to have to migrate to a different solution + * in the future. + * + * Domains provide a way to handle multiple different IO operations as a + * single group. If any of the event emitters or callbacks registered to a + * domain emit an `'error'` event, or throw an error, then the domain object + * will be notified, rather than losing the context of the error in the `process.on('uncaughtException')` handler, or causing the program to + * exit immediately with an error code. + * @deprecated Since v1.4.2 - Deprecated + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/domain.js) + */ +declare module "node:domain" { + import { EventEmitter } from "node:events"; + /** + * The `Domain` class encapsulates the functionality of routing errors and + * uncaught exceptions to the active `Domain` object. + * + * To handle the errors that it catches, listen to its `'error'` event. + */ + class Domain extends EventEmitter { + /** + * An array of event emitters that have been explicitly added to the domain. + */ + members: EventEmitter[]; + /** + * The `enter()` method is plumbing used by the `run()`, `bind()`, and `intercept()` methods to set the active domain. It sets `domain.active` and `process.domain` to the domain, and implicitly + * pushes the domain onto the domain + * stack managed by the domain module (see {@link exit} for details on the + * domain stack). The call to `enter()` delimits the beginning of a chain of + * asynchronous calls and I/O operations bound to a domain. + * + * Calling `enter()` changes only the active domain, and does not alter the domain + * itself. `enter()` and `exit()` can be called an arbitrary number of times on a + * single domain. + */ + enter(): void; + /** + * The `exit()` method exits the current domain, popping it off the domain stack. + * Any time execution is going to switch to the context of a different chain of + * asynchronous calls, it's important to ensure that the current domain is exited. + * The call to `exit()` delimits either the end of or an interruption to the chain + * of asynchronous calls and I/O operations bound to a domain. + * + * If there are multiple, nested domains bound to the current execution context, `exit()` will exit any domains nested within this domain. + * + * Calling `exit()` changes only the active domain, and does not alter the domain + * itself. `enter()` and `exit()` can be called an arbitrary number of times on a + * single domain. + */ + exit(): void; + /** + * Run the supplied function in the context of the domain, implicitly + * binding all event emitters, timers, and low-level requests that are + * created in that context. Optionally, arguments can be passed to + * the function. + * + * This is the most basic way to use a domain. + * + * ```js + * import domain from 'node:domain'; + * import fs from 'node:fs'; + * const d = domain.create(); + * d.on('error', (er) => { + * console.error('Caught error!', er); + * }); + * d.run(() => { + * process.nextTick(() => { + * setTimeout(() => { // Simulating some various async stuff + * fs.open('non-existent file', 'r', (er, fd) => { + * if (er) throw er; + * // proceed... + * }); + * }, 100); + * }); + * }); + * ``` + * + * In this example, the `d.on('error')` handler will be triggered, rather + * than crashing the program. + */ + run(fn: (...args: any[]) => T, ...args: any[]): T; + /** + * Explicitly adds an emitter to the domain. If any event handlers called by + * the emitter throw an error, or if the emitter emits an `'error'` event, it + * will be routed to the domain's `'error'` event, just like with implicit + * binding. + * + * If the `EventEmitter` was already bound to a domain, it is removed from that + * one, and bound to this one instead. + * @param emitter emitter to be added to the domain + */ + add(emitter: EventEmitter): void; + /** + * The opposite of {@link add}. Removes domain handling from the + * specified emitter. + * @param emitter emitter to be removed from the domain + */ + remove(emitter: EventEmitter): void; + /** + * The returned function will be a wrapper around the supplied callback + * function. When the returned function is called, any errors that are + * thrown will be routed to the domain's `'error'` event. + * + * ```js + * const d = domain.create(); + * + * function readSomeFile(filename, cb) { + * fs.readFile(filename, 'utf8', d.bind((er, data) => { + * // If this throws, it will also be passed to the domain. + * return cb(er, data ? JSON.parse(data) : null); + * })); + * } + * + * d.on('error', (er) => { + * // An error occurred somewhere. If we throw it now, it will crash the program + * // with the normal line number and stack message. + * }); + * ``` + * @param callback The callback function + * @return The bound function + */ + bind(callback: T): T; + /** + * This method is almost identical to {@link bind}. However, in + * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function. + * + * In this way, the common `if (err) return callback(err);` pattern can be replaced + * with a single error handler in a single place. + * + * ```js + * const d = domain.create(); + * + * function readSomeFile(filename, cb) { + * fs.readFile(filename, 'utf8', d.intercept((data) => { + * // Note, the first argument is never passed to the + * // callback since it is assumed to be the 'Error' argument + * // and thus intercepted by the domain. + * + * // If this throws, it will also be passed to the domain + * // so the error-handling logic can be moved to the 'error' + * // event on the domain instead of being repeated throughout + * // the program. + * return cb(null, JSON.parse(data)); + * })); + * } + * + * d.on('error', (er) => { + * // An error occurred somewhere. If we throw it now, it will crash the program + * // with the normal line number and stack message. + * }); + * ``` + * @param callback The callback function + * @return The intercepted function + */ + intercept(callback: T): T; + } + function create(): Domain; +} +declare module "domain" { + export * from "node:domain"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/events.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/events.d.ts new file mode 100644 index 0000000..6870cf5 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/events.d.ts @@ -0,0 +1,1047 @@ +/** + * Much of the Node.js core API is built around an idiomatic asynchronous + * event-driven architecture in which certain kinds of objects (called "emitters") + * emit named events that cause `Function` objects ("listeners") to be called. + * + * For instance: a `net.Server` object emits an event each time a peer + * connects to it; a `fs.ReadStream` emits an event when the file is opened; + * a `stream` emits an event whenever data is available to be read. + * + * All objects that emit events are instances of the `EventEmitter` class. These + * objects expose an `eventEmitter.on()` function that allows one or more + * functions to be attached to named events emitted by the object. Typically, + * event names are camel-cased strings but any valid JavaScript property key + * can be used. + * + * When the `EventEmitter` object emits an event, all of the functions attached + * to that specific event are called _synchronously_. Any values returned by the + * called listeners are _ignored_ and discarded. + * + * The following example shows a simple `EventEmitter` instance with a single + * listener. The `eventEmitter.on()` method is used to register listeners, while + * the `eventEmitter.emit()` method is used to trigger the event. + * + * ```js + * import { EventEmitter } from 'node:events'; + * + * class MyEmitter extends EventEmitter {} + * + * const myEmitter = new MyEmitter(); + * myEmitter.on('event', () => { + * console.log('an event occurred!'); + * }); + * myEmitter.emit('event'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/events.js) + */ +declare module "node:events" { + import { AsyncResource, AsyncResourceOptions } from "node:async_hooks"; + // #region Event map helpers + type EventMap = Record; + type IfEventMap, True, False> = {} extends Events ? False : True; + type Args, EventName extends string | symbol> = IfEventMap< + Events, + EventName extends keyof Events ? Events[EventName] + : EventName extends keyof EventEmitterEventMap ? EventEmitterEventMap[EventName] + : any[], + any[] + >; + type EventNames, EventName extends string | symbol> = IfEventMap< + Events, + EventName | (keyof Events & (string | symbol)) | keyof EventEmitterEventMap, + string | symbol + >; + type Listener, EventName extends string | symbol> = IfEventMap< + Events, + ( + ...args: EventName extends keyof Events ? Events[EventName] + : EventName extends keyof EventEmitterEventMap ? EventEmitterEventMap[EventName] + : any[] + ) => void, + (...args: any[]) => void + >; + interface EventEmitterEventMap { + newListener: [eventName: string | symbol, listener: (...args: any[]) => void]; + removeListener: [eventName: string | symbol, listener: (...args: any[]) => void]; + } + // #endregion + interface EventEmitterOptions { + /** + * It enables + * [automatic capturing of promise rejection](https://nodejs.org/docs/latest-v25.x/api/events.html#capture-rejections-of-promises). + * @default false + */ + captureRejections?: boolean | undefined; + } + /** + * The `EventEmitter` class is defined and exposed by the `node:events` module: + * + * ```js + * import { EventEmitter } from 'node:events'; + * ``` + * + * All `EventEmitter`s emit the event `'newListener'` when new listeners are + * added and `'removeListener'` when existing listeners are removed. + * + * It supports the following option: + * @since v0.1.26 + */ + class EventEmitter = any> { + constructor(options?: EventEmitterOptions); + } + interface EventEmitter = any> extends NodeJS.EventEmitter {} + global { + namespace NodeJS { + interface EventEmitter = any> { + /** + * The `Symbol.for('nodejs.rejection')` method is called in case a + * promise rejection happens when emitting an event and + * `captureRejections` is enabled on the emitter. + * It is possible to use `events.captureRejectionSymbol` in + * place of `Symbol.for('nodejs.rejection')`. + * + * ```js + * import { EventEmitter, captureRejectionSymbol } from 'node:events'; + * + * class MyClass extends EventEmitter { + * constructor() { + * super({ captureRejections: true }); + * } + * + * [captureRejectionSymbol](err, event, ...args) { + * console.log('rejection happened for', event, 'with', err, ...args); + * this.destroy(err); + * } + * + * destroy(err) { + * // Tear the resource down here. + * } + * } + * ``` + * @since v13.4.0, v12.16.0 + */ + [EventEmitter.captureRejectionSymbol]?(error: Error, event: string | symbol, ...args: any[]): void; + /** + * Alias for `emitter.on(eventName, listener)`. + * @since v0.1.26 + */ + addListener(eventName: EventNames, listener: Listener): this; + /** + * Synchronously calls each of the listeners registered for the event named + * `eventName`, in the order they were registered, passing the supplied arguments + * to each. + * + * Returns `true` if the event had listeners, `false` otherwise. + * + * ```js + * import { EventEmitter } from 'node:events'; + * const myEmitter = new EventEmitter(); + * + * // First listener + * myEmitter.on('event', function firstListener() { + * console.log('Helloooo! first listener'); + * }); + * // Second listener + * myEmitter.on('event', function secondListener(arg1, arg2) { + * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); + * }); + * // Third listener + * myEmitter.on('event', function thirdListener(...args) { + * const parameters = args.join(', '); + * console.log(`event with parameters ${parameters} in third listener`); + * }); + * + * console.log(myEmitter.listeners('event')); + * + * myEmitter.emit('event', 1, 2, 3, 4, 5); + * + * // Prints: + * // [ + * // [Function: firstListener], + * // [Function: secondListener], + * // [Function: thirdListener] + * // ] + * // Helloooo! first listener + * // event with parameters 1, 2 in second listener + * // event with parameters 1, 2, 3, 4, 5 in third listener + * ``` + * @since v0.1.26 + */ + emit(eventName: EventNames, ...args: Args): boolean; + /** + * Returns an array listing the events for which the emitter has registered + * listeners. + * + * ```js + * import { EventEmitter } from 'node:events'; + * + * const myEE = new EventEmitter(); + * myEE.on('foo', () => {}); + * myEE.on('bar', () => {}); + * + * const sym = Symbol('symbol'); + * myEE.on(sym, () => {}); + * + * console.log(myEE.eventNames()); + * // Prints: [ 'foo', 'bar', Symbol(symbol) ] + * ``` + * @since v6.0.0 + */ + eventNames(): (string | symbol)[]; + /** + * Returns the current max listener value for the `EventEmitter` which is either + * set by `emitter.setMaxListeners(n)` or defaults to + * `events.defaultMaxListeners`. + * @since v1.0.0 + */ + getMaxListeners(): number; + /** + * Returns the number of listeners listening for the event named `eventName`. + * If `listener` is provided, it will return how many times the listener is found + * in the list of the listeners of the event. + * @since v3.2.0 + * @param eventName The name of the event being listened for + * @param listener The event handler function + */ + listenerCount( + eventName: EventNames, + listener?: Listener, + ): number; + /** + * Returns a copy of the array of listeners for the event named `eventName`. + * + * ```js + * server.on('connection', (stream) => { + * console.log('someone connected!'); + * }); + * console.log(util.inspect(server.listeners('connection'))); + * // Prints: [ [Function] ] + * ``` + * @since v0.1.26 + */ + listeners(eventName: EventNames): Listener[]; + /** + * Alias for `emitter.removeListener()`. + * @since v10.0.0 + */ + off(eventName: EventNames, listener: Listener): this; + /** + * Adds the `listener` function to the end of the listeners array for the + * event named `eventName`. No checks are made to see if the `listener` has + * already been added. Multiple calls passing the same combination of `eventName` + * and `listener` will result in the `listener` being added, and called, multiple + * times. + * + * ```js + * server.on('connection', (stream) => { + * console.log('someone connected!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * + * By default, event listeners are invoked in the order they are added. The + * `emitter.prependListener()` method can be used as an alternative to add the + * event listener to the beginning of the listeners array. + * + * ```js + * import { EventEmitter } from 'node:events'; + * const myEE = new EventEmitter(); + * myEE.on('foo', () => console.log('a')); + * myEE.prependListener('foo', () => console.log('b')); + * myEE.emit('foo'); + * // Prints: + * // b + * // a + * ``` + * @since v0.1.101 + * @param eventName The name of the event. + * @param listener The callback function + */ + on(eventName: EventNames, listener: Listener): this; + /** + * Adds a **one-time** `listener` function for the event named `eventName`. The + * next time `eventName` is triggered, this listener is removed and then invoked. + * + * ```js + * server.once('connection', (stream) => { + * console.log('Ah, we have our first user!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * + * By default, event listeners are invoked in the order they are added. The + * `emitter.prependOnceListener()` method can be used as an alternative to add the + * event listener to the beginning of the listeners array. + * + * ```js + * import { EventEmitter } from 'node:events'; + * const myEE = new EventEmitter(); + * myEE.once('foo', () => console.log('a')); + * myEE.prependOnceListener('foo', () => console.log('b')); + * myEE.emit('foo'); + * // Prints: + * // b + * // a + * ``` + * @since v0.3.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + once(eventName: EventNames, listener: Listener): this; + /** + * Adds the `listener` function to the _beginning_ of the listeners array for the + * event named `eventName`. No checks are made to see if the `listener` has + * already been added. Multiple calls passing the same combination of `eventName` + * and `listener` will result in the `listener` being added, and called, multiple + * times. + * + * ```js + * server.prependListener('connection', (stream) => { + * console.log('someone connected!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v6.0.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + prependListener(eventName: EventNames, listener: Listener): this; + /** + * Adds a **one-time** `listener` function for the event named `eventName` to the + * _beginning_ of the listeners array. The next time `eventName` is triggered, this + * listener is removed, and then invoked. + * + * ```js + * server.prependOnceListener('connection', (stream) => { + * console.log('Ah, we have our first user!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v6.0.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + prependOnceListener( + eventName: EventNames, + listener: Listener, + ): this; + /** + * Returns a copy of the array of listeners for the event named `eventName`, + * including any wrappers (such as those created by `.once()`). + * + * ```js + * import { EventEmitter } from 'node:events'; + * const emitter = new EventEmitter(); + * emitter.once('log', () => console.log('log once')); + * + * // Returns a new Array with a function `onceWrapper` which has a property + * // `listener` which contains the original listener bound above + * const listeners = emitter.rawListeners('log'); + * const logFnWrapper = listeners[0]; + * + * // Logs "log once" to the console and does not unbind the `once` event + * logFnWrapper.listener(); + * + * // Logs "log once" to the console and removes the listener + * logFnWrapper(); + * + * emitter.on('log', () => console.log('log persistently')); + * // Will return a new Array with a single function bound by `.on()` above + * const newListeners = emitter.rawListeners('log'); + * + * // Logs "log persistently" twice + * newListeners[0](); + * emitter.emit('log'); + * ``` + * @since v9.4.0 + */ + rawListeners(eventName: EventNames): Listener[]; + /** + * Removes all listeners, or those of the specified `eventName`. + * + * It is bad practice to remove listeners added elsewhere in the code, + * particularly when the `EventEmitter` instance was created by some other + * component or module (e.g. sockets or file streams). + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.1.26 + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: EventNames): this; + /** + * Removes the specified `listener` from the listener array for the event named + * `eventName`. + * + * ```js + * const callback = (stream) => { + * console.log('someone connected!'); + * }; + * server.on('connection', callback); + * // ... + * server.removeListener('connection', callback); + * ``` + * + * `removeListener()` will remove, at most, one instance of a listener from the + * listener array. If any single listener has been added multiple times to the + * listener array for the specified `eventName`, then `removeListener()` must be + * called multiple times to remove each instance. + * + * Once an event is emitted, all listeners attached to it at the + * time of emitting are called in order. This implies that any + * `removeListener()` or `removeAllListeners()` calls _after_ emitting and + * _before_ the last listener finishes execution will not remove them from + * `emit()` in progress. Subsequent events behave as expected. + * + * ```js + * import { EventEmitter } from 'node:events'; + * class MyEmitter extends EventEmitter {} + * const myEmitter = new MyEmitter(); + * + * const callbackA = () => { + * console.log('A'); + * myEmitter.removeListener('event', callbackB); + * }; + * + * const callbackB = () => { + * console.log('B'); + * }; + * + * myEmitter.on('event', callbackA); + * + * myEmitter.on('event', callbackB); + * + * // callbackA removes listener callbackB but it will still be called. + * // Internal listener array at time of emit [callbackA, callbackB] + * myEmitter.emit('event'); + * // Prints: + * // A + * // B + * + * // callbackB is now removed. + * // Internal listener array [callbackA] + * myEmitter.emit('event'); + * // Prints: + * // A + * ``` + * + * Because listeners are managed using an internal array, calling this will + * change the position indexes of any listener registered _after_ the listener + * being removed. This will not impact the order in which listeners are called, + * but it means that any copies of the listener array as returned by + * the `emitter.listeners()` method will need to be recreated. + * + * When a single function has been added as a handler multiple times for a single + * event (as in the example below), `removeListener()` will remove the most + * recently added instance. In the example the `once('ping')` + * listener is removed: + * + * ```js + * import { EventEmitter } from 'node:events'; + * const ee = new EventEmitter(); + * + * function pong() { + * console.log('pong'); + * } + * + * ee.on('ping', pong); + * ee.once('ping', pong); + * ee.removeListener('ping', pong); + * + * ee.emit('ping'); + * ee.emit('ping'); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.1.26 + */ + removeListener(eventName: EventNames, listener: Listener): this; + /** + * By default `EventEmitter`s will print a warning if more than `10` listeners are + * added for a particular event. This is a useful default that helps finding + * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be + * modified for this specific `EventEmitter` instance. The value can be set to + * `Infinity` (or `0`) to indicate an unlimited number of listeners. + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.3.5 + */ + setMaxListeners(n: number): this; + } + } + } + namespace EventEmitter { + export { EventEmitter, EventEmitterEventMap, EventEmitterOptions }; + } + namespace EventEmitter { + interface Abortable { + signal?: AbortSignal | undefined; + } + /** + * See how to write a custom [rejection handler](https://nodejs.org/docs/latest-v25.x/api/events.html#emittersymbolfornodejsrejectionerr-eventname-args). + * @since v13.4.0, v12.16.0 + */ + const captureRejectionSymbol: unique symbol; + /** + * Change the default `captureRejections` option on all new `EventEmitter` objects. + * @since v13.4.0, v12.16.0 + */ + let captureRejections: boolean; + /** + * By default, a maximum of `10` listeners can be registered for any single + * event. This limit can be changed for individual `EventEmitter` instances + * using the `emitter.setMaxListeners(n)` method. To change the default + * for _all_ `EventEmitter` instances, the `events.defaultMaxListeners` + * property can be used. If this value is not a positive number, a `RangeError` + * is thrown. + * + * Take caution when setting the `events.defaultMaxListeners` because the + * change affects _all_ `EventEmitter` instances, including those created before + * the change is made. However, calling `emitter.setMaxListeners(n)` still has + * precedence over `events.defaultMaxListeners`. + * + * This is not a hard limit. The `EventEmitter` instance will allow + * more listeners to be added but will output a trace warning to stderr indicating + * that a "possible EventEmitter memory leak" has been detected. For any single + * `EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` + * methods can be used to temporarily avoid this warning: + * + * `defaultMaxListeners` has no effect on `AbortSignal` instances. While it is + * still possible to use `emitter.setMaxListeners(n)` to set a warning limit + * for individual `AbortSignal` instances, per default `AbortSignal` instances will not warn. + * + * ```js + * import { EventEmitter } from 'node:events'; + * const emitter = new EventEmitter(); + * emitter.setMaxListeners(emitter.getMaxListeners() + 1); + * emitter.once('event', () => { + * // do stuff + * emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); + * }); + * ``` + * + * The `--trace-warnings` command-line flag can be used to display the + * stack trace for such warnings. + * + * The emitted warning can be inspected with `process.on('warning')` and will + * have the additional `emitter`, `type`, and `count` properties, referring to + * the event emitter instance, the event's name and the number of attached + * listeners, respectively. + * Its `name` property is set to `'MaxListenersExceededWarning'`. + * @since v0.11.2 + */ + let defaultMaxListeners: number; + /** + * This symbol shall be used to install a listener for only monitoring `'error'` + * events. Listeners installed using this symbol are called before the regular + * `'error'` listeners are called. + * + * Installing a listener using this symbol does not change the behavior once an + * `'error'` event is emitted. Therefore, the process will still crash if no + * regular `'error'` listener is installed. + * @since v13.6.0, v12.17.0 + */ + const errorMonitor: unique symbol; + /** + * Listens once to the `abort` event on the provided `signal`. + * + * Listening to the `abort` event on abort signals is unsafe and may + * lead to resource leaks since another third party with the signal can + * call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change + * this since it would violate the web standard. Additionally, the original + * API makes it easy to forget to remove listeners. + * + * This API allows safely using `AbortSignal`s in Node.js APIs by solving these + * two issues by listening to the event such that `stopImmediatePropagation` does + * not prevent the listener from running. + * + * Returns a disposable so that it may be unsubscribed from more easily. + * + * ```js + * import { addAbortListener } from 'node:events'; + * + * function example(signal) { + * let disposable; + * try { + * signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); + * disposable = addAbortListener(signal, (e) => { + * // Do something when signal is aborted. + * }); + * } finally { + * disposable?.[Symbol.dispose](); + * } + * } + * ``` + * @since v20.5.0 + * @return Disposable that removes the `abort` listener. + */ + function addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable; + /** + * Returns a copy of the array of listeners for the event named `eventName`. + * + * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on + * the emitter. + * + * For `EventTarget`s this is the only way to get the event listeners for the + * event target. This is useful for debugging and diagnostic purposes. + * + * ```js + * import { getEventListeners, EventEmitter } from 'node:events'; + * + * { + * const ee = new EventEmitter(); + * const listener = () => console.log('Events are fun'); + * ee.on('foo', listener); + * console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] + * } + * { + * const et = new EventTarget(); + * const listener = () => console.log('Events are fun'); + * et.addEventListener('foo', listener); + * console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] + * } + * ``` + * @since v15.2.0, v14.17.0 + */ + function getEventListeners(emitter: EventEmitter, name: string | symbol): ((...args: any[]) => void)[]; + function getEventListeners(emitter: EventTarget, name: string): ((...args: any[]) => void)[]; + /** + * Returns the currently set max amount of listeners. + * + * For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on + * the emitter. + * + * For `EventTarget`s this is the only way to get the max event listeners for the + * event target. If the number of event handlers on a single EventTarget exceeds + * the max set, the EventTarget will print a warning. + * + * ```js + * import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events'; + * + * { + * const ee = new EventEmitter(); + * console.log(getMaxListeners(ee)); // 10 + * setMaxListeners(11, ee); + * console.log(getMaxListeners(ee)); // 11 + * } + * { + * const et = new EventTarget(); + * console.log(getMaxListeners(et)); // 10 + * setMaxListeners(11, et); + * console.log(getMaxListeners(et)); // 11 + * } + * ``` + * @since v19.9.0 + */ + function getMaxListeners(emitter: EventEmitter | EventTarget): number; + /** + * Returns the number of registered listeners for the event named `eventName`. + * + * For `EventEmitter`s this behaves exactly the same as calling `.listenerCount` + * on the emitter. + * + * For `EventTarget`s this is the only way to obtain the listener count. This can + * be useful for debugging and diagnostic purposes. + * @since v0.9.12 + */ + function listenerCount(emitter: EventEmitter, eventName: string | symbol): number; + function listenerCount(emitter: EventTarget, eventName: string): number; + interface OnOptions extends Abortable { + /** + * Names of events that will end the iteration. + */ + close?: readonly string[] | undefined; + /** + * The high watermark. The emitter is paused every time the size of events + * being buffered is higher than it. Supported only on emitters implementing + * `pause()` and `resume()` methods. + * @default Number.MAX_SAFE_INTEGER + */ + highWaterMark?: number | undefined; + /** + * The low watermark. The emitter is resumed every time the size of events + * being buffered is lower than it. Supported only on emitters implementing + * `pause()` and `resume()` methods. + * @default 1 + */ + lowWaterMark?: number | undefined; + } + /** + * ```js + * import { on, EventEmitter } from 'node:events'; + * import process from 'node:process'; + * + * const ee = new EventEmitter(); + * + * // Emit later on + * process.nextTick(() => { + * ee.emit('foo', 'bar'); + * ee.emit('foo', 42); + * }); + * + * for await (const event of on(ee, 'foo')) { + * // The execution of this inner block is synchronous and it + * // processes one event at a time (even with await). Do not use + * // if concurrent execution is required. + * console.log(event); // prints ['bar'] [42] + * } + * // Unreachable here + * ``` + * + * Returns an `AsyncIterator` that iterates `eventName` events. It will throw + * if the `EventEmitter` emits `'error'`. It removes all listeners when + * exiting the loop. The `value` returned by each iteration is an array + * composed of the emitted event arguments. + * + * An `AbortSignal` can be used to cancel waiting on events: + * + * ```js + * import { on, EventEmitter } from 'node:events'; + * import process from 'node:process'; + * + * const ac = new AbortController(); + * + * (async () => { + * const ee = new EventEmitter(); + * + * // Emit later on + * process.nextTick(() => { + * ee.emit('foo', 'bar'); + * ee.emit('foo', 42); + * }); + * + * for await (const event of on(ee, 'foo', { signal: ac.signal })) { + * // The execution of this inner block is synchronous and it + * // processes one event at a time (even with await). Do not use + * // if concurrent execution is required. + * console.log(event); // prints ['bar'] [42] + * } + * // Unreachable here + * })(); + * + * process.nextTick(() => ac.abort()); + * ``` + * @since v13.6.0, v12.16.0 + * @returns `AsyncIterator` that iterates `eventName` events emitted by the `emitter` + */ + function on( + emitter: EventEmitter, + eventName: string | symbol, + options?: OnOptions, + ): NodeJS.AsyncIterator; + function on( + emitter: EventTarget, + eventName: string, + options?: OnOptions, + ): NodeJS.AsyncIterator; + interface OnceOptions extends Abortable {} + /** + * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given + * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. + * The `Promise` will resolve with an array of all the arguments emitted to the + * given event. + * + * This method is intentionally generic and works with the web platform + * [EventTarget][WHATWG-EventTarget] interface, which has no special + * `'error'` event semantics and does not listen to the `'error'` event. + * + * ```js + * import { once, EventEmitter } from 'node:events'; + * import process from 'node:process'; + * + * const ee = new EventEmitter(); + * + * process.nextTick(() => { + * ee.emit('myevent', 42); + * }); + * + * const [value] = await once(ee, 'myevent'); + * console.log(value); + * + * const err = new Error('kaboom'); + * process.nextTick(() => { + * ee.emit('error', err); + * }); + * + * try { + * await once(ee, 'myevent'); + * } catch (err) { + * console.error('error happened', err); + * } + * ``` + * + * The special handling of the `'error'` event is only used when `events.once()` + * is used to wait for another event. If `events.once()` is used to wait for the + * '`error'` event itself, then it is treated as any other kind of event without + * special handling: + * + * ```js + * import { EventEmitter, once } from 'node:events'; + * + * const ee = new EventEmitter(); + * + * once(ee, 'error') + * .then(([err]) => console.log('ok', err.message)) + * .catch((err) => console.error('error', err.message)); + * + * ee.emit('error', new Error('boom')); + * + * // Prints: ok boom + * ``` + * + * An `AbortSignal` can be used to cancel waiting for the event: + * + * ```js + * import { EventEmitter, once } from 'node:events'; + * + * const ee = new EventEmitter(); + * const ac = new AbortController(); + * + * async function foo(emitter, event, signal) { + * try { + * await once(emitter, event, { signal }); + * console.log('event emitted!'); + * } catch (error) { + * if (error.name === 'AbortError') { + * console.error('Waiting for the event was canceled!'); + * } else { + * console.error('There was an error', error.message); + * } + * } + * } + * + * foo(ee, 'foo', ac.signal); + * ac.abort(); // Prints: Waiting for the event was canceled! + * ``` + * @since v11.13.0, v10.16.0 + */ + function once( + emitter: EventEmitter, + eventName: string | symbol, + options?: OnceOptions, + ): Promise; + function once(emitter: EventTarget, eventName: string, options?: OnceOptions): Promise; + /** + * ```js + * import { setMaxListeners, EventEmitter } from 'node:events'; + * + * const target = new EventTarget(); + * const emitter = new EventEmitter(); + * + * setMaxListeners(5, target, emitter); + * ``` + * @since v15.4.0 + * @param n A non-negative number. The maximum number of listeners per `EventTarget` event. + * @param eventTargets Zero or more `EventTarget` + * or `EventEmitter` instances. If none are specified, `n` is set as the default + * max for all newly created `EventTarget` and `EventEmitter` objects. + * objects. + */ + function setMaxListeners(n: number, ...eventTargets: ReadonlyArray): void; + /** + * This is the interface from which event-emitting Node.js APIs inherit in the types package. + * **It is not intended for consumer use.** + * + * It provides event-mapped definitions similar to EventEmitter, except that its signatures + * are deliberately permissive: they provide type _hinting_, but not rigid type-checking, + * for compatibility reasons. + * + * Classes that inherit directly from EventEmitter in JavaScript can inherit directly from + * this interface in the type definitions. Classes that are more than one inheritance level + * away from EventEmitter (eg. `net.Socket` > `stream.Duplex` > `EventEmitter`) must instead + * copy these method definitions into the derived class. Search "#region InternalEventEmitter" + * for examples. + * @internal + */ + interface InternalEventEmitter> extends EventEmitter { + addListener(eventName: E, listener: (...args: T[E]) => void): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: T[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount(eventName: E, listener?: (...args: T[E]) => void): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: T[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: T[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: T[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once(eventName: E, listener: (...args: T[E]) => void): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener(eventName: E, listener: (...args: T[E]) => void): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(eventName: E, listener: (...args: T[E]) => void): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: T[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener(eventName: E, listener: (...args: T[E]) => void): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + } + interface EventEmitterReferencingAsyncResource extends AsyncResource { + readonly eventEmitter: EventEmitterAsyncResource; + } + interface EventEmitterAsyncResourceOptions extends AsyncResourceOptions, EventEmitterOptions { + /** + * The type of async event. + * @default new.target.name + */ + name?: string | undefined; + } + /** + * Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that + * require manual async tracking. Specifically, all events emitted by instances + * of `events.EventEmitterAsyncResource` will run within its [async context](https://nodejs.org/docs/latest-v25.x/api/async_context.html). + * + * ```js + * import { EventEmitterAsyncResource, EventEmitter } from 'node:events'; + * import { notStrictEqual, strictEqual } from 'node:assert'; + * import { executionAsyncId, triggerAsyncId } from 'node:async_hooks'; + * + * // Async tracking tooling will identify this as 'Q'. + * const ee1 = new EventEmitterAsyncResource({ name: 'Q' }); + * + * // 'foo' listeners will run in the EventEmitters async context. + * ee1.on('foo', () => { + * strictEqual(executionAsyncId(), ee1.asyncId); + * strictEqual(triggerAsyncId(), ee1.triggerAsyncId); + * }); + * + * const ee2 = new EventEmitter(); + * + * // 'foo' listeners on ordinary EventEmitters that do not track async + * // context, however, run in the same async context as the emit(). + * ee2.on('foo', () => { + * notStrictEqual(executionAsyncId(), ee2.asyncId); + * notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId); + * }); + * + * Promise.resolve().then(() => { + * ee1.emit('foo'); + * ee2.emit('foo'); + * }); + * ``` + * + * The `EventEmitterAsyncResource` class has the same methods and takes the + * same options as `EventEmitter` and `AsyncResource` themselves. + * @since v17.4.0, v16.14.0 + */ + class EventEmitterAsyncResource extends EventEmitter { + constructor(options?: EventEmitterAsyncResourceOptions); + /** + * The unique `asyncId` assigned to the resource. + */ + readonly asyncId: number; + /** + * The returned `AsyncResource` object has an additional `eventEmitter` property + * that provides a reference to this `EventEmitterAsyncResource`. + */ + readonly asyncResource: EventEmitterReferencingAsyncResource; + /** + * Call all `destroy` hooks. This should only ever be called once. An error will + * be thrown if it is called more than once. This **must** be manually called. If + * the resource is left to be collected by the GC then the `destroy` hooks will + * never be called. + */ + emitDestroy(): void; + /** + * The same `triggerAsyncId` that is passed to the + * `AsyncResource` constructor. + */ + readonly triggerAsyncId: number; + } + /** + * The `NodeEventTarget` is a Node.js-specific extension to `EventTarget` + * that emulates a subset of the `EventEmitter` API. + * @since v14.5.0 + */ + interface NodeEventTarget extends EventTarget { + /** + * Node.js-specific extension to the `EventTarget` class that emulates the + * equivalent `EventEmitter` API. The only difference between `addListener()` and + * `addEventListener()` is that `addListener()` will return a reference to the + * `EventTarget`. + * @since v14.5.0 + */ + addListener(type: string, listener: (arg: any) => void): this; + /** + * Node.js-specific extension to the `EventTarget` class that dispatches the + * `arg` to the list of handlers for `type`. + * @since v15.2.0 + * @returns `true` if event listeners registered for the `type` exist, + * otherwise `false`. + */ + emit(type: string, arg: any): boolean; + /** + * Node.js-specific extension to the `EventTarget` class that returns an array + * of event `type` names for which event listeners are registered. + * @since 14.5.0 + */ + eventNames(): string[]; + /** + * Node.js-specific extension to the `EventTarget` class that returns the number + * of event listeners registered for the `type`. + * @since v14.5.0 + */ + listenerCount(type: string): number; + /** + * Node.js-specific extension to the `EventTarget` class that sets the number + * of max event listeners as `n`. + * @since v14.5.0 + */ + setMaxListeners(n: number): void; + /** + * Node.js-specific extension to the `EventTarget` class that returns the number + * of max event listeners. + * @since v14.5.0 + */ + getMaxListeners(): number; + /** + * Node.js-specific alias for `eventTarget.removeEventListener()`. + * @since v14.5.0 + */ + off(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this; + /** + * Node.js-specific alias for `eventTarget.addEventListener()`. + * @since v14.5.0 + */ + on(type: string, listener: (arg: any) => void): this; + /** + * Node.js-specific extension to the `EventTarget` class that adds a `once` + * listener for the given event `type`. This is equivalent to calling `on` + * with the `once` option set to `true`. + * @since v14.5.0 + */ + once(type: string, listener: (arg: any) => void): this; + /** + * Node.js-specific extension to the `EventTarget` class. If `type` is specified, + * removes all registered listeners for `type`, otherwise removes all registered + * listeners. + * @since v14.5.0 + */ + removeAllListeners(type?: string): this; + /** + * Node.js-specific extension to the `EventTarget` class that removes the + * `listener` for the given `type`. The only difference between `removeListener()` + * and `removeEventListener()` is that `removeListener()` will return a reference + * to the `EventTarget`. + * @since v14.5.0 + */ + removeListener(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this; + } + /** @internal */ + type InternalEventTargetEventProperties = { + [K in keyof T & string as `on${K}`]: ((ev: T[K]) => void) | null; + }; + } + export = EventEmitter; +} +declare module "events" { + import events = require("node:events"); + export = events; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/fs.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/fs.d.ts new file mode 100644 index 0000000..4e16bbc --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/fs.d.ts @@ -0,0 +1,4678 @@ +/** + * The `node:fs` module enables interacting with the file system in a + * way modeled on standard POSIX functions. + * + * To use the promise-based APIs: + * + * ```js + * import * as fs from 'node:fs/promises'; + * ``` + * + * To use the callback and sync APIs: + * + * ```js + * import * as fs from 'node:fs'; + * ``` + * + * All file system operations have synchronous, callback, and promise-based + * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/fs.js) + */ +declare module "node:fs" { + import { NonSharedBuffer } from "node:buffer"; + import { Abortable, EventEmitter, InternalEventEmitter } from "node:events"; + import { FileHandle } from "node:fs/promises"; + import * as stream from "node:stream"; + import { URL } from "node:url"; + /** + * Valid types for path values in "fs". + */ + type PathLike = string | Buffer | URL; + type PathOrFileDescriptor = PathLike | number; + type TimeLike = string | number | Date; + type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; + type BufferEncodingOption = + | "buffer" + | { + encoding: "buffer"; + }; + interface ObjectEncodingOptions { + encoding?: BufferEncoding | null | undefined; + } + type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; + type OpenMode = number | string; + type Mode = number | string; + interface StatsBase { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + dev: T; + ino: T; + mode: T; + nlink: T; + uid: T; + gid: T; + rdev: T; + size: T; + blksize: T; + blocks: T; + atimeMs: T; + mtimeMs: T; + ctimeMs: T; + birthtimeMs: T; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; + } + interface Stats extends StatsBase {} + /** + * A `fs.Stats` object provides information about a file. + * + * Objects returned from {@link stat}, {@link lstat}, {@link fstat}, and + * their synchronous counterparts are of this type. + * If `bigint` in the `options` passed to those methods is true, the numeric values + * will be `bigint` instead of `number`, and the object will contain additional + * nanosecond-precision properties suffixed with `Ns`. `Stat` objects are not to be created directly using the `new` keyword. + * + * ```console + * Stats { + * dev: 2114, + * ino: 48064969, + * mode: 33188, + * nlink: 1, + * uid: 85, + * gid: 100, + * rdev: 0, + * size: 527, + * blksize: 4096, + * blocks: 8, + * atimeMs: 1318289051000.1, + * mtimeMs: 1318289051000.1, + * ctimeMs: 1318289051000.1, + * birthtimeMs: 1318289051000.1, + * atime: Mon, 10 Oct 2011 23:24:11 GMT, + * mtime: Mon, 10 Oct 2011 23:24:11 GMT, + * ctime: Mon, 10 Oct 2011 23:24:11 GMT, + * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } + * ``` + * + * `bigint` version: + * + * ```console + * BigIntStats { + * dev: 2114n, + * ino: 48064969n, + * mode: 33188n, + * nlink: 1n, + * uid: 85n, + * gid: 100n, + * rdev: 0n, + * size: 527n, + * blksize: 4096n, + * blocks: 8n, + * atimeMs: 1318289051000n, + * mtimeMs: 1318289051000n, + * ctimeMs: 1318289051000n, + * birthtimeMs: 1318289051000n, + * atimeNs: 1318289051000000000n, + * mtimeNs: 1318289051000000000n, + * ctimeNs: 1318289051000000000n, + * birthtimeNs: 1318289051000000000n, + * atime: Mon, 10 Oct 2011 23:24:11 GMT, + * mtime: Mon, 10 Oct 2011 23:24:11 GMT, + * ctime: Mon, 10 Oct 2011 23:24:11 GMT, + * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } + * ``` + * @since v0.1.21 + */ + class Stats { + private constructor(); + } + interface StatsFsBase { + /** Type of file system. */ + type: T; + /** Optimal transfer block size. */ + bsize: T; + /** Total data blocks in file system. */ + blocks: T; + /** Free blocks in file system. */ + bfree: T; + /** Available blocks for unprivileged users */ + bavail: T; + /** Total file nodes in file system. */ + files: T; + /** Free file nodes in file system. */ + ffree: T; + } + interface StatsFs extends StatsFsBase {} + /** + * Provides information about a mounted file system. + * + * Objects returned from {@link statfs} and its synchronous counterpart are of + * this type. If `bigint` in the `options` passed to those methods is `true`, the + * numeric values will be `bigint` instead of `number`. + * + * ```console + * StatFs { + * type: 1397114950, + * bsize: 4096, + * blocks: 121938943, + * bfree: 61058895, + * bavail: 61058895, + * files: 999, + * ffree: 1000000 + * } + * ``` + * + * `bigint` version: + * + * ```console + * StatFs { + * type: 1397114950n, + * bsize: 4096n, + * blocks: 121938943n, + * bfree: 61058895n, + * bavail: 61058895n, + * files: 999n, + * ffree: 1000000n + * } + * ``` + * @since v19.6.0, v18.15.0 + */ + class StatsFs {} + interface BigIntStatsFs extends StatsFsBase {} + interface StatFsOptions { + bigint?: boolean | undefined; + } + /** + * A representation of a directory entry, which can be a file or a subdirectory + * within the directory, as returned by reading from an `fs.Dir`. The + * directory entry is a combination of the file name and file type pairs. + * + * Additionally, when {@link readdir} or {@link readdirSync} is called with + * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. + * @since v10.10.0 + */ + class Dirent { + /** + * Returns `true` if the `fs.Dirent` object describes a regular file. + * @since v10.10.0 + */ + isFile(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a file system + * directory. + * @since v10.10.0 + */ + isDirectory(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a block device. + * @since v10.10.0 + */ + isBlockDevice(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a character device. + * @since v10.10.0 + */ + isCharacterDevice(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a symbolic link. + * @since v10.10.0 + */ + isSymbolicLink(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a first-in-first-out + * (FIFO) pipe. + * @since v10.10.0 + */ + isFIFO(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a socket. + * @since v10.10.0 + */ + isSocket(): boolean; + /** + * The file name that this `fs.Dirent` object refers to. The type of this + * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}. + * @since v10.10.0 + */ + name: Name; + /** + * The path to the parent directory of the file this `fs.Dirent` object refers to. + * @since v20.12.0, v18.20.0 + */ + parentPath: string; + } + /** + * A class representing a directory stream. + * + * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. + * + * ```js + * import { opendir } from 'node:fs/promises'; + * + * try { + * const dir = await opendir('./'); + * for await (const dirent of dir) + * console.log(dirent.name); + * } catch (err) { + * console.error(err); + * } + * ``` + * + * When using the async iterator, the `fs.Dir` object will be automatically + * closed after the iterator exits. + * @since v12.12.0 + */ + class Dir implements AsyncIterable { + /** + * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. + * @since v12.12.0 + */ + readonly path: string; + /** + * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. + */ + [Symbol.asyncIterator](): NodeJS.AsyncIterator; + /** + * Asynchronously close the directory's underlying resource handle. + * Subsequent reads will result in errors. + * + * A promise is returned that will be fulfilled after the resource has been + * closed. + * @since v12.12.0 + */ + close(): Promise; + close(cb: NoParamCallback): void; + /** + * Synchronously close the directory's underlying resource handle. + * Subsequent reads will result in errors. + * @since v12.12.0 + */ + closeSync(): void; + /** + * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. + * + * A promise is returned that will be fulfilled with an `fs.Dirent`, or `null` if there are no more directory entries to read. + * + * Directory entries returned by this function are in no particular order as + * provided by the operating system's underlying directory mechanisms. + * Entries added or removed while iterating over the directory might not be + * included in the iteration results. + * @since v12.12.0 + * @return containing {fs.Dirent|null} + */ + read(): Promise; + read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; + /** + * Synchronously read the next directory entry as an `fs.Dirent`. See the + * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail. + * + * If there are no more directory entries to read, `null` will be returned. + * + * Directory entries returned by this function are in no particular order as + * provided by the operating system's underlying directory mechanisms. + * Entries added or removed while iterating over the directory might not be + * included in the iteration results. + * @since v12.12.0 + */ + readSync(): Dirent | null; + /** + * Calls `dir.close()` if the directory handle is open, and returns a promise that + * fulfills when disposal is complete. + * @since v24.1.0 + */ + [Symbol.asyncDispose](): Promise; + /** + * Calls `dir.closeSync()` if the directory handle is open, and returns + * `undefined`. + * @since v24.1.0 + */ + [Symbol.dispose](): void; + } + /** + * Class: fs.StatWatcher + * @since v14.3.0, v12.20.0 + * Extends `EventEmitter` + * A successful call to {@link watchFile} method will return a new fs.StatWatcher object. + */ + interface StatWatcher extends EventEmitter { + /** + * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have + * no effect. + * + * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally + * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been + * called previously. + * @since v14.3.0, v12.20.0 + */ + ref(): this; + /** + * When called, the active `fs.StatWatcher` object will not require the Node.js + * event loop to remain active. If there is no other activity keeping the + * event loop running, the process may exit before the `fs.StatWatcher` object's + * callback is invoked. Calling `watcher.unref()` multiple times will have + * no effect. + * @since v14.3.0, v12.20.0 + */ + unref(): this; + } + interface FSWatcherEventMap { + "change": [eventType: string, filename: string | NonSharedBuffer]; + "close": []; + "error": [error: Error]; + } + interface FSWatcher extends InternalEventEmitter { + /** + * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. + * @since v0.5.8 + */ + close(): void; + /** + * When called, requests that the Node.js event loop _not_ exit so long as the `fs.FSWatcher` is active. Calling `watcher.ref()` multiple times will have + * no effect. + * + * By default, all `fs.FSWatcher` objects are "ref'ed", making it normally + * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been + * called previously. + * @since v14.3.0, v12.20.0 + */ + ref(): this; + /** + * When called, the active `fs.FSWatcher` object will not require the Node.js + * event loop to remain active. If there is no other activity keeping the + * event loop running, the process may exit before the `fs.FSWatcher` object's + * callback is invoked. Calling `watcher.unref()` multiple times will have + * no effect. + * @since v14.3.0, v12.20.0 + */ + unref(): this; + } + interface ReadStreamEventMap extends stream.ReadableEventMap { + "close": []; + "data": [chunk: string | NonSharedBuffer]; + "open": [fd: number]; + "ready": []; + } + /** + * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. + * @since v0.1.93 + */ + class ReadStream extends stream.Readable { + close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; + /** + * The number of bytes that have been read so far. + * @since v6.4.0 + */ + bytesRead: number; + /** + * The path to the file the stream is reading from as specified in the first + * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a + * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`. + * @since v0.1.93 + */ + path: string | Buffer; + /** + * This property is `true` if the underlying file has not been opened yet, + * i.e. before the `'ready'` event is emitted. + * @since v11.2.0, v10.16.0 + */ + pending: boolean; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: ReadStreamEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ReadStreamEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ReadStreamEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: ReadStreamEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: ReadStreamEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: ReadStreamEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: ReadStreamEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ReadStreamEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ReadStreamEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: ReadStreamEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ReadStreamEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface Utf8StreamOptions { + /** + * Appends writes to dest file instead of truncating it. + * @default true + */ + append?: boolean | undefined; + /** + * Which type of data you can send to the write + * function, supported values are `'utf8'` or `'buffer'`. + * @default 'utf8' + */ + contentMode?: "utf8" | "buffer" | undefined; + /** + * A path to a file to be written to (mode controlled by the + * append option). + */ + dest?: string | undefined; + /** + * A file descriptor, something that is returned by `fs.open()` + * or `fs.openSync()`. + */ + fd?: number | undefined; + /** + * An object that has the same API as the `fs` module, useful + * for mocking, testing, or customizing the behavior of the stream. + */ + fs?: object | undefined; + /** + * Perform a `fs.fsyncSync()` every time a write is + * completed. + */ + fsync?: boolean | undefined; + /** + * The maximum length of the internal buffer. If a write + * operation would cause the buffer to exceed `maxLength`, the data written is + * dropped and a drop event is emitted with the dropped data + */ + maxLength?: number | undefined; + /** + * The maximum number of bytes that can be written; + * @default 16384 + */ + maxWrite?: number | undefined; + /** + * The minimum length of the internal buffer that is + * required to be full before flushing. + */ + minLength?: number | undefined; + /** + * Ensure directory for `dest` file exists when true. + * @default false + */ + mkdir?: boolean | undefined; + /** + * Specify the creating file mode (see `fs.open()`). + */ + mode?: number | string | undefined; + /** + * Calls flush every `periodicFlush` milliseconds. + */ + periodicFlush?: number | undefined; + /** + * A function that will be called when `write()`, + * `writeSync()`, or `flushSync()` encounters an `EAGAIN` or `EBUSY` error. + * If the return value is `true` the operation will be retried, otherwise it + * will bubble the error. The `err` is the error that caused this function to + * be called, `writeBufferLen` is the length of the buffer that was written, + * and `remainingBufferLen` is the length of the remaining buffer that the + * stream did not try to write. + */ + retryEAGAIN?: ((err: Error | null, writeBufferLen: number, remainingBufferLen: number) => boolean) | undefined; + /** + * Perform writes synchronously. + */ + sync?: boolean | undefined; + } + interface Utf8StreamEventMap { + "close": []; + "drain": []; + "drop": [data: string | Buffer]; + "error": [error: Error]; + "finish": []; + "ready": []; + "write": [n: number]; + } + /** + * An optimized UTF-8 stream writer that allows for flushing all the internal + * buffering on demand. It handles `EAGAIN` errors correctly, allowing for + * customization, for example, by dropping content if the disk is busy. + * @since v24.6.0 + * @experimental + */ + class Utf8Stream implements EventEmitter { + constructor(options: Utf8StreamOptions); + /** + * Whether the stream is appending to the file or truncating it. + */ + readonly append: boolean; + /** + * The type of data that can be written to the stream. Supported + * values are `'utf8'` or `'buffer'`. + * @default 'utf8' + */ + readonly contentMode: "utf8" | "buffer"; + /** + * Close the stream immediately, without flushing the internal buffer. + */ + destroy(): void; + /** + * Close the stream gracefully, flushing the internal buffer before closing. + */ + end(): void; + /** + * The file descriptor that is being written to. + */ + readonly fd: number; + /** + * The file that is being written to. + */ + readonly file: string; + /** + * Writes the current buffer to the file if a write was not in progress. Do + * nothing if `minLength` is zero or if it is already writing. + */ + flush(callback: (err: Error | null) => void): void; + /** + * Flushes the buffered data synchronously. This is a costly operation. + */ + flushSync(): void; + /** + * Whether the stream is performing a `fs.fsyncSync()` after every + * write operation. + */ + readonly fsync: boolean; + /** + * The maximum length of the internal buffer. If a write + * operation would cause the buffer to exceed `maxLength`, the data written is + * dropped and a drop event is emitted with the dropped data. + */ + readonly maxLength: number; + /** + * The minimum length of the internal buffer that is required to be + * full before flushing. + */ + readonly minLength: number; + /** + * Whether the stream should ensure that the directory for the + * `dest` file exists. If `true`, it will create the directory if it does not + * exist. + * @default false + */ + readonly mkdir: boolean; + /** + * The mode of the file that is being written to. + */ + readonly mode: number | string; + /** + * The number of milliseconds between flushes. If set to `0`, no + * periodic flushes will be performed. + */ + readonly periodicFlush: number; + /** + * Reopen the file in place, useful for log rotation. + * @param file A path to a file to be written to (mode + * controlled by the append option). + */ + reopen(file: PathLike): void; + /** + * Whether the stream is writing synchronously or asynchronously. + */ + readonly sync: boolean; + /** + * When the `options.contentMode` is set to `'utf8'` when the stream is created, + * the `data` argument must be a string. If the `contentMode` is set to `'buffer'`, + * the `data` argument must be a `Buffer`. + * @param data The data to write. + */ + write(data: string | Buffer): boolean; + /** + * Whether the stream is currently writing data to the file. + */ + readonly writing: boolean; + /** + * Calls `utf8Stream.destroy()`. + */ + [Symbol.dispose](): void; + } + interface Utf8Stream extends InternalEventEmitter {} + interface WriteStreamEventMap extends stream.WritableEventMap { + "close": []; + "open": [fd: number]; + "ready": []; + } + /** + * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. + * @since v0.1.93 + */ + class WriteStream extends stream.Writable { + /** + * Closes `writeStream`. Optionally accepts a + * callback that will be executed once the `writeStream`is closed. + * @since v0.9.4 + */ + close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; + /** + * The number of bytes written so far. Does not include data that is still queued + * for writing. + * @since v0.4.7 + */ + bytesWritten: number; + /** + * The path to the file the stream is writing to as specified in the first + * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a + * `Buffer`. + * @since v0.1.93 + */ + path: string | Buffer; + /** + * This property is `true` if the underlying file has not been opened yet, + * i.e. before the `'ready'` event is emitted. + * @since v11.2.0 + */ + pending: boolean; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: WriteStreamEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: WriteStreamEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: WriteStreamEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: WriteStreamEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + /** + * Asynchronously rename file at `oldPath` to the pathname provided + * as `newPath`. In the case that `newPath` already exists, it will + * be overwritten. If there is a directory at `newPath`, an error will + * be raised instead. No arguments other than a possible exception are + * given to the completion callback. + * + * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html). + * + * ```js + * import { rename } from 'node:fs'; + * + * rename('oldFile.txt', 'newFile.txt', (err) => { + * if (err) throw err; + * console.log('Rename complete!'); + * }); + * ``` + * @since v0.0.2 + */ + function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; + namespace rename { + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; + } + /** + * Renames the file from `oldPath` to `newPath`. Returns `undefined`. + * + * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. + * @since v0.1.21 + */ + function renameSync(oldPath: PathLike, newPath: PathLike): void; + /** + * Truncates the file. No arguments other than a possible exception are + * given to the completion callback. A file descriptor can also be passed as the + * first argument. In this case, `fs.ftruncate()` is called. + * + * ```js + * import { truncate } from 'node:fs'; + * // Assuming that 'path/file.txt' is a regular file. + * truncate('path/file.txt', (err) => { + * if (err) throw err; + * console.log('path/file.txt was truncated'); + * }); + * ``` + * + * Passing a file descriptor is deprecated and may result in an error being thrown + * in the future. + * + * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details. + * @since v0.8.6 + * @param [len=0] + */ + function truncate(path: PathLike, len: number | undefined, callback: NoParamCallback): void; + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function truncate(path: PathLike, callback: NoParamCallback): void; + namespace truncate { + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + function __promisify__(path: PathLike, len?: number): Promise; + } + /** + * Truncates the file. Returns `undefined`. A file descriptor can also be + * passed as the first argument. In this case, `fs.ftruncateSync()` is called. + * + * Passing a file descriptor is deprecated and may result in an error being thrown + * in the future. + * @since v0.8.6 + * @param [len=0] + */ + function truncateSync(path: PathLike, len?: number): void; + /** + * Truncates the file descriptor. No arguments other than a possible exception are + * given to the completion callback. + * + * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail. + * + * If the file referred to by the file descriptor was larger than `len` bytes, only + * the first `len` bytes will be retained in the file. + * + * For example, the following program retains only the first four bytes of the + * file: + * + * ```js + * import { open, close, ftruncate } from 'node:fs'; + * + * function closeFd(fd) { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * + * open('temp.txt', 'r+', (err, fd) => { + * if (err) throw err; + * + * try { + * ftruncate(fd, 4, (err) => { + * closeFd(fd); + * if (err) throw err; + * }); + * } catch (err) { + * closeFd(fd); + * if (err) throw err; + * } + * }); + * ``` + * + * If the file previously was shorter than `len` bytes, it is extended, and the + * extended part is filled with null bytes (`'\0'`): + * + * If `len` is negative then `0` will be used. + * @since v0.8.6 + * @param [len=0] + */ + function ftruncate(fd: number, len: number | undefined, callback: NoParamCallback): void; + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + */ + function ftruncate(fd: number, callback: NoParamCallback): void; + namespace ftruncate { + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + function __promisify__(fd: number, len?: number): Promise; + } + /** + * Truncates the file descriptor. Returns `undefined`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link ftruncate}. + * @since v0.8.6 + * @param [len=0] + */ + function ftruncateSync(fd: number, len?: number): void; + /** + * Asynchronously changes owner and group of a file. No arguments other than a + * possible exception are given to the completion callback. + * + * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. + * @since v0.1.97 + */ + function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; + namespace chown { + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + /** + * Synchronously changes owner and group of a file. Returns `undefined`. + * This is the synchronous version of {@link chown}. + * + * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. + * @since v0.1.97 + */ + function chownSync(path: PathLike, uid: number, gid: number): void; + /** + * Sets the owner of the file. No arguments other than a possible exception are + * given to the completion callback. + * + * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. + * @since v0.4.7 + */ + function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; + namespace fchown { + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + function __promisify__(fd: number, uid: number, gid: number): Promise; + } + /** + * Sets the owner of the file. Returns `undefined`. + * + * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. + * @since v0.4.7 + * @param uid The file's new owner's user id. + * @param gid The file's new group's group id. + */ + function fchownSync(fd: number, uid: number, gid: number): void; + /** + * Set the owner of the symbolic link. No arguments other than a possible + * exception are given to the completion callback. + * + * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. + */ + function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; + namespace lchown { + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + /** + * Set the owner for the path. Returns `undefined`. + * + * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details. + * @param uid The file's new owner's user id. + * @param gid The file's new group's group id. + */ + function lchownSync(path: PathLike, uid: number, gid: number): void; + /** + * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic + * link, then the link is not dereferenced: instead, the timestamps of the + * symbolic link itself are changed. + * + * No arguments other than a possible exception are given to the completion + * callback. + * @since v14.5.0, v12.19.0 + */ + function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + namespace lutimes { + /** + * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, + * with the difference that if the path refers to a symbolic link, then the link is not + * dereferenced: instead, the timestamps of the symbolic link itself are changed. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + } + /** + * Change the file system timestamps of the symbolic link referenced by `path`. + * Returns `undefined`, or throws an exception when parameters are incorrect or + * the operation fails. This is the synchronous version of {@link lutimes}. + * @since v14.5.0, v12.19.0 + */ + function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; + /** + * Asynchronously changes the permissions of a file. No arguments other than a + * possible exception are given to the completion callback. + * + * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. + * + * ```js + * import { chmod } from 'node:fs'; + * + * chmod('my_file.txt', 0o775, (err) => { + * if (err) throw err; + * console.log('The permissions for file "my_file.txt" have been changed!'); + * }); + * ``` + * @since v0.1.30 + */ + function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; + namespace chmod { + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(path: PathLike, mode: Mode): Promise; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link chmod}. + * + * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. + * @since v0.6.7 + */ + function chmodSync(path: PathLike, mode: Mode): void; + /** + * Sets the permissions on the file. No arguments other than a possible exception + * are given to the completion callback. + * + * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. + * @since v0.4.7 + */ + function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; + namespace fchmod { + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(fd: number, mode: Mode): Promise; + } + /** + * Sets the permissions on the file. Returns `undefined`. + * + * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. + * @since v0.4.7 + */ + function fchmodSync(fd: number, mode: Mode): void; + /** + * Changes the permissions on a symbolic link. No arguments other than a possible + * exception are given to the completion callback. + * + * This method is only implemented on macOS. + * + * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. + * @deprecated Since v0.4.7 + */ + function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; + /** @deprecated */ + namespace lchmod { + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(path: PathLike, mode: Mode): Promise; + } + /** + * Changes the permissions on a symbolic link. Returns `undefined`. + * + * This method is only implemented on macOS. + * + * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. + * @deprecated Since v0.4.7 + */ + function lchmodSync(path: PathLike, mode: Mode): void; + /** + * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. + * + * In case of an error, the `err.code` will be one of `Common System Errors`. + * + * {@link stat} follows symbolic links. Use {@link lstat} to look at the + * links themselves. + * + * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. + * Instead, user code should open/read/write the file directly and handle the + * error raised if the file is not available. + * + * To check if a file exists without manipulating it afterwards, {@link access} is recommended. + * + * For example, given the following directory structure: + * + * ```text + * - txtDir + * -- file.txt + * - app.js + * ``` + * + * The next program will check for the stats of the given paths: + * + * ```js + * import { stat } from 'node:fs'; + * + * const pathsToCheck = ['./txtDir', './txtDir/file.txt']; + * + * for (let i = 0; i < pathsToCheck.length; i++) { + * stat(pathsToCheck[i], (err, stats) => { + * console.log(stats.isDirectory()); + * console.log(stats); + * }); + * } + * ``` + * + * The resulting output will resemble: + * + * ```console + * true + * Stats { + * dev: 16777220, + * mode: 16877, + * nlink: 3, + * uid: 501, + * gid: 20, + * rdev: 0, + * blksize: 4096, + * ino: 14214262, + * size: 96, + * blocks: 0, + * atimeMs: 1561174653071.963, + * mtimeMs: 1561174614583.3518, + * ctimeMs: 1561174626623.5366, + * birthtimeMs: 1561174126937.2893, + * atime: 2019-06-22T03:37:33.072Z, + * mtime: 2019-06-22T03:36:54.583Z, + * ctime: 2019-06-22T03:37:06.624Z, + * birthtime: 2019-06-22T03:28:46.937Z + * } + * false + * Stats { + * dev: 16777220, + * mode: 33188, + * nlink: 1, + * uid: 501, + * gid: 20, + * rdev: 0, + * blksize: 4096, + * ino: 14214074, + * size: 8, + * blocks: 8, + * atimeMs: 1561174616618.8555, + * mtimeMs: 1561174614584, + * ctimeMs: 1561174614583.8145, + * birthtimeMs: 1561174007710.7478, + * atime: 2019-06-22T03:36:56.619Z, + * mtime: 2019-06-22T03:36:54.584Z, + * ctime: 2019-06-22T03:36:54.584Z, + * birthtime: 2019-06-22T03:26:47.711Z + * } + * ``` + * @since v0.0.2 + */ + function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + function stat( + path: PathLike, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, + ): void; + function stat( + path: PathLike, + options: StatOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, + ): void; + function stat( + path: PathLike, + options: StatOptions | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, + ): void; + namespace stat { + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__( + path: PathLike, + options?: StatOptions & { + bigint?: false | undefined; + }, + ): Promise; + function __promisify__( + path: PathLike, + options: StatOptions & { + bigint: true; + }, + ): Promise; + function __promisify__(path: PathLike, options?: StatOptions): Promise; + } + interface StatSyncFn extends Function { + (path: PathLike, options?: undefined): Stats; + ( + path: PathLike, + options?: StatSyncOptions & { + bigint?: false | undefined; + throwIfNoEntry: false; + }, + ): Stats | undefined; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: true; + throwIfNoEntry: false; + }, + ): BigIntStats | undefined; + ( + path: PathLike, + options?: StatSyncOptions & { + bigint?: false | undefined; + }, + ): Stats; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: true; + }, + ): BigIntStats; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: boolean; + throwIfNoEntry?: false | undefined; + }, + ): Stats | BigIntStats; + (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined; + } + /** + * Synchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + const statSync: StatSyncFn; + /** + * Invokes the callback with the `fs.Stats` for the file descriptor. + * + * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. + * @since v0.1.95 + */ + function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + function fstat( + fd: number, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, + ): void; + function fstat( + fd: number, + options: StatOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, + ): void; + function fstat( + fd: number, + options: StatOptions | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, + ): void; + namespace fstat { + /** + * Asynchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + function __promisify__( + fd: number, + options?: StatOptions & { + bigint?: false | undefined; + }, + ): Promise; + function __promisify__( + fd: number, + options: StatOptions & { + bigint: true; + }, + ): Promise; + function __promisify__(fd: number, options?: StatOptions): Promise; + } + /** + * Retrieves the `fs.Stats` for the file descriptor. + * + * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. + * @since v0.1.95 + */ + function fstatSync( + fd: number, + options?: StatOptions & { + bigint?: false | undefined; + }, + ): Stats; + function fstatSync( + fd: number, + options: StatOptions & { + bigint: true; + }, + ): BigIntStats; + function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats; + /** + * Retrieves the `fs.Stats` for the symbolic link referred to by the path. + * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic + * link, then the link itself is stat-ed, not the file that it refers to. + * + * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. + * @since v0.1.30 + */ + function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + function lstat( + path: PathLike, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, + ): void; + function lstat( + path: PathLike, + options: StatOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, + ): void; + function lstat( + path: PathLike, + options: StatOptions | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, + ): void; + namespace lstat { + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__( + path: PathLike, + options?: StatOptions & { + bigint?: false | undefined; + }, + ): Promise; + function __promisify__( + path: PathLike, + options: StatOptions & { + bigint: true; + }, + ): Promise; + function __promisify__(path: PathLike, options?: StatOptions): Promise; + } + /** + * Asynchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which + * contains `path`. The callback gets two arguments `(err, stats)` where `stats`is an `fs.StatFs` object. + * + * In case of an error, the `err.code` will be one of `Common System Errors`. + * @since v19.6.0, v18.15.0 + * @param path A path to an existing file or directory on the file system to be queried. + */ + function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void; + function statfs( + path: PathLike, + options: + | (StatFsOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void, + ): void; + function statfs( + path: PathLike, + options: StatFsOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void, + ): void; + function statfs( + path: PathLike, + options: StatFsOptions | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void, + ): void; + namespace statfs { + /** + * Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an object. + * @param path A path to an existing file or directory on the file system to be queried. + */ + function __promisify__( + path: PathLike, + options?: StatFsOptions & { + bigint?: false | undefined; + }, + ): Promise; + function __promisify__( + path: PathLike, + options: StatFsOptions & { + bigint: true; + }, + ): Promise; + function __promisify__(path: PathLike, options?: StatFsOptions): Promise; + } + /** + * Synchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which + * contains `path`. + * + * In case of an error, the `err.code` will be one of `Common System Errors`. + * @since v19.6.0, v18.15.0 + * @param path A path to an existing file or directory on the file system to be queried. + */ + function statfsSync( + path: PathLike, + options?: StatFsOptions & { + bigint?: false | undefined; + }, + ): StatsFs; + function statfsSync( + path: PathLike, + options: StatFsOptions & { + bigint: true; + }, + ): BigIntStatsFs; + function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs; + /** + * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + const lstatSync: StatSyncFn; + /** + * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than + * a possible + * exception are given to the completion callback. + * @since v0.1.31 + */ + function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; + namespace link { + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; + } + /** + * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. + * @since v0.1.31 + */ + function linkSync(existingPath: PathLike, newPath: PathLike): void; + /** + * Creates the link called `path` pointing to `target`. No arguments other than a + * possible exception are given to the completion callback. + * + * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details. + * + * The `type` argument is only available on Windows and ignored on other platforms. + * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is + * not a string, Node.js will autodetect `target` type and use `'file'` or `'dir'`. + * If the `target` does not exist, `'file'` will be used. Windows junction points + * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. Junction + * points on NTFS volumes can only point to directories. + * + * Relative targets are relative to the link's parent directory. + * + * ```js + * import { symlink } from 'node:fs'; + * + * symlink('./mew', './mewtwo', callback); + * ``` + * + * The above example creates a symbolic link `mewtwo` which points to `mew` in the + * same directory: + * + * ```bash + * $ tree . + * . + * ├── mew + * └── mewtwo -> ./mew + * ``` + * @since v0.1.31 + * @param [type='null'] + */ + function symlink( + target: PathLike, + path: PathLike, + type: symlink.Type | undefined | null, + callback: NoParamCallback, + ): void; + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + */ + function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; + namespace symlink { + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; + type Type = "dir" | "file" | "junction"; + } + /** + * Returns `undefined`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link symlink}. + * @since v0.1.31 + * @param [type='null'] + */ + function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; + /** + * Reads the contents of the symbolic link referred to by `path`. The callback gets + * two arguments `(err, linkString)`. + * + * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the link path passed to the callback. If the `encoding` is set to `'buffer'`, + * the link path returned will be passed as a `Buffer` object. + * @since v0.1.31 + */ + function readlink( + path: PathLike, + options: EncodingOption, + callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, + ): void; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink( + path: PathLike, + options: BufferEncodingOption, + callback: (err: NodeJS.ErrnoException | null, linkString: NonSharedBuffer) => void, + ): void; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink( + path: PathLike, + options: EncodingOption, + callback: (err: NodeJS.ErrnoException | null, linkString: string | NonSharedBuffer) => void, + ): void; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function readlink( + path: PathLike, + callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, + ): void; + namespace readlink { + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + } + /** + * Returns the symbolic link's string value. + * + * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the link path returned. If the `encoding` is set to `'buffer'`, + * the link path returned will be passed as a `Buffer` object. + * @since v0.1.31 + */ + function readlinkSync(path: PathLike, options?: EncodingOption): string; + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlinkSync(path: PathLike, options: BufferEncodingOption): NonSharedBuffer; + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlinkSync(path: PathLike, options?: EncodingOption): string | NonSharedBuffer; + /** + * Asynchronously computes the canonical pathname by resolving `.`, `..`, and + * symbolic links. + * + * A canonical pathname is not necessarily unique. Hard links and bind mounts can + * expose a file system entity through many pathnames. + * + * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions: + * + * 1. No case conversion is performed on case-insensitive file systems. + * 2. The maximum number of symbolic links is platform-independent and generally + * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. + * + * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd` to resolve relative paths. + * + * Only paths that can be converted to UTF8 strings are supported. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the path passed to the callback. If the `encoding` is set to `'buffer'`, + * the path returned will be passed as a `Buffer` object. + * + * If `path` resolves to a socket or a pipe, the function will return a system + * dependent name for that object. + * @since v0.1.31 + */ + function realpath( + path: PathLike, + options: EncodingOption, + callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, + ): void; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath( + path: PathLike, + options: BufferEncodingOption, + callback: (err: NodeJS.ErrnoException | null, resolvedPath: NonSharedBuffer) => void, + ): void; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath( + path: PathLike, + options: EncodingOption, + callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | NonSharedBuffer) => void, + ): void; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function realpath( + path: PathLike, + callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, + ): void; + namespace realpath { + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html). + * + * The `callback` gets two arguments `(err, resolvedPath)`. + * + * Only paths that can be converted to UTF8 strings are supported. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the path passed to the callback. If the `encoding` is set to `'buffer'`, + * the path returned will be passed as a `Buffer` object. + * + * On Linux, when Node.js is linked against musl libc, the procfs file system must + * be mounted on `/proc` in order for this function to work. Glibc does not have + * this restriction. + * @since v9.2.0 + */ + function native( + path: PathLike, + options: EncodingOption, + callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, + ): void; + function native( + path: PathLike, + options: BufferEncodingOption, + callback: (err: NodeJS.ErrnoException | null, resolvedPath: NonSharedBuffer) => void, + ): void; + function native( + path: PathLike, + options: EncodingOption, + callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | NonSharedBuffer) => void, + ): void; + function native( + path: PathLike, + callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, + ): void; + } + /** + * Returns the resolved pathname. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link realpath}. + * @since v0.1.31 + */ + function realpathSync(path: PathLike, options?: EncodingOption): string; + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpathSync(path: PathLike, options: BufferEncodingOption): NonSharedBuffer; + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpathSync(path: PathLike, options?: EncodingOption): string | NonSharedBuffer; + namespace realpathSync { + function native(path: PathLike, options?: EncodingOption): string; + function native(path: PathLike, options: BufferEncodingOption): NonSharedBuffer; + function native(path: PathLike, options?: EncodingOption): string | NonSharedBuffer; + } + /** + * Asynchronously removes a file or symbolic link. No arguments other than a + * possible exception are given to the completion callback. + * + * ```js + * import { unlink } from 'node:fs'; + * // Assuming that 'path/file.txt' is a regular file. + * unlink('path/file.txt', (err) => { + * if (err) throw err; + * console.log('path/file.txt was deleted'); + * }); + * ``` + * + * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a + * directory, use {@link rmdir}. + * + * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. + * @since v0.0.2 + */ + function unlink(path: PathLike, callback: NoParamCallback): void; + namespace unlink { + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike): Promise; + } + /** + * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. + * @since v0.1.21 + */ + function unlinkSync(path: PathLike): void; + /** @deprecated `rmdir()` no longer provides any options. This interface will be removed in a future version. */ + // TODO: remove in future major + interface RmDirOptions {} + /** + * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given + * to the completion callback. + * + * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on + * Windows and an `ENOTDIR` error on POSIX. + * + * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. + * @since v0.0.2 + */ + function rmdir(path: PathLike, callback: NoParamCallback): void; + namespace rmdir { + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike): Promise; + } + /** + * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. + * + * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error + * on Windows and an `ENOTDIR` error on POSIX. + * + * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. + * @since v0.1.21 + */ + function rmdirSync(path: PathLike): void; + interface RmOptions { + /** + * When `true`, exceptions will be ignored if `path` does not exist. + * @default false + */ + force?: boolean | undefined; + /** + * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or + * `EPERM` error is encountered, Node.js will retry the operation with a linear + * backoff wait of `retryDelay` ms longer on each try. This option represents the + * number of retries. This option is ignored if the `recursive` option is not + * `true`. + * @default 0 + */ + maxRetries?: number | undefined; + /** + * If `true`, perform a recursive directory removal. In + * recursive mode, operations are retried on failure. + * @default false + */ + recursive?: boolean | undefined; + /** + * The amount of time in milliseconds to wait between retries. + * This option is ignored if the `recursive` option is not `true`. + * @default 100 + */ + retryDelay?: number | undefined; + } + /** + * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). No arguments other than a possible exception are given to the + * completion callback. + * @since v14.14.0 + */ + function rm(path: PathLike, callback: NoParamCallback): void; + function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; + namespace rm { + /** + * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). + */ + function __promisify__(path: PathLike, options?: RmOptions): Promise; + } + /** + * Synchronously removes files and directories (modeled on the standard POSIX `rm` utility). Returns `undefined`. + * @since v14.14.0 + */ + function rmSync(path: PathLike, options?: RmOptions): void; + interface MakeDirectoryOptions { + /** + * Indicates whether parent folders should be created. + * If a folder was created, the path to the first created folder will be returned. + * @default false + */ + recursive?: boolean | undefined; + /** + * A file mode. If a string is passed, it is parsed as an octal integer. If not specified + * @default 0o777 + */ + mode?: Mode | undefined; + } + /** + * Asynchronously creates a directory. + * + * The callback is given a possible exception and, if `recursive` is `true`, the + * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was + * created (for instance, if it was previously created). + * + * The optional `options` argument can be an integer specifying `mode` (permission + * and sticky bits), or an object with a `mode` property and a `recursive` property indicating whether parent directories should be created. Calling `fs.mkdir()` when `path` is a directory that + * exists results in an error only + * when `recursive` is false. If `recursive` is false and the directory exists, + * an `EEXIST` error occurs. + * + * ```js + * import { mkdir } from 'node:fs'; + * + * // Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist. + * mkdir('./tmp/a/apple', { recursive: true }, (err) => { + * if (err) throw err; + * }); + * ``` + * + * On Windows, using `fs.mkdir()` on the root directory even with recursion will + * result in an error: + * + * ```js + * import { mkdir } from 'node:fs'; + * + * mkdir('/', { recursive: true }, (err) => { + * // => [Error: EPERM: operation not permitted, mkdir 'C:\'] + * }); + * ``` + * + * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. + * @since v0.1.8 + */ + function mkdir( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + }, + callback: (err: NodeJS.ErrnoException | null, path?: string) => void, + ): void; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir( + path: PathLike, + options: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + | undefined, + callback: NoParamCallback, + ): void; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir( + path: PathLike, + options: Mode | MakeDirectoryOptions | null | undefined, + callback: (err: NodeJS.ErrnoException | null, path?: string) => void, + ): void; + /** + * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function mkdir(path: PathLike, callback: NoParamCallback): void; + namespace mkdir { + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + }, + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__( + path: PathLike, + options?: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null, + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__( + path: PathLike, + options?: Mode | MakeDirectoryOptions | null, + ): Promise; + } + /** + * Synchronously creates a directory. Returns `undefined`, or if `recursive` is `true`, the first directory path created. + * This is the synchronous version of {@link mkdir}. + * + * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. + * @since v0.1.21 + */ + function mkdirSync( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + }, + ): string | undefined; + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdirSync( + path: PathLike, + options?: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null, + ): void; + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; + /** + * Creates a unique temporary directory. + * + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. Due to platform + * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, + * notably the BSDs, can return more than six random characters, and replace + * trailing `X` characters in `prefix` with random characters. + * + * The created directory path is passed as a string to the callback's second + * parameter. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * + * ```js + * import { mkdtemp } from 'node:fs'; + * import { join } from 'node:path'; + * import { tmpdir } from 'node:os'; + * + * mkdtemp(join(tmpdir(), 'foo-'), (err, directory) => { + * if (err) throw err; + * console.log(directory); + * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 + * }); + * ``` + * + * The `fs.mkdtemp()` method will append the six randomly selected characters + * directly to the `prefix` string. For instance, given a directory `/tmp`, if the + * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator + * (`import { sep } from 'node:path'`). + * + * ```js + * import { tmpdir } from 'node:os'; + * import { mkdtemp } from 'node:fs'; + * + * // The parent directory for the new temporary directory + * const tmpDir = tmpdir(); + * + * // This method is *INCORRECT*: + * mkdtemp(tmpDir, (err, directory) => { + * if (err) throw err; + * console.log(directory); + * // Will print something similar to `/tmpabc123`. + * // A new temporary directory is created at the file system root + * // rather than *within* the /tmp directory. + * }); + * + * // This method is *CORRECT*: + * import { sep } from 'node:path'; + * mkdtemp(`${tmpDir}${sep}`, (err, directory) => { + * if (err) throw err; + * console.log(directory); + * // Will print something similar to `/tmp/abc123`. + * // A new temporary directory is created within + * // the /tmp directory. + * }); + * ``` + * @since v5.10.0 + */ + function mkdtemp( + prefix: string, + options: EncodingOption, + callback: (err: NodeJS.ErrnoException | null, folder: string) => void, + ): void; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp( + prefix: string, + options: BufferEncodingOption, + callback: (err: NodeJS.ErrnoException | null, folder: NonSharedBuffer) => void, + ): void; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp( + prefix: string, + options: EncodingOption, + callback: (err: NodeJS.ErrnoException | null, folder: string | NonSharedBuffer) => void, + ): void; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + */ + function mkdtemp( + prefix: string, + callback: (err: NodeJS.ErrnoException | null, folder: string) => void, + ): void; + namespace mkdtemp { + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options?: EncodingOption): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options: BufferEncodingOption): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options?: EncodingOption): Promise; + } + /** + * Returns the created directory path. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link mkdtemp}. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * @since v5.10.0 + */ + function mkdtempSync(prefix: string, options?: EncodingOption): string; + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtempSync(prefix: string, options: BufferEncodingOption): NonSharedBuffer; + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtempSync(prefix: string, options?: EncodingOption): string | NonSharedBuffer; + interface DisposableTempDir extends Disposable { + /** + * The path of the created directory. + */ + path: string; + /** + * A function which removes the created directory. + */ + remove(): void; + /** + * The same as `remove`. + */ + [Symbol.dispose](): void; + } + /** + * Returns a disposable object whose `path` property holds the created directory + * path. When the object is disposed, the directory and its contents will be + * removed if it still exists. If the directory cannot be deleted, disposal will + * throw an error. The object has a `remove()` method which will perform the same + * task. + * + * + * + * For detailed information, see the documentation of `fs.mkdtemp()`. + * + * There is no callback-based version of this API because it is designed for use + * with the `using` syntax. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * @since v24.4.0 + */ + function mkdtempDisposableSync(prefix: string, options?: EncodingOption): DisposableTempDir; + /** + * Reads the contents of a directory. The callback gets two arguments `(err, files)` where `files` is an array of the names of the files in the directory excluding `'.'` and `'..'`. + * + * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the filenames passed to the callback. If the `encoding` is set to `'buffer'`, + * the filenames returned will be passed as `Buffer` objects. + * + * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. + * @since v0.1.8 + */ + function readdir( + path: PathLike, + options: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir( + path: PathLike, + options: + | { + encoding: "buffer"; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | "buffer", + callback: (err: NodeJS.ErrnoException | null, files: NonSharedBuffer[]) => void, + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir( + path: PathLike, + options: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, files: string[] | NonSharedBuffer[]) => void, + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function readdir( + path: PathLike, + callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + function readdir( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean | undefined; + }, + callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void, + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`. + */ + function readdir( + path: PathLike, + options: { + encoding: "buffer"; + withFileTypes: true; + recursive?: boolean | undefined; + }, + callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void, + ): void; + namespace readdir { + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__( + path: PathLike, + options?: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | BufferEncoding + | null, + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__( + path: PathLike, + options: + | "buffer" + | { + encoding: "buffer"; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }, + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | null, + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent + */ + function __promisify__( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean | undefined; + }, + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`. + */ + function __promisify__( + path: PathLike, + options: { + encoding: "buffer"; + withFileTypes: true; + recursive?: boolean | undefined; + }, + ): Promise[]>; + } + /** + * Reads the contents of the directory. + * + * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the filenames returned. If the `encoding` is set to `'buffer'`, + * the filenames returned will be passed as `Buffer` objects. + * + * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. + * @since v0.1.21 + */ + function readdirSync( + path: PathLike, + options?: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | BufferEncoding + | null, + ): string[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdirSync( + path: PathLike, + options: + | { + encoding: "buffer"; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | "buffer", + ): NonSharedBuffer[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdirSync( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | null, + ): string[] | NonSharedBuffer[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + function readdirSync( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean | undefined; + }, + ): Dirent[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`. + */ + function readdirSync( + path: PathLike, + options: { + encoding: "buffer"; + withFileTypes: true; + recursive?: boolean | undefined; + }, + ): Dirent[]; + /** + * Closes the file descriptor. No arguments other than a possible exception are + * given to the completion callback. + * + * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use + * through any other `fs` operation may lead to undefined behavior. + * + * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. + * @since v0.0.2 + */ + function close(fd: number, callback?: NoParamCallback): void; + namespace close { + /** + * Asynchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + /** + * Closes the file descriptor. Returns `undefined`. + * + * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use + * through any other `fs` operation may lead to undefined behavior. + * + * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. + * @since v0.1.21 + */ + function closeSync(fd: number): void; + /** + * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. + * + * `mode` sets the file mode (permission and sticky bits), but only if the file was + * created. On Windows, only the write permission can be manipulated; see {@link chmod}. + * + * The callback gets two arguments `(err, fd)`. + * + * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented + * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains + * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). + * + * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc. + * @since v0.0.2 + * @param [flags='r'] See `support of file system `flags``. + * @param [mode=0o666] + */ + function open( + path: PathLike, + flags: OpenMode | undefined, + mode: Mode | undefined | null, + callback: (err: NodeJS.ErrnoException | null, fd: number) => void, + ): void; + /** + * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param [flags='r'] See `support of file system `flags``. + */ + function open( + path: PathLike, + flags: OpenMode | undefined, + callback: (err: NodeJS.ErrnoException | null, fd: number) => void, + ): void; + /** + * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + namespace open { + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; + } + /** + * Returns an integer representing the file descriptor. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link open}. + * @since v0.1.21 + * @param [flags='r'] + * @param [mode=0o666] + */ + function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; + /** + * Change the file system timestamps of the object referenced by `path`. + * + * The `atime` and `mtime` arguments follow these rules: + * + * * Values can be either numbers representing Unix epoch time in seconds, `Date`s, or a numeric string like `'123456789.0'`. + * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or `-Infinity`, an `Error` will be thrown. + * @since v0.4.2 + */ + function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + namespace utimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + } + /** + * Returns `undefined`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link utimes}. + * @since v0.4.2 + */ + function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; + /** + * Change the file system timestamps of the object referenced by the supplied file + * descriptor. See {@link utimes}. + * @since v0.4.2 + */ + function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + namespace futimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise; + } + /** + * Synchronous version of {@link futimes}. Returns `undefined`. + * @since v0.4.2 + */ + function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; + /** + * Request that all data for the open file descriptor is flushed to the storage + * device. The specific implementation is operating system and device specific. + * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other + * than a possible exception are given to the completion callback. + * @since v0.1.96 + */ + function fsync(fd: number, callback: NoParamCallback): void; + namespace fsync { + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + /** + * Request that all data for the open file descriptor is flushed to the storage + * device. The specific implementation is operating system and device specific. + * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. + * @since v0.1.96 + */ + function fsyncSync(fd: number): void; + interface WriteOptions { + /** + * @default 0 + */ + offset?: number | undefined; + /** + * @default `buffer.byteLength - offset` + */ + length?: number | undefined; + /** + * @default null + */ + position?: number | null | undefined; + } + /** + * Write `buffer` to the file specified by `fd`. + * + * `offset` determines the part of the buffer to be written, and `length` is + * an integer specifying the number of bytes to write. + * + * `position` refers to the offset from the beginning of the file where this data + * should be written. If `typeof position !== 'number'`, the data will be written + * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). + * + * The callback will be given three arguments `(err, bytesWritten, buffer)` where `bytesWritten` specifies how many _bytes_ were written from `buffer`. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a promise for an `Object` with `bytesWritten` and `buffer` properties. + * + * It is unsafe to use `fs.write()` multiple times on the same file without waiting + * for the callback. For this scenario, {@link createWriteStream} is + * recommended. + * + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v0.0.2 + * @param [offset=0] + * @param [length=buffer.byteLength - offset] + * @param [position='null'] + */ + function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + length: number | undefined | null, + position: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + */ + function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + length: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + */ + function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + */ + function write( + fd: number, + buffer: TBuffer, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param options An object with the following properties: + * * `offset` The part of the buffer to be written. If not supplied, defaults to `0`. + * * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function write( + fd: number, + buffer: TBuffer, + options: WriteOptions, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, + ): void; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function write( + fd: number, + string: string, + position: number | undefined | null, + encoding: BufferEncoding | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, + ): void; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function write( + fd: number, + string: string, + position: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, + ): void; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + */ + function write( + fd: number, + string: string, + callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, + ): void; + namespace write { + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function __promisify__( + fd: number, + buffer?: TBuffer, + offset?: number, + length?: number, + position?: number | null, + ): Promise<{ + bytesWritten: number; + buffer: TBuffer; + }>; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param options An object with the following properties: + * * `offset` The part of the buffer to be written. If not supplied, defaults to `0`. + * * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function __promisify__( + fd: number, + buffer?: TBuffer, + options?: WriteOptions, + ): Promise<{ + bytesWritten: number; + buffer: TBuffer; + }>; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function __promisify__( + fd: number, + string: string, + position?: number | null, + encoding?: BufferEncoding | null, + ): Promise<{ + bytesWritten: number; + buffer: string; + }>; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link write}. + * @since v0.1.21 + * @param [offset=0] + * @param [length=buffer.byteLength - offset] + * @param [position='null'] + * @return The number of bytes written. + */ + function writeSync( + fd: number, + buffer: NodeJS.ArrayBufferView, + offset?: number | null, + length?: number | null, + position?: number | null, + ): number; + /** + * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function writeSync( + fd: number, + string: string, + position?: number | null, + encoding?: BufferEncoding | null, + ): number; + type ReadPosition = number | bigint; + interface ReadOptions { + /** + * @default 0 + */ + offset?: number | undefined; + /** + * @default `length of buffer` + */ + length?: number | undefined; + /** + * @default null + */ + position?: ReadPosition | null | undefined; + } + interface ReadOptionsWithBuffer extends ReadOptions { + buffer?: T | undefined; + } + /** @deprecated Use `ReadOptions` instead. */ + // TODO: remove in future major + interface ReadSyncOptions extends ReadOptions {} + /** @deprecated Use `ReadOptionsWithBuffer` instead. */ + // TODO: remove in future major + interface ReadAsyncOptions extends ReadOptionsWithBuffer {} + /** + * Read data from the file specified by `fd`. + * + * The callback is given the three arguments, `(err, bytesRead, buffer)`. + * + * If the file is not modified concurrently, the end-of-file is reached when the + * number of bytes read is zero. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a promise for an `Object` with `bytesRead` and `buffer` properties. + * @since v0.0.2 + * @param buffer The buffer that the data will be written to. + * @param offset The position in `buffer` to write the data to. + * @param length The number of bytes to read. + * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If + * `position` is an integer, the file position will be unchanged. + */ + function read( + fd: number, + buffer: TBuffer, + offset: number, + length: number, + position: ReadPosition | null, + callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, + ): void; + /** + * Similar to the above `fs.read` function, this version takes an optional `options` object. + * If not otherwise specified in an `options` object, + * `buffer` defaults to `Buffer.alloc(16384)`, + * `offset` defaults to `0`, + * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0 + * `position` defaults to `null` + * @since v12.17.0, 13.11.0 + */ + function read( + fd: number, + options: ReadOptionsWithBuffer, + callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, + ): void; + function read( + fd: number, + buffer: TBuffer, + options: ReadOptions, + callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, + ): void; + function read( + fd: number, + buffer: TBuffer, + callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, + ): void; + function read( + fd: number, + callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NonSharedBuffer) => void, + ): void; + namespace read { + /** + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + function __promisify__( + fd: number, + buffer: TBuffer, + offset: number, + length: number, + position: ReadPosition | null, + ): Promise<{ + bytesRead: number; + buffer: TBuffer; + }>; + function __promisify__( + fd: number, + options: ReadOptionsWithBuffer, + ): Promise<{ + bytesRead: number; + buffer: TBuffer; + }>; + function __promisify__(fd: number): Promise<{ + bytesRead: number; + buffer: NonSharedBuffer; + }>; + } + /** + * Returns the number of `bytesRead`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link read}. + * @since v0.1.21 + * @param [position='null'] + */ + function readSync( + fd: number, + buffer: NodeJS.ArrayBufferView, + offset: number, + length: number, + position: ReadPosition | null, + ): number; + /** + * Similar to the above `fs.readSync` function, this version takes an optional `options` object. + * If no `options` object is specified, it will default with the above values. + */ + function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadOptions): number; + /** + * Asynchronously reads the entire contents of a file. + * + * ```js + * import { readFile } from 'node:fs'; + * + * readFile('/etc/passwd', (err, data) => { + * if (err) throw err; + * console.log(data); + * }); + * ``` + * + * The callback is passed two arguments `(err, data)`, where `data` is the + * contents of the file. + * + * If no encoding is specified, then the raw buffer is returned. + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { readFile } from 'node:fs'; + * + * readFile('/etc/passwd', 'utf8', callback); + * ``` + * + * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an + * error will be returned. On FreeBSD, a representation of the directory's contents + * will be returned. + * + * ```js + * import { readFile } from 'node:fs'; + * + * // macOS, Linux, and Windows + * readFile('', (err, data) => { + * // => [Error: EISDIR: illegal operation on a directory, read ] + * }); + * + * // FreeBSD + * readFile('', (err, data) => { + * // => null, + * }); + * ``` + * + * It is possible to abort an ongoing request using an `AbortSignal`. If a + * request is aborted the callback is called with an `AbortError`: + * + * ```js + * import { readFile } from 'node:fs'; + * + * const controller = new AbortController(); + * const signal = controller.signal; + * readFile(fileInfo[0].name, { signal }, (err, buf) => { + * // ... + * }); + * // When you want to abort the request + * controller.abort(); + * ``` + * + * The `fs.readFile()` function buffers the entire file. To minimize memory costs, + * when possible prefer streaming via `fs.createReadStream()`. + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.readFile` performs. + * @since v0.1.29 + * @param path filename or file descriptor + */ + function readFile( + path: PathOrFileDescriptor, + options: + | ({ + encoding?: null | undefined; + flag?: string | undefined; + } & Abortable) + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, data: NonSharedBuffer) => void, + ): void; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile( + path: PathOrFileDescriptor, + options: + | ({ + encoding: BufferEncoding; + flag?: string | undefined; + } & Abortable) + | BufferEncoding, + callback: (err: NodeJS.ErrnoException | null, data: string) => void, + ): void; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile( + path: PathOrFileDescriptor, + options: + | (ObjectEncodingOptions & { + flag?: string | undefined; + } & Abortable) + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, data: string | NonSharedBuffer) => void, + ): void; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + */ + function readFile( + path: PathOrFileDescriptor, + callback: (err: NodeJS.ErrnoException | null, data: NonSharedBuffer) => void, + ): void; + namespace readFile { + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__( + path: PathOrFileDescriptor, + options?: { + encoding?: null | undefined; + flag?: string | undefined; + } | null, + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__( + path: PathOrFileDescriptor, + options: + | { + encoding: BufferEncoding; + flag?: string | undefined; + } + | BufferEncoding, + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__( + path: PathOrFileDescriptor, + options?: + | (ObjectEncodingOptions & { + flag?: string | undefined; + }) + | BufferEncoding + | null, + ): Promise; + } + /** + * Returns the contents of the `path`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link readFile}. + * + * If the `encoding` option is specified then this function returns a + * string. Otherwise it returns a buffer. + * + * Similar to {@link readFile}, when the path is a directory, the behavior of `fs.readFileSync()` is platform-specific. + * + * ```js + * import { readFileSync } from 'node:fs'; + * + * // macOS, Linux, and Windows + * readFileSync(''); + * // => [Error: EISDIR: illegal operation on a directory, read ] + * + * // FreeBSD + * readFileSync(''); // => + * ``` + * @since v0.1.8 + * @param path filename or file descriptor + */ + function readFileSync( + path: PathOrFileDescriptor, + options?: { + encoding?: null | undefined; + flag?: string | undefined; + } | null, + ): NonSharedBuffer; + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFileSync( + path: PathOrFileDescriptor, + options: + | { + encoding: BufferEncoding; + flag?: string | undefined; + } + | BufferEncoding, + ): string; + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFileSync( + path: PathOrFileDescriptor, + options?: + | (ObjectEncodingOptions & { + flag?: string | undefined; + }) + | BufferEncoding + | null, + ): string | NonSharedBuffer; + type WriteFileOptions = + | ( + & ObjectEncodingOptions + & Abortable + & { + mode?: Mode | undefined; + flag?: string | undefined; + flush?: boolean | undefined; + } + ) + | BufferEncoding + | null; + /** + * When `file` is a filename, asynchronously writes data to the file, replacing the + * file if it already exists. `data` can be a string or a buffer. + * + * When `file` is a file descriptor, the behavior is similar to calling `fs.write()` directly (which is recommended). See the notes below on using + * a file descriptor. + * + * The `encoding` option is ignored if `data` is a buffer. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * ```js + * import { writeFile } from 'node:fs'; + * import { Buffer } from 'node:buffer'; + * + * const data = new Uint8Array(Buffer.from('Hello Node.js')); + * writeFile('message.txt', data, (err) => { + * if (err) throw err; + * console.log('The file has been saved!'); + * }); + * ``` + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { writeFile } from 'node:fs'; + * + * writeFile('message.txt', 'Hello Node.js', 'utf8', callback); + * ``` + * + * It is unsafe to use `fs.writeFile()` multiple times on the same file without + * waiting for the callback. For this scenario, {@link createWriteStream} is + * recommended. + * + * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that + * performs multiple `write` calls internally to write the buffer passed to it. + * For performance sensitive code consider using {@link createWriteStream}. + * + * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`. + * Cancelation is "best effort", and some amount of data is likely still + * to be written. + * + * ```js + * import { writeFile } from 'node:fs'; + * import { Buffer } from 'node:buffer'; + * + * const controller = new AbortController(); + * const { signal } = controller; + * const data = new Uint8Array(Buffer.from('Hello Node.js')); + * writeFile('message.txt', data, { signal }, (err) => { + * // When a request is aborted - the callback is called with an AbortError + * }); + * // When the request should be aborted + * controller.abort(); + * ``` + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.writeFile` performs. + * @since v0.1.29 + * @param file filename or file descriptor + */ + function writeFile( + file: PathOrFileDescriptor, + data: string | NodeJS.ArrayBufferView, + options: WriteFileOptions, + callback: NoParamCallback, + ): void; + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + function writeFile( + path: PathOrFileDescriptor, + data: string | NodeJS.ArrayBufferView, + callback: NoParamCallback, + ): void; + namespace writeFile { + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + function __promisify__( + path: PathOrFileDescriptor, + data: string | NodeJS.ArrayBufferView, + options?: WriteFileOptions, + ): Promise; + } + /** + * Returns `undefined`. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link writeFile}. + * @since v0.1.29 + * @param file filename or file descriptor + */ + function writeFileSync( + file: PathOrFileDescriptor, + data: string | NodeJS.ArrayBufferView, + options?: WriteFileOptions, + ): void; + /** + * Asynchronously append data to a file, creating the file if it does not yet + * exist. `data` can be a string or a `Buffer`. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * ```js + * import { appendFile } from 'node:fs'; + * + * appendFile('message.txt', 'data to append', (err) => { + * if (err) throw err; + * console.log('The "data to append" was appended to file!'); + * }); + * ``` + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { appendFile } from 'node:fs'; + * + * appendFile('message.txt', 'data to append', 'utf8', callback); + * ``` + * + * The `path` may be specified as a numeric file descriptor that has been opened + * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will + * not be closed automatically. + * + * ```js + * import { open, close, appendFile } from 'node:fs'; + * + * function closeFd(fd) { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * + * open('message.txt', 'a', (err, fd) => { + * if (err) throw err; + * + * try { + * appendFile(fd, 'data to append', 'utf8', (err) => { + * closeFd(fd); + * if (err) throw err; + * }); + * } catch (err) { + * closeFd(fd); + * throw err; + * } + * }); + * ``` + * @since v0.6.7 + * @param path filename or file descriptor + */ + function appendFile( + path: PathOrFileDescriptor, + data: string | Uint8Array, + options: WriteFileOptions, + callback: NoParamCallback, + ): void; + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; + namespace appendFile { + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + function __promisify__( + file: PathOrFileDescriptor, + data: string | Uint8Array, + options?: WriteFileOptions, + ): Promise; + } + /** + * Synchronously append data to a file, creating the file if it does not yet + * exist. `data` can be a string or a `Buffer`. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * ```js + * import { appendFileSync } from 'node:fs'; + * + * try { + * appendFileSync('message.txt', 'data to append'); + * console.log('The "data to append" was appended to file!'); + * } catch (err) { + * // Handle the error + * } + * ``` + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { appendFileSync } from 'node:fs'; + * + * appendFileSync('message.txt', 'data to append', 'utf8'); + * ``` + * + * The `path` may be specified as a numeric file descriptor that has been opened + * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will + * not be closed automatically. + * + * ```js + * import { openSync, closeSync, appendFileSync } from 'node:fs'; + * + * let fd; + * + * try { + * fd = openSync('message.txt', 'a'); + * appendFileSync(fd, 'data to append', 'utf8'); + * } catch (err) { + * // Handle the error + * } finally { + * if (fd !== undefined) + * closeSync(fd); + * } + * ``` + * @since v0.6.7 + * @param path filename or file descriptor + */ + function appendFileSync( + path: PathOrFileDescriptor, + data: string | Uint8Array, + options?: WriteFileOptions, + ): void; + /** + * Watch for changes on `filename`. The callback `listener` will be called each + * time the file is accessed. + * + * The `options` argument may be omitted. If provided, it should be an object. The `options` object may contain a boolean named `persistent` that indicates + * whether the process should continue to run as long as files are being watched. + * The `options` object may specify an `interval` property indicating how often the + * target should be polled in milliseconds. + * + * The `listener` gets two arguments the current stat object and the previous + * stat object: + * + * ```js + * import { watchFile } from 'node:fs'; + * + * watchFile('message.text', (curr, prev) => { + * console.log(`the current mtime is: ${curr.mtime}`); + * console.log(`the previous mtime was: ${prev.mtime}`); + * }); + * ``` + * + * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, + * the numeric values in these objects are specified as `BigInt`s. + * + * To be notified when the file was modified, not just accessed, it is necessary + * to compare `curr.mtimeMs` and `prev.mtimeMs`. + * + * When an `fs.watchFile` operation results in an `ENOENT` error, it + * will invoke the listener once, with all the fields zeroed (or, for dates, the + * Unix Epoch). If the file is created later on, the listener will be called + * again, with the latest stat objects. This is a change in functionality since + * v0.10. + * + * Using {@link watch} is more efficient than `fs.watchFile` and `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible. + * + * When a file being watched by `fs.watchFile()` disappears and reappears, + * then the contents of `previous` in the second callback event (the file's + * reappearance) will be the same as the contents of `previous` in the first + * callback event (its disappearance). + * + * This happens when: + * + * * the file is deleted, followed by a restore + * * the file is renamed and then renamed a second time back to its original name + * @since v0.1.31 + */ + interface WatchFileOptions { + bigint?: boolean | undefined; + persistent?: boolean | undefined; + interval?: number | undefined; + } + /** + * Watch for changes on `filename`. The callback `listener` will be called each + * time the file is accessed. + * + * The `options` argument may be omitted. If provided, it should be an object. The `options` object may contain a boolean named `persistent` that indicates + * whether the process should continue to run as long as files are being watched. + * The `options` object may specify an `interval` property indicating how often the + * target should be polled in milliseconds. + * + * The `listener` gets two arguments the current stat object and the previous + * stat object: + * + * ```js + * import { watchFile } from 'node:fs'; + * + * watchFile('message.text', (curr, prev) => { + * console.log(`the current mtime is: ${curr.mtime}`); + * console.log(`the previous mtime was: ${prev.mtime}`); + * }); + * ``` + * + * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, + * the numeric values in these objects are specified as `BigInt`s. + * + * To be notified when the file was modified, not just accessed, it is necessary + * to compare `curr.mtimeMs` and `prev.mtimeMs`. + * + * When an `fs.watchFile` operation results in an `ENOENT` error, it + * will invoke the listener once, with all the fields zeroed (or, for dates, the + * Unix Epoch). If the file is created later on, the listener will be called + * again, with the latest stat objects. This is a change in functionality since + * v0.10. + * + * Using {@link watch} is more efficient than `fs.watchFile` and `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible. + * + * When a file being watched by `fs.watchFile()` disappears and reappears, + * then the contents of `previous` in the second callback event (the file's + * reappearance) will be the same as the contents of `previous` in the first + * callback event (its disappearance). + * + * This happens when: + * + * * the file is deleted, followed by a restore + * * the file is renamed and then renamed a second time back to its original name + * @since v0.1.31 + */ + function watchFile( + filename: PathLike, + options: + | (WatchFileOptions & { + bigint?: false | undefined; + }) + | undefined, + listener: StatsListener, + ): StatWatcher; + function watchFile( + filename: PathLike, + options: + | (WatchFileOptions & { + bigint: true; + }) + | undefined, + listener: BigIntStatsListener, + ): StatWatcher; + /** + * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + */ + function watchFile(filename: PathLike, listener: StatsListener): StatWatcher; + /** + * Stop watching for changes on `filename`. If `listener` is specified, only that + * particular listener is removed. Otherwise, _all_ listeners are removed, + * effectively stopping watching of `filename`. + * + * Calling `fs.unwatchFile()` with a filename that is not being watched is a + * no-op, not an error. + * + * Using {@link watch} is more efficient than `fs.watchFile()` and `fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()` and `fs.unwatchFile()` when possible. + * @since v0.1.31 + * @param listener Optional, a listener previously attached using `fs.watchFile()` + */ + function unwatchFile(filename: PathLike, listener?: StatsListener): void; + function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void; + type WatchIgnorePredicate = string | RegExp | ((filename: string) => boolean); + interface WatchOptions extends Abortable { + encoding?: BufferEncoding | "buffer" | undefined; + persistent?: boolean | undefined; + recursive?: boolean | undefined; + ignore?: WatchIgnorePredicate | readonly WatchIgnorePredicate[] | undefined; + } + interface WatchOptionsWithBufferEncoding extends WatchOptions { + encoding: "buffer"; + } + interface WatchOptionsWithStringEncoding extends WatchOptions { + encoding?: BufferEncoding | undefined; + } + type WatchEventType = "rename" | "change"; + type WatchListener = (event: WatchEventType, filename: T | null) => void; + type StatsListener = (curr: Stats, prev: Stats) => void; + type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void; + /** + * Watch for changes on `filename`, where `filename` is either a file or a + * directory. + * + * The second argument is optional. If `options` is provided as a string, it + * specifies the `encoding`. Otherwise `options` should be passed as an object. + * + * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file + * which triggered the event. + * + * On most platforms, `'rename'` is emitted whenever a filename appears or + * disappears in the directory. + * + * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of `eventType`. + * + * If a `signal` is passed, aborting the corresponding AbortController will close + * the returned `fs.FSWatcher`. + * @since v0.5.10 + * @param listener + */ + function watch( + filename: PathLike, + options?: WatchOptionsWithStringEncoding | BufferEncoding | null, + listener?: WatchListener, + ): FSWatcher; + function watch( + filename: PathLike, + options: WatchOptionsWithBufferEncoding | "buffer", + listener: WatchListener, + ): FSWatcher; + function watch( + filename: PathLike, + options: WatchOptions | BufferEncoding | "buffer" | null, + listener: WatchListener, + ): FSWatcher; + function watch(filename: PathLike, listener: WatchListener): FSWatcher; + /** + * Test whether or not the given path exists by checking with the file system. + * Then call the `callback` argument with either true or false: + * + * ```js + * import { exists } from 'node:fs'; + * + * exists('/etc/passwd', (e) => { + * console.log(e ? 'it exists' : 'no passwd!'); + * }); + * ``` + * + * **The parameters for this callback are not consistent with other Node.js** + * **callbacks.** Normally, the first parameter to a Node.js callback is an `err` parameter, optionally followed by other parameters. The `fs.exists()` callback + * has only one boolean parameter. This is one reason `fs.access()` is recommended + * instead of `fs.exists()`. + * + * Using `fs.exists()` to check for the existence of a file before calling `fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing + * so introduces a race condition, since other processes may change the file's + * state between the two calls. Instead, user code should open/read/write the + * file directly and handle the error raised if the file does not exist. + * + * **write (NOT RECOMMENDED)** + * + * ```js + * import { exists, open, close } from 'node:fs'; + * + * exists('myfile', (e) => { + * if (e) { + * console.error('myfile already exists'); + * } else { + * open('myfile', 'wx', (err, fd) => { + * if (err) throw err; + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * } + * }); + * ``` + * + * **write (RECOMMENDED)** + * + * ```js + * import { open, close } from 'node:fs'; + * open('myfile', 'wx', (err, fd) => { + * if (err) { + * if (err.code === 'EEXIST') { + * console.error('myfile already exists'); + * return; + * } + * + * throw err; + * } + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * **read (NOT RECOMMENDED)** + * + * ```js + * import { open, close, exists } from 'node:fs'; + * + * exists('myfile', (e) => { + * if (e) { + * open('myfile', 'r', (err, fd) => { + * if (err) throw err; + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * } else { + * console.error('myfile does not exist'); + * } + * }); + * ``` + * + * **read (RECOMMENDED)** + * + * ```js + * import { open, close } from 'node:fs'; + * + * open('myfile', 'r', (err, fd) => { + * if (err) { + * if (err.code === 'ENOENT') { + * console.error('myfile does not exist'); + * return; + * } + * + * throw err; + * } + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * The "not recommended" examples above check for existence and then use the + * file; the "recommended" examples are better because they use the file directly + * and handle the error, if any. + * + * In general, check for the existence of a file only if the file won't be + * used directly, for example when its existence is a signal from another + * process. + * @since v0.0.2 + * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. + */ + function exists(path: PathLike, callback: (exists: boolean) => void): void; + /** @deprecated */ + namespace exists { + /** + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike): Promise; + } + /** + * Returns `true` if the path exists, `false` otherwise. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link exists}. + * + * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback` parameter to `fs.exists()` accepts parameters that are inconsistent with other + * Node.js callbacks. `fs.existsSync()` does not use a callback. + * + * ```js + * import { existsSync } from 'node:fs'; + * + * if (existsSync('/etc/passwd')) + * console.log('The path exists.'); + * ``` + * @since v0.1.21 + */ + function existsSync(path: PathLike): boolean; + namespace constants { + // File Access Constants + /** Constant for fs.access(). File is visible to the calling process. */ + const F_OK: number; + /** Constant for fs.access(). File can be read by the calling process. */ + const R_OK: number; + /** Constant for fs.access(). File can be written by the calling process. */ + const W_OK: number; + /** Constant for fs.access(). File can be executed by the calling process. */ + const X_OK: number; + // File Copy Constants + /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ + const COPYFILE_EXCL: number; + /** + * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. + * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. + */ + const COPYFILE_FICLONE: number; + /** + * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. + * If the underlying platform does not support copy-on-write, then the operation will fail with an error. + */ + const COPYFILE_FICLONE_FORCE: number; + // File Open Constants + /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ + const O_RDONLY: number; + /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ + const O_WRONLY: number; + /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ + const O_RDWR: number; + /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ + const O_CREAT: number; + /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ + const O_EXCL: number; + /** + * Constant for fs.open(). Flag indicating that if path identifies a terminal device, + * opening the path shall not cause that terminal to become the controlling terminal for the process + * (if the process does not already have one). + */ + const O_NOCTTY: number; + /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ + const O_TRUNC: number; + /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ + const O_APPEND: number; + /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ + const O_DIRECTORY: number; + /** + * constant for fs.open(). + * Flag indicating reading accesses to the file system will no longer result in + * an update to the atime information associated with the file. + * This flag is available on Linux operating systems only. + */ + const O_NOATIME: number; + /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ + const O_NOFOLLOW: number; + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ + const O_SYNC: number; + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ + const O_DSYNC: number; + /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ + const O_SYMLINK: number; + /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ + const O_DIRECT: number; + /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ + const O_NONBLOCK: number; + // File Type Constants + /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ + const S_IFMT: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ + const S_IFREG: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ + const S_IFDIR: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ + const S_IFCHR: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ + const S_IFBLK: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ + const S_IFIFO: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ + const S_IFLNK: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ + const S_IFSOCK: number; + // File Mode Constants + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ + const S_IRWXU: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ + const S_IRUSR: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ + const S_IWUSR: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ + const S_IXUSR: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ + const S_IRWXG: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ + const S_IRGRP: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ + const S_IWGRP: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ + const S_IXGRP: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ + const S_IRWXO: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ + const S_IROTH: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ + const S_IWOTH: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ + const S_IXOTH: number; + /** + * When set, a memory file mapping is used to access the file. This flag + * is available on Windows operating systems only. On other operating systems, + * this flag is ignored. + */ + const UV_FS_O_FILEMAP: number; + } + /** + * Tests a user's permissions for the file or directory specified by `path`. + * The `mode` argument is an optional integer that specifies the accessibility + * checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and `fs.constants.X_OK` + * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for + * possible values of `mode`. + * + * The final argument, `callback`, is a callback function that is invoked with + * a possible error argument. If any of the accessibility checks fail, the error + * argument will be an `Error` object. The following examples check if `package.json` exists, and if it is readable or writable. + * + * ```js + * import { access, constants } from 'node:fs'; + * + * const file = 'package.json'; + * + * // Check if the file exists in the current directory. + * access(file, constants.F_OK, (err) => { + * console.log(`${file} ${err ? 'does not exist' : 'exists'}`); + * }); + * + * // Check if the file is readable. + * access(file, constants.R_OK, (err) => { + * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`); + * }); + * + * // Check if the file is writable. + * access(file, constants.W_OK, (err) => { + * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`); + * }); + * + * // Check if the file is readable and writable. + * access(file, constants.R_OK | constants.W_OK, (err) => { + * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`); + * }); + * ``` + * + * Do not use `fs.access()` to check for the accessibility of a file before calling `fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing + * so introduces a race condition, since other processes may change the file's + * state between the two calls. Instead, user code should open/read/write the + * file directly and handle the error raised if the file is not accessible. + * + * **write (NOT RECOMMENDED)** + * + * ```js + * import { access, open, close } from 'node:fs'; + * + * access('myfile', (err) => { + * if (!err) { + * console.error('myfile already exists'); + * return; + * } + * + * open('myfile', 'wx', (err, fd) => { + * if (err) throw err; + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * }); + * ``` + * + * **write (RECOMMENDED)** + * + * ```js + * import { open, close } from 'node:fs'; + * + * open('myfile', 'wx', (err, fd) => { + * if (err) { + * if (err.code === 'EEXIST') { + * console.error('myfile already exists'); + * return; + * } + * + * throw err; + * } + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * **read (NOT RECOMMENDED)** + * + * ```js + * import { access, open, close } from 'node:fs'; + * access('myfile', (err) => { + * if (err) { + * if (err.code === 'ENOENT') { + * console.error('myfile does not exist'); + * return; + * } + * + * throw err; + * } + * + * open('myfile', 'r', (err, fd) => { + * if (err) throw err; + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * }); + * ``` + * + * **read (RECOMMENDED)** + * + * ```js + * import { open, close } from 'node:fs'; + * + * open('myfile', 'r', (err, fd) => { + * if (err) { + * if (err.code === 'ENOENT') { + * console.error('myfile does not exist'); + * return; + * } + * + * throw err; + * } + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * The "not recommended" examples above check for accessibility and then use the + * file; the "recommended" examples are better because they use the file directly + * and handle the error, if any. + * + * In general, check for the accessibility of a file only if the file will not be + * used directly, for example when its accessibility is a signal from another + * process. + * + * On Windows, access-control policies (ACLs) on a directory may limit access to + * a file or directory. The `fs.access()` function, however, does not check the + * ACL and therefore may report that a path is accessible even if the ACL restricts + * the user from reading or writing to it. + * @since v0.11.15 + * @param [mode=fs.constants.F_OK] + */ + function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + */ + function access(path: PathLike, callback: NoParamCallback): void; + namespace access { + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike, mode?: number): Promise; + } + /** + * Synchronously tests a user's permissions for the file or directory specified + * by `path`. The `mode` argument is an optional integer that specifies the + * accessibility checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and + * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for + * possible values of `mode`. + * + * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise, + * the method will return `undefined`. + * + * ```js + * import { accessSync, constants } from 'node:fs'; + * + * try { + * accessSync('etc/passwd', constants.R_OK | constants.W_OK); + * console.log('can read/write'); + * } catch (err) { + * console.error('no access!'); + * } + * ``` + * @since v0.11.15 + * @param [mode=fs.constants.F_OK] + */ + function accessSync(path: PathLike, mode?: number): void; + interface StreamOptions { + flags?: string | undefined; + encoding?: BufferEncoding | undefined; + fd?: number | FileHandle | undefined; + mode?: number | undefined; + autoClose?: boolean | undefined; + emitClose?: boolean | undefined; + start?: number | undefined; + signal?: AbortSignal | null | undefined; + highWaterMark?: number | undefined; + } + interface FSImplementation { + open?: (...args: any[]) => any; + close?: (...args: any[]) => any; + } + interface CreateReadStreamFSImplementation extends FSImplementation { + read: (...args: any[]) => any; + } + interface CreateWriteStreamFSImplementation extends FSImplementation { + write: (...args: any[]) => any; + writev?: (...args: any[]) => any; + } + interface ReadStreamOptions extends StreamOptions { + fs?: CreateReadStreamFSImplementation | null | undefined; + end?: number | undefined; + } + interface WriteStreamOptions extends StreamOptions { + fs?: CreateWriteStreamFSImplementation | null | undefined; + flush?: boolean | undefined; + } + /** + * `options` can include `start` and `end` values to read a range of bytes from + * the file instead of the entire file. Both `start` and `end` are inclusive and + * start counting at 0, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is + * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the + * current file position. The `encoding` can be any one of those accepted by `Buffer`. + * + * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use + * the specified file descriptor. This means that no `'open'` event will be + * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`. + * + * If `fd` points to a character device that only supports blocking reads + * (such as keyboard or sound card), read operations do not finish until data is + * available. This can prevent the process from exiting and the stream from + * closing naturally. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * + * By providing the `fs` option, it is possible to override the corresponding `fs` implementations for `open`, `read`, and `close`. When providing the `fs` option, + * an override for `read` is required. If no `fd` is provided, an override for `open` is also required. If `autoClose` is `true`, an override for `close` is + * also required. + * + * ```js + * import { createReadStream } from 'node:fs'; + * + * // Create a stream from some character device. + * const stream = createReadStream('/dev/input/event0'); + * setTimeout(() => { + * stream.close(); // This may not close the stream. + * // Artificially marking end-of-stream, as if the underlying resource had + * // indicated end-of-file by itself, allows the stream to close. + * // This does not cancel pending read operations, and if there is such an + * // operation, the process may still not be able to exit successfully + * // until it finishes. + * stream.push(null); + * stream.read(0); + * }, 100); + * ``` + * + * If `autoClose` is false, then the file descriptor won't be closed, even if + * there's an error. It is the application's responsibility to close it and make + * sure there's no file descriptor leak. If `autoClose` is set to true (default + * behavior), on `'error'` or `'end'` the file descriptor will be closed + * automatically. + * + * `mode` sets the file mode (permission and sticky bits), but only if the + * file was created. + * + * An example to read the last 10 bytes of a file which is 100 bytes long: + * + * ```js + * import { createReadStream } from 'node:fs'; + * + * createReadStream('sample.txt', { start: 90, end: 99 }); + * ``` + * + * If `options` is a string, then it specifies the encoding. + * @since v0.1.31 + */ + function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; + /** + * `options` may also include a `start` option to allow writing data at some + * position past the beginning of the file, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than + * replacing it may require the `flags` option to be set to `r+` rather than the + * default `w`. The `encoding` can be any one of those accepted by `Buffer`. + * + * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'` the file descriptor will be closed automatically. If `autoClose` is false, + * then the file descriptor won't be closed, even if there's an error. + * It is the application's responsibility to close it and make sure there's no + * file descriptor leak. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * + * By providing the `fs` option it is possible to override the corresponding `fs` implementations for `open`, `write`, `writev`, and `close`. Overriding `write()` without `writev()` can reduce + * performance as some optimizations (`_writev()`) + * will be disabled. When providing the `fs` option, overrides for at least one of `write` and `writev` are required. If no `fd` option is supplied, an override + * for `open` is also required. If `autoClose` is `true`, an override for `close` is also required. + * + * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the `path` argument and will use the specified file descriptor. This means that no `'open'` event will be + * emitted. `fd` should be blocking; non-blocking `fd`s + * should be passed to `net.Socket`. + * + * If `options` is a string, then it specifies the encoding. + * @since v0.1.31 + */ + function createWriteStream(path: PathLike, options?: BufferEncoding | WriteStreamOptions): WriteStream; + /** + * Forces all currently queued I/O operations associated with the file to the + * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other + * than a possible + * exception are given to the completion callback. + * @since v0.1.96 + */ + function fdatasync(fd: number, callback: NoParamCallback): void; + namespace fdatasync { + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + /** + * Forces all currently queued I/O operations associated with the file to the + * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. + * @since v0.1.96 + */ + function fdatasyncSync(fd: number): void; + /** + * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it + * already exists. No arguments other than a possible exception are given to the + * callback function. Node.js makes no guarantees about the atomicity of the copy + * operation. If an error occurs after the destination file has been opened for + * writing, Node.js will attempt to remove the destination. + * + * `mode` is an optional integer that specifies the behavior + * of the copy operation. It is possible to create a mask consisting of the bitwise + * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). + * + * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already + * exists. + * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a + * copy-on-write reflink. If the platform does not support copy-on-write, then a + * fallback copy mechanism is used. + * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to + * create a copy-on-write reflink. If the platform does not support + * copy-on-write, then the operation will fail. + * + * ```js + * import { copyFile, constants } from 'node:fs'; + * + * function callback(err) { + * if (err) throw err; + * console.log('source.txt was copied to destination.txt'); + * } + * + * // destination.txt will be created or overwritten by default. + * copyFile('source.txt', 'destination.txt', callback); + * + * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. + * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); + * ``` + * @since v8.5.0 + * @param src source filename to copy + * @param dest destination filename of the copy operation + * @param [mode=0] modifiers for copy operation. + */ + function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; + function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; + namespace copyFile { + function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; + } + /** + * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it + * already exists. Returns `undefined`. Node.js makes no guarantees about the + * atomicity of the copy operation. If an error occurs after the destination file + * has been opened for writing, Node.js will attempt to remove the destination. + * + * `mode` is an optional integer that specifies the behavior + * of the copy operation. It is possible to create a mask consisting of the bitwise + * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). + * + * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already + * exists. + * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a + * copy-on-write reflink. If the platform does not support copy-on-write, then a + * fallback copy mechanism is used. + * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to + * create a copy-on-write reflink. If the platform does not support + * copy-on-write, then the operation will fail. + * + * ```js + * import { copyFileSync, constants } from 'node:fs'; + * + * // destination.txt will be created or overwritten by default. + * copyFileSync('source.txt', 'destination.txt'); + * console.log('source.txt was copied to destination.txt'); + * + * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. + * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL); + * ``` + * @since v8.5.0 + * @param src source filename to copy + * @param dest destination filename of the copy operation + * @param [mode=0] modifiers for copy operation. + */ + function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; + /** + * Write an array of `ArrayBufferView`s to the file specified by `fd` using `writev()`. + * + * `position` is the offset from the beginning of the file where this data + * should be written. If `typeof position !== 'number'`, the data will be written + * at the current position. + * + * The callback will be given three arguments: `err`, `bytesWritten`, and `buffers`. `bytesWritten` is how many bytes were written from `buffers`. + * + * If this method is `util.promisify()` ed, it returns a promise for an `Object` with `bytesWritten` and `buffers` properties. + * + * It is unsafe to use `fs.writev()` multiple times on the same file without + * waiting for the callback. For this scenario, use {@link createWriteStream}. + * + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v12.9.0 + * @param [position='null'] + */ + function writev( + fd: number, + buffers: TBuffers, + cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: TBuffers) => void, + ): void; + function writev( + fd: number, + buffers: TBuffers, + position: number | null, + cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: TBuffers) => void, + ): void; + // Providing a default type parameter doesn't provide true BC for userland consumers, but at least suppresses TS2314 + // TODO: remove default in future major version + interface WriteVResult { + bytesWritten: number; + buffers: T; + } + namespace writev { + function __promisify__( + fd: number, + buffers: TBuffers, + position?: number, + ): Promise>; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link writev}. + * @since v12.9.0 + * @param [position='null'] + * @return The number of bytes written. + */ + function writevSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; + /** + * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s + * using `readv()`. + * + * `position` is the offset from the beginning of the file from where data + * should be read. If `typeof position !== 'number'`, the data will be read + * from the current position. + * + * The callback will be given three arguments: `err`, `bytesRead`, and `buffers`. `bytesRead` is how many bytes were read from the file. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a promise for an `Object` with `bytesRead` and `buffers` properties. + * @since v13.13.0, v12.17.0 + * @param [position='null'] + */ + function readv( + fd: number, + buffers: TBuffers, + cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: TBuffers) => void, + ): void; + function readv( + fd: number, + buffers: TBuffers, + position: number | null, + cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: TBuffers) => void, + ): void; + // Providing a default type parameter doesn't provide true BC for userland consumers, but at least suppresses TS2314 + // TODO: remove default in future major version + interface ReadVResult { + bytesRead: number; + buffers: T; + } + namespace readv { + function __promisify__( + fd: number, + buffers: TBuffers, + position?: number, + ): Promise>; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link readv}. + * @since v13.13.0, v12.17.0 + * @param [position='null'] + * @return The number of bytes read. + */ + function readvSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; + + interface OpenAsBlobOptions { + /** + * An optional mime type for the blob. + * + * @default 'undefined' + */ + type?: string | undefined; + } + + /** + * Returns a `Blob` whose data is backed by the given file. + * + * The file must not be modified after the `Blob` is created. Any modifications + * will cause reading the `Blob` data to fail with a `DOMException` error. + * Synchronous stat operations on the file when the `Blob` is created, and before + * each read in order to detect whether the file data has been modified on disk. + * + * ```js + * import { openAsBlob } from 'node:fs'; + * + * const blob = await openAsBlob('the.file.txt'); + * const ab = await blob.arrayBuffer(); + * blob.stream(); + * ``` + * @since v19.8.0 + */ + function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise; + + interface OpenDirOptions { + /** + * @default 'utf8' + */ + encoding?: BufferEncoding | undefined; + /** + * Number of directory entries that are buffered + * internally when reading from the directory. Higher values lead to better + * performance but higher memory usage. + * @default 32 + */ + bufferSize?: number | undefined; + /** + * @default false + */ + recursive?: boolean | undefined; + } + /** + * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html). + * + * Creates an `fs.Dir`, which contains all further functions for reading from + * and cleaning up the directory. + * + * The `encoding` option sets the encoding for the `path` while opening the + * directory and subsequent read operations. + * @since v12.12.0 + */ + function opendirSync(path: PathLike, options?: OpenDirOptions): Dir; + /** + * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for + * more details. + * + * Creates an `fs.Dir`, which contains all further functions for reading from + * and cleaning up the directory. + * + * The `encoding` option sets the encoding for the `path` while opening the + * directory and subsequent read operations. + * @since v12.12.0 + */ + function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; + function opendir( + path: PathLike, + options: OpenDirOptions, + cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void, + ): void; + namespace opendir { + function __promisify__(path: PathLike, options?: OpenDirOptions): Promise; + } + interface BigIntStats extends StatsBase { + atimeNs: bigint; + mtimeNs: bigint; + ctimeNs: bigint; + birthtimeNs: bigint; + } + interface BigIntOptions { + bigint: true; + } + interface StatOptions { + bigint?: boolean | undefined; + } + interface StatSyncOptions extends StatOptions { + throwIfNoEntry?: boolean | undefined; + } + interface CopyOptionsBase { + /** + * Dereference symlinks + * @default false + */ + dereference?: boolean | undefined; + /** + * When `force` is `false`, and the destination + * exists, throw an error. + * @default false + */ + errorOnExist?: boolean | undefined; + /** + * Overwrite existing file or directory. _The copy + * operation will ignore errors if you set this to false and the destination + * exists. Use the `errorOnExist` option to change this behavior. + * @default true + */ + force?: boolean | undefined; + /** + * Modifiers for copy operation. See `mode` flag of {@link copyFileSync()} + */ + mode?: number | undefined; + /** + * When `true` timestamps from `src` will + * be preserved. + * @default false + */ + preserveTimestamps?: boolean | undefined; + /** + * Copy directories recursively. + * @default false + */ + recursive?: boolean | undefined; + /** + * When true, path resolution for symlinks will be skipped + * @default false + */ + verbatimSymlinks?: boolean | undefined; + } + interface CopyOptions extends CopyOptionsBase { + /** + * Function to filter copied files/directories. Return + * `true` to copy the item, `false` to ignore it. + */ + filter?: ((source: string, destination: string) => boolean | Promise) | undefined; + } + interface CopySyncOptions extends CopyOptionsBase { + /** + * Function to filter copied files/directories. Return + * `true` to copy the item, `false` to ignore it. + */ + filter?: ((source: string, destination: string) => boolean) | undefined; + } + /** + * Asynchronously copies the entire directory structure from `src` to `dest`, + * including subdirectories and files. + * + * When copying a directory to another directory, globs are not supported and + * behavior is similar to `cp dir1/ dir2/`. + * @since v16.7.0 + * @experimental + * @param src source path to copy. + * @param dest destination path to copy to. + */ + function cp( + source: string | URL, + destination: string | URL, + callback: (err: NodeJS.ErrnoException | null) => void, + ): void; + function cp( + source: string | URL, + destination: string | URL, + opts: CopyOptions, + callback: (err: NodeJS.ErrnoException | null) => void, + ): void; + /** + * Synchronously copies the entire directory structure from `src` to `dest`, + * including subdirectories and files. + * + * When copying a directory to another directory, globs are not supported and + * behavior is similar to `cp dir1/ dir2/`. + * @since v16.7.0 + * @experimental + * @param src source path to copy. + * @param dest destination path to copy to. + */ + function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void; + + // TODO: collapse + interface _GlobOptions { + /** + * Current working directory. + * @default process.cwd() + */ + cwd?: string | URL | undefined; + /** + * `true` if the glob should return paths as `Dirent`s, `false` otherwise. + * @default false + * @since v22.2.0 + */ + withFileTypes?: boolean | undefined; + /** + * Function to filter out files/directories or a + * list of glob patterns to be excluded. If a function is provided, return + * `true` to exclude the item, `false` to include it. + * If a string array is provided, each string should be a glob pattern that + * specifies paths to exclude. Note: Negation patterns (e.g., '!foo.js') are + * not supported. + * @default undefined + */ + exclude?: ((fileName: T) => boolean) | readonly string[] | undefined; + } + interface GlobOptions extends _GlobOptions {} + interface GlobOptionsWithFileTypes extends _GlobOptions { + withFileTypes: true; + } + interface GlobOptionsWithoutFileTypes extends _GlobOptions { + withFileTypes?: false | undefined; + } + + /** + * Retrieves the files matching the specified pattern. + * + * ```js + * import { glob } from 'node:fs'; + * + * glob('*.js', (err, matches) => { + * if (err) throw err; + * console.log(matches); + * }); + * ``` + * @since v22.0.0 + */ + function glob( + pattern: string | readonly string[], + callback: (err: NodeJS.ErrnoException | null, matches: string[]) => void, + ): void; + function glob( + pattern: string | readonly string[], + options: GlobOptionsWithFileTypes, + callback: ( + err: NodeJS.ErrnoException | null, + matches: Dirent[], + ) => void, + ): void; + function glob( + pattern: string | readonly string[], + options: GlobOptionsWithoutFileTypes, + callback: ( + err: NodeJS.ErrnoException | null, + matches: string[], + ) => void, + ): void; + function glob( + pattern: string | readonly string[], + options: GlobOptions, + callback: ( + err: NodeJS.ErrnoException | null, + matches: Dirent[] | string[], + ) => void, + ): void; + /** + * ```js + * import { globSync } from 'node:fs'; + * + * console.log(globSync('*.js')); + * ``` + * @since v22.0.0 + * @returns paths of files that match the pattern. + */ + function globSync(pattern: string | readonly string[]): string[]; + function globSync( + pattern: string | readonly string[], + options: GlobOptionsWithFileTypes, + ): Dirent[]; + function globSync( + pattern: string | readonly string[], + options: GlobOptionsWithoutFileTypes, + ): string[]; + function globSync( + pattern: string | readonly string[], + options: GlobOptions, + ): Dirent[] | string[]; +} +declare module "node:fs" { + export * as promises from "node:fs/promises"; +} +declare module "fs" { + export * from "node:fs"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/fs/promises.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/fs/promises.d.ts new file mode 100644 index 0000000..e4d249d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/fs/promises.d.ts @@ -0,0 +1,1329 @@ +/** + * The `fs/promises` API provides asynchronous file system methods that return + * promises. + * + * The promise APIs use the underlying Node.js threadpool to perform file + * system operations off the event loop thread. These operations are not + * synchronized or threadsafe. Care must be taken when performing multiple + * concurrent modifications on the same file or data corruption may occur. + * @since v10.0.0 + */ +declare module "node:fs/promises" { + import { NonSharedBuffer } from "node:buffer"; + import { Abortable } from "node:events"; + import { Interface as ReadlineInterface } from "node:readline"; + import { + BigIntStats, + BigIntStatsFs, + BufferEncodingOption, + constants as fsConstants, + CopyOptions, + Dir, + Dirent, + EncodingOption, + GlobOptions, + GlobOptionsWithFileTypes, + GlobOptionsWithoutFileTypes, + MakeDirectoryOptions, + Mode, + ObjectEncodingOptions, + OpenDirOptions, + OpenMode, + PathLike, + ReadOptions, + ReadOptionsWithBuffer, + ReadPosition, + ReadStream, + ReadVResult, + RmOptions, + StatFsOptions, + StatOptions, + Stats, + StatsFs, + TimeLike, + WatchEventType, + WatchOptions as _WatchOptions, + WriteStream, + WriteVResult, + } from "node:fs"; + import { Stream } from "node:stream"; + import { ReadableStream } from "node:stream/web"; + interface FileChangeInfo { + eventType: WatchEventType; + filename: T | null; + } + interface FlagAndOpenMode { + mode?: Mode | undefined; + flag?: OpenMode | undefined; + } + interface FileReadResult { + bytesRead: number; + buffer: T; + } + /** @deprecated This interface will be removed in a future version. Use `import { ReadOptionsWithBuffer } from "node:fs"` instead. */ + interface FileReadOptions { + /** + * @default `Buffer.alloc(0xffff)` + */ + buffer?: T; + /** + * @default 0 + */ + offset?: number | null; + /** + * @default `buffer.byteLength` + */ + length?: number | null; + position?: ReadPosition | null; + } + interface CreateReadStreamOptions extends Abortable { + encoding?: BufferEncoding | null | undefined; + autoClose?: boolean | undefined; + emitClose?: boolean | undefined; + start?: number | undefined; + end?: number | undefined; + highWaterMark?: number | undefined; + } + interface CreateWriteStreamOptions { + encoding?: BufferEncoding | null | undefined; + autoClose?: boolean | undefined; + emitClose?: boolean | undefined; + start?: number | undefined; + highWaterMark?: number | undefined; + flush?: boolean | undefined; + } + interface ReadableWebStreamOptions { + autoClose?: boolean | undefined; + } + // TODO: Add `EventEmitter` close + interface FileHandle { + /** + * The numeric file descriptor managed by the {FileHandle} object. + * @since v10.0.0 + */ + readonly fd: number; + /** + * Alias of `filehandle.writeFile()`. + * + * When operating on file handles, the mode cannot be changed from what it was set + * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + appendFile( + data: string | Uint8Array, + options?: + | (ObjectEncodingOptions & Abortable) + | BufferEncoding + | null, + ): Promise; + /** + * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). + * @since v10.0.0 + * @param uid The file's new owner's user id. + * @param gid The file's new group's group id. + * @return Fulfills with `undefined` upon success. + */ + chown(uid: number, gid: number): Promise; + /** + * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html). + * @since v10.0.0 + * @param mode the file mode bit mask. + * @return Fulfills with `undefined` upon success. + */ + chmod(mode: Mode): Promise; + /** + * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream + * returned by this method has a default `highWaterMark` of 64 KiB. + * + * `options` can include `start` and `end` values to read a range of bytes from + * the file instead of the entire file. Both `start` and `end` are inclusive and + * start counting at 0, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is + * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from + * the current file position. The `encoding` can be any one of those accepted by `Buffer`. + * + * If the `FileHandle` points to a character device that only supports blocking + * reads (such as keyboard or sound card), read operations do not finish until data + * is available. This can prevent the process from exiting and the stream from + * closing naturally. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * + * ```js + * import { open } from 'node:fs/promises'; + * + * const fd = await open('/dev/input/event0'); + * // Create a stream from some character device. + * const stream = fd.createReadStream(); + * setTimeout(() => { + * stream.close(); // This may not close the stream. + * // Artificially marking end-of-stream, as if the underlying resource had + * // indicated end-of-file by itself, allows the stream to close. + * // This does not cancel pending read operations, and if there is such an + * // operation, the process may still not be able to exit successfully + * // until it finishes. + * stream.push(null); + * stream.read(0); + * }, 100); + * ``` + * + * If `autoClose` is false, then the file descriptor won't be closed, even if + * there's an error. It is the application's responsibility to close it and make + * sure there's no file descriptor leak. If `autoClose` is set to true (default + * behavior), on `'error'` or `'end'` the file descriptor will be closed + * automatically. + * + * An example to read the last 10 bytes of a file which is 100 bytes long: + * + * ```js + * import { open } from 'node:fs/promises'; + * + * const fd = await open('sample.txt'); + * fd.createReadStream({ start: 90, end: 99 }); + * ``` + * @since v16.11.0 + */ + createReadStream(options?: CreateReadStreamOptions): ReadStream; + /** + * `options` may also include a `start` option to allow writing data at some + * position past the beginning of the file, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than + * replacing it may require the `flags` `open` option to be set to `r+` rather than + * the default `r`. The `encoding` can be any one of those accepted by `Buffer`. + * + * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'` the file descriptor will be closed automatically. If `autoClose` is false, + * then the file descriptor won't be closed, even if there's an error. + * It is the application's responsibility to close it and make sure there's no + * file descriptor leak. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * @since v16.11.0 + */ + createWriteStream(options?: CreateWriteStreamOptions): WriteStream; + /** + * Forces all currently queued I/O operations associated with the file to the + * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. + * + * Unlike `filehandle.sync` this method does not flush modified metadata. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + datasync(): Promise; + /** + * Request that all data for the open file descriptor is flushed to the storage + * device. The specific implementation is operating system and device specific. + * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + sync(): Promise; + /** + * Reads data from the file and stores that in the given buffer. + * + * If the file is not modified concurrently, the end-of-file is reached when the + * number of bytes read is zero. + * @since v10.0.0 + * @param buffer A buffer that will be filled with the file data read. + * @param offset The location in the buffer at which to start filling. + * @param length The number of bytes to read. + * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an + * integer, the current file position will remain unchanged. + * @return Fulfills upon success with an object with two properties: + */ + read( + buffer: T, + offset?: number | null, + length?: number | null, + position?: ReadPosition | null, + ): Promise>; + read( + buffer: T, + options?: ReadOptions, + ): Promise>; + read( + options?: ReadOptionsWithBuffer, + ): Promise>; + /** + * Returns a byte-oriented `ReadableStream` that may be used to read the file's + * contents. + * + * An error will be thrown if this method is called more than once or is called + * after the `FileHandle` is closed or closing. + * + * ```js + * import { + * open, + * } from 'node:fs/promises'; + * + * const file = await open('./some/file/to/read'); + * + * for await (const chunk of file.readableWebStream()) + * console.log(chunk); + * + * await file.close(); + * ``` + * + * While the `ReadableStream` will read the file to completion, it will not + * close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method. + * @since v17.0.0 + */ + readableWebStream(options?: ReadableWebStreamOptions): ReadableStream; + /** + * Asynchronously reads the entire contents of a file. + * + * If `options` is a string, then it specifies the `encoding`. + * + * The `FileHandle` has to support reading. + * + * If one or more `filehandle.read()` calls are made on a file handle and then a `filehandle.readFile()` call is made, the data will be read from the current + * position till the end of the file. It doesn't always read from the beginning + * of the file. + * @since v10.0.0 + * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the + * data will be a string. + */ + readFile( + options?: + | ({ encoding?: null | undefined } & Abortable) + | null, + ): Promise; + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + */ + readFile( + options: + | ({ encoding: BufferEncoding } & Abortable) + | BufferEncoding, + ): Promise; + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + */ + readFile( + options?: + | (ObjectEncodingOptions & Abortable) + | BufferEncoding + | null, + ): Promise; + /** + * Convenience method to create a `readline` interface and stream over the file. + * See `filehandle.createReadStream()` for the options. + * + * ```js + * import { open } from 'node:fs/promises'; + * + * const file = await open('./some/file/to/read'); + * + * for await (const line of file.readLines()) { + * console.log(line); + * } + * ``` + * @since v18.11.0 + */ + readLines(options?: CreateReadStreamOptions): ReadlineInterface; + /** + * @since v10.0.0 + * @return Fulfills with an {fs.Stats} for the file. + */ + stat( + opts?: StatOptions & { + bigint?: false | undefined; + }, + ): Promise; + stat( + opts: StatOptions & { + bigint: true; + }, + ): Promise; + stat(opts?: StatOptions): Promise; + /** + * Truncates the file. + * + * If the file was larger than `len` bytes, only the first `len` bytes will be + * retained in the file. + * + * The following example retains only the first four bytes of the file: + * + * ```js + * import { open } from 'node:fs/promises'; + * + * let filehandle = null; + * try { + * filehandle = await open('temp.txt', 'r+'); + * await filehandle.truncate(4); + * } finally { + * await filehandle?.close(); + * } + * ``` + * + * If the file previously was shorter than `len` bytes, it is extended, and the + * extended part is filled with null bytes (`'\0'`): + * + * If `len` is negative then `0` will be used. + * @since v10.0.0 + * @param [len=0] + * @return Fulfills with `undefined` upon success. + */ + truncate(len?: number): Promise; + /** + * Change the file system timestamps of the object referenced by the `FileHandle` then fulfills the promise with no arguments upon success. + * @since v10.0.0 + */ + utimes(atime: TimeLike, mtime: TimeLike): Promise; + /** + * Asynchronously writes data to a file, replacing the file if it already exists. `data` can be a string, a buffer, an + * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an + * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. + * The promise is fulfilled with no arguments upon success. + * + * If `options` is a string, then it specifies the `encoding`. + * + * The `FileHandle` has to support writing. + * + * It is unsafe to use `filehandle.writeFile()` multiple times on the same file + * without waiting for the promise to be fulfilled (or rejected). + * + * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the + * current position till the end of the file. It doesn't always write from the + * beginning of the file. + * @since v10.0.0 + */ + writeFile( + data: string | Uint8Array, + options?: + | (ObjectEncodingOptions & Abortable) + | BufferEncoding + | null, + ): Promise; + /** + * Write `buffer` to the file. + * + * The promise is fulfilled with an object containing two properties: + * + * It is unsafe to use `filehandle.write()` multiple times on the same file + * without waiting for the promise to be fulfilled (or rejected). For this + * scenario, use `filehandle.createWriteStream()`. + * + * On Linux, positional writes do not work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v10.0.0 + * @param offset The start position from within `buffer` where the data to write begins. + * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write. + * @param [position='null'] The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current + * position. See the POSIX pwrite(2) documentation for more detail. + */ + write( + buffer: TBuffer, + offset?: number | null, + length?: number | null, + position?: number | null, + ): Promise<{ + bytesWritten: number; + buffer: TBuffer; + }>; + write( + buffer: TBuffer, + options?: { offset?: number; length?: number; position?: number }, + ): Promise<{ + bytesWritten: number; + buffer: TBuffer; + }>; + write( + data: string, + position?: number | null, + encoding?: BufferEncoding | null, + ): Promise<{ + bytesWritten: number; + buffer: string; + }>; + /** + * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file. + * + * The promise is fulfilled with an object containing a two properties: + * + * It is unsafe to call `writev()` multiple times on the same file without waiting + * for the promise to be fulfilled (or rejected). + * + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v12.9.0 + * @param [position='null'] The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current + * position. + */ + writev( + buffers: TBuffers, + position?: number, + ): Promise>; + /** + * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s + * @since v13.13.0, v12.17.0 + * @param [position='null'] The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. + * @return Fulfills upon success an object containing two properties: + */ + readv( + buffers: TBuffers, + position?: number, + ): Promise>; + /** + * Closes the file handle after waiting for any pending operation on the handle to + * complete. + * + * ```js + * import { open } from 'node:fs/promises'; + * + * let filehandle; + * try { + * filehandle = await open('thefile.txt', 'r'); + * } finally { + * await filehandle?.close(); + * } + * ``` + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + close(): Promise; + /** + * Calls `filehandle.close()` and returns a promise that fulfills when the + * filehandle is closed. + * @since v20.4.0, v18.8.0 + */ + [Symbol.asyncDispose](): Promise; + } + const constants: typeof fsConstants; + /** + * Tests a user's permissions for the file or directory specified by `path`. + * The `mode` argument is an optional integer that specifies the accessibility + * checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and `fs.constants.X_OK` + * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for + * possible values of `mode`. + * + * If the accessibility check is successful, the promise is fulfilled with no + * value. If any of the accessibility checks fail, the promise is rejected + * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and + * written by the current process. + * + * ```js + * import { access, constants } from 'node:fs/promises'; + * + * try { + * await access('/etc/passwd', constants.R_OK | constants.W_OK); + * console.log('can access'); + * } catch { + * console.error('cannot access'); + * } + * ``` + * + * Using `fsPromises.access()` to check for the accessibility of a file before + * calling `fsPromises.open()` is not recommended. Doing so introduces a race + * condition, since other processes may change the file's state between the two + * calls. Instead, user code should open/read/write the file directly and handle + * the error raised if the file is not accessible. + * @since v10.0.0 + * @param [mode=fs.constants.F_OK] + * @return Fulfills with `undefined` upon success. + */ + function access(path: PathLike, mode?: number): Promise; + /** + * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it + * already exists. + * + * No guarantees are made about the atomicity of the copy operation. If an + * error occurs after the destination file has been opened for writing, an attempt + * will be made to remove the destination. + * + * ```js + * import { copyFile, constants } from 'node:fs/promises'; + * + * try { + * await copyFile('source.txt', 'destination.txt'); + * console.log('source.txt was copied to destination.txt'); + * } catch { + * console.error('The file could not be copied'); + * } + * + * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. + * try { + * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL); + * console.log('source.txt was copied to destination.txt'); + * } catch { + * console.error('The file could not be copied'); + * } + * ``` + * @since v10.0.0 + * @param src source filename to copy + * @param dest destination filename of the copy operation + * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. + * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) + * @return Fulfills with `undefined` upon success. + */ + function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise; + /** + * Opens a `FileHandle`. + * + * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail. + * + * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented + * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains + * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). + * @since v10.0.0 + * @param [flags='r'] See `support of file system `flags``. + * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created. + * @return Fulfills with a {FileHandle} object. + */ + function open(path: PathLike, flags?: string | number, mode?: Mode): Promise; + /** + * Renames `oldPath` to `newPath`. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function rename(oldPath: PathLike, newPath: PathLike): Promise; + /** + * Truncates (shortens or extends the length) of the content at `path` to `len` bytes. + * @since v10.0.0 + * @param [len=0] + * @return Fulfills with `undefined` upon success. + */ + function truncate(path: PathLike, len?: number): Promise; + /** + * Removes the directory identified by `path`. + * + * Using `fsPromises.rmdir()` on a file (not a directory) results in the + * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. + * + * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function rmdir(path: PathLike): Promise; + /** + * Removes files and directories (modeled on the standard POSIX `rm` utility). + * @since v14.14.0 + * @return Fulfills with `undefined` upon success. + */ + function rm(path: PathLike, options?: RmOptions): Promise; + /** + * Asynchronously creates a directory. + * + * The optional `options` argument can be an integer specifying `mode` (permission + * and sticky bits), or an object with a `mode` property and a `recursive` property indicating whether parent directories should be created. Calling `fsPromises.mkdir()` when `path` is a directory + * that exists results in a + * rejection only when `recursive` is false. + * + * ```js + * import { mkdir } from 'node:fs/promises'; + * + * try { + * const projectFolder = new URL('./test/project/', import.meta.url); + * const createDir = await mkdir(projectFolder, { recursive: true }); + * + * console.log(`created ${createDir}`); + * } catch (err) { + * console.error(err.message); + * } + * ``` + * @since v10.0.0 + * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. + */ + function mkdir( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + }, + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir( + path: PathLike, + options?: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null, + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; + /** + * Reads the contents of a directory. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned + * will be passed as `Buffer` objects. + * + * If `options.withFileTypes` is set to `true`, the returned array will contain `fs.Dirent` objects. + * + * ```js + * import { readdir } from 'node:fs/promises'; + * + * try { + * const files = await readdir(path); + * for (const file of files) + * console.log(file); + * } catch (err) { + * console.error(err); + * } + * ``` + * @since v10.0.0 + * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. + */ + function readdir( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | null, + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir( + path: PathLike, + options: + | { + encoding: "buffer"; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | "buffer", + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | null, + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + function readdir( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean | undefined; + }, + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a directory. If a URL is provided, it must use the `file:` protocol. + * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`. + */ + function readdir( + path: PathLike, + options: { + encoding: "buffer"; + withFileTypes: true; + recursive?: boolean | undefined; + }, + ): Promise[]>; + /** + * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is + * fulfilled with the`linkString` upon success. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the link path returned. If the `encoding` is set to `'buffer'`, the link path + * returned will be passed as a `Buffer` object. + * @since v10.0.0 + * @return Fulfills with the `linkString` upon success. + */ + function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink( + path: PathLike, + options?: ObjectEncodingOptions | string | null, + ): Promise; + /** + * Creates a symbolic link. + * + * The `type` argument is only used on Windows platforms and can be one of `'dir'`, `'file'`, or `'junction'`. If the `type` argument is not a string, Node.js will + * autodetect `target` type and use `'file'` or `'dir'`. If the `target` does not + * exist, `'file'` will be used. Windows junction points require the destination + * path to be absolute. When using `'junction'`, the `target` argument will + * automatically be normalized to absolute path. Junction points on NTFS volumes + * can only point to directories. + * @since v10.0.0 + * @param [type='null'] + * @return Fulfills with `undefined` upon success. + */ + function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; + /** + * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link, + * in which case the link itself is stat-ed, not the file that it refers to. + * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail. + * @since v10.0.0 + * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`. + */ + function lstat( + path: PathLike, + opts?: StatOptions & { + bigint?: false | undefined; + }, + ): Promise; + function lstat( + path: PathLike, + opts: StatOptions & { + bigint: true; + }, + ): Promise; + function lstat(path: PathLike, opts?: StatOptions): Promise; + /** + * @since v10.0.0 + * @return Fulfills with the {fs.Stats} object for the given `path`. + */ + function stat( + path: PathLike, + opts?: StatOptions & { + bigint?: false | undefined; + }, + ): Promise; + function stat( + path: PathLike, + opts: StatOptions & { + bigint: true; + }, + ): Promise; + function stat(path: PathLike, opts?: StatOptions): Promise; + /** + * @since v19.6.0, v18.15.0 + * @return Fulfills with the {fs.StatFs} object for the given `path`. + */ + function statfs( + path: PathLike, + opts?: StatFsOptions & { + bigint?: false | undefined; + }, + ): Promise; + function statfs( + path: PathLike, + opts: StatFsOptions & { + bigint: true; + }, + ): Promise; + function statfs(path: PathLike, opts?: StatFsOptions): Promise; + /** + * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function link(existingPath: PathLike, newPath: PathLike): Promise; + /** + * If `path` refers to a symbolic link, then the link is removed without affecting + * the file or directory to which that link refers. If the `path` refers to a file + * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function unlink(path: PathLike): Promise; + /** + * Changes the permissions of a file. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function chmod(path: PathLike, mode: Mode): Promise; + /** + * Changes the permissions on a symbolic link. + * + * This method is only implemented on macOS. + * @deprecated Since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function lchmod(path: PathLike, mode: Mode): Promise; + /** + * Changes the ownership on a symbolic link. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function lchown(path: PathLike, uid: number, gid: number): Promise; + /** + * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a + * symbolic link, then the link is not dereferenced: instead, the timestamps of + * the symbolic link itself are changed. + * @since v14.5.0, v12.19.0 + * @return Fulfills with `undefined` upon success. + */ + function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + /** + * Changes the ownership of a file. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function chown(path: PathLike, uid: number, gid: number): Promise; + /** + * Change the file system timestamps of the object referenced by `path`. + * + * The `atime` and `mtime` arguments follow these rules: + * + * * Values can be either numbers representing Unix epoch time, `Date`s, or a + * numeric string like `'123456789.0'`. + * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or `-Infinity`, an `Error` will be thrown. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + /** + * Determines the actual location of `path` using the same semantics as the `fs.realpath.native()` function. + * + * Only paths that can be converted to UTF8 strings are supported. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the path. If the `encoding` is set to `'buffer'`, the path returned will be + * passed as a `Buffer` object. + * + * On Linux, when Node.js is linked against musl libc, the procfs file system must + * be mounted on `/proc` in order for this function to work. Glibc does not have + * this restriction. + * @since v10.0.0 + * @return Fulfills with the resolved path upon success. + */ + function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath( + path: PathLike, + options?: ObjectEncodingOptions | BufferEncoding | null, + ): Promise; + /** + * Creates a unique temporary directory. A unique directory name is generated by + * appending six random characters to the end of the provided `prefix`. Due to + * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some + * platforms, notably the BSDs, can return more than six random characters, and + * replace trailing `X` characters in `prefix` with random characters. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * + * ```js + * import { mkdtemp } from 'node:fs/promises'; + * import { join } from 'node:path'; + * import { tmpdir } from 'node:os'; + * + * try { + * await mkdtemp(join(tmpdir(), 'foo-')); + * } catch (err) { + * console.error(err); + * } + * ``` + * + * The `fsPromises.mkdtemp()` method will append the six randomly selected + * characters directly to the `prefix` string. For instance, given a directory `/tmp`, if the intention is to create a temporary directory _within_ `/tmp`, the `prefix` must end with a trailing + * platform-specific path separator + * (`import { sep } from 'node:path'`). + * @since v10.0.0 + * @return Fulfills with a string containing the file system path of the newly created temporary directory. + */ + function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options: BufferEncodingOption): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp( + prefix: string, + options?: ObjectEncodingOptions | BufferEncoding | null, + ): Promise; + interface DisposableTempDir extends AsyncDisposable { + /** + * The path of the created directory. + */ + path: string; + /** + * A function which removes the created directory. + */ + remove(): Promise; + /** + * The same as `remove`. + */ + [Symbol.asyncDispose](): Promise; + } + /** + * The resulting Promise holds an async-disposable object whose `path` property + * holds the created directory path. When the object is disposed, the directory + * and its contents will be removed asynchronously if it still exists. If the + * directory cannot be deleted, disposal will throw an error. The object has an + * async `remove()` method which will perform the same task. + * + * Both this function and the disposal function on the resulting object are + * async, so it should be used with `await` + `await using` as in + * `await using dir = await fsPromises.mkdtempDisposable('prefix')`. + * + * + * + * For detailed information, see the documentation of `fsPromises.mkdtemp()`. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * @since v24.4.0 + */ + function mkdtempDisposable(prefix: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronously writes data to a file, replacing the file if it already exists. `data` can be a string, a buffer, an + * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an + * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. + * + * The `encoding` option is ignored if `data` is a buffer. + * + * If `options` is a string, then it specifies the encoding. + * + * The `mode` option only affects the newly created file. See `fs.open()` for more details. + * + * Any specified `FileHandle` has to support writing. + * + * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file + * without waiting for the promise to be settled. + * + * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience + * method that performs multiple `write` calls internally to write the buffer + * passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`. + * + * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`. + * Cancelation is "best effort", and some amount of data is likely still + * to be written. + * + * ```js + * import { writeFile } from 'node:fs/promises'; + * import { Buffer } from 'node:buffer'; + * + * try { + * const controller = new AbortController(); + * const { signal } = controller; + * const data = new Uint8Array(Buffer.from('Hello Node.js')); + * const promise = writeFile('message.txt', data, { signal }); + * + * // Abort the request before the promise settles. + * controller.abort(); + * + * await promise; + * } catch (err) { + * // When a request is aborted - err is an AbortError + * console.error(err); + * } + * ``` + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.writeFile` performs. + * @since v10.0.0 + * @param file filename or `FileHandle` + * @return Fulfills with `undefined` upon success. + */ + function writeFile( + file: PathLike | FileHandle, + data: + | string + | NodeJS.ArrayBufferView + | Iterable + | AsyncIterable + | Stream, + options?: + | (ObjectEncodingOptions & { + mode?: Mode | undefined; + flag?: OpenMode | undefined; + /** + * If all data is successfully written to the file, and `flush` + * is `true`, `filehandle.sync()` is used to flush the data. + * @default false + */ + flush?: boolean | undefined; + } & Abortable) + | BufferEncoding + | null, + ): Promise; + /** + * Asynchronously append data to a file, creating the file if it does not yet + * exist. `data` can be a string or a `Buffer`. + * + * If `options` is a string, then it specifies the `encoding`. + * + * The `mode` option only affects the newly created file. See `fs.open()` for more details. + * + * The `path` may be specified as a `FileHandle` that has been opened + * for appending (using `fsPromises.open()`). + * @since v10.0.0 + * @param path filename or {FileHandle} + * @return Fulfills with `undefined` upon success. + */ + function appendFile( + path: PathLike | FileHandle, + data: string | Uint8Array, + options?: (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined }) | BufferEncoding | null, + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * + * If no encoding is specified (using `options.encoding`), the data is returned + * as a `Buffer` object. Otherwise, the data will be a string. + * + * If `options` is a string, then it specifies the encoding. + * + * When the `path` is a directory, the behavior of `fsPromises.readFile()` is + * platform-specific. On macOS, Linux, and Windows, the promise will be rejected + * with an error. On FreeBSD, a representation of the directory's contents will be + * returned. + * + * An example of reading a `package.json` file located in the same directory of the + * running code: + * + * ```js + * import { readFile } from 'node:fs/promises'; + * try { + * const filePath = new URL('./package.json', import.meta.url); + * const contents = await readFile(filePath, { encoding: 'utf8' }); + * console.log(contents); + * } catch (err) { + * console.error(err.message); + * } + * ``` + * + * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a + * request is aborted the promise returned is rejected with an `AbortError`: + * + * ```js + * import { readFile } from 'node:fs/promises'; + * + * try { + * const controller = new AbortController(); + * const { signal } = controller; + * const promise = readFile(fileName, { signal }); + * + * // Abort the request before the promise settles. + * controller.abort(); + * + * await promise; + * } catch (err) { + * // When a request is aborted - err is an AbortError + * console.error(err); + * } + * ``` + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.readFile` performs. + * + * Any specified `FileHandle` has to support reading. + * @since v10.0.0 + * @param path filename or `FileHandle` + * @return Fulfills with the contents of the file. + */ + function readFile( + path: PathLike | FileHandle, + options?: + | ({ + encoding?: null | undefined; + flag?: OpenMode | undefined; + } & Abortable) + | null, + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile( + path: PathLike | FileHandle, + options: + | ({ + encoding: BufferEncoding; + flag?: OpenMode | undefined; + } & Abortable) + | BufferEncoding, + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile( + path: PathLike | FileHandle, + options?: + | ( + & ObjectEncodingOptions + & Abortable + & { + flag?: OpenMode | undefined; + } + ) + | BufferEncoding + | null, + ): Promise; + /** + * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail. + * + * Creates an `fs.Dir`, which contains all further functions for reading from + * and cleaning up the directory. + * + * The `encoding` option sets the encoding for the `path` while opening the + * directory and subsequent read operations. + * + * Example using async iteration: + * + * ```js + * import { opendir } from 'node:fs/promises'; + * + * try { + * const dir = await opendir('./'); + * for await (const dirent of dir) + * console.log(dirent.name); + * } catch (err) { + * console.error(err); + * } + * ``` + * + * When using the async iterator, the `fs.Dir` object will be automatically + * closed after the iterator exits. + * @since v12.12.0 + * @return Fulfills with an {fs.Dir}. + */ + function opendir(path: PathLike, options?: OpenDirOptions): Promise; + interface WatchOptions extends _WatchOptions { + maxQueue?: number | undefined; + overflow?: "ignore" | "throw" | undefined; + } + interface WatchOptionsWithBufferEncoding extends WatchOptions { + encoding: "buffer"; + } + interface WatchOptionsWithStringEncoding extends WatchOptions { + encoding?: BufferEncoding | undefined; + } + /** + * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory. + * + * ```js + * import { watch } from 'node:fs/promises'; + * + * const ac = new AbortController(); + * const { signal } = ac; + * setTimeout(() => ac.abort(), 10000); + * + * (async () => { + * try { + * const watcher = watch(__filename, { signal }); + * for await (const event of watcher) + * console.log(event); + * } catch (err) { + * if (err.name === 'AbortError') + * return; + * throw err; + * } + * })(); + * ``` + * + * On most platforms, `'rename'` is emitted whenever a filename appears or + * disappears in the directory. + * + * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`. + * @since v15.9.0, v14.18.0 + * @return of objects with the properties: + */ + function watch( + filename: PathLike, + options?: WatchOptionsWithStringEncoding | BufferEncoding, + ): NodeJS.AsyncIterator>; + function watch( + filename: PathLike, + options: WatchOptionsWithBufferEncoding | "buffer", + ): NodeJS.AsyncIterator>; + function watch( + filename: PathLike, + options: WatchOptions | BufferEncoding | "buffer", + ): NodeJS.AsyncIterator>; + /** + * Asynchronously copies the entire directory structure from `src` to `dest`, + * including subdirectories and files. + * + * When copying a directory to another directory, globs are not supported and + * behavior is similar to `cp dir1/ dir2/`. + * @since v16.7.0 + * @experimental + * @param src source path to copy. + * @param dest destination path to copy to. + * @return Fulfills with `undefined` upon success. + */ + function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise; + /** + * ```js + * import { glob } from 'node:fs/promises'; + * + * for await (const entry of glob('*.js')) + * console.log(entry); + * ``` + * @since v22.0.0 + * @returns An AsyncIterator that yields the paths of files + * that match the pattern. + */ + function glob(pattern: string | readonly string[]): NodeJS.AsyncIterator; + function glob( + pattern: string | readonly string[], + options: GlobOptionsWithFileTypes, + ): NodeJS.AsyncIterator; + function glob( + pattern: string | readonly string[], + options: GlobOptionsWithoutFileTypes, + ): NodeJS.AsyncIterator; + function glob( + pattern: string | readonly string[], + options: GlobOptions, + ): NodeJS.AsyncIterator; +} +declare module "fs/promises" { + export * from "node:fs/promises"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/globals.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/globals.d.ts new file mode 100644 index 0000000..36e7f90 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/globals.d.ts @@ -0,0 +1,150 @@ +declare var global: typeof globalThis; + +declare var process: NodeJS.Process; + +interface ErrorConstructor { + /** + * Creates a `.stack` property on `targetObject`, which when accessed returns + * a string representing the location in the code at which + * `Error.captureStackTrace()` was called. + * + * ```js + * const myObject = {}; + * Error.captureStackTrace(myObject); + * myObject.stack; // Similar to `new Error().stack` + * ``` + * + * The first line of the trace will be prefixed with + * `${myObject.name}: ${myObject.message}`. + * + * The optional `constructorOpt` argument accepts a function. If given, all frames + * above `constructorOpt`, including `constructorOpt`, will be omitted from the + * generated stack trace. + * + * The `constructorOpt` argument is useful for hiding implementation + * details of error generation from the user. For instance: + * + * ```js + * function a() { + * b(); + * } + * + * function b() { + * c(); + * } + * + * function c() { + * // Create an error without stack trace to avoid calculating the stack trace twice. + * const { stackTraceLimit } = Error; + * Error.stackTraceLimit = 0; + * const error = new Error(); + * Error.stackTraceLimit = stackTraceLimit; + * + * // Capture the stack trace above function b + * Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace + * throw error; + * } + * + * a(); + * ``` + */ + captureStackTrace(targetObject: object, constructorOpt?: Function): void; + /** + * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces + */ + prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; + /** + * The `Error.stackTraceLimit` property specifies the number of stack frames + * collected by a stack trace (whether generated by `new Error().stack` or + * `Error.captureStackTrace(obj)`). + * + * The default value is `10` but may be set to any valid JavaScript number. Changes + * will affect any stack trace captured _after_ the value has been changed. + * + * If set to a non-number value, or set to a negative number, stack traces will + * not capture any frames. + */ + stackTraceLimit: number; +} + +/** + * Enable this API with the `--expose-gc` CLI flag. + */ +declare var gc: NodeJS.GCFunction | undefined; + +declare namespace NodeJS { + interface CallSite { + getColumnNumber(): number | null; + getEnclosingColumnNumber(): number | null; + getEnclosingLineNumber(): number | null; + getEvalOrigin(): string | undefined; + getFileName(): string | null; + getFunction(): Function | undefined; + getFunctionName(): string | null; + getLineNumber(): number | null; + getMethodName(): string | null; + getPosition(): number; + getPromiseIndex(): number | null; + getScriptHash(): string; + getScriptNameOrSourceURL(): string | null; + getThis(): unknown; + getTypeName(): string | null; + isAsync(): boolean; + isConstructor(): boolean; + isEval(): boolean; + isNative(): boolean; + isPromiseAll(): boolean; + isToplevel(): boolean; + } + + interface ErrnoException extends Error { + errno?: number | undefined; + code?: string | undefined; + path?: string | undefined; + syscall?: string | undefined; + } + + interface RefCounted { + ref(): this; + unref(): this; + } + + interface Dict { + [key: string]: T | undefined; + } + + interface ReadOnlyDict { + readonly [key: string]: T | undefined; + } + + type PartialOptions = { [K in keyof T]?: T[K] | undefined }; + + interface GCFunction { + (minor?: boolean): void; + (options: NodeJS.GCOptions & { execution: "async" }): Promise; + (options: NodeJS.GCOptions): void; + } + + interface GCOptions { + execution?: "sync" | "async" | undefined; + flavor?: "regular" | "last-resort" | undefined; + type?: "major-snapshot" | "major" | "minor" | undefined; + filename?: string | undefined; + } + + /** An iterable iterator returned by the Node.js API. */ + interface Iterator extends IteratorObject { + [Symbol.iterator](): NodeJS.Iterator; + } + + /** An async iterable iterator returned by the Node.js API. */ + interface AsyncIterator extends AsyncIteratorObject { + [Symbol.asyncIterator](): NodeJS.AsyncIterator; + } + + /** The [`BufferSource`](https://webidl.spec.whatwg.org/#BufferSource) type from the Web IDL specification. */ + type BufferSource = NonSharedArrayBufferView | ArrayBuffer; + + /** The [`AllowSharedBufferSource`](https://webidl.spec.whatwg.org/#AllowSharedBufferSource) type from the Web IDL specification. */ + type AllowSharedBufferSource = ArrayBufferView | ArrayBufferLike; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/globals.typedarray.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/globals.typedarray.d.ts new file mode 100644 index 0000000..e69dd0c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/globals.typedarray.d.ts @@ -0,0 +1,101 @@ +export {}; // Make this a module + +declare global { + namespace NodeJS { + type TypedArray = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float16Array + | Float32Array + | Float64Array; + type ArrayBufferView = + | TypedArray + | DataView; + + // The following aliases are required to allow use of non-shared ArrayBufferViews in @types/node + // while maintaining compatibility with TS <=5.6. + // TODO: remove once @types/node no longer supports TS 5.6, and replace with native types. + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedUint8Array = Uint8Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedUint8ClampedArray = Uint8ClampedArray; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedUint16Array = Uint16Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedUint32Array = Uint32Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedInt8Array = Int8Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedInt16Array = Int16Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedInt32Array = Int32Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedBigUint64Array = BigUint64Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedBigInt64Array = BigInt64Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedFloat16Array = Float16Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedFloat32Array = Float32Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedFloat64Array = Float64Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedDataView = DataView; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedTypedArray = TypedArray; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedArrayBufferView = ArrayBufferView; + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/http.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/http.d.ts new file mode 100644 index 0000000..f88f49f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/http.d.ts @@ -0,0 +1,2188 @@ +/** + * To use the HTTP server and client one must import the `node:http` module. + * + * The HTTP interfaces in Node.js are designed to support many features + * of the protocol which have been traditionally difficult to use. + * In particular, large, possibly chunk-encoded, messages. The interface is + * careful to never buffer entire requests or responses, so the + * user is able to stream data. + * + * HTTP message headers are represented by an object like this: + * + * ```json + * { "content-length": "123", + * "content-type": "text/plain", + * "connection": "keep-alive", + * "host": "example.com", + * "accept": "*" } + * ``` + * + * Keys are lowercased. Values are not modified. + * + * In order to support the full spectrum of possible HTTP applications, the Node.js + * HTTP API is very low-level. It deals with stream handling and message + * parsing only. It parses a message into headers and body but it does not + * parse the actual headers or the body. + * + * See `message.headers` for details on how duplicate headers are handled. + * + * The raw headers as they were received are retained in the `rawHeaders` property, which is an array of `[key, value, key2, value2, ...]`. For + * example, the previous message header object might have a `rawHeaders` list like the following: + * + * ```js + * [ 'ConTent-Length', '123456', + * 'content-LENGTH', '123', + * 'content-type', 'text/plain', + * 'CONNECTION', 'keep-alive', + * 'Host', 'example.com', + * 'accepT', '*' ] + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/http.js) + */ +declare module "node:http" { + import { NonSharedBuffer } from "node:buffer"; + import { LookupOptions } from "node:dns"; + import { EventEmitter } from "node:events"; + import * as net from "node:net"; + import * as stream from "node:stream"; + import { URL } from "node:url"; + // incoming headers will never contain number + interface IncomingHttpHeaders extends NodeJS.Dict { + accept?: string | undefined; + "accept-encoding"?: string | undefined; + "accept-language"?: string | undefined; + "accept-patch"?: string | undefined; + "accept-ranges"?: string | undefined; + "access-control-allow-credentials"?: string | undefined; + "access-control-allow-headers"?: string | undefined; + "access-control-allow-methods"?: string | undefined; + "access-control-allow-origin"?: string | undefined; + "access-control-expose-headers"?: string | undefined; + "access-control-max-age"?: string | undefined; + "access-control-request-headers"?: string | undefined; + "access-control-request-method"?: string | undefined; + age?: string | undefined; + allow?: string | undefined; + "alt-svc"?: string | undefined; + authorization?: string | undefined; + "cache-control"?: string | undefined; + connection?: string | undefined; + "content-disposition"?: string | undefined; + "content-encoding"?: string | undefined; + "content-language"?: string | undefined; + "content-length"?: string | undefined; + "content-location"?: string | undefined; + "content-range"?: string | undefined; + "content-type"?: string | undefined; + cookie?: string | undefined; + date?: string | undefined; + etag?: string | undefined; + expect?: string | undefined; + expires?: string | undefined; + forwarded?: string | undefined; + from?: string | undefined; + host?: string | undefined; + "if-match"?: string | undefined; + "if-modified-since"?: string | undefined; + "if-none-match"?: string | undefined; + "if-unmodified-since"?: string | undefined; + "last-modified"?: string | undefined; + location?: string | undefined; + origin?: string | undefined; + pragma?: string | undefined; + "proxy-authenticate"?: string | undefined; + "proxy-authorization"?: string | undefined; + "public-key-pins"?: string | undefined; + range?: string | undefined; + referer?: string | undefined; + "retry-after"?: string | undefined; + "sec-fetch-site"?: string | undefined; + "sec-fetch-mode"?: string | undefined; + "sec-fetch-user"?: string | undefined; + "sec-fetch-dest"?: string | undefined; + "sec-websocket-accept"?: string | undefined; + "sec-websocket-extensions"?: string | undefined; + "sec-websocket-key"?: string | undefined; + "sec-websocket-protocol"?: string | undefined; + "sec-websocket-version"?: string | undefined; + "set-cookie"?: string[] | undefined; + "strict-transport-security"?: string | undefined; + tk?: string | undefined; + trailer?: string | undefined; + "transfer-encoding"?: string | undefined; + upgrade?: string | undefined; + "user-agent"?: string | undefined; + vary?: string | undefined; + via?: string | undefined; + warning?: string | undefined; + "www-authenticate"?: string | undefined; + } + // outgoing headers allows numbers (as they are converted internally to strings) + type OutgoingHttpHeader = number | string | string[]; + interface OutgoingHttpHeaders extends NodeJS.Dict { + accept?: string | string[] | undefined; + "accept-charset"?: string | string[] | undefined; + "accept-encoding"?: string | string[] | undefined; + "accept-language"?: string | string[] | undefined; + "accept-ranges"?: string | undefined; + "access-control-allow-credentials"?: string | undefined; + "access-control-allow-headers"?: string | undefined; + "access-control-allow-methods"?: string | undefined; + "access-control-allow-origin"?: string | undefined; + "access-control-expose-headers"?: string | undefined; + "access-control-max-age"?: string | undefined; + "access-control-request-headers"?: string | undefined; + "access-control-request-method"?: string | undefined; + age?: string | undefined; + allow?: string | undefined; + authorization?: string | undefined; + "cache-control"?: string | undefined; + "cdn-cache-control"?: string | undefined; + connection?: string | string[] | undefined; + "content-disposition"?: string | undefined; + "content-encoding"?: string | undefined; + "content-language"?: string | undefined; + "content-length"?: string | number | undefined; + "content-location"?: string | undefined; + "content-range"?: string | undefined; + "content-security-policy"?: string | undefined; + "content-security-policy-report-only"?: string | undefined; + "content-type"?: string | undefined; + cookie?: string | string[] | undefined; + dav?: string | string[] | undefined; + dnt?: string | undefined; + date?: string | undefined; + etag?: string | undefined; + expect?: string | undefined; + expires?: string | undefined; + forwarded?: string | undefined; + from?: string | undefined; + host?: string | undefined; + "if-match"?: string | undefined; + "if-modified-since"?: string | undefined; + "if-none-match"?: string | undefined; + "if-range"?: string | undefined; + "if-unmodified-since"?: string | undefined; + "last-modified"?: string | undefined; + link?: string | string[] | undefined; + location?: string | undefined; + "max-forwards"?: string | undefined; + origin?: string | undefined; + pragma?: string | string[] | undefined; + "proxy-authenticate"?: string | string[] | undefined; + "proxy-authorization"?: string | undefined; + "public-key-pins"?: string | undefined; + "public-key-pins-report-only"?: string | undefined; + range?: string | undefined; + referer?: string | undefined; + "referrer-policy"?: string | undefined; + refresh?: string | undefined; + "retry-after"?: string | undefined; + "sec-websocket-accept"?: string | undefined; + "sec-websocket-extensions"?: string | string[] | undefined; + "sec-websocket-key"?: string | undefined; + "sec-websocket-protocol"?: string | string[] | undefined; + "sec-websocket-version"?: string | undefined; + server?: string | undefined; + "set-cookie"?: string | string[] | undefined; + "strict-transport-security"?: string | undefined; + te?: string | undefined; + trailer?: string | undefined; + "transfer-encoding"?: string | undefined; + "user-agent"?: string | undefined; + upgrade?: string | undefined; + "upgrade-insecure-requests"?: string | undefined; + vary?: string | undefined; + via?: string | string[] | undefined; + warning?: string | undefined; + "www-authenticate"?: string | string[] | undefined; + "x-content-type-options"?: string | undefined; + "x-dns-prefetch-control"?: string | undefined; + "x-frame-options"?: string | undefined; + "x-xss-protection"?: string | undefined; + } + interface ClientRequestArgs extends Pick { + _defaultAgent?: Agent | undefined; + agent?: Agent | boolean | undefined; + auth?: string | null | undefined; + createConnection?: + | (( + options: ClientRequestArgs, + oncreate: (err: Error | null, socket: stream.Duplex) => void, + ) => stream.Duplex | null | undefined) + | undefined; + defaultPort?: number | string | undefined; + family?: number | undefined; + headers?: OutgoingHttpHeaders | readonly string[] | undefined; + host?: string | null | undefined; + hostname?: string | null | undefined; + insecureHTTPParser?: boolean | undefined; + localAddress?: string | undefined; + localPort?: number | undefined; + lookup?: net.LookupFunction | undefined; + /** + * @default 16384 + */ + maxHeaderSize?: number | undefined; + method?: string | undefined; + path?: string | null | undefined; + port?: number | string | null | undefined; + protocol?: string | null | undefined; + setDefaultHeaders?: boolean | undefined; + setHost?: boolean | undefined; + signal?: AbortSignal | undefined; + socketPath?: string | undefined; + timeout?: number | undefined; + uniqueHeaders?: Array | undefined; + joinDuplicateHeaders?: boolean | undefined; + } + interface ServerOptions< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse> = typeof ServerResponse, + > { + /** + * Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`. + */ + IncomingMessage?: Request | undefined; + /** + * Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`. + */ + ServerResponse?: Response | undefined; + /** + * Sets the timeout value in milliseconds for receiving the entire request from the client. + * @see Server.requestTimeout for more information. + * @default 300000 + * @since v18.0.0 + */ + requestTimeout?: number | undefined; + /** + * It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates. + * @default false + * @since v18.14.0 + */ + joinDuplicateHeaders?: boolean | undefined; + /** + * The number of milliseconds of inactivity a server needs to wait for additional incoming data, + * after it has finished writing the last response, before a socket will be destroyed. + * @see Server.keepAliveTimeout for more information. + * @default 5000 + * @since v18.0.0 + */ + keepAliveTimeout?: number | undefined; + /** + * An additional buffer time added to the + * `server.keepAliveTimeout` to extend the internal socket timeout. + * @since 24.6.0 + * @default 1000 + */ + keepAliveTimeoutBuffer?: number | undefined; + /** + * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests. + * @default 30000 + */ + connectionsCheckingInterval?: number | undefined; + /** + * Sets the timeout value in milliseconds for receiving the complete HTTP headers from the client. + * See {@link Server.headersTimeout} for more information. + * @default 60000 + * @since 18.0.0 + */ + headersTimeout?: number | undefined; + /** + * Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`. + * This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`. + * Default: @see stream.getDefaultHighWaterMark(). + * @since v20.1.0 + */ + highWaterMark?: number | undefined; + /** + * Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. + * Using the insecure parser should be avoided. + * See --insecure-http-parser for more information. + * @default false + */ + insecureHTTPParser?: boolean | undefined; + /** + * Optionally overrides the value of `--max-http-header-size` for requests received by + * this server, i.e. the maximum length of request headers in bytes. + * @default 16384 + * @since v13.3.0 + */ + maxHeaderSize?: number | undefined; + /** + * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. + * @default true + * @since v16.5.0 + */ + noDelay?: boolean | undefined; + /** + * If set to `true`, it forces the server to respond with a 400 (Bad Request) status code + * to any HTTP/1.1 request message that lacks a Host header (as mandated by the specification). + * @default true + * @since 20.0.0 + */ + requireHostHeader?: boolean | undefined; + /** + * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, + * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. + * @default false + * @since v16.5.0 + */ + keepAlive?: boolean | undefined; + /** + * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. + * @default 0 + * @since v16.5.0 + */ + keepAliveInitialDelay?: number | undefined; + /** + * A list of response headers that should be sent only once. + * If the header's value is an array, the items will be joined using `; `. + */ + uniqueHeaders?: Array | undefined; + /** + * A callback which receives an + * incoming request and returns a boolean, to control which upgrade attempts + * should be accepted. Accepted upgrades will fire an `'upgrade'` event (or + * their sockets will be destroyed, if no listener is registered) while + * rejected upgrades will fire a `'request'` event like any non-upgrade + * request. + * @since v24.9.0 + * @default () => server.listenerCount('upgrade') > 0 + */ + shouldUpgradeCallback?: ((request: InstanceType) => boolean) | undefined; + /** + * If set to `true`, an error is thrown when writing to an HTTP response which does not have a body. + * @default false + * @since v18.17.0, v20.2.0 + */ + rejectNonStandardBodyWrites?: boolean | undefined; + /** + * If set to `true`, requests without `Content-Length` + * or `Transfer-Encoding` headers (indicating no body) will be initialized with an + * already-ended body stream, so they will never emit any stream events + * (like `'data'` or `'end'`). You can use `req.readableEnded` to detect this case. + * @since v25.1.0 + * @default false + */ + optimizeEmptyRequests?: boolean | undefined; + } + type RequestListener< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse> = typeof ServerResponse, + > = (request: InstanceType, response: InstanceType & { req: InstanceType }) => void; + interface ServerEventMap< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse> = typeof ServerResponse, + > extends net.ServerEventMap { + "checkContinue": Parameters>; + "checkExpectation": Parameters>; + "clientError": [exception: Error, socket: stream.Duplex]; + "connect": [request: InstanceType, socket: stream.Duplex, head: NonSharedBuffer]; + "connection": [socket: net.Socket]; + "dropRequest": [request: InstanceType, socket: stream.Duplex]; + "request": Parameters>; + "upgrade": [req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer]; + } + /** + * @since v0.1.17 + */ + class Server< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse> = typeof ServerResponse, + > extends net.Server { + constructor(requestListener?: RequestListener); + constructor(options: ServerOptions, requestListener?: RequestListener); + /** + * Sets the timeout value for sockets, and emits a `'timeout'` event on + * the Server object, passing the socket as an argument, if a timeout + * occurs. + * + * If there is a `'timeout'` event listener on the Server object, then it + * will be called with the timed-out socket as an argument. + * + * By default, the Server does not timeout sockets. However, if a callback + * is assigned to the Server's `'timeout'` event, timeouts must be handled + * explicitly. + * @since v0.9.12 + * @param [msecs=0 (no timeout)] + */ + setTimeout(msecs?: number, callback?: (socket: net.Socket) => void): this; + setTimeout(callback: (socket: net.Socket) => void): this; + /** + * Limits maximum incoming headers count. If set to 0, no limit will be applied. + * @since v0.7.0 + */ + maxHeadersCount: number | null; + /** + * The maximum number of requests socket can handle + * before closing keep alive connection. + * + * A value of `0` will disable the limit. + * + * When the limit is reached it will set the `Connection` header value to `close`, + * but will not actually close the connection, subsequent requests sent + * after the limit is reached will get `503 Service Unavailable` as a response. + * @since v16.10.0 + */ + maxRequestsPerSocket: number | null; + /** + * The number of milliseconds of inactivity before a socket is presumed + * to have timed out. + * + * A value of `0` will disable the timeout behavior on incoming connections. + * + * The socket timeout logic is set up on connection, so changing this + * value only affects new connections to the server, not any existing connections. + * @since v0.9.12 + */ + timeout: number; + /** + * Limit the amount of time the parser will wait to receive the complete HTTP + * headers. + * + * If the timeout expires, the server responds with status 408 without + * forwarding the request to the request listener and then closes the connection. + * + * It must be set to a non-zero value (e.g. 120 seconds) to protect against + * potential Denial-of-Service attacks in case the server is deployed without a + * reverse proxy in front. + * @since v11.3.0, v10.14.0 + */ + headersTimeout: number; + /** + * The number of milliseconds of inactivity a server needs to wait for additional + * incoming data, after it has finished writing the last response, before a socket + * will be destroyed. + * + * This timeout value is combined with the + * `server.keepAliveTimeoutBuffer` option to determine the actual socket + * timeout, calculated as: + * socketTimeout = keepAliveTimeout + keepAliveTimeoutBuffer + * If the server receives new data before the keep-alive timeout has fired, it + * will reset the regular inactivity timeout, i.e., `server.timeout`. + * + * A value of `0` will disable the keep-alive timeout behavior on incoming + * connections. + * A value of `0` makes the HTTP server behave similarly to Node.js versions prior + * to 8.0.0, which did not have a keep-alive timeout. + * + * The socket timeout logic is set up on connection, so changing this value only + * affects new connections to the server, not any existing connections. + * @since v8.0.0 + */ + keepAliveTimeout: number; + /** + * An additional buffer time added to the + * `server.keepAliveTimeout` to extend the internal socket timeout. + * + * This buffer helps reduce connection reset (`ECONNRESET`) errors by increasing + * the socket timeout slightly beyond the advertised keep-alive timeout. + * + * This option applies only to new incoming connections. + * @since v24.6.0 + * @default 1000 + */ + keepAliveTimeoutBuffer: number; + /** + * Sets the timeout value in milliseconds for receiving the entire request from + * the client. + * + * If the timeout expires, the server responds with status 408 without + * forwarding the request to the request listener and then closes the connection. + * + * It must be set to a non-zero value (e.g. 120 seconds) to protect against + * potential Denial-of-Service attacks in case the server is deployed without a + * reverse proxy in front. + * @since v14.11.0 + */ + requestTimeout: number; + /** + * Closes all connections connected to this server. + * @since v18.2.0 + */ + closeAllConnections(): void; + /** + * Closes all connections connected to this server which are not sending a request + * or waiting for a response. + * @since v18.2.0 + */ + closeIdleConnections(): void; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ServerEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ServerEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: ServerEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: ServerEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface OutgoingMessageEventMap extends stream.WritableEventMap { + "prefinish": []; + } + /** + * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract outgoing message from + * the perspective of the participants of an HTTP transaction. + * @since v0.1.17 + */ + class OutgoingMessage extends stream.Writable { + constructor(); + readonly req: Request; + chunkedEncoding: boolean; + shouldKeepAlive: boolean; + useChunkedEncodingByDefault: boolean; + sendDate: boolean; + /** + * @deprecated Use `writableEnded` instead. + */ + finished: boolean; + /** + * Read-only. `true` if the headers were sent, otherwise `false`. + * @since v0.9.3 + */ + readonly headersSent: boolean; + /** + * Alias of `outgoingMessage.socket`. + * @since v0.3.0 + * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead. + */ + readonly connection: net.Socket | null; + /** + * Reference to the underlying socket. Usually, users will not want to access + * this property. + * + * After calling `outgoingMessage.end()`, this property will be nulled. + * @since v0.3.0 + */ + readonly socket: net.Socket | null; + /** + * Once a socket is associated with the message and is connected, `socket.setTimeout()` will be called with `msecs` as the first parameter. + * @since v0.9.12 + * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. + */ + setTimeout(msecs: number, callback?: () => void): this; + /** + * Sets a single header value. If the header already exists in the to-be-sent + * headers, its value will be replaced. Use an array of strings to send multiple + * headers with the same name. + * @since v0.4.0 + * @param name Header name + * @param value Header value + */ + setHeader(name: string, value: number | string | readonly string[]): this; + /** + * Sets multiple header values for implicit headers. headers must be an instance of + * `Headers` or `Map`, if a header already exists in the to-be-sent headers, its + * value will be replaced. + * + * ```js + * const headers = new Headers({ foo: 'bar' }); + * outgoingMessage.setHeaders(headers); + * ``` + * + * or + * + * ```js + * const headers = new Map([['foo', 'bar']]); + * outgoingMessage.setHeaders(headers); + * ``` + * + * When headers have been set with `outgoingMessage.setHeaders()`, they will be + * merged with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * ```js + * // Returns content-type = text/plain + * const server = http.createServer((req, res) => { + * const headers = new Headers({ 'Content-Type': 'text/html' }); + * res.setHeaders(headers); + * res.writeHead(200, { 'Content-Type': 'text/plain' }); + * res.end('ok'); + * }); + * ``` + * + * @since v19.6.0, v18.15.0 + * @param name Header name + * @param value Header value + */ + setHeaders(headers: Headers | Map): this; + /** + * Append a single header value to the header object. + * + * If the value is an array, this is equivalent to calling this method multiple + * times. + * + * If there were no previous values for the header, this is equivalent to calling `outgoingMessage.setHeader(name, value)`. + * + * Depending of the value of `options.uniqueHeaders` when the client request or the + * server were created, this will end up in the header being sent multiple times or + * a single time with values joined using `; `. + * @since v18.3.0, v16.17.0 + * @param name Header name + * @param value Header value + */ + appendHeader(name: string, value: string | readonly string[]): this; + /** + * Gets the value of the HTTP header with the given name. If that header is not + * set, the returned value will be `undefined`. + * @since v0.4.0 + * @param name Name of header + */ + getHeader(name: string): number | string | string[] | undefined; + /** + * Returns a shallow copy of the current outgoing headers. Since a shallow + * copy is used, array values may be mutated without additional calls to + * various header-related HTTP module methods. The keys of the returned + * object are the header names and the values are the respective header + * values. All header names are lowercase. + * + * The object returned by the `outgoingMessage.getHeaders()` method does + * not prototypically inherit from the JavaScript `Object`. This means that + * typical `Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, + * and others are not defined and will not work. + * + * ```js + * outgoingMessage.setHeader('Foo', 'bar'); + * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headers = outgoingMessage.getHeaders(); + * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } + * ``` + * @since v7.7.0 + */ + getHeaders(): OutgoingHttpHeaders; + /** + * Returns an array containing the unique names of the current outgoing headers. + * All names are lowercase. + * @since v7.7.0 + */ + getHeaderNames(): string[]; + /** + * Returns `true` if the header identified by `name` is currently set in the + * outgoing headers. The header name is case-insensitive. + * + * ```js + * const hasContentType = outgoingMessage.hasHeader('content-type'); + * ``` + * @since v7.7.0 + */ + hasHeader(name: string): boolean; + /** + * Removes a header that is queued for implicit sending. + * + * ```js + * outgoingMessage.removeHeader('Content-Encoding'); + * ``` + * @since v0.4.0 + * @param name Header name + */ + removeHeader(name: string): void; + /** + * Adds HTTP trailers (headers but at the end of the message) to the message. + * + * Trailers will **only** be emitted if the message is chunked encoded. If not, + * the trailers will be silently discarded. + * + * HTTP requires the `Trailer` header to be sent to emit trailers, + * with a list of header field names in its value, e.g. + * + * ```js + * message.writeHead(200, { 'Content-Type': 'text/plain', + * 'Trailer': 'Content-MD5' }); + * message.write(fileData); + * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); + * message.end(); + * ``` + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v0.3.0 + */ + addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; + /** + * Flushes the message headers. + * + * For efficiency reason, Node.js normally buffers the message headers + * until `outgoingMessage.end()` is called or the first chunk of message data + * is written. It then tries to pack the headers and data into a single TCP + * packet. + * + * It is usually desired (it saves a TCP round-trip), but not when the first + * data is not sent until possibly much later. `outgoingMessage.flushHeaders()` bypasses the optimization and kickstarts the message. + * @since v1.6.0 + */ + flushHeaders(): void; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: OutgoingMessageEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: OutgoingMessageEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: OutgoingMessageEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: OutgoingMessageEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: OutgoingMessageEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: OutgoingMessageEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: OutgoingMessageEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: OutgoingMessageEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: OutgoingMessageEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: OutgoingMessageEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: OutgoingMessageEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + /** + * This object is created internally by an HTTP server, not by the user. It is + * passed as the second parameter to the `'request'` event. + * @since v0.1.17 + */ + class ServerResponse extends OutgoingMessage { + /** + * When using implicit headers (not calling `response.writeHead()` explicitly), + * this property controls the status code that will be sent to the client when + * the headers get flushed. + * + * ```js + * response.statusCode = 404; + * ``` + * + * After response header was sent to the client, this property indicates the + * status code which was sent out. + * @since v0.4.0 + */ + statusCode: number; + /** + * When using implicit headers (not calling `response.writeHead()` explicitly), + * this property controls the status message that will be sent to the client when + * the headers get flushed. If this is left as `undefined` then the standard + * message for the status code will be used. + * + * ```js + * response.statusMessage = 'Not found'; + * ``` + * + * After response header was sent to the client, this property indicates the + * status message which was sent out. + * @since v0.11.8 + */ + statusMessage: string; + /** + * If set to `true`, Node.js will check whether the `Content-Length` header value and the size of the body, in bytes, are equal. + * Mismatching the `Content-Length` header value will result + * in an `Error` being thrown, identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. + * @since v18.10.0, v16.18.0 + */ + strictContentLength: boolean; + constructor(req: Request); + assignSocket(socket: net.Socket): void; + detachSocket(socket: net.Socket): void; + /** + * Sends an HTTP/1.1 100 Continue message to the client, indicating that + * the request body should be sent. See the `'checkContinue'` event on `Server`. + * @since v0.3.0 + */ + writeContinue(callback?: () => void): void; + /** + * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header, + * indicating that the user agent can preload/preconnect the linked resources. + * The `hints` is an object containing the values of headers to be sent with + * early hints message. The optional `callback` argument will be called when + * the response message has been written. + * + * **Example** + * + * ```js + * const earlyHintsLink = '; rel=preload; as=style'; + * response.writeEarlyHints({ + * 'link': earlyHintsLink, + * }); + * + * const earlyHintsLinks = [ + * '; rel=preload; as=style', + * '; rel=preload; as=script', + * ]; + * response.writeEarlyHints({ + * 'link': earlyHintsLinks, + * 'x-trace-id': 'id for diagnostics', + * }); + * + * const earlyHintsCallback = () => console.log('early hints message sent'); + * response.writeEarlyHints({ + * 'link': earlyHintsLinks, + * }, earlyHintsCallback); + * ``` + * @since v18.11.0 + * @param hints An object containing the values of headers + * @param callback Will be called when the response message has been written + */ + writeEarlyHints(hints: Record, callback?: () => void): void; + /** + * Sends a response header to the request. The status code is a 3-digit HTTP + * status code, like `404`. The last argument, `headers`, are the response headers. + * Optionally one can give a human-readable `statusMessage` as the second + * argument. + * + * `headers` may be an `Array` where the keys and values are in the same list. + * It is _not_ a list of tuples. So, the even-numbered offsets are key values, + * and the odd-numbered offsets are the associated values. The array is in the same + * format as `request.rawHeaders`. + * + * Returns a reference to the `ServerResponse`, so that calls can be chained. + * + * ```js + * const body = 'hello world'; + * response + * .writeHead(200, { + * 'Content-Length': Buffer.byteLength(body), + * 'Content-Type': 'text/plain', + * }) + * .end(body); + * ``` + * + * This method must only be called once on a message and it must + * be called before `response.end()` is called. + * + * If `response.write()` or `response.end()` are called before calling + * this, the implicit/mutable headers will be calculated and call this function. + * + * When headers have been set with `response.setHeader()`, they will be merged + * with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * If this method is called and `response.setHeader()` has not been called, + * it will directly write the supplied header values onto the network channel + * without caching internally, and the `response.getHeader()` on the header + * will not yield the expected result. If progressive population of headers is + * desired with potential future retrieval and modification, use `response.setHeader()` instead. + * + * ```js + * // Returns content-type = text/plain + * const server = http.createServer((req, res) => { + * res.setHeader('Content-Type', 'text/html'); + * res.setHeader('X-Foo', 'bar'); + * res.writeHead(200, { 'Content-Type': 'text/plain' }); + * res.end('ok'); + * }); + * ``` + * + * `Content-Length` is read in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js + * will check whether `Content-Length` and the length of the body which has + * been transmitted are equal or not. + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `Error` being thrown. + * @since v0.1.30 + */ + writeHead( + statusCode: number, + statusMessage?: string, + headers?: OutgoingHttpHeaders | OutgoingHttpHeader[], + ): this; + writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; + /** + * Sends a HTTP/1.1 102 Processing message to the client, indicating that + * the request body should be sent. + * @since v10.0.0 + */ + writeProcessing(callback?: () => void): void; + } + interface InformationEvent { + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + statusCode: number; + statusMessage: string; + headers: IncomingHttpHeaders; + rawHeaders: string[]; + } + interface ClientRequestEventMap extends stream.WritableEventMap { + /** @deprecated Listen for the `'close'` event instead. */ + "abort": []; + "connect": [response: IncomingMessage, socket: net.Socket, head: NonSharedBuffer]; + "continue": []; + "information": [info: InformationEvent]; + "response": [response: IncomingMessage]; + "socket": [socket: net.Socket]; + "timeout": []; + "upgrade": [response: IncomingMessage, socket: net.Socket, head: NonSharedBuffer]; + } + /** + * This object is created internally and returned from {@link request}. It + * represents an _in-progress_ request whose header has already been queued. The + * header is still mutable using the `setHeader(name, value)`, `getHeader(name)`, `removeHeader(name)` API. The actual header will + * be sent along with the first data chunk or when calling `request.end()`. + * + * To get the response, add a listener for `'response'` to the request object. `'response'` will be emitted from the request object when the response + * headers have been received. The `'response'` event is executed with one + * argument which is an instance of {@link IncomingMessage}. + * + * During the `'response'` event, one can add listeners to the + * response object; particularly to listen for the `'data'` event. + * + * If no `'response'` handler is added, then the response will be + * entirely discarded. However, if a `'response'` event handler is added, + * then the data from the response object **must** be consumed, either by + * calling `response.read()` whenever there is a `'readable'` event, or + * by adding a `'data'` handler, or by calling the `.resume()` method. + * Until the data is consumed, the `'end'` event will not fire. Also, until + * the data is read it will consume memory that can eventually lead to a + * 'process out of memory' error. + * + * For backward compatibility, `res` will only emit `'error'` if there is an `'error'` listener registered. + * + * Set `Content-Length` header to limit the response body size. + * If `response.strictContentLength` is set to `true`, mismatching the `Content-Length` header value will result in an `Error` being thrown, + * identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. + * + * `Content-Length` value should be in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. + * @since v0.1.17 + */ + class ClientRequest extends OutgoingMessage { + /** + * The `request.aborted` property will be `true` if the request has + * been aborted. + * @since v0.11.14 + * @deprecated Since v17.0.0, v16.12.0 - Check `destroyed` instead. + */ + aborted: boolean; + /** + * The request host. + * @since v14.5.0, v12.19.0 + */ + host: string; + /** + * The request protocol. + * @since v14.5.0, v12.19.0 + */ + protocol: string; + /** + * When sending request through a keep-alive enabled agent, the underlying socket + * might be reused. But if server closes connection at unfortunate time, client + * may run into a 'ECONNRESET' error. + * + * ```js + * import http from 'node:http'; + * const agent = new http.Agent({ keepAlive: true }); + * + * // Server has a 5 seconds keep-alive timeout by default + * http + * .createServer((req, res) => { + * res.write('hello\n'); + * res.end(); + * }) + * .listen(3000); + * + * setInterval(() => { + * // Adapting a keep-alive agent + * http.get('http://localhost:3000', { agent }, (res) => { + * res.on('data', (data) => { + * // Do nothing + * }); + * }); + * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout + * ``` + * + * By marking a request whether it reused socket or not, we can do + * automatic error retry base on it. + * + * ```js + * import http from 'node:http'; + * const agent = new http.Agent({ keepAlive: true }); + * + * function retriableRequest() { + * const req = http + * .get('http://localhost:3000', { agent }, (res) => { + * // ... + * }) + * .on('error', (err) => { + * // Check if retry is needed + * if (req.reusedSocket && err.code === 'ECONNRESET') { + * retriableRequest(); + * } + * }); + * } + * + * retriableRequest(); + * ``` + * @since v13.0.0, v12.16.0 + */ + reusedSocket: boolean; + /** + * Limits maximum response headers count. If set to 0, no limit will be applied. + */ + maxHeadersCount: number; + constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); + /** + * The request method. + * @since v0.1.97 + */ + method: string; + /** + * The request path. + * @since v0.4.0 + */ + path: string; + /** + * Marks the request as aborting. Calling this will cause remaining data + * in the response to be dropped and the socket to be destroyed. + * @since v0.3.8 + * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. + */ + abort(): void; + onSocket(socket: net.Socket): void; + /** + * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. + * @since v0.5.9 + * @param timeout Milliseconds before a request times out. + * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event. + */ + setTimeout(timeout: number, callback?: () => void): this; + /** + * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called. + * @since v0.5.9 + */ + setNoDelay(noDelay?: boolean): void; + /** + * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called. + * @since v0.5.9 + */ + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; + /** + * Returns an array containing the unique names of the current outgoing raw + * headers. Header names are returned with their exact casing being set. + * + * ```js + * request.setHeader('Foo', 'bar'); + * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headerNames = request.getRawHeaderNames(); + * // headerNames === ['Foo', 'Set-Cookie'] + * ``` + * @since v15.13.0, v14.17.0 + */ + getRawHeaderNames(): string[]; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: ClientRequestEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ClientRequestEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ClientRequestEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: ClientRequestEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: ClientRequestEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: ClientRequestEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: ClientRequestEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ClientRequestEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ClientRequestEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: ClientRequestEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ClientRequestEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface IncomingMessageEventMap extends stream.ReadableEventMap { + /** @deprecated Listen for `'close'` event instead. */ + "aborted": []; + } + /** + * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to + * access response + * status, headers, and data. + * + * Different from its `socket` value which is a subclass of `stream.Duplex`, the `IncomingMessage` itself extends `stream.Readable` and is created separately to + * parse and emit the incoming HTTP headers and payload, as the underlying socket + * may be reused multiple times in case of keep-alive. + * @since v0.1.17 + */ + class IncomingMessage extends stream.Readable { + constructor(socket: net.Socket); + /** + * The `message.aborted` property will be `true` if the request has + * been aborted. + * @since v10.1.0 + * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from stream.Readable. + */ + aborted: boolean; + /** + * In case of server request, the HTTP version sent by the client. In the case of + * client response, the HTTP version of the connected-to server. + * Probably either `'1.1'` or `'1.0'`. + * + * Also `message.httpVersionMajor` is the first integer and `message.httpVersionMinor` is the second. + * @since v0.1.1 + */ + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + /** + * The `message.complete` property will be `true` if a complete HTTP message has + * been received and successfully parsed. + * + * This property is particularly useful as a means of determining if a client or + * server fully transmitted a message before a connection was terminated: + * + * ```js + * const req = http.request({ + * host: '127.0.0.1', + * port: 8080, + * method: 'POST', + * }, (res) => { + * res.resume(); + * res.on('end', () => { + * if (!res.complete) + * console.error( + * 'The connection was terminated while the message was still being sent'); + * }); + * }); + * ``` + * @since v0.3.0 + */ + complete: boolean; + /** + * Alias for `message.socket`. + * @since v0.1.90 + * @deprecated Since v16.0.0 - Use `socket`. + */ + connection: net.Socket; + /** + * The `net.Socket` object associated with the connection. + * + * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the + * client's authentication details. + * + * This property is guaranteed to be an instance of the `net.Socket` class, + * a subclass of `stream.Duplex`, unless the user specified a socket + * type other than `net.Socket` or internally nulled. + * @since v0.3.0 + */ + socket: net.Socket; + /** + * The request/response headers object. + * + * Key-value pairs of header names and values. Header names are lower-cased. + * + * ```js + * // Prints something like: + * // + * // { 'user-agent': 'curl/7.22.0', + * // host: '127.0.0.1:8000', + * // accept: '*' } + * console.log(request.headers); + * ``` + * + * Duplicates in raw headers are handled in the following ways, depending on the + * header name: + * + * * Duplicates of `age`, `authorization`, `content-length`, `content-type`, `etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`, `last-modified`, `location`, + * `max-forwards`, `proxy-authorization`, `referer`, `retry-after`, `server`, or `user-agent` are discarded. + * To allow duplicate values of the headers listed above to be joined, + * use the option `joinDuplicateHeaders` in {@link request} and {@link createServer}. See RFC 9110 Section 5.3 for more + * information. + * * `set-cookie` is always an array. Duplicates are added to the array. + * * For duplicate `cookie` headers, the values are joined together with `; `. + * * For all other headers, the values are joined together with `, `. + * @since v0.1.5 + */ + headers: IncomingHttpHeaders; + /** + * Similar to `message.headers`, but there is no join logic and the values are + * always arrays of strings, even for headers received just once. + * + * ```js + * // Prints something like: + * // + * // { 'user-agent': ['curl/7.22.0'], + * // host: ['127.0.0.1:8000'], + * // accept: ['*'] } + * console.log(request.headersDistinct); + * ``` + * @since v18.3.0, v16.17.0 + */ + headersDistinct: NodeJS.Dict; + /** + * The raw request/response headers list exactly as they were received. + * + * The keys and values are in the same list. It is _not_ a + * list of tuples. So, the even-numbered offsets are key values, and the + * odd-numbered offsets are the associated values. + * + * Header names are not lowercased, and duplicates are not merged. + * + * ```js + * // Prints something like: + * // + * // [ 'user-agent', + * // 'this is invalid because there can be only one', + * // 'User-Agent', + * // 'curl/7.22.0', + * // 'Host', + * // '127.0.0.1:8000', + * // 'ACCEPT', + * // '*' ] + * console.log(request.rawHeaders); + * ``` + * @since v0.11.6 + */ + rawHeaders: string[]; + /** + * The request/response trailers object. Only populated at the `'end'` event. + * @since v0.3.0 + */ + trailers: NodeJS.Dict; + /** + * Similar to `message.trailers`, but there is no join logic and the values are + * always arrays of strings, even for headers received just once. + * Only populated at the `'end'` event. + * @since v18.3.0, v16.17.0 + */ + trailersDistinct: NodeJS.Dict; + /** + * The raw request/response trailer keys and values exactly as they were + * received. Only populated at the `'end'` event. + * @since v0.11.6 + */ + rawTrailers: string[]; + /** + * Calls `message.socket.setTimeout(msecs, callback)`. + * @since v0.5.9 + */ + setTimeout(msecs: number, callback?: () => void): this; + /** + * **Only valid for request obtained from {@link Server}.** + * + * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. + * @since v0.1.1 + */ + method?: string | undefined; + /** + * **Only valid for request obtained from {@link Server}.** + * + * Request URL string. This contains only the URL that is present in the actual + * HTTP request. Take the following request: + * + * ```http + * GET /status?name=ryan HTTP/1.1 + * Accept: text/plain + * ``` + * + * To parse the URL into its parts: + * + * ```js + * new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`); + * ``` + * + * When `request.url` is `'/status?name=ryan'` and `process.env.HOST` is undefined: + * + * ```console + * $ node + * > new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`); + * URL { + * href: 'http://localhost/status?name=ryan', + * origin: 'http://localhost', + * protocol: 'http:', + * username: '', + * password: '', + * host: 'localhost', + * hostname: 'localhost', + * port: '', + * pathname: '/status', + * search: '?name=ryan', + * searchParams: URLSearchParams { 'name' => 'ryan' }, + * hash: '' + * } + * ``` + * + * Ensure that you set `process.env.HOST` to the server's host name, or consider replacing this part entirely. If using `req.headers.host`, ensure proper + * validation is used, as clients may specify a custom `Host` header. + * @since v0.1.90 + */ + url?: string | undefined; + /** + * **Only valid for response obtained from {@link ClientRequest}.** + * + * The 3-digit HTTP response status code. E.G. `404`. + * @since v0.1.1 + */ + statusCode?: number | undefined; + /** + * **Only valid for response obtained from {@link ClientRequest}.** + * + * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. + * @since v0.11.10 + */ + statusMessage?: string | undefined; + /** + * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error` is provided, an `'error'` event is emitted on the socket and `error` is passed + * as an argument to any listeners on the event. + * @since v0.3.0 + */ + destroy(error?: Error): this; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: IncomingMessageEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: IncomingMessageEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: IncomingMessageEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: IncomingMessageEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: IncomingMessageEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: IncomingMessageEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: IncomingMessageEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: IncomingMessageEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: IncomingMessageEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: IncomingMessageEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: IncomingMessageEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface ProxyEnv extends NodeJS.ProcessEnv { + HTTP_PROXY?: string | undefined; + HTTPS_PROXY?: string | undefined; + NO_PROXY?: string | undefined; + http_proxy?: string | undefined; + https_proxy?: string | undefined; + no_proxy?: string | undefined; + } + interface AgentOptions extends NodeJS.PartialOptions { + /** + * Keep sockets around in a pool to be used by other requests in the future. Default = false + */ + keepAlive?: boolean | undefined; + /** + * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. + * Only relevant if keepAlive is set to true. + */ + keepAliveMsecs?: number | undefined; + /** + * Milliseconds to subtract from + * the server-provided `keep-alive: timeout=...` hint when determining socket + * expiration time. This buffer helps ensure the agent closes the socket + * slightly before the server does, reducing the chance of sending a request + * on a socket that’s about to be closed by the server. + * @since v24.7.0 + * @default 1000 + */ + agentKeepAliveTimeoutBuffer?: number | undefined; + /** + * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity + */ + maxSockets?: number | undefined; + /** + * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. + */ + maxTotalSockets?: number | undefined; + /** + * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. + */ + maxFreeSockets?: number | undefined; + /** + * Socket timeout in milliseconds. This will set the timeout after the socket is connected. + */ + timeout?: number | undefined; + /** + * Scheduling strategy to apply when picking the next free socket to use. + * @default `lifo` + */ + scheduling?: "fifo" | "lifo" | undefined; + /** + * Environment variables for proxy configuration. See + * [Built-in Proxy Support](https://nodejs.org/docs/latest-v25.x/api/http.html#built-in-proxy-support) for details. + * @since v24.5.0 + */ + proxyEnv?: ProxyEnv | undefined; + /** + * Default port to use when the port is not specified in requests. + * @since v24.5.0 + */ + defaultPort?: number | undefined; + /** + * The protocol to use for the agent. + * @since v24.5.0 + */ + protocol?: string | undefined; + } + /** + * An `Agent` is responsible for managing connection persistence + * and reuse for HTTP clients. It maintains a queue of pending requests + * for a given host and port, reusing a single socket connection for each + * until the queue is empty, at which time the socket is either destroyed + * or put into a pool where it is kept to be used again for requests to the + * same host and port. Whether it is destroyed or pooled depends on the `keepAlive` `option`. + * + * Pooled connections have TCP Keep-Alive enabled for them, but servers may + * still close idle connections, in which case they will be removed from the + * pool and a new connection will be made when a new HTTP request is made for + * that host and port. Servers may also refuse to allow multiple requests + * over the same connection, in which case the connection will have to be + * remade for every request and cannot be pooled. The `Agent` will still make + * the requests to that server, but each one will occur over a new connection. + * + * When a connection is closed by the client or the server, it is removed + * from the pool. Any unused sockets in the pool will be unrefed so as not + * to keep the Node.js process running when there are no outstanding requests. + * (see `socket.unref()`). + * + * It is good practice, to `destroy()` an `Agent` instance when it is no + * longer in use, because unused sockets consume OS resources. + * + * Sockets are removed from an agent when the socket emits either + * a `'close'` event or an `'agentRemove'` event. When intending to keep one + * HTTP request open for a long time without keeping it in the agent, something + * like the following may be done: + * + * ```js + * http.get(options, (res) => { + * // Do stuff + * }).on('socket', (socket) => { + * socket.emit('agentRemove'); + * }); + * ``` + * + * An agent may also be used for an individual request. By providing `{agent: false}` as an option to the `http.get()` or `http.request()` functions, a one-time use `Agent` with default options + * will be used + * for the client connection. + * + * `agent:false`: + * + * ```js + * http.get({ + * hostname: 'localhost', + * port: 80, + * path: '/', + * agent: false, // Create a new agent just for this one request + * }, (res) => { + * // Do stuff with response + * }); + * ``` + * + * `options` in [`socket.connect()`](https://nodejs.org/docs/latest-v25.x/api/net.html#socketconnectoptions-connectlistener) are also supported. + * + * To configure any of them, a custom {@link Agent} instance must be created. + * + * ```js + * import http from 'node:http'; + * const keepAliveAgent = new http.Agent({ keepAlive: true }); + * options.agent = keepAliveAgent; + * http.request(options, onResponseCallback) + * ``` + * @since v0.3.4 + */ + class Agent extends EventEmitter { + /** + * By default set to 256. For agents with `keepAlive` enabled, this + * sets the maximum number of sockets that will be left open in the free + * state. + * @since v0.11.7 + */ + maxFreeSockets: number; + /** + * By default set to `Infinity`. Determines how many concurrent sockets the agent + * can have open per origin. Origin is the returned value of `agent.getName()`. + * @since v0.3.6 + */ + maxSockets: number; + /** + * By default set to `Infinity`. Determines how many concurrent sockets the agent + * can have open. Unlike `maxSockets`, this parameter applies across all origins. + * @since v14.5.0, v12.19.0 + */ + maxTotalSockets: number; + /** + * An object which contains arrays of sockets currently awaiting use by + * the agent when `keepAlive` is enabled. Do not modify. + * + * Sockets in the `freeSockets` list will be automatically destroyed and + * removed from the array on `'timeout'`. + * @since v0.11.4 + */ + readonly freeSockets: NodeJS.ReadOnlyDict; + /** + * An object which contains arrays of sockets currently in use by the + * agent. Do not modify. + * @since v0.3.6 + */ + readonly sockets: NodeJS.ReadOnlyDict; + /** + * An object which contains queues of requests that have not yet been assigned to + * sockets. Do not modify. + * @since v0.5.9 + */ + readonly requests: NodeJS.ReadOnlyDict; + constructor(opts?: AgentOptions); + /** + * Destroy any sockets that are currently in use by the agent. + * + * It is usually not necessary to do this. However, if using an + * agent with `keepAlive` enabled, then it is best to explicitly shut down + * the agent when it is no longer needed. Otherwise, + * sockets might stay open for quite a long time before the server + * terminates them. + * @since v0.11.4 + */ + destroy(): void; + /** + * Produces a socket/stream to be used for HTTP requests. + * + * By default, this function behaves identically to `net.createConnection()`, + * synchronously returning the created socket. The optional `callback` parameter in the + * signature is **not** used by this default implementation. + * + * However, custom agents may override this method to provide greater flexibility, + * for example, to create sockets asynchronously. When overriding `createConnection`: + * + * 1. **Synchronous socket creation**: The overriding method can return the + * socket/stream directly. + * 2. **Asynchronous socket creation**: The overriding method can accept the `callback` + * and pass the created socket/stream to it (e.g., `callback(null, newSocket)`). + * If an error occurs during socket creation, it should be passed as the first + * argument to the `callback` (e.g., `callback(err)`). + * + * The agent will call the provided `createConnection` function with `options` and + * this internal `callback`. The `callback` provided by the agent has a signature + * of `(err, stream)`. + * @since v0.11.4 + * @param options Options containing connection details. Check + * `net.createConnection` for the format of the options. For custom agents, + * this object is passed to the custom `createConnection` function. + * @param callback (Optional, primarily for custom agents) A function to be + * called by a custom `createConnection` implementation when the socket is + * created, especially for asynchronous operations. + * @returns The created socket. This is returned by the default + * implementation or by a custom synchronous `createConnection` implementation. + * If a custom `createConnection` uses the `callback` for asynchronous + * operation, this return value might not be the primary way to obtain the socket. + */ + createConnection( + options: ClientRequestArgs, + callback?: (err: Error | null, stream: stream.Duplex) => void, + ): stream.Duplex | null | undefined; + /** + * Called when `socket` is detached from a request and could be persisted by the`Agent`. Default behavior is to: + * + * ```js + * socket.setKeepAlive(true, this.keepAliveMsecs); + * socket.unref(); + * return true; + * ``` + * + * This method can be overridden by a particular `Agent` subclass. If this + * method returns a falsy value, the socket will be destroyed instead of persisting + * it for use with the next request. + * + * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`. + * @since v8.1.0 + */ + keepSocketAlive(socket: stream.Duplex): void; + /** + * Called when `socket` is attached to `request` after being persisted because of + * the keep-alive options. Default behavior is to: + * + * ```js + * socket.ref(); + * ``` + * + * This method can be overridden by a particular `Agent` subclass. + * + * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`. + * @since v8.1.0 + */ + reuseSocket(socket: stream.Duplex, request: ClientRequest): void; + /** + * Get a unique name for a set of request options, to determine whether a + * connection can be reused. For an HTTP agent, this returns`host:port:localAddress` or `host:port:localAddress:family`. For an HTTPS agent, + * the name includes the CA, cert, ciphers, and other HTTPS/TLS-specific options + * that determine socket reusability. + * @since v0.11.4 + * @param options A set of options providing information for name generation + */ + getName(options?: ClientRequestArgs): string; + } + const METHODS: string[]; + const STATUS_CODES: { + [errorCode: number]: string | undefined; + [errorCode: string]: string | undefined; + }; + /** + * Returns a new instance of {@link Server}. + * + * The `requestListener` is a function which is automatically + * added to the `'request'` event. + * + * ```js + * import http from 'node:http'; + * + * // Create a local server to receive data from + * const server = http.createServer((req, res) => { + * res.writeHead(200, { 'Content-Type': 'application/json' }); + * res.end(JSON.stringify({ + * data: 'Hello World!', + * })); + * }); + * + * server.listen(8000); + * ``` + * + * ```js + * import http from 'node:http'; + * + * // Create a local server to receive data from + * const server = http.createServer(); + * + * // Listen to the request event + * server.on('request', (request, res) => { + * res.writeHead(200, { 'Content-Type': 'application/json' }); + * res.end(JSON.stringify({ + * data: 'Hello World!', + * })); + * }); + * + * server.listen(8000); + * ``` + * @since v0.1.13 + */ + function createServer< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse> = typeof ServerResponse, + >(requestListener?: RequestListener): Server; + function createServer< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse> = typeof ServerResponse, + >( + options: ServerOptions, + requestListener?: RequestListener, + ): Server; + // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, + // create interface RequestOptions would make the naming more clear to developers + interface RequestOptions extends ClientRequestArgs {} + /** + * `options` in `socket.connect()` are also supported. + * + * Node.js maintains several connections per server to make HTTP requests. + * This function allows one to transparently issue requests. + * + * `url` can be a string or a `URL` object. If `url` is a + * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. + * + * If both `url` and `options` are specified, the objects are merged, with the `options` properties taking precedence. + * + * The optional `callback` parameter will be added as a one-time listener for + * the `'response'` event. + * + * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to + * upload a file with a POST request, then write to the `ClientRequest` object. + * + * ```js + * import http from 'node:http'; + * import { Buffer } from 'node:buffer'; + * + * const postData = JSON.stringify({ + * 'msg': 'Hello World!', + * }); + * + * const options = { + * hostname: 'www.google.com', + * port: 80, + * path: '/upload', + * method: 'POST', + * headers: { + * 'Content-Type': 'application/json', + * 'Content-Length': Buffer.byteLength(postData), + * }, + * }; + * + * const req = http.request(options, (res) => { + * console.log(`STATUS: ${res.statusCode}`); + * console.log(`HEADERS: ${JSON.stringify(res.headers)}`); + * res.setEncoding('utf8'); + * res.on('data', (chunk) => { + * console.log(`BODY: ${chunk}`); + * }); + * res.on('end', () => { + * console.log('No more data in response.'); + * }); + * }); + * + * req.on('error', (e) => { + * console.error(`problem with request: ${e.message}`); + * }); + * + * // Write data to request body + * req.write(postData); + * req.end(); + * ``` + * + * In the example `req.end()` was called. With `http.request()` one + * must always call `req.end()` to signify the end of the request - + * even if there is no data being written to the request body. + * + * If any error is encountered during the request (be that with DNS resolution, + * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted + * on the returned request object. As with all `'error'` events, if no listeners + * are registered the error will be thrown. + * + * There are a few special headers that should be noted. + * + * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to + * the server should be persisted until the next request. + * * Sending a 'Content-Length' header will disable the default chunked encoding. + * * Sending an 'Expect' header will immediately send the request headers. + * Usually, when sending 'Expect: 100-continue', both a timeout and a listener + * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more + * information. + * * Sending an Authorization header will override using the `auth` option + * to compute basic authentication. + * + * Example using a `URL` as `options`: + * + * ```js + * const options = new URL('http://abc:xyz@example.com'); + * + * const req = http.request(options, (res) => { + * // ... + * }); + * ``` + * + * In a successful request, the following events will be emitted in the following + * order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * (`'data'` will not be emitted at all if the response body is empty, for + * instance, in most redirects) + * * `'end'` on the `res` object + * * `'close'` + * + * In the case of a connection error, the following events will be emitted: + * + * * `'socket'` + * * `'error'` + * * `'close'` + * + * In the case of a premature connection close before the response is received, + * the following events will be emitted in the following order: + * + * * `'socket'` + * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'` + * * `'close'` + * + * In the case of a premature connection close after the response is received, + * the following events will be emitted in the following order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * * (connection closed here) + * * `'aborted'` on the `res` object + * * `'close'` + * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'` + * * `'close'` on the `res` object + * + * If `req.destroy()` is called before a socket is assigned, the following + * events will be emitted in the following order: + * + * * (`req.destroy()` called here) + * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called + * * `'close'` + * + * If `req.destroy()` is called before the connection succeeds, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * (`req.destroy()` called here) + * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called + * * `'close'` + * + * If `req.destroy()` is called after the response is received, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * * (`req.destroy()` called here) + * * `'aborted'` on the `res` object + * * `'close'` + * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called + * * `'close'` on the `res` object + * + * If `req.abort()` is called before a socket is assigned, the following + * events will be emitted in the following order: + * + * * (`req.abort()` called here) + * * `'abort'` + * * `'close'` + * + * If `req.abort()` is called before the connection succeeds, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * (`req.abort()` called here) + * * `'abort'` + * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'` + * * `'close'` + * + * If `req.abort()` is called after the response is received, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * * (`req.abort()` called here) + * * `'abort'` + * * `'aborted'` on the `res` object + * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`. + * * `'close'` + * * `'close'` on the `res` object + * + * Setting the `timeout` option or using the `setTimeout()` function will + * not abort the request or do anything besides add a `'timeout'` event. + * + * Passing an `AbortSignal` and then calling `abort()` on the corresponding `AbortController` will behave the same way as calling `.destroy()` on the + * request. Specifically, the `'error'` event will be emitted with an error with + * the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'` and the `cause`, if one was provided. + * @since v0.3.6 + */ + function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + function request( + url: string | URL, + options: RequestOptions, + callback?: (res: IncomingMessage) => void, + ): ClientRequest; + /** + * Since most requests are GET requests without bodies, Node.js provides this + * convenience method. The only difference between this method and {@link request} is that it sets the method to GET by default and calls `req.end()` automatically. The callback must take care to + * consume the response + * data for reasons stated in {@link ClientRequest} section. + * + * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}. + * + * JSON fetching example: + * + * ```js + * http.get('http://localhost:8000/', (res) => { + * const { statusCode } = res; + * const contentType = res.headers['content-type']; + * + * let error; + * // Any 2xx status code signals a successful response but + * // here we're only checking for 200. + * if (statusCode !== 200) { + * error = new Error('Request Failed.\n' + + * `Status Code: ${statusCode}`); + * } else if (!/^application\/json/.test(contentType)) { + * error = new Error('Invalid content-type.\n' + + * `Expected application/json but received ${contentType}`); + * } + * if (error) { + * console.error(error.message); + * // Consume response data to free up memory + * res.resume(); + * return; + * } + * + * res.setEncoding('utf8'); + * let rawData = ''; + * res.on('data', (chunk) => { rawData += chunk; }); + * res.on('end', () => { + * try { + * const parsedData = JSON.parse(rawData); + * console.log(parsedData); + * } catch (e) { + * console.error(e.message); + * } + * }); + * }).on('error', (e) => { + * console.error(`Got error: ${e.message}`); + * }); + * + * // Create a local server to receive data from + * const server = http.createServer((req, res) => { + * res.writeHead(200, { 'Content-Type': 'application/json' }); + * res.end(JSON.stringify({ + * data: 'Hello World!', + * })); + * }); + * + * server.listen(8000); + * ``` + * @since v0.3.6 + * @param options Accepts the same `options` as {@link request}, with the method set to GET by default. + */ + function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; + /** + * Performs the low-level validations on the provided `name` that are done when `res.setHeader(name, value)` is called. + * + * Passing illegal value as `name` will result in a `TypeError` being thrown, + * identified by `code: 'ERR_INVALID_HTTP_TOKEN'`. + * + * It is not necessary to use this method before passing headers to an HTTP request + * or response. The HTTP module will automatically validate such headers. + * + * Example: + * + * ```js + * import { validateHeaderName } from 'node:http'; + * + * try { + * validateHeaderName(''); + * } catch (err) { + * console.error(err instanceof TypeError); // --> true + * console.error(err.code); // --> 'ERR_INVALID_HTTP_TOKEN' + * console.error(err.message); // --> 'Header name must be a valid HTTP token [""]' + * } + * ``` + * @since v14.3.0 + * @param [label='Header name'] Label for error message. + */ + function validateHeaderName(name: string): void; + /** + * Performs the low-level validations on the provided `value` that are done when `res.setHeader(name, value)` is called. + * + * Passing illegal value as `value` will result in a `TypeError` being thrown. + * + * * Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`. + * * Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`. + * + * It is not necessary to use this method before passing headers to an HTTP request + * or response. The HTTP module will automatically validate such headers. + * + * Examples: + * + * ```js + * import { validateHeaderValue } from 'node:http'; + * + * try { + * validateHeaderValue('x-my-header', undefined); + * } catch (err) { + * console.error(err instanceof TypeError); // --> true + * console.error(err.code === 'ERR_HTTP_INVALID_HEADER_VALUE'); // --> true + * console.error(err.message); // --> 'Invalid value "undefined" for header "x-my-header"' + * } + * + * try { + * validateHeaderValue('x-my-header', 'oʊmɪɡə'); + * } catch (err) { + * console.error(err instanceof TypeError); // --> true + * console.error(err.code === 'ERR_INVALID_CHAR'); // --> true + * console.error(err.message); // --> 'Invalid character in header content ["x-my-header"]' + * } + * ``` + * @since v14.3.0 + * @param name Header name + * @param value Header value + */ + function validateHeaderValue(name: string, value: string): void; + /** + * Set the maximum number of idle HTTP parsers. + * @since v18.8.0, v16.18.0 + * @param [max=1000] + */ + function setMaxIdleHTTPParsers(max: number): void; + /** + * Dynamically resets the global configurations to enable built-in proxy support for + * `fetch()` and `http.request()`/`https.request()` at runtime, as an alternative + * to using the `--use-env-proxy` flag or `NODE_USE_ENV_PROXY` environment variable. + * It can also be used to override settings configured from the environment variables. + * + * As this function resets the global configurations, any previously configured + * `http.globalAgent`, `https.globalAgent` or undici global dispatcher would be + * overridden after this function is invoked. It's recommended to invoke it before any + * requests are made and avoid invoking it in the middle of any requests. + * + * See [Built-in Proxy Support](https://nodejs.org/docs/latest-v25.x/api/http.html#built-in-proxy-support) for details on proxy URL formats and `NO_PROXY` + * syntax. + * @since v25.4.0 + * @param proxyEnv An object containing proxy configuration. This accepts the + * same options as the `proxyEnv` option accepted by {@link Agent}. **Default:** + * `process.env`. + * @returns A function that restores the original agent and dispatcher + * settings to the state before this `http.setGlobalProxyFromEnv()` is invoked. + */ + function setGlobalProxyFromEnv(proxyEnv?: ProxyEnv): () => void; + /** + * Global instance of `Agent` which is used as the default for all HTTP client + * requests. Diverges from a default `Agent` configuration by having `keepAlive` + * enabled and a `timeout` of 5 seconds. + * @since v0.5.9 + */ + let globalAgent: Agent; + /** + * Read-only property specifying the maximum allowed size of HTTP headers in bytes. + * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option. + */ + const maxHeaderSize: number; + /** + * A browser-compatible implementation of `WebSocket`. + * @since v22.5.0 + */ + const WebSocket: typeof import("undici-types").WebSocket; + /** + * @since v22.5.0 + */ + const CloseEvent: typeof import("undici-types").CloseEvent; + /** + * @since v22.5.0 + */ + const MessageEvent: typeof import("undici-types").MessageEvent; +} +declare module "http" { + export * from "node:http"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/http2.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/http2.d.ts new file mode 100644 index 0000000..4130bfe --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/http2.d.ts @@ -0,0 +1,2480 @@ +/** + * The `node:http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. + * It can be accessed using: + * + * ```js + * import http2 from 'node:http2'; + * ``` + * @since v8.4.0 + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/http2.js) + */ +declare module "node:http2" { + import { NonSharedBuffer } from "node:buffer"; + import { InternalEventEmitter } from "node:events"; + import * as fs from "node:fs"; + import * as net from "node:net"; + import * as stream from "node:stream"; + import * as tls from "node:tls"; + import * as url from "node:url"; + import { + IncomingHttpHeaders as Http1IncomingHttpHeaders, + IncomingMessage, + OutgoingHttpHeaders, + ServerResponse, + } from "node:http"; + interface IncomingHttpStatusHeader { + ":status"?: number | undefined; + } + interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { + ":path"?: string | undefined; + ":method"?: string | undefined; + ":authority"?: string | undefined; + ":scheme"?: string | undefined; + } + // Http2Stream + interface StreamState { + localWindowSize?: number | undefined; + state?: number | undefined; + localClose?: number | undefined; + remoteClose?: number | undefined; + /** @deprecated */ + sumDependencyWeight?: number | undefined; + /** @deprecated */ + weight?: number | undefined; + } + interface ServerStreamResponseOptions { + endStream?: boolean | undefined; + waitForTrailers?: boolean | undefined; + } + interface StatOptions { + offset: number; + length: number; + } + interface ServerStreamFileResponseOptions { + statCheck?: + | ((stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions) => void) + | undefined; + waitForTrailers?: boolean | undefined; + offset?: number | undefined; + length?: number | undefined; + } + interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { + onError?: ((err: NodeJS.ErrnoException) => void) | undefined; + } + interface Http2StreamEventMap extends stream.DuplexEventMap { + "aborted": []; + "data": [chunk: string | NonSharedBuffer]; + "frameError": [type: number, code: number, id: number]; + "ready": []; + "streamClosed": [code: number]; + "timeout": []; + "trailers": [trailers: IncomingHttpHeaders, flags: number]; + "wantTrailers": []; + } + interface Http2Stream extends stream.Duplex { + /** + * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, + * the `'aborted'` event will have been emitted. + * @since v8.4.0 + */ + readonly aborted: boolean; + /** + * This property shows the number of characters currently buffered to be written. + * See `net.Socket.bufferSize` for details. + * @since v11.2.0, v10.16.0 + */ + readonly bufferSize: number; + /** + * Set to `true` if the `Http2Stream` instance has been closed. + * @since v9.4.0 + */ + readonly closed: boolean; + /** + * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer + * usable. + * @since v8.4.0 + */ + readonly destroyed: boolean; + /** + * Set to `true` if the `END_STREAM` flag was set in the request or response + * HEADERS frame received, indicating that no additional data should be received + * and the readable side of the `Http2Stream` will be closed. + * @since v10.11.0 + */ + readonly endAfterHeaders: boolean; + /** + * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined` if the stream identifier has not yet been assigned. + * @since v8.4.0 + */ + readonly id?: number | undefined; + /** + * Set to `true` if the `Http2Stream` instance has not yet been assigned a + * numeric stream identifier. + * @since v9.4.0 + */ + readonly pending: boolean; + /** + * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is + * destroyed after either receiving an `RST_STREAM` frame from the connected peer, + * calling `http2stream.close()`, or `http2stream.destroy()`. Will be `undefined` if the `Http2Stream` has not been closed. + * @since v8.4.0 + */ + readonly rstCode: number; + /** + * An object containing the outbound headers sent for this `Http2Stream`. + * @since v9.5.0 + */ + readonly sentHeaders: OutgoingHttpHeaders; + /** + * An array of objects containing the outbound informational (additional) headers + * sent for this `Http2Stream`. + * @since v9.5.0 + */ + readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined; + /** + * An object containing the outbound trailers sent for this `HttpStream`. + * @since v9.5.0 + */ + readonly sentTrailers?: OutgoingHttpHeaders | undefined; + /** + * A reference to the `Http2Session` instance that owns this `Http2Stream`. The + * value will be `undefined` after the `Http2Stream` instance is destroyed. + * @since v8.4.0 + */ + readonly session: Http2Session | undefined; + /** + * Provides miscellaneous information about the current state of the `Http2Stream`. + * + * A current state of this `Http2Stream`. + * @since v8.4.0 + */ + readonly state: StreamState; + /** + * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the + * connected HTTP/2 peer. + * @since v8.4.0 + * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code. + * @param callback An optional function registered to listen for the `'close'` event. + */ + close(code?: number, callback?: () => void): void; + /** + * @deprecated Priority signaling is no longer supported in Node.js. + */ + priority(options: unknown): void; + /** + * ```js + * import http2 from 'node:http2'; + * const client = http2.connect('http://example.org:8000'); + * const { NGHTTP2_CANCEL } = http2.constants; + * const req = client.request({ ':path': '/' }); + * + * // Cancel the stream if there's no activity after 5 seconds + * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); + * ``` + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + /** + * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method + * will cause the `Http2Stream` to be immediately closed and must only be + * called after the `'wantTrailers'` event has been emitted. When sending a + * request or sending a response, the `options.waitForTrailers` option must be set + * in order to keep the `Http2Stream` open after the final `DATA` frame so that + * trailers can be sent. + * + * ```js + * import http2 from 'node:http2'; + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond(undefined, { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ xyz: 'abc' }); + * }); + * stream.end('Hello World'); + * }); + * ``` + * + * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header + * fields (e.g. `':method'`, `':path'`, etc). + * @since v10.0.0 + */ + sendTrailers(headers: OutgoingHttpHeaders): void; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: Http2StreamEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: Http2StreamEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: Http2StreamEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: Http2StreamEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: Http2StreamEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: Http2StreamEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: Http2StreamEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: Http2StreamEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: Http2StreamEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: Http2StreamEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: Http2StreamEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface ClientHttp2StreamEventMap extends Http2StreamEventMap { + "continue": []; + "headers": [headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number, rawHeaders: string[]]; + "push": [headers: IncomingHttpHeaders, flags: number]; + "response": [headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number, rawHeaders: string[]]; + } + interface ClientHttp2Stream extends Http2Stream { + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ClientHttp2StreamEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ClientHttp2StreamEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: ClientHttp2StreamEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: ClientHttp2StreamEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface ServerHttp2Stream extends Http2Stream { + /** + * True if headers were sent, false otherwise (read-only). + * @since v8.4.0 + */ + readonly headersSent: boolean; + /** + * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote + * client's most recent `SETTINGS` frame. Will be `true` if the remote peer + * accepts push streams, `false` otherwise. Settings are the same for every `Http2Stream` in the same `Http2Session`. + * @since v8.4.0 + */ + readonly pushAllowed: boolean; + /** + * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. + * @since v8.4.0 + */ + additionalHeaders(headers: OutgoingHttpHeaders): void; + /** + * Initiates a push stream. The callback is invoked with the new `Http2Stream` instance created for the push stream passed as the second argument, or an `Error` passed as the first argument. + * + * ```js + * import http2 from 'node:http2'; + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond({ ':status': 200 }); + * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { + * if (err) throw err; + * pushStream.respond({ ':status': 200 }); + * pushStream.end('some pushed data'); + * }); + * stream.end('some data'); + * }); + * ``` + * + * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass + * a `weight` value to `http2stream.priority` with the `silent` option set to `true` to enable server-side bandwidth balancing between concurrent streams. + * + * Calling `http2stream.pushStream()` from within a pushed stream is not permitted + * and will throw an error. + * @since v8.4.0 + * @param callback Callback that is called once the push stream has been initiated. + */ + pushStream( + headers: OutgoingHttpHeaders, + callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void, + ): void; + pushStream( + headers: OutgoingHttpHeaders, + options?: Pick, + callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void, + ): void; + /** + * ```js + * import http2 from 'node:http2'; + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond({ ':status': 200 }); + * stream.end('some data'); + * }); + * ``` + * + * Initiates a response. When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * will be emitted immediately after queuing the last chunk of payload data to be sent. + * The `http2stream.sendTrailers()` method can then be used to send trailing header fields to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code must call either `http2stream.sendTrailers()` or `http2stream.close()` to close the `Http2Stream`. + * + * ```js + * import http2 from 'node:http2'; + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond({ ':status': 200 }, { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ ABC: 'some value to send' }); + * }); + * stream.end('some data'); + * }); + * ``` + * @since v8.4.0 + */ + respond(headers?: OutgoingHttpHeaders | readonly string[], options?: ServerStreamResponseOptions): void; + /** + * Initiates a response whose data is read from the given file descriptor. No + * validation is performed on the given file descriptor. If an error occurs while + * attempting to read data using the file descriptor, the `Http2Stream` will be + * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. + * + * When used, the `Http2Stream` object's `Duplex` interface will be closed + * automatically. + * + * ```js + * import http2 from 'node:http2'; + * import fs from 'node:fs'; + * + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * const fd = fs.openSync('/some/file', 'r'); + * + * const stat = fs.fstatSync(fd); + * const headers = { + * 'content-length': stat.size, + * 'last-modified': stat.mtime.toUTCString(), + * 'content-type': 'text/plain; charset=utf-8', + * }; + * stream.respondWithFD(fd, headers); + * stream.on('close', () => fs.closeSync(fd)); + * }); + * ``` + * + * The optional `options.statCheck` function may be specified to give user code + * an opportunity to set additional content headers based on the `fs.Stat` details + * of the given fd. If the `statCheck` function is provided, the `http2stream.respondWithFD()` method will + * perform an `fs.fstat()` call to collect details on the provided file descriptor. + * + * The `offset` and `length` options may be used to limit the response to a + * specific range subset. This can be used, for instance, to support HTTP Range + * requests. + * + * The file descriptor or `FileHandle` is not closed when the stream is closed, + * so it will need to be closed manually once it is no longer needed. + * Using the same file descriptor concurrently for multiple streams + * is not supported and may result in data loss. Re-using a file descriptor + * after a stream has finished is supported. + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * will be emitted immediately after queuing the last chunk of payload data to be + * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing + * header fields to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code _must_ call either `http2stream.sendTrailers()` + * or `http2stream.close()` to close the `Http2Stream`. + * + * ```js + * import http2 from 'node:http2'; + * import fs from 'node:fs'; + * + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * const fd = fs.openSync('/some/file', 'r'); + * + * const stat = fs.fstatSync(fd); + * const headers = { + * 'content-length': stat.size, + * 'last-modified': stat.mtime.toUTCString(), + * 'content-type': 'text/plain; charset=utf-8', + * }; + * stream.respondWithFD(fd, headers, { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ ABC: 'some value to send' }); + * }); + * + * stream.on('close', () => fs.closeSync(fd)); + * }); + * ``` + * @since v8.4.0 + * @param fd A readable file descriptor. + */ + respondWithFD( + fd: number | fs.promises.FileHandle, + headers?: OutgoingHttpHeaders, + options?: ServerStreamFileResponseOptions, + ): void; + /** + * Sends a regular file as the response. The `path` must specify a regular file + * or an `'error'` event will be emitted on the `Http2Stream` object. + * + * When used, the `Http2Stream` object's `Duplex` interface will be closed + * automatically. + * + * The optional `options.statCheck` function may be specified to give user code + * an opportunity to set additional content headers based on the `fs.Stat` details + * of the given file: + * + * If an error occurs while attempting to read the file data, the `Http2Stream` will be closed using an + * `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. + * If the `onError` callback is defined, then it will be called. Otherwise, the stream will be destroyed. + * + * Example using a file path: + * + * ```js + * import http2 from 'node:http2'; + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * function statCheck(stat, headers) { + * headers['last-modified'] = stat.mtime.toUTCString(); + * } + * + * function onError(err) { + * // stream.respond() can throw if the stream has been destroyed by + * // the other side. + * try { + * if (err.code === 'ENOENT') { + * stream.respond({ ':status': 404 }); + * } else { + * stream.respond({ ':status': 500 }); + * } + * } catch (err) { + * // Perform actual error handling. + * console.error(err); + * } + * stream.end(); + * } + * + * stream.respondWithFile('/some/file', + * { 'content-type': 'text/plain; charset=utf-8' }, + * { statCheck, onError }); + * }); + * ``` + * + * The `options.statCheck` function may also be used to cancel the send operation + * by returning `false`. For instance, a conditional request may check the stat + * results to determine if the file has been modified to return an appropriate `304` response: + * + * ```js + * import http2 from 'node:http2'; + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * function statCheck(stat, headers) { + * // Check the stat here... + * stream.respond({ ':status': 304 }); + * return false; // Cancel the send operation + * } + * stream.respondWithFile('/some/file', + * { 'content-type': 'text/plain; charset=utf-8' }, + * { statCheck }); + * }); + * ``` + * + * The `content-length` header field will be automatically set. + * + * The `offset` and `length` options may be used to limit the response to a + * specific range subset. This can be used, for instance, to support HTTP Range + * requests. + * + * The `options.onError` function may also be used to handle all the errors + * that could happen before the delivery of the file is initiated. The + * default behavior is to destroy the stream. + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * will be emitted immediately after queuing the last chunk of payload data to be + * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing + * header fields to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * ```js + * import http2 from 'node:http2'; + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respondWithFile('/some/file', + * { 'content-type': 'text/plain; charset=utf-8' }, + * { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ ABC: 'some value to send' }); + * }); + * }); + * ``` + * @since v8.4.0 + */ + respondWithFile( + path: string, + headers?: OutgoingHttpHeaders, + options?: ServerStreamFileResponseOptionsWithError, + ): void; + } + // Http2Session + interface Settings { + headerTableSize?: number | undefined; + enablePush?: boolean | undefined; + initialWindowSize?: number | undefined; + maxFrameSize?: number | undefined; + maxConcurrentStreams?: number | undefined; + maxHeaderListSize?: number | undefined; + enableConnectProtocol?: boolean | undefined; + } + interface ClientSessionRequestOptions { + endStream?: boolean | undefined; + exclusive?: boolean | undefined; + parent?: number | undefined; + waitForTrailers?: boolean | undefined; + signal?: AbortSignal | undefined; + } + interface SessionState { + effectiveLocalWindowSize?: number | undefined; + effectiveRecvDataLength?: number | undefined; + nextStreamID?: number | undefined; + localWindowSize?: number | undefined; + lastProcStreamID?: number | undefined; + remoteWindowSize?: number | undefined; + outboundQueueSize?: number | undefined; + deflateDynamicTableSize?: number | undefined; + inflateDynamicTableSize?: number | undefined; + } + interface Http2SessionEventMap { + "close": []; + "connect": [session: Http2Session, socket: net.Socket | tls.TLSSocket]; + "error": [err: Error]; + "frameError": [type: number, code: number, id: number]; + "goaway": [errorCode: number, lastStreamID: number, opaqueData?: NonSharedBuffer]; + "localSettings": [settings: Settings]; + "ping": [payload: Buffer]; + "remoteSettings": [settings: Settings]; + "stream": [ + stream: Http2Stream, + headers: IncomingHttpHeaders & IncomingHttpStatusHeader, + flags: number, + rawHeaders: string[], + ]; + "timeout": []; + } + interface Http2Session extends InternalEventEmitter { + /** + * Value will be `undefined` if the `Http2Session` is not yet connected to a + * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or + * will return the value of the connected `TLSSocket`'s own `alpnProtocol` property. + * @since v9.4.0 + */ + readonly alpnProtocol?: string | undefined; + /** + * Will be `true` if this `Http2Session` instance has been closed, otherwise `false`. + * @since v9.4.0 + */ + readonly closed: boolean; + /** + * Will be `true` if this `Http2Session` instance is still connecting, will be set + * to `false` before emitting `connect` event and/or calling the `http2.connect` callback. + * @since v10.0.0 + */ + readonly connecting: boolean; + /** + * Will be `true` if this `Http2Session` instance has been destroyed and must no + * longer be used, otherwise `false`. + * @since v8.4.0 + */ + readonly destroyed: boolean; + /** + * Value is `undefined` if the `Http2Session` session socket has not yet been + * connected, `true` if the `Http2Session` is connected with a `TLSSocket`, + * and `false` if the `Http2Session` is connected to any other kind of socket + * or stream. + * @since v9.4.0 + */ + readonly encrypted?: boolean | undefined; + /** + * A prototype-less object describing the current local settings of this `Http2Session`. + * The local settings are local to _this_`Http2Session` instance. + * @since v8.4.0 + */ + readonly localSettings: Settings; + /** + * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property + * will return an `Array` of origins for which the `Http2Session` may be + * considered authoritative. + * + * The `originSet` property is only available when using a secure TLS connection. + * @since v9.4.0 + */ + readonly originSet?: string[] | undefined; + /** + * Indicates whether the `Http2Session` is currently waiting for acknowledgment of + * a sent `SETTINGS` frame. Will be `true` after calling the `http2session.settings()` method. + * Will be `false` once all sent `SETTINGS` frames have been acknowledged. + * @since v8.4.0 + */ + readonly pendingSettingsAck: boolean; + /** + * A prototype-less object describing the current remote settings of this`Http2Session`. + * The remote settings are set by the _connected_ HTTP/2 peer. + * @since v8.4.0 + */ + readonly remoteSettings: Settings; + /** + * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but + * limits available methods to ones safe to use with HTTP/2. + * + * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw + * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. + * + * `setTimeout` method will be called on this `Http2Session`. + * + * All other interactions will be routed directly to the socket. + * @since v8.4.0 + */ + readonly socket: net.Socket | tls.TLSSocket; + /** + * Provides miscellaneous information about the current state of the`Http2Session`. + * + * An object describing the current status of this `Http2Session`. + * @since v8.4.0 + */ + readonly state: SessionState; + /** + * The `http2session.type` will be equal to `http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a + * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a + * client. + * @since v8.4.0 + */ + readonly type: number; + /** + * Gracefully closes the `Http2Session`, allowing any existing streams to + * complete on their own and preventing new `Http2Stream` instances from being + * created. Once closed, `http2session.destroy()`_might_ be called if there + * are no open `Http2Stream` instances. + * + * If specified, the `callback` function is registered as a handler for the`'close'` event. + * @since v9.4.0 + */ + close(callback?: () => void): void; + /** + * Immediately terminates the `Http2Session` and the associated `net.Socket` or `tls.TLSSocket`. + * + * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error` is not undefined, an `'error'` event will be emitted immediately before the `'close'` event. + * + * If there are any remaining open `Http2Streams` associated with the `Http2Session`, those will also be destroyed. + * @since v8.4.0 + * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. + * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. + */ + destroy(error?: Error, code?: number): void; + /** + * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`. + * @since v9.4.0 + * @param code An HTTP/2 error code + * @param lastStreamID The numeric ID of the last processed `Http2Stream` + * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame. + */ + goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; + /** + * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must + * be provided. The method will return `true` if the `PING` was sent, `false` otherwise. + * + * The maximum number of outstanding (unacknowledged) pings is determined by the `maxOutstandingPings` configuration option. The default maximum is 10. + * + * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView` containing 8 bytes of data that will be transmitted with the `PING` and + * returned with the ping acknowledgment. + * + * The callback will be invoked with three arguments: an error argument that will + * be `null` if the `PING` was successfully acknowledged, a `duration` argument + * that reports the number of milliseconds elapsed since the ping was sent and the + * acknowledgment was received, and a `Buffer` containing the 8-byte `PING` payload. + * + * ```js + * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { + * if (!err) { + * console.log(`Ping acknowledged in ${duration} milliseconds`); + * console.log(`With payload '${payload.toString()}'`); + * } + * }); + * ``` + * + * If the `payload` argument is not specified, the default payload will be the + * 64-bit timestamp (little endian) marking the start of the `PING` duration. + * @since v8.9.3 + * @param payload Optional ping payload. + */ + ping(callback: (err: Error | null, duration: number, payload: NonSharedBuffer) => void): boolean; + ping( + payload: NodeJS.ArrayBufferView, + callback: (err: Error | null, duration: number, payload: NonSharedBuffer) => void, + ): boolean; + /** + * Calls `ref()` on this `Http2Session` instance's underlying `net.Socket`. + * @since v9.4.0 + */ + ref(): void; + /** + * Sets the local endpoint's window size. + * The `windowSize` is the total window size to set, not + * the delta. + * + * ```js + * import http2 from 'node:http2'; + * + * const server = http2.createServer(); + * const expectedWindowSize = 2 ** 20; + * server.on('connect', (session) => { + * + * // Set local window size to be 2 ** 20 + * session.setLocalWindowSize(expectedWindowSize); + * }); + * ``` + * @since v15.3.0, v14.18.0 + */ + setLocalWindowSize(windowSize: number): void; + /** + * Used to set a callback function that is called when there is no activity on + * the `Http2Session` after `msecs` milliseconds. The given `callback` is + * registered as a listener on the `'timeout'` event. + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + /** + * Updates the current local settings for this `Http2Session` and sends a new `SETTINGS` frame to the connected HTTP/2 peer. + * + * Once called, the `http2session.pendingSettingsAck` property will be `true` while the session is waiting for the remote peer to acknowledge the new + * settings. + * + * The new settings will not become effective until the `SETTINGS` acknowledgment + * is received and the `'localSettings'` event is emitted. It is possible to send + * multiple `SETTINGS` frames while acknowledgment is still pending. + * @since v8.4.0 + * @param callback Callback that is called once the session is connected or right away if the session is already connected. + */ + settings( + settings: Settings, + callback?: (err: Error | null, settings: Settings, duration: number) => void, + ): void; + /** + * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`. + * @since v9.4.0 + */ + unref(): void; + } + interface ClientHttp2SessionEventMap extends Http2SessionEventMap { + "altsvc": [alt: string, origin: string, streamId: number]; + "connect": [session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket]; + "origin": [origins: string[]]; + "stream": [ + stream: ClientHttp2Stream, + headers: IncomingHttpHeaders & IncomingHttpStatusHeader, + flags: number, + rawHeaders: string[], + ]; + } + interface ClientHttp2Session extends Http2Session { + /** + * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()` creates and returns an `Http2Stream` instance that can be used to send an + * HTTP/2 request to the connected server. + * + * When a `ClientHttp2Session` is first created, the socket may not yet be + * connected. if `clienthttp2session.request()` is called during this time, the + * actual request will be deferred until the socket is ready to go. + * If the `session` is closed before the actual request be executed, an `ERR_HTTP2_GOAWAY_SESSION` is thrown. + * + * This method is only available if `http2session.type` is equal to `http2.constants.NGHTTP2_SESSION_CLIENT`. + * + * ```js + * import http2 from 'node:http2'; + * const clientSession = http2.connect('https://localhost:1234'); + * const { + * HTTP2_HEADER_PATH, + * HTTP2_HEADER_STATUS, + * } = http2.constants; + * + * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); + * req.on('response', (headers) => { + * console.log(headers[HTTP2_HEADER_STATUS]); + * req.on('data', (chunk) => { // .. }); + * req.on('end', () => { // .. }); + * }); + * ``` + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * is emitted immediately after queuing the last chunk of payload data to be sent. + * The `http2stream.sendTrailers()` method can then be called to send trailing + * headers to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * When `options.signal` is set with an `AbortSignal` and then `abort` on the + * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error. + * + * The `:method` and `:path` pseudo-headers are not specified within `headers`, + * they respectively default to: + * + * * `:method` \= `'GET'` + * * `:path` \= `/` + * @since v8.4.0 + */ + request( + headers?: OutgoingHttpHeaders | readonly string[], + options?: ClientSessionRequestOptions, + ): ClientHttp2Stream; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ClientHttp2StreamEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ClientHttp2StreamEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: ClientHttp2StreamEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: ClientHttp2StreamEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface AlternativeServiceOptions { + origin: number | string | url.URL; + } + interface ServerHttp2SessionEventMap< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + > extends Http2SessionEventMap { + "connect": [ + session: ServerHttp2Session, + socket: net.Socket | tls.TLSSocket, + ]; + "stream": [stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number, rawHeaders: string[]]; + } + interface ServerHttp2Session< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + > extends Http2Session { + readonly server: + | Http2Server + | Http2SecureServer; + /** + * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client. + * + * ```js + * import http2 from 'node:http2'; + * + * const server = http2.createServer(); + * server.on('session', (session) => { + * // Set altsvc for origin https://example.org:80 + * session.altsvc('h2=":8000"', 'https://example.org:80'); + * }); + * + * server.on('stream', (stream) => { + * // Set altsvc for a specific stream + * stream.session.altsvc('h2=":8000"', stream.id); + * }); + * ``` + * + * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate + * service is associated with the origin of the given `Http2Stream`. + * + * The `alt` and origin string _must_ contain only ASCII bytes and are + * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given + * domain. + * + * When a string is passed for the `originOrStream` argument, it will be parsed as + * a URL and the origin will be derived. For instance, the origin for the + * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string + * cannot be parsed as a URL or if a valid origin cannot be derived. + * + * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be + * used. The value of the `origin` property _must_ be a properly serialized + * ASCII origin. + * @since v9.4.0 + * @param alt A description of the alternative service configuration as defined by `RFC 7838`. + * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the + * `http2stream.id` property. + */ + altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; + /** + * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client + * to advertise the set of origins for which the server is capable of providing + * authoritative responses. + * + * ```js + * import http2 from 'node:http2'; + * const options = getSecureOptionsSomehow(); + * const server = http2.createSecureServer(options); + * server.on('stream', (stream) => { + * stream.respond(); + * stream.end('ok'); + * }); + * server.on('session', (session) => { + * session.origin('https://example.com', 'https://example.org'); + * }); + * ``` + * + * When a string is passed as an `origin`, it will be parsed as a URL and the + * origin will be derived. For instance, the origin for the HTTP URL `'https://example.org/foo/bar'` is the ASCII string` 'https://example.org'`. An error will be thrown if either the given + * string + * cannot be parsed as a URL or if a valid origin cannot be derived. + * + * A `URL` object, or any object with an `origin` property, may be passed as + * an `origin`, in which case the value of the `origin` property will be + * used. The value of the `origin` property _must_ be a properly serialized + * ASCII origin. + * + * Alternatively, the `origins` option may be used when creating a new HTTP/2 + * server using the `http2.createSecureServer()` method: + * + * ```js + * import http2 from 'node:http2'; + * const options = getSecureOptionsSomehow(); + * options.origins = ['https://example.com', 'https://example.org']; + * const server = http2.createSecureServer(options); + * server.on('stream', (stream) => { + * stream.respond(); + * stream.end('ok'); + * }); + * ``` + * @since v10.12.0 + * @param origins One or more URL Strings passed as separate arguments. + */ + origin( + ...origins: Array< + | string + | url.URL + | { + origin: string; + } + > + ): void; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: ( + ...args: ServerHttp2SessionEventMap[E] + ) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit( + eventName: E, + ...args: ServerHttp2SessionEventMap[E] + ): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: ( + ...args: ServerHttp2SessionEventMap[E] + ) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): (( + ...args: ServerHttp2SessionEventMap[E] + ) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: ( + ...args: ServerHttp2SessionEventMap[E] + ) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: ( + ...args: ServerHttp2SessionEventMap[E] + ) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: ( + ...args: ServerHttp2SessionEventMap[E] + ) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: ( + ...args: ServerHttp2SessionEventMap[E] + ) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: ( + ...args: ServerHttp2SessionEventMap[E] + ) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): (( + ...args: ServerHttp2SessionEventMap[E] + ) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: ( + ...args: ServerHttp2SessionEventMap[E] + ) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + // Http2Server + interface SessionOptions { + /** + * Sets the maximum dynamic table size for deflating header fields. + * @default 4Kib + */ + maxDeflateDynamicTableSize?: number | undefined; + /** + * Sets the maximum number of settings entries per `SETTINGS` frame. + * The minimum value allowed is `1`. + * @default 32 + */ + maxSettings?: number | undefined; + /** + * Sets the maximum memory that the `Http2Session` is permitted to use. + * The value is expressed in terms of number of megabytes, e.g. `1` equal 1 megabyte. + * The minimum value allowed is `1`. + * This is a credit based limit, existing `Http2Stream`s may cause this limit to be exceeded, + * but new `Http2Stream` instances will be rejected while this limit is exceeded. + * The current number of `Http2Stream` sessions, the current memory use of the header compression tables, + * current data queued to be sent, and unacknowledged `PING` and `SETTINGS` frames are all counted towards the current limit. + * @default 10 + */ + maxSessionMemory?: number | undefined; + /** + * Sets the maximum number of header entries. + * This is similar to `server.maxHeadersCount` or `request.maxHeadersCount` in the `node:http` module. + * The minimum value is `1`. + * @default 128 + */ + maxHeaderListPairs?: number | undefined; + /** + * Sets the maximum number of outstanding, unacknowledged pings. + * @default 10 + */ + maxOutstandingPings?: number | undefined; + /** + * Sets the maximum allowed size for a serialized, compressed block of headers. + * Attempts to send headers that exceed this limit will result in + * a `'frameError'` event being emitted and the stream being closed and destroyed. + */ + maxSendHeaderBlockLength?: number | undefined; + /** + * Strategy used for determining the amount of padding to use for `HEADERS` and `DATA` frames. + * @default http2.constants.PADDING_STRATEGY_NONE + */ + paddingStrategy?: number | undefined; + /** + * Sets the maximum number of concurrent streams for the remote peer as if a `SETTINGS` frame had been received. + * Will be overridden if the remote peer sets its own value for `maxConcurrentStreams`. + * @default 100 + */ + peerMaxConcurrentStreams?: number | undefined; + /** + * The initial settings to send to the remote peer upon connection. + */ + settings?: Settings | undefined; + /** + * The array of integer values determines the settings types, + * which are included in the `CustomSettings`-property of the received remoteSettings. + * Please see the `CustomSettings`-property of the `Http2Settings` object for more information, on the allowed setting types. + */ + remoteCustomSettings?: number[] | undefined; + /** + * Specifies a timeout in milliseconds that + * a server should wait when an [`'unknownProtocol'`][] is emitted. If the + * socket has not been destroyed by that time the server will destroy it. + * @default 100000 + */ + unknownProtocolTimeout?: number | undefined; + /** + * If `true`, it turns on strict leading + * and trailing whitespace validation for HTTP/2 header field names and values + * as per [RFC-9113](https://www.rfc-editor.org/rfc/rfc9113.html#section-8.2.1). + * @since v24.2.0 + * @default true + */ + strictFieldWhitespaceValidation?: boolean | undefined; + } + interface ClientSessionOptions extends SessionOptions { + /** + * Sets the maximum number of reserved push streams the client will accept at any given time. + * Once the current number of currently reserved push streams exceeds reaches this limit, + * new push streams sent by the server will be automatically rejected. + * The minimum allowed value is 0. The maximum allowed value is 232-1. + * A negative value sets this option to the maximum allowed value. + * @default 200 + */ + maxReservedRemoteStreams?: number | undefined; + /** + * An optional callback that receives the `URL` instance passed to `connect` and the `options` object, + * and returns any `Duplex` stream that is to be used as the connection for this session. + */ + createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined; + /** + * The protocol to connect with, if not set in the `authority`. + * Value may be either `'http:'` or `'https:'`. + * @default 'https:' + */ + protocol?: "http:" | "https:" | undefined; + } + interface ServerSessionOptions< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + > extends SessionOptions { + streamResetBurst?: number | undefined; + streamResetRate?: number | undefined; + Http1IncomingMessage?: Http1Request | undefined; + Http1ServerResponse?: Http1Response | undefined; + Http2ServerRequest?: Http2Request | undefined; + Http2ServerResponse?: Http2Response | undefined; + } + interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} + interface SecureServerSessionOptions< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + > extends ServerSessionOptions, tls.TlsOptions {} + interface ServerOptions< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + > extends ServerSessionOptions {} + interface SecureServerOptions< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + > extends SecureServerSessionOptions { + allowHTTP1?: boolean | undefined; + origins?: string[] | undefined; + } + interface Http2ServerCommon { + setTimeout(msec?: number, callback?: () => void): this; + /** + * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. + * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. + */ + updateSettings(settings: Settings): void; + } + interface Http2ServerEventMap< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + > extends net.ServerEventMap, Pick { + "checkContinue": [request: InstanceType, response: InstanceType]; + "request": [request: InstanceType, response: InstanceType]; + "session": [session: ServerHttp2Session]; + "sessionError": [err: Error]; + } + interface Http2Server< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + > extends net.Server, Http2ServerCommon { + // #region InternalEventEmitter + addListener( + eventName: E, + listener: ( + ...args: Http2ServerEventMap[E] + ) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit( + eventName: E, + ...args: Http2ServerEventMap[E] + ): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: ( + ...args: Http2ServerEventMap[E] + ) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: Http2ServerEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: ( + ...args: Http2ServerEventMap[E] + ) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: ( + ...args: Http2ServerEventMap[E] + ) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: ( + ...args: Http2ServerEventMap[E] + ) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: ( + ...args: Http2ServerEventMap[E] + ) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: ( + ...args: Http2ServerEventMap[E] + ) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: Http2ServerEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: ( + ...args: Http2ServerEventMap[E] + ) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface Http2SecureServerEventMap< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + > extends tls.ServerEventMap, Http2ServerEventMap { + "unknownProtocol": [socket: tls.TLSSocket]; + } + interface Http2SecureServer< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + > extends tls.Server, Http2ServerCommon { + // #region InternalEventEmitter + addListener( + eventName: E, + listener: ( + ...args: Http2SecureServerEventMap[E] + ) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit( + eventName: E, + ...args: Http2SecureServerEventMap[E] + ): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: ( + ...args: Http2SecureServerEventMap[E] + ) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): (( + ...args: Http2SecureServerEventMap[E] + ) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: ( + ...args: Http2SecureServerEventMap[E] + ) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: ( + ...args: Http2SecureServerEventMap[E] + ) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: ( + ...args: Http2SecureServerEventMap[E] + ) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: ( + ...args: Http2SecureServerEventMap[E] + ) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: ( + ...args: Http2SecureServerEventMap[E] + ) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): (( + ...args: Http2SecureServerEventMap[E] + ) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: ( + ...args: Http2SecureServerEventMap[E] + ) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface Http2ServerRequestEventMap extends stream.ReadableEventMap { + "aborted": [hadError: boolean, code: number]; + "data": [chunk: string | NonSharedBuffer]; + } + /** + * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, + * headers, and + * data. + * @since v8.4.0 + */ + class Http2ServerRequest extends stream.Readable { + constructor( + stream: ServerHttp2Stream, + headers: IncomingHttpHeaders, + options: stream.ReadableOptions, + rawHeaders: readonly string[], + ); + /** + * The `request.aborted` property will be `true` if the request has + * been aborted. + * @since v10.1.0 + */ + readonly aborted: boolean; + /** + * The request authority pseudo header field. Because HTTP/2 allows requests + * to set either `:authority` or `host`, this value is derived from `req.headers[':authority']` if present. Otherwise, it is derived from `req.headers['host']`. + * @since v8.4.0 + */ + readonly authority: string; + /** + * See `request.socket`. + * @since v8.4.0 + * @deprecated Since v13.0.0 - Use `socket`. + */ + readonly connection: net.Socket | tls.TLSSocket; + /** + * The `request.complete` property will be `true` if the request has + * been completed, aborted, or destroyed. + * @since v12.10.0 + */ + readonly complete: boolean; + /** + * The request/response headers object. + * + * Key-value pairs of header names and values. Header names are lower-cased. + * + * ```js + * // Prints something like: + * // + * // { 'user-agent': 'curl/7.22.0', + * // host: '127.0.0.1:8000', + * // accept: '*' } + * console.log(request.headers); + * ``` + * + * See `HTTP/2 Headers Object`. + * + * In HTTP/2, the request path, host name, protocol, and method are represented as + * special headers prefixed with the `:` character (e.g. `':path'`). These special + * headers will be included in the `request.headers` object. Care must be taken not + * to inadvertently modify these special headers or errors may occur. For instance, + * removing all headers from the request will cause errors to occur: + * + * ```js + * removeAllHeaders(request.headers); + * assert(request.url); // Fails because the :path header has been removed + * ``` + * @since v8.4.0 + */ + readonly headers: IncomingHttpHeaders; + /** + * In case of server request, the HTTP version sent by the client. In the case of + * client response, the HTTP version of the connected-to server. Returns `'2.0'`. + * + * Also `message.httpVersionMajor` is the first integer and `message.httpVersionMinor` is the second. + * @since v8.4.0 + */ + readonly httpVersion: string; + readonly httpVersionMinor: number; + readonly httpVersionMajor: number; + /** + * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. + * @since v8.4.0 + */ + readonly method: string; + /** + * The raw request/response headers list exactly as they were received. + * + * The keys and values are in the same list. It is _not_ a + * list of tuples. So, the even-numbered offsets are key values, and the + * odd-numbered offsets are the associated values. + * + * Header names are not lowercased, and duplicates are not merged. + * + * ```js + * // Prints something like: + * // + * // [ 'user-agent', + * // 'this is invalid because there can be only one', + * // 'User-Agent', + * // 'curl/7.22.0', + * // 'Host', + * // '127.0.0.1:8000', + * // 'ACCEPT', + * // '*' ] + * console.log(request.rawHeaders); + * ``` + * @since v8.4.0 + */ + readonly rawHeaders: string[]; + /** + * The raw request/response trailer keys and values exactly as they were + * received. Only populated at the `'end'` event. + * @since v8.4.0 + */ + readonly rawTrailers: string[]; + /** + * The request scheme pseudo header field indicating the scheme + * portion of the target URL. + * @since v8.4.0 + */ + readonly scheme: string; + /** + * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but + * applies getters, setters, and methods based on HTTP/2 logic. + * + * `destroyed`, `readable`, and `writable` properties will be retrieved from and + * set on `request.stream`. + * + * `destroy`, `emit`, `end`, `on` and `once` methods will be called on `request.stream`. + * + * `setTimeout` method will be called on `request.stream.session`. + * + * `pause`, `read`, `resume`, and `write` will throw an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for + * more information. + * + * All other interactions will be routed directly to the socket. With TLS support, + * use `request.socket.getPeerCertificate()` to obtain the client's + * authentication details. + * @since v8.4.0 + */ + readonly socket: net.Socket | tls.TLSSocket; + /** + * The `Http2Stream` object backing the request. + * @since v8.4.0 + */ + readonly stream: ServerHttp2Stream; + /** + * The request/response trailers object. Only populated at the `'end'` event. + * @since v8.4.0 + */ + readonly trailers: IncomingHttpHeaders; + /** + * Request URL string. This contains only the URL that is present in the actual + * HTTP request. If the request is: + * + * ```http + * GET /status?name=ryan HTTP/1.1 + * Accept: text/plain + * ``` + * + * Then `request.url` will be: + * + * ```js + * '/status?name=ryan' + * ``` + * + * To parse the url into its parts, `new URL()` can be used: + * + * ```console + * $ node + * > new URL('/status?name=ryan', 'http://example.com') + * URL { + * href: 'http://example.com/status?name=ryan', + * origin: 'http://example.com', + * protocol: 'http:', + * username: '', + * password: '', + * host: 'example.com', + * hostname: 'example.com', + * port: '', + * pathname: '/status', + * search: '?name=ryan', + * searchParams: URLSearchParams { 'name' => 'ryan' }, + * hash: '' + * } + * ``` + * @since v8.4.0 + */ + url: string; + /** + * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is + * provided, then it is added as a listener on the `'timeout'` event on + * the response object. + * + * If no `'timeout'` listener is added to the request, the response, or + * the server, then `Http2Stream`s are destroyed when they time out. If a + * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + read(size?: number): Buffer | string | null; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: Http2ServerRequestEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: Http2ServerRequestEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: Http2ServerRequestEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: Http2ServerRequestEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: Http2ServerRequestEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: Http2ServerRequestEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: Http2ServerRequestEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: Http2ServerRequestEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: Http2ServerRequestEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: Http2ServerRequestEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: Http2ServerRequestEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + /** + * This object is created internally by an HTTP server, not by the user. It is + * passed as the second parameter to the `'request'` event. + * @since v8.4.0 + */ + class Http2ServerResponse extends stream.Writable { + constructor(stream: ServerHttp2Stream); + /** + * See `response.socket`. + * @since v8.4.0 + * @deprecated Since v13.0.0 - Use `socket`. + */ + readonly connection: net.Socket | tls.TLSSocket; + /** + * Append a single header value to the header object. + * + * If the value is an array, this is equivalent to calling this method multiple times. + * + * If there were no previous values for the header, this is equivalent to calling {@link setHeader}. + * + * Attempting to set a header field name or value that contains invalid characters will result in a + * [TypeError](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-typeerror) being thrown. + * + * ```js + * // Returns headers including "set-cookie: a" and "set-cookie: b" + * const server = http2.createServer((req, res) => { + * res.setHeader('set-cookie', 'a'); + * res.appendHeader('set-cookie', 'b'); + * res.writeHead(200); + * res.end('ok'); + * }); + * ``` + * @since v20.12.0 + */ + appendHeader(name: string, value: string | string[]): void; + /** + * Boolean value that indicates whether the response has completed. Starts + * as `false`. After `response.end()` executes, the value will be `true`. + * @since v8.4.0 + * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`. + */ + readonly finished: boolean; + /** + * True if headers were sent, false otherwise (read-only). + * @since v8.4.0 + */ + readonly headersSent: boolean; + /** + * A reference to the original HTTP2 `request` object. + * @since v15.7.0 + */ + readonly req: Request; + /** + * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but + * applies getters, setters, and methods based on HTTP/2 logic. + * + * `destroyed`, `readable`, and `writable` properties will be retrieved from and + * set on `response.stream`. + * + * `destroy`, `emit`, `end`, `on` and `once` methods will be called on `response.stream`. + * + * `setTimeout` method will be called on `response.stream.session`. + * + * `pause`, `read`, `resume`, and `write` will throw an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for + * more information. + * + * All other interactions will be routed directly to the socket. + * + * ```js + * import http2 from 'node:http2'; + * const server = http2.createServer((req, res) => { + * const ip = req.socket.remoteAddress; + * const port = req.socket.remotePort; + * res.end(`Your IP address is ${ip} and your source port is ${port}.`); + * }).listen(3000); + * ``` + * @since v8.4.0 + */ + readonly socket: net.Socket | tls.TLSSocket; + /** + * The `Http2Stream` object backing the response. + * @since v8.4.0 + */ + readonly stream: ServerHttp2Stream; + /** + * When true, the Date header will be automatically generated and sent in + * the response if it is not already present in the headers. Defaults to true. + * + * This should only be disabled for testing; HTTP requires the Date header + * in responses. + * @since v8.4.0 + */ + sendDate: boolean; + /** + * When using implicit headers (not calling `response.writeHead()` explicitly), + * this property controls the status code that will be sent to the client when + * the headers get flushed. + * + * ```js + * response.statusCode = 404; + * ``` + * + * After response header was sent to the client, this property indicates the + * status code which was sent out. + * @since v8.4.0 + */ + statusCode: number; + /** + * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns + * an empty string. + * @since v8.4.0 + */ + statusMessage: ""; + /** + * This method adds HTTP trailing headers (a header but at the end of the + * message) to the response. + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v8.4.0 + */ + addTrailers(trailers: OutgoingHttpHeaders): void; + /** + * This method signals to the server that all of the response headers and body + * have been sent; that server should consider this message complete. + * The method, `response.end()`, MUST be called on each response. + * + * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`. + * + * If `callback` is specified, it will be called when the response stream + * is finished. + * @since v8.4.0 + */ + end(callback?: () => void): this; + end(data: string | Uint8Array, callback?: () => void): this; + end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this; + /** + * Reads out a header that has already been queued but not sent to the client. + * The name is case-insensitive. + * + * ```js + * const contentType = response.getHeader('content-type'); + * ``` + * @since v8.4.0 + */ + getHeader(name: string): string; + /** + * Returns an array containing the unique names of the current outgoing headers. + * All header names are lowercase. + * + * ```js + * response.setHeader('Foo', 'bar'); + * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headerNames = response.getHeaderNames(); + * // headerNames === ['foo', 'set-cookie'] + * ``` + * @since v8.4.0 + */ + getHeaderNames(): string[]; + /** + * Returns a shallow copy of the current outgoing headers. Since a shallow copy + * is used, array values may be mutated without additional calls to various + * header-related http module methods. The keys of the returned object are the + * header names and the values are the respective header values. All header names + * are lowercase. + * + * The object returned by the `response.getHeaders()` method _does not_ prototypically inherit from the JavaScript `Object`. This means that typical `Object` methods such as `obj.toString()`, + * `obj.hasOwnProperty()`, and others + * are not defined and _will not work_. + * + * ```js + * response.setHeader('Foo', 'bar'); + * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headers = response.getHeaders(); + * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } + * ``` + * @since v8.4.0 + */ + getHeaders(): OutgoingHttpHeaders; + /** + * Returns `true` if the header identified by `name` is currently set in the + * outgoing headers. The header name matching is case-insensitive. + * + * ```js + * const hasContentType = response.hasHeader('content-type'); + * ``` + * @since v8.4.0 + */ + hasHeader(name: string): boolean; + /** + * Removes a header that has been queued for implicit sending. + * + * ```js + * response.removeHeader('Content-Encoding'); + * ``` + * @since v8.4.0 + */ + removeHeader(name: string): void; + /** + * Sets a single header value for implicit headers. If this header already exists + * in the to-be-sent headers, its value will be replaced. Use an array of strings + * here to send multiple headers with the same name. + * + * ```js + * response.setHeader('Content-Type', 'text/html; charset=utf-8'); + * ``` + * + * or + * + * ```js + * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); + * ``` + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * + * When headers have been set with `response.setHeader()`, they will be merged + * with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * ```js + * // Returns content-type = text/plain + * const server = http2.createServer((req, res) => { + * res.setHeader('Content-Type', 'text/html; charset=utf-8'); + * res.setHeader('X-Foo', 'bar'); + * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); + * res.end('ok'); + * }); + * ``` + * @since v8.4.0 + */ + setHeader(name: string, value: number | string | readonly string[]): void; + /** + * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is + * provided, then it is added as a listener on the `'timeout'` event on + * the response object. + * + * If no `'timeout'` listener is added to the request, the response, or + * the server, then `Http2Stream` s are destroyed when they time out. If a + * handler is assigned to the request, the response, or the server's `'timeout'` events, timed out sockets must be handled explicitly. + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + /** + * If this method is called and `response.writeHead()` has not been called, + * it will switch to implicit header mode and flush the implicit headers. + * + * This sends a chunk of the response body. This method may + * be called multiple times to provide successive parts of the body. + * + * In the `node:http` module, the response body is omitted when the + * request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body. + * + * `chunk` can be a string or a buffer. If `chunk` is a string, + * the second parameter specifies how to encode it into a byte stream. + * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk + * of data is flushed. + * + * This is the raw HTTP body and has nothing to do with higher-level multi-part + * body encodings that may be used. + * + * The first time `response.write()` is called, it will send the buffered + * header information and the first chunk of the body to the client. The second + * time `response.write()` is called, Node.js assumes data will be streamed, + * and sends the new data separately. That is, the response is buffered up to the + * first chunk of the body. + * + * Returns `true` if the entire data was flushed successfully to the kernel + * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again. + * @since v8.4.0 + */ + write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; + write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; + /** + * Sends a status `100 Continue` to the client, indicating that the request body + * should be sent. See the `'checkContinue'` event on `Http2Server` and `Http2SecureServer`. + * @since v8.4.0 + */ + writeContinue(): void; + /** + * Sends a status `103 Early Hints` to the client with a Link header, + * indicating that the user agent can preload/preconnect the linked resources. + * The `hints` is an object containing the values of headers to be sent with + * early hints message. + * + * **Example** + * + * ```js + * const earlyHintsLink = '; rel=preload; as=style'; + * response.writeEarlyHints({ + * 'link': earlyHintsLink, + * }); + * + * const earlyHintsLinks = [ + * '; rel=preload; as=style', + * '; rel=preload; as=script', + * ]; + * response.writeEarlyHints({ + * 'link': earlyHintsLinks, + * }); + * ``` + * @since v18.11.0 + */ + writeEarlyHints(hints: Record): void; + /** + * Sends a response header to the request. The status code is a 3-digit HTTP + * status code, like `404`. The last argument, `headers`, are the response headers. + * + * Returns a reference to the `Http2ServerResponse`, so that calls can be chained. + * + * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be + * passed as the second argument. However, because the `statusMessage` has no + * meaning within HTTP/2, the argument will have no effect and a process warning + * will be emitted. + * + * ```js + * const body = 'hello world'; + * response.writeHead(200, { + * 'Content-Length': Buffer.byteLength(body), + * 'Content-Type': 'text/plain; charset=utf-8', + * }); + * ``` + * + * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a + * given encoding. On outbound messages, Node.js does not check if Content-Length + * and the length of the body being transmitted are equal or not. However, when + * receiving messages, Node.js will automatically reject messages when the `Content-Length` does not match the actual payload size. + * + * This method may be called at most one time on a message before `response.end()` is called. + * + * If `response.write()` or `response.end()` are called before calling + * this, the implicit/mutable headers will be calculated and call this function. + * + * When headers have been set with `response.setHeader()`, they will be merged + * with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * ```js + * // Returns content-type = text/plain + * const server = http2.createServer((req, res) => { + * res.setHeader('Content-Type', 'text/html; charset=utf-8'); + * res.setHeader('X-Foo', 'bar'); + * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); + * res.end('ok'); + * }); + * ``` + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v8.4.0 + */ + writeHead(statusCode: number, headers?: OutgoingHttpHeaders | readonly string[]): this; + writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders | readonly string[]): this; + /** + * Call `http2stream.pushStream()` with the given headers, and wrap the + * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback + * parameter if successful. When `Http2ServerRequest` is closed, the callback is + * called with an error `ERR_HTTP2_INVALID_STREAM`. + * @since v8.4.0 + * @param headers An object describing the headers + * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of + * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method + */ + createPushResponse( + headers: OutgoingHttpHeaders, + callback: (err: Error | null, res: Http2ServerResponse) => void, + ): void; + } + namespace constants { + const NGHTTP2_SESSION_SERVER: number; + const NGHTTP2_SESSION_CLIENT: number; + const NGHTTP2_STREAM_STATE_IDLE: number; + const NGHTTP2_STREAM_STATE_OPEN: number; + const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; + const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; + const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; + const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; + const NGHTTP2_STREAM_STATE_CLOSED: number; + const NGHTTP2_NO_ERROR: number; + const NGHTTP2_PROTOCOL_ERROR: number; + const NGHTTP2_INTERNAL_ERROR: number; + const NGHTTP2_FLOW_CONTROL_ERROR: number; + const NGHTTP2_SETTINGS_TIMEOUT: number; + const NGHTTP2_STREAM_CLOSED: number; + const NGHTTP2_FRAME_SIZE_ERROR: number; + const NGHTTP2_REFUSED_STREAM: number; + const NGHTTP2_CANCEL: number; + const NGHTTP2_COMPRESSION_ERROR: number; + const NGHTTP2_CONNECT_ERROR: number; + const NGHTTP2_ENHANCE_YOUR_CALM: number; + const NGHTTP2_INADEQUATE_SECURITY: number; + const NGHTTP2_HTTP_1_1_REQUIRED: number; + const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; + const NGHTTP2_FLAG_NONE: number; + const NGHTTP2_FLAG_END_STREAM: number; + const NGHTTP2_FLAG_END_HEADERS: number; + const NGHTTP2_FLAG_ACK: number; + const NGHTTP2_FLAG_PADDED: number; + const NGHTTP2_FLAG_PRIORITY: number; + const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; + const DEFAULT_SETTINGS_ENABLE_PUSH: number; + const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; + const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; + const MAX_MAX_FRAME_SIZE: number; + const MIN_MAX_FRAME_SIZE: number; + const MAX_INITIAL_WINDOW_SIZE: number; + const NGHTTP2_DEFAULT_WEIGHT: number; + const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; + const NGHTTP2_SETTINGS_ENABLE_PUSH: number; + const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; + const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; + const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; + const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; + const PADDING_STRATEGY_NONE: number; + const PADDING_STRATEGY_MAX: number; + const PADDING_STRATEGY_CALLBACK: number; + const HTTP2_HEADER_STATUS: string; + const HTTP2_HEADER_METHOD: string; + const HTTP2_HEADER_AUTHORITY: string; + const HTTP2_HEADER_SCHEME: string; + const HTTP2_HEADER_PATH: string; + const HTTP2_HEADER_ACCEPT_CHARSET: string; + const HTTP2_HEADER_ACCEPT_ENCODING: string; + const HTTP2_HEADER_ACCEPT_LANGUAGE: string; + const HTTP2_HEADER_ACCEPT_RANGES: string; + const HTTP2_HEADER_ACCEPT: string; + const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS: string; + const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_HEADERS: string; + const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_METHODS: string; + const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; + const HTTP2_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS: string; + const HTTP2_HEADER_ACCESS_CONTROL_REQUEST_HEADERS: string; + const HTTP2_HEADER_ACCESS_CONTROL_REQUEST_METHOD: string; + const HTTP2_HEADER_AGE: string; + const HTTP2_HEADER_ALLOW: string; + const HTTP2_HEADER_AUTHORIZATION: string; + const HTTP2_HEADER_CACHE_CONTROL: string; + const HTTP2_HEADER_CONNECTION: string; + const HTTP2_HEADER_CONTENT_DISPOSITION: string; + const HTTP2_HEADER_CONTENT_ENCODING: string; + const HTTP2_HEADER_CONTENT_LANGUAGE: string; + const HTTP2_HEADER_CONTENT_LENGTH: string; + const HTTP2_HEADER_CONTENT_LOCATION: string; + const HTTP2_HEADER_CONTENT_MD5: string; + const HTTP2_HEADER_CONTENT_RANGE: string; + const HTTP2_HEADER_CONTENT_TYPE: string; + const HTTP2_HEADER_COOKIE: string; + const HTTP2_HEADER_DATE: string; + const HTTP2_HEADER_ETAG: string; + const HTTP2_HEADER_EXPECT: string; + const HTTP2_HEADER_EXPIRES: string; + const HTTP2_HEADER_FROM: string; + const HTTP2_HEADER_HOST: string; + const HTTP2_HEADER_IF_MATCH: string; + const HTTP2_HEADER_IF_MODIFIED_SINCE: string; + const HTTP2_HEADER_IF_NONE_MATCH: string; + const HTTP2_HEADER_IF_RANGE: string; + const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; + const HTTP2_HEADER_LAST_MODIFIED: string; + const HTTP2_HEADER_LINK: string; + const HTTP2_HEADER_LOCATION: string; + const HTTP2_HEADER_MAX_FORWARDS: string; + const HTTP2_HEADER_PREFER: string; + const HTTP2_HEADER_PROXY_AUTHENTICATE: string; + const HTTP2_HEADER_PROXY_AUTHORIZATION: string; + const HTTP2_HEADER_RANGE: string; + const HTTP2_HEADER_REFERER: string; + const HTTP2_HEADER_REFRESH: string; + const HTTP2_HEADER_RETRY_AFTER: string; + const HTTP2_HEADER_SERVER: string; + const HTTP2_HEADER_SET_COOKIE: string; + const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; + const HTTP2_HEADER_TRANSFER_ENCODING: string; + const HTTP2_HEADER_TE: string; + const HTTP2_HEADER_UPGRADE: string; + const HTTP2_HEADER_USER_AGENT: string; + const HTTP2_HEADER_VARY: string; + const HTTP2_HEADER_VIA: string; + const HTTP2_HEADER_WWW_AUTHENTICATE: string; + const HTTP2_HEADER_HTTP2_SETTINGS: string; + const HTTP2_HEADER_KEEP_ALIVE: string; + const HTTP2_HEADER_PROXY_CONNECTION: string; + const HTTP2_METHOD_ACL: string; + const HTTP2_METHOD_BASELINE_CONTROL: string; + const HTTP2_METHOD_BIND: string; + const HTTP2_METHOD_CHECKIN: string; + const HTTP2_METHOD_CHECKOUT: string; + const HTTP2_METHOD_CONNECT: string; + const HTTP2_METHOD_COPY: string; + const HTTP2_METHOD_DELETE: string; + const HTTP2_METHOD_GET: string; + const HTTP2_METHOD_HEAD: string; + const HTTP2_METHOD_LABEL: string; + const HTTP2_METHOD_LINK: string; + const HTTP2_METHOD_LOCK: string; + const HTTP2_METHOD_MERGE: string; + const HTTP2_METHOD_MKACTIVITY: string; + const HTTP2_METHOD_MKCALENDAR: string; + const HTTP2_METHOD_MKCOL: string; + const HTTP2_METHOD_MKREDIRECTREF: string; + const HTTP2_METHOD_MKWORKSPACE: string; + const HTTP2_METHOD_MOVE: string; + const HTTP2_METHOD_OPTIONS: string; + const HTTP2_METHOD_ORDERPATCH: string; + const HTTP2_METHOD_PATCH: string; + const HTTP2_METHOD_POST: string; + const HTTP2_METHOD_PRI: string; + const HTTP2_METHOD_PROPFIND: string; + const HTTP2_METHOD_PROPPATCH: string; + const HTTP2_METHOD_PUT: string; + const HTTP2_METHOD_REBIND: string; + const HTTP2_METHOD_REPORT: string; + const HTTP2_METHOD_SEARCH: string; + const HTTP2_METHOD_TRACE: string; + const HTTP2_METHOD_UNBIND: string; + const HTTP2_METHOD_UNCHECKOUT: string; + const HTTP2_METHOD_UNLINK: string; + const HTTP2_METHOD_UNLOCK: string; + const HTTP2_METHOD_UPDATE: string; + const HTTP2_METHOD_UPDATEREDIRECTREF: string; + const HTTP2_METHOD_VERSION_CONTROL: string; + const HTTP_STATUS_CONTINUE: number; + const HTTP_STATUS_SWITCHING_PROTOCOLS: number; + const HTTP_STATUS_PROCESSING: number; + const HTTP_STATUS_OK: number; + const HTTP_STATUS_CREATED: number; + const HTTP_STATUS_ACCEPTED: number; + const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; + const HTTP_STATUS_NO_CONTENT: number; + const HTTP_STATUS_RESET_CONTENT: number; + const HTTP_STATUS_PARTIAL_CONTENT: number; + const HTTP_STATUS_MULTI_STATUS: number; + const HTTP_STATUS_ALREADY_REPORTED: number; + const HTTP_STATUS_IM_USED: number; + const HTTP_STATUS_MULTIPLE_CHOICES: number; + const HTTP_STATUS_MOVED_PERMANENTLY: number; + const HTTP_STATUS_FOUND: number; + const HTTP_STATUS_SEE_OTHER: number; + const HTTP_STATUS_NOT_MODIFIED: number; + const HTTP_STATUS_USE_PROXY: number; + const HTTP_STATUS_TEMPORARY_REDIRECT: number; + const HTTP_STATUS_PERMANENT_REDIRECT: number; + const HTTP_STATUS_BAD_REQUEST: number; + const HTTP_STATUS_UNAUTHORIZED: number; + const HTTP_STATUS_PAYMENT_REQUIRED: number; + const HTTP_STATUS_FORBIDDEN: number; + const HTTP_STATUS_NOT_FOUND: number; + const HTTP_STATUS_METHOD_NOT_ALLOWED: number; + const HTTP_STATUS_NOT_ACCEPTABLE: number; + const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; + const HTTP_STATUS_REQUEST_TIMEOUT: number; + const HTTP_STATUS_CONFLICT: number; + const HTTP_STATUS_GONE: number; + const HTTP_STATUS_LENGTH_REQUIRED: number; + const HTTP_STATUS_PRECONDITION_FAILED: number; + const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; + const HTTP_STATUS_URI_TOO_LONG: number; + const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; + const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; + const HTTP_STATUS_EXPECTATION_FAILED: number; + const HTTP_STATUS_TEAPOT: number; + const HTTP_STATUS_MISDIRECTED_REQUEST: number; + const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; + const HTTP_STATUS_LOCKED: number; + const HTTP_STATUS_FAILED_DEPENDENCY: number; + const HTTP_STATUS_UNORDERED_COLLECTION: number; + const HTTP_STATUS_UPGRADE_REQUIRED: number; + const HTTP_STATUS_PRECONDITION_REQUIRED: number; + const HTTP_STATUS_TOO_MANY_REQUESTS: number; + const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; + const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; + const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; + const HTTP_STATUS_NOT_IMPLEMENTED: number; + const HTTP_STATUS_BAD_GATEWAY: number; + const HTTP_STATUS_SERVICE_UNAVAILABLE: number; + const HTTP_STATUS_GATEWAY_TIMEOUT: number; + const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; + const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; + const HTTP_STATUS_INSUFFICIENT_STORAGE: number; + const HTTP_STATUS_LOOP_DETECTED: number; + const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; + const HTTP_STATUS_NOT_EXTENDED: number; + const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; + } + /** + * This symbol can be set as a property on the HTTP/2 headers object with + * an array value in order to provide a list of headers considered sensitive. + */ + const sensitiveHeaders: symbol; + /** + * Returns an object containing the default settings for an `Http2Session` instance. This method returns a new object instance every time it is called + * so instances returned may be safely modified for use. + * @since v8.4.0 + */ + function getDefaultSettings(): Settings; + /** + * Returns a `Buffer` instance containing serialized representation of the given + * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended + * for use with the `HTTP2-Settings` header field. + * + * ```js + * import http2 from 'node:http2'; + * + * const packed = http2.getPackedSettings({ enablePush: false }); + * + * console.log(packed.toString('base64')); + * // Prints: AAIAAAAA + * ``` + * @since v8.4.0 + */ + function getPackedSettings(settings: Settings): NonSharedBuffer; + /** + * Returns a `HTTP/2 Settings Object` containing the deserialized settings from + * the given `Buffer` as generated by `http2.getPackedSettings()`. + * @since v8.4.0 + * @param buf The packed settings. + */ + function getUnpackedSettings(buf: Uint8Array): Settings; + /** + * Returns a `net.Server` instance that creates and manages `Http2Session` instances. + * + * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when + * communicating + * with browser clients. + * + * ```js + * import http2 from 'node:http2'; + * + * // Create an unencrypted HTTP/2 server. + * // Since there are no browsers known that support + * // unencrypted HTTP/2, the use of `http2.createSecureServer()` + * // is necessary when communicating with browser clients. + * const server = http2.createServer(); + * + * server.on('stream', (stream, headers) => { + * stream.respond({ + * 'content-type': 'text/html; charset=utf-8', + * ':status': 200, + * }); + * stream.end('

Hello World

'); + * }); + * + * server.listen(8000); + * ``` + * @since v8.4.0 + * @param onRequestHandler See `Compatibility API` + */ + function createServer( + onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, + ): Http2Server; + function createServer< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + >( + options: ServerOptions, + onRequestHandler?: (request: InstanceType, response: InstanceType) => void, + ): Http2Server; + /** + * Returns a `tls.Server` instance that creates and manages `Http2Session` instances. + * + * ```js + * import http2 from 'node:http2'; + * import fs from 'node:fs'; + * + * const options = { + * key: fs.readFileSync('server-key.pem'), + * cert: fs.readFileSync('server-cert.pem'), + * }; + * + * // Create a secure HTTP/2 server + * const server = http2.createSecureServer(options); + * + * server.on('stream', (stream, headers) => { + * stream.respond({ + * 'content-type': 'text/html; charset=utf-8', + * ':status': 200, + * }); + * stream.end('

Hello World

'); + * }); + * + * server.listen(8443); + * ``` + * @since v8.4.0 + * @param onRequestHandler See `Compatibility API` + */ + function createSecureServer( + onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, + ): Http2SecureServer; + function createSecureServer< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + >( + options: SecureServerOptions, + onRequestHandler?: (request: InstanceType, response: InstanceType) => void, + ): Http2SecureServer; + /** + * Returns a `ClientHttp2Session` instance. + * + * ```js + * import http2 from 'node:http2'; + * const client = http2.connect('https://localhost:1234'); + * + * // Use the client + * + * client.close(); + * ``` + * @since v8.4.0 + * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port + * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. + * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. + */ + function connect( + authority: string | url.URL, + listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, + ): ClientHttp2Session; + function connect( + authority: string | url.URL, + options?: ClientSessionOptions | SecureClientSessionOptions, + listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, + ): ClientHttp2Session; + /** + * Create an HTTP/2 server session from an existing socket. + * @param socket A Duplex Stream + * @param options Any `{@link createServer}` options can be provided. + * @since v20.12.0 + */ + function performServerHandshake< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + >( + socket: stream.Duplex, + options?: ServerOptions, + ): ServerHttp2Session; +} +declare module "node:http2" { + export { OutgoingHttpHeaders } from "node:http"; +} +declare module "http2" { + export * from "node:http2"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/https.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/https.d.ts new file mode 100644 index 0000000..6b02569 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/https.d.ts @@ -0,0 +1,405 @@ +/** + * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a + * separate module. + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/https.js) + */ +declare module "node:https" { + import * as http from "node:http"; + import { Duplex } from "node:stream"; + import * as tls from "node:tls"; + import { URL } from "node:url"; + interface ServerOptions< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse> = typeof http.ServerResponse, + > extends http.ServerOptions, tls.TlsOptions {} + interface RequestOptions extends http.RequestOptions, tls.SecureContextOptions { + checkServerIdentity?: + | ((hostname: string, cert: tls.DetailedPeerCertificate) => Error | undefined) + | undefined; + rejectUnauthorized?: boolean | undefined; // Defaults to true + servername?: string | undefined; // SNI TLS Extension + } + interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { + maxCachedSessions?: number | undefined; + } + /** + * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. + * + * Like `http.Agent`, the `createConnection(options[, callback])` method can be overridden + * to customize how TLS connections are established. + * + * > See `agent.createConnection()` for details on overriding this method, + * > including asynchronous socket creation with a callback. + * @since v0.4.5 + */ + class Agent extends http.Agent { + constructor(options?: AgentOptions); + options: AgentOptions; + createConnection( + options: RequestOptions, + callback?: (err: Error | null, stream: Duplex) => void, + ): Duplex | null | undefined; + getName(options?: RequestOptions): string; + } + interface ServerEventMap< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse> = typeof http.ServerResponse, + > extends http.ServerEventMap, tls.ServerEventMap {} + /** + * See `http.Server` for more information. + * @since v0.3.4 + */ + class Server< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse> = typeof http.ServerResponse, + > extends tls.Server { + constructor(requestListener?: http.RequestListener); + constructor( + options: ServerOptions, + requestListener?: http.RequestListener, + ); + /** + * Closes all connections connected to this server. + * @since v18.2.0 + */ + closeAllConnections(): void; + /** + * Closes all connections connected to this server which are not sending a request or waiting for a response. + * @since v18.2.0 + */ + closeIdleConnections(): void; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ServerEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ServerEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: ServerEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: ServerEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface Server< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse> = typeof http.ServerResponse, + > extends http.Server {} + /** + * ```js + * // curl -k https://localhost:8000/ + * import https from 'node:https'; + * import fs from 'node:fs'; + * + * const options = { + * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), + * }; + * + * https.createServer(options, (req, res) => { + * res.writeHead(200); + * res.end('hello world\n'); + * }).listen(8000); + * ``` + * + * Or + * + * ```js + * import https from 'node:https'; + * import fs from 'node:fs'; + * + * const options = { + * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), + * passphrase: 'sample', + * }; + * + * https.createServer(options, (req, res) => { + * res.writeHead(200); + * res.end('hello world\n'); + * }).listen(8000); + * ``` + * @since v0.3.4 + * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`. + * @param requestListener A listener to be added to the `'request'` event. + */ + function createServer< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse> = typeof http.ServerResponse, + >(requestListener?: http.RequestListener): Server; + function createServer< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse> = typeof http.ServerResponse, + >( + options: ServerOptions, + requestListener?: http.RequestListener, + ): Server; + /** + * Makes a request to a secure web server. + * + * The following additional `options` from `tls.connect()` are also accepted: `ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`, `honorCipherOrder`, `key`, `passphrase`, + * `pfx`, `rejectUnauthorized`, `secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`, `highWaterMark`. + * + * `options` can be an object, a string, or a `URL` object. If `options` is a + * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. + * + * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to + * upload a file with a POST request, then write to the `ClientRequest` object. + * + * ```js + * import https from 'node:https'; + * + * const options = { + * hostname: 'encrypted.google.com', + * port: 443, + * path: '/', + * method: 'GET', + * }; + * + * const req = https.request(options, (res) => { + * console.log('statusCode:', res.statusCode); + * console.log('headers:', res.headers); + * + * res.on('data', (d) => { + * process.stdout.write(d); + * }); + * }); + * + * req.on('error', (e) => { + * console.error(e); + * }); + * req.end(); + * ``` + * + * Example using options from `tls.connect()`: + * + * ```js + * const options = { + * hostname: 'encrypted.google.com', + * port: 443, + * path: '/', + * method: 'GET', + * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), + * }; + * options.agent = new https.Agent(options); + * + * const req = https.request(options, (res) => { + * // ... + * }); + * ``` + * + * Alternatively, opt out of connection pooling by not using an `Agent`. + * + * ```js + * const options = { + * hostname: 'encrypted.google.com', + * port: 443, + * path: '/', + * method: 'GET', + * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), + * agent: false, + * }; + * + * const req = https.request(options, (res) => { + * // ... + * }); + * ``` + * + * Example using a `URL` as `options`: + * + * ```js + * const options = new URL('https://abc:xyz@example.com'); + * + * const req = https.request(options, (res) => { + * // ... + * }); + * ``` + * + * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`): + * + * ```js + * import tls from 'node:tls'; + * import https from 'node:https'; + * import crypto from 'node:crypto'; + * + * function sha256(s) { + * return crypto.createHash('sha256').update(s).digest('base64'); + * } + * const options = { + * hostname: 'github.com', + * port: 443, + * path: '/', + * method: 'GET', + * checkServerIdentity: function(host, cert) { + * // Make sure the certificate is issued to the host we are connected to + * const err = tls.checkServerIdentity(host, cert); + * if (err) { + * return err; + * } + * + * // Pin the public key, similar to HPKP pin-sha256 pinning + * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU='; + * if (sha256(cert.pubkey) !== pubkey256) { + * const msg = 'Certificate verification error: ' + + * `The public key of '${cert.subject.CN}' ` + + * 'does not match our pinned fingerprint'; + * return new Error(msg); + * } + * + * // Pin the exact certificate, rather than the pub key + * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' + + * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16'; + * if (cert.fingerprint256 !== cert256) { + * const msg = 'Certificate verification error: ' + + * `The certificate of '${cert.subject.CN}' ` + + * 'does not match our pinned fingerprint'; + * return new Error(msg); + * } + * + * // This loop is informational only. + * // Print the certificate and public key fingerprints of all certs in the + * // chain. Its common to pin the public key of the issuer on the public + * // internet, while pinning the public key of the service in sensitive + * // environments. + * do { + * console.log('Subject Common Name:', cert.subject.CN); + * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); + * + * hash = crypto.createHash('sha256'); + * console.log(' Public key ping-sha256:', sha256(cert.pubkey)); + * + * lastprint256 = cert.fingerprint256; + * cert = cert.issuerCertificate; + * } while (cert.fingerprint256 !== lastprint256); + * + * }, + * }; + * + * options.agent = new https.Agent(options); + * const req = https.request(options, (res) => { + * console.log('All OK. Server matched our pinned cert or public key'); + * console.log('statusCode:', res.statusCode); + * // Print the HPKP values + * console.log('headers:', res.headers['public-key-pins']); + * + * res.on('data', (d) => {}); + * }); + * + * req.on('error', (e) => { + * console.error(e.message); + * }); + * req.end(); + * ``` + * + * Outputs for example: + * + * ```text + * Subject Common Name: github.com + * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16 + * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU= + * Subject Common Name: DigiCert SHA2 Extended Validation Server CA + * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A + * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho= + * Subject Common Name: DigiCert High Assurance EV Root CA + * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF + * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18= + * All OK. Server matched our pinned cert or public key + * statusCode: 200 + * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; + * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; + * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains + * ``` + * @since v0.3.6 + * @param options Accepts all `options` from `request`, with some differences in default values: + */ + function request( + options: RequestOptions | string | URL, + callback?: (res: http.IncomingMessage) => void, + ): http.ClientRequest; + function request( + url: string | URL, + options: RequestOptions, + callback?: (res: http.IncomingMessage) => void, + ): http.ClientRequest; + /** + * Like `http.get()` but for HTTPS. + * + * `options` can be an object, a string, or a `URL` object. If `options` is a + * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. + * + * ```js + * import https from 'node:https'; + * + * https.get('https://encrypted.google.com/', (res) => { + * console.log('statusCode:', res.statusCode); + * console.log('headers:', res.headers); + * + * res.on('data', (d) => { + * process.stdout.write(d); + * }); + * + * }).on('error', (e) => { + * console.error(e); + * }); + * ``` + * @since v0.3.6 + * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. + */ + function get( + options: RequestOptions | string | URL, + callback?: (res: http.IncomingMessage) => void, + ): http.ClientRequest; + function get( + url: string | URL, + options: RequestOptions, + callback?: (res: http.IncomingMessage) => void, + ): http.ClientRequest; + let globalAgent: Agent; +} +declare module "https" { + export * from "node:https"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/index.d.ts new file mode 100644 index 0000000..08ab4f0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/index.d.ts @@ -0,0 +1,115 @@ +/** + * License for programmatically and manually incorporated + * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc + * + * Copyright Node.js contributors. All rights reserved. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +// NOTE: These definitions support Node.js and TypeScript 5.8+. + +// Reference required TypeScript libraries: +/// +/// +/// + +// Iterator definitions required for compatibility with TypeScript <5.6: +/// + +// Definitions for Node.js modules specific to TypeScript 5.7+: +/// +/// + +// Definitions for Node.js modules that are not specific to any version of TypeScript: +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/inspector.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/inspector.d.ts new file mode 100644 index 0000000..34140df --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/inspector.d.ts @@ -0,0 +1,269 @@ +/** + * The `node:inspector` module provides an API for interacting with the V8 + * inspector. + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/inspector.js) + */ +declare module "node:inspector" { + import { EventEmitter } from "node:events"; + /** + * The `inspector.Session` is used for dispatching messages to the V8 inspector + * back-end and receiving message responses and notifications. + */ + class Session extends EventEmitter { + /** + * Create a new instance of the inspector.Session class. + * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend. + */ + constructor(); + /** + * Connects a session to the inspector back-end. + */ + connect(): void; + /** + * Connects a session to the inspector back-end. + * An exception will be thrown if this API was not called on a Worker thread. + * @since v12.11.0 + */ + connectToMainThread(): void; + /** + * Immediately close the session. All pending message callbacks will be called with an error. + * `session.connect()` will need to be called to be able to send messages again. + * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. + */ + disconnect(): void; + } + /** + * Activate inspector on host and port. Equivalent to `node --inspect=[[host:]port]`, but can be done programmatically after node has + * started. + * + * If wait is `true`, will block until a client has connected to the inspect port + * and flow control has been passed to the debugger client. + * + * See the [security warning](https://nodejs.org/docs/latest-v25.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure) + * regarding the `host` parameter usage. + * @param port Port to listen on for inspector connections. Defaults to what was specified on the CLI. + * @param host Host to listen on for inspector connections. Defaults to what was specified on the CLI. + * @param wait Block until a client has connected. Defaults to what was specified on the CLI. + * @returns Disposable that calls `inspector.close()`. + */ + function open(port?: number, host?: string, wait?: boolean): Disposable; + /** + * Deactivate the inspector. Blocks until there are no active connections. + */ + function close(): void; + /** + * Return the URL of the active inspector, or `undefined` if there is none. + * + * ```console + * $ node --inspect -p 'inspector.url()' + * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 + * For help, see: https://nodejs.org/en/docs/inspector + * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 + * + * $ node --inspect=localhost:3000 -p 'inspector.url()' + * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a + * For help, see: https://nodejs.org/en/docs/inspector + * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a + * + * $ node -p 'inspector.url()' + * undefined + * ``` + */ + function url(): string | undefined; + /** + * Blocks until a client (existing or connected later) has sent `Runtime.runIfWaitingForDebugger` command. + * + * An exception will be thrown if there is no active inspector. + * @since v12.7.0 + */ + function waitForDebugger(): void; + // These methods are exposed by the V8 inspector console API (inspector/v8-console.h). + // The method signatures differ from those of the Node.js console, and are deliberately + // typed permissively. + interface InspectorConsole { + debug(...data: any[]): void; + error(...data: any[]): void; + info(...data: any[]): void; + log(...data: any[]): void; + warn(...data: any[]): void; + dir(...data: any[]): void; + dirxml(...data: any[]): void; + table(...data: any[]): void; + trace(...data: any[]): void; + group(...data: any[]): void; + groupCollapsed(...data: any[]): void; + groupEnd(...data: any[]): void; + clear(...data: any[]): void; + count(label?: any): void; + countReset(label?: any): void; + assert(value?: any, ...data: any[]): void; + profile(label?: any): void; + profileEnd(label?: any): void; + time(label?: any): void; + timeLog(label?: any): void; + timeStamp(label?: any): void; + } + /** + * An object to send messages to the remote inspector console. + * @since v11.0.0 + */ + const console: InspectorConsole; + // DevTools protocol event broadcast methods + namespace Network { + /** + * This feature is only available with the `--experimental-network-inspection` flag enabled. + * + * Broadcasts the `Network.requestWillBeSent` event to connected frontends. This event indicates that + * the application is about to send an HTTP request. + * @since v22.6.0 + */ + function requestWillBeSent(params: RequestWillBeSentEventDataType): void; + /** + * This feature is only available with the `--experimental-network-inspection` flag enabled. + * + * Broadcasts the `Network.dataReceived` event to connected frontends, or buffers the data if + * `Network.streamResourceContent` command was not invoked for the given request yet. + * + * Also enables `Network.getResponseBody` command to retrieve the response data. + * @since v24.2.0 + */ + function dataReceived(params: DataReceivedEventDataType): void; + /** + * This feature is only available with the `--experimental-network-inspection` flag enabled. + * + * Enables `Network.getRequestPostData` command to retrieve the request data. + * @since v24.3.0 + */ + function dataSent(params: unknown): void; + /** + * This feature is only available with the `--experimental-network-inspection` flag enabled. + * + * Broadcasts the `Network.responseReceived` event to connected frontends. This event indicates that + * HTTP response is available. + * @since v22.6.0 + */ + function responseReceived(params: ResponseReceivedEventDataType): void; + /** + * This feature is only available with the `--experimental-network-inspection` flag enabled. + * + * Broadcasts the `Network.loadingFinished` event to connected frontends. This event indicates that + * HTTP request has finished loading. + * @since v22.6.0 + */ + function loadingFinished(params: LoadingFinishedEventDataType): void; + /** + * This feature is only available with the `--experimental-network-inspection` flag enabled. + * + * Broadcasts the `Network.loadingFailed` event to connected frontends. This event indicates that + * HTTP request has failed to load. + * @since v22.7.0 + */ + function loadingFailed(params: LoadingFailedEventDataType): void; + /** + * This feature is only available with the `--experimental-network-inspection` flag enabled. + * + * Broadcasts the `Network.webSocketCreated` event to connected frontends. This event indicates that + * a WebSocket connection has been initiated. + * @since v24.7.0 + */ + function webSocketCreated(params: WebSocketCreatedEventDataType): void; + /** + * This feature is only available with the `--experimental-network-inspection` flag enabled. + * + * Broadcasts the `Network.webSocketHandshakeResponseReceived` event to connected frontends. + * This event indicates that the WebSocket handshake response has been received. + * @since v24.7.0 + */ + function webSocketHandshakeResponseReceived(params: WebSocketHandshakeResponseReceivedEventDataType): void; + /** + * This feature is only available with the `--experimental-network-inspection` flag enabled. + * + * Broadcasts the `Network.webSocketClosed` event to connected frontends. + * This event indicates that a WebSocket connection has been closed. + * @since v24.7.0 + */ + function webSocketClosed(params: WebSocketClosedEventDataType): void; + } + namespace NetworkResources { + /** + * This feature is only available with the `--experimental-inspector-network-resource` flag enabled. + * + * The inspector.NetworkResources.put method is used to provide a response for a loadNetworkResource + * request issued via the Chrome DevTools Protocol (CDP). + * This is typically triggered when a source map is specified by URL, and a DevTools frontend—such as + * Chrome—requests the resource to retrieve the source map. + * + * This method allows developers to predefine the resource content to be served in response to such CDP requests. + * + * ```js + * const inspector = require('node:inspector'); + * // By preemptively calling put to register the resource, a source map can be resolved when + * // a loadNetworkResource request is made from the frontend. + * async function setNetworkResources() { + * const mapUrl = 'http://localhost:3000/dist/app.js.map'; + * const tsUrl = 'http://localhost:3000/src/app.ts'; + * const distAppJsMap = await fetch(mapUrl).then((res) => res.text()); + * const srcAppTs = await fetch(tsUrl).then((res) => res.text()); + * inspector.NetworkResources.put(mapUrl, distAppJsMap); + * inspector.NetworkResources.put(tsUrl, srcAppTs); + * }; + * setNetworkResources().then(() => { + * require('./dist/app'); + * }); + * ``` + * + * For more details, see the official CDP documentation: [Network.loadNetworkResource](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-loadNetworkResource) + * @since v24.5.0 + * @experimental + */ + function put(url: string, data: string): void; + } + namespace DOMStorage { + /** + * This feature is only available with the + * `--experimental-storage-inspection` flag enabled. + * + * Broadcasts the `DOMStorage.domStorageItemAdded` event to connected frontends. + * This event indicates that a new item has been added to the storage. + * @since v25.5.0 + */ + function domStorageItemAdded(params: DomStorageItemAddedEventDataType): void; + /** + * This feature is only available with the + * `--experimental-storage-inspection` flag enabled. + * + * Broadcasts the `DOMStorage.domStorageItemRemoved` event to connected frontends. + * This event indicates that an item has been removed from the storage. + * @since v25.5.0 + */ + function domStorageItemRemoved(params: DomStorageItemRemovedEventDataType): void; + /** + * This feature is only available with the + * `--experimental-storage-inspection` flag enabled. + + * Broadcasts the `DOMStorage.domStorageItemUpdated` event to connected frontends. + * This event indicates that a storage item has been updated. + * @since v25.5.0 + */ + function domStorageItemUpdated(params: DomStorageItemUpdatedEventDataType): void; + /** + * This feature is only available with the + * `--experimental-storage-inspection` flag enabled. + * + * Broadcasts the `DOMStorage.domStorageItemsCleared` event to connected + * frontends. This event indicates that all items have been cleared from the + * storage. + * @since v25.5.0 + */ + function domStorageItemsCleared(params: DomStorageItemsClearedEventDataType): void; + /** + * This feature is only available with the + * `--experimental-storage-inspection` flag enabled. + * @since v25.5.0 + */ + function registerStorage(params: unknown): void; + } +} +declare module "inspector" { + export * from "node:inspector"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/inspector.generated.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/inspector.generated.d.ts new file mode 100644 index 0000000..93ae271 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/inspector.generated.d.ts @@ -0,0 +1,4401 @@ +// These definitions are automatically generated by the generate-inspector script. +// Do not edit this file directly. +// See scripts/generate-inspector/README.md for information on how to update the protocol definitions. +// Changes to the module itself should be added to the generator template (scripts/generate-inspector/inspector.d.ts.template). + +declare module "node:inspector" { + interface InspectorNotification { + method: string; + params: T; + } + namespace Schema { + /** + * Description of the protocol domain. + */ + interface Domain { + /** + * Domain name. + */ + name: string; + /** + * Domain version. + */ + version: string; + } + interface GetDomainsReturnType { + /** + * List of supported domains. + */ + domains: Domain[]; + } + } + namespace Runtime { + /** + * Unique script identifier. + */ + type ScriptId = string; + /** + * Unique object identifier. + */ + type RemoteObjectId = string; + /** + * Primitive value which cannot be JSON-stringified. + */ + type UnserializableValue = string; + /** + * Mirror object referencing original JavaScript object. + */ + interface RemoteObject { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string | undefined; + /** + * Object class (constructor) name. Specified for object type values only. + */ + className?: string | undefined; + /** + * Remote object value in case of primitive values or JSON values (if it was requested). + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified does not have value, but gets this property. + */ + unserializableValue?: UnserializableValue | undefined; + /** + * String representation of the object. + */ + description?: string | undefined; + /** + * Unique object identifier (for non-primitive values). + */ + objectId?: RemoteObjectId | undefined; + /** + * Preview containing abbreviated property values. Specified for object type values only. + * @experimental + */ + preview?: ObjectPreview | undefined; + /** + * @experimental + */ + customPreview?: CustomPreview | undefined; + } + /** + * @experimental + */ + interface CustomPreview { + header: string; + hasBody: boolean; + formatterObjectId: RemoteObjectId; + bindRemoteObjectFunctionId: RemoteObjectId; + configObjectId?: RemoteObjectId | undefined; + } + /** + * Object containing abbreviated remote object value. + * @experimental + */ + interface ObjectPreview { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string | undefined; + /** + * String representation of the object. + */ + description?: string | undefined; + /** + * True iff some of the properties or entries of the original object did not fit. + */ + overflow: boolean; + /** + * List of the properties. + */ + properties: PropertyPreview[]; + /** + * List of the entries. Specified for map and set subtype values only. + */ + entries?: EntryPreview[] | undefined; + } + /** + * @experimental + */ + interface PropertyPreview { + /** + * Property name. + */ + name: string; + /** + * Object type. Accessor means that the property itself is an accessor property. + */ + type: string; + /** + * User-friendly property value string. + */ + value?: string | undefined; + /** + * Nested value preview. + */ + valuePreview?: ObjectPreview | undefined; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string | undefined; + } + /** + * @experimental + */ + interface EntryPreview { + /** + * Preview of the key. Specified for map-like collection entries. + */ + key?: ObjectPreview | undefined; + /** + * Preview of the value. + */ + value: ObjectPreview; + } + /** + * Object property descriptor. + */ + interface PropertyDescriptor { + /** + * Property name or symbol description. + */ + name: string; + /** + * The value associated with the property. + */ + value?: RemoteObject | undefined; + /** + * True if the value associated with the property may be changed (data descriptors only). + */ + writable?: boolean | undefined; + /** + * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). + */ + get?: RemoteObject | undefined; + /** + * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). + */ + set?: RemoteObject | undefined; + /** + * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. + */ + configurable: boolean; + /** + * True if this property shows up during enumeration of the properties on the corresponding object. + */ + enumerable: boolean; + /** + * True if the result was thrown during the evaluation. + */ + wasThrown?: boolean | undefined; + /** + * True if the property is owned for the object. + */ + isOwn?: boolean | undefined; + /** + * Property symbol object, if the property is of the symbol type. + */ + symbol?: RemoteObject | undefined; + } + /** + * Object internal property descriptor. This property isn't normally visible in JavaScript code. + */ + interface InternalPropertyDescriptor { + /** + * Conventional property name. + */ + name: string; + /** + * The value associated with the property. + */ + value?: RemoteObject | undefined; + } + /** + * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. + */ + interface CallArgument { + /** + * Primitive value or serializable javascript object. + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified. + */ + unserializableValue?: UnserializableValue | undefined; + /** + * Remote object handle. + */ + objectId?: RemoteObjectId | undefined; + } + /** + * Id of an execution context. + */ + type ExecutionContextId = number; + /** + * Description of an isolated world. + */ + interface ExecutionContextDescription { + /** + * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. + */ + id: ExecutionContextId; + /** + * Execution context origin. + */ + origin: string; + /** + * Human readable name describing given context. + */ + name: string; + /** + * Embedder-specific auxiliary data. + */ + auxData?: object | undefined; + } + /** + * Detailed information about exception (or error) that was thrown during script compilation or execution. + */ + interface ExceptionDetails { + /** + * Exception id. + */ + exceptionId: number; + /** + * Exception text, which should be used together with exception object when available. + */ + text: string; + /** + * Line number of the exception location (0-based). + */ + lineNumber: number; + /** + * Column number of the exception location (0-based). + */ + columnNumber: number; + /** + * Script ID of the exception location. + */ + scriptId?: ScriptId | undefined; + /** + * URL of the exception location, to be used when the script was not reported. + */ + url?: string | undefined; + /** + * JavaScript stack trace if available. + */ + stackTrace?: StackTrace | undefined; + /** + * Exception object if available. + */ + exception?: RemoteObject | undefined; + /** + * Identifier of the context where exception happened. + */ + executionContextId?: ExecutionContextId | undefined; + } + /** + * Number of milliseconds since epoch. + */ + type Timestamp = number; + /** + * Stack entry for runtime errors and assertions. + */ + interface CallFrame { + /** + * JavaScript function name. + */ + functionName: string; + /** + * JavaScript script id. + */ + scriptId: ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * JavaScript script line number (0-based). + */ + lineNumber: number; + /** + * JavaScript script column number (0-based). + */ + columnNumber: number; + } + /** + * Call frames for assertions or error messages. + */ + interface StackTrace { + /** + * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. + */ + description?: string | undefined; + /** + * JavaScript function name. + */ + callFrames: CallFrame[]; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + */ + parent?: StackTrace | undefined; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + * @experimental + */ + parentId?: StackTraceId | undefined; + } + /** + * Unique identifier of current debugger. + * @experimental + */ + type UniqueDebuggerId = string; + /** + * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. + * @experimental + */ + interface StackTraceId { + id: string; + debuggerId?: UniqueDebuggerId | undefined; + } + interface EvaluateParameterType { + /** + * Expression to evaluate. + */ + expression: string; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string | undefined; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + contextId?: ExecutionContextId | undefined; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean | undefined; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean | undefined; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean | undefined; + } + interface AwaitPromiseParameterType { + /** + * Identifier of the promise. + */ + promiseObjectId: RemoteObjectId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean | undefined; + } + interface CallFunctionOnParameterType { + /** + * Declaration of the function to call. + */ + functionDeclaration: string; + /** + * Identifier of the object to call function on. Either objectId or executionContextId should be specified. + */ + objectId?: RemoteObjectId | undefined; + /** + * Call arguments. All call arguments must belong to the same JavaScript world as the target object. + */ + arguments?: CallArgument[] | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean | undefined; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean | undefined; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean | undefined; + /** + * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. + */ + executionContextId?: ExecutionContextId | undefined; + /** + * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. + */ + objectGroup?: string | undefined; + } + interface GetPropertiesParameterType { + /** + * Identifier of the object to return properties for. + */ + objectId: RemoteObjectId; + /** + * If true, returns properties belonging only to the element itself, not to its prototype chain. + */ + ownProperties?: boolean | undefined; + /** + * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. + * @experimental + */ + accessorPropertiesOnly?: boolean | undefined; + /** + * Whether preview should be generated for the results. + * @experimental + */ + generatePreview?: boolean | undefined; + } + interface ReleaseObjectParameterType { + /** + * Identifier of the object to release. + */ + objectId: RemoteObjectId; + } + interface ReleaseObjectGroupParameterType { + /** + * Symbolic object group name. + */ + objectGroup: string; + } + interface SetCustomObjectFormatterEnabledParameterType { + enabled: boolean; + } + interface CompileScriptParameterType { + /** + * Expression to compile. + */ + expression: string; + /** + * Source url to be set for the script. + */ + sourceURL: string; + /** + * Specifies whether the compiled script should be persisted. + */ + persistScript: boolean; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: ExecutionContextId | undefined; + } + interface RunScriptParameterType { + /** + * Id of the script to run. + */ + scriptId: ScriptId; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: ExecutionContextId | undefined; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean | undefined; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean | undefined; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean | undefined; + } + interface QueryObjectsParameterType { + /** + * Identifier of the prototype to return objects for. + */ + prototypeObjectId: RemoteObjectId; + } + interface GlobalLexicalScopeNamesParameterType { + /** + * Specifies in which execution context to lookup global scope variables. + */ + executionContextId?: ExecutionContextId | undefined; + } + interface EvaluateReturnType { + /** + * Evaluation result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface AwaitPromiseReturnType { + /** + * Promise result. Will contain rejected value if promise was rejected. + */ + result: RemoteObject; + /** + * Exception details if stack strace is available. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface CallFunctionOnReturnType { + /** + * Call result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface GetPropertiesReturnType { + /** + * Object properties. + */ + result: PropertyDescriptor[]; + /** + * Internal object properties (only of the element itself). + */ + internalProperties?: InternalPropertyDescriptor[] | undefined; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface CompileScriptReturnType { + /** + * Id of the script. + */ + scriptId?: ScriptId | undefined; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface RunScriptReturnType { + /** + * Run result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface QueryObjectsReturnType { + /** + * Array with objects. + */ + objects: RemoteObject; + } + interface GlobalLexicalScopeNamesReturnType { + names: string[]; + } + interface ExecutionContextCreatedEventDataType { + /** + * A newly created execution context. + */ + context: ExecutionContextDescription; + } + interface ExecutionContextDestroyedEventDataType { + /** + * Id of the destroyed context + */ + executionContextId: ExecutionContextId; + } + interface ExceptionThrownEventDataType { + /** + * Timestamp of the exception. + */ + timestamp: Timestamp; + exceptionDetails: ExceptionDetails; + } + interface ExceptionRevokedEventDataType { + /** + * Reason describing why exception was revoked. + */ + reason: string; + /** + * The id of revoked exception, as reported in exceptionThrown. + */ + exceptionId: number; + } + interface ConsoleAPICalledEventDataType { + /** + * Type of the call. + */ + type: string; + /** + * Call arguments. + */ + args: RemoteObject[]; + /** + * Identifier of the context where the call was made. + */ + executionContextId: ExecutionContextId; + /** + * Call timestamp. + */ + timestamp: Timestamp; + /** + * Stack trace captured when the call was made. + */ + stackTrace?: StackTrace | undefined; + /** + * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. + * @experimental + */ + context?: string | undefined; + } + interface InspectRequestedEventDataType { + object: RemoteObject; + hints: object; + } + } + namespace Debugger { + /** + * Breakpoint identifier. + */ + type BreakpointId = string; + /** + * Call frame identifier. + */ + type CallFrameId = string; + /** + * Location in the source code. + */ + interface Location { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number | undefined; + } + /** + * Location in the source code. + * @experimental + */ + interface ScriptPosition { + lineNumber: number; + columnNumber: number; + } + /** + * JavaScript call frame. Array of call frames form the call stack. + */ + interface CallFrame { + /** + * Call frame identifier. This identifier is only valid while the virtual machine is paused. + */ + callFrameId: CallFrameId; + /** + * Name of the JavaScript function called on this call frame. + */ + functionName: string; + /** + * Location in the source code. + */ + functionLocation?: Location | undefined; + /** + * Location in the source code. + */ + location: Location; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Scope chain for this call frame. + */ + scopeChain: Scope[]; + /** + * this object for this call frame. + */ + this: Runtime.RemoteObject; + /** + * The value being returned, if the function is at return point. + */ + returnValue?: Runtime.RemoteObject | undefined; + } + /** + * Scope description. + */ + interface Scope { + /** + * Scope type. + */ + type: string; + /** + * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. + */ + object: Runtime.RemoteObject; + name?: string | undefined; + /** + * Location in the source code where scope starts + */ + startLocation?: Location | undefined; + /** + * Location in the source code where scope ends + */ + endLocation?: Location | undefined; + } + /** + * Search match for resource. + */ + interface SearchMatch { + /** + * Line number in resource content. + */ + lineNumber: number; + /** + * Line with match content. + */ + lineContent: string; + } + interface BreakLocation { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number | undefined; + type?: string | undefined; + } + interface SetBreakpointsActiveParameterType { + /** + * New value for breakpoints active state. + */ + active: boolean; + } + interface SetSkipAllPausesParameterType { + /** + * New value for skip pauses state. + */ + skip: boolean; + } + interface SetBreakpointByUrlParameterType { + /** + * Line number to set breakpoint at. + */ + lineNumber: number; + /** + * URL of the resources to set breakpoint on. + */ + url?: string | undefined; + /** + * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. + */ + urlRegex?: string | undefined; + /** + * Script hash of the resources to set breakpoint on. + */ + scriptHash?: string | undefined; + /** + * Offset in the line to set breakpoint at. + */ + columnNumber?: number | undefined; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string | undefined; + } + interface SetBreakpointParameterType { + /** + * Location to set breakpoint in. + */ + location: Location; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string | undefined; + } + interface RemoveBreakpointParameterType { + breakpointId: BreakpointId; + } + interface GetPossibleBreakpointsParameterType { + /** + * Start of range to search possible breakpoint locations in. + */ + start: Location; + /** + * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. + */ + end?: Location | undefined; + /** + * Only consider locations which are in the same (non-nested) function as start. + */ + restrictToFunction?: boolean | undefined; + } + interface ContinueToLocationParameterType { + /** + * Location to continue to. + */ + location: Location; + targetCallFrames?: string | undefined; + } + interface PauseOnAsyncCallParameterType { + /** + * Debugger will pause when async call with given stack trace is started. + */ + parentStackTraceId: Runtime.StackTraceId; + } + interface StepIntoParameterType { + /** + * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. + * @experimental + */ + breakOnAsyncCall?: boolean | undefined; + } + interface GetStackTraceParameterType { + stackTraceId: Runtime.StackTraceId; + } + interface SearchInContentParameterType { + /** + * Id of the script to search in. + */ + scriptId: Runtime.ScriptId; + /** + * String to search for. + */ + query: string; + /** + * If true, search is case sensitive. + */ + caseSensitive?: boolean | undefined; + /** + * If true, treats string parameter as regex. + */ + isRegex?: boolean | undefined; + } + interface SetScriptSourceParameterType { + /** + * Id of the script to edit. + */ + scriptId: Runtime.ScriptId; + /** + * New content of the script. + */ + scriptSource: string; + /** + * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. + */ + dryRun?: boolean | undefined; + } + interface RestartFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: CallFrameId; + } + interface GetScriptSourceParameterType { + /** + * Id of the script to get source for. + */ + scriptId: Runtime.ScriptId; + } + interface SetPauseOnExceptionsParameterType { + /** + * Pause on exceptions mode. + */ + state: string; + } + interface EvaluateOnCallFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: CallFrameId; + /** + * Expression to evaluate. + */ + expression: string; + /** + * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). + */ + objectGroup?: string | undefined; + /** + * Specifies whether command line API should be available to the evaluated expression, defaults to false. + */ + includeCommandLineAPI?: boolean | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean | undefined; + /** + * Whether to throw an exception if side effect cannot be ruled out during evaluation. + */ + throwOnSideEffect?: boolean | undefined; + } + interface SetVariableValueParameterType { + /** + * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. + */ + scopeNumber: number; + /** + * Variable name. + */ + variableName: string; + /** + * New variable value. + */ + newValue: Runtime.CallArgument; + /** + * Id of callframe that holds variable. + */ + callFrameId: CallFrameId; + } + interface SetReturnValueParameterType { + /** + * New return value. + */ + newValue: Runtime.CallArgument; + } + interface SetAsyncCallStackDepthParameterType { + /** + * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). + */ + maxDepth: number; + } + interface SetBlackboxPatternsParameterType { + /** + * Array of regexps that will be used to check script url for blackbox state. + */ + patterns: string[]; + } + interface SetBlackboxedRangesParameterType { + /** + * Id of the script. + */ + scriptId: Runtime.ScriptId; + positions: ScriptPosition[]; + } + interface EnableReturnType { + /** + * Unique identifier of the debugger. + * @experimental + */ + debuggerId: Runtime.UniqueDebuggerId; + } + interface SetBreakpointByUrlReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: BreakpointId; + /** + * List of the locations this breakpoint resolved into upon addition. + */ + locations: Location[]; + } + interface SetBreakpointReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: BreakpointId; + /** + * Location this breakpoint resolved into. + */ + actualLocation: Location; + } + interface GetPossibleBreakpointsReturnType { + /** + * List of the possible breakpoint locations. + */ + locations: BreakLocation[]; + } + interface GetStackTraceReturnType { + stackTrace: Runtime.StackTrace; + } + interface SearchInContentReturnType { + /** + * List of search matches. + */ + result: SearchMatch[]; + } + interface SetScriptSourceReturnType { + /** + * New stack trace in case editing has happened while VM was stopped. + */ + callFrames?: CallFrame[] | undefined; + /** + * Whether current call stack was modified after applying the changes. + */ + stackChanged?: boolean | undefined; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace | undefined; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId | undefined; + /** + * Exception details if any. + */ + exceptionDetails?: Runtime.ExceptionDetails | undefined; + } + interface RestartFrameReturnType { + /** + * New stack trace. + */ + callFrames: CallFrame[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace | undefined; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId | undefined; + } + interface GetScriptSourceReturnType { + /** + * Script source. + */ + scriptSource: string; + } + interface EvaluateOnCallFrameReturnType { + /** + * Object wrapper for the evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails | undefined; + } + interface ScriptParsedEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: object | undefined; + /** + * True, if this script is generated as a result of the live edit operation. + * @experimental + */ + isLiveEdit?: boolean | undefined; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string | undefined; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean | undefined; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean | undefined; + /** + * This script length. + */ + length?: number | undefined; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace | undefined; + } + interface ScriptFailedToParseEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: object | undefined; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string | undefined; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean | undefined; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean | undefined; + /** + * This script length. + */ + length?: number | undefined; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace | undefined; + } + interface BreakpointResolvedEventDataType { + /** + * Breakpoint unique identifier. + */ + breakpointId: BreakpointId; + /** + * Actual breakpoint location. + */ + location: Location; + } + interface PausedEventDataType { + /** + * Call stack the virtual machine stopped on. + */ + callFrames: CallFrame[]; + /** + * Pause reason. + */ + reason: string; + /** + * Object containing break-specific auxiliary properties. + */ + data?: object | undefined; + /** + * Hit breakpoints IDs + */ + hitBreakpoints?: string[] | undefined; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace | undefined; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId | undefined; + /** + * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. + * @experimental + */ + asyncCallStackTraceId?: Runtime.StackTraceId | undefined; + } + } + namespace Console { + /** + * Console message. + */ + interface ConsoleMessage { + /** + * Message source. + */ + source: string; + /** + * Message severity. + */ + level: string; + /** + * Message text. + */ + text: string; + /** + * URL of the message origin. + */ + url?: string | undefined; + /** + * Line number in the resource that generated this message (1-based). + */ + line?: number | undefined; + /** + * Column number in the resource that generated this message (1-based). + */ + column?: number | undefined; + } + interface MessageAddedEventDataType { + /** + * Console message that has been added. + */ + message: ConsoleMessage; + } + } + namespace Profiler { + /** + * Profile node. Holds callsite information, execution statistics and child nodes. + */ + interface ProfileNode { + /** + * Unique id of the node. + */ + id: number; + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Number of samples where this node was on top of the call stack. + */ + hitCount?: number | undefined; + /** + * Child node ids. + */ + children?: number[] | undefined; + /** + * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. + */ + deoptReason?: string | undefined; + /** + * An array of source position ticks. + */ + positionTicks?: PositionTickInfo[] | undefined; + } + /** + * Profile. + */ + interface Profile { + /** + * The list of profile nodes. First item is the root node. + */ + nodes: ProfileNode[]; + /** + * Profiling start timestamp in microseconds. + */ + startTime: number; + /** + * Profiling end timestamp in microseconds. + */ + endTime: number; + /** + * Ids of samples top nodes. + */ + samples?: number[] | undefined; + /** + * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. + */ + timeDeltas?: number[] | undefined; + } + /** + * Specifies a number of samples attributed to a certain source position. + */ + interface PositionTickInfo { + /** + * Source line number (1-based). + */ + line: number; + /** + * Number of samples attributed to the source line. + */ + ticks: number; + } + /** + * Coverage data for a source range. + */ + interface CoverageRange { + /** + * JavaScript script source offset for the range start. + */ + startOffset: number; + /** + * JavaScript script source offset for the range end. + */ + endOffset: number; + /** + * Collected execution count of the source range. + */ + count: number; + } + /** + * Coverage data for a JavaScript function. + */ + interface FunctionCoverage { + /** + * JavaScript function name. + */ + functionName: string; + /** + * Source ranges inside the function with coverage data. + */ + ranges: CoverageRange[]; + /** + * Whether coverage data for this function has block granularity. + */ + isBlockCoverage: boolean; + } + /** + * Coverage data for a JavaScript script. + */ + interface ScriptCoverage { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Functions contained in the script that has coverage data. + */ + functions: FunctionCoverage[]; + } + interface SetSamplingIntervalParameterType { + /** + * New sampling interval in microseconds. + */ + interval: number; + } + interface StartPreciseCoverageParameterType { + /** + * Collect accurate call counts beyond simple 'covered' or 'not covered'. + */ + callCount?: boolean | undefined; + /** + * Collect block-based coverage. + */ + detailed?: boolean | undefined; + } + interface StopReturnType { + /** + * Recorded profile. + */ + profile: Profile; + } + interface TakePreciseCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: ScriptCoverage[]; + } + interface GetBestEffortCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: ScriptCoverage[]; + } + interface ConsoleProfileStartedEventDataType { + id: string; + /** + * Location of console.profile(). + */ + location: Debugger.Location; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string | undefined; + } + interface ConsoleProfileFinishedEventDataType { + id: string; + /** + * Location of console.profileEnd(). + */ + location: Debugger.Location; + profile: Profile; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string | undefined; + } + } + namespace HeapProfiler { + /** + * Heap snapshot object id. + */ + type HeapSnapshotObjectId = string; + /** + * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + */ + interface SamplingHeapProfileNode { + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Allocations size in bytes for the node excluding children. + */ + selfSize: number; + /** + * Child nodes. + */ + children: SamplingHeapProfileNode[]; + } + /** + * Profile. + */ + interface SamplingHeapProfile { + head: SamplingHeapProfileNode; + } + interface StartTrackingHeapObjectsParameterType { + trackAllocations?: boolean | undefined; + } + interface StopTrackingHeapObjectsParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. + */ + reportProgress?: boolean | undefined; + } + interface TakeHeapSnapshotParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. + */ + reportProgress?: boolean | undefined; + } + interface GetObjectByHeapObjectIdParameterType { + objectId: HeapSnapshotObjectId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string | undefined; + } + interface AddInspectedHeapObjectParameterType { + /** + * Heap snapshot object id to be accessible by means of $x command line API. + */ + heapObjectId: HeapSnapshotObjectId; + } + interface GetHeapObjectIdParameterType { + /** + * Identifier of the object to get heap object id for. + */ + objectId: Runtime.RemoteObjectId; + } + interface StartSamplingParameterType { + /** + * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. + */ + samplingInterval?: number | undefined; + } + interface GetObjectByHeapObjectIdReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + } + interface GetHeapObjectIdReturnType { + /** + * Id of the heap snapshot object corresponding to the passed remote object id. + */ + heapSnapshotObjectId: HeapSnapshotObjectId; + } + interface StopSamplingReturnType { + /** + * Recorded sampling heap profile. + */ + profile: SamplingHeapProfile; + } + interface GetSamplingProfileReturnType { + /** + * Return the sampling profile being collected. + */ + profile: SamplingHeapProfile; + } + interface AddHeapSnapshotChunkEventDataType { + chunk: string; + } + interface ReportHeapSnapshotProgressEventDataType { + done: number; + total: number; + finished?: boolean | undefined; + } + interface LastSeenObjectIdEventDataType { + lastSeenObjectId: number; + timestamp: number; + } + interface HeapStatsUpdateEventDataType { + /** + * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. + */ + statsUpdate: number[]; + } + } + namespace IO { + type StreamHandle = string; + interface ReadParameterType { + /** + * Handle of the stream to read. + */ + handle: StreamHandle; + /** + * Seek to the specified offset before reading (if not specified, proceed with offset + * following the last read). Some types of streams may only support sequential reads. + */ + offset?: number | undefined; + /** + * Maximum number of bytes to read (left upon the agent discretion if not specified). + */ + size?: number | undefined; + } + interface CloseParameterType { + /** + * Handle of the stream to close. + */ + handle: StreamHandle; + } + interface ReadReturnType { + /** + * Data that were read. + */ + data: string; + /** + * Set if the end-of-file condition occurred while reading. + */ + eof: boolean; + } + } + namespace Network { + /** + * Resource type as it was perceived by the rendering engine. + */ + type ResourceType = string; + /** + * Unique request identifier. + */ + type RequestId = string; + /** + * UTC time in seconds, counted from January 1, 1970. + */ + type TimeSinceEpoch = number; + /** + * Monotonically increasing time in seconds since an arbitrary point in the past. + */ + type MonotonicTime = number; + /** + * Information about the request initiator. + */ + interface Initiator { + /** + * Type of this initiator. + */ + type: string; + /** + * Initiator JavaScript stack trace, set for Script only. + * Requires the Debugger domain to be enabled. + */ + stack?: Runtime.StackTrace | undefined; + /** + * Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type. + */ + url?: string | undefined; + /** + * Initiator line number, set for Parser type or for Script type (when script is importing + * module) (0-based). + */ + lineNumber?: number | undefined; + /** + * Initiator column number, set for Parser type or for Script type (when script is importing + * module) (0-based). + */ + columnNumber?: number | undefined; + /** + * Set if another request triggered this request (e.g. preflight). + */ + requestId?: RequestId | undefined; + } + /** + * HTTP request data. + */ + interface Request { + url: string; + method: string; + headers: Headers; + hasPostData: boolean; + } + /** + * HTTP response data. + */ + interface Response { + url: string; + status: number; + statusText: string; + headers: Headers; + mimeType: string; + charset: string; + } + /** + * Request / response headers as keys / values of JSON object. + */ + interface Headers { + } + interface LoadNetworkResourcePageResult { + success: boolean; + stream?: IO.StreamHandle | undefined; + } + /** + * WebSocket response data. + */ + interface WebSocketResponse { + /** + * HTTP response status code. + */ + status: number; + /** + * HTTP response status text. + */ + statusText: string; + /** + * HTTP response headers. + */ + headers: Headers; + } + interface EnableParameterType { + /** + * Buffer size in bytes to use when preserving network payloads (XHRs, etc). + * @experimental + */ + maxTotalBufferSize?: number | undefined; + /** + * Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc). + * @experimental + */ + maxResourceBufferSize?: number | undefined; + } + interface GetRequestPostDataParameterType { + /** + * Identifier of the network request to get content for. + */ + requestId: RequestId; + } + interface GetResponseBodyParameterType { + /** + * Identifier of the network request to get content for. + */ + requestId: RequestId; + } + interface StreamResourceContentParameterType { + /** + * Identifier of the request to stream. + */ + requestId: RequestId; + } + interface LoadNetworkResourceParameterType { + /** + * URL of the resource to get content for. + */ + url: string; + } + interface GetRequestPostDataReturnType { + /** + * Request body string, omitting files from multipart requests + */ + postData: string; + } + interface GetResponseBodyReturnType { + /** + * Response body. + */ + body: string; + /** + * True, if content was sent as base64. + */ + base64Encoded: boolean; + } + interface StreamResourceContentReturnType { + /** + * Data that has been buffered until streaming is enabled. + */ + bufferedData: string; + } + interface LoadNetworkResourceReturnType { + resource: LoadNetworkResourcePageResult; + } + interface RequestWillBeSentEventDataType { + /** + * Request identifier. + */ + requestId: RequestId; + /** + * Request data. + */ + request: Request; + /** + * Request initiator. + */ + initiator: Initiator; + /** + * Timestamp. + */ + timestamp: MonotonicTime; + /** + * Timestamp. + */ + wallTime: TimeSinceEpoch; + } + interface ResponseReceivedEventDataType { + /** + * Request identifier. + */ + requestId: RequestId; + /** + * Timestamp. + */ + timestamp: MonotonicTime; + /** + * Resource type. + */ + type: ResourceType; + /** + * Response data. + */ + response: Response; + } + interface LoadingFailedEventDataType { + /** + * Request identifier. + */ + requestId: RequestId; + /** + * Timestamp. + */ + timestamp: MonotonicTime; + /** + * Resource type. + */ + type: ResourceType; + /** + * Error message. + */ + errorText: string; + } + interface LoadingFinishedEventDataType { + /** + * Request identifier. + */ + requestId: RequestId; + /** + * Timestamp. + */ + timestamp: MonotonicTime; + } + interface DataReceivedEventDataType { + /** + * Request identifier. + */ + requestId: RequestId; + /** + * Timestamp. + */ + timestamp: MonotonicTime; + /** + * Data chunk length. + */ + dataLength: number; + /** + * Actual bytes received (might be less than dataLength for compressed encodings). + */ + encodedDataLength: number; + /** + * Data that was received. + * @experimental + */ + data?: string | undefined; + } + interface WebSocketCreatedEventDataType { + /** + * Request identifier. + */ + requestId: RequestId; + /** + * WebSocket request URL. + */ + url: string; + /** + * Request initiator. + */ + initiator: Initiator; + } + interface WebSocketClosedEventDataType { + /** + * Request identifier. + */ + requestId: RequestId; + /** + * Timestamp. + */ + timestamp: MonotonicTime; + } + interface WebSocketHandshakeResponseReceivedEventDataType { + /** + * Request identifier. + */ + requestId: RequestId; + /** + * Timestamp. + */ + timestamp: MonotonicTime; + /** + * WebSocket response data. + */ + response: WebSocketResponse; + } + } + namespace NodeRuntime { + interface NotifyWhenWaitingForDisconnectParameterType { + enabled: boolean; + } + } + namespace NodeTracing { + interface TraceConfig { + /** + * Controls how the trace buffer stores data. + */ + recordMode?: string | undefined; + /** + * Included category filters. + */ + includedCategories: string[]; + } + interface StartParameterType { + traceConfig: TraceConfig; + } + interface GetCategoriesReturnType { + /** + * A list of supported tracing categories. + */ + categories: string[]; + } + interface DataCollectedEventDataType { + value: object[]; + } + } + namespace NodeWorker { + type WorkerID = string; + /** + * Unique identifier of attached debugging session. + */ + type SessionID = string; + interface WorkerInfo { + workerId: WorkerID; + type: string; + title: string; + url: string; + } + interface SendMessageToWorkerParameterType { + message: string; + /** + * Identifier of the session. + */ + sessionId: SessionID; + } + interface EnableParameterType { + /** + * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` + * message to run them. + */ + waitForDebuggerOnStart: boolean; + } + interface DetachParameterType { + sessionId: SessionID; + } + interface AttachedToWorkerEventDataType { + /** + * Identifier assigned to the session used to send/receive messages. + */ + sessionId: SessionID; + workerInfo: WorkerInfo; + waitingForDebugger: boolean; + } + interface DetachedFromWorkerEventDataType { + /** + * Detached session identifier. + */ + sessionId: SessionID; + } + interface ReceivedMessageFromWorkerEventDataType { + /** + * Identifier of a session which sends a message. + */ + sessionId: SessionID; + message: string; + } + } + namespace Target { + type SessionID = string; + type TargetID = string; + interface TargetInfo { + targetId: TargetID; + type: string; + title: string; + url: string; + attached: boolean; + canAccessOpener: boolean; + } + interface SetAutoAttachParameterType { + autoAttach: boolean; + waitForDebuggerOnStart: boolean; + } + interface TargetCreatedEventDataType { + targetInfo: TargetInfo; + } + interface AttachedToTargetEventDataType { + sessionId: SessionID; + targetInfo: TargetInfo; + waitingForDebugger: boolean; + } + } + namespace DOMStorage { + type SerializedStorageKey = string; + /** + * DOM Storage identifier. + */ + interface StorageId { + /** + * Security origin for the storage. + */ + securityOrigin?: string | undefined; + /** + * Represents a key by which DOM Storage keys its CachedStorageAreas + */ + storageKey?: SerializedStorageKey | undefined; + /** + * Whether the storage is local storage (not session storage). + */ + isLocalStorage: boolean; + } + /** + * DOM Storage item. + */ + type Item = string[]; + interface ClearParameterType { + storageId: StorageId; + } + interface GetDOMStorageItemsParameterType { + storageId: StorageId; + } + interface RemoveDOMStorageItemParameterType { + storageId: StorageId; + key: string; + } + interface SetDOMStorageItemParameterType { + storageId: StorageId; + key: string; + value: string; + } + interface GetDOMStorageItemsReturnType { + entries: Item[]; + } + interface DomStorageItemAddedEventDataType { + storageId: StorageId; + key: string; + newValue: string; + } + interface DomStorageItemRemovedEventDataType { + storageId: StorageId; + key: string; + } + interface DomStorageItemUpdatedEventDataType { + storageId: StorageId; + key: string; + oldValue: string; + newValue: string; + } + interface DomStorageItemsClearedEventDataType { + storageId: StorageId; + } + } + namespace Storage { + type SerializedStorageKey = string; + interface GetStorageKeyParameterType { + frameId?: string | undefined; + } + interface GetStorageKeyReturnType { + storageKey: SerializedStorageKey; + } + } + interface Session { + /** + * Posts a message to the inspector back-end. `callback` will be notified when + * a response is received. `callback` is a function that accepts two optional + * arguments: error and message-specific result. + * + * ```js + * session.post('Runtime.evaluate', { expression: '2 + 2' }, + * (error, { result }) => console.log(result)); + * // Output: { type: 'number', value: 4, description: '4' } + * ``` + * + * The latest version of the V8 inspector protocol is published on the + * [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). + * + * Node.js inspector supports all the Chrome DevTools Protocol domains declared + * by V8. Chrome DevTools Protocol domain provides an interface for interacting + * with one of the runtime agents used to inspect the application state and listen + * to the run-time events. + */ + post(method: string, callback?: (err: Error | null, params?: object) => void): void; + post(method: string, params?: object, callback?: (err: Error | null, params?: object) => void): void; + /** + * Returns supported domains. + */ + post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; + /** + * Evaluates expression on global object. + */ + post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + /** + * Add handler to promise with given promise object id. + */ + post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + post(method: "Runtime.awaitPromise", callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + /** + * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. + */ + post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + post(method: "Runtime.callFunctionOn", callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + /** + * Returns properties of a given object. Object group of the result is inherited from the target object. + */ + post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + post(method: "Runtime.getProperties", callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + /** + * Releases remote object with given id. + */ + post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObject", callback?: (err: Error | null) => void): void; + /** + * Releases all remote objects that belong to a given group. + */ + post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObjectGroup", callback?: (err: Error | null) => void): void; + /** + * Tells inspected instance to run if it was waiting for debugger to attach. + */ + post(method: "Runtime.runIfWaitingForDebugger", callback?: (err: Error | null) => void): void; + /** + * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. + */ + post(method: "Runtime.enable", callback?: (err: Error | null) => void): void; + /** + * Disables reporting of execution contexts creation. + */ + post(method: "Runtime.disable", callback?: (err: Error | null) => void): void; + /** + * Discards collected exceptions and console API calls. + */ + post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void; + /** + * @experimental + */ + post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void; + /** + * Compiles expression. + */ + post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + /** + * Runs script with given id in a given context. + */ + post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + /** + * Returns all let, const and class variables from global scope. + */ + post( + method: "Runtime.globalLexicalScopeNames", + params?: Runtime.GlobalLexicalScopeNamesParameterType, + callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void + ): void; + post(method: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; + /** + * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. + */ + post(method: "Debugger.enable", callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; + /** + * Disables debugger for given page. + */ + post(method: "Debugger.disable", callback?: (err: Error | null) => void): void; + /** + * Activates / deactivates all breakpoints on the page. + */ + post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void; + /** + * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). + */ + post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void; + /** + * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. + */ + post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + /** + * Sets JavaScript breakpoint at a given location. + */ + post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + /** + * Removes JavaScript breakpoint. + */ + post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void; + /** + * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. + */ + post( + method: "Debugger.getPossibleBreakpoints", + params?: Debugger.GetPossibleBreakpointsParameterType, + callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void + ): void; + post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + /** + * Continues execution until specific location is reached. + */ + post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void; + /** + * @experimental + */ + post(method: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.pauseOnAsyncCall", callback?: (err: Error | null) => void): void; + /** + * Steps over the statement. + */ + post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void; + /** + * Steps into the function call. + */ + post(method: "Debugger.stepInto", params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void; + /** + * Steps out of the function call. + */ + post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void; + /** + * Stops on the next JavaScript statement. + */ + post(method: "Debugger.pause", callback?: (err: Error | null) => void): void; + /** + * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. + * @experimental + */ + post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void; + /** + * Resumes JavaScript execution. + */ + post(method: "Debugger.resume", callback?: (err: Error | null) => void): void; + /** + * Returns stack trace with given stackTraceId. + * @experimental + */ + post(method: "Debugger.getStackTrace", params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + post(method: "Debugger.getStackTrace", callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + /** + * Searches for given string in script content. + */ + post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + /** + * Edits JavaScript source live. + */ + post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + /** + * Restarts particular call frame from the beginning. + */ + post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + /** + * Returns source for the script with given id. + */ + post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + /** + * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. + */ + post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void; + /** + * Evaluates expression on a given call frame. + */ + post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + /** + * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. + */ + post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void; + /** + * Changes return value in top frame. Available only at return break position. + * @experimental + */ + post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setReturnValue", callback?: (err: Error | null) => void): void; + /** + * Enables or disables async call stacks tracking. + */ + post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; + /** + * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + * @experimental + */ + post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void; + /** + * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. + * @experimental + */ + post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void; + /** + * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. + */ + post(method: "Console.enable", callback?: (err: Error | null) => void): void; + /** + * Disables console domain, prevents further console messages from being reported to the client. + */ + post(method: "Console.disable", callback?: (err: Error | null) => void): void; + /** + * Does nothing. + */ + post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void; + post(method: "Profiler.enable", callback?: (err: Error | null) => void): void; + post(method: "Profiler.disable", callback?: (err: Error | null) => void): void; + /** + * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + */ + post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void; + post(method: "Profiler.start", callback?: (err: Error | null) => void): void; + post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; + /** + * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. + */ + post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void; + /** + * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. + */ + post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void; + /** + * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. + */ + post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; + /** + * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. + */ + post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; + post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void; + post( + method: "HeapProfiler.getObjectByHeapObjectId", + params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, + callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void + ): void; + post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + /** + * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). + */ + post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; + post(method: "HeapProfiler.getSamplingProfile", callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; + /** + * Read a chunk of the stream + */ + post(method: "IO.read", params?: IO.ReadParameterType, callback?: (err: Error | null, params: IO.ReadReturnType) => void): void; + post(method: "IO.read", callback?: (err: Error | null, params: IO.ReadReturnType) => void): void; + post(method: "IO.close", params?: IO.CloseParameterType, callback?: (err: Error | null) => void): void; + post(method: "IO.close", callback?: (err: Error | null) => void): void; + /** + * Disables network tracking, prevents network events from being sent to the client. + */ + post(method: "Network.disable", callback?: (err: Error | null) => void): void; + /** + * Enables network tracking, network events will now be delivered to the client. + */ + post(method: "Network.enable", params?: Network.EnableParameterType, callback?: (err: Error | null) => void): void; + post(method: "Network.enable", callback?: (err: Error | null) => void): void; + /** + * Returns post data sent with the request. Returns an error when no data was sent with the request. + */ + post(method: "Network.getRequestPostData", params?: Network.GetRequestPostDataParameterType, callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void; + post(method: "Network.getRequestPostData", callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void; + /** + * Returns content served for the given request. + */ + post(method: "Network.getResponseBody", params?: Network.GetResponseBodyParameterType, callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void; + post(method: "Network.getResponseBody", callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void; + /** + * Enables streaming of the response for the given requestId. + * If enabled, the dataReceived event contains the data that was received during streaming. + * @experimental + */ + post( + method: "Network.streamResourceContent", + params?: Network.StreamResourceContentParameterType, + callback?: (err: Error | null, params: Network.StreamResourceContentReturnType) => void + ): void; + post(method: "Network.streamResourceContent", callback?: (err: Error | null, params: Network.StreamResourceContentReturnType) => void): void; + /** + * Fetches the resource and returns the content. + */ + post(method: "Network.loadNetworkResource", params?: Network.LoadNetworkResourceParameterType, callback?: (err: Error | null, params: Network.LoadNetworkResourceReturnType) => void): void; + post(method: "Network.loadNetworkResource", callback?: (err: Error | null, params: Network.LoadNetworkResourceReturnType) => void): void; + /** + * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`. + */ + post(method: "NodeRuntime.enable", callback?: (err: Error | null) => void): void; + /** + * Disable NodeRuntime events + */ + post(method: "NodeRuntime.disable", callback?: (err: Error | null) => void): void; + /** + * Enable the `NodeRuntime.waitingForDisconnect`. + */ + post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", callback?: (err: Error | null) => void): void; + /** + * Gets supported tracing categories. + */ + post(method: "NodeTracing.getCategories", callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; + /** + * Start trace events collection. + */ + post(method: "NodeTracing.start", params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeTracing.start", callback?: (err: Error | null) => void): void; + /** + * Stop trace events collection. Remaining collected events will be sent as a sequence of + * dataCollected events followed by tracingComplete event. + */ + post(method: "NodeTracing.stop", callback?: (err: Error | null) => void): void; + /** + * Sends protocol message over session with given id. + */ + post(method: "NodeWorker.sendMessageToWorker", params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeWorker.sendMessageToWorker", callback?: (err: Error | null) => void): void; + /** + * Instructs the inspector to attach to running workers. Will also attach to new workers + * as they start + */ + post(method: "NodeWorker.enable", params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeWorker.enable", callback?: (err: Error | null) => void): void; + /** + * Detaches from all running workers and disables attaching to new workers as they are started. + */ + post(method: "NodeWorker.disable", callback?: (err: Error | null) => void): void; + /** + * Detached from the worker with given sessionId. + */ + post(method: "NodeWorker.detach", params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeWorker.detach", callback?: (err: Error | null) => void): void; + post(method: "Target.setAutoAttach", params?: Target.SetAutoAttachParameterType, callback?: (err: Error | null) => void): void; + post(method: "Target.setAutoAttach", callback?: (err: Error | null) => void): void; + post(method: "DOMStorage.clear", params?: DOMStorage.ClearParameterType, callback?: (err: Error | null) => void): void; + post(method: "DOMStorage.clear", callback?: (err: Error | null) => void): void; + /** + * Disables storage tracking, prevents storage events from being sent to the client. + */ + post(method: "DOMStorage.disable", callback?: (err: Error | null) => void): void; + /** + * Enables storage tracking, storage events will now be delivered to the client. + */ + post(method: "DOMStorage.enable", callback?: (err: Error | null) => void): void; + post( + method: "DOMStorage.getDOMStorageItems", + params?: DOMStorage.GetDOMStorageItemsParameterType, + callback?: (err: Error | null, params: DOMStorage.GetDOMStorageItemsReturnType) => void + ): void; + post(method: "DOMStorage.getDOMStorageItems", callback?: (err: Error | null, params: DOMStorage.GetDOMStorageItemsReturnType) => void): void; + post(method: "DOMStorage.removeDOMStorageItem", params?: DOMStorage.RemoveDOMStorageItemParameterType, callback?: (err: Error | null) => void): void; + post(method: "DOMStorage.removeDOMStorageItem", callback?: (err: Error | null) => void): void; + post(method: "DOMStorage.setDOMStorageItem", params?: DOMStorage.SetDOMStorageItemParameterType, callback?: (err: Error | null) => void): void; + post(method: "DOMStorage.setDOMStorageItem", callback?: (err: Error | null) => void): void; + /** + * @experimental + */ + post(method: "Storage.getStorageKey", params?: Storage.GetStorageKeyParameterType, callback?: (err: Error | null, params: Storage.GetStorageKeyReturnType) => void): void; + post(method: "Storage.getStorageKey", callback?: (err: Error | null, params: Storage.GetStorageKeyReturnType) => void): void; + addListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + addListener(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; + /** + * Issued when new execution context is created. + */ + addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + addListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + addListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + addListener(event: "Debugger.resumed", listener: () => void): this; + /** + * Issued when new console message is added. + */ + addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + /** + * Fired when page is about to send HTTP request. + */ + addListener(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; + /** + * Fired when HTTP response is available. + */ + addListener(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + addListener(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + addListener(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; + /** + * Fired when data chunk was received over the network. + */ + addListener(event: "Network.dataReceived", listener: (message: InspectorNotification) => void): this; + /** + * Fired upon WebSocket creation. + */ + addListener(event: "Network.webSocketCreated", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket is closed. + */ + addListener(event: "Network.webSocketClosed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket handshake response becomes available. + */ + addListener(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + addListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; + /** + * This event is fired when the runtime is waiting for the debugger. For + * example, when inspector.waitingForDebugger is called + */ + addListener(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + /** + * Contains an bucket of collected trace events. + */ + addListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + addListener(event: "NodeTracing.tracingComplete", listener: () => void): this; + /** + * Issued when attached to a worker. + */ + addListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + addListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + addListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + addListener(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + addListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; + addListener(event: "DOMStorage.domStorageItemAdded", listener: (message: InspectorNotification) => void): this; + addListener(event: "DOMStorage.domStorageItemRemoved", listener: (message: InspectorNotification) => void): this; + addListener(event: "DOMStorage.domStorageItemUpdated", listener: (message: InspectorNotification) => void): this; + addListener(event: "DOMStorage.domStorageItemsCleared", listener: (message: InspectorNotification) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "inspectorNotification", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextCreated", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextsCleared"): boolean; + emit(event: "Runtime.exceptionThrown", message: InspectorNotification): boolean; + emit(event: "Runtime.exceptionRevoked", message: InspectorNotification): boolean; + emit(event: "Runtime.consoleAPICalled", message: InspectorNotification): boolean; + emit(event: "Runtime.inspectRequested", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptParsed", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification): boolean; + emit(event: "Debugger.breakpointResolved", message: InspectorNotification): boolean; + emit(event: "Debugger.paused", message: InspectorNotification): boolean; + emit(event: "Debugger.resumed"): boolean; + emit(event: "Console.messageAdded", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.addHeapSnapshotChunk", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.resetProfiles"): boolean; + emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification): boolean; + emit(event: "Network.requestWillBeSent", message: InspectorNotification): boolean; + emit(event: "Network.responseReceived", message: InspectorNotification): boolean; + emit(event: "Network.loadingFailed", message: InspectorNotification): boolean; + emit(event: "Network.loadingFinished", message: InspectorNotification): boolean; + emit(event: "Network.dataReceived", message: InspectorNotification): boolean; + emit(event: "Network.webSocketCreated", message: InspectorNotification): boolean; + emit(event: "Network.webSocketClosed", message: InspectorNotification): boolean; + emit(event: "Network.webSocketHandshakeResponseReceived", message: InspectorNotification): boolean; + emit(event: "NodeRuntime.waitingForDisconnect"): boolean; + emit(event: "NodeRuntime.waitingForDebugger"): boolean; + emit(event: "NodeTracing.dataCollected", message: InspectorNotification): boolean; + emit(event: "NodeTracing.tracingComplete"): boolean; + emit(event: "NodeWorker.attachedToWorker", message: InspectorNotification): boolean; + emit(event: "NodeWorker.detachedFromWorker", message: InspectorNotification): boolean; + emit(event: "NodeWorker.receivedMessageFromWorker", message: InspectorNotification): boolean; + emit(event: "Target.targetCreated", message: InspectorNotification): boolean; + emit(event: "Target.attachedToTarget", message: InspectorNotification): boolean; + emit(event: "DOMStorage.domStorageItemAdded", message: InspectorNotification): boolean; + emit(event: "DOMStorage.domStorageItemRemoved", message: InspectorNotification): boolean; + emit(event: "DOMStorage.domStorageItemUpdated", message: InspectorNotification): boolean; + emit(event: "DOMStorage.domStorageItemsCleared", message: InspectorNotification): boolean; + on(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + on(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; + /** + * Issued when new execution context is created. + */ + on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + on(event: "Runtime.executionContextsCleared", listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + on(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + on(event: "Debugger.resumed", listener: () => void): this; + /** + * Issued when new console message is added. + */ + on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.resetProfiles", listener: () => void): this; + on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + /** + * Fired when page is about to send HTTP request. + */ + on(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; + /** + * Fired when HTTP response is available. + */ + on(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + on(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + on(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; + /** + * Fired when data chunk was received over the network. + */ + on(event: "Network.dataReceived", listener: (message: InspectorNotification) => void): this; + /** + * Fired upon WebSocket creation. + */ + on(event: "Network.webSocketCreated", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket is closed. + */ + on(event: "Network.webSocketClosed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket handshake response becomes available. + */ + on(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + on(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; + /** + * This event is fired when the runtime is waiting for the debugger. For + * example, when inspector.waitingForDebugger is called + */ + on(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + /** + * Contains an bucket of collected trace events. + */ + on(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + on(event: "NodeTracing.tracingComplete", listener: () => void): this; + /** + * Issued when attached to a worker. + */ + on(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + on(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + on(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + on(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + on(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; + on(event: "DOMStorage.domStorageItemAdded", listener: (message: InspectorNotification) => void): this; + on(event: "DOMStorage.domStorageItemRemoved", listener: (message: InspectorNotification) => void): this; + on(event: "DOMStorage.domStorageItemUpdated", listener: (message: InspectorNotification) => void): this; + on(event: "DOMStorage.domStorageItemsCleared", listener: (message: InspectorNotification) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + once(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; + /** + * Issued when new execution context is created. + */ + once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + once(event: "Runtime.executionContextsCleared", listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + once(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + once(event: "Debugger.resumed", listener: () => void): this; + /** + * Issued when new console message is added. + */ + once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.resetProfiles", listener: () => void): this; + once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + /** + * Fired when page is about to send HTTP request. + */ + once(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; + /** + * Fired when HTTP response is available. + */ + once(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + once(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + once(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; + /** + * Fired when data chunk was received over the network. + */ + once(event: "Network.dataReceived", listener: (message: InspectorNotification) => void): this; + /** + * Fired upon WebSocket creation. + */ + once(event: "Network.webSocketCreated", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket is closed. + */ + once(event: "Network.webSocketClosed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket handshake response becomes available. + */ + once(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + once(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; + /** + * This event is fired when the runtime is waiting for the debugger. For + * example, when inspector.waitingForDebugger is called + */ + once(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + /** + * Contains an bucket of collected trace events. + */ + once(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + once(event: "NodeTracing.tracingComplete", listener: () => void): this; + /** + * Issued when attached to a worker. + */ + once(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + once(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + once(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + once(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + once(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; + once(event: "DOMStorage.domStorageItemAdded", listener: (message: InspectorNotification) => void): this; + once(event: "DOMStorage.domStorageItemRemoved", listener: (message: InspectorNotification) => void): this; + once(event: "DOMStorage.domStorageItemUpdated", listener: (message: InspectorNotification) => void): this; + once(event: "DOMStorage.domStorageItemsCleared", listener: (message: InspectorNotification) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependListener(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; + /** + * Issued when new execution context is created. + */ + prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + prependListener(event: "Debugger.resumed", listener: () => void): this; + /** + * Issued when new console message is added. + */ + prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + /** + * Fired when page is about to send HTTP request. + */ + prependListener(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; + /** + * Fired when HTTP response is available. + */ + prependListener(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; + /** + * Fired when data chunk was received over the network. + */ + prependListener(event: "Network.dataReceived", listener: (message: InspectorNotification) => void): this; + /** + * Fired upon WebSocket creation. + */ + prependListener(event: "Network.webSocketCreated", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket is closed. + */ + prependListener(event: "Network.webSocketClosed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket handshake response becomes available. + */ + prependListener(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + prependListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; + /** + * This event is fired when the runtime is waiting for the debugger. For + * example, when inspector.waitingForDebugger is called + */ + prependListener(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + /** + * Contains an bucket of collected trace events. + */ + prependListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependListener(event: "NodeTracing.tracingComplete", listener: () => void): this; + /** + * Issued when attached to a worker. + */ + prependListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + prependListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; + prependListener(event: "DOMStorage.domStorageItemAdded", listener: (message: InspectorNotification) => void): this; + prependListener(event: "DOMStorage.domStorageItemRemoved", listener: (message: InspectorNotification) => void): this; + prependListener(event: "DOMStorage.domStorageItemUpdated", listener: (message: InspectorNotification) => void): this; + prependListener(event: "DOMStorage.domStorageItemsCleared", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; + /** + * Issued when new execution context is created. + */ + prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + prependOnceListener(event: "Debugger.resumed", listener: () => void): this; + /** + * Issued when new console message is added. + */ + prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + /** + * Fired when page is about to send HTTP request. + */ + prependOnceListener(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; + /** + * Fired when HTTP response is available. + */ + prependOnceListener(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; + /** + * Fired when data chunk was received over the network. + */ + prependOnceListener(event: "Network.dataReceived", listener: (message: InspectorNotification) => void): this; + /** + * Fired upon WebSocket creation. + */ + prependOnceListener(event: "Network.webSocketCreated", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket is closed. + */ + prependOnceListener(event: "Network.webSocketClosed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket handshake response becomes available. + */ + prependOnceListener(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + prependOnceListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; + /** + * This event is fired when the runtime is waiting for the debugger. For + * example, when inspector.waitingForDebugger is called + */ + prependOnceListener(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + /** + * Contains an bucket of collected trace events. + */ + prependOnceListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependOnceListener(event: "NodeTracing.tracingComplete", listener: () => void): this; + /** + * Issued when attached to a worker. + */ + prependOnceListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + prependOnceListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependOnceListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "DOMStorage.domStorageItemAdded", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "DOMStorage.domStorageItemRemoved", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "DOMStorage.domStorageItemUpdated", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "DOMStorage.domStorageItemsCleared", listener: (message: InspectorNotification) => void): this; + } +} +declare module "node:inspector/promises" { + export { + Schema, + Runtime, + Debugger, + Console, + Profiler, + HeapProfiler, + IO, + Network, + NodeRuntime, + NodeTracing, + NodeWorker, + Target, + DOMStorage, + Storage, + } from 'inspector'; +} +declare module "node:inspector/promises" { + import { + InspectorNotification, + Schema, + Runtime, + Debugger, + Console, + Profiler, + HeapProfiler, + IO, + Network, + NodeRuntime, + NodeTracing, + NodeWorker, + Target, + DOMStorage, + Storage, + } from "inspector"; + /** + * The `inspector.Session` is used for dispatching messages to the V8 inspector + * back-end and receiving message responses and notifications. + * @since v19.0.0 + */ + interface Session { + /** + * Posts a message to the inspector back-end. + * + * ```js + * import { Session } from 'node:inspector/promises'; + * try { + * const session = new Session(); + * session.connect(); + * const result = await session.post('Runtime.evaluate', { expression: '2 + 2' }); + * console.log(result); + * } catch (error) { + * console.error(error); + * } + * // Output: { result: { type: 'number', value: 4, description: '4' } } + * ``` + * + * The latest version of the V8 inspector protocol is published on the + * [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). + * + * Node.js inspector supports all the Chrome DevTools Protocol domains declared + * by V8. Chrome DevTools Protocol domain provides an interface for interacting + * with one of the runtime agents used to inspect the application state and listen + * to the run-time events. + */ + post(method: string, params?: object): Promise; + /** + * Returns supported domains. + */ + post(method: "Schema.getDomains"): Promise; + /** + * Evaluates expression on global object. + */ + post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType): Promise; + /** + * Add handler to promise with given promise object id. + */ + post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType): Promise; + /** + * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. + */ + post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType): Promise; + /** + * Returns properties of a given object. Object group of the result is inherited from the target object. + */ + post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType): Promise; + /** + * Releases remote object with given id. + */ + post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType): Promise; + /** + * Releases all remote objects that belong to a given group. + */ + post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType): Promise; + /** + * Tells inspected instance to run if it was waiting for debugger to attach. + */ + post(method: "Runtime.runIfWaitingForDebugger"): Promise; + /** + * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. + */ + post(method: "Runtime.enable"): Promise; + /** + * Disables reporting of execution contexts creation. + */ + post(method: "Runtime.disable"): Promise; + /** + * Discards collected exceptions and console API calls. + */ + post(method: "Runtime.discardConsoleEntries"): Promise; + /** + * @experimental + */ + post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType): Promise; + /** + * Compiles expression. + */ + post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType): Promise; + /** + * Runs script with given id in a given context. + */ + post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType): Promise; + post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType): Promise; + /** + * Returns all let, const and class variables from global scope. + */ + post(method: "Runtime.globalLexicalScopeNames", params?: Runtime.GlobalLexicalScopeNamesParameterType): Promise; + /** + * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. + */ + post(method: "Debugger.enable"): Promise; + /** + * Disables debugger for given page. + */ + post(method: "Debugger.disable"): Promise; + /** + * Activates / deactivates all breakpoints on the page. + */ + post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType): Promise; + /** + * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). + */ + post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType): Promise; + /** + * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. + */ + post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType): Promise; + /** + * Sets JavaScript breakpoint at a given location. + */ + post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType): Promise; + /** + * Removes JavaScript breakpoint. + */ + post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType): Promise; + /** + * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. + */ + post(method: "Debugger.getPossibleBreakpoints", params?: Debugger.GetPossibleBreakpointsParameterType): Promise; + /** + * Continues execution until specific location is reached. + */ + post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType): Promise; + /** + * @experimental + */ + post(method: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType): Promise; + /** + * Steps over the statement. + */ + post(method: "Debugger.stepOver"): Promise; + /** + * Steps into the function call. + */ + post(method: "Debugger.stepInto", params?: Debugger.StepIntoParameterType): Promise; + /** + * Steps out of the function call. + */ + post(method: "Debugger.stepOut"): Promise; + /** + * Stops on the next JavaScript statement. + */ + post(method: "Debugger.pause"): Promise; + /** + * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. + * @experimental + */ + post(method: "Debugger.scheduleStepIntoAsync"): Promise; + /** + * Resumes JavaScript execution. + */ + post(method: "Debugger.resume"): Promise; + /** + * Returns stack trace with given stackTraceId. + * @experimental + */ + post(method: "Debugger.getStackTrace", params?: Debugger.GetStackTraceParameterType): Promise; + /** + * Searches for given string in script content. + */ + post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType): Promise; + /** + * Edits JavaScript source live. + */ + post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType): Promise; + /** + * Restarts particular call frame from the beginning. + */ + post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType): Promise; + /** + * Returns source for the script with given id. + */ + post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType): Promise; + /** + * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. + */ + post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType): Promise; + /** + * Evaluates expression on a given call frame. + */ + post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType): Promise; + /** + * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. + */ + post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType): Promise; + /** + * Changes return value in top frame. Available only at return break position. + * @experimental + */ + post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType): Promise; + /** + * Enables or disables async call stacks tracking. + */ + post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType): Promise; + /** + * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + * @experimental + */ + post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType): Promise; + /** + * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. + * @experimental + */ + post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType): Promise; + /** + * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. + */ + post(method: "Console.enable"): Promise; + /** + * Disables console domain, prevents further console messages from being reported to the client. + */ + post(method: "Console.disable"): Promise; + /** + * Does nothing. + */ + post(method: "Console.clearMessages"): Promise; + post(method: "Profiler.enable"): Promise; + post(method: "Profiler.disable"): Promise; + /** + * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + */ + post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType): Promise; + post(method: "Profiler.start"): Promise; + post(method: "Profiler.stop"): Promise; + /** + * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. + */ + post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType): Promise; + /** + * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. + */ + post(method: "Profiler.stopPreciseCoverage"): Promise; + /** + * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. + */ + post(method: "Profiler.takePreciseCoverage"): Promise; + /** + * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. + */ + post(method: "Profiler.getBestEffortCoverage"): Promise; + post(method: "HeapProfiler.enable"): Promise; + post(method: "HeapProfiler.disable"): Promise; + post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType): Promise; + post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType): Promise; + post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType): Promise; + post(method: "HeapProfiler.collectGarbage"): Promise; + post(method: "HeapProfiler.getObjectByHeapObjectId", params?: HeapProfiler.GetObjectByHeapObjectIdParameterType): Promise; + /** + * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). + */ + post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType): Promise; + post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType): Promise; + post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType): Promise; + post(method: "HeapProfiler.stopSampling"): Promise; + post(method: "HeapProfiler.getSamplingProfile"): Promise; + /** + * Read a chunk of the stream + */ + post(method: "IO.read", params?: IO.ReadParameterType): Promise; + post(method: "IO.close", params?: IO.CloseParameterType): Promise; + /** + * Disables network tracking, prevents network events from being sent to the client. + */ + post(method: "Network.disable"): Promise; + /** + * Enables network tracking, network events will now be delivered to the client. + */ + post(method: "Network.enable", params?: Network.EnableParameterType): Promise; + /** + * Returns post data sent with the request. Returns an error when no data was sent with the request. + */ + post(method: "Network.getRequestPostData", params?: Network.GetRequestPostDataParameterType): Promise; + /** + * Returns content served for the given request. + */ + post(method: "Network.getResponseBody", params?: Network.GetResponseBodyParameterType): Promise; + /** + * Enables streaming of the response for the given requestId. + * If enabled, the dataReceived event contains the data that was received during streaming. + * @experimental + */ + post(method: "Network.streamResourceContent", params?: Network.StreamResourceContentParameterType): Promise; + /** + * Fetches the resource and returns the content. + */ + post(method: "Network.loadNetworkResource", params?: Network.LoadNetworkResourceParameterType): Promise; + /** + * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`. + */ + post(method: "NodeRuntime.enable"): Promise; + /** + * Disable NodeRuntime events + */ + post(method: "NodeRuntime.disable"): Promise; + /** + * Enable the `NodeRuntime.waitingForDisconnect`. + */ + post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType): Promise; + /** + * Gets supported tracing categories. + */ + post(method: "NodeTracing.getCategories"): Promise; + /** + * Start trace events collection. + */ + post(method: "NodeTracing.start", params?: NodeTracing.StartParameterType): Promise; + /** + * Stop trace events collection. Remaining collected events will be sent as a sequence of + * dataCollected events followed by tracingComplete event. + */ + post(method: "NodeTracing.stop"): Promise; + /** + * Sends protocol message over session with given id. + */ + post(method: "NodeWorker.sendMessageToWorker", params?: NodeWorker.SendMessageToWorkerParameterType): Promise; + /** + * Instructs the inspector to attach to running workers. Will also attach to new workers + * as they start + */ + post(method: "NodeWorker.enable", params?: NodeWorker.EnableParameterType): Promise; + /** + * Detaches from all running workers and disables attaching to new workers as they are started. + */ + post(method: "NodeWorker.disable"): Promise; + /** + * Detached from the worker with given sessionId. + */ + post(method: "NodeWorker.detach", params?: NodeWorker.DetachParameterType): Promise; + post(method: "Target.setAutoAttach", params?: Target.SetAutoAttachParameterType): Promise; + post(method: "DOMStorage.clear", params?: DOMStorage.ClearParameterType): Promise; + /** + * Disables storage tracking, prevents storage events from being sent to the client. + */ + post(method: "DOMStorage.disable"): Promise; + /** + * Enables storage tracking, storage events will now be delivered to the client. + */ + post(method: "DOMStorage.enable"): Promise; + post(method: "DOMStorage.getDOMStorageItems", params?: DOMStorage.GetDOMStorageItemsParameterType): Promise; + post(method: "DOMStorage.removeDOMStorageItem", params?: DOMStorage.RemoveDOMStorageItemParameterType): Promise; + post(method: "DOMStorage.setDOMStorageItem", params?: DOMStorage.SetDOMStorageItemParameterType): Promise; + /** + * @experimental + */ + post(method: "Storage.getStorageKey", params?: Storage.GetStorageKeyParameterType): Promise; + addListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + addListener(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; + /** + * Issued when new execution context is created. + */ + addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + addListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + addListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + addListener(event: "Debugger.resumed", listener: () => void): this; + /** + * Issued when new console message is added. + */ + addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + /** + * Fired when page is about to send HTTP request. + */ + addListener(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; + /** + * Fired when HTTP response is available. + */ + addListener(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + addListener(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + addListener(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; + /** + * Fired when data chunk was received over the network. + */ + addListener(event: "Network.dataReceived", listener: (message: InspectorNotification) => void): this; + /** + * Fired upon WebSocket creation. + */ + addListener(event: "Network.webSocketCreated", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket is closed. + */ + addListener(event: "Network.webSocketClosed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket handshake response becomes available. + */ + addListener(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + addListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; + /** + * This event is fired when the runtime is waiting for the debugger. For + * example, when inspector.waitingForDebugger is called + */ + addListener(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + /** + * Contains an bucket of collected trace events. + */ + addListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + addListener(event: "NodeTracing.tracingComplete", listener: () => void): this; + /** + * Issued when attached to a worker. + */ + addListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + addListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + addListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + addListener(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + addListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; + addListener(event: "DOMStorage.domStorageItemAdded", listener: (message: InspectorNotification) => void): this; + addListener(event: "DOMStorage.domStorageItemRemoved", listener: (message: InspectorNotification) => void): this; + addListener(event: "DOMStorage.domStorageItemUpdated", listener: (message: InspectorNotification) => void): this; + addListener(event: "DOMStorage.domStorageItemsCleared", listener: (message: InspectorNotification) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "inspectorNotification", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextCreated", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextsCleared"): boolean; + emit(event: "Runtime.exceptionThrown", message: InspectorNotification): boolean; + emit(event: "Runtime.exceptionRevoked", message: InspectorNotification): boolean; + emit(event: "Runtime.consoleAPICalled", message: InspectorNotification): boolean; + emit(event: "Runtime.inspectRequested", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptParsed", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification): boolean; + emit(event: "Debugger.breakpointResolved", message: InspectorNotification): boolean; + emit(event: "Debugger.paused", message: InspectorNotification): boolean; + emit(event: "Debugger.resumed"): boolean; + emit(event: "Console.messageAdded", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.addHeapSnapshotChunk", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.resetProfiles"): boolean; + emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification): boolean; + emit(event: "Network.requestWillBeSent", message: InspectorNotification): boolean; + emit(event: "Network.responseReceived", message: InspectorNotification): boolean; + emit(event: "Network.loadingFailed", message: InspectorNotification): boolean; + emit(event: "Network.loadingFinished", message: InspectorNotification): boolean; + emit(event: "Network.dataReceived", message: InspectorNotification): boolean; + emit(event: "Network.webSocketCreated", message: InspectorNotification): boolean; + emit(event: "Network.webSocketClosed", message: InspectorNotification): boolean; + emit(event: "Network.webSocketHandshakeResponseReceived", message: InspectorNotification): boolean; + emit(event: "NodeRuntime.waitingForDisconnect"): boolean; + emit(event: "NodeRuntime.waitingForDebugger"): boolean; + emit(event: "NodeTracing.dataCollected", message: InspectorNotification): boolean; + emit(event: "NodeTracing.tracingComplete"): boolean; + emit(event: "NodeWorker.attachedToWorker", message: InspectorNotification): boolean; + emit(event: "NodeWorker.detachedFromWorker", message: InspectorNotification): boolean; + emit(event: "NodeWorker.receivedMessageFromWorker", message: InspectorNotification): boolean; + emit(event: "Target.targetCreated", message: InspectorNotification): boolean; + emit(event: "Target.attachedToTarget", message: InspectorNotification): boolean; + emit(event: "DOMStorage.domStorageItemAdded", message: InspectorNotification): boolean; + emit(event: "DOMStorage.domStorageItemRemoved", message: InspectorNotification): boolean; + emit(event: "DOMStorage.domStorageItemUpdated", message: InspectorNotification): boolean; + emit(event: "DOMStorage.domStorageItemsCleared", message: InspectorNotification): boolean; + on(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + on(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; + /** + * Issued when new execution context is created. + */ + on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + on(event: "Runtime.executionContextsCleared", listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + on(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + on(event: "Debugger.resumed", listener: () => void): this; + /** + * Issued when new console message is added. + */ + on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.resetProfiles", listener: () => void): this; + on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + /** + * Fired when page is about to send HTTP request. + */ + on(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; + /** + * Fired when HTTP response is available. + */ + on(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + on(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + on(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; + /** + * Fired when data chunk was received over the network. + */ + on(event: "Network.dataReceived", listener: (message: InspectorNotification) => void): this; + /** + * Fired upon WebSocket creation. + */ + on(event: "Network.webSocketCreated", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket is closed. + */ + on(event: "Network.webSocketClosed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket handshake response becomes available. + */ + on(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + on(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; + /** + * This event is fired when the runtime is waiting for the debugger. For + * example, when inspector.waitingForDebugger is called + */ + on(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + /** + * Contains an bucket of collected trace events. + */ + on(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + on(event: "NodeTracing.tracingComplete", listener: () => void): this; + /** + * Issued when attached to a worker. + */ + on(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + on(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + on(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + on(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + on(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; + on(event: "DOMStorage.domStorageItemAdded", listener: (message: InspectorNotification) => void): this; + on(event: "DOMStorage.domStorageItemRemoved", listener: (message: InspectorNotification) => void): this; + on(event: "DOMStorage.domStorageItemUpdated", listener: (message: InspectorNotification) => void): this; + on(event: "DOMStorage.domStorageItemsCleared", listener: (message: InspectorNotification) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + once(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; + /** + * Issued when new execution context is created. + */ + once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + once(event: "Runtime.executionContextsCleared", listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + once(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + once(event: "Debugger.resumed", listener: () => void): this; + /** + * Issued when new console message is added. + */ + once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.resetProfiles", listener: () => void): this; + once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + /** + * Fired when page is about to send HTTP request. + */ + once(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; + /** + * Fired when HTTP response is available. + */ + once(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + once(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + once(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; + /** + * Fired when data chunk was received over the network. + */ + once(event: "Network.dataReceived", listener: (message: InspectorNotification) => void): this; + /** + * Fired upon WebSocket creation. + */ + once(event: "Network.webSocketCreated", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket is closed. + */ + once(event: "Network.webSocketClosed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket handshake response becomes available. + */ + once(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + once(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; + /** + * This event is fired when the runtime is waiting for the debugger. For + * example, when inspector.waitingForDebugger is called + */ + once(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + /** + * Contains an bucket of collected trace events. + */ + once(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + once(event: "NodeTracing.tracingComplete", listener: () => void): this; + /** + * Issued when attached to a worker. + */ + once(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + once(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + once(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + once(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + once(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; + once(event: "DOMStorage.domStorageItemAdded", listener: (message: InspectorNotification) => void): this; + once(event: "DOMStorage.domStorageItemRemoved", listener: (message: InspectorNotification) => void): this; + once(event: "DOMStorage.domStorageItemUpdated", listener: (message: InspectorNotification) => void): this; + once(event: "DOMStorage.domStorageItemsCleared", listener: (message: InspectorNotification) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependListener(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; + /** + * Issued when new execution context is created. + */ + prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + prependListener(event: "Debugger.resumed", listener: () => void): this; + /** + * Issued when new console message is added. + */ + prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + /** + * Fired when page is about to send HTTP request. + */ + prependListener(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; + /** + * Fired when HTTP response is available. + */ + prependListener(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; + /** + * Fired when data chunk was received over the network. + */ + prependListener(event: "Network.dataReceived", listener: (message: InspectorNotification) => void): this; + /** + * Fired upon WebSocket creation. + */ + prependListener(event: "Network.webSocketCreated", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket is closed. + */ + prependListener(event: "Network.webSocketClosed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket handshake response becomes available. + */ + prependListener(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + prependListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; + /** + * This event is fired when the runtime is waiting for the debugger. For + * example, when inspector.waitingForDebugger is called + */ + prependListener(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + /** + * Contains an bucket of collected trace events. + */ + prependListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependListener(event: "NodeTracing.tracingComplete", listener: () => void): this; + /** + * Issued when attached to a worker. + */ + prependListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + prependListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; + prependListener(event: "DOMStorage.domStorageItemAdded", listener: (message: InspectorNotification) => void): this; + prependListener(event: "DOMStorage.domStorageItemRemoved", listener: (message: InspectorNotification) => void): this; + prependListener(event: "DOMStorage.domStorageItemUpdated", listener: (message: InspectorNotification) => void): this; + prependListener(event: "DOMStorage.domStorageItemsCleared", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; + /** + * Issued when new execution context is created. + */ + prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + prependOnceListener(event: "Debugger.resumed", listener: () => void): this; + /** + * Issued when new console message is added. + */ + prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + /** + * Fired when page is about to send HTTP request. + */ + prependOnceListener(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; + /** + * Fired when HTTP response is available. + */ + prependOnceListener(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; + /** + * Fired when data chunk was received over the network. + */ + prependOnceListener(event: "Network.dataReceived", listener: (message: InspectorNotification) => void): this; + /** + * Fired upon WebSocket creation. + */ + prependOnceListener(event: "Network.webSocketCreated", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket is closed. + */ + prependOnceListener(event: "Network.webSocketClosed", listener: (message: InspectorNotification) => void): this; + /** + * Fired when WebSocket handshake response becomes available. + */ + prependOnceListener(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + prependOnceListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; + /** + * This event is fired when the runtime is waiting for the debugger. For + * example, when inspector.waitingForDebugger is called + */ + prependOnceListener(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + /** + * Contains an bucket of collected trace events. + */ + prependOnceListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependOnceListener(event: "NodeTracing.tracingComplete", listener: () => void): this; + /** + * Issued when attached to a worker. + */ + prependOnceListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + prependOnceListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependOnceListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "DOMStorage.domStorageItemAdded", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "DOMStorage.domStorageItemRemoved", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "DOMStorage.domStorageItemUpdated", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "DOMStorage.domStorageItemsCleared", listener: (message: InspectorNotification) => void): this; + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/inspector/promises.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/inspector/promises.d.ts new file mode 100644 index 0000000..54e1250 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/inspector/promises.d.ts @@ -0,0 +1,41 @@ +/** + * The `node:inspector/promises` module provides an API for interacting with the V8 + * inspector. + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/inspector/promises.js) + * @since v19.0.0 + */ +declare module "node:inspector/promises" { + import { EventEmitter } from "node:events"; + export { close, console, NetworkResources, open, url, waitForDebugger } from "node:inspector"; + /** + * The `inspector.Session` is used for dispatching messages to the V8 inspector + * back-end and receiving message responses and notifications. + * @since v19.0.0 + */ + export class Session extends EventEmitter { + /** + * Create a new instance of the inspector.Session class. + * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend. + */ + constructor(); + /** + * Connects a session to the inspector back-end. + */ + connect(): void; + /** + * Connects a session to the inspector back-end. + * An exception will be thrown if this API was not called on a Worker thread. + * @since v12.11.0 + */ + connectToMainThread(): void; + /** + * Immediately close the session. All pending message callbacks will be called with an error. + * `session.connect()` will need to be called to be able to send messages again. + * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. + */ + disconnect(): void; + } +} +declare module "inspector/promises" { + export * from "node:inspector/promises"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/module.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/module.d.ts new file mode 100644 index 0000000..6a8e339 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/module.d.ts @@ -0,0 +1,757 @@ +/** + * @since v0.3.7 + */ +declare module "node:module" { + import { URL } from "node:url"; + class Module { + constructor(id: string, parent?: Module); + } + interface Module extends NodeJS.Module {} + namespace Module { + export { Module }; + } + namespace Module { + /** + * A list of the names of all modules provided by Node.js. Can be used to verify + * if a module is maintained by a third party or not. + * + * Note: the list doesn't contain prefix-only modules like `node:test`. + * @since v9.3.0, v8.10.0, v6.13.0 + */ + const builtinModules: readonly string[]; + /** + * @since v12.2.0 + * @param path Filename to be used to construct the require + * function. Must be a file URL object, file URL string, or absolute path + * string. + */ + function createRequire(path: string | URL): NodeJS.Require; + namespace constants { + /** + * The following constants are returned as the `status` field in the object returned by + * {@link enableCompileCache} to indicate the result of the attempt to enable the + * [module compile cache](https://nodejs.org/docs/latest-v25.x/api/module.html#module-compile-cache). + * @since v22.8.0 + */ + namespace compileCacheStatus { + /** + * Node.js has enabled the compile cache successfully. The directory used to store the + * compile cache will be returned in the `directory` field in the + * returned object. + */ + const ENABLED: number; + /** + * The compile cache has already been enabled before, either by a previous call to + * {@link enableCompileCache}, or by the `NODE_COMPILE_CACHE=dir` + * environment variable. The directory used to store the + * compile cache will be returned in the `directory` field in the + * returned object. + */ + const ALREADY_ENABLED: number; + /** + * Node.js fails to enable the compile cache. This can be caused by the lack of + * permission to use the specified directory, or various kinds of file system errors. + * The detail of the failure will be returned in the `message` field in the + * returned object. + */ + const FAILED: number; + /** + * Node.js cannot enable the compile cache because the environment variable + * `NODE_DISABLE_COMPILE_CACHE=1` has been set. + */ + const DISABLED: number; + } + } + interface EnableCompileCacheOptions { + /** + * Optional. Directory to store the compile cache. If not specified, + * the directory specified by the `NODE_COMPILE_CACHE=dir` environment variable + * will be used if it's set, or `path.join(os.tmpdir(), 'node-compile-cache')` + * otherwise. + * @since v25.0.0 + */ + directory?: string | undefined; + /** + * Optional. If `true`, enables portable compile cache so that + * the cache can be reused even if the project directory is moved. This is a best-effort + * feature. If not specified, it will depend on whether the environment variable + * `NODE_COMPILE_CACHE_PORTABLE=1` is set. + * @since v25.0.0 + */ + portable?: boolean | undefined; + } + interface EnableCompileCacheResult { + /** + * One of the {@link constants.compileCacheStatus} + */ + status: number; + /** + * If Node.js cannot enable the compile cache, this contains + * the error message. Only set if `status` is `module.constants.compileCacheStatus.FAILED`. + */ + message?: string; + /** + * If the compile cache is enabled, this contains the directory + * where the compile cache is stored. Only set if `status` is + * `module.constants.compileCacheStatus.ENABLED` or + * `module.constants.compileCacheStatus.ALREADY_ENABLED`. + */ + directory?: string; + } + /** + * Enable [module compile cache](https://nodejs.org/docs/latest-v25.x/api/module.html#module-compile-cache) + * in the current Node.js instance. + * + * For general use cases, it's recommended to call `module.enableCompileCache()` without + * specifying the `options.directory`, so that the directory can be overridden by the + * `NODE_COMPILE_CACHE` environment variable when necessary. + * + * Since compile cache is supposed to be a optimization that is not mission critical, this + * method is designed to not throw any exception when the compile cache cannot be enabled. + * Instead, it will return an object containing an error message in the `message` field to + * aid debugging. If compile cache is enabled successfully, the `directory` field in the + * returned object contains the path to the directory where the compile cache is stored. The + * `status` field in the returned object would be one of the `module.constants.compileCacheStatus` + * values to indicate the result of the attempt to enable the + * [module compile cache](https://nodejs.org/docs/latest-v25.x/api/module.html#module-compile-cache). + * + * This method only affects the current Node.js instance. To enable it in child worker threads, + * either call this method in child worker threads too, or set the + * `process.env.NODE_COMPILE_CACHE` value to compile cache directory so the behavior can + * be inherited into the child workers. The directory can be obtained either from the + * `directory` field returned by this method, or with {@link getCompileCacheDir}. + * @since v22.8.0 + * @param options Optional. If a string is passed, it is considered to be `options.directory`. + */ + function enableCompileCache(options?: string | EnableCompileCacheOptions): EnableCompileCacheResult; + /** + * Flush the [module compile cache](https://nodejs.org/docs/latest-v25.x/api/module.html#module-compile-cache) + * accumulated from modules already loaded + * in the current Node.js instance to disk. This returns after all the flushing + * file system operations come to an end, no matter they succeed or not. If there + * are any errors, this will fail silently, since compile cache misses should not + * interfere with the actual operation of the application. + * @since v22.10.0 + */ + function flushCompileCache(): void; + /** + * @since v22.8.0 + * @return Path to the [module compile cache](https://nodejs.org/docs/latest-v25.x/api/module.html#module-compile-cache) + * directory if it is enabled, or `undefined` otherwise. + */ + function getCompileCacheDir(): string | undefined; + /** + * ```text + * /path/to/project + * ├ packages/ + * ├ bar/ + * ├ bar.js + * └ package.json // name = '@foo/bar' + * └ qux/ + * ├ node_modules/ + * └ some-package/ + * └ package.json // name = 'some-package' + * ├ qux.js + * └ package.json // name = '@foo/qux' + * ├ main.js + * └ package.json // name = '@foo' + * ``` + * ```js + * // /path/to/project/packages/bar/bar.js + * import { findPackageJSON } from 'node:module'; + * + * findPackageJSON('..', import.meta.url); + * // '/path/to/project/package.json' + * // Same result when passing an absolute specifier instead: + * findPackageJSON(new URL('../', import.meta.url)); + * findPackageJSON(import.meta.resolve('../')); + * + * findPackageJSON('some-package', import.meta.url); + * // '/path/to/project/packages/bar/node_modules/some-package/package.json' + * // When passing an absolute specifier, you might get a different result if the + * // resolved module is inside a subfolder that has nested `package.json`. + * findPackageJSON(import.meta.resolve('some-package')); + * // '/path/to/project/packages/bar/node_modules/some-package/some-subfolder/package.json' + * + * findPackageJSON('@foo/qux', import.meta.url); + * // '/path/to/project/packages/qux/package.json' + * ``` + * @since v22.14.0 + * @param specifier The specifier for the module whose `package.json` to + * retrieve. When passing a _bare specifier_, the `package.json` at the root of + * the package is returned. When passing a _relative specifier_ or an _absolute specifier_, + * the closest parent `package.json` is returned. + * @param base The absolute location (`file:` URL string or FS path) of the + * containing module. For CJS, use `__filename` (not `__dirname`!); for ESM, use + * `import.meta.url`. You do not need to pass it if `specifier` is an _absolute specifier_. + * @returns A path if the `package.json` is found. When `startLocation` + * is a package, the package's root `package.json`; when a relative or unresolved, the closest + * `package.json` to the `startLocation`. + */ + function findPackageJSON(specifier: string | URL, base?: string | URL): string | undefined; + /** + * @since v18.6.0, v16.17.0 + */ + function isBuiltin(moduleName: string): boolean; + interface RegisterOptions { + /** + * If you want to resolve `specifier` relative to a + * base URL, such as `import.meta.url`, you can pass that URL here. This + * property is ignored if the `parentURL` is supplied as the second argument. + * @default 'data:' + */ + parentURL?: string | URL | undefined; + /** + * Any arbitrary, cloneable JavaScript value to pass into the + * {@link initialize} hook. + */ + data?: Data | undefined; + /** + * [Transferable objects](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html#portpostmessagevalue-transferlist) + * to be passed into the `initialize` hook. + */ + transferList?: any[] | undefined; + } + /* eslint-disable @definitelytyped/no-unnecessary-generics */ + /** + * Register a module that exports hooks that customize Node.js module + * resolution and loading behavior. See + * [Customization hooks](https://nodejs.org/docs/latest-v25.x/api/module.html#customization-hooks). + * + * This feature requires `--allow-worker` if used with the + * [Permission Model](https://nodejs.org/docs/latest-v25.x/api/permissions.html#permission-model). + * @since v20.6.0, v18.19.0 + * @param specifier Customization hooks to be registered; this should be + * the same string that would be passed to `import()`, except that if it is + * relative, it is resolved relative to `parentURL`. + * @param parentURL f you want to resolve `specifier` relative to a base + * URL, such as `import.meta.url`, you can pass that URL here. + */ + function register( + specifier: string | URL, + parentURL?: string | URL, + options?: RegisterOptions, + ): void; + function register(specifier: string | URL, options?: RegisterOptions): void; + interface RegisterHooksOptions { + /** + * See [load hook](https://nodejs.org/docs/latest-v25.x/api/module.html#loadurl-context-nextload). + * @default undefined + */ + load?: LoadHookSync | undefined; + /** + * See [resolve hook](https://nodejs.org/docs/latest-v25.x/api/module.html#resolvespecifier-context-nextresolve). + * @default undefined + */ + resolve?: ResolveHookSync | undefined; + } + interface ModuleHooks { + /** + * Deregister the hook instance. + */ + deregister(): void; + } + /** + * Register [hooks](https://nodejs.org/docs/latest-v25.x/api/module.html#customization-hooks) + * that customize Node.js module resolution and loading behavior. + * @since v22.15.0 + * @experimental + */ + function registerHooks(options: RegisterHooksOptions): ModuleHooks; + interface StripTypeScriptTypesOptions { + /** + * Possible values are: + * * `'strip'` Only strip type annotations without performing the transformation of TypeScript features. + * * `'transform'` Strip type annotations and transform TypeScript features to JavaScript. + * @default 'strip' + */ + mode?: "strip" | "transform" | undefined; + /** + * Only when `mode` is `'transform'`, if `true`, a source map + * will be generated for the transformed code. + * @default false + */ + sourceMap?: boolean | undefined; + /** + * Specifies the source url used in the source map. + */ + sourceUrl?: string | undefined; + } + /** + * `module.stripTypeScriptTypes()` removes type annotations from TypeScript code. It + * can be used to strip type annotations from TypeScript code before running it + * with `vm.runInContext()` or `vm.compileFunction()`. + * By default, it will throw an error if the code contains TypeScript features + * that require transformation such as `Enums`, + * see [type-stripping](https://nodejs.org/docs/latest-v25.x/api/typescript.md#type-stripping) for more information. + * When mode is `'transform'`, it also transforms TypeScript features to JavaScript, + * see [transform TypeScript features](https://nodejs.org/docs/latest-v25.x/api/typescript.md#typescript-features) for more information. + * When mode is `'strip'`, source maps are not generated, because locations are preserved. + * If `sourceMap` is provided, when mode is `'strip'`, an error will be thrown. + * + * _WARNING_: The output of this function should not be considered stable across Node.js versions, + * due to changes in the TypeScript parser. + * + * ```js + * import { stripTypeScriptTypes } from 'node:module'; + * const code = 'const a: number = 1;'; + * const strippedCode = stripTypeScriptTypes(code); + * console.log(strippedCode); + * // Prints: const a = 1; + * ``` + * + * If `sourceUrl` is provided, it will be used appended as a comment at the end of the output: + * + * ```js + * import { stripTypeScriptTypes } from 'node:module'; + * const code = 'const a: number = 1;'; + * const strippedCode = stripTypeScriptTypes(code, { mode: 'strip', sourceUrl: 'source.ts' }); + * console.log(strippedCode); + * // Prints: const a = 1\n\n//# sourceURL=source.ts; + * ``` + * + * When `mode` is `'transform'`, the code is transformed to JavaScript: + * + * ```js + * import { stripTypeScriptTypes } from 'node:module'; + * const code = ` + * namespace MathUtil { + * export const add = (a: number, b: number) => a + b; + * }`; + * const strippedCode = stripTypeScriptTypes(code, { mode: 'transform', sourceMap: true }); + * console.log(strippedCode); + * // Prints: + * // var MathUtil; + * // (function(MathUtil) { + * // MathUtil.add = (a, b)=>a + b; + * // })(MathUtil || (MathUtil = {})); + * // # sourceMappingURL=data:application/json;base64, ... + * ``` + * @since v22.13.0 + * @param code The code to strip type annotations from. + * @returns The code with type annotations stripped. + */ + function stripTypeScriptTypes(code: string, options?: StripTypeScriptTypesOptions): string; + /* eslint-enable @definitelytyped/no-unnecessary-generics */ + /** + * The `module.syncBuiltinESMExports()` method updates all the live bindings for + * builtin `ES Modules` to match the properties of the `CommonJS` exports. It + * does not add or remove exported names from the `ES Modules`. + * + * ```js + * import fs from 'node:fs'; + * import assert from 'node:assert'; + * import { syncBuiltinESMExports } from 'node:module'; + * + * fs.readFile = newAPI; + * + * delete fs.readFileSync; + * + * function newAPI() { + * // ... + * } + * + * fs.newAPI = newAPI; + * + * syncBuiltinESMExports(); + * + * import('node:fs').then((esmFS) => { + * // It syncs the existing readFile property with the new value + * assert.strictEqual(esmFS.readFile, newAPI); + * // readFileSync has been deleted from the required fs + * assert.strictEqual('readFileSync' in fs, false); + * // syncBuiltinESMExports() does not remove readFileSync from esmFS + * assert.strictEqual('readFileSync' in esmFS, true); + * // syncBuiltinESMExports() does not add names + * assert.strictEqual(esmFS.newAPI, undefined); + * }); + * ``` + * @since v12.12.0 + */ + function syncBuiltinESMExports(): void; + interface ImportAttributes extends NodeJS.Dict { + type?: string | undefined; + } + type ImportPhase = "source" | "evaluation"; + type ModuleFormat = + | "addon" + | "builtin" + | "commonjs" + | "commonjs-typescript" + | "json" + | "module" + | "module-typescript" + | "wasm"; + type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray; + type InitializeHook = (data: Data) => void | Promise; + interface ResolveHookContext { + conditions: string[]; + importAttributes: ImportAttributes; + parentURL: string | undefined; + } + interface ResolveFnOutput { + format?: string | null | undefined; + importAttributes?: ImportAttributes | undefined; + shortCircuit?: boolean | undefined; + url: string; + } + type ResolveHook = ( + specifier: string, + context: ResolveHookContext, + nextResolve: ( + specifier: string, + context?: Partial, + ) => ResolveFnOutput | Promise, + ) => ResolveFnOutput | Promise; + type ResolveHookSync = ( + specifier: string, + context: ResolveHookContext, + nextResolve: ( + specifier: string, + context?: Partial, + ) => ResolveFnOutput, + ) => ResolveFnOutput; + interface LoadHookContext { + conditions: string[]; + format: string | null | undefined; + importAttributes: ImportAttributes; + } + interface LoadFnOutput { + format: string | null | undefined; + shortCircuit?: boolean | undefined; + source?: ModuleSource | undefined; + } + type LoadHook = ( + url: string, + context: LoadHookContext, + nextLoad: ( + url: string, + context?: Partial, + ) => LoadFnOutput | Promise, + ) => LoadFnOutput | Promise; + type LoadHookSync = ( + url: string, + context: LoadHookContext, + nextLoad: ( + url: string, + context?: Partial, + ) => LoadFnOutput, + ) => LoadFnOutput; + interface SourceMapsSupport { + /** + * If the source maps support is enabled + */ + enabled: boolean; + /** + * If the support is enabled for files in `node_modules`. + */ + nodeModules: boolean; + /** + * If the support is enabled for generated code from `eval` or `new Function`. + */ + generatedCode: boolean; + } + /** + * This method returns whether the [Source Map v3](https://tc39.es/ecma426/) support for stack + * traces is enabled. + * @since v23.7.0, v22.14.0 + */ + function getSourceMapsSupport(): SourceMapsSupport; + /** + * `path` is the resolved path for the file for which a corresponding source map + * should be fetched. + * @since v13.7.0, v12.17.0 + * @return Returns `module.SourceMap` if a source map is found, `undefined` otherwise. + */ + function findSourceMap(path: string): SourceMap | undefined; + interface SetSourceMapsSupportOptions { + /** + * If enabling the support for files in `node_modules`. + * @default false + */ + nodeModules?: boolean | undefined; + /** + * If enabling the support for generated code from `eval` or `new Function`. + * @default false + */ + generatedCode?: boolean | undefined; + } + /** + * This function enables or disables the [Source Map v3](https://tc39.es/ecma426/) support for + * stack traces. + * + * It provides same features as launching Node.js process with commandline options + * `--enable-source-maps`, with additional options to alter the support for files + * in `node_modules` or generated codes. + * + * Only source maps in JavaScript files that are loaded after source maps has been + * enabled will be parsed and loaded. Preferably, use the commandline options + * `--enable-source-maps` to avoid losing track of source maps of modules loaded + * before this API call. + * @since v23.7.0, v22.14.0 + */ + function setSourceMapsSupport(enabled: boolean, options?: SetSourceMapsSupportOptions): void; + interface SourceMapConstructorOptions { + /** + * @since v21.0.0, v20.5.0 + */ + lineLengths?: readonly number[] | undefined; + } + interface SourceMapPayload { + file: string; + version: number; + sources: string[]; + sourcesContent: string[]; + names: string[]; + mappings: string; + sourceRoot: string; + } + interface SourceMapping { + generatedLine: number; + generatedColumn: number; + originalSource: string; + originalLine: number; + originalColumn: number; + } + interface SourceOrigin { + /** + * The name of the range in the source map, if one was provided + */ + name: string | undefined; + /** + * The file name of the original source, as reported in the SourceMap + */ + fileName: string; + /** + * The 1-indexed lineNumber of the corresponding call site in the original source + */ + lineNumber: number; + /** + * The 1-indexed columnNumber of the corresponding call site in the original source + */ + columnNumber: number; + } + /** + * @since v13.7.0, v12.17.0 + */ + class SourceMap { + constructor(payload: SourceMapPayload, options?: SourceMapConstructorOptions); + /** + * Getter for the payload used to construct the `SourceMap` instance. + */ + readonly payload: SourceMapPayload; + /** + * Given a line offset and column offset in the generated source + * file, returns an object representing the SourceMap range in the + * original file if found, or an empty object if not. + * + * The object returned contains the following keys: + * + * The returned value represents the raw range as it appears in the + * SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and + * column numbers as they appear in Error messages and CallSite + * objects. + * + * To get the corresponding 1-indexed line and column numbers from a + * lineNumber and columnNumber as they are reported by Error stacks + * and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)` + * @param lineOffset The zero-indexed line number offset in the generated source + * @param columnOffset The zero-indexed column number offset in the generated source + */ + findEntry(lineOffset: number, columnOffset: number): SourceMapping | {}; + /** + * Given a 1-indexed `lineNumber` and `columnNumber` from a call site in the generated source, + * find the corresponding call site location in the original source. + * + * If the `lineNumber` and `columnNumber` provided are not found in any source map, + * then an empty object is returned. + * @param lineNumber The 1-indexed line number of the call site in the generated source + * @param columnNumber The 1-indexed column number of the call site in the generated source + */ + findOrigin(lineNumber: number, columnNumber: number): SourceOrigin | {}; + } + function runMain(main?: string): void; + function wrap(script: string): string; + } + global { + namespace NodeJS { + interface Module { + /** + * The module objects required for the first time by this one. + * @since v0.1.16 + */ + children: Module[]; + /** + * The `module.exports` object is created by the `Module` system. Sometimes this is + * not acceptable; many want their module to be an instance of some class. To do + * this, assign the desired export object to `module.exports`. + * @since v0.1.16 + */ + exports: any; + /** + * The fully resolved filename of the module. + * @since v0.1.16 + */ + filename: string; + /** + * The identifier for the module. Typically this is the fully resolved + * filename. + * @since v0.1.16 + */ + id: string; + /** + * `true` if the module is running during the Node.js preload + * phase. + * @since v15.4.0, v14.17.0 + */ + isPreloading: boolean; + /** + * Whether or not the module is done loading, or is in the process of + * loading. + * @since v0.1.16 + */ + loaded: boolean; + /** + * The module that first required this one, or `null` if the current module is the + * entry point of the current process, or `undefined` if the module was loaded by + * something that is not a CommonJS module (e.g. REPL or `import`). + * @since v0.1.16 + * @deprecated Please use `require.main` and `module.children` instead. + */ + parent: Module | null | undefined; + /** + * The directory name of the module. This is usually the same as the + * `path.dirname()` of the `module.id`. + * @since v11.14.0 + */ + path: string; + /** + * The search paths for the module. + * @since v0.4.0 + */ + paths: string[]; + /** + * The `module.require()` method provides a way to load a module as if + * `require()` was called from the original module. + * @since v0.5.1 + */ + require(id: string): any; + } + interface Require { + /** + * Used to import modules, `JSON`, and local files. + * @since v0.1.13 + */ + (id: string): any; + /** + * Modules are cached in this object when they are required. By deleting a key + * value from this object, the next `require` will reload the module. + * This does not apply to + * [native addons](https://nodejs.org/docs/latest-v25.x/api/addons.html), + * for which reloading will result in an error. + * @since v0.3.0 + */ + cache: Dict; + /** + * Instruct `require` on how to handle certain file extensions. + * @since v0.3.0 + * @deprecated + */ + extensions: RequireExtensions; + /** + * The `Module` object representing the entry script loaded when the Node.js + * process launched, or `undefined` if the entry point of the program is not a + * CommonJS module. + * @since v0.1.17 + */ + main: Module | undefined; + /** + * @since v0.3.0 + */ + resolve: RequireResolve; + } + /** @deprecated */ + interface RequireExtensions extends Dict<(module: Module, filename: string) => any> { + ".js": (module: Module, filename: string) => any; + ".json": (module: Module, filename: string) => any; + ".node": (module: Module, filename: string) => any; + } + interface RequireResolveOptions { + /** + * Paths to resolve module location from. If present, these + * paths are used instead of the default resolution paths, with the exception + * of + * [GLOBAL\_FOLDERS](https://nodejs.org/docs/latest-v25.x/api/modules.html#loading-from-the-global-folders) + * like `$HOME/.node_modules`, which are + * always included. Each of these paths is used as a starting point for + * the module resolution algorithm, meaning that the `node_modules` hierarchy + * is checked from this location. + * @since v8.9.0 + */ + paths?: string[] | undefined; + } + interface RequireResolve { + /** + * Use the internal `require()` machinery to look up the location of a module, + * but rather than loading the module, just return the resolved filename. + * + * If the module can not be found, a `MODULE_NOT_FOUND` error is thrown. + * @since v0.3.0 + * @param request The module path to resolve. + */ + (request: string, options?: RequireResolveOptions): string; + /** + * Returns an array containing the paths searched during resolution of `request` or + * `null` if the `request` string references a core module, for example `http` or + * `fs`. + * @since v8.9.0 + * @param request The module path whose lookup paths are being retrieved. + */ + paths(request: string): string[] | null; + } + } + /** + * The directory name of the current module. This is the same as the + * `path.dirname()` of the `__filename`. + * @since v0.1.27 + */ + var __dirname: string; + /** + * The file name of the current module. This is the current module file's absolute + * path with symlinks resolved. + * + * For a main program this is not necessarily the same as the file name used in the + * command line. + * @since v0.0.1 + */ + var __filename: string; + /** + * The `exports` variable is available within a module's file-level scope, and is + * assigned the value of `module.exports` before the module is evaluated. + * @since v0.1.16 + */ + var exports: NodeJS.Module["exports"]; + /** + * A reference to the current module. + * @since v0.1.16 + */ + var module: NodeJS.Module; + /** + * @since v0.1.13 + */ + var require: NodeJS.Require; + // Global-scope aliases for backwards compatibility with @types/node <13.0.x + // TODO: consider removing in a future major version update + /** @deprecated Use `NodeJS.Module` instead. */ + interface NodeModule extends NodeJS.Module {} + /** @deprecated Use `NodeJS.Require` instead. */ + interface NodeRequire extends NodeJS.Require {} + /** @deprecated Use `NodeJS.RequireResolve` instead. */ + interface RequireResolve extends NodeJS.RequireResolve {} + } + export = Module; +} +declare module "module" { + import module = require("node:module"); + export = module; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/net.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/net.d.ts new file mode 100644 index 0000000..9000542 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/net.d.ts @@ -0,0 +1,933 @@ +/** + * > Stability: 2 - Stable + * + * The `node:net` module provides an asynchronous network API for creating stream-based + * TCP or `IPC` servers ({@link createServer}) and clients + * ({@link createConnection}). + * + * It can be accessed using: + * + * ```js + * import net from 'node:net'; + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/net.js) + */ +declare module "node:net" { + import { NonSharedBuffer } from "node:buffer"; + import * as dns from "node:dns"; + import { Abortable, EventEmitter, InternalEventEmitter } from "node:events"; + import * as stream from "node:stream"; + type LookupFunction = ( + hostname: string, + options: dns.LookupOptions, + callback: (err: NodeJS.ErrnoException | null, address: string | dns.LookupAddress[], family?: number) => void, + ) => void; + interface AddressInfo { + address: string; + family: string; + port: number; + } + interface SocketConstructorOpts { + fd?: number | undefined; + allowHalfOpen?: boolean | undefined; + onread?: OnReadOpts | undefined; + readable?: boolean | undefined; + writable?: boolean | undefined; + signal?: AbortSignal | undefined; + noDelay?: boolean | undefined; + keepAlive?: boolean | undefined; + keepAliveInitialDelay?: number | undefined; + blockList?: BlockList | undefined; + } + interface OnReadOpts { + buffer: Uint8Array | (() => Uint8Array); + /** + * This function is called for every chunk of incoming data. + * Two arguments are passed to it: the number of bytes written to `buffer` and a reference to `buffer`. + * Return `false` from this function to implicitly `pause()` the socket. + */ + callback(bytesWritten: number, buffer: Uint8Array): boolean; + } + interface TcpSocketConnectOpts { + port: number; + host?: string | undefined; + localAddress?: string | undefined; + localPort?: number | undefined; + hints?: number | undefined; + family?: number | undefined; + lookup?: LookupFunction | undefined; + /** + * @since v18.13.0 + */ + autoSelectFamily?: boolean | undefined; + /** + * @since v18.13.0 + */ + autoSelectFamilyAttemptTimeout?: number | undefined; + } + interface IpcSocketConnectOpts { + path: string; + } + type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; + type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed"; + interface SocketEventMap extends Omit { + "close": [hadError: boolean]; + "connect": []; + "connectionAttempt": [ip: string, port: number, family: number]; + "connectionAttemptFailed": [ip: string, port: number, family: number, error: Error]; + "connectionAttemptTimeout": [ip: string, port: number, family: number]; + "data": [data: string | NonSharedBuffer]; + "lookup": [err: Error | null, address: string, family: number | null, host: string]; + "ready": []; + "timeout": []; + } + /** + * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint + * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also + * an `EventEmitter`. + * + * A `net.Socket` can be created by the user and used directly to interact with + * a server. For example, it is returned by {@link createConnection}, + * so the user can use it to talk to the server. + * + * It can also be created by Node.js and passed to the user when a connection + * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use + * it to interact with the client. + * @since v0.3.4 + */ + class Socket extends stream.Duplex { + constructor(options?: SocketConstructorOpts); + /** + * Destroys the socket after all data is written. If the `finish` event was already emitted the socket is destroyed immediately. + * If the socket is still writable it implicitly calls `socket.end()`. + * @since v0.3.4 + */ + destroySoon(): void; + /** + * Sends data on the socket. The second parameter specifies the encoding in the + * case of a string. It defaults to UTF8 encoding. + * + * Returns `true` if the entire data was flushed successfully to the kernel + * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free. + * + * The optional `callback` parameter will be executed when the data is finally + * written out, which may not be immediately. + * + * See `Writable` stream `write()` method for more + * information. + * @since v0.1.90 + * @param [encoding='utf8'] Only used when data is `string`. + */ + write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; + write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; + /** + * Initiate a connection on a given socket. + * + * Possible signatures: + * + * * `socket.connect(options[, connectListener])` + * * `socket.connect(path[, connectListener])` for `IPC` connections. + * * `socket.connect(port[, host][, connectListener])` for TCP connections. + * * Returns: `net.Socket` The socket itself. + * + * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting, + * instead of a `'connect'` event, an `'error'` event will be emitted with + * the error passed to the `'error'` listener. + * The last parameter `connectListener`, if supplied, will be added as a listener + * for the `'connect'` event **once**. + * + * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined + * behavior. + */ + connect(options: SocketConnectOpts, connectionListener?: () => void): this; + connect(port: number, host: string, connectionListener?: () => void): this; + connect(port: number, connectionListener?: () => void): this; + connect(path: string, connectionListener?: () => void): this; + /** + * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information. + * @since v0.1.90 + * @return The socket itself. + */ + setEncoding(encoding?: BufferEncoding): this; + /** + * Pauses the reading of data. That is, `'data'` events will not be emitted. + * Useful to throttle back an upload. + * @return The socket itself. + */ + pause(): this; + /** + * Close the TCP connection by sending an RST packet and destroy the stream. + * If this TCP socket is in connecting status, it will send an RST packet and destroy this TCP socket once it is connected. + * Otherwise, it will call `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. + * If this is not a TCP socket (for example, a pipe), calling this method will immediately throw an `ERR_INVALID_HANDLE_TYPE` Error. + * @since v18.3.0, v16.17.0 + */ + resetAndDestroy(): this; + /** + * Resumes reading after a call to `socket.pause()`. + * @return The socket itself. + */ + resume(): this; + /** + * Sets the socket to timeout after `timeout` milliseconds of inactivity on + * the socket. By default `net.Socket` do not have a timeout. + * + * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to + * end the connection. + * + * ```js + * socket.setTimeout(3000); + * socket.on('timeout', () => { + * console.log('socket timeout'); + * socket.end(); + * }); + * ``` + * + * If `timeout` is 0, then the existing idle timeout is disabled. + * + * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event. + * @since v0.1.90 + * @return The socket itself. + */ + setTimeout(timeout: number, callback?: () => void): this; + /** + * Enable/disable the use of Nagle's algorithm. + * + * When a TCP connection is created, it will have Nagle's algorithm enabled. + * + * Nagle's algorithm delays data before it is sent via the network. It attempts + * to optimize throughput at the expense of latency. + * + * Passing `true` for `noDelay` or not passing an argument will disable Nagle's + * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's + * algorithm. + * @since v0.1.90 + * @param [noDelay=true] + * @return The socket itself. + */ + setNoDelay(noDelay?: boolean): this; + /** + * Enable/disable keep-alive functionality, and optionally set the initial + * delay before the first keepalive probe is sent on an idle socket. + * + * Set `initialDelay` (in milliseconds) to set the delay between the last + * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default + * (or previous) setting. + * + * Enabling the keep-alive functionality will set the following socket options: + * + * * `SO_KEEPALIVE=1` + * * `TCP_KEEPIDLE=initialDelay` + * * `TCP_KEEPCNT=10` + * * `TCP_KEEPINTVL=1` + * @since v0.1.92 + * @param [enable=false] + * @param [initialDelay=0] + * @return The socket itself. + */ + setKeepAlive(enable?: boolean, initialDelay?: number): this; + /** + * Returns the bound `address`, the address `family` name and `port` of the + * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` + * @since v0.1.90 + */ + address(): AddressInfo | {}; + /** + * Calling `unref()` on a socket will allow the program to exit if this is the only + * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect. + * @since v0.9.1 + * @return The socket itself. + */ + unref(): this; + /** + * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior). + * If the socket is `ref`ed calling `ref` again will have no effect. + * @since v0.9.1 + * @return The socket itself. + */ + ref(): this; + /** + * This property is only present if the family autoselection algorithm is enabled in `socket.connect(options)` + * and it is an array of the addresses that have been attempted. + * + * Each address is a string in the form of `$IP:$PORT`. + * If the connection was successful, then the last address is the one that the socket is currently connected to. + * @since v19.4.0 + */ + readonly autoSelectFamilyAttemptedAddresses: string[]; + /** + * This property shows the number of characters buffered for writing. The buffer + * may contain strings whose length after encoding is not yet known. So this number + * is only an approximation of the number of bytes in the buffer. + * + * `net.Socket` has the property that `socket.write()` always works. This is to + * help users get up and running quickly. The computer cannot always keep up + * with the amount of data that is written to a socket. The network connection + * simply might be too slow. Node.js will internally queue up the data written to a + * socket and send it out over the wire when it is possible. + * + * The consequence of this internal buffering is that memory may grow. + * Users who experience large or growing `bufferSize` should attempt to + * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`. + * @since v0.3.8 + * @deprecated Since v14.6.0 - Use `writableLength` instead. + */ + readonly bufferSize: number; + /** + * The amount of received bytes. + * @since v0.5.3 + */ + readonly bytesRead: number; + /** + * The amount of bytes sent. + * @since v0.5.3 + */ + readonly bytesWritten: number; + /** + * If `true`, `socket.connect(options[, connectListener])` was + * called and has not yet finished. It will stay `true` until the socket becomes + * connected, then it is set to `false` and the `'connect'` event is emitted. Note + * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. + * @since v6.1.0 + */ + readonly connecting: boolean; + /** + * This is `true` if the socket is not connected yet, either because `.connect()`has not yet been called or because it is still in the process of connecting + * (see `socket.connecting`). + * @since v11.2.0, v10.16.0 + */ + readonly pending: boolean; + /** + * See `writable.destroyed` for further details. + */ + readonly destroyed: boolean; + /** + * The string representation of the local IP address the remote client is + * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client + * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`. + * @since v0.9.6 + */ + readonly localAddress?: string; + /** + * The numeric representation of the local port. For example, `80` or `21`. + * @since v0.9.6 + */ + readonly localPort?: number; + /** + * The string representation of the local IP family. `'IPv4'` or `'IPv6'`. + * @since v18.8.0, v16.18.0 + */ + readonly localFamily?: string; + /** + * This property represents the state of the connection as a string. + * + * * If the stream is connecting `socket.readyState` is `opening`. + * * If the stream is readable and writable, it is `open`. + * * If the stream is readable and not writable, it is `readOnly`. + * * If the stream is not readable and writable, it is `writeOnly`. + * @since v0.5.0 + */ + readonly readyState: SocketReadyState; + /** + * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if + * the socket is destroyed (for example, if the client disconnected). + * @since v0.5.10 + */ + readonly remoteAddress: string | undefined; + /** + * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if + * the socket is destroyed (for example, if the client disconnected). + * @since v0.11.14 + */ + readonly remoteFamily: string | undefined; + /** + * The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if + * the socket is destroyed (for example, if the client disconnected). + * @since v0.5.10 + */ + readonly remotePort: number | undefined; + /** + * The socket timeout in milliseconds as set by `socket.setTimeout()`. + * It is `undefined` if a timeout has not been set. + * @since v10.7.0 + */ + readonly timeout?: number; + /** + * Half-closes the socket. i.e., it sends a FIN packet. It is possible the + * server will still send some data. + * + * See `writable.end()` for further details. + * @since v0.1.90 + * @param [encoding='utf8'] Only used when data is `string`. + * @param callback Optional callback for when the socket is finished. + * @return The socket itself. + */ + end(callback?: () => void): this; + end(buffer: Uint8Array | string, callback?: () => void): this; + end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this; + // #region InternalEventEmitter + addListener(eventName: E, listener: (...args: SocketEventMap[E]) => void): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: SocketEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: SocketEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: SocketEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: SocketEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: SocketEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once(eventName: E, listener: (...args: SocketEventMap[E]) => void): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: SocketEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: SocketEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: SocketEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: SocketEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface ListenOptions extends Abortable { + backlog?: number | undefined; + exclusive?: boolean | undefined; + host?: string | undefined; + /** + * @default false + */ + ipv6Only?: boolean | undefined; + reusePort?: boolean | undefined; + path?: string | undefined; + port?: number | undefined; + readableAll?: boolean | undefined; + writableAll?: boolean | undefined; + } + interface ServerOpts { + /** + * Indicates whether half-opened TCP connections are allowed. + * @default false + */ + allowHalfOpen?: boolean | undefined; + /** + * Indicates whether the socket should be paused on incoming connections. + * @default false + */ + pauseOnConnect?: boolean | undefined; + /** + * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. + * @default false + * @since v16.5.0 + */ + noDelay?: boolean | undefined; + /** + * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, + * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. + * @default false + * @since v16.5.0 + */ + keepAlive?: boolean | undefined; + /** + * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. + * @default 0 + * @since v16.5.0 + */ + keepAliveInitialDelay?: number | undefined; + /** + * Optionally overrides all `net.Socket`s' `readableHighWaterMark` and `writableHighWaterMark`. + * @default See [stream.getDefaultHighWaterMark()](https://nodejs.org/docs/latest-v25.x/api/stream.html#streamgetdefaulthighwatermarkobjectmode). + * @since v18.17.0, v20.1.0 + */ + highWaterMark?: number | undefined; + /** + * `blockList` can be used for disabling inbound + * access to specific IP addresses, IP ranges, or IP subnets. This does not + * work if the server is behind a reverse proxy, NAT, etc. because the address + * checked against the block list is the address of the proxy, or the one + * specified by the NAT. + * @since v22.13.0 + */ + blockList?: BlockList | undefined; + } + interface DropArgument { + localAddress?: string; + localPort?: number; + localFamily?: string; + remoteAddress?: string; + remotePort?: number; + remoteFamily?: string; + } + interface ServerEventMap { + "close": []; + "connection": [socket: Socket]; + "error": [err: Error]; + "listening": []; + "drop": [data?: DropArgument]; + } + /** + * This class is used to create a TCP or `IPC` server. + * @since v0.1.90 + */ + class Server implements EventEmitter { + constructor(connectionListener?: (socket: Socket) => void); + constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); + /** + * Start a server listening for connections. A `net.Server` can be a TCP or + * an `IPC` server depending on what it listens to. + * + * Possible signatures: + * + * * `server.listen(handle[, backlog][, callback])` + * * `server.listen(options[, callback])` + * * `server.listen(path[, backlog][, callback])` for `IPC` servers + * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers + * + * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'` + * event. + * + * All `listen()` methods can take a `backlog` parameter to specify the maximum + * length of the queue of pending connections. The actual length will be determined + * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn` on Linux. The default value of this parameter is 511 (not 512). + * + * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for + * details). + * + * The `server.listen()` method can be called again if and only if there was an + * error during the first `server.listen()` call or `server.close()` has been + * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown. + * + * One of the most common errors raised when listening is `EADDRINUSE`. + * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry + * after a certain amount of time: + * + * ```js + * server.on('error', (e) => { + * if (e.code === 'EADDRINUSE') { + * console.error('Address in use, retrying...'); + * setTimeout(() => { + * server.close(); + * server.listen(PORT, HOST); + * }, 1000); + * } + * }); + * ``` + */ + listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; + listen(port?: number, hostname?: string, listeningListener?: () => void): this; + listen(port?: number, backlog?: number, listeningListener?: () => void): this; + listen(port?: number, listeningListener?: () => void): this; + listen(path: string, backlog?: number, listeningListener?: () => void): this; + listen(path: string, listeningListener?: () => void): this; + listen(options: ListenOptions, listeningListener?: () => void): this; + listen(handle: any, backlog?: number, listeningListener?: () => void): this; + listen(handle: any, listeningListener?: () => void): this; + /** + * Stops the server from accepting new connections and keeps existing + * connections. This function is asynchronous, the server is finally closed + * when all connections are ended and the server emits a `'close'` event. + * The optional `callback` will be called once the `'close'` event occurs. Unlike + * that event, it will be called with an `Error` as its only argument if the server + * was not open when it was closed. + * @since v0.1.90 + * @param callback Called when the server is closed. + */ + close(callback?: (err?: Error) => void): this; + /** + * Returns the bound `address`, the address `family` name, and `port` of the server + * as reported by the operating system if listening on an IP socket + * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. + * + * For a server listening on a pipe or Unix domain socket, the name is returned + * as a string. + * + * ```js + * const server = net.createServer((socket) => { + * socket.end('goodbye\n'); + * }).on('error', (err) => { + * // Handle errors here. + * throw err; + * }); + * + * // Grab an arbitrary unused port. + * server.listen(() => { + * console.log('opened server on', server.address()); + * }); + * ``` + * + * `server.address()` returns `null` before the `'listening'` event has been + * emitted or after calling `server.close()`. + * @since v0.1.90 + */ + address(): AddressInfo | string | null; + /** + * Asynchronously get the number of concurrent connections on the server. Works + * when sockets were sent to forks. + * + * Callback should take two arguments `err` and `count`. + * @since v0.9.7 + */ + getConnections(cb: (error: Error | null, count: number) => void): this; + /** + * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior). + * If the server is `ref`ed calling `ref()` again will have no effect. + * @since v0.9.1 + */ + ref(): this; + /** + * Calling `unref()` on a server will allow the program to exit if this is the only + * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect. + * @since v0.9.1 + */ + unref(): this; + /** + * Set this property to reject connections when the server's connection count gets + * high. + * + * It is not recommended to use this option once a socket has been sent to a child + * with `child_process.fork()`. + * @since v0.2.0 + */ + maxConnections: number; + connections: number; + /** + * Indicates whether or not the server is listening for connections. + * @since v5.7.0 + */ + readonly listening: boolean; + /** + * Calls {@link Server.close()} and returns a promise that fulfills when the server has closed. + * @since v20.5.0 + */ + [Symbol.asyncDispose](): Promise; + } + interface Server extends InternalEventEmitter {} + type IPVersion = "ipv4" | "ipv6"; + /** + * The `BlockList` object can be used with some network APIs to specify rules for + * disabling inbound or outbound access to specific IP addresses, IP ranges, or + * IP subnets. + * @since v15.0.0, v14.18.0 + */ + class BlockList { + /** + * Adds a rule to block the given IP address. + * @since v15.0.0, v14.18.0 + * @param address An IPv4 or IPv6 address. + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + addAddress(address: string, type?: IPVersion): void; + addAddress(address: SocketAddress): void; + /** + * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive). + * @since v15.0.0, v14.18.0 + * @param start The starting IPv4 or IPv6 address in the range. + * @param end The ending IPv4 or IPv6 address in the range. + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + addRange(start: string, end: string, type?: IPVersion): void; + addRange(start: SocketAddress, end: SocketAddress): void; + /** + * Adds a rule to block a range of IP addresses specified as a subnet mask. + * @since v15.0.0, v14.18.0 + * @param net The network IPv4 or IPv6 address. + * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + addSubnet(net: SocketAddress, prefix: number): void; + addSubnet(net: string, prefix: number, type?: IPVersion): void; + /** + * Returns `true` if the given IP address matches any of the rules added to the`BlockList`. + * + * ```js + * const blockList = new net.BlockList(); + * blockList.addAddress('123.123.123.123'); + * blockList.addRange('10.0.0.1', '10.0.0.10'); + * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); + * + * console.log(blockList.check('123.123.123.123')); // Prints: true + * console.log(blockList.check('10.0.0.3')); // Prints: true + * console.log(blockList.check('222.111.111.222')); // Prints: false + * + * // IPv6 notation for IPv4 addresses works: + * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true + * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true + * ``` + * @since v15.0.0, v14.18.0 + * @param address The IP address to check + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + check(address: SocketAddress): boolean; + check(address: string, type?: IPVersion): boolean; + /** + * The list of rules added to the blocklist. + * @since v15.0.0, v14.18.0 + */ + rules: readonly string[]; + /** + * Returns `true` if the `value` is a `net.BlockList`. + * @since v22.13.0 + * @param value Any JS value + */ + static isBlockList(value: unknown): value is BlockList; + /** + * ```js + * const blockList = new net.BlockList(); + * const data = [ + * 'Subnet: IPv4 192.168.1.0/24', + * 'Address: IPv4 10.0.0.5', + * 'Range: IPv4 192.168.2.1-192.168.2.10', + * 'Range: IPv4 10.0.0.1-10.0.0.10', + * ]; + * blockList.fromJSON(data); + * blockList.fromJSON(JSON.stringify(data)); + * ``` + * @since v24.5.0 + * @experimental + */ + fromJSON(data: string | readonly string[]): void; + /** + * @since v24.5.0 + * @experimental + */ + toJSON(): readonly string[]; + } + interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { + timeout?: number | undefined; + } + interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { + timeout?: number | undefined; + } + type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; + /** + * Creates a new TCP or `IPC` server. + * + * If `allowHalfOpen` is set to `true`, when the other end of the socket + * signals the end of transmission, the server will only send back the end of + * transmission when `socket.end()` is explicitly called. For example, in the + * context of TCP, when a FIN packed is received, a FIN packed is sent + * back only when `socket.end()` is explicitly called. Until then the + * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information. + * + * If `pauseOnConnect` is set to `true`, then the socket associated with each + * incoming connection will be paused, and no data will be read from its handle. + * This allows connections to be passed between processes without any data being + * read by the original process. To begin reading data from a paused socket, call `socket.resume()`. + * + * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to. + * + * Here is an example of a TCP echo server which listens for connections + * on port 8124: + * + * ```js + * import net from 'node:net'; + * const server = net.createServer((c) => { + * // 'connection' listener. + * console.log('client connected'); + * c.on('end', () => { + * console.log('client disconnected'); + * }); + * c.write('hello\r\n'); + * c.pipe(c); + * }); + * server.on('error', (err) => { + * throw err; + * }); + * server.listen(8124, () => { + * console.log('server bound'); + * }); + * ``` + * + * Test this by using `telnet`: + * + * ```bash + * telnet localhost 8124 + * ``` + * + * To listen on the socket `/tmp/echo.sock`: + * + * ```js + * server.listen('/tmp/echo.sock', () => { + * console.log('server bound'); + * }); + * ``` + * + * Use `nc` to connect to a Unix domain socket server: + * + * ```bash + * nc -U /tmp/echo.sock + * ``` + * @since v0.5.0 + * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. + */ + function createServer(connectionListener?: (socket: Socket) => void): Server; + function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; + /** + * Aliases to {@link createConnection}. + * + * Possible signatures: + * + * * {@link connect} + * * {@link connect} for `IPC` connections. + * * {@link connect} for TCP connections. + */ + function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; + function connect(port: number, host?: string, connectionListener?: () => void): Socket; + function connect(path: string, connectionListener?: () => void): Socket; + /** + * A factory function, which creates a new {@link Socket}, + * immediately initiates connection with `socket.connect()`, + * then returns the `net.Socket` that starts the connection. + * + * When the connection is established, a `'connect'` event will be emitted + * on the returned socket. The last parameter `connectListener`, if supplied, + * will be added as a listener for the `'connect'` event **once**. + * + * Possible signatures: + * + * * {@link createConnection} + * * {@link createConnection} for `IPC` connections. + * * {@link createConnection} for TCP connections. + * + * The {@link connect} function is an alias to this function. + */ + function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; + function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; + function createConnection(path: string, connectionListener?: () => void): Socket; + /** + * Gets the current default value of the `autoSelectFamily` option of `socket.connect(options)`. + * The initial default value is `true`, unless the command line option`--no-network-family-autoselection` is provided. + * @since v19.4.0 + */ + function getDefaultAutoSelectFamily(): boolean; + /** + * Sets the default value of the `autoSelectFamily` option of `socket.connect(options)`. + * @param value The new default value. + * The initial default value is `true`, unless the command line option + * `--no-network-family-autoselection` is provided. + * @since v19.4.0 + */ + function setDefaultAutoSelectFamily(value: boolean): void; + /** + * Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. + * The initial default value is `500` or the value specified via the command line option `--network-family-autoselection-attempt-timeout`. + * @returns The current default value of the `autoSelectFamilyAttemptTimeout` option. + * @since v19.8.0, v18.8.0 + */ + function getDefaultAutoSelectFamilyAttemptTimeout(): number; + /** + * Sets the default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. + * @param value The new default value, which must be a positive number. If the number is less than `10`, the value `10` is used instead. The initial default value is `250` or the value specified via the command line + * option `--network-family-autoselection-attempt-timeout`. + * @since v19.8.0, v18.8.0 + */ + function setDefaultAutoSelectFamilyAttemptTimeout(value: number): void; + /** + * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4 + * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`. + * + * ```js + * net.isIP('::1'); // returns 6 + * net.isIP('127.0.0.1'); // returns 4 + * net.isIP('127.000.000.001'); // returns 0 + * net.isIP('127.0.0.1/24'); // returns 0 + * net.isIP('fhqwhgads'); // returns 0 + * ``` + * @since v0.3.0 + */ + function isIP(input: string): number; + /** + * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no + * leading zeroes. Otherwise, returns `false`. + * + * ```js + * net.isIPv4('127.0.0.1'); // returns true + * net.isIPv4('127.000.000.001'); // returns false + * net.isIPv4('127.0.0.1/24'); // returns false + * net.isIPv4('fhqwhgads'); // returns false + * ``` + * @since v0.3.0 + */ + function isIPv4(input: string): boolean; + /** + * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`. + * + * ```js + * net.isIPv6('::1'); // returns true + * net.isIPv6('fhqwhgads'); // returns false + * ``` + * @since v0.3.0 + */ + function isIPv6(input: string): boolean; + interface SocketAddressInitOptions { + /** + * The network address as either an IPv4 or IPv6 string. + * @default 127.0.0.1 + */ + address?: string | undefined; + /** + * @default `'ipv4'` + */ + family?: IPVersion | undefined; + /** + * An IPv6 flow-label used only if `family` is `'ipv6'`. + * @default 0 + */ + flowlabel?: number | undefined; + /** + * An IP port. + * @default 0 + */ + port?: number | undefined; + } + /** + * @since v15.14.0, v14.18.0 + */ + class SocketAddress { + constructor(options: SocketAddressInitOptions); + /** + * Either \`'ipv4'\` or \`'ipv6'\`. + * @since v15.14.0, v14.18.0 + */ + readonly address: string; + /** + * Either \`'ipv4'\` or \`'ipv6'\`. + * @since v15.14.0, v14.18.0 + */ + readonly family: IPVersion; + /** + * @since v15.14.0, v14.18.0 + */ + readonly port: number; + /** + * @since v15.14.0, v14.18.0 + */ + readonly flowlabel: number; + /** + * @since v22.13.0 + * @param input An input string containing an IP address and optional port, + * e.g. `123.1.2.3:1234` or `[1::1]:1234`. + * @returns Returns a `SocketAddress` if parsing was successful. + * Otherwise returns `undefined`. + */ + static parse(input: string): SocketAddress | undefined; + } +} +declare module "net" { + export * from "node:net"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/os.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/os.d.ts new file mode 100644 index 0000000..db86e9b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/os.d.ts @@ -0,0 +1,507 @@ +/** + * The `node:os` module provides operating system-related utility methods and + * properties. It can be accessed using: + * + * ```js + * import os from 'node:os'; + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/os.js) + */ +declare module "node:os" { + import { NonSharedBuffer } from "buffer"; + interface CpuInfo { + model: string; + speed: number; + times: { + /** The number of milliseconds the CPU has spent in user mode. */ + user: number; + /** The number of milliseconds the CPU has spent in nice mode. */ + nice: number; + /** The number of milliseconds the CPU has spent in sys mode. */ + sys: number; + /** The number of milliseconds the CPU has spent in idle mode. */ + idle: number; + /** The number of milliseconds the CPU has spent in irq mode. */ + irq: number; + }; + } + interface NetworkInterfaceBase { + address: string; + netmask: string; + mac: string; + internal: boolean; + cidr: string | null; + scopeid?: number; + } + interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { + family: "IPv4"; + } + interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { + family: "IPv6"; + scopeid: number; + } + interface UserInfo { + username: T; + uid: number; + gid: number; + shell: T | null; + homedir: T; + } + type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; + /** + * Returns the host name of the operating system as a string. + * @since v0.3.3 + */ + function hostname(): string; + /** + * Returns an array containing the 1, 5, and 15 minute load averages. + * + * The load average is a measure of system activity calculated by the operating + * system and expressed as a fractional number. + * + * The load average is a Unix-specific concept. On Windows, the return value is + * always `[0, 0, 0]`. + * @since v0.3.3 + */ + function loadavg(): number[]; + /** + * Returns the system uptime in number of seconds. + * @since v0.3.3 + */ + function uptime(): number; + /** + * Returns the amount of free system memory in bytes as an integer. + * @since v0.3.3 + */ + function freemem(): number; + /** + * Returns the total amount of system memory in bytes as an integer. + * @since v0.3.3 + */ + function totalmem(): number; + /** + * Returns an array of objects containing information about each logical CPU core. + * The array will be empty if no CPU information is available, such as if the `/proc` file system is unavailable. + * + * The properties included on each object include: + * + * ```js + * [ + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 252020, + * nice: 0, + * sys: 30340, + * idle: 1070356870, + * irq: 0, + * }, + * }, + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 306960, + * nice: 0, + * sys: 26980, + * idle: 1071569080, + * irq: 0, + * }, + * }, + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 248450, + * nice: 0, + * sys: 21750, + * idle: 1070919370, + * irq: 0, + * }, + * }, + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 256880, + * nice: 0, + * sys: 19430, + * idle: 1070905480, + * irq: 20, + * }, + * }, + * ] + * ``` + * + * `nice` values are POSIX-only. On Windows, the `nice` values of all processors + * are always 0. + * + * `os.cpus().length` should not be used to calculate the amount of parallelism + * available to an application. Use {@link availableParallelism} for this purpose. + * @since v0.3.3 + */ + function cpus(): CpuInfo[]; + /** + * Returns an estimate of the default amount of parallelism a program should use. + * Always returns a value greater than zero. + * + * This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism). + * @since v19.4.0, v18.14.0 + */ + function availableParallelism(): number; + /** + * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it + * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. + * + * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information + * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. + * @since v0.3.3 + */ + function type(): string; + /** + * Returns the operating system as a string. + * + * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See + * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. + * @since v0.3.3 + */ + function release(): string; + /** + * Returns an object containing network interfaces that have been assigned a + * network address. + * + * Each key on the returned object identifies a network interface. The associated + * value is an array of objects that each describe an assigned network address. + * + * The properties available on the assigned network address object include: + * + * ```js + * { + * lo: [ + * { + * address: '127.0.0.1', + * netmask: '255.0.0.0', + * family: 'IPv4', + * mac: '00:00:00:00:00:00', + * internal: true, + * cidr: '127.0.0.1/8' + * }, + * { + * address: '::1', + * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', + * family: 'IPv6', + * mac: '00:00:00:00:00:00', + * scopeid: 0, + * internal: true, + * cidr: '::1/128' + * } + * ], + * eth0: [ + * { + * address: '192.168.1.108', + * netmask: '255.255.255.0', + * family: 'IPv4', + * mac: '01:02:03:0a:0b:0c', + * internal: false, + * cidr: '192.168.1.108/24' + * }, + * { + * address: 'fe80::a00:27ff:fe4e:66a1', + * netmask: 'ffff:ffff:ffff:ffff::', + * family: 'IPv6', + * mac: '01:02:03:0a:0b:0c', + * scopeid: 1, + * internal: false, + * cidr: 'fe80::a00:27ff:fe4e:66a1/64' + * } + * ] + * } + * ``` + * @since v0.6.0 + */ + function networkInterfaces(): NodeJS.Dict; + /** + * Returns the string path of the current user's home directory. + * + * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it + * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. + * + * On Windows, it uses the `USERPROFILE` environment variable if defined. + * Otherwise it uses the path to the profile directory of the current user. + * @since v2.3.0 + */ + function homedir(): string; + interface UserInfoOptions { + encoding?: BufferEncoding | "buffer" | undefined; + } + interface UserInfoOptionsWithBufferEncoding extends UserInfoOptions { + encoding: "buffer"; + } + interface UserInfoOptionsWithStringEncoding extends UserInfoOptions { + encoding?: BufferEncoding | undefined; + } + /** + * Returns information about the currently effective user. On POSIX platforms, + * this is typically a subset of the password file. The returned object includes + * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and `gid` fields are `-1`, and `shell` is `null`. + * + * The value of `homedir` returned by `os.userInfo()` is provided by the operating + * system. This differs from the result of `os.homedir()`, which queries + * environment variables for the home directory before falling back to the + * operating system response. + * + * Throws a [`SystemError`](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-systemerror) if a user has no `username` or `homedir`. + * @since v6.0.0 + */ + function userInfo(options?: UserInfoOptionsWithStringEncoding): UserInfo; + function userInfo(options: UserInfoOptionsWithBufferEncoding): UserInfo; + function userInfo(options: UserInfoOptions): UserInfo; + type SignalConstants = { + [key in NodeJS.Signals]: number; + }; + namespace constants { + const UV_UDP_REUSEADDR: number; + namespace signals {} + const signals: SignalConstants; + namespace errno { + const E2BIG: number; + const EACCES: number; + const EADDRINUSE: number; + const EADDRNOTAVAIL: number; + const EAFNOSUPPORT: number; + const EAGAIN: number; + const EALREADY: number; + const EBADF: number; + const EBADMSG: number; + const EBUSY: number; + const ECANCELED: number; + const ECHILD: number; + const ECONNABORTED: number; + const ECONNREFUSED: number; + const ECONNRESET: number; + const EDEADLK: number; + const EDESTADDRREQ: number; + const EDOM: number; + const EDQUOT: number; + const EEXIST: number; + const EFAULT: number; + const EFBIG: number; + const EHOSTUNREACH: number; + const EIDRM: number; + const EILSEQ: number; + const EINPROGRESS: number; + const EINTR: number; + const EINVAL: number; + const EIO: number; + const EISCONN: number; + const EISDIR: number; + const ELOOP: number; + const EMFILE: number; + const EMLINK: number; + const EMSGSIZE: number; + const EMULTIHOP: number; + const ENAMETOOLONG: number; + const ENETDOWN: number; + const ENETRESET: number; + const ENETUNREACH: number; + const ENFILE: number; + const ENOBUFS: number; + const ENODATA: number; + const ENODEV: number; + const ENOENT: number; + const ENOEXEC: number; + const ENOLCK: number; + const ENOLINK: number; + const ENOMEM: number; + const ENOMSG: number; + const ENOPROTOOPT: number; + const ENOSPC: number; + const ENOSR: number; + const ENOSTR: number; + const ENOSYS: number; + const ENOTCONN: number; + const ENOTDIR: number; + const ENOTEMPTY: number; + const ENOTSOCK: number; + const ENOTSUP: number; + const ENOTTY: number; + const ENXIO: number; + const EOPNOTSUPP: number; + const EOVERFLOW: number; + const EPERM: number; + const EPIPE: number; + const EPROTO: number; + const EPROTONOSUPPORT: number; + const EPROTOTYPE: number; + const ERANGE: number; + const EROFS: number; + const ESPIPE: number; + const ESRCH: number; + const ESTALE: number; + const ETIME: number; + const ETIMEDOUT: number; + const ETXTBSY: number; + const EWOULDBLOCK: number; + const EXDEV: number; + const WSAEINTR: number; + const WSAEBADF: number; + const WSAEACCES: number; + const WSAEFAULT: number; + const WSAEINVAL: number; + const WSAEMFILE: number; + const WSAEWOULDBLOCK: number; + const WSAEINPROGRESS: number; + const WSAEALREADY: number; + const WSAENOTSOCK: number; + const WSAEDESTADDRREQ: number; + const WSAEMSGSIZE: number; + const WSAEPROTOTYPE: number; + const WSAENOPROTOOPT: number; + const WSAEPROTONOSUPPORT: number; + const WSAESOCKTNOSUPPORT: number; + const WSAEOPNOTSUPP: number; + const WSAEPFNOSUPPORT: number; + const WSAEAFNOSUPPORT: number; + const WSAEADDRINUSE: number; + const WSAEADDRNOTAVAIL: number; + const WSAENETDOWN: number; + const WSAENETUNREACH: number; + const WSAENETRESET: number; + const WSAECONNABORTED: number; + const WSAECONNRESET: number; + const WSAENOBUFS: number; + const WSAEISCONN: number; + const WSAENOTCONN: number; + const WSAESHUTDOWN: number; + const WSAETOOMANYREFS: number; + const WSAETIMEDOUT: number; + const WSAECONNREFUSED: number; + const WSAELOOP: number; + const WSAENAMETOOLONG: number; + const WSAEHOSTDOWN: number; + const WSAEHOSTUNREACH: number; + const WSAENOTEMPTY: number; + const WSAEPROCLIM: number; + const WSAEUSERS: number; + const WSAEDQUOT: number; + const WSAESTALE: number; + const WSAEREMOTE: number; + const WSASYSNOTREADY: number; + const WSAVERNOTSUPPORTED: number; + const WSANOTINITIALISED: number; + const WSAEDISCON: number; + const WSAENOMORE: number; + const WSAECANCELLED: number; + const WSAEINVALIDPROCTABLE: number; + const WSAEINVALIDPROVIDER: number; + const WSAEPROVIDERFAILEDINIT: number; + const WSASYSCALLFAILURE: number; + const WSASERVICE_NOT_FOUND: number; + const WSATYPE_NOT_FOUND: number; + const WSA_E_NO_MORE: number; + const WSA_E_CANCELLED: number; + const WSAEREFUSED: number; + } + namespace dlopen { + const RTLD_LAZY: number; + const RTLD_NOW: number; + const RTLD_GLOBAL: number; + const RTLD_LOCAL: number; + const RTLD_DEEPBIND: number; + } + namespace priority { + const PRIORITY_LOW: number; + const PRIORITY_BELOW_NORMAL: number; + const PRIORITY_NORMAL: number; + const PRIORITY_ABOVE_NORMAL: number; + const PRIORITY_HIGH: number; + const PRIORITY_HIGHEST: number; + } + } + const devNull: string; + /** + * The operating system-specific end-of-line marker. + * * `\n` on POSIX + * * `\r\n` on Windows + */ + const EOL: string; + /** + * Returns the operating system CPU architecture for which the Node.js binary was + * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, + * `'mips'`, `'mipsel'`, `'ppc64'`, `'riscv64'`, `'s390x'`, and `'x64'`. + * + * The return value is equivalent to [process.arch](https://nodejs.org/docs/latest-v25.x/api/process.html#processarch). + * @since v0.5.0 + */ + function arch(): NodeJS.Architecture; + /** + * Returns a string identifying the kernel version. + * + * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not + * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. + * @since v13.11.0, v12.17.0 + */ + function version(): string; + /** + * Returns a string identifying the operating system platform for which + * the Node.js binary was compiled. The value is set at compile time. + * Possible values are `'aix'`, `'darwin'`, `'freebsd'`, `'linux'`, `'openbsd'`, `'sunos'`, and `'win32'`. + * + * The return value is equivalent to `process.platform`. + * + * The value `'android'` may also be returned if Node.js is built on the Android + * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). + * @since v0.5.0 + */ + function platform(): NodeJS.Platform; + /** + * Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`, + * `mips`, `mips64`, `ppc64`, `ppc64le`, `s390x`, `i386`, `i686`, `x86_64`. + * + * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not + * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. + * @since v18.9.0, v16.18.0 + */ + function machine(): string; + /** + * Returns the operating system's default directory for temporary files as a + * string. + * @since v0.9.9 + */ + function tmpdir(): string; + /** + * Returns a string identifying the endianness of the CPU for which the Node.js + * binary was compiled. + * + * Possible values are `'BE'` for big endian and `'LE'` for little endian. + * @since v0.9.4 + */ + function endianness(): "BE" | "LE"; + /** + * Returns the scheduling priority for the process specified by `pid`. If `pid` is + * not provided or is `0`, the priority of the current process is returned. + * @since v10.10.0 + * @param [pid=0] The process ID to retrieve scheduling priority for. + */ + function getPriority(pid?: number): number; + /** + * Attempts to set the scheduling priority for the process specified by `pid`. If `pid` is not provided or is `0`, the process ID of the current process is used. + * + * The `priority` input must be an integer between `-20` (high priority) and `19` (low priority). Due to differences between Unix priority levels and Windows + * priority classes, `priority` is mapped to one of six priority constants in `os.constants.priority`. When retrieving a process priority level, this range + * mapping may cause the return value to be slightly different on Windows. To avoid + * confusion, set `priority` to one of the priority constants. + * + * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user + * privileges. Otherwise the set priority will be silently reduced to `PRIORITY_HIGH`. + * @since v10.10.0 + * @param [pid=0] The process ID to set scheduling priority for. + * @param priority The scheduling priority to assign to the process. + */ + function setPriority(priority: number): void; + function setPriority(pid: number, priority: number): void; +} +declare module "os" { + export * from "node:os"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/package.json new file mode 100644 index 0000000..b9affa9 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/package.json @@ -0,0 +1,155 @@ +{ + "name": "@types/node", + "version": "25.5.0", + "description": "TypeScript definitions for node", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", + "license": "MIT", + "contributors": [ + { + "name": "Microsoft TypeScript", + "githubUsername": "Microsoft", + "url": "https://github.com/Microsoft" + }, + { + "name": "Alberto Schiabel", + "githubUsername": "jkomyno", + "url": "https://github.com/jkomyno" + }, + { + "name": "Andrew Makarov", + "githubUsername": "r3nya", + "url": "https://github.com/r3nya" + }, + { + "name": "Benjamin Toueg", + "githubUsername": "btoueg", + "url": "https://github.com/btoueg" + }, + { + "name": "David Junger", + "githubUsername": "touffy", + "url": "https://github.com/touffy" + }, + { + "name": "Mohsen Azimi", + "githubUsername": "mohsen1", + "url": "https://github.com/mohsen1" + }, + { + "name": "Nikita Galkin", + "githubUsername": "galkin", + "url": "https://github.com/galkin" + }, + { + "name": "Sebastian Silbermann", + "githubUsername": "eps1lon", + "url": "https://github.com/eps1lon" + }, + { + "name": "Wilco Bakker", + "githubUsername": "WilcoBakker", + "url": "https://github.com/WilcoBakker" + }, + { + "name": "Marcin Kopacz", + "githubUsername": "chyzwar", + "url": "https://github.com/chyzwar" + }, + { + "name": "Trivikram Kamat", + "githubUsername": "trivikr", + "url": "https://github.com/trivikr" + }, + { + "name": "Junxiao Shi", + "githubUsername": "yoursunny", + "url": "https://github.com/yoursunny" + }, + { + "name": "Ilia Baryshnikov", + "githubUsername": "qwelias", + "url": "https://github.com/qwelias" + }, + { + "name": "ExE Boss", + "githubUsername": "ExE-Boss", + "url": "https://github.com/ExE-Boss" + }, + { + "name": "Piotr Błażejewicz", + "githubUsername": "peterblazejewicz", + "url": "https://github.com/peterblazejewicz" + }, + { + "name": "Anna Henningsen", + "githubUsername": "addaleax", + "url": "https://github.com/addaleax" + }, + { + "name": "Victor Perin", + "githubUsername": "victorperin", + "url": "https://github.com/victorperin" + }, + { + "name": "NodeJS Contributors", + "githubUsername": "NodeJS", + "url": "https://github.com/NodeJS" + }, + { + "name": "Linus Unnebäck", + "githubUsername": "LinusU", + "url": "https://github.com/LinusU" + }, + { + "name": "wafuwafu13", + "githubUsername": "wafuwafu13", + "url": "https://github.com/wafuwafu13" + }, + { + "name": "Matteo Collina", + "githubUsername": "mcollina", + "url": "https://github.com/mcollina" + }, + { + "name": "Dmitry Semigradsky", + "githubUsername": "Semigradsky", + "url": "https://github.com/Semigradsky" + }, + { + "name": "René", + "githubUsername": "Renegade334", + "url": "https://github.com/Renegade334" + }, + { + "name": "Yagiz Nizipli", + "githubUsername": "anonrig", + "url": "https://github.com/anonrig" + } + ], + "main": "", + "types": "index.d.ts", + "typesVersions": { + "<=5.6": { + "*": [ + "ts5.6/*" + ] + }, + "<=5.7": { + "*": [ + "ts5.7/*" + ] + } + }, + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/node" + }, + "scripts": {}, + "dependencies": { + "undici-types": "~7.18.0" + }, + "peerDependencies": {}, + "typesPublisherContentHash": "4b6968335abe1dc64bd6086fd546d6e9c50f986c37d49de8073f4ed1c900057c", + "typeScriptVersion": "5.2" +} \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/path.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/path.d.ts new file mode 100644 index 0000000..c0b22f6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/path.d.ts @@ -0,0 +1,187 @@ +/** + * The `node:path` module provides utilities for working with file and directory + * paths. It can be accessed using: + * + * ```js + * import path from 'node:path'; + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/path.js) + */ +declare module "node:path" { + namespace path { + /** + * A parsed path object generated by path.parse() or consumed by path.format(). + */ + interface ParsedPath { + /** + * The root of the path such as '/' or 'c:\' + */ + root: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base: string; + /** + * The file extension (if any) such as '.html' + */ + ext: string; + /** + * The file name without extension (if any) such as 'index' + */ + name: string; + } + interface FormatInputPathObject { + /** + * The root of the path such as '/' or 'c:\' + */ + root?: string | undefined; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir?: string | undefined; + /** + * The file name including extension (if any) such as 'index.html' + */ + base?: string | undefined; + /** + * The file extension (if any) such as '.html' + */ + ext?: string | undefined; + /** + * The file name without extension (if any) such as 'index' + */ + name?: string | undefined; + } + /** + * Normalize a string path, reducing '..' and '.' parts. + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. If the path is a zero-length string, '.' is returned, representing the current working directory. + * + * @param path string path to normalize. + * @throws {TypeError} if `path` is not a string. + */ + function normalize(path: string): string; + /** + * Join all arguments together and normalize the resulting path. + * + * @param paths paths to join. + * @throws {TypeError} if any of the path segments is not a string. + */ + function join(...paths: string[]): string; + /** + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. + * + * Starting from leftmost {from} parameter, resolves {to} to an absolute path. + * + * If {to} isn't already absolute, {from} arguments are prepended in right to left order, + * until an absolute path is found. If after using all {from} paths still no absolute path is found, + * the current working directory is used as well. The resulting path is normalized, + * and trailing slashes are removed unless the path gets resolved to the root directory. + * + * @param paths A sequence of paths or path segments. + * @throws {TypeError} if any of the arguments is not a string. + */ + function resolve(...paths: string[]): string; + /** + * The `path.matchesGlob()` method determines if `path` matches the `pattern`. + * @param path The path to glob-match against. + * @param pattern The glob to check the path against. + * @returns Whether or not the `path` matched the `pattern`. + * @throws {TypeError} if `path` or `pattern` are not strings. + * @since v22.5.0 + */ + function matchesGlob(path: string, pattern: string): boolean; + /** + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. + * + * If the given {path} is a zero-length string, `false` will be returned. + * + * @param path path to test. + * @throws {TypeError} if `path` is not a string. + */ + function isAbsolute(path: string): boolean; + /** + * Solve the relative path from {from} to {to} based on the current working directory. + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. + * + * @throws {TypeError} if either `from` or `to` is not a string. + */ + function relative(from: string, to: string): string; + /** + * Return the directory name of a path. Similar to the Unix dirname command. + * + * @param path the path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + function dirname(path: string): string; + /** + * Return the last portion of a path. Similar to the Unix basename command. + * Often used to extract the file name from a fully qualified path. + * + * @param path the path to evaluate. + * @param suffix optionally, an extension to remove from the result. + * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. + */ + function basename(path: string, suffix?: string): string; + /** + * Return the extension of the path, from the last '.' to end of string in the last portion of the path. + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. + * + * @param path the path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + function extname(path: string): string; + /** + * The platform-specific file separator. '\\' or '/'. + */ + const sep: "\\" | "/"; + /** + * The platform-specific file delimiter. ';' or ':'. + */ + const delimiter: ";" | ":"; + /** + * Returns an object from a path string - the opposite of format(). + * + * @param path path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + function parse(path: string): ParsedPath; + /** + * Returns a path string from an object - the opposite of parse(). + * + * @param pathObject path to evaluate. + */ + function format(pathObject: FormatInputPathObject): string; + /** + * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. + * If path is not a string, path will be returned without modifications. + * This method is meaningful only on Windows system. + * On POSIX systems, the method is non-operational and always returns path without modifications. + */ + function toNamespacedPath(path: string): string; + } + namespace path { + export { + /** + * The `path.posix` property provides access to POSIX specific implementations of the `path` methods. + * + * The API is accessible via `require('node:path').posix` or `require('node:path/posix')`. + */ + path as posix, + /** + * The `path.win32` property provides access to Windows-specific implementations of the `path` methods. + * + * The API is accessible via `require('node:path').win32` or `require('node:path/win32')`. + */ + path as win32, + }; + } + export = path; +} +declare module "path" { + import path = require("node:path"); + export = path; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/path/posix.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/path/posix.d.ts new file mode 100644 index 0000000..d60f629 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/path/posix.d.ts @@ -0,0 +1,8 @@ +declare module "node:path/posix" { + import path = require("node:path"); + export = path.posix; +} +declare module "path/posix" { + import path = require("path"); + export = path.posix; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/path/win32.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/path/win32.d.ts new file mode 100644 index 0000000..e6aa9fa --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/path/win32.d.ts @@ -0,0 +1,8 @@ +declare module "node:path/win32" { + import path = require("node:path"); + export = path.win32; +} +declare module "path/win32" { + import path = require("path"); + export = path.win32; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/perf_hooks.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/perf_hooks.d.ts new file mode 100644 index 0000000..4dd0632 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/perf_hooks.d.ts @@ -0,0 +1,643 @@ +/** + * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for + * Node.js-specific performance measurements. + * + * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/): + * + * * [High Resolution Time](https://www.w3.org/TR/hr-time-2) + * * [Performance Timeline](https://w3c.github.io/performance-timeline/) + * * [User Timing](https://www.w3.org/TR/user-timing/) + * * [Resource Timing](https://www.w3.org/TR/resource-timing-2/) + * + * ```js + * import { PerformanceObserver, performance } from 'node:perf_hooks'; + * + * const obs = new PerformanceObserver((items) => { + * console.log(items.getEntries()[0].duration); + * performance.clearMarks(); + * }); + * obs.observe({ type: 'measure' }); + * performance.measure('Start to Now'); + * + * performance.mark('A'); + * doSomeLongRunningProcess(() => { + * performance.measure('A to Now', 'A'); + * + * performance.mark('B'); + * performance.measure('A to B', 'A', 'B'); + * }); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/perf_hooks.js) + */ +declare module "node:perf_hooks" { + import { InternalEventTargetEventProperties } from "node:events"; + // #region web types + type EntryType = + | "dns" // Node.js only + | "function" // Node.js only + | "gc" // Node.js only + | "http2" // Node.js only + | "http" // Node.js only + | "mark" // available on the Web + | "measure" // available on the Web + | "net" // Node.js only + | "node" // Node.js only + | "resource"; // available on the Web + interface ConnectionTimingInfo { + domainLookupStartTime: number; + domainLookupEndTime: number; + connectionStartTime: number; + connectionEndTime: number; + secureConnectionStartTime: number; + ALPNNegotiatedProtocol: string; + } + interface FetchTimingInfo { + startTime: number; + redirectStartTime: number; + redirectEndTime: number; + postRedirectStartTime: number; + finalServiceWorkerStartTime: number; + finalNetworkRequestStartTime: number; + finalNetworkResponseStartTime: number; + endTime: number; + finalConnectionTimingInfo: ConnectionTimingInfo | null; + encodedBodySize: number; + decodedBodySize: number; + } + type PerformanceEntryList = PerformanceEntry[]; + interface PerformanceMarkOptions { + detail?: any; + startTime?: number; + } + interface PerformanceMeasureOptions { + detail?: any; + duration?: number; + end?: string | number; + start?: string | number; + } + interface PerformanceObserverCallback { + (entries: PerformanceObserverEntryList, observer: PerformanceObserver): void; + } + interface PerformanceObserverInit { + buffered?: boolean; + entryTypes?: EntryType[]; + type?: EntryType; + } + // TODO: remove in next major + /** @deprecated Use `TimerifyOptions` instead. */ + interface PerformanceTimerifyOptions extends TimerifyOptions {} + interface PerformanceEventMap { + "resourcetimingbufferfull": Event; + } + interface Performance extends EventTarget, InternalEventTargetEventProperties { + readonly nodeTiming: PerformanceNodeTiming; + readonly timeOrigin: number; + clearMarks(markName?: string): void; + clearMeasures(measureName?: string): void; + clearResourceTimings(resourceTimingName?: string): void; + getEntries(): PerformanceEntryList; + getEntriesByName(name: string, type?: EntryType): PerformanceEntryList; + getEntriesByType(type: EntryType): PerformanceEntryList; + mark(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark; + markResourceTiming( + timingInfo: FetchTimingInfo, + requestedUrl: string, + initiatorType: string, + global: unknown, + cacheMode: string, + bodyInfo: unknown, + responseStatus: number, + deliveryType?: string, + ): PerformanceResourceTiming; + measure(measureName: string, startMark?: string, endMark?: string): PerformanceMeasure; + measure(measureName: string, options: PerformanceMeasureOptions, endMark?: string): PerformanceMeasure; + now(): number; + setResourceTimingBufferSize(maxSize: number): void; + toJSON(): any; + addEventListener( + type: K, + listener: (ev: PerformanceEventMap[K]) => void, + options?: AddEventListenerOptions | boolean, + ): void; + addEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: AddEventListenerOptions | boolean, + ): void; + removeEventListener( + type: K, + listener: (ev: PerformanceEventMap[K]) => void, + options?: EventListenerOptions | boolean, + ): void; + removeEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: EventListenerOptions | boolean, + ): void; + /** + * This is an alias of `perf_hooks.eventLoopUtilization()`. + * + * _This property is an extension by Node.js. It is not available in Web browsers._ + * @since v14.10.0, v12.19.0 + * @param utilization1 The result of a previous call to + * `eventLoopUtilization()`. + * @param utilization2 The result of a previous call to + * `eventLoopUtilization()` prior to `utilization1`. + */ + eventLoopUtilization( + utilization1?: EventLoopUtilization, + utilization2?: EventLoopUtilization, + ): EventLoopUtilization; + /** + * This is an alias of `perf_hooks.timerify()`. + * + * _This property is an extension by Node.js. It is not available in Web browsers._ + * @since v8.5.0 + */ + timerify any>(fn: T, options?: TimerifyOptions): T; + } + var Performance: { + prototype: Performance; + new(): Performance; + }; + interface PerformanceEntry { + readonly duration: number; + readonly entryType: EntryType; + readonly name: string; + readonly startTime: number; + toJSON(): any; + } + var PerformanceEntry: { + prototype: PerformanceEntry; + new(): PerformanceEntry; + }; + interface PerformanceMark extends PerformanceEntry { + readonly detail: any; + readonly entryType: "mark"; + } + var PerformanceMark: { + prototype: PerformanceMark; + new(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark; + }; + interface PerformanceMeasure extends PerformanceEntry { + readonly detail: any; + readonly entryType: "measure"; + } + var PerformanceMeasure: { + prototype: PerformanceMeasure; + new(): PerformanceMeasure; + }; + interface PerformanceObserver { + disconnect(): void; + observe(options: PerformanceObserverInit): void; + takeRecords(): PerformanceEntryList; + } + var PerformanceObserver: { + prototype: PerformanceObserver; + new(callback: PerformanceObserverCallback): PerformanceObserver; + readonly supportedEntryTypes: readonly EntryType[]; + }; + interface PerformanceObserverEntryList { + getEntries(): PerformanceEntryList; + getEntriesByName(name: string, type?: EntryType): PerformanceEntryList; + getEntriesByType(type: EntryType): PerformanceEntryList; + } + var PerformanceObserverEntryList: { + prototype: PerformanceObserverEntryList; + new(): PerformanceObserverEntryList; + }; + interface PerformanceResourceTiming extends PerformanceEntry { + readonly connectEnd: number; + readonly connectStart: number; + readonly decodedBodySize: number; + readonly domainLookupEnd: number; + readonly domainLookupStart: number; + readonly encodedBodySize: number; + readonly entryType: "resource"; + readonly fetchStart: number; + readonly initiatorType: string; + readonly nextHopProtocol: string; + readonly redirectEnd: number; + readonly redirectStart: number; + readonly requestStart: number; + readonly responseEnd: number; + readonly responseStart: number; + readonly responseStatus: number; + readonly secureConnectionStart: number; + readonly transferSize: number; + readonly workerStart: number; + toJSON(): any; + } + var PerformanceResourceTiming: { + prototype: PerformanceResourceTiming; + new(): PerformanceResourceTiming; + }; + var performance: Performance; + // #endregion + /** + * _This class is an extension by Node.js. It is not available in Web browsers._ + * + * Provides detailed Node.js timing data. + * + * The constructor of this class is not exposed to users directly. + * @since v19.0.0 + */ + class PerformanceNodeEntry extends PerformanceEntry { + /** + * Additional detail specific to the `entryType`. + * @since v16.0.0 + */ + readonly detail: any; + readonly entryType: "dns" | "function" | "gc" | "http2" | "http" | "net" | "node"; + } + interface UVMetrics { + /** + * Number of event loop iterations. + */ + readonly loopCount: number; + /** + * Number of events that have been processed by the event handler. + */ + readonly events: number; + /** + * Number of events that were waiting to be processed when the event provider was called. + */ + readonly eventsWaiting: number; + } + /** + * _This property is an extension by Node.js. It is not available in Web browsers._ + * + * Provides timing details for Node.js itself. The constructor of this class + * is not exposed to users. + * @since v8.5.0 + */ + interface PerformanceNodeTiming extends PerformanceEntry { + /** + * The high resolution millisecond timestamp at which the Node.js process + * completed bootstrapping. If bootstrapping has not yet finished, the property + * has the value of -1. + * @since v8.5.0 + */ + readonly bootstrapComplete: number; + readonly entryType: "node"; + /** + * The high resolution millisecond timestamp at which the Node.js environment was + * initialized. + * @since v8.5.0 + */ + readonly environment: number; + /** + * The high resolution millisecond timestamp of the amount of time the event loop + * has been idle within the event loop's event provider (e.g. `epoll_wait`). This + * does not take CPU usage into consideration. If the event loop has not yet + * started (e.g., in the first tick of the main script), the property has the + * value of 0. + * @since v14.10.0, v12.19.0 + */ + readonly idleTime: number; + /** + * The high resolution millisecond timestamp at which the Node.js event loop + * exited. If the event loop has not yet exited, the property has the value of -1\. + * It can only have a value of not -1 in a handler of the `'exit'` event. + * @since v8.5.0 + */ + readonly loopExit: number; + /** + * The high resolution millisecond timestamp at which the Node.js event loop + * started. If the event loop has not yet started (e.g., in the first tick of the + * main script), the property has the value of -1. + * @since v8.5.0 + */ + readonly loopStart: number; + /** + * The high resolution millisecond timestamp at which the Node.js process was initialized. + * @since v8.5.0 + */ + readonly nodeStart: number; + /** + * This is a wrapper to the `uv_metrics_info` function. + * It returns the current set of event loop metrics. + * + * It is recommended to use this property inside a function whose execution was + * scheduled using `setImmediate` to avoid collecting metrics before finishing all + * operations scheduled during the current loop iteration. + * @since v22.8.0, v20.18.0 + */ + readonly uvMetricsInfo: UVMetrics; + /** + * The high resolution millisecond timestamp at which the V8 platform was + * initialized. + * @since v8.5.0 + */ + readonly v8Start: number; + } + namespace constants { + const NODE_PERFORMANCE_GC_MAJOR: number; + const NODE_PERFORMANCE_GC_MINOR: number; + const NODE_PERFORMANCE_GC_INCREMENTAL: number; + const NODE_PERFORMANCE_GC_WEAKCB: number; + const NODE_PERFORMANCE_GC_FLAGS_NO: number; + const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; + const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; + const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; + const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; + const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; + const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; + } + interface EventLoopMonitorOptions { + /** + * The sampling rate in milliseconds. + * Must be greater than zero. + * @default 10 + */ + resolution?: number | undefined; + } + interface Histogram { + /** + * The number of samples recorded by the histogram. + * @since v17.4.0, v16.14.0 + */ + readonly count: number; + /** + * The number of samples recorded by the histogram. + * v17.4.0, v16.14.0 + */ + readonly countBigInt: bigint; + /** + * The number of times the event loop delay exceeded the maximum 1 hour event + * loop delay threshold. + * @since v11.10.0 + */ + readonly exceeds: number; + /** + * The number of times the event loop delay exceeded the maximum 1 hour event loop delay threshold. + * @since v17.4.0, v16.14.0 + */ + readonly exceedsBigInt: bigint; + /** + * The maximum recorded event loop delay. + * @since v11.10.0 + */ + readonly max: number; + /** + * The maximum recorded event loop delay. + * v17.4.0, v16.14.0 + */ + readonly maxBigInt: number; + /** + * The mean of the recorded event loop delays. + * @since v11.10.0 + */ + readonly mean: number; + /** + * The minimum recorded event loop delay. + * @since v11.10.0 + */ + readonly min: number; + /** + * The minimum recorded event loop delay. + * v17.4.0, v16.14.0 + */ + readonly minBigInt: bigint; + /** + * Returns the value at the given percentile. + * @since v11.10.0 + * @param percentile A percentile value in the range (0, 100]. + */ + percentile(percentile: number): number; + /** + * Returns the value at the given percentile. + * @since v17.4.0, v16.14.0 + * @param percentile A percentile value in the range (0, 100]. + */ + percentileBigInt(percentile: number): bigint; + /** + * Returns a `Map` object detailing the accumulated percentile distribution. + * @since v11.10.0 + */ + readonly percentiles: Map; + /** + * Returns a `Map` object detailing the accumulated percentile distribution. + * @since v17.4.0, v16.14.0 + */ + readonly percentilesBigInt: Map; + /** + * Resets the collected histogram data. + * @since v11.10.0 + */ + reset(): void; + /** + * The standard deviation of the recorded event loop delays. + * @since v11.10.0 + */ + readonly stddev: number; + } + interface IntervalHistogram extends Histogram { + /** + * Enables the update interval timer. Returns `true` if the timer was + * started, `false` if it was already started. + * @since v11.10.0 + */ + enable(): boolean; + /** + * Disables the update interval timer. Returns `true` if the timer was + * stopped, `false` if it was already stopped. + * @since v11.10.0 + */ + disable(): boolean; + /** + * Disables the update interval timer when the histogram is disposed. + * + * ```js + * const { monitorEventLoopDelay } = require('node:perf_hooks'); + * { + * using hist = monitorEventLoopDelay({ resolution: 20 }); + * hist.enable(); + * // The histogram will be disabled when the block is exited. + * } + * ``` + * @since v24.2.0 + */ + [Symbol.dispose](): void; + } + interface RecordableHistogram extends Histogram { + /** + * @since v15.9.0, v14.18.0 + * @param val The amount to record in the histogram. + */ + record(val: number | bigint): void; + /** + * Calculates the amount of time (in nanoseconds) that has passed since the + * previous call to `recordDelta()` and records that amount in the histogram. + * @since v15.9.0, v14.18.0 + */ + recordDelta(): void; + /** + * Adds the values from `other` to this histogram. + * @since v17.4.0, v16.14.0 + */ + add(other: RecordableHistogram): void; + } + interface EventLoopUtilization { + idle: number; + active: number; + utilization: number; + } + /** + * The `eventLoopUtilization()` function returns an object that contains the + * cumulative duration of time the event loop has been both idle and active as a + * high resolution milliseconds timer. The `utilization` value is the calculated + * Event Loop Utilization (ELU). + * + * If bootstrapping has not yet finished on the main thread the properties have + * the value of `0`. The ELU is immediately available on [Worker threads](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html#worker-threads) since + * bootstrap happens within the event loop. + * + * Both `utilization1` and `utilization2` are optional parameters. + * + * If `utilization1` is passed, then the delta between the current call's `active` + * and `idle` times, as well as the corresponding `utilization` value are + * calculated and returned (similar to `process.hrtime()`). + * + * If `utilization1` and `utilization2` are both passed, then the delta is + * calculated between the two arguments. This is a convenience option because, + * unlike `process.hrtime()`, calculating the ELU is more complex than a + * single subtraction. + * + * ELU is similar to CPU utilization, except that it only measures event loop + * statistics and not CPU usage. It represents the percentage of time the event + * loop has spent outside the event loop's event provider (e.g. `epoll_wait`). + * No other CPU idle time is taken into consideration. The following is an example + * of how a mostly idle process will have a high ELU. + * + * ```js + * import { eventLoopUtilization } from 'node:perf_hooks'; + * import { spawnSync } from 'node:child_process'; + * + * setImmediate(() => { + * const elu = eventLoopUtilization(); + * spawnSync('sleep', ['5']); + * console.log(eventLoopUtilization(elu).utilization); + * }); + * ``` + * + * Although the CPU is mostly idle while running this script, the value of + * `utilization` is `1`. This is because the call to + * `child_process.spawnSync()` blocks the event loop from proceeding. + * + * Passing in a user-defined object instead of the result of a previous call to + * `eventLoopUtilization()` will lead to undefined behavior. The return values + * are not guaranteed to reflect any correct state of the event loop. + * @since v25.2.0 + * @param utilization1 The result of a previous call to + * `eventLoopUtilization()`. + * @param utilization2 The result of a previous call to + * `eventLoopUtilization()` prior to `utilization1`. + */ + function eventLoopUtilization( + utilization1?: EventLoopUtilization, + utilization2?: EventLoopUtilization, + ): EventLoopUtilization; + /** + * _This property is an extension by Node.js. It is not available in Web browsers._ + * + * Creates an `IntervalHistogram` object that samples and reports the event loop + * delay over time. The delays will be reported in nanoseconds. + * + * Using a timer to detect approximate event loop delay works because the + * execution of timers is tied specifically to the lifecycle of the libuv + * event loop. That is, a delay in the loop will cause a delay in the execution + * of the timer, and those delays are specifically what this API is intended to + * detect. + * + * ```js + * import { monitorEventLoopDelay } from 'node:perf_hooks'; + * const h = monitorEventLoopDelay({ resolution: 20 }); + * h.enable(); + * // Do something. + * h.disable(); + * console.log(h.min); + * console.log(h.max); + * console.log(h.mean); + * console.log(h.stddev); + * console.log(h.percentiles); + * console.log(h.percentile(50)); + * console.log(h.percentile(99)); + * ``` + * @since v11.10.0 + */ + function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; + interface TimerifyOptions { + /** + * A histogram object created using + * `perf_hooks.createHistogram()` that will record runtime durations in + * nanoseconds. + */ + histogram?: RecordableHistogram | undefined; + } + /** + * _This property is an extension by Node.js. It is not available in Web browsers._ + * + * Wraps a function within a new function that measures the running time of the + * wrapped function. A `PerformanceObserver` must be subscribed to the `'function'` + * event type in order for the timing details to be accessed. + * + * ```js + * import { timerify, performance, PerformanceObserver } from 'node:perf_hooks'; + * + * function someFunction() { + * console.log('hello world'); + * } + * + * const wrapped = timerify(someFunction); + * + * const obs = new PerformanceObserver((list) => { + * console.log(list.getEntries()[0].duration); + * + * performance.clearMarks(); + * performance.clearMeasures(); + * obs.disconnect(); + * }); + * obs.observe({ entryTypes: ['function'] }); + * + * // A performance timeline entry will be created + * wrapped(); + * ``` + * + * If the wrapped function returns a promise, a finally handler will be attached + * to the promise and the duration will be reported once the finally handler is + * invoked. + * @since v25.2.0 + */ + function timerify any>(fn: T, options?: TimerifyOptions): T; + interface CreateHistogramOptions { + /** + * The minimum recordable value. Must be an integer value greater than 0. + * @default 1 + */ + lowest?: number | bigint | undefined; + /** + * The maximum recordable value. Must be an integer value greater than min. + * @default Number.MAX_SAFE_INTEGER + */ + highest?: number | bigint | undefined; + /** + * The number of accuracy digits. Must be a number between 1 and 5. + * @default 3 + */ + figures?: number | undefined; + } + /** + * Returns a `RecordableHistogram`. + * @since v15.9.0, v14.18.0 + */ + function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; + // TODO: remove these in a future major + /** @deprecated Use the canonical `PerformanceMarkOptions` instead. */ + interface MarkOptions extends PerformanceMarkOptions {} + /** @deprecated Use the canonical `PerformanceMeasureOptions` instead. */ + interface MeasureOptions extends PerformanceMeasureOptions {} +} +declare module "perf_hooks" { + export * from "node:perf_hooks"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/process.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/process.d.ts new file mode 100644 index 0000000..ea50c94 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/process.d.ts @@ -0,0 +1,2175 @@ +declare module "node:process" { + import { Control, MessageOptions, SendHandle } from "node:child_process"; + import { PathLike } from "node:fs"; + import * as tty from "node:tty"; + import { Worker } from "node:worker_threads"; + interface BuiltInModule { + "assert": typeof import("assert"); + "node:assert": typeof import("node:assert"); + "assert/strict": typeof import("assert/strict"); + "node:assert/strict": typeof import("node:assert/strict"); + "async_hooks": typeof import("async_hooks"); + "node:async_hooks": typeof import("node:async_hooks"); + "buffer": typeof import("buffer"); + "node:buffer": typeof import("node:buffer"); + "child_process": typeof import("child_process"); + "node:child_process": typeof import("node:child_process"); + "cluster": typeof import("cluster"); + "node:cluster": typeof import("node:cluster"); + "console": typeof import("console"); + "node:console": typeof import("node:console"); + "constants": typeof import("constants"); + "node:constants": typeof import("node:constants"); + "crypto": typeof import("crypto"); + "node:crypto": typeof import("node:crypto"); + "dgram": typeof import("dgram"); + "node:dgram": typeof import("node:dgram"); + "diagnostics_channel": typeof import("diagnostics_channel"); + "node:diagnostics_channel": typeof import("node:diagnostics_channel"); + "dns": typeof import("dns"); + "node:dns": typeof import("node:dns"); + "dns/promises": typeof import("dns/promises"); + "node:dns/promises": typeof import("node:dns/promises"); + "domain": typeof import("domain"); + "node:domain": typeof import("node:domain"); + "events": typeof import("events"); + "node:events": typeof import("node:events"); + "fs": typeof import("fs"); + "node:fs": typeof import("node:fs"); + "fs/promises": typeof import("fs/promises"); + "node:fs/promises": typeof import("node:fs/promises"); + "http": typeof import("http"); + "node:http": typeof import("node:http"); + "http2": typeof import("http2"); + "node:http2": typeof import("node:http2"); + "https": typeof import("https"); + "node:https": typeof import("node:https"); + "inspector": typeof import("inspector"); + "node:inspector": typeof import("node:inspector"); + "inspector/promises": typeof import("inspector/promises"); + "node:inspector/promises": typeof import("node:inspector/promises"); + "module": typeof import("module"); + "node:module": typeof import("node:module"); + "net": typeof import("net"); + "node:net": typeof import("node:net"); + "os": typeof import("os"); + "node:os": typeof import("node:os"); + "path": typeof import("path"); + "node:path": typeof import("node:path"); + "path/posix": typeof import("path/posix"); + "node:path/posix": typeof import("node:path/posix"); + "path/win32": typeof import("path/win32"); + "node:path/win32": typeof import("node:path/win32"); + "perf_hooks": typeof import("perf_hooks"); + "node:perf_hooks": typeof import("node:perf_hooks"); + "process": typeof import("process"); + "node:process": typeof import("node:process"); + "punycode": typeof import("punycode"); + "node:punycode": typeof import("node:punycode"); + "querystring": typeof import("querystring"); + "node:querystring": typeof import("node:querystring"); + "node:quic": typeof import("node:quic"); + "readline": typeof import("readline"); + "node:readline": typeof import("node:readline"); + "readline/promises": typeof import("readline/promises"); + "node:readline/promises": typeof import("node:readline/promises"); + "repl": typeof import("repl"); + "node:repl": typeof import("node:repl"); + "node:sea": typeof import("node:sea"); + "node:sqlite": typeof import("node:sqlite"); + "stream": typeof import("stream"); + "node:stream": typeof import("node:stream"); + "stream/consumers": typeof import("stream/consumers"); + "node:stream/consumers": typeof import("node:stream/consumers"); + "stream/promises": typeof import("stream/promises"); + "node:stream/promises": typeof import("node:stream/promises"); + "stream/web": typeof import("stream/web"); + "node:stream/web": typeof import("node:stream/web"); + "string_decoder": typeof import("string_decoder"); + "node:string_decoder": typeof import("node:string_decoder"); + "node:test": typeof import("node:test"); + "node:test/reporters": typeof import("node:test/reporters"); + "timers": typeof import("timers"); + "node:timers": typeof import("node:timers"); + "timers/promises": typeof import("timers/promises"); + "node:timers/promises": typeof import("node:timers/promises"); + "tls": typeof import("tls"); + "node:tls": typeof import("node:tls"); + "trace_events": typeof import("trace_events"); + "node:trace_events": typeof import("node:trace_events"); + "tty": typeof import("tty"); + "node:tty": typeof import("node:tty"); + "url": typeof import("url"); + "node:url": typeof import("node:url"); + "util": typeof import("util"); + "node:util": typeof import("node:util"); + "util/types": typeof import("util/types"); + "node:util/types": typeof import("node:util/types"); + "v8": typeof import("v8"); + "node:v8": typeof import("node:v8"); + "vm": typeof import("vm"); + "node:vm": typeof import("node:vm"); + "wasi": typeof import("wasi"); + "node:wasi": typeof import("node:wasi"); + "worker_threads": typeof import("worker_threads"); + "node:worker_threads": typeof import("node:worker_threads"); + "zlib": typeof import("zlib"); + "node:zlib": typeof import("node:zlib"); + } + type SignalsEventMap = { [S in NodeJS.Signals]: [signal: S] }; + interface ProcessEventMap extends SignalsEventMap { + "beforeExit": [code: number]; + "disconnect": []; + "exit": [code: number]; + "message": [ + message: object | boolean | number | string | null, + sendHandle: SendHandle | undefined, + ]; + "rejectionHandled": [promise: Promise]; + "uncaughtException": [error: Error, origin: NodeJS.UncaughtExceptionOrigin]; + "uncaughtExceptionMonitor": [error: Error, origin: NodeJS.UncaughtExceptionOrigin]; + "unhandledRejection": [reason: unknown, promise: Promise]; + "warning": [warning: Error]; + "worker": [worker: Worker]; + "workerMessage": [value: any, source: number]; + } + global { + var process: NodeJS.Process; + namespace process { + export { ProcessEventMap }; + } + namespace NodeJS { + // this namespace merge is here because these are specifically used + // as the type for process.stdin, process.stdout, and process.stderr. + // they can't live in tty.d.ts because we need to disambiguate the imported name. + interface ReadStream extends tty.ReadStream {} + interface WriteStream extends tty.WriteStream {} + interface MemoryUsageFn { + /** + * The `process.memoryUsage()` method iterate over each page to gather informations about memory + * usage which can be slow depending on the program memory allocations. + */ + (): MemoryUsage; + /** + * method returns an integer representing the Resident Set Size (RSS) in bytes. + */ + rss(): number; + } + interface MemoryUsage { + /** + * Resident Set Size, is the amount of space occupied in the main memory device (that is a subset of the total allocated memory) for the + * process, including all C++ and JavaScript objects and code. + */ + rss: number; + /** + * Refers to V8's memory usage. + */ + heapTotal: number; + /** + * Refers to V8's memory usage. + */ + heapUsed: number; + external: number; + /** + * Refers to memory allocated for `ArrayBuffer`s and `SharedArrayBuffer`s, including all Node.js Buffers. This is also included + * in the external value. When Node.js is used as an embedded library, this value may be `0` because allocations for `ArrayBuffer`s + * may not be tracked in that case. + */ + arrayBuffers: number; + } + interface CpuUsage { + user: number; + system: number; + } + interface ProcessRelease { + name: string; + sourceUrl?: string | undefined; + headersUrl?: string | undefined; + libUrl?: string | undefined; + lts?: string | undefined; + } + interface ProcessFeatures { + /** + * A boolean value that is `true` if the current Node.js build is caching builtin modules. + * @since v12.0.0 + */ + readonly cached_builtins: boolean; + /** + * A boolean value that is `true` if the current Node.js build is a debug build. + * @since v0.5.5 + */ + readonly debug: boolean; + /** + * A boolean value that is `true` if the current Node.js build includes the inspector. + * @since v11.10.0 + */ + readonly inspector: boolean; + /** + * A boolean value that is `true` if the current Node.js build includes support for IPv6. + * + * Since all Node.js builds have IPv6 support, this value is always `true`. + * @since v0.5.3 + * @deprecated This property is always true, and any checks based on it are redundant. + */ + readonly ipv6: boolean; + /** + * A boolean value that is `true` if the current Node.js build supports + * [loading ECMAScript modules using `require()`](https://nodejs.org/docs/latest-v25.x/api/modules.md#loading-ecmascript-modules-using-require). + * @since v22.10.0 + */ + readonly require_module: boolean; + /** + * A boolean value that is `true` if the current Node.js build includes support for TLS. + * @since v0.5.3 + */ + readonly tls: boolean; + /** + * A boolean value that is `true` if the current Node.js build includes support for ALPN in TLS. + * + * In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional ALPN support. + * This value is therefore identical to that of `process.features.tls`. + * @since v4.8.0 + * @deprecated Use `process.features.tls` instead. + */ + readonly tls_alpn: boolean; + /** + * A boolean value that is `true` if the current Node.js build includes support for OCSP in TLS. + * + * In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional OCSP support. + * This value is therefore identical to that of `process.features.tls`. + * @since v0.11.13 + * @deprecated Use `process.features.tls` instead. + */ + readonly tls_ocsp: boolean; + /** + * A boolean value that is `true` if the current Node.js build includes support for SNI in TLS. + * + * In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional SNI support. + * This value is therefore identical to that of `process.features.tls`. + * @since v0.5.3 + * @deprecated Use `process.features.tls` instead. + */ + readonly tls_sni: boolean; + /** + * A value that is `"strip"` by default, + * `"transform"` if Node.js is run with `--experimental-transform-types`, and `false` if + * Node.js is run with `--no-strip-types`. + * @since v22.10.0 + */ + readonly typescript: "strip" | "transform" | false; + /** + * A boolean value that is `true` if the current Node.js build includes support for libuv. + * + * Since it's not possible to build Node.js without libuv, this value is always `true`. + * @since v0.5.3 + * @deprecated This property is always true, and any checks based on it are redundant. + */ + readonly uv: boolean; + } + interface ProcessVersions extends Dict { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + modules: string; + openssl: string; + } + type Platform = + | "aix" + | "android" + | "darwin" + | "freebsd" + | "haiku" + | "linux" + | "openbsd" + | "sunos" + | "win32" + | "cygwin" + | "netbsd"; + type Architecture = + | "arm" + | "arm64" + | "ia32" + | "loong64" + | "mips" + | "mipsel" + | "ppc64" + | "riscv64" + | "s390x" + | "x64"; + type Signals = + | "SIGABRT" + | "SIGALRM" + | "SIGBUS" + | "SIGCHLD" + | "SIGCONT" + | "SIGFPE" + | "SIGHUP" + | "SIGILL" + | "SIGINT" + | "SIGIO" + | "SIGIOT" + | "SIGKILL" + | "SIGPIPE" + | "SIGPOLL" + | "SIGPROF" + | "SIGPWR" + | "SIGQUIT" + | "SIGSEGV" + | "SIGSTKFLT" + | "SIGSTOP" + | "SIGSYS" + | "SIGTERM" + | "SIGTRAP" + | "SIGTSTP" + | "SIGTTIN" + | "SIGTTOU" + | "SIGUNUSED" + | "SIGURG" + | "SIGUSR1" + | "SIGUSR2" + | "SIGVTALRM" + | "SIGWINCH" + | "SIGXCPU" + | "SIGXFSZ" + | "SIGBREAK" + | "SIGLOST" + | "SIGINFO"; + type UncaughtExceptionOrigin = "uncaughtException" | "unhandledRejection"; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['beforeExit']) => { ... }; + * ``` + */ + type BeforeExitListener = (...args: ProcessEventMap["beforeExit"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['disconnect']) => { ... }; + * ``` + */ + type DisconnectListener = (...args: ProcessEventMap["disconnect"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['exit']) => { ... }; + * ``` + */ + type ExitListener = (...args: ProcessEventMap["exit"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['message']) => { ... }; + * ``` + */ + type MessageListener = (...args: ProcessEventMap["message"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['rejectionHandled']) => { ... }; + * ``` + */ + type RejectionHandledListener = (...args: ProcessEventMap["rejectionHandled"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + */ + type SignalsListener = (signal: Signals) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['uncaughtException']) => { ... }; + * ``` + */ + type UncaughtExceptionListener = (...args: ProcessEventMap["uncaughtException"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['unhandledRejection']) => { ... }; + * ``` + */ + type UnhandledRejectionListener = (...args: ProcessEventMap["unhandledRejection"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['warning']) => { ... }; + * ``` + */ + type WarningListener = (...args: ProcessEventMap["warning"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['worker']) => { ... }; + * ``` + */ + type WorkerListener = (...args: ProcessEventMap["worker"]) => void; + interface Socket extends ReadWriteStream { + isTTY?: true | undefined; + } + // Alias for compatibility + interface ProcessEnv extends Dict {} + interface HRTime { + /** + * This is the legacy version of {@link process.hrtime.bigint()} + * before bigint was introduced in JavaScript. + * + * The `process.hrtime()` method returns the current high-resolution real time in a `[seconds, nanoseconds]` tuple `Array`, + * where `nanoseconds` is the remaining part of the real time that can't be represented in second precision. + * + * `time` is an optional parameter that must be the result of a previous `process.hrtime()` call to diff with the current time. + * If the parameter passed in is not a tuple `Array`, a TypeError will be thrown. + * Passing in a user-defined array instead of the result of a previous call to `process.hrtime()` will lead to undefined behavior. + * + * These times are relative to an arbitrary time in the past, + * and not related to the time of day and therefore not subject to clock drift. + * The primary use is for measuring performance between intervals: + * ```js + * const { hrtime } = require('node:process'); + * const NS_PER_SEC = 1e9; + * const time = hrtime(); + * // [ 1800216, 25 ] + * + * setTimeout(() => { + * const diff = hrtime(time); + * // [ 1, 552 ] + * + * console.log(`Benchmark took ${diff[0] * NS_PER_SEC + diff[1]} nanoseconds`); + * // Benchmark took 1000000552 nanoseconds + * }, 1000); + * ``` + * @since 0.7.6 + * @legacy Use {@link process.hrtime.bigint()} instead. + * @param time The result of a previous call to `process.hrtime()` + */ + (time?: [number, number]): [number, number]; + /** + * The `bigint` version of the {@link process.hrtime()} method returning the current high-resolution real time in nanoseconds as a `bigint`. + * + * Unlike {@link process.hrtime()}, it does not support an additional time argument since the difference can just be computed directly by subtraction of the two `bigint`s. + * ```js + * import { hrtime } from 'node:process'; + * + * const start = hrtime.bigint(); + * // 191051479007711n + * + * setTimeout(() => { + * const end = hrtime.bigint(); + * // 191052633396993n + * + * console.log(`Benchmark took ${end - start} nanoseconds`); + * // Benchmark took 1154389282 nanoseconds + * }, 1000); + * ``` + * @since v10.7.0 + */ + bigint(): bigint; + } + interface ProcessPermission { + /** + * Verifies that the process is able to access the given scope and reference. + * If no reference is provided, a global scope is assumed, for instance, `process.permission.has('fs.read')` + * will check if the process has ALL file system read permissions. + * + * The reference has a meaning based on the provided scope. For example, the reference when the scope is File System means files and folders. + * + * The available scopes are: + * + * * `fs` - All File System + * * `fs.read` - File System read operations + * * `fs.write` - File System write operations + * * `child` - Child process spawning operations + * * `worker` - Worker thread spawning operation + * + * ```js + * // Check if the process has permission to read the README file + * process.permission.has('fs.read', './README.md'); + * // Check if the process has read permission operations + * process.permission.has('fs.read'); + * ``` + * @since v20.0.0 + */ + has(scope: string, reference?: string): boolean; + } + interface ProcessReport { + /** + * Write reports in a compact format, single-line JSON, more easily consumable by log processing systems + * than the default multi-line format designed for human consumption. + * @since v13.12.0, v12.17.0 + */ + compact: boolean; + /** + * Directory where the report is written. + * The default value is the empty string, indicating that reports are written to the current + * working directory of the Node.js process. + */ + directory: string; + /** + * Filename where the report is written. If set to the empty string, the output filename will be comprised + * of a timestamp, PID, and sequence number. The default value is the empty string. + */ + filename: string; + /** + * Returns a JavaScript Object representation of a diagnostic report for the running process. + * The report's JavaScript stack trace is taken from `err`, if present. + */ + getReport(err?: Error): object; + /** + * If true, a diagnostic report is generated on fatal errors, + * such as out of memory errors or failed C++ assertions. + * @default false + */ + reportOnFatalError: boolean; + /** + * If true, a diagnostic report is generated when the process + * receives the signal specified by process.report.signal. + * @default false + */ + reportOnSignal: boolean; + /** + * If true, a diagnostic report is generated on uncaught exception. + * @default false + */ + reportOnUncaughtException: boolean; + /** + * If true, a diagnostic report is generated without the environment variables. + * @default false + */ + excludeEnv: boolean; + /** + * The signal used to trigger the creation of a diagnostic report. + * @default 'SIGUSR2' + */ + signal: Signals; + /** + * Writes a diagnostic report to a file. If filename is not provided, the default filename + * includes the date, time, PID, and a sequence number. + * The report's JavaScript stack trace is taken from `err`, if present. + * + * If the value of filename is set to `'stdout'` or `'stderr'`, the report is written + * to the stdout or stderr of the process respectively. + * @param fileName Name of the file where the report is written. + * This should be a relative path, that will be appended to the directory specified in + * `process.report.directory`, or the current working directory of the Node.js process, + * if unspecified. + * @param err A custom error used for reporting the JavaScript stack. + * @return Filename of the generated report. + */ + writeReport(fileName?: string, err?: Error): string; + writeReport(err?: Error): string; + } + interface ResourceUsage { + fsRead: number; + fsWrite: number; + involuntaryContextSwitches: number; + ipcReceived: number; + ipcSent: number; + majorPageFault: number; + maxRSS: number; + minorPageFault: number; + sharedMemorySize: number; + signalsCount: number; + swappedOut: number; + systemCPUTime: number; + unsharedDataSize: number; + unsharedStackSize: number; + userCPUTime: number; + voluntaryContextSwitches: number; + } + interface EmitWarningOptions { + /** + * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. + * + * @default 'Warning' + */ + type?: string | undefined; + /** + * A unique identifier for the warning instance being emitted. + */ + code?: string | undefined; + /** + * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. + * + * @default process.emitWarning + */ + ctor?: Function | undefined; + /** + * Additional text to include with the error. + */ + detail?: string | undefined; + } + interface ProcessConfig { + readonly target_defaults: { + readonly cflags: any[]; + readonly default_configuration: string; + readonly defines: string[]; + readonly include_dirs: string[]; + readonly libraries: string[]; + }; + readonly variables: { + readonly clang: number; + readonly host_arch: string; + readonly node_install_npm: boolean; + readonly node_install_waf: boolean; + readonly node_prefix: string; + readonly node_shared_openssl: boolean; + readonly node_shared_v8: boolean; + readonly node_shared_zlib: boolean; + readonly node_use_dtrace: boolean; + readonly node_use_etw: boolean; + readonly node_use_openssl: boolean; + readonly target_arch: string; + readonly v8_no_strict_aliasing: number; + readonly v8_use_snapshot: boolean; + readonly visibility: string; + }; + } + interface Process extends EventEmitter { + /** + * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is + * a `Writable` stream. + * + * For example, to copy `process.stdin` to `process.stdout`: + * + * ```js + * import { stdin, stdout } from 'node:process'; + * + * stdin.pipe(stdout); + * ``` + * + * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information. + */ + stdout: WriteStream & { + fd: 1; + }; + /** + * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is + * a `Writable` stream. + * + * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information. + */ + stderr: WriteStream & { + fd: 2; + }; + /** + * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is + * a `Readable` stream. + * + * For details of how to read from `stdin` see `readable.read()`. + * + * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that + * is compatible with scripts written for Node.js prior to v0.10\. + * For more information see `Stream compatibility`. + * + * In "old" streams mode the `stdin` stream is paused by default, so one + * must call `process.stdin.resume()` to read from it. Note also that calling `process.stdin.resume()` itself would switch stream to "old" mode. + */ + stdin: ReadStream & { + fd: 0; + }; + /** + * The `process.argv` property returns an array containing the command-line + * arguments passed when the Node.js process was launched. The first element will + * be {@link execPath}. See `process.argv0` if access to the original value + * of `argv[0]` is needed. The second element will be the path to the JavaScript + * file being executed. If a [program entry point](https://nodejs.org/docs/latest-v25.x/api/cli.html#program-entry-point) was provided, the second element + * will be the absolute path to it. The remaining elements are additional command-line + * arguments. + * + * For example, assuming the following script for `process-args.js`: + * + * ```js + * import { argv } from 'node:process'; + * + * // print process.argv + * argv.forEach((val, index) => { + * console.log(`${index}: ${val}`); + * }); + * ``` + * + * Launching the Node.js process as: + * + * ```bash + * node process-args.js one two=three four + * ``` + * + * Would generate the output: + * + * ```text + * 0: /usr/local/bin/node + * 1: /Users/mjr/work/node/process-args.js + * 2: one + * 3: two=three + * 4: four + * ``` + * @since v0.1.27 + */ + argv: string[]; + /** + * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts. + * + * ```console + * $ bash -c 'exec -a customArgv0 ./node' + * > process.argv[0] + * '/Volumes/code/external/node/out/Release/node' + * > process.argv0 + * 'customArgv0' + * ``` + * @since v6.4.0 + */ + argv0: string; + /** + * The `process.execArgv` property returns the set of Node.js-specific command-line + * options passed when the Node.js process was launched. These options do not + * appear in the array returned by the {@link argv} property, and do not + * include the Node.js executable, the name of the script, or any options following + * the script name. These options are useful in order to spawn child processes with + * the same execution environment as the parent. + * + * ```bash + * node --icu-data-dir=./foo --require ./bar.js script.js --version + * ``` + * + * Results in `process.execArgv`: + * + * ```js + * ["--icu-data-dir=./foo", "--require", "./bar.js"] + * ``` + * + * And `process.argv`: + * + * ```js + * ['/usr/local/bin/node', 'script.js', '--version'] + * ``` + * + * Refer to `Worker constructor` for the detailed behavior of worker + * threads with this property. + * @since v0.7.7 + */ + execArgv: string[]; + /** + * The `process.execPath` property returns the absolute pathname of the executable + * that started the Node.js process. Symbolic links, if any, are resolved. + * + * ```js + * '/usr/local/bin/node' + * ``` + * @since v0.1.100 + */ + execPath: string; + /** + * The `process.abort()` method causes the Node.js process to exit immediately and + * generate a core file. + * + * This feature is not available in `Worker` threads. + * @since v0.7.0 + */ + abort(): never; + /** + * The `process.chdir()` method changes the current working directory of the + * Node.js process or throws an exception if doing so fails (for instance, if + * the specified `directory` does not exist). + * + * ```js + * import { chdir, cwd } from 'node:process'; + * + * console.log(`Starting directory: ${cwd()}`); + * try { + * chdir('/tmp'); + * console.log(`New directory: ${cwd()}`); + * } catch (err) { + * console.error(`chdir: ${err}`); + * } + * ``` + * + * This feature is not available in `Worker` threads. + * @since v0.1.17 + */ + chdir(directory: string): void; + /** + * The `process.cwd()` method returns the current working directory of the Node.js + * process. + * + * ```js + * import { cwd } from 'node:process'; + * + * console.log(`Current directory: ${cwd()}`); + * ``` + * @since v0.1.8 + */ + cwd(): string; + /** + * The port used by the Node.js debugger when enabled. + * + * ```js + * import process from 'node:process'; + * + * process.debugPort = 5858; + * ``` + * @since v0.7.2 + */ + debugPort: number; + /** + * The `process.dlopen()` method allows dynamically loading shared objects. It is primarily used by `require()` to load C++ Addons, and + * should not be used directly, except in special cases. In other words, `require()` should be preferred over `process.dlopen()` + * unless there are specific reasons such as custom dlopen flags or loading from ES modules. + * + * The `flags` argument is an integer that allows to specify dlopen behavior. See the `[os.constants.dlopen](https://nodejs.org/docs/latest-v25.x/api/os.html#dlopen-constants)` + * documentation for details. + * + * An important requirement when calling `process.dlopen()` is that the `module` instance must be passed. Functions exported by the C++ Addon + * are then accessible via `module.exports`. + * + * The example below shows how to load a C++ Addon, named `local.node`, that exports a `foo` function. All the symbols are loaded before the call returns, by passing the `RTLD_NOW` constant. + * In this example the constant is assumed to be available. + * + * ```js + * import { dlopen } from 'node:process'; + * import { constants } from 'node:os'; + * import { fileURLToPath } from 'node:url'; + * + * const module = { exports: {} }; + * dlopen(module, fileURLToPath(new URL('local.node', import.meta.url)), + * constants.dlopen.RTLD_NOW); + * module.exports.foo(); + * ``` + */ + dlopen(module: object, filename: string, flags?: number): void; + /** + * The `process.emitWarning()` method can be used to emit custom or application + * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. + * + * ```js + * import { emitWarning } from 'node:process'; + * + * // Emit a warning using a string. + * emitWarning('Something happened!'); + * // Emits: (node: 56338) Warning: Something happened! + * ``` + * + * ```js + * import { emitWarning } from 'node:process'; + * + * // Emit a warning using a string and a type. + * emitWarning('Something Happened!', 'CustomWarning'); + * // Emits: (node:56338) CustomWarning: Something Happened! + * ``` + * + * ```js + * import { emitWarning } from 'node:process'; + * + * emitWarning('Something happened!', 'CustomWarning', 'WARN001'); + * // Emits: (node:56338) [WARN001] CustomWarning: Something happened! + * ```js + * + * In each of the previous examples, an `Error` object is generated internally by `process.emitWarning()` and passed through to the `'warning'` handler. + * + * ```js + * import process from 'node:process'; + * + * process.on('warning', (warning) => { + * console.warn(warning.name); // 'Warning' + * console.warn(warning.message); // 'Something happened!' + * console.warn(warning.code); // 'MY_WARNING' + * console.warn(warning.stack); // Stack trace + * console.warn(warning.detail); // 'This is some additional information' + * }); + * ``` + * + * If `warning` is passed as an `Error` object, it will be passed through to the `'warning'` event handler + * unmodified (and the optional `type`, `code` and `ctor` arguments will be ignored): + * + * ```js + * import { emitWarning } from 'node:process'; + * + * // Emit a warning using an Error object. + * const myWarning = new Error('Something happened!'); + * // Use the Error name property to specify the type name + * myWarning.name = 'CustomWarning'; + * myWarning.code = 'WARN001'; + * + * emitWarning(myWarning); + * // Emits: (node:56338) [WARN001] CustomWarning: Something happened! + * ``` + * + * A `TypeError` is thrown if `warning` is anything other than a string or `Error` object. + * + * While process warnings use `Error` objects, the process warning mechanism is not a replacement for normal error handling mechanisms. + * + * The following additional handling is implemented if the warning `type` is `'DeprecationWarning'`: + * * If the `--throw-deprecation` command-line flag is used, the deprecation warning is thrown as an exception rather than being emitted as an event. + * * If the `--no-deprecation` command-line flag is used, the deprecation warning is suppressed. + * * If the `--trace-deprecation` command-line flag is used, the deprecation warning is printed to `stderr` along with the full stack trace. + * @since v8.0.0 + * @param warning The warning to emit. + */ + emitWarning(warning: string | Error, ctor?: Function): void; + emitWarning(warning: string | Error, type?: string, ctor?: Function): void; + emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; + emitWarning(warning: string | Error, options?: EmitWarningOptions): void; + /** + * The `process.env` property returns an object containing the user environment. + * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html). + * + * An example of this object looks like: + * + * ```js + * { + * TERM: 'xterm-256color', + * SHELL: '/usr/local/bin/bash', + * USER: 'maciej', + * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', + * PWD: '/Users/maciej', + * EDITOR: 'vim', + * SHLVL: '1', + * HOME: '/Users/maciej', + * LOGNAME: 'maciej', + * _: '/usr/local/bin/node' + * } + * ``` + * + * It is possible to modify this object, but such modifications will not be + * reflected outside the Node.js process, or (unless explicitly requested) + * to other `Worker` threads. + * In other words, the following example would not work: + * + * ```bash + * node -e 'process.env.foo = "bar"' && echo $foo + * ``` + * + * While the following will: + * + * ```js + * import { env } from 'node:process'; + * + * env.foo = 'bar'; + * console.log(env.foo); + * ``` + * + * Assigning a property on `process.env` will implicitly convert the value + * to a string. **This behavior is deprecated.** Future versions of Node.js may + * throw an error when the value is not a string, number, or boolean. + * + * ```js + * import { env } from 'node:process'; + * + * env.test = null; + * console.log(env.test); + * // => 'null' + * env.test = undefined; + * console.log(env.test); + * // => 'undefined' + * ``` + * + * Use `delete` to delete a property from `process.env`. + * + * ```js + * import { env } from 'node:process'; + * + * env.TEST = 1; + * delete env.TEST; + * console.log(env.TEST); + * // => undefined + * ``` + * + * On Windows operating systems, environment variables are case-insensitive. + * + * ```js + * import { env } from 'node:process'; + * + * env.TEST = 1; + * console.log(env.test); + * // => 1 + * ``` + * + * Unless explicitly specified when creating a `Worker` instance, + * each `Worker` thread has its own copy of `process.env`, based on its + * parent thread's `process.env`, or whatever was specified as the `env` option + * to the `Worker` constructor. Changes to `process.env` will not be visible + * across `Worker` threads, and only the main thread can make changes that + * are visible to the operating system or to native add-ons. On Windows, a copy of `process.env` on a `Worker` instance operates in a case-sensitive manner + * unlike the main thread. + * @since v0.1.27 + */ + env: ProcessEnv; + /** + * The `process.exit()` method instructs Node.js to terminate the process + * synchronously with an exit status of `code`. If `code` is omitted, exit uses + * either the 'success' code `0` or the value of `process.exitCode` if it has been + * set. Node.js will not terminate until all the `'exit'` event listeners are + * called. + * + * To exit with a 'failure' code: + * + * ```js + * import { exit } from 'node:process'; + * + * exit(1); + * ``` + * + * The shell that executed Node.js should see the exit code as `1`. + * + * Calling `process.exit()` will force the process to exit as quickly as possible + * even if there are still asynchronous operations pending that have not yet + * completed fully, including I/O operations to `process.stdout` and `process.stderr`. + * + * In most situations, it is not actually necessary to call `process.exit()` explicitly. The Node.js process will exit on its own _if there is no additional_ + * _work pending_ in the event loop. The `process.exitCode` property can be set to + * tell the process which exit code to use when the process exits gracefully. + * + * For instance, the following example illustrates a _misuse_ of the `process.exit()` method that could lead to data printed to stdout being + * truncated and lost: + * + * ```js + * import { exit } from 'node:process'; + * + * // This is an example of what *not* to do: + * if (someConditionNotMet()) { + * printUsageToStdout(); + * exit(1); + * } + * ``` + * + * The reason this is problematic is because writes to `process.stdout` in Node.js + * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js + * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed. + * + * Rather than calling `process.exit()` directly, the code _should_ set the `process.exitCode` and allow the process to exit naturally by avoiding + * scheduling any additional work for the event loop: + * + * ```js + * import process from 'node:process'; + * + * // How to properly set the exit code while letting + * // the process exit gracefully. + * if (someConditionNotMet()) { + * printUsageToStdout(); + * process.exitCode = 1; + * } + * ``` + * + * If it is necessary to terminate the Node.js process due to an error condition, + * throwing an _uncaught_ error and allowing the process to terminate accordingly + * is safer than calling `process.exit()`. + * + * In `Worker` threads, this function stops the current thread rather + * than the current process. + * @since v0.1.13 + * @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed. + */ + exit(code?: number | string | null): never; + /** + * A number which will be the process exit code, when the process either + * exits gracefully, or is exited via {@link exit} without specifying + * a code. + * + * Specifying a code to {@link exit} will override any + * previous setting of `process.exitCode`. + * @default undefined + * @since v0.11.8 + */ + exitCode: number | string | null | undefined; + finalization: { + /** + * This function registers a callback to be called when the process emits the `exit` event if the `ref` object was not garbage collected. + * If the object `ref` was garbage collected before the `exit` event is emitted, the callback will be removed from the finalization registry, and it will not be called on process exit. + * + * Inside the callback you can release the resources allocated by the `ref` object. + * Be aware that all limitations applied to the `beforeExit` event are also applied to the callback function, + * this means that there is a possibility that the callback will not be called under special circumstances. + * + * The idea of ​​this function is to help you free up resources when the starts process exiting, but also let the object be garbage collected if it is no longer being used. + * @param ref The reference to the resource that is being tracked. + * @param callback The callback function to be called when the resource is finalized. + * @since v22.5.0 + * @experimental + */ + register(ref: T, callback: (ref: T, event: "exit") => void): void; + /** + * This function behaves exactly like the `register`, except that the callback will be called when the process emits the `beforeExit` event if `ref` object was not garbage collected. + * + * Be aware that all limitations applied to the `beforeExit` event are also applied to the callback function, this means that there is a possibility that the callback will not be called under special circumstances. + * @param ref The reference to the resource that is being tracked. + * @param callback The callback function to be called when the resource is finalized. + * @since v22.5.0 + * @experimental + */ + registerBeforeExit(ref: T, callback: (ref: T, event: "beforeExit") => void): void; + /** + * This function remove the register of the object from the finalization registry, so the callback will not be called anymore. + * @param ref The reference to the resource that was registered previously. + * @since v22.5.0 + * @experimental + */ + unregister(ref: object): void; + }; + /** + * The `process.getActiveResourcesInfo()` method returns an array of strings containing + * the types of the active resources that are currently keeping the event loop alive. + * + * ```js + * import { getActiveResourcesInfo } from 'node:process'; + * import { setTimeout } from 'node:timers'; + + * console.log('Before:', getActiveResourcesInfo()); + * setTimeout(() => {}, 1000); + * console.log('After:', getActiveResourcesInfo()); + * // Prints: + * // Before: [ 'TTYWrap', 'TTYWrap', 'TTYWrap' ] + * // After: [ 'TTYWrap', 'TTYWrap', 'TTYWrap', 'Timeout' ] + * ``` + * @since v17.3.0, v16.14.0 + */ + getActiveResourcesInfo(): string[]; + /** + * Provides a way to load built-in modules in a globally available function. + * @param id ID of the built-in module being requested. + */ + getBuiltinModule(id: ID): BuiltInModule[ID]; + getBuiltinModule(id: string): object | undefined; + /** + * The `process.getgid()` method returns the numerical group identity of the + * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).) + * + * ```js + * import process from 'node:process'; + * + * if (process.getgid) { + * console.log(`Current gid: ${process.getgid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v0.1.31 + */ + getgid?: () => number; + /** + * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a + * numeric ID or a group name + * string. If a group name is specified, this method blocks while resolving the + * associated numeric ID. + * + * ```js + * import process from 'node:process'; + * + * if (process.getgid && process.setgid) { + * console.log(`Current gid: ${process.getgid()}`); + * try { + * process.setgid(501); + * console.log(`New gid: ${process.getgid()}`); + * } catch (err) { + * console.log(`Failed to set gid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v0.1.31 + * @param id The group name or ID + */ + setgid?: (id: number | string) => void; + /** + * The `process.getuid()` method returns the numeric user identity of the process. + * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) + * + * ```js + * import process from 'node:process'; + * + * if (process.getuid) { + * console.log(`Current uid: ${process.getuid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v0.1.28 + */ + getuid?: () => number; + /** + * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a + * numeric ID or a username string. + * If a username is specified, the method blocks while resolving the associated + * numeric ID. + * + * ```js + * import process from 'node:process'; + * + * if (process.getuid && process.setuid) { + * console.log(`Current uid: ${process.getuid()}`); + * try { + * process.setuid(501); + * console.log(`New uid: ${process.getuid()}`); + * } catch (err) { + * console.log(`Failed to set uid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v0.1.28 + */ + setuid?: (id: number | string) => void; + /** + * The `process.geteuid()` method returns the numerical effective user identity of + * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) + * + * ```js + * import process from 'node:process'; + * + * if (process.geteuid) { + * console.log(`Current uid: ${process.geteuid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v2.0.0 + */ + geteuid?: () => number; + /** + * The `process.seteuid()` method sets the effective user identity of the process. + * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username + * string. If a username is specified, the method blocks while resolving the + * associated numeric ID. + * + * ```js + * import process from 'node:process'; + * + * if (process.geteuid && process.seteuid) { + * console.log(`Current uid: ${process.geteuid()}`); + * try { + * process.seteuid(501); + * console.log(`New uid: ${process.geteuid()}`); + * } catch (err) { + * console.log(`Failed to set uid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v2.0.0 + * @param id A user name or ID + */ + seteuid?: (id: number | string) => void; + /** + * The `process.getegid()` method returns the numerical effective group identity + * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) + * + * ```js + * import process from 'node:process'; + * + * if (process.getegid) { + * console.log(`Current gid: ${process.getegid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v2.0.0 + */ + getegid?: () => number; + /** + * The `process.setegid()` method sets the effective group identity of the process. + * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group + * name string. If a group name is specified, this method blocks while resolving + * the associated a numeric ID. + * + * ```js + * import process from 'node:process'; + * + * if (process.getegid && process.setegid) { + * console.log(`Current gid: ${process.getegid()}`); + * try { + * process.setegid(501); + * console.log(`New gid: ${process.getegid()}`); + * } catch (err) { + * console.log(`Failed to set gid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v2.0.0 + * @param id A group name or ID + */ + setegid?: (id: number | string) => void; + /** + * The `process.getgroups()` method returns an array with the supplementary group + * IDs. POSIX leaves it unspecified if the effective group ID is included but + * Node.js ensures it always is. + * + * ```js + * import process from 'node:process'; + * + * if (process.getgroups) { + * console.log(process.getgroups()); // [ 16, 21, 297 ] + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v0.9.4 + */ + getgroups?: () => number[]; + /** + * The `process.setgroups()` method sets the supplementary group IDs for the + * Node.js process. This is a privileged operation that requires the Node.js + * process to have `root` or the `CAP_SETGID` capability. + * + * The `groups` array can contain numeric group IDs, group names, or both. + * + * ```js + * import process from 'node:process'; + * + * if (process.getgroups && process.setgroups) { + * try { + * process.setgroups([501]); + * console.log(process.getgroups()); // new groups + * } catch (err) { + * console.log(`Failed to set groups: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v0.9.4 + */ + setgroups?: (groups: ReadonlyArray) => void; + /** + * The `process.setUncaughtExceptionCaptureCallback()` function sets a function + * that will be invoked when an uncaught exception occurs, which will receive the + * exception value itself as its first argument. + * + * If such a function is set, the `'uncaughtException'` event will + * not be emitted. If `--abort-on-uncaught-exception` was passed from the + * command line or set through `v8.setFlagsFromString()`, the process will + * not abort. Actions configured to take place on exceptions such as report + * generations will be affected too + * + * To unset the capture function, `process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this + * method with a non-`null` argument while another capture function is set will + * throw an error. + * + * Using this function is mutually exclusive with using the deprecated `domain` built-in module. + * @since v9.3.0 + */ + setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; + /** + * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}. + * @since v9.3.0 + */ + hasUncaughtExceptionCaptureCallback(): boolean; + /** + * The `process.sourceMapsEnabled` property returns whether the [Source Map v3](https://sourcemaps.info/spec.html) support for stack traces is enabled. + * @since v20.7.0 + * @experimental + */ + readonly sourceMapsEnabled: boolean; + /** + * This function enables or disables the [Source Map v3](https://sourcemaps.info/spec.html) support for + * stack traces. + * + * It provides same features as launching Node.js process with commandline options `--enable-source-maps`. + * + * Only source maps in JavaScript files that are loaded after source maps has been + * enabled will be parsed and loaded. + * @since v16.6.0, v14.18.0 + * @experimental + */ + setSourceMapsEnabled(value: boolean): void; + /** + * The `process.version` property contains the Node.js version string. + * + * ```js + * import { version } from 'node:process'; + * + * console.log(`Version: ${version}`); + * // Version: v14.8.0 + * ``` + * + * To get the version string without the prepended _v_, use`process.versions.node`. + * @since v0.1.3 + */ + readonly version: string; + /** + * The `process.versions` property returns an object listing the version strings of + * Node.js and its dependencies. `process.versions.modules` indicates the current + * ABI version, which is increased whenever a C++ API changes. Node.js will refuse + * to load modules that were compiled against a different module ABI version. + * + * ```js + * import { versions } from 'node:process'; + * + * console.log(versions); + * ``` + * + * Will generate an object similar to: + * + * ```console + * { node: '20.2.0', + * acorn: '8.8.2', + * ada: '2.4.0', + * ares: '1.19.0', + * base64: '0.5.0', + * brotli: '1.0.9', + * cjs_module_lexer: '1.2.2', + * cldr: '43.0', + * icu: '73.1', + * llhttp: '8.1.0', + * modules: '115', + * napi: '8', + * nghttp2: '1.52.0', + * nghttp3: '0.7.0', + * ngtcp2: '0.8.1', + * openssl: '3.0.8+quic', + * simdutf: '3.2.9', + * tz: '2023c', + * undici: '5.22.0', + * unicode: '15.0', + * uv: '1.44.2', + * uvwasi: '0.0.16', + * v8: '11.3.244.8-node.9', + * zlib: '1.2.13' } + * ``` + * @since v0.2.0 + */ + readonly versions: ProcessVersions; + /** + * The `process.config` property returns a frozen `Object` containing the + * JavaScript representation of the configure options used to compile the current + * Node.js executable. This is the same as the `config.gypi` file that was produced + * when running the `./configure` script. + * + * An example of the possible output looks like: + * + * ```js + * { + * target_defaults: + * { cflags: [], + * default_configuration: 'Release', + * defines: [], + * include_dirs: [], + * libraries: [] }, + * variables: + * { + * host_arch: 'x64', + * napi_build_version: 5, + * node_install_npm: 'true', + * node_prefix: '', + * node_shared_cares: 'false', + * node_shared_http_parser: 'false', + * node_shared_libuv: 'false', + * node_shared_zlib: 'false', + * node_use_openssl: 'true', + * node_shared_openssl: 'false', + * strict_aliasing: 'true', + * target_arch: 'x64', + * v8_use_snapshot: 1 + * } + * } + * ``` + * @since v0.7.7 + */ + readonly config: ProcessConfig; + /** + * The `process.kill()` method sends the `signal` to the process identified by`pid`. + * + * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information. + * + * This method will throw an error if the target `pid` does not exist. As a special + * case, a signal of `0` can be used to test for the existence of a process. + * Windows platforms will throw an error if the `pid` is used to kill a process + * group. + * + * Even though the name of this function is `process.kill()`, it is really just a + * signal sender, like the `kill` system call. The signal sent may do something + * other than kill the target process. + * + * ```js + * import process, { kill } from 'node:process'; + * + * process.on('SIGHUP', () => { + * console.log('Got SIGHUP signal.'); + * }); + * + * setTimeout(() => { + * console.log('Exiting.'); + * process.exit(0); + * }, 100); + * + * kill(process.pid, 'SIGHUP'); + * ``` + * + * When `SIGUSR1` is received by a Node.js process, Node.js will start the + * debugger. See `Signal Events`. + * @since v0.0.6 + * @param pid A process ID + * @param [signal='SIGTERM'] The signal to send, either as a string or number. + */ + kill(pid: number, signal?: string | number): true; + /** + * Loads the environment configuration from a `.env` file into `process.env`. If + * the file is not found, error will be thrown. + * + * To load a specific .env file by specifying its path, use the following code: + * + * ```js + * import { loadEnvFile } from 'node:process'; + * + * loadEnvFile('./development.env') + * ``` + * @since v20.12.0 + * @param path The path to the .env file + */ + loadEnvFile(path?: PathLike): void; + /** + * The `process.pid` property returns the PID of the process. + * + * ```js + * import { pid } from 'node:process'; + * + * console.log(`This process is pid ${pid}`); + * ``` + * @since v0.1.15 + */ + readonly pid: number; + /** + * The `process.ppid` property returns the PID of the parent of the + * current process. + * + * ```js + * import { ppid } from 'node:process'; + * + * console.log(`The parent process is pid ${ppid}`); + * ``` + * @since v9.2.0, v8.10.0, v6.13.0 + */ + readonly ppid: number; + /** + * The `process.threadCpuUsage()` method returns the user and system CPU time usage of + * the current worker thread, in an object with properties `user` and `system`, whose + * values are microsecond values (millionth of a second). + * + * The result of a previous call to `process.threadCpuUsage()` can be passed as the + * argument to the function, to get a diff reading. + * @since v23.9.0 + * @param previousValue A previous return value from calling + * `process.threadCpuUsage()` + */ + threadCpuUsage(previousValue?: CpuUsage): CpuUsage; + /** + * The `process.title` property returns the current process title (i.e. returns + * the current value of `ps`). Assigning a new value to `process.title` modifies + * the current value of `ps`. + * + * When a new value is assigned, different platforms will impose different maximum + * length restrictions on the title. Usually such restrictions are quite limited. + * For instance, on Linux and macOS, `process.title` is limited to the size of the + * binary name plus the length of the command-line arguments because setting the `process.title` overwrites the `argv` memory of the process. Node.js v0.8 + * allowed for longer process title strings by also overwriting the `environ` memory but that was potentially insecure and confusing in some (rather obscure) + * cases. + * + * Assigning a value to `process.title` might not result in an accurate label + * within process manager applications such as macOS Activity Monitor or Windows + * Services Manager. + * @since v0.1.104 + */ + title: string; + /** + * The operating system CPU architecture for which the Node.js binary was compiled. + * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`, + * `'mipsel'`, `'ppc64'`, `'riscv64'`, `'s390x'`, and `'x64'`. + * + * ```js + * import { arch } from 'node:process'; + * + * console.log(`This processor architecture is ${arch}`); + * ``` + * @since v0.5.0 + */ + readonly arch: Architecture; + /** + * The `process.platform` property returns a string identifying the operating + * system platform for which the Node.js binary was compiled. + * + * Currently possible values are: + * + * * `'aix'` + * * `'darwin'` + * * `'freebsd'` + * * `'linux'` + * * `'openbsd'` + * * `'sunos'` + * * `'win32'` + * + * ```js + * import { platform } from 'node:process'; + * + * console.log(`This platform is ${platform}`); + * ``` + * + * The value `'android'` may also be returned if the Node.js is built on the + * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). + * @since v0.1.16 + */ + readonly platform: Platform; + /** + * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at + * runtime, `require.main` may still refer to the original main module in + * modules that were required before the change occurred. Generally, it's + * safe to assume that the two refer to the same module. + * + * As with `require.main`, `process.mainModule` will be `undefined` if there + * is no entry script. + * @since v0.1.17 + * @deprecated Since v14.0.0 - Use `main` instead. + */ + mainModule?: Module; + memoryUsage: MemoryUsageFn; + /** + * Gets the amount of memory available to the process (in bytes) based on + * limits imposed by the OS. If there is no such constraint, or the constraint + * is unknown, `0` is returned. + * + * See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more + * information. + * @since v19.6.0, v18.15.0 + */ + constrainedMemory(): number; + /** + * Gets the amount of free memory that is still available to the process (in bytes). + * See [`uv_get_available_memory`](https://nodejs.org/docs/latest-v25.x/api/process.html#processavailablememory) for more information. + * @since v20.13.0 + */ + availableMemory(): number; + /** + * The `process.cpuUsage()` method returns the user and system CPU time usage of + * the current process, in an object with properties `user` and `system`, whose + * values are microsecond values (millionth of a second). These values measure time + * spent in user and system code respectively, and may end up being greater than + * actual elapsed time if multiple CPU cores are performing work for this process. + * + * The result of a previous call to `process.cpuUsage()` can be passed as the + * argument to the function, to get a diff reading. + * + * ```js + * import { cpuUsage } from 'node:process'; + * + * const startUsage = cpuUsage(); + * // { user: 38579, system: 6986 } + * + * // spin the CPU for 500 milliseconds + * const now = Date.now(); + * while (Date.now() - now < 500); + * + * console.log(cpuUsage(startUsage)); + * // { user: 514883, system: 11226 } + * ``` + * @since v6.1.0 + * @param previousValue A previous return value from calling `process.cpuUsage()` + */ + cpuUsage(previousValue?: CpuUsage): CpuUsage; + /** + * `process.nextTick()` adds `callback` to the "next tick queue". This queue is + * fully drained after the current operation on the JavaScript stack runs to + * completion and before the event loop is allowed to continue. It's possible to + * create an infinite loop if one were to recursively call `process.nextTick()`. + * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background. + * + * ```js + * import { nextTick } from 'node:process'; + * + * console.log('start'); + * nextTick(() => { + * console.log('nextTick callback'); + * }); + * console.log('scheduled'); + * // Output: + * // start + * // scheduled + * // nextTick callback + * ``` + * + * This is important when developing APIs in order to give users the opportunity + * to assign event handlers _after_ an object has been constructed but before any + * I/O has occurred: + * + * ```js + * import { nextTick } from 'node:process'; + * + * function MyThing(options) { + * this.setupOptions(options); + * + * nextTick(() => { + * this.startDoingStuff(); + * }); + * } + * + * const thing = new MyThing(); + * thing.getReadyForStuff(); + * + * // thing.startDoingStuff() gets called now, not before. + * ``` + * + * It is very important for APIs to be either 100% synchronous or 100% + * asynchronous. Consider this example: + * + * ```js + * // WARNING! DO NOT USE! BAD UNSAFE HAZARD! + * function maybeSync(arg, cb) { + * if (arg) { + * cb(); + * return; + * } + * + * fs.stat('file', cb); + * } + * ``` + * + * This API is hazardous because in the following case: + * + * ```js + * const maybeTrue = Math.random() > 0.5; + * + * maybeSync(maybeTrue, () => { + * foo(); + * }); + * + * bar(); + * ``` + * + * It is not clear whether `foo()` or `bar()` will be called first. + * + * The following approach is much better: + * + * ```js + * import { nextTick } from 'node:process'; + * + * function definitelyAsync(arg, cb) { + * if (arg) { + * nextTick(cb); + * return; + * } + * + * fs.stat('file', cb); + * } + * ``` + * @since v0.1.26 + * @param args Additional arguments to pass when invoking the `callback` + */ + nextTick(callback: Function, ...args: any[]): void; + /** + * The process.noDeprecation property indicates whether the --no-deprecation flag is set on the current Node.js process. + * See the documentation for the ['warning' event](https://nodejs.org/docs/latest/api/process.html#event-warning) and the [emitWarning()](https://nodejs.org/docs/latest/api/process.html#processemitwarningwarning-type-code-ctor) method for more information about this flag's behavior. + */ + noDeprecation?: boolean; + /** + * This API is available through the [--permission](https://nodejs.org/api/cli.html#--permission) flag. + * + * `process.permission` is an object whose methods are used to manage permissions for the current process. + * Additional documentation is available in the [Permission Model](https://nodejs.org/api/permissions.html#permission-model). + * @since v20.0.0 + */ + permission: ProcessPermission; + /** + * The `process.release` property returns an `Object` containing metadata related + * to the current release, including URLs for the source tarball and headers-only + * tarball. + * + * `process.release` contains the following properties: + * + * ```js + * { + * name: 'node', + * lts: 'Hydrogen', + * sourceUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz', + * headersUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz', + * libUrl: 'https://nodejs.org/download/release/v18.12.0/win-x64/node.lib' + * } + * ``` + * + * In custom builds from non-release versions of the source tree, only the `name` property may be present. The additional properties should not be + * relied upon to exist. + * @since v3.0.0 + */ + readonly release: ProcessRelease; + readonly features: ProcessFeatures; + /** + * The `process.traceProcessWarnings` property indicates whether the `--trace-warnings` flag + * is set on the current Node.js process. This property allows programmatic control over the + * tracing of warnings, enabling or disabling stack traces for warnings at runtime. + * + * ```js + * // Enable trace warnings + * process.traceProcessWarnings = true; + * + * // Emit a warning with a stack trace + * process.emitWarning('Warning with stack trace'); + * + * // Disable trace warnings + * process.traceProcessWarnings = false; + * ``` + * @since v6.10.0 + */ + traceProcessWarnings: boolean; + /** + * `process.umask()` returns the Node.js process's file mode creation mask. Child + * processes inherit the mask from the parent process. + * @since v0.1.19 + * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential + * security vulnerability. There is no safe, cross-platform alternative API. + */ + umask(): number; + /** + * Can only be set if not in worker thread. + */ + umask(mask: string | number): number; + /** + * The `process.uptime()` method returns the number of seconds the current Node.js + * process has been running. + * + * The return value includes fractions of a second. Use `Math.floor()` to get whole + * seconds. + * @since v0.5.0 + */ + uptime(): number; + hrtime: HRTime; + /** + * If the Node.js process was spawned with an IPC channel, the process.channel property is a reference to the IPC channel. + * If no IPC channel exists, this property is undefined. + * @since v7.1.0 + */ + channel?: Control; + /** + * If Node.js is spawned with an IPC channel, the `process.send()` method can be + * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. + * + * If Node.js was not spawned with an IPC channel, `process.send` will be `undefined`. + * + * The message goes through serialization and parsing. The resulting message might + * not be the same as what is originally sent. + * @since v0.5.9 + * @param options used to parameterize the sending of certain types of handles. `options` supports the following properties: + */ + send?( + message: any, + sendHandle?: SendHandle, + options?: MessageOptions, + callback?: (error: Error | null) => void, + ): boolean; + send?( + message: any, + sendHandle: SendHandle, + callback?: (error: Error | null) => void, + ): boolean; + send?( + message: any, + callback: (error: Error | null) => void, + ): boolean; + /** + * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the + * IPC channel to the parent process, allowing the child process to exit gracefully + * once there are no other connections keeping it alive. + * + * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. + * + * If the Node.js process was not spawned with an IPC channel, `process.disconnect()` will be `undefined`. + * @since v0.7.2 + */ + disconnect?(): void; + /** + * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return `true` so long as the IPC + * channel is connected and will return `false` after `process.disconnect()` is called. + * + * Once `process.connected` is `false`, it is no longer possible to send messages + * over the IPC channel using `process.send()`. + * @since v0.7.2 + */ + connected: boolean; + /** + * The `process.allowedNodeEnvironmentFlags` property is a special, + * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. + * + * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides `Set.prototype.has` to recognize several different possible flag + * representations. `process.allowedNodeEnvironmentFlags.has()` will + * return `true` in the following cases: + * + * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g., `inspect-brk` for `--inspect-brk`, or `r` for `-r`. + * * Flags passed through to V8 (as listed in `--v8-options`) may replace + * one or more _non-leading_ dashes for an underscore, or vice-versa; + * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, + * etc. + * * Flags may contain one or more equals (`=`) characters; all + * characters after and including the first equals will be ignored; + * e.g., `--stack-trace-limit=100`. + * * Flags _must_ be allowable within `NODE_OPTIONS`. + * + * When iterating over `process.allowedNodeEnvironmentFlags`, flags will + * appear only _once_; each will begin with one or more dashes. Flags + * passed through to V8 will contain underscores instead of non-leading + * dashes: + * + * ```js + * import { allowedNodeEnvironmentFlags } from 'node:process'; + * + * allowedNodeEnvironmentFlags.forEach((flag) => { + * // -r + * // --inspect-brk + * // --abort_on_uncaught_exception + * // ... + * }); + * ``` + * + * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail + * silently. + * + * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will + * contain what _would have_ been allowable. + * @since v10.10.0 + */ + allowedNodeEnvironmentFlags: ReadonlySet; + /** + * `process.report` is an object whose methods are used to generate diagnostic reports for the current process. + * Additional documentation is available in the [report documentation](https://nodejs.org/docs/latest-v25.x/api/report.html). + * @since v11.8.0 + */ + report: ProcessReport; + /** + * ```js + * import { resourceUsage } from 'node:process'; + * + * console.log(resourceUsage()); + * /* + * Will output: + * { + * userCPUTime: 82872, + * systemCPUTime: 4143, + * maxRSS: 33164, + * sharedMemorySize: 0, + * unsharedDataSize: 0, + * unsharedStackSize: 0, + * minorPageFault: 2469, + * majorPageFault: 0, + * swappedOut: 0, + * fsRead: 0, + * fsWrite: 8, + * ipcSent: 0, + * ipcReceived: 0, + * signalsCount: 0, + * voluntaryContextSwitches: 79, + * involuntaryContextSwitches: 1 + * } + * + * ``` + * @since v12.6.0 + * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t]. + */ + resourceUsage(): ResourceUsage; + /** + * The initial value of `process.throwDeprecation` indicates whether the `--throw-deprecation` flag is set on the current Node.js process. `process.throwDeprecation` + * is mutable, so whether or not deprecation warnings result in errors may be altered at runtime. See the documentation for the 'warning' event and the emitWarning() + * method for more information. + * + * ```bash + * $ node --throw-deprecation -p "process.throwDeprecation" + * true + * $ node -p "process.throwDeprecation" + * undefined + * $ node + * > process.emitWarning('test', 'DeprecationWarning'); + * undefined + * > (node:26598) DeprecationWarning: test + * > process.throwDeprecation = true; + * true + * > process.emitWarning('test', 'DeprecationWarning'); + * Thrown: + * [DeprecationWarning: test] { name: 'DeprecationWarning' } + * ``` + * @since v0.9.12 + */ + throwDeprecation: boolean; + /** + * The `process.traceDeprecation` property indicates whether the `--trace-deprecation` flag is set on the current Node.js process. See the + * documentation for the `'warning' event` and the `emitWarning() method` for more information about this + * flag's behavior. + * @since v0.8.0 + */ + traceDeprecation: boolean; + /** + * An object is "refable" if it implements the Node.js "Refable protocol". + * Specifically, this means that the object implements the `Symbol.for('nodejs.ref')` + * and `Symbol.for('nodejs.unref')` methods. "Ref'd" objects will keep the Node.js + * event loop alive, while "unref'd" objects will not. Historically, this was + * implemented by using `ref()` and `unref()` methods directly on the objects. + * This pattern, however, is being deprecated in favor of the "Refable protocol" + * in order to better support Web Platform API types whose APIs cannot be modified + * to add `ref()` and `unref()` methods but still need to support that behavior. + * @since v22.14.0 + * @experimental + * @param maybeRefable An object that may be "refable". + */ + ref(maybeRefable: any): void; + /** + * An object is "unrefable" if it implements the Node.js "Refable protocol". + * Specifically, this means that the object implements the `Symbol.for('nodejs.ref')` + * and `Symbol.for('nodejs.unref')` methods. "Ref'd" objects will keep the Node.js + * event loop alive, while "unref'd" objects will not. Historically, this was + * implemented by using `ref()` and `unref()` methods directly on the objects. + * This pattern, however, is being deprecated in favor of the "Refable protocol" + * in order to better support Web Platform API types whose APIs cannot be modified + * to add `ref()` and `unref()` methods but still need to support that behavior. + * @since v22.14.0 + * @experimental + * @param maybeRefable An object that may be "unref'd". + */ + unref(maybeRefable: any): void; + /** + * Replaces the current process with a new process. + * + * This is achieved by using the `execve` POSIX function and therefore no memory or other + * resources from the current process are preserved, except for the standard input, + * standard output and standard error file descriptor. + * + * All other resources are discarded by the system when the processes are swapped, without triggering + * any exit or close events and without running any cleanup handler. + * + * This function will never return, unless an error occurred. + * + * This function is not available on Windows or IBM i. + * @since v22.15.0 + * @experimental + * @param file The name or path of the executable file to run. + * @param args List of string arguments. No argument can contain a null-byte (`\u0000`). + * @param env Environment key-value pairs. + * No key or value can contain a null-byte (`\u0000`). + * **Default:** `process.env`. + */ + execve?(file: string, args?: readonly string[], env?: ProcessEnv): never; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: ProcessEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ProcessEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ProcessEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: ProcessEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: ProcessEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: ProcessEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: ProcessEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ProcessEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ProcessEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: ProcessEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ProcessEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + } + } + export = process; +} +declare module "process" { + import process = require("node:process"); + export = process; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/punycode.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/punycode.d.ts new file mode 100644 index 0000000..d293553 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/punycode.d.ts @@ -0,0 +1,117 @@ +/** + * **The version of the punycode module bundled in Node.js is being deprecated. **In a future major version of Node.js this module will be removed. Users + * currently depending on the `punycode` module should switch to using the + * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL + * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. + * + * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It + * can be accessed using: + * + * ```js + * import punycode from 'node:punycode'; + * ``` + * + * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is + * primarily intended for use in Internationalized Domain Names. Because host + * names in URLs are limited to ASCII characters only, Domain Names that contain + * non-ASCII characters must be converted into ASCII using the Punycode scheme. + * For instance, the Japanese character that translates into the English word, `'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent + * to `'example.com'`) is represented by Punycode as the ASCII string `'xn--fsq.com'`. + * + * The `punycode` module provides a simple implementation of the Punycode standard. + * + * The `punycode` module is a third-party dependency used by Node.js and + * made available to developers as a convenience. Fixes or other modifications to + * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. + * @deprecated + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/punycode.js) + */ +declare module "node:punycode" { + /** + * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only + * characters to the equivalent string of Unicode codepoints. + * + * ```js + * punycode.decode('maana-pta'); // 'mañana' + * punycode.decode('--dqo34k'); // '☃-⌘' + * ``` + * @since v0.5.1 + */ + function decode(string: string): string; + /** + * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. + * + * ```js + * punycode.encode('mañana'); // 'maana-pta' + * punycode.encode('☃-⌘'); // '--dqo34k' + * ``` + * @since v0.5.1 + */ + function encode(string: string): string; + /** + * The `punycode.toUnicode()` method converts a string representing a domain name + * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be + * converted. + * + * ```js + * // decode domain names + * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' + * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' + * punycode.toUnicode('example.com'); // 'example.com' + * ``` + * @since v0.6.1 + */ + function toUnicode(domain: string): string; + /** + * The `punycode.toASCII()` method converts a Unicode string representing an + * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the + * domain name will be converted. Calling `punycode.toASCII()` on a string that + * already only contains ASCII characters will have no effect. + * + * ```js + * // encode domain names + * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' + * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' + * punycode.toASCII('example.com'); // 'example.com' + * ``` + * @since v0.6.1 + */ + function toASCII(domain: string): string; + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + const ucs2: ucs2; + interface ucs2 { + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + decode(string: string): number[]; + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + encode(codePoints: readonly number[]): string; + } + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + const version: string; +} +declare module "punycode" { + export * from "node:punycode"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/querystring.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/querystring.d.ts new file mode 100644 index 0000000..dc421bc --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/querystring.d.ts @@ -0,0 +1,152 @@ +/** + * The `node:querystring` module provides utilities for parsing and formatting URL + * query strings. It can be accessed using: + * + * ```js + * import querystring from 'node:querystring'; + * ``` + * + * `querystring` is more performant than `URLSearchParams` but is not a + * standardized API. Use `URLSearchParams` when performance is not critical or + * when compatibility with browser code is desirable. + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/querystring.js) + */ +declare module "node:querystring" { + interface StringifyOptions { + /** + * The function to use when converting URL-unsafe characters to percent-encoding in the query string. + * @default `querystring.escape()` + */ + encodeURIComponent?: ((str: string) => string) | undefined; + } + interface ParseOptions { + /** + * Specifies the maximum number of keys to parse. Specify `0` to remove key counting limitations. + * @default 1000 + */ + maxKeys?: number | undefined; + /** + * The function to use when decoding percent-encoded characters in the query string. + * @default `querystring.unescape()` + */ + decodeURIComponent?: ((str: string) => string) | undefined; + } + interface ParsedUrlQuery extends NodeJS.Dict {} + interface ParsedUrlQueryInput extends + NodeJS.Dict< + | string + | number + | boolean + | bigint + | ReadonlyArray + | null + > + {} + /** + * The `querystring.stringify()` method produces a URL query string from a + * given `obj` by iterating through the object's "own properties". + * + * It serializes the following types of values passed in `obj`: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | + * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | + * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | + * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | + * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | + * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | + * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | + * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to + * empty strings. + * + * ```js + * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); + * // Returns 'foo=bar&baz=qux&baz=quux&corge=' + * + * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); + * // Returns 'foo:bar;baz:qux' + * ``` + * + * By default, characters requiring percent-encoding within the query string will + * be encoded as UTF-8\. If an alternative encoding is required, then an alternative `encodeURIComponent` option will need to be specified: + * + * ```js + * // Assuming gbkEncodeURIComponent function already exists, + * + * querystring.stringify({ w: '中文', foo: 'bar' }, null, null, + * { encodeURIComponent: gbkEncodeURIComponent }); + * ``` + * @since v0.1.25 + * @param obj The object to serialize into a URL query string + * @param [sep='&'] The substring used to delimit key and value pairs in the query string. + * @param [eq='='] . The substring used to delimit keys and values in the query string. + */ + function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; + /** + * The `querystring.parse()` method parses a URL query string (`str`) into a + * collection of key and value pairs. + * + * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: + * + * ```json + * { + * "foo": "bar", + * "abc": ["xyz", "123"] + * } + * ``` + * + * The object returned by the `querystring.parse()` method _does not_ prototypically inherit from the JavaScript `Object`. This means that typical `Object` methods such as `obj.toString()`, + * `obj.hasOwnProperty()`, and others + * are not defined and _will not work_. + * + * By default, percent-encoded characters within the query string will be assumed + * to use UTF-8 encoding. If an alternative character encoding is used, then an + * alternative `decodeURIComponent` option will need to be specified: + * + * ```js + * // Assuming gbkDecodeURIComponent function already exists... + * + * querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, + * { decodeURIComponent: gbkDecodeURIComponent }); + * ``` + * @since v0.1.25 + * @param str The URL query string to parse + * @param [sep='&'] The substring used to delimit key and value pairs in the query string. + * @param [eq='='] The substring used to delimit keys and values in the query string. + */ + function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; + /** + * The querystring.encode() function is an alias for querystring.stringify(). + */ + const encode: typeof stringify; + /** + * The querystring.decode() function is an alias for querystring.parse(). + */ + const decode: typeof parse; + /** + * The `querystring.escape()` method performs URL percent-encoding on the given `str` in a manner that is optimized for the specific requirements of URL + * query strings. + * + * The `querystring.escape()` method is used by `querystring.stringify()` and is + * generally not expected to be used directly. It is exported primarily to allow + * application code to provide a replacement percent-encoding implementation if + * necessary by assigning `querystring.escape` to an alternative function. + * @since v0.1.25 + */ + function escape(str: string): string; + /** + * The `querystring.unescape()` method performs decoding of URL percent-encoded + * characters on the given `str`. + * + * The `querystring.unescape()` method is used by `querystring.parse()` and is + * generally not expected to be used directly. It is exported primarily to allow + * application code to provide a replacement decoding implementation if + * necessary by assigning `querystring.unescape` to an alternative function. + * + * By default, the `querystring.unescape()` method will attempt to use the + * JavaScript built-in `decodeURIComponent()` method to decode. If that fails, + * a safer equivalent that does not throw on malformed URLs will be used. + * @since v0.1.25 + */ + function unescape(str: string): string; +} +declare module "querystring" { + export * from "node:querystring"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/quic.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/quic.d.ts new file mode 100644 index 0000000..9a6fd97 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/quic.d.ts @@ -0,0 +1,910 @@ +/** + * The 'node:quic' module provides an implementation of the QUIC protocol. + * To access it, start Node.js with the `--experimental-quic` option and: + * + * ```js + * import quic from 'node:quic'; + * ``` + * + * The module is only available under the `node:` scheme. + * @since v23.8.0 + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/quic.js) + */ +declare module "node:quic" { + import { KeyObject, webcrypto } from "node:crypto"; + import { SocketAddress } from "node:net"; + import { ReadableStream } from "node:stream/web"; + /** + * @since v23.8.0 + */ + type OnSessionCallback = (this: QuicEndpoint, session: QuicSession) => void; + /** + * @since v23.8.0 + */ + type OnStreamCallback = (this: QuicSession, stream: QuicStream) => void; + /** + * @since v23.8.0 + */ + type OnDatagramCallback = (this: QuicSession, datagram: Uint8Array, early: boolean) => void; + /** + * @since v23.8.0 + */ + type OnDatagramStatusCallback = (this: QuicSession, id: bigint, status: "lost" | "acknowledged") => void; + /** + * @since v23.8.0 + */ + type OnPathValidationCallback = ( + this: QuicSession, + result: "success" | "failure" | "aborted", + newLocalAddress: SocketAddress, + newRemoteAddress: SocketAddress, + oldLocalAddress: SocketAddress, + oldRemoteAddress: SocketAddress, + preferredAddress: boolean, + ) => void; + /** + * @since v23.8.0 + */ + type OnSessionTicketCallback = (this: QuicSession, ticket: object) => void; + /** + * @since v23.8.0 + */ + type OnVersionNegotiationCallback = ( + this: QuicSession, + version: number, + requestedVersions: number[], + supportedVersions: number[], + ) => void; + /** + * @since v23.8.0 + */ + type OnHandshakeCallback = ( + this: QuicSession, + sni: string, + alpn: string, + cipher: string, + cipherVersion: string, + validationErrorReason: string, + validationErrorCode: number, + earlyDataAccepted: boolean, + ) => void; + /** + * @since v23.8.0 + */ + type OnBlockedCallback = (this: QuicStream) => void; + /** + * @since v23.8.0 + */ + type OnStreamErrorCallback = (this: QuicStream, error: any) => void; + /** + * @since v23.8.0 + */ + interface TransportParams { + /** + * The preferred IPv4 address to advertise. + * @since v23.8.0 + */ + preferredAddressIpv4?: SocketAddress | undefined; + /** + * The preferred IPv6 address to advertise. + * @since v23.8.0 + */ + preferredAddressIpv6?: SocketAddress | undefined; + /** + * @since v23.8.0 + */ + initialMaxStreamDataBidiLocal?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + initialMaxStreamDataBidiRemote?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + initialMaxStreamDataUni?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + initialMaxData?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + initialMaxStreamsBidi?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + initialMaxStreamsUni?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + maxIdleTimeout?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + activeConnectionIDLimit?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + ackDelayExponent?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + maxAckDelay?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + maxDatagramFrameSize?: bigint | number | undefined; + } + /** + * @since v23.8.0 + */ + interface SessionOptions { + /** + * An endpoint to use. + * @since v23.8.0 + */ + endpoint?: EndpointOptions | QuicEndpoint | undefined; + /** + * The ALPN protocol identifier. + * @since v23.8.0 + */ + alpn?: string | undefined; + /** + * The CA certificates to use for sessions. + * @since v23.8.0 + */ + ca?: ArrayBuffer | NodeJS.ArrayBufferView | ReadonlyArray | undefined; + /** + * Specifies the congestion control algorithm that will be used. + * Must be set to one of either `'reno'`, `'cubic'`, or `'bbr'`. + * + * This is an advanced option that users typically won't have need to specify. + * @since v23.8.0 + */ + cc?: `${constants.cc}` | undefined; + /** + * The TLS certificates to use for sessions. + * @since v23.8.0 + */ + certs?: ArrayBuffer | NodeJS.ArrayBufferView | ReadonlyArray | undefined; + /** + * The list of supported TLS 1.3 cipher algorithms. + * @since v23.8.0 + */ + ciphers?: string | undefined; + /** + * The CRL to use for sessions. + * @since v23.8.0 + */ + crl?: ArrayBuffer | NodeJS.ArrayBufferView | ReadonlyArray | undefined; + /** + * The list of support TLS 1.3 cipher groups. + * @since v23.8.0 + */ + groups?: string | undefined; + /** + * True to enable TLS keylogging output. + * @since v23.8.0 + */ + keylog?: boolean | undefined; + /** + * The TLS crypto keys to use for sessions. + * @since v23.8.0 + */ + keys?: KeyObject | webcrypto.CryptoKey | ReadonlyArray | undefined; + /** + * Specifies the maximum UDP packet payload size. + * @since v23.8.0 + */ + maxPayloadSize?: bigint | number | undefined; + /** + * Specifies the maximum stream flow-control window size. + * @since v23.8.0 + */ + maxStreamWindow?: bigint | number | undefined; + /** + * Specifies the maximum session flow-control window size. + * @since v23.8.0 + */ + maxWindow?: bigint | number | undefined; + /** + * The minimum QUIC version number to allow. This is an advanced option that users + * typically won't have need to specify. + * @since v23.8.0 + */ + minVersion?: number | undefined; + /** + * When the remote peer advertises a preferred address, this option specifies whether + * to use it or ignore it. + * @since v23.8.0 + */ + preferredAddressPolicy?: "use" | "ignore" | "default" | undefined; + /** + * True if qlog output should be enabled. + * @since v23.8.0 + */ + qlog?: boolean | undefined; + /** + * A session ticket to use for 0RTT session resumption. + * @since v23.8.0 + */ + sessionTicket?: NodeJS.ArrayBufferView | undefined; + /** + * Specifies the maximum number of milliseconds a TLS handshake is permitted to take + * to complete before timing out. + * @since v23.8.0 + */ + handshakeTimeout?: bigint | number | undefined; + /** + * The peer server name to target. + * @since v23.8.0 + */ + sni?: string | undefined; + /** + * True to enable TLS tracing output. + * @since v23.8.0 + */ + tlsTrace?: boolean | undefined; + /** + * The QUIC transport parameters to use for the session. + * @since v23.8.0 + */ + transportParams?: TransportParams | undefined; + /** + * Specifies the maximum number of unacknowledged packets a session should allow. + * @since v23.8.0 + */ + unacknowledgedPacketThreshold?: bigint | number | undefined; + /** + * True to require verification of TLS client certificate. + * @since v23.8.0 + */ + verifyClient?: boolean | undefined; + /** + * True to require private key verification. + * @since v23.8.0 + */ + verifyPrivateKey?: boolean | undefined; + /** + * The QUIC version number to use. This is an advanced option that users typically + * won't have need to specify. + * @since v23.8.0 + */ + version?: number | undefined; + } + /** + * Initiate a new client-side session. + * + * ```js + * import { connect } from 'node:quic'; + * import { Buffer } from 'node:buffer'; + * + * const enc = new TextEncoder(); + * const alpn = 'foo'; + * const client = await connect('123.123.123.123:8888', { alpn }); + * await client.createUnidirectionalStream({ + * body: enc.encode('hello world'), + * }); + * ``` + * + * By default, every call to `connect(...)` will create a new local + * `QuicEndpoint` instance bound to a new random local IP port. To + * specify the exact local address to use, or to multiplex multiple + * QUIC sessions over a single local port, pass the `endpoint` option + * with either a `QuicEndpoint` or `EndpointOptions` as the argument. + * + * ```js + * import { QuicEndpoint, connect } from 'node:quic'; + * + * const endpoint = new QuicEndpoint({ + * address: '127.0.0.1:1234', + * }); + * + * const client = await connect('123.123.123.123:8888', { endpoint }); + * ``` + * @since v23.8.0 + */ + function connect(address: string | SocketAddress, options?: SessionOptions): Promise; + /** + * Configures the endpoint to listen as a server. When a new session is initiated by + * a remote peer, the given `onsession` callback will be invoked with the created + * session. + * + * ```js + * import { listen } from 'node:quic'; + * + * const endpoint = await listen((session) => { + * // ... handle the session + * }); + * + * // Closing the endpoint allows any sessions open when close is called + * // to complete naturally while preventing new sessions from being + * // initiated. Once all existing sessions have finished, the endpoint + * // will be destroyed. The call returns a promise that is resolved once + * // the endpoint is destroyed. + * await endpoint.close(); + * ``` + * + * By default, every call to `listen(...)` will create a new local + * `QuicEndpoint` instance bound to a new random local IP port. To + * specify the exact local address to use, or to multiplex multiple + * QUIC sessions over a single local port, pass the `endpoint` option + * with either a `QuicEndpoint` or `EndpointOptions` as the argument. + * + * At most, any single `QuicEndpoint` can only be configured to listen as + * a server once. + * @since v23.8.0 + */ + function listen(onsession: OnSessionCallback, options?: SessionOptions): Promise; + /** + * The endpoint configuration options passed when constructing a new `QuicEndpoint` instance. + * @since v23.8.0 + */ + interface EndpointOptions { + /** + * If not specified the endpoint will bind to IPv4 `localhost` on a random port. + * @since v23.8.0 + */ + address?: SocketAddress | string | undefined; + /** + * The endpoint maintains an internal cache of validated socket addresses as a + * performance optimization. This option sets the maximum number of addresses + * that are cache. This is an advanced option that users typically won't have + * need to specify. + * @since v23.8.0 + */ + addressLRUSize?: bigint | number | undefined; + /** + * When `true`, indicates that the endpoint should bind only to IPv6 addresses. + * @since v23.8.0 + */ + ipv6Only?: boolean | undefined; + /** + * Specifies the maximum number of concurrent sessions allowed per remote peer address. + * @since v23.8.0 + */ + maxConnectionsPerHost?: bigint | number | undefined; + /** + * Specifies the maximum total number of concurrent sessions. + * @since v23.8.0 + */ + maxConnectionsTotal?: bigint | number | undefined; + /** + * Specifies the maximum number of QUIC retry attempts allowed per remote peer address. + * @since v23.8.0 + */ + maxRetries?: bigint | number | undefined; + /** + * Specifies the maximum number of stateless resets that are allowed per remote peer address. + * @since v23.8.0 + */ + maxStatelessResetsPerHost?: bigint | number | undefined; + /** + * Specifies the length of time a QUIC retry token is considered valid. + * @since v23.8.0 + */ + retryTokenExpiration?: bigint | number | undefined; + /** + * Specifies the 16-byte secret used to generate QUIC retry tokens. + * @since v23.8.0 + */ + resetTokenSecret?: NodeJS.ArrayBufferView | undefined; + /** + * Specifies the length of time a QUIC token is considered valid. + * @since v23.8.0 + */ + tokenExpiration?: bigint | number | undefined; + /** + * Specifies the 16-byte secret used to generate QUIC tokens. + * @since v23.8.0 + */ + tokenSecret?: NodeJS.ArrayBufferView | undefined; + /** + * @since v23.8.0 + */ + udpReceiveBufferSize?: number | undefined; + /** + * @since v23.8.0 + */ + udpSendBufferSize?: number | undefined; + /** + * @since v23.8.0 + */ + udpTTL?: number | undefined; + /** + * When `true`, requires that the endpoint validate peer addresses using retry packets + * while establishing a new connection. + * @since v23.8.0 + */ + validateAddress?: boolean | undefined; + } + /** + * A `QuicEndpoint` encapsulates the local UDP-port binding for QUIC. It can be + * used as both a client and a server. + * @since v23.8.0 + */ + class QuicEndpoint implements AsyncDisposable { + constructor(options?: EndpointOptions); + /** + * The local UDP socket address to which the endpoint is bound, if any. + * + * If the endpoint is not currently bound then the value will be `undefined`. Read only. + * @since v23.8.0 + */ + readonly address: SocketAddress | undefined; + /** + * When `endpoint.busy` is set to true, the endpoint will temporarily reject + * new sessions from being created. Read/write. + * + * ```js + * // Mark the endpoint busy. New sessions will be prevented. + * endpoint.busy = true; + * + * // Mark the endpoint free. New session will be allowed. + * endpoint.busy = false; + * ``` + * + * The `busy` property is useful when the endpoint is under heavy load and needs to + * temporarily reject new sessions while it catches up. + * @since v23.8.0 + */ + busy: boolean; + /** + * Gracefully close the endpoint. The endpoint will close and destroy itself when + * all currently open sessions close. Once called, new sessions will be rejected. + * + * Returns a promise that is fulfilled when the endpoint is destroyed. + * @since v23.8.0 + */ + close(): Promise; + /** + * A promise that is fulfilled when the endpoint is destroyed. This will be the same promise that is + * returned by the `endpoint.close()` function. Read only. + * @since v23.8.0 + */ + readonly closed: Promise; + /** + * True if `endpoint.close()` has been called and closing the endpoint has not yet completed. + * Read only. + * @since v23.8.0 + */ + readonly closing: boolean; + /** + * Forcefully closes the endpoint by forcing all open sessions to be immediately + * closed. + * @since v23.8.0 + */ + destroy(error?: any): void; + /** + * True if `endpoint.destroy()` has been called. Read only. + * @since v23.8.0 + */ + readonly destroyed: boolean; + /** + * The statistics collected for an active session. Read only. + * @since v23.8.0 + */ + readonly stats: QuicEndpoint.Stats; + /** + * Calls `endpoint.close()` and returns a promise that fulfills when the + * endpoint has closed. + * @since v23.8.0 + */ + [Symbol.asyncDispose](): Promise; + } + namespace QuicEndpoint { + /** + * A view of the collected statistics for an endpoint. + * @since v23.8.0 + */ + class Stats { + private constructor(); + /** + * A timestamp indicating the moment the endpoint was created. Read only. + * @since v23.8.0 + */ + readonly createdAt: bigint; + /** + * A timestamp indicating the moment the endpoint was destroyed. Read only. + * @since v23.8.0 + */ + readonly destroyedAt: bigint; + /** + * The total number of bytes received by this endpoint. Read only. + * @since v23.8.0 + */ + readonly bytesReceived: bigint; + /** + * The total number of bytes sent by this endpoint. Read only. + * @since v23.8.0 + */ + readonly bytesSent: bigint; + /** + * The total number of QUIC packets successfully received by this endpoint. Read only. + * @since v23.8.0 + */ + readonly packetsReceived: bigint; + /** + * The total number of QUIC packets successfully sent by this endpoint. Read only. + * @since v23.8.0 + */ + readonly packetsSent: bigint; + /** + * The total number of peer-initiated sessions received by this endpoint. Read only. + * @since v23.8.0 + */ + readonly serverSessions: bigint; + /** + * The total number of sessions initiated by this endpoint. Read only. + * @since v23.8.0 + */ + readonly clientSessions: bigint; + /** + * The total number of times an initial packet was rejected due to the + * endpoint being marked busy. Read only. + * @since v23.8.0 + */ + readonly serverBusyCount: bigint; + /** + * The total number of QUIC retry attempts on this endpoint. Read only. + * @since v23.8.0 + */ + readonly retryCount: bigint; + /** + * The total number sessions rejected due to QUIC version mismatch. Read only. + * @since v23.8.0 + */ + readonly versionNegotiationCount: bigint; + /** + * The total number of stateless resets handled by this endpoint. Read only. + * @since v23.8.0 + */ + readonly statelessResetCount: bigint; + /** + * The total number of sessions that were closed before handshake completed. Read only. + * @since v23.8.0 + */ + readonly immediateCloseCount: bigint; + } + } + interface CreateStreamOptions { + body?: ArrayBuffer | NodeJS.ArrayBufferView | Blob | undefined; + sendOrder?: number | undefined; + } + interface SessionPath { + local: SocketAddress; + remote: SocketAddress; + } + /** + * A `QuicSession` represents the local side of a QUIC connection. + * @since v23.8.0 + */ + class QuicSession implements AsyncDisposable { + private constructor(); + /** + * Initiate a graceful close of the session. Existing streams will be allowed + * to complete but no new streams will be opened. Once all streams have closed, + * the session will be destroyed. The returned promise will be fulfilled once + * the session has been destroyed. + * @since v23.8.0 + */ + close(): Promise; + /** + * A promise that is fulfilled once the session is destroyed. + * @since v23.8.0 + */ + readonly closed: Promise; + /** + * Immediately destroy the session. All streams will be destroys and the + * session will be closed. + * @since v23.8.0 + */ + destroy(error?: any): void; + /** + * True if `session.destroy()` has been called. Read only. + * @since v23.8.0 + */ + readonly destroyed: boolean; + /** + * The endpoint that created this session. Read only. + * @since v23.8.0 + */ + readonly endpoint: QuicEndpoint; + /** + * The callback to invoke when a new stream is initiated by a remote peer. Read/write. + * @since v23.8.0 + */ + onstream: OnStreamCallback | undefined; + /** + * The callback to invoke when a new datagram is received from a remote peer. Read/write. + * @since v23.8.0 + */ + ondatagram: OnDatagramCallback | undefined; + /** + * The callback to invoke when the status of a datagram is updated. Read/write. + * @since v23.8.0 + */ + ondatagramstatus: OnDatagramStatusCallback | undefined; + /** + * The callback to invoke when the path validation is updated. Read/write. + * @since v23.8.0 + */ + onpathvalidation: OnPathValidationCallback | undefined; + /** + * The callback to invoke when a new session ticket is received. Read/write. + * @since v23.8.0 + */ + onsessionticket: OnSessionTicketCallback | undefined; + /** + * The callback to invoke when a version negotiation is initiated. Read/write. + * @since v23.8.0 + */ + onversionnegotiation: OnVersionNegotiationCallback | undefined; + /** + * The callback to invoke when the TLS handshake is completed. Read/write. + * @since v23.8.0 + */ + onhandshake: OnHandshakeCallback | undefined; + /** + * Open a new bidirectional stream. If the `body` option is not specified, + * the outgoing stream will be half-closed. + * @since v23.8.0 + */ + createBidirectionalStream(options?: CreateStreamOptions): Promise; + /** + * Open a new unidirectional stream. If the `body` option is not specified, + * the outgoing stream will be closed. + * @since v23.8.0 + */ + createUnidirectionalStream(options?: CreateStreamOptions): Promise; + /** + * The local and remote socket addresses associated with the session. Read only. + * @since v23.8.0 + */ + path: SessionPath | undefined; + /** + * Sends an unreliable datagram to the remote peer, returning the datagram ID. + * If the datagram payload is specified as an `ArrayBufferView`, then ownership of + * that view will be transfered to the underlying stream. + * @since v23.8.0 + */ + sendDatagram(datagram: string | NodeJS.ArrayBufferView): bigint; + /** + * Return the current statistics for the session. Read only. + * @since v23.8.0 + */ + readonly stats: QuicSession.Stats; + /** + * Initiate a key update for the session. + * @since v23.8.0 + */ + updateKey(): void; + /** + * Calls `session.close()` and returns a promise that fulfills when the + * session has closed. + * @since v23.8.0 + */ + [Symbol.asyncDispose](): Promise; + } + namespace QuicSession { + /** + * @since v23.8.0 + */ + class Stats { + private constructor(); + /** + * @since v23.8.0 + */ + readonly createdAt: bigint; + /** + * @since v23.8.0 + */ + readonly closingAt: bigint; + /** + * @since v23.8.0 + */ + readonly handshakeCompletedAt: bigint; + /** + * @since v23.8.0 + */ + readonly handshakeConfirmedAt: bigint; + /** + * @since v23.8.0 + */ + readonly bytesReceived: bigint; + /** + * @since v23.8.0 + */ + readonly bytesSent: bigint; + /** + * @since v23.8.0 + */ + readonly bidiInStreamCount: bigint; + /** + * @since v23.8.0 + */ + readonly bidiOutStreamCount: bigint; + /** + * @since v23.8.0 + */ + readonly uniInStreamCount: bigint; + /** + * @since v23.8.0 + */ + readonly uniOutStreamCount: bigint; + /** + * @since v23.8.0 + */ + readonly maxBytesInFlights: bigint; + /** + * @since v23.8.0 + */ + readonly bytesInFlight: bigint; + /** + * @since v23.8.0 + */ + readonly blockCount: bigint; + /** + * @since v23.8.0 + */ + readonly cwnd: bigint; + /** + * @since v23.8.0 + */ + readonly latestRtt: bigint; + /** + * @since v23.8.0 + */ + readonly minRtt: bigint; + /** + * @since v23.8.0 + */ + readonly rttVar: bigint; + /** + * @since v23.8.0 + */ + readonly smoothedRtt: bigint; + /** + * @since v23.8.0 + */ + readonly ssthresh: bigint; + /** + * @since v23.8.0 + */ + readonly datagramsReceived: bigint; + /** + * @since v23.8.0 + */ + readonly datagramsSent: bigint; + /** + * @since v23.8.0 + */ + readonly datagramsAcknowledged: bigint; + /** + * @since v23.8.0 + */ + readonly datagramsLost: bigint; + } + } + /** + * @since v23.8.0 + */ + class QuicStream { + private constructor(); + /** + * A promise that is fulfilled when the stream is fully closed. + * @since v23.8.0 + */ + readonly closed: Promise; + /** + * Immediately and abruptly destroys the stream. + * @since v23.8.0 + */ + destroy(error?: any): void; + /** + * True if `stream.destroy()` has been called. + * @since v23.8.0 + */ + readonly destroyed: boolean; + /** + * The directionality of the stream. Read only. + * @since v23.8.0 + */ + readonly direction: "bidi" | "uni"; + /** + * The stream ID. Read only. + * @since v23.8.0 + */ + readonly id: bigint; + /** + * The callback to invoke when the stream is blocked. Read/write. + * @since v23.8.0 + */ + onblocked: OnBlockedCallback | undefined; + /** + * The callback to invoke when the stream is reset. Read/write. + * @since v23.8.0 + */ + onreset: OnStreamErrorCallback | undefined; + /** + * @since v23.8.0 + */ + readonly readable: ReadableStream; + /** + * The session that created this stream. Read only. + * @since v23.8.0 + */ + readonly session: QuicSession; + /** + * The current statistics for the stream. Read only. + * @since v23.8.0 + */ + readonly stats: QuicStream.Stats; + } + namespace QuicStream { + /** + * @since v23.8.0 + */ + class Stats { + private constructor(); + /** + * @since v23.8.0 + */ + readonly ackedAt: bigint; + /** + * @since v23.8.0 + */ + readonly bytesReceived: bigint; + /** + * @since v23.8.0 + */ + readonly bytesSent: bigint; + /** + * @since v23.8.0 + */ + readonly createdAt: bigint; + /** + * @since v23.8.0 + */ + readonly destroyedAt: bigint; + /** + * @since v23.8.0 + */ + readonly finalSize: bigint; + /** + * @since v23.8.0 + */ + readonly isConnected: bigint; + /** + * @since v23.8.0 + */ + readonly maxOffset: bigint; + /** + * @since v23.8.0 + */ + readonly maxOffsetAcknowledged: bigint; + /** + * @since v23.8.0 + */ + readonly maxOffsetReceived: bigint; + /** + * @since v23.8.0 + */ + readonly openedAt: bigint; + /** + * @since v23.8.0 + */ + readonly receivedAt: bigint; + } + } + namespace constants { + enum cc { + RENO = "reno", + CUBIC = "cubic", + BBR = "bbr", + } + const DEFAULT_CIPHERS: string; + const DEFAULT_GROUPS: string; + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/readline.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/readline.d.ts new file mode 100644 index 0000000..9e3714f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/readline.d.ts @@ -0,0 +1,542 @@ +/** + * The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-v25.x/api/stream.html#readable-streams) stream + * (such as [`process.stdin`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstdin)) one line at a time. + * + * To use the promise-based APIs: + * + * ```js + * import * as readline from 'node:readline/promises'; + * ``` + * + * To use the callback and sync APIs: + * + * ```js + * import * as readline from 'node:readline'; + * ``` + * + * The following simple example illustrates the basic use of the `node:readline` module. + * + * ```js + * import * as readline from 'node:readline/promises'; + * import { stdin as input, stdout as output } from 'node:process'; + * + * const rl = readline.createInterface({ input, output }); + * + * const answer = await rl.question('What do you think of Node.js? '); + * + * console.log(`Thank you for your valuable feedback: ${answer}`); + * + * rl.close(); + * ``` + * + * Once this code is invoked, the Node.js application will not terminate until the `readline.Interface` is closed because the interface waits for data to be + * received on the `input` stream. + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/readline.js) + */ +declare module "node:readline" { + import { Abortable, EventEmitter, InternalEventEmitter } from "node:events"; + interface Key { + sequence?: string | undefined; + name?: string | undefined; + ctrl?: boolean | undefined; + meta?: boolean | undefined; + shift?: boolean | undefined; + } + interface InterfaceEventMap { + "close": []; + "error": [error: Error]; + "history": [history: string[]]; + "line": [input: string]; + "pause": []; + "resume": []; + "SIGCONT": []; + "SIGINT": []; + "SIGTSTP": []; + } + /** + * Instances of the `readline.Interface` class are constructed using the `readline.createInterface()` method. Every instance is associated with a + * single `input` [Readable](https://nodejs.org/docs/latest-v25.x/api/stream.html#readable-streams) stream and a single `output` [Writable](https://nodejs.org/docs/latest-v25.x/api/stream.html#writable-streams) stream. + * The `output` stream is used to print prompts for user input that arrives on, + * and is read from, the `input` stream. + * @since v0.1.104 + */ + class Interface implements EventEmitter, Disposable { + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v25.x/docs/api/readline.html#class-interfaceconstructor + */ + protected constructor( + input: NodeJS.ReadableStream, + output?: NodeJS.WritableStream, + completer?: Completer | AsyncCompleter, + terminal?: boolean, + ); + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v25.x/docs/api/readline.html#class-interfaceconstructor + */ + protected constructor(options: ReadLineOptions); + readonly terminal: boolean; + /** + * The current input data being processed by node. + * + * This can be used when collecting input from a TTY stream to retrieve the + * current value that has been processed thus far, prior to the `line` event + * being emitted. Once the `line` event has been emitted, this property will + * be an empty string. + * + * Be aware that modifying the value during the instance runtime may have + * unintended consequences if `rl.cursor` is not also controlled. + * + * **If not using a TTY stream for input, use the `'line'` event.** + * + * One possible use case would be as follows: + * + * ```js + * const values = ['lorem ipsum', 'dolor sit amet']; + * const rl = readline.createInterface(process.stdin); + * const showResults = debounce(() => { + * console.log( + * '\n', + * values.filter((val) => val.startsWith(rl.line)).join(' '), + * ); + * }, 300); + * process.stdin.on('keypress', (c, k) => { + * showResults(); + * }); + * ``` + * @since v0.1.98 + */ + readonly line: string; + /** + * The cursor position relative to `rl.line`. + * + * This will track where the current cursor lands in the input string, when + * reading input from a TTY stream. The position of cursor determines the + * portion of the input string that will be modified as input is processed, + * as well as the column where the terminal caret will be rendered. + * @since v0.1.98 + */ + readonly cursor: number; + /** + * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. + * @since v15.3.0, v14.17.0 + * @return the current prompt string + */ + getPrompt(): string; + /** + * The `rl.setPrompt()` method sets the prompt that will be written to `output` whenever `rl.prompt()` is called. + * @since v0.1.98 + */ + setPrompt(prompt: string): void; + /** + * The `rl.prompt()` method writes the `Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new + * location at which to provide input. + * + * When called, `rl.prompt()` will resume the `input` stream if it has been + * paused. + * + * If the `Interface` was created with `output` set to `null` or `undefined` the prompt is not written. + * @since v0.1.98 + * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. + */ + prompt(preserveCursor?: boolean): void; + /** + * The `rl.question()` method displays the `query` by writing it to the `output`, + * waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument. + * + * When called, `rl.question()` will resume the `input` stream if it has been + * paused. + * + * If the `Interface` was created with `output` set to `null` or `undefined` the `query` is not written. + * + * The `callback` function passed to `rl.question()` does not follow the typical + * pattern of accepting an `Error` object or `null` as the first argument. + * The `callback` is called with the provided answer as the only argument. + * + * An error will be thrown if calling `rl.question()` after `rl.close()`. + * + * Example usage: + * + * ```js + * rl.question('What is your favorite food? ', (answer) => { + * console.log(`Oh, so your favorite food is ${answer}`); + * }); + * ``` + * + * Using an `AbortController` to cancel a question. + * + * ```js + * const ac = new AbortController(); + * const signal = ac.signal; + * + * rl.question('What is your favorite food? ', { signal }, (answer) => { + * console.log(`Oh, so your favorite food is ${answer}`); + * }); + * + * signal.addEventListener('abort', () => { + * console.log('The food question timed out'); + * }, { once: true }); + * + * setTimeout(() => ac.abort(), 10000); + * ``` + * @since v0.3.3 + * @param query A statement or query to write to `output`, prepended to the prompt. + * @param callback A callback function that is invoked with the user's input in response to the `query`. + */ + question(query: string, callback: (answer: string) => void): void; + question(query: string, options: Abortable, callback: (answer: string) => void): void; + /** + * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed + * later if necessary. + * + * Calling `rl.pause()` does not immediately pause other events (including `'line'`) from being emitted by the `Interface` instance. + * @since v0.3.4 + */ + pause(): this; + /** + * The `rl.resume()` method resumes the `input` stream if it has been paused. + * @since v0.3.4 + */ + resume(): this; + /** + * The `rl.close()` method closes the `Interface` instance and + * relinquishes control over the `input` and `output` streams. When called, + * the `'close'` event will be emitted. + * + * Calling `rl.close()` does not immediately stop other events (including `'line'`) + * from being emitted by the `Interface` instance. + * @since v0.1.98 + */ + close(): void; + /** + * Alias for `rl.close()`. + * @since v22.15.0 + */ + [Symbol.dispose](): void; + /** + * The `rl.write()` method will write either `data` or a key sequence identified + * by `key` to the `output`. The `key` argument is supported only if `output` is + * a `TTY` text terminal. See `TTY keybindings` for a list of key + * combinations. + * + * If `key` is specified, `data` is ignored. + * + * When called, `rl.write()` will resume the `input` stream if it has been + * paused. + * + * If the `Interface` was created with `output` set to `null` or `undefined` the `data` and `key` are not written. + * + * ```js + * rl.write('Delete this!'); + * // Simulate Ctrl+U to delete the line written previously + * rl.write(null, { ctrl: true, name: 'u' }); + * ``` + * + * The `rl.write()` method will write the data to the `readline` `Interface`'s `input` _as if it were provided by the user_. + * @since v0.1.98 + */ + write(data: string | Buffer, key?: Key): void; + write(data: undefined | null | string | Buffer, key: Key): void; + /** + * Returns the real position of the cursor in relation to the input + * prompt + string. Long input (wrapping) strings, as well as multiple + * line prompts are included in the calculations. + * @since v13.5.0, v12.16.0 + */ + getCursorPos(): CursorPos; + [Symbol.asyncIterator](): NodeJS.AsyncIterator; + } + interface Interface extends InternalEventEmitter {} + type ReadLine = Interface; // type forwarded for backwards compatibility + type Completer = (line: string) => CompleterResult; + type AsyncCompleter = ( + line: string, + callback: (err?: null | Error, result?: CompleterResult) => void, + ) => void; + type CompleterResult = [string[], string]; + interface ReadLineOptions { + /** + * The [`Readable`](https://nodejs.org/docs/latest-v25.x/api/stream.html#readable-streams) stream to listen to + */ + input: NodeJS.ReadableStream; + /** + * The [`Writable`](https://nodejs.org/docs/latest-v25.x/api/stream.html#writable-streams) stream to write readline data to. + */ + output?: NodeJS.WritableStream | undefined; + /** + * An optional function used for Tab autocompletion. + */ + completer?: Completer | AsyncCompleter | undefined; + /** + * `true` if the `input` and `output` streams should be treated like a TTY, + * and have ANSI/VT100 escape codes written to it. + * Default: checking `isTTY` on the `output` stream upon instantiation. + */ + terminal?: boolean | undefined; + /** + * Initial list of history lines. + * This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, + * otherwise the history caching mechanism is not initialized at all. + * @default [] + */ + history?: string[] | undefined; + /** + * Maximum number of history lines retained. + * To disable the history set this value to `0`. + * This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, + * otherwise the history caching mechanism is not initialized at all. + * @default 30 + */ + historySize?: number | undefined; + /** + * If `true`, when a new input line added to the history list duplicates an older one, + * this removes the older line from the list. + * @default false + */ + removeHistoryDuplicates?: boolean | undefined; + /** + * The prompt string to use. + * @default "> " + */ + prompt?: string | undefined; + /** + * If the delay between `\r` and `\n` exceeds `crlfDelay` milliseconds, + * both `\r` and `\n` will be treated as separate end-of-line input. + * `crlfDelay` will be coerced to a number no less than `100`. + * It can be set to `Infinity`, in which case + * `\r` followed by `\n` will always be considered a single newline + * (which may be reasonable for [reading files](https://nodejs.org/docs/latest-v25.x/api/readline.html#example-read-file-stream-line-by-line) with `\r\n` line delimiter). + * @default 100 + */ + crlfDelay?: number | undefined; + /** + * The duration `readline` will wait for a character + * (when reading an ambiguous key sequence in milliseconds + * one that can both form a complete key sequence using the input read so far + * and can take additional input to complete a longer key sequence). + * @default 500 + */ + escapeCodeTimeout?: number | undefined; + /** + * The number of spaces a tab is equal to (minimum 1). + * @default 8 + */ + tabSize?: number | undefined; + /** + * Allows closing the interface using an AbortSignal. + * Aborting the signal will internally call `close` on the interface. + */ + signal?: AbortSignal | undefined; + } + /** + * The `readline.createInterface()` method creates a new `readline.Interface` instance. + * + * ```js + * import readline from 'node:readline'; + * const rl = readline.createInterface({ + * input: process.stdin, + * output: process.stdout, + * }); + * ``` + * + * Once the `readline.Interface` instance is created, the most common case is to + * listen for the `'line'` event: + * + * ```js + * rl.on('line', (line) => { + * console.log(`Received: ${line}`); + * }); + * ``` + * + * If `terminal` is `true` for this instance then the `output` stream will get + * the best compatibility if it defines an `output.columns` property and emits + * a `'resize'` event on the `output` if or when the columns ever change + * (`process.stdout` does this automatically when it is a TTY). + * + * When creating a `readline.Interface` using `stdin` as input, the program + * will not terminate until it receives an [EOF character](https://en.wikipedia.org/wiki/End-of-file#EOF_character). To exit without + * waiting for user input, call `process.stdin.unref()`. + * @since v0.1.98 + */ + function createInterface( + input: NodeJS.ReadableStream, + output?: NodeJS.WritableStream, + completer?: Completer | AsyncCompleter, + terminal?: boolean, + ): Interface; + function createInterface(options: ReadLineOptions): Interface; + /** + * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. + * + * Optionally, `interface` specifies a `readline.Interface` instance for which + * autocompletion is disabled when copy-pasted input is detected. + * + * If the `stream` is a `TTY`, then it must be in raw mode. + * + * This is automatically called by any readline instance on its `input` if the `input` is a terminal. Closing the `readline` instance does not stop + * the `input` from emitting `'keypress'` events. + * + * ```js + * readline.emitKeypressEvents(process.stdin); + * if (process.stdin.isTTY) + * process.stdin.setRawMode(true); + * ``` + * + * ## Example: Tiny CLI + * + * The following example illustrates the use of `readline.Interface` class to + * implement a small command-line interface: + * + * ```js + * import readline from 'node:readline'; + * const rl = readline.createInterface({ + * input: process.stdin, + * output: process.stdout, + * prompt: 'OHAI> ', + * }); + * + * rl.prompt(); + * + * rl.on('line', (line) => { + * switch (line.trim()) { + * case 'hello': + * console.log('world!'); + * break; + * default: + * console.log(`Say what? I might have heard '${line.trim()}'`); + * break; + * } + * rl.prompt(); + * }).on('close', () => { + * console.log('Have a great day!'); + * process.exit(0); + * }); + * ``` + * + * ## Example: Read file stream line-by-Line + * + * A common use case for `readline` is to consume an input file one line at a + * time. The easiest way to do so is leveraging the `fs.ReadStream` API as + * well as a `for await...of` loop: + * + * ```js + * import fs from 'node:fs'; + * import readline from 'node:readline'; + * + * async function processLineByLine() { + * const fileStream = fs.createReadStream('input.txt'); + * + * const rl = readline.createInterface({ + * input: fileStream, + * crlfDelay: Infinity, + * }); + * // Note: we use the crlfDelay option to recognize all instances of CR LF + * // ('\r\n') in input.txt as a single line break. + * + * for await (const line of rl) { + * // Each line in input.txt will be successively available here as `line`. + * console.log(`Line from file: ${line}`); + * } + * } + * + * processLineByLine(); + * ``` + * + * Alternatively, one could use the `'line'` event: + * + * ```js + * import fs from 'node:fs'; + * import readline from 'node:readline'; + * + * const rl = readline.createInterface({ + * input: fs.createReadStream('sample.txt'), + * crlfDelay: Infinity, + * }); + * + * rl.on('line', (line) => { + * console.log(`Line from file: ${line}`); + * }); + * ``` + * + * Currently, `for await...of` loop can be a bit slower. If `async` / `await` flow and speed are both essential, a mixed approach can be applied: + * + * ```js + * import { once } from 'node:events'; + * import { createReadStream } from 'node:fs'; + * import { createInterface } from 'node:readline'; + * + * (async function processLineByLine() { + * try { + * const rl = createInterface({ + * input: createReadStream('big-file.txt'), + * crlfDelay: Infinity, + * }); + * + * rl.on('line', (line) => { + * // Process the line. + * }); + * + * await once(rl, 'close'); + * + * console.log('File processed.'); + * } catch (err) { + * console.error(err); + * } + * })(); + * ``` + * @since v0.7.7 + */ + function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; + type Direction = -1 | 0 | 1; + interface CursorPos { + rows: number; + cols: number; + } + /** + * The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) stream + * in a specified direction identified by `dir`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; + /** + * The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) stream from + * the current position of the cursor down. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; + /** + * The `readline.cursorTo()` method moves cursor to the specified position in a + * given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) `stream`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; + /** + * The `readline.moveCursor()` method moves the cursor _relative_ to its current + * position in a given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) `stream`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; +} +declare module "node:readline" { + export * as promises from "node:readline/promises"; +} +declare module "readline" { + export * from "node:readline"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/readline/promises.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/readline/promises.d.ts new file mode 100644 index 0000000..f449e1b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/readline/promises.d.ts @@ -0,0 +1,161 @@ +/** + * @since v17.0.0 + */ +declare module "node:readline/promises" { + import { Abortable } from "node:events"; + import { + CompleterResult, + Direction, + Interface as _Interface, + ReadLineOptions as _ReadLineOptions, + } from "node:readline"; + /** + * Instances of the `readlinePromises.Interface` class are constructed using the `readlinePromises.createInterface()` method. Every instance is associated with a + * single `input` `Readable` stream and a single `output` `Writable` stream. + * The `output` stream is used to print prompts for user input that arrives on, + * and is read from, the `input` stream. + * @since v17.0.0 + */ + class Interface extends _Interface { + /** + * The `rl.question()` method displays the `query` by writing it to the `output`, + * waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument. + * + * When called, `rl.question()` will resume the `input` stream if it has been + * paused. + * + * If the `Interface` was created with `output` set to `null` or `undefined` the `query` is not written. + * + * If the question is called after `rl.close()`, it returns a rejected promise. + * + * Example usage: + * + * ```js + * const answer = await rl.question('What is your favorite food? '); + * console.log(`Oh, so your favorite food is ${answer}`); + * ``` + * + * Using an `AbortSignal` to cancel a question. + * + * ```js + * const signal = AbortSignal.timeout(10_000); + * + * signal.addEventListener('abort', () => { + * console.log('The food question timed out'); + * }, { once: true }); + * + * const answer = await rl.question('What is your favorite food? ', { signal }); + * console.log(`Oh, so your favorite food is ${answer}`); + * ``` + * @since v17.0.0 + * @param query A statement or query to write to `output`, prepended to the prompt. + * @return A promise that is fulfilled with the user's input in response to the `query`. + */ + question(query: string): Promise; + question(query: string, options: Abortable): Promise; + } + /** + * @since v17.0.0 + */ + class Readline { + /** + * @param stream A TTY stream. + */ + constructor( + stream: NodeJS.WritableStream, + options?: { + autoCommit?: boolean | undefined; + }, + ); + /** + * The `rl.clearLine()` method adds to the internal list of pending action an + * action that clears current line of the associated `stream` in a specified + * direction identified by `dir`. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. + * @since v17.0.0 + * @return this + */ + clearLine(dir: Direction): this; + /** + * The `rl.clearScreenDown()` method adds to the internal list of pending action an + * action that clears the associated stream from the current position of the + * cursor down. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. + * @since v17.0.0 + * @return this + */ + clearScreenDown(): this; + /** + * The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions. + * @since v17.0.0 + */ + commit(): Promise; + /** + * The `rl.cursorTo()` method adds to the internal list of pending action an action + * that moves cursor to the specified position in the associated `stream`. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. + * @since v17.0.0 + * @return this + */ + cursorTo(x: number, y?: number): this; + /** + * The `rl.moveCursor()` method adds to the internal list of pending action an + * action that moves the cursor _relative_ to its current position in the + * associated `stream`. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. + * @since v17.0.0 + * @return this + */ + moveCursor(dx: number, dy: number): this; + /** + * The `rl.rollback` methods clears the internal list of pending actions without + * sending it to the associated `stream`. + * @since v17.0.0 + * @return this + */ + rollback(): this; + } + type Completer = (line: string) => CompleterResult | Promise; + interface ReadLineOptions extends Omit<_ReadLineOptions, "completer"> { + /** + * An optional function used for Tab autocompletion. + */ + completer?: Completer | undefined; + } + /** + * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance. + * + * ```js + * import readlinePromises from 'node:readline/promises'; + * const rl = readlinePromises.createInterface({ + * input: process.stdin, + * output: process.stdout, + * }); + * ``` + * + * Once the `readlinePromises.Interface` instance is created, the most common case + * is to listen for the `'line'` event: + * + * ```js + * rl.on('line', (line) => { + * console.log(`Received: ${line}`); + * }); + * ``` + * + * If `terminal` is `true` for this instance then the `output` stream will get + * the best compatibility if it defines an `output.columns` property and emits + * a `'resize'` event on the `output` if or when the columns ever change + * (`process.stdout` does this automatically when it is a TTY). + * @since v17.0.0 + */ + function createInterface( + input: NodeJS.ReadableStream, + output?: NodeJS.WritableStream, + completer?: Completer, + terminal?: boolean, + ): Interface; + function createInterface(options: ReadLineOptions): Interface; +} +declare module "readline/promises" { + export * from "node:readline/promises"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/repl.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/repl.d.ts new file mode 100644 index 0000000..2d06294 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/repl.d.ts @@ -0,0 +1,415 @@ +/** + * The `node:repl` module provides a Read-Eval-Print-Loop (REPL) implementation + * that is available both as a standalone program or includible in other + * applications. It can be accessed using: + * + * ```js + * import repl from 'node:repl'; + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/repl.js) + */ +declare module "node:repl" { + import { AsyncCompleter, Completer, Interface, InterfaceEventMap } from "node:readline"; + import { InspectOptions } from "node:util"; + import { Context } from "node:vm"; + interface ReplOptions { + /** + * The input prompt to display. + * @default "> " + */ + prompt?: string | undefined; + /** + * The `Readable` stream from which REPL input will be read. + * @default process.stdin + */ + input?: NodeJS.ReadableStream | undefined; + /** + * The `Writable` stream to which REPL output will be written. + * @default process.stdout + */ + output?: NodeJS.WritableStream | undefined; + /** + * If `true`, specifies that the output should be treated as a TTY terminal, and have + * ANSI/VT100 escape codes written to it. + * Default: checking the value of the `isTTY` property on the output stream upon + * instantiation. + */ + terminal?: boolean | undefined; + /** + * The function to be used when evaluating each given line of input. + * **Default:** an async wrapper for the JavaScript `eval()` function. An `eval` function can + * error with `repl.Recoverable` to indicate the input was incomplete and prompt for + * additional lines. See the [custom evaluation functions](https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#custom-evaluation-functions) + * section for more details. + */ + eval?: REPLEval | undefined; + /** + * Defines if the repl prints output previews or not. + * @default `true` Always `false` in case `terminal` is falsy. + */ + preview?: boolean | undefined; + /** + * If `true`, specifies that the default `writer` function should include ANSI color + * styling to REPL output. If a custom `writer` function is provided then this has no + * effect. + * @default the REPL instance's `terminal` value + */ + useColors?: boolean | undefined; + /** + * If `true`, specifies that the default evaluation function will use the JavaScript + * `global` as the context as opposed to creating a new separate context for the REPL + * instance. The node CLI REPL sets this value to `true`. + * @default false + */ + useGlobal?: boolean | undefined; + /** + * If `true`, specifies that the default writer will not output the return value of a + * command if it evaluates to `undefined`. + * @default false + */ + ignoreUndefined?: boolean | undefined; + /** + * The function to invoke to format the output of each command before writing to `output`. + * @default a wrapper for `util.inspect` + * + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_customizing_repl_output + */ + writer?: REPLWriter | undefined; + /** + * An optional function used for custom Tab auto completion. + * + * @see https://nodejs.org/dist/latest-v25.x/docs/api/readline.html#readline_use_of_the_completer_function + */ + completer?: Completer | AsyncCompleter | undefined; + /** + * A flag that specifies whether the default evaluator executes all JavaScript commands in + * strict mode or default (sloppy) mode. + * Accepted values are: + * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. + * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to + * prefacing every repl statement with `'use strict'`. + */ + replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined; + /** + * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is + * pressed. This cannot be used together with a custom `eval` function. + * @default false + */ + breakEvalOnSigint?: boolean | undefined; + } + type REPLEval = ( + this: REPLServer, + evalCmd: string, + context: Context, + file: string, + cb: (err: Error | null, result: any) => void, + ) => void; + type REPLWriter = (this: REPLServer, obj: any) => string; + /** + * This is the default "writer" value, if none is passed in the REPL options, + * and it can be overridden by custom print functions. + */ + const writer: REPLWriter & { + options: InspectOptions; + }; + type REPLCommandAction = (this: REPLServer, text: string) => void; + interface REPLCommand { + /** + * Help text to be displayed when `.help` is entered. + */ + help?: string | undefined; + /** + * The function to execute, optionally accepting a single string argument. + */ + action: REPLCommandAction; + } + interface REPLServerSetupHistoryOptions { + filePath?: string | undefined; + size?: number | undefined; + removeHistoryDuplicates?: boolean | undefined; + onHistoryFileLoaded?: ((err: Error | null, repl: REPLServer) => void) | undefined; + } + interface REPLServerEventMap extends InterfaceEventMap { + "exit": []; + "reset": [context: Context]; + } + /** + * Instances of `repl.REPLServer` are created using the {@link start} method + * or directly using the JavaScript `new` keyword. + * + * ```js + * import repl from 'node:repl'; + * + * const options = { useColors: true }; + * + * const firstInstance = repl.start(options); + * const secondInstance = new repl.REPLServer(options); + * ``` + * @since v0.1.91 + */ + class REPLServer extends Interface { + /** + * NOTE: According to the documentation: + * + * > Instances of `repl.REPLServer` are created using the `repl.start()` method and + * > _should not_ be created directly using the JavaScript `new` keyword. + * + * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. + * + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_class_replserver + */ + private constructor(); + /** + * The `vm.Context` provided to the `eval` function to be used for JavaScript + * evaluation. + */ + readonly context: Context; + /** + * @deprecated since v14.3.0 - Use `input` instead. + */ + readonly inputStream: NodeJS.ReadableStream; + /** + * @deprecated since v14.3.0 - Use `output` instead. + */ + readonly outputStream: NodeJS.WritableStream; + /** + * The `Readable` stream from which REPL input will be read. + */ + readonly input: NodeJS.ReadableStream; + /** + * The `Writable` stream to which REPL output will be written. + */ + readonly output: NodeJS.WritableStream; + /** + * The commands registered via `replServer.defineCommand()`. + */ + readonly commands: NodeJS.ReadOnlyDict; + /** + * A value indicating whether the REPL is currently in "editor mode". + * + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_commands_and_special_keys + */ + readonly editorMode: boolean; + /** + * A value indicating whether the `_` variable has been assigned. + * + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly underscoreAssigned: boolean; + /** + * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). + * + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly last: any; + /** + * A value indicating whether the `_error` variable has been assigned. + * + * @since v9.8.0 + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly underscoreErrAssigned: boolean; + /** + * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). + * + * @since v9.8.0 + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly lastError: any; + /** + * Specified in the REPL options, this is the function to be used when evaluating each + * given line of input. If not specified in the REPL options, this is an async wrapper + * for the JavaScript `eval()` function. + */ + readonly eval: REPLEval; + /** + * Specified in the REPL options, this is a value indicating whether the default + * `writer` function should include ANSI color styling to REPL output. + */ + readonly useColors: boolean; + /** + * Specified in the REPL options, this is a value indicating whether the default `eval` + * function will use the JavaScript `global` as the context as opposed to creating a new + * separate context for the REPL instance. + */ + readonly useGlobal: boolean; + /** + * Specified in the REPL options, this is a value indicating whether the default `writer` + * function should output the result of a command if it evaluates to `undefined`. + */ + readonly ignoreUndefined: boolean; + /** + * Specified in the REPL options, this is the function to invoke to format the output of + * each command before writing to `outputStream`. If not specified in the REPL options, + * this will be a wrapper for `util.inspect`. + */ + readonly writer: REPLWriter; + /** + * Specified in the REPL options, this is the function to use for custom Tab auto-completion. + */ + readonly completer: Completer | AsyncCompleter; + /** + * Specified in the REPL options, this is a flag that specifies whether the default `eval` + * function should execute all JavaScript commands in strict mode or default (sloppy) mode. + * Possible values are: + * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. + * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to + * prefacing every repl statement with `'use strict'`. + */ + readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; + /** + * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands + * to the REPL instance. Such commands are invoked by typing a `.` followed by the `keyword`. The `cmd` is either a `Function` or an `Object` with the following + * properties: + * + * The following example shows two new commands added to the REPL instance: + * + * ```js + * import repl from 'node:repl'; + * + * const replServer = repl.start({ prompt: '> ' }); + * replServer.defineCommand('sayhello', { + * help: 'Say hello', + * action(name) { + * this.clearBufferedCommand(); + * console.log(`Hello, ${name}!`); + * this.displayPrompt(); + * }, + * }); + * replServer.defineCommand('saybye', function saybye() { + * console.log('Goodbye!'); + * this.close(); + * }); + * ``` + * + * The new commands can then be used from within the REPL instance: + * + * ```console + * > .sayhello Node.js User + * Hello, Node.js User! + * > .saybye + * Goodbye! + * ``` + * @since v0.3.0 + * @param keyword The command keyword (_without_ a leading `.` character). + * @param cmd The function to invoke when the command is processed. + */ + defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; + /** + * The `replServer.displayPrompt()` method readies the REPL instance for input + * from the user, printing the configured `prompt` to a new line in the `output` and resuming the `input` to accept new input. + * + * When multi-line input is being entered, a pipe `'|'` is printed rather than the + * 'prompt'. + * + * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. + * + * The `replServer.displayPrompt` method is primarily intended to be called from + * within the action function for commands registered using the `replServer.defineCommand()` method. + * @since v0.1.91 + */ + displayPrompt(preserveCursor?: boolean): void; + /** + * The `replServer.clearBufferedCommand()` method clears any command that has been + * buffered but not yet executed. This method is primarily intended to be + * called from within the action function for commands registered using the `replServer.defineCommand()` method. + * @since v9.0.0 + */ + clearBufferedCommand(): void; + /** + * Initializes a history log file for the REPL instance. When executing the + * Node.js binary and using the command-line REPL, a history file is initialized + * by default. However, this is not the case when creating a REPL + * programmatically. Use this method to initialize a history log file when working + * with REPL instances programmatically. + * @since v11.10.0 + * @param historyPath the path to the history file + * @param callback called when history writes are ready or upon error + */ + setupHistory(historyPath: string, callback: (err: Error | null, repl: this) => void): void; + setupHistory( + historyConfig?: REPLServerSetupHistoryOptions, + callback?: (err: Error | null, repl: this) => void, + ): void; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: REPLServerEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: REPLServerEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: REPLServerEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: REPLServerEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: REPLServerEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: REPLServerEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: REPLServerEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: REPLServerEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: REPLServerEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: REPLServerEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: REPLServerEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + /** + * A flag passed in the REPL options. Evaluates expressions in sloppy mode. + */ + const REPL_MODE_SLOPPY: unique symbol; + /** + * A flag passed in the REPL options. Evaluates expressions in strict mode. + * This is equivalent to prefacing every repl statement with `'use strict'`. + */ + const REPL_MODE_STRICT: unique symbol; + /** + * The `repl.start()` method creates and starts a {@link REPLServer} instance. + * + * If `options` is a string, then it specifies the input prompt: + * + * ```js + * import repl from 'node:repl'; + * + * // a Unix style prompt + * repl.start('$ '); + * ``` + * @since v0.1.91 + */ + function start(options?: string | ReplOptions): REPLServer; + /** + * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. + * + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_recoverable_errors + */ + class Recoverable extends SyntaxError { + err: Error; + constructor(err: Error); + } +} +declare module "repl" { + export * from "node:repl"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/sea.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/sea.d.ts new file mode 100644 index 0000000..2930c82 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/sea.d.ts @@ -0,0 +1,162 @@ +/** + * This feature allows the distribution of a Node.js application conveniently to a + * system that does not have Node.js installed. + * + * Node.js supports the creation of [single executable applications](https://github.com/nodejs/single-executable) by allowing + * the injection of a blob prepared by Node.js, which can contain a bundled script, + * into the `node` binary. During start up, the program checks if anything has been + * injected. If the blob is found, it executes the script in the blob. Otherwise + * Node.js operates as it normally does. + * + * The single executable application feature currently only supports running a + * single embedded script using the `CommonJS` module system. + * + * Users can create a single executable application from their bundled script + * with the `node` binary itself and any tool which can inject resources into the + * binary. + * + * Here are the steps for creating a single executable application using one such + * tool, [postject](https://github.com/nodejs/postject): + * + * 1. Create a JavaScript file: + * ```bash + * echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js + * ``` + * 2. Create a configuration file building a blob that can be injected into the + * single executable application (see `Generating single executable preparation blobs` for details): + * ```bash + * echo '{ "main": "hello.js", "output": "sea-prep.blob" }' > sea-config.json + * ``` + * 3. Generate the blob to be injected: + * ```bash + * node --experimental-sea-config sea-config.json + * ``` + * 4. Create a copy of the `node` executable and name it according to your needs: + * * On systems other than Windows: + * ```bash + * cp $(command -v node) hello + * ``` + * * On Windows: + * ```text + * node -e "require('fs').copyFileSync(process.execPath, 'hello.exe')" + * ``` + * The `.exe` extension is necessary. + * 5. Remove the signature of the binary (macOS and Windows only): + * * On macOS: + * ```bash + * codesign --remove-signature hello + * ``` + * * On Windows (optional): + * [signtool](https://learn.microsoft.com/en-us/windows/win32/seccrypto/signtool) can be used from the installed [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/). + * If this step is + * skipped, ignore any signature-related warning from postject. + * ```powershell + * signtool remove /s hello.exe + * ``` + * 6. Inject the blob into the copied binary by running `postject` with + * the following options: + * * `hello` / `hello.exe` \- The name of the copy of the `node` executable + * created in step 4. + * * `NODE_SEA_BLOB` \- The name of the resource / note / section in the binary + * where the contents of the blob will be stored. + * * `sea-prep.blob` \- The name of the blob created in step 1. + * * `--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2` \- The [fuse](https://www.electronjs.org/docs/latest/tutorial/fuses) used by the Node.js project to detect if a file has been + * injected. + * * `--macho-segment-name NODE_SEA` (only needed on macOS) - The name of the + * segment in the binary where the contents of the blob will be + * stored. + * To summarize, here is the required command for each platform: + * * On Linux: + * ```bash + * npx postject hello NODE_SEA_BLOB sea-prep.blob \ + * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 + * ``` + * * On Windows - PowerShell: + * ```powershell + * npx postject hello.exe NODE_SEA_BLOB sea-prep.blob ` + * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 + * ``` + * * On Windows - Command Prompt: + * ```text + * npx postject hello.exe NODE_SEA_BLOB sea-prep.blob ^ + * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 + * ``` + * * On macOS: + * ```bash + * npx postject hello NODE_SEA_BLOB sea-prep.blob \ + * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \ + * --macho-segment-name NODE_SEA + * ``` + * 7. Sign the binary (macOS and Windows only): + * * On macOS: + * ```bash + * codesign --sign - hello + * ``` + * * On Windows (optional): + * A certificate needs to be present for this to work. However, the unsigned + * binary would still be runnable. + * ```powershell + * signtool sign /fd SHA256 hello.exe + * ``` + * 8. Run the binary: + * * On systems other than Windows + * ```console + * $ ./hello world + * Hello, world! + * ``` + * * On Windows + * ```console + * $ .\hello.exe world + * Hello, world! + * ``` + * @since v19.7.0, v18.16.0 + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v25.x/src/node_sea.cc) + */ +declare module "node:sea" { + type AssetKey = string; + /** + * @since v20.12.0 + * @return Whether this script is running inside a single-executable application. + */ + function isSea(): boolean; + /** + * This method can be used to retrieve the assets configured to be bundled into the + * single-executable application at build time. + * An error is thrown when no matching asset can be found. + * @since v20.12.0 + */ + function getAsset(key: AssetKey): ArrayBuffer; + function getAsset(key: AssetKey, encoding: string): string; + /** + * Similar to `sea.getAsset()`, but returns the result in a [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob). + * An error is thrown when no matching asset can be found. + * @since v20.12.0 + */ + function getAssetAsBlob(key: AssetKey, options?: { + type: string; + }): Blob; + /** + * This method can be used to retrieve the assets configured to be bundled into the + * single-executable application at build time. + * An error is thrown when no matching asset can be found. + * + * Unlike `sea.getRawAsset()` or `sea.getAssetAsBlob()`, this method does not + * return a copy. Instead, it returns the raw asset bundled inside the executable. + * + * For now, users should avoid writing to the returned array buffer. If the + * injected section is not marked as writable or not aligned properly, + * writes to the returned array buffer is likely to result in a crash. + * @since v20.12.0 + */ + function getRawAsset(key: AssetKey): ArrayBuffer; + /** + * This method can be used to retrieve an array of all the keys of assets + * embedded into the single-executable application. + * An error is thrown when not running inside a single-executable application. + * @since v24.8.0 + * @returns An array containing all the keys of the assets + * embedded in the executable. If no assets are embedded, returns an empty array. + */ + function getAssetKeys(): string[]; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/sqlite.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/sqlite.d.ts new file mode 100644 index 0000000..44a9b66 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/sqlite.d.ts @@ -0,0 +1,1065 @@ +/** + * The `node:sqlite` module facilitates working with SQLite databases. + * To access it: + * + * ```js + * import sqlite from 'node:sqlite'; + * ``` + * + * This module is only available under the `node:` scheme. The following will not + * work: + * + * ```js + * import sqlite from 'sqlite'; + * ``` + * + * The following example shows the basic usage of the `node:sqlite` module to open + * an in-memory database, write data to the database, and then read the data back. + * + * ```js + * import { DatabaseSync } from 'node:sqlite'; + * const database = new DatabaseSync(':memory:'); + * + * // Execute SQL statements from strings. + * database.exec(` + * CREATE TABLE data( + * key INTEGER PRIMARY KEY, + * value TEXT + * ) STRICT + * `); + * // Create a prepared statement to insert data into the database. + * const insert = database.prepare('INSERT INTO data (key, value) VALUES (?, ?)'); + * // Execute the prepared statement with bound values. + * insert.run(1, 'hello'); + * insert.run(2, 'world'); + * // Create a prepared statement to read data from the database. + * const query = database.prepare('SELECT * FROM data ORDER BY key'); + * // Execute the prepared statement and log the result set. + * console.log(query.all()); + * // Prints: [ { key: 1, value: 'hello' }, { key: 2, value: 'world' } ] + * ``` + * @since v22.5.0 + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/sqlite.js) + */ +declare module "node:sqlite" { + import { PathLike } from "node:fs"; + type SQLInputValue = null | number | bigint | string | NodeJS.ArrayBufferView; + type SQLOutputValue = null | number | bigint | string | NodeJS.NonSharedUint8Array; + interface DatabaseSyncOptions { + /** + * If `true`, the database is opened by the constructor. When + * this value is `false`, the database must be opened via the `open()` method. + * @since v22.5.0 + * @default true + */ + open?: boolean | undefined; + /** + * If `true`, foreign key constraints + * are enabled. This is recommended but can be disabled for compatibility with + * legacy database schemas. The enforcement of foreign key constraints can be + * enabled and disabled after opening the database using + * [`PRAGMA foreign_keys`](https://www.sqlite.org/pragma.html#pragma_foreign_keys). + * @since v22.10.0 + * @default true + */ + enableForeignKeyConstraints?: boolean | undefined; + /** + * If `true`, SQLite will accept + * [double-quoted string literals](https://www.sqlite.org/quirks.html#dblquote). + * This is not recommended but can be + * enabled for compatibility with legacy database schemas. + * @since v22.10.0 + * @default false + */ + enableDoubleQuotedStringLiterals?: boolean | undefined; + /** + * If `true`, the database is opened in read-only mode. + * If the database does not exist, opening it will fail. + * @since v22.12.0 + * @default false + */ + readOnly?: boolean | undefined; + /** + * If `true`, the `loadExtension` SQL function + * and the `loadExtension()` method are enabled. + * You can call `enableLoadExtension(false)` later to disable this feature. + * @since v22.13.0 + * @default false + */ + allowExtension?: boolean | undefined; + /** + * The [busy timeout](https://sqlite.org/c3ref/busy_timeout.html) in milliseconds. This is the maximum amount of + * time that SQLite will wait for a database lock to be released before + * returning an error. + * @since v24.0.0 + * @default 0 + */ + timeout?: number | undefined; + /** + * If `true`, integer fields are read as JavaScript `BigInt` values. If `false`, + * integer fields are read as JavaScript numbers. + * @since v24.4.0 + * @default false + */ + readBigInts?: boolean | undefined; + /** + * If `true`, query results are returned as arrays instead of objects. + * @since v24.4.0 + * @default false + */ + returnArrays?: boolean | undefined; + /** + * If `true`, allows binding named parameters without the prefix + * character (e.g., `foo` instead of `:foo`). + * @since v24.4.40 + * @default true + */ + allowBareNamedParameters?: boolean | undefined; + /** + * If `true`, unknown named parameters are ignored when binding. + * If `false`, an exception is thrown for unknown named parameters. + * @since v24.4.40 + * @default false + */ + allowUnknownNamedParameters?: boolean | undefined; + /** + * If `true`, enables the defensive flag. When the defensive flag is enabled, + * language features that allow ordinary SQL to deliberately corrupt the database file are disabled. + * The defensive flag can also be set using `enableDefensive()`. + * @since v25.1.0 + * @default true + */ + defensive?: boolean | undefined; + } + interface CreateSessionOptions { + /** + * A specific table to track changes for. By default, changes to all tables are tracked. + * @since v22.12.0 + */ + table?: string | undefined; + /** + * Name of the database to track. This is useful when multiple databases have been added using + * [`ATTACH DATABASE`](https://www.sqlite.org/lang_attach.html). + * @since v22.12.0 + * @default 'main' + */ + db?: string | undefined; + } + interface ApplyChangesetOptions { + /** + * Skip changes that, when targeted table name is supplied to this function, return a truthy value. + * By default, all changes are attempted. + * @since v22.12.0 + */ + filter?: ((tableName: string) => boolean) | undefined; + /** + * A function that determines how to handle conflicts. The function receives one argument, + * which can be one of the following values: + * + * * `SQLITE_CHANGESET_DATA`: A `DELETE` or `UPDATE` change does not contain the expected "before" values. + * * `SQLITE_CHANGESET_NOTFOUND`: A row matching the primary key of the `DELETE` or `UPDATE` change does not exist. + * * `SQLITE_CHANGESET_CONFLICT`: An `INSERT` change results in a duplicate primary key. + * * `SQLITE_CHANGESET_FOREIGN_KEY`: Applying a change would result in a foreign key violation. + * * `SQLITE_CHANGESET_CONSTRAINT`: Applying a change results in a `UNIQUE`, `CHECK`, or `NOT NULL` constraint + * violation. + * + * The function should return one of the following values: + * + * * `SQLITE_CHANGESET_OMIT`: Omit conflicting changes. + * * `SQLITE_CHANGESET_REPLACE`: Replace existing values with conflicting changes (only valid with + `SQLITE_CHANGESET_DATA` or `SQLITE_CHANGESET_CONFLICT` conflicts). + * * `SQLITE_CHANGESET_ABORT`: Abort on conflict and roll back the database. + * + * When an error is thrown in the conflict handler or when any other value is returned from the handler, + * applying the changeset is aborted and the database is rolled back. + * + * **Default**: A function that returns `SQLITE_CHANGESET_ABORT`. + * @since v22.12.0 + */ + onConflict?: ((conflictType: number) => number) | undefined; + } + interface FunctionOptions { + /** + * If `true`, the [`SQLITE_DETERMINISTIC`](https://www.sqlite.org/c3ref/c_deterministic.html) flag is + * set on the created function. + * @default false + */ + deterministic?: boolean | undefined; + /** + * If `true`, the [`SQLITE_DIRECTONLY`](https://www.sqlite.org/c3ref/c_directonly.html) flag is set on + * the created function. + * @default false + */ + directOnly?: boolean | undefined; + /** + * If `true`, integer arguments to `function` + * are converted to `BigInt`s. If `false`, integer arguments are passed as + * JavaScript numbers. + * @default false + */ + useBigIntArguments?: boolean | undefined; + /** + * If `true`, `function` may be invoked with any number of + * arguments (between zero and + * [`SQLITE_MAX_FUNCTION_ARG`](https://www.sqlite.org/limits.html#max_function_arg)). If `false`, + * `function` must be invoked with exactly `function.length` arguments. + * @default false + */ + varargs?: boolean | undefined; + } + interface AggregateOptions extends FunctionOptions { + /** + * The identity value for the aggregation function. This value is used when the aggregation + * function is initialized. When a `Function` is passed the identity will be its return value. + */ + start: T | (() => T); + /** + * The function to call for each row in the aggregation. The + * function receives the current state and the row value. The return value of + * this function should be the new state. + */ + step: (accumulator: T, ...args: SQLOutputValue[]) => T; + /** + * The function to call to get the result of the + * aggregation. The function receives the final state and should return the + * result of the aggregation. + */ + result?: ((accumulator: T) => SQLInputValue) | undefined; + /** + * When this function is provided, the `aggregate` method will work as a window function. + * The function receives the current state and the dropped row value. The return value of this function should be the + * new state. + */ + inverse?: ((accumulator: T, ...args: SQLOutputValue[]) => T) | undefined; + } + interface PrepareOptions { + /** + * If `true`, integer fields are read as `BigInt`s. + * @since v25.5.0 + */ + readBigInts?: boolean | undefined; + /** + * If `true`, results are returned as arrays. + * @since v25.5.0 + */ + returnArrays?: boolean | undefined; + /** + * If `true`, allows binding named parameters without the prefix character. + * @since v25.5.0 + */ + allowBareNamedParameters?: boolean | undefined; + /** + * If `true`, unknown named parameters are ignored. + * @since v25.5.0 + */ + allowUnknownNamedParameters?: boolean | undefined; + } + /** + * This class represents a single [connection](https://www.sqlite.org/c3ref/sqlite3.html) to a SQLite database. All APIs + * exposed by this class execute synchronously. + * @since v22.5.0 + */ + class DatabaseSync implements Disposable { + /** + * Constructs a new `DatabaseSync` instance. + * @param path The path of the database. + * A SQLite database can be stored in a file or completely [in memory](https://www.sqlite.org/inmemorydb.html). + * To use a file-backed database, the path should be a file path. + * To use an in-memory database, the path should be the special name `':memory:'`. + * @param options Configuration options for the database connection. + */ + constructor(path: PathLike, options?: DatabaseSyncOptions); + /** + * Registers a new aggregate function with the SQLite database. This method is a wrapper around + * [`sqlite3_create_window_function()`](https://www.sqlite.org/c3ref/create_function.html). + * + * When used as a window function, the `result` function will be called multiple times. + * + * ```js + * import { DatabaseSync } from 'node:sqlite'; + * + * const db = new DatabaseSync(':memory:'); + * db.exec(` + * CREATE TABLE t3(x, y); + * INSERT INTO t3 VALUES ('a', 4), + * ('b', 5), + * ('c', 3), + * ('d', 8), + * ('e', 1); + * `); + * + * db.aggregate('sumint', { + * start: 0, + * step: (acc, value) => acc + value, + * }); + * + * db.prepare('SELECT sumint(y) as total FROM t3').get(); // { total: 21 } + * ``` + * @since v24.0.0 + * @param name The name of the SQLite function to create. + * @param options Function configuration settings. + */ + aggregate(name: string, options: AggregateOptions): void; + aggregate(name: string, options: AggregateOptions): void; + /** + * Closes the database connection. An exception is thrown if the database is not + * open. This method is a wrapper around [`sqlite3_close_v2()`](https://www.sqlite.org/c3ref/close.html). + * @since v22.5.0 + */ + close(): void; + /** + * Loads a shared library into the database connection. This method is a wrapper + * around [`sqlite3_load_extension()`](https://www.sqlite.org/c3ref/load_extension.html). It is required to enable the + * `allowExtension` option when constructing the `DatabaseSync` instance. + * @since v22.13.0 + * @param path The path to the shared library to load. + */ + loadExtension(path: string): void; + /** + * Enables or disables the `loadExtension` SQL function, and the `loadExtension()` + * method. When `allowExtension` is `false` when constructing, you cannot enable + * loading extensions for security reasons. + * @since v22.13.0 + * @param allow Whether to allow loading extensions. + */ + enableLoadExtension(allow: boolean): void; + /** + * Enables or disables the defensive flag. When the defensive flag is active, + * language features that allow ordinary SQL to deliberately corrupt the database file are disabled. + * See [`SQLITE_DBCONFIG_DEFENSIVE`](https://www.sqlite.org/c3ref/c_dbconfig_defensive.html#sqlitedbconfigdefensive) in the SQLite documentation for details. + * @since v25.1.0 + * @param active Whether to set the defensive flag. + */ + enableDefensive(active: boolean): void; + /** + * This method is a wrapper around [`sqlite3_db_filename()`](https://sqlite.org/c3ref/db_filename.html) + * @since v24.0.0 + * @param dbName Name of the database. This can be `'main'` (the default primary database) or any other + * database that has been added with [`ATTACH DATABASE`](https://www.sqlite.org/lang_attach.html) **Default:** `'main'`. + * @returns The location of the database file. When using an in-memory database, + * this method returns null. + */ + location(dbName?: string): string | null; + /** + * This method allows one or more SQL statements to be executed without returning + * any results. This method is useful when executing SQL statements read from a + * file. This method is a wrapper around [`sqlite3_exec()`](https://www.sqlite.org/c3ref/exec.html). + * @since v22.5.0 + * @param sql A SQL string to execute. + */ + exec(sql: string): void; + /** + * This method is used to create SQLite user-defined functions. This method is a + * wrapper around [`sqlite3_create_function_v2()`](https://www.sqlite.org/c3ref/create_function.html). + * @since v22.13.0 + * @param name The name of the SQLite function to create. + * @param options Optional configuration settings for the function. + * @param func The JavaScript function to call when the SQLite + * function is invoked. The return value of this function should be a valid + * SQLite data type: see + * [Type conversion between JavaScript and SQLite](https://nodejs.org/docs/latest-v25.x/api/sqlite.html#type-conversion-between-javascript-and-sqlite). + * The result defaults to `NULL` if the return value is `undefined`. + */ + function( + name: string, + options: FunctionOptions, + func: (...args: SQLOutputValue[]) => SQLInputValue, + ): void; + function(name: string, func: (...args: SQLOutputValue[]) => SQLInputValue): void; + /** + * Sets an authorizer callback that SQLite will invoke whenever it attempts to + * access data or modify the database schema through prepared statements. + * This can be used to implement security policies, audit access, or restrict certain operations. + * This method is a wrapper around [`sqlite3_set_authorizer()`](https://sqlite.org/c3ref/set_authorizer.html). + * + * When invoked, the callback receives five arguments: + * + * * `actionCode` {number} The type of operation being performed (e.g., + * `SQLITE_INSERT`, `SQLITE_UPDATE`, `SQLITE_SELECT`). + * * `arg1` {string|null} The first argument (context-dependent, often a table name). + * * `arg2` {string|null} The second argument (context-dependent, often a column name). + * * `dbName` {string|null} The name of the database. + * * `triggerOrView` {string|null} The name of the trigger or view causing the access. + * + * The callback must return one of the following constants: + * + * * `SQLITE_OK` - Allow the operation. + * * `SQLITE_DENY` - Deny the operation (causes an error). + * * `SQLITE_IGNORE` - Ignore the operation (silently skip). + * + * ```js + * import { DatabaseSync, constants } from 'node:sqlite'; + * const db = new DatabaseSync(':memory:'); + * + * // Set up an authorizer that denies all table creation + * db.setAuthorizer((actionCode) => { + * if (actionCode === constants.SQLITE_CREATE_TABLE) { + * return constants.SQLITE_DENY; + * } + * return constants.SQLITE_OK; + * }); + * + * // This will work + * db.prepare('SELECT 1').get(); + * + * // This will throw an error due to authorization denial + * try { + * db.exec('CREATE TABLE blocked (id INTEGER)'); + * } catch (err) { + * console.log('Operation blocked:', err.message); + * } + * ``` + * @since v24.10.0 + * @param callback The authorizer function to set, or `null` to + * clear the current authorizer. + */ + setAuthorizer( + callback: + | (( + actionCode: number, + arg1: string | null, + arg2: string | null, + dbName: string | null, + triggerOrView: string | null, + ) => number) + | null, + ): void; + /** + * Whether the database is currently open or not. + * @since v22.15.0 + */ + readonly isOpen: boolean; + /** + * Whether the database is currently within a transaction. This method + * is a wrapper around [`sqlite3_get_autocommit()`](https://sqlite.org/c3ref/get_autocommit.html). + * @since v24.0.0 + */ + readonly isTransaction: boolean; + /** + * Opens the database specified in the `path` argument of the `DatabaseSync`constructor. This method should only be used when the database is not opened via + * the constructor. An exception is thrown if the database is already open. + * @since v22.5.0 + */ + open(): void; + /** + * Compiles a SQL statement into a [prepared statement](https://www.sqlite.org/c3ref/stmt.html). This method is a wrapper + * around [`sqlite3_prepare_v2()`](https://www.sqlite.org/c3ref/prepare.html). + * @since v22.5.0 + * @param sql A SQL string to compile to a prepared statement. + * @param options Optional configuration for the prepared statement. + * @return The prepared statement. + */ + prepare(sql: string, options?: PrepareOptions): StatementSync; + /** + * Creates a new {@link SQLTagStore}, which is a Least Recently Used (LRU) cache + * for storing prepared statements. This allows for the efficient reuse of + * prepared statements by tagging them with a unique identifier. + * + * When a tagged SQL literal is executed, the `SQLTagStore` checks if a prepared + * statement for the corresponding SQL query string already exists in the cache. + * If it does, the cached statement is used. If not, a new prepared statement is + * created, executed, and then stored in the cache for future use. This mechanism + * helps to avoid the overhead of repeatedly parsing and preparing the same SQL + * statements. + * + * Tagged statements bind the placeholder values from the template literal as + * parameters to the underlying prepared statement. For example: + * + * ```js + * sqlTagStore.get`SELECT ${value}`; + * ``` + * + * is equivalent to: + * + * ```js + * db.prepare('SELECT ?').get(value); + * ``` + * + * However, in the first example, the tag store will cache the underlying prepared + * statement for future use. + * + * > **Note:** The `${value}` syntax in tagged statements _binds_ a parameter to + * > the prepared statement. This differs from its behavior in _untagged_ template + * > literals, where it performs string interpolation. + * > + * > ```js + * > // This a safe example of binding a parameter to a tagged statement. + * > sqlTagStore.run`INSERT INTO t1 (id) VALUES (${id})`; + * > + * > // This is an *unsafe* example of an untagged template string. + * > // `id` is interpolated into the query text as a string. + * > // This can lead to SQL injection and data corruption. + * > db.run(`INSERT INTO t1 (id) VALUES (${id})`); + * > ``` + * + * The tag store will match a statement from the cache if the query strings + * (including the positions of any bound placeholders) are identical. + * + * ```js + * // The following statements will match in the cache: + * sqlTagStore.get`SELECT * FROM t1 WHERE id = ${id} AND active = 1`; + * sqlTagStore.get`SELECT * FROM t1 WHERE id = ${12345} AND active = 1`; + * + * // The following statements will not match, as the query strings + * // and bound placeholders differ: + * sqlTagStore.get`SELECT * FROM t1 WHERE id = ${id} AND active = 1`; + * sqlTagStore.get`SELECT * FROM t1 WHERE id = 12345 AND active = 1`; + * + * // The following statements will not match, as matches are case-sensitive: + * sqlTagStore.get`SELECT * FROM t1 WHERE id = ${id} AND active = 1`; + * sqlTagStore.get`select * from t1 where id = ${id} and active = 1`; + * ``` + * + * The only way of binding parameters in tagged statements is with the `${value}` + * syntax. Do not add parameter binding placeholders (`?` etc.) to the SQL query + * string itself. + * + * ```js + * import { DatabaseSync } from 'node:sqlite'; + * + * const db = new DatabaseSync(':memory:'); + * const sql = db.createSQLTagStore(); + * + * db.exec('CREATE TABLE users (id INT, name TEXT)'); + * + * // Using the 'run' method to insert data. + * // The tagged literal is used to identify the prepared statement. + * sql.run`INSERT INTO users VALUES (1, 'Alice')`; + * sql.run`INSERT INTO users VALUES (2, 'Bob')`; + * + * // Using the 'get' method to retrieve a single row. + * const name = 'Alice'; + * const user = sql.get`SELECT * FROM users WHERE name = ${name}`; + * console.log(user); // { id: 1, name: 'Alice' } + * + * // Using the 'all' method to retrieve all rows. + * const allUsers = sql.all`SELECT * FROM users ORDER BY id`; + * console.log(allUsers); + * // [ + * // { id: 1, name: 'Alice' }, + * // { id: 2, name: 'Bob' } + * // ] + * ``` + * @since v24.9.0 + * @returns A new SQL tag store for caching prepared statements. + */ + createTagStore(maxSize?: number): SQLTagStore; + /** + * Creates and attaches a session to the database. This method is a wrapper around + * [`sqlite3session_create()`](https://www.sqlite.org/session/sqlite3session_create.html) and + * [`sqlite3session_attach()`](https://www.sqlite.org/session/sqlite3session_attach.html). + * @param options The configuration options for the session. + * @returns A session handle. + * @since v22.12.0 + */ + createSession(options?: CreateSessionOptions): Session; + /** + * An exception is thrown if the database is not + * open. This method is a wrapper around + * [`sqlite3changeset_apply()`](https://www.sqlite.org/session/sqlite3changeset_apply.html). + * + * ```js + * import { DatabaseSync } from 'node:sqlite'; + * + * const sourceDb = new DatabaseSync(':memory:'); + * const targetDb = new DatabaseSync(':memory:'); + * + * sourceDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)'); + * targetDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)'); + * + * const session = sourceDb.createSession(); + * + * const insert = sourceDb.prepare('INSERT INTO data (key, value) VALUES (?, ?)'); + * insert.run(1, 'hello'); + * insert.run(2, 'world'); + * + * const changeset = session.changeset(); + * targetDb.applyChangeset(changeset); + * // Now that the changeset has been applied, targetDb contains the same data as sourceDb. + * ``` + * @param changeset A binary changeset or patchset. + * @param options The configuration options for how the changes will be applied. + * @returns Whether the changeset was applied successfully without being aborted. + * @since v22.12.0 + */ + applyChangeset(changeset: Uint8Array, options?: ApplyChangesetOptions): boolean; + /** + * Closes the database connection. If the database connection is already closed + * then this is a no-op. + * @since v22.15.0 + */ + [Symbol.dispose](): void; + } + /** + * @since v22.12.0 + */ + interface Session { + /** + * Retrieves a changeset containing all changes since the changeset was created. Can be called multiple times. + * An exception is thrown if the database or the session is not open. This method is a wrapper around + * [`sqlite3session_changeset()`](https://www.sqlite.org/session/sqlite3session_changeset.html). + * @returns Binary changeset that can be applied to other databases. + * @since v22.12.0 + */ + changeset(): NodeJS.NonSharedUint8Array; + /** + * Similar to the method above, but generates a more compact patchset. See + * [Changesets and Patchsets](https://www.sqlite.org/sessionintro.html#changesets_and_patchsets) + * in the documentation of SQLite. An exception is thrown if the database or the session is not open. This method is a + * wrapper around + * [`sqlite3session_patchset()`](https://www.sqlite.org/session/sqlite3session_patchset.html). + * @returns Binary patchset that can be applied to other databases. + * @since v22.12.0 + */ + patchset(): NodeJS.NonSharedUint8Array; + /** + * Closes the session. An exception is thrown if the database or the session is not open. This method is a + * wrapper around + * [`sqlite3session_delete()`](https://www.sqlite.org/session/sqlite3session_delete.html). + */ + close(): void; + /** + * Closes the session. If the session is already closed, does nothing. + * @since v24.9.0 + */ + [Symbol.dispose](): void; + } + /** + * This class represents a single LRU (Least Recently Used) cache for storing + * prepared statements. + * + * Instances of this class are created via the `database.createTagStore()` + * method, not by using a constructor. The store caches prepared statements based + * on the provided SQL query string. When the same query is seen again, the store + * retrieves the cached statement and safely applies the new values through + * parameter binding, thereby preventing attacks like SQL injection. + * + * The cache has a maxSize that defaults to 1000 statements, but a custom size can + * be provided (e.g., `database.createTagStore(100)`). All APIs exposed by this + * class execute synchronously. + * @since v24.9.0 + */ + interface SQLTagStore { + /** + * Executes the given SQL query and returns all resulting rows as an array of + * objects. + * + * This function is intended to be used as a template literal tag, not to be + * called directly. + * @since v24.9.0 + * @param stringElements Template literal elements containing the SQL + * query. + * @param boundParameters Parameter values to be bound to placeholders in the template string. + * @returns An array of objects representing the rows returned by the query. + */ + all( + stringElements: TemplateStringsArray, + ...boundParameters: SQLInputValue[] + ): Record[]; + /** + * Executes the given SQL query and returns the first resulting row as an object. + * + * This function is intended to be used as a template literal tag, not to be + * called directly. + * @since v24.9.0 + * @param stringElements Template literal elements containing the SQL + * query. + * @param boundParameters Parameter values to be bound to placeholders in the template string. + * @returns An object representing the first row returned by + * the query, or `undefined` if no rows are returned. + */ + get( + stringElements: TemplateStringsArray, + ...boundParameters: SQLInputValue[] + ): Record | undefined; + /** + * Executes the given SQL query and returns an iterator over the resulting rows. + * + * This function is intended to be used as a template literal tag, not to be + * called directly. + * @since v24.9.0 + * @param stringElements Template literal elements containing the SQL + * query. + * @param boundParameters Parameter values to be bound to placeholders in the template string. + * @returns An iterator that yields objects representing the rows returned by the query. + */ + iterate( + stringElements: TemplateStringsArray, + ...boundParameters: SQLInputValue[] + ): NodeJS.Iterator>; + /** + * Executes the given SQL query, which is expected to not return any rows (e.g., INSERT, UPDATE, DELETE). + * + * This function is intended to be used as a template literal tag, not to be + * called directly. + * @since v24.9.0 + * @param stringElements Template literal elements containing the SQL + * query. + * @param boundParameters Parameter values to be bound to placeholders in the template string. + * @returns An object containing information about the execution, including `changes` and `lastInsertRowid`. + */ + run(stringElements: TemplateStringsArray, ...boundParameters: SQLInputValue[]): StatementResultingChanges; + /** + * A read-only property that returns the number of prepared statements currently in the cache. + * @since v24.9.0 + */ + readonly size: number; + /** + * A read-only property that returns the maximum number of prepared statements the cache can hold. + * @since v24.9.0 + */ + readonly capacity: number; + /** + * A read-only property that returns the `DatabaseSync` object associated with this `SQLTagStore`. + * @since v24.9.0 + */ + readonly db: DatabaseSync; + /** + * Resets the LRU cache, clearing all stored prepared statements. + * @since v24.9.0 + */ + clear(): void; + } + interface StatementColumnMetadata { + /** + * The unaliased name of the column in the origin + * table, or `null` if the column is the result of an expression or subquery. + * This property is the result of [`sqlite3_column_origin_name()`](https://www.sqlite.org/c3ref/column_database_name.html). + */ + column: string | null; + /** + * The unaliased name of the origin database, or + * `null` if the column is the result of an expression or subquery. This + * property is the result of [`sqlite3_column_database_name()`](https://www.sqlite.org/c3ref/column_database_name.html). + */ + database: string | null; + /** + * The name assigned to the column in the result set of a + * `SELECT` statement. This property is the result of + * [`sqlite3_column_name()`](https://www.sqlite.org/c3ref/column_name.html). + */ + name: string; + /** + * The unaliased name of the origin table, or `null` if + * the column is the result of an expression or subquery. This property is the + * result of [`sqlite3_column_table_name()`](https://www.sqlite.org/c3ref/column_database_name.html). + */ + table: string | null; + /** + * The declared data type of the column, or `null` if the + * column is the result of an expression or subquery. This property is the + * result of [`sqlite3_column_decltype()`](https://www.sqlite.org/c3ref/column_decltype.html). + */ + type: string | null; + } + interface StatementResultingChanges { + /** + * The number of rows modified, inserted, or deleted by the most recently completed `INSERT`, `UPDATE`, or `DELETE` statement. + * This field is either a number or a `BigInt` depending on the prepared statement's configuration. + * This property is the result of [`sqlite3_changes64()`](https://www.sqlite.org/c3ref/changes.html). + */ + changes: number | bigint; + /** + * The most recently inserted rowid. + * This field is either a number or a `BigInt` depending on the prepared statement's configuration. + * This property is the result of [`sqlite3_last_insert_rowid()`](https://www.sqlite.org/c3ref/last_insert_rowid.html). + */ + lastInsertRowid: number | bigint; + } + /** + * This class represents a single [prepared statement](https://www.sqlite.org/c3ref/stmt.html). This class cannot be + * instantiated via its constructor. Instead, instances are created via the`database.prepare()` method. All APIs exposed by this class execute + * synchronously. + * + * A prepared statement is an efficient binary representation of the SQL used to + * create it. Prepared statements are parameterizable, and can be invoked multiple + * times with different bound values. Parameters also offer protection against [SQL injection](https://en.wikipedia.org/wiki/SQL_injection) attacks. For these reasons, prepared statements are + * preferred + * over hand-crafted SQL strings when handling user input. + * @since v22.5.0 + */ + class StatementSync { + private constructor(); + /** + * This method executes a prepared statement and returns all results as an array of + * objects. If the prepared statement does not return any results, this method + * returns an empty array. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using + * the values in `namedParameters` and `anonymousParameters`. + * @since v22.5.0 + * @param namedParameters An optional object used to bind named parameters. The keys of this object are used to configure the mapping. + * @param anonymousParameters Zero or more values to bind to anonymous parameters. + * @return An array of objects. Each object corresponds to a row returned by executing the prepared statement. The keys and values of each object correspond to the column names and values of + * the row. + */ + all(...anonymousParameters: SQLInputValue[]): Record[]; + all( + namedParameters: Record, + ...anonymousParameters: SQLInputValue[] + ): Record[]; + /** + * This method is used to retrieve information about the columns returned by the + * prepared statement. + * @since v23.11.0 + * @returns An array of objects. Each object corresponds to a column + * in the prepared statement, and contains the following properties: + */ + columns(): StatementColumnMetadata[]; + /** + * The source SQL text of the prepared statement with parameter + * placeholders replaced by the values that were used during the most recent + * execution of this prepared statement. This property is a wrapper around + * [`sqlite3_expanded_sql()`](https://www.sqlite.org/c3ref/expanded_sql.html). + * @since v22.5.0 + */ + readonly expandedSQL: string; + /** + * This method executes a prepared statement and returns the first result as an + * object. If the prepared statement does not return any results, this method + * returns `undefined`. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using the + * values in `namedParameters` and `anonymousParameters`. + * @since v22.5.0 + * @param namedParameters An optional object used to bind named parameters. The keys of this object are used to configure the mapping. + * @param anonymousParameters Zero or more values to bind to anonymous parameters. + * @return An object corresponding to the first row returned by executing the prepared statement. The keys and values of the object correspond to the column names and values of the row. If no + * rows were returned from the database then this method returns `undefined`. + */ + get(...anonymousParameters: SQLInputValue[]): Record | undefined; + get( + namedParameters: Record, + ...anonymousParameters: SQLInputValue[] + ): Record | undefined; + /** + * This method executes a prepared statement and returns an iterator of + * objects. If the prepared statement does not return any results, this method + * returns an empty iterator. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using + * the values in `namedParameters` and `anonymousParameters`. + * @since v22.13.0 + * @param namedParameters An optional object used to bind named parameters. + * The keys of this object are used to configure the mapping. + * @param anonymousParameters Zero or more values to bind to anonymous parameters. + * @returns An iterable iterator of objects. Each object corresponds to a row + * returned by executing the prepared statement. The keys and values of each + * object correspond to the column names and values of the row. + */ + iterate(...anonymousParameters: SQLInputValue[]): NodeJS.Iterator>; + iterate( + namedParameters: Record, + ...anonymousParameters: SQLInputValue[] + ): NodeJS.Iterator>; + /** + * This method executes a prepared statement and returns an object summarizing the + * resulting changes. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using the + * values in `namedParameters` and `anonymousParameters`. + * @since v22.5.0 + * @param namedParameters An optional object used to bind named parameters. The keys of this object are used to configure the mapping. + * @param anonymousParameters Zero or more values to bind to anonymous parameters. + */ + run(...anonymousParameters: SQLInputValue[]): StatementResultingChanges; + run( + namedParameters: Record, + ...anonymousParameters: SQLInputValue[] + ): StatementResultingChanges; + /** + * The names of SQLite parameters begin with a prefix character. By default,`node:sqlite` requires that this prefix character is present when binding + * parameters. However, with the exception of dollar sign character, these + * prefix characters also require extra quoting when used in object keys. + * + * To improve ergonomics, this method can be used to also allow bare named + * parameters, which do not require the prefix character in JavaScript code. There + * are several caveats to be aware of when enabling bare named parameters: + * + * * The prefix character is still required in SQL. + * * The prefix character is still allowed in JavaScript. In fact, prefixed names + * will have slightly better binding performance. + * * Using ambiguous named parameters, such as `$k` and `@k`, in the same prepared + * statement will result in an exception as it cannot be determined how to bind + * a bare name. + * @since v22.5.0 + * @param enabled Enables or disables support for binding named parameters without the prefix character. + */ + setAllowBareNamedParameters(enabled: boolean): void; + /** + * By default, if an unknown name is encountered while binding parameters, an + * exception is thrown. This method allows unknown named parameters to be ignored. + * @since v22.15.0 + * @param enabled Enables or disables support for unknown named parameters. + */ + setAllowUnknownNamedParameters(enabled: boolean): void; + /** + * When enabled, query results returned by the `all()`, `get()`, and `iterate()` methods will be returned as arrays instead + * of objects. + * @since v24.0.0 + * @param enabled Enables or disables the return of query results as arrays. + */ + setReturnArrays(enabled: boolean): void; + /** + * When reading from the database, SQLite `INTEGER`s are mapped to JavaScript + * numbers by default. However, SQLite `INTEGER`s can store values larger than + * JavaScript numbers are capable of representing. In such cases, this method can + * be used to read `INTEGER` data using JavaScript `BigInt`s. This method has no + * impact on database write operations where numbers and `BigInt`s are both + * supported at all times. + * @since v22.5.0 + * @param enabled Enables or disables the use of `BigInt`s when reading `INTEGER` fields from the database. + */ + setReadBigInts(enabled: boolean): void; + /** + * The source SQL text of the prepared statement. This property is a + * wrapper around [`sqlite3_sql()`](https://www.sqlite.org/c3ref/expanded_sql.html). + * @since v22.5.0 + */ + readonly sourceSQL: string; + } + interface BackupOptions { + /** + * Name of the source database. This can be `'main'` (the default primary database) or any other + * database that have been added with [`ATTACH DATABASE`](https://www.sqlite.org/lang_attach.html) + * @default 'main' + */ + source?: string | undefined; + /** + * Name of the target database. This can be `'main'` (the default primary database) or any other + * database that have been added with [`ATTACH DATABASE`](https://www.sqlite.org/lang_attach.html) + * @default 'main' + */ + target?: string | undefined; + /** + * Number of pages to be transmitted in each batch of the backup. + * @default 100 + */ + rate?: number | undefined; + /** + * An optional callback function that will be called after each backup step. The argument passed + * to this callback is an `Object` with `remainingPages` and `totalPages` properties, describing the current progress + * of the backup operation. + */ + progress?: ((progressInfo: BackupProgressInfo) => void) | undefined; + } + interface BackupProgressInfo { + totalPages: number; + remainingPages: number; + } + /** + * This method makes a database backup. This method abstracts the + * [`sqlite3_backup_init()`](https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupinit), + * [`sqlite3_backup_step()`](https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupstep) + * and [`sqlite3_backup_finish()`](https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupfinish) functions. + * + * The backed-up database can be used normally during the backup process. Mutations coming from the same connection - same + * `DatabaseSync` - object will be reflected in the backup right away. However, mutations from other connections will cause + * the backup process to restart. + * + * ```js + * import { backup, DatabaseSync } from 'node:sqlite'; + * + * const sourceDb = new DatabaseSync('source.db'); + * const totalPagesTransferred = await backup(sourceDb, 'backup.db', { + * rate: 1, // Copy one page at a time. + * progress: ({ totalPages, remainingPages }) => { + * console.log('Backup in progress', { totalPages, remainingPages }); + * }, + * }); + * + * console.log('Backup completed', totalPagesTransferred); + * ``` + * @since v23.8.0 + * @param sourceDb The database to backup. The source database must be open. + * @param path The path where the backup will be created. If the file already exists, + * the contents will be overwritten. + * @param options Optional configuration for the backup. The + * following properties are supported: + * @returns A promise that fulfills with the total number of backed-up pages upon completion, or rejects if an + * error occurs. + */ + function backup(sourceDb: DatabaseSync, path: PathLike, options?: BackupOptions): Promise; + /** + * @since v22.13.0 + */ + namespace constants { + /** + * The conflict handler is invoked with this constant when processing a DELETE or UPDATE change if a row with the required PRIMARY KEY fields is present in the database, but one or more other (non primary-key) fields modified by the update do not contain the expected "before" values. + * @since v22.14.0 + */ + const SQLITE_CHANGESET_DATA: number; + /** + * The conflict handler is invoked with this constant when processing a DELETE or UPDATE change if a row with the required PRIMARY KEY fields is not present in the database. + * @since v22.14.0 + */ + const SQLITE_CHANGESET_NOTFOUND: number; + /** + * This constant is passed to the conflict handler while processing an INSERT change if the operation would result in duplicate primary key values. + * @since v22.14.0 + */ + const SQLITE_CHANGESET_CONFLICT: number; + /** + * If foreign key handling is enabled, and applying a changeset leaves the database in a state containing foreign key violations, the conflict handler is invoked with this constant exactly once before the changeset is committed. If the conflict handler returns `SQLITE_CHANGESET_OMIT`, the changes, including those that caused the foreign key constraint violation, are committed. Or, if it returns `SQLITE_CHANGESET_ABORT`, the changeset is rolled back. + * @since v22.14.0 + */ + const SQLITE_CHANGESET_FOREIGN_KEY: number; + /** + * Conflicting changes are omitted. + * @since v22.12.0 + */ + const SQLITE_CHANGESET_OMIT: number; + /** + * Conflicting changes replace existing values. Note that this value can only be returned when the type of conflict is either `SQLITE_CHANGESET_DATA` or `SQLITE_CHANGESET_CONFLICT`. + * @since v22.12.0 + */ + const SQLITE_CHANGESET_REPLACE: number; + /** + * Abort when a change encounters a conflict and roll back database. + * @since v22.12.0 + */ + const SQLITE_CHANGESET_ABORT: number; + /** + * Deny the operation and cause an error to be returned. + * @since v24.10.0 + */ + const SQLITE_DENY: number; + /** + * Ignore the operation and continue as if it had never been requested. + * @since 24.10.0 + */ + const SQLITE_IGNORE: number; + /** + * Allow the operation to proceed normally. + * @since v24.10.0 + */ + const SQLITE_OK: number; + const SQLITE_CREATE_INDEX: number; + const SQLITE_CREATE_TABLE: number; + const SQLITE_CREATE_TEMP_INDEX: number; + const SQLITE_CREATE_TEMP_TABLE: number; + const SQLITE_CREATE_TEMP_TRIGGER: number; + const SQLITE_CREATE_TEMP_VIEW: number; + const SQLITE_CREATE_TRIGGER: number; + const SQLITE_CREATE_VIEW: number; + const SQLITE_DELETE: number; + const SQLITE_DROP_INDEX: number; + const SQLITE_DROP_TABLE: number; + const SQLITE_DROP_TEMP_INDEX: number; + const SQLITE_DROP_TEMP_TABLE: number; + const SQLITE_DROP_TEMP_TRIGGER: number; + const SQLITE_DROP_TEMP_VIEW: number; + const SQLITE_DROP_TRIGGER: number; + const SQLITE_DROP_VIEW: number; + const SQLITE_INSERT: number; + const SQLITE_PRAGMA: number; + const SQLITE_READ: number; + const SQLITE_SELECT: number; + const SQLITE_TRANSACTION: number; + const SQLITE_UPDATE: number; + const SQLITE_ATTACH: number; + const SQLITE_DETACH: number; + const SQLITE_ALTER_TABLE: number; + const SQLITE_REINDEX: number; + const SQLITE_ANALYZE: number; + const SQLITE_CREATE_VTABLE: number; + const SQLITE_DROP_VTABLE: number; + const SQLITE_FUNCTION: number; + const SQLITE_SAVEPOINT: number; + const SQLITE_COPY: number; + const SQLITE_RECURSIVE: number; + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/stream.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/stream.d.ts new file mode 100644 index 0000000..3f046ac --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/stream.d.ts @@ -0,0 +1,1770 @@ +/** + * A stream is an abstract interface for working with streaming data in Node.js. + * The `node:stream` module provides an API for implementing the stream interface. + * + * There are many stream objects provided by Node.js. For instance, a [request to an HTTP server](https://nodejs.org/docs/latest-v25.x/api/http.html#class-httpincomingmessage) + * and [`process.stdout`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstdout) are both stream instances. + * + * Streams can be readable, writable, or both. All streams are instances of [`EventEmitter`](https://nodejs.org/docs/latest-v25.x/api/events.html#class-eventemitter). + * + * To access the `node:stream` module: + * + * ```js + * import stream from 'node:stream'; + * ``` + * + * The `node:stream` module is useful for creating new types of stream instances. + * It is usually not necessary to use the `node:stream` module to consume streams. + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/stream.js) + */ +declare module "node:stream" { + import { Blob } from "node:buffer"; + import { Abortable, EventEmitter } from "node:events"; + import * as promises from "node:stream/promises"; + import * as web from "node:stream/web"; + class Stream extends EventEmitter { + /** + * @since v0.9.4 + */ + pipe( + destination: T, + options?: Stream.PipeOptions, + ): T; + } + namespace Stream { + export { promises, Stream }; + } + namespace Stream { + interface PipeOptions { + /** + * End the writer when the reader ends. + * @default true + */ + end?: boolean | undefined; + } + interface StreamOptions extends Abortable { + emitClose?: boolean | undefined; + highWaterMark?: number | undefined; + objectMode?: boolean | undefined; + construct?: ((this: T, callback: (error?: Error | null) => void) => void) | undefined; + destroy?: ((this: T, error: Error | null, callback: (error?: Error | null) => void) => void) | undefined; + autoDestroy?: boolean | undefined; + } + interface ReadableOptions extends StreamOptions { + encoding?: BufferEncoding | undefined; + read?: ((this: T, size: number) => void) | undefined; + } + interface ReadableIteratorOptions { + /** + * When set to `false`, calling `return` on the async iterator, + * or exiting a `for await...of` iteration using a `break`, + * `return`, or `throw` will not destroy the stream. + * @default true + */ + destroyOnReturn?: boolean | undefined; + } + interface ReadableOperatorOptions extends Abortable { + /** + * The maximum concurrent invocations of `fn` to call + * on the stream at once. + * @default 1 + */ + concurrency?: number | undefined; + /** + * How many items to buffer while waiting for user consumption + * of the output. + * @default concurrency * 2 - 1 + */ + highWaterMark?: number | undefined; + } + /** @deprecated Use `ReadableOperatorOptions` instead. */ + interface ArrayOptions extends ReadableOperatorOptions {} + interface ReadableToWebOptions { + strategy?: web.QueuingStrategy | undefined; + type?: web.ReadableStreamType | undefined; + } + interface ReadableEventMap { + "close": []; + "data": [chunk: any]; + "end": []; + "error": [err: Error]; + "pause": []; + "readable": []; + "resume": []; + } + /** + * @since v0.9.4 + */ + class Readable extends Stream implements NodeJS.ReadableStream { + constructor(options?: ReadableOptions); + /** + * A utility method for creating Readable Streams out of iterators. + * @since v12.3.0, v10.17.0 + * @param iterable Object implementing the `Symbol.asyncIterator` or `Symbol.iterator` iterable protocol. Emits an 'error' event if a null value is passed. + * @param options Options provided to `new stream.Readable([options])`. By default, `Readable.from()` will set `options.objectMode` to `true`, unless this is explicitly opted out by setting `options.objectMode` to `false`. + */ + static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; + /** + * A utility method for creating a `Readable` from a web `ReadableStream`. + * @since v17.0.0 + */ + static fromWeb( + readableStream: web.ReadableStream, + options?: Pick, + ): Readable; + /** + * A utility method for creating a web `ReadableStream` from a `Readable`. + * @since v17.0.0 + */ + static toWeb( + streamReadable: NodeJS.ReadableStream, + options?: ReadableToWebOptions, + ): web.ReadableStream; + /** + * Returns whether the stream has been read from or cancelled. + * @since v16.8.0 + */ + static isDisturbed(stream: NodeJS.ReadableStream | web.ReadableStream): boolean; + /** + * Returns whether the stream was destroyed or errored before emitting `'end'`. + * @since v16.8.0 + */ + readonly readableAborted: boolean; + /** + * Is `true` if it is safe to call {@link read}, which means + * the stream has not been destroyed or emitted `'error'` or `'end'`. + * @since v11.4.0 + */ + readable: boolean; + /** + * Returns whether `'data'` has been emitted. + * @since v16.7.0, v14.18.0 + */ + readonly readableDidRead: boolean; + /** + * Getter for the property `encoding` of a given `Readable` stream. The `encoding` property can be set using the {@link setEncoding} method. + * @since v12.7.0 + */ + readonly readableEncoding: BufferEncoding | null; + /** + * Becomes `true` when [`'end'`](https://nodejs.org/docs/latest-v25.x/api/stream.html#event-end) event is emitted. + * @since v12.9.0 + */ + readonly readableEnded: boolean; + /** + * This property reflects the current state of a `Readable` stream as described + * in the [Three states](https://nodejs.org/docs/latest-v25.x/api/stream.html#three-states) section. + * @since v9.4.0 + */ + readableFlowing: boolean | null; + /** + * Returns the value of `highWaterMark` passed when creating this `Readable`. + * @since v9.3.0 + */ + readonly readableHighWaterMark: number; + /** + * This property contains the number of bytes (or objects) in the queue + * ready to be read. The value provides introspection data regarding + * the status of the `highWaterMark`. + * @since v9.4.0 + */ + readonly readableLength: number; + /** + * Getter for the property `objectMode` of a given `Readable` stream. + * @since v12.3.0 + */ + readonly readableObjectMode: boolean; + /** + * Is `true` after `readable.destroy()` has been called. + * @since v8.0.0 + */ + destroyed: boolean; + /** + * Is `true` after `'close'` has been emitted. + * @since v18.0.0 + */ + readonly closed: boolean; + /** + * Returns error if the stream has been destroyed with an error. + * @since v18.0.0 + */ + readonly errored: Error | null; + _construct?(callback: (error?: Error | null) => void): void; + _read(size: number): void; + /** + * The `readable.read()` method reads data out of the internal buffer and + * returns it. If no data is available to be read, `null` is returned. By default, + * the data is returned as a `Buffer` object unless an encoding has been + * specified using the `readable.setEncoding()` method or the stream is operating + * in object mode. + * + * The optional `size` argument specifies a specific number of bytes to read. If + * `size` bytes are not available to be read, `null` will be returned _unless_ the + * stream has ended, in which case all of the data remaining in the internal buffer + * will be returned. + * + * If the `size` argument is not specified, all of the data contained in the + * internal buffer will be returned. + * + * The `size` argument must be less than or equal to 1 GiB. + * + * The `readable.read()` method should only be called on `Readable` streams + * operating in paused mode. In flowing mode, `readable.read()` is called + * automatically until the internal buffer is fully drained. + * + * ```js + * const readable = getReadableStreamSomehow(); + * + * // 'readable' may be triggered multiple times as data is buffered in + * readable.on('readable', () => { + * let chunk; + * console.log('Stream is readable (new data received in buffer)'); + * // Use a loop to make sure we read all currently available data + * while (null !== (chunk = readable.read())) { + * console.log(`Read ${chunk.length} bytes of data...`); + * } + * }); + * + * // 'end' will be triggered once when there is no more data available + * readable.on('end', () => { + * console.log('Reached end of stream.'); + * }); + * ``` + * + * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks + * are not concatenated. A `while` loop is necessary to consume all data + * currently in the buffer. When reading a large file `.read()` may return `null`, + * having consumed all buffered content so far, but there is still more data to + * come not yet buffered. In this case a new `'readable'` event will be emitted + * when there is more data in the buffer. Finally the `'end'` event will be + * emitted when there is no more data to come. + * + * Therefore to read a file's whole contents from a `readable`, it is necessary + * to collect chunks across multiple `'readable'` events: + * + * ```js + * const chunks = []; + * + * readable.on('readable', () => { + * let chunk; + * while (null !== (chunk = readable.read())) { + * chunks.push(chunk); + * } + * }); + * + * readable.on('end', () => { + * const content = chunks.join(''); + * }); + * ``` + * + * A `Readable` stream in object mode will always return a single item from + * a call to `readable.read(size)`, regardless of the value of the `size` argument. + * + * If the `readable.read()` method returns a chunk of data, a `'data'` event will + * also be emitted. + * + * Calling {@link read} after the `'end'` event has + * been emitted will return `null`. No runtime error will be raised. + * @since v0.9.4 + * @param size Optional argument to specify how much data to read. + */ + read(size?: number): any; + /** + * The `readable.setEncoding()` method sets the character encoding for + * data read from the `Readable` stream. + * + * By default, no encoding is assigned and stream data will be returned as `Buffer` objects. Setting an encoding causes the stream data + * to be returned as strings of the specified encoding rather than as `Buffer` objects. For instance, calling `readable.setEncoding('utf8')` will cause the + * output data to be interpreted as UTF-8 data, and passed as strings. Calling `readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal + * string format. + * + * The `Readable` stream will properly handle multi-byte characters delivered + * through the stream that would otherwise become improperly decoded if simply + * pulled from the stream as `Buffer` objects. + * + * ```js + * const readable = getReadableStreamSomehow(); + * readable.setEncoding('utf8'); + * readable.on('data', (chunk) => { + * assert.equal(typeof chunk, 'string'); + * console.log('Got %d characters of string data:', chunk.length); + * }); + * ``` + * @since v0.9.4 + * @param encoding The encoding to use. + */ + setEncoding(encoding: BufferEncoding): this; + /** + * The `readable.pause()` method will cause a stream in flowing mode to stop + * emitting `'data'` events, switching out of flowing mode. Any data that + * becomes available will remain in the internal buffer. + * + * ```js + * const readable = getReadableStreamSomehow(); + * readable.on('data', (chunk) => { + * console.log(`Received ${chunk.length} bytes of data.`); + * readable.pause(); + * console.log('There will be no additional data for 1 second.'); + * setTimeout(() => { + * console.log('Now data will start flowing again.'); + * readable.resume(); + * }, 1000); + * }); + * ``` + * + * The `readable.pause()` method has no effect if there is a `'readable'` event listener. + * @since v0.9.4 + */ + pause(): this; + /** + * The `readable.resume()` method causes an explicitly paused `Readable` stream to + * resume emitting `'data'` events, switching the stream into flowing mode. + * + * The `readable.resume()` method can be used to fully consume the data from a + * stream without actually processing any of that data: + * + * ```js + * getReadableStreamSomehow() + * .resume() + * .on('end', () => { + * console.log('Reached the end, but did not read anything.'); + * }); + * ``` + * + * The `readable.resume()` method has no effect if there is a `'readable'` event listener. + * @since v0.9.4 + */ + resume(): this; + /** + * The `readable.isPaused()` method returns the current operating state of the `Readable`. + * This is used primarily by the mechanism that underlies the `readable.pipe()` method. + * In most typical cases, there will be no reason to use this method directly. + * + * ```js + * const readable = new stream.Readable(); + * + * readable.isPaused(); // === false + * readable.pause(); + * readable.isPaused(); // === true + * readable.resume(); + * readable.isPaused(); // === false + * ``` + * @since v0.11.14 + */ + isPaused(): boolean; + /** + * The `readable.unpipe()` method detaches a `Writable` stream previously attached + * using the {@link pipe} method. + * + * If the `destination` is not specified, then _all_ pipes are detached. + * + * If the `destination` is specified, but no pipe is set up for it, then + * the method does nothing. + * + * ```js + * import fs from 'node:fs'; + * const readable = getReadableStreamSomehow(); + * const writable = fs.createWriteStream('file.txt'); + * // All the data from readable goes into 'file.txt', + * // but only for the first second. + * readable.pipe(writable); + * setTimeout(() => { + * console.log('Stop writing to file.txt.'); + * readable.unpipe(writable); + * console.log('Manually close the file stream.'); + * writable.end(); + * }, 1000); + * ``` + * @since v0.9.4 + * @param destination Optional specific stream to unpipe + */ + unpipe(destination?: NodeJS.WritableStream): this; + /** + * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the + * same as `readable.push(null)`, after which no more data can be written. The EOF + * signal is put at the end of the buffer and any buffered data will still be + * flushed. + * + * The `readable.unshift()` method pushes a chunk of data back into the internal + * buffer. This is useful in certain situations where a stream is being consumed by + * code that needs to "un-consume" some amount of data that it has optimistically + * pulled out of the source, so that the data can be passed on to some other party. + * + * The `stream.unshift(chunk)` method cannot be called after the `'end'` event + * has been emitted or a runtime error will be thrown. + * + * Developers using `stream.unshift()` often should consider switching to + * use of a `Transform` stream instead. See the `API for stream implementers` section for more information. + * + * ```js + * // Pull off a header delimited by \n\n. + * // Use unshift() if we get too much. + * // Call the callback with (error, header, stream). + * import { StringDecoder } from 'node:string_decoder'; + * function parseHeader(stream, callback) { + * stream.on('error', callback); + * stream.on('readable', onReadable); + * const decoder = new StringDecoder('utf8'); + * let header = ''; + * function onReadable() { + * let chunk; + * while (null !== (chunk = stream.read())) { + * const str = decoder.write(chunk); + * if (str.includes('\n\n')) { + * // Found the header boundary. + * const split = str.split(/\n\n/); + * header += split.shift(); + * const remaining = split.join('\n\n'); + * const buf = Buffer.from(remaining, 'utf8'); + * stream.removeListener('error', callback); + * // Remove the 'readable' listener before unshifting. + * stream.removeListener('readable', onReadable); + * if (buf.length) + * stream.unshift(buf); + * // Now the body of the message can be read from the stream. + * callback(null, header, stream); + * return; + * } + * // Still reading the header. + * header += str; + * } + * } + * } + * ``` + * + * Unlike {@link push}, `stream.unshift(chunk)` will not + * end the reading process by resetting the internal reading state of the stream. + * This can cause unexpected results if `readable.unshift()` is called during a + * read (i.e. from within a {@link _read} implementation on a + * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately, + * however it is best to simply avoid calling `readable.unshift()` while in the + * process of performing a read. + * @since v0.9.11 + * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must + * be a {string}, {Buffer}, {TypedArray}, {DataView} or `null`. For object mode streams, `chunk` may be any JavaScript value. + * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. + */ + unshift(chunk: any, encoding?: BufferEncoding): void; + /** + * Prior to Node.js 0.10, streams did not implement the entire `node:stream` module API as it is currently defined. (See `Compatibility` for more + * information.) + * + * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the `readable.wrap()` method can be used to create a `Readable` + * stream that uses + * the old stream as its data source. + * + * It will rarely be necessary to use `readable.wrap()` but the method has been + * provided as a convenience for interacting with older Node.js applications and + * libraries. + * + * ```js + * import { OldReader } from './old-api-module.js'; + * import { Readable } from 'node:stream'; + * const oreader = new OldReader(); + * const myReader = new Readable().wrap(oreader); + * + * myReader.on('readable', () => { + * myReader.read(); // etc. + * }); + * ``` + * @since v0.9.4 + * @param stream An "old style" readable stream + */ + wrap(stream: NodeJS.ReadableStream): this; + push(chunk: any, encoding?: BufferEncoding): boolean; + /** + * ```js + * import { Readable } from 'node:stream'; + * + * async function* splitToWords(source) { + * for await (const chunk of source) { + * const words = String(chunk).split(' '); + * + * for (const word of words) { + * yield word; + * } + * } + * } + * + * const wordsStream = Readable.from(['text passed through', 'composed stream']).compose(splitToWords); + * const words = await wordsStream.toArray(); + * + * console.log(words); // prints ['text', 'passed', 'through', 'composed', 'stream'] + * ``` + * + * `readable.compose(s)` is equivalent to `stream.compose(readable, s)`. + * + * This method also allows for an `AbortSignal` to be provided, which will destroy + * the composed stream when aborted. + * + * See [`stream.compose(...streams)`](https://nodejs.org/docs/latest-v25.x/api/stream.html#streamcomposestreams) for more information. + * @since v19.1.0, v18.13.0 + * @returns a stream composed with the stream `stream`. + */ + compose( + stream: NodeJS.WritableStream | web.WritableStream | web.TransformStream | ((source: any) => void), + options?: Abortable, + ): Duplex; + /** + * The iterator created by this method gives users the option to cancel the destruction + * of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`, + * or if the iterator should destroy the stream if the stream emitted an error during iteration. + * @since v16.3.0 + */ + iterator(options?: ReadableIteratorOptions): NodeJS.AsyncIterator; + /** + * This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream. + * If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream. + * @since v17.4.0, v16.14.0 + * @param fn a function to map over every chunk in the stream. Async or not. + * @returns a stream mapped with the function *fn*. + */ + map(fn: (data: any, options?: Abortable) => any, options?: ReadableOperatorOptions): Readable; + /** + * This method allows filtering the stream. For each chunk in the stream the *fn* function will be called + * and if it returns a truthy value, the chunk will be passed to the result stream. + * If the *fn* function returns a promise - that promise will be `await`ed. + * @since v17.4.0, v16.14.0 + * @param fn a function to filter chunks from the stream. Async or not. + * @returns a stream filtered with the predicate *fn*. + */ + filter( + fn: (data: any, options?: Abortable) => boolean | Promise, + options?: ReadableOperatorOptions, + ): Readable; + /** + * This method allows iterating a stream. For each chunk in the stream the *fn* function will be called. + * If the *fn* function returns a promise - that promise will be `await`ed. + * + * This method is different from `for await...of` loops in that it can optionally process chunks concurrently. + * In addition, a `forEach` iteration can only be stopped by having passed a `signal` option + * and aborting the related AbortController while `for await...of` can be stopped with `break` or `return`. + * In either case the stream will be destroyed. + * + * This method is different from listening to the `'data'` event in that it uses the `readable` event + * in the underlying machinary and can limit the number of concurrent *fn* calls. + * @since v17.5.0 + * @param fn a function to call on each chunk of the stream. Async or not. + * @returns a promise for when the stream has finished. + */ + forEach( + fn: (data: any, options?: Abortable) => void | Promise, + options?: Pick, + ): Promise; + /** + * This method allows easily obtaining the contents of a stream. + * + * As this method reads the entire stream into memory, it negates the benefits of streams. It's intended + * for interoperability and convenience, not as the primary way to consume streams. + * @since v17.5.0 + * @returns a promise containing an array with the contents of the stream. + */ + toArray(options?: Abortable): Promise; + /** + * This method is similar to `Array.prototype.some` and calls *fn* on each chunk in the stream + * until the awaited return value is `true` (or any truthy value). Once an *fn* call on a chunk + * `await`ed return value is truthy, the stream is destroyed and the promise is fulfilled with `true`. + * If none of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `false`. + * @since v17.5.0 + * @param fn a function to call on each chunk of the stream. Async or not. + * @returns a promise evaluating to `true` if *fn* returned a truthy value for at least one of the chunks. + */ + some( + fn: (data: any, options?: Abortable) => boolean | Promise, + options?: Pick, + ): Promise; + /** + * This method is similar to `Array.prototype.find` and calls *fn* on each chunk in the stream + * to find a chunk with a truthy value for *fn*. Once an *fn* call's awaited return value is truthy, + * the stream is destroyed and the promise is fulfilled with value for which *fn* returned a truthy value. + * If all of the *fn* calls on the chunks return a falsy value, the promise is fulfilled with `undefined`. + * @since v17.5.0 + * @param fn a function to call on each chunk of the stream. Async or not. + * @returns a promise evaluating to the first chunk for which *fn* evaluated with a truthy value, + * or `undefined` if no element was found. + */ + find( + fn: (data: any, options?: Abortable) => data is T, + options?: Pick, + ): Promise; + find( + fn: (data: any, options?: Abortable) => boolean | Promise, + options?: Pick, + ): Promise; + /** + * This method is similar to `Array.prototype.every` and calls *fn* on each chunk in the stream + * to check if all awaited return values are truthy value for *fn*. Once an *fn* call on a chunk + * `await`ed return value is falsy, the stream is destroyed and the promise is fulfilled with `false`. + * If all of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `true`. + * @since v17.5.0 + * @param fn a function to call on each chunk of the stream. Async or not. + * @returns a promise evaluating to `true` if *fn* returned a truthy value for every one of the chunks. + */ + every( + fn: (data: any, options?: Abortable) => boolean | Promise, + options?: Pick, + ): Promise; + /** + * This method returns a new stream by applying the given callback to each chunk of the stream + * and then flattening the result. + * + * It is possible to return a stream or another iterable or async iterable from *fn* and the result streams + * will be merged (flattened) into the returned stream. + * @since v17.5.0 + * @param fn a function to map over every chunk in the stream. May be async. May be a stream or generator. + * @returns a stream flat-mapped with the function *fn*. + */ + flatMap( + fn: (data: any, options?: Abortable) => any, + options?: Pick, + ): Readable; + /** + * This method returns a new stream with the first *limit* chunks dropped from the start. + * @since v17.5.0 + * @param limit the number of chunks to drop from the readable. + * @returns a stream with *limit* chunks dropped from the start. + */ + drop(limit: number, options?: Abortable): Readable; + /** + * This method returns a new stream with the first *limit* chunks. + * @since v17.5.0 + * @param limit the number of chunks to take from the readable. + * @returns a stream with *limit* chunks taken. + */ + take(limit: number, options?: Abortable): Readable; + /** + * This method calls *fn* on each chunk of the stream in order, passing it the result from the calculation + * on the previous element. It returns a promise for the final value of the reduction. + * + * If no *initial* value is supplied the first chunk of the stream is used as the initial value. + * If the stream is empty, the promise is rejected with a `TypeError` with the `ERR_INVALID_ARGS` code property. + * + * The reducer function iterates the stream element-by-element which means that there is no *concurrency* parameter + * or parallelism. To perform a reduce concurrently, you can extract the async function to `readable.map` method. + * @since v17.5.0 + * @param fn a reducer function to call over every chunk in the stream. Async or not. + * @param initial the initial value to use in the reduction. + * @returns a promise for the final value of the reduction. + */ + reduce(fn: (previous: any, data: any, options?: Abortable) => T): Promise; + reduce( + fn: (previous: T, data: any, options?: Abortable) => T, + initial: T, + options?: Abortable, + ): Promise; + _destroy(error: Error | null, callback: (error?: Error | null) => void): void; + /** + * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'` event (unless `emitClose` is set to `false`). After this call, the readable + * stream will release any internal resources and subsequent calls to `push()` will be ignored. + * + * Once `destroy()` has been called any further calls will be a no-op and no + * further errors except from `_destroy()` may be emitted as `'error'`. + * + * Implementors should not override this method, but instead implement `readable._destroy()`. + * @since v8.0.0 + * @param error Error which will be passed as payload in `'error'` event + */ + destroy(error?: Error): this; + /** + * @returns `AsyncIterator` to fully consume the stream. + * @since v10.0.0 + */ + [Symbol.asyncIterator](): NodeJS.AsyncIterator; + /** + * Calls `readable.destroy()` with an `AbortError` and returns + * a promise that fulfills when the stream is finished. + * @since v20.4.0 + */ + [Symbol.asyncDispose](): Promise; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: ReadableEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ReadableEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ReadableEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: ReadableEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: ReadableEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: ReadableEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: ReadableEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ReadableEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ReadableEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: ReadableEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ReadableEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface WritableOptions extends StreamOptions { + decodeStrings?: boolean | undefined; + defaultEncoding?: BufferEncoding | undefined; + write?: + | (( + this: T, + chunk: any, + encoding: BufferEncoding, + callback: (error?: Error | null) => void, + ) => void) + | undefined; + writev?: + | (( + this: T, + chunks: { + chunk: any; + encoding: BufferEncoding; + }[], + callback: (error?: Error | null) => void, + ) => void) + | undefined; + final?: ((this: T, callback: (error?: Error | null) => void) => void) | undefined; + } + interface WritableEventMap { + "close": []; + "drain": []; + "error": [err: Error]; + "finish": []; + "pipe": [src: Readable]; + "unpipe": [src: Readable]; + } + /** + * @since v0.9.4 + */ + class Writable extends Stream implements NodeJS.WritableStream { + constructor(options?: WritableOptions); + /** + * A utility method for creating a `Writable` from a web `WritableStream`. + * @since v17.0.0 + */ + static fromWeb( + writableStream: web.WritableStream, + options?: Pick, + ): Writable; + /** + * A utility method for creating a web `WritableStream` from a `Writable`. + * @since v17.0.0 + */ + static toWeb(streamWritable: NodeJS.WritableStream): web.WritableStream; + /** + * Is `true` if it is safe to call `writable.write()`, which means + * the stream has not been destroyed, errored, or ended. + * @since v11.4.0 + */ + writable: boolean; + /** + * Returns whether the stream was destroyed or errored before emitting `'finish'`. + * @since v18.0.0, v16.17.0 + */ + readonly writableAborted: boolean; + /** + * Is `true` after `writable.end()` has been called. This property + * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead. + * @since v12.9.0 + */ + readonly writableEnded: boolean; + /** + * Is set to `true` immediately before the `'finish'` event is emitted. + * @since v12.6.0 + */ + readonly writableFinished: boolean; + /** + * Return the value of `highWaterMark` passed when creating this `Writable`. + * @since v9.3.0 + */ + readonly writableHighWaterMark: number; + /** + * This property contains the number of bytes (or objects) in the queue + * ready to be written. The value provides introspection data regarding + * the status of the `highWaterMark`. + * @since v9.4.0 + */ + readonly writableLength: number; + /** + * Getter for the property `objectMode` of a given `Writable` stream. + * @since v12.3.0 + */ + readonly writableObjectMode: boolean; + /** + * Number of times `writable.uncork()` needs to be + * called in order to fully uncork the stream. + * @since v13.2.0, v12.16.0 + */ + readonly writableCorked: number; + /** + * Is `true` after `writable.destroy()` has been called. + * @since v8.0.0 + */ + destroyed: boolean; + /** + * Is `true` after `'close'` has been emitted. + * @since v18.0.0 + */ + readonly closed: boolean; + /** + * Returns error if the stream has been destroyed with an error. + * @since v18.0.0 + */ + readonly errored: Error | null; + /** + * Is `true` if the stream's buffer has been full and stream will emit `'drain'`. + * @since v15.2.0, v14.17.0 + */ + readonly writableNeedDrain: boolean; + _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + _writev?( + chunks: { + chunk: any; + encoding: BufferEncoding; + }[], + callback: (error?: Error | null) => void, + ): void; + _construct?(callback: (error?: Error | null) => void): void; + _destroy(error: Error | null, callback: (error?: Error | null) => void): void; + _final(callback: (error?: Error | null) => void): void; + /** + * The `writable.write()` method writes some data to the stream, and calls the + * supplied `callback` once the data has been fully handled. If an error + * occurs, the `callback` will be called with the error as its + * first argument. The `callback` is called asynchronously and before `'error'` is + * emitted. + * + * The return value is `true` if the internal buffer is less than the `highWaterMark` configured when the stream was created after admitting `chunk`. + * If `false` is returned, further attempts to write data to the stream should + * stop until the `'drain'` event is emitted. + * + * While a stream is not draining, calls to `write()` will buffer `chunk`, and + * return false. Once all currently buffered chunks are drained (accepted for + * delivery by the operating system), the `'drain'` event will be emitted. + * Once `write()` returns false, do not write more chunks + * until the `'drain'` event is emitted. While calling `write()` on a stream that + * is not draining is allowed, Node.js will buffer all written chunks until + * maximum memory usage occurs, at which point it will abort unconditionally. + * Even before it aborts, high memory usage will cause poor garbage collector + * performance and high RSS (which is not typically released back to the system, + * even after the memory is no longer required). Since TCP sockets may never + * drain if the remote peer does not read the data, writing a socket that is + * not draining may lead to a remotely exploitable vulnerability. + * + * Writing data while the stream is not draining is particularly + * problematic for a `Transform`, because the `Transform` streams are paused + * by default until they are piped or a `'data'` or `'readable'` event handler + * is added. + * + * If the data to be written can be generated or fetched on demand, it is + * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is + * possible to respect backpressure and avoid memory issues using the `'drain'` event: + * + * ```js + * function write(data, cb) { + * if (!stream.write(data)) { + * stream.once('drain', cb); + * } else { + * process.nextTick(cb); + * } + * } + * + * // Wait for cb to be called before doing any other write. + * write('hello', () => { + * console.log('Write completed, do more writes now.'); + * }); + * ``` + * + * A `Writable` stream in object mode will always ignore the `encoding` argument. + * @since v0.9.4 + * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, + * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`. + * @param [encoding='utf8'] The encoding, if `chunk` is a string. + * @param callback Callback for when this chunk of data is flushed. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean; + write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean; + /** + * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream. + * @since v0.11.15 + * @param encoding The new default encoding + */ + setDefaultEncoding(encoding: BufferEncoding): this; + /** + * Calling the `writable.end()` method signals that no more data will be written + * to the `Writable`. The optional `chunk` and `encoding` arguments allow one + * final additional chunk of data to be written immediately before closing the + * stream. + * + * Calling the {@link write} method after calling {@link end} will raise an error. + * + * ```js + * // Write 'hello, ' and then end with 'world!'. + * import fs from 'node:fs'; + * const file = fs.createWriteStream('example.txt'); + * file.write('hello, '); + * file.end('world!'); + * // Writing more now is not allowed! + * ``` + * @since v0.9.4 + * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, + * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`. + * @param encoding The encoding if `chunk` is a string + * @param callback Callback for when the stream is finished. + */ + end(cb?: () => void): this; + end(chunk: any, cb?: () => void): this; + end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; + /** + * The `writable.cork()` method forces all written data to be buffered in memory. + * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. + * + * The primary intent of `writable.cork()` is to accommodate a situation in which + * several small chunks are written to the stream in rapid succession. Instead of + * immediately forwarding them to the underlying destination, `writable.cork()` buffers all the chunks until `writable.uncork()` is called, which will pass them + * all to `writable._writev()`, if present. This prevents a head-of-line blocking + * situation where data is being buffered while waiting for the first small chunk + * to be processed. However, use of `writable.cork()` without implementing `writable._writev()` may have an adverse effect on throughput. + * + * See also: `writable.uncork()`, `writable._writev()`. + * @since v0.11.2 + */ + cork(): void; + /** + * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. + * + * When using `writable.cork()` and `writable.uncork()` to manage the buffering + * of writes to a stream, defer calls to `writable.uncork()` using `process.nextTick()`. Doing so allows batching of all `writable.write()` calls that occur within a given Node.js event + * loop phase. + * + * ```js + * stream.cork(); + * stream.write('some '); + * stream.write('data '); + * process.nextTick(() => stream.uncork()); + * ``` + * + * If the `writable.cork()` method is called multiple times on a stream, the + * same number of calls to `writable.uncork()` must be called to flush the buffered + * data. + * + * ```js + * stream.cork(); + * stream.write('some '); + * stream.cork(); + * stream.write('data '); + * process.nextTick(() => { + * stream.uncork(); + * // The data will not be flushed until uncork() is called a second time. + * stream.uncork(); + * }); + * ``` + * + * See also: `writable.cork()`. + * @since v0.11.2 + */ + uncork(): void; + /** + * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'` event (unless `emitClose` is set to `false`). After this call, the writable + * stream has ended and subsequent calls to `write()` or `end()` will result in + * an `ERR_STREAM_DESTROYED` error. + * This is a destructive and immediate way to destroy a stream. Previous calls to `write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. + * Use `end()` instead of destroy if data should flush before close, or wait for + * the `'drain'` event before destroying the stream. + * + * Once `destroy()` has been called any further calls will be a no-op and no + * further errors except from `_destroy()` may be emitted as `'error'`. + * + * Implementors should not override this method, + * but instead implement `writable._destroy()`. + * @since v8.0.0 + * @param error Optional, an error to emit with `'error'` event. + */ + destroy(error?: Error): this; + /** + * Calls `writable.destroy()` with an `AbortError` and returns + * a promise that fulfills when the stream is finished. + * @since v22.4.0, v20.16.0 + */ + [Symbol.asyncDispose](): Promise; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: WritableEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: WritableEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: WritableEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: WritableEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: WritableEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: WritableEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: WritableEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: WritableEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: WritableEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: WritableEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: WritableEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface DuplexOptions extends ReadableOptions, WritableOptions { + allowHalfOpen?: boolean | undefined; + readableObjectMode?: boolean | undefined; + writableObjectMode?: boolean | undefined; + readableHighWaterMark?: number | undefined; + writableHighWaterMark?: number | undefined; + writableCorked?: number | undefined; + } + interface DuplexToWebOptions { + type?: web.ReadableStreamType | undefined; + } + interface DuplexEventMap extends ReadableEventMap, WritableEventMap {} + /** + * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. + * + * Examples of `Duplex` streams include: + * + * * `TCP sockets` + * * `zlib streams` + * * `crypto streams` + * @since v0.9.4 + */ + class Duplex extends Stream implements NodeJS.ReadWriteStream { + constructor(options?: DuplexOptions); + /** + * A utility method for creating duplex streams. + * + * - `Stream` converts writable stream into writable `Duplex` and readable stream + * to `Duplex`. + * - `Blob` converts into readable `Duplex`. + * - `string` converts into readable `Duplex`. + * - `ArrayBuffer` converts into readable `Duplex`. + * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. + * - `AsyncGeneratorFunction` converts into a readable/writable transform + * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield + * `null`. + * - `AsyncFunction` converts into a writable `Duplex`. Must return + * either `null` or `undefined` + * - `Object ({ writable, readable })` converts `readable` and + * `writable` into `Stream` and then combines them into `Duplex` where the + * `Duplex` will write to the `writable` and read from the `readable`. + * - `Promise` converts into readable `Duplex`. Value `null` is ignored. + * + * @since v16.8.0 + */ + static from( + src: + | NodeJS.ReadableStream + | NodeJS.WritableStream + | Blob + | string + | Iterable + | AsyncIterable + | ((source: AsyncIterable) => AsyncIterable) + | ((source: AsyncIterable) => Promise) + | Promise + | web.ReadableWritablePair + | web.ReadableStream + | web.WritableStream, + ): Duplex; + /** + * A utility method for creating a web `ReadableStream` and `WritableStream` from a `Duplex`. + * @since v17.0.0 + */ + static toWeb(streamDuplex: NodeJS.ReadWriteStream, options?: DuplexToWebOptions): web.ReadableWritablePair; + /** + * A utility method for creating a `Duplex` from a web `ReadableStream` and `WritableStream`. + * @since v17.0.0 + */ + static fromWeb( + duplexStream: web.ReadableWritablePair, + options?: Pick< + DuplexOptions, + "allowHalfOpen" | "decodeStrings" | "encoding" | "highWaterMark" | "objectMode" | "signal" + >, + ): Duplex; + /** + * If `false` then the stream will automatically end the writable side when the + * readable side ends. Set initially by the `allowHalfOpen` constructor option, + * which defaults to `true`. + * + * This can be changed manually to change the half-open behavior of an existing + * `Duplex` stream instance, but must be changed before the `'end'` event is emitted. + * @since v0.9.4 + */ + allowHalfOpen: boolean; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: DuplexEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: DuplexEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: DuplexEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: DuplexEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: DuplexEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: DuplexEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once(eventName: E, listener: (...args: DuplexEventMap[E]) => void): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: DuplexEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: DuplexEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: DuplexEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: DuplexEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface Duplex extends Readable, Writable {} + /** + * The utility function `duplexPair` returns an Array with two items, + * each being a `Duplex` stream connected to the other side: + * + * ```js + * const [ sideA, sideB ] = duplexPair(); + * ``` + * + * Whatever is written to one stream is made readable on the other. It provides + * behavior analogous to a network connection, where the data written by the client + * becomes readable by the server, and vice-versa. + * + * The Duplex streams are symmetrical; one or the other may be used without any + * difference in behavior. + * @param options A value to pass to both {@link Duplex} constructors, + * to set options such as buffering. + * @since v22.6.0 + */ + function duplexPair(options?: DuplexOptions): [Duplex, Duplex]; + type TransformCallback = (error?: Error | null, data?: any) => void; + interface TransformOptions extends DuplexOptions { + transform?: + | ((this: T, chunk: any, encoding: BufferEncoding, callback: TransformCallback) => void) + | undefined; + flush?: ((this: T, callback: TransformCallback) => void) | undefined; + } + /** + * Transform streams are `Duplex` streams where the output is in some way + * related to the input. Like all `Duplex` streams, `Transform` streams + * implement both the `Readable` and `Writable` interfaces. + * + * Examples of `Transform` streams include: + * + * * `zlib streams` + * * `crypto streams` + * @since v0.9.4 + */ + class Transform extends Duplex { + constructor(options?: TransformOptions); + _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; + _flush(callback: TransformCallback): void; + } + /** + * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is + * primarily for examples and testing, but there are some use cases where `stream.PassThrough` is useful as a building block for novel sorts of streams. + */ + class PassThrough extends Transform {} + /** + * A stream to attach a signal to. + * + * Attaches an AbortSignal to a readable or writeable stream. This lets code + * control stream destruction using an `AbortController`. + * + * Calling `abort` on the `AbortController` corresponding to the passed `AbortSignal` will behave the same way as calling `.destroy(new AbortError())` on the + * stream, and `controller.error(new AbortError())` for webstreams. + * + * ```js + * import fs from 'node:fs'; + * + * const controller = new AbortController(); + * const read = addAbortSignal( + * controller.signal, + * fs.createReadStream(('object.json')), + * ); + * // Later, abort the operation closing the stream + * controller.abort(); + * ``` + * + * Or using an `AbortSignal` with a readable stream as an async iterable: + * + * ```js + * const controller = new AbortController(); + * setTimeout(() => controller.abort(), 10_000); // set a timeout + * const stream = addAbortSignal( + * controller.signal, + * fs.createReadStream(('object.json')), + * ); + * (async () => { + * try { + * for await (const chunk of stream) { + * await process(chunk); + * } + * } catch (e) { + * if (e.name === 'AbortError') { + * // The operation was cancelled + * } else { + * throw e; + * } + * } + * })(); + * ``` + * + * Or using an `AbortSignal` with a ReadableStream: + * + * ```js + * const controller = new AbortController(); + * const rs = new ReadableStream({ + * start(controller) { + * controller.enqueue('hello'); + * controller.enqueue('world'); + * controller.close(); + * }, + * }); + * + * addAbortSignal(controller.signal, rs); + * + * finished(rs, (err) => { + * if (err) { + * if (err.name === 'AbortError') { + * // The operation was cancelled + * } + * } + * }); + * + * const reader = rs.getReader(); + * + * reader.read().then(({ value, done }) => { + * console.log(value); // hello + * console.log(done); // false + * controller.abort(); + * }); + * ``` + * @since v15.4.0 + * @param signal A signal representing possible cancellation + * @param stream A stream to attach a signal to. + */ + function addAbortSignal< + T extends NodeJS.ReadableStream | NodeJS.WritableStream | web.ReadableStream | web.WritableStream, + >(signal: AbortSignal, stream: T): T; + /** + * Returns the default highWaterMark used by streams. + * Defaults to `65536` (64 KiB), or `16` for `objectMode`. + * @since v19.9.0 + */ + function getDefaultHighWaterMark(objectMode: boolean): number; + /** + * Sets the default highWaterMark used by streams. + * @since v19.9.0 + * @param value highWaterMark value + */ + function setDefaultHighWaterMark(objectMode: boolean, value: number): void; + interface FinishedOptions extends Abortable { + error?: boolean | undefined; + readable?: boolean | undefined; + writable?: boolean | undefined; + } + /** + * A readable and/or writable stream/webstream. + * + * A function to get notified when a stream is no longer readable, writable + * or has experienced an error or a premature close event. + * + * ```js + * import { finished } from 'node:stream'; + * import fs from 'node:fs'; + * + * const rs = fs.createReadStream('archive.tar'); + * + * finished(rs, (err) => { + * if (err) { + * console.error('Stream failed.', err); + * } else { + * console.log('Stream is done reading.'); + * } + * }); + * + * rs.resume(); // Drain the stream. + * ``` + * + * Especially useful in error handling scenarios where a stream is destroyed + * prematurely (like an aborted HTTP request), and will not emit `'end'` or `'finish'`. + * + * The `finished` API provides [`promise version`](https://nodejs.org/docs/latest-v25.x/api/stream.html#streamfinishedstream-options). + * + * `stream.finished()` leaves dangling event listeners (in particular `'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been + * invoked. The reason for this is so that unexpected `'error'` events (due to + * incorrect stream implementations) do not cause unexpected crashes. + * If this is unwanted behavior then the returned cleanup function needs to be + * invoked in the callback: + * + * ```js + * const cleanup = finished(rs, (err) => { + * cleanup(); + * // ... + * }); + * ``` + * @since v10.0.0 + * @param stream A readable and/or writable stream. + * @param callback A callback function that takes an optional error argument. + * @returns A cleanup function which removes all registered listeners. + */ + function finished( + stream: NodeJS.ReadableStream | NodeJS.WritableStream | web.ReadableStream | web.WritableStream, + options: FinishedOptions, + callback: (err?: NodeJS.ErrnoException | null) => void, + ): () => void; + function finished( + stream: NodeJS.ReadableStream | NodeJS.WritableStream | web.ReadableStream | web.WritableStream, + callback: (err?: NodeJS.ErrnoException | null) => void, + ): () => void; + namespace finished { + import __promisify__ = promises.finished; + export { __promisify__ }; + } + type PipelineSourceFunction = (options?: Abortable) => Iterable | AsyncIterable; + type PipelineSource = + | NodeJS.ReadableStream + | web.ReadableStream + | web.TransformStream + | Iterable + | AsyncIterable + | PipelineSourceFunction; + type PipelineSourceArgument = (T extends (...args: any[]) => infer R ? R : T) extends infer S + ? S extends web.TransformStream ? web.ReadableStream : S + : never; + type PipelineTransformGenerator, O> = ( + source: PipelineSourceArgument, + options?: Abortable, + ) => AsyncIterable; + type PipelineTransformStreams = + | NodeJS.ReadWriteStream + | web.TransformStream; + type PipelineTransform, O> = S extends + PipelineSource | PipelineTransformStreams | ((...args: any[]) => infer I) + ? PipelineTransformStreams | PipelineTransformGenerator + : never; + type PipelineTransformSource = PipelineSource | PipelineTransform; + type PipelineDestinationFunction, R> = ( + source: PipelineSourceArgument, + options?: Abortable, + ) => R; + type PipelineDestination, R> = S extends + PipelineSource | PipelineTransform ? + | NodeJS.WritableStream + | web.WritableStream + | web.TransformStream + | PipelineDestinationFunction + : never; + type PipelineCallback> = ( + err: NodeJS.ErrnoException | null, + value: S extends (...args: any[]) => PromiseLike ? R : undefined, + ) => void; + type PipelineResult> = S extends NodeJS.WritableStream ? S : Duplex; + /** + * A module method to pipe between streams and generators forwarding errors and + * properly cleaning up and provide a callback when the pipeline is complete. + * + * ```js + * import { pipeline } from 'node:stream'; + * import fs from 'node:fs'; + * import zlib from 'node:zlib'; + * + * // Use the pipeline API to easily pipe a series of streams + * // together and get notified when the pipeline is fully done. + * + * // A pipeline to gzip a potentially huge tar file efficiently: + * + * pipeline( + * fs.createReadStream('archive.tar'), + * zlib.createGzip(), + * fs.createWriteStream('archive.tar.gz'), + * (err) => { + * if (err) { + * console.error('Pipeline failed.', err); + * } else { + * console.log('Pipeline succeeded.'); + * } + * }, + * ); + * ``` + * + * The `pipeline` API provides a [`promise version`](https://nodejs.org/docs/latest-v25.x/api/stream.html#streampipelinesource-transforms-destination-options). + * + * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: + * + * * `Readable` streams which have emitted `'end'` or `'close'`. + * * `Writable` streams which have emitted `'finish'` or `'close'`. + * + * `stream.pipeline()` leaves dangling event listeners on the streams + * after the `callback` has been invoked. In the case of reuse of streams after + * failure, this can cause event listener leaks and swallowed errors. If the last + * stream is readable, dangling event listeners will be removed so that the last + * stream can be consumed later. + * + * `stream.pipeline()` closes all the streams when an error is raised. + * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior + * once it would destroy the socket without sending the expected response. + * See the example below: + * + * ```js + * import fs from 'node:fs'; + * import http from 'node:http'; + * import { pipeline } from 'node:stream'; + * + * const server = http.createServer((req, res) => { + * const fileStream = fs.createReadStream('./fileNotExist.txt'); + * pipeline(fileStream, res, (err) => { + * if (err) { + * console.log(err); // No such file + * // this message can't be sent once `pipeline` already destroyed the socket + * return res.end('error!!!'); + * } + * }); + * }); + * ``` + * @since v10.0.0 + * @param callback Called when the pipeline is fully done. + */ + function pipeline, D extends PipelineDestination>( + source: S, + destination: D, + callback: PipelineCallback, + ): PipelineResult; + function pipeline< + S extends PipelineSource, + T extends PipelineTransform, + D extends PipelineDestination, + >( + source: S, + transform: T, + destination: D, + callback: PipelineCallback, + ): PipelineResult; + function pipeline< + S extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + D extends PipelineDestination, + >( + source: S, + transform1: T1, + transform2: T2, + destination: D, + callback: PipelineCallback, + ): PipelineResult; + function pipeline< + S extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + D extends PipelineDestination, + >( + source: S, + transform1: T1, + transform2: T2, + transform3: T3, + destination: D, + callback: PipelineCallback, + ): PipelineResult; + function pipeline< + S extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + D extends PipelineDestination, + >( + source: S, + transform1: T1, + transform2: T2, + transform3: T3, + transform4: T4, + destination: D, + callback: PipelineCallback, + ): PipelineResult; + function pipeline( + streams: ReadonlyArray | PipelineTransform | PipelineDestination>, + callback: (err: NodeJS.ErrnoException | null) => void, + ): NodeJS.WritableStream; + function pipeline( + ...streams: [ + ...[PipelineSource, ...PipelineTransform[], PipelineDestination], + callback: ((err: NodeJS.ErrnoException | null) => void), + ] + ): NodeJS.WritableStream; + namespace pipeline { + import __promisify__ = promises.pipeline; + export { __promisify__ }; + } + type ComposeSource = + | NodeJS.ReadableStream + | web.ReadableStream + | Iterable + | AsyncIterable + | (() => AsyncIterable); + type ComposeTransformStreams = NodeJS.ReadWriteStream | web.TransformStream; + type ComposeTransformGenerator = (source: AsyncIterable) => AsyncIterable; + type ComposeTransform, O> = S extends + ComposeSource | ComposeTransformStreams | ComposeTransformGenerator + ? ComposeTransformStreams | ComposeTransformGenerator + : never; + type ComposeTransformSource = ComposeSource | ComposeTransform; + type ComposeDestination> = S extends ComposeTransformSource ? + | NodeJS.WritableStream + | web.WritableStream + | web.TransformStream + | ((source: AsyncIterable) => void) + : never; + /** + * Combines two or more streams into a `Duplex` stream that writes to the + * first stream and reads from the last. Each provided stream is piped into + * the next, using `stream.pipeline`. If any of the streams error then all + * are destroyed, including the outer `Duplex` stream. + * + * Because `stream.compose` returns a new stream that in turn can (and + * should) be piped into other streams, it enables composition. In contrast, + * when passing streams to `stream.pipeline`, typically the first stream is + * a readable stream and the last a writable stream, forming a closed + * circuit. + * + * If passed a `Function` it must be a factory method taking a `source` + * `Iterable`. + * + * ```js + * import { compose, Transform } from 'node:stream'; + * + * const removeSpaces = new Transform({ + * transform(chunk, encoding, callback) { + * callback(null, String(chunk).replace(' ', '')); + * }, + * }); + * + * async function* toUpper(source) { + * for await (const chunk of source) { + * yield String(chunk).toUpperCase(); + * } + * } + * + * let res = ''; + * for await (const buf of compose(removeSpaces, toUpper).end('hello world')) { + * res += buf; + * } + * + * console.log(res); // prints 'HELLOWORLD' + * ``` + * + * `stream.compose` can be used to convert async iterables, generators and + * functions into streams. + * + * * `AsyncIterable` converts into a readable `Duplex`. Cannot yield + * `null`. + * * `AsyncGeneratorFunction` converts into a readable/writable transform `Duplex`. + * Must take a source `AsyncIterable` as first parameter. Cannot yield + * `null`. + * * `AsyncFunction` converts into a writable `Duplex`. Must return + * either `null` or `undefined`. + * + * ```js + * import { compose } from 'node:stream'; + * import { finished } from 'node:stream/promises'; + * + * // Convert AsyncIterable into readable Duplex. + * const s1 = compose(async function*() { + * yield 'Hello'; + * yield 'World'; + * }()); + * + * // Convert AsyncGenerator into transform Duplex. + * const s2 = compose(async function*(source) { + * for await (const chunk of source) { + * yield String(chunk).toUpperCase(); + * } + * }); + * + * let res = ''; + * + * // Convert AsyncFunction into writable Duplex. + * const s3 = compose(async function(source) { + * for await (const chunk of source) { + * res += chunk; + * } + * }); + * + * await finished(compose(s1, s2, s3)); + * + * console.log(res); // prints 'HELLOWORLD' + * ``` + * + * For convenience, the `readable.compose(stream)` method is available on + * `Readable` and `Duplex` streams as a wrapper for this function. + * @since v16.9.0 + * @experimental + */ + /* eslint-disable @definitelytyped/no-unnecessary-generics */ + function compose(stream: ComposeSource | ComposeDestination): Duplex; + function compose< + S extends ComposeSource | ComposeTransform, + D extends ComposeTransform | ComposeDestination, + >( + source: S, + destination: D, + ): Duplex; + function compose< + S extends ComposeSource | ComposeTransform, + T extends ComposeTransform, + D extends ComposeTransform | ComposeDestination, + >(source: S, transform: T, destination: D): Duplex; + function compose< + S extends ComposeSource | ComposeTransform, + T1 extends ComposeTransform, + T2 extends ComposeTransform, + D extends ComposeTransform | ComposeDestination, + >(source: S, transform1: T1, transform2: T2, destination: D): Duplex; + function compose< + S extends ComposeSource | ComposeTransform, + T1 extends ComposeTransform, + T2 extends ComposeTransform, + T3 extends ComposeTransform, + D extends ComposeTransform | ComposeDestination, + >(source: S, transform1: T1, transform2: T2, transform3: T3, destination: D): Duplex; + function compose< + S extends ComposeSource | ComposeTransform, + T1 extends ComposeTransform, + T2 extends ComposeTransform, + T3 extends ComposeTransform, + T4 extends ComposeTransform, + D extends ComposeTransform | ComposeDestination, + >(source: S, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: D): Duplex; + function compose( + ...streams: [ + ComposeSource, + ...ComposeTransform[], + ComposeDestination, + ] + ): Duplex; + /* eslint-enable @definitelytyped/no-unnecessary-generics */ + /** + * Returns whether the stream has encountered an error. + * @since v17.3.0, v16.14.0 + */ + function isErrored( + stream: NodeJS.ReadableStream | NodeJS.WritableStream | web.ReadableStream | web.WritableStream, + ): boolean; + /** + * Returns whether the stream is readable. + * @since v17.4.0, v16.14.0 + * @returns Only returns `null` if `stream` is not a valid `Readable`, `Duplex` or `ReadableStream`. + */ + function isReadable(stream: NodeJS.ReadableStream | web.ReadableStream): boolean | null; + /** + * Returns whether the stream is writable. + * @since v20.0.0 + * @returns Only returns `null` if `stream` is not a valid `Writable`, `Duplex` or `WritableStream`. + */ + function isWritable(stream: NodeJS.WritableStream | web.WritableStream): boolean | null; + } + global { + namespace NodeJS { + // These interfaces are vestigial, and correspond roughly to the "streams2" interfaces + // from early versions of Node.js, but they are still used widely across the ecosystem. + // Accordingly, they are commonly used as "in-types" for @types/node APIs, so that + // eg. streams returned from older libraries will still be considered valid input to + // functions which accept stream arguments. + // It's not possible to change or remove these without astronomical levels of breakage. + interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: BufferEncoding): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean | undefined }): T; + unpipe(destination?: WritableStream): this; + unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; + wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; + write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; + end(cb?: () => void): this; + end(data: string | Uint8Array, cb?: () => void): this; + end(str: string, encoding?: BufferEncoding, cb?: () => void): this; + } + interface ReadWriteStream extends ReadableStream, WritableStream {} + } + } + export = Stream; +} +declare module "stream" { + import stream = require("node:stream"); + export = stream; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/stream/consumers.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/stream/consumers.d.ts new file mode 100644 index 0000000..97f260d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/stream/consumers.d.ts @@ -0,0 +1,38 @@ +/** + * The utility consumer functions provide common options for consuming + * streams. + * @since v16.7.0 + */ +declare module "node:stream/consumers" { + import { Blob, NonSharedBuffer } from "node:buffer"; + import { ReadableStream } from "node:stream/web"; + /** + * @since v16.7.0 + * @returns Fulfills with an `ArrayBuffer` containing the full contents of the stream. + */ + function arrayBuffer(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with a `Blob` containing the full contents of the stream. + */ + function blob(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with a `Buffer` containing the full contents of the stream. + */ + function buffer(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with the contents of the stream parsed as a + * UTF-8 encoded string that is then passed through `JSON.parse()`. + */ + function json(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with the contents of the stream parsed as a UTF-8 encoded string. + */ + function text(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; +} +declare module "stream/consumers" { + export * from "node:stream/consumers"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/stream/promises.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/stream/promises.d.ts new file mode 100644 index 0000000..c4bd3ea --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/stream/promises.d.ts @@ -0,0 +1,211 @@ +declare module "node:stream/promises" { + import { Abortable } from "node:events"; + import { + FinishedOptions as _FinishedOptions, + PipelineDestination, + PipelineSource, + PipelineTransform, + } from "node:stream"; + import { ReadableStream, WritableStream } from "node:stream/web"; + interface FinishedOptions extends _FinishedOptions { + /** + * If true, removes the listeners registered by this function before the promise is fulfilled. + * @default false + */ + cleanup?: boolean | undefined; + } + /** + * ```js + * import { finished } from 'node:stream/promises'; + * import { createReadStream } from 'node:fs'; + * + * const rs = createReadStream('archive.tar'); + * + * async function run() { + * await finished(rs); + * console.log('Stream is done reading.'); + * } + * + * run().catch(console.error); + * rs.resume(); // Drain the stream. + * ``` + * + * The `finished` API also provides a [callback version](https://nodejs.org/docs/latest-v25.x/api/stream.html#streamfinishedstream-options-callback). + * + * `stream.finished()` leaves dangling event listeners (in particular + * `'error'`, `'end'`, `'finish'` and `'close'`) after the returned promise is + * resolved or rejected. The reason for this is so that unexpected `'error'` + * events (due to incorrect stream implementations) do not cause unexpected + * crashes. If this is unwanted behavior then `options.cleanup` should be set to + * `true`: + * + * ```js + * await finished(rs, { cleanup: true }); + * ``` + * @since v15.0.0 + * @returns Fulfills when the stream is no longer readable or writable. + */ + function finished( + stream: NodeJS.ReadableStream | NodeJS.WritableStream | ReadableStream | WritableStream, + options?: FinishedOptions, + ): Promise; + interface PipelineOptions extends Abortable { + end?: boolean | undefined; + } + type PipelineResult> = S extends (...args: any[]) => PromiseLike + ? Promise + : Promise; + /** + * ```js + * import { pipeline } from 'node:stream/promises'; + * import { createReadStream, createWriteStream } from 'node:fs'; + * import { createGzip } from 'node:zlib'; + * + * await pipeline( + * createReadStream('archive.tar'), + * createGzip(), + * createWriteStream('archive.tar.gz'), + * ); + * console.log('Pipeline succeeded.'); + * ``` + * + * To use an `AbortSignal`, pass it inside an options object, as the last argument. + * When the signal is aborted, `destroy` will be called on the underlying pipeline, + * with an `AbortError`. + * + * ```js + * import { pipeline } from 'node:stream/promises'; + * import { createReadStream, createWriteStream } from 'node:fs'; + * import { createGzip } from 'node:zlib'; + * + * const ac = new AbortController(); + * const { signal } = ac; + * setImmediate(() => ac.abort()); + * try { + * await pipeline( + * createReadStream('archive.tar'), + * createGzip(), + * createWriteStream('archive.tar.gz'), + * { signal }, + * ); + * } catch (err) { + * console.error(err); // AbortError + * } + * ``` + * + * The `pipeline` API also supports async generators: + * + * ```js + * import { pipeline } from 'node:stream/promises'; + * import { createReadStream, createWriteStream } from 'node:fs'; + * + * await pipeline( + * createReadStream('lowercase.txt'), + * async function* (source, { signal }) { + * source.setEncoding('utf8'); // Work with strings rather than `Buffer`s. + * for await (const chunk of source) { + * yield await processChunk(chunk, { signal }); + * } + * }, + * createWriteStream('uppercase.txt'), + * ); + * console.log('Pipeline succeeded.'); + * ``` + * + * Remember to handle the `signal` argument passed into the async generator. + * Especially in the case where the async generator is the source for the + * pipeline (i.e. first argument) or the pipeline will never complete. + * + * ```js + * import { pipeline } from 'node:stream/promises'; + * import fs from 'node:fs'; + * await pipeline( + * async function* ({ signal }) { + * await someLongRunningfn({ signal }); + * yield 'asd'; + * }, + * fs.createWriteStream('uppercase.txt'), + * ); + * console.log('Pipeline succeeded.'); + * ``` + * + * The `pipeline` API provides [callback version](https://nodejs.org/docs/latest-v25.x/api/stream.html#streampipelinesource-transforms-destination-callback): + * @since v15.0.0 + * @returns Fulfills when the pipeline is complete. + */ + function pipeline, B extends PipelineDestination>( + source: A, + destination: B, + options?: PipelineOptions, + ): PipelineResult; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + B extends PipelineDestination, + >( + source: A, + transform1: T1, + destination: B, + options?: PipelineOptions, + ): PipelineResult; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + B extends PipelineDestination, + >( + source: A, + transform1: T1, + transform2: T2, + destination: B, + options?: PipelineOptions, + ): PipelineResult; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination, + >( + source: A, + transform1: T1, + transform2: T2, + transform3: T3, + destination: B, + options?: PipelineOptions, + ): PipelineResult; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination, + >( + source: A, + transform1: T1, + transform2: T2, + transform3: T3, + transform4: T4, + destination: B, + options?: PipelineOptions, + ): PipelineResult; + function pipeline( + streams: readonly [PipelineSource, ...PipelineTransform[], PipelineDestination], + options?: PipelineOptions, + ): Promise; + function pipeline( + ...streams: [PipelineSource, ...PipelineTransform[], PipelineDestination] + ): Promise; + function pipeline( + ...streams: [ + PipelineSource, + ...PipelineTransform[], + PipelineDestination, + options: PipelineOptions, + ] + ): Promise; +} +declare module "stream/promises" { + export * from "node:stream/promises"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/stream/web.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/stream/web.d.ts new file mode 100644 index 0000000..32ce406 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/stream/web.d.ts @@ -0,0 +1,296 @@ +declare module "node:stream/web" { + import { TextDecoderCommon, TextDecoderOptions, TextEncoderCommon } from "node:util"; + type CompressionFormat = "brotli" | "deflate" | "deflate-raw" | "gzip"; + type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; + type ReadableStreamReader = ReadableStreamDefaultReader | ReadableStreamBYOBReader; + type ReadableStreamReaderMode = "byob"; + type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; + type ReadableStreamType = "bytes"; + interface GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + interface QueuingStrategy { + highWaterMark?: number; + size?: QueuingStrategySize; + } + interface QueuingStrategyInit { + highWaterMark: number; + } + interface QueuingStrategySize { + (chunk: T): number; + } + interface ReadableStreamBYOBReaderReadOptions { + min?: number; + } + interface ReadableStreamGenericReader { + readonly closed: Promise; + cancel(reason?: any): Promise; + } + interface ReadableStreamGetReaderOptions { + mode?: ReadableStreamReaderMode; + } + interface ReadableStreamIteratorOptions { + preventCancel?: boolean; + } + interface ReadableStreamReadDoneResult { + done: true; + value: T | undefined; + } + interface ReadableStreamReadValueResult { + done: false; + value: T; + } + interface ReadableWritablePair { + readable: ReadableStream; + writable: WritableStream; + } + interface StreamPipeOptions { + preventAbort?: boolean; + preventCancel?: boolean; + preventClose?: boolean; + signal?: AbortSignal; + } + interface Transformer { + flush?: TransformerFlushCallback; + readableType?: undefined; + start?: TransformerStartCallback; + transform?: TransformerTransformCallback; + writableType?: undefined; + } + interface TransformerFlushCallback { + (controller: TransformStreamDefaultController): void | PromiseLike; + } + interface TransformerStartCallback { + (controller: TransformStreamDefaultController): any; + } + interface TransformerTransformCallback { + (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike; + } + interface UnderlyingByteSource { + autoAllocateChunkSize?: number; + cancel?: UnderlyingSourceCancelCallback; + pull?: (controller: ReadableByteStreamController) => void | PromiseLike; + start?: (controller: ReadableByteStreamController) => any; + type: "bytes"; + } + interface UnderlyingDefaultSource { + cancel?: UnderlyingSourceCancelCallback; + pull?: (controller: ReadableStreamDefaultController) => void | PromiseLike; + start?: (controller: ReadableStreamDefaultController) => any; + type?: undefined; + } + interface UnderlyingSink { + abort?: UnderlyingSinkAbortCallback; + close?: UnderlyingSinkCloseCallback; + start?: UnderlyingSinkStartCallback; + type?: undefined; + write?: UnderlyingSinkWriteCallback; + } + interface UnderlyingSinkAbortCallback { + (reason?: any): void | PromiseLike; + } + interface UnderlyingSinkCloseCallback { + (): void | PromiseLike; + } + interface UnderlyingSinkStartCallback { + (controller: WritableStreamDefaultController): any; + } + interface UnderlyingSinkWriteCallback { + (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike; + } + interface UnderlyingSource { + autoAllocateChunkSize?: number; + cancel?: UnderlyingSourceCancelCallback; + pull?: UnderlyingSourcePullCallback; + start?: UnderlyingSourceStartCallback; + type?: ReadableStreamType; + } + interface UnderlyingSourceCancelCallback { + (reason?: any): void | PromiseLike; + } + interface UnderlyingSourcePullCallback { + (controller: ReadableStreamController): void | PromiseLike; + } + interface UnderlyingSourceStartCallback { + (controller: ReadableStreamController): any; + } + interface ByteLengthQueuingStrategy extends QueuingStrategy { + readonly highWaterMark: number; + readonly size: QueuingStrategySize; + } + var ByteLengthQueuingStrategy: { + prototype: ByteLengthQueuingStrategy; + new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; + }; + interface CompressionStream extends GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + var CompressionStream: { + prototype: CompressionStream; + new(format: CompressionFormat): CompressionStream; + }; + interface CountQueuingStrategy extends QueuingStrategy { + readonly highWaterMark: number; + readonly size: QueuingStrategySize; + } + var CountQueuingStrategy: { + prototype: CountQueuingStrategy; + new(init: QueuingStrategyInit): CountQueuingStrategy; + }; + interface DecompressionStream extends GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + var DecompressionStream: { + prototype: DecompressionStream; + new(format: CompressionFormat): DecompressionStream; + }; + interface ReadableByteStreamController { + readonly byobRequest: ReadableStreamBYOBRequest | null; + readonly desiredSize: number | null; + close(): void; + enqueue(chunk: NodeJS.NonSharedArrayBufferView): void; + error(e?: any): void; + } + var ReadableByteStreamController: { + prototype: ReadableByteStreamController; + new(): ReadableByteStreamController; + }; + interface ReadableStream { + readonly locked: boolean; + cancel(reason?: any): Promise; + getReader(options: { mode: "byob" }): ReadableStreamBYOBReader; + getReader(): ReadableStreamDefaultReader; + getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReader; + pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; + pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; + tee(): [ReadableStream, ReadableStream]; + [Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator; + values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator; + } + var ReadableStream: { + prototype: ReadableStream; + new( + underlyingSource: UnderlyingByteSource, + strategy?: { highWaterMark?: number }, + ): ReadableStream; + new(underlyingSource: UnderlyingDefaultSource, strategy?: QueuingStrategy): ReadableStream; + new(underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; + from(iterable: Iterable | AsyncIterable): ReadableStream; + }; + interface ReadableStreamAsyncIterator extends NodeJS.AsyncIterator { + [Symbol.asyncIterator](): ReadableStreamAsyncIterator; + } + interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { + read( + view: T, + options?: ReadableStreamBYOBReaderReadOptions, + ): Promise>; + releaseLock(): void; + } + var ReadableStreamBYOBReader: { + prototype: ReadableStreamBYOBReader; + new(stream: ReadableStream): ReadableStreamBYOBReader; + }; + interface ReadableStreamBYOBRequest { + readonly view: NodeJS.NonSharedArrayBufferView | null; + respond(bytesWritten: number): void; + respondWithNewView(view: NodeJS.NonSharedArrayBufferView): void; + } + var ReadableStreamBYOBRequest: { + prototype: ReadableStreamBYOBRequest; + new(): ReadableStreamBYOBRequest; + }; + interface ReadableStreamDefaultController { + readonly desiredSize: number | null; + close(): void; + enqueue(chunk?: R): void; + error(e?: any): void; + } + var ReadableStreamDefaultController: { + prototype: ReadableStreamDefaultController; + new(): ReadableStreamDefaultController; + }; + interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { + read(): Promise>; + releaseLock(): void; + } + var ReadableStreamDefaultReader: { + prototype: ReadableStreamDefaultReader; + new(stream: ReadableStream): ReadableStreamDefaultReader; + }; + interface TextDecoderStream extends GenericTransformStream, TextDecoderCommon { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + var TextDecoderStream: { + prototype: TextDecoderStream; + new(label?: string, options?: TextDecoderOptions): TextDecoderStream; + }; + interface TextEncoderStream extends GenericTransformStream, TextEncoderCommon { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + var TextEncoderStream: { + prototype: TextEncoderStream; + new(): TextEncoderStream; + }; + interface TransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + var TransformStream: { + prototype: TransformStream; + new( + transformer?: Transformer, + writableStrategy?: QueuingStrategy, + readableStrategy?: QueuingStrategy, + ): TransformStream; + }; + interface TransformStreamDefaultController { + readonly desiredSize: number | null; + enqueue(chunk?: O): void; + error(reason?: any): void; + terminate(): void; + } + var TransformStreamDefaultController: { + prototype: TransformStreamDefaultController; + new(): TransformStreamDefaultController; + }; + interface WritableStream { + readonly locked: boolean; + abort(reason?: any): Promise; + close(): Promise; + getWriter(): WritableStreamDefaultWriter; + } + var WritableStream: { + prototype: WritableStream; + new(underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; + }; + interface WritableStreamDefaultController { + readonly signal: AbortSignal; + error(e?: any): void; + } + var WritableStreamDefaultController: { + prototype: WritableStreamDefaultController; + new(): WritableStreamDefaultController; + }; + interface WritableStreamDefaultWriter { + readonly closed: Promise; + readonly desiredSize: number | null; + readonly ready: Promise; + abort(reason?: any): Promise; + close(): Promise; + releaseLock(): void; + write(chunk?: W): Promise; + } + var WritableStreamDefaultWriter: { + prototype: WritableStreamDefaultWriter; + new(stream: WritableStream): WritableStreamDefaultWriter; + }; +} +declare module "stream/web" { + export * from "node:stream/web"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/string_decoder.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/string_decoder.d.ts new file mode 100644 index 0000000..a72c374 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/string_decoder.d.ts @@ -0,0 +1,67 @@ +/** + * The `node:string_decoder` module provides an API for decoding `Buffer` objects + * into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 + * characters. It can be accessed using: + * + * ```js + * import { StringDecoder } from 'node:string_decoder'; + * ``` + * + * The following example shows the basic use of the `StringDecoder` class. + * + * ```js + * import { StringDecoder } from 'node:string_decoder'; + * const decoder = new StringDecoder('utf8'); + * + * const cent = Buffer.from([0xC2, 0xA2]); + * console.log(decoder.write(cent)); // Prints: ¢ + * + * const euro = Buffer.from([0xE2, 0x82, 0xAC]); + * console.log(decoder.write(euro)); // Prints: € + * ``` + * + * When a `Buffer` instance is written to the `StringDecoder` instance, an + * internal buffer is used to ensure that the decoded string does not contain + * any incomplete multibyte characters. These are held in the buffer until the + * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. + * + * In the following example, the three UTF-8 encoded bytes of the European Euro + * symbol (`€`) are written over three separate operations: + * + * ```js + * import { StringDecoder } from 'node:string_decoder'; + * const decoder = new StringDecoder('utf8'); + * + * decoder.write(Buffer.from([0xE2])); + * decoder.write(Buffer.from([0x82])); + * console.log(decoder.end(Buffer.from([0xAC]))); // Prints: € + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/string_decoder.js) + */ +declare module "node:string_decoder" { + class StringDecoder { + constructor(encoding?: BufferEncoding); + /** + * Returns a decoded string, ensuring that any incomplete multibyte characters at + * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the + * returned string and stored in an internal buffer for the next call to `stringDecoder.write()` or `stringDecoder.end()`. + * @since v0.1.99 + * @param buffer The bytes to decode. + */ + write(buffer: string | NodeJS.ArrayBufferView): string; + /** + * Returns any remaining input stored in the internal buffer as a string. Bytes + * representing incomplete UTF-8 and UTF-16 characters will be replaced with + * substitution characters appropriate for the character encoding. + * + * If the `buffer` argument is provided, one final call to `stringDecoder.write()` is performed before returning the remaining input. + * After `end()` is called, the `stringDecoder` object can be reused for new input. + * @since v0.9.3 + * @param buffer The bytes to decode. + */ + end(buffer?: string | NodeJS.ArrayBufferView): string; + } +} +declare module "string_decoder" { + export * from "node:string_decoder"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/test.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/test.d.ts new file mode 100644 index 0000000..4207cda --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/test.d.ts @@ -0,0 +1,2275 @@ +/** + * The `node:test` module facilitates the creation of JavaScript tests. + * To access it: + * + * ```js + * import test from 'node:test'; + * ``` + * + * This module is only available under the `node:` scheme. The following will not + * work: + * + * ```js + * import test from 'node:test'; + * ``` + * + * Tests created via the `test` module consist of a single function that is + * processed in one of three ways: + * + * 1. A synchronous function that is considered failing if it throws an exception, + * and is considered passing otherwise. + * 2. A function that returns a `Promise` that is considered failing if the `Promise` rejects, and is considered passing if the `Promise` fulfills. + * 3. A function that receives a callback function. If the callback receives any + * truthy value as its first argument, the test is considered failing. If a + * falsy value is passed as the first argument to the callback, the test is + * considered passing. If the test function receives a callback function and + * also returns a `Promise`, the test will fail. + * + * The following example illustrates how tests are written using the `test` module. + * + * ```js + * test('synchronous passing test', (t) => { + * // This test passes because it does not throw an exception. + * assert.strictEqual(1, 1); + * }); + * + * test('synchronous failing test', (t) => { + * // This test fails because it throws an exception. + * assert.strictEqual(1, 2); + * }); + * + * test('asynchronous passing test', async (t) => { + * // This test passes because the Promise returned by the async + * // function is settled and not rejected. + * assert.strictEqual(1, 1); + * }); + * + * test('asynchronous failing test', async (t) => { + * // This test fails because the Promise returned by the async + * // function is rejected. + * assert.strictEqual(1, 2); + * }); + * + * test('failing test using Promises', (t) => { + * // Promises can be used directly as well. + * return new Promise((resolve, reject) => { + * setImmediate(() => { + * reject(new Error('this will cause the test to fail')); + * }); + * }); + * }); + * + * test('callback passing test', (t, done) => { + * // done() is the callback function. When the setImmediate() runs, it invokes + * // done() with no arguments. + * setImmediate(done); + * }); + * + * test('callback failing test', (t, done) => { + * // When the setImmediate() runs, done() is invoked with an Error object and + * // the test fails. + * setImmediate(() => { + * done(new Error('callback failure')); + * }); + * }); + * ``` + * + * If any tests fail, the process exit code is set to `1`. + * @since v18.0.0, v16.17.0 + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/test.js) + */ +declare module "node:test" { + import { AssertMethodNames } from "node:assert"; + import { Readable, ReadableEventMap } from "node:stream"; + import { TestEvent } from "node:test/reporters"; + import { URL } from "node:url"; + import TestFn = test.TestFn; + import TestOptions = test.TestOptions; + /** + * The `test()` function is the value imported from the `test` module. Each + * invocation of this function results in reporting the test to the `TestsStream`. + * + * The `TestContext` object passed to the `fn` argument can be used to perform + * actions related to the current test. Examples include skipping the test, adding + * additional diagnostic information, or creating subtests. + * + * `test()` returns a `Promise` that fulfills once the test completes. + * if `test()` is called within a suite, it fulfills immediately. + * The return value can usually be discarded for top level tests. + * However, the return value from subtests should be used to prevent the parent + * test from finishing first and cancelling the subtest + * as shown in the following example. + * + * ```js + * test('top level test', async (t) => { + * // The setTimeout() in the following subtest would cause it to outlive its + * // parent test if 'await' is removed on the next line. Once the parent test + * // completes, it will cancel any outstanding subtests. + * await t.test('longer running subtest', async (t) => { + * return new Promise((resolve, reject) => { + * setTimeout(resolve, 1000); + * }); + * }); + * }); + * ``` + * + * The `timeout` option can be used to fail the test if it takes longer than `timeout` milliseconds to complete. However, it is not a reliable mechanism for + * canceling tests because a running test might block the application thread and + * thus prevent the scheduled cancellation. + * @since v18.0.0, v16.17.0 + * @param name The name of the test, which is displayed when reporting test results. + * Defaults to the `name` property of `fn`, or `''` if `fn` does not have a name. + * @param options Configuration options for the test. + * @param fn The function under test. The first argument to this function is a {@link TestContext} object. + * If the test uses callbacks, the callback function is passed as the second argument. + * @return Fulfilled with `undefined` once the test completes, or immediately if the test runs within a suite. + */ + function test(name?: string, fn?: TestFn): Promise; + function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function test(options?: TestOptions, fn?: TestFn): Promise; + function test(fn?: TestFn): Promise; + namespace test { + export { test }; + export { suite as describe, test as it }; + } + namespace test { + /** + * **Note:** `shard` is used to horizontally parallelize test running across + * machines or processes, ideal for large-scale executions across varied + * environments. It's incompatible with `watch` mode, tailored for rapid + * code iteration by automatically rerunning tests on file changes. + * + * ```js + * import { tap } from 'node:test/reporters'; + * import { run } from 'node:test'; + * import process from 'node:process'; + * import path from 'node:path'; + * + * run({ files: [path.resolve('./tests/test.js')] }) + * .compose(tap) + * .pipe(process.stdout); + * ``` + * @since v18.9.0, v16.19.0 + * @param options Configuration options for running tests. + */ + function run(options?: RunOptions): TestsStream; + /** + * The `suite()` function is imported from the `node:test` module. + * @param name The name of the suite, which is displayed when reporting test results. + * Defaults to the `name` property of `fn`, or `''` if `fn` does not have a name. + * @param options Configuration options for the suite. This supports the same options as {@link test}. + * @param fn The suite function declaring nested tests and suites. The first argument to this function is a {@link SuiteContext} object. + * @return Immediately fulfilled with `undefined`. + * @since v20.13.0 + */ + function suite(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function suite(name?: string, fn?: SuiteFn): Promise; + function suite(options?: TestOptions, fn?: SuiteFn): Promise; + function suite(fn?: SuiteFn): Promise; + namespace suite { + /** + * Shorthand for skipping a suite. This is the same as calling {@link suite} with `options.skip` set to `true`. + * @since v20.13.0 + */ + function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function skip(name?: string, fn?: SuiteFn): Promise; + function skip(options?: TestOptions, fn?: SuiteFn): Promise; + function skip(fn?: SuiteFn): Promise; + /** + * Shorthand for marking a suite as `TODO`. This is the same as calling {@link suite} with `options.todo` set to `true`. + * @since v20.13.0 + */ + function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function todo(name?: string, fn?: SuiteFn): Promise; + function todo(options?: TestOptions, fn?: SuiteFn): Promise; + function todo(fn?: SuiteFn): Promise; + /** + * Shorthand for marking a suite as `only`. This is the same as calling {@link suite} with `options.only` set to `true`. + * @since v20.13.0 + */ + function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function only(name?: string, fn?: SuiteFn): Promise; + function only(options?: TestOptions, fn?: SuiteFn): Promise; + function only(fn?: SuiteFn): Promise; + // added in v25.5.0, undocumented + function expectFailure(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function expectFailure(name?: string, fn?: SuiteFn): Promise; + function expectFailure(options?: TestOptions, fn?: SuiteFn): Promise; + function expectFailure(fn?: SuiteFn): Promise; + } + /** + * Shorthand for skipping a test. This is the same as calling {@link test} with `options.skip` set to `true`. + * @since v20.2.0 + */ + function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function skip(name?: string, fn?: TestFn): Promise; + function skip(options?: TestOptions, fn?: TestFn): Promise; + function skip(fn?: TestFn): Promise; + /** + * Shorthand for marking a test as `TODO`. This is the same as calling {@link test} with `options.todo` set to `true`. + * @since v20.2.0 + */ + function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function todo(name?: string, fn?: TestFn): Promise; + function todo(options?: TestOptions, fn?: TestFn): Promise; + function todo(fn?: TestFn): Promise; + /** + * Shorthand for marking a test as `only`. This is the same as calling {@link test} with `options.only` set to `true`. + * @since v20.2.0 + */ + function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function only(name?: string, fn?: TestFn): Promise; + function only(options?: TestOptions, fn?: TestFn): Promise; + function only(fn?: TestFn): Promise; + // added in v25.5.0, undocumented + function expectFailure(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function expectFailure(name?: string, fn?: TestFn): Promise; + function expectFailure(options?: TestOptions, fn?: TestFn): Promise; + function expectFailure(fn?: TestFn): Promise; + /** + * The type of a function passed to {@link test}. The first argument to this function is a {@link TestContext} object. + * If the test uses callbacks, the callback function is passed as the second argument. + */ + type TestFn = (t: TestContext, done: (result?: any) => void) => void | Promise; + /** + * The type of a suite test function. The argument to this function is a {@link SuiteContext} object. + */ + type SuiteFn = (s: SuiteContext) => void | Promise; + interface TestShard { + /** + * A positive integer between 1 and `total` that specifies the index of the shard to run. + */ + index: number; + /** + * A positive integer that specifies the total number of shards to split the test files to. + */ + total: number; + } + interface RunOptions { + /** + * If a number is provided, then that many tests would run asynchronously (they are still managed by the single-threaded event loop). + * If `true`, it would run `os.availableParallelism() - 1` test files in parallel. If `false`, it would only run one test file at a time. + * @default false + */ + concurrency?: number | boolean | undefined; + /** + * Specifies the current working directory to be used by the test runner. + * Serves as the base path for resolving files according to the + * [test runner execution model](https://nodejs.org/docs/latest-v25.x/api/test.html#test-runner-execution-model). + * @since v23.0.0 + * @default process.cwd() + */ + cwd?: string | undefined; + /** + * An array containing the list of files to run. If omitted, files are run according to the + * [test runner execution model](https://nodejs.org/docs/latest-v25.x/api/test.html#test-runner-execution-model). + */ + files?: readonly string[] | undefined; + /** + * Configures the test runner to exit the process once all known + * tests have finished executing even if the event loop would + * otherwise remain active. + * @default false + */ + forceExit?: boolean | undefined; + /** + * An array containing the list of glob patterns to match test files. + * This option cannot be used together with `files`. If omitted, files are run according to the + * [test runner execution model](https://nodejs.org/docs/latest-v25.x/api/test.html#test-runner-execution-model). + * @since v22.6.0 + */ + globPatterns?: readonly string[] | undefined; + /** + * Sets inspector port of test child process. + * This can be a number, or a function that takes no arguments and returns a + * number. If a nullish value is provided, each process gets its own port, + * incremented from the primary's `process.debugPort`. This option is ignored + * if the `isolation` option is set to `'none'` as no child processes are + * spawned. + * @default undefined + */ + inspectPort?: number | (() => number) | undefined; + /** + * Configures the type of test isolation. If set to + * `'process'`, each test file is run in a separate child process. If set to + * `'none'`, all test files run in the current process. + * @default 'process' + * @since v22.8.0 + */ + isolation?: "process" | "none" | undefined; + /** + * If truthy, the test context will only run tests that have the `only` option set + */ + only?: boolean | undefined; + /** + * A function that accepts the `TestsStream` instance and can be used to setup listeners before any tests are run. + * @default undefined + */ + setup?: ((reporter: TestsStream) => void | Promise) | undefined; + /** + * An array of CLI flags to pass to the `node` executable when + * spawning the subprocesses. This option has no effect when `isolation` is `'none`'. + * @since v22.10.0 + * @default [] + */ + execArgv?: readonly string[] | undefined; + /** + * An array of CLI flags to pass to each test file when spawning the + * subprocesses. This option has no effect when `isolation` is `'none'`. + * @since v22.10.0 + * @default [] + */ + argv?: readonly string[] | undefined; + /** + * Allows aborting an in-progress test execution. + */ + signal?: AbortSignal | undefined; + /** + * If provided, only run tests whose name matches the provided pattern. + * Strings are interpreted as JavaScript regular expressions. + * @default undefined + */ + testNamePatterns?: string | RegExp | ReadonlyArray | undefined; + /** + * A String, RegExp or a RegExp Array, that can be used to exclude running tests whose + * name matches the provided pattern. Test name patterns are interpreted as JavaScript + * regular expressions. For each test that is executed, any corresponding test hooks, + * such as `beforeEach()`, are also run. + * @default undefined + * @since v22.1.0 + */ + testSkipPatterns?: string | RegExp | ReadonlyArray | undefined; + /** + * The number of milliseconds after which the test execution will fail. + * If unspecified, subtests inherit this value from their parent. + * @default Infinity + */ + timeout?: number | undefined; + /** + * Whether to run in watch mode or not. + * @default false + */ + watch?: boolean | undefined; + /** + * Running tests in a specific shard. + * @default undefined + */ + shard?: TestShard | undefined; + /** + * A file path where the test runner will + * store the state of the tests to allow rerunning only the failed tests on a next run. + * @since v24.7.0 + * @default undefined + */ + rerunFailuresFilePath?: string | undefined; + /** + * enable [code coverage](https://nodejs.org/docs/latest-v25.x/api/test.html#collecting-code-coverage) collection. + * @since v22.10.0 + * @default false + */ + coverage?: boolean | undefined; + /** + * Excludes specific files from code coverage + * using a glob pattern, which can match both absolute and relative file paths. + * This property is only applicable when `coverage` was set to `true`. + * If both `coverageExcludeGlobs` and `coverageIncludeGlobs` are provided, + * files must meet **both** criteria to be included in the coverage report. + * @since v22.10.0 + * @default undefined + */ + coverageExcludeGlobs?: string | readonly string[] | undefined; + /** + * Includes specific files in code coverage + * using a glob pattern, which can match both absolute and relative file paths. + * This property is only applicable when `coverage` was set to `true`. + * If both `coverageExcludeGlobs` and `coverageIncludeGlobs` are provided, + * files must meet **both** criteria to be included in the coverage report. + * @since v22.10.0 + * @default undefined + */ + coverageIncludeGlobs?: string | readonly string[] | undefined; + /** + * Require a minimum percent of covered lines. If code + * coverage does not reach the threshold specified, the process will exit with code `1`. + * @since v22.10.0 + * @default 0 + */ + lineCoverage?: number | undefined; + /** + * Require a minimum percent of covered branches. If code + * coverage does not reach the threshold specified, the process will exit with code `1`. + * @since v22.10.0 + * @default 0 + */ + branchCoverage?: number | undefined; + /** + * Require a minimum percent of covered functions. If code + * coverage does not reach the threshold specified, the process will exit with code `1`. + * @since v22.10.0 + * @default 0 + */ + functionCoverage?: number | undefined; + } + interface TestsStreamEventMap extends ReadableEventMap { + "data": [data: TestEvent]; + "test:coverage": [data: EventData.TestCoverage]; + "test:complete": [data: EventData.TestComplete]; + "test:dequeue": [data: EventData.TestDequeue]; + "test:diagnostic": [data: EventData.TestDiagnostic]; + "test:enqueue": [data: EventData.TestEnqueue]; + "test:fail": [data: EventData.TestFail]; + "test:pass": [data: EventData.TestPass]; + "test:plan": [data: EventData.TestPlan]; + "test:start": [data: EventData.TestStart]; + "test:stderr": [data: EventData.TestStderr]; + "test:stdout": [data: EventData.TestStdout]; + "test:summary": [data: EventData.TestSummary]; + "test:watch:drained": []; + "test:watch:restarted": []; + } + /** + * A successful call to `run()` will return a new `TestsStream` object, streaming a series of events representing the execution of the tests. + * + * Some of the events are guaranteed to be emitted in the same order as the tests are defined, while others are emitted in the order that the tests execute. + * @since v18.9.0, v16.19.0 + */ + interface TestsStream extends Readable { + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: TestsStreamEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: TestsStreamEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: TestsStreamEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: TestsStreamEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: TestsStreamEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: TestsStreamEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: TestsStreamEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: TestsStreamEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: TestsStreamEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: TestsStreamEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: TestsStreamEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + namespace EventData { + interface Error extends globalThis.Error { + cause: unknown; + } + interface LocationInfo { + /** + * The column number where the test is defined, or + * `undefined` if the test was run through the REPL. + */ + column?: number; + /** + * The path of the test file, `undefined` if test was run through the REPL. + */ + file?: string; + /** + * The line number where the test is defined, or `undefined` if the test was run through the REPL. + */ + line?: number; + } + interface TestDiagnostic extends LocationInfo { + /** + * The diagnostic message. + */ + message: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The severity level of the diagnostic message. + * Possible values are: + * * `'info'`: Informational messages. + * * `'warn'`: Warnings. + * * `'error'`: Errors. + */ + level: "info" | "warn" | "error"; + } + interface TestCoverage { + /** + * An object containing the coverage report. + */ + summary: { + /** + * An array of coverage reports for individual files. + */ + files: Array<{ + /** + * The absolute path of the file. + */ + path: string; + /** + * The total number of lines. + */ + totalLineCount: number; + /** + * The total number of branches. + */ + totalBranchCount: number; + /** + * The total number of functions. + */ + totalFunctionCount: number; + /** + * The number of covered lines. + */ + coveredLineCount: number; + /** + * The number of covered branches. + */ + coveredBranchCount: number; + /** + * The number of covered functions. + */ + coveredFunctionCount: number; + /** + * The percentage of lines covered. + */ + coveredLinePercent: number; + /** + * The percentage of branches covered. + */ + coveredBranchPercent: number; + /** + * The percentage of functions covered. + */ + coveredFunctionPercent: number; + /** + * An array of functions representing function coverage. + */ + functions: Array<{ + /** + * The name of the function. + */ + name: string; + /** + * The line number where the function is defined. + */ + line: number; + /** + * The number of times the function was called. + */ + count: number; + }>; + /** + * An array of branches representing branch coverage. + */ + branches: Array<{ + /** + * The line number where the branch is defined. + */ + line: number; + /** + * The number of times the branch was taken. + */ + count: number; + }>; + /** + * An array of lines representing line numbers and the number of times they were covered. + */ + lines: Array<{ + /** + * The line number. + */ + line: number; + /** + * The number of times the line was covered. + */ + count: number; + }>; + }>; + /** + * An object containing whether or not the coverage for + * each coverage type. + * @since v22.9.0 + */ + thresholds: { + /** + * The function coverage threshold. + */ + function: number; + /** + * The branch coverage threshold. + */ + branch: number; + /** + * The line coverage threshold. + */ + line: number; + }; + /** + * An object containing a summary of coverage for all files. + */ + totals: { + /** + * The total number of lines. + */ + totalLineCount: number; + /** + * The total number of branches. + */ + totalBranchCount: number; + /** + * The total number of functions. + */ + totalFunctionCount: number; + /** + * The number of covered lines. + */ + coveredLineCount: number; + /** + * The number of covered branches. + */ + coveredBranchCount: number; + /** + * The number of covered functions. + */ + coveredFunctionCount: number; + /** + * The percentage of lines covered. + */ + coveredLinePercent: number; + /** + * The percentage of branches covered. + */ + coveredBranchPercent: number; + /** + * The percentage of functions covered. + */ + coveredFunctionPercent: number; + }; + /** + * The working directory when code coverage began. This + * is useful for displaying relative path names in case + * the tests changed the working directory of the Node.js process. + */ + workingDirectory: string; + }; + /** + * The nesting level of the test. + */ + nesting: number; + } + interface TestComplete extends LocationInfo { + /** + * Additional execution metadata. + */ + details: { + /** + * Whether the test passed or not. + */ + passed: boolean; + /** + * The duration of the test in milliseconds. + */ + duration_ms: number; + /** + * An error wrapping the error thrown by the test if it did not pass. + */ + error?: Error; + /** + * The type of the test, used to denote whether this is a suite. + */ + type?: "suite" | "test"; + }; + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The ordinal number of the test. + */ + testNumber: number; + /** + * Present if `context.todo` is called. + */ + todo?: string | boolean; + /** + * Present if `context.skip` is called. + */ + skip?: string | boolean; + } + interface TestDequeue extends LocationInfo { + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The test type. Either `'suite'` or `'test'`. + * @since v22.15.0 + */ + type: "suite" | "test"; + } + interface TestEnqueue extends LocationInfo { + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The test type. Either `'suite'` or `'test'`. + * @since v22.15.0 + */ + type: "suite" | "test"; + } + interface TestFail extends LocationInfo { + /** + * Additional execution metadata. + */ + details: { + /** + * The duration of the test in milliseconds. + */ + duration_ms: number; + /** + * An error wrapping the error thrown by the test. + */ + error: Error; + /** + * The type of the test, used to denote whether this is a suite. + * @since v20.0.0, v19.9.0, v18.17.0 + */ + type?: "suite" | "test"; + /** + * The attempt number of the test run, + * present only when using the `--test-rerun-failures` flag. + * @since v24.7.0 + */ + attempt?: number; + }; + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The ordinal number of the test. + */ + testNumber: number; + /** + * Present if `context.todo` is called. + */ + todo?: string | boolean; + /** + * Present if `context.skip` is called. + */ + skip?: string | boolean; + } + interface TestPass extends LocationInfo { + /** + * Additional execution metadata. + */ + details: { + /** + * The duration of the test in milliseconds. + */ + duration_ms: number; + /** + * The type of the test, used to denote whether this is a suite. + * @since 20.0.0, 19.9.0, 18.17.0 + */ + type?: "suite" | "test"; + /** + * The attempt number of the test run, + * present only when using the `--test-rerun-failures` flag. + * @since v24.7.0 + */ + attempt?: number; + /** + * The attempt number the test passed on, + * present only when using the `--test-rerun-failures` flag. + * @since v24.7.0 + */ + passed_on_attempt?: number; + }; + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The ordinal number of the test. + */ + testNumber: number; + /** + * Present if `context.todo` is called. + */ + todo?: string | boolean; + /** + * Present if `context.skip` is called. + */ + skip?: string | boolean; + } + interface TestPlan extends LocationInfo { + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The number of subtests that have ran. + */ + count: number; + } + interface TestStart extends LocationInfo { + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + } + interface TestStderr { + /** + * The path of the test file. + */ + file: string; + /** + * The message written to `stderr`. + */ + message: string; + } + interface TestStdout { + /** + * The path of the test file. + */ + file: string; + /** + * The message written to `stdout`. + */ + message: string; + } + interface TestSummary { + /** + * An object containing the counts of various test results. + */ + counts: { + /** + * The total number of cancelled tests. + */ + cancelled: number; + /** + * The total number of passed tests. + */ + passed: number; + /** + * The total number of skipped tests. + */ + skipped: number; + /** + * The total number of suites run. + */ + suites: number; + /** + * The total number of tests run, excluding suites. + */ + tests: number; + /** + * The total number of TODO tests. + */ + todo: number; + /** + * The total number of top level tests and suites. + */ + topLevel: number; + }; + /** + * The duration of the test run in milliseconds. + */ + duration_ms: number; + /** + * The path of the test file that generated the + * summary. If the summary corresponds to multiple files, this value is + * `undefined`. + */ + file: string | undefined; + /** + * Indicates whether or not the test run is considered + * successful or not. If any error condition occurs, such as a failing test or + * unmet coverage threshold, this value will be set to `false`. + */ + success: boolean; + } + } + /** + * An instance of `TestContext` is passed to each test function in order to + * interact with the test runner. However, the `TestContext` constructor is not + * exposed as part of the API. + * @since v18.0.0, v16.17.0 + */ + interface TestContext { + /** + * An object containing assertion methods bound to the test context. + * The top-level functions from the `node:assert` module are exposed here for the purpose of creating test plans. + * + * **Note:** Some of the functions from `node:assert` contain type assertions. If these are called via the + * TestContext `assert` object, then the context parameter in the test's function signature **must be explicitly typed** + * (ie. the parameter must have a type annotation), otherwise an error will be raised by the TypeScript compiler: + * ```ts + * import { test, type TestContext } from 'node:test'; + * + * // The test function's context parameter must have a type annotation. + * test('example', (t: TestContext) => { + * t.assert.deepStrictEqual(actual, expected); + * }); + * + * // Omitting the type annotation will result in a compilation error. + * test('example', t => { + * t.assert.deepStrictEqual(actual, expected); // Error: 't' needs an explicit type annotation. + * }); + * ``` + * @since v22.2.0, v20.15.0 + */ + readonly assert: TestContextAssert; + /** + * This function is used to create a hook running before subtest of the current test. + * @param fn The hook function. The first argument to this function is a `TestContext` object. + * If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. + * @since v20.1.0, v18.17.0 + */ + before(fn?: TestContextHookFn, options?: HookOptions): void; + /** + * This function is used to create a hook running before each subtest of the current test. + * @param fn The hook function. The first argument to this function is a `TestContext` object. + * If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + beforeEach(fn?: TestContextHookFn, options?: HookOptions): void; + /** + * This function is used to create a hook that runs after the current test finishes. + * @param fn The hook function. The first argument to this function is a `TestContext` object. + * If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. + * @since v18.13.0 + */ + after(fn?: TestContextHookFn, options?: HookOptions): void; + /** + * This function is used to create a hook running after each subtest of the current test. + * @param fn The hook function. The first argument to this function is a `TestContext` object. + * If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + afterEach(fn?: TestContextHookFn, options?: HookOptions): void; + /** + * This function is used to write diagnostics to the output. Any diagnostic + * information is included at the end of the test's results. This function does + * not return a value. + * + * ```js + * test('top level test', (t) => { + * t.diagnostic('A diagnostic message'); + * }); + * ``` + * @since v18.0.0, v16.17.0 + * @param message Message to be reported. + */ + diagnostic(message: string): void; + /** + * The absolute path of the test file that created the current test. If a test file imports + * additional modules that generate tests, the imported tests will return the path of the root test file. + * @since v22.6.0 + */ + readonly filePath: string | undefined; + /** + * The name of the test and each of its ancestors, separated by `>`. + * @since v22.3.0 + */ + readonly fullName: string; + /** + * The name of the test. + * @since v18.8.0, v16.18.0 + */ + readonly name: string; + /** + * Indicated whether the test succeeded. + * @since v21.7.0, v20.12.0 + */ + readonly passed: boolean; + /** + * The failure reason for the test/case; wrapped and available via `context.error.cause`. + * @since v21.7.0, v20.12.0 + */ + readonly error: EventData.Error | null; + /** + * Number of times the test has been attempted. + * @since v21.7.0, v20.12.0 + */ + readonly attempt: number; + /** + * This function is used to set the number of assertions and subtests that are expected to run + * within the test. If the number of assertions and subtests that run does not match the + * expected count, the test will fail. + * + * > Note: To make sure assertions are tracked, `t.assert` must be used instead of `assert` directly. + * + * ```js + * test('top level test', (t) => { + * t.plan(2); + * t.assert.ok('some relevant assertion here'); + * t.test('subtest', () => {}); + * }); + * ``` + * + * When working with asynchronous code, the `plan` function can be used to ensure that the + * correct number of assertions are run: + * + * ```js + * test('planning with streams', (t, done) => { + * function* generate() { + * yield 'a'; + * yield 'b'; + * yield 'c'; + * } + * const expected = ['a', 'b', 'c']; + * t.plan(expected.length); + * const stream = Readable.from(generate()); + * stream.on('data', (chunk) => { + * t.assert.strictEqual(chunk, expected.shift()); + * }); + * + * stream.on('end', () => { + * done(); + * }); + * }); + * ``` + * + * When using the `wait` option, you can control how long the test will wait for the expected assertions. + * For example, setting a maximum wait time ensures that the test will wait for asynchronous assertions + * to complete within the specified timeframe: + * + * ```js + * test('plan with wait: 2000 waits for async assertions', (t) => { + * t.plan(1, { wait: 2000 }); // Waits for up to 2 seconds for the assertion to complete. + * + * const asyncActivity = () => { + * setTimeout(() => { + * * t.assert.ok(true, 'Async assertion completed within the wait time'); + * }, 1000); // Completes after 1 second, within the 2-second wait time. + * }; + * + * asyncActivity(); // The test will pass because the assertion is completed in time. + * }); + * ``` + * + * Note: If a `wait` timeout is specified, it begins counting down only after the test function finishes executing. + * @since v22.2.0 + */ + plan(count: number, options?: TestContextPlanOptions): void; + /** + * If `shouldRunOnlyTests` is truthy, the test context will only run tests that + * have the `only` option set. Otherwise, all tests are run. If Node.js was not + * started with the `--test-only` command-line option, this function is a + * no-op. + * + * ```js + * test('top level test', (t) => { + * // The test context can be set to run subtests with the 'only' option. + * t.runOnly(true); + * return Promise.all([ + * t.test('this subtest is now skipped'), + * t.test('this subtest is run', { only: true }), + * ]); + * }); + * ``` + * @since v18.0.0, v16.17.0 + * @param shouldRunOnlyTests Whether or not to run `only` tests. + */ + runOnly(shouldRunOnlyTests: boolean): void; + /** + * ```js + * test('top level test', async (t) => { + * await fetch('some/uri', { signal: t.signal }); + * }); + * ``` + * @since v18.7.0, v16.17.0 + */ + readonly signal: AbortSignal; + /** + * This function causes the test's output to indicate the test as skipped. If `message` is provided, it is included in the output. Calling `skip()` does + * not terminate execution of the test function. This function does not return a + * value. + * + * ```js + * test('top level test', (t) => { + * // Make sure to return here as well if the test contains additional logic. + * t.skip('this is skipped'); + * }); + * ``` + * @since v18.0.0, v16.17.0 + * @param message Optional skip message. + */ + skip(message?: string): void; + /** + * This function adds a `TODO` directive to the test's output. If `message` is + * provided, it is included in the output. Calling `todo()` does not terminate + * execution of the test function. This function does not return a value. + * + * ```js + * test('top level test', (t) => { + * // This test is marked as `TODO` + * t.todo('this is a todo'); + * }); + * ``` + * @since v18.0.0, v16.17.0 + * @param message Optional `TODO` message. + */ + todo(message?: string): void; + /** + * This function is used to create subtests under the current test. This function behaves in + * the same fashion as the top level {@link test} function. + * @since v18.0.0 + * @param name The name of the test, which is displayed when reporting test results. + * Defaults to the `name` property of `fn`, or `''` if `fn` does not have a name. + * @param options Configuration options for the test. + * @param fn The function under test. This first argument to this function is a {@link TestContext} object. + * If the test uses callbacks, the callback function is passed as the second argument. + * @returns A {@link Promise} resolved with `undefined` once the test completes. + */ + test: typeof test; + /** + * This method polls a `condition` function until that function either returns + * successfully or the operation times out. + * @since v22.14.0 + * @param condition An assertion function that is invoked + * periodically until it completes successfully or the defined polling timeout + * elapses. Successful completion is defined as not throwing or rejecting. This + * function does not accept any arguments, and is allowed to return any value. + * @param options An optional configuration object for the polling operation. + * @returns Fulfilled with the value returned by `condition`. + */ + waitFor(condition: () => T, options?: TestContextWaitForOptions): Promise>; + /** + * Each test provides its own MockTracker instance. + */ + readonly mock: MockTracker; + } + interface TestContextAssert extends Pick { + /** + * This function serializes `value` and writes it to the file specified by `path`. + * + * ```js + * test('snapshot test with default serialization', (t) => { + * t.assert.fileSnapshot({ value1: 1, value2: 2 }, './snapshots/snapshot.json'); + * }); + * ``` + * + * This function differs from `context.assert.snapshot()` in the following ways: + * + * * The snapshot file path is explicitly provided by the user. + * * Each snapshot file is limited to a single snapshot value. + * * No additional escaping is performed by the test runner. + * + * These differences allow snapshot files to better support features such as syntax + * highlighting. + * @since v22.14.0 + * @param value A value to serialize to a string. If Node.js was started with + * the [`--test-update-snapshots`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--test-update-snapshots) + * flag, the serialized value is written to + * `path`. Otherwise, the serialized value is compared to the contents of the + * existing snapshot file. + * @param path The file where the serialized `value` is written. + * @param options Optional configuration options. + */ + fileSnapshot(value: any, path: string, options?: AssertSnapshotOptions): void; + /** + * This function implements assertions for snapshot testing. + * ```js + * test('snapshot test with default serialization', (t) => { + * t.assert.snapshot({ value1: 1, value2: 2 }); + * }); + * + * test('snapshot test with custom serialization', (t) => { + * t.assert.snapshot({ value3: 3, value4: 4 }, { + * serializers: [(value) => JSON.stringify(value)] + * }); + * }); + * ``` + * @since v22.3.0 + * @param value A value to serialize to a string. If Node.js was started with + * the [`--test-update-snapshots`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--test-update-snapshots) + * flag, the serialized value is written to + * the snapshot file. Otherwise, the serialized value is compared to the + * corresponding value in the existing snapshot file. + */ + snapshot(value: any, options?: AssertSnapshotOptions): void; + /** + * A custom assertion function registered with `assert.register()`. + */ + [name: string]: (...args: any[]) => void; + } + interface AssertSnapshotOptions { + /** + * An array of synchronous functions used to serialize `value` into a string. + * `value` is passed as the only argument to the first serializer function. + * The return value of each serializer is passed as input to the next serializer. + * Once all serializers have run, the resulting value is coerced to a string. + * + * If no serializers are provided, the test runner's default serializers are used. + */ + serializers?: ReadonlyArray<(value: any) => any> | undefined; + } + interface TestContextPlanOptions { + /** + * The wait time for the plan: + * * If `true`, the plan waits indefinitely for all assertions and subtests to run. + * * If `false`, the plan performs an immediate check after the test function completes, + * without waiting for any pending assertions or subtests. + * Any assertions or subtests that complete after this check will not be counted towards the plan. + * * If a number, it specifies the maximum wait time in milliseconds + * before timing out while waiting for expected assertions and subtests to be matched. + * If the timeout is reached, the test will fail. + * @default false + */ + wait?: boolean | number | undefined; + } + interface TestContextWaitForOptions { + /** + * The number of milliseconds to wait after an unsuccessful + * invocation of `condition` before trying again. + * @default 50 + */ + interval?: number | undefined; + /** + * The poll timeout in milliseconds. If `condition` has not + * succeeded by the time this elapses, an error occurs. + * @default 1000 + */ + timeout?: number | undefined; + } + /** + * An instance of `SuiteContext` is passed to each suite function in order to + * interact with the test runner. However, the `SuiteContext` constructor is not + * exposed as part of the API. + * @since v18.7.0, v16.17.0 + */ + interface SuiteContext { + /** + * The absolute path of the test file that created the current suite. If a test file imports + * additional modules that generate suites, the imported suites will return the path of the root test file. + * @since v22.6.0 + */ + readonly filePath: string | undefined; + /** + * The name of the suite and each of its ancestors, separated by `>`. + * @since v22.3.0, v20.16.0 + */ + readonly fullName: string; + /** + * The name of the suite. + * @since v18.8.0, v16.18.0 + */ + readonly name: string; + /** + * Can be used to abort test subtasks when the test has been aborted. + * @since v18.7.0, v16.17.0 + */ + readonly signal: AbortSignal; + } + interface TestOptions { + /** + * If a number is provided, then that many tests would run in parallel. + * If truthy, it would run (number of cpu cores - 1) tests in parallel. + * For subtests, it will be `Infinity` tests in parallel. + * If falsy, it would only run one test at a time. + * If unspecified, subtests inherit this value from their parent. + * @default false + */ + concurrency?: number | boolean | undefined; + /** + * If truthy, and the test context is configured to run `only` tests, then this test will be + * run. Otherwise, the test is skipped. + * @default false + */ + only?: boolean | undefined; + /** + * Allows aborting an in-progress test. + * @since v18.8.0 + */ + signal?: AbortSignal | undefined; + /** + * If truthy, the test is skipped. If a string is provided, that string is displayed in the + * test results as the reason for skipping the test. + * @default false + */ + skip?: boolean | string | undefined; + /** + * A number of milliseconds the test will fail after. If unspecified, subtests inherit this + * value from their parent. + * @default Infinity + * @since v18.7.0 + */ + timeout?: number | undefined; + /** + * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in + * the test results as the reason why the test is `TODO`. + * @default false + */ + todo?: boolean | string | undefined; + /** + * The number of assertions and subtests expected to be run in the test. + * If the number of assertions run in the test does not match the number + * specified in the plan, the test will fail. + * @default undefined + * @since v22.2.0 + */ + plan?: number | undefined; + // added in v25.5.0, undocumented + expectFailure?: boolean | undefined; + } + /** + * This function creates a hook that runs before executing a suite. + * + * ```js + * describe('tests', async () => { + * before(() => console.log('about to run some test')); + * it('is a subtest', () => { + * // Some relevant assertion here + * }); + * }); + * ``` + * @since v18.8.0, v16.18.0 + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. + */ + function before(fn?: HookFn, options?: HookOptions): void; + /** + * This function creates a hook that runs after executing a suite. + * + * ```js + * describe('tests', async () => { + * after(() => console.log('finished running tests')); + * it('is a subtest', () => { + * // Some relevant assertion here + * }); + * }); + * ``` + * @since v18.8.0, v16.18.0 + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. + */ + function after(fn?: HookFn, options?: HookOptions): void; + /** + * This function creates a hook that runs before each test in the current suite. + * + * ```js + * describe('tests', async () => { + * beforeEach(() => console.log('about to run a test')); + * it('is a subtest', () => { + * // Some relevant assertion here + * }); + * }); + * ``` + * @since v18.8.0, v16.18.0 + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. + */ + function beforeEach(fn?: HookFn, options?: HookOptions): void; + /** + * This function creates a hook that runs after each test in the current suite. + * The `afterEach()` hook is run even if the test fails. + * + * ```js + * describe('tests', async () => { + * afterEach(() => console.log('finished running a test')); + * it('is a subtest', () => { + * // Some relevant assertion here + * }); + * }); + * ``` + * @since v18.8.0, v16.18.0 + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. + */ + function afterEach(fn?: HookFn, options?: HookOptions): void; + /** + * The hook function. The first argument is the context in which the hook is called. + * If the hook uses callbacks, the callback function is passed as the second argument. + */ + type HookFn = (c: TestContext | SuiteContext, done: (result?: any) => void) => any; + /** + * The hook function. The first argument is a `TestContext` object. + * If the hook uses callbacks, the callback function is passed as the second argument. + */ + type TestContextHookFn = (t: TestContext, done: (result?: any) => void) => any; + /** + * Configuration options for hooks. + * @since v18.8.0 + */ + interface HookOptions { + /** + * Allows aborting an in-progress hook. + */ + signal?: AbortSignal | undefined; + /** + * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this + * value from their parent. + * @default Infinity + */ + timeout?: number | undefined; + } + interface MockFunctionOptions { + /** + * The number of times that the mock will use the behavior of `implementation`. + * Once the mock function has been called `times` times, + * it will automatically restore the behavior of `original`. + * This value must be an integer greater than zero. + * @default Infinity + */ + times?: number | undefined; + } + interface MockMethodOptions extends MockFunctionOptions { + /** + * If `true`, `object[methodName]` is treated as a getter. + * This option cannot be used with the `setter` option. + */ + getter?: boolean | undefined; + /** + * If `true`, `object[methodName]` is treated as a setter. + * This option cannot be used with the `getter` option. + */ + setter?: boolean | undefined; + } + type Mock = F & { + mock: MockFunctionContext; + }; + interface MockModuleOptions { + /** + * If false, each call to `require()` or `import()` generates a new mock module. + * If true, subsequent calls will return the same module mock, and the mock module is inserted into the CommonJS cache. + * @default false + */ + cache?: boolean | undefined; + /** + * The value to use as the mocked module's default export. + * + * If this value is not provided, ESM mocks do not include a default export. + * If the mock is a CommonJS or builtin module, this setting is used as the value of `module.exports`. + * If this value is not provided, CJS and builtin mocks use an empty object as the value of `module.exports`. + */ + defaultExport?: any; + /** + * An object whose keys and values are used to create the named exports of the mock module. + * + * If the mock is a CommonJS or builtin module, these values are copied onto `module.exports`. + * Therefore, if a mock is created with both named exports and a non-object default export, + * the mock will throw an exception when used as a CJS or builtin module. + */ + namedExports?: object | undefined; + } + /** + * The `MockTracker` class is used to manage mocking functionality. The test runner + * module provides a top level `mock` export which is a `MockTracker` instance. + * Each test also provides its own `MockTracker` instance via the test context's `mock` property. + * @since v19.1.0, v18.13.0 + */ + interface MockTracker { + /** + * This function is used to create a mock function. + * + * The following example creates a mock function that increments a counter by one + * on each invocation. The `times` option is used to modify the mock behavior such + * that the first two invocations add two to the counter instead of one. + * + * ```js + * test('mocks a counting function', (t) => { + * let cnt = 0; + * + * function addOne() { + * cnt++; + * return cnt; + * } + * + * function addTwo() { + * cnt += 2; + * return cnt; + * } + * + * const fn = t.mock.fn(addOne, addTwo, { times: 2 }); + * + * assert.strictEqual(fn(), 2); + * assert.strictEqual(fn(), 4); + * assert.strictEqual(fn(), 5); + * assert.strictEqual(fn(), 6); + * }); + * ``` + * @since v19.1.0, v18.13.0 + * @param original An optional function to create a mock on. + * @param implementation An optional function used as the mock implementation for `original`. This is useful for creating mocks that exhibit one behavior for a specified number of calls and + * then restore the behavior of `original`. + * @param options Optional configuration options for the mock function. + * @return The mocked function. The mocked function contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the + * behavior of the mocked function. + */ + fn undefined>( + original?: F, + options?: MockFunctionOptions, + ): Mock; + fn undefined, Implementation extends Function = F>( + original?: F, + implementation?: Implementation, + options?: MockFunctionOptions, + ): Mock; + /** + * This function is used to create a mock on an existing object method. The + * following example demonstrates how a mock is created on an existing object + * method. + * + * ```js + * test('spies on an object method', (t) => { + * const number = { + * value: 5, + * subtract(a) { + * return this.value - a; + * }, + * }; + * + * t.mock.method(number, 'subtract'); + * assert.strictEqual(number.subtract.mock.calls.length, 0); + * assert.strictEqual(number.subtract(3), 2); + * assert.strictEqual(number.subtract.mock.calls.length, 1); + * + * const call = number.subtract.mock.calls[0]; + * + * assert.deepStrictEqual(call.arguments, [3]); + * assert.strictEqual(call.result, 2); + * assert.strictEqual(call.error, undefined); + * assert.strictEqual(call.target, undefined); + * assert.strictEqual(call.this, number); + * }); + * ``` + * @since v19.1.0, v18.13.0 + * @param object The object whose method is being mocked. + * @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown. + * @param implementation An optional function used as the mock implementation for `object[methodName]`. + * @param options Optional configuration options for the mock method. + * @return The mocked method. The mocked method contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the + * behavior of the mocked method. + */ + method< + MockedObject extends object, + MethodName extends FunctionPropertyNames, + >( + object: MockedObject, + methodName: MethodName, + options?: MockFunctionOptions, + ): MockedObject[MethodName] extends Function ? Mock + : never; + method< + MockedObject extends object, + MethodName extends FunctionPropertyNames, + Implementation extends Function, + >( + object: MockedObject, + methodName: MethodName, + implementation: Implementation, + options?: MockFunctionOptions, + ): MockedObject[MethodName] extends Function ? Mock + : never; + method( + object: MockedObject, + methodName: keyof MockedObject, + options: MockMethodOptions, + ): Mock; + method( + object: MockedObject, + methodName: keyof MockedObject, + implementation: Function, + options: MockMethodOptions, + ): Mock; + /** + * This function is syntax sugar for `MockTracker.method` with `options.getter` set to `true`. + * @since v19.3.0, v18.13.0 + */ + getter< + MockedObject extends object, + MethodName extends keyof MockedObject, + >( + object: MockedObject, + methodName: MethodName, + options?: MockFunctionOptions, + ): Mock<() => MockedObject[MethodName]>; + getter< + MockedObject extends object, + MethodName extends keyof MockedObject, + Implementation extends Function, + >( + object: MockedObject, + methodName: MethodName, + implementation?: Implementation, + options?: MockFunctionOptions, + ): Mock<(() => MockedObject[MethodName]) | Implementation>; + /** + * This function is syntax sugar for `MockTracker.method` with `options.setter` set to `true`. + * @since v19.3.0, v18.13.0 + */ + setter< + MockedObject extends object, + MethodName extends keyof MockedObject, + >( + object: MockedObject, + methodName: MethodName, + options?: MockFunctionOptions, + ): Mock<(value: MockedObject[MethodName]) => void>; + setter< + MockedObject extends object, + MethodName extends keyof MockedObject, + Implementation extends Function, + >( + object: MockedObject, + methodName: MethodName, + implementation?: Implementation, + options?: MockFunctionOptions, + ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>; + /** + * This function is used to mock the exports of ECMAScript modules, CommonJS modules, JSON modules, and + * Node.js builtin modules. Any references to the original module prior to mocking are not impacted. In + * order to enable module mocking, Node.js must be started with the + * [`--experimental-test-module-mocks`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--experimental-test-module-mocks) + * command-line flag. + * + * The following example demonstrates how a mock is created for a module. + * + * ```js + * test('mocks a builtin module in both module systems', async (t) => { + * // Create a mock of 'node:readline' with a named export named 'fn', which + * // does not exist in the original 'node:readline' module. + * const mock = t.mock.module('node:readline', { + * namedExports: { fn() { return 42; } }, + * }); + * + * let esmImpl = await import('node:readline'); + * let cjsImpl = require('node:readline'); + * + * // cursorTo() is an export of the original 'node:readline' module. + * assert.strictEqual(esmImpl.cursorTo, undefined); + * assert.strictEqual(cjsImpl.cursorTo, undefined); + * assert.strictEqual(esmImpl.fn(), 42); + * assert.strictEqual(cjsImpl.fn(), 42); + * + * mock.restore(); + * + * // The mock is restored, so the original builtin module is returned. + * esmImpl = await import('node:readline'); + * cjsImpl = require('node:readline'); + * + * assert.strictEqual(typeof esmImpl.cursorTo, 'function'); + * assert.strictEqual(typeof cjsImpl.cursorTo, 'function'); + * assert.strictEqual(esmImpl.fn, undefined); + * assert.strictEqual(cjsImpl.fn, undefined); + * }); + * ``` + * @since v22.3.0 + * @experimental + * @param specifier A string identifying the module to mock. + * @param options Optional configuration options for the mock module. + */ + module(specifier: string | URL, options?: MockModuleOptions): MockModuleContext; + /** + * Creates a mock for a property value on an object. This allows you to track and control access to a specific property, + * including how many times it is read (getter) or written (setter), and to restore the original value after mocking. + * + * ```js + * test('mocks a property value', (t) => { + * const obj = { foo: 42 }; + * const prop = t.mock.property(obj, 'foo', 100); + * + * assert.strictEqual(obj.foo, 100); + * assert.strictEqual(prop.mock.accessCount(), 1); + * assert.strictEqual(prop.mock.accesses[0].type, 'get'); + * assert.strictEqual(prop.mock.accesses[0].value, 100); + * + * obj.foo = 200; + * assert.strictEqual(prop.mock.accessCount(), 2); + * assert.strictEqual(prop.mock.accesses[1].type, 'set'); + * assert.strictEqual(prop.mock.accesses[1].value, 200); + * + * prop.mock.restore(); + * assert.strictEqual(obj.foo, 42); + * }); + * ``` + * @since v24.3.0 + * @param object The object whose value is being mocked. + * @param propertyName The identifier of the property on `object` to mock. + * @param value An optional value used as the mock value + * for `object[propertyName]`. **Default:** The original property value. + * @returns A proxy to the mocked object. The mocked object contains a + * special `mock` property, which is an instance of [`MockPropertyContext`][], and + * can be used for inspecting and changing the behavior of the mocked property. + */ + property< + MockedObject extends object, + PropertyName extends keyof MockedObject, + >( + object: MockedObject, + property: PropertyName, + value?: MockedObject[PropertyName], + ): MockedObject & { mock: MockPropertyContext }; + /** + * This function restores the default behavior of all mocks that were previously + * created by this `MockTracker` and disassociates the mocks from the `MockTracker` instance. Once disassociated, the mocks can still be used, but the `MockTracker` instance can no longer be + * used to reset their behavior or + * otherwise interact with them. + * + * After each test completes, this function is called on the test context's `MockTracker`. If the global `MockTracker` is used extensively, calling this + * function manually is recommended. + * @since v19.1.0, v18.13.0 + */ + reset(): void; + /** + * This function restores the default behavior of all mocks that were previously + * created by this `MockTracker`. Unlike `mock.reset()`, `mock.restoreAll()` does + * not disassociate the mocks from the `MockTracker` instance. + * @since v19.1.0, v18.13.0 + */ + restoreAll(): void; + readonly timers: MockTimers; + } + const mock: MockTracker; + interface MockFunctionCall< + F extends Function, + ReturnType = F extends (...args: any) => infer T ? T + : F extends abstract new(...args: any) => infer T ? T + : unknown, + Args = F extends (...args: infer Y) => any ? Y + : F extends abstract new(...args: infer Y) => any ? Y + : unknown[], + > { + /** + * An array of the arguments passed to the mock function. + */ + arguments: Args; + /** + * If the mocked function threw then this property contains the thrown value. + */ + error: unknown | undefined; + /** + * The value returned by the mocked function. + * + * If the mocked function threw, it will be `undefined`. + */ + result: ReturnType | undefined; + /** + * An `Error` object whose stack can be used to determine the callsite of the mocked function invocation. + */ + stack: Error; + /** + * If the mocked function is a constructor, this field contains the class being constructed. + * Otherwise this will be `undefined`. + */ + target: F extends abstract new(...args: any) => any ? F : undefined; + /** + * The mocked function's `this` value. + */ + this: unknown; + } + /** + * The `MockFunctionContext` class is used to inspect or manipulate the behavior of + * mocks created via the `MockTracker` APIs. + * @since v19.1.0, v18.13.0 + */ + interface MockFunctionContext { + /** + * A getter that returns a copy of the internal array used to track calls to the + * mock. Each entry in the array is an object with the following properties. + * @since v19.1.0, v18.13.0 + */ + readonly calls: MockFunctionCall[]; + /** + * This function returns the number of times that this mock has been invoked. This + * function is more efficient than checking `ctx.calls.length` because `ctx.calls` is a getter that creates a copy of the internal call tracking array. + * @since v19.1.0, v18.13.0 + * @return The number of times that this mock has been invoked. + */ + callCount(): number; + /** + * This function is used to change the behavior of an existing mock. + * + * The following example creates a mock function using `t.mock.fn()`, calls the + * mock function, and then changes the mock implementation to a different function. + * + * ```js + * test('changes a mock behavior', (t) => { + * let cnt = 0; + * + * function addOne() { + * cnt++; + * return cnt; + * } + * + * function addTwo() { + * cnt += 2; + * return cnt; + * } + * + * const fn = t.mock.fn(addOne); + * + * assert.strictEqual(fn(), 1); + * fn.mock.mockImplementation(addTwo); + * assert.strictEqual(fn(), 3); + * assert.strictEqual(fn(), 5); + * }); + * ``` + * @since v19.1.0, v18.13.0 + * @param implementation The function to be used as the mock's new implementation. + */ + mockImplementation(implementation: F): void; + /** + * This function is used to change the behavior of an existing mock for a single + * invocation. Once invocation `onCall` has occurred, the mock will revert to + * whatever behavior it would have used had `mockImplementationOnce()` not been + * called. + * + * The following example creates a mock function using `t.mock.fn()`, calls the + * mock function, changes the mock implementation to a different function for the + * next invocation, and then resumes its previous behavior. + * + * ```js + * test('changes a mock behavior once', (t) => { + * let cnt = 0; + * + * function addOne() { + * cnt++; + * return cnt; + * } + * + * function addTwo() { + * cnt += 2; + * return cnt; + * } + * + * const fn = t.mock.fn(addOne); + * + * assert.strictEqual(fn(), 1); + * fn.mock.mockImplementationOnce(addTwo); + * assert.strictEqual(fn(), 3); + * assert.strictEqual(fn(), 4); + * }); + * ``` + * @since v19.1.0, v18.13.0 + * @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`. + * @param onCall The invocation number that will use `implementation`. If the specified invocation has already occurred then an exception is thrown. + */ + mockImplementationOnce(implementation: F, onCall?: number): void; + /** + * Resets the call history of the mock function. + * @since v19.3.0, v18.13.0 + */ + resetCalls(): void; + /** + * Resets the implementation of the mock function to its original behavior. The + * mock can still be used after calling this function. + * @since v19.1.0, v18.13.0 + */ + restore(): void; + } + /** + * @since v22.3.0 + * @experimental + */ + interface MockModuleContext { + /** + * Resets the implementation of the mock module. + * @since v22.3.0 + */ + restore(): void; + } + /** + * @since v24.3.0 + */ + class MockPropertyContext { + /** + * A getter that returns a copy of the internal array used to track accesses (get/set) to + * the mocked property. Each entry in the array is an object with the following properties: + */ + readonly accesses: Array<{ + type: "get" | "set"; + value: PropertyType; + stack: Error; + }>; + /** + * This function returns the number of times that the property was accessed. + * This function is more efficient than checking `ctx.accesses.length` because + * `ctx.accesses` is a getter that creates a copy of the internal access tracking array. + * @returns The number of times that the property was accessed (read or written). + */ + accessCount(): number; + /** + * This function is used to change the value returned by the mocked property getter. + * @param value The new value to be set as the mocked property value. + */ + mockImplementation(value: PropertyType): void; + /** + * This function is used to change the behavior of an existing mock for a single + * invocation. Once invocation `onAccess` has occurred, the mock will revert to + * whatever behavior it would have used had `mockImplementationOnce()` not been + * called. + * + * The following example creates a mock function using `t.mock.property()`, calls the + * mock property, changes the mock implementation to a different value for the + * next invocation, and then resumes its previous behavior. + * + * ```js + * test('changes a mock behavior once', (t) => { + * const obj = { foo: 1 }; + * + * const prop = t.mock.property(obj, 'foo', 5); + * + * assert.strictEqual(obj.foo, 5); + * prop.mock.mockImplementationOnce(25); + * assert.strictEqual(obj.foo, 25); + * assert.strictEqual(obj.foo, 5); + * }); + * ``` + * @param value The value to be used as the mock's + * implementation for the invocation number specified by `onAccess`. + * @param onAccess The invocation number that will use `value`. If + * the specified invocation has already occurred then an exception is thrown. + * **Default:** The number of the next invocation. + */ + mockImplementationOnce(value: PropertyType, onAccess?: number): void; + /** + * Resets the access history of the mocked property. + */ + resetAccesses(): void; + /** + * Resets the implementation of the mock property to its original behavior. The + * mock can still be used after calling this function. + */ + restore(): void; + } + interface MockTimersOptions { + apis: ReadonlyArray<"setInterval" | "setTimeout" | "setImmediate" | "Date">; + now?: number | Date | undefined; + } + /** + * Mocking timers is a technique commonly used in software testing to simulate and + * control the behavior of timers, such as `setInterval` and `setTimeout`, + * without actually waiting for the specified time intervals. + * + * The MockTimers API also allows for mocking of the `Date` constructor and + * `setImmediate`/`clearImmediate` functions. + * + * The `MockTracker` provides a top-level `timers` export + * which is a `MockTimers` instance. + * @since v20.4.0 + */ + interface MockTimers { + /** + * Enables timer mocking for the specified timers. + * + * **Note:** When you enable mocking for a specific timer, its associated + * clear function will also be implicitly mocked. + * + * **Note:** Mocking `Date` will affect the behavior of the mocked timers + * as they use the same internal clock. + * + * Example usage without setting initial time: + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.enable({ apis: ['setInterval', 'Date'], now: 1234 }); + * ``` + * + * The above example enables mocking for the `Date` constructor, `setInterval` timer and + * implicitly mocks the `clearInterval` function. Only the `Date` constructor from `globalThis`, + * `setInterval` and `clearInterval` functions from `node:timers`, `node:timers/promises`, and `globalThis` will be mocked. + * + * Example usage with initial time set + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.enable({ apis: ['Date'], now: 1000 }); + * ``` + * + * Example usage with initial Date object as time set + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.enable({ apis: ['Date'], now: new Date() }); + * ``` + * + * Alternatively, if you call `mock.timers.enable()` without any parameters: + * + * All timers (`'setInterval'`, `'clearInterval'`, `'Date'`, `'setImmediate'`, `'clearImmediate'`, `'setTimeout'`, and `'clearTimeout'`) + * will be mocked. + * + * The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout` functions from `node:timers`, `node:timers/promises`, + * and `globalThis` will be mocked. + * The `Date` constructor from `globalThis` will be mocked. + * + * If there is no initial epoch set, the initial date will be based on 0 in the Unix epoch. This is `January 1st, 1970, 00:00:00 UTC`. You can + * set an initial date by passing a now property to the `.enable()` method. This value will be used as the initial date for the mocked Date + * object. It can either be a positive integer, or another Date object. + * @since v20.4.0 + */ + enable(options?: MockTimersOptions): void; + /** + * Sets the current Unix timestamp that will be used as reference for any mocked + * `Date` objects. + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('runAll functions following the given order', (context) => { + * const now = Date.now(); + * const setTime = 1000; + * // Date.now is not mocked + * assert.deepStrictEqual(Date.now(), now); + * + * context.mock.timers.enable({ apis: ['Date'] }); + * context.mock.timers.setTime(setTime); + * // Date.now is now 1000 + * assert.strictEqual(Date.now(), setTime); + * }); + * ``` + * @since v21.2.0, v20.11.0 + */ + setTime(milliseconds: number): void; + /** + * This function restores the default behavior of all mocks that were previously + * created by this `MockTimers` instance and disassociates the mocks + * from the `MockTracker` instance. + * + * **Note:** After each test completes, this function is called on + * the test context's `MockTracker`. + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.reset(); + * ``` + * @since v20.4.0 + */ + reset(): void; + /** + * Advances time for all mocked timers. + * + * **Note:** This diverges from how `setTimeout` in Node.js behaves and accepts + * only positive numbers. In Node.js, `setTimeout` with negative numbers is + * only supported for web compatibility reasons. + * + * The following example mocks a `setTimeout` function and + * by using `.tick` advances in + * time triggering all pending timers. + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * + * context.mock.timers.enable({ apis: ['setTimeout'] }); + * + * setTimeout(fn, 9999); + * + * assert.strictEqual(fn.mock.callCount(), 0); + * + * // Advance in time + * context.mock.timers.tick(9999); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * + * Alternativelly, the `.tick` function can be called many times + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * context.mock.timers.enable({ apis: ['setTimeout'] }); + * const nineSecs = 9000; + * setTimeout(fn, nineSecs); + * + * const twoSeconds = 3000; + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * + * Advancing time using `.tick` will also advance the time for any `Date` object + * created after the mock was enabled (if `Date` was also set to be mocked). + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * + * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); + * setTimeout(fn, 9999); + * + * assert.strictEqual(fn.mock.callCount(), 0); + * assert.strictEqual(Date.now(), 0); + * + * // Advance in time + * context.mock.timers.tick(9999); + * assert.strictEqual(fn.mock.callCount(), 1); + * assert.strictEqual(Date.now(), 9999); + * }); + * ``` + * @since v20.4.0 + */ + tick(milliseconds: number): void; + /** + * Triggers all pending mocked timers immediately. If the `Date` object is also + * mocked, it will also advance the `Date` object to the furthest timer's time. + * + * The example below triggers all pending timers immediately, + * causing them to execute without any delay. + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('runAll functions following the given order', (context) => { + * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); + * const results = []; + * setTimeout(() => results.push(1), 9999); + * + * // Notice that if both timers have the same timeout, + * // the order of execution is guaranteed + * setTimeout(() => results.push(3), 8888); + * setTimeout(() => results.push(2), 8888); + * + * assert.deepStrictEqual(results, []); + * + * context.mock.timers.runAll(); + * assert.deepStrictEqual(results, [3, 2, 1]); + * // The Date object is also advanced to the furthest timer's time + * assert.strictEqual(Date.now(), 9999); + * }); + * ``` + * + * **Note:** The `runAll()` function is specifically designed for + * triggering timers in the context of timer mocking. + * It does not have any effect on real-time system + * clocks or actual timers outside of the mocking environment. + * @since v20.4.0 + */ + runAll(): void; + /** + * Calls {@link MockTimers.reset()}. + */ + [Symbol.dispose](): void; + } + /** + * An object whose methods are used to configure available assertions on the + * `TestContext` objects in the current process. The methods from `node:assert` + * and snapshot testing functions are available by default. + * + * It is possible to apply the same configuration to all files by placing common + * configuration code in a module + * preloaded with `--require` or `--import`. + * @since v22.14.0 + */ + namespace assert { + /** + * Defines a new assertion function with the provided name and function. If an + * assertion already exists with the same name, it is overwritten. + * @since v22.14.0 + */ + function register(name: string, fn: (this: TestContext, ...args: any[]) => void): void; + } + /** + * @since v22.3.0 + */ + namespace snapshot { + /** + * This function is used to customize the default serialization mechanism used by the test runner. + * + * By default, the test runner performs serialization by calling `JSON.stringify(value, null, 2)` on the provided value. + * `JSON.stringify()` does have limitations regarding circular structures and supported data types. + * If a more robust serialization mechanism is required, this function should be used to specify a list of custom serializers. + * + * Serializers are called in order, with the output of the previous serializer passed as input to the next. + * The final result must be a string value. + * @since v22.3.0 + * @param serializers An array of synchronous functions used as the default serializers for snapshot tests. + */ + function setDefaultSnapshotSerializers(serializers: ReadonlyArray<(value: any) => any>): void; + /** + * This function is used to set a custom resolver for the location of the snapshot file used for snapshot testing. + * By default, the snapshot filename is the same as the entry point filename with `.snapshot` appended. + * @since v22.3.0 + * @param fn A function used to compute the location of the snapshot file. + * The function receives the path of the test file as its only argument. If the + * test is not associated with a file (for example in the REPL), the input is + * undefined. `fn()` must return a string specifying the location of the snapshot file. + */ + function setResolveSnapshotPath(fn: (path: string | undefined) => string): void; + } + } + type FunctionPropertyNames = { + [K in keyof T]: T[K] extends Function ? K : never; + }[keyof T]; + export = test; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/test/reporters.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/test/reporters.d.ts new file mode 100644 index 0000000..465e80d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/test/reporters.d.ts @@ -0,0 +1,96 @@ +/** + * The `node:test` module supports passing `--test-reporter` + * flags for the test runner to use a specific reporter. + * + * The following built-reporters are supported: + * + * * `spec` + * The `spec` reporter outputs the test results in a human-readable format. This + * is the default reporter. + * + * * `tap` + * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format. + * + * * `dot` + * The `dot` reporter outputs the test results in a compact format, + * where each passing test is represented by a `.`, + * and each failing test is represented by a `X`. + * + * * `junit` + * The junit reporter outputs test results in a jUnit XML format + * + * * `lcov` + * The `lcov` reporter outputs test coverage when used with the + * `--experimental-test-coverage` flag. + * + * The exact output of these reporters is subject to change between versions of + * Node.js, and should not be relied on programmatically. If programmatic access + * to the test runner's output is required, use the events emitted by the + * `TestsStream`. + * + * The reporters are available via the `node:test/reporters` module: + * + * ```js + * import { tap, spec, dot, junit, lcov } from 'node:test/reporters'; + * ``` + * @since v19.9.0, v18.17.0 + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/test/reporters.js) + */ +declare module "node:test/reporters" { + import { Transform, TransformOptions } from "node:stream"; + import { EventData } from "node:test"; + type TestEvent = + | { type: "test:coverage"; data: EventData.TestCoverage } + | { type: "test:complete"; data: EventData.TestComplete } + | { type: "test:dequeue"; data: EventData.TestDequeue } + | { type: "test:diagnostic"; data: EventData.TestDiagnostic } + | { type: "test:enqueue"; data: EventData.TestEnqueue } + | { type: "test:fail"; data: EventData.TestFail } + | { type: "test:pass"; data: EventData.TestPass } + | { type: "test:plan"; data: EventData.TestPlan } + | { type: "test:start"; data: EventData.TestStart } + | { type: "test:stderr"; data: EventData.TestStderr } + | { type: "test:stdout"; data: EventData.TestStdout } + | { type: "test:summary"; data: EventData.TestSummary } + | { type: "test:watch:drained"; data: undefined } + | { type: "test:watch:restarted"; data: undefined }; + interface ReporterConstructorWrapper Transform> { + new(...args: ConstructorParameters): InstanceType; + (...args: ConstructorParameters): InstanceType; + } + /** + * The `dot` reporter outputs the test results in a compact format, + * where each passing test is represented by a `.`, + * and each failing test is represented by a `X`. + * @since v20.0.0 + */ + function dot(source: AsyncIterable): NodeJS.AsyncIterator; + /** + * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format. + * @since v20.0.0 + */ + function tap(source: AsyncIterable): NodeJS.AsyncIterator; + class SpecReporter extends Transform { + constructor(); + } + /** + * The `spec` reporter outputs the test results in a human-readable format. + * @since v20.0.0 + */ + const spec: ReporterConstructorWrapper; + /** + * The `junit` reporter outputs test results in a jUnit XML format. + * @since v21.0.0 + */ + function junit(source: AsyncIterable): NodeJS.AsyncIterator; + class LcovReporter extends Transform { + constructor(options?: Omit); + } + /** + * The `lcov` reporter outputs test coverage when used with the + * [`--experimental-test-coverage`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--experimental-test-coverage) flag. + * @since v22.0.0 + */ + const lcov: ReporterConstructorWrapper; + export { dot, junit, lcov, spec, tap, TestEvent }; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/timers.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/timers.d.ts new file mode 100644 index 0000000..00a8cd0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/timers.d.ts @@ -0,0 +1,159 @@ +/** + * The `timer` module exposes a global API for scheduling functions to + * be called at some future period of time. Because the timer functions are + * globals, there is no need to import `node:timers` to use the API. + * + * The timer functions within Node.js implement a similar API as the timers API + * provided by Web Browsers but use a different internal implementation that is + * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/timers.js) + */ +declare module "node:timers" { + import { Abortable } from "node:events"; + import * as promises from "node:timers/promises"; + export interface TimerOptions extends Abortable { + /** + * Set to `false` to indicate that the scheduled `Timeout` + * should not require the Node.js event loop to remain active. + * @default true + */ + ref?: boolean | undefined; + } + global { + namespace NodeJS { + /** + * This object is created internally and is returned from `setImmediate()`. It + * can be passed to `clearImmediate()` in order to cancel the scheduled + * actions. + * + * By default, when an immediate is scheduled, the Node.js event loop will continue + * running as long as the immediate is active. The `Immediate` object returned by + * `setImmediate()` exports both `immediate.ref()` and `immediate.unref()` + * functions that can be used to control this default behavior. + */ + interface Immediate extends RefCounted, Disposable { + /** + * If true, the `Immediate` object will keep the Node.js event loop active. + * @since v11.0.0 + */ + hasRef(): boolean; + /** + * When called, requests that the Node.js event loop _not_ exit so long as the + * `Immediate` is active. Calling `immediate.ref()` multiple times will have no + * effect. + * + * By default, all `Immediate` objects are "ref'ed", making it normally unnecessary + * to call `immediate.ref()` unless `immediate.unref()` had been called previously. + * @since v9.7.0 + * @returns a reference to `immediate` + */ + ref(): this; + /** + * When called, the active `Immediate` object will not require the Node.js event + * loop to remain active. If there is no other activity keeping the event loop + * running, the process may exit before the `Immediate` object's callback is + * invoked. Calling `immediate.unref()` multiple times will have no effect. + * @since v9.7.0 + * @returns a reference to `immediate` + */ + unref(): this; + /** + * Cancels the immediate. This is similar to calling `clearImmediate()`. + * @since v20.5.0, v18.18.0 + */ + [Symbol.dispose](): void; + _onImmediate(...args: any[]): void; + } + // Legacy interface used in Node.js v9 and prior + // TODO: remove in a future major version bump + /** @deprecated Use `NodeJS.Timeout` instead. */ + interface Timer extends RefCounted { + hasRef(): boolean; + refresh(): this; + [Symbol.toPrimitive](): number; + } + /** + * This object is created internally and is returned from `setTimeout()` and + * `setInterval()`. It can be passed to either `clearTimeout()` or + * `clearInterval()` in order to cancel the scheduled actions. + * + * By default, when a timer is scheduled using either `setTimeout()` or + * `setInterval()`, the Node.js event loop will continue running as long as the + * timer is active. Each of the `Timeout` objects returned by these functions + * export both `timeout.ref()` and `timeout.unref()` functions that can be used to + * control this default behavior. + */ + interface Timeout extends RefCounted, Disposable, Timer { + /** + * Cancels the timeout. + * @since v0.9.1 + * @legacy Use `clearTimeout()` instead. + * @returns a reference to `timeout` + */ + close(): this; + /** + * If true, the `Timeout` object will keep the Node.js event loop active. + * @since v11.0.0 + */ + hasRef(): boolean; + /** + * When called, requests that the Node.js event loop _not_ exit so long as the + * `Timeout` is active. Calling `timeout.ref()` multiple times will have no effect. + * + * By default, all `Timeout` objects are "ref'ed", making it normally unnecessary + * to call `timeout.ref()` unless `timeout.unref()` had been called previously. + * @since v0.9.1 + * @returns a reference to `timeout` + */ + ref(): this; + /** + * Sets the timer's start time to the current time, and reschedules the timer to + * call its callback at the previously specified duration adjusted to the current + * time. This is useful for refreshing a timer without allocating a new + * JavaScript object. + * + * Using this on a timer that has already called its callback will reactivate the + * timer. + * @since v10.2.0 + * @returns a reference to `timeout` + */ + refresh(): this; + /** + * When called, the active `Timeout` object will not require the Node.js event loop + * to remain active. If there is no other activity keeping the event loop running, + * the process may exit before the `Timeout` object's callback is invoked. Calling + * `timeout.unref()` multiple times will have no effect. + * @since v0.9.1 + * @returns a reference to `timeout` + */ + unref(): this; + /** + * Coerce a `Timeout` to a primitive. The primitive can be used to + * clear the `Timeout`. The primitive can only be used in the + * same thread where the timeout was created. Therefore, to use it + * across `worker_threads` it must first be passed to the correct + * thread. This allows enhanced compatibility with browser + * `setTimeout()` and `setInterval()` implementations. + * @since v14.9.0, v12.19.0 + */ + [Symbol.toPrimitive](): number; + /** + * Cancels the timeout. + * @since v20.5.0, v18.18.0 + */ + [Symbol.dispose](): void; + _onTimeout(...args: any[]): void; + } + } + } + import clearImmediate = globalThis.clearImmediate; + import clearInterval = globalThis.clearInterval; + import clearTimeout = globalThis.clearTimeout; + import setImmediate = globalThis.setImmediate; + import setInterval = globalThis.setInterval; + import setTimeout = globalThis.setTimeout; + export { clearImmediate, clearInterval, clearTimeout, promises, setImmediate, setInterval, setTimeout }; +} +declare module "timers" { + export * from "node:timers"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/timers/promises.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/timers/promises.d.ts new file mode 100644 index 0000000..85bc831 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/timers/promises.d.ts @@ -0,0 +1,108 @@ +/** + * The `timers/promises` API provides an alternative set of timer functions + * that return `Promise` objects. The API is accessible via + * `require('node:timers/promises')`. + * + * ```js + * import { + * setTimeout, + * setImmediate, + * setInterval, + * } from 'node:timers/promises'; + * ``` + * @since v15.0.0 + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/timers/promises.js) + */ +declare module "node:timers/promises" { + import { TimerOptions } from "node:timers"; + /** + * ```js + * import { + * setTimeout, + * } from 'node:timers/promises'; + * + * const res = await setTimeout(100, 'result'); + * + * console.log(res); // Prints 'result' + * ``` + * @since v15.0.0 + * @param delay The number of milliseconds to wait before fulfilling the + * promise. **Default:** `1`. + * @param value A value with which the promise is fulfilled. + */ + function setTimeout(delay?: number, value?: T, options?: TimerOptions): Promise; + /** + * ```js + * import { + * setImmediate, + * } from 'node:timers/promises'; + * + * const res = await setImmediate('result'); + * + * console.log(res); // Prints 'result' + * ``` + * @since v15.0.0 + * @param value A value with which the promise is fulfilled. + */ + function setImmediate(value?: T, options?: TimerOptions): Promise; + /** + * Returns an async iterator that generates values in an interval of `delay` ms. + * If `ref` is `true`, you need to call `next()` of async iterator explicitly + * or implicitly to keep the event loop alive. + * + * ```js + * import { + * setInterval, + * } from 'node:timers/promises'; + * + * const interval = 100; + * for await (const startTime of setInterval(interval, Date.now())) { + * const now = Date.now(); + * console.log(now); + * if ((now - startTime) > 1000) + * break; + * } + * console.log(Date.now()); + * ``` + * @since v15.9.0 + * @param delay The number of milliseconds to wait between iterations. + * **Default:** `1`. + * @param value A value with which the iterator returns. + */ + function setInterval(delay?: number, value?: T, options?: TimerOptions): NodeJS.AsyncIterator; + interface Scheduler { + /** + * An experimental API defined by the [Scheduling APIs](https://github.com/WICG/scheduling-apis) draft specification + * being developed as a standard Web Platform API. + * + * Calling `timersPromises.scheduler.wait(delay, options)` is roughly equivalent + * to calling `timersPromises.setTimeout(delay, undefined, options)` except that + * the `ref` option is not supported. + * + * ```js + * import { scheduler } from 'node:timers/promises'; + * + * await scheduler.wait(1000); // Wait one second before continuing + * ``` + * @since v17.3.0, v16.14.0 + * @experimental + * @param delay The number of milliseconds to wait before resolving the + * promise. + */ + wait(delay: number, options?: { signal?: AbortSignal }): Promise; + /** + * An experimental API defined by the [Scheduling APIs](https://github.com/WICG/scheduling-apis) draft specification + * being developed as a standard Web Platform API. + * + * Calling `timersPromises.scheduler.yield()` is equivalent to calling + * `timersPromises.setImmediate()` with no arguments. + * @since v17.3.0, v16.14.0 + * @experimental + */ + yield(): Promise; + } + const scheduler: Scheduler; +} +declare module "timers/promises" { + export * from "node:timers/promises"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/tls.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/tls.d.ts new file mode 100644 index 0000000..a2c29df --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/tls.d.ts @@ -0,0 +1,1203 @@ +/** + * The `node:tls` module provides an implementation of the Transport Layer Security + * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. + * The module can be accessed using: + * + * ```js + * import tls from 'node:tls'; + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/tls.js) + */ +declare module "node:tls" { + import { NonSharedBuffer } from "node:buffer"; + import { X509Certificate } from "node:crypto"; + import * as net from "node:net"; + import * as stream from "stream"; + const CLIENT_RENEG_LIMIT: number; + const CLIENT_RENEG_WINDOW: number; + interface Certificate extends NodeJS.Dict { + /** + * Country code. + */ + C?: string | string[]; + /** + * Street. + */ + ST?: string | string[]; + /** + * Locality. + */ + L?: string | string[]; + /** + * Organization. + */ + O?: string | string[]; + /** + * Organizational unit. + */ + OU?: string | string[]; + /** + * Common name. + */ + CN?: string | string[]; + } + interface PeerCertificate { + /** + * `true` if a Certificate Authority (CA), `false` otherwise. + * @since v18.13.0 + */ + ca: boolean; + /** + * The DER encoded X.509 certificate data. + */ + raw: NonSharedBuffer; + /** + * The certificate subject. + */ + subject: Certificate; + /** + * The certificate issuer, described in the same terms as the `subject`. + */ + issuer: Certificate; + /** + * The date-time the certificate is valid from. + */ + valid_from: string; + /** + * The date-time the certificate is valid to. + */ + valid_to: string; + /** + * The certificate serial number, as a hex string. + */ + serialNumber: string; + /** + * The SHA-1 digest of the DER encoded certificate. + * It is returned as a `:` separated hexadecimal string. + */ + fingerprint: string; + /** + * The SHA-256 digest of the DER encoded certificate. + * It is returned as a `:` separated hexadecimal string. + */ + fingerprint256: string; + /** + * The SHA-512 digest of the DER encoded certificate. + * It is returned as a `:` separated hexadecimal string. + */ + fingerprint512: string; + /** + * The extended key usage, a set of OIDs. + */ + ext_key_usage?: string[]; + /** + * A string containing concatenated names for the subject, + * an alternative to the `subject` names. + */ + subjectaltname?: string; + /** + * An array describing the AuthorityInfoAccess, used with OCSP. + */ + infoAccess?: NodeJS.Dict; + /** + * For RSA keys: The RSA bit size. + * + * For EC keys: The key size in bits. + */ + bits?: number; + /** + * The RSA exponent, as a string in hexadecimal number notation. + */ + exponent?: string; + /** + * The RSA modulus, as a hexadecimal string. + */ + modulus?: string; + /** + * The public key. + */ + pubkey?: NonSharedBuffer; + /** + * The ASN.1 name of the OID of the elliptic curve. + * Well-known curves are identified by an OID. + * While it is unusual, it is possible that the curve + * is identified by its mathematical properties, + * in which case it will not have an OID. + */ + asn1Curve?: string; + /** + * The NIST name for the elliptic curve, if it has one + * (not all well-known curves have been assigned names by NIST). + */ + nistCurve?: string; + } + interface DetailedPeerCertificate extends PeerCertificate { + /** + * The issuer certificate object. + * For self-signed certificates, this may be a circular reference. + */ + issuerCertificate: DetailedPeerCertificate; + } + interface CipherNameAndProtocol { + /** + * The cipher name. + */ + name: string; + /** + * SSL/TLS protocol version. + */ + version: string; + /** + * IETF name for the cipher suite. + */ + standardName: string; + } + interface EphemeralKeyInfo { + /** + * The supported types are 'DH' and 'ECDH'. + */ + type: string; + /** + * The name property is available only when type is 'ECDH'. + */ + name?: string | undefined; + /** + * The size of parameter of an ephemeral key exchange. + */ + size: number; + } + interface KeyObject { + /** + * Private keys in PEM format. + */ + pem: string | Buffer; + /** + * Optional passphrase. + */ + passphrase?: string | undefined; + } + interface PxfObject { + /** + * PFX or PKCS12 encoded private key and certificate chain. + */ + buf: string | Buffer; + /** + * Optional passphrase. + */ + passphrase?: string | undefined; + } + interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { + /** + * If true the TLS socket will be instantiated in server-mode. + * Defaults to false. + */ + isServer?: boolean | undefined; + /** + * An optional net.Server instance. + */ + server?: net.Server | undefined; + /** + * An optional Buffer instance containing a TLS session. + */ + session?: Buffer | undefined; + /** + * If true, specifies that the OCSP status request extension will be + * added to the client hello and an 'OCSPResponse' event will be + * emitted on the socket before establishing a secure communication + */ + requestOCSP?: boolean | undefined; + } + interface TLSSocketEventMap extends net.SocketEventMap { + "keylog": [line: NonSharedBuffer]; + "OCSPResponse": [response: NonSharedBuffer]; + "secure": []; + "secureConnect": []; + "session": [session: NonSharedBuffer]; + } + /** + * Performs transparent encryption of written data and all required TLS + * negotiation. + * + * Instances of `tls.TLSSocket` implement the duplex `Stream` interface. + * + * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate}) will only return data while the + * connection is open. + * @since v0.11.4 + */ + class TLSSocket extends net.Socket { + /** + * Construct a new tls.TLSSocket object from an existing TCP socket. + */ + constructor(socket: net.Socket | stream.Duplex, options?: TLSSocketOptions); + /** + * This property is `true` if the peer certificate was signed by one of the CAs + * specified when creating the `tls.TLSSocket` instance, otherwise `false`. + * @since v0.11.4 + */ + authorized: boolean; + /** + * Returns the reason why the peer's certificate was not been verified. This + * property is set only when `tlsSocket.authorized === false`. + * @since v0.11.4 + */ + authorizationError: Error; + /** + * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances. + * @since v0.11.4 + */ + encrypted: true; + /** + * String containing the selected ALPN protocol. + * Before a handshake has completed, this value is always null. + * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. + */ + alpnProtocol: string | false | null; + /** + * String containing the server name requested via SNI (Server Name Indication) TLS extension. + */ + servername: string | false | null; + /** + * Returns an object representing the local certificate. The returned object has + * some properties corresponding to the fields of the certificate. + * + * See {@link TLSSocket.getPeerCertificate} for an example of the certificate + * structure. + * + * If there is no local certificate, an empty object will be returned. If the + * socket has been destroyed, `null` will be returned. + * @since v11.2.0 + */ + getCertificate(): PeerCertificate | object | null; + /** + * Returns an object containing information on the negotiated cipher suite. + * + * For example, a TLSv1.2 protocol with AES256-SHA cipher: + * + * ```json + * { + * "name": "AES256-SHA", + * "standardName": "TLS_RSA_WITH_AES_256_CBC_SHA", + * "version": "SSLv3" + * } + * ``` + * + * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information. + * @since v0.11.4 + */ + getCipher(): CipherNameAndProtocol; + /** + * Returns an object representing the type, name, and size of parameter of + * an ephemeral key exchange in `perfect forward secrecy` on a client + * connection. It returns an empty object when the key exchange is not + * ephemeral. As this is only supported on a client socket; `null` is returned + * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The `name` property is available only when type is `'ECDH'`. + * + * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. + * @since v5.0.0 + */ + getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; + /** + * As the `Finished` messages are message digests of the complete handshake + * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can + * be used for external authentication procedures when the authentication + * provided by SSL/TLS is not desired or is not enough. + * + * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used + * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). + * @since v9.9.0 + * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet. + */ + getFinished(): NonSharedBuffer | undefined; + /** + * Returns an object representing the peer's certificate. If the peer does not + * provide a certificate, an empty object will be returned. If the socket has been + * destroyed, `null` will be returned. + * + * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's + * certificate. + * @since v0.11.4 + * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate. + * @return A certificate object. + */ + getPeerCertificate(detailed: true): DetailedPeerCertificate; + getPeerCertificate(detailed?: false): PeerCertificate; + getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; + /** + * As the `Finished` messages are message digests of the complete handshake + * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can + * be used for external authentication procedures when the authentication + * provided by SSL/TLS is not desired or is not enough. + * + * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used + * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). + * @since v9.9.0 + * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so + * far. + */ + getPeerFinished(): NonSharedBuffer | undefined; + /** + * Returns a string containing the negotiated SSL/TLS protocol version of the + * current connection. The value `'unknown'` will be returned for connected + * sockets that have not completed the handshaking process. The value `null` will + * be returned for server sockets or disconnected client sockets. + * + * Protocol versions are: + * + * * `'SSLv3'` + * * `'TLSv1'` + * * `'TLSv1.1'` + * * `'TLSv1.2'` + * * `'TLSv1.3'` + * + * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information. + * @since v5.7.0 + */ + getProtocol(): string | null; + /** + * Returns the TLS session data or `undefined` if no session was + * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful + * for debugging. + * + * See `Session Resumption` for more information. + * + * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications + * must use the `'session'` event (it also works for TLSv1.2 and below). + * @since v0.11.4 + */ + getSession(): NonSharedBuffer | undefined; + /** + * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information. + * @since v12.11.0 + * @return List of signature algorithms shared between the server and the client in the order of decreasing preference. + */ + getSharedSigalgs(): string[]; + /** + * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`. + * + * It may be useful for debugging. + * + * See `Session Resumption` for more information. + * @since v0.11.4 + */ + getTLSTicket(): NonSharedBuffer | undefined; + /** + * See `Session Resumption` for more information. + * @since v0.5.6 + * @return `true` if the session was reused, `false` otherwise. + */ + isSessionReused(): boolean; + /** + * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. + * Upon completion, the `callback` function will be passed a single argument + * that is either an `Error` (if the request failed) or `null`. + * + * This method can be used to request a peer's certificate after the secure + * connection has been established. + * + * When running as the server, the socket will be destroyed with an error after `handshakeTimeout` timeout. + * + * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the + * protocol. + * @since v0.11.8 + * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with + * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. + * @return `true` if renegotiation was initiated, `false` otherwise. + */ + renegotiate( + options: { + rejectUnauthorized?: boolean | undefined; + requestCert?: boolean | undefined; + }, + callback: (err: Error | null) => void, + ): undefined | boolean; + /** + * The `tlsSocket.setKeyCert()` method sets the private key and certificate to use for the socket. + * This is mainly useful if you wish to select a server certificate from a TLS server's `ALPNCallback`. + * @since v22.5.0, v20.17.0 + * @param context An object containing at least `key` and `cert` properties from the {@link createSecureContext()} `options`, + * or a TLS context object created with {@link createSecureContext()} itself. + */ + setKeyCert(context: SecureContextOptions | SecureContext): void; + /** + * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. + * Returns `true` if setting the limit succeeded; `false` otherwise. + * + * Smaller fragment sizes decrease the buffering latency on the client: larger + * fragments are buffered by the TLS layer until the entire fragment is received + * and its integrity is verified; large fragments can span multiple roundtrips + * and their processing can be delayed due to packet loss or reordering. However, + * smaller fragments add extra TLS framing bytes and CPU overhead, which may + * decrease overall server throughput. + * @since v0.11.11 + * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`. + */ + setMaxSendFragment(size: number): boolean; + /** + * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts + * to renegotiate will trigger an `'error'` event on the `TLSSocket`. + * @since v8.4.0 + */ + disableRenegotiation(): void; + /** + * When enabled, TLS packet trace information is written to `stderr`. This can be + * used to debug TLS connection problems. + * + * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by + * OpenSSL's `SSL_trace()` function, the format is undocumented, can change + * without notice, and should not be relied on. + * @since v12.2.0 + */ + enableTrace(): void; + /** + * Returns the peer certificate as an `X509Certificate` object. + * + * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned. + * @since v15.9.0 + */ + getPeerX509Certificate(): X509Certificate | undefined; + /** + * Returns the local certificate as an `X509Certificate` object. + * + * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned. + * @since v15.9.0 + */ + getX509Certificate(): X509Certificate | undefined; + /** + * Keying material is used for validations to prevent different kind of attacks in + * network protocols, for example in the specifications of IEEE 802.1X. + * + * Example + * + * ```js + * const keyingMaterial = tlsSocket.exportKeyingMaterial( + * 128, + * 'client finished'); + * + * /* + * Example return value of keyingMaterial: + * + * + * ``` + * + * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more + * information. + * @since v13.10.0, v12.17.0 + * @param length number of bytes to retrieve from keying material + * @param label an application specific label, typically this will be a value from the [IANA Exporter Label + * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). + * @param context Optionally provide a context. + * @return requested bytes of the keying material + */ + exportKeyingMaterial(length: number, label: string, context: Buffer): NonSharedBuffer; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: TLSSocketEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: TLSSocketEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: TLSSocketEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: TLSSocketEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: TLSSocketEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: TLSSocketEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once(eventName: E, listener: (...args: TLSSocketEventMap[E]) => void): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: TLSSocketEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: TLSSocketEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: TLSSocketEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: TLSSocketEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface CommonConnectionOptions { + /** + * An optional TLS context object from tls.createSecureContext() + */ + secureContext?: SecureContext | undefined; + /** + * When enabled, TLS packet trace information is written to `stderr`. This can be + * used to debug TLS connection problems. + * @default false + */ + enableTrace?: boolean | undefined; + /** + * If true the server will request a certificate from clients that + * connect and attempt to verify that certificate. Defaults to + * false. + */ + requestCert?: boolean | undefined; + /** + * An array of strings, or a single `Buffer`, `TypedArray`, or `DataView` containing the supported + * ALPN protocols. Buffers should have the format `[len][name][len][name]...` + * e.g. `'\x08http/1.1\x08http/1.0'`, where the `len` byte is the length of the + * next protocol name. Passing an array is usually much simpler, e.g. + * `['http/1.1', 'http/1.0']`. Protocols earlier in the list have higher + * preference than those later. + */ + ALPNProtocols?: readonly string[] | NodeJS.ArrayBufferView | undefined; + /** + * SNICallback(servername, cb) A function that will be + * called if the client supports SNI TLS extension. Two arguments + * will be passed when called: servername and cb. SNICallback should + * invoke cb(null, ctx), where ctx is a SecureContext instance. + * (tls.createSecureContext(...) can be used to get a proper + * SecureContext.) If SNICallback wasn't provided the default callback + * with high-level API will be used (see below). + */ + SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined; + /** + * If true the server will reject any connection which is not + * authorized with the list of supplied CAs. This option only has an + * effect if requestCert is true. + * @default true + */ + rejectUnauthorized?: boolean | undefined; + } + interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { + /** + * Abort the connection if the SSL/TLS handshake does not finish in the + * specified number of milliseconds. A 'tlsClientError' is emitted on + * the tls.Server object whenever a handshake times out. Default: + * 120000 (120 seconds). + */ + handshakeTimeout?: number | undefined; + /** + * The number of seconds after which a TLS session created by the + * server will no longer be resumable. See Session Resumption for more + * information. Default: 300. + */ + sessionTimeout?: number | undefined; + /** + * 48-bytes of cryptographically strong pseudo-random data. + */ + ticketKeys?: Buffer | undefined; + /** + * @param socket + * @param identity identity parameter sent from the client. + * @return pre-shared key that must either be + * a buffer or `null` to stop the negotiation process. Returned PSK must be + * compatible with the selected cipher's digest. + * + * When negotiating TLS-PSK (pre-shared keys), this function is called + * with the identity provided by the client. + * If the return value is `null` the negotiation process will stop and an + * "unknown_psk_identity" alert message will be sent to the other party. + * If the server wishes to hide the fact that the PSK identity was not known, + * the callback must provide some random data as `psk` to make the connection + * fail with "decrypt_error" before negotiation is finished. + * PSK ciphers are disabled by default, and using TLS-PSK thus + * requires explicitly specifying a cipher suite with the `ciphers` option. + * More information can be found in the RFC 4279. + */ + pskCallback?: ((socket: TLSSocket, identity: string) => NodeJS.ArrayBufferView | null) | undefined; + /** + * hint to send to a client to help + * with selecting the identity during TLS-PSK negotiation. Will be ignored + * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be + * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. + */ + pskIdentityHint?: string | undefined; + } + interface PSKCallbackNegotation { + psk: NodeJS.ArrayBufferView; + identity: string; + } + interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { + host?: string | undefined; + port?: number | undefined; + path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. + socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket + checkServerIdentity?: typeof checkServerIdentity | undefined; + servername?: string | undefined; // SNI TLS Extension + session?: Buffer | undefined; + minDHSize?: number | undefined; + lookup?: net.LookupFunction | undefined; + timeout?: number | undefined; + /** + * When negotiating TLS-PSK (pre-shared keys), this function is called + * with optional identity `hint` provided by the server or `null` + * in case of TLS 1.3 where `hint` was removed. + * It will be necessary to provide a custom `tls.checkServerIdentity()` + * for the connection as the default one will try to check hostname/IP + * of the server against the certificate but that's not applicable for PSK + * because there won't be a certificate present. + * More information can be found in the RFC 4279. + * + * @param hint message sent from the server to help client + * decide which identity to use during negotiation. + * Always `null` if TLS 1.3 is used. + * @returns Return `null` to stop the negotiation process. `psk` must be + * compatible with the selected cipher's digest. + * `identity` must use UTF-8 encoding. + */ + pskCallback?: ((hint: string | null) => PSKCallbackNegotation | null) | undefined; + } + interface ServerEventMap extends net.ServerEventMap { + "connection": [socket: net.Socket]; + "keylog": [line: NonSharedBuffer, tlsSocket: TLSSocket]; + "newSession": [sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void]; + "OCSPRequest": [ + certificate: NonSharedBuffer, + issuer: NonSharedBuffer, + callback: (err: Error | null, resp: Buffer | null) => void, + ]; + "resumeSession": [sessionId: Buffer, callback: (err: Error | null, sessionData?: Buffer) => void]; + "secureConnection": [tlsSocket: TLSSocket]; + "tlsClientError": [exception: Error, tlsSocket: TLSSocket]; + } + /** + * Accepts encrypted connections using TLS or SSL. + * @since v0.3.2 + */ + class Server extends net.Server { + constructor(secureConnectionListener?: (socket: TLSSocket) => void); + constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); + /** + * The `server.addContext()` method adds a secure context that will be used if + * the client request's SNI name matches the supplied `hostname` (or wildcard). + * + * When there are multiple matching contexts, the most recently added one is + * used. + * @since v0.5.3 + * @param hostname A SNI host name or wildcard (e.g. `'*'`) + * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created + * with {@link createSecureContext} itself. + */ + addContext(hostname: string, context: SecureContextOptions | SecureContext): void; + /** + * Returns the session ticket keys. + * + * See `Session Resumption` for more information. + * @since v3.0.0 + * @return A 48-byte buffer containing the session ticket keys. + */ + getTicketKeys(): NonSharedBuffer; + /** + * The `server.setSecureContext()` method replaces the secure context of an + * existing server. Existing connections to the server are not interrupted. + * @since v11.0.0 + * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). + */ + setSecureContext(options: SecureContextOptions): void; + /** + * Sets the session ticket keys. + * + * Changes to the ticket keys are effective only for future server connections. + * Existing or currently pending server connections will use the previous keys. + * + * See `Session Resumption` for more information. + * @since v3.0.0 + * @param keys A 48-byte buffer containing the session ticket keys. + */ + setTicketKeys(keys: Buffer): void; + // #region InternalEventEmitter + addListener(eventName: E, listener: (...args: ServerEventMap[E]) => void): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ServerEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ServerEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: ServerEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: ServerEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: ServerEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once(eventName: E, listener: (...args: ServerEventMap[E]) => void): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: ServerEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1"; + interface SecureContextOptions { + /** + * If set, this will be called when a client opens a connection using the ALPN extension. + * One argument will be passed to the callback: an object containing `servername` and `protocols` fields, + * respectively containing the server name from the SNI extension (if any) and an array of + * ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, + * which will be returned to the client as the selected ALPN protocol, or `undefined`, + * to reject the connection with a fatal alert. If a string is returned that does not match one of + * the client's ALPN protocols, an error will be thrown. + * This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error. + */ + ALPNCallback?: ((arg: { servername: string; protocols: string[] }) => string | undefined) | undefined; + /** + * Treat intermediate (non-self-signed) + * certificates in the trust CA certificate list as trusted. + * @since v22.9.0, v20.18.0 + */ + allowPartialTrustChain?: boolean | undefined; + /** + * Optionally override the trusted CA certificates. Default is to trust + * the well-known CAs curated by Mozilla. Mozilla's CAs are completely + * replaced when CAs are explicitly specified using this option. + */ + ca?: string | Buffer | Array | undefined; + /** + * Cert chains in PEM format. One cert chain should be provided per + * private key. Each cert chain should consist of the PEM formatted + * certificate for a provided private key, followed by the PEM + * formatted intermediate certificates (if any), in order, and not + * including the root CA (the root CA must be pre-known to the peer, + * see ca). When providing multiple cert chains, they do not have to + * be in the same order as their private keys in key. If the + * intermediate certificates are not provided, the peer will not be + * able to validate the certificate, and the handshake will fail. + */ + cert?: string | Buffer | Array | undefined; + /** + * Colon-separated list of supported signature algorithms. The list + * can contain digest algorithms (SHA256, MD5 etc.), public key + * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g + * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). + */ + sigalgs?: string | undefined; + /** + * Cipher suite specification, replacing the default. For more + * information, see modifying the default cipher suite. Permitted + * ciphers can be obtained via tls.getCiphers(). Cipher names must be + * uppercased in order for OpenSSL to accept them. + */ + ciphers?: string | undefined; + /** + * Name of an OpenSSL engine which can provide the client certificate. + * @deprecated + */ + clientCertEngine?: string | undefined; + /** + * PEM formatted CRLs (Certificate Revocation Lists). + */ + crl?: string | Buffer | Array | undefined; + /** + * `'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy. + * If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available. + * ECDHE-based perfect forward secrecy will still be available. + */ + dhparam?: string | Buffer | undefined; + /** + * A string describing a named curve or a colon separated list of curve + * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key + * agreement. Set to auto to select the curve automatically. Use + * crypto.getCurves() to obtain a list of available curve names. On + * recent releases, openssl ecparam -list_curves will also display the + * name and description of each available elliptic curve. Default: + * tls.DEFAULT_ECDH_CURVE. + */ + ecdhCurve?: string | undefined; + /** + * Attempt to use the server's cipher suite preferences instead of the + * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be + * set in secureOptions + */ + honorCipherOrder?: boolean | undefined; + /** + * Private keys in PEM format. PEM allows the option of private keys + * being encrypted. Encrypted keys will be decrypted with + * options.passphrase. Multiple keys using different algorithms can be + * provided either as an array of unencrypted key strings or buffers, + * or an array of objects in the form {pem: [, + * passphrase: ]}. The object form can only occur in an array. + * object.passphrase is optional. Encrypted keys will be decrypted with + * object.passphrase if provided, or options.passphrase if it is not. + */ + key?: string | Buffer | Array | undefined; + /** + * Name of an OpenSSL engine to get private key from. Should be used + * together with privateKeyIdentifier. + * @deprecated + */ + privateKeyEngine?: string | undefined; + /** + * Identifier of a private key managed by an OpenSSL engine. Should be + * used together with privateKeyEngine. Should not be set together with + * key, because both options define a private key in different ways. + * @deprecated + */ + privateKeyIdentifier?: string | undefined; + /** + * Optionally set the maximum TLS version to allow. One + * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the + * `secureProtocol` option, use one or the other. + * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using + * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to + * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. + */ + maxVersion?: SecureVersion | undefined; + /** + * Optionally set the minimum TLS version to allow. One + * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the + * `secureProtocol` option, use one or the other. It is not recommended to use + * less than TLSv1.2, but it may be required for interoperability. + * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using + * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to + * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to + * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. + */ + minVersion?: SecureVersion | undefined; + /** + * Shared passphrase used for a single private key and/or a PFX. + */ + passphrase?: string | undefined; + /** + * PFX or PKCS12 encoded private key and certificate chain. pfx is an + * alternative to providing key and cert individually. PFX is usually + * encrypted, if it is, passphrase will be used to decrypt it. Multiple + * PFX can be provided either as an array of unencrypted PFX buffers, + * or an array of objects in the form {buf: [, + * passphrase: ]}. The object form can only occur in an array. + * object.passphrase is optional. Encrypted PFX will be decrypted with + * object.passphrase if provided, or options.passphrase if it is not. + */ + pfx?: string | Buffer | Array | undefined; + /** + * Optionally affect the OpenSSL protocol behavior, which is not + * usually necessary. This should be used carefully if at all! Value is + * a numeric bitmask of the SSL_OP_* options from OpenSSL Options + */ + secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options + /** + * Legacy mechanism to select the TLS protocol version to use, it does + * not support independent control of the minimum and maximum version, + * and does not support limiting the protocol to TLSv1.3. Use + * minVersion and maxVersion instead. The possible values are listed as + * SSL_METHODS, use the function names as strings. For example, use + * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow + * any TLS protocol version up to TLSv1.3. It is not recommended to use + * TLS versions less than 1.2, but it may be required for + * interoperability. Default: none, see minVersion. + */ + secureProtocol?: string | undefined; + /** + * Opaque identifier used by servers to ensure session state is not + * shared between applications. Unused by clients. + */ + sessionIdContext?: string | undefined; + /** + * 48-bytes of cryptographically strong pseudo-random data. + * See Session Resumption for more information. + */ + ticketKeys?: Buffer | undefined; + /** + * The number of seconds after which a TLS session created by the + * server will no longer be resumable. See Session Resumption for more + * information. Default: 300. + */ + sessionTimeout?: number | undefined; + } + interface SecureContext { + context: any; + } + /** + * Verifies the certificate `cert` is issued to `hostname`. + * + * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on + * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type). + * + * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as + * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead. + * + * This function can be overwritten by providing an alternative function as the `options.checkServerIdentity` option that is passed to `tls.connect()`. The + * overwriting function can call `tls.checkServerIdentity()` of course, to augment + * the checks done with additional verification. + * + * This function is only called if the certificate passed all other checks, such as + * being issued by trusted CA (`options.ca`). + * + * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name + * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use + * a custom `options.checkServerIdentity` function that implements the desired behavior. + * @since v0.8.4 + * @param hostname The host name or IP address to verify the certificate against. + * @param cert A `certificate object` representing the peer's certificate. + */ + function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined; + /** + * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is + * automatically set as a listener for the `'secureConnection'` event. + * + * The `ticketKeys` options is automatically shared between `node:cluster` module + * workers. + * + * The following illustrates a simple echo server: + * + * ```js + * import tls from 'node:tls'; + * import fs from 'node:fs'; + * + * const options = { + * key: fs.readFileSync('server-key.pem'), + * cert: fs.readFileSync('server-cert.pem'), + * + * // This is necessary only if using client certificate authentication. + * requestCert: true, + * + * // This is necessary only if the client uses a self-signed certificate. + * ca: [ fs.readFileSync('client-cert.pem') ], + * }; + * + * const server = tls.createServer(options, (socket) => { + * console.log('server connected', + * socket.authorized ? 'authorized' : 'unauthorized'); + * socket.write('welcome!\n'); + * socket.setEncoding('utf8'); + * socket.pipe(socket); + * }); + * server.listen(8000, () => { + * console.log('server bound'); + * }); + * ``` + * + * The server can be tested by connecting to it using the example client from {@link connect}. + * @since v0.3.2 + */ + function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; + function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; + /** + * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event. + * + * `tls.connect()` returns a {@link TLSSocket} object. + * + * Unlike the `https` API, `tls.connect()` does not enable the + * SNI (Server Name Indication) extension by default, which may cause some + * servers to return an incorrect certificate or reject the connection + * altogether. To enable SNI, set the `servername` option in addition + * to `host`. + * + * The following illustrates a client for the echo server example from {@link createServer}: + * + * ```js + * // Assumes an echo server that is listening on port 8000. + * import tls from 'node:tls'; + * import fs from 'node:fs'; + * + * const options = { + * // Necessary only if the server requires client certificate authentication. + * key: fs.readFileSync('client-key.pem'), + * cert: fs.readFileSync('client-cert.pem'), + * + * // Necessary only if the server uses a self-signed certificate. + * ca: [ fs.readFileSync('server-cert.pem') ], + * + * // Necessary only if the server's cert isn't for "localhost". + * checkServerIdentity: () => { return null; }, + * }; + * + * const socket = tls.connect(8000, options, () => { + * console.log('client connected', + * socket.authorized ? 'authorized' : 'unauthorized'); + * process.stdin.pipe(socket); + * process.stdin.resume(); + * }); + * socket.setEncoding('utf8'); + * socket.on('data', (data) => { + * console.log(data); + * }); + * socket.on('end', () => { + * console.log('server ends connection'); + * }); + * ``` + * @since v0.11.3 + */ + function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + function connect( + port: number, + host?: string, + options?: ConnectionOptions, + secureConnectListener?: () => void, + ): TLSSocket; + function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + /** + * `{@link createServer}` sets the default value of the `honorCipherOrder` option + * to `true`, other APIs that create secure contexts leave it unset. + * + * `{@link createServer}` uses a 128 bit truncated SHA1 hash value generated + * from `process.argv` as the default value of the `sessionIdContext` option, other + * APIs that create secure contexts have no default value. + * + * The `tls.createSecureContext()` method creates a `SecureContext` object. It is + * usable as an argument to several `tls` APIs, such as `server.addContext()`, + * but has no public methods. The {@link Server} constructor and the {@link createServer} method do not support the `secureContext` option. + * + * A key is _required_ for ciphers that use certificates. Either `key` or `pfx` can be used to provide it. + * + * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of + * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). + * + * Custom DHE parameters are discouraged in favor of the new `dhparam: 'auto' `option. When set to `'auto'`, well-known DHE parameters of sufficient strength + * will be selected automatically. Otherwise, if necessary, `openssl dhparam` can + * be used to create custom parameters. The key length must be greater than or + * equal to 1024 bits or else an error will be thrown. Although 1024 bits is + * permissible, use 2048 bits or larger for stronger security. + * @since v0.11.13 + */ + function createSecureContext(options?: SecureContextOptions): SecureContext; + /** + * Returns an array containing the CA certificates from various sources, depending on `type`: + * + * * `"default"`: return the CA certificates that will be used by the Node.js TLS clients by default. + * * When `--use-bundled-ca` is enabled (default), or `--use-openssl-ca` is not enabled, + * this would include CA certificates from the bundled Mozilla CA store. + * * When `--use-system-ca` is enabled, this would also include certificates from the system's + * trusted store. + * * When `NODE_EXTRA_CA_CERTS` is used, this would also include certificates loaded from the specified + * file. + * * `"system"`: return the CA certificates that are loaded from the system's trusted store, according + * to rules set by `--use-system-ca`. This can be used to get the certificates from the system + * when `--use-system-ca` is not enabled. + * * `"bundled"`: return the CA certificates from the bundled Mozilla CA store. This would be the same + * as `tls.rootCertificates`. + * * `"extra"`: return the CA certificates loaded from `NODE_EXTRA_CA_CERTS`. It's an empty array if + * `NODE_EXTRA_CA_CERTS` is not set. + * @since v22.15.0 + * @param type The type of CA certificates that will be returned. Valid values + * are `"default"`, `"system"`, `"bundled"` and `"extra"`. + * **Default:** `"default"`. + * @returns An array of PEM-encoded certificates. The array may contain duplicates + * if the same certificate is repeatedly stored in multiple sources. + */ + function getCACertificates(type?: "default" | "system" | "bundled" | "extra"): string[]; + /** + * Returns an array with the names of the supported TLS ciphers. The names are + * lower-case for historical reasons, but must be uppercased to be used in + * the `ciphers` option of `{@link createSecureContext}`. + * + * Not all supported ciphers are enabled by default. See + * [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v25.x/api/tls.html#modifying-the-default-tls-cipher-suite). + * + * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for + * TLSv1.2 and below. + * + * ```js + * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] + * ``` + * @since v0.10.2 + */ + function getCiphers(): string[]; + /** + * Sets the default CA certificates used by Node.js TLS clients. If the provided + * certificates are parsed successfully, they will become the default CA + * certificate list returned by {@link getCACertificates} and used + * by subsequent TLS connections that don't specify their own CA certificates. + * The certificates will be deduplicated before being set as the default. + * + * This function only affects the current Node.js thread. Previous + * sessions cached by the HTTPS agent won't be affected by this change, so + * this method should be called before any unwanted cachable TLS connections are + * made. + * + * To use system CA certificates as the default: + * + * ```js + * import tls from 'node:tls'; + * tls.setDefaultCACertificates(tls.getCACertificates('system')); + * ``` + * + * This function completely replaces the default CA certificate list. To add additional + * certificates to the existing defaults, get the current certificates and append to them: + * + * ```js + * import tls from 'node:tls'; + * const currentCerts = tls.getCACertificates('default'); + * const additionalCerts = ['-----BEGIN CERTIFICATE-----\n...']; + * tls.setDefaultCACertificates([...currentCerts, ...additionalCerts]); + * ``` + * @since v24.5.0 + * @param certs An array of CA certificates in PEM format. + */ + function setDefaultCACertificates(certs: ReadonlyArray): void; + /** + * The default curve name to use for ECDH key agreement in a tls server. + * The default value is `'auto'`. See `{@link createSecureContext()}` for further + * information. + * @since v0.11.13 + */ + let DEFAULT_ECDH_CURVE: string; + /** + * The default value of the `maxVersion` option of `{@link createSecureContext()}`. + * It can be assigned any of the supported TLS protocol versions, + * `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. **Default:** `'TLSv1.3'`, unless + * changed using CLI options. Using `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using + * `--tls-max-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options + * are provided, the highest maximum is used. + * @since v11.4.0 + */ + let DEFAULT_MAX_VERSION: SecureVersion; + /** + * The default value of the `minVersion` option of `{@link createSecureContext()}`. + * It can be assigned any of the supported TLS protocol versions, + * `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. **Default:** `'TLSv1.2'`, unless + * changed using CLI options. Using `--tls-min-v1.0` sets the default to + * `'TLSv1'`. Using `--tls-min-v1.1` sets the default to `'TLSv1.1'`. Using + * `--tls-min-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options + * are provided, the lowest minimum is used. + * @since v11.4.0 + */ + let DEFAULT_MIN_VERSION: SecureVersion; + /** + * The default value of the `ciphers` option of `{@link createSecureContext()}`. + * It can be assigned any of the supported OpenSSL ciphers. + * Defaults to the content of `crypto.constants.defaultCoreCipherList`, unless + * changed using CLI options using `--tls-default-ciphers`. + * @since v19.8.0 + */ + let DEFAULT_CIPHERS: string; + /** + * An immutable array of strings representing the root certificates (in PEM format) + * from the bundled Mozilla CA store as supplied by the current Node.js version. + * + * The bundled CA store, as supplied by Node.js, is a snapshot of Mozilla CA store + * that is fixed at release time. It is identical on all supported platforms. + * @since v12.3.0 + */ + const rootCertificates: readonly string[]; +} +declare module "tls" { + export * from "node:tls"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/trace_events.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/trace_events.d.ts new file mode 100644 index 0000000..b2c6b32 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/trace_events.d.ts @@ -0,0 +1,197 @@ +/** + * The `node:trace_events` module provides a mechanism to centralize tracing information + * generated by V8, Node.js core, and userspace code. + * + * Tracing can be enabled with the `--trace-event-categories` command-line flag + * or by using the `trace_events` module. The `--trace-event-categories` flag + * accepts a list of comma-separated category names. + * + * The available categories are: + * + * * `node`: An empty placeholder. + * * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html) trace data. + * The [`async_hooks`](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html) events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. + * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. + * * `node.console`: Enables capture of `console.time()` and `console.count()` output. + * * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. + * * `node.threadpoolwork.async`: Enables capture of trace data for threadpool asynchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. + * * `node.dns.native`: Enables capture of trace data for DNS queries. + * * `node.net.native`: Enables capture of trace data for network. + * * `node.environment`: Enables capture of Node.js Environment milestones. + * * `node.fs.sync`: Enables capture of trace data for file system sync methods. + * * `node.fs_dir.sync`: Enables capture of trace data for file system sync directory methods. + * * `node.fs.async`: Enables capture of trace data for file system async methods. + * * `node.fs_dir.async`: Enables capture of trace data for file system async directory methods. + * * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v25.x/api/perf_hooks.html) measurements. + * * `node.perf.usertiming`: Enables capture of only Performance API User Timing + * measures and marks. + * * `node.perf.timerify`: Enables capture of only Performance API timerify + * measurements. + * * `node.promises.rejections`: Enables capture of trace data tracking the number + * of unhandled Promise rejections and handled-after-rejections. + * * `node.vm.script`: Enables capture of trace data for the `node:vm` module's `runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. + * * `v8`: The [V8](https://nodejs.org/docs/latest-v25.x/api/v8.html) events are GC, compiling, and execution related. + * * `node.http`: Enables capture of trace data for http request / response. + * + * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. + * + * ```bash + * node --trace-event-categories v8,node,node.async_hooks server.js + * ``` + * + * Prior versions of Node.js required the use of the `--trace-events-enabled` flag to enable trace events. This requirement has been removed. However, the `--trace-events-enabled` flag _may_ still be + * used and will enable the `node`, `node.async_hooks`, and `v8` trace event categories by default. + * + * ```bash + * node --trace-events-enabled + * + * # is equivalent to + * + * node --trace-event-categories v8,node,node.async_hooks + * ``` + * + * Alternatively, trace events may be enabled using the `node:trace_events` module: + * + * ```js + * import trace_events from 'node:trace_events'; + * const tracing = trace_events.createTracing({ categories: ['node.perf'] }); + * tracing.enable(); // Enable trace event capture for the 'node.perf' category + * + * // do work + * + * tracing.disable(); // Disable trace event capture for the 'node.perf' category + * ``` + * + * Running Node.js with tracing enabled will produce log files that can be opened + * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome. + * + * The logging file is by default called `node_trace.${rotation}.log`, where `${rotation}` is an incrementing log-rotation id. The filepath pattern can + * be specified with `--trace-event-file-pattern` that accepts a template + * string that supports `${rotation}` and `${pid}`: + * + * ```bash + * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js + * ``` + * + * To guarantee that the log file is properly generated after signal events like `SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers + * in your code, such as: + * + * ```js + * process.on('SIGINT', function onSigint() { + * console.info('Received SIGINT.'); + * process.exit(130); // Or applicable exit code depending on OS and signal + * }); + * ``` + * + * The tracing system uses the same time source + * as the one used by `process.hrtime()`. + * However the trace-event timestamps are expressed in microseconds, + * unlike `process.hrtime()` which returns nanoseconds. + * + * The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html#class-worker) threads. + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/trace_events.js) + */ +declare module "node:trace_events" { + /** + * The `Tracing` object is used to enable or disable tracing for sets of + * categories. Instances are created using the + * `trace_events.createTracing()` method. + * + * When created, the `Tracing` object is disabled. Calling the + * `tracing.enable()` method adds the categories to the set of enabled trace + * event categories. Calling `tracing.disable()` will remove the categories + * from the set of enabled trace event categories. + */ + interface Tracing { + /** + * A comma-separated list of the trace event categories covered by this + * `Tracing` object. + * @since v10.0.0 + */ + readonly categories: string; + /** + * Disables this `Tracing` object. + * + * Only trace event categories _not_ covered by other enabled `Tracing` + * objects and _not_ specified by the `--trace-event-categories` flag + * will be disabled. + * + * ```js + * import trace_events from 'node:trace_events'; + * const t1 = trace_events.createTracing({ categories: ['node', 'v8'] }); + * const t2 = trace_events.createTracing({ categories: ['node.perf', 'node'] }); + * t1.enable(); + * t2.enable(); + * + * // Prints 'node,node.perf,v8' + * console.log(trace_events.getEnabledCategories()); + * + * t2.disable(); // Will only disable emission of the 'node.perf' category + * + * // Prints 'node,v8' + * console.log(trace_events.getEnabledCategories()); + * ``` + * @since v10.0.0 + */ + disable(): void; + /** + * Enables this `Tracing` object for the set of categories covered by + * the `Tracing` object. + * @since v10.0.0 + */ + enable(): void; + /** + * `true` only if the `Tracing` object has been enabled. + * @since v10.0.0 + */ + readonly enabled: boolean; + } + interface CreateTracingOptions { + /** + * An array of trace category names. Values included in the array are + * coerced to a string when possible. An error will be thrown if the + * value cannot be coerced. + */ + categories: string[]; + } + /** + * Creates and returns a `Tracing` object for the given set of `categories`. + * + * ```js + * import trace_events from 'node:trace_events'; + * const categories = ['node.perf', 'node.async_hooks']; + * const tracing = trace_events.createTracing({ categories }); + * tracing.enable(); + * // do stuff + * tracing.disable(); + * ``` + * @since v10.0.0 + */ + function createTracing(options: CreateTracingOptions): Tracing; + /** + * Returns a comma-separated list of all currently-enabled trace event + * categories. The current set of enabled trace event categories is determined + * by the _union_ of all currently-enabled `Tracing` objects and any categories + * enabled using the `--trace-event-categories` flag. + * + * Given the file `test.js` below, the command `node --trace-event-categories node.perf test.js` will print `'node.async_hooks,node.perf'` to the console. + * + * ```js + * import trace_events from 'node:trace_events'; + * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] }); + * const t2 = trace_events.createTracing({ categories: ['node.perf'] }); + * const t3 = trace_events.createTracing({ categories: ['v8'] }); + * + * t1.enable(); + * t2.enable(); + * + * console.log(trace_events.getEnabledCategories()); + * ``` + * @since v10.0.0 + */ + function getEnabledCategories(): string | undefined; +} +declare module "trace_events" { + export * from "node:trace_events"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.6/buffer.buffer.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.6/buffer.buffer.d.ts new file mode 100644 index 0000000..bd32dc6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.6/buffer.buffer.d.ts @@ -0,0 +1,462 @@ +declare module "node:buffer" { + global { + interface BufferConstructor { + // see ../buffer.d.ts for implementation shared with all TypeScript versions + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. + */ + new(str: string, encoding?: BufferEncoding): Buffer; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). + */ + new(size: number): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + new(array: ArrayLike): Buffer; + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}/{SharedArrayBuffer}. + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. + */ + new(arrayBuffer: ArrayBufferLike): Buffer; + /** + * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. + * Array entries outside that range will be truncated to fit into it. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. + * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + * ``` + * + * If `array` is an `Array`-like object (that is, one with a `length` property of + * type `number`), it is treated as if it is an array, unless it is a `Buffer` or + * a `Uint8Array`. This means all other `TypedArray` variants get treated as an + * `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use + * `Buffer.copyBytesFrom()`. + * + * A `TypeError` will be thrown if `array` is not an `Array` or another type + * appropriate for `Buffer.from()` variants. + * + * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal + * `Buffer` pool like `Buffer.allocUnsafe()` does. + * @since v5.10.0 + */ + from(array: WithImplicitCoercion>): Buffer; + /** + * This creates a view of the `ArrayBuffer` without copying the underlying + * memory. For example, when passed a reference to the `.buffer` property of a + * `TypedArray` instance, the newly created `Buffer` will share the same + * allocated memory as the `TypedArray`'s underlying `ArrayBuffer`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const arr = new Uint16Array(2); + * + * arr[0] = 5000; + * arr[1] = 4000; + * + * // Shares memory with `arr`. + * const buf = Buffer.from(arr.buffer); + * + * console.log(buf); + * // Prints: + * + * // Changing the original Uint16Array changes the Buffer also. + * arr[1] = 6000; + * + * console.log(buf); + * // Prints: + * ``` + * + * The optional `byteOffset` and `length` arguments specify a memory range within + * the `arrayBuffer` that will be shared by the `Buffer`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const ab = new ArrayBuffer(10); + * const buf = Buffer.from(ab, 0, 2); + * + * console.log(buf.length); + * // Prints: 2 + * ``` + * + * A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer` or a + * `SharedArrayBuffer` or another type appropriate for `Buffer.from()` + * variants. + * + * It is important to remember that a backing `ArrayBuffer` can cover a range + * of memory that extends beyond the bounds of a `TypedArray` view. A new + * `Buffer` created using the `buffer` property of a `TypedArray` may extend + * beyond the range of the `TypedArray`: + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const arrA = Uint8Array.from([0x63, 0x64, 0x65, 0x66]); // 4 elements + * const arrB = new Uint8Array(arrA.buffer, 1, 2); // 2 elements + * console.log(arrA.buffer === arrB.buffer); // true + * + * const buf = Buffer.from(arrB.buffer); + * console.log(buf); + * // Prints: + * ``` + * @since v5.10.0 + * @param arrayBuffer An `ArrayBuffer`, `SharedArrayBuffer`, for example the + * `.buffer` property of a `TypedArray`. + * @param byteOffset Index of first byte to expose. **Default:** `0`. + * @param length Number of bytes to expose. **Default:** + * `arrayBuffer.byteLength - byteOffset`. + */ + from( + arrayBuffer: WithImplicitCoercion, + byteOffset?: number, + length?: number, + ): Buffer; + /** + * Creates a new `Buffer` containing `string`. The `encoding` parameter identifies + * the character encoding to be used when converting `string` into bytes. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from('this is a tést'); + * const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); + * + * console.log(buf1.toString()); + * // Prints: this is a tést + * console.log(buf2.toString()); + * // Prints: this is a tést + * console.log(buf1.toString('latin1')); + * // Prints: this is a tést + * ``` + * + * A `TypeError` will be thrown if `string` is not a string or another type + * appropriate for `Buffer.from()` variants. + * + * `Buffer.from(string)` may also use the internal `Buffer` pool like + * `Buffer.allocUnsafe()` does. + * @since v5.10.0 + * @param string A string to encode. + * @param encoding The encoding of `string`. **Default:** `'utf8'`. + */ + from(string: WithImplicitCoercion, encoding?: BufferEncoding): Buffer; + from(arrayOrString: WithImplicitCoercion | string>): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param values to create a new Buffer + */ + of(...items: number[]): Buffer; + /** + * Returns a new `Buffer` which is the result of concatenating all the `Buffer` instances in the `list` together. + * + * If the list has no items, or if the `totalLength` is 0, then a new zero-length `Buffer` is returned. + * + * If `totalLength` is not provided, it is calculated from the `Buffer` instances + * in `list` by adding their lengths. + * + * If `totalLength` is provided, it is coerced to an unsigned integer. If the + * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is + * truncated to `totalLength`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Create a single `Buffer` from a list of three `Buffer` instances. + * + * const buf1 = Buffer.alloc(10); + * const buf2 = Buffer.alloc(14); + * const buf3 = Buffer.alloc(18); + * const totalLength = buf1.length + buf2.length + buf3.length; + * + * console.log(totalLength); + * // Prints: 42 + * + * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); + * + * console.log(bufA); + * // Prints: + * console.log(bufA.length); + * // Prints: 42 + * ``` + * + * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. + * @since v0.7.11 + * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. + * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. + */ + concat(list: readonly Uint8Array[], totalLength?: number): Buffer; + /** + * Copies the underlying memory of `view` into a new `Buffer`. + * + * ```js + * const u16 = new Uint16Array([0, 0xffff]); + * const buf = Buffer.copyBytesFrom(u16, 1, 1); + * u16[1] = 0; + * console.log(buf.length); // 2 + * console.log(buf[0]); // 255 + * console.log(buf[1]); // 255 + * ``` + * @since v19.8.0 + * @param view The {TypedArray} to copy. + * @param [offset=0] The starting offset within `view`. + * @param [length=view.length - offset] The number of elements from `view` to copy. + */ + copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer; + /** + * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.alloc(5); + * + * console.log(buf); + * // Prints: + * ``` + * + * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. + * + * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.alloc(5, 'a'); + * + * console.log(buf); + * // Prints: + * ``` + * + * If both `fill` and `encoding` are specified, the allocated `Buffer` will be + * initialized by calling `buf.fill(fill, encoding)`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); + * + * console.log(buf); + * // Prints: + * ``` + * + * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance + * contents will never contain sensitive data from previous allocations, including + * data that might not have been allocated for `Buffer`s. + * + * A `TypeError` will be thrown if `size` is not a number. + * @since v5.10.0 + * @param size The desired length of the new `Buffer`. + * @param [fill=0] A value to pre-fill the new `Buffer` with. + * @param [encoding='utf8'] If `fill` is a string, this is its encoding. + */ + alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer; + /** + * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. + * + * The underlying memory for `Buffer` instances created in this way is _not_ + * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(10); + * + * console.log(buf); + * // Prints (contents may vary): + * + * buf.fill(0); + * + * console.log(buf); + * // Prints: + * ``` + * + * A `TypeError` will be thrown if `size` is not a number. + * + * The `Buffer` module pre-allocates an internal `Buffer` instance of + * size `Buffer.poolSize` that is used as a pool for the fast allocation of new `Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, + * and `Buffer.concat()` only when `size` is less than `Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two). + * + * Use of this pre-allocated internal memory pool is a key difference between + * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. + * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less + * than or equal to half `Buffer.poolSize`. The + * difference is subtle but can be important when an application requires the + * additional performance that `Buffer.allocUnsafe()` provides. + * @since v5.10.0 + * @param size The desired length of the new `Buffer`. + */ + allocUnsafe(size: number): Buffer; + /** + * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if + * `size` is 0. + * + * The underlying memory for `Buffer` instances created in this way is _not_ + * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize + * such `Buffer` instances with zeroes. + * + * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, + * allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This + * allows applications to avoid the garbage collection overhead of creating many + * individually allocated `Buffer` instances. This approach improves both + * performance and memory usage by eliminating the need to track and clean up as + * many individual `ArrayBuffer` objects. + * + * However, in the case where a developer may need to retain a small chunk of + * memory from a pool for an indeterminate amount of time, it may be appropriate + * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and + * then copying out the relevant bits. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Need to keep around a few small chunks of memory. + * const store = []; + * + * socket.on('readable', () => { + * let data; + * while (null !== (data = readable.read())) { + * // Allocate for retained data. + * const sb = Buffer.allocUnsafeSlow(10); + * + * // Copy the data into the new allocation. + * data.copy(sb, 0, 0, 10); + * + * store.push(sb); + * } + * }); + * ``` + * + * A `TypeError` will be thrown if `size` is not a number. + * @since v5.12.0 + * @param size The desired length of the new `Buffer`. + */ + allocUnsafeSlow(size: number): Buffer; + } + interface Buffer extends Uint8Array { + // see ../buffer.d.ts for implementation shared with all TypeScript versions + + /** + * Returns a new `Buffer` that references the same memory as the original, but + * offset and cropped by the `start` and `end` indices. + * + * This method is not compatible with the `Uint8Array.prototype.slice()`, + * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('buffer'); + * + * const copiedBuf = Uint8Array.prototype.slice.call(buf); + * copiedBuf[0]++; + * console.log(copiedBuf.toString()); + * // Prints: cuffer + * + * console.log(buf.toString()); + * // Prints: buffer + * + * // With buf.slice(), the original buffer is modified. + * const notReallyCopiedBuf = buf.slice(); + * notReallyCopiedBuf[0]++; + * console.log(notReallyCopiedBuf.toString()); + * // Prints: cuffer + * console.log(buf.toString()); + * // Also prints: cuffer (!) + * ``` + * @since v0.3.0 + * @deprecated Use `subarray` instead. + * @param [start=0] Where the new `Buffer` will start. + * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). + */ + slice(start?: number, end?: number): Buffer; + /** + * Returns a new `Buffer` that references the same memory as the original, but + * offset and cropped by the `start` and `end` indices. + * + * Specifying `end` greater than `buf.length` will return the same result as + * that of `end` equal to `buf.length`. + * + * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). + * + * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte + * // from the original `Buffer`. + * + * const buf1 = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * const buf2 = buf1.subarray(0, 3); + * + * console.log(buf2.toString('ascii', 0, buf2.length)); + * // Prints: abc + * + * buf1[0] = 33; + * + * console.log(buf2.toString('ascii', 0, buf2.length)); + * // Prints: !bc + * ``` + * + * Specifying negative indexes causes the slice to be generated relative to the + * end of `buf` rather than the beginning. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('buffer'); + * + * console.log(buf.subarray(-6, -1).toString()); + * // Prints: buffe + * // (Equivalent to buf.subarray(0, 5).) + * + * console.log(buf.subarray(-6, -2).toString()); + * // Prints: buff + * // (Equivalent to buf.subarray(0, 4).) + * + * console.log(buf.subarray(-5, -2).toString()); + * // Prints: uff + * // (Equivalent to buf.subarray(1, 4).) + * ``` + * @since v3.0.0 + * @param [start=0] Where the new `Buffer` will start. + * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). + */ + subarray(start?: number, end?: number): Buffer; + } + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type NonSharedBuffer = Buffer; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ + type AllowSharedBuffer = Buffer; + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts new file mode 100644 index 0000000..f148cc4 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts @@ -0,0 +1,71 @@ +// Interface declaration for Float16Array, required in @types/node v24+. +// These definitions are specific to TS <=5.6. + +// This needs all of the "common" properties/methods of the TypedArrays, +// otherwise the type unions `TypedArray` and `ArrayBufferView` will be +// empty objects. +interface Float16Array extends Pick { + readonly BYTES_PER_ELEMENT: number; + readonly buffer: ArrayBufferLike; + readonly byteLength: number; + readonly byteOffset: number; + readonly length: number; + readonly [Symbol.toStringTag]: "Float16Array"; + at(index: number): number | undefined; + copyWithin(target: number, start: number, end?: number): this; + every(predicate: (value: number, index: number, array: Float16Array) => unknown, thisArg?: any): boolean; + fill(value: number, start?: number, end?: number): this; + filter(predicate: (value: number, index: number, array: Float16Array) => any, thisArg?: any): Float16Array; + find(predicate: (value: number, index: number, obj: Float16Array) => boolean, thisArg?: any): number | undefined; + findIndex(predicate: (value: number, index: number, obj: Float16Array) => boolean, thisArg?: any): number; + findLast( + predicate: (value: number, index: number, array: Float16Array) => value is S, + thisArg?: any, + ): S | undefined; + findLast( + predicate: (value: number, index: number, array: Float16Array) => unknown, + thisArg?: any, + ): number | undefined; + findLastIndex(predicate: (value: number, index: number, array: Float16Array) => unknown, thisArg?: any): number; + forEach(callbackfn: (value: number, index: number, array: Float16Array) => void, thisArg?: any): void; + includes(searchElement: number, fromIndex?: number): boolean; + indexOf(searchElement: number, fromIndex?: number): number; + join(separator?: string): string; + lastIndexOf(searchElement: number, fromIndex?: number): number; + map(callbackfn: (value: number, index: number, array: Float16Array) => number, thisArg?: any): Float16Array; + reduce( + callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float16Array) => number, + ): number; + reduce( + callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float16Array) => number, + initialValue: number, + ): number; + reduce( + callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float16Array) => U, + initialValue: U, + ): U; + reduceRight( + callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float16Array) => number, + ): number; + reduceRight( + callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float16Array) => number, + initialValue: number, + ): number; + reduceRight( + callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float16Array) => U, + initialValue: U, + ): U; + reverse(): Float16Array; + set(array: ArrayLike, offset?: number): void; + slice(start?: number, end?: number): Float16Array; + some(predicate: (value: number, index: number, array: Float16Array) => unknown, thisArg?: any): boolean; + sort(compareFn?: (a: number, b: number) => number): this; + subarray(begin?: number, end?: number): Float16Array; + toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions): string; + toReversed(): Float16Array; + toSorted(compareFn?: (a: number, b: number) => number): Float16Array; + toString(): string; + valueOf(): Float16Array; + with(index: number, value: number): Float16Array; + [index: number]: number; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.6/globals.typedarray.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.6/globals.typedarray.d.ts new file mode 100644 index 0000000..57a1ab4 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.6/globals.typedarray.d.ts @@ -0,0 +1,36 @@ +export {}; // Make this a module + +declare global { + namespace NodeJS { + type TypedArray = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float16Array + | Float32Array + | Float64Array; + type ArrayBufferView = TypedArray | DataView; + + type NonSharedUint8Array = Uint8Array; + type NonSharedUint8ClampedArray = Uint8ClampedArray; + type NonSharedUint16Array = Uint16Array; + type NonSharedUint32Array = Uint32Array; + type NonSharedInt8Array = Int8Array; + type NonSharedInt16Array = Int16Array; + type NonSharedInt32Array = Int32Array; + type NonSharedBigUint64Array = BigUint64Array; + type NonSharedBigInt64Array = BigInt64Array; + type NonSharedFloat16Array = Float16Array; + type NonSharedFloat32Array = Float32Array; + type NonSharedFloat64Array = Float64Array; + type NonSharedDataView = DataView; + type NonSharedTypedArray = TypedArray; + type NonSharedArrayBufferView = ArrayBufferView; + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.6/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.6/index.d.ts new file mode 100644 index 0000000..a157660 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.6/index.d.ts @@ -0,0 +1,117 @@ +/** + * License for programmatically and manually incorporated + * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc + * + * Copyright Node.js contributors. All rights reserved. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +// NOTE: These definitions support Node.js and TypeScript 5.2 through 5.6. + +// Reference required TypeScript libraries: +/// +/// + +// TypeScript library polyfills required for TypeScript <=5.6: +/// + +// Iterator definitions required for compatibility with TypeScript <5.6: +/// + +// Definitions for Node.js modules specific to TypeScript <=5.6: +/// +/// + +// Definitions for Node.js modules that are not specific to any version of TypeScript: +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts new file mode 100644 index 0000000..110b1eb --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts @@ -0,0 +1,72 @@ +// Interface declaration for Float16Array, required in @types/node v24+. +// These definitions are specific to TS 5.7. + +// This needs all of the "common" properties/methods of the TypedArrays, +// otherwise the type unions `TypedArray` and `ArrayBufferView` will be +// empty objects. +interface Float16Array { + readonly BYTES_PER_ELEMENT: number; + readonly buffer: TArrayBuffer; + readonly byteLength: number; + readonly byteOffset: number; + readonly length: number; + readonly [Symbol.toStringTag]: "Float16Array"; + at(index: number): number | undefined; + copyWithin(target: number, start: number, end?: number): this; + entries(): ArrayIterator<[number, number]>; + every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean; + fill(value: number, start?: number, end?: number): this; + filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Float16Array; + find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined; + findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number; + findLast( + predicate: (value: number, index: number, array: this) => value is S, + thisArg?: any, + ): S | undefined; + findLast(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): number | undefined; + findLastIndex(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): number; + forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void; + includes(searchElement: number, fromIndex?: number): boolean; + indexOf(searchElement: number, fromIndex?: number): number; + join(separator?: string): string; + keys(): ArrayIterator; + lastIndexOf(searchElement: number, fromIndex?: number): number; + map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Float16Array; + reduce( + callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, + ): number; + reduce( + callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, + initialValue: number, + ): number; + reduce( + callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, + initialValue: U, + ): U; + reduceRight( + callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, + ): number; + reduceRight( + callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, + initialValue: number, + ): number; + reduceRight( + callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, + initialValue: U, + ): U; + reverse(): this; + set(array: ArrayLike, offset?: number): void; + slice(start?: number, end?: number): Float16Array; + some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean; + sort(compareFn?: (a: number, b: number) => number): this; + subarray(begin?: number, end?: number): Float16Array; + toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions): string; + toReversed(): Float16Array; + toSorted(compareFn?: (a: number, b: number) => number): Float16Array; + toString(): string; + valueOf(): this; + values(): ArrayIterator; + with(index: number, value: number): Float16Array; + [Symbol.iterator](): ArrayIterator; + [index: number]: number; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.7/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.7/index.d.ts new file mode 100644 index 0000000..32c541b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/ts5.7/index.d.ts @@ -0,0 +1,117 @@ +/** + * License for programmatically and manually incorporated + * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc + * + * Copyright Node.js contributors. All rights reserved. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +// NOTE: These definitions support Node.js and TypeScript 5.7. + +// Reference required TypeScript libraries: +/// +/// + +// TypeScript library polyfills required for TypeScript 5.7: +/// + +// Iterator definitions required for compatibility with TypeScript <5.6: +/// + +// Definitions for Node.js modules specific to TypeScript 5.7+: +/// +/// + +// Definitions for Node.js modules that are not specific to any version of TypeScript: +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/tty.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/tty.d.ts new file mode 100644 index 0000000..9b97a1e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/tty.d.ts @@ -0,0 +1,250 @@ +/** + * The `node:tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes. In most cases, it will not be necessary or possible to use this module + * directly. However, it can be accessed using: + * + * ```js + * import tty from 'node:tty'; + * ``` + * + * When Node.js detects that it is being run with a text terminal ("TTY") + * attached, `process.stdin` will, by default, be initialized as an instance of `tty.ReadStream` and both `process.stdout` and `process.stderr` will, by + * default, be instances of `tty.WriteStream`. The preferred method of determining + * whether Node.js is being run within a TTY context is to check that the value of + * the `process.stdout.isTTY` property is `true`: + * + * ```console + * $ node -p -e "Boolean(process.stdout.isTTY)" + * true + * $ node -p -e "Boolean(process.stdout.isTTY)" | cat + * false + * ``` + * + * In most cases, there should be little to no reason for an application to + * manually create instances of the `tty.ReadStream` and `tty.WriteStream` classes. + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/tty.js) + */ +declare module "node:tty" { + import * as net from "node:net"; + /** + * The `tty.isatty()` method returns `true` if the given `fd` is associated with + * a TTY and `false` if it is not, including whenever `fd` is not a non-negative + * integer. + * @since v0.5.8 + * @param fd A numeric file descriptor + */ + function isatty(fd: number): boolean; + /** + * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js + * process and there should be no reason to create additional instances. + * @since v0.5.8 + */ + class ReadStream extends net.Socket { + constructor(fd: number, options?: net.SocketConstructorOpts); + /** + * A `boolean` that is `true` if the TTY is currently configured to operate as a + * raw device. + * + * This flag is always `false` when a process starts, even if the terminal is + * operating in raw mode. Its value will change with subsequent calls to `setRawMode`. + * @since v0.7.7 + */ + isRaw: boolean; + /** + * Allows configuration of `tty.ReadStream` so that it operates as a raw device. + * + * When in raw mode, input is always available character-by-character, not + * including modifiers. Additionally, all special processing of characters by the + * terminal is disabled, including echoing input + * characters. Ctrl+C will no longer cause a `SIGINT` when + * in this mode. + * @since v0.7.7 + * @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw` + * property will be set to the resulting mode. + * @return The read stream instance. + */ + setRawMode(mode: boolean): this; + /** + * A `boolean` that is always `true` for `tty.ReadStream` instances. + * @since v0.5.8 + */ + isTTY: boolean; + } + /** + * -1 - to the left from cursor + * 0 - the entire line + * 1 - to the right from cursor + */ + type Direction = -1 | 0 | 1; + interface WriteStreamEventMap extends net.SocketEventMap { + "resize": []; + } + /** + * Represents the writable side of a TTY. In normal circumstances, `process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there + * should be no reason to create additional instances. + * @since v0.5.8 + */ + class WriteStream extends net.Socket { + constructor(fd: number); + /** + * `writeStream.clearLine()` clears the current line of this `WriteStream` in a + * direction identified by `dir`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + clearLine(dir: Direction, callback?: () => void): boolean; + /** + * `writeStream.clearScreenDown()` clears this `WriteStream` from the current + * cursor down. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + clearScreenDown(callback?: () => void): boolean; + /** + * `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified + * position. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + cursorTo(x: number, y?: number, callback?: () => void): boolean; + cursorTo(x: number, callback: () => void): boolean; + /** + * `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its + * current position. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + moveCursor(dx: number, dy: number, callback?: () => void): boolean; + /** + * Returns: + * + * * `1` for 2, + * * `4` for 16, + * * `8` for 256, + * * `24` for 16,777,216 colors supported. + * + * Use this to determine what colors the terminal supports. Due to the nature of + * colors in terminals it is possible to either have false positives or false + * negatives. It depends on process information and the environment variables that + * may lie about what terminal is used. + * It is possible to pass in an `env` object to simulate the usage of a specific + * terminal. This can be useful to check how specific environment settings behave. + * + * To enforce a specific color support, use one of the below environment settings. + * + * * 2 colors: `FORCE_COLOR = 0` (Disables colors) + * * 16 colors: `FORCE_COLOR = 1` + * * 256 colors: `FORCE_COLOR = 2` + * * 16,777,216 colors: `FORCE_COLOR = 3` + * + * Disabling color support is also possible by using the `NO_COLOR` and `NODE_DISABLE_COLORS` environment variables. + * @since v9.9.0 + * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. + */ + getColorDepth(env?: object): number; + /** + * Returns `true` if the `writeStream` supports at least as many colors as provided + * in `count`. Minimum support is 2 (black and white). + * + * This has the same false positives and negatives as described in `writeStream.getColorDepth()`. + * + * ```js + * process.stdout.hasColors(); + * // Returns true or false depending on if `stdout` supports at least 16 colors. + * process.stdout.hasColors(256); + * // Returns true or false depending on if `stdout` supports at least 256 colors. + * process.stdout.hasColors({ TMUX: '1' }); + * // Returns true. + * process.stdout.hasColors(2 ** 24, { TMUX: '1' }); + * // Returns false (the environment setting pretends to support 2 ** 8 colors). + * ``` + * @since v11.13.0, v10.16.0 + * @param [count=16] The number of colors that are requested (minimum 2). + * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. + */ + hasColors(count?: number): boolean; + hasColors(env?: object): boolean; + hasColors(count: number, env?: object): boolean; + /** + * `writeStream.getWindowSize()` returns the size of the TTY + * corresponding to this `WriteStream`. The array is of the type `[numColumns, numRows]` where `numColumns` and `numRows` represent the number + * of columns and rows in the corresponding TTY. + * @since v0.7.7 + */ + getWindowSize(): [number, number]; + /** + * A `number` specifying the number of columns the TTY currently has. This property + * is updated whenever the `'resize'` event is emitted. + * @since v0.7.7 + */ + columns: number; + /** + * A `number` specifying the number of rows the TTY currently has. This property + * is updated whenever the `'resize'` event is emitted. + * @since v0.7.7 + */ + rows: number; + /** + * A `boolean` that is always `true`. + * @since v0.5.8 + */ + isTTY: boolean; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: WriteStreamEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: WriteStreamEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: WriteStreamEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: WriteStreamEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } +} +declare module "tty" { + export * from "node:tty"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/url.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/url.d.ts new file mode 100644 index 0000000..b0a8ed0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/url.d.ts @@ -0,0 +1,541 @@ +/** + * The `node:url` module provides utilities for URL resolution and parsing. It can + * be accessed using: + * + * ```js + * import url from 'node:url'; + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/url.js) + */ +declare module "node:url" { + import { Blob, NonSharedBuffer } from "node:buffer"; + import { ClientRequestArgs } from "node:http"; + import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring"; + // Input to `url.format` + interface UrlObject { + auth?: string | null | undefined; + hash?: string | null | undefined; + host?: string | null | undefined; + hostname?: string | null | undefined; + href?: string | null | undefined; + pathname?: string | null | undefined; + protocol?: string | null | undefined; + search?: string | null | undefined; + slashes?: boolean | null | undefined; + port?: string | number | null | undefined; + query?: string | null | ParsedUrlQueryInput | undefined; + } + // Output of `url.parse` + interface Url { + auth: string | null; + hash: string | null; + host: string | null; + hostname: string | null; + href: string; + path: string | null; + pathname: string | null; + protocol: string | null; + search: string | null; + slashes: boolean | null; + port: string | null; + query: string | null | ParsedUrlQuery; + } + interface UrlWithParsedQuery extends Url { + query: ParsedUrlQuery; + } + interface UrlWithStringQuery extends Url { + query: string | null; + } + interface FileUrlToPathOptions { + /** + * `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default. + * @default undefined + * @since v22.1.0 + */ + windows?: boolean | undefined; + } + interface PathToFileUrlOptions { + /** + * `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default. + * @default undefined + * @since v22.1.0 + */ + windows?: boolean | undefined; + } + /** + * The `url.parse()` method takes a URL string, parses it, and returns a URL + * object. + * + * A `TypeError` is thrown if `urlString` is not a string. + * + * A `URIError` is thrown if the `auth` property is present but cannot be decoded. + * + * `url.parse()` uses a lenient, non-standard algorithm for parsing URL + * strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487) + * and incorrect handling of usernames and passwords. Do not use with untrusted + * input. CVEs are not issued for `url.parse()` vulnerabilities. Use the + * [WHATWG URL](https://nodejs.org/docs/latest-v25.x/api/url.html#the-whatwg-url-api) API instead, for example: + * + * ```js + * function getURL(req) { + * const proto = req.headers['x-forwarded-proto'] || 'https'; + * const host = req.headers['x-forwarded-host'] || req.headers.host || 'example.com'; + * return new URL(req.url || '/', `${proto}://${host}`); + * } + * ``` + * + * The example above assumes well-formed headers are forwarded from a reverse + * proxy to your Node.js server. If you are not using a reverse proxy, you should + * use the example below: + * + * ```js + * function getURL(req) { + * return new URL(req.url || '/', 'https://example.com'); + * } + * ``` + * @since v0.1.25 + * @deprecated Use the WHATWG URL API instead. + * @param urlString The URL string to parse. + * @param parseQueryString If `true`, the `query` property will always + * be set to an object returned by the [`querystring`](https://nodejs.org/docs/latest-v25.x/api/querystring.html) module's `parse()` + * method. If `false`, the `query` property on the returned URL object will be an + * unparsed, undecoded string. **Default:** `false`. + * @param slashesDenoteHost If `true`, the first token after the literal + * string `//` and preceding the next `/` will be interpreted as the `host`. + * For instance, given `//foo/bar`, the result would be + * `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. + * **Default:** `false`. + */ + function parse( + urlString: string, + parseQueryString?: false, + slashesDenoteHost?: boolean, + ): UrlWithStringQuery; + function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; + function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; + /** + * The `url.format()` method returns a formatted URL string derived from `urlObject`. + * + * ```js + * import url from 'node:url'; + * url.format({ + * protocol: 'https', + * hostname: 'example.com', + * pathname: '/some/path', + * query: { + * page: 1, + * format: 'json', + * }, + * }); + * + * // => 'https://example.com/some/path?page=1&format=json' + * ``` + * + * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. + * + * The formatting process operates as follows: + * + * * A new empty string `result` is created. + * * If `urlObject.protocol` is a string, it is appended as-is to `result`. + * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. + * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII + * colon (`:`) character, the literal string `:` will be appended to `result`. + * * If either of the following conditions is true, then the literal string `//` will be appended to `result`: + * * `urlObject.slashes` property is true; + * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or `file`; + * * If the value of the `urlObject.auth` property is truthy, and either `urlObject.host` or `urlObject.hostname` are not `undefined`, the value of `urlObject.auth` will be coerced into a string + * and appended to `result` followed by the literal string `@`. + * * If the `urlObject.host` property is `undefined` then: + * * If the `urlObject.hostname` is a string, it is appended to `result`. + * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, + * an `Error` is thrown. + * * If the `urlObject.port` property value is truthy, and `urlObject.hostname` is not `undefined`: + * * The literal string `:` is appended to `result`, and + * * The value of `urlObject.port` is coerced to a string and appended to `result`. + * * Otherwise, if the `urlObject.host` property value is truthy, the value of `urlObject.host` is coerced to a string and appended to `result`. + * * If the `urlObject.pathname` property is a string that is not an empty string: + * * If the `urlObject.pathname` _does not start_ with an ASCII forward slash + * (`/`), then the literal string `'/'` is appended to `result`. + * * The value of `urlObject.pathname` is appended to `result`. + * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. + * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result` followed by the output of calling the + * `querystring` module's `stringify()` method passing the value of `urlObject.query`. + * * Otherwise, if `urlObject.search` is a string: + * * If the value of `urlObject.search` _does not start_ with the ASCII question + * mark (`?`) character, the literal string `?` is appended to `result`. + * * The value of `urlObject.search` is appended to `result`. + * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. + * * If the `urlObject.hash` property is a string: + * * If the value of `urlObject.hash` _does not start_ with the ASCII hash (`#`) + * character, the literal string `#` is appended to `result`. + * * The value of `urlObject.hash` is appended to `result`. + * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a + * string, an `Error` is thrown. + * * `result` is returned. + * @since v0.1.25 + * @legacy Use the WHATWG URL API instead. + * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. + */ + function format(urlObject: URL, options?: URLFormatOptions): string; + /** + * The `url.format()` method returns a formatted URL string derived from `urlObject`. + * + * ```js + * import url from 'node:url'; + * url.format({ + * protocol: 'https', + * hostname: 'example.com', + * pathname: '/some/path', + * query: { + * page: 1, + * format: 'json', + * }, + * }); + * + * // => 'https://example.com/some/path?page=1&format=json' + * ``` + * + * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. + * + * The formatting process operates as follows: + * + * * A new empty string `result` is created. + * * If `urlObject.protocol` is a string, it is appended as-is to `result`. + * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. + * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII + * colon (`:`) character, the literal string `:` will be appended to `result`. + * * If either of the following conditions is true, then the literal string `//` will be appended to `result`: + * * `urlObject.slashes` property is true; + * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or `file`; + * * If the value of the `urlObject.auth` property is truthy, and either `urlObject.host` or `urlObject.hostname` are not `undefined`, the value of `urlObject.auth` will be coerced into a string + * and appended to `result` followed by the literal string `@`. + * * If the `urlObject.host` property is `undefined` then: + * * If the `urlObject.hostname` is a string, it is appended to `result`. + * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, + * an `Error` is thrown. + * * If the `urlObject.port` property value is truthy, and `urlObject.hostname` is not `undefined`: + * * The literal string `:` is appended to `result`, and + * * The value of `urlObject.port` is coerced to a string and appended to `result`. + * * Otherwise, if the `urlObject.host` property value is truthy, the value of `urlObject.host` is coerced to a string and appended to `result`. + * * If the `urlObject.pathname` property is a string that is not an empty string: + * * If the `urlObject.pathname` _does not start_ with an ASCII forward slash + * (`/`), then the literal string `'/'` is appended to `result`. + * * The value of `urlObject.pathname` is appended to `result`. + * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. + * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result` followed by the output of calling the + * `querystring` module's `stringify()` method passing the value of `urlObject.query`. + * * Otherwise, if `urlObject.search` is a string: + * * If the value of `urlObject.search` _does not start_ with the ASCII question + * mark (`?`) character, the literal string `?` is appended to `result`. + * * The value of `urlObject.search` is appended to `result`. + * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. + * * If the `urlObject.hash` property is a string: + * * If the value of `urlObject.hash` _does not start_ with the ASCII hash (`#`) + * character, the literal string `#` is appended to `result`. + * * The value of `urlObject.hash` is appended to `result`. + * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a + * string, an `Error` is thrown. + * * `result` is returned. + * @since v0.1.25 + * @legacy Use the WHATWG URL API instead. + * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. + */ + function format(urlObject: UrlObject | string): string; + /** + * The `url.resolve()` method resolves a target URL relative to a base URL in a + * manner similar to that of a web browser resolving an anchor tag. + * + * ```js + * import url from 'node:url'; + * url.resolve('/one/two/three', 'four'); // '/one/two/four' + * url.resolve('http://example.com/', '/one'); // 'http://example.com/one' + * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two' + * ``` + * + * To achieve the same result using the WHATWG URL API: + * + * ```js + * function resolve(from, to) { + * const resolvedUrl = new URL(to, new URL(from, 'resolve://')); + * if (resolvedUrl.protocol === 'resolve:') { + * // `from` is a relative URL. + * const { pathname, search, hash } = resolvedUrl; + * return pathname + search + hash; + * } + * return resolvedUrl.toString(); + * } + * + * resolve('/one/two/three', 'four'); // '/one/two/four' + * resolve('http://example.com/', '/one'); // 'http://example.com/one' + * resolve('http://example.com/one', '/two'); // 'http://example.com/two' + * ``` + * @since v0.1.25 + * @legacy Use the WHATWG URL API instead. + * @param from The base URL to use if `to` is a relative URL. + * @param to The target URL to resolve. + */ + function resolve(from: string, to: string): string; + /** + * Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an + * invalid domain, the empty string is returned. + * + * It performs the inverse operation to {@link domainToUnicode}. + * + * ```js + * import url from 'node:url'; + * + * console.log(url.domainToASCII('español.com')); + * // Prints xn--espaol-zwa.com + * console.log(url.domainToASCII('中文.com')); + * // Prints xn--fiq228c.com + * console.log(url.domainToASCII('xn--iñvalid.com')); + * // Prints an empty string + * ``` + * @since v7.4.0, v6.13.0 + */ + function domainToASCII(domain: string): string; + /** + * Returns the Unicode serialization of the `domain`. If `domain` is an invalid + * domain, the empty string is returned. + * + * It performs the inverse operation to {@link domainToASCII}. + * + * ```js + * import url from 'node:url'; + * + * console.log(url.domainToUnicode('xn--espaol-zwa.com')); + * // Prints español.com + * console.log(url.domainToUnicode('xn--fiq228c.com')); + * // Prints 中文.com + * console.log(url.domainToUnicode('xn--iñvalid.com')); + * // Prints an empty string + * ``` + * @since v7.4.0, v6.13.0 + */ + function domainToUnicode(domain: string): string; + /** + * This function ensures the correct decodings of percent-encoded characters as + * well as ensuring a cross-platform valid absolute path string. + * + * ```js + * import { fileURLToPath } from 'node:url'; + * + * const __filename = fileURLToPath(import.meta.url); + * + * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/ + * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows) + * + * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt + * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows) + * + * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt + * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX) + * + * new URL('file:///hello world').pathname; // Incorrect: /hello%20world + * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX) + * ``` + * + * **Security Considerations:** + * + * This function decodes percent-encoded characters, including encoded dot-segments + * (`%2e` as `.` and `%2e%2e` as `..`), and then normalizes the resulting path. + * This means that encoded directory traversal sequences (such as `%2e%2e`) are + * decoded and processed as actual path traversal, even though encoded slashes + * (`%2F`, `%5C`) are correctly rejected. + * + * **Applications must not rely on `fileURLToPath()` alone to prevent directory + * traversal attacks.** Always perform explicit path validation and security checks + * on the returned path value to ensure it remains within expected boundaries + * before using it for file system operations. + * @since v10.12.0 + * @param url The file URL string or URL object to convert to a path. + * @return The fully-resolved platform-specific Node.js file path. + */ + function fileURLToPath(url: string | URL, options?: FileUrlToPathOptions): string; + /** + * Like `url.fileURLToPath(...)` except that instead of returning a string + * representation of the path, a `Buffer` is returned. This conversion is + * helpful when the input URL contains percent-encoded segments that are + * not valid UTF-8 / Unicode sequences. + * + * **Security Considerations:** + * + * This function has the same security considerations as `url.fileURLToPath()`. + * It decodes percent-encoded characters, including encoded dot-segments + * (`%2e` as `.` and `%2e%2e` as `..`), and normalizes the path. **Applications + * must not rely on this function alone to prevent directory traversal attacks.** + * Always perform explicit path validation on the returned buffer value before + * using it for file system operations. + * @since v24.3.0 + * @param url The file URL string or URL object to convert to a path. + * @returns The fully-resolved platform-specific Node.js file path + * as a `Buffer`. + */ + function fileURLToPathBuffer(url: string | URL, options?: FileUrlToPathOptions): NonSharedBuffer; + /** + * This function ensures that `path` is resolved absolutely, and that the URL + * control characters are correctly encoded when converting into a File URL. + * + * ```js + * import { pathToFileURL } from 'node:url'; + * + * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1 + * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX) + * + * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c + * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX) + * ``` + * @since v10.12.0 + * @param path The path to convert to a File URL. + * @return The file URL object. + */ + function pathToFileURL(path: string, options?: PathToFileUrlOptions): URL; + /** + * This utility function converts a URL object into an ordinary options object as + * expected by the `http.request()` and `https.request()` APIs. + * + * ```js + * import { urlToHttpOptions } from 'node:url'; + * const myURL = new URL('https://a:b@測試?abc#foo'); + * + * console.log(urlToHttpOptions(myURL)); + * /* + * { + * protocol: 'https:', + * hostname: 'xn--g6w251d', + * hash: '#foo', + * search: '?abc', + * pathname: '/', + * path: '/?abc', + * href: 'https://a:b@xn--g6w251d/?abc#foo', + * auth: 'a:b' + * } + * + * ``` + * @since v15.7.0, v14.18.0 + * @param url The `WHATWG URL` object to convert to an options object. + * @return Options object + */ + function urlToHttpOptions(url: URL): ClientRequestArgs; + interface URLFormatOptions { + /** + * `true` if the serialized URL string should include the username and password, `false` otherwise. + * @default true + */ + auth?: boolean | undefined; + /** + * `true` if the serialized URL string should include the fragment, `false` otherwise. + * @default true + */ + fragment?: boolean | undefined; + /** + * `true` if the serialized URL string should include the search query, `false` otherwise. + * @default true + */ + search?: boolean | undefined; + /** + * `true` if Unicode characters appearing in the host component of the URL string should be encoded directly as opposed to + * being Punycode encoded. + * @default false + */ + unicode?: boolean | undefined; + } + // #region web types + type URLPatternInput = string | URLPatternInit; + interface URLPatternComponentResult { + input: string; + groups: Record; + } + interface URLPatternInit { + protocol?: string; + username?: string; + password?: string; + hostname?: string; + port?: string; + pathname?: string; + search?: string; + hash?: string; + baseURL?: string; + } + interface URLPatternOptions { + ignoreCase?: boolean; + } + interface URLPatternResult { + inputs: URLPatternInput[]; + protocol: URLPatternComponentResult; + username: URLPatternComponentResult; + password: URLPatternComponentResult; + hostname: URLPatternComponentResult; + port: URLPatternComponentResult; + pathname: URLPatternComponentResult; + search: URLPatternComponentResult; + hash: URLPatternComponentResult; + } + interface URL { + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + readonly searchParams: URLSearchParams; + username: string; + toJSON(): string; + } + var URL: { + prototype: URL; + new(url: string | URL, base?: string | URL): URL; + canParse(input: string | URL, base?: string | URL): boolean; + createObjectURL(blob: Blob): string; + parse(input: string | URL, base?: string | URL): URL | null; + revokeObjectURL(id: string): void; + }; + interface URLPattern { + readonly hasRegExpGroups: boolean; + readonly hash: string; + readonly hostname: string; + readonly password: string; + readonly pathname: string; + readonly port: string; + readonly protocol: string; + readonly search: string; + readonly username: string; + exec(input?: URLPatternInput, baseURL?: string | URL): URLPatternResult | null; + test(input?: URLPatternInput, baseURL?: string | URL): boolean; + } + var URLPattern: { + prototype: URLPattern; + new(input: URLPatternInput, baseURL: string | URL, options?: URLPatternOptions): URLPattern; + new(input?: URLPatternInput, options?: URLPatternOptions): URLPattern; + }; + interface URLSearchParams { + readonly size: number; + append(name: string, value: string): void; + delete(name: string, value?: string): void; + get(name: string): string | null; + getAll(name: string): string[]; + has(name: string, value?: string): boolean; + set(name: string, value: string): void; + sort(): void; + forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void; + [Symbol.iterator](): URLSearchParamsIterator<[string, string]>; + entries(): URLSearchParamsIterator<[string, string]>; + keys(): URLSearchParamsIterator; + values(): URLSearchParamsIterator; + } + var URLSearchParams: { + prototype: URLSearchParams; + new(init?: string[][] | Record | string | URLSearchParams): URLSearchParams; + }; + interface URLSearchParamsIterator extends NodeJS.Iterator { + [Symbol.iterator](): URLSearchParamsIterator; + } + // #endregion +} +declare module "url" { + export * from "node:url"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/util.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/util.d.ts new file mode 100644 index 0000000..10062f6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/util.d.ts @@ -0,0 +1,1687 @@ +/** + * The `node:util` module supports the needs of Node.js internal APIs. Many of the + * utilities are useful for application and module developers as well. To access + * it: + * + * ```js + * import util from 'node:util'; + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/util.js) + */ +declare module "node:util" { + export * as types from "node:util/types"; + export type InspectStyle = + | "special" + | "number" + | "bigint" + | "boolean" + | "undefined" + | "null" + | "string" + | "symbol" + | "date" + | "name" + | "regexp" + | "module"; + export interface InspectStyles extends Record string)> { + regexp: { + (value: string): string; + colors: InspectColor[]; + }; + } + export type InspectColorModifier = + | "reset" + | "bold" + | "dim" + | "italic" + | "underline" + | "blink" + | "inverse" + | "hidden" + | "strikethrough" + | "doubleunderline"; + export type InspectColorForeground = + | "black" + | "red" + | "green" + | "yellow" + | "blue" + | "magenta" + | "cyan" + | "white" + | "gray" + | "redBright" + | "greenBright" + | "yellowBright" + | "blueBright" + | "magentaBright" + | "cyanBright" + | "whiteBright"; + export type InspectColorBackground = `bg${Capitalize}`; + export type InspectColor = InspectColorModifier | InspectColorForeground | InspectColorBackground; + export interface InspectColors extends Record {} + export interface InspectOptions { + /** + * If `true`, object's non-enumerable symbols and properties are included in the formatted result. + * `WeakMap` and `WeakSet` entries are also included as well as user defined prototype properties (excluding method properties). + * @default false + */ + showHidden?: boolean | undefined; + /** + * Specifies the number of times to recurse while formatting object. + * This is useful for inspecting large objects. + * To recurse up to the maximum call stack size pass `Infinity` or `null`. + * @default 2 + */ + depth?: number | null | undefined; + /** + * If `true`, the output is styled with ANSI color codes. Colors are customizable. + */ + colors?: boolean | undefined; + /** + * If `false`, `[util.inspect.custom](depth, opts, inspect)` functions are not invoked. + * @default true + */ + customInspect?: boolean | undefined; + /** + * If `true`, `Proxy` inspection includes the target and handler objects. + * @default false + */ + showProxy?: boolean | undefined; + /** + * Specifies the maximum number of `Array`, `TypedArray`, `WeakMap`, and `WeakSet` elements + * to include when formatting. Set to `null` or `Infinity` to show all elements. + * Set to `0` or negative to show no elements. + * @default 100 + */ + maxArrayLength?: number | null | undefined; + /** + * Specifies the maximum number of characters to + * include when formatting. Set to `null` or `Infinity` to show all elements. + * Set to `0` or negative to show no characters. + * @default 10000 + */ + maxStringLength?: number | null | undefined; + /** + * The length at which input values are split across multiple lines. + * Set to `Infinity` to format the input as a single line + * (in combination with `compact` set to `true` or any number >= `1`). + * @default 80 + */ + breakLength?: number | undefined; + /** + * Setting this to `false` causes each object key + * to be displayed on a new line. It will also add new lines to text that is + * longer than `breakLength`. If set to a number, the most `n` inner elements + * are united on a single line as long as all properties fit into + * `breakLength`. Short array elements are also grouped together. Note that no + * text will be reduced below 16 characters, no matter the `breakLength` size. + * For more information, see the example below. + * @default true + */ + compact?: boolean | number | undefined; + /** + * If set to `true` or a function, all properties of an object, and `Set` and `Map` + * entries are sorted in the resulting string. + * If set to `true` the default sort is used. + * If set to a function, it is used as a compare function. + */ + sorted?: boolean | ((a: string, b: string) => number) | undefined; + /** + * If set to `true`, getters are going to be + * inspected as well. If set to `'get'` only getters without setter are going + * to be inspected. If set to `'set'` only getters having a corresponding + * setter are going to be inspected. This might cause side effects depending on + * the getter function. + * @default false + */ + getters?: "get" | "set" | boolean | undefined; + /** + * If set to `true`, an underscore is used to separate every three digits in all bigints and numbers. + * @default false + */ + numericSeparator?: boolean | undefined; + } + export interface InspectContext extends Required { + stylize(text: string, styleType: InspectStyle): string; + } + import _inspect = inspect; + export interface Inspectable { + [inspect.custom](depth: number, options: InspectContext, inspect: typeof _inspect): any; + } + // TODO: Remove these in a future major + /** @deprecated Use `InspectStyle` instead. */ + export type Style = Exclude; + /** @deprecated Use the `Inspectable` interface instead. */ + export type CustomInspectFunction = (depth: number, options: InspectContext) => any; + /** @deprecated Use `InspectContext` instead. */ + export interface InspectOptionsStylized extends InspectContext {} + /** @deprecated Use `InspectColorModifier` instead. */ + export type Modifiers = InspectColorModifier; + /** @deprecated Use `InspectColorForeground` instead. */ + export type ForegroundColors = InspectColorForeground; + /** @deprecated Use `InspectColorBackground` instead. */ + export type BackgroundColors = InspectColorBackground; + export interface CallSiteObject { + /** + * Returns the name of the function associated with this call site. + */ + functionName: string; + /** + * Returns the name of the resource that contains the script for the + * function for this call site. + */ + scriptName: string; + /** + * Returns the unique id of the script, as in Chrome DevTools protocol + * [`Runtime.ScriptId`](https://chromedevtools.github.io/devtools-protocol/1-3/Runtime/#type-ScriptId). + * @since v22.14.0 + */ + scriptId: string; + /** + * Returns the number, 1-based, of the line for the associate function call. + */ + lineNumber: number; + /** + * Returns the 1-based column offset on the line for the associated function call. + */ + columnNumber: number; + } + export type DiffEntry = [operation: -1 | 0 | 1, value: string]; + /** + * `util.diff()` compares two string or array values and returns an array of difference entries. + * It uses the Myers diff algorithm to compute minimal differences, which is the same algorithm + * used internally by assertion error messages. + * + * If the values are equal, an empty array is returned. + * + * ```js + * const { diff } = require('node:util'); + * + * // Comparing strings + * const actualString = '12345678'; + * const expectedString = '12!!5!7!'; + * console.log(diff(actualString, expectedString)); + * // [ + * // [0, '1'], + * // [0, '2'], + * // [1, '3'], + * // [1, '4'], + * // [-1, '!'], + * // [-1, '!'], + * // [0, '5'], + * // [1, '6'], + * // [-1, '!'], + * // [0, '7'], + * // [1, '8'], + * // [-1, '!'], + * // ] + * // Comparing arrays + * const actualArray = ['1', '2', '3']; + * const expectedArray = ['1', '3', '4']; + * console.log(diff(actualArray, expectedArray)); + * // [ + * // [0, '1'], + * // [1, '2'], + * // [0, '3'], + * // [-1, '4'], + * // ] + * // Equal values return empty array + * console.log(diff('same', 'same')); + * // [] + * ``` + * @since v22.15.0 + * @experimental + * @param actual The first value to compare + * @param expected The second value to compare + * @returns An array of difference entries. Each entry is an array with two elements: + * * Index 0: `number` Operation code: `-1` for delete, `0` for no-op/unchanged, `1` for insert + * * Index 1: `string` The value associated with the operation + */ + export function diff(actual: string | readonly string[], expected: string | readonly string[]): DiffEntry[]; + /** + * The `util.format()` method returns a formatted string using the first argument + * as a `printf`-like format string which can contain zero or more format + * specifiers. Each specifier is replaced with the converted value from the + * corresponding argument. Supported specifiers are: + * + * If a specifier does not have a corresponding argument, it is not replaced: + * + * ```js + * util.format('%s:%s', 'foo'); + * // Returns: 'foo:%s' + * ``` + * + * Values that are not part of the format string are formatted using `util.inspect()` if their type is not `string`. + * + * If there are more arguments passed to the `util.format()` method than the + * number of specifiers, the extra arguments are concatenated to the returned + * string, separated by spaces: + * + * ```js + * util.format('%s:%s', 'foo', 'bar', 'baz'); + * // Returns: 'foo:bar baz' + * ``` + * + * If the first argument does not contain a valid format specifier, `util.format()` returns a string that is the concatenation of all arguments separated by spaces: + * + * ```js + * util.format(1, 2, 3); + * // Returns: '1 2 3' + * ``` + * + * If only one argument is passed to `util.format()`, it is returned as it is + * without any formatting: + * + * ```js + * util.format('%% %s'); + * // Returns: '%% %s' + * ``` + * + * `util.format()` is a synchronous method that is intended as a debugging tool. + * Some input values can have a significant performance overhead that can block the + * event loop. Use this function with care and never in a hot code path. + * @since v0.5.3 + * @param format A `printf`-like format string. + */ + export function format(format?: any, ...param: any[]): string; + /** + * This function is identical to {@link format}, except in that it takes + * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}. + * + * ```js + * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 }); + * // Returns 'See object { foo: 42 }', where `42` is colored as a number + * // when printed to a terminal. + * ``` + * @since v10.0.0 + */ + export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string; + export interface GetCallSitesOptions { + /** + * Reconstruct the original location in the stacktrace from the source-map. + * Enabled by default with the flag `--enable-source-maps`. + */ + sourceMap?: boolean | undefined; + } + /** + * Returns an array of call site objects containing the stack of + * the caller function. + * + * Unlike accessing an `error.stack`, the result returned from this API is not + * interfered with `Error.prepareStackTrace`. + * + * ```js + * import { getCallSites } from 'node:util'; + * + * function exampleFunction() { + * const callSites = getCallSites(); + * + * console.log('Call Sites:'); + * callSites.forEach((callSite, index) => { + * console.log(`CallSite ${index + 1}:`); + * console.log(`Function Name: ${callSite.functionName}`); + * console.log(`Script Name: ${callSite.scriptName}`); + * console.log(`Line Number: ${callSite.lineNumber}`); + * console.log(`Column Number: ${callSite.columnNumber}`); + * }); + * // CallSite 1: + * // Function Name: exampleFunction + * // Script Name: /home/example.js + * // Line Number: 5 + * // Column Number: 26 + * + * // CallSite 2: + * // Function Name: anotherFunction + * // Script Name: /home/example.js + * // Line Number: 22 + * // Column Number: 3 + * + * // ... + * } + * + * // A function to simulate another stack layer + * function anotherFunction() { + * exampleFunction(); + * } + * + * anotherFunction(); + * ``` + * + * It is possible to reconstruct the original locations by setting the option `sourceMap` to `true`. + * If the source map is not available, the original location will be the same as the current location. + * When the `--enable-source-maps` flag is enabled, for example when using `--experimental-transform-types`, + * `sourceMap` will be true by default. + * + * ```ts + * import { getCallSites } from 'node:util'; + * + * interface Foo { + * foo: string; + * } + * + * const callSites = getCallSites({ sourceMap: true }); + * + * // With sourceMap: + * // Function Name: '' + * // Script Name: example.js + * // Line Number: 7 + * // Column Number: 26 + * + * // Without sourceMap: + * // Function Name: '' + * // Script Name: example.js + * // Line Number: 2 + * // Column Number: 26 + * ``` + * @param frameCount Number of frames to capture as call site objects. + * **Default:** `10`. Allowable range is between 1 and 200. + * @return An array of call site objects + * @since v22.9.0 + */ + export function getCallSites(frameCount?: number, options?: GetCallSitesOptions): CallSiteObject[]; + export function getCallSites(options: GetCallSitesOptions): CallSiteObject[]; + /** + * Returns the string name for a numeric error code that comes from a Node.js API. + * The mapping between error codes and error names is platform-dependent. + * See `Common System Errors` for the names of common errors. + * + * ```js + * fs.access('file/that/does/not/exist', (err) => { + * const name = util.getSystemErrorName(err.errno); + * console.error(name); // ENOENT + * }); + * ``` + * @since v9.7.0 + */ + export function getSystemErrorName(err: number): string; + /** + * Enable or disable printing a stack trace on `SIGINT`. The API is only available on the main thread. + * @since 24.6.0 + */ + export function setTraceSigInt(enable: boolean): void; + /** + * Returns a Map of all system error codes available from the Node.js API. + * The mapping between error codes and error names is platform-dependent. + * See `Common System Errors` for the names of common errors. + * + * ```js + * fs.access('file/that/does/not/exist', (err) => { + * const errorMap = util.getSystemErrorMap(); + * const name = errorMap.get(err.errno); + * console.error(name); // ENOENT + * }); + * ``` + * @since v16.0.0, v14.17.0 + */ + export function getSystemErrorMap(): Map; + /** + * Returns the string message for a numeric error code that comes from a Node.js + * API. + * The mapping between error codes and string messages is platform-dependent. + * + * ```js + * fs.access('file/that/does/not/exist', (err) => { + * const message = util.getSystemErrorMessage(err.errno); + * console.error(message); // no such file or directory + * }); + * ``` + * @since v22.12.0 + */ + export function getSystemErrorMessage(err: number): string; + /** + * Returns the `string` after replacing any surrogate code points + * (or equivalently, any unpaired surrogate code units) with the + * Unicode "replacement character" U+FFFD. + * @since v16.8.0, v14.18.0 + */ + export function toUSVString(string: string): string; + /** + * Creates and returns an `AbortController` instance whose `AbortSignal` is marked + * as transferable and can be used with `structuredClone()` or `postMessage()`. + * @since v18.11.0 + * @returns A transferable AbortController + */ + export function transferableAbortController(): AbortController; + /** + * Marks the given `AbortSignal` as transferable so that it can be used with`structuredClone()` and `postMessage()`. + * + * ```js + * const signal = transferableAbortSignal(AbortSignal.timeout(100)); + * const channel = new MessageChannel(); + * channel.port2.postMessage(signal, [signal]); + * ``` + * @since v18.11.0 + * @param signal The AbortSignal + * @returns The same AbortSignal + */ + export function transferableAbortSignal(signal: AbortSignal): AbortSignal; + /** + * Listens to abort event on the provided `signal` and returns a promise that resolves when the `signal` is aborted. + * If `resource` is provided, it weakly references the operation's associated object, + * so if `resource` is garbage collected before the `signal` aborts, + * then returned promise shall remain pending. + * This prevents memory leaks in long-running or non-cancelable operations. + * + * ```js + * import { aborted } from 'node:util'; + * + * // Obtain an object with an abortable signal, like a custom resource or operation. + * const dependent = obtainSomethingAbortable(); + * + * // Pass `dependent` as the resource, indicating the promise should only resolve + * // if `dependent` is still in memory when the signal is aborted. + * aborted(dependent.signal, dependent).then(() => { + * // This code runs when `dependent` is aborted. + * console.log('Dependent resource was aborted.'); + * }); + * + * // Simulate an event that triggers the abort. + * dependent.on('event', () => { + * dependent.abort(); // This will cause the `aborted` promise to resolve. + * }); + * ``` + * @since v19.7.0 + * @param resource Any non-null object tied to the abortable operation and held weakly. + * If `resource` is garbage collected before the `signal` aborts, the promise remains pending, + * allowing Node.js to stop tracking it. + * This helps prevent memory leaks in long-running or non-cancelable operations. + */ + export function aborted(signal: AbortSignal, resource: any): Promise; + /** + * The `util.inspect()` method returns a string representation of `object` that is + * intended for debugging. The output of `util.inspect` may change at any time + * and should not be depended upon programmatically. Additional `options` may be + * passed that alter the result. + * `util.inspect()` will use the constructor's name and/or `Symbol.toStringTag` + * property to make an identifiable tag for an inspected value. + * + * ```js + * class Foo { + * get [Symbol.toStringTag]() { + * return 'bar'; + * } + * } + * + * class Bar {} + * + * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } }); + * + * util.inspect(new Foo()); // 'Foo [bar] {}' + * util.inspect(new Bar()); // 'Bar {}' + * util.inspect(baz); // '[foo] {}' + * ``` + * + * Circular references point to their anchor by using a reference index: + * + * ```js + * import { inspect } from 'node:util'; + * + * const obj = {}; + * obj.a = [obj]; + * obj.b = {}; + * obj.b.inner = obj.b; + * obj.b.obj = obj; + * + * console.log(inspect(obj)); + * // { + * // a: [ [Circular *1] ], + * // b: { inner: [Circular *2], obj: [Circular *1] } + * // } + * ``` + * + * The following example inspects all properties of the `util` object: + * + * ```js + * import util from 'node:util'; + * + * console.log(util.inspect(util, { showHidden: true, depth: null })); + * ``` + * + * The following example highlights the effect of the `compact` option: + * + * ```js + * import { inspect } from 'node:util'; + * + * const o = { + * a: [1, 2, [[ + * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' + + * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.', + * 'test', + * 'foo']], 4], + * b: new Map([['za', 1], ['zb', 'test']]), + * }; + * console.log(inspect(o, { compact: true, depth: 5, breakLength: 80 })); + * + * // { a: + * // [ 1, + * // 2, + * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line + * // 'test', + * // 'foo' ] ], + * // 4 ], + * // b: Map(2) { 'za' => 1, 'zb' => 'test' } } + * + * // Setting `compact` to false or an integer creates more reader friendly output. + * console.log(inspect(o, { compact: false, depth: 5, breakLength: 80 })); + * + * // { + * // a: [ + * // 1, + * // 2, + * // [ + * // [ + * // 'Lorem ipsum dolor sit amet,\n' + + * // 'consectetur adipiscing elit, sed do eiusmod \n' + + * // 'tempor incididunt ut labore et dolore magna aliqua.', + * // 'test', + * // 'foo' + * // ] + * // ], + * // 4 + * // ], + * // b: Map(2) { + * // 'za' => 1, + * // 'zb' => 'test' + * // } + * // } + * + * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a + * // single line. + * ``` + * + * The `showHidden` option allows `WeakMap` and `WeakSet` entries to be + * inspected. If there are more entries than `maxArrayLength`, there is no + * guarantee which entries are displayed. That means retrieving the same + * `WeakSet` entries twice may result in different output. Furthermore, entries + * with no remaining strong references may be garbage collected at any time. + * + * ```js + * import { inspect } from 'node:util'; + * + * const obj = { a: 1 }; + * const obj2 = { b: 2 }; + * const weakSet = new WeakSet([obj, obj2]); + * + * console.log(inspect(weakSet, { showHidden: true })); + * // WeakSet { { a: 1 }, { b: 2 } } + * ``` + * + * The `sorted` option ensures that an object's property insertion order does not + * impact the result of `util.inspect()`. + * + * ```js + * import { inspect } from 'node:util'; + * import assert from 'node:assert'; + * + * const o1 = { + * b: [2, 3, 1], + * a: '`a` comes before `b`', + * c: new Set([2, 3, 1]), + * }; + * console.log(inspect(o1, { sorted: true })); + * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } } + * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) })); + * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' } + * + * const o2 = { + * c: new Set([2, 1, 3]), + * a: '`a` comes before `b`', + * b: [2, 3, 1], + * }; + * assert.strict.equal( + * inspect(o1, { sorted: true }), + * inspect(o2, { sorted: true }), + * ); + * ``` + * + * The `numericSeparator` option adds an underscore every three digits to all + * numbers. + * + * ```js + * import { inspect } from 'node:util'; + * + * const thousand = 1000; + * const million = 1000000; + * const bigNumber = 123456789n; + * const bigDecimal = 1234.12345; + * + * console.log(inspect(thousand, { numericSeparator: true })); + * // 1_000 + * console.log(inspect(million, { numericSeparator: true })); + * // 1_000_000 + * console.log(inspect(bigNumber, { numericSeparator: true })); + * // 123_456_789n + * console.log(inspect(bigDecimal, { numericSeparator: true })); + * // 1_234.123_45 + * ``` + * + * `util.inspect()` is a synchronous method intended for debugging. Its maximum + * output length is approximately 128 MiB. Inputs that result in longer output will + * be truncated. + * @since v0.3.0 + * @param object Any JavaScript primitive or `Object`. + * @return The representation of `object`. + */ + export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; + export function inspect(object: any, options?: InspectOptions): string; + export namespace inspect { + const custom: unique symbol; + let colors: InspectColors; + let styles: InspectStyles; + let defaultOptions: InspectOptions; + let replDefaults: InspectOptions; + } + /** + * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray). + * + * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`. + * + * ```js + * import util from 'node:util'; + * + * util.isArray([]); + * // Returns: true + * util.isArray(new Array()); + * // Returns: true + * util.isArray({}); + * // Returns: false + * ``` + * @since v0.6.0 + * @deprecated Since v4.0.0 - Use `isArray` instead. + */ + export function isArray(object: unknown): object is unknown[]; + /** + * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and + * `extends` keywords to get language level inheritance support. Also note + * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179). + * + * Inherit the prototype methods from one + * [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The + * prototype of `constructor` will be set to a new object created from + * `superConstructor`. + * + * This mainly adds some input validation on top of + * `Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`. + * As an additional convenience, `superConstructor` will be accessible + * through the `constructor.super_` property. + * + * ```js + * const util = require('node:util'); + * const EventEmitter = require('node:events'); + * + * function MyStream() { + * EventEmitter.call(this); + * } + * + * util.inherits(MyStream, EventEmitter); + * + * MyStream.prototype.write = function(data) { + * this.emit('data', data); + * }; + * + * const stream = new MyStream(); + * + * console.log(stream instanceof EventEmitter); // true + * console.log(MyStream.super_ === EventEmitter); // true + * + * stream.on('data', (data) => { + * console.log(`Received data: "${data}"`); + * }); + * stream.write('It works!'); // Received data: "It works!" + * ``` + * + * ES6 example using `class` and `extends`: + * + * ```js + * import EventEmitter from 'node:events'; + * + * class MyStream extends EventEmitter { + * write(data) { + * this.emit('data', data); + * } + * } + * + * const stream = new MyStream(); + * + * stream.on('data', (data) => { + * console.log(`Received data: "${data}"`); + * }); + * stream.write('With ES6'); + * ``` + * @since v0.3.0 + * @legacy Use ES2015 class syntax and `extends` keyword instead. + */ + export function inherits(constructor: unknown, superConstructor: unknown): void; + /** + * The `util.convertProcessSignalToExitCode()` method converts a signal name to its + * corresponding POSIX exit code. Following the POSIX standard, the exit code + * for a process terminated by a signal is calculated as `128 + signal number`. + * + * If `signal` is not a valid signal name, then an error will be thrown. See + * [`signal(7)`](https://man7.org/linux/man-pages/man7/signal.7.html) for a list of valid signals. + * + * ```js + * import { convertProcessSignalToExitCode } from 'node:util'; + * + * console.log(convertProcessSignalToExitCode('SIGTERM')); // 143 (128 + 15) + * console.log(convertProcessSignalToExitCode('SIGKILL')); // 137 (128 + 9) + * ``` + * + * This is particularly useful when working with processes to determine + * the exit code based on the signal that terminated the process. + * @since v25.4.0 + * @param signal A signal name (e.g. `'SIGTERM'`) + * @returns The exit code corresponding to `signal` + */ + export function convertProcessSignalToExitCode(signal: NodeJS.Signals): number; + export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void; + export interface DebugLogger extends DebugLoggerFunction { + /** + * The `util.debuglog().enabled` getter is used to create a test that can be used + * in conditionals based on the existence of the `NODE_DEBUG` environment variable. + * If the `section` name appears within the value of that environment variable, + * then the returned value will be `true`. If not, then the returned value will be + * `false`. + * + * ```js + * import { debuglog } from 'node:util'; + * const enabled = debuglog('foo').enabled; + * if (enabled) { + * console.log('hello from foo [%d]', 123); + * } + * ``` + * + * If this program is run with `NODE_DEBUG=foo` in the environment, then it will + * output something like: + * + * ```console + * hello from foo [123] + * ``` + */ + enabled: boolean; + } + /** + * The `util.debuglog()` method is used to create a function that conditionally + * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG` + * environment variable. If the `section` name appears within the value of that + * environment variable, then the returned function operates similar to + * `console.error()`. If not, then the returned function is a no-op. + * + * ```js + * import { debuglog } from 'node:util'; + * const log = debuglog('foo'); + * + * log('hello from foo [%d]', 123); + * ``` + * + * If this program is run with `NODE_DEBUG=foo` in the environment, then + * it will output something like: + * + * ```console + * FOO 3245: hello from foo [123] + * ``` + * + * where `3245` is the process id. If it is not run with that + * environment variable set, then it will not print anything. + * + * The `section` supports wildcard also: + * + * ```js + * import { debuglog } from 'node:util'; + * const log = debuglog('foo-bar'); + * + * log('hi there, it\'s foo-bar [%d]', 2333); + * ``` + * + * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output + * something like: + * + * ```console + * FOO-BAR 3257: hi there, it's foo-bar [2333] + * ``` + * + * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG` + * environment variable: `NODE_DEBUG=fs,net,tls`. + * + * The optional `callback` argument can be used to replace the logging function + * with a different function that doesn't have any initialization or + * unnecessary wrapping. + * + * ```js + * import { debuglog } from 'node:util'; + * let log = debuglog('internals', (debug) => { + * // Replace with a logging function that optimizes out + * // testing if the section is enabled + * log = debug; + * }); + * ``` + * @since v0.11.3 + * @param section A string identifying the portion of the application for which the `debuglog` function is being created. + * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function. + * @return The logging function + */ + export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger; + export { debuglog as debug }; + export interface DeprecateOptions { + /** + * When false do not change the prototype of object + * while emitting the deprecation warning. + * @since v25.2.0 + * @default true + */ + modifyPrototype?: boolean | undefined; + } + /** + * The `util.deprecate()` method wraps `fn` (which may be a function or class) in + * such a way that it is marked as deprecated. + * + * ```js + * import { deprecate } from 'node:util'; + * + * export const obsoleteFunction = deprecate(() => { + * // Do something here. + * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.'); + * ``` + * + * When called, `util.deprecate()` will return a function that will emit a + * `DeprecationWarning` using the `'warning'` event. The warning will + * be emitted and printed to `stderr` the first time the returned function is + * called. After the warning is emitted, the wrapped function is called without + * emitting a warning. + * + * If the same optional `code` is supplied in multiple calls to `util.deprecate()`, + * the warning will be emitted only once for that `code`. + * + * ```js + * import { deprecate } from 'node:util'; + * + * const fn1 = deprecate( + * () => 'a value', + * 'deprecation message', + * 'DEP0001', + * ); + * const fn2 = deprecate( + * () => 'a different value', + * 'other dep message', + * 'DEP0001', + * ); + * fn1(); // Emits a deprecation warning with code DEP0001 + * fn2(); // Does not emit a deprecation warning because it has the same code + * ``` + * + * If either the `--no-deprecation` or `--no-warnings` command-line flags are + * used, or if the `process.noDeprecation` property is set to `true` _prior_ to + * the first deprecation warning, the `util.deprecate()` method does nothing. + * + * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set, + * or the `process.traceDeprecation` property is set to `true`, a warning and a + * stack trace are printed to `stderr` the first time the deprecated function is + * called. + * + * If the `--throw-deprecation` command-line flag is set, or the + * `process.throwDeprecation` property is set to `true`, then an exception will be + * thrown when the deprecated function is called. + * + * The `--throw-deprecation` command-line flag and `process.throwDeprecation` + * property take precedence over `--trace-deprecation` and + * `process.traceDeprecation`. + * @since v0.8.0 + * @param fn The function that is being deprecated. + * @param msg A warning message to display when the deprecated function is invoked. + * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes. + * @return The deprecated function wrapped to emit a warning. + */ + export function deprecate(fn: T, msg: string, code?: string, options?: DeprecateOptions): T; + export interface IsDeepStrictEqualOptions { + /** + * If `true`, prototype and constructor + * comparison is skipped during deep strict equality check. + * @since v24.9.0 + * @default false + */ + skipPrototype?: boolean | undefined; + } + /** + * Returns `true` if there is deep strict equality between `val1` and `val2`. + * Otherwise, returns `false`. + * + * See `assert.deepStrictEqual()` for more information about deep strict + * equality. + * @since v9.0.0 + */ + export function isDeepStrictEqual(val1: unknown, val2: unknown, options?: IsDeepStrictEqualOptions): boolean; + /** + * Returns `str` with any ANSI escape codes removed. + * + * ```js + * console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m')); + * // Prints "value" + * ``` + * @since v16.11.0 + */ + export function stripVTControlCharacters(str: string): string; + /** + * Takes an `async` function (or a function that returns a `Promise`) and returns a + * function following the error-first callback style, i.e. taking + * an `(err, value) => ...` callback as the last argument. In the callback, the + * first argument will be the rejection reason (or `null` if the `Promise` + * resolved), and the second argument will be the resolved value. + * + * ```js + * import { callbackify } from 'node:util'; + * + * async function fn() { + * return 'hello world'; + * } + * const callbackFunction = callbackify(fn); + * + * callbackFunction((err, ret) => { + * if (err) throw err; + * console.log(ret); + * }); + * ``` + * + * Will print: + * + * ```text + * hello world + * ``` + * + * The callback is executed asynchronously, and will have a limited stack trace. + * If the callback throws, the process will emit an `'uncaughtException'` + * event, and if not handled will exit. + * + * Since `null` has a special meaning as the first argument to a callback, if a + * wrapped function rejects a `Promise` with a falsy value as a reason, the value + * is wrapped in an `Error` with the original value stored in a field named + * `reason`. + * + * ```js + * function fn() { + * return Promise.reject(null); + * } + * const callbackFunction = util.callbackify(fn); + * + * callbackFunction((err, ret) => { + * // When the Promise was rejected with `null` it is wrapped with an Error and + * // the original value is stored in `reason`. + * err && Object.hasOwn(err, 'reason') && err.reason === null; // true + * }); + * ``` + * @since v8.2.0 + * @param fn An `async` function + * @return a callback style function + */ + export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: () => Promise, + ): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify( + fn: (arg1: T1) => Promise, + ): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1) => Promise, + ): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2) => Promise, + ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2) => Promise, + ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3) => Promise, + ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3) => Promise, + ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise, + ): ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, + ) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise, + ): ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, + ) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise, + ): ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + callback: (err: NodeJS.ErrnoException) => void, + ) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise, + ): ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, + ) => void; + export interface CustomPromisifyLegacy extends Function { + __promisify__: TCustom; + } + export interface CustomPromisifySymbol extends Function { + [promisify.custom]: TCustom; + } + export type CustomPromisify = + | CustomPromisifySymbol + | CustomPromisifyLegacy; + /** + * Takes a function following the common error-first callback style, i.e. taking + * an `(err, value) => ...` callback as the last argument, and returns a version + * that returns promises. + * + * ```js + * import { promisify } from 'node:util'; + * import { stat } from 'node:fs'; + * + * const promisifiedStat = promisify(stat); + * promisifiedStat('.').then((stats) => { + * // Do something with `stats` + * }).catch((error) => { + * // Handle the error. + * }); + * ``` + * + * Or, equivalently using `async function`s: + * + * ```js + * import { promisify } from 'node:util'; + * import { stat } from 'node:fs'; + * + * const promisifiedStat = promisify(stat); + * + * async function callStat() { + * const stats = await promisifiedStat('.'); + * console.log(`This directory is owned by ${stats.uid}`); + * } + * + * callStat(); + * ``` + * + * If there is an `original[util.promisify.custom]` property present, `promisify` + * will return its value, see [Custom promisified functions](https://nodejs.org/docs/latest-v25.x/api/util.html#custom-promisified-functions). + * + * `promisify()` assumes that `original` is a function taking a callback as its + * final argument in all cases. If `original` is not a function, `promisify()` + * will throw an error. If `original` is a function but its last argument is not + * an error-first callback, it will still be passed an error-first + * callback as its last argument. + * + * Using `promisify()` on class methods or other methods that use `this` may not + * work as expected unless handled specially: + * + * ```js + * import { promisify } from 'node:util'; + * + * class Foo { + * constructor() { + * this.a = 42; + * } + * + * bar(callback) { + * callback(null, this.a); + * } + * } + * + * const foo = new Foo(); + * + * const naiveBar = promisify(foo.bar); + * // TypeError: Cannot read properties of undefined (reading 'a') + * // naiveBar().then(a => console.log(a)); + * + * naiveBar.call(foo).then((a) => console.log(a)); // '42' + * + * const bindBar = naiveBar.bind(foo); + * bindBar().then((a) => console.log(a)); // '42' + * ``` + * @since v8.0.0 + */ + export function promisify(fn: CustomPromisify): TCustom; + export function promisify( + fn: (callback: (err: any, result: TResult) => void) => void, + ): () => Promise; + export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise; + export function promisify( + fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void, + ): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void, + ): (arg1: T1, arg2: T2) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void, + ): (arg1: T1, arg2: T2) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void, + ): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void, + ): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: Function): Function; + export namespace promisify { + /** + * That can be used to declare custom promisified variants of functions. + */ + const custom: unique symbol; + } + /** + * Stability: 1.1 - Active development + * Given an example `.env` file: + * + * ```js + * import { parseEnv } from 'node:util'; + * + * parseEnv('HELLO=world\nHELLO=oh my\n'); + * // Returns: { HELLO: 'oh my' } + * ``` + * @param content The raw contents of a `.env` file. + * @since v20.12.0 + */ + export function parseEnv(content: string): NodeJS.Dict; + export interface StyleTextOptions { + /** + * When true, `stream` is checked to see if it can handle colors. + * @default true + */ + validateStream?: boolean | undefined; + /** + * A stream that will be validated if it can be colored. + * @default process.stdout + */ + stream?: NodeJS.WritableStream | undefined; + } + /** + * This function returns a formatted text considering the `format` passed + * for printing in a terminal. It is aware of the terminal's capabilities + * and acts according to the configuration set via `NO_COLOR`, + * `NODE_DISABLE_COLORS` and `FORCE_COLOR` environment variables. + * + * ```js + * import { styleText } from 'node:util'; + * import { stderr } from 'node:process'; + * + * const successMessage = styleText('green', 'Success!'); + * console.log(successMessage); + * + * const errorMessage = styleText( + * 'red', + * 'Error! Error!', + * // Validate if process.stderr has TTY + * { stream: stderr }, + * ); + * console.error(errorMessage); + * ``` + * + * `util.inspect.colors` also provides text formats such as `italic`, and + * `underline` and you can combine both: + * + * ```js + * console.log( + * util.styleText(['underline', 'italic'], 'My italic underlined message'), + * ); + * ``` + * + * When passing an array of formats, the order of the format applied + * is left to right so the following style might overwrite the previous one. + * + * ```js + * console.log( + * util.styleText(['red', 'green'], 'text'), // green + * ); + * ``` + * + * The special format value `none` applies no additional styling to the text. + * + * The full list of formats can be found in [modifiers](https://nodejs.org/docs/latest-v25.x/api/util.html#modifiers). + * @param format A text format or an Array of text formats defined in `util.inspect.colors`. + * @param text The text to to be formatted. + * @since v20.12.0 + */ + export function styleText( + format: InspectColor | readonly InspectColor[], + text: string, + options?: StyleTextOptions, + ): string; + /** @deprecated This alias will be removed in a future version. Use the canonical `TextEncoderEncodeIntoResult` instead. */ + // TODO: remove in future major + export interface EncodeIntoResult extends TextEncoderEncodeIntoResult {} + //// parseArgs + /** + * Provides a higher level API for command-line argument parsing than interacting + * with `process.argv` directly. Takes a specification for the expected arguments + * and returns a structured object with the parsed options and positionals. + * + * ```js + * import { parseArgs } from 'node:util'; + * const args = ['-f', '--bar', 'b']; + * const options = { + * foo: { + * type: 'boolean', + * short: 'f', + * }, + * bar: { + * type: 'string', + * }, + * }; + * const { + * values, + * positionals, + * } = parseArgs({ args, options }); + * console.log(values, positionals); + * // Prints: [Object: null prototype] { foo: true, bar: 'b' } [] + * ``` + * @since v18.3.0, v16.17.0 + * @param config Used to provide arguments for parsing and to configure the parser. `config` supports the following properties: + * @return The parsed command line arguments: + */ + export function parseArgs(config?: T): ParsedResults; + /** + * Type of argument used in {@link parseArgs}. + */ + export type ParseArgsOptionsType = "boolean" | "string"; + export interface ParseArgsOptionDescriptor { + /** + * Type of argument. + */ + type: ParseArgsOptionsType; + /** + * Whether this option can be provided multiple times. + * If `true`, all values will be collected in an array. + * If `false`, values for the option are last-wins. + * @default false. + */ + multiple?: boolean | undefined; + /** + * A single character alias for the option. + */ + short?: string | undefined; + /** + * The value to assign to + * the option if it does not appear in the arguments to be parsed. The value + * must match the type specified by the `type` property. If `multiple` is + * `true`, it must be an array. No default value is applied when the option + * does appear in the arguments to be parsed, even if the provided value + * is falsy. + * @since v18.11.0 + */ + default?: string | boolean | string[] | boolean[] | undefined; + } + export interface ParseArgsOptionsConfig { + [longOption: string]: ParseArgsOptionDescriptor; + } + export interface ParseArgsConfig { + /** + * Array of argument strings. + */ + args?: readonly string[] | undefined; + /** + * Used to describe arguments known to the parser. + */ + options?: ParseArgsOptionsConfig | undefined; + /** + * Should an error be thrown when unknown arguments are encountered, + * or when arguments are passed that do not match the `type` configured in `options`. + * @default true + */ + strict?: boolean | undefined; + /** + * Whether this command accepts positional arguments. + */ + allowPositionals?: boolean | undefined; + /** + * If `true`, allows explicitly setting boolean options to `false` by prefixing the option name with `--no-`. + * @default false + * @since v22.4.0 + */ + allowNegative?: boolean | undefined; + /** + * Return the parsed tokens. This is useful for extending the built-in behavior, + * from adding additional checks through to reprocessing the tokens in different ways. + * @default false + */ + tokens?: boolean | undefined; + } + /* + IfDefaultsTrue and IfDefaultsFalse are helpers to handle default values for missing boolean properties. + TypeScript does not have exact types for objects: https://github.com/microsoft/TypeScript/issues/12936 + This means it is impossible to distinguish between "field X is definitely not present" and "field X may or may not be present". + But we expect users to generally provide their config inline or `as const`, which means TS will always know whether a given field is present. + So this helper treats "not definitely present" (i.e., not `extends boolean`) as being "definitely not present", i.e. it should have its default value. + This is technically incorrect but is a much nicer UX for the common case. + The IfDefaultsTrue version is for things which default to true; the IfDefaultsFalse version is for things which default to false. + */ + type IfDefaultsTrue = T extends true ? IfTrue + : T extends false ? IfFalse + : IfTrue; + // we put the `extends false` condition first here because `undefined` compares like `any` when `strictNullChecks: false` + type IfDefaultsFalse = T extends false ? IfFalse + : T extends true ? IfTrue + : IfFalse; + type ExtractOptionValue = IfDefaultsTrue< + T["strict"], + O["type"] extends "string" ? string : O["type"] extends "boolean" ? boolean : string | boolean, + string | boolean + >; + type ApplyOptionalModifiers> = ( + & { -readonly [LongOption in keyof O]?: V[LongOption] } + & { [LongOption in keyof O as O[LongOption]["default"] extends {} ? LongOption : never]: V[LongOption] } + ) extends infer P ? { [K in keyof P]: P[K] } : never; // resolve intersection to object + type ParsedValues = + & IfDefaultsTrue + & (T["options"] extends ParseArgsOptionsConfig ? ApplyOptionalModifiers< + T["options"], + { + [LongOption in keyof T["options"]]: IfDefaultsFalse< + T["options"][LongOption]["multiple"], + Array>, + ExtractOptionValue + >; + } + > + : {}); + type ParsedPositionals = IfDefaultsTrue< + T["strict"], + IfDefaultsFalse, + IfDefaultsTrue + >; + type PreciseTokenForOptions< + K extends string, + O extends ParseArgsOptionDescriptor, + > = O["type"] extends "string" ? { + kind: "option"; + index: number; + name: K; + rawName: string; + value: string; + inlineValue: boolean; + } + : O["type"] extends "boolean" ? { + kind: "option"; + index: number; + name: K; + rawName: string; + value: undefined; + inlineValue: undefined; + } + : OptionToken & { name: K }; + type TokenForOptions< + T extends ParseArgsConfig, + K extends keyof T["options"] = keyof T["options"], + > = K extends unknown + ? T["options"] extends ParseArgsOptionsConfig ? PreciseTokenForOptions + : OptionToken + : never; + type ParsedOptionToken = IfDefaultsTrue, OptionToken>; + type ParsedPositionalToken = IfDefaultsTrue< + T["strict"], + IfDefaultsFalse, + IfDefaultsTrue + >; + type ParsedTokens = Array< + ParsedOptionToken | ParsedPositionalToken | { kind: "option-terminator"; index: number } + >; + type PreciseParsedResults = IfDefaultsFalse< + T["tokens"], + { + values: ParsedValues; + positionals: ParsedPositionals; + tokens: ParsedTokens; + }, + { + values: ParsedValues; + positionals: ParsedPositionals; + } + >; + type OptionToken = + | { kind: "option"; index: number; name: string; rawName: string; value: string; inlineValue: boolean } + | { + kind: "option"; + index: number; + name: string; + rawName: string; + value: undefined; + inlineValue: undefined; + }; + type Token = + | OptionToken + | { kind: "positional"; index: number; value: string } + | { kind: "option-terminator"; index: number }; + // If ParseArgsConfig extends T, then the user passed config constructed elsewhere. + // So we can't rely on the `"not definitely present" implies "definitely not present"` assumption mentioned above. + type ParsedResults = ParseArgsConfig extends T ? { + values: { + [longOption: string]: undefined | string | boolean | Array; + }; + positionals: string[]; + tokens?: Token[]; + } + : PreciseParsedResults; + /** + * An implementation of [the MIMEType class](https://bmeck.github.io/node-proposal-mime-api/). + * + * In accordance with browser conventions, all properties of `MIMEType` objects + * are implemented as getters and setters on the class prototype, rather than as + * data properties on the object itself. + * + * A MIME string is a structured string containing multiple meaningful + * components. When parsed, a `MIMEType` object is returned containing + * properties for each of these components. + * @since v19.1.0, v18.13.0 + */ + export class MIMEType { + /** + * Creates a new MIMEType object by parsing the input. + * + * A `TypeError` will be thrown if the `input` is not a valid MIME. + * Note that an effort will be made to coerce the given values into strings. + * @param input The input MIME to parse. + */ + constructor(input: string | { toString: () => string }); + /** + * Gets and sets the type portion of the MIME. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const myMIME = new MIMEType('text/javascript'); + * console.log(myMIME.type); + * // Prints: text + * myMIME.type = 'application'; + * console.log(myMIME.type); + * // Prints: application + * console.log(String(myMIME)); + * // Prints: application/javascript + * ``` + */ + type: string; + /** + * Gets and sets the subtype portion of the MIME. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const myMIME = new MIMEType('text/ecmascript'); + * console.log(myMIME.subtype); + * // Prints: ecmascript + * myMIME.subtype = 'javascript'; + * console.log(myMIME.subtype); + * // Prints: javascript + * console.log(String(myMIME)); + * // Prints: text/javascript + * ``` + */ + subtype: string; + /** + * Gets the essence of the MIME. This property is read only. + * Use `mime.type` or `mime.subtype` to alter the MIME. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const myMIME = new MIMEType('text/javascript;key=value'); + * console.log(myMIME.essence); + * // Prints: text/javascript + * myMIME.type = 'application'; + * console.log(myMIME.essence); + * // Prints: application/javascript + * console.log(String(myMIME)); + * // Prints: application/javascript;key=value + * ``` + */ + readonly essence: string; + /** + * Gets the `MIMEParams` object representing the + * parameters of the MIME. This property is read-only. See `MIMEParams` documentation for details. + */ + readonly params: MIMEParams; + /** + * The `toString()` method on the `MIMEType` object returns the serialized MIME. + * + * Because of the need for standard compliance, this method does not allow users + * to customize the serialization process of the MIME. + */ + toString(): string; + } + /** + * The `MIMEParams` API provides read and write access to the parameters of a `MIMEType`. + * @since v19.1.0, v18.13.0 + */ + export class MIMEParams { + /** + * Remove all name-value pairs whose name is `name`. + */ + delete(name: string): void; + /** + * Returns an iterator over each of the name-value pairs in the parameters. + * Each item of the iterator is a JavaScript `Array`. The first item of the array + * is the `name`, the second item of the array is the `value`. + */ + entries(): NodeJS.Iterator<[name: string, value: string]>; + /** + * Returns the value of the first name-value pair whose name is `name`. If there + * are no such pairs, `null` is returned. + * @return or `null` if there is no name-value pair with the given `name`. + */ + get(name: string): string | null; + /** + * Returns `true` if there is at least one name-value pair whose name is `name`. + */ + has(name: string): boolean; + /** + * Returns an iterator over the names of each name-value pair. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const { params } = new MIMEType('text/plain;foo=0;bar=1'); + * for (const name of params.keys()) { + * console.log(name); + * } + * // Prints: + * // foo + * // bar + * ``` + */ + keys(): NodeJS.Iterator; + /** + * Sets the value in the `MIMEParams` object associated with `name` to `value`. If there are any pre-existing name-value pairs whose names are `name`, + * set the first such pair's value to `value`. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const { params } = new MIMEType('text/plain;foo=0;bar=1'); + * params.set('foo', 'def'); + * params.set('baz', 'xyz'); + * console.log(params.toString()); + * // Prints: foo=def;bar=1;baz=xyz + * ``` + */ + set(name: string, value: string): void; + /** + * Returns an iterator over the values of each name-value pair. + */ + values(): NodeJS.Iterator; + /** + * Returns an iterator over each of the name-value pairs in the parameters. + */ + [Symbol.iterator](): NodeJS.Iterator<[name: string, value: string]>; + } + // #region web types + export interface TextDecodeOptions { + stream?: boolean; + } + export interface TextDecoderCommon { + readonly encoding: string; + readonly fatal: boolean; + readonly ignoreBOM: boolean; + } + export interface TextDecoderOptions { + fatal?: boolean; + ignoreBOM?: boolean; + } + export interface TextEncoderCommon { + readonly encoding: string; + } + export interface TextEncoderEncodeIntoResult { + read: number; + written: number; + } + export interface TextDecoder extends TextDecoderCommon { + decode(input?: NodeJS.AllowSharedBufferSource, options?: TextDecodeOptions): string; + } + export var TextDecoder: { + prototype: TextDecoder; + new(label?: string, options?: TextDecoderOptions): TextDecoder; + }; + export interface TextEncoder extends TextEncoderCommon { + encode(input?: string): NodeJS.NonSharedUint8Array; + encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult; + } + export var TextEncoder: { + prototype: TextEncoder; + new(): TextEncoder; + }; + // #endregion +} +declare module "util" { + export * from "node:util"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/util/types.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/util/types.d.ts new file mode 100644 index 0000000..818825b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/util/types.d.ts @@ -0,0 +1,558 @@ +declare module "node:util/types" { + import { KeyObject, webcrypto } from "node:crypto"; + /** + * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or + * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. + * + * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`. + * + * ```js + * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true + * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true + * ``` + * @since v10.0.0 + */ + function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike; + /** + * Returns `true` if the value is an `arguments` object. + * + * ```js + * function foo() { + * util.types.isArgumentsObject(arguments); // Returns true + * } + * ``` + * @since v10.0.0 + */ + function isArgumentsObject(object: unknown): object is IArguments; + /** + * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance. + * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is + * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. + * + * ```js + * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true + * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false + * ``` + * @since v10.0.0 + */ + function isArrayBuffer(object: unknown): object is ArrayBuffer; + /** + * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed + * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to + * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). + * + * ```js + * util.types.isArrayBufferView(new Int8Array()); // true + * util.types.isArrayBufferView(Buffer.from('hello world')); // true + * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true + * util.types.isArrayBufferView(new ArrayBuffer()); // false + * ``` + * @since v10.0.0 + */ + function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView; + /** + * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). + * This only reports back what the JavaScript engine is seeing; + * in particular, the return value may not match the original source code if + * a transpilation tool was used. + * + * ```js + * util.types.isAsyncFunction(function foo() {}); // Returns false + * util.types.isAsyncFunction(async function foo() {}); // Returns true + * ``` + * @since v10.0.0 + */ + function isAsyncFunction(object: unknown): boolean; + /** + * Returns `true` if the value is a `BigInt64Array` instance. + * + * ```js + * util.types.isBigInt64Array(new BigInt64Array()); // Returns true + * util.types.isBigInt64Array(new BigUint64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isBigInt64Array(value: unknown): value is BigInt64Array; + /** + * Returns `true` if the value is a BigInt object, e.g. created + * by `Object(BigInt(123))`. + * + * ```js + * util.types.isBigIntObject(Object(BigInt(123))); // Returns true + * util.types.isBigIntObject(BigInt(123)); // Returns false + * util.types.isBigIntObject(123); // Returns false + * ``` + * @since v10.4.0 + */ + function isBigIntObject(object: unknown): object is BigInt; + /** + * Returns `true` if the value is a `BigUint64Array` instance. + * + * ```js + * util.types.isBigUint64Array(new BigInt64Array()); // Returns false + * util.types.isBigUint64Array(new BigUint64Array()); // Returns true + * ``` + * @since v10.0.0 + */ + function isBigUint64Array(value: unknown): value is BigUint64Array; + /** + * Returns `true` if the value is a boolean object, e.g. created + * by `new Boolean()`. + * + * ```js + * util.types.isBooleanObject(false); // Returns false + * util.types.isBooleanObject(true); // Returns false + * util.types.isBooleanObject(new Boolean(false)); // Returns true + * util.types.isBooleanObject(new Boolean(true)); // Returns true + * util.types.isBooleanObject(Boolean(false)); // Returns false + * util.types.isBooleanObject(Boolean(true)); // Returns false + * ``` + * @since v10.0.0 + */ + function isBooleanObject(object: unknown): object is Boolean; + /** + * Returns `true` if the value is any boxed primitive object, e.g. created + * by `new Boolean()`, `new String()` or `Object(Symbol())`. + * + * For example: + * + * ```js + * util.types.isBoxedPrimitive(false); // Returns false + * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true + * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false + * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true + * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true + * ``` + * @since v10.11.0 + */ + function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol; + /** + * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance. + * + * ```js + * const ab = new ArrayBuffer(20); + * util.types.isDataView(new DataView(ab)); // Returns true + * util.types.isDataView(new Float64Array()); // Returns false + * ``` + * + * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). + * @since v10.0.0 + */ + function isDataView(object: unknown): object is DataView; + /** + * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance. + * + * ```js + * util.types.isDate(new Date()); // Returns true + * ``` + * @since v10.0.0 + */ + function isDate(object: unknown): object is Date; + /** + * Returns `true` if the value is a native `External` value. + * + * A native `External` value is a special type of object that contains a + * raw C++ pointer (`void*`) for access from native code, and has no other + * properties. Such objects are created either by Node.js internals or native + * addons. In JavaScript, they are + * [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a + * `null` prototype. + * + * ```c + * #include + * #include + * napi_value result; + * static napi_value MyNapi(napi_env env, napi_callback_info info) { + * int* raw = (int*) malloc(1024); + * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result); + * if (status != napi_ok) { + * napi_throw_error(env, NULL, "napi_create_external failed"); + * return NULL; + * } + * return result; + * } + * ... + * DECLARE_NAPI_PROPERTY("myNapi", MyNapi) + * ... + * ``` + * + * ```js + * import native from 'napi_addon.node'; + * import { types } from 'node:util'; + * + * const data = native.myNapi(); + * types.isExternal(data); // returns true + * types.isExternal(0); // returns false + * types.isExternal(new String('foo')); // returns false + * ``` + * + * For further information on `napi_create_external`, refer to + * [`napi_create_external()`](https://nodejs.org/docs/latest-v25.x/api/n-api.html#napi_create_external). + * @since v10.0.0 + */ + function isExternal(object: unknown): boolean; + /** + * Returns `true` if the value is a built-in [`Float16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float16Array) instance. + * + * ```js + * util.types.isFloat16Array(new ArrayBuffer()); // Returns false + * util.types.isFloat16Array(new Float16Array()); // Returns true + * util.types.isFloat16Array(new Float32Array()); // Returns false + * ``` + * @since v24.0.0 + */ + function isFloat16Array(object: unknown): object is Float16Array; + /** + * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance. + * + * ```js + * util.types.isFloat32Array(new ArrayBuffer()); // Returns false + * util.types.isFloat32Array(new Float32Array()); // Returns true + * util.types.isFloat32Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isFloat32Array(object: unknown): object is Float32Array; + /** + * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance. + * + * ```js + * util.types.isFloat64Array(new ArrayBuffer()); // Returns false + * util.types.isFloat64Array(new Uint8Array()); // Returns false + * util.types.isFloat64Array(new Float64Array()); // Returns true + * ``` + * @since v10.0.0 + */ + function isFloat64Array(object: unknown): object is Float64Array; + /** + * Returns `true` if the value is a generator function. + * This only reports back what the JavaScript engine is seeing; + * in particular, the return value may not match the original source code if + * a transpilation tool was used. + * + * ```js + * util.types.isGeneratorFunction(function foo() {}); // Returns false + * util.types.isGeneratorFunction(function* foo() {}); // Returns true + * ``` + * @since v10.0.0 + */ + function isGeneratorFunction(object: unknown): object is GeneratorFunction; + /** + * Returns `true` if the value is a generator object as returned from a + * built-in generator function. + * This only reports back what the JavaScript engine is seeing; + * in particular, the return value may not match the original source code if + * a transpilation tool was used. + * + * ```js + * function* foo() {} + * const generator = foo(); + * util.types.isGeneratorObject(generator); // Returns true + * ``` + * @since v10.0.0 + */ + function isGeneratorObject(object: unknown): object is Generator; + /** + * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance. + * + * ```js + * util.types.isInt8Array(new ArrayBuffer()); // Returns false + * util.types.isInt8Array(new Int8Array()); // Returns true + * util.types.isInt8Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isInt8Array(object: unknown): object is Int8Array; + /** + * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance. + * + * ```js + * util.types.isInt16Array(new ArrayBuffer()); // Returns false + * util.types.isInt16Array(new Int16Array()); // Returns true + * util.types.isInt16Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isInt16Array(object: unknown): object is Int16Array; + /** + * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance. + * + * ```js + * util.types.isInt32Array(new ArrayBuffer()); // Returns false + * util.types.isInt32Array(new Int32Array()); // Returns true + * util.types.isInt32Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isInt32Array(object: unknown): object is Int32Array; + /** + * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. + * + * ```js + * util.types.isMap(new Map()); // Returns true + * ``` + * @since v10.0.0 + */ + function isMap( + object: T | {}, + ): object is T extends ReadonlyMap ? (unknown extends T ? never : ReadonlyMap) + : Map; + /** + * Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. + * + * ```js + * const map = new Map(); + * util.types.isMapIterator(map.keys()); // Returns true + * util.types.isMapIterator(map.values()); // Returns true + * util.types.isMapIterator(map.entries()); // Returns true + * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true + * ``` + * @since v10.0.0 + */ + function isMapIterator(object: unknown): boolean; + /** + * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects). + * + * ```js + * import * as ns from './a.js'; + * + * util.types.isModuleNamespaceObject(ns); // Returns true + * ``` + * @since v10.0.0 + */ + function isModuleNamespaceObject(value: unknown): boolean; + /** + * Returns `true` if the value was returned by the constructor of a + * [built-in `Error` type](https://tc39.es/ecma262/#sec-error-objects). + * + * ```js + * console.log(util.types.isNativeError(new Error())); // true + * console.log(util.types.isNativeError(new TypeError())); // true + * console.log(util.types.isNativeError(new RangeError())); // true + * ``` + * + * Subclasses of the native error types are also native errors: + * + * ```js + * class MyError extends Error {} + * console.log(util.types.isNativeError(new MyError())); // true + * ``` + * + * A value being `instanceof` a native error class is not equivalent to `isNativeError()` + * returning `true` for that value. `isNativeError()` returns `true` for errors + * which come from a different [realm](https://tc39.es/ecma262/#realm) while `instanceof Error` returns `false` + * for these errors: + * + * ```js + * import { createContext, runInContext } from 'node:vm'; + * import { types } from 'node:util'; + * + * const context = createContext({}); + * const myError = runInContext('new Error()', context); + * console.log(types.isNativeError(myError)); // true + * console.log(myError instanceof Error); // false + * ``` + * + * Conversely, `isNativeError()` returns `false` for all objects which were not + * returned by the constructor of a native error. That includes values + * which are `instanceof` native errors: + * + * ```js + * const myError = { __proto__: Error.prototype }; + * console.log(util.types.isNativeError(myError)); // false + * console.log(myError instanceof Error); // true + * ``` + * @since v10.0.0 + * @deprecated The `util.types.isNativeError` API is deprecated. Please use `Error.isError` instead. + */ + function isNativeError(object: unknown): object is Error; + /** + * Returns `true` if the value is a number object, e.g. created + * by `new Number()`. + * + * ```js + * util.types.isNumberObject(0); // Returns false + * util.types.isNumberObject(new Number(0)); // Returns true + * ``` + * @since v10.0.0 + */ + function isNumberObject(object: unknown): object is Number; + /** + * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). + * + * ```js + * util.types.isPromise(Promise.resolve(42)); // Returns true + * ``` + * @since v10.0.0 + */ + function isPromise(object: unknown): object is Promise; + /** + * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance. + * + * ```js + * const target = {}; + * const proxy = new Proxy(target, {}); + * util.types.isProxy(target); // Returns false + * util.types.isProxy(proxy); // Returns true + * ``` + * @since v10.0.0 + */ + function isProxy(object: unknown): boolean; + /** + * Returns `true` if the value is a regular expression object. + * + * ```js + * util.types.isRegExp(/abc/); // Returns true + * util.types.isRegExp(new RegExp('abc')); // Returns true + * ``` + * @since v10.0.0 + */ + function isRegExp(object: unknown): object is RegExp; + /** + * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. + * + * ```js + * util.types.isSet(new Set()); // Returns true + * ``` + * @since v10.0.0 + */ + function isSet( + object: T | {}, + ): object is T extends ReadonlySet ? (unknown extends T ? never : ReadonlySet) : Set; + /** + * Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. + * + * ```js + * const set = new Set(); + * util.types.isSetIterator(set.keys()); // Returns true + * util.types.isSetIterator(set.values()); // Returns true + * util.types.isSetIterator(set.entries()); // Returns true + * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true + * ``` + * @since v10.0.0 + */ + function isSetIterator(object: unknown): boolean; + /** + * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. + * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is + * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. + * + * ```js + * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false + * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true + * ``` + * @since v10.0.0 + */ + function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer; + /** + * Returns `true` if the value is a string object, e.g. created + * by `new String()`. + * + * ```js + * util.types.isStringObject('foo'); // Returns false + * util.types.isStringObject(new String('foo')); // Returns true + * ``` + * @since v10.0.0 + */ + function isStringObject(object: unknown): object is String; + /** + * Returns `true` if the value is a symbol object, created + * by calling `Object()` on a `Symbol` primitive. + * + * ```js + * const symbol = Symbol('foo'); + * util.types.isSymbolObject(symbol); // Returns false + * util.types.isSymbolObject(Object(symbol)); // Returns true + * ``` + * @since v10.0.0 + */ + function isSymbolObject(object: unknown): object is Symbol; + /** + * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance. + * + * ```js + * util.types.isTypedArray(new ArrayBuffer()); // Returns false + * util.types.isTypedArray(new Uint8Array()); // Returns true + * util.types.isTypedArray(new Float64Array()); // Returns true + * ``` + * + * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). + * @since v10.0.0 + */ + function isTypedArray(object: unknown): object is NodeJS.TypedArray; + /** + * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance. + * + * ```js + * util.types.isUint8Array(new ArrayBuffer()); // Returns false + * util.types.isUint8Array(new Uint8Array()); // Returns true + * util.types.isUint8Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint8Array(object: unknown): object is Uint8Array; + /** + * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance. + * + * ```js + * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false + * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true + * util.types.isUint8ClampedArray(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray; + /** + * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance. + * + * ```js + * util.types.isUint16Array(new ArrayBuffer()); // Returns false + * util.types.isUint16Array(new Uint16Array()); // Returns true + * util.types.isUint16Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint16Array(object: unknown): object is Uint16Array; + /** + * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance. + * + * ```js + * util.types.isUint32Array(new ArrayBuffer()); // Returns false + * util.types.isUint32Array(new Uint32Array()); // Returns true + * util.types.isUint32Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint32Array(object: unknown): object is Uint32Array; + /** + * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance. + * + * ```js + * util.types.isWeakMap(new WeakMap()); // Returns true + * ``` + * @since v10.0.0 + */ + function isWeakMap(object: unknown): object is WeakMap; + /** + * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance. + * + * ```js + * util.types.isWeakSet(new WeakSet()); // Returns true + * ``` + * @since v10.0.0 + */ + function isWeakSet(object: unknown): object is WeakSet; + /** + * Returns `true` if `value` is a `KeyObject`, `false` otherwise. + * @since v16.2.0 + */ + function isKeyObject(object: unknown): object is KeyObject; + /** + * Returns `true` if `value` is a `CryptoKey`, `false` otherwise. + * @since v16.2.0 + */ + function isCryptoKey(object: unknown): object is webcrypto.CryptoKey; +} +declare module "util/types" { + export * from "node:util/types"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/v8.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/v8.d.ts new file mode 100644 index 0000000..3c3eff2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/v8.d.ts @@ -0,0 +1,988 @@ +/** + * The `node:v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using: + * + * ```js + * import v8 from 'node:v8'; + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/v8.js) + */ +declare module "node:v8" { + import { NonSharedBuffer } from "node:buffer"; + import { Readable } from "node:stream"; + interface HeapSpaceInfo { + space_name: string; + space_size: number; + space_used_size: number; + space_available_size: number; + physical_space_size: number; + } + // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ + type DoesZapCodeSpaceFlag = 0 | 1; + interface HeapInfo { + total_heap_size: number; + total_heap_size_executable: number; + total_physical_size: number; + total_available_size: number; + used_heap_size: number; + heap_size_limit: number; + malloced_memory: number; + peak_malloced_memory: number; + does_zap_garbage: DoesZapCodeSpaceFlag; + number_of_native_contexts: number; + number_of_detached_contexts: number; + total_global_handles_size: number; + used_global_handles_size: number; + external_memory: number; + total_allocated_bytes: number; + } + interface HeapCodeStatistics { + code_and_metadata_size: number; + bytecode_and_metadata_size: number; + external_script_source_size: number; + } + interface HeapSnapshotOptions { + /** + * If true, expose internals in the heap snapshot. + * @default false + */ + exposeInternals?: boolean | undefined; + /** + * If true, expose numeric values in artificial fields. + * @default false + */ + exposeNumericValues?: boolean | undefined; + } + /** + * Returns an integer representing a version tag derived from the V8 version, + * command-line flags, and detected CPU features. This is useful for determining + * whether a `vm.Script` `cachedData` buffer is compatible with this instance + * of V8. + * + * ```js + * console.log(v8.cachedDataVersionTag()); // 3947234607 + * // The value returned by v8.cachedDataVersionTag() is derived from the V8 + * // version, command-line flags, and detected CPU features. Test that the value + * // does indeed update when flags are toggled. + * v8.setFlagsFromString('--allow_natives_syntax'); + * console.log(v8.cachedDataVersionTag()); // 183726201 + * ``` + * @since v8.0.0 + */ + function cachedDataVersionTag(): number; + /** + * Returns an object with the following properties: + * + * `does_zap_garbage` is a 0/1 boolean, which signifies whether the `--zap_code_space` option is enabled or not. This makes V8 overwrite heap + * garbage with a bit pattern. The RSS footprint (resident set size) gets bigger + * because it continuously touches all heap pages and that makes them less likely + * to get swapped out by the operating system. + * + * `number_of_native_contexts` The value of native\_context is the number of the + * top-level contexts currently active. Increase of this number over time indicates + * a memory leak. + * + * `number_of_detached_contexts` The value of detached\_context is the number + * of contexts that were detached and not yet garbage collected. This number + * being non-zero indicates a potential memory leak. + * + * `total_global_handles_size` The value of total\_global\_handles\_size is the + * total memory size of V8 global handles. + * + * `used_global_handles_size` The value of used\_global\_handles\_size is the + * used memory size of V8 global handles. + * + * `external_memory` The value of external\_memory is the memory size of array + * buffers and external strings. + * + * `total_allocated_bytes` The value of total allocated bytes since the Isolate + * creation. + * + * ```js + * { + * total_heap_size: 7326976, + * total_heap_size_executable: 4194304, + * total_physical_size: 7326976, + * total_available_size: 1152656, + * used_heap_size: 3476208, + * heap_size_limit: 1535115264, + * malloced_memory: 16384, + * peak_malloced_memory: 1127496, + * does_zap_garbage: 0, + * number_of_native_contexts: 1, + * number_of_detached_contexts: 0, + * total_global_handles_size: 8192, + * used_global_handles_size: 3296, + * external_memory: 318824, + * total_allocated_bytes: 45224088 + * } + * ``` + * @since v1.0.0 + */ + function getHeapStatistics(): HeapInfo; + /** + * It returns an object with a structure similar to the + * [`cppgc::HeapStatistics`](https://v8docs.nodesource.com/node-22.4/d7/d51/heap-statistics_8h_source.html) + * object. See the [V8 documentation](https://v8docs.nodesource.com/node-22.4/df/d2f/structcppgc_1_1_heap_statistics.html) + * for more information about the properties of the object. + * + * ```js + * // Detailed + * ({ + * committed_size_bytes: 131072, + * resident_size_bytes: 131072, + * used_size_bytes: 152, + * space_statistics: [ + * { + * name: 'NormalPageSpace0', + * committed_size_bytes: 0, + * resident_size_bytes: 0, + * used_size_bytes: 0, + * page_stats: [{}], + * free_list_stats: {}, + * }, + * { + * name: 'NormalPageSpace1', + * committed_size_bytes: 131072, + * resident_size_bytes: 131072, + * used_size_bytes: 152, + * page_stats: [{}], + * free_list_stats: {}, + * }, + * { + * name: 'NormalPageSpace2', + * committed_size_bytes: 0, + * resident_size_bytes: 0, + * used_size_bytes: 0, + * page_stats: [{}], + * free_list_stats: {}, + * }, + * { + * name: 'NormalPageSpace3', + * committed_size_bytes: 0, + * resident_size_bytes: 0, + * used_size_bytes: 0, + * page_stats: [{}], + * free_list_stats: {}, + * }, + * { + * name: 'LargePageSpace', + * committed_size_bytes: 0, + * resident_size_bytes: 0, + * used_size_bytes: 0, + * page_stats: [{}], + * free_list_stats: {}, + * }, + * ], + * type_names: [], + * detail_level: 'detailed', + * }); + * ``` + * + * ```js + * // Brief + * ({ + * committed_size_bytes: 131072, + * resident_size_bytes: 131072, + * used_size_bytes: 128864, + * space_statistics: [], + * type_names: [], + * detail_level: 'brief', + * }); + * ``` + * @since v22.15.0 + * @param detailLevel **Default:** `'detailed'`. Specifies the level of detail in the returned statistics. + * Accepted values are: + * * `'brief'`: Brief statistics contain only the top-level + * allocated and used + * memory statistics for the entire heap. + * * `'detailed'`: Detailed statistics also contain a break + * down per space and page, as well as freelist statistics + * and object type histograms. + */ + function getCppHeapStatistics(detailLevel?: "brief" | "detailed"): object; + /** + * Returns statistics about the V8 heap spaces, i.e. the segments which make up + * the V8 heap. Neither the ordering of heap spaces, nor the availability of a + * heap space can be guaranteed as the statistics are provided via the + * V8 [`GetHeapSpaceStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4) function and may change from one V8 version to the + * next. + * + * The value returned is an array of objects containing the following properties: + * + * ```json + * [ + * { + * "space_name": "new_space", + * "space_size": 2063872, + * "space_used_size": 951112, + * "space_available_size": 80824, + * "physical_space_size": 2063872 + * }, + * { + * "space_name": "old_space", + * "space_size": 3090560, + * "space_used_size": 2493792, + * "space_available_size": 0, + * "physical_space_size": 3090560 + * }, + * { + * "space_name": "code_space", + * "space_size": 1260160, + * "space_used_size": 644256, + * "space_available_size": 960, + * "physical_space_size": 1260160 + * }, + * { + * "space_name": "map_space", + * "space_size": 1094160, + * "space_used_size": 201608, + * "space_available_size": 0, + * "physical_space_size": 1094160 + * }, + * { + * "space_name": "large_object_space", + * "space_size": 0, + * "space_used_size": 0, + * "space_available_size": 1490980608, + * "physical_space_size": 0 + * } + * ] + * ``` + * @since v6.0.0 + */ + function getHeapSpaceStatistics(): HeapSpaceInfo[]; + /** + * The `v8.setFlagsFromString()` method can be used to programmatically set + * V8 command-line flags. This method should be used with care. Changing settings + * after the VM has started may result in unpredictable behavior, including + * crashes and data loss; or it may simply do nothing. + * + * The V8 options available for a version of Node.js may be determined by running `node --v8-options`. + * + * Usage: + * + * ```js + * // Print GC events to stdout for one minute. + * import v8 from 'node:v8'; + * v8.setFlagsFromString('--trace_gc'); + * setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3); + * ``` + * @since v1.0.0 + */ + function setFlagsFromString(flags: string): void; + /** + * This is similar to the [`queryObjects()` console API](https://developer.chrome.com/docs/devtools/console/utilities#queryObjects-function) + * provided by the Chromium DevTools console. It can be used to search for objects that have the matching constructor on its prototype chain + * in the heap after a full garbage collection, which can be useful for memory leak regression tests. To avoid surprising results, users should + * avoid using this API on constructors whose implementation they don't control, or on constructors that can be invoked by other parties in the + * application. + * + * To avoid accidental leaks, this API does not return raw references to the objects found. By default, it returns the count of the objects + * found. If `options.format` is `'summary'`, it returns an array containing brief string representations for each object. The visibility provided + * in this API is similar to what the heap snapshot provides, while users can save the cost of serialization and parsing and directly filter the + * target objects during the search. + * + * Only objects created in the current execution context are included in the results. + * + * ```js + * import { queryObjects } from 'node:v8'; + * class A { foo = 'bar'; } + * console.log(queryObjects(A)); // 0 + * const a = new A(); + * console.log(queryObjects(A)); // 1 + * // [ "A { foo: 'bar' }" ] + * console.log(queryObjects(A, { format: 'summary' })); + * + * class B extends A { bar = 'qux'; } + * const b = new B(); + * console.log(queryObjects(B)); // 1 + * // [ "B { foo: 'bar', bar: 'qux' }" ] + * console.log(queryObjects(B, { format: 'summary' })); + * + * // Note that, when there are child classes inheriting from a constructor, + * // the constructor also shows up in the prototype chain of the child + * // classes's prototoype, so the child classes's prototoype would also be + * // included in the result. + * console.log(queryObjects(A)); // 3 + * // [ "B { foo: 'bar', bar: 'qux' }", 'A {}', "A { foo: 'bar' }" ] + * console.log(queryObjects(A, { format: 'summary' })); + * ``` + * @param ctor The constructor that can be used to search on the prototype chain in order to filter target objects in the heap. + * @since v20.13.0 + */ + function queryObjects(ctor: Function): number | string[]; + function queryObjects(ctor: Function, options: { format: "count" }): number; + function queryObjects(ctor: Function, options: { format: "summary" }): string[]; + /** + * Generates a snapshot of the current V8 heap and returns a Readable + * Stream that may be used to read the JSON serialized representation. + * This JSON stream format is intended to be used with tools such as + * Chrome DevTools. The JSON schema is undocumented and specific to the + * V8 engine. Therefore, the schema may change from one version of V8 to the next. + * + * Creating a heap snapshot requires memory about twice the size of the heap at + * the time the snapshot is created. This results in the risk of OOM killers + * terminating the process. + * + * Generating a snapshot is a synchronous operation which blocks the event loop + * for a duration depending on the heap size. + * + * ```js + * // Print heap snapshot to the console + * import v8 from 'node:v8'; + * const stream = v8.getHeapSnapshot(); + * stream.pipe(process.stdout); + * ``` + * @since v11.13.0 + * @return A Readable containing the V8 heap snapshot. + */ + function getHeapSnapshot(options?: HeapSnapshotOptions): Readable; + /** + * Generates a snapshot of the current V8 heap and writes it to a JSON + * file. This file is intended to be used with tools such as Chrome + * DevTools. The JSON schema is undocumented and specific to the V8 + * engine, and may change from one version of V8 to the next. + * + * A heap snapshot is specific to a single V8 isolate. When using `worker threads`, a heap snapshot generated from the main thread will + * not contain any information about the workers, and vice versa. + * + * Creating a heap snapshot requires memory about twice the size of the heap at + * the time the snapshot is created. This results in the risk of OOM killers + * terminating the process. + * + * Generating a snapshot is a synchronous operation which blocks the event loop + * for a duration depending on the heap size. + * + * ```js + * import { writeHeapSnapshot } from 'node:v8'; + * import { + * Worker, + * isMainThread, + * parentPort, + * } from 'node:worker_threads'; + * + * if (isMainThread) { + * const worker = new Worker(__filename); + * + * worker.once('message', (filename) => { + * console.log(`worker heapdump: ${filename}`); + * // Now get a heapdump for the main thread. + * console.log(`main thread heapdump: ${writeHeapSnapshot()}`); + * }); + * + * // Tell the worker to create a heapdump. + * worker.postMessage('heapdump'); + * } else { + * parentPort.once('message', (message) => { + * if (message === 'heapdump') { + * // Generate a heapdump for the worker + * // and return the filename to the parent. + * parentPort.postMessage(writeHeapSnapshot()); + * } + * }); + * } + * ``` + * @since v11.13.0 + * @param filename The file path where the V8 heap snapshot is to be saved. If not specified, a file name with the pattern `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be + * generated, where `{pid}` will be the PID of the Node.js process, `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from the main Node.js thread or the id of a + * worker thread. + * @return The filename where the snapshot was saved. + */ + function writeHeapSnapshot(filename?: string, options?: HeapSnapshotOptions): string; + /** + * Get statistics about code and its metadata in the heap, see + * V8 [`GetHeapCodeAndMetadataStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#a6079122af17612ef54ef3348ce170866) API. Returns an object with the + * following properties: + * + * ```js + * { + * code_and_metadata_size: 212208, + * bytecode_and_metadata_size: 161368, + * external_script_source_size: 1410794, + * cpu_profiler_metadata_size: 0, + * } + * ``` + * @since v12.8.0 + */ + function getHeapCodeStatistics(): HeapCodeStatistics; + /** + * @since v25.0.0 + */ + interface SyncCPUProfileHandle { + /** + * Stopping collecting the profile and return the profile data. + * @since v25.0.0 + */ + stop(): string; + /** + * Stopping collecting the profile and the profile will be discarded. + * @since v25.0.0 + */ + [Symbol.dispose](): void; + } + /** + * @since v24.8.0 + */ + interface CPUProfileHandle { + /** + * Stopping collecting the profile, then return a Promise that fulfills with an error or the + * profile data. + * @since v24.8.0 + */ + stop(): Promise; + /** + * Stopping collecting the profile and the profile will be discarded. + * @since v24.8.0 + */ + [Symbol.asyncDispose](): Promise; + } + /** + * @since v24.9.0 + */ + interface HeapProfileHandle { + /** + * Stopping collecting the profile, then return a Promise that fulfills with an error or the + * profile data. + * @since v24.9.0 + */ + stop(): Promise; + /** + * Stopping collecting the profile and the profile will be discarded. + * @since v24.9.0 + */ + [Symbol.asyncDispose](): Promise; + } + /** + * Starting a CPU profile then return a `SyncCPUProfileHandle` object. + * This API supports `using` syntax. + * + * ```js + * const handle = v8.startCpuProfile(); + * const profile = handle.stop(); + * console.log(profile); + * ``` + * @since v25.0.0 + */ + function startCpuProfile(): SyncCPUProfileHandle; + /** + * V8 only supports `Latin-1/ISO-8859-1` and `UTF16` as the underlying representation of a string. + * If the `content` uses `Latin-1/ISO-8859-1` as the underlying representation, this function will return true; + * otherwise, it returns false. + * + * If this method returns false, that does not mean that the string contains some characters not in `Latin-1/ISO-8859-1`. + * Sometimes a `Latin-1` string may also be represented as `UTF16`. + * + * ```js + * const { isStringOneByteRepresentation } = require('node:v8'); + * + * const Encoding = { + * latin1: 1, + * utf16le: 2, + * }; + * const buffer = Buffer.alloc(100); + * function writeString(input) { + * if (isStringOneByteRepresentation(input)) { + * buffer.writeUint8(Encoding.latin1); + * buffer.writeUint32LE(input.length, 1); + * buffer.write(input, 5, 'latin1'); + * } else { + * buffer.writeUint8(Encoding.utf16le); + * buffer.writeUint32LE(input.length * 2, 1); + * buffer.write(input, 5, 'utf16le'); + * } + * } + * writeString('hello'); + * writeString('你好'); + * ``` + * @since v23.10.0, v22.15.0 + */ + function isStringOneByteRepresentation(content: string): boolean; + /** + * @since v8.0.0 + */ + class Serializer { + /** + * Writes out a header, which includes the serialization format version. + */ + writeHeader(): void; + /** + * Serializes a JavaScript value and adds the serialized representation to the + * internal buffer. + * + * This throws an error if `value` cannot be serialized. + */ + writeValue(val: any): boolean; + /** + * Returns the stored internal buffer. This serializer should not be used once + * the buffer is released. Calling this method results in undefined behavior + * if a previous write has failed. + */ + releaseBuffer(): NonSharedBuffer; + /** + * Marks an `ArrayBuffer` as having its contents transferred out of band. + * Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`. + * @param id A 32-bit unsigned integer. + * @param arrayBuffer An `ArrayBuffer` instance. + */ + transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; + /** + * Write a raw 32-bit unsigned integer. + * For use inside of a custom `serializer._writeHostObject()`. + */ + writeUint32(value: number): void; + /** + * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts. + * For use inside of a custom `serializer._writeHostObject()`. + */ + writeUint64(hi: number, lo: number): void; + /** + * Write a JS `number` value. + * For use inside of a custom `serializer._writeHostObject()`. + */ + writeDouble(value: number): void; + /** + * Write raw bytes into the serializer's internal buffer. The deserializer + * will require a way to compute the length of the buffer. + * For use inside of a custom `serializer._writeHostObject()`. + */ + writeRawBytes(buffer: NodeJS.ArrayBufferView): void; + } + /** + * A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only + * stores the part of their underlying `ArrayBuffer`s that they are referring to. + * @since v8.0.0 + */ + class DefaultSerializer extends Serializer {} + /** + * @since v8.0.0 + */ + class Deserializer { + constructor(data: NodeJS.TypedArray); + /** + * Reads and validates a header (including the format version). + * May, for example, reject an invalid or unsupported wire format. In that case, + * an `Error` is thrown. + */ + readHeader(): boolean; + /** + * Deserializes a JavaScript value from the buffer and returns it. + */ + readValue(): any; + /** + * Marks an `ArrayBuffer` as having its contents transferred out of band. + * Pass the corresponding `ArrayBuffer` in the serializing context to `serializer.transferArrayBuffer()` (or return the `id` from `serializer._getSharedArrayBufferId()` in the case of + * `SharedArrayBuffer`s). + * @param id A 32-bit unsigned integer. + * @param arrayBuffer An `ArrayBuffer` instance. + */ + transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; + /** + * Reads the underlying wire format version. Likely mostly to be useful to + * legacy code reading old wire format versions. May not be called before `.readHeader()`. + */ + getWireFormatVersion(): number; + /** + * Read a raw 32-bit unsigned integer and return it. + * For use inside of a custom `deserializer._readHostObject()`. + */ + readUint32(): number; + /** + * Read a raw 64-bit unsigned integer and return it as an array `[hi, lo]` with two 32-bit unsigned integer entries. + * For use inside of a custom `deserializer._readHostObject()`. + */ + readUint64(): [number, number]; + /** + * Read a JS `number` value. + * For use inside of a custom `deserializer._readHostObject()`. + */ + readDouble(): number; + /** + * Read raw bytes from the deserializer's internal buffer. The `length` parameter + * must correspond to the length of the buffer that was passed to `serializer.writeRawBytes()`. + * For use inside of a custom `deserializer._readHostObject()`. + */ + readRawBytes(length: number): Buffer; + } + /** + * A subclass of `Deserializer` corresponding to the format written by `DefaultSerializer`. + * @since v8.0.0 + */ + class DefaultDeserializer extends Deserializer {} + /** + * Uses a `DefaultSerializer` to serialize `value` into a buffer. + * + * `ERR_BUFFER_TOO_LARGE` will be thrown when trying to + * serialize a huge object which requires buffer + * larger than `buffer.constants.MAX_LENGTH`. + * @since v8.0.0 + */ + function serialize(value: any): NonSharedBuffer; + /** + * Uses a `DefaultDeserializer` with default options to read a JS value + * from a buffer. + * @since v8.0.0 + * @param buffer A buffer returned by {@link serialize}. + */ + function deserialize(buffer: NodeJS.ArrayBufferView): any; + /** + * The `v8.takeCoverage()` method allows the user to write the coverage started by `NODE_V8_COVERAGE` to disk on demand. This method can be invoked multiple + * times during the lifetime of the process. Each time the execution counter will + * be reset and a new coverage report will be written to the directory specified + * by `NODE_V8_COVERAGE`. + * + * When the process is about to exit, one last coverage will still be written to + * disk unless {@link stopCoverage} is invoked before the process exits. + * @since v15.1.0, v14.18.0, v12.22.0 + */ + function takeCoverage(): void; + /** + * The `v8.stopCoverage()` method allows the user to stop the coverage collection + * started by `NODE_V8_COVERAGE`, so that V8 can release the execution count + * records and optimize code. This can be used in conjunction with {@link takeCoverage} if the user wants to collect the coverage on demand. + * @since v15.1.0, v14.18.0, v12.22.0 + */ + function stopCoverage(): void; + /** + * The API is a no-op if `--heapsnapshot-near-heap-limit` is already set from the command line or the API is called more than once. + * `limit` must be a positive integer. See [`--heapsnapshot-near-heap-limit`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--heapsnapshot-near-heap-limitmax_count) for more information. + * @since v18.10.0, v16.18.0 + */ + function setHeapSnapshotNearHeapLimit(limit: number): void; + /** + * This API collects GC data in current thread. + * @since v19.6.0, v18.15.0 + */ + class GCProfiler { + /** + * Start collecting GC data. + * @since v19.6.0, v18.15.0 + */ + start(): void; + /** + * Stop collecting GC data and return an object. The content of object + * is as follows. + * + * ```json + * { + * "version": 1, + * "startTime": 1674059033862, + * "statistics": [ + * { + * "gcType": "Scavenge", + * "beforeGC": { + * "heapStatistics": { + * "totalHeapSize": 5005312, + * "totalHeapSizeExecutable": 524288, + * "totalPhysicalSize": 5226496, + * "totalAvailableSize": 4341325216, + * "totalGlobalHandlesSize": 8192, + * "usedGlobalHandlesSize": 2112, + * "usedHeapSize": 4883840, + * "heapSizeLimit": 4345298944, + * "mallocedMemory": 254128, + * "externalMemory": 225138, + * "peakMallocedMemory": 181760 + * }, + * "heapSpaceStatistics": [ + * { + * "spaceName": "read_only_space", + * "spaceSize": 0, + * "spaceUsedSize": 0, + * "spaceAvailableSize": 0, + * "physicalSpaceSize": 0 + * } + * ] + * }, + * "cost": 1574.14, + * "afterGC": { + * "heapStatistics": { + * "totalHeapSize": 6053888, + * "totalHeapSizeExecutable": 524288, + * "totalPhysicalSize": 5500928, + * "totalAvailableSize": 4341101384, + * "totalGlobalHandlesSize": 8192, + * "usedGlobalHandlesSize": 2112, + * "usedHeapSize": 4059096, + * "heapSizeLimit": 4345298944, + * "mallocedMemory": 254128, + * "externalMemory": 225138, + * "peakMallocedMemory": 181760 + * }, + * "heapSpaceStatistics": [ + * { + * "spaceName": "read_only_space", + * "spaceSize": 0, + * "spaceUsedSize": 0, + * "spaceAvailableSize": 0, + * "physicalSpaceSize": 0 + * } + * ] + * } + * } + * ], + * "endTime": 1674059036865 + * } + * ``` + * + * Here's an example. + * + * ```js + * import { GCProfiler } from 'node:v8'; + * const profiler = new GCProfiler(); + * profiler.start(); + * setTimeout(() => { + * console.log(profiler.stop()); + * }, 1000); + * ``` + * @since v19.6.0, v18.15.0 + */ + stop(): GCProfilerResult; + /** + * Stop collecting GC data, and discard the profile. + * @since v25.5.0 + */ + [Symbol.dispose](): void; + } + interface GCProfilerResult { + version: number; + startTime: number; + endTime: number; + statistics: Array<{ + gcType: string; + cost: number; + beforeGC: { + heapStatistics: HeapStatistics; + heapSpaceStatistics: HeapSpaceStatistics[]; + }; + afterGC: { + heapStatistics: HeapStatistics; + heapSpaceStatistics: HeapSpaceStatistics[]; + }; + }>; + } + interface HeapStatistics { + totalHeapSize: number; + totalHeapSizeExecutable: number; + totalPhysicalSize: number; + totalAvailableSize: number; + totalGlobalHandlesSize: number; + usedGlobalHandlesSize: number; + usedHeapSize: number; + heapSizeLimit: number; + mallocedMemory: number; + externalMemory: number; + peakMallocedMemory: number; + } + interface HeapSpaceStatistics { + spaceName: string; + spaceSize: number; + spaceUsedSize: number; + spaceAvailableSize: number; + physicalSpaceSize: number; + } + /** + * Called when a promise is constructed. This does not mean that corresponding before/after events will occur, only that the possibility exists. This will + * happen if a promise is created without ever getting a continuation. + * @since v17.1.0, v16.14.0 + * @param promise The promise being created. + * @param parent The promise continued from, if applicable. + */ + interface Init { + (promise: Promise, parent: Promise): void; + } + /** + * Called before a promise continuation executes. This can be in the form of `then()`, `catch()`, or `finally()` handlers or an await resuming. + * + * The before callback will be called 0 to N times. The before callback will typically be called 0 times if no continuation was ever made for the promise. + * The before callback may be called many times in the case where many continuations have been made from the same promise. + * @since v17.1.0, v16.14.0 + */ + interface Before { + (promise: Promise): void; + } + /** + * Called immediately after a promise continuation executes. This may be after a `then()`, `catch()`, or `finally()` handler or before an await after another await. + * @since v17.1.0, v16.14.0 + */ + interface After { + (promise: Promise): void; + } + /** + * Called when the promise receives a resolution or rejection value. This may occur synchronously in the case of {@link Promise.resolve()} or + * {@link Promise.reject()}. + * @since v17.1.0, v16.14.0 + */ + interface Settled { + (promise: Promise): void; + } + /** + * Key events in the lifetime of a promise have been categorized into four areas: creation of a promise, before/after a continuation handler is called or + * around an await, and when the promise resolves or rejects. + * + * Because promises are asynchronous resources whose lifecycle is tracked via the promise hooks mechanism, the `init()`, `before()`, `after()`, and + * `settled()` callbacks must not be async functions as they create more promises which would produce an infinite loop. + * @since v17.1.0, v16.14.0 + */ + interface HookCallbacks { + init?: Init; + before?: Before; + after?: After; + settled?: Settled; + } + interface PromiseHooks { + /** + * The `init` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. + * @since v17.1.0, v16.14.0 + * @param init The {@link Init | `init` callback} to call when a promise is created. + * @return Call to stop the hook. + */ + onInit: (init: Init) => Function; + /** + * The `settled` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. + * @since v17.1.0, v16.14.0 + * @param settled The {@link Settled | `settled` callback} to call when a promise is created. + * @return Call to stop the hook. + */ + onSettled: (settled: Settled) => Function; + /** + * The `before` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. + * @since v17.1.0, v16.14.0 + * @param before The {@link Before | `before` callback} to call before a promise continuation executes. + * @return Call to stop the hook. + */ + onBefore: (before: Before) => Function; + /** + * The `after` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. + * @since v17.1.0, v16.14.0 + * @param after The {@link After | `after` callback} to call after a promise continuation executes. + * @return Call to stop the hook. + */ + onAfter: (after: After) => Function; + /** + * Registers functions to be called for different lifetime events of each promise. + * The callbacks `init()`/`before()`/`after()`/`settled()` are called for the respective events during a promise's lifetime. + * All callbacks are optional. For example, if only promise creation needs to be tracked, then only the init callback needs to be passed. + * The hook callbacks must be plain functions. Providing async functions will throw as it would produce an infinite microtask loop. + * @since v17.1.0, v16.14.0 + * @param callbacks The {@link HookCallbacks | Hook Callbacks} to register + * @return Used for disabling hooks + */ + createHook: (callbacks: HookCallbacks) => Function; + } + /** + * The `promiseHooks` interface can be used to track promise lifecycle events. + * @since v17.1.0, v16.14.0 + */ + const promiseHooks: PromiseHooks; + type StartupSnapshotCallbackFn = (args: any) => any; + /** + * The `v8.startupSnapshot` interface can be used to add serialization and deserialization hooks for custom startup snapshots. + * + * ```bash + * $ node --snapshot-blob snapshot.blob --build-snapshot entry.js + * # This launches a process with the snapshot + * $ node --snapshot-blob snapshot.blob + * ``` + * + * In the example above, `entry.js` can use methods from the `v8.startupSnapshot` interface to specify how to save information for custom objects + * in the snapshot during serialization and how the information can be used to synchronize these objects during deserialization of the snapshot. + * For example, if the `entry.js` contains the following script: + * + * ```js + * 'use strict'; + * + * import fs from 'node:fs'; + * import zlib from 'node:zlib'; + * import path from 'node:path'; + * import assert from 'node:assert'; + * + * import v8 from 'node:v8'; + * + * class BookShelf { + * storage = new Map(); + * + * // Reading a series of files from directory and store them into storage. + * constructor(directory, books) { + * for (const book of books) { + * this.storage.set(book, fs.readFileSync(path.join(directory, book))); + * } + * } + * + * static compressAll(shelf) { + * for (const [ book, content ] of shelf.storage) { + * shelf.storage.set(book, zlib.gzipSync(content)); + * } + * } + * + * static decompressAll(shelf) { + * for (const [ book, content ] of shelf.storage) { + * shelf.storage.set(book, zlib.gunzipSync(content)); + * } + * } + * } + * + * // __dirname here is where the snapshot script is placed + * // during snapshot building time. + * const shelf = new BookShelf(__dirname, [ + * 'book1.en_US.txt', + * 'book1.es_ES.txt', + * 'book2.zh_CN.txt', + * ]); + * + * assert(v8.startupSnapshot.isBuildingSnapshot()); + * // On snapshot serialization, compress the books to reduce size. + * v8.startupSnapshot.addSerializeCallback(BookShelf.compressAll, shelf); + * // On snapshot deserialization, decompress the books. + * v8.startupSnapshot.addDeserializeCallback(BookShelf.decompressAll, shelf); + * v8.startupSnapshot.setDeserializeMainFunction((shelf) => { + * // process.env and process.argv are refreshed during snapshot + * // deserialization. + * const lang = process.env.BOOK_LANG || 'en_US'; + * const book = process.argv[1]; + * const name = `${book}.${lang}.txt`; + * console.log(shelf.storage.get(name)); + * }, shelf); + * ``` + * + * The resulted binary will get print the data deserialized from the snapshot during start up, using the refreshed `process.env` and `process.argv` of the launched process: + * + * ```bash + * $ BOOK_LANG=es_ES node --snapshot-blob snapshot.blob book1 + * # Prints content of book1.es_ES.txt deserialized from the snapshot. + * ``` + * + * Currently the application deserialized from a user-land snapshot cannot be snapshotted again, so these APIs are only available to applications that are not deserialized from a user-land snapshot. + * + * @since v18.6.0, v16.17.0 + */ + namespace startupSnapshot { + /** + * Add a callback that will be called when the Node.js instance is about to get serialized into a snapshot and exit. + * This can be used to release resources that should not or cannot be serialized or to convert user data into a form more suitable for serialization. + * @since v18.6.0, v16.17.0 + */ + function addSerializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void; + /** + * Add a callback that will be called when the Node.js instance is deserialized from a snapshot. + * The `callback` and the `data` (if provided) will be serialized into the snapshot, they can be used to re-initialize the state of the application or + * to re-acquire resources that the application needs when the application is restarted from the snapshot. + * @since v18.6.0, v16.17.0 + */ + function addDeserializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void; + /** + * This sets the entry point of the Node.js application when it is deserialized from a snapshot. This can be called only once in the snapshot building script. + * If called, the deserialized application no longer needs an additional entry point script to start up and will simply invoke the callback along with the deserialized + * data (if provided), otherwise an entry point script still needs to be provided to the deserialized application. + * @since v18.6.0, v16.17.0 + */ + function setDeserializeMainFunction(callback: StartupSnapshotCallbackFn, data?: any): void; + /** + * Returns true if the Node.js instance is run to build a snapshot. + * @since v18.6.0, v16.17.0 + */ + function isBuildingSnapshot(): boolean; + } +} +declare module "v8" { + export * from "node:v8"; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/vm.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/vm.d.ts new file mode 100644 index 0000000..d5e437e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/@types/node/vm.d.ts @@ -0,0 +1,1208 @@ +/** + * The `node:vm` module enables compiling and running code within V8 Virtual + * Machine contexts. + * + * **The `node:vm` module is not a security** + * **mechanism. Do not use it to run untrusted code.** + * + * JavaScript code can be compiled and run immediately or + * compiled, saved, and run later. + * + * A common use case is to run the code in a different V8 Context. This means + * invoked code has a different global object than the invoking code. + * + * One can provide the context by `contextifying` an + * object. The invoked code treats any property in the context like a + * global variable. Any changes to global variables caused by the invoked + * code are reflected in the context object. + * + * ```js + * import vm from 'node:vm'; + * + * const x = 1; + * + * const context = { x: 2 }; + * vm.createContext(context); // Contextify the object. + * + * const code = 'x += 40; var y = 17;'; + * // `x` and `y` are global variables in the context. + * // Initially, x has the value 2 because that is the value of context.x. + * vm.runInContext(code, context); + * + * console.log(context.x); // 42 + * console.log(context.y); // 17 + * + * console.log(x); // 1; y is not defined. + * ``` + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/vm.js) + */ +declare module "node:vm" { + import { NonSharedBuffer } from "node:buffer"; + import { ImportAttributes, ImportPhase } from "node:module"; + interface Context extends NodeJS.Dict {} + interface BaseOptions { + /** + * Specifies the filename used in stack traces produced by this script. + * @default '' + */ + filename?: string | undefined; + /** + * Specifies the line number offset that is displayed in stack traces produced by this script. + * @default 0 + */ + lineOffset?: number | undefined; + /** + * Specifies the column number offset that is displayed in stack traces produced by this script. + * @default 0 + */ + columnOffset?: number | undefined; + } + type DynamicModuleLoader = ( + specifier: string, + referrer: T, + importAttributes: ImportAttributes, + phase: ImportPhase, + ) => Module | Promise; + interface ScriptOptions extends BaseOptions { + /** + * Provides an optional data with V8's code cache data for the supplied source. + */ + cachedData?: NodeJS.ArrayBufferView | undefined; + /** @deprecated in favor of `script.createCachedData()` */ + produceCachedData?: boolean | undefined; + /** + * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is + * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see + * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v25.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). + * @experimental + */ + importModuleDynamically?: + | DynamicModuleLoader +``` + +- You can use tools such as [**Babel**](https://github.com/babel/babel) to increase the compatibility rate. + +### Create a new LRU Cache + +> Set maximum size when creating **LRU**. + +```ts +const LRU = createLRU({ max: 150_000 }); +``` + +Also, you can set a callback for every deletion/eviction: + +```ts +const LRU = createLRU({ + max: 150_000, + onEviction: (key, value) => { + // do something + }, +}); +``` + +### Set a cache + +Adds a key-value pair to the cache. Updates the value if the key already exists + +```ts +LRU.set('key', 'value'); +``` + +> `undefined` keys will simply be ignored. + +- Complexity: **O(1)**. + +### Get a cache + +Retrieves the value for a given key and moves the key to the most recent position. + +```ts +LRU.get('key'); +``` + +- Complexity: **O(1)**. + +### Peek a cache + +Retrieves the value for a given key without changing its position. + +```ts +LRU.peek('key'); +``` + +- Complexity: **O(1)**. + +### Check if a key exists + +```ts +LRU.has('key'); +``` + +- Complexity: **O(1)**. + +### Delete a cache + +```ts +LRU.delete('key'); +``` + +- Complexity: **O(1)**. + +### Evict from the oldest cache + +Evicts the specified number of the oldest items from the cache. + +```ts +LRU.evict(1000); +``` + +- Complexity: **O(key)** — even if passed a number greater than the number of items, only existing items will be evicted. + +> [!TIP] +> +> - Methods that perform eviction(s) when maximum size is reached: `set` and `resize`. +> - Methods that always perform eviction(s): `delete`, `clear`, and `evict` itself. + +### Resize the cache + +Resizes the cache to a new maximum size, evicting items if necessary. + +```ts +LRU.resize(50_000); +``` + +- Complexity: + - Increasing: **O(newMax - max)**. + - Downsizing: **O(n)**. + +### Clear the cache + +Clears and disposes (if used) all key-value pairs from the cache. + +```ts +LRU.clear(); +``` + +- Complexity: + - Without `onEviction`: **O(1)**. + - Using `onEviction`: **O(entries)**. + +### Debugging + +#### Get the max size of the cache + +```ts +LRU.max; +``` + +- Complexity: **O(1)**. + +#### Get the current size of the cache + +```ts +LRU.size; +``` + +- Complexity: **O(1)**. + +#### Get the available slots in the cache + +```ts +LRU.available; +``` + +- Complexity: **O(1)**. + +### Iterating the cache + +#### Get all keys + +Iterates over all keys in the cache, from most recent to least recent. + +```ts +const keys = [...LRU.keys()]; +``` + +- Complexity: **O(keys)**. + +#### Get all values + +Iterates over all values in the cache, from most recent to least recent. + +```ts +const values = [...LRU.values()]; +``` + +- Complexity: **O(values)**. + +#### Get all entries + +Iterates over `[key, value]` pairs in the cache, from most recent to least recent. + +```ts +const entries = [...LRU.entries()]; +``` + +- Complexity: **O(entries)**. + +#### Run a callback for each entry + +Iterates over each value-key pair in the cache, from most recent to least recent. + +```ts +LRU.forEach((value, key) => { + // do something +}); +``` + +- Complexity: **O(entries)**. + +--- + +> [!NOTE] +> +> - We use `O(keys)`, `O(values)`, `O(entries)`, and `O(newMax - max)` to explicitly indicate what is being iterated over. In traditional complexity notation, this would be represented as `O(n)`. + +--- + +### TypeScript + +You can set types for both keys and values. For example: + +```ts +import { createLRU } from 'lru.min'; + +type Key = number; + +type Value = { + name: string; +}; + +const LRU = createLRU({ max: 1000 }); + +LRU.set(1, { name: 'Peter' }); +LRU.set(2, { name: 'Mary' }); +``` + +Also: + +```ts +import { createLRU, type CacheOptions } from 'lru.min'; + +type Key = number; + +type Value = { + name: string; +}; + +const options: CacheOptions = { + max: 10, + onEviction(key, value) { + console.log(key, value); + }, +}; + +// No need to repeat the type params +const LRU = createLRU(options); + +LRU.set(1, { name: 'Peter' }); +LRU.set(2, { name: 'Mary' }); +``` + +--- + +### Performance + +The benchmark is performed by comparing `1,000,000` runs through a maximum cache limit of `100,000`, getting `333,333` caches and deleting `200,000` keys 10 consecutive times, clearing the cache every run. + +> - [**lru-cache**](https://github.com/isaacs/node-lru-cache) `v11.0.0` + +```sh +# Time: + lru.min: 240.45ms + lru-cache: 258.32ms + +# CPU: + lru.min: 275558.30µs + lru-cache: 306858.30µs +``` + +- See detailed results and how the tests are run and compared in the [**benchmark**](https://github.com/wellwelwel/lru.min/tree/main/benchmark) directory. + +--- + +## Security Policy + +[![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/wellwelwel/lru.min/ci_codeql.yml?event=push&label=&branch=main&logo=github&logoColor=white&color=f368e0)](https://github.com/wellwelwel/lru.min/actions/workflows/ci_codeql.yml?query=branch%3Amain) + +Please check the [**SECURITY.md**](https://github.com/wellwelwel/lru.min/blob/main/SECURITY.md). + +--- + +## Contributing + +See the [**Contributing Guide**](https://github.com/wellwelwel/lru.min/blob/main/CONTRIBUTING.md) and please follow our [**Code of Conduct**](https://github.com/wellwelwel/lru.min/blob/main/CODE_OF_CONDUCT.md) 🚀 + +--- + +## Acknowledgements + +- [![Contributors](https://img.shields.io/github/contributors/wellwelwel/lru.min?label=Contributors)](https://github.com/wellwelwel/lru.min/graphs/contributors) +- **lru.min** is inspired by [**lru-cache**](https://github.com/isaacs/node-lru-cache) architecture and [**quick-lru**](https://github.com/sindresorhus/quick-lru) usage, simplifying and improving their concepts for enhanced performance and compatibility. + +> [!IMPORTANT] +> +> No [**lru-cache**](https://github.com/isaacs/node-lru-cache) or [**quick-lru**](https://github.com/sindresorhus/quick-lru) code is used in **lru.min**. For more comprehensive features such as **TTL** support, consider using and supporting them 🤝 + +--- + +## License + +**lru.min** is under the [**MIT License**](https://github.com/wellwelwel/lru.min/blob/main/LICENSE).
+Copyright © 2024-present [Weslley Araújo](https://github.com/wellwelwel) and **lru.min** [contributors](https://github.com/wellwelwel/lru.min/graphs/contributors). diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/lru.min/browser/lru.min.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/lru.min/browser/lru.min.js new file mode 100644 index 0000000..5b767a7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/lru.min/browser/lru.min.js @@ -0,0 +1 @@ +"use strict";window.createLRU=function(e){var r=e.max;if(!(Number.isInteger(r)&&r>0))throw new TypeError("`max` must be a positive integer");var n=0,i=0,t=0,l=[],o=e.onEviction,a=new Map,f=new Array(r).fill(void 0),v=new Array(r).fill(void 0),u=new Array(r).fill(0),d=new Array(r).fill(0),c=function(e){u[t]=e,d[e]=t,u[e]=0,t=e},s=function(e){if(e!==t){var r=u[e],n=d[e];e===i?i=r:u[n]=r,d[r]=n,c(e)}};return{set:function(e,g){if(void 0!==e){var h=a.get(e);if(void 0===h){if(n===r){var w=f[h=i];null==o||o(w,v[h]),a.delete(w),i=u[h],d[i]=0}else h=l.length>0?l.pop():n,n++;a.set(e,h),f[h]=e,v[h]=g,1===n?i=t=h:c(h)}else null==o||o(e,v[h]),v[h]=g,s(h)}},get:function(e){var r=a.get(e);if(void 0!==r)return r!==t&&s(r),v[r]},peek:function(e){var r=a.get(e);return void 0!==r?v[r]:void 0},has:function(e){return a.has(e)},keys:function*(){for(var e=t,r=0;r0;){var c=i,s=f[c];null==o||o(s,v[c]),a.delete(s),f[c]=void 0,v[c]=void 0,i=u[c],d[i]=0,n--,l.push(c),r--}0===n&&(i=t=0)},clear:function(){if(o)for(var e=i,r=0;r0))throw new TypeError("`max` must be a positive integer");e!==r&&(e=0;p--)g[p]=f[r],h[p]=v[r],a.set(f[r],p),r=d[r];i=0,t=c-1,n=c,f.length=e,v.length=e,u.length=e,d.length=e;for(var m=0;m = { + /** Maximum number of items the cache can hold. */ + max: number; + /** Function called when an item is evicted from the cache. */ + onEviction?: (key: Key, value: Value) => unknown; +}; +export declare const createLRU: (options: CacheOptions) => { + /** Adds a key-value pair to the cache. Updates the value if the key already exists. */ + set(key: Key, value: Value): undefined; + /** Retrieves the value for a given key and moves the key to the most recent position. */ + get(key: Key): Value | undefined; + /** Retrieves the value for a given key without changing its position. */ + peek: (key: Key) => Value | undefined; + /** Checks if a key exists in the cache. */ + has: (key: Key) => boolean; + /** Iterates over all keys in the cache, from most recent to least recent. */ + keys(): IterableIterator; + /** Iterates over all values in the cache, from most recent to least recent. */ + values(): IterableIterator; + /** Iterates over `[key, value]` pairs in the cache, from most recent to least recent. */ + entries(): IterableIterator<[Key, Value]>; + /** Iterates over each value-key pair in the cache, from most recent to least recent. */ + forEach: (callback: (value: Value, key: Key) => unknown) => undefined; + /** Deletes a key-value pair from the cache. */ + delete(key: Key): boolean; + /** Evicts the oldest item or the specified number of the oldest items from the cache. */ + evict: (number: number) => undefined; + /** Clears all key-value pairs from the cache. */ + clear(): undefined; + /** Resizes the cache to a new maximum size, evicting items if necessary. */ + resize: (newMax: number) => undefined; + /** Returns the maximum number of items that can be stored in the cache. */ + readonly max: number; + /** Returns the number of items currently stored in the cache. */ + readonly size: number; + /** Returns the number of currently available slots in the cache before reaching the maximum size. */ + readonly available: number; +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/lru.min/lib/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/lru.min/lib/index.js new file mode 100644 index 0000000..6061c8d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/lru.min/lib/index.js @@ -0,0 +1,248 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createLRU = void 0; +const createLRU = (options) => { + let { max } = options; + if (!(Number.isInteger(max) && max > 0)) + throw new TypeError('`max` must be a positive integer'); + let size = 0; + let head = 0; + let tail = 0; + let free = []; + const { onEviction } = options; + const keyMap = new Map(); + const keyList = new Array(max).fill(undefined); + const valList = new Array(max).fill(undefined); + const next = new Array(max).fill(0); + const prev = new Array(max).fill(0); + const linkTail = (index) => { + next[tail] = index; + prev[index] = tail; + next[index] = 0; + tail = index; + }; + const moveToTail = (index) => { + if (index === tail) + return; + const nextIndex = next[index]; + const prevIndex = prev[index]; + if (index === head) + head = nextIndex; + else + next[prevIndex] = nextIndex; + prev[nextIndex] = prevIndex; + linkTail(index); + }; + const _shrink = (newMax) => { + let current = tail; + const preserve = Math.min(size, newMax); + const remove = size - preserve; + const newKeyList = new Array(preserve); + const newValList = new Array(preserve); + for (let i = 0; i < remove; i++) { + const key = keyList[head]; + onEviction === null || onEviction === void 0 ? void 0 : onEviction(key, valList[head]); + keyMap.delete(key); + head = next[head]; + } + for (let i = preserve - 1; i >= 0; i--) { + newKeyList[i] = keyList[current]; + newValList[i] = valList[current]; + keyMap.set(keyList[current], i); + current = prev[current]; + } + head = 0; + tail = preserve - 1; + size = preserve; + keyList.length = newMax; + valList.length = newMax; + next.length = newMax; + prev.length = newMax; + for (let i = 0; i < preserve; i++) { + keyList[i] = newKeyList[i]; + valList[i] = newValList[i]; + next[i] = i + 1; + prev[i] = i - 1; + } + free = []; + for (let i = preserve; i < newMax; i++) + free.push(i); + }; + const _grow = (newMax) => { + keyList.length = newMax; + valList.length = newMax; + next.length = newMax; + prev.length = newMax; + keyList.fill(undefined, max); + valList.fill(undefined, max); + next.fill(0, max); + prev.fill(0, max); + }; + return { + /** Adds a key-value pair to the cache. Updates the value if the key already exists. */ + set(key, value) { + if (key === undefined) + return; + let index = keyMap.get(key); + if (index === undefined) { + if (size === max) { + index = head; + const evictKey = keyList[index]; + onEviction === null || onEviction === void 0 ? void 0 : onEviction(evictKey, valList[index]); + keyMap.delete(evictKey); + head = next[index]; + prev[head] = 0; + } + else { + index = free.length > 0 ? free.pop() : size; + size++; + } + keyMap.set(key, index); + keyList[index] = key; + valList[index] = value; + if (size === 1) + head = tail = index; + else + linkTail(index); + } + else { + onEviction === null || onEviction === void 0 ? void 0 : onEviction(key, valList[index]); + valList[index] = value; + moveToTail(index); + } + }, + /** Retrieves the value for a given key and moves the key to the most recent position. */ + get(key) { + const index = keyMap.get(key); + if (index === undefined) + return; + if (index !== tail) + moveToTail(index); + return valList[index]; + }, + /** Retrieves the value for a given key without changing its position. */ + peek: (key) => { + const index = keyMap.get(key); + return index !== undefined ? valList[index] : undefined; + }, + /** Checks if a key exists in the cache. */ + has: (key) => keyMap.has(key), + /** Iterates over all keys in the cache, from most recent to least recent. */ + *keys() { + let current = tail; + for (let i = 0; i < size; i++) { + yield keyList[current]; + current = prev[current]; + } + }, + /** Iterates over all values in the cache, from most recent to least recent. */ + *values() { + let current = tail; + for (let i = 0; i < size; i++) { + yield valList[current]; + current = prev[current]; + } + }, + /** Iterates over `[key, value]` pairs in the cache, from most recent to least recent. */ + *entries() { + let current = tail; + for (let i = 0; i < size; i++) { + yield [keyList[current], valList[current]]; + current = prev[current]; + } + }, + /** Iterates over each value-key pair in the cache, from most recent to least recent. */ + forEach: (callback) => { + let current = tail; + for (let i = 0; i < size; i++) { + const key = keyList[current]; + const value = valList[current]; + callback(value, key); + current = prev[current]; + } + }, + /** Deletes a key-value pair from the cache. */ + delete(key) { + const index = keyMap.get(key); + if (index === undefined) + return false; + onEviction === null || onEviction === void 0 ? void 0 : onEviction(key, valList[index]); + keyMap.delete(key); + free.push(index); + keyList[index] = undefined; + valList[index] = undefined; + const prevIndex = prev[index]; + const nextIndex = next[index]; + if (index === head) + head = nextIndex; + else + next[prevIndex] = nextIndex; + if (index === tail) + tail = prevIndex; + else + prev[nextIndex] = prevIndex; + size--; + return true; + }, + /** Evicts the oldest item or the specified number of the oldest items from the cache. */ + evict: (number) => { + let toPrune = Math.min(number, size); + while (toPrune > 0) { + const evictHead = head; + const key = keyList[evictHead]; + onEviction === null || onEviction === void 0 ? void 0 : onEviction(key, valList[evictHead]); + keyMap.delete(key); + keyList[evictHead] = undefined; + valList[evictHead] = undefined; + head = next[evictHead]; + prev[head] = 0; + size--; + free.push(evictHead); + toPrune--; + } + if (size === 0) + head = tail = 0; + }, + /** Clears all key-value pairs from the cache. */ + clear() { + if (onEviction) { + let current = head; + for (let i = 0; i < size; i++) { + onEviction(keyList[current], valList[current]); + current = next[current]; + } + } + keyMap.clear(); + keyList.fill(undefined); + valList.fill(undefined); + free = []; + size = 0; + head = tail = 0; + }, + /** Resizes the cache to a new maximum size, evicting items if necessary. */ + resize: (newMax) => { + if (!(Number.isInteger(newMax) && newMax > 0)) + throw new TypeError('`max` must be a positive integer'); + if (newMax === max) + return; + if (newMax < max) + _shrink(newMax); + else + _grow(newMax); + max = newMax; + }, + /** Returns the maximum number of items that can be stored in the cache. */ + get max() { + return max; + }, + /** Returns the number of items currently stored in the cache. */ + get size() { + return size; + }, + /** Returns the number of currently available slots in the cache before reaching the maximum size. */ + get available() { + return max - size; + }, + }; +}; +exports.createLRU = createLRU; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/lru.min/lib/index.mjs b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/lru.min/lib/index.mjs new file mode 100644 index 0000000..fba4828 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/lru.min/lib/index.mjs @@ -0,0 +1,227 @@ +const createLRU = (options) => { + let { max } = options; + if (!(Number.isInteger(max) && max > 0)) + throw new TypeError("`max` must be a positive integer"); + let size = 0; + let head = 0; + let tail = 0; + let free = []; + const { onEviction } = options; + const keyMap = /* @__PURE__ */ new Map(); + const keyList = new Array(max).fill(void 0); + const valList = new Array(max).fill(void 0); + const next = new Array(max).fill(0); + const prev = new Array(max).fill(0); + const linkTail = (index) => { + next[tail] = index; + prev[index] = tail; + next[index] = 0; + tail = index; + }; + const moveToTail = (index) => { + if (index === tail) return; + const nextIndex = next[index]; + const prevIndex = prev[index]; + if (index === head) head = nextIndex; + else next[prevIndex] = nextIndex; + prev[nextIndex] = prevIndex; + linkTail(index); + }; + const _shrink = (newMax) => { + let current = tail; + const preserve = Math.min(size, newMax); + const remove = size - preserve; + const newKeyList = new Array(preserve); + const newValList = new Array(preserve); + for (let i = 0; i < remove; i++) { + const key = keyList[head]; + onEviction == null ? void 0 : onEviction(key, valList[head]); + keyMap.delete(key); + head = next[head]; + } + for (let i = preserve - 1; i >= 0; i--) { + newKeyList[i] = keyList[current]; + newValList[i] = valList[current]; + keyMap.set(keyList[current], i); + current = prev[current]; + } + head = 0; + tail = preserve - 1; + size = preserve; + keyList.length = newMax; + valList.length = newMax; + next.length = newMax; + prev.length = newMax; + for (let i = 0; i < preserve; i++) { + keyList[i] = newKeyList[i]; + valList[i] = newValList[i]; + next[i] = i + 1; + prev[i] = i - 1; + } + free = []; + for (let i = preserve; i < newMax; i++) free.push(i); + }; + const _grow = (newMax) => { + keyList.length = newMax; + valList.length = newMax; + next.length = newMax; + prev.length = newMax; + keyList.fill(void 0, max); + valList.fill(void 0, max); + next.fill(0, max); + prev.fill(0, max); + }; + return { + /** Adds a key-value pair to the cache. Updates the value if the key already exists. */ + set(key, value) { + if (key === void 0) return; + let index = keyMap.get(key); + if (index === void 0) { + if (size === max) { + index = head; + const evictKey = keyList[index]; + onEviction == null ? void 0 : onEviction(evictKey, valList[index]); + keyMap.delete(evictKey); + head = next[index]; + prev[head] = 0; + } else { + index = free.length > 0 ? free.pop() : size; + size++; + } + keyMap.set(key, index); + keyList[index] = key; + valList[index] = value; + if (size === 1) head = tail = index; + else linkTail(index); + } else { + onEviction == null ? void 0 : onEviction(key, valList[index]); + valList[index] = value; + moveToTail(index); + } + }, + /** Retrieves the value for a given key and moves the key to the most recent position. */ + get(key) { + const index = keyMap.get(key); + if (index === void 0) return; + if (index !== tail) moveToTail(index); + return valList[index]; + }, + /** Retrieves the value for a given key without changing its position. */ + peek: (key) => { + const index = keyMap.get(key); + return index !== void 0 ? valList[index] : void 0; + }, + /** Checks if a key exists in the cache. */ + has: (key) => keyMap.has(key), + /** Iterates over all keys in the cache, from most recent to least recent. */ + *keys() { + let current = tail; + for (let i = 0; i < size; i++) { + yield keyList[current]; + current = prev[current]; + } + }, + /** Iterates over all values in the cache, from most recent to least recent. */ + *values() { + let current = tail; + for (let i = 0; i < size; i++) { + yield valList[current]; + current = prev[current]; + } + }, + /** Iterates over `[key, value]` pairs in the cache, from most recent to least recent. */ + *entries() { + let current = tail; + for (let i = 0; i < size; i++) { + yield [keyList[current], valList[current]]; + current = prev[current]; + } + }, + /** Iterates over each value-key pair in the cache, from most recent to least recent. */ + forEach: (callback) => { + let current = tail; + for (let i = 0; i < size; i++) { + const key = keyList[current]; + const value = valList[current]; + callback(value, key); + current = prev[current]; + } + }, + /** Deletes a key-value pair from the cache. */ + delete(key) { + const index = keyMap.get(key); + if (index === void 0) return false; + onEviction == null ? void 0 : onEviction(key, valList[index]); + keyMap.delete(key); + free.push(index); + keyList[index] = void 0; + valList[index] = void 0; + const prevIndex = prev[index]; + const nextIndex = next[index]; + if (index === head) head = nextIndex; + else next[prevIndex] = nextIndex; + if (index === tail) tail = prevIndex; + else prev[nextIndex] = prevIndex; + size--; + return true; + }, + /** Evicts the oldest item or the specified number of the oldest items from the cache. */ + evict: (number) => { + let toPrune = Math.min(number, size); + while (toPrune > 0) { + const evictHead = head; + const key = keyList[evictHead]; + onEviction == null ? void 0 : onEviction(key, valList[evictHead]); + keyMap.delete(key); + keyList[evictHead] = void 0; + valList[evictHead] = void 0; + head = next[evictHead]; + prev[head] = 0; + size--; + free.push(evictHead); + toPrune--; + } + if (size === 0) head = tail = 0; + }, + /** Clears all key-value pairs from the cache. */ + clear() { + if (onEviction) { + let current = head; + for (let i = 0; i < size; i++) { + onEviction(keyList[current], valList[current]); + current = next[current]; + } + } + keyMap.clear(); + keyList.fill(void 0); + valList.fill(void 0); + free = []; + size = 0; + head = tail = 0; + }, + /** Resizes the cache to a new maximum size, evicting items if necessary. */ + resize: (newMax) => { + if (!(Number.isInteger(newMax) && newMax > 0)) + throw new TypeError("`max` must be a positive integer"); + if (newMax === max) return; + if (newMax < max) _shrink(newMax); + else _grow(newMax); + max = newMax; + }, + /** Returns the maximum number of items that can be stored in the cache. */ + get max() { + return max; + }, + /** Returns the number of items currently stored in the cache. */ + get size() { + return size; + }, + /** Returns the number of currently available slots in the cache before reaching the maximum size. */ + get available() { + return max - size; + } + }; +}; +export { + createLRU +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/lru.min/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/lru.min/package.json new file mode 100644 index 0000000..be48750 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/lru.min/package.json @@ -0,0 +1,87 @@ +{ + "name": "lru.min", + "version": "1.1.4", + "description": "🔥 An extremely fast and efficient LRU cache for JavaScript with high compatibility (including Browsers).", + "main": "./lib/index.js", + "module": "./lib/index.mjs", + "types": "./lib/index.d.ts", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/wellwelwel/lru.min.git" + }, + "bugs": { + "url": "https://github.com/wellwelwel/lru.min/issues" + }, + "author": "https://github.com/wellwelwel", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + }, + "files": [ + "browser", + "lib" + ], + "engines": { + "node": ">=8.0.0", + "bun": ">=1.0.0", + "deno": ">=1.30.0" + }, + "scripts": { + "benchmark:esm": "cd benchmark && npm ci && node index.mjs", + "benchmark:cjs": "cd benchmark && npm ci && node index.cjs", + "build:browser": "tsx tools/browserfy.ts", + "build:esm": "esbuild src/index.ts --outfile=lib/index.mjs --platform=node --target=node12 --format=esm", + "build": "rm -rf ./browser ./lib && tsc && npm run build:esm && npm run build:browser", + "test:node": "poku", + "test:bun": "bun poku", + "test:deno": "deno run -A npm:poku", + "test:coverage": "mcr --import tsx --config mcr.config.ts npm run test:node", + "lint": "npx @biomejs/biome lint && prettier --check .", + "lint:fix": "npx @biomejs/biome lint --write && prettier --write .github/workflows/*.yml .", + "update": "pu minor && npm i && (npm audit fix || true) && npm run lint:fix", + "size": "ls -lh lib/index.mjs | awk '{print $5}'" + }, + "devDependencies": { + "@babel/core": "^7.29.0", + "@babel/preset-env": "^7.29.0", + "@biomejs/biome": "^1.9.4", + "@types/babel__core": "^7.20.5", + "@types/node": "^24.10.9", + "esbuild": "^0.27.2", + "monocart-coverage-reports": "^2.12.9", + "packages-update": "^2.0.0", + "poku": "^3.0.3-canary.13a996a9", + "prettier": "^3.8.1", + "terser": "^5.46.0", + "tsx": "^4.21.0", + "typescript": "^5.9.3" + }, + "exports": { + ".": { + "import": { + "types": "./lib/index.d.ts", + "default": "./lib/index.mjs" + }, + "require": { + "types": "./lib/index.d.ts", + "default": "./lib/index.js" + } + } + }, + "keywords": [ + "lru", + "cache", + "caching", + "hash", + "node", + "nodejs", + "bun", + "deno", + "typescript", + "browser", + "fast", + "lru-cache", + "quick-lru" + ] +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/.eslintrc b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/.eslintrc new file mode 100644 index 0000000..d90a1bc --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/.eslintrc @@ -0,0 +1,16 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "eqeqeq": ["error", "allow-null"], + "id-length": "off", + "new-cap": ["error", { + "capIsNewExceptions": [ + "RequireObjectCoercible", + "ToObject", + ], + }], + }, +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/.github/FUNDING.yml b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/.github/FUNDING.yml new file mode 100644 index 0000000..868f4ff --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/math-intrinsics +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/CHANGELOG.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/CHANGELOG.md new file mode 100644 index 0000000..9cf48f5 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/CHANGELOG.md @@ -0,0 +1,24 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.0](https://github.com/es-shims/math-intrinsics/compare/v1.0.0...v1.1.0) - 2024-12-18 + +### Commits + +- [New] add `round` [`7cfb044`](https://github.com/es-shims/math-intrinsics/commit/7cfb04460c0fbdf1ca101eecbac3f59d11994130) +- [Tests] add attw [`e96be8f`](https://github.com/es-shims/math-intrinsics/commit/e96be8fbf58449eafe976446a0470e6ea561ad8d) +- [Dev Deps] update `@types/tape` [`30d0023`](https://github.com/es-shims/math-intrinsics/commit/30d00234ce8a3fa0094a61cd55d6686eb91e36ec) + +## v1.0.0 - 2024-12-11 + +### Commits + +- Initial implementation, tests, readme, types [`b898caa`](https://github.com/es-shims/math-intrinsics/commit/b898caae94e9994a94a42b8740f7bbcfd0a868fe) +- Initial commit [`02745b0`](https://github.com/es-shims/math-intrinsics/commit/02745b03a62255af8a332771987b55d127538d9c) +- [New] add `constants/maxArrayLength`, `mod` [`b978178`](https://github.com/es-shims/math-intrinsics/commit/b978178a57685bd23ed1c7efe2137f3784f5fcc5) +- npm init [`a39fc57`](https://github.com/es-shims/math-intrinsics/commit/a39fc57e5639a645d0bd52a0dc56202480223be2) +- Only apps should have lockfiles [`9451580`](https://github.com/es-shims/math-intrinsics/commit/94515800fb34db4f3cc7e99290042d45609ac7bd) diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/LICENSE new file mode 100644 index 0000000..34995e7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 ECMAScript Shims + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/README.md new file mode 100644 index 0000000..4a66dcf --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/README.md @@ -0,0 +1,50 @@ +# math-intrinsics [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +ES Math-related intrinsics and helpers, robustly cached. + + - `abs` + - `floor` + - `isFinite` + - `isInteger` + - `isNaN` + - `isNegativeZero` + - `max` + - `min` + - `mod` + - `pow` + - `round` + - `sign` + - `constants/maxArrayLength` + - `constants/maxSafeInteger` + - `constants/maxValue` + + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/math-intrinsics +[npm-version-svg]: https://versionbadg.es/es-shims/math-intrinsics.svg +[deps-svg]: https://david-dm.org/es-shims/math-intrinsics.svg +[deps-url]: https://david-dm.org/es-shims/math-intrinsics +[dev-deps-svg]: https://david-dm.org/es-shims/math-intrinsics/dev-status.svg +[dev-deps-url]: https://david-dm.org/es-shims/math-intrinsics#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/math-intrinsics.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/math-intrinsics.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-object.svg +[downloads-url]: https://npm-stat.com/charts.html?package=math-intrinsics +[codecov-image]: https://codecov.io/gh/es-shims/math-intrinsics/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/es-shims/math-intrinsics/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/math-intrinsics +[actions-url]: https://github.com/es-shims/math-intrinsics/actions diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/abs.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/abs.d.ts new file mode 100644 index 0000000..14ad9c6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/abs.d.ts @@ -0,0 +1 @@ +export = Math.abs; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/abs.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/abs.js new file mode 100644 index 0000000..a751424 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/abs.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./abs')} */ +module.exports = Math.abs; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxArrayLength.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxArrayLength.d.ts new file mode 100644 index 0000000..b92d46b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxArrayLength.d.ts @@ -0,0 +1,3 @@ +declare const MAX_ARRAY_LENGTH: 4294967295; + +export = MAX_ARRAY_LENGTH; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxArrayLength.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxArrayLength.js new file mode 100644 index 0000000..cfc6aff --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxArrayLength.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./maxArrayLength')} */ +module.exports = 4294967295; // Math.pow(2, 32) - 1; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts new file mode 100644 index 0000000..fee3f62 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts @@ -0,0 +1,3 @@ +declare const MAX_SAFE_INTEGER: 9007199254740991; + +export = MAX_SAFE_INTEGER; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxSafeInteger.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxSafeInteger.js new file mode 100644 index 0000000..b568ad3 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxSafeInteger.js @@ -0,0 +1,5 @@ +'use strict'; + +/** @type {import('./maxSafeInteger')} */ +// eslint-disable-next-line no-extra-parens +module.exports = /** @type {import('./maxSafeInteger')} */ (Number.MAX_SAFE_INTEGER) || 9007199254740991; // Math.pow(2, 53) - 1; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxValue.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxValue.d.ts new file mode 100644 index 0000000..292cb82 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxValue.d.ts @@ -0,0 +1,3 @@ +declare const MAX_VALUE: 1.7976931348623157e+308; + +export = MAX_VALUE; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxValue.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxValue.js new file mode 100644 index 0000000..a2202dc --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/constants/maxValue.js @@ -0,0 +1,5 @@ +'use strict'; + +/** @type {import('./maxValue')} */ +// eslint-disable-next-line no-extra-parens +module.exports = /** @type {import('./maxValue')} */ (Number.MAX_VALUE) || 1.7976931348623157e+308; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/floor.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/floor.d.ts new file mode 100644 index 0000000..9265236 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/floor.d.ts @@ -0,0 +1 @@ +export = Math.floor; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/floor.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/floor.js new file mode 100644 index 0000000..ab0e5d7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/floor.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./floor')} */ +module.exports = Math.floor; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isFinite.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isFinite.d.ts new file mode 100644 index 0000000..6daae33 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isFinite.d.ts @@ -0,0 +1,3 @@ +declare function isFinite(x: unknown): x is number | bigint; + +export = isFinite; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isFinite.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isFinite.js new file mode 100644 index 0000000..b201a5a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isFinite.js @@ -0,0 +1,12 @@ +'use strict'; + +var $isNaN = require('./isNaN'); + +/** @type {import('./isFinite')} */ +module.exports = function isFinite(x) { + return (typeof x === 'number' || typeof x === 'bigint') + && !$isNaN(x) + && x !== Infinity + && x !== -Infinity; +}; + diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isInteger.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isInteger.d.ts new file mode 100644 index 0000000..13935a8 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isInteger.d.ts @@ -0,0 +1,3 @@ +declare function isInteger(argument: unknown): argument is number; + +export = isInteger; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isInteger.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isInteger.js new file mode 100644 index 0000000..4b1b9a5 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isInteger.js @@ -0,0 +1,16 @@ +'use strict'; + +var $abs = require('./abs'); +var $floor = require('./floor'); + +var $isNaN = require('./isNaN'); +var $isFinite = require('./isFinite'); + +/** @type {import('./isInteger')} */ +module.exports = function isInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var absValue = $abs(argument); + return $floor(absValue) === absValue; +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isNaN.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isNaN.d.ts new file mode 100644 index 0000000..c1d4c55 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isNaN.d.ts @@ -0,0 +1 @@ +export = Number.isNaN; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isNaN.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isNaN.js new file mode 100644 index 0000000..e36475c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isNaN.js @@ -0,0 +1,6 @@ +'use strict'; + +/** @type {import('./isNaN')} */ +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isNegativeZero.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isNegativeZero.d.ts new file mode 100644 index 0000000..7ad8819 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isNegativeZero.d.ts @@ -0,0 +1,3 @@ +declare function isNegativeZero(x: unknown): boolean; + +export = isNegativeZero; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isNegativeZero.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isNegativeZero.js new file mode 100644 index 0000000..b69adcc --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/isNegativeZero.js @@ -0,0 +1,6 @@ +'use strict'; + +/** @type {import('./isNegativeZero')} */ +module.exports = function isNegativeZero(x) { + return x === 0 && 1 / x === 1 / -0; +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/max.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/max.d.ts new file mode 100644 index 0000000..ad6f43e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/max.d.ts @@ -0,0 +1 @@ +export = Math.max; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/max.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/max.js new file mode 100644 index 0000000..edb55df --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/max.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./max')} */ +module.exports = Math.max; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/min.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/min.d.ts new file mode 100644 index 0000000..fd90f2d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/min.d.ts @@ -0,0 +1 @@ +export = Math.min; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/min.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/min.js new file mode 100644 index 0000000..5a4a7c7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/min.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./min')} */ +module.exports = Math.min; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/mod.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/mod.d.ts new file mode 100644 index 0000000..549dbd4 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/mod.d.ts @@ -0,0 +1,3 @@ +declare function mod(number: number, modulo: number): number; + +export = mod; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/mod.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/mod.js new file mode 100644 index 0000000..4a98362 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/mod.js @@ -0,0 +1,9 @@ +'use strict'; + +var $floor = require('./floor'); + +/** @type {import('./mod')} */ +module.exports = function mod(number, modulo) { + var remain = number % modulo; + return $floor(remain >= 0 ? remain : remain + modulo); +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/package.json new file mode 100644 index 0000000..0676273 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/package.json @@ -0,0 +1,86 @@ +{ + "name": "math-intrinsics", + "version": "1.1.0", + "description": "ES Math-related intrinsics and helpers, robustly cached.", + "main": false, + "exports": { + "./abs": "./abs.js", + "./floor": "./floor.js", + "./isFinite": "./isFinite.js", + "./isInteger": "./isInteger.js", + "./isNaN": "./isNaN.js", + "./isNegativeZero": "./isNegativeZero.js", + "./max": "./max.js", + "./min": "./min.js", + "./mod": "./mod.js", + "./pow": "./pow.js", + "./sign": "./sign.js", + "./round": "./round.js", + "./constants/maxArrayLength": "./constants/maxArrayLength.js", + "./constants/maxSafeInteger": "./constants/maxSafeInteger.js", + "./constants/maxValue": "./constants/maxValue.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/**/*.js'", + "posttest": "npx npm@'>= 10.2' audit --production", + "prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc && attw -P", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/es-shims/math-intrinsics.git" + }, + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/es-shims/math-intrinsics/issues" + }, + "homepage": "https://github.com/es-shims/math-intrinsics#readme", + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/for-each": "^0.3.3", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.8.0", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "es-value-fixtures": "^1.5.0", + "eslint": "^8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.3", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/pow.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/pow.d.ts new file mode 100644 index 0000000..5873c44 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/pow.d.ts @@ -0,0 +1 @@ +export = Math.pow; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/pow.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/pow.js new file mode 100644 index 0000000..c0a4103 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/pow.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./pow')} */ +module.exports = Math.pow; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/round.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/round.d.ts new file mode 100644 index 0000000..da1fde3 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/round.d.ts @@ -0,0 +1 @@ +export = Math.round; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/round.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/round.js new file mode 100644 index 0000000..b792156 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/round.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./round')} */ +module.exports = Math.round; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/sign.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/sign.d.ts new file mode 100644 index 0000000..c49ceca --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/sign.d.ts @@ -0,0 +1,3 @@ +declare function sign(x: number): number; + +export = sign; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/sign.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/sign.js new file mode 100644 index 0000000..9e5173c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/sign.js @@ -0,0 +1,11 @@ +'use strict'; + +var $isNaN = require('./isNaN'); + +/** @type {import('./sign')} */ +module.exports = function sign(number) { + if ($isNaN(number) || number === 0) { + return number; + } + return number < 0 ? -1 : +1; +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/test/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/test/index.js new file mode 100644 index 0000000..0f90a5d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/test/index.js @@ -0,0 +1,192 @@ +'use strict'; + +var test = require('tape'); +var v = require('es-value-fixtures'); +var forEach = require('for-each'); +var inspect = require('object-inspect'); + +var abs = require('../abs'); +var floor = require('../floor'); +var isFinite = require('../isFinite'); +var isInteger = require('../isInteger'); +var isNaN = require('../isNaN'); +var isNegativeZero = require('../isNegativeZero'); +var max = require('../max'); +var min = require('../min'); +var mod = require('../mod'); +var pow = require('../pow'); +var round = require('../round'); +var sign = require('../sign'); + +var maxArrayLength = require('../constants/maxArrayLength'); +var maxSafeInteger = require('../constants/maxSafeInteger'); +var maxValue = require('../constants/maxValue'); + +test('abs', function (t) { + t.equal(abs(-1), 1, 'abs(-1) === 1'); + t.equal(abs(+1), 1, 'abs(+1) === 1'); + t.equal(abs(+0), +0, 'abs(+0) === +0'); + t.equal(abs(-0), +0, 'abs(-0) === +0'); + + t.end(); +}); + +test('floor', function (t) { + t.equal(floor(-1.1), -2, 'floor(-1.1) === -2'); + t.equal(floor(+1.1), 1, 'floor(+1.1) === 1'); + t.equal(floor(+0), +0, 'floor(+0) === +0'); + t.equal(floor(-0), -0, 'floor(-0) === -0'); + t.equal(floor(-Infinity), -Infinity, 'floor(-Infinity) === -Infinity'); + t.equal(floor(Number(Infinity)), Number(Infinity), 'floor(+Infinity) === +Infinity'); + t.equal(floor(NaN), NaN, 'floor(NaN) === NaN'); + t.equal(floor(0), +0, 'floor(0) === +0'); + t.equal(floor(-0), -0, 'floor(-0) === -0'); + t.equal(floor(1), 1, 'floor(1) === 1'); + t.equal(floor(-1), -1, 'floor(-1) === -1'); + t.equal(floor(1.1), 1, 'floor(1.1) === 1'); + t.equal(floor(-1.1), -2, 'floor(-1.1) === -2'); + t.equal(floor(maxValue), maxValue, 'floor(maxValue) === maxValue'); + t.equal(floor(maxSafeInteger), maxSafeInteger, 'floor(maxSafeInteger) === maxSafeInteger'); + + t.end(); +}); + +test('isFinite', function (t) { + t.equal(isFinite(0), true, 'isFinite(+0) === true'); + t.equal(isFinite(-0), true, 'isFinite(-0) === true'); + t.equal(isFinite(1), true, 'isFinite(1) === true'); + t.equal(isFinite(Infinity), false, 'isFinite(Infinity) === false'); + t.equal(isFinite(-Infinity), false, 'isFinite(-Infinity) === false'); + t.equal(isFinite(NaN), false, 'isFinite(NaN) === false'); + + forEach(v.nonNumbers, function (nonNumber) { + t.equal(isFinite(nonNumber), false, 'isFinite(' + inspect(nonNumber) + ') === false'); + }); + + t.end(); +}); + +test('isInteger', function (t) { + forEach([].concat( + // @ts-expect-error TS sucks with concat + v.nonNumbers, + v.nonIntegerNumbers + ), function (nonInteger) { + t.equal(isInteger(nonInteger), false, 'isInteger(' + inspect(nonInteger) + ') === false'); + }); + + t.end(); +}); + +test('isNaN', function (t) { + forEach([].concat( + // @ts-expect-error TS sucks with concat + v.nonNumbers, + v.infinities, + v.zeroes, + v.integerNumbers + ), function (nonNaN) { + t.equal(isNaN(nonNaN), false, 'isNaN(' + inspect(nonNaN) + ') === false'); + }); + + t.equal(isNaN(NaN), true, 'isNaN(NaN) === true'); + + t.end(); +}); + +test('isNegativeZero', function (t) { + t.equal(isNegativeZero(-0), true, 'isNegativeZero(-0) === true'); + t.equal(isNegativeZero(+0), false, 'isNegativeZero(+0) === false'); + t.equal(isNegativeZero(1), false, 'isNegativeZero(1) === false'); + t.equal(isNegativeZero(-1), false, 'isNegativeZero(-1) === false'); + t.equal(isNegativeZero(NaN), false, 'isNegativeZero(NaN) === false'); + t.equal(isNegativeZero(Infinity), false, 'isNegativeZero(Infinity) === false'); + t.equal(isNegativeZero(-Infinity), false, 'isNegativeZero(-Infinity) === false'); + + forEach(v.nonNumbers, function (nonNumber) { + t.equal(isNegativeZero(nonNumber), false, 'isNegativeZero(' + inspect(nonNumber) + ') === false'); + }); + + t.end(); +}); + +test('max', function (t) { + t.equal(max(1, 2), 2, 'max(1, 2) === 2'); + t.equal(max(1, 2, 3), 3, 'max(1, 2, 3) === 3'); + t.equal(max(1, 2, 3, 4), 4, 'max(1, 2, 3, 4) === 4'); + t.equal(max(1, 2, 3, 4, 5), 5, 'max(1, 2, 3, 4, 5) === 5'); + t.equal(max(1, 2, 3, 4, 5, 6), 6, 'max(1, 2, 3, 4, 5, 6) === 6'); + t.equal(max(1, 2, 3, 4, 5, 6, 7), 7, 'max(1, 2, 3, 4, 5, 6, 7) === 7'); + + t.end(); +}); + +test('min', function (t) { + t.equal(min(1, 2), 1, 'min(1, 2) === 1'); + t.equal(min(1, 2, 3), 1, 'min(1, 2, 3) === 1'); + t.equal(min(1, 2, 3, 4), 1, 'min(1, 2, 3, 4) === 1'); + t.equal(min(1, 2, 3, 4, 5), 1, 'min(1, 2, 3, 4, 5) === 1'); + t.equal(min(1, 2, 3, 4, 5, 6), 1, 'min(1, 2, 3, 4, 5, 6) === 1'); + + t.end(); +}); + +test('mod', function (t) { + t.equal(mod(1, 2), 1, 'mod(1, 2) === 1'); + t.equal(mod(2, 2), 0, 'mod(2, 2) === 0'); + t.equal(mod(3, 2), 1, 'mod(3, 2) === 1'); + t.equal(mod(4, 2), 0, 'mod(4, 2) === 0'); + t.equal(mod(5, 2), 1, 'mod(5, 2) === 1'); + t.equal(mod(6, 2), 0, 'mod(6, 2) === 0'); + t.equal(mod(7, 2), 1, 'mod(7, 2) === 1'); + t.equal(mod(8, 2), 0, 'mod(8, 2) === 0'); + t.equal(mod(9, 2), 1, 'mod(9, 2) === 1'); + t.equal(mod(10, 2), 0, 'mod(10, 2) === 0'); + t.equal(mod(11, 2), 1, 'mod(11, 2) === 1'); + + t.end(); +}); + +test('pow', function (t) { + t.equal(pow(2, 2), 4, 'pow(2, 2) === 4'); + t.equal(pow(2, 3), 8, 'pow(2, 3) === 8'); + t.equal(pow(2, 4), 16, 'pow(2, 4) === 16'); + t.equal(pow(2, 5), 32, 'pow(2, 5) === 32'); + t.equal(pow(2, 6), 64, 'pow(2, 6) === 64'); + t.equal(pow(2, 7), 128, 'pow(2, 7) === 128'); + t.equal(pow(2, 8), 256, 'pow(2, 8) === 256'); + t.equal(pow(2, 9), 512, 'pow(2, 9) === 512'); + t.equal(pow(2, 10), 1024, 'pow(2, 10) === 1024'); + + t.end(); +}); + +test('round', function (t) { + t.equal(round(1.1), 1, 'round(1.1) === 1'); + t.equal(round(1.5), 2, 'round(1.5) === 2'); + t.equal(round(1.9), 2, 'round(1.9) === 2'); + + t.end(); +}); + +test('sign', function (t) { + t.equal(sign(-1), -1, 'sign(-1) === -1'); + t.equal(sign(+1), +1, 'sign(+1) === +1'); + t.equal(sign(+0), +0, 'sign(+0) === +0'); + t.equal(sign(-0), -0, 'sign(-0) === -0'); + t.equal(sign(NaN), NaN, 'sign(NaN) === NaN'); + t.equal(sign(Infinity), +1, 'sign(Infinity) === +1'); + t.equal(sign(-Infinity), -1, 'sign(-Infinity) === -1'); + t.equal(sign(maxValue), +1, 'sign(maxValue) === +1'); + t.equal(sign(maxSafeInteger), +1, 'sign(maxSafeInteger) === +1'); + + t.end(); +}); + +test('constants', function (t) { + t.equal(typeof maxArrayLength, 'number', 'typeof maxArrayLength === "number"'); + t.equal(typeof maxSafeInteger, 'number', 'typeof maxSafeInteger === "number"'); + t.equal(typeof maxValue, 'number', 'typeof maxValue === "number"'); + + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/tsconfig.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/tsconfig.json new file mode 100644 index 0000000..b131000 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/math-intrinsics/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "@ljharb/tsconfig", +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/media-typer/HISTORY.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/media-typer/HISTORY.md new file mode 100644 index 0000000..538ade1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/media-typer/HISTORY.md @@ -0,0 +1,50 @@ +1.1.0 / 2019-04-24 +================== + + * Add `test(string)` function + +1.0.2 / 2019-04-19 +================== + + * Fix JSDoc comment for `parse` function + +1.0.1 / 2018-10-20 +================== + + * Remove left over `parameters` property from class + +1.0.0 / 2018-10-20 +================== + +This major release brings the module back to it's RFC 6838 roots. If you want +a module to parse the `Content-Type` or similar HTTP headers, use the +`content-type` module instead. + + * Drop support for Node.js below 0.8 + * Remove parameter handling, which is outside RFC 6838 scope + * Remove `parse(req)` and `parse(res)` signatures + * perf: enable strict mode + * perf: use a class for object creation + +0.3.0 / 2014-09-07 +================== + + * Support Node.js 0.6 + * Throw error when parameter format invalid on parse + +0.2.0 / 2014-06-18 +================== + + * Add `typer.format()` to format media types + +0.1.0 / 2014-06-17 +================== + + * Accept `req` as argument to `parse` + * Accept `res` as argument to `parse` + * Parse media type with extra LWS between type and first parameter + +0.0.0 / 2014-06-13 +================== + + * Initial implementation diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/media-typer/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/media-typer/LICENSE new file mode 100644 index 0000000..84441fb --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/media-typer/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/media-typer/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/media-typer/README.md new file mode 100644 index 0000000..37edad1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/media-typer/README.md @@ -0,0 +1,93 @@ +# media-typer + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Simple RFC 6838 media type parser. + +This module will parse a given media type into it's component parts, like type, +subtype, and suffix. A formatter is also provided to put them back together and +the two can be combined to normalize media types into a canonical form. + +If you are looking to parse the string that represents a media type and it's +parameters in HTTP (for example, the `Content-Type` header), use the +[content-type module](https://www.npmjs.com/package/content-type). + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install media-typer +``` + +## API + + + +```js +var typer = require('media-typer') +``` + +### typer.parse(string) + + + +```js +var obj = typer.parse('image/svg+xml') +``` + +Parse a media type string. This will return an object with the following +properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`): + + - `type`: The type of the media type (always lower case). Example: `'image'` + + - `subtype`: The subtype of the media type (always lower case). Example: `'svg'` + + - `suffix`: The suffix of the media type (always lower case). Example: `'xml'` + +If the given type string is invalid, then a `TypeError` is thrown. + +### typer.format(obj) + + + +```js +var obj = typer.format({ type: 'image', subtype: 'svg', suffix: 'xml' }) +``` + +Format an object into a media type string. This will return a string of the +mime type for the given object. For the properties of the object, see the +documentation for `typer.parse(string)`. + +If any of the given object values are invalid, then a `TypeError` is thrown. + +### typer.test(string) + + + +```js +var valid = typer.test('image/svg+xml') +``` + +Validate a media type string. This will return `true` is the string is a well- +formatted media type, or `false` otherwise. + +## License + +[MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/media-typer/master +[coveralls-url]: https://coveralls.io/r/jshttp/media-typer?branch=master +[node-version-image]: https://badgen.net/npm/node/media-typer +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/media-typer +[npm-url]: https://npmjs.org/package/media-typer +[npm-version-image]: https://badgen.net/npm/v/media-typer +[travis-image]: https://badgen.net/travis/jshttp/media-typer/master +[travis-url]: https://travis-ci.org/jshttp/media-typer diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/media-typer/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/media-typer/index.js new file mode 100644 index 0000000..897cae1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/media-typer/index.js @@ -0,0 +1,143 @@ +/*! + * media-typer + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * RegExp to match type in RFC 6838 + * + * type-name = restricted-name + * subtype-name = restricted-name + * restricted-name = restricted-name-first *126restricted-name-chars + * restricted-name-first = ALPHA / DIGIT + * restricted-name-chars = ALPHA / DIGIT / "!" / "#" / + * "$" / "&" / "-" / "^" / "_" + * restricted-name-chars =/ "." ; Characters before first dot always + * ; specify a facet name + * restricted-name-chars =/ "+" ; Characters after last plus always + * ; specify a structured syntax suffix + * ALPHA = %x41-5A / %x61-7A ; A-Z / a-z + * DIGIT = %x30-39 ; 0-9 + */ +var SUBTYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/ +var TYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/ +var TYPE_REGEXP = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/ + +/** + * Module exports. + */ + +exports.format = format +exports.parse = parse +exports.test = test + +/** + * Format object to media type. + * + * @param {object} obj + * @return {string} + * @public + */ + +function format (obj) { + if (!obj || typeof obj !== 'object') { + throw new TypeError('argument obj is required') + } + + var subtype = obj.subtype + var suffix = obj.suffix + var type = obj.type + + if (!type || !TYPE_NAME_REGEXP.test(type)) { + throw new TypeError('invalid type') + } + + if (!subtype || !SUBTYPE_NAME_REGEXP.test(subtype)) { + throw new TypeError('invalid subtype') + } + + // format as type/subtype + var string = type + '/' + subtype + + // append +suffix + if (suffix) { + if (!TYPE_NAME_REGEXP.test(suffix)) { + throw new TypeError('invalid suffix') + } + + string += '+' + suffix + } + + return string +} + +/** + * Test media type. + * + * @param {string} string + * @return {object} + * @public + */ + +function test (string) { + if (!string) { + throw new TypeError('argument string is required') + } + + if (typeof string !== 'string') { + throw new TypeError('argument string is required to be a string') + } + + return TYPE_REGEXP.test(string.toLowerCase()) +} + +/** + * Parse media type to object. + * + * @param {string} string + * @return {object} + * @public + */ + +function parse (string) { + if (!string) { + throw new TypeError('argument string is required') + } + + if (typeof string !== 'string') { + throw new TypeError('argument string is required to be a string') + } + + var match = TYPE_REGEXP.exec(string.toLowerCase()) + + if (!match) { + throw new TypeError('invalid media type') + } + + var type = match[1] + var subtype = match[2] + var suffix + + // suffix after last + + var index = subtype.lastIndexOf('+') + if (index !== -1) { + suffix = subtype.substr(index + 1) + subtype = subtype.substr(0, index) + } + + return new MediaType(type, subtype, suffix) +} + +/** + * Class for MediaType object. + * @public + */ + +function MediaType (type, subtype, suffix) { + this.type = type + this.subtype = subtype + this.suffix = suffix +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/media-typer/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/media-typer/package.json new file mode 100644 index 0000000..1dca712 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/media-typer/package.json @@ -0,0 +1,33 @@ +{ + "name": "media-typer", + "description": "Simple RFC 6838 media type parser and formatter", + "version": "1.1.0", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "jshttp/media-typer", + "devDependencies": { + "eslint": "5.16.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.17.2", + "eslint-plugin-markdown": "1.0.0", + "eslint-plugin-node": "8.0.1", + "eslint-plugin-promise": "4.1.1", + "eslint-plugin-standard": "4.0.0", + "mocha": "6.1.4", + "nyc": "14.0.0" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-travis": "nyc --reporter=text npm test" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/merge-descriptors/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/merge-descriptors/index.d.ts new file mode 100644 index 0000000..df8f91f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/merge-descriptors/index.d.ts @@ -0,0 +1,11 @@ +/** +Merges "own" properties from a source to a destination object, including non-enumerable and accessor-defined properties. It retains original values and descriptors, ensuring the destination receives a complete and accurate copy of the source's properties. + +@param destination - The object to receive properties. +@param source - The object providing properties. +@param overwrite - Optional boolean to control overwriting of existing properties. Defaults to true. +@returns The modified destination object. +*/ +declare function mergeDescriptors(destination: T, source: U, overwrite?: boolean): T & U; + +export = mergeDescriptors; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/merge-descriptors/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/merge-descriptors/index.js new file mode 100644 index 0000000..51228e5 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/merge-descriptors/index.js @@ -0,0 +1,26 @@ +'use strict'; + +function mergeDescriptors(destination, source, overwrite = true) { + if (!destination) { + throw new TypeError('The `destination` argument is required.'); + } + + if (!source) { + throw new TypeError('The `source` argument is required.'); + } + + for (const name of Object.getOwnPropertyNames(source)) { + if (!overwrite && Object.hasOwn(destination, name)) { + // Skip descriptor + continue; + } + + // Copy descriptor + const descriptor = Object.getOwnPropertyDescriptor(source, name); + Object.defineProperty(destination, name, descriptor); + } + + return destination; +} + +module.exports = mergeDescriptors; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/merge-descriptors/license b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/merge-descriptors/license new file mode 100644 index 0000000..c509d45 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/merge-descriptors/license @@ -0,0 +1,11 @@ +MIT License + +Copyright (c) Jonathan Ong +Copyright (c) Douglas Christopher Wilson +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/merge-descriptors/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/merge-descriptors/package.json new file mode 100644 index 0000000..9bedb25 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/merge-descriptors/package.json @@ -0,0 +1,50 @@ +{ + "name": "merge-descriptors", + "version": "2.0.0", + "description": "Merge objects using their property descriptors", + "license": "MIT", + "repository": "sindresorhus/merge-descriptors", + "funding": "https://github.com/sponsors/sindresorhus", + "contributors": [ + "Jonathan Ong ", + "Douglas Christopher Wilson ", + "Mike Grabowski ", + "Sindre Sorhus " + ], + "exports": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "main": "./index.js", + "types": "./index.d.ts", + "sideEffects": false, + "engines": { + "node": ">=18" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "merge", + "descriptors", + "object", + "property", + "properties", + "merging", + "getter", + "setter" + ], + "devDependencies": { + "ava": "^5.3.1", + "xo": "^0.56.0" + }, + "xo": { + "rules": { + "unicorn/prefer-module": "off" + } + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/merge-descriptors/readme.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/merge-descriptors/readme.md new file mode 100644 index 0000000..1dee67d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/merge-descriptors/readme.md @@ -0,0 +1,55 @@ +# merge-descriptors + +> Merge objects using their property descriptors + +## Install + +```sh +npm install merge-descriptors +``` + +## Usage + +```js +import mergeDescriptors from 'merge-descriptors'; + +const thing = { + get name() { + return 'John' + } +} + +const animal = {}; + +mergeDescriptors(animal, thing); + +console.log(animal.name); +//=> 'John' +``` + +## API + +### merge(destination, source, overwrite?) + +Merges "own" properties from a source to a destination object, including non-enumerable and accessor-defined properties. It retains original values and descriptors, ensuring the destination receives a complete and accurate copy of the source's properties. + +Returns the modified destination object. + +#### destination + +Type: `object` + +The object to receive properties. + +#### source + +Type: `object` + +The object providing properties. + +#### overwrite + +Type: `boolean`\ +Default: `true` + +A boolean to control overwriting of existing properties. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/HISTORY.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/HISTORY.md new file mode 100644 index 0000000..fb35bec --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/HISTORY.md @@ -0,0 +1,541 @@ +1.54.0 / 2025-03-17 +=================== + + * Update mime type for DCM format (#362) + * mark application/octet-stream as compressible (#163) + * Fix typo in application/x-zip-compressed mimetype (#359) + * Add mime-type for Jupyter notebooks (#282) + * Add Google Drive MIME types (#311) + * Add .blend file type (#338) + * Add support for the FBX file extension (#342) + * Add Adobe DNG file (#340) + * Add Procreate Brush and Brush Set file Types (#339) + * Add support for Procreate Dreams (#341) + * replace got with undici (#352) + * Added extensions list for model/step (#293) + * Add m4b as a type of audio/mp4 (#357) + * windows 11 application/x-zip-compressed (#346) + * add dotLottie mime type (#351) + * Add some MS-related extensions and types (#336) + +1.53.0 / 2024-07-12 +=================== + + * Add extension `.sql` to `application/sql` + * Add extensions `.aac` and `.adts` to `audio/aac` + * Add extensions `.js` and `.mjs` to `text/javascript` + * Add extensions for `application/mp4` from IANA + * Add extensions from IANA for more MIME types + * Add Microsoft app installer types and extensions + * Add new upstream MIME types + * Fix extensions for `text/markdown` to match IANA + * Remove extension `.mjs` from `application/javascript` + * Remove obsolete MIME types from IANA data + +1.52.0 / 2022-02-21 +=================== + + * Add extensions from IANA for more `image/*` types + * Add extension `.asc` to `application/pgp-keys` + * Add extensions to various XML types + * Add new upstream MIME types + +1.51.0 / 2021-11-08 +=================== + + * Add new upstream MIME types + * Mark `image/vnd.microsoft.icon` as compressible + * Mark `image/vnd.ms-dds` as compressible + +1.50.0 / 2021-09-15 +=================== + + * Add deprecated iWorks mime types and extensions + * Add new upstream MIME types + +1.49.0 / 2021-07-26 +=================== + + * Add extension `.trig` to `application/trig` + * Add new upstream MIME types + +1.48.0 / 2021-05-30 +=================== + + * Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + * Add new upstream MIME types + * Mark `text/yaml` as compressible + +1.47.0 / 2021-04-01 +=================== + + * Add new upstream MIME types + * Remove ambiguous extensions from IANA for `application/*+xml` types + * Update primary extension to `.es` for `application/ecmascript` + +1.46.0 / 2021-02-13 +=================== + + * Add extension `.amr` to `audio/amr` + * Add extension `.m4s` to `video/iso.segment` + * Add extension `.opus` to `audio/ogg` + * Add new upstream MIME types + +1.45.0 / 2020-09-22 +=================== + + * Add `application/ubjson` with extension `.ubj` + * Add `image/avif` with extension `.avif` + * Add `image/ktx2` with extension `.ktx2` + * Add extension `.dbf` to `application/vnd.dbf` + * Add extension `.rar` to `application/vnd.rar` + * Add extension `.td` to `application/urc-targetdesc+xml` + * Add new upstream MIME types + * Fix extension of `application/vnd.apple.keynote` to be `.key` + +1.44.0 / 2020-04-22 +=================== + + * Add charsets from IANA + * Add extension `.cjs` to `application/node` + * Add new upstream MIME types + +1.43.0 / 2020-01-05 +=================== + + * Add `application/x-keepass2` with extension `.kdbx` + * Add extension `.mxmf` to `audio/mobile-xmf` + * Add extensions from IANA for `application/*+xml` types + * Add new upstream MIME types + +1.42.0 / 2019-09-25 +=================== + + * Add `image/vnd.ms-dds` with extension `.dds` + * Add new upstream MIME types + * Remove compressible from `multipart/mixed` + +1.41.0 / 2019-08-30 +=================== + + * Add new upstream MIME types + * Add `application/toml` with extension `.toml` + * Mark `font/ttf` as compressible + +1.40.0 / 2019-04-20 +=================== + + * Add extensions from IANA for `model/*` types + * Add `text/mdx` with extension `.mdx` + +1.39.0 / 2019-04-04 +=================== + + * Add extensions `.siv` and `.sieve` to `application/sieve` + * Add new upstream MIME types + +1.38.0 / 2019-02-04 +=================== + + * Add extension `.nq` to `application/n-quads` + * Add extension `.nt` to `application/n-triples` + * Add new upstream MIME types + * Mark `text/less` as compressible + +1.37.0 / 2018-10-19 +=================== + + * Add extensions to HEIC image types + * Add new upstream MIME types + +1.36.0 / 2018-08-20 +=================== + + * Add Apple file extensions from IANA + * Add extensions from IANA for `image/*` types + * Add new upstream MIME types + +1.35.0 / 2018-07-15 +=================== + + * Add extension `.owl` to `application/rdf+xml` + * Add new upstream MIME types + - Removes extension `.woff` from `application/font-woff` + +1.34.0 / 2018-06-03 +=================== + + * Add extension `.csl` to `application/vnd.citationstyles.style+xml` + * Add extension `.es` to `application/ecmascript` + * Add new upstream MIME types + * Add `UTF-8` as default charset for `text/turtle` + * Mark all XML-derived types as compressible + +1.33.0 / 2018-02-15 +=================== + + * Add extensions from IANA for `message/*` types + * Add new upstream MIME types + * Fix some incorrect OOXML types + * Remove `application/font-woff2` + +1.32.0 / 2017-11-29 +=================== + + * Add new upstream MIME types + * Update `text/hjson` to registered `application/hjson` + * Add `text/shex` with extension `.shex` + +1.31.0 / 2017-10-25 +=================== + + * Add `application/raml+yaml` with extension `.raml` + * Add `application/wasm` with extension `.wasm` + * Add new `font` type from IANA + * Add new upstream font extensions + * Add new upstream MIME types + * Add extensions for JPEG-2000 images + +1.30.0 / 2017-08-27 +=================== + + * Add `application/vnd.ms-outlook` + * Add `application/x-arj` + * Add extension `.mjs` to `application/javascript` + * Add glTF types and extensions + * Add new upstream MIME types + * Add `text/x-org` + * Add VirtualBox MIME types + * Fix `source` records for `video/*` types that are IANA + * Update `font/opentype` to registered `font/otf` + +1.29.0 / 2017-07-10 +=================== + + * Add `application/fido.trusted-apps+json` + * Add extension `.wadl` to `application/vnd.sun.wadl+xml` + * Add new upstream MIME types + * Add `UTF-8` as default charset for `text/css` + +1.28.0 / 2017-05-14 +=================== + + * Add new upstream MIME types + * Add extension `.gz` to `application/gzip` + * Update extensions `.md` and `.markdown` to be `text/markdown` + +1.27.0 / 2017-03-16 +=================== + + * Add new upstream MIME types + * Add `image/apng` with extension `.apng` + +1.26.0 / 2017-01-14 +=================== + + * Add new upstream MIME types + * Add extension `.geojson` to `application/geo+json` + +1.25.0 / 2016-11-11 +=================== + + * Add new upstream MIME types + +1.24.0 / 2016-09-18 +=================== + + * Add `audio/mp3` + * Add new upstream MIME types + +1.23.0 / 2016-05-01 +=================== + + * Add new upstream MIME types + * Add extension `.3gpp` to `audio/3gpp` + +1.22.0 / 2016-02-15 +=================== + + * Add `text/slim` + * Add extension `.rng` to `application/xml` + * Add new upstream MIME types + * Fix extension of `application/dash+xml` to be `.mpd` + * Update primary extension to `.m4a` for `audio/mp4` + +1.21.0 / 2016-01-06 +=================== + + * Add Google document types + * Add new upstream MIME types + +1.20.0 / 2015-11-10 +=================== + + * Add `text/x-suse-ymp` + * Add new upstream MIME types + +1.19.0 / 2015-09-17 +=================== + + * Add `application/vnd.apple.pkpass` + * Add new upstream MIME types + +1.18.0 / 2015-09-03 +=================== + + * Add new upstream MIME types + +1.17.0 / 2015-08-13 +=================== + + * Add `application/x-msdos-program` + * Add `audio/g711-0` + * Add `image/vnd.mozilla.apng` + * Add extension `.exe` to `application/x-msdos-program` + +1.16.0 / 2015-07-29 +=================== + + * Add `application/vnd.uri-map` + +1.15.0 / 2015-07-13 +=================== + + * Add `application/x-httpd-php` + +1.14.0 / 2015-06-25 +=================== + + * Add `application/scim+json` + * Add `application/vnd.3gpp.ussd+xml` + * Add `application/vnd.biopax.rdf+xml` + * Add `text/x-processing` + +1.13.0 / 2015-06-07 +=================== + + * Add nginx as a source + * Add `application/x-cocoa` + * Add `application/x-java-archive-diff` + * Add `application/x-makeself` + * Add `application/x-perl` + * Add `application/x-pilot` + * Add `application/x-redhat-package-manager` + * Add `application/x-sea` + * Add `audio/x-m4a` + * Add `audio/x-realaudio` + * Add `image/x-jng` + * Add `text/mathml` + +1.12.0 / 2015-06-05 +=================== + + * Add `application/bdoc` + * Add `application/vnd.hyperdrive+json` + * Add `application/x-bdoc` + * Add extension `.rtf` to `text/rtf` + +1.11.0 / 2015-05-31 +=================== + + * Add `audio/wav` + * Add `audio/wave` + * Add extension `.litcoffee` to `text/coffeescript` + * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data` + * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install` + +1.10.0 / 2015-05-19 +=================== + + * Add `application/vnd.balsamiq.bmpr` + * Add `application/vnd.microsoft.portable-executable` + * Add `application/x-ns-proxy-autoconfig` + +1.9.1 / 2015-04-19 +================== + + * Remove `.json` extension from `application/manifest+json` + - This is causing bugs downstream + +1.9.0 / 2015-04-19 +================== + + * Add `application/manifest+json` + * Add `application/vnd.micro+json` + * Add `image/vnd.zbrush.pcx` + * Add `image/x-ms-bmp` + +1.8.0 / 2015-03-13 +================== + + * Add `application/vnd.citationstyles.style+xml` + * Add `application/vnd.fastcopy-disk-image` + * Add `application/vnd.gov.sk.xmldatacontainer+xml` + * Add extension `.jsonld` to `application/ld+json` + +1.7.0 / 2015-02-08 +================== + + * Add `application/vnd.gerber` + * Add `application/vnd.msa-disk-image` + +1.6.1 / 2015-02-05 +================== + + * Community extensions ownership transferred from `node-mime` + +1.6.0 / 2015-01-29 +================== + + * Add `application/jose` + * Add `application/jose+json` + * Add `application/json-seq` + * Add `application/jwk+json` + * Add `application/jwk-set+json` + * Add `application/jwt` + * Add `application/rdap+json` + * Add `application/vnd.gov.sk.e-form+xml` + * Add `application/vnd.ims.imsccv1p3` + +1.5.0 / 2014-12-30 +================== + + * Add `application/vnd.oracle.resource+json` + * Fix various invalid MIME type entries + - `application/mbox+xml` + - `application/oscp-response` + - `application/vwg-multiplexed` + - `audio/g721` + +1.4.0 / 2014-12-21 +================== + + * Add `application/vnd.ims.imsccv1p2` + * Fix various invalid MIME type entries + - `application/vnd-acucobol` + - `application/vnd-curl` + - `application/vnd-dart` + - `application/vnd-dxr` + - `application/vnd-fdf` + - `application/vnd-mif` + - `application/vnd-sema` + - `application/vnd-wap-wmlc` + - `application/vnd.adobe.flash-movie` + - `application/vnd.dece-zip` + - `application/vnd.dvb_service` + - `application/vnd.micrografx-igx` + - `application/vnd.sealed-doc` + - `application/vnd.sealed-eml` + - `application/vnd.sealed-mht` + - `application/vnd.sealed-ppt` + - `application/vnd.sealed-tiff` + - `application/vnd.sealed-xls` + - `application/vnd.sealedmedia.softseal-html` + - `application/vnd.sealedmedia.softseal-pdf` + - `application/vnd.wap-slc` + - `application/vnd.wap-wbxml` + - `audio/vnd.sealedmedia.softseal-mpeg` + - `image/vnd-djvu` + - `image/vnd-svf` + - `image/vnd-wap-wbmp` + - `image/vnd.sealed-png` + - `image/vnd.sealedmedia.softseal-gif` + - `image/vnd.sealedmedia.softseal-jpg` + - `model/vnd-dwf` + - `model/vnd.parasolid.transmit-binary` + - `model/vnd.parasolid.transmit-text` + - `text/vnd-a` + - `text/vnd-curl` + - `text/vnd.wap-wml` + * Remove example template MIME types + - `application/example` + - `audio/example` + - `image/example` + - `message/example` + - `model/example` + - `multipart/example` + - `text/example` + - `video/example` + +1.3.1 / 2014-12-16 +================== + + * Fix missing extensions + - `application/json5` + - `text/hjson` + +1.3.0 / 2014-12-07 +================== + + * Add `application/a2l` + * Add `application/aml` + * Add `application/atfx` + * Add `application/atxml` + * Add `application/cdfx+xml` + * Add `application/dii` + * Add `application/json5` + * Add `application/lxf` + * Add `application/mf4` + * Add `application/vnd.apache.thrift.compact` + * Add `application/vnd.apache.thrift.json` + * Add `application/vnd.coffeescript` + * Add `application/vnd.enphase.envoy` + * Add `application/vnd.ims.imsccv1p1` + * Add `text/csv-schema` + * Add `text/hjson` + * Add `text/markdown` + * Add `text/yaml` + +1.2.0 / 2014-11-09 +================== + + * Add `application/cea` + * Add `application/dit` + * Add `application/vnd.gov.sk.e-form+zip` + * Add `application/vnd.tmd.mediaflex.api+xml` + * Type `application/epub+zip` is now IANA-registered + +1.1.2 / 2014-10-23 +================== + + * Rebuild database for `application/x-www-form-urlencoded` change + +1.1.1 / 2014-10-20 +================== + + * Mark `application/x-www-form-urlencoded` as compressible. + +1.1.0 / 2014-09-28 +================== + + * Add `application/font-woff2` + +1.0.3 / 2014-09-25 +================== + + * Fix engine requirement in package + +1.0.2 / 2014-09-25 +================== + + * Add `application/coap-group+json` + * Add `application/dcd` + * Add `application/vnd.apache.thrift.binary` + * Add `image/vnd.tencent.tap` + * Mark all JSON-derived types as compressible + * Update `text/vtt` data + +1.0.1 / 2014-08-30 +================== + + * Fix extension ordering + +1.0.0 / 2014-08-30 +================== + + * Add `application/atf` + * Add `application/merge-patch+json` + * Add `multipart/x-mixed-replace` + * Add `source: 'apache'` metadata + * Add `source: 'iana'` metadata + * Remove badly-assumed charset data diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/LICENSE new file mode 100644 index 0000000..0751cb1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/README.md new file mode 100644 index 0000000..ee93fa0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/README.md @@ -0,0 +1,109 @@ +# mime-db + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][ci-image]][ci-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +This is a large database of mime types and information about them. +It consists of a single, public JSON file and does not include any logic, +allowing it to remain as un-opinionated as possible with an API. +It aggregates data from the following sources: + +- https://www.iana.org/assignments/media-types/media-types.xhtml +- https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types +- https://hg.nginx.org/nginx/raw-file/default/conf/mime.types + +## Installation + +```bash +npm install mime-db +``` + +### Database Download + +If you intend to use this in a web browser, you can conveniently access the JSON file via [jsDelivr](https://www.jsdelivr.com/), a popular CDN (Content Delivery Network). To ensure stability and compatibility, it is advisable to specify [a release tag](https://github.com/jshttp/mime-db/tags) instead of using the 'master' branch. This is because the JSON file's format might change in future updates, and relying on a specific release tag will prevent potential issues arising from these changes. + +``` +https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json +``` + +## Usage + +```js +var db = require('mime-db') + +// grab data on .js files +var data = db['application/javascript'] +``` + +## Data Structure + +The JSON file is a map lookup for lowercased mime types. +Each mime type has the following properties: + +- `.source` - where the mime type is defined. + If not set, it's probably a custom media type. + - `apache` - [Apache common media types](https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) + - `iana` - [IANA-defined media types](https://www.iana.org/assignments/media-types/media-types.xhtml) + - `nginx` - [nginx media types](https://hg.nginx.org/nginx/raw-file/default/conf/mime.types) +- `.extensions[]` - known extensions associated with this mime type. +- `.compressible` - whether a file of this type can be gzipped. +- `.charset` - the default charset associated with this type, if any. + +If unknown, every property could be `undefined`. + +## Note on MIME Type Data and Semver + +This package considers the programmatic api as the semver compatibility. This means the MIME type resolution is *not* considered +in the semver bumps. This means that if you want to pin your `mime-db` data you will need to do it in your application. While +this expectation was not set in docs until now, it is how the pacakge operated, so we do not feel this is a breaking change. + +## Contributing + +The primary way to contribute to this database is by updating the data in +one of the upstream sources. The database is updated from the upstreams +periodically and will pull in any changes. + +### Registering Media Types + +The best way to get new media types included in this library is to register +them with the IANA. The community registration procedure is outlined in +[RFC 6838 section 5](https://tools.ietf.org/html/rfc6838#section-5). Types +registered with the IANA are automatically pulled into this library. + +### Direct Inclusion + +If that is not possible / feasible, they can be added directly here as a +"custom" type. To do this, it is required to have a primary source that +definitively lists the media type. If an extension is going to be listed as +associated with this media type, the source must definitively link the +media type and extension as well. + +To edit the database, only make PRs against `src/custom-types.json` or +`src/custom-suffix.json`. + +The `src/custom-types.json` file is a JSON object with the MIME type as the +keys and the values being an object with the following keys: + +- `compressible` - leave out if you don't know, otherwise `true`/`false` to + indicate whether the data represented by the type is typically compressible. +- `extensions` - include an array of file extensions that are associated with + the type. +- `notes` - human-readable notes about the type, typically what the type is. +- `sources` - include an array of URLs of where the MIME type and the associated + extensions are sourced from. This needs to be a [primary source](https://en.wikipedia.org/wiki/Primary_source); + links to type aggregating sites and Wikipedia are _not acceptable_. + +To update the build, run `npm run build`. + +[ci-image]: https://badgen.net/github/checks/jshttp/mime-db/master?label=ci +[ci-url]: https://github.com/jshttp/mime-db/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master +[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master +[node-image]: https://badgen.net/npm/node/mime-db +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/mime-db +[npm-url]: https://npmjs.org/package/mime-db +[npm-version-image]: https://badgen.net/npm/v/mime-db diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/db.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/db.json new file mode 100644 index 0000000..7e74733 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/db.json @@ -0,0 +1,9342 @@ +{ + "application/1d-interleaved-parityfec": { + "source": "iana" + }, + "application/3gpdash-qoe-report+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/3gpp-ims+xml": { + "source": "iana", + "compressible": true + }, + "application/3gpphal+json": { + "source": "iana", + "compressible": true + }, + "application/3gpphalforms+json": { + "source": "iana", + "compressible": true + }, + "application/a2l": { + "source": "iana" + }, + "application/ace+cbor": { + "source": "iana" + }, + "application/ace+json": { + "source": "iana", + "compressible": true + }, + "application/ace-groupcomm+cbor": { + "source": "iana" + }, + "application/ace-trl+cbor": { + "source": "iana" + }, + "application/activemessage": { + "source": "iana" + }, + "application/activity+json": { + "source": "iana", + "compressible": true + }, + "application/aif+cbor": { + "source": "iana" + }, + "application/aif+json": { + "source": "iana", + "compressible": true + }, + "application/alto-cdni+json": { + "source": "iana", + "compressible": true + }, + "application/alto-cdnifilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-costmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-costmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-directory+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcost+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcostparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointprop+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointpropparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-error+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-propmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-propmapparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-tips+json": { + "source": "iana", + "compressible": true + }, + "application/alto-tipsparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-updatestreamcontrol+json": { + "source": "iana", + "compressible": true + }, + "application/alto-updatestreamparams+json": { + "source": "iana", + "compressible": true + }, + "application/aml": { + "source": "iana" + }, + "application/andrew-inset": { + "source": "iana", + "extensions": ["ez"] + }, + "application/appinstaller": { + "compressible": false, + "extensions": ["appinstaller"] + }, + "application/applefile": { + "source": "iana" + }, + "application/applixware": { + "source": "apache", + "extensions": ["aw"] + }, + "application/appx": { + "compressible": false, + "extensions": ["appx"] + }, + "application/appxbundle": { + "compressible": false, + "extensions": ["appxbundle"] + }, + "application/at+jwt": { + "source": "iana" + }, + "application/atf": { + "source": "iana" + }, + "application/atfx": { + "source": "iana" + }, + "application/atom+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atom"] + }, + "application/atomcat+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atomcat"] + }, + "application/atomdeleted+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atomdeleted"] + }, + "application/atomicmail": { + "source": "iana" + }, + "application/atomsvc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atomsvc"] + }, + "application/atsc-dwd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dwd"] + }, + "application/atsc-dynamic-event-message": { + "source": "iana" + }, + "application/atsc-held+xml": { + "source": "iana", + "compressible": true, + "extensions": ["held"] + }, + "application/atsc-rdt+json": { + "source": "iana", + "compressible": true + }, + "application/atsc-rsat+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rsat"] + }, + "application/atxml": { + "source": "iana" + }, + "application/auth-policy+xml": { + "source": "iana", + "compressible": true + }, + "application/automationml-aml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["aml"] + }, + "application/automationml-amlx+zip": { + "source": "iana", + "compressible": false, + "extensions": ["amlx"] + }, + "application/bacnet-xdd+zip": { + "source": "iana", + "compressible": false + }, + "application/batch-smtp": { + "source": "iana" + }, + "application/bdoc": { + "compressible": false, + "extensions": ["bdoc"] + }, + "application/beep+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/bufr": { + "source": "iana" + }, + "application/c2pa": { + "source": "iana" + }, + "application/calendar+json": { + "source": "iana", + "compressible": true + }, + "application/calendar+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xcs"] + }, + "application/call-completion": { + "source": "iana" + }, + "application/cals-1840": { + "source": "iana" + }, + "application/captive+json": { + "source": "iana", + "compressible": true + }, + "application/cbor": { + "source": "iana" + }, + "application/cbor-seq": { + "source": "iana" + }, + "application/cccex": { + "source": "iana" + }, + "application/ccmp+xml": { + "source": "iana", + "compressible": true + }, + "application/ccxml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ccxml"] + }, + "application/cda+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/cdfx+xml": { + "source": "iana", + "compressible": true, + "extensions": ["cdfx"] + }, + "application/cdmi-capability": { + "source": "iana", + "extensions": ["cdmia"] + }, + "application/cdmi-container": { + "source": "iana", + "extensions": ["cdmic"] + }, + "application/cdmi-domain": { + "source": "iana", + "extensions": ["cdmid"] + }, + "application/cdmi-object": { + "source": "iana", + "extensions": ["cdmio"] + }, + "application/cdmi-queue": { + "source": "iana", + "extensions": ["cdmiq"] + }, + "application/cdni": { + "source": "iana" + }, + "application/ce+cbor": { + "source": "iana" + }, + "application/cea": { + "source": "iana" + }, + "application/cea-2018+xml": { + "source": "iana", + "compressible": true + }, + "application/cellml+xml": { + "source": "iana", + "compressible": true + }, + "application/cfw": { + "source": "iana" + }, + "application/cid-edhoc+cbor-seq": { + "source": "iana" + }, + "application/city+json": { + "source": "iana", + "compressible": true + }, + "application/city+json-seq": { + "source": "iana" + }, + "application/clr": { + "source": "iana" + }, + "application/clue+xml": { + "source": "iana", + "compressible": true + }, + "application/clue_info+xml": { + "source": "iana", + "compressible": true + }, + "application/cms": { + "source": "iana" + }, + "application/cnrp+xml": { + "source": "iana", + "compressible": true + }, + "application/coap-eap": { + "source": "iana" + }, + "application/coap-group+json": { + "source": "iana", + "compressible": true + }, + "application/coap-payload": { + "source": "iana" + }, + "application/commonground": { + "source": "iana" + }, + "application/concise-problem-details+cbor": { + "source": "iana" + }, + "application/conference-info+xml": { + "source": "iana", + "compressible": true + }, + "application/cose": { + "source": "iana" + }, + "application/cose-key": { + "source": "iana" + }, + "application/cose-key-set": { + "source": "iana" + }, + "application/cose-x509": { + "source": "iana" + }, + "application/cpl+xml": { + "source": "iana", + "compressible": true, + "extensions": ["cpl"] + }, + "application/csrattrs": { + "source": "iana" + }, + "application/csta+xml": { + "source": "iana", + "compressible": true + }, + "application/cstadata+xml": { + "source": "iana", + "compressible": true + }, + "application/csvm+json": { + "source": "iana", + "compressible": true + }, + "application/cu-seeme": { + "source": "apache", + "extensions": ["cu"] + }, + "application/cwl": { + "source": "iana", + "extensions": ["cwl"] + }, + "application/cwl+json": { + "source": "iana", + "compressible": true + }, + "application/cwl+yaml": { + "source": "iana" + }, + "application/cwt": { + "source": "iana" + }, + "application/cybercash": { + "source": "iana" + }, + "application/dart": { + "compressible": true + }, + "application/dash+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpd"] + }, + "application/dash-patch+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpp"] + }, + "application/dashdelta": { + "source": "iana" + }, + "application/davmount+xml": { + "source": "iana", + "compressible": true, + "extensions": ["davmount"] + }, + "application/dca-rft": { + "source": "iana" + }, + "application/dcd": { + "source": "iana" + }, + "application/dec-dx": { + "source": "iana" + }, + "application/dialog-info+xml": { + "source": "iana", + "compressible": true + }, + "application/dicom": { + "source": "iana", + "extensions": ["dcm"] + }, + "application/dicom+json": { + "source": "iana", + "compressible": true + }, + "application/dicom+xml": { + "source": "iana", + "compressible": true + }, + "application/dii": { + "source": "iana" + }, + "application/dit": { + "source": "iana" + }, + "application/dns": { + "source": "iana" + }, + "application/dns+json": { + "source": "iana", + "compressible": true + }, + "application/dns-message": { + "source": "iana" + }, + "application/docbook+xml": { + "source": "apache", + "compressible": true, + "extensions": ["dbk"] + }, + "application/dots+cbor": { + "source": "iana" + }, + "application/dpop+jwt": { + "source": "iana" + }, + "application/dskpp+xml": { + "source": "iana", + "compressible": true + }, + "application/dssc+der": { + "source": "iana", + "extensions": ["dssc"] + }, + "application/dssc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdssc"] + }, + "application/dvcs": { + "source": "iana" + }, + "application/eat+cwt": { + "source": "iana" + }, + "application/eat+jwt": { + "source": "iana" + }, + "application/eat-bun+cbor": { + "source": "iana" + }, + "application/eat-bun+json": { + "source": "iana", + "compressible": true + }, + "application/eat-ucs+cbor": { + "source": "iana" + }, + "application/eat-ucs+json": { + "source": "iana", + "compressible": true + }, + "application/ecmascript": { + "source": "apache", + "compressible": true, + "extensions": ["ecma"] + }, + "application/edhoc+cbor-seq": { + "source": "iana" + }, + "application/edi-consent": { + "source": "iana" + }, + "application/edi-x12": { + "source": "iana", + "compressible": false + }, + "application/edifact": { + "source": "iana", + "compressible": false + }, + "application/efi": { + "source": "iana" + }, + "application/elm+json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/elm+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.cap+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/emergencycalldata.comment+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.control+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.deviceinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.ecall.msd": { + "source": "iana" + }, + "application/emergencycalldata.legacyesn+json": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.providerinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.serviceinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.subscriberinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.veds+xml": { + "source": "iana", + "compressible": true + }, + "application/emma+xml": { + "source": "iana", + "compressible": true, + "extensions": ["emma"] + }, + "application/emotionml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["emotionml"] + }, + "application/encaprtp": { + "source": "iana" + }, + "application/entity-statement+jwt": { + "source": "iana" + }, + "application/epp+xml": { + "source": "iana", + "compressible": true + }, + "application/epub+zip": { + "source": "iana", + "compressible": false, + "extensions": ["epub"] + }, + "application/eshop": { + "source": "iana" + }, + "application/exi": { + "source": "iana", + "extensions": ["exi"] + }, + "application/expect-ct-report+json": { + "source": "iana", + "compressible": true + }, + "application/express": { + "source": "iana", + "extensions": ["exp"] + }, + "application/fastinfoset": { + "source": "iana" + }, + "application/fastsoap": { + "source": "iana" + }, + "application/fdf": { + "source": "iana", + "extensions": ["fdf"] + }, + "application/fdt+xml": { + "source": "iana", + "compressible": true, + "extensions": ["fdt"] + }, + "application/fhir+json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/fhir+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/fido.trusted-apps+json": { + "compressible": true + }, + "application/fits": { + "source": "iana" + }, + "application/flexfec": { + "source": "iana" + }, + "application/font-sfnt": { + "source": "iana" + }, + "application/font-tdpfr": { + "source": "iana", + "extensions": ["pfr"] + }, + "application/font-woff": { + "source": "iana", + "compressible": false + }, + "application/framework-attributes+xml": { + "source": "iana", + "compressible": true + }, + "application/geo+json": { + "source": "iana", + "compressible": true, + "extensions": ["geojson"] + }, + "application/geo+json-seq": { + "source": "iana" + }, + "application/geopackage+sqlite3": { + "source": "iana" + }, + "application/geopose+json": { + "source": "iana", + "compressible": true + }, + "application/geoxacml+json": { + "source": "iana", + "compressible": true + }, + "application/geoxacml+xml": { + "source": "iana", + "compressible": true + }, + "application/gltf-buffer": { + "source": "iana" + }, + "application/gml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["gml"] + }, + "application/gnap-binding-jws": { + "source": "iana" + }, + "application/gnap-binding-jwsd": { + "source": "iana" + }, + "application/gnap-binding-rotation-jws": { + "source": "iana" + }, + "application/gnap-binding-rotation-jwsd": { + "source": "iana" + }, + "application/gpx+xml": { + "source": "apache", + "compressible": true, + "extensions": ["gpx"] + }, + "application/grib": { + "source": "iana" + }, + "application/gxf": { + "source": "apache", + "extensions": ["gxf"] + }, + "application/gzip": { + "source": "iana", + "compressible": false, + "extensions": ["gz"] + }, + "application/h224": { + "source": "iana" + }, + "application/held+xml": { + "source": "iana", + "compressible": true + }, + "application/hjson": { + "extensions": ["hjson"] + }, + "application/hl7v2+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/http": { + "source": "iana" + }, + "application/hyperstudio": { + "source": "iana", + "extensions": ["stk"] + }, + "application/ibe-key-request+xml": { + "source": "iana", + "compressible": true + }, + "application/ibe-pkg-reply+xml": { + "source": "iana", + "compressible": true + }, + "application/ibe-pp-data": { + "source": "iana" + }, + "application/iges": { + "source": "iana" + }, + "application/im-iscomposing+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/index": { + "source": "iana" + }, + "application/index.cmd": { + "source": "iana" + }, + "application/index.obj": { + "source": "iana" + }, + "application/index.response": { + "source": "iana" + }, + "application/index.vnd": { + "source": "iana" + }, + "application/inkml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ink","inkml"] + }, + "application/iotp": { + "source": "iana" + }, + "application/ipfix": { + "source": "iana", + "extensions": ["ipfix"] + }, + "application/ipp": { + "source": "iana" + }, + "application/isup": { + "source": "iana" + }, + "application/its+xml": { + "source": "iana", + "compressible": true, + "extensions": ["its"] + }, + "application/java-archive": { + "source": "iana", + "compressible": false, + "extensions": ["jar","war","ear"] + }, + "application/java-serialized-object": { + "source": "apache", + "compressible": false, + "extensions": ["ser"] + }, + "application/java-vm": { + "source": "apache", + "compressible": false, + "extensions": ["class"] + }, + "application/javascript": { + "source": "apache", + "charset": "UTF-8", + "compressible": true, + "extensions": ["js"] + }, + "application/jf2feed+json": { + "source": "iana", + "compressible": true + }, + "application/jose": { + "source": "iana" + }, + "application/jose+json": { + "source": "iana", + "compressible": true + }, + "application/jrd+json": { + "source": "iana", + "compressible": true + }, + "application/jscalendar+json": { + "source": "iana", + "compressible": true + }, + "application/jscontact+json": { + "source": "iana", + "compressible": true + }, + "application/json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["json","map"] + }, + "application/json-patch+json": { + "source": "iana", + "compressible": true + }, + "application/json-seq": { + "source": "iana" + }, + "application/json5": { + "extensions": ["json5"] + }, + "application/jsonml+json": { + "source": "apache", + "compressible": true, + "extensions": ["jsonml"] + }, + "application/jsonpath": { + "source": "iana" + }, + "application/jwk+json": { + "source": "iana", + "compressible": true + }, + "application/jwk-set+json": { + "source": "iana", + "compressible": true + }, + "application/jwk-set+jwt": { + "source": "iana" + }, + "application/jwt": { + "source": "iana" + }, + "application/kpml-request+xml": { + "source": "iana", + "compressible": true + }, + "application/kpml-response+xml": { + "source": "iana", + "compressible": true + }, + "application/ld+json": { + "source": "iana", + "compressible": true, + "extensions": ["jsonld"] + }, + "application/lgr+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lgr"] + }, + "application/link-format": { + "source": "iana" + }, + "application/linkset": { + "source": "iana" + }, + "application/linkset+json": { + "source": "iana", + "compressible": true + }, + "application/load-control+xml": { + "source": "iana", + "compressible": true + }, + "application/logout+jwt": { + "source": "iana" + }, + "application/lost+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lostxml"] + }, + "application/lostsync+xml": { + "source": "iana", + "compressible": true + }, + "application/lpf+zip": { + "source": "iana", + "compressible": false + }, + "application/lxf": { + "source": "iana" + }, + "application/mac-binhex40": { + "source": "iana", + "extensions": ["hqx"] + }, + "application/mac-compactpro": { + "source": "apache", + "extensions": ["cpt"] + }, + "application/macwriteii": { + "source": "iana" + }, + "application/mads+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mads"] + }, + "application/manifest+json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["webmanifest"] + }, + "application/marc": { + "source": "iana", + "extensions": ["mrc"] + }, + "application/marcxml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mrcx"] + }, + "application/mathematica": { + "source": "iana", + "extensions": ["ma","nb","mb"] + }, + "application/mathml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mathml"] + }, + "application/mathml-content+xml": { + "source": "iana", + "compressible": true + }, + "application/mathml-presentation+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-associated-procedure-description+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-deregister+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-envelope+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-msk+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-msk-response+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-protection-description+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-reception-report+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-register+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-register-response+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-schedule+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-user-service-description+xml": { + "source": "iana", + "compressible": true + }, + "application/mbox": { + "source": "iana", + "extensions": ["mbox"] + }, + "application/media-policy-dataset+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpf"] + }, + "application/media_control+xml": { + "source": "iana", + "compressible": true + }, + "application/mediaservercontrol+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mscml"] + }, + "application/merge-patch+json": { + "source": "iana", + "compressible": true + }, + "application/metalink+xml": { + "source": "apache", + "compressible": true, + "extensions": ["metalink"] + }, + "application/metalink4+xml": { + "source": "iana", + "compressible": true, + "extensions": ["meta4"] + }, + "application/mets+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mets"] + }, + "application/mf4": { + "source": "iana" + }, + "application/mikey": { + "source": "iana" + }, + "application/mipc": { + "source": "iana" + }, + "application/missing-blocks+cbor-seq": { + "source": "iana" + }, + "application/mmt-aei+xml": { + "source": "iana", + "compressible": true, + "extensions": ["maei"] + }, + "application/mmt-usd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["musd"] + }, + "application/mods+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mods"] + }, + "application/moss-keys": { + "source": "iana" + }, + "application/moss-signature": { + "source": "iana" + }, + "application/mosskey-data": { + "source": "iana" + }, + "application/mosskey-request": { + "source": "iana" + }, + "application/mp21": { + "source": "iana", + "extensions": ["m21","mp21"] + }, + "application/mp4": { + "source": "iana", + "extensions": ["mp4","mpg4","mp4s","m4p"] + }, + "application/mpeg4-generic": { + "source": "iana" + }, + "application/mpeg4-iod": { + "source": "iana" + }, + "application/mpeg4-iod-xmt": { + "source": "iana" + }, + "application/mrb-consumer+xml": { + "source": "iana", + "compressible": true + }, + "application/mrb-publish+xml": { + "source": "iana", + "compressible": true + }, + "application/msc-ivr+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/msc-mixer+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/msix": { + "compressible": false, + "extensions": ["msix"] + }, + "application/msixbundle": { + "compressible": false, + "extensions": ["msixbundle"] + }, + "application/msword": { + "source": "iana", + "compressible": false, + "extensions": ["doc","dot"] + }, + "application/mud+json": { + "source": "iana", + "compressible": true + }, + "application/multipart-core": { + "source": "iana" + }, + "application/mxf": { + "source": "iana", + "extensions": ["mxf"] + }, + "application/n-quads": { + "source": "iana", + "extensions": ["nq"] + }, + "application/n-triples": { + "source": "iana", + "extensions": ["nt"] + }, + "application/nasdata": { + "source": "iana" + }, + "application/news-checkgroups": { + "source": "iana", + "charset": "US-ASCII" + }, + "application/news-groupinfo": { + "source": "iana", + "charset": "US-ASCII" + }, + "application/news-transmission": { + "source": "iana" + }, + "application/nlsml+xml": { + "source": "iana", + "compressible": true + }, + "application/node": { + "source": "iana", + "extensions": ["cjs"] + }, + "application/nss": { + "source": "iana" + }, + "application/oauth-authz-req+jwt": { + "source": "iana" + }, + "application/oblivious-dns-message": { + "source": "iana" + }, + "application/ocsp-request": { + "source": "iana" + }, + "application/ocsp-response": { + "source": "iana" + }, + "application/octet-stream": { + "source": "iana", + "compressible": true, + "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"] + }, + "application/oda": { + "source": "iana", + "extensions": ["oda"] + }, + "application/odm+xml": { + "source": "iana", + "compressible": true + }, + "application/odx": { + "source": "iana" + }, + "application/oebps-package+xml": { + "source": "iana", + "compressible": true, + "extensions": ["opf"] + }, + "application/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["ogx"] + }, + "application/ohttp-keys": { + "source": "iana" + }, + "application/omdoc+xml": { + "source": "apache", + "compressible": true, + "extensions": ["omdoc"] + }, + "application/onenote": { + "source": "apache", + "extensions": ["onetoc","onetoc2","onetmp","onepkg","one","onea"] + }, + "application/opc-nodeset+xml": { + "source": "iana", + "compressible": true + }, + "application/oscore": { + "source": "iana" + }, + "application/oxps": { + "source": "iana", + "extensions": ["oxps"] + }, + "application/p21": { + "source": "iana" + }, + "application/p21+zip": { + "source": "iana", + "compressible": false + }, + "application/p2p-overlay+xml": { + "source": "iana", + "compressible": true, + "extensions": ["relo"] + }, + "application/parityfec": { + "source": "iana" + }, + "application/passport": { + "source": "iana" + }, + "application/patch-ops-error+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xer"] + }, + "application/pdf": { + "source": "iana", + "compressible": false, + "extensions": ["pdf"] + }, + "application/pdx": { + "source": "iana" + }, + "application/pem-certificate-chain": { + "source": "iana" + }, + "application/pgp-encrypted": { + "source": "iana", + "compressible": false, + "extensions": ["pgp"] + }, + "application/pgp-keys": { + "source": "iana", + "extensions": ["asc"] + }, + "application/pgp-signature": { + "source": "iana", + "extensions": ["sig","asc"] + }, + "application/pics-rules": { + "source": "apache", + "extensions": ["prf"] + }, + "application/pidf+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/pidf-diff+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/pkcs10": { + "source": "iana", + "extensions": ["p10"] + }, + "application/pkcs12": { + "source": "iana" + }, + "application/pkcs7-mime": { + "source": "iana", + "extensions": ["p7m","p7c"] + }, + "application/pkcs7-signature": { + "source": "iana", + "extensions": ["p7s"] + }, + "application/pkcs8": { + "source": "iana", + "extensions": ["p8"] + }, + "application/pkcs8-encrypted": { + "source": "iana" + }, + "application/pkix-attr-cert": { + "source": "iana", + "extensions": ["ac"] + }, + "application/pkix-cert": { + "source": "iana", + "extensions": ["cer"] + }, + "application/pkix-crl": { + "source": "iana", + "extensions": ["crl"] + }, + "application/pkix-pkipath": { + "source": "iana", + "extensions": ["pkipath"] + }, + "application/pkixcmp": { + "source": "iana", + "extensions": ["pki"] + }, + "application/pls+xml": { + "source": "iana", + "compressible": true, + "extensions": ["pls"] + }, + "application/poc-settings+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/postscript": { + "source": "iana", + "compressible": true, + "extensions": ["ai","eps","ps"] + }, + "application/ppsp-tracker+json": { + "source": "iana", + "compressible": true + }, + "application/private-token-issuer-directory": { + "source": "iana" + }, + "application/private-token-request": { + "source": "iana" + }, + "application/private-token-response": { + "source": "iana" + }, + "application/problem+json": { + "source": "iana", + "compressible": true + }, + "application/problem+xml": { + "source": "iana", + "compressible": true + }, + "application/provenance+xml": { + "source": "iana", + "compressible": true, + "extensions": ["provx"] + }, + "application/provided-claims+jwt": { + "source": "iana" + }, + "application/prs.alvestrand.titrax-sheet": { + "source": "iana" + }, + "application/prs.cww": { + "source": "iana", + "extensions": ["cww"] + }, + "application/prs.cyn": { + "source": "iana", + "charset": "7-BIT" + }, + "application/prs.hpub+zip": { + "source": "iana", + "compressible": false + }, + "application/prs.implied-document+xml": { + "source": "iana", + "compressible": true + }, + "application/prs.implied-executable": { + "source": "iana" + }, + "application/prs.implied-object+json": { + "source": "iana", + "compressible": true + }, + "application/prs.implied-object+json-seq": { + "source": "iana" + }, + "application/prs.implied-object+yaml": { + "source": "iana" + }, + "application/prs.implied-structure": { + "source": "iana" + }, + "application/prs.mayfile": { + "source": "iana" + }, + "application/prs.nprend": { + "source": "iana" + }, + "application/prs.plucker": { + "source": "iana" + }, + "application/prs.rdf-xml-crypt": { + "source": "iana" + }, + "application/prs.vcfbzip2": { + "source": "iana" + }, + "application/prs.xsf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xsf"] + }, + "application/pskc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["pskcxml"] + }, + "application/pvd+json": { + "source": "iana", + "compressible": true + }, + "application/qsig": { + "source": "iana" + }, + "application/raml+yaml": { + "compressible": true, + "extensions": ["raml"] + }, + "application/raptorfec": { + "source": "iana" + }, + "application/rdap+json": { + "source": "iana", + "compressible": true + }, + "application/rdf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rdf","owl"] + }, + "application/reginfo+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rif"] + }, + "application/relax-ng-compact-syntax": { + "source": "iana", + "extensions": ["rnc"] + }, + "application/remote-printing": { + "source": "apache" + }, + "application/reputon+json": { + "source": "iana", + "compressible": true + }, + "application/resolve-response+jwt": { + "source": "iana" + }, + "application/resource-lists+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rl"] + }, + "application/resource-lists-diff+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rld"] + }, + "application/rfc+xml": { + "source": "iana", + "compressible": true + }, + "application/riscos": { + "source": "iana" + }, + "application/rlmi+xml": { + "source": "iana", + "compressible": true + }, + "application/rls-services+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rs"] + }, + "application/route-apd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rapd"] + }, + "application/route-s-tsid+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sls"] + }, + "application/route-usd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rusd"] + }, + "application/rpki-checklist": { + "source": "iana" + }, + "application/rpki-ghostbusters": { + "source": "iana", + "extensions": ["gbr"] + }, + "application/rpki-manifest": { + "source": "iana", + "extensions": ["mft"] + }, + "application/rpki-publication": { + "source": "iana" + }, + "application/rpki-roa": { + "source": "iana", + "extensions": ["roa"] + }, + "application/rpki-signed-tal": { + "source": "iana" + }, + "application/rpki-updown": { + "source": "iana" + }, + "application/rsd+xml": { + "source": "apache", + "compressible": true, + "extensions": ["rsd"] + }, + "application/rss+xml": { + "source": "apache", + "compressible": true, + "extensions": ["rss"] + }, + "application/rtf": { + "source": "iana", + "compressible": true, + "extensions": ["rtf"] + }, + "application/rtploopback": { + "source": "iana" + }, + "application/rtx": { + "source": "iana" + }, + "application/samlassertion+xml": { + "source": "iana", + "compressible": true + }, + "application/samlmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/sarif+json": { + "source": "iana", + "compressible": true + }, + "application/sarif-external-properties+json": { + "source": "iana", + "compressible": true + }, + "application/sbe": { + "source": "iana" + }, + "application/sbml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sbml"] + }, + "application/scaip+xml": { + "source": "iana", + "compressible": true + }, + "application/scim+json": { + "source": "iana", + "compressible": true + }, + "application/scvp-cv-request": { + "source": "iana", + "extensions": ["scq"] + }, + "application/scvp-cv-response": { + "source": "iana", + "extensions": ["scs"] + }, + "application/scvp-vp-request": { + "source": "iana", + "extensions": ["spq"] + }, + "application/scvp-vp-response": { + "source": "iana", + "extensions": ["spp"] + }, + "application/sdp": { + "source": "iana", + "extensions": ["sdp"] + }, + "application/secevent+jwt": { + "source": "iana" + }, + "application/senml+cbor": { + "source": "iana" + }, + "application/senml+json": { + "source": "iana", + "compressible": true + }, + "application/senml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["senmlx"] + }, + "application/senml-etch+cbor": { + "source": "iana" + }, + "application/senml-etch+json": { + "source": "iana", + "compressible": true + }, + "application/senml-exi": { + "source": "iana" + }, + "application/sensml+cbor": { + "source": "iana" + }, + "application/sensml+json": { + "source": "iana", + "compressible": true + }, + "application/sensml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sensmlx"] + }, + "application/sensml-exi": { + "source": "iana" + }, + "application/sep+xml": { + "source": "iana", + "compressible": true + }, + "application/sep-exi": { + "source": "iana" + }, + "application/session-info": { + "source": "iana" + }, + "application/set-payment": { + "source": "iana" + }, + "application/set-payment-initiation": { + "source": "iana", + "extensions": ["setpay"] + }, + "application/set-registration": { + "source": "iana" + }, + "application/set-registration-initiation": { + "source": "iana", + "extensions": ["setreg"] + }, + "application/sgml": { + "source": "iana" + }, + "application/sgml-open-catalog": { + "source": "iana" + }, + "application/shf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["shf"] + }, + "application/sieve": { + "source": "iana", + "extensions": ["siv","sieve"] + }, + "application/simple-filter+xml": { + "source": "iana", + "compressible": true + }, + "application/simple-message-summary": { + "source": "iana" + }, + "application/simplesymbolcontainer": { + "source": "iana" + }, + "application/sipc": { + "source": "iana" + }, + "application/slate": { + "source": "iana" + }, + "application/smil": { + "source": "apache" + }, + "application/smil+xml": { + "source": "iana", + "compressible": true, + "extensions": ["smi","smil"] + }, + "application/smpte336m": { + "source": "iana" + }, + "application/soap+fastinfoset": { + "source": "iana" + }, + "application/soap+xml": { + "source": "iana", + "compressible": true + }, + "application/sparql-query": { + "source": "iana", + "extensions": ["rq"] + }, + "application/sparql-results+xml": { + "source": "iana", + "compressible": true, + "extensions": ["srx"] + }, + "application/spdx+json": { + "source": "iana", + "compressible": true + }, + "application/spirits-event+xml": { + "source": "iana", + "compressible": true + }, + "application/sql": { + "source": "iana", + "extensions": ["sql"] + }, + "application/srgs": { + "source": "iana", + "extensions": ["gram"] + }, + "application/srgs+xml": { + "source": "iana", + "compressible": true, + "extensions": ["grxml"] + }, + "application/sru+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sru"] + }, + "application/ssdl+xml": { + "source": "apache", + "compressible": true, + "extensions": ["ssdl"] + }, + "application/sslkeylogfile": { + "source": "iana" + }, + "application/ssml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ssml"] + }, + "application/st2110-41": { + "source": "iana" + }, + "application/stix+json": { + "source": "iana", + "compressible": true + }, + "application/stratum": { + "source": "iana" + }, + "application/swid+cbor": { + "source": "iana" + }, + "application/swid+xml": { + "source": "iana", + "compressible": true, + "extensions": ["swidtag"] + }, + "application/tamp-apex-update": { + "source": "iana" + }, + "application/tamp-apex-update-confirm": { + "source": "iana" + }, + "application/tamp-community-update": { + "source": "iana" + }, + "application/tamp-community-update-confirm": { + "source": "iana" + }, + "application/tamp-error": { + "source": "iana" + }, + "application/tamp-sequence-adjust": { + "source": "iana" + }, + "application/tamp-sequence-adjust-confirm": { + "source": "iana" + }, + "application/tamp-status-query": { + "source": "iana" + }, + "application/tamp-status-response": { + "source": "iana" + }, + "application/tamp-update": { + "source": "iana" + }, + "application/tamp-update-confirm": { + "source": "iana" + }, + "application/tar": { + "compressible": true + }, + "application/taxii+json": { + "source": "iana", + "compressible": true + }, + "application/td+json": { + "source": "iana", + "compressible": true + }, + "application/tei+xml": { + "source": "iana", + "compressible": true, + "extensions": ["tei","teicorpus"] + }, + "application/tetra_isi": { + "source": "iana" + }, + "application/thraud+xml": { + "source": "iana", + "compressible": true, + "extensions": ["tfi"] + }, + "application/timestamp-query": { + "source": "iana" + }, + "application/timestamp-reply": { + "source": "iana" + }, + "application/timestamped-data": { + "source": "iana", + "extensions": ["tsd"] + }, + "application/tlsrpt+gzip": { + "source": "iana" + }, + "application/tlsrpt+json": { + "source": "iana", + "compressible": true + }, + "application/tm+json": { + "source": "iana", + "compressible": true + }, + "application/tnauthlist": { + "source": "iana" + }, + "application/toc+cbor": { + "source": "iana" + }, + "application/token-introspection+jwt": { + "source": "iana" + }, + "application/toml": { + "source": "iana", + "compressible": true, + "extensions": ["toml"] + }, + "application/trickle-ice-sdpfrag": { + "source": "iana" + }, + "application/trig": { + "source": "iana", + "extensions": ["trig"] + }, + "application/trust-chain+json": { + "source": "iana", + "compressible": true + }, + "application/trust-mark+jwt": { + "source": "iana" + }, + "application/trust-mark-delegation+jwt": { + "source": "iana" + }, + "application/ttml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ttml"] + }, + "application/tve-trigger": { + "source": "iana" + }, + "application/tzif": { + "source": "iana" + }, + "application/tzif-leap": { + "source": "iana" + }, + "application/ubjson": { + "compressible": false, + "extensions": ["ubj"] + }, + "application/uccs+cbor": { + "source": "iana" + }, + "application/ujcs+json": { + "source": "iana", + "compressible": true + }, + "application/ulpfec": { + "source": "iana" + }, + "application/urc-grpsheet+xml": { + "source": "iana", + "compressible": true + }, + "application/urc-ressheet+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rsheet"] + }, + "application/urc-targetdesc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["td"] + }, + "application/urc-uisocketdesc+xml": { + "source": "iana", + "compressible": true + }, + "application/vc": { + "source": "iana" + }, + "application/vc+cose": { + "source": "iana" + }, + "application/vc+jwt": { + "source": "iana" + }, + "application/vcard+json": { + "source": "iana", + "compressible": true + }, + "application/vcard+xml": { + "source": "iana", + "compressible": true + }, + "application/vemmi": { + "source": "iana" + }, + "application/vividence.scriptfile": { + "source": "apache" + }, + "application/vnd.1000minds.decision-model+xml": { + "source": "iana", + "compressible": true, + "extensions": ["1km"] + }, + "application/vnd.1ob": { + "source": "iana" + }, + "application/vnd.3gpp-prose+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc3a+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc3ach+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc3ch+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc8+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-v2x-local-service-information": { + "source": "iana" + }, + "application/vnd.3gpp.5gnas": { + "source": "iana" + }, + "application/vnd.3gpp.5gsa2x": { + "source": "iana" + }, + "application/vnd.3gpp.5gsa2x-local-service-information": { + "source": "iana" + }, + "application/vnd.3gpp.5gsv2x": { + "source": "iana" + }, + "application/vnd.3gpp.5gsv2x-local-service-information": { + "source": "iana" + }, + "application/vnd.3gpp.access-transfer-events+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.bsf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.crs+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.current-location-discovery+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.gmop+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.gtpc": { + "source": "iana" + }, + "application/vnd.3gpp.interworking-data": { + "source": "iana" + }, + "application/vnd.3gpp.lpp": { + "source": "iana" + }, + "application/vnd.3gpp.mc-signalling-ear": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-msgstore-ctrl-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-payload": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-regroup+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-signalling": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-floor-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-location-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-regroup+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-signed+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-ue-init-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-location-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-regroup+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-transmission-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mid-call+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.ngap": { + "source": "iana" + }, + "application/vnd.3gpp.pfcp": { + "source": "iana" + }, + "application/vnd.3gpp.pic-bw-large": { + "source": "iana", + "extensions": ["plb"] + }, + "application/vnd.3gpp.pic-bw-small": { + "source": "iana", + "extensions": ["psb"] + }, + "application/vnd.3gpp.pic-bw-var": { + "source": "iana", + "extensions": ["pvb"] + }, + "application/vnd.3gpp.pinapp-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.s1ap": { + "source": "iana" + }, + "application/vnd.3gpp.seal-group-doc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-location-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-mbms-usage-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-network-qos-management-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-ue-config-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-unicast-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-user-profile-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.sms": { + "source": "iana" + }, + "application/vnd.3gpp.sms+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.srvcc-ext+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.srvcc-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.state-and-event-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.ussd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.v2x": { + "source": "iana" + }, + "application/vnd.3gpp.vae-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp2.bcmcsinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp2.sms": { + "source": "iana" + }, + "application/vnd.3gpp2.tcap": { + "source": "iana", + "extensions": ["tcap"] + }, + "application/vnd.3lightssoftware.imagescal": { + "source": "iana" + }, + "application/vnd.3m.post-it-notes": { + "source": "iana", + "extensions": ["pwn"] + }, + "application/vnd.accpac.simply.aso": { + "source": "iana", + "extensions": ["aso"] + }, + "application/vnd.accpac.simply.imp": { + "source": "iana", + "extensions": ["imp"] + }, + "application/vnd.acm.addressxfer+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.acm.chatbot+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.acucobol": { + "source": "iana", + "extensions": ["acu"] + }, + "application/vnd.acucorp": { + "source": "iana", + "extensions": ["atc","acutc"] + }, + "application/vnd.adobe.air-application-installer-package+zip": { + "source": "apache", + "compressible": false, + "extensions": ["air"] + }, + "application/vnd.adobe.flash.movie": { + "source": "iana" + }, + "application/vnd.adobe.formscentral.fcdt": { + "source": "iana", + "extensions": ["fcdt"] + }, + "application/vnd.adobe.fxp": { + "source": "iana", + "extensions": ["fxp","fxpl"] + }, + "application/vnd.adobe.partial-upload": { + "source": "iana" + }, + "application/vnd.adobe.xdp+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdp"] + }, + "application/vnd.adobe.xfdf": { + "source": "apache", + "extensions": ["xfdf"] + }, + "application/vnd.aether.imp": { + "source": "iana" + }, + "application/vnd.afpc.afplinedata": { + "source": "iana" + }, + "application/vnd.afpc.afplinedata-pagedef": { + "source": "iana" + }, + "application/vnd.afpc.cmoca-cmresource": { + "source": "iana" + }, + "application/vnd.afpc.foca-charset": { + "source": "iana" + }, + "application/vnd.afpc.foca-codedfont": { + "source": "iana" + }, + "application/vnd.afpc.foca-codepage": { + "source": "iana" + }, + "application/vnd.afpc.modca": { + "source": "iana" + }, + "application/vnd.afpc.modca-cmtable": { + "source": "iana" + }, + "application/vnd.afpc.modca-formdef": { + "source": "iana" + }, + "application/vnd.afpc.modca-mediummap": { + "source": "iana" + }, + "application/vnd.afpc.modca-objectcontainer": { + "source": "iana" + }, + "application/vnd.afpc.modca-overlay": { + "source": "iana" + }, + "application/vnd.afpc.modca-pagesegment": { + "source": "iana" + }, + "application/vnd.age": { + "source": "iana", + "extensions": ["age"] + }, + "application/vnd.ah-barcode": { + "source": "apache" + }, + "application/vnd.ahead.space": { + "source": "iana", + "extensions": ["ahead"] + }, + "application/vnd.airzip.filesecure.azf": { + "source": "iana", + "extensions": ["azf"] + }, + "application/vnd.airzip.filesecure.azs": { + "source": "iana", + "extensions": ["azs"] + }, + "application/vnd.amadeus+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.amazon.ebook": { + "source": "apache", + "extensions": ["azw"] + }, + "application/vnd.amazon.mobi8-ebook": { + "source": "iana" + }, + "application/vnd.americandynamics.acc": { + "source": "iana", + "extensions": ["acc"] + }, + "application/vnd.amiga.ami": { + "source": "iana", + "extensions": ["ami"] + }, + "application/vnd.amundsen.maze+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.android.ota": { + "source": "iana" + }, + "application/vnd.android.package-archive": { + "source": "apache", + "compressible": false, + "extensions": ["apk"] + }, + "application/vnd.anki": { + "source": "iana" + }, + "application/vnd.anser-web-certificate-issue-initiation": { + "source": "iana", + "extensions": ["cii"] + }, + "application/vnd.anser-web-funds-transfer-initiation": { + "source": "apache", + "extensions": ["fti"] + }, + "application/vnd.antix.game-component": { + "source": "iana", + "extensions": ["atx"] + }, + "application/vnd.apache.arrow.file": { + "source": "iana" + }, + "application/vnd.apache.arrow.stream": { + "source": "iana" + }, + "application/vnd.apache.parquet": { + "source": "iana" + }, + "application/vnd.apache.thrift.binary": { + "source": "iana" + }, + "application/vnd.apache.thrift.compact": { + "source": "iana" + }, + "application/vnd.apache.thrift.json": { + "source": "iana" + }, + "application/vnd.apexlang": { + "source": "iana" + }, + "application/vnd.api+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.aplextor.warrp+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.apothekende.reservation+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.apple.installer+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpkg"] + }, + "application/vnd.apple.keynote": { + "source": "iana", + "extensions": ["key"] + }, + "application/vnd.apple.mpegurl": { + "source": "iana", + "extensions": ["m3u8"] + }, + "application/vnd.apple.numbers": { + "source": "iana", + "extensions": ["numbers"] + }, + "application/vnd.apple.pages": { + "source": "iana", + "extensions": ["pages"] + }, + "application/vnd.apple.pkpass": { + "compressible": false, + "extensions": ["pkpass"] + }, + "application/vnd.arastra.swi": { + "source": "apache" + }, + "application/vnd.aristanetworks.swi": { + "source": "iana", + "extensions": ["swi"] + }, + "application/vnd.artisan+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.artsquare": { + "source": "iana" + }, + "application/vnd.astraea-software.iota": { + "source": "iana", + "extensions": ["iota"] + }, + "application/vnd.audiograph": { + "source": "iana", + "extensions": ["aep"] + }, + "application/vnd.autodesk.fbx": { + "extensions": ["fbx"] + }, + "application/vnd.autopackage": { + "source": "iana" + }, + "application/vnd.avalon+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.avistar+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.balsamiq.bmml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["bmml"] + }, + "application/vnd.balsamiq.bmpr": { + "source": "iana" + }, + "application/vnd.banana-accounting": { + "source": "iana" + }, + "application/vnd.bbf.usp.error": { + "source": "iana" + }, + "application/vnd.bbf.usp.msg": { + "source": "iana" + }, + "application/vnd.bbf.usp.msg+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.bekitzur-stech+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.belightsoft.lhzd+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.belightsoft.lhzl+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.bint.med-content": { + "source": "iana" + }, + "application/vnd.biopax.rdf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.blink-idb-value-wrapper": { + "source": "iana" + }, + "application/vnd.blueice.multipass": { + "source": "iana", + "extensions": ["mpm"] + }, + "application/vnd.bluetooth.ep.oob": { + "source": "iana" + }, + "application/vnd.bluetooth.le.oob": { + "source": "iana" + }, + "application/vnd.bmi": { + "source": "iana", + "extensions": ["bmi"] + }, + "application/vnd.bpf": { + "source": "iana" + }, + "application/vnd.bpf3": { + "source": "iana" + }, + "application/vnd.businessobjects": { + "source": "iana", + "extensions": ["rep"] + }, + "application/vnd.byu.uapi+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.bzip3": { + "source": "iana" + }, + "application/vnd.c3voc.schedule+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.cab-jscript": { + "source": "iana" + }, + "application/vnd.canon-cpdl": { + "source": "iana" + }, + "application/vnd.canon-lips": { + "source": "iana" + }, + "application/vnd.capasystems-pg+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cendio.thinlinc.clientconf": { + "source": "iana" + }, + "application/vnd.century-systems.tcp_stream": { + "source": "iana" + }, + "application/vnd.chemdraw+xml": { + "source": "iana", + "compressible": true, + "extensions": ["cdxml"] + }, + "application/vnd.chess-pgn": { + "source": "iana" + }, + "application/vnd.chipnuts.karaoke-mmd": { + "source": "iana", + "extensions": ["mmd"] + }, + "application/vnd.ciedi": { + "source": "iana" + }, + "application/vnd.cinderella": { + "source": "iana", + "extensions": ["cdy"] + }, + "application/vnd.cirpack.isdn-ext": { + "source": "iana" + }, + "application/vnd.citationstyles.style+xml": { + "source": "iana", + "compressible": true, + "extensions": ["csl"] + }, + "application/vnd.claymore": { + "source": "iana", + "extensions": ["cla"] + }, + "application/vnd.cloanto.rp9": { + "source": "iana", + "extensions": ["rp9"] + }, + "application/vnd.clonk.c4group": { + "source": "iana", + "extensions": ["c4g","c4d","c4f","c4p","c4u"] + }, + "application/vnd.cluetrust.cartomobile-config": { + "source": "iana", + "extensions": ["c11amc"] + }, + "application/vnd.cluetrust.cartomobile-config-pkg": { + "source": "iana", + "extensions": ["c11amz"] + }, + "application/vnd.cncf.helm.chart.content.v1.tar+gzip": { + "source": "iana" + }, + "application/vnd.cncf.helm.chart.provenance.v1.prov": { + "source": "iana" + }, + "application/vnd.cncf.helm.config.v1+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.coffeescript": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.document": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.document-template": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.presentation": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.presentation-template": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet-template": { + "source": "iana" + }, + "application/vnd.collection+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.doc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.next+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.comicbook+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.comicbook-rar": { + "source": "iana" + }, + "application/vnd.commerce-battelle": { + "source": "iana" + }, + "application/vnd.commonspace": { + "source": "iana", + "extensions": ["csp"] + }, + "application/vnd.contact.cmsg": { + "source": "iana", + "extensions": ["cdbcmsg"] + }, + "application/vnd.coreos.ignition+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cosmocaller": { + "source": "iana", + "extensions": ["cmc"] + }, + "application/vnd.crick.clicker": { + "source": "iana", + "extensions": ["clkx"] + }, + "application/vnd.crick.clicker.keyboard": { + "source": "iana", + "extensions": ["clkk"] + }, + "application/vnd.crick.clicker.palette": { + "source": "iana", + "extensions": ["clkp"] + }, + "application/vnd.crick.clicker.template": { + "source": "iana", + "extensions": ["clkt"] + }, + "application/vnd.crick.clicker.wordbank": { + "source": "iana", + "extensions": ["clkw"] + }, + "application/vnd.criticaltools.wbs+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wbs"] + }, + "application/vnd.cryptii.pipe+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.crypto-shade-file": { + "source": "iana" + }, + "application/vnd.cryptomator.encrypted": { + "source": "iana" + }, + "application/vnd.cryptomator.vault": { + "source": "iana" + }, + "application/vnd.ctc-posml": { + "source": "iana", + "extensions": ["pml"] + }, + "application/vnd.ctct.ws+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.cups-pdf": { + "source": "iana" + }, + "application/vnd.cups-postscript": { + "source": "iana" + }, + "application/vnd.cups-ppd": { + "source": "iana", + "extensions": ["ppd"] + }, + "application/vnd.cups-raster": { + "source": "iana" + }, + "application/vnd.cups-raw": { + "source": "iana" + }, + "application/vnd.curl": { + "source": "iana" + }, + "application/vnd.curl.car": { + "source": "apache", + "extensions": ["car"] + }, + "application/vnd.curl.pcurl": { + "source": "apache", + "extensions": ["pcurl"] + }, + "application/vnd.cyan.dean.root+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.cybank": { + "source": "iana" + }, + "application/vnd.cyclonedx+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cyclonedx+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.d2l.coursepackage1p0+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.d3m-dataset": { + "source": "iana" + }, + "application/vnd.d3m-problem": { + "source": "iana" + }, + "application/vnd.dart": { + "source": "iana", + "compressible": true, + "extensions": ["dart"] + }, + "application/vnd.data-vision.rdz": { + "source": "iana", + "extensions": ["rdz"] + }, + "application/vnd.datalog": { + "source": "iana" + }, + "application/vnd.datapackage+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dataresource+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dbf": { + "source": "iana", + "extensions": ["dbf"] + }, + "application/vnd.dcmp+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dcmp"] + }, + "application/vnd.debian.binary-package": { + "source": "iana" + }, + "application/vnd.dece.data": { + "source": "iana", + "extensions": ["uvf","uvvf","uvd","uvvd"] + }, + "application/vnd.dece.ttml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["uvt","uvvt"] + }, + "application/vnd.dece.unspecified": { + "source": "iana", + "extensions": ["uvx","uvvx"] + }, + "application/vnd.dece.zip": { + "source": "iana", + "extensions": ["uvz","uvvz"] + }, + "application/vnd.denovo.fcselayout-link": { + "source": "iana", + "extensions": ["fe_launch"] + }, + "application/vnd.desmume.movie": { + "source": "iana" + }, + "application/vnd.dir-bi.plate-dl-nosuffix": { + "source": "iana" + }, + "application/vnd.dm.delegation+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dna": { + "source": "iana", + "extensions": ["dna"] + }, + "application/vnd.document+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dolby.mlp": { + "source": "apache", + "extensions": ["mlp"] + }, + "application/vnd.dolby.mobile.1": { + "source": "iana" + }, + "application/vnd.dolby.mobile.2": { + "source": "iana" + }, + "application/vnd.doremir.scorecloud-binary-document": { + "source": "iana" + }, + "application/vnd.dpgraph": { + "source": "iana", + "extensions": ["dpg"] + }, + "application/vnd.dreamfactory": { + "source": "iana", + "extensions": ["dfac"] + }, + "application/vnd.drive+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ds-keypoint": { + "source": "apache", + "extensions": ["kpxx"] + }, + "application/vnd.dtg.local": { + "source": "iana" + }, + "application/vnd.dtg.local.flash": { + "source": "iana" + }, + "application/vnd.dtg.local.html": { + "source": "iana" + }, + "application/vnd.dvb.ait": { + "source": "iana", + "extensions": ["ait"] + }, + "application/vnd.dvb.dvbisl+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.dvbj": { + "source": "iana" + }, + "application/vnd.dvb.esgcontainer": { + "source": "iana" + }, + "application/vnd.dvb.ipdcdftnotifaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess2": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgpdd": { + "source": "iana" + }, + "application/vnd.dvb.ipdcroaming": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-base": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-enhancement": { + "source": "iana" + }, + "application/vnd.dvb.notif-aggregate-root+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-container+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-generic+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-ia-msglist+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-ia-registration-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-ia-registration-response+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-init+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.pfr": { + "source": "iana" + }, + "application/vnd.dvb.service": { + "source": "iana", + "extensions": ["svc"] + }, + "application/vnd.dxr": { + "source": "iana" + }, + "application/vnd.dynageo": { + "source": "iana", + "extensions": ["geo"] + }, + "application/vnd.dzr": { + "source": "iana" + }, + "application/vnd.easykaraoke.cdgdownload": { + "source": "iana" + }, + "application/vnd.ecdis-update": { + "source": "iana" + }, + "application/vnd.ecip.rlp": { + "source": "iana" + }, + "application/vnd.eclipse.ditto+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ecowin.chart": { + "source": "iana", + "extensions": ["mag"] + }, + "application/vnd.ecowin.filerequest": { + "source": "iana" + }, + "application/vnd.ecowin.fileupdate": { + "source": "iana" + }, + "application/vnd.ecowin.series": { + "source": "iana" + }, + "application/vnd.ecowin.seriesrequest": { + "source": "iana" + }, + "application/vnd.ecowin.seriesupdate": { + "source": "iana" + }, + "application/vnd.efi.img": { + "source": "iana" + }, + "application/vnd.efi.iso": { + "source": "iana" + }, + "application/vnd.eln+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.emclient.accessrequest+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.enliven": { + "source": "iana", + "extensions": ["nml"] + }, + "application/vnd.enphase.envoy": { + "source": "iana" + }, + "application/vnd.eprints.data+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.epson.esf": { + "source": "iana", + "extensions": ["esf"] + }, + "application/vnd.epson.msf": { + "source": "iana", + "extensions": ["msf"] + }, + "application/vnd.epson.quickanime": { + "source": "iana", + "extensions": ["qam"] + }, + "application/vnd.epson.salt": { + "source": "iana", + "extensions": ["slt"] + }, + "application/vnd.epson.ssf": { + "source": "iana", + "extensions": ["ssf"] + }, + "application/vnd.ericsson.quickcall": { + "source": "iana" + }, + "application/vnd.erofs": { + "source": "iana" + }, + "application/vnd.espass-espass+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.eszigno3+xml": { + "source": "iana", + "compressible": true, + "extensions": ["es3","et3"] + }, + "application/vnd.etsi.aoc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.asic-e+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.etsi.asic-s+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.etsi.cug+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvcommand+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvdiscovery+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsad-bc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsad-cod+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsad-npvr+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvservice+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsync+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvueprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.mcid+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.mheg5": { + "source": "iana" + }, + "application/vnd.etsi.overload-control-policy-dataset+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.pstn+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.sci+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.simservs+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.timestamp-token": { + "source": "iana" + }, + "application/vnd.etsi.tsl+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.tsl.der": { + "source": "iana" + }, + "application/vnd.eu.kasparian.car+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.eudora.data": { + "source": "iana" + }, + "application/vnd.evolv.ecig.profile": { + "source": "iana" + }, + "application/vnd.evolv.ecig.settings": { + "source": "iana" + }, + "application/vnd.evolv.ecig.theme": { + "source": "iana" + }, + "application/vnd.exstream-empower+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.exstream-package": { + "source": "iana" + }, + "application/vnd.ezpix-album": { + "source": "iana", + "extensions": ["ez2"] + }, + "application/vnd.ezpix-package": { + "source": "iana", + "extensions": ["ez3"] + }, + "application/vnd.f-secure.mobile": { + "source": "iana" + }, + "application/vnd.familysearch.gedcom+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.fastcopy-disk-image": { + "source": "iana" + }, + "application/vnd.fdf": { + "source": "apache", + "extensions": ["fdf"] + }, + "application/vnd.fdsn.mseed": { + "source": "iana", + "extensions": ["mseed"] + }, + "application/vnd.fdsn.seed": { + "source": "iana", + "extensions": ["seed","dataless"] + }, + "application/vnd.fdsn.stationxml+xml": { + "source": "iana", + "charset": "XML-BASED", + "compressible": true + }, + "application/vnd.ffsns": { + "source": "iana" + }, + "application/vnd.ficlab.flb+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.filmit.zfc": { + "source": "iana" + }, + "application/vnd.fints": { + "source": "iana" + }, + "application/vnd.firemonkeys.cloudcell": { + "source": "iana" + }, + "application/vnd.flographit": { + "source": "iana", + "extensions": ["gph"] + }, + "application/vnd.fluxtime.clip": { + "source": "iana", + "extensions": ["ftc"] + }, + "application/vnd.font-fontforge-sfd": { + "source": "iana" + }, + "application/vnd.framemaker": { + "source": "iana", + "extensions": ["fm","frame","maker","book"] + }, + "application/vnd.freelog.comic": { + "source": "iana" + }, + "application/vnd.frogans.fnc": { + "source": "apache", + "extensions": ["fnc"] + }, + "application/vnd.frogans.ltf": { + "source": "apache", + "extensions": ["ltf"] + }, + "application/vnd.fsc.weblaunch": { + "source": "iana", + "extensions": ["fsc"] + }, + "application/vnd.fujifilm.fb.docuworks": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.docuworks.binder": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.docuworks.container": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.jfi+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.fujitsu.oasys": { + "source": "iana", + "extensions": ["oas"] + }, + "application/vnd.fujitsu.oasys2": { + "source": "iana", + "extensions": ["oa2"] + }, + "application/vnd.fujitsu.oasys3": { + "source": "iana", + "extensions": ["oa3"] + }, + "application/vnd.fujitsu.oasysgp": { + "source": "iana", + "extensions": ["fg5"] + }, + "application/vnd.fujitsu.oasysprs": { + "source": "iana", + "extensions": ["bh2"] + }, + "application/vnd.fujixerox.art-ex": { + "source": "iana" + }, + "application/vnd.fujixerox.art4": { + "source": "iana" + }, + "application/vnd.fujixerox.ddd": { + "source": "iana", + "extensions": ["ddd"] + }, + "application/vnd.fujixerox.docuworks": { + "source": "iana", + "extensions": ["xdw"] + }, + "application/vnd.fujixerox.docuworks.binder": { + "source": "iana", + "extensions": ["xbd"] + }, + "application/vnd.fujixerox.docuworks.container": { + "source": "iana" + }, + "application/vnd.fujixerox.hbpl": { + "source": "iana" + }, + "application/vnd.fut-misnet": { + "source": "iana" + }, + "application/vnd.futoin+cbor": { + "source": "iana" + }, + "application/vnd.futoin+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.fuzzysheet": { + "source": "iana", + "extensions": ["fzs"] + }, + "application/vnd.ga4gh.passport+jwt": { + "source": "iana" + }, + "application/vnd.genomatix.tuxedo": { + "source": "iana", + "extensions": ["txd"] + }, + "application/vnd.genozip": { + "source": "iana" + }, + "application/vnd.gentics.grd+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.gentoo.catmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.gentoo.ebuild": { + "source": "iana" + }, + "application/vnd.gentoo.eclass": { + "source": "iana" + }, + "application/vnd.gentoo.gpkg": { + "source": "iana" + }, + "application/vnd.gentoo.manifest": { + "source": "iana" + }, + "application/vnd.gentoo.pkgmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.gentoo.xpak": { + "source": "iana" + }, + "application/vnd.geo+json": { + "source": "apache", + "compressible": true + }, + "application/vnd.geocube+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.geogebra.file": { + "source": "iana", + "extensions": ["ggb"] + }, + "application/vnd.geogebra.pinboard": { + "source": "iana" + }, + "application/vnd.geogebra.slides": { + "source": "iana", + "extensions": ["ggs"] + }, + "application/vnd.geogebra.tool": { + "source": "iana", + "extensions": ["ggt"] + }, + "application/vnd.geometry-explorer": { + "source": "iana", + "extensions": ["gex","gre"] + }, + "application/vnd.geonext": { + "source": "iana", + "extensions": ["gxt"] + }, + "application/vnd.geoplan": { + "source": "iana", + "extensions": ["g2w"] + }, + "application/vnd.geospace": { + "source": "iana", + "extensions": ["g3w"] + }, + "application/vnd.gerber": { + "source": "iana" + }, + "application/vnd.globalplatform.card-content-mgt": { + "source": "iana" + }, + "application/vnd.globalplatform.card-content-mgt-response": { + "source": "iana" + }, + "application/vnd.gmx": { + "source": "iana", + "extensions": ["gmx"] + }, + "application/vnd.gnu.taler.exchange+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.gnu.taler.merchant+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.google-apps.audio": {}, + "application/vnd.google-apps.document": { + "compressible": false, + "extensions": ["gdoc"] + }, + "application/vnd.google-apps.drawing": { + "compressible": false, + "extensions": ["gdraw"] + }, + "application/vnd.google-apps.drive-sdk": { + "compressible": false + }, + "application/vnd.google-apps.file": {}, + "application/vnd.google-apps.folder": { + "compressible": false + }, + "application/vnd.google-apps.form": { + "compressible": false, + "extensions": ["gform"] + }, + "application/vnd.google-apps.fusiontable": {}, + "application/vnd.google-apps.jam": { + "compressible": false, + "extensions": ["gjam"] + }, + "application/vnd.google-apps.mail-layout": {}, + "application/vnd.google-apps.map": { + "compressible": false, + "extensions": ["gmap"] + }, + "application/vnd.google-apps.photo": {}, + "application/vnd.google-apps.presentation": { + "compressible": false, + "extensions": ["gslides"] + }, + "application/vnd.google-apps.script": { + "compressible": false, + "extensions": ["gscript"] + }, + "application/vnd.google-apps.shortcut": {}, + "application/vnd.google-apps.site": { + "compressible": false, + "extensions": ["gsite"] + }, + "application/vnd.google-apps.spreadsheet": { + "compressible": false, + "extensions": ["gsheet"] + }, + "application/vnd.google-apps.unknown": {}, + "application/vnd.google-apps.video": {}, + "application/vnd.google-earth.kml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["kml"] + }, + "application/vnd.google-earth.kmz": { + "source": "iana", + "compressible": false, + "extensions": ["kmz"] + }, + "application/vnd.gov.sk.e-form+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.gov.sk.e-form+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.gov.sk.xmldatacontainer+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdcf"] + }, + "application/vnd.gpxsee.map+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.grafeq": { + "source": "iana", + "extensions": ["gqf","gqs"] + }, + "application/vnd.gridmp": { + "source": "iana" + }, + "application/vnd.groove-account": { + "source": "iana", + "extensions": ["gac"] + }, + "application/vnd.groove-help": { + "source": "iana", + "extensions": ["ghf"] + }, + "application/vnd.groove-identity-message": { + "source": "iana", + "extensions": ["gim"] + }, + "application/vnd.groove-injector": { + "source": "iana", + "extensions": ["grv"] + }, + "application/vnd.groove-tool-message": { + "source": "iana", + "extensions": ["gtm"] + }, + "application/vnd.groove-tool-template": { + "source": "iana", + "extensions": ["tpl"] + }, + "application/vnd.groove-vcard": { + "source": "iana", + "extensions": ["vcg"] + }, + "application/vnd.hal+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hal+xml": { + "source": "iana", + "compressible": true, + "extensions": ["hal"] + }, + "application/vnd.handheld-entertainment+xml": { + "source": "iana", + "compressible": true, + "extensions": ["zmm"] + }, + "application/vnd.hbci": { + "source": "iana", + "extensions": ["hbci"] + }, + "application/vnd.hc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hcl-bireports": { + "source": "iana" + }, + "application/vnd.hdt": { + "source": "iana" + }, + "application/vnd.heroku+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hhe.lesson-player": { + "source": "iana", + "extensions": ["les"] + }, + "application/vnd.hp-hpgl": { + "source": "iana", + "extensions": ["hpgl"] + }, + "application/vnd.hp-hpid": { + "source": "iana", + "extensions": ["hpid"] + }, + "application/vnd.hp-hps": { + "source": "iana", + "extensions": ["hps"] + }, + "application/vnd.hp-jlyt": { + "source": "iana", + "extensions": ["jlt"] + }, + "application/vnd.hp-pcl": { + "source": "iana", + "extensions": ["pcl"] + }, + "application/vnd.hp-pclxl": { + "source": "iana", + "extensions": ["pclxl"] + }, + "application/vnd.hsl": { + "source": "iana" + }, + "application/vnd.httphone": { + "source": "iana" + }, + "application/vnd.hydrostatix.sof-data": { + "source": "iana", + "extensions": ["sfd-hdstx"] + }, + "application/vnd.hyper+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hyper-item+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hyperdrive+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hzn-3d-crossword": { + "source": "iana" + }, + "application/vnd.ibm.afplinedata": { + "source": "apache" + }, + "application/vnd.ibm.electronic-media": { + "source": "iana" + }, + "application/vnd.ibm.minipay": { + "source": "iana", + "extensions": ["mpy"] + }, + "application/vnd.ibm.modcap": { + "source": "apache", + "extensions": ["afp","listafp","list3820"] + }, + "application/vnd.ibm.rights-management": { + "source": "iana", + "extensions": ["irm"] + }, + "application/vnd.ibm.secure-container": { + "source": "iana", + "extensions": ["sc"] + }, + "application/vnd.iccprofile": { + "source": "iana", + "extensions": ["icc","icm"] + }, + "application/vnd.ieee.1905": { + "source": "iana" + }, + "application/vnd.igloader": { + "source": "iana", + "extensions": ["igl"] + }, + "application/vnd.imagemeter.folder+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.imagemeter.image+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.immervision-ivp": { + "source": "iana", + "extensions": ["ivp"] + }, + "application/vnd.immervision-ivu": { + "source": "iana", + "extensions": ["ivu"] + }, + "application/vnd.ims.imsccv1p1": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p2": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p3": { + "source": "iana" + }, + "application/vnd.ims.lis.v2.result+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolconsumerprofile+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy.id+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings.simple+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.informedcontrol.rms+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.informix-visionary": { + "source": "apache" + }, + "application/vnd.infotech.project": { + "source": "iana" + }, + "application/vnd.infotech.project+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.innopath.wamp.notification": { + "source": "iana" + }, + "application/vnd.insors.igm": { + "source": "iana", + "extensions": ["igm"] + }, + "application/vnd.intercon.formnet": { + "source": "iana", + "extensions": ["xpw","xpx"] + }, + "application/vnd.intergeo": { + "source": "iana", + "extensions": ["i2g"] + }, + "application/vnd.intertrust.digibox": { + "source": "iana" + }, + "application/vnd.intertrust.nncp": { + "source": "iana" + }, + "application/vnd.intu.qbo": { + "source": "iana", + "extensions": ["qbo"] + }, + "application/vnd.intu.qfx": { + "source": "iana", + "extensions": ["qfx"] + }, + "application/vnd.ipfs.ipns-record": { + "source": "iana" + }, + "application/vnd.ipld.car": { + "source": "iana" + }, + "application/vnd.ipld.dag-cbor": { + "source": "iana" + }, + "application/vnd.ipld.dag-json": { + "source": "iana" + }, + "application/vnd.ipld.raw": { + "source": "iana" + }, + "application/vnd.iptc.g2.catalogitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.conceptitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.knowledgeitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.newsitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.newsmessage+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.packageitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.planningitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ipunplugged.rcprofile": { + "source": "iana", + "extensions": ["rcprofile"] + }, + "application/vnd.irepository.package+xml": { + "source": "iana", + "compressible": true, + "extensions": ["irp"] + }, + "application/vnd.is-xpr": { + "source": "iana", + "extensions": ["xpr"] + }, + "application/vnd.isac.fcs": { + "source": "iana", + "extensions": ["fcs"] + }, + "application/vnd.iso11783-10+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.jam": { + "source": "iana", + "extensions": ["jam"] + }, + "application/vnd.japannet-directory-service": { + "source": "iana" + }, + "application/vnd.japannet-jpnstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-payment-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-registration": { + "source": "iana" + }, + "application/vnd.japannet-registration-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-setstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-verification": { + "source": "iana" + }, + "application/vnd.japannet-verification-wakeup": { + "source": "iana" + }, + "application/vnd.jcp.javame.midlet-rms": { + "source": "iana", + "extensions": ["rms"] + }, + "application/vnd.jisp": { + "source": "iana", + "extensions": ["jisp"] + }, + "application/vnd.joost.joda-archive": { + "source": "iana", + "extensions": ["joda"] + }, + "application/vnd.jsk.isdn-ngn": { + "source": "iana" + }, + "application/vnd.kahootz": { + "source": "iana", + "extensions": ["ktz","ktr"] + }, + "application/vnd.kde.karbon": { + "source": "iana", + "extensions": ["karbon"] + }, + "application/vnd.kde.kchart": { + "source": "iana", + "extensions": ["chrt"] + }, + "application/vnd.kde.kformula": { + "source": "iana", + "extensions": ["kfo"] + }, + "application/vnd.kde.kivio": { + "source": "iana", + "extensions": ["flw"] + }, + "application/vnd.kde.kontour": { + "source": "iana", + "extensions": ["kon"] + }, + "application/vnd.kde.kpresenter": { + "source": "iana", + "extensions": ["kpr","kpt"] + }, + "application/vnd.kde.kspread": { + "source": "iana", + "extensions": ["ksp"] + }, + "application/vnd.kde.kword": { + "source": "iana", + "extensions": ["kwd","kwt"] + }, + "application/vnd.kdl": { + "source": "iana" + }, + "application/vnd.kenameaapp": { + "source": "iana", + "extensions": ["htke"] + }, + "application/vnd.keyman.kmp+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.keyman.kmx": { + "source": "iana" + }, + "application/vnd.kidspiration": { + "source": "iana", + "extensions": ["kia"] + }, + "application/vnd.kinar": { + "source": "iana", + "extensions": ["kne","knp"] + }, + "application/vnd.koan": { + "source": "iana", + "extensions": ["skp","skd","skt","skm"] + }, + "application/vnd.kodak-descriptor": { + "source": "iana", + "extensions": ["sse"] + }, + "application/vnd.las": { + "source": "iana" + }, + "application/vnd.las.las+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.las.las+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lasxml"] + }, + "application/vnd.laszip": { + "source": "iana" + }, + "application/vnd.ldev.productlicensing": { + "source": "iana" + }, + "application/vnd.leap+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.liberty-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.llamagraphics.life-balance.desktop": { + "source": "iana", + "extensions": ["lbd"] + }, + "application/vnd.llamagraphics.life-balance.exchange+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lbe"] + }, + "application/vnd.logipipe.circuit+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.loom": { + "source": "iana" + }, + "application/vnd.lotus-1-2-3": { + "source": "iana", + "extensions": ["123"] + }, + "application/vnd.lotus-approach": { + "source": "iana", + "extensions": ["apr"] + }, + "application/vnd.lotus-freelance": { + "source": "iana", + "extensions": ["pre"] + }, + "application/vnd.lotus-notes": { + "source": "iana", + "extensions": ["nsf"] + }, + "application/vnd.lotus-organizer": { + "source": "iana", + "extensions": ["org"] + }, + "application/vnd.lotus-screencam": { + "source": "iana", + "extensions": ["scm"] + }, + "application/vnd.lotus-wordpro": { + "source": "iana", + "extensions": ["lwp"] + }, + "application/vnd.macports.portpkg": { + "source": "iana", + "extensions": ["portpkg"] + }, + "application/vnd.mapbox-vector-tile": { + "source": "iana", + "extensions": ["mvt"] + }, + "application/vnd.marlin.drm.actiontoken+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.marlin.drm.conftoken+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.marlin.drm.license+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.marlin.drm.mdcf": { + "source": "iana" + }, + "application/vnd.mason+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.maxar.archive.3tz+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.maxmind.maxmind-db": { + "source": "iana" + }, + "application/vnd.mcd": { + "source": "iana", + "extensions": ["mcd"] + }, + "application/vnd.mdl": { + "source": "iana" + }, + "application/vnd.mdl-mbsdf": { + "source": "iana" + }, + "application/vnd.medcalcdata": { + "source": "iana", + "extensions": ["mc1"] + }, + "application/vnd.mediastation.cdkey": { + "source": "iana", + "extensions": ["cdkey"] + }, + "application/vnd.medicalholodeck.recordxr": { + "source": "iana" + }, + "application/vnd.meridian-slingshot": { + "source": "iana" + }, + "application/vnd.mermaid": { + "source": "iana" + }, + "application/vnd.mfer": { + "source": "iana", + "extensions": ["mwf"] + }, + "application/vnd.mfmp": { + "source": "iana", + "extensions": ["mfm"] + }, + "application/vnd.micro+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.micrografx.flo": { + "source": "iana", + "extensions": ["flo"] + }, + "application/vnd.micrografx.igx": { + "source": "iana", + "extensions": ["igx"] + }, + "application/vnd.microsoft.portable-executable": { + "source": "iana" + }, + "application/vnd.microsoft.windows.thumbnail-cache": { + "source": "iana" + }, + "application/vnd.miele+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.mif": { + "source": "iana", + "extensions": ["mif"] + }, + "application/vnd.minisoft-hp3000-save": { + "source": "iana" + }, + "application/vnd.mitsubishi.misty-guard.trustweb": { + "source": "iana" + }, + "application/vnd.mobius.daf": { + "source": "iana", + "extensions": ["daf"] + }, + "application/vnd.mobius.dis": { + "source": "iana", + "extensions": ["dis"] + }, + "application/vnd.mobius.mbk": { + "source": "iana", + "extensions": ["mbk"] + }, + "application/vnd.mobius.mqy": { + "source": "iana", + "extensions": ["mqy"] + }, + "application/vnd.mobius.msl": { + "source": "iana", + "extensions": ["msl"] + }, + "application/vnd.mobius.plc": { + "source": "iana", + "extensions": ["plc"] + }, + "application/vnd.mobius.txf": { + "source": "iana", + "extensions": ["txf"] + }, + "application/vnd.modl": { + "source": "iana" + }, + "application/vnd.mophun.application": { + "source": "iana", + "extensions": ["mpn"] + }, + "application/vnd.mophun.certificate": { + "source": "iana", + "extensions": ["mpc"] + }, + "application/vnd.motorola.flexsuite": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.adsi": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.fis": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.gotap": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.kmr": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.ttc": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.wem": { + "source": "iana" + }, + "application/vnd.motorola.iprm": { + "source": "iana" + }, + "application/vnd.mozilla.xul+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xul"] + }, + "application/vnd.ms-3mfdocument": { + "source": "iana" + }, + "application/vnd.ms-artgalry": { + "source": "iana", + "extensions": ["cil"] + }, + "application/vnd.ms-asf": { + "source": "iana" + }, + "application/vnd.ms-cab-compressed": { + "source": "iana", + "extensions": ["cab"] + }, + "application/vnd.ms-color.iccprofile": { + "source": "apache" + }, + "application/vnd.ms-excel": { + "source": "iana", + "compressible": false, + "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] + }, + "application/vnd.ms-excel.addin.macroenabled.12": { + "source": "iana", + "extensions": ["xlam"] + }, + "application/vnd.ms-excel.sheet.binary.macroenabled.12": { + "source": "iana", + "extensions": ["xlsb"] + }, + "application/vnd.ms-excel.sheet.macroenabled.12": { + "source": "iana", + "extensions": ["xlsm"] + }, + "application/vnd.ms-excel.template.macroenabled.12": { + "source": "iana", + "extensions": ["xltm"] + }, + "application/vnd.ms-fontobject": { + "source": "iana", + "compressible": true, + "extensions": ["eot"] + }, + "application/vnd.ms-htmlhelp": { + "source": "iana", + "extensions": ["chm"] + }, + "application/vnd.ms-ims": { + "source": "iana", + "extensions": ["ims"] + }, + "application/vnd.ms-lrm": { + "source": "iana", + "extensions": ["lrm"] + }, + "application/vnd.ms-office.activex+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-officetheme": { + "source": "iana", + "extensions": ["thmx"] + }, + "application/vnd.ms-opentype": { + "source": "apache", + "compressible": true + }, + "application/vnd.ms-outlook": { + "compressible": false, + "extensions": ["msg"] + }, + "application/vnd.ms-package.obfuscated-opentype": { + "source": "apache" + }, + "application/vnd.ms-pki.seccat": { + "source": "apache", + "extensions": ["cat"] + }, + "application/vnd.ms-pki.stl": { + "source": "apache", + "extensions": ["stl"] + }, + "application/vnd.ms-playready.initiator+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-powerpoint": { + "source": "iana", + "compressible": false, + "extensions": ["ppt","pps","pot"] + }, + "application/vnd.ms-powerpoint.addin.macroenabled.12": { + "source": "iana", + "extensions": ["ppam"] + }, + "application/vnd.ms-powerpoint.presentation.macroenabled.12": { + "source": "iana", + "extensions": ["pptm"] + }, + "application/vnd.ms-powerpoint.slide.macroenabled.12": { + "source": "iana", + "extensions": ["sldm"] + }, + "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { + "source": "iana", + "extensions": ["ppsm"] + }, + "application/vnd.ms-powerpoint.template.macroenabled.12": { + "source": "iana", + "extensions": ["potm"] + }, + "application/vnd.ms-printdevicecapabilities+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-printing.printticket+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.ms-printschematicket+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-project": { + "source": "iana", + "extensions": ["mpp","mpt"] + }, + "application/vnd.ms-tnef": { + "source": "iana" + }, + "application/vnd.ms-visio.viewer": { + "extensions": ["vdx"] + }, + "application/vnd.ms-windows.devicepairing": { + "source": "iana" + }, + "application/vnd.ms-windows.nwprinting.oob": { + "source": "iana" + }, + "application/vnd.ms-windows.printerpairing": { + "source": "iana" + }, + "application/vnd.ms-windows.wsd.oob": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-resp": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-resp": { + "source": "iana" + }, + "application/vnd.ms-word.document.macroenabled.12": { + "source": "iana", + "extensions": ["docm"] + }, + "application/vnd.ms-word.template.macroenabled.12": { + "source": "iana", + "extensions": ["dotm"] + }, + "application/vnd.ms-works": { + "source": "iana", + "extensions": ["wps","wks","wcm","wdb"] + }, + "application/vnd.ms-wpl": { + "source": "iana", + "extensions": ["wpl"] + }, + "application/vnd.ms-xpsdocument": { + "source": "iana", + "compressible": false, + "extensions": ["xps"] + }, + "application/vnd.msa-disk-image": { + "source": "iana" + }, + "application/vnd.mseq": { + "source": "iana", + "extensions": ["mseq"] + }, + "application/vnd.msgpack": { + "source": "iana" + }, + "application/vnd.msign": { + "source": "iana" + }, + "application/vnd.multiad.creator": { + "source": "iana" + }, + "application/vnd.multiad.creator.cif": { + "source": "iana" + }, + "application/vnd.music-niff": { + "source": "iana" + }, + "application/vnd.musician": { + "source": "iana", + "extensions": ["mus"] + }, + "application/vnd.muvee.style": { + "source": "iana", + "extensions": ["msty"] + }, + "application/vnd.mynfc": { + "source": "iana", + "extensions": ["taglet"] + }, + "application/vnd.nacamar.ybrid+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.nato.bindingdataobject+cbor": { + "source": "iana" + }, + "application/vnd.nato.bindingdataobject+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.nato.bindingdataobject+xml": { + "source": "iana", + "compressible": true, + "extensions": ["bdo"] + }, + "application/vnd.nato.openxmlformats-package.iepd+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.ncd.control": { + "source": "iana" + }, + "application/vnd.ncd.reference": { + "source": "iana" + }, + "application/vnd.nearst.inv+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.nebumind.line": { + "source": "iana" + }, + "application/vnd.nervana": { + "source": "iana" + }, + "application/vnd.netfpx": { + "source": "iana" + }, + "application/vnd.neurolanguage.nlu": { + "source": "iana", + "extensions": ["nlu"] + }, + "application/vnd.nimn": { + "source": "iana" + }, + "application/vnd.nintendo.nitro.rom": { + "source": "iana" + }, + "application/vnd.nintendo.snes.rom": { + "source": "iana" + }, + "application/vnd.nitf": { + "source": "iana", + "extensions": ["ntf","nitf"] + }, + "application/vnd.noblenet-directory": { + "source": "iana", + "extensions": ["nnd"] + }, + "application/vnd.noblenet-sealer": { + "source": "iana", + "extensions": ["nns"] + }, + "application/vnd.noblenet-web": { + "source": "iana", + "extensions": ["nnw"] + }, + "application/vnd.nokia.catalogs": { + "source": "iana" + }, + "application/vnd.nokia.conml+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.conml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.iptv.config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.isds-radio-presets": { + "source": "iana" + }, + "application/vnd.nokia.landmark+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.landmark+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.landmarkcollection+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.n-gage.ac+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ac"] + }, + "application/vnd.nokia.n-gage.data": { + "source": "iana", + "extensions": ["ngdat"] + }, + "application/vnd.nokia.n-gage.symbian.install": { + "source": "apache", + "extensions": ["n-gage"] + }, + "application/vnd.nokia.ncd": { + "source": "iana" + }, + "application/vnd.nokia.pcd+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.pcd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.radio-preset": { + "source": "iana", + "extensions": ["rpst"] + }, + "application/vnd.nokia.radio-presets": { + "source": "iana", + "extensions": ["rpss"] + }, + "application/vnd.novadigm.edm": { + "source": "iana", + "extensions": ["edm"] + }, + "application/vnd.novadigm.edx": { + "source": "iana", + "extensions": ["edx"] + }, + "application/vnd.novadigm.ext": { + "source": "iana", + "extensions": ["ext"] + }, + "application/vnd.ntt-local.content-share": { + "source": "iana" + }, + "application/vnd.ntt-local.file-transfer": { + "source": "iana" + }, + "application/vnd.ntt-local.ogw_remote-access": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_remote": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_tcp_stream": { + "source": "iana" + }, + "application/vnd.oai.workflows": { + "source": "iana" + }, + "application/vnd.oai.workflows+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oai.workflows+yaml": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.base": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.chart": { + "source": "iana", + "extensions": ["odc"] + }, + "application/vnd.oasis.opendocument.chart-template": { + "source": "iana", + "extensions": ["otc"] + }, + "application/vnd.oasis.opendocument.database": { + "source": "apache", + "extensions": ["odb"] + }, + "application/vnd.oasis.opendocument.formula": { + "source": "iana", + "extensions": ["odf"] + }, + "application/vnd.oasis.opendocument.formula-template": { + "source": "iana", + "extensions": ["odft"] + }, + "application/vnd.oasis.opendocument.graphics": { + "source": "iana", + "compressible": false, + "extensions": ["odg"] + }, + "application/vnd.oasis.opendocument.graphics-template": { + "source": "iana", + "extensions": ["otg"] + }, + "application/vnd.oasis.opendocument.image": { + "source": "iana", + "extensions": ["odi"] + }, + "application/vnd.oasis.opendocument.image-template": { + "source": "iana", + "extensions": ["oti"] + }, + "application/vnd.oasis.opendocument.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["odp"] + }, + "application/vnd.oasis.opendocument.presentation-template": { + "source": "iana", + "extensions": ["otp"] + }, + "application/vnd.oasis.opendocument.spreadsheet": { + "source": "iana", + "compressible": false, + "extensions": ["ods"] + }, + "application/vnd.oasis.opendocument.spreadsheet-template": { + "source": "iana", + "extensions": ["ots"] + }, + "application/vnd.oasis.opendocument.text": { + "source": "iana", + "compressible": false, + "extensions": ["odt"] + }, + "application/vnd.oasis.opendocument.text-master": { + "source": "iana", + "extensions": ["odm"] + }, + "application/vnd.oasis.opendocument.text-master-template": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.text-template": { + "source": "iana", + "extensions": ["ott"] + }, + "application/vnd.oasis.opendocument.text-web": { + "source": "iana", + "extensions": ["oth"] + }, + "application/vnd.obn": { + "source": "iana" + }, + "application/vnd.ocf+cbor": { + "source": "iana" + }, + "application/vnd.oci.image.manifest.v1+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oftn.l10n+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.contentaccessdownload+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.contentaccessstreaming+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.cspg-hexbinary": { + "source": "iana" + }, + "application/vnd.oipf.dae.svg+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.dae.xhtml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.mippvcontrolmessage+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.pae.gem": { + "source": "iana" + }, + "application/vnd.oipf.spdiscovery+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.spdlist+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.ueprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.userprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.olpc-sugar": { + "source": "iana", + "extensions": ["xo"] + }, + "application/vnd.oma-scws-config": { + "source": "iana" + }, + "application/vnd.oma-scws-http-request": { + "source": "iana" + }, + "application/vnd.oma-scws-http-response": { + "source": "iana" + }, + "application/vnd.oma.bcast.associated-procedure-parameter+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.drm-trigger+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.oma.bcast.imd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.ltkm": { + "source": "iana" + }, + "application/vnd.oma.bcast.notification+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.provisioningtrigger": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgboot": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgdd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.sgdu": { + "source": "iana" + }, + "application/vnd.oma.bcast.simple-symbol-container": { + "source": "iana" + }, + "application/vnd.oma.bcast.smartcard-trigger+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.oma.bcast.sprov+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.stkm": { + "source": "iana" + }, + "application/vnd.oma.cab-address-book+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-feature-handler+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-pcc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-subs-invite+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-user-prefs+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.dcd": { + "source": "iana" + }, + "application/vnd.oma.dcdc": { + "source": "iana" + }, + "application/vnd.oma.dd2+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dd2"] + }, + "application/vnd.oma.drm.risd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.group-usage-list+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.lwm2m+cbor": { + "source": "iana" + }, + "application/vnd.oma.lwm2m+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.lwm2m+tlv": { + "source": "iana" + }, + "application/vnd.oma.pal+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.detailed-progress-report+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.final-report+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.groups+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.invocation-descriptor+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.optimized-progress-report+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.push": { + "source": "iana" + }, + "application/vnd.oma.scidm.messages+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.xcap-directory+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.omads-email+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.omads-file+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.omads-folder+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.omaloc-supl-init": { + "source": "iana" + }, + "application/vnd.onepager": { + "source": "iana" + }, + "application/vnd.onepagertamp": { + "source": "iana" + }, + "application/vnd.onepagertamx": { + "source": "iana" + }, + "application/vnd.onepagertat": { + "source": "iana" + }, + "application/vnd.onepagertatp": { + "source": "iana" + }, + "application/vnd.onepagertatx": { + "source": "iana" + }, + "application/vnd.onvif.metadata": { + "source": "iana" + }, + "application/vnd.openblox.game+xml": { + "source": "iana", + "compressible": true, + "extensions": ["obgx"] + }, + "application/vnd.openblox.game-binary": { + "source": "iana" + }, + "application/vnd.openeye.oeb": { + "source": "iana" + }, + "application/vnd.openofficeorg.extension": { + "source": "apache", + "extensions": ["oxt"] + }, + "application/vnd.openstreetmap.data+xml": { + "source": "iana", + "compressible": true, + "extensions": ["osm"] + }, + "application/vnd.opentimestamps.ots": { + "source": "iana" + }, + "application/vnd.openvpi.dspx+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.custom-properties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawing+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.extended-properties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["pptx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide": { + "source": "iana", + "extensions": ["sldx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { + "source": "iana", + "extensions": ["ppsx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.template": { + "source": "iana", + "extensions": ["potx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { + "source": "iana", + "compressible": false, + "extensions": ["xlsx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { + "source": "iana", + "extensions": ["xltx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.theme+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.themeoverride+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.vmldrawing": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { + "source": "iana", + "compressible": false, + "extensions": ["docx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { + "source": "iana", + "extensions": ["dotx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-package.core-properties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-package.relationships+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oracle.resource+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.orange.indata": { + "source": "iana" + }, + "application/vnd.osa.netdeploy": { + "source": "iana" + }, + "application/vnd.osgeo.mapguide.package": { + "source": "iana", + "extensions": ["mgp"] + }, + "application/vnd.osgi.bundle": { + "source": "iana" + }, + "application/vnd.osgi.dp": { + "source": "iana", + "extensions": ["dp"] + }, + "application/vnd.osgi.subsystem": { + "source": "iana", + "extensions": ["esa"] + }, + "application/vnd.otps.ct-kip+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oxli.countgraph": { + "source": "iana" + }, + "application/vnd.pagerduty+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.palm": { + "source": "iana", + "extensions": ["pdb","pqa","oprc"] + }, + "application/vnd.panoply": { + "source": "iana" + }, + "application/vnd.paos.xml": { + "source": "iana" + }, + "application/vnd.patentdive": { + "source": "iana" + }, + "application/vnd.patientecommsdoc": { + "source": "iana" + }, + "application/vnd.pawaafile": { + "source": "iana", + "extensions": ["paw"] + }, + "application/vnd.pcos": { + "source": "iana" + }, + "application/vnd.pg.format": { + "source": "iana", + "extensions": ["str"] + }, + "application/vnd.pg.osasli": { + "source": "iana", + "extensions": ["ei6"] + }, + "application/vnd.piaccess.application-licence": { + "source": "iana" + }, + "application/vnd.picsel": { + "source": "iana", + "extensions": ["efif"] + }, + "application/vnd.pmi.widget": { + "source": "iana", + "extensions": ["wg"] + }, + "application/vnd.poc.group-advertisement+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.pocketlearn": { + "source": "iana", + "extensions": ["plf"] + }, + "application/vnd.powerbuilder6": { + "source": "iana", + "extensions": ["pbd"] + }, + "application/vnd.powerbuilder6-s": { + "source": "iana" + }, + "application/vnd.powerbuilder7": { + "source": "iana" + }, + "application/vnd.powerbuilder7-s": { + "source": "iana" + }, + "application/vnd.powerbuilder75": { + "source": "iana" + }, + "application/vnd.powerbuilder75-s": { + "source": "iana" + }, + "application/vnd.preminet": { + "source": "iana" + }, + "application/vnd.previewsystems.box": { + "source": "iana", + "extensions": ["box"] + }, + "application/vnd.procrate.brushset": { + "extensions": ["brushset"] + }, + "application/vnd.procreate.brush": { + "extensions": ["brush"] + }, + "application/vnd.procreate.dream": { + "extensions": ["drm"] + }, + "application/vnd.proteus.magazine": { + "source": "iana", + "extensions": ["mgz"] + }, + "application/vnd.psfs": { + "source": "iana" + }, + "application/vnd.pt.mundusmundi": { + "source": "iana" + }, + "application/vnd.publishare-delta-tree": { + "source": "iana", + "extensions": ["qps"] + }, + "application/vnd.pvi.ptid1": { + "source": "iana", + "extensions": ["ptid"] + }, + "application/vnd.pwg-multiplexed": { + "source": "iana" + }, + "application/vnd.pwg-xhtml-print+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xhtm"] + }, + "application/vnd.qualcomm.brew-app-res": { + "source": "iana" + }, + "application/vnd.quarantainenet": { + "source": "iana" + }, + "application/vnd.quark.quarkxpress": { + "source": "iana", + "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"] + }, + "application/vnd.quobject-quoxdocument": { + "source": "iana" + }, + "application/vnd.radisys.moml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-conf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-conn+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-dialog+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-stream+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-conf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-base+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-fax-detect+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-group+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-speech+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-transform+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.rainstor.data": { + "source": "iana" + }, + "application/vnd.rapid": { + "source": "iana" + }, + "application/vnd.rar": { + "source": "iana", + "extensions": ["rar"] + }, + "application/vnd.realvnc.bed": { + "source": "iana", + "extensions": ["bed"] + }, + "application/vnd.recordare.musicxml": { + "source": "iana", + "extensions": ["mxl"] + }, + "application/vnd.recordare.musicxml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["musicxml"] + }, + "application/vnd.relpipe": { + "source": "iana" + }, + "application/vnd.renlearn.rlprint": { + "source": "iana" + }, + "application/vnd.resilient.logic": { + "source": "iana" + }, + "application/vnd.restful+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.rig.cryptonote": { + "source": "iana", + "extensions": ["cryptonote"] + }, + "application/vnd.rim.cod": { + "source": "apache", + "extensions": ["cod"] + }, + "application/vnd.rn-realmedia": { + "source": "apache", + "extensions": ["rm"] + }, + "application/vnd.rn-realmedia-vbr": { + "source": "apache", + "extensions": ["rmvb"] + }, + "application/vnd.route66.link66+xml": { + "source": "iana", + "compressible": true, + "extensions": ["link66"] + }, + "application/vnd.rs-274x": { + "source": "iana" + }, + "application/vnd.ruckus.download": { + "source": "iana" + }, + "application/vnd.s3sms": { + "source": "iana" + }, + "application/vnd.sailingtracker.track": { + "source": "iana", + "extensions": ["st"] + }, + "application/vnd.sar": { + "source": "iana" + }, + "application/vnd.sbm.cid": { + "source": "iana" + }, + "application/vnd.sbm.mid2": { + "source": "iana" + }, + "application/vnd.scribus": { + "source": "iana" + }, + "application/vnd.sealed.3df": { + "source": "iana" + }, + "application/vnd.sealed.csf": { + "source": "iana" + }, + "application/vnd.sealed.doc": { + "source": "iana" + }, + "application/vnd.sealed.eml": { + "source": "iana" + }, + "application/vnd.sealed.mht": { + "source": "iana" + }, + "application/vnd.sealed.net": { + "source": "iana" + }, + "application/vnd.sealed.ppt": { + "source": "iana" + }, + "application/vnd.sealed.tiff": { + "source": "iana" + }, + "application/vnd.sealed.xls": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal.html": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal.pdf": { + "source": "iana" + }, + "application/vnd.seemail": { + "source": "iana", + "extensions": ["see"] + }, + "application/vnd.seis+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.sema": { + "source": "iana", + "extensions": ["sema"] + }, + "application/vnd.semd": { + "source": "iana", + "extensions": ["semd"] + }, + "application/vnd.semf": { + "source": "iana", + "extensions": ["semf"] + }, + "application/vnd.shade-save-file": { + "source": "iana" + }, + "application/vnd.shana.informed.formdata": { + "source": "iana", + "extensions": ["ifm"] + }, + "application/vnd.shana.informed.formtemplate": { + "source": "iana", + "extensions": ["itp"] + }, + "application/vnd.shana.informed.interchange": { + "source": "iana", + "extensions": ["iif"] + }, + "application/vnd.shana.informed.package": { + "source": "iana", + "extensions": ["ipk"] + }, + "application/vnd.shootproof+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.shopkick+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.shp": { + "source": "iana" + }, + "application/vnd.shx": { + "source": "iana" + }, + "application/vnd.sigrok.session": { + "source": "iana" + }, + "application/vnd.simtech-mindmapper": { + "source": "iana", + "extensions": ["twd","twds"] + }, + "application/vnd.siren+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.sketchometry": { + "source": "iana" + }, + "application/vnd.smaf": { + "source": "iana", + "extensions": ["mmf"] + }, + "application/vnd.smart.notebook": { + "source": "iana" + }, + "application/vnd.smart.teacher": { + "source": "iana", + "extensions": ["teacher"] + }, + "application/vnd.smintio.portals.archive": { + "source": "iana" + }, + "application/vnd.snesdev-page-table": { + "source": "iana" + }, + "application/vnd.software602.filler.form+xml": { + "source": "iana", + "compressible": true, + "extensions": ["fo"] + }, + "application/vnd.software602.filler.form-xml-zip": { + "source": "iana" + }, + "application/vnd.solent.sdkm+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sdkm","sdkd"] + }, + "application/vnd.spotfire.dxp": { + "source": "iana", + "extensions": ["dxp"] + }, + "application/vnd.spotfire.sfs": { + "source": "iana", + "extensions": ["sfs"] + }, + "application/vnd.sqlite3": { + "source": "iana" + }, + "application/vnd.sss-cod": { + "source": "iana" + }, + "application/vnd.sss-dtf": { + "source": "iana" + }, + "application/vnd.sss-ntf": { + "source": "iana" + }, + "application/vnd.stardivision.calc": { + "source": "apache", + "extensions": ["sdc"] + }, + "application/vnd.stardivision.draw": { + "source": "apache", + "extensions": ["sda"] + }, + "application/vnd.stardivision.impress": { + "source": "apache", + "extensions": ["sdd"] + }, + "application/vnd.stardivision.math": { + "source": "apache", + "extensions": ["smf"] + }, + "application/vnd.stardivision.writer": { + "source": "apache", + "extensions": ["sdw","vor"] + }, + "application/vnd.stardivision.writer-global": { + "source": "apache", + "extensions": ["sgl"] + }, + "application/vnd.stepmania.package": { + "source": "iana", + "extensions": ["smzip"] + }, + "application/vnd.stepmania.stepchart": { + "source": "iana", + "extensions": ["sm"] + }, + "application/vnd.street-stream": { + "source": "iana" + }, + "application/vnd.sun.wadl+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wadl"] + }, + "application/vnd.sun.xml.calc": { + "source": "apache", + "extensions": ["sxc"] + }, + "application/vnd.sun.xml.calc.template": { + "source": "apache", + "extensions": ["stc"] + }, + "application/vnd.sun.xml.draw": { + "source": "apache", + "extensions": ["sxd"] + }, + "application/vnd.sun.xml.draw.template": { + "source": "apache", + "extensions": ["std"] + }, + "application/vnd.sun.xml.impress": { + "source": "apache", + "extensions": ["sxi"] + }, + "application/vnd.sun.xml.impress.template": { + "source": "apache", + "extensions": ["sti"] + }, + "application/vnd.sun.xml.math": { + "source": "apache", + "extensions": ["sxm"] + }, + "application/vnd.sun.xml.writer": { + "source": "apache", + "extensions": ["sxw"] + }, + "application/vnd.sun.xml.writer.global": { + "source": "apache", + "extensions": ["sxg"] + }, + "application/vnd.sun.xml.writer.template": { + "source": "apache", + "extensions": ["stw"] + }, + "application/vnd.sus-calendar": { + "source": "iana", + "extensions": ["sus","susp"] + }, + "application/vnd.svd": { + "source": "iana", + "extensions": ["svd"] + }, + "application/vnd.swiftview-ics": { + "source": "iana" + }, + "application/vnd.sybyl.mol2": { + "source": "iana" + }, + "application/vnd.sycle+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.syft+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.symbian.install": { + "source": "apache", + "extensions": ["sis","sisx"] + }, + "application/vnd.syncml+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["xsm"] + }, + "application/vnd.syncml.dm+wbxml": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["bdm"] + }, + "application/vnd.syncml.dm+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["xdm"] + }, + "application/vnd.syncml.dm.notification": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["ddf"] + }, + "application/vnd.syncml.dmtnds+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmtnds+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.syncml.ds.notification": { + "source": "iana" + }, + "application/vnd.tableschema+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.tao.intent-module-archive": { + "source": "iana", + "extensions": ["tao"] + }, + "application/vnd.tcpdump.pcap": { + "source": "iana", + "extensions": ["pcap","cap","dmp"] + }, + "application/vnd.think-cell.ppttc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.tmd.mediaflex.api+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.tml": { + "source": "iana" + }, + "application/vnd.tmobile-livetv": { + "source": "iana", + "extensions": ["tmo"] + }, + "application/vnd.tri.onesource": { + "source": "iana" + }, + "application/vnd.trid.tpt": { + "source": "iana", + "extensions": ["tpt"] + }, + "application/vnd.triscape.mxs": { + "source": "iana", + "extensions": ["mxs"] + }, + "application/vnd.trueapp": { + "source": "iana", + "extensions": ["tra"] + }, + "application/vnd.truedoc": { + "source": "iana" + }, + "application/vnd.ubisoft.webplayer": { + "source": "iana" + }, + "application/vnd.ufdl": { + "source": "iana", + "extensions": ["ufd","ufdl"] + }, + "application/vnd.uic.osdm+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.uiq.theme": { + "source": "iana", + "extensions": ["utz"] + }, + "application/vnd.umajin": { + "source": "iana", + "extensions": ["umj"] + }, + "application/vnd.unity": { + "source": "iana", + "extensions": ["unityweb"] + }, + "application/vnd.uoml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["uoml","uo"] + }, + "application/vnd.uplanet.alert": { + "source": "iana" + }, + "application/vnd.uplanet.alert-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.channel": { + "source": "iana" + }, + "application/vnd.uplanet.channel-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.list": { + "source": "iana" + }, + "application/vnd.uplanet.list-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.signal": { + "source": "iana" + }, + "application/vnd.uri-map": { + "source": "iana" + }, + "application/vnd.valve.source.material": { + "source": "iana" + }, + "application/vnd.vcx": { + "source": "iana", + "extensions": ["vcx"] + }, + "application/vnd.vd-study": { + "source": "iana" + }, + "application/vnd.vectorworks": { + "source": "iana" + }, + "application/vnd.vel+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.veraison.tsm-report+cbor": { + "source": "iana" + }, + "application/vnd.veraison.tsm-report+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.verimatrix.vcas": { + "source": "iana" + }, + "application/vnd.veritone.aion+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.veryant.thin": { + "source": "iana" + }, + "application/vnd.ves.encrypted": { + "source": "iana" + }, + "application/vnd.vidsoft.vidconference": { + "source": "iana" + }, + "application/vnd.visio": { + "source": "iana", + "extensions": ["vsd","vst","vss","vsw","vsdx","vtx"] + }, + "application/vnd.visionary": { + "source": "iana", + "extensions": ["vis"] + }, + "application/vnd.vividence.scriptfile": { + "source": "iana" + }, + "application/vnd.vocalshaper.vsp4": { + "source": "iana" + }, + "application/vnd.vsf": { + "source": "iana", + "extensions": ["vsf"] + }, + "application/vnd.wap.sic": { + "source": "iana" + }, + "application/vnd.wap.slc": { + "source": "iana" + }, + "application/vnd.wap.wbxml": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["wbxml"] + }, + "application/vnd.wap.wmlc": { + "source": "iana", + "extensions": ["wmlc"] + }, + "application/vnd.wap.wmlscriptc": { + "source": "iana", + "extensions": ["wmlsc"] + }, + "application/vnd.wasmflow.wafl": { + "source": "iana" + }, + "application/vnd.webturbo": { + "source": "iana", + "extensions": ["wtb"] + }, + "application/vnd.wfa.dpp": { + "source": "iana" + }, + "application/vnd.wfa.p2p": { + "source": "iana" + }, + "application/vnd.wfa.wsc": { + "source": "iana" + }, + "application/vnd.windows.devicepairing": { + "source": "iana" + }, + "application/vnd.wmc": { + "source": "iana" + }, + "application/vnd.wmf.bootstrap": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica.package": { + "source": "iana" + }, + "application/vnd.wolfram.player": { + "source": "iana", + "extensions": ["nbp"] + }, + "application/vnd.wordlift": { + "source": "iana" + }, + "application/vnd.wordperfect": { + "source": "iana", + "extensions": ["wpd"] + }, + "application/vnd.wqd": { + "source": "iana", + "extensions": ["wqd"] + }, + "application/vnd.wrq-hp3000-labelled": { + "source": "iana" + }, + "application/vnd.wt.stf": { + "source": "iana", + "extensions": ["stf"] + }, + "application/vnd.wv.csp+wbxml": { + "source": "iana" + }, + "application/vnd.wv.csp+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.wv.ssp+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.xacml+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.xara": { + "source": "iana", + "extensions": ["xar"] + }, + "application/vnd.xarin.cpj": { + "source": "iana" + }, + "application/vnd.xecrets-encrypted": { + "source": "iana" + }, + "application/vnd.xfdl": { + "source": "iana", + "extensions": ["xfdl"] + }, + "application/vnd.xfdl.webform": { + "source": "iana" + }, + "application/vnd.xmi+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.xmpie.cpkg": { + "source": "iana" + }, + "application/vnd.xmpie.dpkg": { + "source": "iana" + }, + "application/vnd.xmpie.plan": { + "source": "iana" + }, + "application/vnd.xmpie.ppkg": { + "source": "iana" + }, + "application/vnd.xmpie.xlim": { + "source": "iana" + }, + "application/vnd.yamaha.hv-dic": { + "source": "iana", + "extensions": ["hvd"] + }, + "application/vnd.yamaha.hv-script": { + "source": "iana", + "extensions": ["hvs"] + }, + "application/vnd.yamaha.hv-voice": { + "source": "iana", + "extensions": ["hvp"] + }, + "application/vnd.yamaha.openscoreformat": { + "source": "iana", + "extensions": ["osf"] + }, + "application/vnd.yamaha.openscoreformat.osfpvg+xml": { + "source": "iana", + "compressible": true, + "extensions": ["osfpvg"] + }, + "application/vnd.yamaha.remote-setup": { + "source": "iana" + }, + "application/vnd.yamaha.smaf-audio": { + "source": "iana", + "extensions": ["saf"] + }, + "application/vnd.yamaha.smaf-phrase": { + "source": "iana", + "extensions": ["spf"] + }, + "application/vnd.yamaha.through-ngn": { + "source": "iana" + }, + "application/vnd.yamaha.tunnel-udpencap": { + "source": "iana" + }, + "application/vnd.yaoweme": { + "source": "iana" + }, + "application/vnd.yellowriver-custom-menu": { + "source": "iana", + "extensions": ["cmp"] + }, + "application/vnd.zul": { + "source": "iana", + "extensions": ["zir","zirz"] + }, + "application/vnd.zzazz.deck+xml": { + "source": "iana", + "compressible": true, + "extensions": ["zaz"] + }, + "application/voicexml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["vxml"] + }, + "application/voucher-cms+json": { + "source": "iana", + "compressible": true + }, + "application/voucher-jws+json": { + "source": "iana", + "compressible": true + }, + "application/vp": { + "source": "iana" + }, + "application/vp+cose": { + "source": "iana" + }, + "application/vp+jwt": { + "source": "iana" + }, + "application/vq-rtcpxr": { + "source": "iana" + }, + "application/wasm": { + "source": "iana", + "compressible": true, + "extensions": ["wasm"] + }, + "application/watcherinfo+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wif"] + }, + "application/webpush-options+json": { + "source": "iana", + "compressible": true + }, + "application/whoispp-query": { + "source": "iana" + }, + "application/whoispp-response": { + "source": "iana" + }, + "application/widget": { + "source": "iana", + "extensions": ["wgt"] + }, + "application/winhlp": { + "source": "apache", + "extensions": ["hlp"] + }, + "application/wita": { + "source": "iana" + }, + "application/wordperfect5.1": { + "source": "iana" + }, + "application/wsdl+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wsdl"] + }, + "application/wspolicy+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wspolicy"] + }, + "application/x-7z-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["7z"] + }, + "application/x-abiword": { + "source": "apache", + "extensions": ["abw"] + }, + "application/x-ace-compressed": { + "source": "apache", + "extensions": ["ace"] + }, + "application/x-amf": { + "source": "apache" + }, + "application/x-apple-diskimage": { + "source": "apache", + "extensions": ["dmg"] + }, + "application/x-arj": { + "compressible": false, + "extensions": ["arj"] + }, + "application/x-authorware-bin": { + "source": "apache", + "extensions": ["aab","x32","u32","vox"] + }, + "application/x-authorware-map": { + "source": "apache", + "extensions": ["aam"] + }, + "application/x-authorware-seg": { + "source": "apache", + "extensions": ["aas"] + }, + "application/x-bcpio": { + "source": "apache", + "extensions": ["bcpio"] + }, + "application/x-bdoc": { + "compressible": false, + "extensions": ["bdoc"] + }, + "application/x-bittorrent": { + "source": "apache", + "extensions": ["torrent"] + }, + "application/x-blender": { + "extensions": ["blend"] + }, + "application/x-blorb": { + "source": "apache", + "extensions": ["blb","blorb"] + }, + "application/x-bzip": { + "source": "apache", + "compressible": false, + "extensions": ["bz"] + }, + "application/x-bzip2": { + "source": "apache", + "compressible": false, + "extensions": ["bz2","boz"] + }, + "application/x-cbr": { + "source": "apache", + "extensions": ["cbr","cba","cbt","cbz","cb7"] + }, + "application/x-cdlink": { + "source": "apache", + "extensions": ["vcd"] + }, + "application/x-cfs-compressed": { + "source": "apache", + "extensions": ["cfs"] + }, + "application/x-chat": { + "source": "apache", + "extensions": ["chat"] + }, + "application/x-chess-pgn": { + "source": "apache", + "extensions": ["pgn"] + }, + "application/x-chrome-extension": { + "extensions": ["crx"] + }, + "application/x-cocoa": { + "source": "nginx", + "extensions": ["cco"] + }, + "application/x-compress": { + "source": "apache" + }, + "application/x-compressed": { + "extensions": ["rar"] + }, + "application/x-conference": { + "source": "apache", + "extensions": ["nsc"] + }, + "application/x-cpio": { + "source": "apache", + "extensions": ["cpio"] + }, + "application/x-csh": { + "source": "apache", + "extensions": ["csh"] + }, + "application/x-deb": { + "compressible": false + }, + "application/x-debian-package": { + "source": "apache", + "extensions": ["deb","udeb"] + }, + "application/x-dgc-compressed": { + "source": "apache", + "extensions": ["dgc"] + }, + "application/x-director": { + "source": "apache", + "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"] + }, + "application/x-doom": { + "source": "apache", + "extensions": ["wad"] + }, + "application/x-dtbncx+xml": { + "source": "apache", + "compressible": true, + "extensions": ["ncx"] + }, + "application/x-dtbook+xml": { + "source": "apache", + "compressible": true, + "extensions": ["dtb"] + }, + "application/x-dtbresource+xml": { + "source": "apache", + "compressible": true, + "extensions": ["res"] + }, + "application/x-dvi": { + "source": "apache", + "compressible": false, + "extensions": ["dvi"] + }, + "application/x-envoy": { + "source": "apache", + "extensions": ["evy"] + }, + "application/x-eva": { + "source": "apache", + "extensions": ["eva"] + }, + "application/x-font-bdf": { + "source": "apache", + "extensions": ["bdf"] + }, + "application/x-font-dos": { + "source": "apache" + }, + "application/x-font-framemaker": { + "source": "apache" + }, + "application/x-font-ghostscript": { + "source": "apache", + "extensions": ["gsf"] + }, + "application/x-font-libgrx": { + "source": "apache" + }, + "application/x-font-linux-psf": { + "source": "apache", + "extensions": ["psf"] + }, + "application/x-font-pcf": { + "source": "apache", + "extensions": ["pcf"] + }, + "application/x-font-snf": { + "source": "apache", + "extensions": ["snf"] + }, + "application/x-font-speedo": { + "source": "apache" + }, + "application/x-font-sunos-news": { + "source": "apache" + }, + "application/x-font-type1": { + "source": "apache", + "extensions": ["pfa","pfb","pfm","afm"] + }, + "application/x-font-vfont": { + "source": "apache" + }, + "application/x-freearc": { + "source": "apache", + "extensions": ["arc"] + }, + "application/x-futuresplash": { + "source": "apache", + "extensions": ["spl"] + }, + "application/x-gca-compressed": { + "source": "apache", + "extensions": ["gca"] + }, + "application/x-glulx": { + "source": "apache", + "extensions": ["ulx"] + }, + "application/x-gnumeric": { + "source": "apache", + "extensions": ["gnumeric"] + }, + "application/x-gramps-xml": { + "source": "apache", + "extensions": ["gramps"] + }, + "application/x-gtar": { + "source": "apache", + "extensions": ["gtar"] + }, + "application/x-gzip": { + "source": "apache" + }, + "application/x-hdf": { + "source": "apache", + "extensions": ["hdf"] + }, + "application/x-httpd-php": { + "compressible": true, + "extensions": ["php"] + }, + "application/x-install-instructions": { + "source": "apache", + "extensions": ["install"] + }, + "application/x-ipynb+json": { + "compressible": true, + "extensions": ["ipynb"] + }, + "application/x-iso9660-image": { + "source": "apache", + "extensions": ["iso"] + }, + "application/x-iwork-keynote-sffkey": { + "extensions": ["key"] + }, + "application/x-iwork-numbers-sffnumbers": { + "extensions": ["numbers"] + }, + "application/x-iwork-pages-sffpages": { + "extensions": ["pages"] + }, + "application/x-java-archive-diff": { + "source": "nginx", + "extensions": ["jardiff"] + }, + "application/x-java-jnlp-file": { + "source": "apache", + "compressible": false, + "extensions": ["jnlp"] + }, + "application/x-javascript": { + "compressible": true + }, + "application/x-keepass2": { + "extensions": ["kdbx"] + }, + "application/x-latex": { + "source": "apache", + "compressible": false, + "extensions": ["latex"] + }, + "application/x-lua-bytecode": { + "extensions": ["luac"] + }, + "application/x-lzh-compressed": { + "source": "apache", + "extensions": ["lzh","lha"] + }, + "application/x-makeself": { + "source": "nginx", + "extensions": ["run"] + }, + "application/x-mie": { + "source": "apache", + "extensions": ["mie"] + }, + "application/x-mobipocket-ebook": { + "source": "apache", + "extensions": ["prc","mobi"] + }, + "application/x-mpegurl": { + "compressible": false + }, + "application/x-ms-application": { + "source": "apache", + "extensions": ["application"] + }, + "application/x-ms-shortcut": { + "source": "apache", + "extensions": ["lnk"] + }, + "application/x-ms-wmd": { + "source": "apache", + "extensions": ["wmd"] + }, + "application/x-ms-wmz": { + "source": "apache", + "extensions": ["wmz"] + }, + "application/x-ms-xbap": { + "source": "apache", + "extensions": ["xbap"] + }, + "application/x-msaccess": { + "source": "apache", + "extensions": ["mdb"] + }, + "application/x-msbinder": { + "source": "apache", + "extensions": ["obd"] + }, + "application/x-mscardfile": { + "source": "apache", + "extensions": ["crd"] + }, + "application/x-msclip": { + "source": "apache", + "extensions": ["clp"] + }, + "application/x-msdos-program": { + "extensions": ["exe"] + }, + "application/x-msdownload": { + "source": "apache", + "extensions": ["exe","dll","com","bat","msi"] + }, + "application/x-msmediaview": { + "source": "apache", + "extensions": ["mvb","m13","m14"] + }, + "application/x-msmetafile": { + "source": "apache", + "extensions": ["wmf","wmz","emf","emz"] + }, + "application/x-msmoney": { + "source": "apache", + "extensions": ["mny"] + }, + "application/x-mspublisher": { + "source": "apache", + "extensions": ["pub"] + }, + "application/x-msschedule": { + "source": "apache", + "extensions": ["scd"] + }, + "application/x-msterminal": { + "source": "apache", + "extensions": ["trm"] + }, + "application/x-mswrite": { + "source": "apache", + "extensions": ["wri"] + }, + "application/x-netcdf": { + "source": "apache", + "extensions": ["nc","cdf"] + }, + "application/x-ns-proxy-autoconfig": { + "compressible": true, + "extensions": ["pac"] + }, + "application/x-nzb": { + "source": "apache", + "extensions": ["nzb"] + }, + "application/x-perl": { + "source": "nginx", + "extensions": ["pl","pm"] + }, + "application/x-pilot": { + "source": "nginx", + "extensions": ["prc","pdb"] + }, + "application/x-pkcs12": { + "source": "apache", + "compressible": false, + "extensions": ["p12","pfx"] + }, + "application/x-pkcs7-certificates": { + "source": "apache", + "extensions": ["p7b","spc"] + }, + "application/x-pkcs7-certreqresp": { + "source": "apache", + "extensions": ["p7r"] + }, + "application/x-pki-message": { + "source": "iana" + }, + "application/x-rar-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["rar"] + }, + "application/x-redhat-package-manager": { + "source": "nginx", + "extensions": ["rpm"] + }, + "application/x-research-info-systems": { + "source": "apache", + "extensions": ["ris"] + }, + "application/x-sea": { + "source": "nginx", + "extensions": ["sea"] + }, + "application/x-sh": { + "source": "apache", + "compressible": true, + "extensions": ["sh"] + }, + "application/x-shar": { + "source": "apache", + "extensions": ["shar"] + }, + "application/x-shockwave-flash": { + "source": "apache", + "compressible": false, + "extensions": ["swf"] + }, + "application/x-silverlight-app": { + "source": "apache", + "extensions": ["xap"] + }, + "application/x-sql": { + "source": "apache", + "extensions": ["sql"] + }, + "application/x-stuffit": { + "source": "apache", + "compressible": false, + "extensions": ["sit"] + }, + "application/x-stuffitx": { + "source": "apache", + "extensions": ["sitx"] + }, + "application/x-subrip": { + "source": "apache", + "extensions": ["srt"] + }, + "application/x-sv4cpio": { + "source": "apache", + "extensions": ["sv4cpio"] + }, + "application/x-sv4crc": { + "source": "apache", + "extensions": ["sv4crc"] + }, + "application/x-t3vm-image": { + "source": "apache", + "extensions": ["t3"] + }, + "application/x-tads": { + "source": "apache", + "extensions": ["gam"] + }, + "application/x-tar": { + "source": "apache", + "compressible": true, + "extensions": ["tar"] + }, + "application/x-tcl": { + "source": "apache", + "extensions": ["tcl","tk"] + }, + "application/x-tex": { + "source": "apache", + "extensions": ["tex"] + }, + "application/x-tex-tfm": { + "source": "apache", + "extensions": ["tfm"] + }, + "application/x-texinfo": { + "source": "apache", + "extensions": ["texinfo","texi"] + }, + "application/x-tgif": { + "source": "apache", + "extensions": ["obj"] + }, + "application/x-ustar": { + "source": "apache", + "extensions": ["ustar"] + }, + "application/x-virtualbox-hdd": { + "compressible": true, + "extensions": ["hdd"] + }, + "application/x-virtualbox-ova": { + "compressible": true, + "extensions": ["ova"] + }, + "application/x-virtualbox-ovf": { + "compressible": true, + "extensions": ["ovf"] + }, + "application/x-virtualbox-vbox": { + "compressible": true, + "extensions": ["vbox"] + }, + "application/x-virtualbox-vbox-extpack": { + "compressible": false, + "extensions": ["vbox-extpack"] + }, + "application/x-virtualbox-vdi": { + "compressible": true, + "extensions": ["vdi"] + }, + "application/x-virtualbox-vhd": { + "compressible": true, + "extensions": ["vhd"] + }, + "application/x-virtualbox-vmdk": { + "compressible": true, + "extensions": ["vmdk"] + }, + "application/x-wais-source": { + "source": "apache", + "extensions": ["src"] + }, + "application/x-web-app-manifest+json": { + "compressible": true, + "extensions": ["webapp"] + }, + "application/x-www-form-urlencoded": { + "source": "iana", + "compressible": true + }, + "application/x-x509-ca-cert": { + "source": "iana", + "extensions": ["der","crt","pem"] + }, + "application/x-x509-ca-ra-cert": { + "source": "iana" + }, + "application/x-x509-next-ca-cert": { + "source": "iana" + }, + "application/x-xfig": { + "source": "apache", + "extensions": ["fig"] + }, + "application/x-xliff+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xlf"] + }, + "application/x-xpinstall": { + "source": "apache", + "compressible": false, + "extensions": ["xpi"] + }, + "application/x-xz": { + "source": "apache", + "extensions": ["xz"] + }, + "application/x-zip-compressed": { + "extensions": ["zip"] + }, + "application/x-zmachine": { + "source": "apache", + "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] + }, + "application/x400-bp": { + "source": "iana" + }, + "application/xacml+xml": { + "source": "iana", + "compressible": true + }, + "application/xaml+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xaml"] + }, + "application/xcap-att+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xav"] + }, + "application/xcap-caps+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xca"] + }, + "application/xcap-diff+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdf"] + }, + "application/xcap-el+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xel"] + }, + "application/xcap-error+xml": { + "source": "iana", + "compressible": true + }, + "application/xcap-ns+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xns"] + }, + "application/xcon-conference-info+xml": { + "source": "iana", + "compressible": true + }, + "application/xcon-conference-info-diff+xml": { + "source": "iana", + "compressible": true + }, + "application/xenc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xenc"] + }, + "application/xfdf": { + "source": "iana", + "extensions": ["xfdf"] + }, + "application/xhtml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xhtml","xht"] + }, + "application/xhtml-voice+xml": { + "source": "apache", + "compressible": true + }, + "application/xliff+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xlf"] + }, + "application/xml": { + "source": "iana", + "compressible": true, + "extensions": ["xml","xsl","xsd","rng"] + }, + "application/xml-dtd": { + "source": "iana", + "compressible": true, + "extensions": ["dtd"] + }, + "application/xml-external-parsed-entity": { + "source": "iana" + }, + "application/xml-patch+xml": { + "source": "iana", + "compressible": true + }, + "application/xmpp+xml": { + "source": "iana", + "compressible": true + }, + "application/xop+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xop"] + }, + "application/xproc+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xpl"] + }, + "application/xslt+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xsl","xslt"] + }, + "application/xspf+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xspf"] + }, + "application/xv+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mxml","xhvml","xvml","xvm"] + }, + "application/yaml": { + "source": "iana" + }, + "application/yang": { + "source": "iana", + "extensions": ["yang"] + }, + "application/yang-data+cbor": { + "source": "iana" + }, + "application/yang-data+json": { + "source": "iana", + "compressible": true + }, + "application/yang-data+xml": { + "source": "iana", + "compressible": true + }, + "application/yang-patch+json": { + "source": "iana", + "compressible": true + }, + "application/yang-patch+xml": { + "source": "iana", + "compressible": true + }, + "application/yang-sid+json": { + "source": "iana", + "compressible": true + }, + "application/yin+xml": { + "source": "iana", + "compressible": true, + "extensions": ["yin"] + }, + "application/zip": { + "source": "iana", + "compressible": false, + "extensions": ["zip"] + }, + "application/zip+dotlottie": { + "extensions": ["lottie"] + }, + "application/zlib": { + "source": "iana" + }, + "application/zstd": { + "source": "iana" + }, + "audio/1d-interleaved-parityfec": { + "source": "iana" + }, + "audio/32kadpcm": { + "source": "iana" + }, + "audio/3gpp": { + "source": "iana", + "compressible": false, + "extensions": ["3gpp"] + }, + "audio/3gpp2": { + "source": "iana" + }, + "audio/aac": { + "source": "iana", + "extensions": ["adts","aac"] + }, + "audio/ac3": { + "source": "iana" + }, + "audio/adpcm": { + "source": "apache", + "extensions": ["adp"] + }, + "audio/amr": { + "source": "iana", + "extensions": ["amr"] + }, + "audio/amr-wb": { + "source": "iana" + }, + "audio/amr-wb+": { + "source": "iana" + }, + "audio/aptx": { + "source": "iana" + }, + "audio/asc": { + "source": "iana" + }, + "audio/atrac-advanced-lossless": { + "source": "iana" + }, + "audio/atrac-x": { + "source": "iana" + }, + "audio/atrac3": { + "source": "iana" + }, + "audio/basic": { + "source": "iana", + "compressible": false, + "extensions": ["au","snd"] + }, + "audio/bv16": { + "source": "iana" + }, + "audio/bv32": { + "source": "iana" + }, + "audio/clearmode": { + "source": "iana" + }, + "audio/cn": { + "source": "iana" + }, + "audio/dat12": { + "source": "iana" + }, + "audio/dls": { + "source": "iana" + }, + "audio/dsr-es201108": { + "source": "iana" + }, + "audio/dsr-es202050": { + "source": "iana" + }, + "audio/dsr-es202211": { + "source": "iana" + }, + "audio/dsr-es202212": { + "source": "iana" + }, + "audio/dv": { + "source": "iana" + }, + "audio/dvi4": { + "source": "iana" + }, + "audio/eac3": { + "source": "iana" + }, + "audio/encaprtp": { + "source": "iana" + }, + "audio/evrc": { + "source": "iana" + }, + "audio/evrc-qcp": { + "source": "iana" + }, + "audio/evrc0": { + "source": "iana" + }, + "audio/evrc1": { + "source": "iana" + }, + "audio/evrcb": { + "source": "iana" + }, + "audio/evrcb0": { + "source": "iana" + }, + "audio/evrcb1": { + "source": "iana" + }, + "audio/evrcnw": { + "source": "iana" + }, + "audio/evrcnw0": { + "source": "iana" + }, + "audio/evrcnw1": { + "source": "iana" + }, + "audio/evrcwb": { + "source": "iana" + }, + "audio/evrcwb0": { + "source": "iana" + }, + "audio/evrcwb1": { + "source": "iana" + }, + "audio/evs": { + "source": "iana" + }, + "audio/flac": { + "source": "iana" + }, + "audio/flexfec": { + "source": "iana" + }, + "audio/fwdred": { + "source": "iana" + }, + "audio/g711-0": { + "source": "iana" + }, + "audio/g719": { + "source": "iana" + }, + "audio/g722": { + "source": "iana" + }, + "audio/g7221": { + "source": "iana" + }, + "audio/g723": { + "source": "iana" + }, + "audio/g726-16": { + "source": "iana" + }, + "audio/g726-24": { + "source": "iana" + }, + "audio/g726-32": { + "source": "iana" + }, + "audio/g726-40": { + "source": "iana" + }, + "audio/g728": { + "source": "iana" + }, + "audio/g729": { + "source": "iana" + }, + "audio/g7291": { + "source": "iana" + }, + "audio/g729d": { + "source": "iana" + }, + "audio/g729e": { + "source": "iana" + }, + "audio/gsm": { + "source": "iana" + }, + "audio/gsm-efr": { + "source": "iana" + }, + "audio/gsm-hr-08": { + "source": "iana" + }, + "audio/ilbc": { + "source": "iana" + }, + "audio/ip-mr_v2.5": { + "source": "iana" + }, + "audio/isac": { + "source": "apache" + }, + "audio/l16": { + "source": "iana" + }, + "audio/l20": { + "source": "iana" + }, + "audio/l24": { + "source": "iana", + "compressible": false + }, + "audio/l8": { + "source": "iana" + }, + "audio/lpc": { + "source": "iana" + }, + "audio/matroska": { + "source": "iana" + }, + "audio/melp": { + "source": "iana" + }, + "audio/melp1200": { + "source": "iana" + }, + "audio/melp2400": { + "source": "iana" + }, + "audio/melp600": { + "source": "iana" + }, + "audio/mhas": { + "source": "iana" + }, + "audio/midi": { + "source": "apache", + "extensions": ["mid","midi","kar","rmi"] + }, + "audio/midi-clip": { + "source": "iana" + }, + "audio/mobile-xmf": { + "source": "iana", + "extensions": ["mxmf"] + }, + "audio/mp3": { + "compressible": false, + "extensions": ["mp3"] + }, + "audio/mp4": { + "source": "iana", + "compressible": false, + "extensions": ["m4a","mp4a","m4b"] + }, + "audio/mp4a-latm": { + "source": "iana" + }, + "audio/mpa": { + "source": "iana" + }, + "audio/mpa-robust": { + "source": "iana" + }, + "audio/mpeg": { + "source": "iana", + "compressible": false, + "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"] + }, + "audio/mpeg4-generic": { + "source": "iana" + }, + "audio/musepack": { + "source": "apache" + }, + "audio/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["oga","ogg","spx","opus"] + }, + "audio/opus": { + "source": "iana" + }, + "audio/parityfec": { + "source": "iana" + }, + "audio/pcma": { + "source": "iana" + }, + "audio/pcma-wb": { + "source": "iana" + }, + "audio/pcmu": { + "source": "iana" + }, + "audio/pcmu-wb": { + "source": "iana" + }, + "audio/prs.sid": { + "source": "iana" + }, + "audio/qcelp": { + "source": "iana" + }, + "audio/raptorfec": { + "source": "iana" + }, + "audio/red": { + "source": "iana" + }, + "audio/rtp-enc-aescm128": { + "source": "iana" + }, + "audio/rtp-midi": { + "source": "iana" + }, + "audio/rtploopback": { + "source": "iana" + }, + "audio/rtx": { + "source": "iana" + }, + "audio/s3m": { + "source": "apache", + "extensions": ["s3m"] + }, + "audio/scip": { + "source": "iana" + }, + "audio/silk": { + "source": "apache", + "extensions": ["sil"] + }, + "audio/smv": { + "source": "iana" + }, + "audio/smv-qcp": { + "source": "iana" + }, + "audio/smv0": { + "source": "iana" + }, + "audio/sofa": { + "source": "iana" + }, + "audio/sp-midi": { + "source": "iana" + }, + "audio/speex": { + "source": "iana" + }, + "audio/t140c": { + "source": "iana" + }, + "audio/t38": { + "source": "iana" + }, + "audio/telephone-event": { + "source": "iana" + }, + "audio/tetra_acelp": { + "source": "iana" + }, + "audio/tetra_acelp_bb": { + "source": "iana" + }, + "audio/tone": { + "source": "iana" + }, + "audio/tsvcis": { + "source": "iana" + }, + "audio/uemclip": { + "source": "iana" + }, + "audio/ulpfec": { + "source": "iana" + }, + "audio/usac": { + "source": "iana" + }, + "audio/vdvi": { + "source": "iana" + }, + "audio/vmr-wb": { + "source": "iana" + }, + "audio/vnd.3gpp.iufp": { + "source": "iana" + }, + "audio/vnd.4sb": { + "source": "iana" + }, + "audio/vnd.audiokoz": { + "source": "iana" + }, + "audio/vnd.celp": { + "source": "iana" + }, + "audio/vnd.cisco.nse": { + "source": "iana" + }, + "audio/vnd.cmles.radio-events": { + "source": "iana" + }, + "audio/vnd.cns.anp1": { + "source": "iana" + }, + "audio/vnd.cns.inf1": { + "source": "iana" + }, + "audio/vnd.dece.audio": { + "source": "iana", + "extensions": ["uva","uvva"] + }, + "audio/vnd.digital-winds": { + "source": "iana", + "extensions": ["eol"] + }, + "audio/vnd.dlna.adts": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.1": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.2": { + "source": "iana" + }, + "audio/vnd.dolby.mlp": { + "source": "iana" + }, + "audio/vnd.dolby.mps": { + "source": "iana" + }, + "audio/vnd.dolby.pl2": { + "source": "iana" + }, + "audio/vnd.dolby.pl2x": { + "source": "iana" + }, + "audio/vnd.dolby.pl2z": { + "source": "iana" + }, + "audio/vnd.dolby.pulse.1": { + "source": "iana" + }, + "audio/vnd.dra": { + "source": "iana", + "extensions": ["dra"] + }, + "audio/vnd.dts": { + "source": "iana", + "extensions": ["dts"] + }, + "audio/vnd.dts.hd": { + "source": "iana", + "extensions": ["dtshd"] + }, + "audio/vnd.dts.uhd": { + "source": "iana" + }, + "audio/vnd.dvb.file": { + "source": "iana" + }, + "audio/vnd.everad.plj": { + "source": "iana" + }, + "audio/vnd.hns.audio": { + "source": "iana" + }, + "audio/vnd.lucent.voice": { + "source": "iana", + "extensions": ["lvp"] + }, + "audio/vnd.ms-playready.media.pya": { + "source": "iana", + "extensions": ["pya"] + }, + "audio/vnd.nokia.mobile-xmf": { + "source": "iana" + }, + "audio/vnd.nortel.vbk": { + "source": "iana" + }, + "audio/vnd.nuera.ecelp4800": { + "source": "iana", + "extensions": ["ecelp4800"] + }, + "audio/vnd.nuera.ecelp7470": { + "source": "iana", + "extensions": ["ecelp7470"] + }, + "audio/vnd.nuera.ecelp9600": { + "source": "iana", + "extensions": ["ecelp9600"] + }, + "audio/vnd.octel.sbc": { + "source": "iana" + }, + "audio/vnd.presonus.multitrack": { + "source": "iana" + }, + "audio/vnd.qcelp": { + "source": "apache" + }, + "audio/vnd.rhetorex.32kadpcm": { + "source": "iana" + }, + "audio/vnd.rip": { + "source": "iana", + "extensions": ["rip"] + }, + "audio/vnd.rn-realaudio": { + "compressible": false + }, + "audio/vnd.sealedmedia.softseal.mpeg": { + "source": "iana" + }, + "audio/vnd.vmx.cvsd": { + "source": "iana" + }, + "audio/vnd.wave": { + "compressible": false + }, + "audio/vorbis": { + "source": "iana", + "compressible": false + }, + "audio/vorbis-config": { + "source": "iana" + }, + "audio/wav": { + "compressible": false, + "extensions": ["wav"] + }, + "audio/wave": { + "compressible": false, + "extensions": ["wav"] + }, + "audio/webm": { + "source": "apache", + "compressible": false, + "extensions": ["weba"] + }, + "audio/x-aac": { + "source": "apache", + "compressible": false, + "extensions": ["aac"] + }, + "audio/x-aiff": { + "source": "apache", + "extensions": ["aif","aiff","aifc"] + }, + "audio/x-caf": { + "source": "apache", + "compressible": false, + "extensions": ["caf"] + }, + "audio/x-flac": { + "source": "apache", + "extensions": ["flac"] + }, + "audio/x-m4a": { + "source": "nginx", + "extensions": ["m4a"] + }, + "audio/x-matroska": { + "source": "apache", + "extensions": ["mka"] + }, + "audio/x-mpegurl": { + "source": "apache", + "extensions": ["m3u"] + }, + "audio/x-ms-wax": { + "source": "apache", + "extensions": ["wax"] + }, + "audio/x-ms-wma": { + "source": "apache", + "extensions": ["wma"] + }, + "audio/x-pn-realaudio": { + "source": "apache", + "extensions": ["ram","ra"] + }, + "audio/x-pn-realaudio-plugin": { + "source": "apache", + "extensions": ["rmp"] + }, + "audio/x-realaudio": { + "source": "nginx", + "extensions": ["ra"] + }, + "audio/x-tta": { + "source": "apache" + }, + "audio/x-wav": { + "source": "apache", + "extensions": ["wav"] + }, + "audio/xm": { + "source": "apache", + "extensions": ["xm"] + }, + "chemical/x-cdx": { + "source": "apache", + "extensions": ["cdx"] + }, + "chemical/x-cif": { + "source": "apache", + "extensions": ["cif"] + }, + "chemical/x-cmdf": { + "source": "apache", + "extensions": ["cmdf"] + }, + "chemical/x-cml": { + "source": "apache", + "extensions": ["cml"] + }, + "chemical/x-csml": { + "source": "apache", + "extensions": ["csml"] + }, + "chemical/x-pdb": { + "source": "apache" + }, + "chemical/x-xyz": { + "source": "apache", + "extensions": ["xyz"] + }, + "font/collection": { + "source": "iana", + "extensions": ["ttc"] + }, + "font/otf": { + "source": "iana", + "compressible": true, + "extensions": ["otf"] + }, + "font/sfnt": { + "source": "iana" + }, + "font/ttf": { + "source": "iana", + "compressible": true, + "extensions": ["ttf"] + }, + "font/woff": { + "source": "iana", + "extensions": ["woff"] + }, + "font/woff2": { + "source": "iana", + "extensions": ["woff2"] + }, + "image/aces": { + "source": "iana", + "extensions": ["exr"] + }, + "image/apng": { + "source": "iana", + "compressible": false, + "extensions": ["apng"] + }, + "image/avci": { + "source": "iana", + "extensions": ["avci"] + }, + "image/avcs": { + "source": "iana", + "extensions": ["avcs"] + }, + "image/avif": { + "source": "iana", + "compressible": false, + "extensions": ["avif"] + }, + "image/bmp": { + "source": "iana", + "compressible": true, + "extensions": ["bmp","dib"] + }, + "image/cgm": { + "source": "iana", + "extensions": ["cgm"] + }, + "image/dicom-rle": { + "source": "iana", + "extensions": ["drle"] + }, + "image/dpx": { + "source": "iana", + "extensions": ["dpx"] + }, + "image/emf": { + "source": "iana", + "extensions": ["emf"] + }, + "image/fits": { + "source": "iana", + "extensions": ["fits"] + }, + "image/g3fax": { + "source": "iana", + "extensions": ["g3"] + }, + "image/gif": { + "source": "iana", + "compressible": false, + "extensions": ["gif"] + }, + "image/heic": { + "source": "iana", + "extensions": ["heic"] + }, + "image/heic-sequence": { + "source": "iana", + "extensions": ["heics"] + }, + "image/heif": { + "source": "iana", + "extensions": ["heif"] + }, + "image/heif-sequence": { + "source": "iana", + "extensions": ["heifs"] + }, + "image/hej2k": { + "source": "iana", + "extensions": ["hej2"] + }, + "image/ief": { + "source": "iana", + "extensions": ["ief"] + }, + "image/j2c": { + "source": "iana" + }, + "image/jaii": { + "source": "iana", + "extensions": ["jaii"] + }, + "image/jais": { + "source": "iana", + "extensions": ["jais"] + }, + "image/jls": { + "source": "iana", + "extensions": ["jls"] + }, + "image/jp2": { + "source": "iana", + "compressible": false, + "extensions": ["jp2","jpg2"] + }, + "image/jpeg": { + "source": "iana", + "compressible": false, + "extensions": ["jpg","jpeg","jpe"] + }, + "image/jph": { + "source": "iana", + "extensions": ["jph"] + }, + "image/jphc": { + "source": "iana", + "extensions": ["jhc"] + }, + "image/jpm": { + "source": "iana", + "compressible": false, + "extensions": ["jpm","jpgm"] + }, + "image/jpx": { + "source": "iana", + "compressible": false, + "extensions": ["jpx","jpf"] + }, + "image/jxl": { + "source": "iana", + "extensions": ["jxl"] + }, + "image/jxr": { + "source": "iana", + "extensions": ["jxr"] + }, + "image/jxra": { + "source": "iana", + "extensions": ["jxra"] + }, + "image/jxrs": { + "source": "iana", + "extensions": ["jxrs"] + }, + "image/jxs": { + "source": "iana", + "extensions": ["jxs"] + }, + "image/jxsc": { + "source": "iana", + "extensions": ["jxsc"] + }, + "image/jxsi": { + "source": "iana", + "extensions": ["jxsi"] + }, + "image/jxss": { + "source": "iana", + "extensions": ["jxss"] + }, + "image/ktx": { + "source": "iana", + "extensions": ["ktx"] + }, + "image/ktx2": { + "source": "iana", + "extensions": ["ktx2"] + }, + "image/naplps": { + "source": "iana" + }, + "image/pjpeg": { + "compressible": false, + "extensions": ["jfif"] + }, + "image/png": { + "source": "iana", + "compressible": false, + "extensions": ["png"] + }, + "image/prs.btif": { + "source": "iana", + "extensions": ["btif","btf"] + }, + "image/prs.pti": { + "source": "iana", + "extensions": ["pti"] + }, + "image/pwg-raster": { + "source": "iana" + }, + "image/sgi": { + "source": "apache", + "extensions": ["sgi"] + }, + "image/svg+xml": { + "source": "iana", + "compressible": true, + "extensions": ["svg","svgz"] + }, + "image/t38": { + "source": "iana", + "extensions": ["t38"] + }, + "image/tiff": { + "source": "iana", + "compressible": false, + "extensions": ["tif","tiff"] + }, + "image/tiff-fx": { + "source": "iana", + "extensions": ["tfx"] + }, + "image/vnd.adobe.photoshop": { + "source": "iana", + "compressible": true, + "extensions": ["psd"] + }, + "image/vnd.airzip.accelerator.azv": { + "source": "iana", + "extensions": ["azv"] + }, + "image/vnd.clip": { + "source": "iana" + }, + "image/vnd.cns.inf2": { + "source": "iana" + }, + "image/vnd.dece.graphic": { + "source": "iana", + "extensions": ["uvi","uvvi","uvg","uvvg"] + }, + "image/vnd.djvu": { + "source": "iana", + "extensions": ["djvu","djv"] + }, + "image/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "image/vnd.dwg": { + "source": "iana", + "extensions": ["dwg"] + }, + "image/vnd.dxf": { + "source": "iana", + "extensions": ["dxf"] + }, + "image/vnd.fastbidsheet": { + "source": "iana", + "extensions": ["fbs"] + }, + "image/vnd.fpx": { + "source": "iana", + "extensions": ["fpx"] + }, + "image/vnd.fst": { + "source": "iana", + "extensions": ["fst"] + }, + "image/vnd.fujixerox.edmics-mmr": { + "source": "iana", + "extensions": ["mmr"] + }, + "image/vnd.fujixerox.edmics-rlc": { + "source": "iana", + "extensions": ["rlc"] + }, + "image/vnd.globalgraphics.pgb": { + "source": "iana" + }, + "image/vnd.microsoft.icon": { + "source": "iana", + "compressible": true, + "extensions": ["ico"] + }, + "image/vnd.mix": { + "source": "iana" + }, + "image/vnd.mozilla.apng": { + "source": "iana" + }, + "image/vnd.ms-dds": { + "compressible": true, + "extensions": ["dds"] + }, + "image/vnd.ms-modi": { + "source": "iana", + "extensions": ["mdi"] + }, + "image/vnd.ms-photo": { + "source": "apache", + "extensions": ["wdp"] + }, + "image/vnd.net-fpx": { + "source": "iana", + "extensions": ["npx"] + }, + "image/vnd.pco.b16": { + "source": "iana", + "extensions": ["b16"] + }, + "image/vnd.radiance": { + "source": "iana" + }, + "image/vnd.sealed.png": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal.gif": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal.jpg": { + "source": "iana" + }, + "image/vnd.svf": { + "source": "iana" + }, + "image/vnd.tencent.tap": { + "source": "iana", + "extensions": ["tap"] + }, + "image/vnd.valve.source.texture": { + "source": "iana", + "extensions": ["vtf"] + }, + "image/vnd.wap.wbmp": { + "source": "iana", + "extensions": ["wbmp"] + }, + "image/vnd.xiff": { + "source": "iana", + "extensions": ["xif"] + }, + "image/vnd.zbrush.pcx": { + "source": "iana", + "extensions": ["pcx"] + }, + "image/webp": { + "source": "iana", + "extensions": ["webp"] + }, + "image/wmf": { + "source": "iana", + "extensions": ["wmf"] + }, + "image/x-3ds": { + "source": "apache", + "extensions": ["3ds"] + }, + "image/x-adobe-dng": { + "extensions": ["dng"] + }, + "image/x-cmu-raster": { + "source": "apache", + "extensions": ["ras"] + }, + "image/x-cmx": { + "source": "apache", + "extensions": ["cmx"] + }, + "image/x-emf": { + "source": "iana" + }, + "image/x-freehand": { + "source": "apache", + "extensions": ["fh","fhc","fh4","fh5","fh7"] + }, + "image/x-icon": { + "source": "apache", + "compressible": true, + "extensions": ["ico"] + }, + "image/x-jng": { + "source": "nginx", + "extensions": ["jng"] + }, + "image/x-mrsid-image": { + "source": "apache", + "extensions": ["sid"] + }, + "image/x-ms-bmp": { + "source": "nginx", + "compressible": true, + "extensions": ["bmp"] + }, + "image/x-pcx": { + "source": "apache", + "extensions": ["pcx"] + }, + "image/x-pict": { + "source": "apache", + "extensions": ["pic","pct"] + }, + "image/x-portable-anymap": { + "source": "apache", + "extensions": ["pnm"] + }, + "image/x-portable-bitmap": { + "source": "apache", + "extensions": ["pbm"] + }, + "image/x-portable-graymap": { + "source": "apache", + "extensions": ["pgm"] + }, + "image/x-portable-pixmap": { + "source": "apache", + "extensions": ["ppm"] + }, + "image/x-rgb": { + "source": "apache", + "extensions": ["rgb"] + }, + "image/x-tga": { + "source": "apache", + "extensions": ["tga"] + }, + "image/x-wmf": { + "source": "iana" + }, + "image/x-xbitmap": { + "source": "apache", + "extensions": ["xbm"] + }, + "image/x-xcf": { + "compressible": false + }, + "image/x-xpixmap": { + "source": "apache", + "extensions": ["xpm"] + }, + "image/x-xwindowdump": { + "source": "apache", + "extensions": ["xwd"] + }, + "message/bhttp": { + "source": "iana" + }, + "message/cpim": { + "source": "iana" + }, + "message/delivery-status": { + "source": "iana" + }, + "message/disposition-notification": { + "source": "iana", + "extensions": [ + "disposition-notification" + ] + }, + "message/external-body": { + "source": "iana" + }, + "message/feedback-report": { + "source": "iana" + }, + "message/global": { + "source": "iana", + "extensions": ["u8msg"] + }, + "message/global-delivery-status": { + "source": "iana", + "extensions": ["u8dsn"] + }, + "message/global-disposition-notification": { + "source": "iana", + "extensions": ["u8mdn"] + }, + "message/global-headers": { + "source": "iana", + "extensions": ["u8hdr"] + }, + "message/http": { + "source": "iana", + "compressible": false + }, + "message/imdn+xml": { + "source": "iana", + "compressible": true + }, + "message/mls": { + "source": "iana" + }, + "message/news": { + "source": "apache" + }, + "message/ohttp-req": { + "source": "iana" + }, + "message/ohttp-res": { + "source": "iana" + }, + "message/partial": { + "source": "iana", + "compressible": false + }, + "message/rfc822": { + "source": "iana", + "compressible": true, + "extensions": ["eml","mime","mht","mhtml"] + }, + "message/s-http": { + "source": "apache" + }, + "message/sip": { + "source": "iana" + }, + "message/sipfrag": { + "source": "iana" + }, + "message/tracking-status": { + "source": "iana" + }, + "message/vnd.si.simp": { + "source": "apache" + }, + "message/vnd.wfa.wsc": { + "source": "iana", + "extensions": ["wsc"] + }, + "model/3mf": { + "source": "iana", + "extensions": ["3mf"] + }, + "model/e57": { + "source": "iana" + }, + "model/gltf+json": { + "source": "iana", + "compressible": true, + "extensions": ["gltf"] + }, + "model/gltf-binary": { + "source": "iana", + "compressible": true, + "extensions": ["glb"] + }, + "model/iges": { + "source": "iana", + "compressible": false, + "extensions": ["igs","iges"] + }, + "model/jt": { + "source": "iana", + "extensions": ["jt"] + }, + "model/mesh": { + "source": "iana", + "compressible": false, + "extensions": ["msh","mesh","silo"] + }, + "model/mtl": { + "source": "iana", + "extensions": ["mtl"] + }, + "model/obj": { + "source": "iana", + "extensions": ["obj"] + }, + "model/prc": { + "source": "iana", + "extensions": ["prc"] + }, + "model/step": { + "source": "iana", + "extensions": ["step","stp","stpnc","p21","210"] + }, + "model/step+xml": { + "source": "iana", + "compressible": true, + "extensions": ["stpx"] + }, + "model/step+zip": { + "source": "iana", + "compressible": false, + "extensions": ["stpz"] + }, + "model/step-xml+zip": { + "source": "iana", + "compressible": false, + "extensions": ["stpxz"] + }, + "model/stl": { + "source": "iana", + "extensions": ["stl"] + }, + "model/u3d": { + "source": "iana", + "extensions": ["u3d"] + }, + "model/vnd.bary": { + "source": "iana", + "extensions": ["bary"] + }, + "model/vnd.cld": { + "source": "iana", + "extensions": ["cld"] + }, + "model/vnd.collada+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dae"] + }, + "model/vnd.dwf": { + "source": "iana", + "extensions": ["dwf"] + }, + "model/vnd.flatland.3dml": { + "source": "iana" + }, + "model/vnd.gdl": { + "source": "iana", + "extensions": ["gdl"] + }, + "model/vnd.gs-gdl": { + "source": "apache" + }, + "model/vnd.gs.gdl": { + "source": "iana" + }, + "model/vnd.gtw": { + "source": "iana", + "extensions": ["gtw"] + }, + "model/vnd.moml+xml": { + "source": "iana", + "compressible": true + }, + "model/vnd.mts": { + "source": "iana", + "extensions": ["mts"] + }, + "model/vnd.opengex": { + "source": "iana", + "extensions": ["ogex"] + }, + "model/vnd.parasolid.transmit.binary": { + "source": "iana", + "extensions": ["x_b"] + }, + "model/vnd.parasolid.transmit.text": { + "source": "iana", + "extensions": ["x_t"] + }, + "model/vnd.pytha.pyox": { + "source": "iana", + "extensions": ["pyo","pyox"] + }, + "model/vnd.rosette.annotated-data-model": { + "source": "iana" + }, + "model/vnd.sap.vds": { + "source": "iana", + "extensions": ["vds"] + }, + "model/vnd.usda": { + "source": "iana", + "extensions": ["usda"] + }, + "model/vnd.usdz+zip": { + "source": "iana", + "compressible": false, + "extensions": ["usdz"] + }, + "model/vnd.valve.source.compiled-map": { + "source": "iana", + "extensions": ["bsp"] + }, + "model/vnd.vtu": { + "source": "iana", + "extensions": ["vtu"] + }, + "model/vrml": { + "source": "iana", + "compressible": false, + "extensions": ["wrl","vrml"] + }, + "model/x3d+binary": { + "source": "apache", + "compressible": false, + "extensions": ["x3db","x3dbz"] + }, + "model/x3d+fastinfoset": { + "source": "iana", + "extensions": ["x3db"] + }, + "model/x3d+vrml": { + "source": "apache", + "compressible": false, + "extensions": ["x3dv","x3dvz"] + }, + "model/x3d+xml": { + "source": "iana", + "compressible": true, + "extensions": ["x3d","x3dz"] + }, + "model/x3d-vrml": { + "source": "iana", + "extensions": ["x3dv"] + }, + "multipart/alternative": { + "source": "iana", + "compressible": false + }, + "multipart/appledouble": { + "source": "iana" + }, + "multipart/byteranges": { + "source": "iana" + }, + "multipart/digest": { + "source": "iana" + }, + "multipart/encrypted": { + "source": "iana", + "compressible": false + }, + "multipart/form-data": { + "source": "iana", + "compressible": false + }, + "multipart/header-set": { + "source": "iana" + }, + "multipart/mixed": { + "source": "iana" + }, + "multipart/multilingual": { + "source": "iana" + }, + "multipart/parallel": { + "source": "iana" + }, + "multipart/related": { + "source": "iana", + "compressible": false + }, + "multipart/report": { + "source": "iana" + }, + "multipart/signed": { + "source": "iana", + "compressible": false + }, + "multipart/vnd.bint.med-plus": { + "source": "iana" + }, + "multipart/voice-message": { + "source": "iana" + }, + "multipart/x-mixed-replace": { + "source": "iana" + }, + "text/1d-interleaved-parityfec": { + "source": "iana" + }, + "text/cache-manifest": { + "source": "iana", + "compressible": true, + "extensions": ["appcache","manifest"] + }, + "text/calendar": { + "source": "iana", + "extensions": ["ics","ifb"] + }, + "text/calender": { + "compressible": true + }, + "text/cmd": { + "compressible": true + }, + "text/coffeescript": { + "extensions": ["coffee","litcoffee"] + }, + "text/cql": { + "source": "iana" + }, + "text/cql-expression": { + "source": "iana" + }, + "text/cql-identifier": { + "source": "iana" + }, + "text/css": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["css"] + }, + "text/csv": { + "source": "iana", + "compressible": true, + "extensions": ["csv"] + }, + "text/csv-schema": { + "source": "iana" + }, + "text/directory": { + "source": "iana" + }, + "text/dns": { + "source": "iana" + }, + "text/ecmascript": { + "source": "apache" + }, + "text/encaprtp": { + "source": "iana" + }, + "text/enriched": { + "source": "iana" + }, + "text/fhirpath": { + "source": "iana" + }, + "text/flexfec": { + "source": "iana" + }, + "text/fwdred": { + "source": "iana" + }, + "text/gff3": { + "source": "iana" + }, + "text/grammar-ref-list": { + "source": "iana" + }, + "text/hl7v2": { + "source": "iana" + }, + "text/html": { + "source": "iana", + "compressible": true, + "extensions": ["html","htm","shtml"] + }, + "text/jade": { + "extensions": ["jade"] + }, + "text/javascript": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["js","mjs"] + }, + "text/jcr-cnd": { + "source": "iana" + }, + "text/jsx": { + "compressible": true, + "extensions": ["jsx"] + }, + "text/less": { + "compressible": true, + "extensions": ["less"] + }, + "text/markdown": { + "source": "iana", + "compressible": true, + "extensions": ["md","markdown"] + }, + "text/mathml": { + "source": "nginx", + "extensions": ["mml"] + }, + "text/mdx": { + "compressible": true, + "extensions": ["mdx"] + }, + "text/mizar": { + "source": "iana" + }, + "text/n3": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["n3"] + }, + "text/parameters": { + "source": "iana", + "charset": "UTF-8" + }, + "text/parityfec": { + "source": "iana" + }, + "text/plain": { + "source": "iana", + "compressible": true, + "extensions": ["txt","text","conf","def","list","log","in","ini"] + }, + "text/provenance-notation": { + "source": "iana", + "charset": "UTF-8" + }, + "text/prs.fallenstein.rst": { + "source": "iana" + }, + "text/prs.lines.tag": { + "source": "iana", + "extensions": ["dsc"] + }, + "text/prs.prop.logic": { + "source": "iana" + }, + "text/prs.texi": { + "source": "iana" + }, + "text/raptorfec": { + "source": "iana" + }, + "text/red": { + "source": "iana" + }, + "text/rfc822-headers": { + "source": "iana" + }, + "text/richtext": { + "source": "iana", + "compressible": true, + "extensions": ["rtx"] + }, + "text/rtf": { + "source": "iana", + "compressible": true, + "extensions": ["rtf"] + }, + "text/rtp-enc-aescm128": { + "source": "iana" + }, + "text/rtploopback": { + "source": "iana" + }, + "text/rtx": { + "source": "iana" + }, + "text/sgml": { + "source": "iana", + "extensions": ["sgml","sgm"] + }, + "text/shaclc": { + "source": "iana" + }, + "text/shex": { + "source": "iana", + "extensions": ["shex"] + }, + "text/slim": { + "extensions": ["slim","slm"] + }, + "text/spdx": { + "source": "iana", + "extensions": ["spdx"] + }, + "text/strings": { + "source": "iana" + }, + "text/stylus": { + "extensions": ["stylus","styl"] + }, + "text/t140": { + "source": "iana" + }, + "text/tab-separated-values": { + "source": "iana", + "compressible": true, + "extensions": ["tsv"] + }, + "text/troff": { + "source": "iana", + "extensions": ["t","tr","roff","man","me","ms"] + }, + "text/turtle": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["ttl"] + }, + "text/ulpfec": { + "source": "iana" + }, + "text/uri-list": { + "source": "iana", + "compressible": true, + "extensions": ["uri","uris","urls"] + }, + "text/vcard": { + "source": "iana", + "compressible": true, + "extensions": ["vcard"] + }, + "text/vnd.a": { + "source": "iana" + }, + "text/vnd.abc": { + "source": "iana" + }, + "text/vnd.ascii-art": { + "source": "iana" + }, + "text/vnd.curl": { + "source": "iana", + "extensions": ["curl"] + }, + "text/vnd.curl.dcurl": { + "source": "apache", + "extensions": ["dcurl"] + }, + "text/vnd.curl.mcurl": { + "source": "apache", + "extensions": ["mcurl"] + }, + "text/vnd.curl.scurl": { + "source": "apache", + "extensions": ["scurl"] + }, + "text/vnd.debian.copyright": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.dmclientscript": { + "source": "iana" + }, + "text/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "text/vnd.esmertec.theme-descriptor": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.exchangeable": { + "source": "iana" + }, + "text/vnd.familysearch.gedcom": { + "source": "iana", + "extensions": ["ged"] + }, + "text/vnd.ficlab.flt": { + "source": "iana" + }, + "text/vnd.fly": { + "source": "iana", + "extensions": ["fly"] + }, + "text/vnd.fmi.flexstor": { + "source": "iana", + "extensions": ["flx"] + }, + "text/vnd.gml": { + "source": "iana" + }, + "text/vnd.graphviz": { + "source": "iana", + "extensions": ["gv"] + }, + "text/vnd.hans": { + "source": "iana" + }, + "text/vnd.hgl": { + "source": "iana" + }, + "text/vnd.in3d.3dml": { + "source": "iana", + "extensions": ["3dml"] + }, + "text/vnd.in3d.spot": { + "source": "iana", + "extensions": ["spot"] + }, + "text/vnd.iptc.newsml": { + "source": "iana" + }, + "text/vnd.iptc.nitf": { + "source": "iana" + }, + "text/vnd.latex-z": { + "source": "iana" + }, + "text/vnd.motorola.reflex": { + "source": "iana" + }, + "text/vnd.ms-mediapackage": { + "source": "iana" + }, + "text/vnd.net2phone.commcenter.command": { + "source": "iana" + }, + "text/vnd.radisys.msml-basic-layout": { + "source": "iana" + }, + "text/vnd.senx.warpscript": { + "source": "iana" + }, + "text/vnd.si.uricatalogue": { + "source": "apache" + }, + "text/vnd.sosi": { + "source": "iana" + }, + "text/vnd.sun.j2me.app-descriptor": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["jad"] + }, + "text/vnd.trolltech.linguist": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.vcf": { + "source": "iana" + }, + "text/vnd.wap.si": { + "source": "iana" + }, + "text/vnd.wap.sl": { + "source": "iana" + }, + "text/vnd.wap.wml": { + "source": "iana", + "extensions": ["wml"] + }, + "text/vnd.wap.wmlscript": { + "source": "iana", + "extensions": ["wmls"] + }, + "text/vnd.zoo.kcl": { + "source": "iana" + }, + "text/vtt": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["vtt"] + }, + "text/wgsl": { + "source": "iana", + "extensions": ["wgsl"] + }, + "text/x-asm": { + "source": "apache", + "extensions": ["s","asm"] + }, + "text/x-c": { + "source": "apache", + "extensions": ["c","cc","cxx","cpp","h","hh","dic"] + }, + "text/x-component": { + "source": "nginx", + "extensions": ["htc"] + }, + "text/x-fortran": { + "source": "apache", + "extensions": ["f","for","f77","f90"] + }, + "text/x-gwt-rpc": { + "compressible": true + }, + "text/x-handlebars-template": { + "extensions": ["hbs"] + }, + "text/x-java-source": { + "source": "apache", + "extensions": ["java"] + }, + "text/x-jquery-tmpl": { + "compressible": true + }, + "text/x-lua": { + "extensions": ["lua"] + }, + "text/x-markdown": { + "compressible": true, + "extensions": ["mkd"] + }, + "text/x-nfo": { + "source": "apache", + "extensions": ["nfo"] + }, + "text/x-opml": { + "source": "apache", + "extensions": ["opml"] + }, + "text/x-org": { + "compressible": true, + "extensions": ["org"] + }, + "text/x-pascal": { + "source": "apache", + "extensions": ["p","pas"] + }, + "text/x-processing": { + "compressible": true, + "extensions": ["pde"] + }, + "text/x-sass": { + "extensions": ["sass"] + }, + "text/x-scss": { + "extensions": ["scss"] + }, + "text/x-setext": { + "source": "apache", + "extensions": ["etx"] + }, + "text/x-sfv": { + "source": "apache", + "extensions": ["sfv"] + }, + "text/x-suse-ymp": { + "compressible": true, + "extensions": ["ymp"] + }, + "text/x-uuencode": { + "source": "apache", + "extensions": ["uu"] + }, + "text/x-vcalendar": { + "source": "apache", + "extensions": ["vcs"] + }, + "text/x-vcard": { + "source": "apache", + "extensions": ["vcf"] + }, + "text/xml": { + "source": "iana", + "compressible": true, + "extensions": ["xml"] + }, + "text/xml-external-parsed-entity": { + "source": "iana" + }, + "text/yaml": { + "compressible": true, + "extensions": ["yaml","yml"] + }, + "video/1d-interleaved-parityfec": { + "source": "iana" + }, + "video/3gpp": { + "source": "iana", + "extensions": ["3gp","3gpp"] + }, + "video/3gpp-tt": { + "source": "iana" + }, + "video/3gpp2": { + "source": "iana", + "extensions": ["3g2"] + }, + "video/av1": { + "source": "iana" + }, + "video/bmpeg": { + "source": "iana" + }, + "video/bt656": { + "source": "iana" + }, + "video/celb": { + "source": "iana" + }, + "video/dv": { + "source": "iana" + }, + "video/encaprtp": { + "source": "iana" + }, + "video/evc": { + "source": "iana" + }, + "video/ffv1": { + "source": "iana" + }, + "video/flexfec": { + "source": "iana" + }, + "video/h261": { + "source": "iana", + "extensions": ["h261"] + }, + "video/h263": { + "source": "iana", + "extensions": ["h263"] + }, + "video/h263-1998": { + "source": "iana" + }, + "video/h263-2000": { + "source": "iana" + }, + "video/h264": { + "source": "iana", + "extensions": ["h264"] + }, + "video/h264-rcdo": { + "source": "iana" + }, + "video/h264-svc": { + "source": "iana" + }, + "video/h265": { + "source": "iana" + }, + "video/h266": { + "source": "iana" + }, + "video/iso.segment": { + "source": "iana", + "extensions": ["m4s"] + }, + "video/jpeg": { + "source": "iana", + "extensions": ["jpgv"] + }, + "video/jpeg2000": { + "source": "iana" + }, + "video/jpm": { + "source": "apache", + "extensions": ["jpm","jpgm"] + }, + "video/jxsv": { + "source": "iana" + }, + "video/lottie+json": { + "source": "iana", + "compressible": true + }, + "video/matroska": { + "source": "iana" + }, + "video/matroska-3d": { + "source": "iana" + }, + "video/mj2": { + "source": "iana", + "extensions": ["mj2","mjp2"] + }, + "video/mp1s": { + "source": "iana" + }, + "video/mp2p": { + "source": "iana" + }, + "video/mp2t": { + "source": "iana", + "extensions": ["ts","m2t","m2ts","mts"] + }, + "video/mp4": { + "source": "iana", + "compressible": false, + "extensions": ["mp4","mp4v","mpg4"] + }, + "video/mp4v-es": { + "source": "iana" + }, + "video/mpeg": { + "source": "iana", + "compressible": false, + "extensions": ["mpeg","mpg","mpe","m1v","m2v"] + }, + "video/mpeg4-generic": { + "source": "iana" + }, + "video/mpv": { + "source": "iana" + }, + "video/nv": { + "source": "iana" + }, + "video/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["ogv"] + }, + "video/parityfec": { + "source": "iana" + }, + "video/pointer": { + "source": "iana" + }, + "video/quicktime": { + "source": "iana", + "compressible": false, + "extensions": ["qt","mov"] + }, + "video/raptorfec": { + "source": "iana" + }, + "video/raw": { + "source": "iana" + }, + "video/rtp-enc-aescm128": { + "source": "iana" + }, + "video/rtploopback": { + "source": "iana" + }, + "video/rtx": { + "source": "iana" + }, + "video/scip": { + "source": "iana" + }, + "video/smpte291": { + "source": "iana" + }, + "video/smpte292m": { + "source": "iana" + }, + "video/ulpfec": { + "source": "iana" + }, + "video/vc1": { + "source": "iana" + }, + "video/vc2": { + "source": "iana" + }, + "video/vnd.cctv": { + "source": "iana" + }, + "video/vnd.dece.hd": { + "source": "iana", + "extensions": ["uvh","uvvh"] + }, + "video/vnd.dece.mobile": { + "source": "iana", + "extensions": ["uvm","uvvm"] + }, + "video/vnd.dece.mp4": { + "source": "iana" + }, + "video/vnd.dece.pd": { + "source": "iana", + "extensions": ["uvp","uvvp"] + }, + "video/vnd.dece.sd": { + "source": "iana", + "extensions": ["uvs","uvvs"] + }, + "video/vnd.dece.video": { + "source": "iana", + "extensions": ["uvv","uvvv"] + }, + "video/vnd.directv.mpeg": { + "source": "iana" + }, + "video/vnd.directv.mpeg-tts": { + "source": "iana" + }, + "video/vnd.dlna.mpeg-tts": { + "source": "iana" + }, + "video/vnd.dvb.file": { + "source": "iana", + "extensions": ["dvb"] + }, + "video/vnd.fvt": { + "source": "iana", + "extensions": ["fvt"] + }, + "video/vnd.hns.video": { + "source": "iana" + }, + "video/vnd.iptvforum.1dparityfec-1010": { + "source": "iana" + }, + "video/vnd.iptvforum.1dparityfec-2005": { + "source": "iana" + }, + "video/vnd.iptvforum.2dparityfec-1010": { + "source": "iana" + }, + "video/vnd.iptvforum.2dparityfec-2005": { + "source": "iana" + }, + "video/vnd.iptvforum.ttsavc": { + "source": "iana" + }, + "video/vnd.iptvforum.ttsmpeg2": { + "source": "iana" + }, + "video/vnd.motorola.video": { + "source": "iana" + }, + "video/vnd.motorola.videop": { + "source": "iana" + }, + "video/vnd.mpegurl": { + "source": "iana", + "extensions": ["mxu","m4u"] + }, + "video/vnd.ms-playready.media.pyv": { + "source": "iana", + "extensions": ["pyv"] + }, + "video/vnd.nokia.interleaved-multimedia": { + "source": "iana" + }, + "video/vnd.nokia.mp4vr": { + "source": "iana" + }, + "video/vnd.nokia.videovoip": { + "source": "iana" + }, + "video/vnd.objectvideo": { + "source": "iana" + }, + "video/vnd.planar": { + "source": "iana" + }, + "video/vnd.radgamettools.bink": { + "source": "iana" + }, + "video/vnd.radgamettools.smacker": { + "source": "apache" + }, + "video/vnd.sealed.mpeg1": { + "source": "iana" + }, + "video/vnd.sealed.mpeg4": { + "source": "iana" + }, + "video/vnd.sealed.swf": { + "source": "iana" + }, + "video/vnd.sealedmedia.softseal.mov": { + "source": "iana" + }, + "video/vnd.uvvu.mp4": { + "source": "iana", + "extensions": ["uvu","uvvu"] + }, + "video/vnd.vivo": { + "source": "iana", + "extensions": ["viv"] + }, + "video/vnd.youtube.yt": { + "source": "iana" + }, + "video/vp8": { + "source": "iana" + }, + "video/vp9": { + "source": "iana" + }, + "video/webm": { + "source": "apache", + "compressible": false, + "extensions": ["webm"] + }, + "video/x-f4v": { + "source": "apache", + "extensions": ["f4v"] + }, + "video/x-fli": { + "source": "apache", + "extensions": ["fli"] + }, + "video/x-flv": { + "source": "apache", + "compressible": false, + "extensions": ["flv"] + }, + "video/x-m4v": { + "source": "apache", + "extensions": ["m4v"] + }, + "video/x-matroska": { + "source": "apache", + "compressible": false, + "extensions": ["mkv","mk3d","mks"] + }, + "video/x-mng": { + "source": "apache", + "extensions": ["mng"] + }, + "video/x-ms-asf": { + "source": "apache", + "extensions": ["asf","asx"] + }, + "video/x-ms-vob": { + "source": "apache", + "extensions": ["vob"] + }, + "video/x-ms-wm": { + "source": "apache", + "extensions": ["wm"] + }, + "video/x-ms-wmv": { + "source": "apache", + "compressible": false, + "extensions": ["wmv"] + }, + "video/x-ms-wmx": { + "source": "apache", + "extensions": ["wmx"] + }, + "video/x-ms-wvx": { + "source": "apache", + "extensions": ["wvx"] + }, + "video/x-msvideo": { + "source": "apache", + "extensions": ["avi"] + }, + "video/x-sgi-movie": { + "source": "apache", + "extensions": ["movie"] + }, + "video/x-smv": { + "source": "apache", + "extensions": ["smv"] + }, + "x-conference/x-cooltalk": { + "source": "apache", + "extensions": ["ice"] + }, + "x-shader/x-fragment": { + "compressible": true + }, + "x-shader/x-vertex": { + "compressible": true + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/index.js new file mode 100644 index 0000000..ec2be30 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/index.js @@ -0,0 +1,12 @@ +/*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module exports. + */ + +module.exports = require('./db.json') diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/package.json new file mode 100644 index 0000000..289a370 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-db/package.json @@ -0,0 +1,56 @@ +{ + "name": "mime-db", + "description": "Media Type Database", + "version": "1.54.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)", + "Robert Kieffer (http://github.com/broofa)" + ], + "license": "MIT", + "keywords": [ + "mime", + "db", + "type", + "types", + "database", + "charset", + "charsets" + ], + "repository": "jshttp/mime-db", + "devDependencies": { + "csv-parse": "4.16.3", + "eslint": "8.32.0", + "eslint-config-standard": "15.0.1", + "eslint-plugin-import": "2.27.5", + "eslint-plugin-markdown": "3.0.0", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "6.1.1", + "eslint-plugin-standard": "4.1.0", + "media-typer": "1.1.0", + "mocha": "10.2.0", + "nyc": "15.1.0", + "stream-to-array": "2.3.0", + "undici": "7.1.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "db.json", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "build": "node scripts/build", + "fetch": "node scripts/fetch-apache && node scripts/fetch-iana && node scripts/fetch-nginx", + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "update": "npm run fetch && npm run build", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/HISTORY.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/HISTORY.md new file mode 100644 index 0000000..9ba2dc0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/HISTORY.md @@ -0,0 +1,428 @@ +3.0.2 / 2025-11-20 +=================== + +* Fix: update JSDoc to reflect that functions return only `false` or `string`, not `boolean|string`. +* Fix: refined mime-score logic so `.mp4` resolves correctly +* Fix:reflect the current Node.js version supported to ≥ 18 (See 3.0.0 for more details). + +3.0.1 / 2025-03-26 +=================== + +* deps: mime-db@1.54.0 + +3.0.0 / 2024-08-31 +=================== + +* Drop support for node <18 +* deps: mime-db@1.53.0 +* resolve extension conflicts with mime-score (#119) + * asc -> application/pgp-signature is now application/pgp-keys + * mpp -> application/vnd.ms-project is now application/dash-patch+xml + * ac -> application/vnd.nokia.n-gage.ac+xml is now application/pkix-attr-cert + * bdoc -> application/x-bdoc is now application/bdoc + * wmz -> application/x-msmetafile is now application/x-ms-wmz + * xsl -> application/xslt+xml is now application/xml + * wav -> audio/wave is now audio/wav + * rtf -> text/rtf is now application/rtf + * xml -> text/xml is now application/xml + * mp4 -> video/mp4 is now application/mp4 + * mpg4 -> video/mp4 is now application/mp4 + + +2.1.35 / 2022-03-12 +=================== + + * deps: mime-db@1.52.0 + - Add extensions from IANA for more `image/*` types + - Add extension `.asc` to `application/pgp-keys` + - Add extensions to various XML types + - Add new upstream MIME types + +2.1.34 / 2021-11-08 +=================== + + * deps: mime-db@1.51.0 + - Add new upstream MIME types + +2.1.33 / 2021-10-01 +=================== + + * deps: mime-db@1.50.0 + - Add deprecated iWorks mime types and extensions + - Add new upstream MIME types + +2.1.32 / 2021-07-27 +=================== + + * deps: mime-db@1.49.0 + - Add extension `.trig` to `application/trig` + - Add new upstream MIME types + +2.1.31 / 2021-06-01 +=================== + + * deps: mime-db@1.48.0 + - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + - Add new upstream MIME types + +2.1.30 / 2021-04-02 +=================== + + * deps: mime-db@1.47.0 + - Add extension `.amr` to `audio/amr` + - Remove ambigious extensions from IANA for `application/*+xml` types + - Update primary extension to `.es` for `application/ecmascript` + +2.1.29 / 2021-02-17 +=================== + + * deps: mime-db@1.46.0 + - Add extension `.amr` to `audio/amr` + - Add extension `.m4s` to `video/iso.segment` + - Add extension `.opus` to `audio/ogg` + - Add new upstream MIME types + +2.1.28 / 2021-01-01 +=================== + + * deps: mime-db@1.45.0 + - Add `application/ubjson` with extension `.ubj` + - Add `image/avif` with extension `.avif` + - Add `image/ktx2` with extension `.ktx2` + - Add extension `.dbf` to `application/vnd.dbf` + - Add extension `.rar` to `application/vnd.rar` + - Add extension `.td` to `application/urc-targetdesc+xml` + - Add new upstream MIME types + - Fix extension of `application/vnd.apple.keynote` to be `.key` + +2.1.27 / 2020-04-23 +=================== + + * deps: mime-db@1.44.0 + - Add charsets from IANA + - Add extension `.cjs` to `application/node` + - Add new upstream MIME types + +2.1.26 / 2020-01-05 +=================== + + * deps: mime-db@1.43.0 + - Add `application/x-keepass2` with extension `.kdbx` + - Add extension `.mxmf` to `audio/mobile-xmf` + - Add extensions from IANA for `application/*+xml` types + - Add new upstream MIME types + +2.1.25 / 2019-11-12 +=================== + + * deps: mime-db@1.42.0 + - Add new upstream MIME types + - Add `application/toml` with extension `.toml` + - Add `image/vnd.ms-dds` with extension `.dds` + +2.1.24 / 2019-04-20 +=================== + + * deps: mime-db@1.40.0 + - Add extensions from IANA for `model/*` types + - Add `text/mdx` with extension `.mdx` + +2.1.23 / 2019-04-17 +=================== + + * deps: mime-db@~1.39.0 + - Add extensions `.siv` and `.sieve` to `application/sieve` + - Add new upstream MIME types + +2.1.22 / 2019-02-14 +=================== + + * deps: mime-db@~1.38.0 + - Add extension `.nq` to `application/n-quads` + - Add extension `.nt` to `application/n-triples` + - Add new upstream MIME types + +2.1.21 / 2018-10-19 +=================== + + * deps: mime-db@~1.37.0 + - Add extensions to HEIC image types + - Add new upstream MIME types + +2.1.20 / 2018-08-26 +=================== + + * deps: mime-db@~1.36.0 + - Add Apple file extensions from IANA + - Add extensions from IANA for `image/*` types + - Add new upstream MIME types + +2.1.19 / 2018-07-17 +=================== + + * deps: mime-db@~1.35.0 + - Add extension `.csl` to `application/vnd.citationstyles.style+xml` + - Add extension `.es` to `application/ecmascript` + - Add extension `.owl` to `application/rdf+xml` + - Add new upstream MIME types + - Add UTF-8 as default charset for `text/turtle` + +2.1.18 / 2018-02-16 +=================== + + * deps: mime-db@~1.33.0 + - Add `application/raml+yaml` with extension `.raml` + - Add `application/wasm` with extension `.wasm` + - Add `text/shex` with extension `.shex` + - Add extensions for JPEG-2000 images + - Add extensions from IANA for `message/*` types + - Add new upstream MIME types + - Update font MIME types + - Update `text/hjson` to registered `application/hjson` + +2.1.17 / 2017-09-01 +=================== + + * deps: mime-db@~1.30.0 + - Add `application/vnd.ms-outlook` + - Add `application/x-arj` + - Add extension `.mjs` to `application/javascript` + - Add glTF types and extensions + - Add new upstream MIME types + - Add `text/x-org` + - Add VirtualBox MIME types + - Fix `source` records for `video/*` types that are IANA + - Update `font/opentype` to registered `font/otf` + +2.1.16 / 2017-07-24 +=================== + + * deps: mime-db@~1.29.0 + - Add `application/fido.trusted-apps+json` + - Add extension `.wadl` to `application/vnd.sun.wadl+xml` + - Add extension `.gz` to `application/gzip` + - Add new upstream MIME types + - Update extensions `.md` and `.markdown` to be `text/markdown` + +2.1.15 / 2017-03-23 +=================== + + * deps: mime-db@~1.27.0 + - Add new mime types + - Add `image/apng` + +2.1.14 / 2017-01-14 +=================== + + * deps: mime-db@~1.26.0 + - Add new mime types + +2.1.13 / 2016-11-18 +=================== + + * deps: mime-db@~1.25.0 + - Add new mime types + +2.1.12 / 2016-09-18 +=================== + + * deps: mime-db@~1.24.0 + - Add new mime types + - Add `audio/mp3` + +2.1.11 / 2016-05-01 +=================== + + * deps: mime-db@~1.23.0 + - Add new mime types + +2.1.10 / 2016-02-15 +=================== + + * deps: mime-db@~1.22.0 + - Add new mime types + - Fix extension of `application/dash+xml` + - Update primary extension for `audio/mp4` + +2.1.9 / 2016-01-06 +================== + + * deps: mime-db@~1.21.0 + - Add new mime types + +2.1.8 / 2015-11-30 +================== + + * deps: mime-db@~1.20.0 + - Add new mime types + +2.1.7 / 2015-09-20 +================== + + * deps: mime-db@~1.19.0 + - Add new mime types + +2.1.6 / 2015-09-03 +================== + + * deps: mime-db@~1.18.0 + - Add new mime types + +2.1.5 / 2015-08-20 +================== + + * deps: mime-db@~1.17.0 + - Add new mime types + +2.1.4 / 2015-07-30 +================== + + * deps: mime-db@~1.16.0 + - Add new mime types + +2.1.3 / 2015-07-13 +================== + + * deps: mime-db@~1.15.0 + - Add new mime types + +2.1.2 / 2015-06-25 +================== + + * deps: mime-db@~1.14.0 + - Add new mime types + +2.1.1 / 2015-06-08 +================== + + * perf: fix deopt during mapping + +2.1.0 / 2015-06-07 +================== + + * Fix incorrectly treating extension-less file name as extension + - i.e. `'path/to/json'` will no longer return `application/json` + * Fix `.charset(type)` to accept parameters + * Fix `.charset(type)` to match case-insensitive + * Improve generation of extension to MIME mapping + * Refactor internals for readability and no argument reassignment + * Prefer `application/*` MIME types from the same source + * Prefer any type over `application/octet-stream` + * deps: mime-db@~1.13.0 + - Add nginx as a source + - Add new mime types + +2.0.14 / 2015-06-06 +=================== + + * deps: mime-db@~1.12.0 + - Add new mime types + +2.0.13 / 2015-05-31 +=================== + + * deps: mime-db@~1.11.0 + - Add new mime types + +2.0.12 / 2015-05-19 +=================== + + * deps: mime-db@~1.10.0 + - Add new mime types + +2.0.11 / 2015-05-05 +=================== + + * deps: mime-db@~1.9.1 + - Add new mime types + +2.0.10 / 2015-03-13 +=================== + + * deps: mime-db@~1.8.0 + - Add new mime types + +2.0.9 / 2015-02-09 +================== + + * deps: mime-db@~1.7.0 + - Add new mime types + - Community extensions ownership transferred from `node-mime` + +2.0.8 / 2015-01-29 +================== + + * deps: mime-db@~1.6.0 + - Add new mime types + +2.0.7 / 2014-12-30 +================== + + * deps: mime-db@~1.5.0 + - Add new mime types + - Fix various invalid MIME type entries + +2.0.6 / 2014-12-30 +================== + + * deps: mime-db@~1.4.0 + - Add new mime types + - Fix various invalid MIME type entries + - Remove example template MIME types + +2.0.5 / 2014-12-29 +================== + + * deps: mime-db@~1.3.1 + - Fix missing extensions + +2.0.4 / 2014-12-10 +================== + + * deps: mime-db@~1.3.0 + - Add new mime types + +2.0.3 / 2014-11-09 +================== + + * deps: mime-db@~1.2.0 + - Add new mime types + +2.0.2 / 2014-09-28 +================== + + * deps: mime-db@~1.1.0 + - Add new mime types + - Update charsets + +2.0.1 / 2014-09-07 +================== + + * Support Node.js 0.6 + +2.0.0 / 2014-09-02 +================== + + * Use `mime-db` + * Remove `.define()` + +1.0.2 / 2014-08-04 +================== + + * Set charset=utf-8 for `text/javascript` + +1.0.1 / 2014-06-24 +================== + + * Add `text/jsx` type + +1.0.0 / 2014-05-12 +================== + + * Return `false` for unknown types + * Set charset=utf-8 for `application/json` + +0.1.0 / 2014-05-02 +================== + + * Initial release diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/LICENSE new file mode 100644 index 0000000..0616607 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/README.md new file mode 100644 index 0000000..222d2b5 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/README.md @@ -0,0 +1,126 @@ +# mime-types + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +The ultimate javascript content-type utility. + +Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except: + +- __No fallbacks.__ Instead of naively returning the first available type, + `mime-types` simply returns `false`, so do + `var type = mime.lookup('unrecognized') || 'application/octet-stream'`. +- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`. +- No `.define()` functionality +- Bug fixes for `.lookup(path)` + +Otherwise, the API is compatible with `mime` 1.x. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install mime-types +``` + +## Note on MIME Type Data and Semver + +This package considers the programmatic api as the semver compatibility. Additionally, the package which provides the MIME data +for this package (`mime-db`) *also* considers it's programmatic api as the semver contract. This means the MIME type resolution is *not* considered +in the semver bumps. + +In the past the version of `mime-db` was pinned to give two decision points when adopting MIME data changes. This is no longer true. We still update the +`mime-db` package here as a `minor` release when necessary, but will use a `^` range going forward. This means that if you want to pin your `mime-db` data +you will need to do it in your application. While this expectation was not set in docs until now, it is how the pacakge operated, so we do not feel this is +a breaking change. + +If you wish to pin your `mime-db` version you can do that with overrides via your package manager of choice. See their documentation for how to correctly configure that. + +## Adding Types + +All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db), +so open a PR there if you'd like to add mime types. + +## API + +```js +var mime = require('mime-types') +``` + +All functions return `false` if input is invalid or not found. + +### mime.lookup(path) + +Lookup the content-type associated with a file. + +```js +mime.lookup('json') // 'application/json' +mime.lookup('.md') // 'text/markdown' +mime.lookup('file.html') // 'text/html' +mime.lookup('folder/file.js') // 'application/javascript' +mime.lookup('folder/.htaccess') // false + +mime.lookup('cats') // false +``` + +### mime.contentType(type) + +Create a full content-type header given a content-type or extension. +When given an extension, `mime.lookup` is used to get the matching +content-type, otherwise the given content-type is used. Then if the +content-type does not already have a `charset` parameter, `mime.charset` +is used to get the default charset and add to the returned content-type. + +```js +mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' +mime.contentType('file.json') // 'application/json; charset=utf-8' +mime.contentType('text/html') // 'text/html; charset=utf-8' +mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1' + +// from a full path +mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8' +``` + +### mime.extension(type) + +Get the default extension for a content-type. + +```js +mime.extension('application/octet-stream') // 'bin' +``` + +### mime.charset(type) + +Lookup the implied default charset of a content-type. + +```js +mime.charset('text/markdown') // 'UTF-8' +``` + +### var type = mime.types[extension] + +A map of content-types by extension. + +### [extensions...] = mime.extensions[type] + +A map of extensions by content-type. + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci +[ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master +[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master +[node-version-image]: https://badgen.net/npm/node/mime-types +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/mime-types +[npm-url]: https://npmjs.org/package/mime-types +[npm-version-image]: https://badgen.net/npm/v/mime-types diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/index.js new file mode 100644 index 0000000..9725ddf --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/index.js @@ -0,0 +1,211 @@ +/*! + * mime-types + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var db = require('mime-db') +var extname = require('path').extname +var mimeScore = require('./mimeScore') + +/** + * Module variables. + * @private + */ + +var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ +var TEXT_TYPE_REGEXP = /^text\//i + +/** + * Module exports. + * @public + */ + +exports.charset = charset +exports.charsets = { lookup: charset } +exports.contentType = contentType +exports.extension = extension +exports.extensions = Object.create(null) +exports.lookup = lookup +exports.types = Object.create(null) +exports._extensionConflicts = [] + +// Populate the extensions/types maps +populateMaps(exports.extensions, exports.types) + +/** + * Get the default charset for a MIME type. + * + * @param {string} type + * @return {false|string} + */ + +function charset (type) { + if (!type || typeof type !== 'string') { + return false + } + + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type) + var mime = match && db[match[1].toLowerCase()] + + if (mime && mime.charset) { + return mime.charset + } + + // default text/* to utf-8 + if (match && TEXT_TYPE_REGEXP.test(match[1])) { + return 'UTF-8' + } + + return false +} + +/** + * Create a full Content-Type header given a MIME type or extension. + * + * @param {string} str + * @return {false|string} + */ + +function contentType (str) { + // TODO: should this even be in this module? + if (!str || typeof str !== 'string') { + return false + } + + var mime = str.indexOf('/') === -1 ? exports.lookup(str) : str + + if (!mime) { + return false + } + + // TODO: use content-type or other module + if (mime.indexOf('charset') === -1) { + var charset = exports.charset(mime) + if (charset) mime += '; charset=' + charset.toLowerCase() + } + + return mime +} + +/** + * Get the default extension for a MIME type. + * + * @param {string} type + * @return {false|string} + */ + +function extension (type) { + if (!type || typeof type !== 'string') { + return false + } + + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type) + + // get extensions + var exts = match && exports.extensions[match[1].toLowerCase()] + + if (!exts || !exts.length) { + return false + } + + return exts[0] +} + +/** + * Lookup the MIME type for a file path/extension. + * + * @param {string} path + * @return {false|string} + */ + +function lookup (path) { + if (!path || typeof path !== 'string') { + return false + } + + // get the extension ("ext" or ".ext" or full path) + var extension = extname('x.' + path) + .toLowerCase() + .slice(1) + + if (!extension) { + return false + } + + return exports.types[extension] || false +} + +/** + * Populate the extensions and types maps. + * @private + */ + +function populateMaps (extensions, types) { + Object.keys(db).forEach(function forEachMimeType (type) { + var mime = db[type] + var exts = mime.extensions + + if (!exts || !exts.length) { + return + } + + // mime -> extensions + extensions[type] = exts + + // extension -> mime + for (var i = 0; i < exts.length; i++) { + var extension = exts[i] + types[extension] = _preferredType(extension, types[extension], type) + + // DELETE (eventually): Capture extension->type maps that change as a + // result of switching to mime-score. This is just to help make reviewing + // PR #119 easier, and can be removed once that PR is approved. + const legacyType = _preferredTypeLegacy( + extension, + types[extension], + type + ) + if (legacyType !== types[extension]) { + exports._extensionConflicts.push([extension, legacyType, types[extension]]) + } + } + }) +} + +// Resolve type conflict using mime-score +function _preferredType (ext, type0, type1) { + var score0 = type0 ? mimeScore(type0, db[type0].source) : 0 + var score1 = type1 ? mimeScore(type1, db[type1].source) : 0 + + return score0 > score1 ? type0 : type1 +} + +// Resolve type conflict using pre-mime-score logic +function _preferredTypeLegacy (ext, type0, type1) { + var SOURCE_RANK = ['nginx', 'apache', undefined, 'iana'] + + var score0 = type0 ? SOURCE_RANK.indexOf(db[type0].source) : 0 + var score1 = type1 ? SOURCE_RANK.indexOf(db[type1].source) : 0 + + if ( + exports.types[extension] !== 'application/octet-stream' && + (score0 > score1 || + (score0 === score1 && + exports.types[extension]?.slice(0, 12) === 'application/')) + ) { + return type0 + } + + return score0 > score1 ? type0 : type1 +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/mimeScore.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/mimeScore.js new file mode 100644 index 0000000..fc2e665 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/mimeScore.js @@ -0,0 +1,57 @@ +// 'mime-score' back-ported to CommonJS + +// Score RFC facets (see https://tools.ietf.org/html/rfc6838#section-3) +var FACET_SCORES = { + 'prs.': 100, + 'x-': 200, + 'x.': 300, + 'vnd.': 400, + default: 900 +} + +// Score mime source (Logic originally from `jshttp/mime-types` module) +var SOURCE_SCORES = { + nginx: 10, + apache: 20, + iana: 40, + default: 30 // definitions added by `jshttp/mime-db` project? +} + +var TYPE_SCORES = { + // prefer application/xml over text/xml + // prefer application/rtf over text/rtf + application: 1, + + // prefer font/woff over application/font-woff + font: 2, + + // prefer video/mp4 over audio/mp4 over application/mp4 + // See https://www.rfc-editor.org/rfc/rfc4337.html#section-2 + audio: 2, + video: 3, + + default: 0 +} + +/** + * Get each component of the score for a mime type. The sum of these is the + * total score. The higher the score, the more "official" the type. + */ +module.exports = function mimeScore (mimeType, source = 'default') { + if (mimeType === 'application/octet-stream') { + return 0 + } + + const [type, subtype] = mimeType.split('/') + + const facet = subtype.replace(/(\.|x-).*/, '$1') + + const facetScore = FACET_SCORES[facet] || FACET_SCORES.default + const sourceScore = SOURCE_SCORES[source] || SOURCE_SCORES.default + const typeScore = TYPE_SCORES[type] || TYPE_SCORES.default + + // All else being equal prefer shorter types + const lengthScore = 1 - mimeType.length / 100 + + return facetScore + sourceScore + typeScore + lengthScore +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/package.json new file mode 100644 index 0000000..6c58c27 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mime-types/package.json @@ -0,0 +1,49 @@ +{ + "name": "mime-types", + "description": "The ultimate javascript content-type utility.", + "version": "3.0.2", + "contributors": [ + "Douglas Christopher Wilson ", + "Jeremiah Senkpiel (https://searchbeam.jit.su)", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "keywords": [ + "mime", + "types" + ], + "repository": "jshttp/mime-types", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "dependencies": { + "mime-db": "^1.54.0" + }, + "devDependencies": { + "eslint": "8.33.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.32.0", + "eslint-plugin-markdown": "3.0.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "6.6.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "10.8.2", + "nyc": "15.1.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js", + "mimeScore.js" + ], + "engines": { + "node": ">=18" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec test/test.js", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/LICENSE.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/LICENSE.md new file mode 100644 index 0000000..8cb5cc6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +**_As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim._** diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/README.md new file mode 100644 index 0000000..1a068fa --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/README.md @@ -0,0 +1,528 @@ +# minimatch + +A minimal matching utility. + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Important Security Consideration! + +> [!WARNING] +> This library uses JavaScript regular expressions. Please read +> the following warning carefully, and be thoughtful about what +> you provide to this library in production systems. + +_Any_ library in JavaScript that deals with matching string +patterns using regular expressions will be subject to +[ReDoS](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS) +if the pattern is generated using untrusted input. + +Efforts have been made to mitigate risk as much as is feasible in +such a library, providing maximum recursion depths and so forth, +but these measures can only ultimately protect against accidents, +not malice. A dedicated attacker can _always_ find patterns that +cannot be defended against by a bash-compatible glob pattern +matching system that uses JavaScript regular expressions. + +To be extremely clear: + +> [!WARNING] +> **If you create a system where you take user input, and use +> that input as the source of a Regular Expression pattern, in +> this or any extant glob matcher in JavaScript, you will be +> pwned.** + +A future version of this library _may_ use a different matching +algorithm which does not exhibit backtracking problems. If and +when that happens, it will likely be a sweeping change, and those +improvements will **not** be backported to legacy versions. + +In the near term, it is not reasonable to continue to play +whack-a-mole with security advisories, and so any future ReDoS +reports will be considered "working as intended", and resolved +entirely by this warning. + +## Usage + +```js +// hybrid module, load with require() or import +import { minimatch } from 'minimatch' +// or: +const { minimatch } = require('minimatch') + +minimatch('bar.foo', '*.foo') // true! +minimatch('bar.foo', '*.bar') // false! +minimatch('bar.foo', '*.+(bar|foo)', { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +- Brace Expansion +- Extended glob matching +- "Globstar" `**` matching +- [Posix character + classes](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html), + like `[[:alpha:]]`, supporting the full range of Unicode + characters. For example, `[[:alpha:]]` will match against + `'é'`, though `[a-zA-Z]` will not. Collating symbol and set + matching is not supported, so `[[=e=]]` will _not_ match `'é'` + and `[[.ch.]]` will not match `'ch'` in locales where `ch` is + considered a single character. + +See: + +- `man sh` +- `man bash` [Pattern + Matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) +- `man 3 fnmatch` +- `man 5 gitignore` + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes in patterns +will always be interpreted as escape characters, not path separators. + +Note that `\` or `/` _will_ be interpreted as path separators in paths on +Windows, and will match against `/` in glob expressions. + +So just always use `/` in patterns. + +### UNC Paths + +On Windows, UNC paths like `//?/c:/...` or +`//ComputerName/Share/...` are handled specially. + +- Patterns starting with a double-slash followed by some + non-slash characters will preserve their double-slash. As a + result, a pattern like `//*` will match `//x`, but not `/x`. +- Patterns staring with `//?/:` will _not_ treat + the `?` as a wildcard character. Instead, it will be treated + as a normal string. +- Patterns starting with `//?/:/...` will match + file paths starting with `:/...`, and vice versa, + as if the `//?/` was not present. This behavior only is + present when the drive letters are a case-insensitive match to + one another. The remaining portions of the path/pattern are + compared case sensitively, unless `nocase:true` is set. + +Note that specifying a UNC path using `\` characters as path +separators is always allowed in the file path argument, but only +allowed in the pattern argument when `windowsPathsNoEscape: true` +is set in the options. + +## Minimatch Class + +Create a minimatch object by instantiating the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require('minimatch').Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +- `pattern` The original pattern the minimatch object represents. +- `options` The options supplied to the constructor. +- `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +- `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +- `negate` True if the pattern is negated. +- `comment` True if the pattern is a comment. +- `empty` True if the pattern is `""`. + +### Methods + +- `makeRe()` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +- `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +- `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. +- `hasMagic()` Returns true if the parsed pattern contains any + magic characters. Returns false if all comparator parts are + string literals. If the `magicalBraces` option is set on the + constructor, then it will consider brace expansions which are + not otherwise magical to be magic. If not set, then a pattern + like `a{b,c}d` will return `false`, because neither `abd` nor + `acd` contain any special glob characters. + + This does **not** mean that the pattern string can be used as a + literal filename, as it may contain magic glob characters that + are escaped. For example, the pattern `\\*` or `[*]` would not + be considered to have magic, as the matching portion parses to + the literal string `'*'` and would match a path named `'*'`, + not `'\\*'` or `'[*]'`. The `minimatch.unescape()` method may + be used to remove escape characters. + +All other methods are internal, and will be called as necessary. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, '*.js', { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter( + minimatch.filter('*.js', { matchBase: true }), +) +``` + +### minimatch.escape(pattern, options = {}) + +Escape all magic characters in a glob pattern, so that it will +only ever match literal strings. + +If the `windowsPathsNoEscape` option is used, then characters are +escaped by wrapping in `[]`, because a magic character wrapped in +a character class can only be satisfied by that exact character. + +Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot +be escaped or unescaped. + +### minimatch.unescape(pattern, options = {}) + +Un-escape a glob string that may contain some escaped characters. + +If the `windowsPathsNoEscape` option is used, then square-brace +escapes are removed, but not backslash escapes. For example, it +will turn the string `'[*]'` into `*`, but it will not turn +`'\\*'` into `'*'`, because `\` is a path separator in +`windowsPathsNoEscape` mode. + +When `windowsPathsNoEscape` is not set, then both brace escapes +and backslash escapes are removed. + +Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot +be escaped or unescaped. + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, '*.js', { matchBase: true }) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nocaseMagicOnly + +When used with `{nocase: true}`, create regular expressions that +are case-insensitive, but leave string match portions untouched. +Has no effect when used without `{nocase: true}`. + +Useful when some other form of case-insensitive matching is used, +or if the original string representation is useful in some other +way. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### magicalBraces + +This only affects the results of the `Minimatch.hasMagic` method. + +If the pattern contains brace expansions, such as `a{b,c}d`, but +no other magic characters, then the `Minimatch.hasMagic()` method +will return `false` by default. When this option set, it will +return `true` for brace expansion as well as other magic glob +characters. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + +### partial + +Compare a partial path to a pattern. As long as the parts of the path that +are present are not contradicted by the pattern, it will be treated as a +match. This is useful in applications where you're walking through a +folder structure, and don't yet have the full path, but want to ensure that +you do not walk down paths that can never be a match. + +For example, + +```js +minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d +minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d +minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a +``` + +### windowsPathsNoEscape + +Use `\\` as a path separator _only_, and _never_ as an escape +character. If set, all `\\` characters are replaced with `/` in +the pattern. Note that this makes it **impossible** to match +against paths containing literal glob pattern characters, but +allows matching with patterns constructed using `path.join()` and +`path.resolve()` on Windows platforms, mimicking the (buggy!) +behavior of earlier versions on Windows. Please use with +caution, and be mindful of [the caveat about Windows +paths](#windows). + +For legacy reasons, this is also set if +`options.allowWindowsEscape` is set to the exact value `false`. + +### windowsNoMagicRoot + +When a pattern starts with a UNC path or drive letter, and in +`nocase:true` mode, do not convert the root portions of the +pattern into a case-insensitive regular expression, and instead +leave them as strings. + +This is the default when the platform is `win32` and +`nocase:true` is set. + +### preserveMultipleSlashes + +By default, multiple `/` characters (other than the leading `//` +in a UNC path, see "UNC Paths" above) are treated as a single +`/`. + +That is, a pattern like `a///b` will match the file path `a/b`. + +Set `preserveMultipleSlashes: true` to suppress this behavior. + +### optimizationLevel + +A number indicating the level of optimization that should be done +to the pattern prior to parsing and using it for matches. + +Globstar parts `**` are always converted to `*` when `noglobstar` +is set, and multiple adjacent `**` parts are converted into a +single `**` (ie, `a/**/**/b` will be treated as `a/**/b`, as this +is equivalent in all cases). + +- `0` - Make no further changes. In this mode, `.` and `..` are + maintained in the pattern, meaning that they must also appear + in the same position in the test path string. Eg, a pattern + like `a/*/../c` will match the string `a/b/../c` but not the + string `a/c`. +- `1` - (default) Remove cases where a double-dot `..` follows a + pattern portion that is not `**`, `.`, `..`, or empty `''`. For + example, the pattern `./a/b/../*` is converted to `./a/*`, and + so it will match the path string `./a/c`, but not the path + string `./a/b/../c`. Dots and empty path portions in the + pattern are preserved. +- `2` (or higher) - Much more aggressive optimizations, suitable + for use with file-walking cases: + - Remove cases where a double-dot `..` follows a pattern + portion that is not `**`, `.`, or empty `''`. Remove empty + and `.` portions of the pattern, where safe to do so (ie, + anywhere other than the last position, the first position, or + the second position in a pattern starting with `/`, as this + may indicate a UNC path on Windows). + - Convert patterns containing `
/**/../

/` into the + equivalent `

/{..,**}/

/`, where `

` is a + a pattern portion other than `.`, `..`, `**`, or empty + `''`. + - Dedupe patterns where a `**` portion is present in one and + omitted in another, and it is not the final path portion, and + they are otherwise equivalent. So `{a/**/b,a/b}` becomes + `a/**/b`, because `**` matches against an empty path portion. + - Dedupe patterns where a `*` portion is present in one, and a + non-dot pattern other than `**`, `.`, `..`, or `''` is in the + same position in the other. So `a/{*,x}/b` becomes `a/*/b`, + because `*` can match against `x`. + + While these optimizations improve the performance of + file-walking use cases such as [glob](http://npm.im/glob) (ie, + the reason this module exists), there are cases where it will + fail to match a literal string that would have been matched in + optimization level 1 or 0. + + Specifically, while the `Minimatch.match()` method will + optimize the file path string in the same ways, resulting in + the same matches, it will fail when tested with the regular + expression provided by `Minimatch.makeRe()`, unless the path + string is first processed with + `minimatch.levelTwoFileOptimize()` or similar. + +### platform + +When set to `win32`, this will trigger all windows-specific +behaviors (special handling for UNC paths, and treating `\` as +separators in file paths for comparison.) + +Defaults to the value of `process.platform`. + +### maxGlobstarRecursion + +Max number of non-adjacent `**` patterns to recursively walk +down. + +The default of `200` is almost certainly high enough for most +purposes, and can handle absurdly excessive patterns. + +If the limit is exceeded (which would require very excessively +long patterns and paths containing lots of `**` patterns!), then +it is treated as non-matching, even if the path would normally +match the pattern provided. + +That is, this is an intentional false negative, deemed an +acceptable break in correctness for security and performance. + +### maxExtglobRecursion + +Max depth to traverse for nested extglobs like `*(a|b|c)` + +Default is 2, which is quite low, but any higher value swiftly +results in punishing performance impacts. Note that this is _not_ +relevant when the globstar types can be safely coalesced into a +single set. + +For example, `*(a|@(b|c)|d)` would be flattened into +`*(a|b|c|d)`. Thus, many common extglobs will retain good +performance and never hit this limit, even if they are +excessively deep and complicated. + +If the limit is hit, then the extglob characters are simply not +parsed, and the pattern effectively switches into `noextglob: +true` mode for the contents of that nested sub-pattern. This will +typically _not_ result in a match, but is considered a valid +trade-off for security and performance. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a +worthwhile goal, some discrepancies exist between minimatch and +other implementations. Some are intentional, and some are +unavoidable. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +Negated extglob patterns are handled as closely as possible to +Bash semantics, but there are some cases with negative extglobs +which are exceedingly difficult to express in a JavaScript +regular expression. In particular the negated pattern +`!(*|)*` will in bash match anything that does +not start with ``. However, +`!(*)*` _will_ match paths starting with +``, because the empty string can match against +the negated portion. In this library, `!(*|)*` +will _not_ match any pattern starting with ``, due to a +difference in precisely which patterns are considered "greedy" in +Regular Expressions vs bash path expansion. This may be fixable, +but not without incurring some complexity and performance costs, +and the trade-off seems to not be worth pursuing. + +Note that `fnmatch(3)` in libc is an extremely naive string comparison +matcher, which does not do anything special for slashes. This library is +designed to be used in glob searching and file walkers, and so it does do +special things with `/`. Thus, `foo*` will not match `foo/bar` in this +library, even though it would in `fnmatch(3)`. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts new file mode 100644 index 0000000..34d7a78 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts @@ -0,0 +1,2 @@ +export declare const assertValidPattern: (pattern: unknown) => void; +//# sourceMappingURL=assert-valid-pattern.d.ts.map \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map new file mode 100644 index 0000000..30ddcd5 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAUtD,CAAA"} \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js new file mode 100644 index 0000000..5fc86bb --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assertValidPattern = void 0; +const MAX_PATTERN_LENGTH = 1024 * 64; +const assertValidPattern = (pattern) => { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern'); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long'); + } +}; +exports.assertValidPattern = assertValidPattern; +//# sourceMappingURL=assert-valid-pattern.js.map \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map new file mode 100644 index 0000000..9fc27a9 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map @@ -0,0 +1 @@ +{"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AAC7B,MAAM,kBAAkB,GAA+B,CAC5D,OAAgB,EACW,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;IACxC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA;AAVY,QAAA,kBAAkB,sBAU9B","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: unknown) => void = (\n pattern: unknown,\n): asserts pattern is string => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n"]} \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/ast.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/ast.d.ts new file mode 100644 index 0000000..74f2cf9 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/ast.d.ts @@ -0,0 +1,22 @@ +import type { MinimatchOptions, MMRegExp } from './index.js'; +export type ExtglobType = '!' | '?' | '+' | '*' | '@'; +export declare class AST { + #private; + type: ExtglobType | null; + id: number; + get depth(): number; + constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions); + get hasMagic(): boolean | undefined; + toString(): string; + push(...parts: (string | AST)[]): void; + toJSON(): unknown[]; + isStart(): boolean; + isEnd(): boolean; + copyIn(part: AST | string): void; + clone(parent: AST): AST; + static fromGlob(pattern: string, options?: MinimatchOptions): AST; + toMMPattern(): MMRegExp | string; + get options(): MinimatchOptions; + toRegExpSource(allowDot?: boolean): [re: string, body: string, hasMagic: boolean, uflag: boolean]; +} +//# sourceMappingURL=ast.d.ts.map \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/ast.d.ts.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/ast.d.ts.map new file mode 100644 index 0000000..8965fd6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/ast.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwC5D,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAgJrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IAexB,EAAE,SAAO;IAET,IAAI,KAAK,IAAI,MAAM,CAElB;gBAgBC,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,CAAC,EAAE,GAAG,EACZ,OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IAkDlB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAe/B,MAAM;IAkBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsQjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CA6OjE"} \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/ast.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/ast.js new file mode 100644 index 0000000..33df376 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/ast.js @@ -0,0 +1,845 @@ +"use strict"; +// parse a single path portion +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AST = void 0; +const brace_expressions_js_1 = require("./brace-expressions.js"); +const unescape_js_1 = require("./unescape.js"); +const types = new Set(['!', '?', '+', '*', '@']); +const isExtglobType = (c) => types.has(c); +const isExtglobAST = (c) => isExtglobType(c.type); +// Map of which extglob types can adopt the children of a nested extglob +// +// anything but ! can adopt a matching type: +// +(a|+(b|c)|d) => +(a|b|c|d) +// *(a|*(b|c)|d) => *(a|b|c|d) +// @(a|@(b|c)|d) => @(a|b|c|d) +// ?(a|?(b|c)|d) => ?(a|b|c|d) +// +// * can adopt anything, because 0 or repetition is allowed +// *(a|?(b|c)|d) => *(a|b|c|d) +// *(a|+(b|c)|d) => *(a|b|c|d) +// *(a|@(b|c)|d) => *(a|b|c|d) +// +// + can adopt @, because 1 or repetition is allowed +// +(a|@(b|c)|d) => +(a|b|c|d) +// +// + and @ CANNOT adopt *, because 0 would be allowed +// +(a|*(b|c)|d) => would match "", on *(b|c) +// @(a|*(b|c)|d) => would match "", on *(b|c) +// +// + and @ CANNOT adopt ?, because 0 would be allowed +// +(a|?(b|c)|d) => would match "", on ?(b|c) +// @(a|?(b|c)|d) => would match "", on ?(b|c) +// +// ? can adopt @, because 0 or 1 is allowed +// ?(a|@(b|c)|d) => ?(a|b|c|d) +// +// ? and @ CANNOT adopt * or +, because >1 would be allowed +// ?(a|*(b|c)|d) => would match bbb on *(b|c) +// @(a|*(b|c)|d) => would match bbb on *(b|c) +// ?(a|+(b|c)|d) => would match bbb on +(b|c) +// @(a|+(b|c)|d) => would match bbb on +(b|c) +// +// ! CANNOT adopt ! (nothing else can either) +// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c) +// +// ! can adopt @ +// !(a|@(b|c)|d) => !(a|b|c|d) +// +// ! CANNOT adopt * +// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed +// +// ! CANNOT adopt + +// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed +// +// ! CANNOT adopt ? +// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x" +const adoptionMap = new Map([ + ['!', ['@']], + ['?', ['?', '@']], + ['@', ['@']], + ['*', ['*', '+', '?', '@']], + ['+', ['+', '@']], +]); +// nested extglobs that can be adopted in, but with the addition of +// a blank '' element. +const adoptionWithSpaceMap = new Map([ + ['!', ['?']], + ['@', ['?']], + ['+', ['?', '*']], +]); +// union of the previous two maps +const adoptionAnyMap = new Map([ + ['!', ['?', '@']], + ['?', ['?', '@']], + ['@', ['?', '@']], + ['*', ['*', '+', '?', '@']], + ['+', ['+', '@', '?', '*']], +]); +// Extglobs that can take over their parent if they are the only child +// the key is parent, value maps child to resulting extglob parent type +// '@' is omitted because it's a special case. An `@` extglob with a single +// member can always be usurped by that subpattern. +const usurpMap = new Map([ + ['!', new Map([['!', '@']])], + [ + '?', + new Map([ + ['*', '*'], + ['+', '*'], + ]), + ], + [ + '@', + new Map([ + ['!', '!'], + ['?', '?'], + ['@', '@'], + ['*', '*'], + ['+', '+'], + ]), + ], + [ + '+', + new Map([ + ['?', '*'], + ['*', '*'], + ]), + ], +]); +// Patterns that get prepended to bind to the start of either the +// entire string, or just a single path portion, to prevent dots +// and/or traversal patterns, when needed. +// Exts don't need the ^ or / bit, because the root binds that already. +const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))'; +const startNoDot = '(?!\\.)'; +// characters that indicate a start of pattern needs the "no dots" bit, +// because a dot *might* be matched. ( is not in the list, because in +// the case of a child extglob, it will handle the prevention itself. +const addPatternStart = new Set(['[', '.']); +// cases where traversal is A-OK, no dot prevention needed +const justDots = new Set(['..', '.']); +const reSpecials = new Set('().*{}+?[]^$\\!'); +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// any single thing other than / +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// use + when we need to ensure that *something* matches, because the * is +// the only thing in the path portion. +const starNoEmpty = qmark + '+?'; +// remove the \ chars that we added if we end up doing a nonmagic compare +// const deslash = (s: string) => s.replace(/\\(.)/g, '$1') +let ID = 0; +class AST { + type; + #root; + #hasMagic; + #uflag = false; + #parts = []; + #parent; + #parentIndex; + #negs; + #filledNegs = false; + #options; + #toString; + // set to true if it's an extglob with no children + // (which really means one child of '') + #emptyExt = false; + id = ++ID; + get depth() { + return (this.#parent?.depth ?? -1) + 1; + } + [Symbol.for('nodejs.util.inspect.custom')]() { + return { + '@@type': 'AST', + id: this.id, + type: this.type, + root: this.#root.id, + parent: this.#parent?.id, + depth: this.depth, + partsLength: this.#parts.length, + parts: this.#parts, + }; + } + constructor(type, parent, options = {}) { + this.type = type; + // extglobs are inherently magical + if (type) + this.#hasMagic = true; + this.#parent = parent; + this.#root = this.#parent ? this.#parent.#root : this; + this.#options = this.#root === this ? options : this.#root.#options; + this.#negs = this.#root === this ? [] : this.#root.#negs; + if (type === '!' && !this.#root.#filledNegs) + this.#negs.push(this); + this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0; + } + get hasMagic() { + /* c8 ignore start */ + if (this.#hasMagic !== undefined) + return this.#hasMagic; + /* c8 ignore stop */ + for (const p of this.#parts) { + if (typeof p === 'string') + continue; + if (p.type || p.hasMagic) + return (this.#hasMagic = true); + } + // note: will be undefined until we generate the regexp src and find out + return this.#hasMagic; + } + // reconstructs the pattern + toString() { + return (this.#toString !== undefined ? this.#toString + : !this.type ? + (this.#toString = this.#parts.map(p => String(p)).join('')) + : (this.#toString = + this.type + + '(' + + this.#parts.map(p => String(p)).join('|') + + ')')); + } + #fillNegs() { + /* c8 ignore start */ + if (this !== this.#root) + throw new Error('should only call on root'); + if (this.#filledNegs) + return this; + /* c8 ignore stop */ + // call toString() once to fill this out + this.toString(); + this.#filledNegs = true; + let n; + while ((n = this.#negs.pop())) { + if (n.type !== '!') + continue; + // walk up the tree, appending everthing that comes AFTER parentIndex + let p = n; + let pp = p.#parent; + while (pp) { + for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) { + for (const part of n.#parts) { + /* c8 ignore start */ + if (typeof part === 'string') { + throw new Error('string part in extglob AST??'); + } + /* c8 ignore stop */ + part.copyIn(pp.#parts[i]); + } + } + p = pp; + pp = p.#parent; + } + } + return this; + } + push(...parts) { + for (const p of parts) { + if (p === '') + continue; + /* c8 ignore start */ + if (typeof p !== 'string' && + !(p instanceof _a && p.#parent === this)) { + throw new Error('invalid part: ' + p); + } + /* c8 ignore stop */ + this.#parts.push(p); + } + } + toJSON() { + const ret = this.type === null ? + this.#parts + .slice() + .map(p => (typeof p === 'string' ? p : p.toJSON())) + : [this.type, ...this.#parts.map(p => p.toJSON())]; + if (this.isStart() && !this.type) + ret.unshift([]); + if (this.isEnd() && + (this === this.#root || + (this.#root.#filledNegs && this.#parent?.type === '!'))) { + ret.push({}); + } + return ret; + } + isStart() { + if (this.#root === this) + return true; + // if (this.type) return !!this.#parent?.isStart() + if (!this.#parent?.isStart()) + return false; + if (this.#parentIndex === 0) + return true; + // if everything AHEAD of this is a negation, then it's still the "start" + const p = this.#parent; + for (let i = 0; i < this.#parentIndex; i++) { + const pp = p.#parts[i]; + if (!(pp instanceof _a && pp.type === '!')) { + return false; + } + } + return true; + } + isEnd() { + if (this.#root === this) + return true; + if (this.#parent?.type === '!') + return true; + if (!this.#parent?.isEnd()) + return false; + if (!this.type) + return this.#parent?.isEnd(); + // if not root, it'll always have a parent + /* c8 ignore start */ + const pl = this.#parent ? this.#parent.#parts.length : 0; + /* c8 ignore stop */ + return this.#parentIndex === pl - 1; + } + copyIn(part) { + if (typeof part === 'string') + this.push(part); + else + this.push(part.clone(this)); + } + clone(parent) { + const c = new _a(this.type, parent); + for (const p of this.#parts) { + c.copyIn(p); + } + return c; + } + static #parseAST(str, ast, pos, opt, extDepth) { + const maxDepth = opt.maxExtglobRecursion ?? 2; + let escaping = false; + let inBrace = false; + let braceStart = -1; + let braceNeg = false; + if (ast.type === null) { + // outside of a extglob, append until we find a start + let i = pos; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + // we don't have to check for adoption here, because that's + // done at the other recursion point. + const doRecurse = !opt.noext && + isExtglobType(c) && + str.charAt(i) === '(' && + extDepth <= maxDepth; + if (doRecurse) { + ast.push(acc); + acc = ''; + const ext = new _a(c, ast); + i = _a.#parseAST(str, ext, i, opt, extDepth + 1); + ast.push(ext); + continue; + } + acc += c; + } + ast.push(acc); + return i; + } + // some kind of extglob, pos is at the ( + // find the next | or ) + let i = pos + 1; + let part = new _a(null, ast); + const parts = []; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + const doRecurse = !opt.noext && + isExtglobType(c) && + str.charAt(i) === '(' && + /* c8 ignore start - the maxDepth is sufficient here */ + (extDepth <= maxDepth || (ast && ast.#canAdoptType(c))); + /* c8 ignore stop */ + if (doRecurse) { + const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1; + part.push(acc); + acc = ''; + const ext = new _a(c, part); + part.push(ext); + i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd); + continue; + } + if (c === '|') { + part.push(acc); + acc = ''; + parts.push(part); + part = new _a(null, ast); + continue; + } + if (c === ')') { + if (acc === '' && ast.#parts.length === 0) { + ast.#emptyExt = true; + } + part.push(acc); + acc = ''; + ast.push(...parts, part); + return i; + } + acc += c; + } + // unfinished extglob + // if we got here, it was a malformed extglob! not an extglob, but + // maybe something else in there. + ast.type = null; + ast.#hasMagic = undefined; + ast.#parts = [str.substring(pos - 1)]; + return i; + } + #canAdoptWithSpace(child) { + return this.#canAdopt(child, adoptionWithSpaceMap); + } + #canAdopt(child, map = adoptionMap) { + if (!child || + typeof child !== 'object' || + child.type !== null || + child.#parts.length !== 1 || + this.type === null) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== 'object' || gc.type === null) { + return false; + } + return this.#canAdoptType(gc.type, map); + } + #canAdoptType(c, map = adoptionAnyMap) { + return !!map.get(this.type)?.includes(c); + } + #adoptWithSpace(child, index) { + const gc = child.#parts[0]; + const blank = new _a(null, gc, this.options); + blank.#parts.push(''); + gc.push(blank); + this.#adopt(child, index); + } + #adopt(child, index) { + const gc = child.#parts[0]; + this.#parts.splice(index, 1, ...gc.#parts); + for (const p of gc.#parts) { + if (typeof p === 'object') + p.#parent = this; + } + this.#toString = undefined; + } + #canUsurpType(c) { + const m = usurpMap.get(this.type); + return !!m?.has(c); + } + #canUsurp(child) { + if (!child || + typeof child !== 'object' || + child.type !== null || + child.#parts.length !== 1 || + this.type === null || + this.#parts.length !== 1) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== 'object' || gc.type === null) { + return false; + } + return this.#canUsurpType(gc.type); + } + #usurp(child) { + const m = usurpMap.get(this.type); + const gc = child.#parts[0]; + const nt = m?.get(gc.type); + /* c8 ignore start - impossible */ + if (!nt) + return false; + /* c8 ignore stop */ + this.#parts = gc.#parts; + for (const p of this.#parts) { + if (typeof p === 'object') { + p.#parent = this; + } + } + this.type = nt; + this.#toString = undefined; + this.#emptyExt = false; + } + static fromGlob(pattern, options = {}) { + const ast = new _a(null, undefined, options); + _a.#parseAST(pattern, ast, 0, options, 0); + return ast; + } + // returns the regular expression if there's magic, or the unescaped + // string if not. + toMMPattern() { + // should only be called on root + /* c8 ignore start */ + if (this !== this.#root) + return this.#root.toMMPattern(); + /* c8 ignore stop */ + const glob = this.toString(); + const [re, body, hasMagic, uflag] = this.toRegExpSource(); + // if we're in nocase mode, and not nocaseMagicOnly, then we do + // still need a regular expression if we have to case-insensitively + // match capital/lowercase characters. + const anyMagic = hasMagic || + this.#hasMagic || + (this.#options.nocase && + !this.#options.nocaseMagicOnly && + glob.toUpperCase() !== glob.toLowerCase()); + if (!anyMagic) { + return body; + } + const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : ''); + return Object.assign(new RegExp(`^${re}$`, flags), { + _src: re, + _glob: glob, + }); + } + get options() { + return this.#options; + } + // returns the string match, the regexp source, whether there's magic + // in the regexp (so a regular expression is required) and whether or + // not the uflag is needed for the regular expression (for posix classes) + // TODO: instead of injecting the start/end at this point, just return + // the BODY of the regexp, along with the start/end portions suitable + // for binding the start/end in either a joined full-path makeRe context + // (where we bind to (^|/), or a standalone matchPart context (where + // we bind to ^, and not /). Otherwise slashes get duped! + // + // In part-matching mode, the start is: + // - if not isStart: nothing + // - if traversal possible, but not allowed: ^(?!\.\.?$) + // - if dots allowed or not possible: ^ + // - if dots possible and not allowed: ^(?!\.) + // end is: + // - if not isEnd(): nothing + // - else: $ + // + // In full-path matching mode, we put the slash at the START of the + // pattern, so start is: + // - if first pattern: same as part-matching mode + // - if not isStart(): nothing + // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/)) + // - if dots allowed or not possible: / + // - if dots possible and not allowed: /(?!\.) + // end is: + // - if last pattern, same as part-matching mode + // - else nothing + // + // Always put the (?:$|/) on negated tails, though, because that has to be + // there to bind the end of the negated pattern portion, and it's easier to + // just stick it in now rather than try to inject it later in the middle of + // the pattern. + // + // We can just always return the same end, and leave it up to the caller + // to know whether it's going to be used joined or in parts. + // And, if the start is adjusted slightly, can do the same there: + // - if not isStart: nothing + // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$) + // - if dots allowed or not possible: (?:/|^) + // - if dots possible and not allowed: (?:/|^)(?!\.) + // + // But it's better to have a simpler binding without a conditional, for + // performance, so probably better to return both start options. + // + // Then the caller just ignores the end if it's not the first pattern, + // and the start always gets applied. + // + // But that's always going to be $ if it's the ending pattern, or nothing, + // so the caller can just attach $ at the end of the pattern when building. + // + // So the todo is: + // - better detect what kind of start is needed + // - return both flavors of starting pattern + // - attach $ at the end of the pattern when creating the actual RegExp + // + // Ah, but wait, no, that all only applies to the root when the first pattern + // is not an extglob. If the first pattern IS an extglob, then we need all + // that dot prevention biz to live in the extglob portions, because eg + // +(*|.x*) can match .xy but not .yx. + // + // So, return the two flavors if it's #root and the first child is not an + // AST, otherwise leave it to the child AST to handle it, and there, + // use the (?:^|/) style of start binding. + // + // Even simplified further: + // - Since the start for a join is eg /(?!\.) and the start for a part + // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root + // or start or whatever) and prepend ^ or / at the Regexp construction. + toRegExpSource(allowDot) { + const dot = allowDot ?? !!this.#options.dot; + if (this.#root === this) { + this.#flatten(); + this.#fillNegs(); + } + if (!isExtglobAST(this)) { + const noEmpty = this.isStart() && + this.isEnd() && + !this.#parts.some(s => typeof s !== 'string'); + const src = this.#parts + .map(p => { + const [re, _, hasMagic, uflag] = typeof p === 'string' ? + _a.#parseGlob(p, this.#hasMagic, noEmpty) + : p.toRegExpSource(allowDot); + this.#hasMagic = this.#hasMagic || hasMagic; + this.#uflag = this.#uflag || uflag; + return re; + }) + .join(''); + let start = ''; + if (this.isStart()) { + if (typeof this.#parts[0] === 'string') { + // this is the string that will match the start of the pattern, + // so we need to protect against dots and such. + // '.' and '..' cannot match unless the pattern is that exactly, + // even if it starts with . or dot:true is set. + const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]); + if (!dotTravAllowed) { + const aps = addPatternStart; + // check if we have a possibility of matching . or .., + // and prevent that. + const needNoTrav = + // dots are allowed, and the pattern starts with [ or . + (dot && aps.has(src.charAt(0))) || + // the pattern starts with \., and then [ or . + (src.startsWith('\\.') && aps.has(src.charAt(2))) || + // the pattern starts with \.\., and then [ or . + (src.startsWith('\\.\\.') && aps.has(src.charAt(4))); + // no need to prevent dots if it can't match a dot, or if a + // sub-pattern will be preventing it anyway. + const needNoDot = !dot && !allowDot && aps.has(src.charAt(0)); + start = + needNoTrav ? startNoTraversal + : needNoDot ? startNoDot + : ''; + } + } + } + // append the "end of path portion" pattern to negation tails + let end = ''; + if (this.isEnd() && + this.#root.#filledNegs && + this.#parent?.type === '!') { + end = '(?:$|\\/)'; + } + const final = start + src + end; + return [ + final, + (0, unescape_js_1.unescape)(src), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + // We need to calculate the body *twice* if it's a repeat pattern + // at the start, once in nodot mode, then again in dot mode, so a + // pattern like *(?) can match 'x.y' + const repeated = this.type === '*' || this.type === '+'; + // some kind of extglob + const start = this.type === '!' ? '(?:(?!(?:' : '(?:'; + let body = this.#partsToRegExp(dot); + if (this.isStart() && this.isEnd() && !body && this.type !== '!') { + // invalid extglob, has to at least be *something* present, if it's + // the entire path portion. + const s = this.toString(); + const me = this; + me.#parts = [s]; + me.type = null; + me.#hasMagic = undefined; + return [s, (0, unescape_js_1.unescape)(this.toString()), false, false]; + } + let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? + '' + : this.#partsToRegExp(true); + if (bodyDotAllowed === body) { + bodyDotAllowed = ''; + } + if (bodyDotAllowed) { + body = `(?:${body})(?:${bodyDotAllowed})*?`; + } + // an empty !() is exactly equivalent to a starNoEmpty + let final = ''; + if (this.type === '!' && this.#emptyExt) { + final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty; + } + else { + const close = this.type === '!' ? + // !() must match something,but !(x) can match '' + '))' + + (this.isStart() && !dot && !allowDot ? startNoDot : '') + + star + + ')' + : this.type === '@' ? ')' + : this.type === '?' ? ')?' + : this.type === '+' && bodyDotAllowed ? ')' + : this.type === '*' && bodyDotAllowed ? `)?` + : `)${this.type}`; + final = start + body + close; + } + return [ + final, + (0, unescape_js_1.unescape)(body), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + #flatten() { + if (!isExtglobAST(this)) { + for (const p of this.#parts) { + if (typeof p === 'object') { + p.#flatten(); + } + } + } + else { + // do up to 10 passes to flatten as much as possible + let iterations = 0; + let done = false; + do { + done = true; + for (let i = 0; i < this.#parts.length; i++) { + const c = this.#parts[i]; + if (typeof c === 'object') { + c.#flatten(); + if (this.#canAdopt(c)) { + done = false; + this.#adopt(c, i); + } + else if (this.#canAdoptWithSpace(c)) { + done = false; + this.#adoptWithSpace(c, i); + } + else if (this.#canUsurp(c)) { + done = false; + this.#usurp(c); + } + } + } + } while (!done && ++iterations < 10); + } + this.#toString = undefined; + } + #partsToRegExp(dot) { + return this.#parts + .map(p => { + // extglob ASTs should only contain parent ASTs + /* c8 ignore start */ + if (typeof p === 'string') { + throw new Error('string type in extglob ast??'); + } + /* c8 ignore stop */ + // can ignore hasMagic, because extglobs are already always magic + const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot); + this.#uflag = this.#uflag || uflag; + return re; + }) + .filter(p => !(this.isStart() && this.isEnd()) || !!p) + .join('|'); + } + static #parseGlob(glob, hasMagic, noEmpty = false) { + let escaping = false; + let re = ''; + let uflag = false; + // multiple stars that aren't globstars coalesce into one * + let inStar = false; + for (let i = 0; i < glob.length; i++) { + const c = glob.charAt(i); + if (escaping) { + escaping = false; + re += (reSpecials.has(c) ? '\\' : '') + c; + continue; + } + if (c === '*') { + if (inStar) + continue; + inStar = true; + re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star; + hasMagic = true; + continue; + } + else { + inStar = false; + } + if (c === '\\') { + if (i === glob.length - 1) { + re += '\\\\'; + } + else { + escaping = true; + } + continue; + } + if (c === '[') { + const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob, i); + if (consumed) { + re += src; + uflag = uflag || needUflag; + i += consumed - 1; + hasMagic = hasMagic || magic; + continue; + } + } + if (c === '?') { + re += qmark; + hasMagic = true; + continue; + } + re += regExpEscape(c); + } + return [re, (0, unescape_js_1.unescape)(glob), !!hasMagic, uflag]; + } +} +exports.AST = AST; +_a = AST; +//# sourceMappingURL=ast.js.map \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/ast.js.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/ast.js.map new file mode 100644 index 0000000..3498fb2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/ast.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":";AAAA,8BAA8B;;;;AAE9B,iEAAmD;AAEnD,+CAAwC;AAwCxC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AAC7D,MAAM,aAAa,GAAG,CAAC,CAAgB,EAAoB,EAAE,CAC3D,KAAK,CAAC,GAAG,CAAC,CAAgB,CAAC,CAAA;AAC7B,MAAM,YAAY,GAAG,CAAC,CAAM,EAAoC,EAAE,CAChE,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAEvB,wEAAwE;AACxE,EAAE;AACF,4CAA4C;AAC5C,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,EAAE;AACF,2DAA2D;AAC3D,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,EAAE;AACF,oDAAoD;AACpD,8BAA8B;AAC9B,EAAE;AACF,qDAAqD;AACrD,6CAA6C;AAC7C,6CAA6C;AAC7C,EAAE;AACF,qDAAqD;AACrD,6CAA6C;AAC7C,6CAA6C;AAC7C,EAAE;AACF,2CAA2C;AAC3C,8BAA8B;AAC9B,EAAE;AACF,2DAA2D;AAC3D,6CAA6C;AAC7C,6CAA6C;AAC7C,6CAA6C;AAC7C,6CAA6C;AAC7C,EAAE;AACF,6CAA6C;AAC7C,qEAAqE;AACrE,EAAE;AACF,gBAAgB;AAChB,8BAA8B;AAC9B,EAAE;AACF,mBAAmB;AACnB,8DAA8D;AAC9D,EAAE;AACF,mBAAmB;AACnB,8DAA8D;AAC9D,EAAE;AACF,mBAAmB;AACnB,wDAAwD;AACxD,MAAM,WAAW,GAAG,IAAI,GAAG,CAA6B;IACtD,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CAClB,CAAC,CAAA;AAEF,mEAAmE;AACnE,sBAAsB;AACtB,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAA6B;IAC/D,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CAClB,CAAC,CAAA;AAEF,iCAAiC;AACjC,MAAM,cAAc,GAAG,IAAI,GAAG,CAA6B;IACzD,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CAC5B,CAAC,CAAA;AAEF,sEAAsE;AACtE,uEAAuE;AACvE,2EAA2E;AAC3E,mDAAmD;AACnD,MAAM,QAAQ,GAAG,IAAI,GAAG,CAGtB;IACA,CAAC,GAAG,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5B;QACE,GAAG;QACH,IAAI,GAAG,CAAC;YACN,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,GAAG,EAAE,GAAG,CAAC;SACX,CAAC;KACH;IACD;QACE,GAAG;QACH,IAAI,GAAG,CAAC;YACN,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,GAAG,EAAE,GAAG,CAAC;SACX,CAAC;KACH;IACD;QACE,GAAG;QACH,IAAI,GAAG,CAAC;YACN,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,GAAG,EAAE,GAAG,CAAC;SACX,CAAC;KACH;CACF,CAAC,CAAA;AAEF,iEAAiE;AACjE,gEAAgE;AAChE,0CAA0C;AAC1C,uEAAuE;AACvE,MAAM,gBAAgB,GAAG,2BAA2B,CAAA;AACpD,MAAM,UAAU,GAAG,SAAS,CAAA;AAE5B,uEAAuE;AACvE,qEAAqE;AACrE,qEAAqE;AACrE,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AAC3C,0DAA0D;AAC1D,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAA;AACrC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,iBAAiB,CAAC,CAAA;AAC7C,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CACjC,CAAC,CAAC,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAA;AAE/C,gCAAgC;AAChC,MAAM,KAAK,GAAG,MAAM,CAAA;AAEpB,gCAAgC;AAChC,MAAM,IAAI,GAAG,KAAK,GAAG,IAAI,CAAA;AACzB,0EAA0E;AAC1E,sCAAsC;AACtC,MAAM,WAAW,GAAG,KAAK,GAAG,IAAI,CAAA;AAEhC,yEAAyE;AACzE,2DAA2D;AAE3D,IAAI,EAAE,GAAG,CAAC,CAAA;AACV,MAAa,GAAG;IACd,IAAI,CAAoB;IACf,KAAK,CAAK;IAEnB,SAAS,CAAU;IACnB,MAAM,GAAY,KAAK,CAAA;IACvB,MAAM,GAAqB,EAAE,CAAA;IAC7B,OAAO,CAAM;IACb,YAAY,CAAQ;IACpB,KAAK,CAAO;IACZ,WAAW,GAAY,KAAK,CAAA;IAC5B,QAAQ,CAAkB;IAC1B,SAAS,CAAS;IAClB,kDAAkD;IAClD,uCAAuC;IACvC,SAAS,GAAY,KAAK,CAAA;IAC1B,EAAE,GAAG,EAAE,EAAE,CAAA;IAET,IAAI,KAAK;QACP,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IACxC,CAAC;IAED,CAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QACxC,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;YACnB,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE;YACxB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAC/B,KAAK,EAAE,IAAI,CAAC,MAAM;SACnB,CAAA;IACH,CAAC;IAED,YACE,IAAwB,EACxB,MAAY,EACZ,UAA4B,EAAE;QAE9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,kCAAkC;QAClC,IAAI,IAAI;YAAE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;QAC/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;QACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAA;QACnE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAA;QACxD,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW;YAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;IACnE,CAAC;IAED,IAAI,QAAQ;QACV,qBAAqB;QACrB,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC,SAAS,CAAA;QACvD,oBAAoB;QACpB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC5B,IAAI,OAAO,CAAC,KAAK,QAAQ;gBAAE,SAAQ;YACnC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ;gBAAE,OAAO,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAA;QAC1D,CAAC;QACD,wEAAwE;QACxE,OAAO,IAAI,CAAC,SAAS,CAAA;IACvB,CAAC;IAED,2BAA2B;IAC3B,QAAQ;QACN,OAAO,CACL,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS;YAC7C,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACZ,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAC7D,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS;oBACb,IAAI,CAAC,IAAI;wBACT,GAAG;wBACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;wBACzC,GAAG,CAAC,CACT,CAAA;IACH,CAAC;IAED,SAAS;QACP,qBAAqB;QACrB,IAAI,IAAI,KAAK,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACpE,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAA;QACjC,oBAAoB;QAEpB,wCAAwC;QACxC,IAAI,CAAC,QAAQ,EAAE,CAAA;QACf,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA;QACvB,IAAI,CAAkB,CAAA;QACtB,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,CAAC,IAAI,KAAK,GAAG;gBAAE,SAAQ;YAC5B,qEAAqE;YACrE,IAAI,CAAC,GAAoB,CAAC,CAAA;YAC1B,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAA;YAClB,OAAO,EAAE,EAAE,CAAC;gBACV,KACE,IAAI,CAAC,GAAG,CAAC,CAAC,YAAY,GAAG,CAAC,EAC1B,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAChC,CAAC,EAAE,EACH,CAAC;oBACD,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;wBAC5B,qBAAqB;wBACrB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;4BAC7B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;wBACjD,CAAC;wBACD,oBAAoB;wBACpB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;oBAC3B,CAAC;gBACH,CAAC;gBACD,CAAC,GAAG,EAAE,CAAA;gBACN,EAAE,GAAG,CAAC,CAAC,OAAO,CAAA;YAChB,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,CAAC,GAAG,KAAuB;QAC7B,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;YACtB,IAAI,CAAC,KAAK,EAAE;gBAAE,SAAQ;YACtB,qBAAqB;YACrB,IACE,OAAO,CAAC,KAAK,QAAQ;gBACrB,CAAC,CAAC,CAAC,YAAY,EAAG,IAAI,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,EACzC,CAAC;gBACD,MAAM,IAAI,KAAK,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAA;YACvC,CAAC;YACD,oBAAoB;YACpB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACrB,CAAC;IACH,CAAC;IAED,MAAM;QACJ,MAAM,GAAG,GACP,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;YAClB,IAAI,CAAC,MAAM;iBACR,KAAK,EAAE;iBACP,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAE,CAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;QAC7D,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QACjD,IACE,IAAI,CAAC,KAAK,EAAE;YACZ,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK;gBAClB,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC,EACzD,CAAC;YACD,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,IAAI,CAAA;QACpC,kDAAkD;QAClD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE;YAAE,OAAO,KAAK,CAAA;QAC1C,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC;YAAE,OAAO,IAAI,CAAA;QACxC,yEAAyE;QACzE,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAA;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;YACtB,IAAI,CAAC,CAAC,EAAE,YAAY,EAAG,IAAI,EAAE,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;gBAC5C,OAAO,KAAK,CAAA;YACd,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK;QACH,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,IAAI,CAAA;QACpC,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,KAAK,GAAG;YAAE,OAAO,IAAI,CAAA;QAC3C,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE;YAAE,OAAO,KAAK,CAAA;QACxC,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,CAAA;QAC5C,0CAA0C;QAC1C,qBAAqB;QACrB,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;QACxD,oBAAoB;QACpB,OAAO,IAAI,CAAC,YAAY,KAAK,EAAE,GAAG,CAAC,CAAA;IACrC,CAAC;IAED,MAAM,CAAC,IAAkB;QACvB,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;;YACxC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;IAClC,CAAC;IAED,KAAK,CAAC,MAAW;QACf,MAAM,CAAC,GAAG,IAAI,EAAG,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QACpC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC5B,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACb,CAAC;QACD,OAAO,CAAC,CAAA;IACV,CAAC;IAED,MAAM,CAAC,SAAS,CACd,GAAW,EACX,GAAQ,EACR,GAAW,EACX,GAAqB,EACrB,QAAgB;QAEhB,MAAM,QAAQ,GAAG,GAAG,CAAC,mBAAmB,IAAI,CAAC,CAAA;QAC7C,IAAI,QAAQ,GAAG,KAAK,CAAA;QACpB,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,IAAI,UAAU,GAAG,CAAC,CAAC,CAAA;QACnB,IAAI,QAAQ,GAAG,KAAK,CAAA;QACpB,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACtB,qDAAqD;YACrD,IAAI,CAAC,GAAG,GAAG,CAAA;YACX,IAAI,GAAG,GAAG,EAAE,CAAA;YACZ,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;gBACtB,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAA;gBACzB,2DAA2D;gBAC3D,0BAA0B;gBAC1B,IAAI,QAAQ,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;oBAC3B,QAAQ,GAAG,CAAC,QAAQ,CAAA;oBACpB,GAAG,IAAI,CAAC,CAAA;oBACR,SAAQ;gBACV,CAAC;gBAED,IAAI,OAAO,EAAE,CAAC;oBACZ,IAAI,CAAC,KAAK,UAAU,GAAG,CAAC,EAAE,CAAC;wBACzB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;4BAC3B,QAAQ,GAAG,IAAI,CAAA;wBACjB,CAAC;oBACH,CAAC;yBAAM,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU,GAAG,CAAC,IAAI,QAAQ,CAAC,EAAE,CAAC;wBAC5D,OAAO,GAAG,KAAK,CAAA;oBACjB,CAAC;oBACD,GAAG,IAAI,CAAC,CAAA;oBACR,SAAQ;gBACV,CAAC;qBAAM,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;oBACrB,OAAO,GAAG,IAAI,CAAA;oBACd,UAAU,GAAG,CAAC,CAAA;oBACd,QAAQ,GAAG,KAAK,CAAA;oBAChB,GAAG,IAAI,CAAC,CAAA;oBACR,SAAQ;gBACV,CAAC;gBAED,2DAA2D;gBAC3D,qCAAqC;gBACrC,MAAM,SAAS,GACb,CAAC,GAAG,CAAC,KAAK;oBACV,aAAa,CAAC,CAAC,CAAC;oBAChB,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG;oBACrB,QAAQ,IAAI,QAAQ,CAAA;gBACtB,IAAI,SAAS,EAAE,CAAC;oBACd,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;oBACb,GAAG,GAAG,EAAE,CAAA;oBACR,MAAM,GAAG,GAAG,IAAI,EAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;oBAC3B,CAAC,GAAG,EAAG,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAA;oBACjD,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;oBACb,SAAQ;gBACV,CAAC;gBACD,GAAG,IAAI,CAAC,CAAA;YACV,CAAC;YACD,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACb,OAAO,CAAC,CAAA;QACV,CAAC;QAED,wCAAwC;QACxC,uBAAuB;QACvB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAA;QACf,IAAI,IAAI,GAAG,IAAI,EAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QAC7B,MAAM,KAAK,GAAU,EAAE,CAAA;QACvB,IAAI,GAAG,GAAG,EAAE,CAAA;QACZ,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;YACtB,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAA;YACzB,2DAA2D;YAC3D,0BAA0B;YAC1B,IAAI,QAAQ,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC3B,QAAQ,GAAG,CAAC,QAAQ,CAAA;gBACpB,GAAG,IAAI,CAAC,CAAA;gBACR,SAAQ;YACV,CAAC;YAED,IAAI,OAAO,EAAE,CAAC;gBACZ,IAAI,CAAC,KAAK,UAAU,GAAG,CAAC,EAAE,CAAC;oBACzB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;wBAC3B,QAAQ,GAAG,IAAI,CAAA;oBACjB,CAAC;gBACH,CAAC;qBAAM,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU,GAAG,CAAC,IAAI,QAAQ,CAAC,EAAE,CAAC;oBAC5D,OAAO,GAAG,KAAK,CAAA;gBACjB,CAAC;gBACD,GAAG,IAAI,CAAC,CAAA;gBACR,SAAQ;YACV,CAAC;iBAAM,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACrB,OAAO,GAAG,IAAI,CAAA;gBACd,UAAU,GAAG,CAAC,CAAA;gBACd,QAAQ,GAAG,KAAK,CAAA;gBAChB,GAAG,IAAI,CAAC,CAAA;gBACR,SAAQ;YACV,CAAC;YAED,MAAM,SAAS,GACb,CAAC,GAAG,CAAC,KAAK;gBACV,aAAa,CAAC,CAAC,CAAC;gBAChB,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG;gBACrB,uDAAuD;gBACvD,CAAC,QAAQ,IAAI,QAAQ,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACzD,oBAAoB;YACpB,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,QAAQ,GAAG,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;gBACpD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBACd,GAAG,GAAG,EAAE,CAAA;gBACR,MAAM,GAAG,GAAG,IAAI,EAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;gBAC5B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBACd,CAAC,GAAG,EAAG,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAAC,CAAA;gBACxD,SAAQ;YACV,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBACd,GAAG,GAAG,EAAE,CAAA;gBACR,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;gBAChB,IAAI,GAAG,IAAI,EAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;gBACzB,SAAQ;YACV,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,IAAI,GAAG,KAAK,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAC1C,GAAG,CAAC,SAAS,GAAG,IAAI,CAAA;gBACtB,CAAC;gBACD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBACd,GAAG,GAAG,EAAE,CAAA;gBACR,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,CAAA;gBACxB,OAAO,CAAC,CAAA;YACV,CAAC;YACD,GAAG,IAAI,CAAC,CAAA;QACV,CAAC;QAED,qBAAqB;QACrB,kEAAkE;QAClE,iCAAiC;QACjC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAA;QACf,GAAG,CAAC,SAAS,GAAG,SAAS,CAAA;QACzB,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;QACrC,OAAO,CAAC,CAAA;IACV,CAAC;IAED,kBAAkB,CAAC,KAAoB;QAIrC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAA;IACpD,CAAC;IAED,SAAS,CACP,KAAoB,EACpB,MAAuC,WAAW;QAKlD,IACE,CAAC,KAAK;YACN,OAAO,KAAK,KAAK,QAAQ;YACzB,KAAK,CAAC,IAAI,KAAK,IAAI;YACnB,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YACzB,IAAI,CAAC,IAAI,KAAK,IAAI,EAClB,CAAC;YACD,OAAO,KAAK,CAAA;QACd,CAAC;QACD,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAC1B,IAAI,CAAC,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACtD,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAQ,IAAoC,CAAC,aAAa,CACxD,EAAE,CAAC,IAAI,EACP,GAAG,CACJ,CAAA;IACH,CAAC;IACD,aAAa,CACX,CAAS,EACT,MAAuC,cAAc;QAErD,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAmB,CAAC,EAAE,QAAQ,CAAC,CAAgB,CAAC,CAAA;IACxE,CAAC;IAED,eAAe,CAEb,KAEC,EACD,KAAa;QAEb,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAgC,CAAA;QACzD,MAAM,KAAK,GAAG,IAAI,EAAG,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAC7C,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACrB,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACd,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IAC3B,CAAC;IAED,MAAM,CACJ,KAEC,EACD,KAAa;QAEb,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAgC,CAAA;QACzD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA;QAC1C,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC;YAC1B,IAAI,OAAO,CAAC,KAAK,QAAQ;gBAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAAA;QAC7C,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAED,aAAa,CAAC,CAAS;QACrB,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAmB,CAAC,CAAA;QAChD,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAgB,CAAC,CAAA;IACnC,CAAC;IAED,SAAS,CAAC,KAAoB;QAI5B,IACE,CAAC,KAAK;YACN,OAAO,KAAK,KAAK,QAAQ;YACzB,KAAK,CAAC,IAAI,KAAK,IAAI;YACnB,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YACzB,IAAI,CAAC,IAAI,KAAK,IAAI;YAClB,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EACxB,CAAC;YACD,OAAO,KAAK,CAAA;QACd,CAAC;QACD,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAC1B,IAAI,CAAC,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACtD,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAQ,IAAoC,CAAC,aAAa,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;IACrE,CAAC;IAED,MAAM,CAAoC,KAA2B;QACnE,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAmB,CAAC,CAAA;QAChD,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAgC,CAAA;QACzD,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;QAC1B,kCAAkC;QAClC,IAAI,CAAC,EAAE;YAAE,OAAO,KAAK,CAAA;QACrB,oBAAoB;QACpB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,CAAA;QACvB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC5B,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;gBAC1B,CAAC,CAAC,OAAO,GAAG,IAAI,CAAA;YAClB,CAAC;QACH,CAAC;QACD,IAAI,CAAC,IAAI,GAAG,EAAE,CAAA;QACd,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;IACxB,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,OAAe,EAAE,UAA4B,EAAE;QAC7D,MAAM,GAAG,GAAG,IAAI,EAAG,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;QAC7C,EAAG,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;QAC1C,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,oEAAoE;IACpE,iBAAiB;IACjB,WAAW;QACT,gCAAgC;QAChC,qBAAqB;QACrB,IAAI,IAAI,KAAK,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAA;QACxD,oBAAoB;QACpB,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;QAC5B,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;QACzD,+DAA+D;QAC/D,mEAAmE;QACnE,sCAAsC;QACtC,MAAM,QAAQ,GACZ,QAAQ;YACR,IAAI,CAAC,SAAS;YACd,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM;gBACnB,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe;gBAC9B,IAAI,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;QAC9C,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QACpE,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE;YACjD,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,IAAI;SACZ,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAED,qEAAqE;IACrE,qEAAqE;IACrE,yEAAyE;IACzE,sEAAsE;IACtE,qEAAqE;IACrE,wEAAwE;IACxE,oEAAoE;IACpE,0DAA0D;IAC1D,EAAE;IACF,uCAAuC;IACvC,4BAA4B;IAC5B,wDAAwD;IACxD,uCAAuC;IACvC,8CAA8C;IAC9C,UAAU;IACV,4BAA4B;IAC5B,YAAY;IACZ,EAAE;IACF,mEAAmE;IACnE,wBAAwB;IACxB,iDAAiD;IACjD,8BAA8B;IAC9B,8DAA8D;IAC9D,uCAAuC;IACvC,8CAA8C;IAC9C,UAAU;IACV,gDAAgD;IAChD,iBAAiB;IACjB,EAAE;IACF,0EAA0E;IAC1E,2EAA2E;IAC3E,2EAA2E;IAC3E,eAAe;IACf,EAAE;IACF,wEAAwE;IACxE,4DAA4D;IAC5D,iEAAiE;IACjE,4BAA4B;IAC5B,8DAA8D;IAC9D,6CAA6C;IAC7C,oDAAoD;IACpD,EAAE;IACF,uEAAuE;IACvE,gEAAgE;IAChE,EAAE;IACF,sEAAsE;IACtE,qCAAqC;IACrC,EAAE;IACF,0EAA0E;IAC1E,2EAA2E;IAC3E,EAAE;IACF,kBAAkB;IAClB,+CAA+C;IAC/C,4CAA4C;IAC5C,uEAAuE;IACvE,EAAE;IACF,6EAA6E;IAC7E,0EAA0E;IAC1E,sEAAsE;IACtE,sCAAsC;IACtC,EAAE;IACF,yEAAyE;IACzE,oEAAoE;IACpE,0CAA0C;IAC1C,EAAE;IACF,2BAA2B;IAC3B,sEAAsE;IACtE,qEAAqE;IACrE,uEAAuE;IACvE,cAAc,CACZ,QAAkB;QAElB,MAAM,GAAG,GAAG,QAAQ,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAA;QAC3C,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC,QAAQ,EAAE,CAAA;YACf,IAAI,CAAC,SAAS,EAAE,CAAA;QAClB,CAAC;QACD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,MAAM,OAAO,GACX,IAAI,CAAC,OAAO,EAAE;gBACd,IAAI,CAAC,KAAK,EAAE;gBACZ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAA;YAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM;iBACpB,GAAG,CAAC,CAAC,CAAC,EAAE;gBACP,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,GAC5B,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;oBACrB,EAAG,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC;oBAC5C,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAA;gBAC9B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAA;gBAC3C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,KAAK,CAAA;gBAClC,OAAO,EAAE,CAAA;YACX,CAAC,CAAC;iBACD,IAAI,CAAC,EAAE,CAAC,CAAA;YAEX,IAAI,KAAK,GAAG,EAAE,CAAA;YACd,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;gBACnB,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;oBACvC,+DAA+D;oBAC/D,+CAA+C;oBAE/C,gEAAgE;oBAChE,+CAA+C;oBAC/C,MAAM,cAAc,GAClB,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;oBAC1D,IAAI,CAAC,cAAc,EAAE,CAAC;wBACpB,MAAM,GAAG,GAAG,eAAe,CAAA;wBAC3B,sDAAsD;wBACtD,oBAAoB;wBACpB,MAAM,UAAU;wBACd,uDAAuD;wBACvD,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;4BAC/B,8CAA8C;4BAC9C,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;4BACjD,gDAAgD;4BAChD,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;wBACtD,2DAA2D;wBAC3D,4CAA4C;wBAC5C,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;wBAE7D,KAAK;4BACH,UAAU,CAAC,CAAC,CAAC,gBAAgB;gCAC7B,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU;oCACxB,CAAC,CAAC,EAAE,CAAA;oBACR,CAAC;gBACH,CAAC;YACH,CAAC;YAED,6DAA6D;YAC7D,IAAI,GAAG,GAAG,EAAE,CAAA;YACZ,IACE,IAAI,CAAC,KAAK,EAAE;gBACZ,IAAI,CAAC,KAAK,CAAC,WAAW;gBACtB,IAAI,CAAC,OAAO,EAAE,IAAI,KAAK,GAAG,EAC1B,CAAC;gBACD,GAAG,GAAG,WAAW,CAAA;YACnB,CAAC;YACD,MAAM,KAAK,GAAG,KAAK,GAAG,GAAG,GAAG,GAAG,CAAA;YAC/B,OAAO;gBACL,KAAK;gBACL,IAAA,sBAAQ,EAAC,GAAG,CAAC;gBACb,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;gBACnC,IAAI,CAAC,MAAM;aACZ,CAAA;QACH,CAAC;QAED,iEAAiE;QACjE,iEAAiE;QACjE,oCAAoC;QAEpC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,CAAA;QACvD,uBAAuB;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAA;QACrD,IAAI,IAAI,GAAI,IAAoC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAA;QAEpE,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;YACjE,mEAAmE;YACnE,2BAA2B;YAC3B,MAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;YACzB,MAAM,EAAE,GAAG,IAAW,CAAA;YACtB,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAA;YACf,EAAE,CAAC,IAAI,GAAG,IAAI,CAAA;YACd,EAAE,CAAC,SAAS,GAAG,SAAS,CAAA;YACxB,OAAO,CAAC,CAAC,EAAE,IAAA,sBAAQ,EAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;QACrD,CAAC;QAED,IAAI,cAAc,GAChB,CAAC,QAAQ,IAAI,QAAQ,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;YAC3C,EAAE;YACJ,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;QAC7B,IAAI,cAAc,KAAK,IAAI,EAAE,CAAC;YAC5B,cAAc,GAAG,EAAE,CAAA;QACrB,CAAC;QACD,IAAI,cAAc,EAAE,CAAC;YACnB,IAAI,GAAG,MAAM,IAAI,OAAO,cAAc,KAAK,CAAA;QAC7C,CAAC;QAED,sDAAsD;QACtD,IAAI,KAAK,GAAG,EAAE,CAAA;QACd,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACxC,KAAK,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,WAAW,CAAA;QAClE,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,GACT,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;gBACjB,iDAAiD;gBACjD,IAAI;oBACJ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;oBACvD,IAAI;oBACJ,GAAG;gBACL,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG;oBACzB,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI;wBAC1B,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,GAAG;4BAC3C,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,IAAI;gCAC5C,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAA;YACnB,KAAK,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA;QAC9B,CAAC;QACD,OAAO;YACL,KAAK;YACL,IAAA,sBAAQ,EAAC,IAAI,CAAC;YACd,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;YACnC,IAAI,CAAC,MAAM;SACZ,CAAA;IACH,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAC5B,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;oBAC1B,CAAC,CAAC,QAAQ,EAAE,CAAA;gBACd,CAAC;YACH,CAAC;QACH,CAAC;aAAM,CAAC;YACN,oDAAoD;YACpD,IAAI,UAAU,GAAG,CAAC,CAAA;YAClB,IAAI,IAAI,GAAG,KAAK,CAAA;YAChB,GAAG,CAAC;gBACF,IAAI,GAAG,IAAI,CAAA;gBACX,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC5C,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;oBACxB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;wBAC1B,CAAC,CAAC,QAAQ,EAAE,CAAA;wBACZ,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;4BACtB,IAAI,GAAG,KAAK,CAAA;4BACZ,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;wBACnB,CAAC;6BAAM,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC;4BACtC,IAAI,GAAG,KAAK,CACX;4BAAC,IAAoC,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;wBAC9D,CAAC;6BAAM,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;4BAC7B,IAAI,GAAG,KAAK,CACX;4BAAC,IAAoC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;wBAClD,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,UAAU,GAAG,EAAE,EAAC;QACtC,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAED,cAAc,CAAoC,GAAY;QAC5D,OAAO,IAAI,CAAC,MAAM;aACf,GAAG,CAAC,CAAC,CAAC,EAAE;YACP,+CAA+C;YAC/C,qBAAqB;YACrB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;YACjD,CAAC;YACD,oBAAoB;YACpB,iEAAiE;YACjE,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAA;YACvD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,KAAK,CAAA;YAClC,OAAO,EAAE,CAAA;QACX,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACrD,IAAI,CAAC,GAAG,CAAC,CAAA;IACd,CAAC;IAED,MAAM,CAAC,UAAU,CACf,IAAY,EACZ,QAA6B,EAC7B,UAAmB,KAAK;QAExB,IAAI,QAAQ,GAAG,KAAK,CAAA;QACpB,IAAI,EAAE,GAAG,EAAE,CAAA;QACX,IAAI,KAAK,GAAG,KAAK,CAAA;QACjB,2DAA2D;QAC3D,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;YACxB,IAAI,QAAQ,EAAE,CAAC;gBACb,QAAQ,GAAG,KAAK,CAAA;gBAChB,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;gBACzC,SAAQ;YACV,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,IAAI,MAAM;oBAAE,SAAQ;gBACpB,MAAM,GAAG,IAAI,CAAA;gBACb,EAAE,IAAI,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAA;gBACzD,QAAQ,GAAG,IAAI,CAAA;gBACf,SAAQ;YACV,CAAC;iBAAM,CAAC;gBACN,MAAM,GAAG,KAAK,CAAA;YAChB,CAAC;YACD,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC1B,EAAE,IAAI,MAAM,CAAA;gBACd,CAAC;qBAAM,CAAC;oBACN,QAAQ,GAAG,IAAI,CAAA;gBACjB,CAAC;gBACD,SAAQ;YACV,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,GAAG,IAAA,iCAAU,EAAC,IAAI,EAAE,CAAC,CAAC,CAAA;gBAC7D,IAAI,QAAQ,EAAE,CAAC;oBACb,EAAE,IAAI,GAAG,CAAA;oBACT,KAAK,GAAG,KAAK,IAAI,SAAS,CAAA;oBAC1B,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAA;oBACjB,QAAQ,GAAG,QAAQ,IAAI,KAAK,CAAA;oBAC5B,SAAQ;gBACV,CAAC;YACH,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,EAAE,IAAI,KAAK,CAAA;gBACX,QAAQ,GAAG,IAAI,CAAA;gBACf,SAAQ;YACV,CAAC;YACD,EAAE,IAAI,YAAY,CAAC,CAAC,CAAC,CAAA;QACvB,CAAC;QACD,OAAO,CAAC,EAAE,EAAE,IAAA,sBAAQ,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAChD,CAAC;CACF;AArxBD,kBAqxBC","sourcesContent":["// parse a single path portion\n\nimport { parseClass } from './brace-expressions.js'\nimport type { MinimatchOptions, MMRegExp } from './index.js'\nimport { unescape } from './unescape.js'\n\n// classes [] are handled by the parseClass method\n// for positive extglobs, we sub-parse the contents, and combine,\n// with the appropriate regexp close.\n// for negative extglobs, we sub-parse the contents, but then\n// have to include the rest of the pattern, then the parent, etc.,\n// as the thing that cannot be because RegExp negative lookaheads\n// are different from globs.\n//\n// So for example:\n// a@(i|w!(x|y)z|j)b => ^a(i|w((!?(x|y)zb).*)z|j)b$\n// 1 2 3 4 5 6 1 2 3 46 5 6\n//\n// Assembling the extglob requires not just the negated patterns themselves,\n// but also anything following the negative patterns up to the boundary\n// of the current pattern, plus anything following in the parent pattern.\n//\n//\n// So, first, we parse the string into an AST of extglobs, without turning\n// anything into regexps yet.\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y']}, 'z'], ['j']]}, 'b']\n//\n// Then, for all the negative extglobs, we append whatever comes after in\n// each parent as their tail\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y'], 'z', 'b'}, 'z'], ['j']]}, 'b']\n//\n// Lastly, we turn each of these pieces into a regexp, and join\n//\n// v----- .* because there's more following,\n// v v otherwise, .+ because it must be\n// v v *something* there.\n// ['^a', {@ ['i', 'w(?:(!?(?:x|y).*zb$).*)z', 'j' ]}, 'b$']\n// copy what follows into here--^^^^^\n// ['^a', '(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)', 'b$']\n// ['^a(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)b$']\n\nexport type ExtglobType = '!' | '?' | '+' | '*' | '@'\nconst types = new Set(['!', '?', '+', '*', '@'])\nconst isExtglobType = (c: string | null): c is ExtglobType =>\n types.has(c as ExtglobType)\nconst isExtglobAST = (c: AST): c is AST & { type: ExtglobType } =>\n isExtglobType(c.type)\n\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map([\n ['!', ['@']],\n ['?', ['?', '@']],\n ['@', ['@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@']],\n])\n\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map([\n ['!', ['?']],\n ['@', ['?']],\n ['+', ['?', '*']],\n])\n\n// union of the previous two maps\nconst adoptionAnyMap = new Map([\n ['!', ['?', '@']],\n ['?', ['?', '@']],\n ['@', ['?', '@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@', '?', '*']],\n])\n\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map<\n ExtglobType,\n Map\n>([\n ['!', new Map([['!', '@']])],\n [\n '?',\n new Map([\n ['*', '*'],\n ['+', '*'],\n ]),\n ],\n [\n '@',\n new Map([\n ['!', '!'],\n ['?', '?'],\n ['@', '@'],\n ['*', '*'],\n ['+', '+'],\n ]),\n ],\n [\n '+',\n new Map([\n ['?', '*'],\n ['*', '*'],\n ]),\n ],\n])\n\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))'\nconst startNoDot = '(?!\\\\.)'\n\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.'])\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.'])\nconst reSpecials = new Set('().*{}+?[]^$\\\\!')\nconst regExpEscape = (s: string) =>\n s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// any single thing other than /\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?'\n\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\n\nlet ID = 0\nexport class AST {\n type: ExtglobType | null\n readonly #root: AST\n\n #hasMagic?: boolean\n #uflag: boolean = false\n #parts: (string | AST)[] = []\n #parent?: AST\n #parentIndex: number\n #negs: AST[]\n #filledNegs: boolean = false\n #options: MinimatchOptions\n #toString?: string\n // set to true if it's an extglob with no children\n // (which really means one child of '')\n #emptyExt: boolean = false\n id = ++ID\n\n get depth(): number {\n return (this.#parent?.depth ?? -1) + 1\n }\n\n [Symbol.for('nodejs.util.inspect.custom')]() {\n return {\n '@@type': 'AST',\n id: this.id,\n type: this.type,\n root: this.#root.id,\n parent: this.#parent?.id,\n depth: this.depth,\n partsLength: this.#parts.length,\n parts: this.#parts,\n }\n }\n\n constructor(\n type: ExtglobType | null,\n parent?: AST,\n options: MinimatchOptions = {},\n ) {\n this.type = type\n // extglobs are inherently magical\n if (type) this.#hasMagic = true\n this.#parent = parent\n this.#root = this.#parent ? this.#parent.#root : this\n this.#options = this.#root === this ? options : this.#root.#options\n this.#negs = this.#root === this ? [] : this.#root.#negs\n if (type === '!' && !this.#root.#filledNegs) this.#negs.push(this)\n this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0\n }\n\n get hasMagic(): boolean | undefined {\n /* c8 ignore start */\n if (this.#hasMagic !== undefined) return this.#hasMagic\n /* c8 ignore stop */\n for (const p of this.#parts) {\n if (typeof p === 'string') continue\n if (p.type || p.hasMagic) return (this.#hasMagic = true)\n }\n // note: will be undefined until we generate the regexp src and find out\n return this.#hasMagic\n }\n\n // reconstructs the pattern\n toString(): string {\n return (\n this.#toString !== undefined ? this.#toString\n : !this.type ?\n (this.#toString = this.#parts.map(p => String(p)).join(''))\n : (this.#toString =\n this.type +\n '(' +\n this.#parts.map(p => String(p)).join('|') +\n ')')\n )\n }\n\n #fillNegs() {\n /* c8 ignore start */\n if (this !== this.#root) throw new Error('should only call on root')\n if (this.#filledNegs) return this\n /* c8 ignore stop */\n\n // call toString() once to fill this out\n this.toString()\n this.#filledNegs = true\n let n: AST | undefined\n while ((n = this.#negs.pop())) {\n if (n.type !== '!') continue\n // walk up the tree, appending everthing that comes AFTER parentIndex\n let p: AST | undefined = n\n let pp = p.#parent\n while (pp) {\n for (\n let i = p.#parentIndex + 1;\n !pp.type && i < pp.#parts.length;\n i++\n ) {\n for (const part of n.#parts) {\n /* c8 ignore start */\n if (typeof part === 'string') {\n throw new Error('string part in extglob AST??')\n }\n /* c8 ignore stop */\n part.copyIn(pp.#parts[i])\n }\n }\n p = pp\n pp = p.#parent\n }\n }\n return this\n }\n\n push(...parts: (string | AST)[]) {\n for (const p of parts) {\n if (p === '') continue\n /* c8 ignore start */\n if (\n typeof p !== 'string' &&\n !(p instanceof AST && p.#parent === this)\n ) {\n throw new Error('invalid part: ' + p)\n }\n /* c8 ignore stop */\n this.#parts.push(p)\n }\n }\n\n toJSON() {\n const ret: unknown[] =\n this.type === null ?\n this.#parts\n .slice()\n .map(p => (typeof p === 'string' ? p : p.toJSON()))\n : [this.type, ...this.#parts.map(p => (p as AST).toJSON())]\n if (this.isStart() && !this.type) ret.unshift([])\n if (\n this.isEnd() &&\n (this === this.#root ||\n (this.#root.#filledNegs && this.#parent?.type === '!'))\n ) {\n ret.push({})\n }\n return ret\n }\n\n isStart(): boolean {\n if (this.#root === this) return true\n // if (this.type) return !!this.#parent?.isStart()\n if (!this.#parent?.isStart()) return false\n if (this.#parentIndex === 0) return true\n // if everything AHEAD of this is a negation, then it's still the \"start\"\n const p = this.#parent\n for (let i = 0; i < this.#parentIndex; i++) {\n const pp = p.#parts[i]\n if (!(pp instanceof AST && pp.type === '!')) {\n return false\n }\n }\n return true\n }\n\n isEnd(): boolean {\n if (this.#root === this) return true\n if (this.#parent?.type === '!') return true\n if (!this.#parent?.isEnd()) return false\n if (!this.type) return this.#parent?.isEnd()\n // if not root, it'll always have a parent\n /* c8 ignore start */\n const pl = this.#parent ? this.#parent.#parts.length : 0\n /* c8 ignore stop */\n return this.#parentIndex === pl - 1\n }\n\n copyIn(part: AST | string) {\n if (typeof part === 'string') this.push(part)\n else this.push(part.clone(this))\n }\n\n clone(parent: AST) {\n const c = new AST(this.type, parent)\n for (const p of this.#parts) {\n c.copyIn(p)\n }\n return c\n }\n\n static #parseAST(\n str: string,\n ast: AST,\n pos: number,\n opt: MinimatchOptions,\n extDepth: number,\n ): number {\n const maxDepth = opt.maxExtglobRecursion ?? 2\n let escaping = false\n let inBrace = false\n let braceStart = -1\n let braceNeg = false\n if (ast.type === null) {\n // outside of a extglob, append until we find a start\n let i = pos\n let acc = ''\n while (i < str.length) {\n const c = str.charAt(i++)\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping\n acc += c\n continue\n }\n\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true\n }\n } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false\n }\n acc += c\n continue\n } else if (c === '[') {\n inBrace = true\n braceStart = i\n braceNeg = false\n acc += c\n continue\n }\n\n // we don't have to check for adoption here, because that's\n // done at the other recursion point.\n const doRecurse =\n !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n extDepth <= maxDepth\n if (doRecurse) {\n ast.push(acc)\n acc = ''\n const ext = new AST(c, ast)\n i = AST.#parseAST(str, ext, i, opt, extDepth + 1)\n ast.push(ext)\n continue\n }\n acc += c\n }\n ast.push(acc)\n return i\n }\n\n // some kind of extglob, pos is at the (\n // find the next | or )\n let i = pos + 1\n let part = new AST(null, ast)\n const parts: AST[] = []\n let acc = ''\n while (i < str.length) {\n const c = str.charAt(i++)\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping\n acc += c\n continue\n }\n\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true\n }\n } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false\n }\n acc += c\n continue\n } else if (c === '[') {\n inBrace = true\n braceStart = i\n braceNeg = false\n acc += c\n continue\n }\n\n const doRecurse =\n !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n /* c8 ignore start - the maxDepth is sufficient here */\n (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)))\n /* c8 ignore stop */\n if (doRecurse) {\n const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1\n part.push(acc)\n acc = ''\n const ext = new AST(c, part)\n part.push(ext)\n i = AST.#parseAST(str, ext, i, opt, extDepth + depthAdd)\n continue\n }\n if (c === '|') {\n part.push(acc)\n acc = ''\n parts.push(part)\n part = new AST(null, ast)\n continue\n }\n if (c === ')') {\n if (acc === '' && ast.#parts.length === 0) {\n ast.#emptyExt = true\n }\n part.push(acc)\n acc = ''\n ast.push(...parts, part)\n return i\n }\n acc += c\n }\n\n // unfinished extglob\n // if we got here, it was a malformed extglob! not an extglob, but\n // maybe something else in there.\n ast.type = null\n ast.#hasMagic = undefined\n ast.#parts = [str.substring(pos - 1)]\n return i\n }\n\n #canAdoptWithSpace(child?: AST | string): child is AST & {\n type: null\n parts: [AST & { type: ExtglobType }]\n } {\n return this.#canAdopt(child, adoptionWithSpaceMap)\n }\n\n #canAdopt(\n child?: AST | string,\n map: Map = adoptionMap,\n ): child is AST & {\n type: null\n parts: [AST & { type: ExtglobType }]\n } {\n if (\n !child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null\n ) {\n return false\n }\n const gc = child.#parts[0]\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false\n }\n return (this as AST & { type: ExtglobType }).#canAdoptType(\n gc.type,\n map,\n )\n }\n #canAdoptType(\n c: string,\n map: Map = adoptionAnyMap,\n ): c is ExtglobType {\n return !!map.get(this.type as ExtglobType)?.includes(c as ExtglobType)\n }\n\n #adoptWithSpace(\n this: AST & { type: ExtglobType },\n child: AST & {\n type: null\n },\n index: number,\n ) {\n const gc = child.#parts[0] as AST & { type: ExtglobType }\n const blank = new AST(null, gc, this.options)\n blank.#parts.push('')\n gc.push(blank)\n this.#adopt(child, index)\n }\n\n #adopt(\n child: AST & {\n type: null\n },\n index: number,\n ) {\n const gc = child.#parts[0] as AST & { type: ExtglobType }\n this.#parts.splice(index, 1, ...gc.#parts)\n for (const p of gc.#parts) {\n if (typeof p === 'object') p.#parent = this\n }\n this.#toString = undefined\n }\n\n #canUsurpType(c: string): boolean {\n const m = usurpMap.get(this.type as ExtglobType)\n return !!m?.has(c as ExtglobType)\n }\n\n #canUsurp(child?: AST | string): child is AST & {\n type: null\n parts: [AST & { type: ExtglobType }]\n } {\n if (\n !child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null ||\n this.#parts.length !== 1\n ) {\n return false\n }\n const gc = child.#parts[0]\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false\n }\n return (this as AST & { type: ExtglobType }).#canUsurpType(gc.type)\n }\n\n #usurp(this: AST & { type: ExtglobType }, child: AST & { type: null }) {\n const m = usurpMap.get(this.type as ExtglobType)\n const gc = child.#parts[0] as AST & { type: ExtglobType }\n const nt = m?.get(gc.type)\n /* c8 ignore start - impossible */\n if (!nt) return false\n /* c8 ignore stop */\n this.#parts = gc.#parts\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#parent = this\n }\n }\n this.type = nt\n this.#toString = undefined\n this.#emptyExt = false\n }\n\n static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n const ast = new AST(null, undefined, options)\n AST.#parseAST(pattern, ast, 0, options, 0)\n return ast\n }\n\n // returns the regular expression if there's magic, or the unescaped\n // string if not.\n toMMPattern(): MMRegExp | string {\n // should only be called on root\n /* c8 ignore start */\n if (this !== this.#root) return this.#root.toMMPattern()\n /* c8 ignore stop */\n const glob = this.toString()\n const [re, body, hasMagic, uflag] = this.toRegExpSource()\n // if we're in nocase mode, and not nocaseMagicOnly, then we do\n // still need a regular expression if we have to case-insensitively\n // match capital/lowercase characters.\n const anyMagic =\n hasMagic ||\n this.#hasMagic ||\n (this.#options.nocase &&\n !this.#options.nocaseMagicOnly &&\n glob.toUpperCase() !== glob.toLowerCase())\n if (!anyMagic) {\n return body\n }\n\n const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '')\n return Object.assign(new RegExp(`^${re}$`, flags), {\n _src: re,\n _glob: glob,\n })\n }\n\n get options() {\n return this.#options\n }\n\n // returns the string match, the regexp source, whether there's magic\n // in the regexp (so a regular expression is required) and whether or\n // not the uflag is needed for the regular expression (for posix classes)\n // TODO: instead of injecting the start/end at this point, just return\n // the BODY of the regexp, along with the start/end portions suitable\n // for binding the start/end in either a joined full-path makeRe context\n // (where we bind to (^|/), or a standalone matchPart context (where\n // we bind to ^, and not /). Otherwise slashes get duped!\n //\n // In part-matching mode, the start is:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n // - if dots allowed or not possible: ^\n // - if dots possible and not allowed: ^(?!\\.)\n // end is:\n // - if not isEnd(): nothing\n // - else: $\n //\n // In full-path matching mode, we put the slash at the START of the\n // pattern, so start is:\n // - if first pattern: same as part-matching mode\n // - if not isStart(): nothing\n // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n // - if dots allowed or not possible: /\n // - if dots possible and not allowed: /(?!\\.)\n // end is:\n // - if last pattern, same as part-matching mode\n // - else nothing\n //\n // Always put the (?:$|/) on negated tails, though, because that has to be\n // there to bind the end of the negated pattern portion, and it's easier to\n // just stick it in now rather than try to inject it later in the middle of\n // the pattern.\n //\n // We can just always return the same end, and leave it up to the caller\n // to know whether it's going to be used joined or in parts.\n // And, if the start is adjusted slightly, can do the same there:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n // - if dots allowed or not possible: (?:/|^)\n // - if dots possible and not allowed: (?:/|^)(?!\\.)\n //\n // But it's better to have a simpler binding without a conditional, for\n // performance, so probably better to return both start options.\n //\n // Then the caller just ignores the end if it's not the first pattern,\n // and the start always gets applied.\n //\n // But that's always going to be $ if it's the ending pattern, or nothing,\n // so the caller can just attach $ at the end of the pattern when building.\n //\n // So the todo is:\n // - better detect what kind of start is needed\n // - return both flavors of starting pattern\n // - attach $ at the end of the pattern when creating the actual RegExp\n //\n // Ah, but wait, no, that all only applies to the root when the first pattern\n // is not an extglob. If the first pattern IS an extglob, then we need all\n // that dot prevention biz to live in the extglob portions, because eg\n // +(*|.x*) can match .xy but not .yx.\n //\n // So, return the two flavors if it's #root and the first child is not an\n // AST, otherwise leave it to the child AST to handle it, and there,\n // use the (?:^|/) style of start binding.\n //\n // Even simplified further:\n // - Since the start for a join is eg /(?!\\.) and the start for a part\n // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n // or start or whatever) and prepend ^ or / at the Regexp construction.\n toRegExpSource(\n allowDot?: boolean,\n ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n const dot = allowDot ?? !!this.#options.dot\n if (this.#root === this) {\n this.#flatten()\n this.#fillNegs()\n }\n if (!isExtglobAST(this)) {\n const noEmpty =\n this.isStart() &&\n this.isEnd() &&\n !this.#parts.some(s => typeof s !== 'string')\n const src = this.#parts\n .map(p => {\n const [re, _, hasMagic, uflag] =\n typeof p === 'string' ?\n AST.#parseGlob(p, this.#hasMagic, noEmpty)\n : p.toRegExpSource(allowDot)\n this.#hasMagic = this.#hasMagic || hasMagic\n this.#uflag = this.#uflag || uflag\n return re\n })\n .join('')\n\n let start = ''\n if (this.isStart()) {\n if (typeof this.#parts[0] === 'string') {\n // this is the string that will match the start of the pattern,\n // so we need to protect against dots and such.\n\n // '.' and '..' cannot match unless the pattern is that exactly,\n // even if it starts with . or dot:true is set.\n const dotTravAllowed =\n this.#parts.length === 1 && justDots.has(this.#parts[0])\n if (!dotTravAllowed) {\n const aps = addPatternStart\n // check if we have a possibility of matching . or ..,\n // and prevent that.\n const needNoTrav =\n // dots are allowed, and the pattern starts with [ or .\n (dot && aps.has(src.charAt(0))) ||\n // the pattern starts with \\., and then [ or .\n (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n // the pattern starts with \\.\\., and then [ or .\n (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)))\n // no need to prevent dots if it can't match a dot, or if a\n // sub-pattern will be preventing it anyway.\n const needNoDot = !dot && !allowDot && aps.has(src.charAt(0))\n\n start =\n needNoTrav ? startNoTraversal\n : needNoDot ? startNoDot\n : ''\n }\n }\n }\n\n // append the \"end of path portion\" pattern to negation tails\n let end = ''\n if (\n this.isEnd() &&\n this.#root.#filledNegs &&\n this.#parent?.type === '!'\n ) {\n end = '(?:$|\\\\/)'\n }\n const final = start + src + end\n return [\n final,\n unescape(src),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ]\n }\n\n // We need to calculate the body *twice* if it's a repeat pattern\n // at the start, once in nodot mode, then again in dot mode, so a\n // pattern like *(?) can match 'x.y'\n\n const repeated = this.type === '*' || this.type === '+'\n // some kind of extglob\n const start = this.type === '!' ? '(?:(?!(?:' : '(?:'\n let body = (this as AST & { type: ExtglobType }).#partsToRegExp(dot)\n\n if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n // invalid extglob, has to at least be *something* present, if it's\n // the entire path portion.\n const s = this.toString()\n const me = this as AST\n me.#parts = [s]\n me.type = null\n me.#hasMagic = undefined\n return [s, unescape(this.toString()), false, false]\n }\n\n let bodyDotAllowed =\n !repeated || allowDot || dot || !startNoDot ?\n ''\n : this.#partsToRegExp(true)\n if (bodyDotAllowed === body) {\n bodyDotAllowed = ''\n }\n if (bodyDotAllowed) {\n body = `(?:${body})(?:${bodyDotAllowed})*?`\n }\n\n // an empty !() is exactly equivalent to a starNoEmpty\n let final = ''\n if (this.type === '!' && this.#emptyExt) {\n final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty\n } else {\n const close =\n this.type === '!' ?\n // !() must match something,but !(x) can match ''\n '))' +\n (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n star +\n ')'\n : this.type === '@' ? ')'\n : this.type === '?' ? ')?'\n : this.type === '+' && bodyDotAllowed ? ')'\n : this.type === '*' && bodyDotAllowed ? `)?`\n : `)${this.type}`\n final = start + body + close\n }\n return [\n final,\n unescape(body),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ]\n }\n\n #flatten() {\n if (!isExtglobAST(this)) {\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#flatten()\n }\n }\n } else {\n // do up to 10 passes to flatten as much as possible\n let iterations = 0\n let done = false\n do {\n done = true\n for (let i = 0; i < this.#parts.length; i++) {\n const c = this.#parts[i]\n if (typeof c === 'object') {\n c.#flatten()\n if (this.#canAdopt(c)) {\n done = false\n this.#adopt(c, i)\n } else if (this.#canAdoptWithSpace(c)) {\n done = false\n ;(this as AST & { type: ExtglobType }).#adoptWithSpace(c, i)\n } else if (this.#canUsurp(c)) {\n done = false\n ;(this as AST & { type: ExtglobType }).#usurp(c)\n }\n }\n }\n } while (!done && ++iterations < 10)\n }\n this.#toString = undefined\n }\n\n #partsToRegExp(this: AST & { type: ExtglobType }, dot: boolean) {\n return this.#parts\n .map(p => {\n // extglob ASTs should only contain parent ASTs\n /* c8 ignore start */\n if (typeof p === 'string') {\n throw new Error('string type in extglob ast??')\n }\n /* c8 ignore stop */\n // can ignore hasMagic, because extglobs are already always magic\n const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot)\n this.#uflag = this.#uflag || uflag\n return re\n })\n .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n .join('|')\n }\n\n static #parseGlob(\n glob: string,\n hasMagic: boolean | undefined,\n noEmpty: boolean = false,\n ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n let escaping = false\n let re = ''\n let uflag = false\n // multiple stars that aren't globstars coalesce into one *\n let inStar = false\n for (let i = 0; i < glob.length; i++) {\n const c = glob.charAt(i)\n if (escaping) {\n escaping = false\n re += (reSpecials.has(c) ? '\\\\' : '') + c\n continue\n }\n if (c === '*') {\n if (inStar) continue\n inStar = true\n re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star\n hasMagic = true\n continue\n } else {\n inStar = false\n }\n if (c === '\\\\') {\n if (i === glob.length - 1) {\n re += '\\\\\\\\'\n } else {\n escaping = true\n }\n continue\n }\n if (c === '[') {\n const [src, needUflag, consumed, magic] = parseClass(glob, i)\n if (consumed) {\n re += src\n uflag = uflag || needUflag\n i += consumed - 1\n hasMagic = hasMagic || magic\n continue\n }\n }\n if (c === '?') {\n re += qmark\n hasMagic = true\n continue\n }\n re += regExpEscape(c)\n }\n return [re, unescape(glob), !!hasMagic, uflag]\n }\n}\n"]} \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts new file mode 100644 index 0000000..b1572de --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts @@ -0,0 +1,8 @@ +export type ParseClassResult = [ + src: string, + uFlag: boolean, + consumed: number, + hasMagic: boolean +]; +export declare const parseClass: (glob: string, position: number) => ParseClassResult; +//# sourceMappingURL=brace-expressions.d.ts.map \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map new file mode 100644 index 0000000..09b4c11 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"brace-expressions.d.ts","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AAgCA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,OAAO;CAClB,CAAA;AAQD,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,UAAU,MAAM,KACf,gBA2HF,CAAA"} \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/brace-expressions.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/brace-expressions.js new file mode 100644 index 0000000..2b7b037 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/brace-expressions.js @@ -0,0 +1,150 @@ +"use strict"; +// translate the various posix character classes into unicode properties +// this works across all unicode locales +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseClass = void 0; +// { : [, /u flag required, negated] +const posixClasses = { + '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true], + '[:alpha:]': ['\\p{L}\\p{Nl}', true], + '[:ascii:]': ['\\x' + '00-\\x' + '7f', false], + '[:blank:]': ['\\p{Zs}\\t', true], + '[:cntrl:]': ['\\p{Cc}', true], + '[:digit:]': ['\\p{Nd}', true], + '[:graph:]': ['\\p{Z}\\p{C}', true, true], + '[:lower:]': ['\\p{Ll}', true], + '[:print:]': ['\\p{C}', true], + '[:punct:]': ['\\p{P}', true], + '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true], + '[:upper:]': ['\\p{Lu}', true], + '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true], + '[:xdigit:]': ['A-Fa-f0-9', false], +}; +// only need to escape a few things inside of brace expressions +// escapes: [ \ ] - +const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&'); +// escape all regexp magic characters +const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// everything has already been escaped, we just have to join +const rangesToString = (ranges) => ranges.join(''); +// takes a glob string at a posix brace expression, and returns +// an equivalent regular expression source, and boolean indicating +// whether the /u flag needs to be applied, and the number of chars +// consumed to parse the character class. +// This also removes out of order ranges, and returns ($.) if the +// entire class just no good. +const parseClass = (glob, position) => { + const pos = position; + /* c8 ignore start */ + if (glob.charAt(pos) !== '[') { + throw new Error('not in a brace expression'); + } + /* c8 ignore stop */ + const ranges = []; + const negs = []; + let i = pos + 1; + let sawStart = false; + let uflag = false; + let escaping = false; + let negate = false; + let endPos = pos; + let rangeStart = ''; + WHILE: while (i < glob.length) { + const c = glob.charAt(i); + if ((c === '!' || c === '^') && i === pos + 1) { + negate = true; + i++; + continue; + } + if (c === ']' && sawStart && !escaping) { + endPos = i + 1; + break; + } + sawStart = true; + if (c === '\\') { + if (!escaping) { + escaping = true; + i++; + continue; + } + // escaped \ char, fall through and treat like normal char + } + if (c === '[' && !escaping) { + // either a posix class, a collation equivalent, or just a [ + for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) { + if (glob.startsWith(cls, i)) { + // invalid, [a-[] is fine, but not [a-[:alpha]] + if (rangeStart) { + return ['$.', false, glob.length - pos, true]; + } + i += cls.length; + if (neg) + negs.push(unip); + else + ranges.push(unip); + uflag = uflag || u; + continue WHILE; + } + } + } + // now it's just a normal character, effectively + escaping = false; + if (rangeStart) { + // throw this range away if it's not valid, but others + // can still match. + if (c > rangeStart) { + ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c)); + } + else if (c === rangeStart) { + ranges.push(braceEscape(c)); + } + rangeStart = ''; + i++; + continue; + } + // now might be the start of a range. + // can be either c-d or c-] or c] or c] at this point + if (glob.startsWith('-]', i + 1)) { + ranges.push(braceEscape(c + '-')); + i += 2; + continue; + } + if (glob.startsWith('-', i + 1)) { + rangeStart = c; + i += 2; + continue; + } + // not the start of a range, just a single character + ranges.push(braceEscape(c)); + i++; + } + if (endPos < i) { + // didn't see the end of the class, not a valid class, + // but might still be valid as a literal match. + return ['', false, 0, false]; + } + // if we got no ranges and no negates, then we have a range that + // cannot possibly match anything, and that poisons the whole glob + if (!ranges.length && !negs.length) { + return ['$.', false, glob.length - pos, true]; + } + // if we got one positive range, and it's a single character, then that's + // not actually a magic pattern, it's just that one literal character. + // we should not treat that as "magic", we should just return the literal + // character. [_] is a perfectly valid way to escape glob magic chars. + if (negs.length === 0 && + ranges.length === 1 && + /^\\?.$/.test(ranges[0]) && + !negate) { + const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]; + return [regexpEscape(r), false, endPos - pos, false]; + } + const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'; + const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'; + const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')' + : ranges.length ? sranges + : snegs; + return [comb, uflag, endPos - pos, true]; +}; +exports.parseClass = parseClass; +//# sourceMappingURL=brace-expressions.js.map \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/brace-expressions.js.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/brace-expressions.js.map new file mode 100644 index 0000000..3cc3b34 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/brace-expressions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"brace-expressions.js","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":";AAAA,wEAAwE;AACxE,wCAAwC;;;AAExC,8DAA8D;AAC9D,MAAM,YAAY,GAChB;IACE,WAAW,EAAE,CAAC,sBAAsB,EAAE,IAAI,CAAC;IAC3C,WAAW,EAAE,CAAC,eAAe,EAAE,IAAI,CAAC;IACpC,WAAW,EAAE,CAAC,KAAK,GAAG,QAAQ,GAAG,IAAI,EAAE,KAAK,CAAC;IAC7C,WAAW,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC;IACjC,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC;IACzC,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;IAC7B,WAAW,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;IAC7B,WAAW,EAAE,CAAC,uBAAuB,EAAE,IAAI,CAAC;IAC5C,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,UAAU,EAAE,CAAC,6BAA6B,EAAE,IAAI,CAAC;IACjD,YAAY,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC;CACnC,CAAA;AAEH,+DAA+D;AAC/D,mBAAmB;AACnB,MAAM,WAAW,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;AACjE,qCAAqC;AACrC,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CACjC,CAAC,CAAC,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAA;AAE/C,4DAA4D;AAC5D,MAAM,cAAc,GAAG,CAAC,MAAgB,EAAU,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AASpE,+DAA+D;AAC/D,kEAAkE;AAClE,mEAAmE;AACnE,yCAAyC;AACzC,iEAAiE;AACjE,6BAA6B;AACtB,MAAM,UAAU,GAAG,CACxB,IAAY,EACZ,QAAgB,EACE,EAAE;IACpB,MAAM,GAAG,GAAG,QAAQ,CAAA;IACpB,qBAAqB;IACrB,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;IAC9C,CAAC;IACD,oBAAoB;IACpB,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,MAAM,IAAI,GAAa,EAAE,CAAA;IAEzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAA;IACf,IAAI,QAAQ,GAAG,KAAK,CAAA;IACpB,IAAI,KAAK,GAAG,KAAK,CAAA;IACjB,IAAI,QAAQ,GAAG,KAAK,CAAA;IACpB,IAAI,MAAM,GAAG,KAAK,CAAA;IAClB,IAAI,MAAM,GAAG,GAAG,CAAA;IAChB,IAAI,UAAU,GAAG,EAAE,CAAA;IACnB,KAAK,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC9B,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACxB,IAAI,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,EAAE,CAAC;YAC9C,MAAM,GAAG,IAAI,CAAA;YACb,CAAC,EAAE,CAAA;YACH,SAAQ;QACV,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,QAAQ,IAAI,CAAC,QAAQ,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAA;YACd,MAAK;QACP,CAAC;QAED,QAAQ,GAAG,IAAI,CAAA;QACf,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;YACf,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,QAAQ,GAAG,IAAI,CAAA;gBACf,CAAC,EAAE,CAAA;gBACH,SAAQ;YACV,CAAC;YACD,0DAA0D;QAC5D,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC3B,4DAA4D;YAC5D,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;gBACjE,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;oBAC5B,+CAA+C;oBAC/C,IAAI,UAAU,EAAE,CAAC;wBACf,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;oBAC/C,CAAC;oBACD,CAAC,IAAI,GAAG,CAAC,MAAM,CAAA;oBACf,IAAI,GAAG;wBAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;;wBACnB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;oBACtB,KAAK,GAAG,KAAK,IAAI,CAAC,CAAA;oBAClB,SAAS,KAAK,CAAA;gBAChB,CAAC;YACH,CAAC;QACH,CAAC;QAED,gDAAgD;QAChD,QAAQ,GAAG,KAAK,CAAA;QAChB,IAAI,UAAU,EAAE,CAAC;YACf,sDAAsD;YACtD,mBAAmB;YACnB,IAAI,CAAC,GAAG,UAAU,EAAE,CAAC;gBACnB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;YAC7D,CAAC;iBAAM,IAAI,CAAC,KAAK,UAAU,EAAE,CAAC;gBAC5B,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;YAC7B,CAAC;YACD,UAAU,GAAG,EAAE,CAAA;YACf,CAAC,EAAE,CAAA;YACH,SAAQ;QACV,CAAC;QAED,qCAAqC;QACrC,8DAA8D;QAC9D,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACjC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;YACjC,CAAC,IAAI,CAAC,CAAA;YACN,SAAQ;QACV,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAChC,UAAU,GAAG,CAAC,CAAA;YACd,CAAC,IAAI,CAAC,CAAA;YACN,SAAQ;QACV,CAAC;QAED,oDAAoD;QACpD,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;QAC3B,CAAC,EAAE,CAAA;IACL,CAAC;IAED,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QACf,sDAAsD;QACtD,+CAA+C;QAC/C,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAA;IAC9B,CAAC;IAED,gEAAgE;IAChE,kEAAkE;IAClE,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACnC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;IAC/C,CAAC;IAED,yEAAyE;IACzE,sEAAsE;IACtE,yEAAyE;IACzE,sEAAsE;IACtE,IACE,IAAI,CAAC,MAAM,KAAK,CAAC;QACjB,MAAM,CAAC,MAAM,KAAK,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACxB,CAAC,MAAM,EACP,CAAC;QACD,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAClE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,KAAK,CAAC,CAAA;IACtD,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,GAAG,CAAA;IACxE,MAAM,KAAK,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACpE,MAAM,IAAI,GACR,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG;QAChE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;YACzB,CAAC,CAAC,KAAK,CAAA;IAET,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC,CAAA;AA9HY,QAAA,UAAU,cA8HtB","sourcesContent":["// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n\n// { : [, /u flag required, negated]\nconst posixClasses: { [k: string]: [e: string, u: boolean, n?: boolean] } =\n {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n '[:cntrl:]': ['\\\\p{Cc}', true],\n '[:digit:]': ['\\\\p{Nd}', true],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n '[:lower:]': ['\\\\p{Ll}', true],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}', true],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n '[:upper:]': ['\\\\p{Lu}', true],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n '[:xdigit:]': ['A-Fa-f0-9', false],\n }\n\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s: string) => s.replace(/[[\\]\\\\-]/g, '\\\\$&')\n// escape all regexp magic characters\nconst regexpEscape = (s: string) =>\n s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges: string[]): string => ranges.join('')\n\nexport type ParseClassResult = [\n src: string,\n uFlag: boolean,\n consumed: number,\n hasMagic: boolean,\n]\n\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (\n glob: string,\n position: number,\n): ParseClassResult => {\n const pos = position\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression')\n }\n /* c8 ignore stop */\n const ranges: string[] = []\n const negs: string[] = []\n\n let i = pos + 1\n let sawStart = false\n let uflag = false\n let escaping = false\n let negate = false\n let endPos = pos\n let rangeStart = ''\n WHILE: while (i < glob.length) {\n const c = glob.charAt(i)\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true\n i++\n continue\n }\n\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1\n break\n }\n\n sawStart = true\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true\n i++\n continue\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return ['$.', false, glob.length - pos, true]\n }\n i += cls.length\n if (neg) negs.push(unip)\n else ranges.push(unip)\n uflag = uflag || u\n continue WHILE\n }\n }\n }\n\n // now it's just a normal character, effectively\n escaping = false\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (c > rangeStart) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c))\n } else if (c === rangeStart) {\n ranges.push(braceEscape(c))\n }\n rangeStart = ''\n i++\n continue\n }\n\n // now might be the start of a range.\n // can be either c-d or c-] or c] or c] at this point\n if (glob.startsWith('-]', i + 1)) {\n ranges.push(braceEscape(c + '-'))\n i += 2\n continue\n }\n if (glob.startsWith('-', i + 1)) {\n rangeStart = c\n i += 2\n continue\n }\n\n // not the start of a range, just a single character\n ranges.push(braceEscape(c))\n i++\n }\n\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return ['', false, 0, false]\n }\n\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return ['$.', false, glob.length - pos, true]\n }\n\n // if we got one positive range, and it's a single character, then that's\n // not actually a magic pattern, it's just that one literal character.\n // we should not treat that as \"magic\", we should just return the literal\n // character. [_] is a perfectly valid way to escape glob magic chars.\n if (\n negs.length === 0 &&\n ranges.length === 1 &&\n /^\\\\?.$/.test(ranges[0]) &&\n !negate\n ) {\n const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]\n return [regexpEscape(r), false, endPos - pos, false]\n }\n\n const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'\n const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'\n const comb =\n ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n : ranges.length ? sranges\n : snegs\n\n return [comb, uflag, endPos - pos, true]\n}\n"]} \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/escape.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/escape.d.ts new file mode 100644 index 0000000..141024a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/escape.d.ts @@ -0,0 +1,15 @@ +import type { MinimatchOptions } from './index.js'; +/** + * Escape all magic characters in a glob pattern. + * + * If the {@link MinimatchOptions.windowsPathsNoEscape} + * option is used, then characters are escaped by wrapping in `[]`, because + * a magic character wrapped in a character class can only be satisfied by + * that exact character. In this mode, `\` is _not_ escaped, because it is + * not interpreted as a magic character, but instead as a path separator. + * + * If the {@link MinimatchOptions.magicalBraces} option is used, + * then braces (`{` and `}`) will be escaped. + */ +export declare const escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; +//# sourceMappingURL=escape.d.ts.map \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/escape.d.ts.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/escape.d.ts.map new file mode 100644 index 0000000..e167e30 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/escape.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,GACjB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAazE,CAAA"} \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/escape.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/escape.js new file mode 100644 index 0000000..83a713a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/escape.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.escape = void 0; +/** + * Escape all magic characters in a glob pattern. + * + * If the {@link MinimatchOptions.windowsPathsNoEscape} + * option is used, then characters are escaped by wrapping in `[]`, because + * a magic character wrapped in a character class can only be satisfied by + * that exact character. In this mode, `\` is _not_ escaped, because it is + * not interpreted as a magic character, but instead as a path separator. + * + * If the {@link MinimatchOptions.magicalBraces} option is used, + * then braces (`{` and `}`) will be escaped. + */ +const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => { + // don't need to escape +@! because we escape the parens + // that make those magic, and escaping ! as [!] isn't valid, + // because [!]] is a valid glob class meaning not ']'. + if (magicalBraces) { + return windowsPathsNoEscape ? + s.replace(/[?*()[\]{}]/g, '[$&]') + : s.replace(/[?*()[\]\\{}]/g, '\\$&'); + } + return windowsPathsNoEscape ? + s.replace(/[?*()[\]]/g, '[$&]') + : s.replace(/[?*()[\]\\]/g, '\\$&'); +}; +exports.escape = escape; +//# sourceMappingURL=escape.js.map \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/escape.js.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/escape.js.map new file mode 100644 index 0000000..f963f0a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/escape.js.map @@ -0,0 +1 @@ +{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACI,MAAM,MAAM,GAAG,CACpB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,KAAK,MAC+C,EAAE,EACxE,EAAE;IACF,wDAAwD;IACxD,4DAA4D;IAC5D,sDAAsD;IACtD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC;YACnC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AACvC,CAAC,CAAA;AAlBY,QAAA,MAAM,UAkBlB","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (\n s: string,\n {\n windowsPathsNoEscape = false,\n magicalBraces = false,\n }: Pick = {},\n) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]{}]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&')\n }\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&')\n}\n"]} \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/index.d.ts new file mode 100644 index 0000000..7e1fc2e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/index.d.ts @@ -0,0 +1,174 @@ +import { AST } from './ast.js'; +export type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd'; +export interface MinimatchOptions { + /** do not expand `{x,y}` style braces */ + nobrace?: boolean; + /** do not treat patterns starting with `#` as a comment */ + nocomment?: boolean; + /** do not treat patterns starting with `!` as a negation */ + nonegate?: boolean; + /** print LOTS of debugging output */ + debug?: boolean; + /** treat `**` the same as `*` */ + noglobstar?: boolean; + /** do not expand extglobs like `+(a|b)` */ + noext?: boolean; + /** return the pattern if nothing matches */ + nonull?: boolean; + /** treat `\\` as a path separator, not an escape character */ + windowsPathsNoEscape?: boolean; + /** + * inverse of {@link MinimatchOptions.windowsPathsNoEscape} + * @deprecated + */ + allowWindowsEscape?: boolean; + /** + * Compare a partial path to a pattern. As long as the parts + * of the path that are present are not contradicted by the + * pattern, it will be treated as a match. This is useful in + * applications where you're walking through a folder structure, + * and don't yet have the full path, but want to ensure that you + * do not walk down paths that can never be a match. + */ + partial?: boolean; + /** allow matches that start with `.` even if the pattern does not */ + dot?: boolean; + /** ignore case */ + nocase?: boolean; + /** ignore case only in wildcard patterns */ + nocaseMagicOnly?: boolean; + /** consider braces to be "magic" for the purpose of `hasMagic` */ + magicalBraces?: boolean; + /** + * If set, then patterns without slashes will be matched + * against the basename of the path if it contains slashes. + * For example, `a?b` would match the path `/xyz/123/acb`, but + * not `/xyz/acb/123`. + */ + matchBase?: boolean; + /** invert the results of negated matches */ + flipNegate?: boolean; + /** do not collapse multiple `/` into a single `/` */ + preserveMultipleSlashes?: boolean; + /** + * A number indicating the level of optimization that should be done + * to the pattern prior to parsing and using it for matches. + */ + optimizationLevel?: number; + /** operating system platform */ + platform?: Platform; + /** + * When a pattern starts with a UNC path or drive letter, and in + * `nocase:true` mode, do not convert the root portions of the + * pattern into a case-insensitive regular expression, and instead + * leave them as strings. + * + * This is the default when the platform is `win32` and + * `nocase:true` is set. + */ + windowsNoMagicRoot?: boolean; + /** + * max number of `{...}` patterns to expand. Default 100_000. + */ + braceExpandMax?: number; + /** + * Max number of non-adjacent `**` patterns to recursively walk down. + * + * The default of 200 is almost certainly high enough for most purposes, + * and can handle absurdly excessive patterns. + */ + maxGlobstarRecursion?: number; + /** + * Max depth to traverse for nested extglobs like `*(a|b|c)` + * + * Default is 2, which is quite low, but any higher value + * swiftly results in punishing performance impacts. Note + * that this is *not* relevant when the globstar types can + * be safely coalesced into a single set. + * + * For example, `*(a|@(b|c)|d)` would be flattened into + * `*(a|b|c|d)`. Thus, many common extglobs will retain good + * performance and never hit this limit, even if they are + * excessively deep and complicated. + * + * If the limit is hit, then the extglob characters are simply + * not parsed, and the pattern effectively switches into + * `noextglob: true` mode for the contents of that nested + * sub-pattern. This will typically _not_ result in a match, + * but is considered a valid trade-off for security and + * performance. + */ + maxExtglobRecursion?: number; +} +export declare const minimatch: { + (p: string, pattern: string, options?: MinimatchOptions): boolean; + sep: Sep; + GLOBSTAR: typeof GLOBSTAR; + filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean; + defaults: (def: MinimatchOptions) => typeof minimatch; + braceExpand: (pattern: string, options?: MinimatchOptions) => string[]; + makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp; + match: (list: string[], pattern: string, options?: MinimatchOptions) => string[]; + AST: typeof AST; + Minimatch: typeof Minimatch; + escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; + unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; +}; +export type Sep = '\\' | '/'; +export declare const sep: Sep; +export declare const GLOBSTAR: unique symbol; +export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean; +export declare const defaults: (def: MinimatchOptions) => typeof minimatch; +export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[]; +export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp; +export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[]; +export type MMRegExp = RegExp & { + _src?: string; + _glob?: string; +}; +export type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR; +export type ParseReturn = ParseReturnFiltered | false; +export declare class Minimatch { + #private; + options: MinimatchOptions; + set: ParseReturnFiltered[][]; + pattern: string; + windowsPathsNoEscape: boolean; + nonegate: boolean; + negate: boolean; + comment: boolean; + empty: boolean; + preserveMultipleSlashes: boolean; + partial: boolean; + globSet: string[]; + globParts: string[][]; + nocase: boolean; + isWindows: boolean; + platform: Platform; + windowsNoMagicRoot: boolean; + maxGlobstarRecursion: number; + regexp: false | null | MMRegExp; + constructor(pattern: string, options?: MinimatchOptions); + hasMagic(): boolean; + debug(..._: unknown[]): void; + make(): void; + preprocess(globParts: string[][]): string[][]; + adjascentGlobstarOptimize(globParts: string[][]): string[][]; + levelOneOptimize(globParts: string[][]): string[][]; + levelTwoFileOptimize(parts: string | string[]): string[]; + firstPhasePreProcess(globParts: string[][]): string[][]; + secondPhasePreProcess(globParts: string[][]): string[][]; + partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[]; + parseNegate(): void; + matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean; + braceExpand(): string[]; + parse(pattern: string): ParseReturn; + makeRe(): false | MMRegExp; + slashSplit(p: string): string[]; + match(f: string, partial?: boolean): boolean; + static defaults(def: MinimatchOptions): typeof Minimatch; +} +export { AST } from './ast.js'; +export { escape } from './escape.js'; +export { unescape } from './unescape.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/index.d.ts.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000..7620db9 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI9B,MAAM,MAAM,QAAQ,GAChB,KAAK,GACL,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,CAAA;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,8DAA8D;IAC9D,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qEAAqE;IACrE,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,kBAAkB;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,4CAA4C;IAC5C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,kEAAkE;IAClE,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,qDAAqD;IACrD,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB;;;;;;;;OAQG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAE7B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,eAAO,MAAM,SAAS;QACjB,MAAM,WACA,MAAM,YACN,gBAAgB;;;sBA4Gf,MAAM,YAAW,gBAAgB,MAC1C,GAAG,MAAM;oBAOkB,gBAAgB,KAAG,OAAO,SAAS;2BAuFtD,MAAM,YACN,gBAAgB;sBA2BK,MAAM,YAAW,gBAAgB;kBAKzD,MAAM,EAAE,WACL,MAAM,YACN,gBAAgB;;;;;CApO1B,CAAA;AAkED,MAAM,MAAM,GAAG,GAAG,IAAI,GAAG,GAAG,CAAA;AAQ5B,eAAO,MAAM,GAAG,KAC+C,CAAA;AAG/D,eAAO,MAAM,QAAQ,eAAwB,CAAA;AAmB7C,eAAO,MAAM,MAAM,GAChB,SAAS,MAAM,EAAE,UAAS,gBAAqB,MAC/C,GAAG,MAAM,YACsB,CAAA;AAMlC,eAAO,MAAM,QAAQ,GAAI,KAAK,gBAAgB,KAAG,OAAO,SAyEvD,CAAA;AAaD,eAAO,MAAM,WAAW,GACtB,SAAS,MAAM,EACf,UAAS,gBAAqB,aAY/B,CAAA;AAeD,eAAO,MAAM,MAAM,GAAI,SAAS,MAAM,EAAE,UAAS,gBAAqB,qBAC5B,CAAA;AAG1C,eAAO,MAAM,KAAK,GAChB,MAAM,MAAM,EAAE,EACd,SAAS,MAAM,EACf,UAAS,gBAAqB,aAQ/B,CAAA;AAQD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,QAAQ,CAAA;AACrE,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,KAAK,CAAA;AAErD,qBAAa,SAAS;;IACpB,OAAO,EAAE,gBAAgB,CAAA;IACzB,GAAG,EAAE,mBAAmB,EAAE,EAAE,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;IAEf,oBAAoB,EAAE,OAAO,CAAA;IAC7B,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,OAAO,CAAA;IACd,uBAAuB,EAAE,OAAO,CAAA;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAA;IACrB,MAAM,EAAE,OAAO,CAAA;IAEf,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,QAAQ,CAAA;IAClB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,oBAAoB,EAAE,MAAM,CAAA;IAE5B,MAAM,EAAE,KAAK,GAAG,IAAI,GAAG,QAAQ,CAAA;gBACnB,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAqC3D,QAAQ,IAAI,OAAO;IAYnB,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE;IAErB,IAAI;IA8FJ,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IA8BhC,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IAiB/C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IAoBtC,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAoE7C,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IA0F1C,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE;IAkBxD,UAAU,CACR,CAAC,EAAE,MAAM,EAAE,EACX,CAAC,EAAE,MAAM,EAAE,EACX,YAAY,GAAE,OAAe,GAC5B,KAAK,GAAG,MAAM,EAAE;IA+CnB,WAAW;IAqBX,QAAQ,CACN,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,WAAW,EAAE,EACtB,OAAO,GAAE,OAAe;IAiX1B,WAAW;IAIX,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IA6CnC,MAAM;IAuGN,UAAU,CAAC,CAAC,EAAE,MAAM;IAepB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,UAAe;IAgEvC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,gBAAgB;CAGtC;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"} \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/index.js new file mode 100644 index 0000000..5a69834 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/index.js @@ -0,0 +1,1127 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0; +const brace_expansion_1 = require("brace-expansion"); +const assert_valid_pattern_js_1 = require("./assert-valid-pattern.js"); +const ast_js_1 = require("./ast.js"); +const escape_js_1 = require("./escape.js"); +const unescape_js_1 = require("./unescape.js"); +const minimatch = (p, pattern, options = {}) => { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false; + } + return new Minimatch(pattern, options).match(p); +}; +exports.minimatch = minimatch; +// Optimized checking for the most common glob patterns. +const starDotExtRE = /^\*+([^+@!?*[(]*)$/; +const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext); +const starDotExtTestDot = (ext) => (f) => f.endsWith(ext); +const starDotExtTestNocase = (ext) => { + ext = ext.toLowerCase(); + return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext); +}; +const starDotExtTestNocaseDot = (ext) => { + ext = ext.toLowerCase(); + return (f) => f.toLowerCase().endsWith(ext); +}; +const starDotStarRE = /^\*+\.\*+$/; +const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.'); +const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.'); +const dotStarRE = /^\.\*+$/; +const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.'); +const starRE = /^\*+$/; +const starTest = (f) => f.length !== 0 && !f.startsWith('.'); +const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..'; +const qmarksRE = /^\?+([^+@!?*[(]*)?$/; +const qmarksTestNocase = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestNocaseDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTest = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTestNoExt = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && !f.startsWith('.'); +}; +const qmarksTestNoExtDot = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && f !== '.' && f !== '..'; +}; +/* c8 ignore start */ +const defaultPlatform = (typeof process === 'object' && process ? + (typeof process.env === 'object' && + process.env && + process.env.__MINIMATCH_TESTING_PLATFORM__) || + process.platform + : 'posix'); +const path = { + win32: { sep: '\\' }, + posix: { sep: '/' }, +}; +/* c8 ignore stop */ +exports.sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep; +exports.minimatch.sep = exports.sep; +exports.GLOBSTAR = Symbol('globstar **'); +exports.minimatch.GLOBSTAR = exports.GLOBSTAR; +// any single thing other than / +// don't need to escape / when using new RegExp() +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?'; +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?'; +const filter = (pattern, options = {}) => (p) => (0, exports.minimatch)(p, pattern, options); +exports.filter = filter; +exports.minimatch.filter = exports.filter; +const ext = (a, b = {}) => Object.assign({}, a, b); +const defaults = (def) => { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return exports.minimatch; + } + const orig = exports.minimatch; + const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options)); + return Object.assign(m, { + Minimatch: class Minimatch extends orig.Minimatch { + constructor(pattern, options = {}) { + super(pattern, ext(def, options)); + } + static defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + } + }, + AST: class AST extends orig.AST { + /* c8 ignore start */ + constructor(type, parent, options = {}) { + super(type, parent, ext(def, options)); + } + /* c8 ignore stop */ + static fromGlob(pattern, options = {}) { + return orig.AST.fromGlob(pattern, ext(def, options)); + } + }, + unescape: (s, options = {}) => orig.unescape(s, ext(def, options)), + escape: (s, options = {}) => orig.escape(s, ext(def, options)), + filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)), + defaults: (options) => orig.defaults(ext(def, options)), + makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), + braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)), + match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)), + sep: orig.sep, + GLOBSTAR: exports.GLOBSTAR, + }); +}; +exports.defaults = defaults; +exports.minimatch.defaults = exports.defaults; +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +const braceExpand = (pattern, options = {}) => { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern]; + } + return (0, brace_expansion_1.expand)(pattern, { max: options.braceExpandMax }); +}; +exports.braceExpand = braceExpand; +exports.minimatch.braceExpand = exports.braceExpand; +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe(); +exports.makeRe = makeRe; +exports.minimatch.makeRe = exports.makeRe; +const match = (list, pattern, options = {}) => { + const mm = new Minimatch(pattern, options); + list = list.filter(f => mm.match(f)); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; +}; +exports.match = match; +exports.minimatch.match = exports.match; +// replace stuff like \* with * +const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/; +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +class Minimatch { + options; + set; + pattern; + windowsPathsNoEscape; + nonegate; + negate; + comment; + empty; + preserveMultipleSlashes; + partial; + globSet; + globParts; + nocase; + isWindows; + platform; + windowsNoMagicRoot; + maxGlobstarRecursion; + regexp; + constructor(pattern, options = {}) { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + options = options || {}; + this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200; + this.pattern = pattern; + this.platform = options.platform || defaultPlatform; + this.isWindows = this.platform === 'win32'; + // avoid the annoying deprecation flag lol + const awe = ('allowWindow' + 'sEscape'); + this.windowsPathsNoEscape = + !!options.windowsPathsNoEscape || options[awe] === false; + if (this.windowsPathsNoEscape) { + this.pattern = this.pattern.replace(/\\/g, '/'); + } + this.preserveMultipleSlashes = !!options.preserveMultipleSlashes; + this.regexp = null; + this.negate = false; + this.nonegate = !!options.nonegate; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.nocase = !!this.options.nocase; + this.windowsNoMagicRoot = + options.windowsNoMagicRoot !== undefined ? + options.windowsNoMagicRoot + : !!(this.isWindows && this.nocase); + this.globSet = []; + this.globParts = []; + this.set = []; + // make the set of regexps etc. + this.make(); + } + hasMagic() { + if (this.options.magicalBraces && this.set.length > 1) { + return true; + } + for (const pattern of this.set) { + for (const part of pattern) { + if (typeof part !== 'string') + return true; + } + } + return false; + } + debug(..._) { } + make() { + const pattern = this.pattern; + const options = this.options; + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true; + return; + } + if (!pattern) { + this.empty = true; + return; + } + // step 1: figure out negation, etc. + this.parseNegate(); + // step 2: expand braces + this.globSet = [...new Set(this.braceExpand())]; + if (options.debug) { + //oxlint-disable-next-line no-console + this.debug = (...args) => console.error(...args); + } + this.debug(this.pattern, this.globSet); + // step 3: now we have a set, so turn each one into a series of + // path-portion matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + // + // First, we preprocess to make the glob pattern sets a bit simpler + // and deduped. There are some perf-killing patterns that can cause + // problems with a glob walk, but we can simplify them down a bit. + const rawGlobParts = this.globSet.map(s => this.slashSplit(s)); + this.globParts = this.preprocess(rawGlobParts); + this.debug(this.pattern, this.globParts); + // glob --> regexps + let set = this.globParts.map((s, _, __) => { + if (this.isWindows && this.windowsNoMagicRoot) { + // check if it's a drive or unc path. + const isUNC = s[0] === '' && + s[1] === '' && + (s[2] === '?' || !globMagic.test(s[2])) && + !globMagic.test(s[3]); + const isDrive = /^[a-z]:/i.test(s[0]); + if (isUNC) { + return [ + ...s.slice(0, 4), + ...s.slice(4).map(ss => this.parse(ss)), + ]; + } + else if (isDrive) { + return [s[0], ...s.slice(1).map(ss => this.parse(ss))]; + } + } + return s.map(ss => this.parse(ss)); + }); + this.debug(this.pattern, set); + // filter out everything that didn't compile properly. + this.set = set.filter(s => s.indexOf(false) === -1); + // do not treat the ? in UNC paths as magic + if (this.isWindows) { + for (let i = 0; i < this.set.length; i++) { + const p = this.set[i]; + if (p[0] === '' && + p[1] === '' && + this.globParts[i][2] === '?' && + typeof p[3] === 'string' && + /^[a-z]:$/i.test(p[3])) { + p[2] = '?'; + } + } + } + this.debug(this.pattern, this.set); + } + // various transforms to equivalent pattern sets that are + // faster to process in a filesystem walk. The goal is to + // eliminate what we can, and push all ** patterns as far + // to the right as possible, even if it increases the number + // of patterns that we have to process. + preprocess(globParts) { + // if we're not in globstar mode, then turn ** into * + if (this.options.noglobstar) { + for (const partset of globParts) { + for (let j = 0; j < partset.length; j++) { + if (partset[j] === '**') { + partset[j] = '*'; + } + } + } + } + const { optimizationLevel = 1 } = this.options; + if (optimizationLevel >= 2) { + // aggressive optimization for the purpose of fs walking + globParts = this.firstPhasePreProcess(globParts); + globParts = this.secondPhasePreProcess(globParts); + } + else if (optimizationLevel >= 1) { + // just basic optimizations to remove some .. parts + globParts = this.levelOneOptimize(globParts); + } + else { + // just collapse multiple ** portions into one + globParts = this.adjascentGlobstarOptimize(globParts); + } + return globParts; + } + // just get rid of adjascent ** portions + adjascentGlobstarOptimize(globParts) { + return globParts.map(parts => { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let i = gs; + while (parts[i + 1] === '**') { + i++; + } + if (i !== gs) { + parts.splice(gs, i - gs); + } + } + return parts; + }); + } + // get rid of adjascent ** and resolve .. portions + levelOneOptimize(globParts) { + return globParts.map(parts => { + parts = parts.reduce((set, part) => { + const prev = set[set.length - 1]; + if (part === '**' && prev === '**') { + return set; + } + if (part === '..') { + if (prev && prev !== '..' && prev !== '.' && prev !== '**') { + set.pop(); + return set; + } + } + set.push(part); + return set; + }, []); + return parts.length === 0 ? [''] : parts; + }); + } + levelTwoFileOptimize(parts) { + if (!Array.isArray(parts)) { + parts = this.slashSplit(parts); + } + let didSomething = false; + do { + didSomething = false; + //

// -> 
/
+            if (!this.preserveMultipleSlashes) {
+                for (let i = 1; i < parts.length - 1; i++) {
+                    const p = parts[i];
+                    // don't squeeze out UNC patterns
+                    if (i === 1 && p === '' && parts[0] === '')
+                        continue;
+                    if (p === '.' || p === '') {
+                        didSomething = true;
+                        parts.splice(i, 1);
+                        i--;
+                    }
+                }
+                if (parts[0] === '.' &&
+                    parts.length === 2 &&
+                    (parts[1] === '.' || parts[1] === '')) {
+                    didSomething = true;
+                    parts.pop();
+                }
+            }
+            // 
/

/../ ->

/
+            let dd = 0;
+            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                const p = parts[dd - 1];
+                if (p &&
+                    p !== '.' &&
+                    p !== '..' &&
+                    p !== '**' &&
+                    !(this.isWindows && /^[a-z]:$/i.test(p))) {
+                    didSomething = true;
+                    parts.splice(dd - 1, 2);
+                    dd -= 2;
+                }
+            }
+        } while (didSomething);
+        return parts.length === 0 ? [''] : parts;
+    }
+    // First phase: single-pattern processing
+    // 
 is 1 or more portions
+    //  is 1 or more portions
+    // 

is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + //

// -> 
/
+    // 
/

/../ ->

/
+    // **/**/ -> **/
+    //
+    // **/*/ -> */**/ <== not valid because ** doesn't follow
+    // this WOULD be allowed if ** did follow symlinks, or * didn't
+    firstPhasePreProcess(globParts) {
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

/**/**/ -> 
/**/
+                        gss++;
+                    }
+                    // eg, if gs is 2 and gss is 4, that means we have 3 **
+                    // parts, and can remove 2 of them.
+                    if (gss > gs) {
+                        parts.splice(gs + 1, gss - gs);
+                    }
+                    let next = parts[gs + 1];
+                    const p = parts[gs + 2];
+                    const p2 = parts[gs + 3];
+                    if (next !== '..')
+                        continue;
+                    if (!p ||
+                        p === '.' ||
+                        p === '..' ||
+                        !p2 ||
+                        p2 === '.' ||
+                        p2 === '..') {
+                        continue;
+                    }
+                    didSomething = true;
+                    // edit parts in place, and push the new one
+                    parts.splice(gs, 1);
+                    const other = parts.slice(0);
+                    other[gs] = '**';
+                    globParts.push(other);
+                    gs--;
+                }
+                // 
// -> 
/
+                if (!this.preserveMultipleSlashes) {
+                    for (let i = 1; i < parts.length - 1; i++) {
+                        const p = parts[i];
+                        // don't squeeze out UNC patterns
+                        if (i === 1 && p === '' && parts[0] === '')
+                            continue;
+                        if (p === '.' || p === '') {
+                            didSomething = true;
+                            parts.splice(i, 1);
+                            i--;
+                        }
+                    }
+                    if (parts[0] === '.' &&
+                        parts.length === 2 &&
+                        (parts[1] === '.' || parts[1] === '')) {
+                        didSomething = true;
+                        parts.pop();
+                    }
+                }
+                // 
/

/../ ->

/
+                let dd = 0;
+                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                    const p = parts[dd - 1];
+                    if (p && p !== '.' && p !== '..' && p !== '**') {
+                        didSomething = true;
+                        const needDot = dd === 1 && parts[dd + 1] === '**';
+                        const splin = needDot ? ['.'] : [];
+                        parts.splice(dd - 1, 2, ...splin);
+                        if (parts.length === 0)
+                            parts.push('');
+                        dd -= 2;
+                    }
+                }
+            }
+        } while (didSomething);
+        return globParts;
+    }
+    // second phase: multi-pattern dedupes
+    // {
/*/,
/

/} ->

/*/
+    // {
/,
/} -> 
/
+    // {
/**/,
/} -> 
/**/
+    //
+    // {
/**/,
/**/

/} ->

/**/
+    // ^-- not valid because ** doens't follow symlinks
+    secondPhasePreProcess(globParts) {
+        for (let i = 0; i < globParts.length - 1; i++) {
+            for (let j = i + 1; j < globParts.length; j++) {
+                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
+                if (matched) {
+                    globParts[i] = [];
+                    globParts[j] = matched;
+                    break;
+                }
+            }
+        }
+        return globParts.filter(gs => gs.length);
+    }
+    partsMatch(a, b, emptyGSMatch = false) {
+        let ai = 0;
+        let bi = 0;
+        let result = [];
+        let which = '';
+        while (ai < a.length && bi < b.length) {
+            if (a[ai] === b[bi]) {
+                result.push(which === 'b' ? b[bi] : a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
+                result.push(a[ai]);
+                ai++;
+            }
+            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
+                result.push(b[bi]);
+                bi++;
+            }
+            else if (a[ai] === '*' &&
+                b[bi] &&
+                (this.options.dot || !b[bi].startsWith('.')) &&
+                b[bi] !== '**') {
+                if (which === 'b')
+                    return false;
+                which = 'a';
+                result.push(a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (b[bi] === '*' &&
+                a[ai] &&
+                (this.options.dot || !a[ai].startsWith('.')) &&
+                a[ai] !== '**') {
+                if (which === 'a')
+                    return false;
+                which = 'b';
+                result.push(b[bi]);
+                ai++;
+                bi++;
+            }
+            else {
+                return false;
+            }
+        }
+        // if we fall out of the loop, it means they two are identical
+        // as long as their lengths match
+        return a.length === b.length && result;
+    }
+    parseNegate() {
+        if (this.nonegate)
+            return;
+        const pattern = this.pattern;
+        let negate = false;
+        let negateOffset = 0;
+        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
+            negate = !negate;
+            negateOffset++;
+        }
+        if (negateOffset)
+            this.pattern = pattern.slice(negateOffset);
+        this.negate = negate;
+    }
+    // set partial to true to test if, for example,
+    // "/a/b" matches the start of "/*/b/*/d"
+    // Partial means, if you run out of file before you run
+    // out of pattern, then that's fine, as long as all
+    // the parts match.
+    matchOne(file, pattern, partial = false) {
+        let fileStartIndex = 0;
+        let patternStartIndex = 0;
+        // UNC paths like //?/X:/... can match X:/... and vice versa
+        // Drive letters in absolute drive or unc paths are always compared
+        // case-insensitively.
+        if (this.isWindows) {
+            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
+            const fileUNC = !fileDrive &&
+                file[0] === '' &&
+                file[1] === '' &&
+                file[2] === '?' &&
+                /^[a-z]:$/i.test(file[3]);
+            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
+            const patternUNC = !patternDrive &&
+                pattern[0] === '' &&
+                pattern[1] === '' &&
+                pattern[2] === '?' &&
+                typeof pattern[3] === 'string' &&
+                /^[a-z]:$/i.test(pattern[3]);
+            const fdi = fileUNC ? 3
+                : fileDrive ? 0
+                    : undefined;
+            const pdi = patternUNC ? 3
+                : patternDrive ? 0
+                    : undefined;
+            if (typeof fdi === 'number' && typeof pdi === 'number') {
+                const [fd, pd] = [
+                    file[fdi],
+                    pattern[pdi],
+                ];
+                // start matching at the drive letter index of each
+                if (fd.toLowerCase() === pd.toLowerCase()) {
+                    pattern[pdi] = fd;
+                    patternStartIndex = pdi;
+                    fileStartIndex = fdi;
+                }
+            }
+        }
+        // resolve and reduce . and .. portions in the file as well.
+        // don't need to do the second phase, because it's only one string[]
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            file = this.levelTwoFileOptimize(file);
+        }
+        if (pattern.includes(exports.GLOBSTAR)) {
+            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
+        }
+        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
+    }
+    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
+        // split the pattern into head, tail, and middle of ** delimited parts
+        const firstgs = pattern.indexOf(exports.GLOBSTAR, patternIndex);
+        const lastgs = pattern.lastIndexOf(exports.GLOBSTAR);
+        // split the pattern up into globstar-delimited sections
+        // the tail has to be at the end, and the others just have
+        // to be found in order from the head.
+        const [head, body, tail] = partial ?
+            [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1),
+                [],
+            ]
+            : [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1, lastgs),
+                pattern.slice(lastgs + 1),
+            ];
+        // check the head, from the current file/pattern index.
+        if (head.length) {
+            const fileHead = file.slice(fileIndex, fileIndex + head.length);
+            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
+                return false;
+            }
+            fileIndex += head.length;
+            patternIndex += head.length;
+        }
+        // now we know the head matches!
+        // if the last portion is not empty, it MUST match the end
+        // check the tail
+        let fileTailMatch = 0;
+        if (tail.length) {
+            // if head + tail > file, then we cannot possibly match
+            if (tail.length + fileIndex > file.length)
+                return false;
+            // try to match the tail
+            let tailStart = file.length - tail.length;
+            if (this.#matchOne(file, tail, partial, tailStart, 0)) {
+                fileTailMatch = tail.length;
+            }
+            else {
+                // affordance for stuff like a/**/* matching a/b/
+                // if the last file portion is '', and there's more to the pattern
+                // then try without the '' bit.
+                if (file[file.length - 1] !== '' ||
+                    fileIndex + tail.length === file.length) {
+                    return false;
+                }
+                tailStart--;
+                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
+                    return false;
+                }
+                fileTailMatch = tail.length + 1;
+            }
+        }
+        // now we know the tail matches!
+        // the middle is zero or more portions wrapped in **, possibly
+        // containing more ** sections.
+        // so a/**/b/**/c/**/d has become **/b/**/c/**
+        // if it's empty, it means a/**/b, just verify we have no bad dots
+        // if there's no tail, so it ends on /**, then we must have *something*
+        // after the head, or it's not a matc
+        if (!body.length) {
+            let sawSome = !!fileTailMatch;
+            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
+                const f = String(file[i]);
+                sawSome = true;
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            // in partial mode, we just need to get past all file parts
+            return partial || sawSome;
+        }
+        // now we know that there's one or more body sections, which can
+        // be matched anywhere from the 0 index (because the head was pruned)
+        // through to the length-fileTailMatch index.
+        // split the body up into sections, and note the minimum index it can
+        // be found at (start with the length of all previous segments)
+        // [section, before, after]
+        const bodySegments = [[[], 0]];
+        let currentBody = bodySegments[0];
+        let nonGsParts = 0;
+        const nonGsPartsSums = [0];
+        for (const b of body) {
+            if (b === exports.GLOBSTAR) {
+                nonGsPartsSums.push(nonGsParts);
+                currentBody = [[], 0];
+                bodySegments.push(currentBody);
+            }
+            else {
+                currentBody[0].push(b);
+                nonGsParts++;
+            }
+        }
+        let i = bodySegments.length - 1;
+        const fileLength = file.length - fileTailMatch;
+        for (const b of bodySegments) {
+            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
+        }
+        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
+    }
+    // return false for "nope, not matching"
+    // return null for "not matching, cannot keep trying"
+    #matchGlobStarBodySections(file, 
+    // pattern section, last possible position for it
+    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
+        // take the first body segment, and walk from fileIndex to its "after"
+        // value at the end
+        // If it doesn't match at that position, we increment, until we hit
+        // that final possible position, and give up.
+        // If it does match, then advance and try to rest.
+        // If any of them fail we keep walking forward.
+        // this is still a bit recursively painful, but it's more constrained
+        // than previous implementations, because we never test something that
+        // can't possibly be a valid matching condition.
+        const bs = bodySegments[bodyIndex];
+        if (!bs) {
+            // just make sure that there's no bad dots
+            for (let i = fileIndex; i < file.length; i++) {
+                sawTail = true;
+                const f = file[i];
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            return sawTail;
+        }
+        // have a non-globstar body section to test
+        const [body, after] = bs;
+        while (fileIndex <= after) {
+            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
+            // if limit exceeded, no match. intentional false negative,
+            // acceptable break in correctness for security.
+            if (m && globStarDepth < this.maxGlobstarRecursion) {
+                // match! see if the rest match. if so, we're done!
+                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
+                if (sub !== false) {
+                    return sub;
+                }
+            }
+            const f = file[fileIndex];
+            if (f === '.' ||
+                f === '..' ||
+                (!this.options.dot && f.startsWith('.'))) {
+                return false;
+            }
+            fileIndex++;
+        }
+        // walked off. no point continuing
+        return partial || null;
+    }
+    #matchOne(file, pattern, partial, fileIndex, patternIndex) {
+        let fi;
+        let pi;
+        let pl;
+        let fl;
+        for (fi = fileIndex,
+            pi = patternIndex,
+            fl = file.length,
+            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
+            this.debug('matchOne loop');
+            let p = pattern[pi];
+            let f = file[fi];
+            this.debug(pattern, p, f);
+            // should be impossible.
+            // some invalid regexp stuff in the set.
+            /* c8 ignore start */
+            if (p === false || p === exports.GLOBSTAR) {
+                return false;
+            }
+            /* c8 ignore stop */
+            // something other than **
+            // non-magic patterns just have to match exactly
+            // patterns with magic have been turned into regexps.
+            let hit;
+            if (typeof p === 'string') {
+                hit = f === p;
+                this.debug('string match', p, f, hit);
+            }
+            else {
+                hit = p.test(f);
+                this.debug('pattern match', p, f, hit);
+            }
+            if (!hit)
+                return false;
+        }
+        // Note: ending in / means that we'll get a final ""
+        // at the end of the pattern.  This can only match a
+        // corresponding "" at the end of the file.
+        // If the file ends in /, then it can only match a
+        // a pattern that ends in /, unless the pattern just
+        // doesn't have any more for it. But, a/b/ should *not*
+        // match "a/b/*", even though "" matches against the
+        // [^/]*? pattern, except in partial mode, where it might
+        // simply not be reached yet.
+        // However, a/b/ should still satisfy a/*
+        // now either we fell off the end of the pattern, or we're done.
+        if (fi === fl && pi === pl) {
+            // ran out of pattern and filename at the same time.
+            // an exact hit!
+            return true;
+        }
+        else if (fi === fl) {
+            // ran out of file, but still had pattern left.
+            // this is ok if we're doing the match as part of
+            // a glob fs traversal.
+            return partial;
+        }
+        else if (pi === pl) {
+            // ran out of pattern, still have file left.
+            // this is only acceptable if we're on the very last
+            // empty segment of a file with a trailing slash.
+            // a/* should match a/b/
+            return fi === fl - 1 && file[fi] === '';
+            /* c8 ignore start */
+        }
+        else {
+            // should be unreachable.
+            throw new Error('wtf?');
+        }
+        /* c8 ignore stop */
+    }
+    braceExpand() {
+        return (0, exports.braceExpand)(this.pattern, this.options);
+    }
+    parse(pattern) {
+        (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
+        const options = this.options;
+        // shortcuts
+        if (pattern === '**')
+            return exports.GLOBSTAR;
+        if (pattern === '')
+            return '';
+        // far and away, the most common glob pattern parts are
+        // *, *.*, and *.  Add a fast check method for those.
+        let m;
+        let fastTest = null;
+        if ((m = pattern.match(starRE))) {
+            fastTest = options.dot ? starTestDot : starTest;
+        }
+        else if ((m = pattern.match(starDotExtRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    starDotExtTestNocaseDot
+                    : starDotExtTestNocase
+                : options.dot ? starDotExtTestDot
+                    : starDotExtTest)(m[1]);
+        }
+        else if ((m = pattern.match(qmarksRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    qmarksTestNocaseDot
+                    : qmarksTestNocase
+                : options.dot ? qmarksTestDot
+                    : qmarksTest)(m);
+        }
+        else if ((m = pattern.match(starDotStarRE))) {
+            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        }
+        else if ((m = pattern.match(dotStarRE))) {
+            fastTest = dotStarTest;
+        }
+        const re = ast_js_1.AST.fromGlob(pattern, this.options).toMMPattern();
+        if (fastTest && typeof re === 'object') {
+            // Avoids overriding in frozen environments
+            Reflect.defineProperty(re, 'test', { value: fastTest });
+        }
+        return re;
+    }
+    makeRe() {
+        if (this.regexp || this.regexp === false)
+            return this.regexp;
+        // at this point, this.set is a 2d array of partial
+        // pattern strings, or "**".
+        //
+        // It's better to use .match().  This function shouldn't
+        // be used, really, but it's pretty convenient sometimes,
+        // when you just want to work with a regex.
+        const set = this.set;
+        if (!set.length) {
+            this.regexp = false;
+            return this.regexp;
+        }
+        const options = this.options;
+        const twoStar = options.noglobstar ? star
+            : options.dot ? twoStarDot
+                : twoStarNoDot;
+        const flags = new Set(options.nocase ? ['i'] : []);
+        // regexpify non-globstar patterns
+        // if ** is only item, then we just do one twoStar
+        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
+        // if ** is last, append (\/twoStar|) to previous
+        // if ** is in the middle, append (\/|\/twoStar\/) to previous
+        // then filter out GLOBSTAR symbols
+        let re = set
+            .map(pattern => {
+            const pp = pattern.map(p => {
+                if (p instanceof RegExp) {
+                    for (const f of p.flags.split(''))
+                        flags.add(f);
+                }
+                return (typeof p === 'string' ? regExpEscape(p)
+                    : p === exports.GLOBSTAR ? exports.GLOBSTAR
+                        : p._src);
+            });
+            pp.forEach((p, i) => {
+                const next = pp[i + 1];
+                const prev = pp[i - 1];
+                if (p !== exports.GLOBSTAR || prev === exports.GLOBSTAR) {
+                    return;
+                }
+                if (prev === undefined) {
+                    if (next !== undefined && next !== exports.GLOBSTAR) {
+                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
+                    }
+                    else {
+                        pp[i] = twoStar;
+                    }
+                }
+                else if (next === undefined) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
+                }
+                else if (next !== exports.GLOBSTAR) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
+                    pp[i + 1] = exports.GLOBSTAR;
+                }
+            });
+            const filtered = pp.filter(p => p !== exports.GLOBSTAR);
+            // For partial matches, we need to make the pattern match
+            // any prefix of the full path. We do this by generating
+            // alternative patterns that match progressively longer prefixes.
+            if (this.partial && filtered.length >= 1) {
+                const prefixes = [];
+                for (let i = 1; i <= filtered.length; i++) {
+                    prefixes.push(filtered.slice(0, i).join('/'));
+                }
+                return '(?:' + prefixes.join('|') + ')';
+            }
+            return filtered.join('/');
+        })
+            .join('|');
+        // need to wrap in parens if we had more than one thing with |,
+        // otherwise only the first will be anchored to ^ and the last to $
+        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
+        // must match entire pattern
+        // ending in a * or ** will make it less strict.
+        re = '^' + open + re + close + '$';
+        // In partial mode, '/' should always match as it's a valid prefix for any pattern
+        if (this.partial) {
+            re = '^(?:\\/|' + open + re.slice(1, -1) + close + ')$';
+        }
+        // can match anything, as long as it's not this.
+        if (this.negate)
+            re = '^(?!' + re + ').+$';
+        try {
+            this.regexp = new RegExp(re, [...flags].join(''));
+            /* c8 ignore start */
+        }
+        catch {
+            // should be impossible
+            this.regexp = false;
+        }
+        /* c8 ignore stop */
+        return this.regexp;
+    }
+    slashSplit(p) {
+        // if p starts with // on windows, we preserve that
+        // so that UNC paths aren't broken.  Otherwise, any number of
+        // / characters are coalesced into one, unless
+        // preserveMultipleSlashes is set to true.
+        if (this.preserveMultipleSlashes) {
+            return p.split('/');
+        }
+        else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
+            // add an extra '' for the one we lose
+            return ['', ...p.split(/\/+/)];
+        }
+        else {
+            return p.split(/\/+/);
+        }
+    }
+    match(f, partial = this.partial) {
+        this.debug('match', f, this.pattern);
+        // short-circuit in the case of busted things.
+        // comments, etc.
+        if (this.comment) {
+            return false;
+        }
+        if (this.empty) {
+            return f === '';
+        }
+        if (f === '/' && partial) {
+            return true;
+        }
+        const options = this.options;
+        // windows: need to use /, not \
+        if (this.isWindows) {
+            f = f.split('\\').join('/');
+        }
+        // treat the test path as a set of pathparts.
+        const ff = this.slashSplit(f);
+        this.debug(this.pattern, 'split', ff);
+        // just ONE of the pattern sets in this.set needs to match
+        // in order for it to be valid.  If negating, then just one
+        // match means that we have failed.
+        // Either way, return on the first hit.
+        const set = this.set;
+        this.debug(this.pattern, 'set', set);
+        // Find the basename of the path by looking for the last non-empty segment
+        let filename = ff[ff.length - 1];
+        if (!filename) {
+            for (let i = ff.length - 2; !filename && i >= 0; i--) {
+                filename = ff[i];
+            }
+        }
+        for (const pattern of set) {
+            let file = ff;
+            if (options.matchBase && pattern.length === 1) {
+                file = [filename];
+            }
+            const hit = this.matchOne(file, pattern, partial);
+            if (hit) {
+                if (options.flipNegate) {
+                    return true;
+                }
+                return !this.negate;
+            }
+        }
+        // didn't get any hits.  this is success if it's a negative
+        // pattern, failure otherwise.
+        if (options.flipNegate) {
+            return false;
+        }
+        return this.negate;
+    }
+    static defaults(def) {
+        return exports.minimatch.defaults(def).Minimatch;
+    }
+}
+exports.Minimatch = Minimatch;
+/* c8 ignore start */
+var ast_js_2 = require("./ast.js");
+Object.defineProperty(exports, "AST", { enumerable: true, get: function () { return ast_js_2.AST; } });
+var escape_js_2 = require("./escape.js");
+Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return escape_js_2.escape; } });
+var unescape_js_2 = require("./unescape.js");
+Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return unescape_js_2.unescape; } });
+/* c8 ignore stop */
+exports.minimatch.AST = ast_js_1.AST;
+exports.minimatch.Minimatch = Minimatch;
+exports.minimatch.escape = escape_js_1.escape;
+exports.minimatch.unescape = unescape_js_1.unescape;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/index.js.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/index.js.map
new file mode 100644
index 0000000..f0b81f0
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/index.js.map	
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAAwC;AACxC,uEAA8D;AAE9D,qCAA8B;AAC9B,2CAAoC;AACpC,+CAAwC;AAqHjC,MAAM,SAAS,GAAG,CACvB,CAAS,EACT,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE;IACF,IAAA,4CAAkB,EAAC,OAAO,CAAC,CAAA;IAE3B,oCAAoC;IACpC,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QACpD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACjD,CAAC,CAAA;AAbY,QAAA,SAAS,aAarB;AAED,wDAAwD;AACxD,MAAM,YAAY,GAAG,oBAAoB,CAAA;AACzC,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,CAAS,EAAE,EAAE,CACpD,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACvC,MAAM,iBAAiB,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACzE,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAE,EAAE;IAC3C,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;IACvB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAC3E,CAAC,CAAA;AACD,MAAM,uBAAuB,GAAG,CAAC,GAAW,EAAE,EAAE;IAC9C,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;IACvB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACrD,CAAC,CAAA;AACD,MAAM,aAAa,GAAG,YAAY,CAAA;AAClC,MAAM,eAAe,GAAG,CAAC,CAAS,EAAE,EAAE,CACpC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACvC,MAAM,kBAAkB,GAAG,CAAC,CAAS,EAAE,EAAE,CACvC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAC5C,MAAM,SAAS,GAAG,SAAS,CAAA;AAC3B,MAAM,WAAW,GAAG,CAAC,CAAS,EAAE,EAAE,CAChC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AAC9C,MAAM,MAAM,GAAG,OAAO,CAAA;AACtB,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AACpE,MAAM,WAAW,GAAG,CAAC,CAAS,EAAE,EAAE,CAChC,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAA;AAC3C,MAAM,QAAQ,GAAG,qBAAqB,CAAA;AACtC,MAAM,gBAAgB,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,CAAmB,EAAE,EAAE;IAC5D,MAAM,KAAK,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACnC,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAA;IACtB,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;IACvB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACjE,CAAC,CAAA;AACD,MAAM,mBAAmB,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,CAAmB,EAAE,EAAE;IAC/D,MAAM,KAAK,GAAG,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACtC,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAA;IACtB,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;IACvB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACjE,CAAC,CAAA;AACD,MAAM,aAAa,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,CAAmB,EAAE,EAAE;IACzD,MAAM,KAAK,GAAG,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACtC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAClE,CAAC,CAAA;AACD,MAAM,UAAU,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,CAAmB,EAAE,EAAE;IACtD,MAAM,KAAK,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACnC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAClE,CAAC,CAAA;AACD,MAAM,eAAe,GAAG,CAAC,CAAC,EAAE,CAAmB,EAAE,EAAE;IACjD,MAAM,GAAG,GAAG,EAAE,CAAC,MAAM,CAAA;IACrB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AAC9D,CAAC,CAAA;AACD,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAmB,EAAE,EAAE;IACpD,MAAM,GAAG,GAAG,EAAE,CAAC,MAAM,CAAA;IACrB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAA;AACnE,CAAC,CAAA;AAED,qBAAqB;AACrB,MAAM,eAAe,GAAa,CAChC,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC;IACtC,CAAC,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;QAC9B,OAAO,CAAC,GAAG;QACX,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC;QAC7C,OAAO,CAAC,QAAQ;IAClB,CAAC,CAAC,OAAO,CAAa,CAAA;AAIxB,MAAM,IAAI,GAAkC;IAC1C,KAAK,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE;IACpB,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;CACpB,CAAA;AACD,oBAAoB;AAEP,QAAA,GAAG,GACd,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAA;AAC/D,iBAAS,CAAC,GAAG,GAAG,WAAG,CAAA;AAEN,QAAA,QAAQ,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;AAC7C,iBAAS,CAAC,QAAQ,GAAG,gBAAQ,CAAA;AAE7B,gCAAgC;AAChC,iDAAiD;AACjD,MAAM,KAAK,GAAG,MAAM,CAAA;AAEpB,gCAAgC;AAChC,MAAM,IAAI,GAAG,KAAK,GAAG,IAAI,CAAA;AAEzB,4DAA4D;AAC5D,+DAA+D;AAC/D,6CAA6C;AAC7C,MAAM,UAAU,GAAG,yCAAyC,CAAA;AAE5D,kCAAkC;AAClC,6CAA6C;AAC7C,MAAM,YAAY,GAAG,yBAAyB,CAAA;AAEvC,MAAM,MAAM,GACjB,CAAC,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CACpD,CAAC,CAAS,EAAE,EAAE,CACZ,IAAA,iBAAS,EAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;AAHrB,QAAA,MAAM,UAGe;AAClC,iBAAS,CAAC,MAAM,GAAG,cAAM,CAAA;AAEzB,MAAM,GAAG,GAAG,CAAC,CAAmB,EAAE,IAAsB,EAAE,EAAE,EAAE,CAC5D,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AAElB,MAAM,QAAQ,GAAG,CAAC,GAAqB,EAAoB,EAAE;IAClE,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;QAChE,OAAO,iBAAS,CAAA;IAClB,CAAC;IAED,MAAM,IAAI,GAAG,iBAAS,CAAA;IAEtB,MAAM,CAAC,GAAG,CAAC,CAAS,EAAE,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CACvE,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;IAErC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE;QACtB,SAAS,EAAE,MAAM,SAAU,SAAQ,IAAI,CAAC,SAAS;YAC/C,YAAY,OAAe,EAAE,UAA4B,EAAE;gBACzD,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;YACnC,CAAC;YACD,MAAM,CAAC,QAAQ,CAAC,OAAyB;gBACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAA;YACnD,CAAC;SACF;QAED,GAAG,EAAE,MAAM,GAAI,SAAQ,IAAI,CAAC,GAAG;YAC7B,qBAAqB;YACrB,YACE,IAAwB,EACxB,MAAY,EACZ,UAA4B,EAAE;gBAE9B,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;YACxC,CAAC;YACD,oBAAoB;YAEpB,MAAM,CAAC,QAAQ,CAAC,OAAe,EAAE,UAA4B,EAAE;gBAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;YACtD,CAAC;SACF;QAED,QAAQ,EAAE,CACR,CAAS,EACT,UAGI,EAAE,EACN,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAExC,MAAM,EAAE,CACN,CAAS,EACT,UAGI,EAAE,EACN,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEtC,MAAM,EAAE,CAAC,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CAC1D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEzC,QAAQ,EAAE,CAAC,OAAyB,EAAE,EAAE,CACtC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAElC,MAAM,EAAE,CAAC,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CAC1D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEzC,WAAW,EAAE,CAAC,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CAC/D,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAE9C,KAAK,EAAE,CACL,IAAc,EACd,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEjD,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,QAAQ,EAAE,gBAA2B;KACtC,CAAC,CAAA;AACJ,CAAC,CAAA;AAzEY,QAAA,QAAQ,YAyEpB;AACD,iBAAS,CAAC,QAAQ,GAAG,gBAAQ,CAAA;AAE7B,mBAAmB;AACnB,qBAAqB;AACrB,mBAAmB;AACnB,8BAA8B;AAC9B,mCAAmC;AACnC,2CAA2C;AAC3C,EAAE;AACF,iCAAiC;AACjC,qBAAqB;AACrB,iBAAiB;AACV,MAAM,WAAW,GAAG,CACzB,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE;IACF,IAAA,4CAAkB,EAAC,OAAO,CAAC,CAAA;IAE3B,wDAAwD;IACxD,wDAAwD;IACxD,IAAI,OAAO,CAAC,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACzD,+BAA+B;QAC/B,OAAO,CAAC,OAAO,CAAC,CAAA;IAClB,CAAC;IAED,OAAO,IAAA,wBAAM,EAAC,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC,CAAA;AACzD,CAAC,CAAA;AAdY,QAAA,WAAW,eAcvB;AACD,iBAAS,CAAC,WAAW,GAAG,mBAAW,CAAA;AAEnC,yCAAyC;AACzC,kDAAkD;AAClD,oEAAoE;AACpE,oEAAoE;AACpE,6DAA6D;AAC7D,kEAAkE;AAClE,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,qEAAqE;AACrE,8DAA8D;AAEvD,MAAM,MAAM,GAAG,CAAC,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CACxE,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,CAAA;AAD7B,QAAA,MAAM,UACuB;AAC1C,iBAAS,CAAC,MAAM,GAAG,cAAM,CAAA;AAElB,MAAM,KAAK,GAAG,CACnB,IAAc,EACd,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE;IACF,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC1C,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IACpC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACtC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACpB,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAXY,QAAA,KAAK,SAWjB;AACD,iBAAS,CAAC,KAAK,GAAG,aAAK,CAAA;AAEvB,+BAA+B;AAC/B,MAAM,SAAS,GAAG,yBAAyB,CAAA;AAC3C,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CACjC,CAAC,CAAC,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAA;AAU/C,MAAa,SAAS;IACpB,OAAO,CAAkB;IACzB,GAAG,CAAyB;IAC5B,OAAO,CAAQ;IAEf,oBAAoB,CAAS;IAC7B,QAAQ,CAAS;IACjB,MAAM,CAAS;IACf,OAAO,CAAS;IAChB,KAAK,CAAS;IACd,uBAAuB,CAAS;IAChC,OAAO,CAAS;IAChB,OAAO,CAAU;IACjB,SAAS,CAAY;IACrB,MAAM,CAAS;IAEf,SAAS,CAAS;IAClB,QAAQ,CAAU;IAClB,kBAAkB,CAAS;IAC3B,oBAAoB,CAAQ;IAE5B,MAAM,CAAyB;IAC/B,YAAY,OAAe,EAAE,UAA4B,EAAE;QACzD,IAAA,4CAAkB,EAAC,OAAO,CAAC,CAAA;QAE3B,OAAO,GAAG,OAAO,IAAI,EAAE,CAAA;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,IAAI,GAAG,CAAA;QAC/D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,eAAe,CAAA;QACnD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,KAAK,OAAO,CAAA;QAC1C,0CAA0C;QAC1C,MAAM,GAAG,GAAG,CAAC,aAAa,GAAG,SAAS,CAA2B,CAAA;QACjE,IAAI,CAAC,oBAAoB;YACvB,CAAC,CAAC,OAAO,CAAC,oBAAoB,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAA;QAC1D,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC9B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACjD,CAAC;QACD,IAAI,CAAC,uBAAuB,GAAG,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAA;QAChE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;QAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACnB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAA;QAClC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAA;QAChC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAA;QACnC,IAAI,CAAC,kBAAkB;YACrB,OAAO,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC;gBACxC,OAAO,CAAC,kBAAkB;gBAC5B,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,CAAA;QAErC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAA;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAA;QAEb,+BAA+B;QAC/B,IAAI,CAAC,IAAI,EAAE,CAAA;IACb,CAAC;IAED,QAAQ;QACN,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtD,OAAO,IAAI,CAAA;QACb,CAAC;QACD,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;YAC/B,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;gBAC3B,IAAI,OAAO,IAAI,KAAK,QAAQ;oBAAE,OAAO,IAAI,CAAA;YAC3C,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,KAAK,CAAC,GAAG,CAAY,IAAG,CAAC;IAEzB,IAAI;QACF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,6CAA6C;QAC7C,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YACpD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;YACnB,OAAM;QACR,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;YACjB,OAAM;QACR,CAAC;QAED,oCAAoC;QACpC,IAAI,CAAC,WAAW,EAAE,CAAA;QAElB,wBAAwB;QACxB,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAA;QAE/C,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,qCAAqC;YACrC,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA;QAC7D,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAEtC,+DAA+D;QAC/D,kCAAkC;QAClC,8DAA8D;QAC9D,oDAAoD;QACpD,wCAAwC;QACxC,EAAE;QACF,mEAAmE;QACnE,oEAAoE;QACpE,kEAAkE;QAClE,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAA;QAC9C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QAExC,mBAAmB;QACnB,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE;YACxC,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAC9C,qCAAqC;gBACrC,MAAM,KAAK,GACT,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;oBACX,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;oBACX,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACvC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;gBACvB,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;gBACrC,IAAI,KAAK,EAAE,CAAC;oBACV,OAAO;wBACL,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;wBAChB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;qBACxC,CAAA;gBACH,CAAC;qBAAM,IAAI,OAAO,EAAE,CAAC;oBACnB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;gBACxD,CAAC;YACH,CAAC;YACD,OAAO,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAA;QACpC,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;QAE7B,sDAAsD;QACtD,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CACnB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CACF,CAAA;QAE5B,2CAA2C;QAC3C,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACzC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;gBACrB,IACE,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;oBACX,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;oBACX,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG;oBAC5B,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ;oBACxB,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACtB,CAAC;oBACD,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;gBACZ,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;IACpC,CAAC;IAED,yDAAyD;IACzD,0DAA0D;IAC1D,yDAAyD;IACzD,4DAA4D;IAC5D,uCAAuC;IACvC,UAAU,CAAC,SAAqB;QAC9B,qDAAqD;QACrD,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YAC5B,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,CAAC;gBAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBACxC,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;wBACxB,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;oBAClB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,EAAE,iBAAiB,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;QAE9C,IAAI,iBAAiB,IAAI,CAAC,EAAE,CAAC;YAC3B,wDAAwD;YACxD,SAAS,GAAG,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAA;YAChD,SAAS,GAAG,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAA;QACnD,CAAC;aAAM,IAAI,iBAAiB,IAAI,CAAC,EAAE,CAAC;YAClC,mDAAmD;YACnD,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAA;QAC9C,CAAC;aAAM,CAAC;YACN,8CAA8C;YAC9C,SAAS,GAAG,IAAI,CAAC,yBAAyB,CAAC,SAAS,CAAC,CAAA;QACvD,CAAC;QAED,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,wCAAwC;IACxC,yBAAyB,CAAC,SAAqB;QAC7C,OAAO,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC3B,IAAI,EAAE,GAAW,CAAC,CAAC,CAAA;YACnB,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBACjD,IAAI,CAAC,GAAG,EAAE,CAAA;gBACV,OAAO,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;oBAC7B,CAAC,EAAE,CAAA;gBACL,CAAC;gBACD,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;oBACb,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAA;gBAC1B,CAAC;YACH,CAAC;YACD,OAAO,KAAK,CAAA;QACd,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,kDAAkD;IAClD,gBAAgB,CAAC,SAAqB;QACpC,OAAO,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC3B,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,GAAa,EAAE,IAAI,EAAE,EAAE;gBAC3C,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;gBAChC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;oBACnC,OAAO,GAAG,CAAA;gBACZ,CAAC;gBACD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;oBAClB,IAAI,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;wBAC3D,GAAG,CAAC,GAAG,EAAE,CAAA;wBACT,OAAO,GAAG,CAAA;oBACZ,CAAC;gBACH,CAAC;gBACD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;gBACd,OAAO,GAAG,CAAA;YACZ,CAAC,EAAE,EAAE,CAAC,CAAA;YACN,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;QAC1C,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,oBAAoB,CAAC,KAAwB;QAC3C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QAChC,CAAC;QACD,IAAI,YAAY,GAAY,KAAK,CAAA;QAEjC,GAAG,CAAC;YACF,YAAY,GAAG,KAAK,CAAA;YACpB,mCAAmC;YACnC,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC;gBAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC1C,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;oBAClB,iCAAiC;oBACjC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE;wBAAE,SAAQ;oBACpD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;wBAC1B,YAAY,GAAG,IAAI,CAAA;wBACnB,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;wBAClB,CAAC,EAAE,CAAA;oBACL,CAAC;gBACH,CAAC;gBACD,IACE,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG;oBAChB,KAAK,CAAC,MAAM,KAAK,CAAC;oBAClB,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,EACrC,CAAC;oBACD,YAAY,GAAG,IAAI,CAAA;oBACnB,KAAK,CAAC,GAAG,EAAE,CAAA;gBACb,CAAC;YACH,CAAC;YAED,sCAAsC;YACtC,IAAI,EAAE,GAAW,CAAC,CAAA;YAClB,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBACjD,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;gBACvB,IACE,CAAC;oBACD,CAAC,KAAK,GAAG;oBACT,CAAC,KAAK,IAAI;oBACV,CAAC,KAAK,IAAI;oBACV,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EACxC,CAAC;oBACD,YAAY,GAAG,IAAI,CAAA;oBACnB,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;oBACvB,EAAE,IAAI,CAAC,CAAA;gBACT,CAAC;YACH,CAAC;QACH,CAAC,QAAQ,YAAY,EAAC;QACtB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAC1C,CAAC;IAED,yCAAyC;IACzC,8BAA8B;IAC9B,+BAA+B;IAC/B,iDAAiD;IACjD,iBAAiB;IACjB,EAAE;IACF,gEAAgE;IAChE,gEAAgE;IAChE,kEAAkE;IAClE,qDAAqD;IACrD,EAAE;IACF,kFAAkF;IAClF,mCAAmC;IACnC,sCAAsC;IACtC,4BAA4B;IAC5B,EAAE;IACF,qEAAqE;IACrE,+DAA+D;IAC/D,oBAAoB,CAAC,SAAqB;QACxC,IAAI,YAAY,GAAG,KAAK,CAAA;QACxB,GAAG,CAAC;YACF,YAAY,GAAG,KAAK,CAAA;YACpB,kFAAkF;YAClF,KAAK,IAAI,KAAK,IAAI,SAAS,EAAE,CAAC;gBAC5B,IAAI,EAAE,GAAW,CAAC,CAAC,CAAA;gBACnB,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;oBACjD,IAAI,GAAG,GAAW,EAAE,CAAA;oBACpB,OAAO,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;wBAC/B,wCAAwC;wBACxC,GAAG,EAAE,CAAA;oBACP,CAAC;oBACD,uDAAuD;oBACvD,mCAAmC;oBACnC,IAAI,GAAG,GAAG,EAAE,EAAE,CAAC;wBACb,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,CAAA;oBAChC,CAAC;oBAED,IAAI,IAAI,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;oBACxB,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;oBACvB,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;oBACxB,IAAI,IAAI,KAAK,IAAI;wBAAE,SAAQ;oBAC3B,IACE,CAAC,CAAC;wBACF,CAAC,KAAK,GAAG;wBACT,CAAC,KAAK,IAAI;wBACV,CAAC,EAAE;wBACH,EAAE,KAAK,GAAG;wBACV,EAAE,KAAK,IAAI,EACX,CAAC;wBACD,SAAQ;oBACV,CAAC;oBACD,YAAY,GAAG,IAAI,CAAA;oBACnB,4CAA4C;oBAC5C,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;oBACnB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;oBAC5B,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,CAAA;oBAChB,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;oBACrB,EAAE,EAAE,CAAA;gBACN,CAAC;gBAED,mCAAmC;gBACnC,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC;oBAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;wBAC1C,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;wBAClB,iCAAiC;wBACjC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE;4BAAE,SAAQ;wBACpD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;4BAC1B,YAAY,GAAG,IAAI,CAAA;4BACnB,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;4BAClB,CAAC,EAAE,CAAA;wBACL,CAAC;oBACH,CAAC;oBACD,IACE,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG;wBAChB,KAAK,CAAC,MAAM,KAAK,CAAC;wBAClB,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,EACrC,CAAC;wBACD,YAAY,GAAG,IAAI,CAAA;wBACnB,KAAK,CAAC,GAAG,EAAE,CAAA;oBACb,CAAC;gBACH,CAAC;gBAED,sCAAsC;gBACtC,IAAI,EAAE,GAAW,CAAC,CAAA;gBAClB,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;oBACjD,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;oBACvB,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;wBAC/C,YAAY,GAAG,IAAI,CAAA;wBACnB,MAAM,OAAO,GAAG,EAAE,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,IAAI,CAAA;wBAClD,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;wBAClC,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,CAAA;wBACjC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;4BAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;wBACtC,EAAE,IAAI,CAAC,CAAA;oBACT,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC,QAAQ,YAAY,EAAC;QAEtB,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,sCAAsC;IACtC,sDAAsD;IACtD,8CAA8C;IAC9C,oDAAoD;IACpD,EAAE;IACF,2DAA2D;IAC3D,mDAAmD;IACnD,qBAAqB,CAAC,SAAqB;QACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9C,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAC7B,SAAS,CAAC,CAAC,CAAC,EACZ,SAAS,CAAC,CAAC,CAAC,EACZ,CAAC,IAAI,CAAC,uBAAuB,CAC9B,CAAA;gBACD,IAAI,OAAO,EAAE,CAAC;oBACZ,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,CAAA;oBACjB,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,CAAA;oBACtB,MAAK;gBACP,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAA;IAC1C,CAAC;IAED,UAAU,CACR,CAAW,EACX,CAAW,EACX,eAAwB,KAAK;QAE7B,IAAI,EAAE,GAAG,CAAC,CAAA;QACV,IAAI,EAAE,GAAG,CAAC,CAAA;QACV,IAAI,MAAM,GAAa,EAAE,CAAA;QACzB,IAAI,KAAK,GAAW,EAAE,CAAA;QACtB,OAAO,EAAE,GAAG,CAAC,CAAC,MAAM,IAAI,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;YACtC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;gBACpB,MAAM,CAAC,IAAI,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAC1C,EAAE,EAAE,CAAA;gBACJ,EAAE,EAAE,CAAA;YACN,CAAC;iBAAM,IAAI,YAAY,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;gBACjE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAClB,EAAE,EAAE,CAAA;YACN,CAAC;iBAAM,IAAI,YAAY,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;gBACjE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAClB,EAAE,EAAE,CAAA;YACN,CAAC;iBAAM,IACL,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG;gBACb,CAAC,CAAC,EAAE,CAAC;gBACL,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;gBAC5C,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,EACd,CAAC;gBACD,IAAI,KAAK,KAAK,GAAG;oBAAE,OAAO,KAAK,CAAA;gBAC/B,KAAK,GAAG,GAAG,CAAA;gBACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAClB,EAAE,EAAE,CAAA;gBACJ,EAAE,EAAE,CAAA;YACN,CAAC;iBAAM,IACL,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG;gBACb,CAAC,CAAC,EAAE,CAAC;gBACL,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;gBAC5C,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,EACd,CAAC;gBACD,IAAI,KAAK,KAAK,GAAG;oBAAE,OAAO,KAAK,CAAA;gBAC/B,KAAK,GAAG,GAAG,CAAA;gBACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAClB,EAAE,EAAE,CAAA;gBACJ,EAAE,EAAE,CAAA;YACN,CAAC;iBAAM,CAAC;gBACN,OAAO,KAAK,CAAA;YACd,CAAC;QACH,CAAC;QACD,8DAA8D;QAC9D,iCAAiC;QACjC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,MAAM,CAAA;IACxC,CAAC;IAED,WAAW;QACT,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAM;QAEzB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAC5B,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,IAAI,YAAY,GAAG,CAAC,CAAA;QAEpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YACrE,MAAM,GAAG,CAAC,MAAM,CAAA;YAChB,YAAY,EAAE,CAAA;QAChB,CAAC;QAED,IAAI,YAAY;YAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;QAC5D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,+CAA+C;IAC/C,yCAAyC;IACzC,uDAAuD;IACvD,mDAAmD;IACnD,mBAAmB;IACnB,QAAQ,CACN,IAAc,EACd,OAAsB,EACtB,UAAmB,KAAK;QAExB,IAAI,cAAc,GAAG,CAAC,CAAA;QACtB,IAAI,iBAAiB,GAAG,CAAC,CAAA;QAEzB,4DAA4D;QAC5D,mEAAmE;QACnE,sBAAsB;QACtB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,SAAS,GACb,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1D,MAAM,OAAO,GACX,CAAC,SAAS;gBACV,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;gBACd,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;gBACd,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG;gBACf,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAE3B,MAAM,YAAY,GAChB,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;YAChE,MAAM,UAAU,GACd,CAAC,YAAY;gBACb,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE;gBACjB,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE;gBACjB,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG;gBAClB,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ;gBAC9B,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;YAE9B,MAAM,GAAG,GACP,OAAO,CAAC,CAAC,CAAC,CAAC;gBACX,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;oBACf,CAAC,CAAC,SAAS,CAAA;YACb,MAAM,GAAG,GACP,UAAU,CAAC,CAAC,CAAC,CAAC;gBACd,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;oBAClB,CAAC,CAAC,SAAS,CAAA;YACb,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;gBACvD,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAqB;oBACjC,IAAI,CAAC,GAAG,CAAC;oBACT,OAAO,CAAC,GAAG,CAAW;iBACvB,CAAA;gBACD,mDAAmD;gBACnD,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;oBAC1C,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAA;oBACjB,iBAAiB,GAAG,GAAG,CAAA;oBACvB,cAAc,GAAG,GAAG,CAAA;gBACtB,CAAC;YACH,CAAC;QACH,CAAC;QAED,4DAA4D;QAC5D,oEAAoE;QACpE,MAAM,EAAE,iBAAiB,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;QAC9C,IAAI,iBAAiB,IAAI,CAAC,EAAE,CAAC;YAC3B,IAAI,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;QACxC,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,gBAAQ,CAAC,EAAE,CAAC;YAC/B,OAAO,IAAI,CAAC,cAAc,CACxB,IAAI,EACJ,OAAO,EACP,OAAO,EACP,cAAc,EACd,iBAAiB,CAClB,CAAA;QACH,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CACnB,IAAI,EACJ,OAAO,EACP,OAAO,EACP,cAAc,EACd,iBAAiB,CAClB,CAAA;IACH,CAAC;IAED,cAAc,CACZ,IAAc,EACd,OAAsB,EACtB,OAAgB,EAChB,SAAiB,EACjB,YAAoB;QAEpB,sEAAsE;QACtE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,gBAAQ,EAAE,YAAY,CAAC,CAAA;QACvD,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,gBAAQ,CAAC,CAAA;QAE5C,wDAAwD;QACxD,0DAA0D;QAC1D,sCAAsC;QACtC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GACtB,OAAO,CAAC,CAAC;YACP;gBACE,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC;gBACpC,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;gBAC1B,EAAE;aACH;YACH,CAAC,CAAC;gBACE,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC;gBACpC,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,EAAE,MAAM,CAAC;gBAClC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;aAC1B,CAAA;QAEL,uDAAuD;QACvD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,CAAA;YAC/D,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;gBACnD,OAAO,KAAK,CAAA;YACd,CAAC;YACD,SAAS,IAAI,IAAI,CAAC,MAAM,CAAA;YACxB,YAAY,IAAI,IAAI,CAAC,MAAM,CAAA;QAC7B,CAAC;QACD,gCAAgC;QAEhC,0DAA0D;QAC1D,iBAAiB;QACjB,IAAI,aAAa,GAAW,CAAC,CAAA;QAC7B,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,uDAAuD;YACvD,IAAI,IAAI,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM;gBAAE,OAAO,KAAK,CAAA;YAEvD,wBAAwB;YACxB,IAAI,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;YACzC,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;gBACtD,aAAa,GAAG,IAAI,CAAC,MAAM,CAAA;YAC7B,CAAC;iBAAM,CAAC;gBACN,iDAAiD;gBACjD,kEAAkE;gBAClE,+BAA+B;gBAC/B,IACE,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE;oBAC5B,SAAS,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EACvC,CAAC;oBACD,OAAO,KAAK,CAAA;gBACd,CAAC;gBACD,SAAS,EAAE,CAAA;gBACX,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;oBACvD,OAAO,KAAK,CAAA;gBACd,CAAC;gBACD,aAAa,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAA;YACjC,CAAC;QACH,CAAC;QAED,gCAAgC;QAEhC,8DAA8D;QAC9D,+BAA+B;QAC/B,8CAA8C;QAC9C,kEAAkE;QAClE,uEAAuE;QACvE,qCAAqC;QACrC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,OAAO,GAAG,CAAC,CAAC,aAAa,CAAA;YAC7B,KAAK,IAAI,CAAC,GAAG,SAAS,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,aAAa,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC7D,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;gBACzB,OAAO,GAAG,IAAI,CAAA;gBACd,IACE,CAAC,KAAK,GAAG;oBACT,CAAC,KAAK,IAAI;oBACV,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EACxC,CAAC;oBACD,OAAO,KAAK,CAAA;gBACd,CAAC;YACH,CAAC;YACD,2DAA2D;YAC3D,OAAO,OAAO,IAAI,OAAO,CAAA;QAC3B,CAAC;QAED,gEAAgE;QAChE,qEAAqE;QACrE,6CAA6C;QAC7C,qEAAqE;QACrE,+DAA+D;QAC/D,2BAA2B;QAC3B,MAAM,YAAY,GAA8B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;QACzD,IAAI,WAAW,GAA4B,YAAY,CAAC,CAAC,CAAC,CAAA;QAC1D,IAAI,UAAU,GAAG,CAAC,CAAA;QAClB,MAAM,cAAc,GAAa,CAAC,CAAC,CAAC,CAAA;QACpC,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;YACrB,IAAI,CAAC,KAAK,gBAAQ,EAAE,CAAC;gBACnB,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;gBAC/B,WAAW,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;gBACrB,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;YAChC,CAAC;iBAAM,CAAC;gBACN,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;gBACtB,UAAU,EAAE,CAAA;YACd,CAAC;QACH,CAAC;QACD,IAAI,CAAC,GAAG,YAAY,CAAC,MAAM,GAAG,CAAC,CAAA;QAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,GAAG,aAAa,CAAA;QAC9C,KAAK,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC;YAC7B,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,GAAG,CAAE,cAAc,CAAC,CAAC,EAAE,CAAY,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;QACrE,CAAC;QAED,OAAO,CAAC,CAAC,IAAI,CAAC,0BAA0B,CACtC,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,CAAC,EACD,OAAO,EACP,CAAC,EACD,CAAC,CAAC,aAAa,CAChB,CAAA;IACH,CAAC;IAED,wCAAwC;IACxC,qDAAqD;IACrD,0BAA0B,CACxB,IAAc;IACd,iDAAiD;IACjD,YAAuC,EACvC,SAAiB,EACjB,SAAiB,EACjB,OAAgB,EAChB,aAAqB,EACrB,OAAgB;QAEhB,sEAAsE;QACtE,mBAAmB;QACnB,mEAAmE;QACnE,6CAA6C;QAC7C,kDAAkD;QAClD,+CAA+C;QAC/C,qEAAqE;QACrE,sEAAsE;QACtE,gDAAgD;QAChD,MAAM,EAAE,GAAG,YAAY,CAAC,SAAS,CAAC,CAAA;QAClC,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,0CAA0C;YAC1C,KAAK,IAAI,CAAC,GAAG,SAAS,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC7C,OAAO,GAAG,IAAI,CAAA;gBACd,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;gBACjB,IACE,CAAC,KAAK,GAAG;oBACT,CAAC,KAAK,IAAI;oBACV,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EACxC,CAAC;oBACD,OAAO,KAAK,CAAA;gBACd,CAAC;YACH,CAAC;YACD,OAAO,OAAO,CAAA;QAChB,CAAC;QAED,2CAA2C;QAC3C,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,CAAA;QACxB,OAAO,SAAS,IAAI,KAAK,EAAE,CAAC;YAC1B,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CACtB,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,EACtC,IAAI,EACJ,OAAO,EACP,SAAS,EACT,CAAC,CACF,CAAA;YACD,2DAA2D;YAC3D,gDAAgD;YAChD,IAAI,CAAC,IAAI,aAAa,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;gBACnD,mDAAmD;gBACnD,MAAM,GAAG,GAAG,IAAI,CAAC,0BAA0B,CACzC,IAAI,EACJ,YAAY,EACZ,SAAS,GAAG,IAAI,CAAC,MAAM,EACvB,SAAS,GAAG,CAAC,EACb,OAAO,EACP,aAAa,GAAG,CAAC,EACjB,OAAO,CACR,CAAA;gBACD,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;oBAClB,OAAO,GAAG,CAAA;gBACZ,CAAC;YACH,CAAC;YACD,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAA;YACzB,IACE,CAAC,KAAK,GAAG;gBACT,CAAC,KAAK,IAAI;gBACV,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EACxC,CAAC;gBACD,OAAO,KAAK,CAAA;YACd,CAAC;YAED,SAAS,EAAE,CAAA;QACb,CAAC;QACD,kCAAkC;QAClC,OAAO,OAAO,IAAI,IAAI,CAAA;IACxB,CAAC;IAED,SAAS,CACP,IAAc,EACd,OAAsB,EACtB,OAAgB,EAChB,SAAiB,EACjB,YAAoB;QAEpB,IAAI,EAAU,CAAA;QACd,IAAI,EAAU,CAAA;QACd,IAAI,EAAU,CAAA;QACd,IAAI,EAAU,CAAA;QACd,KACE,EAAE,GAAG,SAAS;YACZ,EAAE,GAAG,YAAY;YACjB,EAAE,GAAG,IAAI,CAAC,MAAM;YAChB,EAAE,GAAG,OAAO,CAAC,MAAM,EACrB,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,EAClB,EAAE,EAAE,EAAE,EAAE,EAAE,EACV,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;YAC3B,IAAI,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC,CAAA;YACnB,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAA;YAEhB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;YAEzB,wBAAwB;YACxB,wCAAwC;YACxC,qBAAqB;YACrB,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,gBAAQ,EAAE,CAAC;gBAClC,OAAO,KAAK,CAAA;YACd,CAAC;YACD,oBAAoB;YAEpB,0BAA0B;YAC1B,gDAAgD;YAChD,qDAAqD;YACrD,IAAI,GAAY,CAAA;YAChB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;gBAC1B,GAAG,GAAG,CAAC,KAAK,CAAC,CAAA;gBACb,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAA;YACvC,CAAC;iBAAM,CAAC;gBACN,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;gBACf,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAA;YACxC,CAAC;YAED,IAAI,CAAC,GAAG;gBAAE,OAAO,KAAK,CAAA;QACxB,CAAC;QAED,oDAAoD;QACpD,oDAAoD;QACpD,2CAA2C;QAC3C,kDAAkD;QAClD,oDAAoD;QACpD,uDAAuD;QACvD,oDAAoD;QACpD,yDAAyD;QACzD,6BAA6B;QAC7B,yCAAyC;QAEzC,gEAAgE;QAChE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC3B,oDAAoD;YACpD,gBAAgB;YAChB,OAAO,IAAI,CAAA;QACb,CAAC;aAAM,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACrB,+CAA+C;YAC/C,iDAAiD;YACjD,uBAAuB;YACvB,OAAO,OAAO,CAAA;QAChB,CAAC;aAAM,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACrB,4CAA4C;YAC5C,oDAAoD;YACpD,iDAAiD;YACjD,wBAAwB;YACxB,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;YAEvC,qBAAqB;QACvB,CAAC;aAAM,CAAC;YACN,yBAAyB;YACzB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAA;QACzB,CAAC;QACD,oBAAoB;IACtB,CAAC;IAED,WAAW;QACT,OAAO,IAAA,mBAAW,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAChD,CAAC;IAED,KAAK,CAAC,OAAe;QACnB,IAAA,4CAAkB,EAAC,OAAO,CAAC,CAAA;QAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,YAAY;QACZ,IAAI,OAAO,KAAK,IAAI;YAAE,OAAO,gBAAQ,CAAA;QACrC,IAAI,OAAO,KAAK,EAAE;YAAE,OAAO,EAAE,CAAA;QAE7B,uDAAuD;QACvD,0DAA0D;QAC1D,IAAI,CAA0B,CAAA;QAC9B,IAAI,QAAQ,GAAoC,IAAI,CAAA;QACpD,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;YAChC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAA;QACjD,CAAC;aAAM,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;YAC7C,QAAQ,GAAG,CACT,OAAO,CAAC,MAAM,CAAC,CAAC;gBACd,OAAO,CAAC,GAAG,CAAC,CAAC;oBACX,uBAAuB;oBACzB,CAAC,CAAC,oBAAoB;gBACxB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,iBAAiB;oBACjC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC3B,CAAC;aAAM,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;YACzC,QAAQ,GAAG,CACT,OAAO,CAAC,MAAM,CAAC,CAAC;gBACd,OAAO,CAAC,GAAG,CAAC,CAAC;oBACX,mBAAmB;oBACrB,CAAC,CAAC,gBAAgB;gBACpB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa;oBAC7B,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;QACpB,CAAC;aAAM,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC;YAC9C,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,eAAe,CAAA;QAC/D,CAAC;aAAM,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YAC1C,QAAQ,GAAG,WAAW,CAAA;QACxB,CAAC;QAED,MAAM,EAAE,GAAG,YAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAA;QAC5D,IAAI,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;YACvC,2CAA2C;YAC3C,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;QACzD,CAAC;QACD,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM;QACJ,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK;YAAE,OAAO,IAAI,CAAC,MAAM,CAAA;QAE5D,mDAAmD;QACnD,4BAA4B;QAC5B,EAAE;QACF,wDAAwD;QACxD,yDAAyD;QACzD,2CAA2C;QAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;QAEpB,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;YACnB,OAAO,IAAI,CAAC,MAAM,CAAA;QACpB,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,MAAM,OAAO,GACX,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI;YACzB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU;gBAC1B,CAAC,CAAC,YAAY,CAAA;QAChB,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QAElD,kCAAkC;QAClC,kDAAkD;QAClD,sEAAsE;QACtE,iDAAiD;QACjD,8DAA8D;QAC9D,mCAAmC;QACnC,IAAI,EAAE,GAAG,GAAG;aACT,GAAG,CAAC,OAAO,CAAC,EAAE;YACb,MAAM,EAAE,GAAiC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;gBACvD,IAAI,CAAC,YAAY,MAAM,EAAE,CAAC;oBACxB,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;wBAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;gBACjD,CAAC;gBACD,OAAO,CACL,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;oBACvC,CAAC,CAAC,CAAC,KAAK,gBAAQ,CAAC,CAAC,CAAC,gBAAQ;wBAC3B,CAAC,CAAC,CAAC,CAAC,IAAI,CACT,CAAA;YACH,CAAC,CAAiC,CAAA;YAClC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBAClB,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;gBACtB,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;gBACtB,IAAI,CAAC,KAAK,gBAAQ,IAAI,IAAI,KAAK,gBAAQ,EAAE,CAAC;oBACxC,OAAM;gBACR,CAAC;gBACD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;oBACvB,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,gBAAQ,EAAE,CAAC;wBAC5C,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;oBAClD,CAAC;yBAAM,CAAC;wBACN,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO,CAAA;oBACjB,CAAC;gBACH,CAAC;qBAAM,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;oBAC9B,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,YAAY,GAAG,OAAO,GAAG,IAAI,CAAA;gBAClD,CAAC;qBAAM,IAAI,IAAI,KAAK,gBAAQ,EAAE,CAAC;oBAC7B,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,CAAA;oBACzD,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,gBAAQ,CAAA;gBACtB,CAAC;YACH,CAAC,CAAC,CAAA;YACF,MAAM,QAAQ,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,gBAAQ,CAAC,CAAA;YAE/C,yDAAyD;YACzD,wDAAwD;YACxD,iEAAiE;YACjE,IAAI,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;gBACzC,MAAM,QAAQ,GAAa,EAAE,CAAA;gBAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC1C,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;gBAC/C,CAAC;gBACD,OAAO,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAA;YACzC,CAAC;YAED,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC3B,CAAC,CAAC;aACD,IAAI,CAAC,GAAG,CAAC,CAAA;QAEZ,+DAA+D;QAC/D,mEAAmE;QACnE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QAC9D,4BAA4B;QAC5B,gDAAgD;QAChD,EAAE,GAAG,GAAG,GAAG,IAAI,GAAG,EAAE,GAAG,KAAK,GAAG,GAAG,CAAA;QAElC,kFAAkF;QAClF,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,EAAE,GAAG,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAA;QACzD,CAAC;QAED,gDAAgD;QAChD,IAAI,IAAI,CAAC,MAAM;YAAE,EAAE,GAAG,MAAM,GAAG,EAAE,GAAG,MAAM,CAAA;QAE1C,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;YACjD,qBAAqB;QACvB,CAAC;QAAC,MAAM,CAAC;YACP,uBAAuB;YACvB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACrB,CAAC;QACD,oBAAoB;QACpB,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,UAAU,CAAC,CAAS;QAClB,mDAAmD;QACnD,6DAA6D;QAC7D,8CAA8C;QAC9C,0CAA0C;QAC1C,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;YACjC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACrB,CAAC;aAAM,IAAI,IAAI,CAAC,SAAS,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAClD,sCAAsC;YACtC,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;QAChC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACvB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,CAAS,EAAE,OAAO,GAAG,IAAI,CAAC,OAAO;QACrC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACpC,8CAA8C;QAC9C,iBAAiB;QACjB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,EAAE,CAAA;QACjB,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,OAAO,EAAE,CAAC;YACzB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,gCAAgC;QAChC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC7B,CAAC;QAED,6CAA6C;QAC7C,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;QAC7B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;QAErC,0DAA0D;QAC1D,2DAA2D;QAC3D,mCAAmC;QACnC,uCAAuC;QAEvC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;QACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QAEpC,0EAA0E;QAC1E,IAAI,QAAQ,GAAW,EAAE,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QACxC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBACrD,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;YAClB,CAAC;QACH,CAAC;QAED,KAAK,MAAM,OAAO,IAAI,GAAG,EAAE,CAAC;YAC1B,IAAI,IAAI,GAAG,EAAE,CAAA;YACb,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC9C,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAA;YACnB,CAAC;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;YACjD,IAAI,GAAG,EAAE,CAAC;gBACR,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;oBACvB,OAAO,IAAI,CAAA;gBACb,CAAC;gBACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAA;YACrB,CAAC;QACH,CAAC;QAED,2DAA2D;QAC3D,8BAA8B;QAC9B,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAqB;QACnC,OAAO,iBAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,CAAA;IAC1C,CAAC;CACF;AAhkCD,8BAgkCC;AACD,qBAAqB;AACrB,mCAA8B;AAArB,6FAAA,GAAG,OAAA;AACZ,yCAAoC;AAA3B,mGAAA,MAAM,OAAA;AACf,6CAAwC;AAA/B,uGAAA,QAAQ,OAAA;AACjB,oBAAoB;AACpB,iBAAS,CAAC,GAAG,GAAG,YAAG,CAAA;AACnB,iBAAS,CAAC,SAAS,GAAG,SAAS,CAAA;AAC/B,iBAAS,CAAC,MAAM,GAAG,kBAAM,CAAA;AACzB,iBAAS,CAAC,QAAQ,GAAG,sBAAQ,CAAA","sourcesContent":["import { expand } from 'brace-expansion'\nimport { assertValidPattern } from './assert-valid-pattern.js'\nimport type { ExtglobType } from './ast.js'\nimport { AST } from './ast.js'\nimport { escape } from './escape.js'\nimport { unescape } from './unescape.js'\n\nexport type Platform =\n  | 'aix'\n  | 'android'\n  | 'darwin'\n  | 'freebsd'\n  | 'haiku'\n  | 'linux'\n  | 'openbsd'\n  | 'sunos'\n  | 'win32'\n  | 'cygwin'\n  | 'netbsd'\n\nexport interface MinimatchOptions {\n  /** do not expand `{x,y}` style braces */\n  nobrace?: boolean\n  /** do not treat patterns starting with `#` as a comment */\n  nocomment?: boolean\n  /** do not treat patterns starting with `!` as a negation */\n  nonegate?: boolean\n  /** print LOTS of debugging output */\n  debug?: boolean\n  /** treat `**` the same as `*` */\n  noglobstar?: boolean\n  /** do not expand extglobs like `+(a|b)` */\n  noext?: boolean\n  /** return the pattern if nothing matches */\n  nonull?: boolean\n  /** treat `\\\\` as a path separator, not an escape character */\n  windowsPathsNoEscape?: boolean\n  /**\n   * inverse of {@link MinimatchOptions.windowsPathsNoEscape}\n   * @deprecated\n   */\n  allowWindowsEscape?: boolean\n  /**\n   * Compare a partial path to a pattern. As long as the parts\n   * of the path that are present are not contradicted by the\n   * pattern, it will be treated as a match. This is useful in\n   * applications where you're walking through a folder structure,\n   * and don't yet have the full path, but want to ensure that you\n   * do not walk down paths that can never be a match.\n   */\n  partial?: boolean\n  /** allow matches that start with `.` even if the pattern does not */\n  dot?: boolean\n  /** ignore case */\n  nocase?: boolean\n  /** ignore case only in wildcard patterns */\n  nocaseMagicOnly?: boolean\n  /** consider braces to be \"magic\" for the purpose of `hasMagic` */\n  magicalBraces?: boolean\n  /**\n   * If set, then patterns without slashes will be matched\n   * against the basename of the path if it contains slashes.\n   * For example, `a?b` would match the path `/xyz/123/acb`, but\n   * not `/xyz/acb/123`.\n   */\n  matchBase?: boolean\n  /** invert the results of negated matches */\n  flipNegate?: boolean\n  /** do not collapse multiple `/` into a single `/` */\n  preserveMultipleSlashes?: boolean\n  /**\n   * A number indicating the level of optimization that should be done\n   * to the pattern prior to parsing and using it for matches.\n   */\n  optimizationLevel?: number\n  /** operating system platform */\n  platform?: Platform\n  /**\n   * When a pattern starts with a UNC path or drive letter, and in\n   * `nocase:true` mode, do not convert the root portions of the\n   * pattern into a case-insensitive regular expression, and instead\n   * leave them as strings.\n   *\n   * This is the default when the platform is `win32` and\n   * `nocase:true` is set.\n   */\n  windowsNoMagicRoot?: boolean\n  /**\n   * max number of `{...}` patterns to expand. Default 100_000.\n   */\n  braceExpandMax?: number\n  /**\n   * Max number of non-adjacent `**` patterns to recursively walk down.\n   *\n   * The default of 200 is almost certainly high enough for most purposes,\n   * and can handle absurdly excessive patterns.\n   */\n  maxGlobstarRecursion?: number\n\n  /**\n   * Max depth to traverse for nested extglobs like `*(a|b|c)`\n   *\n   * Default is 2, which is quite low, but any higher value\n   * swiftly results in punishing performance impacts. Note\n   * that this is *not*  relevant when the globstar types can\n   * be safely coalesced into a single set.\n   *\n   * For example, `*(a|@(b|c)|d)` would be flattened into\n   * `*(a|b|c|d)`. Thus, many common extglobs will retain good\n   * performance and  never hit this limit, even if they are\n   * excessively deep and complicated.\n   *\n   * If the limit is hit, then the extglob characters are simply\n   * not parsed, and the pattern effectively switches into\n   * `noextglob: true` mode for the contents of that nested\n   * sub-pattern. This will typically _not_ result in a match,\n   * but is considered a valid trade-off for security and\n   * performance.\n   */\n  maxExtglobRecursion?: number\n}\n\nexport const minimatch = (\n  p: string,\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // shortcut: comments match nothing.\n  if (!options.nocomment && pattern.charAt(0) === '#') {\n    return false\n  }\n\n  return new Minimatch(pattern, options).match(p)\n}\n\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/\nconst starDotExtTest = (ext: string) => (f: string) =>\n  !f.startsWith('.') && f.endsWith(ext)\nconst starDotExtTestDot = (ext: string) => (f: string) => f.endsWith(ext)\nconst starDotExtTestNocase = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => !f.startsWith('.') && f.toLowerCase().endsWith(ext)\n}\nconst starDotExtTestNocaseDot = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => f.toLowerCase().endsWith(ext)\n}\nconst starDotStarRE = /^\\*+\\.\\*+$/\nconst starDotStarTest = (f: string) =>\n  !f.startsWith('.') && f.includes('.')\nconst starDotStarTestDot = (f: string) =>\n  f !== '.' && f !== '..' && f.includes('.')\nconst dotStarRE = /^\\.\\*+$/\nconst dotStarTest = (f: string) =>\n  f !== '.' && f !== '..' && f.startsWith('.')\nconst starRE = /^\\*+$/\nconst starTest = (f: string) => f.length !== 0 && !f.startsWith('.')\nconst starTestDot = (f: string) =>\n  f.length !== 0 && f !== '.' && f !== '..'\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/\nconst qmarksTestNocase = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestNocaseDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTest = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTestNoExt = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && !f.startsWith('.')\n}\nconst qmarksTestNoExtDot = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && f !== '.' && f !== '..'\n}\n\n/* c8 ignore start */\nconst defaultPlatform: Platform = (\n  typeof process === 'object' && process ?\n    (typeof process.env === 'object' &&\n      process.env &&\n      process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n    process.platform\n  : 'posix') as Platform\n\nexport type Sep = '\\\\' | '/'\n\nconst path: { [k: string]: { sep: Sep } } = {\n  win32: { sep: '\\\\' },\n  posix: { sep: '/' },\n}\n/* c8 ignore stop */\n\nexport const sep =\n  defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep\nminimatch.sep = sep\n\nexport const GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed.  Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?'\n\nexport const filter =\n  (pattern: string, options: MinimatchOptions = {}) =>\n  (p: string) =>\n    minimatch(p, pattern, options)\nminimatch.filter = filter\n\nconst ext = (a: MinimatchOptions, b: MinimatchOptions = {}) =>\n  Object.assign({}, a, b)\n\nexport const defaults = (def: MinimatchOptions): typeof minimatch => {\n  if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n    return minimatch\n  }\n\n  const orig = minimatch\n\n  const m = (p: string, pattern: string, options: MinimatchOptions = {}) =>\n    orig(p, pattern, ext(def, options))\n\n  return Object.assign(m, {\n    Minimatch: class Minimatch extends orig.Minimatch {\n      constructor(pattern: string, options: MinimatchOptions = {}) {\n        super(pattern, ext(def, options))\n      }\n      static defaults(options: MinimatchOptions) {\n        return orig.defaults(ext(def, options)).Minimatch\n      }\n    },\n\n    AST: class AST extends orig.AST {\n      /* c8 ignore start */\n      constructor(\n        type: ExtglobType | null,\n        parent?: AST,\n        options: MinimatchOptions = {},\n      ) {\n        super(type, parent, ext(def, options))\n      }\n      /* c8 ignore stop */\n\n      static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n        return orig.AST.fromGlob(pattern, ext(def, options))\n      }\n    },\n\n    unescape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.unescape(s, ext(def, options)),\n\n    escape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.escape(s, ext(def, options)),\n\n    filter: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.filter(pattern, ext(def, options)),\n\n    defaults: (options: MinimatchOptions) =>\n      orig.defaults(ext(def, options)),\n\n    makeRe: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.makeRe(pattern, ext(def, options)),\n\n    braceExpand: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.braceExpand(pattern, ext(def, options)),\n\n    match: (\n      list: string[],\n      pattern: string,\n      options: MinimatchOptions = {},\n    ) => orig.match(list, pattern, ext(def, options)),\n\n    sep: orig.sep,\n    GLOBSTAR: GLOBSTAR as typeof GLOBSTAR,\n  })\n}\nminimatch.defaults = defaults\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // Thanks to Yeting Li  for\n  // improving this regexp to avoid a ReDOS vulnerability.\n  if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n    // shortcut. no need to expand.\n    return [pattern]\n  }\n\n  return expand(pattern, { max: options.braceExpandMax })\n}\nminimatch.braceExpand = braceExpand\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion.  Otherwise, any series\n// of * is equivalent to a single *.  Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\n\nexport const makeRe = (pattern: string, options: MinimatchOptions = {}) =>\n  new Minimatch(pattern, options).makeRe()\nminimatch.makeRe = makeRe\n\nexport const match = (\n  list: string[],\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  const mm = new Minimatch(pattern, options)\n  list = list.filter(f => mm.match(f))\n  if (mm.options.nonull && !list.length) {\n    list.push(pattern)\n  }\n  return list\n}\nminimatch.match = match\n\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\nexport type MMRegExp = RegExp & {\n  _src?: string\n  _glob?: string\n}\n\nexport type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR\nexport type ParseReturn = ParseReturnFiltered | false\n\nexport class Minimatch {\n  options: MinimatchOptions\n  set: ParseReturnFiltered[][]\n  pattern: string\n\n  windowsPathsNoEscape: boolean\n  nonegate: boolean\n  negate: boolean\n  comment: boolean\n  empty: boolean\n  preserveMultipleSlashes: boolean\n  partial: boolean\n  globSet: string[]\n  globParts: string[][]\n  nocase: boolean\n\n  isWindows: boolean\n  platform: Platform\n  windowsNoMagicRoot: boolean\n  maxGlobstarRecursion: number\n\n  regexp: false | null | MMRegExp\n  constructor(pattern: string, options: MinimatchOptions = {}) {\n    assertValidPattern(pattern)\n\n    options = options || {}\n    this.options = options\n    this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200\n    this.pattern = pattern\n    this.platform = options.platform || defaultPlatform\n    this.isWindows = this.platform === 'win32'\n    // avoid the annoying deprecation flag lol\n    const awe = ('allowWindow' + 'sEscape') as keyof MinimatchOptions\n    this.windowsPathsNoEscape =\n      !!options.windowsPathsNoEscape || options[awe] === false\n    if (this.windowsPathsNoEscape) {\n      this.pattern = this.pattern.replace(/\\\\/g, '/')\n    }\n    this.preserveMultipleSlashes = !!options.preserveMultipleSlashes\n    this.regexp = null\n    this.negate = false\n    this.nonegate = !!options.nonegate\n    this.comment = false\n    this.empty = false\n    this.partial = !!options.partial\n    this.nocase = !!this.options.nocase\n    this.windowsNoMagicRoot =\n      options.windowsNoMagicRoot !== undefined ?\n        options.windowsNoMagicRoot\n      : !!(this.isWindows && this.nocase)\n\n    this.globSet = []\n    this.globParts = []\n    this.set = []\n\n    // make the set of regexps etc.\n    this.make()\n  }\n\n  hasMagic(): boolean {\n    if (this.options.magicalBraces && this.set.length > 1) {\n      return true\n    }\n    for (const pattern of this.set) {\n      for (const part of pattern) {\n        if (typeof part !== 'string') return true\n      }\n    }\n    return false\n  }\n\n  debug(..._: unknown[]) {}\n\n  make() {\n    const pattern = this.pattern\n    const options = this.options\n\n    // empty patterns and comments match nothing.\n    if (!options.nocomment && pattern.charAt(0) === '#') {\n      this.comment = true\n      return\n    }\n\n    if (!pattern) {\n      this.empty = true\n      return\n    }\n\n    // step 1: figure out negation, etc.\n    this.parseNegate()\n\n    // step 2: expand braces\n    this.globSet = [...new Set(this.braceExpand())]\n\n    if (options.debug) {\n      //oxlint-disable-next-line no-console\n      this.debug = (...args: unknown[]) => console.error(...args)\n    }\n\n    this.debug(this.pattern, this.globSet)\n\n    // step 3: now we have a set, so turn each one into a series of\n    // path-portion matching patterns.\n    // These will be regexps, except in the case of \"**\", which is\n    // set to the GLOBSTAR object for globstar behavior,\n    // and will not contain any / characters\n    //\n    // First, we preprocess to make the glob pattern sets a bit simpler\n    // and deduped.  There are some perf-killing patterns that can cause\n    // problems with a glob walk, but we can simplify them down a bit.\n    const rawGlobParts = this.globSet.map(s => this.slashSplit(s))\n    this.globParts = this.preprocess(rawGlobParts)\n    this.debug(this.pattern, this.globParts)\n\n    // glob --> regexps\n    let set = this.globParts.map((s, _, __) => {\n      if (this.isWindows && this.windowsNoMagicRoot) {\n        // check if it's a drive or unc path.\n        const isUNC =\n          s[0] === '' &&\n          s[1] === '' &&\n          (s[2] === '?' || !globMagic.test(s[2])) &&\n          !globMagic.test(s[3])\n        const isDrive = /^[a-z]:/i.test(s[0])\n        if (isUNC) {\n          return [\n            ...s.slice(0, 4),\n            ...s.slice(4).map(ss => this.parse(ss)),\n          ]\n        } else if (isDrive) {\n          return [s[0], ...s.slice(1).map(ss => this.parse(ss))]\n        }\n      }\n      return s.map(ss => this.parse(ss))\n    })\n\n    this.debug(this.pattern, set)\n\n    // filter out everything that didn't compile properly.\n    this.set = set.filter(\n      s => s.indexOf(false) === -1,\n    ) as ParseReturnFiltered[][]\n\n    // do not treat the ? in UNC paths as magic\n    if (this.isWindows) {\n      for (let i = 0; i < this.set.length; i++) {\n        const p = this.set[i]\n        if (\n          p[0] === '' &&\n          p[1] === '' &&\n          this.globParts[i][2] === '?' &&\n          typeof p[3] === 'string' &&\n          /^[a-z]:$/i.test(p[3])\n        ) {\n          p[2] = '?'\n        }\n      }\n    }\n\n    this.debug(this.pattern, this.set)\n  }\n\n  // various transforms to equivalent pattern sets that are\n  // faster to process in a filesystem walk.  The goal is to\n  // eliminate what we can, and push all ** patterns as far\n  // to the right as possible, even if it increases the number\n  // of patterns that we have to process.\n  preprocess(globParts: string[][]) {\n    // if we're not in globstar mode, then turn ** into *\n    if (this.options.noglobstar) {\n      for (const partset of globParts) {\n        for (let j = 0; j < partset.length; j++) {\n          if (partset[j] === '**') {\n            partset[j] = '*'\n          }\n        }\n      }\n    }\n\n    const { optimizationLevel = 1 } = this.options\n\n    if (optimizationLevel >= 2) {\n      // aggressive optimization for the purpose of fs walking\n      globParts = this.firstPhasePreProcess(globParts)\n      globParts = this.secondPhasePreProcess(globParts)\n    } else if (optimizationLevel >= 1) {\n      // just basic optimizations to remove some .. parts\n      globParts = this.levelOneOptimize(globParts)\n    } else {\n      // just collapse multiple ** portions into one\n      globParts = this.adjascentGlobstarOptimize(globParts)\n    }\n\n    return globParts\n  }\n\n  // just get rid of adjascent ** portions\n  adjascentGlobstarOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      let gs: number = -1\n      while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n        let i = gs\n        while (parts[i + 1] === '**') {\n          i++\n        }\n        if (i !== gs) {\n          parts.splice(gs, i - gs)\n        }\n      }\n      return parts\n    })\n  }\n\n  // get rid of adjascent ** and resolve .. portions\n  levelOneOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      parts = parts.reduce((set: string[], part) => {\n        const prev = set[set.length - 1]\n        if (part === '**' && prev === '**') {\n          return set\n        }\n        if (part === '..') {\n          if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n            set.pop()\n            return set\n          }\n        }\n        set.push(part)\n        return set\n      }, [])\n      return parts.length === 0 ? [''] : parts\n    })\n  }\n\n  levelTwoFileOptimize(parts: string | string[]) {\n    if (!Array.isArray(parts)) {\n      parts = this.slashSplit(parts)\n    }\n    let didSomething: boolean = false\n\n    do {\n      didSomething = false\n      // 
// -> 
/\n      if (!this.preserveMultipleSlashes) {\n        for (let i = 1; i < parts.length - 1; i++) {\n          const p = parts[i]\n          // don't squeeze out UNC patterns\n          if (i === 1 && p === '' && parts[0] === '') continue\n          if (p === '.' || p === '') {\n            didSomething = true\n            parts.splice(i, 1)\n            i--\n          }\n        }\n        if (\n          parts[0] === '.' &&\n          parts.length === 2 &&\n          (parts[1] === '.' || parts[1] === '')\n        ) {\n          didSomething = true\n          parts.pop()\n        }\n      }\n\n      // 
/

/../ ->

/\n      let dd: number = 0\n      while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n        const p = parts[dd - 1]\n        if (\n          p &&\n          p !== '.' &&\n          p !== '..' &&\n          p !== '**' &&\n          !(this.isWindows && /^[a-z]:$/i.test(p))\n        ) {\n          didSomething = true\n          parts.splice(dd - 1, 2)\n          dd -= 2\n        }\n      }\n    } while (didSomething)\n    return parts.length === 0 ? [''] : parts\n  }\n\n  // First phase: single-pattern processing\n  // 
 is 1 or more portions\n  //  is 1 or more portions\n  // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n  // 
/

/../ ->

/\n  // **/**/ -> **/\n  //\n  // **/*/ -> */**/ <== not valid because ** doesn't follow\n  // this WOULD be allowed if ** did follow symlinks, or * didn't\n  firstPhasePreProcess(globParts: string[][]) {\n    let didSomething = false\n    do {\n      didSomething = false\n      // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs: number = -1\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss: number = gs\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n            gss++\n          }\n          // eg, if gs is 2 and gss is 4, that means we have 3 **\n          // parts, and can remove 2 of them.\n          if (gss > gs) {\n            parts.splice(gs + 1, gss - gs)\n          }\n\n          let next = parts[gs + 1]\n          const p = parts[gs + 2]\n          const p2 = parts[gs + 3]\n          if (next !== '..') continue\n          if (\n            !p ||\n            p === '.' ||\n            p === '..' ||\n            !p2 ||\n            p2 === '.' ||\n            p2 === '..'\n          ) {\n            continue\n          }\n          didSomething = true\n          // edit parts in place, and push the new one\n          parts.splice(gs, 1)\n          const other = parts.slice(0)\n          other[gs] = '**'\n          globParts.push(other)\n          gs--\n        }\n\n        // 
// -> 
/\n        if (!this.preserveMultipleSlashes) {\n          for (let i = 1; i < parts.length - 1; i++) {\n            const p = parts[i]\n            // don't squeeze out UNC patterns\n            if (i === 1 && p === '' && parts[0] === '') continue\n            if (p === '.' || p === '') {\n              didSomething = true\n              parts.splice(i, 1)\n              i--\n            }\n          }\n          if (\n            parts[0] === '.' &&\n            parts.length === 2 &&\n            (parts[1] === '.' || parts[1] === '')\n          ) {\n            didSomething = true\n            parts.pop()\n          }\n        }\n\n        // 
/

/../ ->

/\n        let dd: number = 0\n        while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n          const p = parts[dd - 1]\n          if (p && p !== '.' && p !== '..' && p !== '**') {\n            didSomething = true\n            const needDot = dd === 1 && parts[dd + 1] === '**'\n            const splin = needDot ? ['.'] : []\n            parts.splice(dd - 1, 2, ...splin)\n            if (parts.length === 0) parts.push('')\n            dd -= 2\n          }\n        }\n      }\n    } while (didSomething)\n\n    return globParts\n  }\n\n  // second phase: multi-pattern dedupes\n  // {
/*/,
/

/} ->

/*/\n  // {
/,
/} -> 
/\n  // {
/**/,
/} -> 
/**/\n  //\n  // {
/**/,
/**/

/} ->

/**/\n  // ^-- not valid because ** doens't follow symlinks\n  secondPhasePreProcess(globParts: string[][]): string[][] {\n    for (let i = 0; i < globParts.length - 1; i++) {\n      for (let j = i + 1; j < globParts.length; j++) {\n        const matched = this.partsMatch(\n          globParts[i],\n          globParts[j],\n          !this.preserveMultipleSlashes,\n        )\n        if (matched) {\n          globParts[i] = []\n          globParts[j] = matched\n          break\n        }\n      }\n    }\n    return globParts.filter(gs => gs.length)\n  }\n\n  partsMatch(\n    a: string[],\n    b: string[],\n    emptyGSMatch: boolean = false,\n  ): false | string[] {\n    let ai = 0\n    let bi = 0\n    let result: string[] = []\n    let which: string = ''\n    while (ai < a.length && bi < b.length) {\n      if (a[ai] === b[bi]) {\n        result.push(which === 'b' ? b[bi] : a[ai])\n        ai++\n        bi++\n      } else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n        result.push(a[ai])\n        ai++\n      } else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n        result.push(b[bi])\n        bi++\n      } else if (\n        a[ai] === '*' &&\n        b[bi] &&\n        (this.options.dot || !b[bi].startsWith('.')) &&\n        b[bi] !== '**'\n      ) {\n        if (which === 'b') return false\n        which = 'a'\n        result.push(a[ai])\n        ai++\n        bi++\n      } else if (\n        b[bi] === '*' &&\n        a[ai] &&\n        (this.options.dot || !a[ai].startsWith('.')) &&\n        a[ai] !== '**'\n      ) {\n        if (which === 'a') return false\n        which = 'b'\n        result.push(b[bi])\n        ai++\n        bi++\n      } else {\n        return false\n      }\n    }\n    // if we fall out of the loop, it means they two are identical\n    // as long as their lengths match\n    return a.length === b.length && result\n  }\n\n  parseNegate() {\n    if (this.nonegate) return\n\n    const pattern = this.pattern\n    let negate = false\n    let negateOffset = 0\n\n    for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n      negate = !negate\n      negateOffset++\n    }\n\n    if (negateOffset) this.pattern = pattern.slice(negateOffset)\n    this.negate = negate\n  }\n\n  // set partial to true to test if, for example,\n  // \"/a/b\" matches the start of \"/*/b/*/d\"\n  // Partial means, if you run out of file before you run\n  // out of pattern, then that's fine, as long as all\n  // the parts match.\n  matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean = false,\n  ) {\n    let fileStartIndex = 0\n    let patternStartIndex = 0\n\n    // UNC paths like //?/X:/... can match X:/... and vice versa\n    // Drive letters in absolute drive or unc paths are always compared\n    // case-insensitively.\n    if (this.isWindows) {\n      const fileDrive =\n        typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0])\n      const fileUNC =\n        !fileDrive &&\n        file[0] === '' &&\n        file[1] === '' &&\n        file[2] === '?' &&\n        /^[a-z]:$/i.test(file[3])\n\n      const patternDrive =\n        typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0])\n      const patternUNC =\n        !patternDrive &&\n        pattern[0] === '' &&\n        pattern[1] === '' &&\n        pattern[2] === '?' &&\n        typeof pattern[3] === 'string' &&\n        /^[a-z]:$/i.test(pattern[3])\n\n      const fdi =\n        fileUNC ? 3\n        : fileDrive ? 0\n        : undefined\n      const pdi =\n        patternUNC ? 3\n        : patternDrive ? 0\n        : undefined\n      if (typeof fdi === 'number' && typeof pdi === 'number') {\n        const [fd, pd]: [string, string] = [\n          file[fdi],\n          pattern[pdi] as string,\n        ]\n        // start matching at the drive letter index of each\n        if (fd.toLowerCase() === pd.toLowerCase()) {\n          pattern[pdi] = fd\n          patternStartIndex = pdi\n          fileStartIndex = fdi\n        }\n      }\n    }\n\n    // resolve and reduce . and .. portions in the file as well.\n    // don't need to do the second phase, because it's only one string[]\n    const { optimizationLevel = 1 } = this.options\n    if (optimizationLevel >= 2) {\n      file = this.levelTwoFileOptimize(file)\n    }\n\n    if (pattern.includes(GLOBSTAR)) {\n      return this.#matchGlobstar(\n        file,\n        pattern,\n        partial,\n        fileStartIndex,\n        patternStartIndex,\n      )\n    }\n\n    return this.#matchOne(\n      file,\n      pattern,\n      partial,\n      fileStartIndex,\n      patternStartIndex,\n    )\n  }\n\n  #matchGlobstar(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    // split the pattern into head, tail, and middle of ** delimited parts\n    const firstgs = pattern.indexOf(GLOBSTAR, patternIndex)\n    const lastgs = pattern.lastIndexOf(GLOBSTAR)\n\n    // split the pattern up into globstar-delimited sections\n    // the tail has to be at the end, and the others just have\n    // to be found in order from the head.\n    const [head, body, tail] =\n      partial ?\n        [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1),\n          [],\n        ]\n      : [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1, lastgs),\n          pattern.slice(lastgs + 1),\n        ]\n\n    // check the head, from the current file/pattern index.\n    if (head.length) {\n      const fileHead = file.slice(fileIndex, fileIndex + head.length)\n      if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n        return false\n      }\n      fileIndex += head.length\n      patternIndex += head.length\n    }\n    // now we know the head matches!\n\n    // if the last portion is not empty, it MUST match the end\n    // check the tail\n    let fileTailMatch: number = 0\n    if (tail.length) {\n      // if head + tail > file, then we cannot possibly match\n      if (tail.length + fileIndex > file.length) return false\n\n      // try to match the tail\n      let tailStart = file.length - tail.length\n      if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n        fileTailMatch = tail.length\n      } else {\n        // affordance for stuff like a/**/* matching a/b/\n        // if the last file portion is '', and there's more to the pattern\n        // then try without the '' bit.\n        if (\n          file[file.length - 1] !== '' ||\n          fileIndex + tail.length === file.length\n        ) {\n          return false\n        }\n        tailStart--\n        if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n          return false\n        }\n        fileTailMatch = tail.length + 1\n      }\n    }\n\n    // now we know the tail matches!\n\n    // the middle is zero or more portions wrapped in **, possibly\n    // containing more ** sections.\n    // so a/**/b/**/c/**/d has become **/b/**/c/**\n    // if it's empty, it means a/**/b, just verify we have no bad dots\n    // if there's no tail, so it ends on /**, then we must have *something*\n    // after the head, or it's not a matc\n    if (!body.length) {\n      let sawSome = !!fileTailMatch\n      for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n        const f = String(file[i])\n        sawSome = true\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      // in partial mode, we just need to get past all file parts\n      return partial || sawSome\n    }\n\n    // now we know that there's one or more body sections, which can\n    // be matched anywhere from the 0 index (because the head was pruned)\n    // through to the length-fileTailMatch index.\n    // split the body up into sections, and note the minimum index it can\n    // be found at (start with the length of all previous segments)\n    // [section, before, after]\n    const bodySegments: [ParseReturn[], number][] = [[[], 0]]\n    let currentBody: [ParseReturn[], number] = bodySegments[0]\n    let nonGsParts = 0\n    const nonGsPartsSums: number[] = [0]\n    for (const b of body) {\n      if (b === GLOBSTAR) {\n        nonGsPartsSums.push(nonGsParts)\n        currentBody = [[], 0]\n        bodySegments.push(currentBody)\n      } else {\n        currentBody[0].push(b)\n        nonGsParts++\n      }\n    }\n    let i = bodySegments.length - 1\n    const fileLength = file.length - fileTailMatch\n    for (const b of bodySegments) {\n      b[1] = fileLength - ((nonGsPartsSums[i--] as number) + b[0].length)\n    }\n\n    return !!this.#matchGlobStarBodySections(\n      file,\n      bodySegments,\n      fileIndex,\n      0,\n      partial,\n      0,\n      !!fileTailMatch,\n    )\n  }\n\n  // return false for \"nope, not matching\"\n  // return null for \"not matching, cannot keep trying\"\n  #matchGlobStarBodySections(\n    file: string[],\n    // pattern section, last possible position for it\n    bodySegments: [ParseReturn[], number][],\n    fileIndex: number,\n    bodyIndex: number,\n    partial: boolean,\n    globStarDepth: number,\n    sawTail: boolean,\n  ): boolean | null {\n    // take the first body segment, and walk from fileIndex to its \"after\"\n    // value at the end\n    // If it doesn't match at that position, we increment, until we hit\n    // that final possible position, and give up.\n    // If it does match, then advance and try to rest.\n    // If any of them fail we keep walking forward.\n    // this is still a bit recursively painful, but it's more constrained\n    // than previous implementations, because we never test something that\n    // can't possibly be a valid matching condition.\n    const bs = bodySegments[bodyIndex]\n    if (!bs) {\n      // just make sure that there's no bad dots\n      for (let i = fileIndex; i < file.length; i++) {\n        sawTail = true\n        const f = file[i]\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      return sawTail\n    }\n\n    // have a non-globstar body section to test\n    const [body, after] = bs\n    while (fileIndex <= after) {\n      const m = this.#matchOne(\n        file.slice(0, fileIndex + body.length),\n        body,\n        partial,\n        fileIndex,\n        0,\n      )\n      // if limit exceeded, no match. intentional false negative,\n      // acceptable break in correctness for security.\n      if (m && globStarDepth < this.maxGlobstarRecursion) {\n        // match! see if the rest match. if so, we're done!\n        const sub = this.#matchGlobStarBodySections(\n          file,\n          bodySegments,\n          fileIndex + body.length,\n          bodyIndex + 1,\n          partial,\n          globStarDepth + 1,\n          sawTail,\n        )\n        if (sub !== false) {\n          return sub\n        }\n      }\n      const f = file[fileIndex]\n      if (\n        f === '.' ||\n        f === '..' ||\n        (!this.options.dot && f.startsWith('.'))\n      ) {\n        return false\n      }\n\n      fileIndex++\n    }\n    // walked off. no point continuing\n    return partial || null\n  }\n\n  #matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    let fi: number\n    let pi: number\n    let pl: number\n    let fl: number\n    for (\n      fi = fileIndex,\n        pi = patternIndex,\n        fl = file.length,\n        pl = pattern.length;\n      fi < fl && pi < pl;\n      fi++, pi++\n    ) {\n      this.debug('matchOne loop')\n      let p = pattern[pi]\n      let f = file[fi]\n\n      this.debug(pattern, p, f)\n\n      // should be impossible.\n      // some invalid regexp stuff in the set.\n      /* c8 ignore start */\n      if (p === false || p === GLOBSTAR) {\n        return false\n      }\n      /* c8 ignore stop */\n\n      // something other than **\n      // non-magic patterns just have to match exactly\n      // patterns with magic have been turned into regexps.\n      let hit: boolean\n      if (typeof p === 'string') {\n        hit = f === p\n        this.debug('string match', p, f, hit)\n      } else {\n        hit = p.test(f)\n        this.debug('pattern match', p, f, hit)\n      }\n\n      if (!hit) return false\n    }\n\n    // Note: ending in / means that we'll get a final \"\"\n    // at the end of the pattern.  This can only match a\n    // corresponding \"\" at the end of the file.\n    // If the file ends in /, then it can only match a\n    // a pattern that ends in /, unless the pattern just\n    // doesn't have any more for it. But, a/b/ should *not*\n    // match \"a/b/*\", even though \"\" matches against the\n    // [^/]*? pattern, except in partial mode, where it might\n    // simply not be reached yet.\n    // However, a/b/ should still satisfy a/*\n\n    // now either we fell off the end of the pattern, or we're done.\n    if (fi === fl && pi === pl) {\n      // ran out of pattern and filename at the same time.\n      // an exact hit!\n      return true\n    } else if (fi === fl) {\n      // ran out of file, but still had pattern left.\n      // this is ok if we're doing the match as part of\n      // a glob fs traversal.\n      return partial\n    } else if (pi === pl) {\n      // ran out of pattern, still have file left.\n      // this is only acceptable if we're on the very last\n      // empty segment of a file with a trailing slash.\n      // a/* should match a/b/\n      return fi === fl - 1 && file[fi] === ''\n\n      /* c8 ignore start */\n    } else {\n      // should be unreachable.\n      throw new Error('wtf?')\n    }\n    /* c8 ignore stop */\n  }\n\n  braceExpand() {\n    return braceExpand(this.pattern, this.options)\n  }\n\n  parse(pattern: string): ParseReturn {\n    assertValidPattern(pattern)\n\n    const options = this.options\n\n    // shortcuts\n    if (pattern === '**') return GLOBSTAR\n    if (pattern === '') return ''\n\n    // far and away, the most common glob pattern parts are\n    // *, *.*, and *.  Add a fast check method for those.\n    let m: RegExpMatchArray | null\n    let fastTest: null | ((f: string) => boolean) = null\n    if ((m = pattern.match(starRE))) {\n      fastTest = options.dot ? starTestDot : starTest\n    } else if ((m = pattern.match(starDotExtRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            starDotExtTestNocaseDot\n          : starDotExtTestNocase\n        : options.dot ? starDotExtTestDot\n        : starDotExtTest)(m[1])\n    } else if ((m = pattern.match(qmarksRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            qmarksTestNocaseDot\n          : qmarksTestNocase\n        : options.dot ? qmarksTestDot\n        : qmarksTest)(m)\n    } else if ((m = pattern.match(starDotStarRE))) {\n      fastTest = options.dot ? starDotStarTestDot : starDotStarTest\n    } else if ((m = pattern.match(dotStarRE))) {\n      fastTest = dotStarTest\n    }\n\n    const re = AST.fromGlob(pattern, this.options).toMMPattern()\n    if (fastTest && typeof re === 'object') {\n      // Avoids overriding in frozen environments\n      Reflect.defineProperty(re, 'test', { value: fastTest })\n    }\n    return re\n  }\n\n  makeRe() {\n    if (this.regexp || this.regexp === false) return this.regexp\n\n    // at this point, this.set is a 2d array of partial\n    // pattern strings, or \"**\".\n    //\n    // It's better to use .match().  This function shouldn't\n    // be used, really, but it's pretty convenient sometimes,\n    // when you just want to work with a regex.\n    const set = this.set\n\n    if (!set.length) {\n      this.regexp = false\n      return this.regexp\n    }\n    const options = this.options\n\n    const twoStar =\n      options.noglobstar ? star\n      : options.dot ? twoStarDot\n      : twoStarNoDot\n    const flags = new Set(options.nocase ? ['i'] : [])\n\n    // regexpify non-globstar patterns\n    // if ** is only item, then we just do one twoStar\n    // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n    // if ** is last, append (\\/twoStar|) to previous\n    // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n    // then filter out GLOBSTAR symbols\n    let re = set\n      .map(pattern => {\n        const pp: (string | typeof GLOBSTAR)[] = pattern.map(p => {\n          if (p instanceof RegExp) {\n            for (const f of p.flags.split('')) flags.add(f)\n          }\n          return (\n            typeof p === 'string' ? regExpEscape(p)\n            : p === GLOBSTAR ? GLOBSTAR\n            : p._src\n          )\n        }) as (string | typeof GLOBSTAR)[]\n        pp.forEach((p, i) => {\n          const next = pp[i + 1]\n          const prev = pp[i - 1]\n          if (p !== GLOBSTAR || prev === GLOBSTAR) {\n            return\n          }\n          if (prev === undefined) {\n            if (next !== undefined && next !== GLOBSTAR) {\n              pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next\n            } else {\n              pp[i] = twoStar\n            }\n          } else if (next === undefined) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?'\n          } else if (next !== GLOBSTAR) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next\n            pp[i + 1] = GLOBSTAR\n          }\n        })\n        const filtered = pp.filter(p => p !== GLOBSTAR)\n\n        // For partial matches, we need to make the pattern match\n        // any prefix of the full path. We do this by generating\n        // alternative patterns that match progressively longer prefixes.\n        if (this.partial && filtered.length >= 1) {\n          const prefixes: string[] = []\n          for (let i = 1; i <= filtered.length; i++) {\n            prefixes.push(filtered.slice(0, i).join('/'))\n          }\n          return '(?:' + prefixes.join('|') + ')'\n        }\n\n        return filtered.join('/')\n      })\n      .join('|')\n\n    // need to wrap in parens if we had more than one thing with |,\n    // otherwise only the first will be anchored to ^ and the last to $\n    const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', '']\n    // must match entire pattern\n    // ending in a * or ** will make it less strict.\n    re = '^' + open + re + close + '$'\n\n    // In partial mode, '/' should always match as it's a valid prefix for any pattern\n    if (this.partial) {\n      re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$'\n    }\n\n    // can match anything, as long as it's not this.\n    if (this.negate) re = '^(?!' + re + ').+$'\n\n    try {\n      this.regexp = new RegExp(re, [...flags].join(''))\n      /* c8 ignore start */\n    } catch {\n      // should be impossible\n      this.regexp = false\n    }\n    /* c8 ignore stop */\n    return this.regexp\n  }\n\n  slashSplit(p: string) {\n    // if p starts with // on windows, we preserve that\n    // so that UNC paths aren't broken.  Otherwise, any number of\n    // / characters are coalesced into one, unless\n    // preserveMultipleSlashes is set to true.\n    if (this.preserveMultipleSlashes) {\n      return p.split('/')\n    } else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n      // add an extra '' for the one we lose\n      return ['', ...p.split(/\\/+/)]\n    } else {\n      return p.split(/\\/+/)\n    }\n  }\n\n  match(f: string, partial = this.partial) {\n    this.debug('match', f, this.pattern)\n    // short-circuit in the case of busted things.\n    // comments, etc.\n    if (this.comment) {\n      return false\n    }\n    if (this.empty) {\n      return f === ''\n    }\n\n    if (f === '/' && partial) {\n      return true\n    }\n\n    const options = this.options\n\n    // windows: need to use /, not \\\n    if (this.isWindows) {\n      f = f.split('\\\\').join('/')\n    }\n\n    // treat the test path as a set of pathparts.\n    const ff = this.slashSplit(f)\n    this.debug(this.pattern, 'split', ff)\n\n    // just ONE of the pattern sets in this.set needs to match\n    // in order for it to be valid.  If negating, then just one\n    // match means that we have failed.\n    // Either way, return on the first hit.\n\n    const set = this.set\n    this.debug(this.pattern, 'set', set)\n\n    // Find the basename of the path by looking for the last non-empty segment\n    let filename: string = ff[ff.length - 1]\n    if (!filename) {\n      for (let i = ff.length - 2; !filename && i >= 0; i--) {\n        filename = ff[i]\n      }\n    }\n\n    for (const pattern of set) {\n      let file = ff\n      if (options.matchBase && pattern.length === 1) {\n        file = [filename]\n      }\n      const hit = this.matchOne(file, pattern, partial)\n      if (hit) {\n        if (options.flipNegate) {\n          return true\n        }\n        return !this.negate\n      }\n    }\n\n    // didn't get any hits.  this is success if it's a negative\n    // pattern, failure otherwise.\n    if (options.flipNegate) {\n      return false\n    }\n    return this.negate\n  }\n\n  static defaults(def: MinimatchOptions) {\n    return minimatch.defaults(def).Minimatch\n  }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js'\nexport { escape } from './escape.js'\nexport { unescape } from './unescape.js'\n/* c8 ignore stop */\nminimatch.AST = AST\nminimatch.Minimatch = Minimatch\nminimatch.escape = escape\nminimatch.unescape = unescape\n"]}
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/package.json
new file mode 100644
index 0000000..5bbefff
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/package.json	
@@ -0,0 +1,3 @@
+{
+  "type": "commonjs"
+}
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/unescape.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/unescape.d.ts
new file mode 100644
index 0000000..c4a1447
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/unescape.d.ts	
@@ -0,0 +1,22 @@
+import type { MinimatchOptions } from './index.js';
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+export declare const unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+//# sourceMappingURL=unescape.d.ts.map
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/unescape.d.ts.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/unescape.d.ts.map
new file mode 100644
index 0000000..09d6eab
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/unescape.d.ts.map	
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.d.ts","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAczE,CAAA"}
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/unescape.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/unescape.js
new file mode 100644
index 0000000..ad648fb
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/unescape.js	
@@ -0,0 +1,38 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.unescape = void 0;
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
+    if (magicalBraces) {
+        return windowsPathsNoEscape ?
+            s.replace(/\[([^/\\])\]/g, '$1')
+            : s
+                .replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
+                .replace(/\\([^/])/g, '$1');
+    }
+    return windowsPathsNoEscape ?
+        s.replace(/\[([^/\\{}])\]/g, '$1')
+        : s
+            .replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
+            .replace(/\\([^/{}])/g, '$1');
+};
+exports.unescape = unescape;
+//# sourceMappingURL=unescape.js.map
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/unescape.js.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/unescape.js.map
new file mode 100644
index 0000000..44387ec
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/commonjs/unescape.js.map	
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEI,MAAM,QAAQ,GAAG,CACtB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,IAAI,MACgD,EAAE,EACxE,EAAE;IACF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;YAClC,CAAC,CAAC,CAAC;iBACE,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC;iBAC3C,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;aACE,OAAO,CAAC,4BAA4B,EAAE,MAAM,CAAC;aAC7C,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;AACrC,CAAC,CAAA;AAnBY,QAAA,QAAQ,YAmBpB","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\n\nexport const unescape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n    magicalBraces = true,\n  }: Pick = {},\n) => {\n  if (magicalBraces) {\n    return windowsPathsNoEscape ?\n        s.replace(/\\[([^/\\\\])\\]/g, '$1')\n      : s\n          .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n          .replace(/\\\\([^/])/g, '$1')\n  }\n  return windowsPathsNoEscape ?\n      s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n    : s\n        .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n        .replace(/\\\\([^/{}])/g, '$1')\n}\n"]}
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts
new file mode 100644
index 0000000..34d7a78
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts	
@@ -0,0 +1,2 @@
+export declare const assertValidPattern: (pattern: unknown) => void;
+//# sourceMappingURL=assert-valid-pattern.d.ts.map
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map
new file mode 100644
index 0000000..30ddcd5
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map	
@@ -0,0 +1 @@
+{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAUtD,CAAA"}
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/assert-valid-pattern.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/assert-valid-pattern.js
new file mode 100644
index 0000000..7b534fc
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/assert-valid-pattern.js	
@@ -0,0 +1,10 @@
+const MAX_PATTERN_LENGTH = 1024 * 64;
+export const assertValidPattern = (pattern) => {
+    if (typeof pattern !== 'string') {
+        throw new TypeError('invalid pattern');
+    }
+    if (pattern.length > MAX_PATTERN_LENGTH) {
+        throw new TypeError('pattern is too long');
+    }
+};
+//# sourceMappingURL=assert-valid-pattern.js.map
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map
new file mode 100644
index 0000000..550f61d
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map	
@@ -0,0 +1 @@
+{"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AACpC,MAAM,CAAC,MAAM,kBAAkB,GAA+B,CAC5D,OAAgB,EACW,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;IACxC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: unknown) => void = (\n  pattern: unknown,\n): asserts pattern is string => {\n  if (typeof pattern !== 'string') {\n    throw new TypeError('invalid pattern')\n  }\n\n  if (pattern.length > MAX_PATTERN_LENGTH) {\n    throw new TypeError('pattern is too long')\n  }\n}\n"]}
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/ast.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/ast.d.ts
new file mode 100644
index 0000000..74f2cf9
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/ast.d.ts	
@@ -0,0 +1,22 @@
+import type { MinimatchOptions, MMRegExp } from './index.js';
+export type ExtglobType = '!' | '?' | '+' | '*' | '@';
+export declare class AST {
+    #private;
+    type: ExtglobType | null;
+    id: number;
+    get depth(): number;
+    constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions);
+    get hasMagic(): boolean | undefined;
+    toString(): string;
+    push(...parts: (string | AST)[]): void;
+    toJSON(): unknown[];
+    isStart(): boolean;
+    isEnd(): boolean;
+    copyIn(part: AST | string): void;
+    clone(parent: AST): AST;
+    static fromGlob(pattern: string, options?: MinimatchOptions): AST;
+    toMMPattern(): MMRegExp | string;
+    get options(): MinimatchOptions;
+    toRegExpSource(allowDot?: boolean): [re: string, body: string, hasMagic: boolean, uflag: boolean];
+}
+//# sourceMappingURL=ast.d.ts.map
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/ast.d.ts.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/ast.d.ts.map
new file mode 100644
index 0000000..8965fd6
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/ast.d.ts.map	
@@ -0,0 +1 @@
+{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwC5D,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAgJrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IAexB,EAAE,SAAO;IAET,IAAI,KAAK,IAAI,MAAM,CAElB;gBAgBC,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,CAAC,EAAE,GAAG,EACZ,OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IAkDlB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAe/B,MAAM;IAkBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsQjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CA6OjE"}
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/ast.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/ast.js
new file mode 100644
index 0000000..f639546
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/ast.js	
@@ -0,0 +1,841 @@
+// parse a single path portion
+var _a;
+import { parseClass } from './brace-expressions.js';
+import { unescape } from './unescape.js';
+const types = new Set(['!', '?', '+', '*', '@']);
+const isExtglobType = (c) => types.has(c);
+const isExtglobAST = (c) => isExtglobType(c.type);
+// Map of which extglob types can adopt the children of a nested extglob
+//
+// anything but ! can adopt a matching type:
+// +(a|+(b|c)|d) => +(a|b|c|d)
+// *(a|*(b|c)|d) => *(a|b|c|d)
+// @(a|@(b|c)|d) => @(a|b|c|d)
+// ?(a|?(b|c)|d) => ?(a|b|c|d)
+//
+// * can adopt anything, because 0 or repetition is allowed
+// *(a|?(b|c)|d) => *(a|b|c|d)
+// *(a|+(b|c)|d) => *(a|b|c|d)
+// *(a|@(b|c)|d) => *(a|b|c|d)
+//
+// + can adopt @, because 1 or repetition is allowed
+// +(a|@(b|c)|d) => +(a|b|c|d)
+//
+// + and @ CANNOT adopt *, because 0 would be allowed
+// +(a|*(b|c)|d) => would match "", on *(b|c)
+// @(a|*(b|c)|d) => would match "", on *(b|c)
+//
+// + and @ CANNOT adopt ?, because 0 would be allowed
+// +(a|?(b|c)|d) => would match "", on ?(b|c)
+// @(a|?(b|c)|d) => would match "", on ?(b|c)
+//
+// ? can adopt @, because 0 or 1 is allowed
+// ?(a|@(b|c)|d) => ?(a|b|c|d)
+//
+// ? and @ CANNOT adopt * or +, because >1 would be allowed
+// ?(a|*(b|c)|d) => would match bbb on *(b|c)
+// @(a|*(b|c)|d) => would match bbb on *(b|c)
+// ?(a|+(b|c)|d) => would match bbb on +(b|c)
+// @(a|+(b|c)|d) => would match bbb on +(b|c)
+//
+// ! CANNOT adopt ! (nothing else can either)
+// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)
+//
+// ! can adopt @
+// !(a|@(b|c)|d) => !(a|b|c|d)
+//
+// ! CANNOT adopt *
+// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
+//
+// ! CANNOT adopt +
+// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
+//
+// ! CANNOT adopt ?
+// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x"
+const adoptionMap = new Map([
+    ['!', ['@']],
+    ['?', ['?', '@']],
+    ['@', ['@']],
+    ['*', ['*', '+', '?', '@']],
+    ['+', ['+', '@']],
+]);
+// nested extglobs that can be adopted in, but with the addition of
+// a blank '' element.
+const adoptionWithSpaceMap = new Map([
+    ['!', ['?']],
+    ['@', ['?']],
+    ['+', ['?', '*']],
+]);
+// union of the previous two maps
+const adoptionAnyMap = new Map([
+    ['!', ['?', '@']],
+    ['?', ['?', '@']],
+    ['@', ['?', '@']],
+    ['*', ['*', '+', '?', '@']],
+    ['+', ['+', '@', '?', '*']],
+]);
+// Extglobs that can take over their parent if they are the only child
+// the key is parent, value maps child to resulting extglob parent type
+// '@' is omitted because it's a special case. An `@` extglob with a single
+// member can always be usurped by that subpattern.
+const usurpMap = new Map([
+    ['!', new Map([['!', '@']])],
+    [
+        '?',
+        new Map([
+            ['*', '*'],
+            ['+', '*'],
+        ]),
+    ],
+    [
+        '@',
+        new Map([
+            ['!', '!'],
+            ['?', '?'],
+            ['@', '@'],
+            ['*', '*'],
+            ['+', '+'],
+        ]),
+    ],
+    [
+        '+',
+        new Map([
+            ['?', '*'],
+            ['*', '*'],
+        ]),
+    ],
+]);
+// Patterns that get prepended to bind to the start of either the
+// entire string, or just a single path portion, to prevent dots
+// and/or traversal patterns, when needed.
+// Exts don't need the ^ or / bit, because the root binds that already.
+const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
+const startNoDot = '(?!\\.)';
+// characters that indicate a start of pattern needs the "no dots" bit,
+// because a dot *might* be matched. ( is not in the list, because in
+// the case of a child extglob, it will handle the prevention itself.
+const addPatternStart = new Set(['[', '.']);
+// cases where traversal is A-OK, no dot prevention needed
+const justDots = new Set(['..', '.']);
+const reSpecials = new Set('().*{}+?[]^$\\!');
+const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+// any single thing other than /
+const qmark = '[^/]';
+// * => any number of characters
+const star = qmark + '*?';
+// use + when we need to ensure that *something* matches, because the * is
+// the only thing in the path portion.
+const starNoEmpty = qmark + '+?';
+// remove the \ chars that we added if we end up doing a nonmagic compare
+// const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
+let ID = 0;
+export class AST {
+    type;
+    #root;
+    #hasMagic;
+    #uflag = false;
+    #parts = [];
+    #parent;
+    #parentIndex;
+    #negs;
+    #filledNegs = false;
+    #options;
+    #toString;
+    // set to true if it's an extglob with no children
+    // (which really means one child of '')
+    #emptyExt = false;
+    id = ++ID;
+    get depth() {
+        return (this.#parent?.depth ?? -1) + 1;
+    }
+    [Symbol.for('nodejs.util.inspect.custom')]() {
+        return {
+            '@@type': 'AST',
+            id: this.id,
+            type: this.type,
+            root: this.#root.id,
+            parent: this.#parent?.id,
+            depth: this.depth,
+            partsLength: this.#parts.length,
+            parts: this.#parts,
+        };
+    }
+    constructor(type, parent, options = {}) {
+        this.type = type;
+        // extglobs are inherently magical
+        if (type)
+            this.#hasMagic = true;
+        this.#parent = parent;
+        this.#root = this.#parent ? this.#parent.#root : this;
+        this.#options = this.#root === this ? options : this.#root.#options;
+        this.#negs = this.#root === this ? [] : this.#root.#negs;
+        if (type === '!' && !this.#root.#filledNegs)
+            this.#negs.push(this);
+        this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
+    }
+    get hasMagic() {
+        /* c8 ignore start */
+        if (this.#hasMagic !== undefined)
+            return this.#hasMagic;
+        /* c8 ignore stop */
+        for (const p of this.#parts) {
+            if (typeof p === 'string')
+                continue;
+            if (p.type || p.hasMagic)
+                return (this.#hasMagic = true);
+        }
+        // note: will be undefined until we generate the regexp src and find out
+        return this.#hasMagic;
+    }
+    // reconstructs the pattern
+    toString() {
+        return (this.#toString !== undefined ? this.#toString
+            : !this.type ?
+                (this.#toString = this.#parts.map(p => String(p)).join(''))
+                : (this.#toString =
+                    this.type +
+                        '(' +
+                        this.#parts.map(p => String(p)).join('|') +
+                        ')'));
+    }
+    #fillNegs() {
+        /* c8 ignore start */
+        if (this !== this.#root)
+            throw new Error('should only call on root');
+        if (this.#filledNegs)
+            return this;
+        /* c8 ignore stop */
+        // call toString() once to fill this out
+        this.toString();
+        this.#filledNegs = true;
+        let n;
+        while ((n = this.#negs.pop())) {
+            if (n.type !== '!')
+                continue;
+            // walk up the tree, appending everthing that comes AFTER parentIndex
+            let p = n;
+            let pp = p.#parent;
+            while (pp) {
+                for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
+                    for (const part of n.#parts) {
+                        /* c8 ignore start */
+                        if (typeof part === 'string') {
+                            throw new Error('string part in extglob AST??');
+                        }
+                        /* c8 ignore stop */
+                        part.copyIn(pp.#parts[i]);
+                    }
+                }
+                p = pp;
+                pp = p.#parent;
+            }
+        }
+        return this;
+    }
+    push(...parts) {
+        for (const p of parts) {
+            if (p === '')
+                continue;
+            /* c8 ignore start */
+            if (typeof p !== 'string' &&
+                !(p instanceof _a && p.#parent === this)) {
+                throw new Error('invalid part: ' + p);
+            }
+            /* c8 ignore stop */
+            this.#parts.push(p);
+        }
+    }
+    toJSON() {
+        const ret = this.type === null ?
+            this.#parts
+                .slice()
+                .map(p => (typeof p === 'string' ? p : p.toJSON()))
+            : [this.type, ...this.#parts.map(p => p.toJSON())];
+        if (this.isStart() && !this.type)
+            ret.unshift([]);
+        if (this.isEnd() &&
+            (this === this.#root ||
+                (this.#root.#filledNegs && this.#parent?.type === '!'))) {
+            ret.push({});
+        }
+        return ret;
+    }
+    isStart() {
+        if (this.#root === this)
+            return true;
+        // if (this.type) return !!this.#parent?.isStart()
+        if (!this.#parent?.isStart())
+            return false;
+        if (this.#parentIndex === 0)
+            return true;
+        // if everything AHEAD of this is a negation, then it's still the "start"
+        const p = this.#parent;
+        for (let i = 0; i < this.#parentIndex; i++) {
+            const pp = p.#parts[i];
+            if (!(pp instanceof _a && pp.type === '!')) {
+                return false;
+            }
+        }
+        return true;
+    }
+    isEnd() {
+        if (this.#root === this)
+            return true;
+        if (this.#parent?.type === '!')
+            return true;
+        if (!this.#parent?.isEnd())
+            return false;
+        if (!this.type)
+            return this.#parent?.isEnd();
+        // if not root, it'll always have a parent
+        /* c8 ignore start */
+        const pl = this.#parent ? this.#parent.#parts.length : 0;
+        /* c8 ignore stop */
+        return this.#parentIndex === pl - 1;
+    }
+    copyIn(part) {
+        if (typeof part === 'string')
+            this.push(part);
+        else
+            this.push(part.clone(this));
+    }
+    clone(parent) {
+        const c = new _a(this.type, parent);
+        for (const p of this.#parts) {
+            c.copyIn(p);
+        }
+        return c;
+    }
+    static #parseAST(str, ast, pos, opt, extDepth) {
+        const maxDepth = opt.maxExtglobRecursion ?? 2;
+        let escaping = false;
+        let inBrace = false;
+        let braceStart = -1;
+        let braceNeg = false;
+        if (ast.type === null) {
+            // outside of a extglob, append until we find a start
+            let i = pos;
+            let acc = '';
+            while (i < str.length) {
+                const c = str.charAt(i++);
+                // still accumulate escapes at this point, but we do ignore
+                // starts that are escaped
+                if (escaping || c === '\\') {
+                    escaping = !escaping;
+                    acc += c;
+                    continue;
+                }
+                if (inBrace) {
+                    if (i === braceStart + 1) {
+                        if (c === '^' || c === '!') {
+                            braceNeg = true;
+                        }
+                    }
+                    else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
+                        inBrace = false;
+                    }
+                    acc += c;
+                    continue;
+                }
+                else if (c === '[') {
+                    inBrace = true;
+                    braceStart = i;
+                    braceNeg = false;
+                    acc += c;
+                    continue;
+                }
+                // we don't have to check for adoption here, because that's
+                // done at the other recursion point.
+                const doRecurse = !opt.noext &&
+                    isExtglobType(c) &&
+                    str.charAt(i) === '(' &&
+                    extDepth <= maxDepth;
+                if (doRecurse) {
+                    ast.push(acc);
+                    acc = '';
+                    const ext = new _a(c, ast);
+                    i = _a.#parseAST(str, ext, i, opt, extDepth + 1);
+                    ast.push(ext);
+                    continue;
+                }
+                acc += c;
+            }
+            ast.push(acc);
+            return i;
+        }
+        // some kind of extglob, pos is at the (
+        // find the next | or )
+        let i = pos + 1;
+        let part = new _a(null, ast);
+        const parts = [];
+        let acc = '';
+        while (i < str.length) {
+            const c = str.charAt(i++);
+            // still accumulate escapes at this point, but we do ignore
+            // starts that are escaped
+            if (escaping || c === '\\') {
+                escaping = !escaping;
+                acc += c;
+                continue;
+            }
+            if (inBrace) {
+                if (i === braceStart + 1) {
+                    if (c === '^' || c === '!') {
+                        braceNeg = true;
+                    }
+                }
+                else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
+                    inBrace = false;
+                }
+                acc += c;
+                continue;
+            }
+            else if (c === '[') {
+                inBrace = true;
+                braceStart = i;
+                braceNeg = false;
+                acc += c;
+                continue;
+            }
+            const doRecurse = !opt.noext &&
+                isExtglobType(c) &&
+                str.charAt(i) === '(' &&
+                /* c8 ignore start - the maxDepth is sufficient here */
+                (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));
+            /* c8 ignore stop */
+            if (doRecurse) {
+                const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
+                part.push(acc);
+                acc = '';
+                const ext = new _a(c, part);
+                part.push(ext);
+                i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);
+                continue;
+            }
+            if (c === '|') {
+                part.push(acc);
+                acc = '';
+                parts.push(part);
+                part = new _a(null, ast);
+                continue;
+            }
+            if (c === ')') {
+                if (acc === '' && ast.#parts.length === 0) {
+                    ast.#emptyExt = true;
+                }
+                part.push(acc);
+                acc = '';
+                ast.push(...parts, part);
+                return i;
+            }
+            acc += c;
+        }
+        // unfinished extglob
+        // if we got here, it was a malformed extglob! not an extglob, but
+        // maybe something else in there.
+        ast.type = null;
+        ast.#hasMagic = undefined;
+        ast.#parts = [str.substring(pos - 1)];
+        return i;
+    }
+    #canAdoptWithSpace(child) {
+        return this.#canAdopt(child, adoptionWithSpaceMap);
+    }
+    #canAdopt(child, map = adoptionMap) {
+        if (!child ||
+            typeof child !== 'object' ||
+            child.type !== null ||
+            child.#parts.length !== 1 ||
+            this.type === null) {
+            return false;
+        }
+        const gc = child.#parts[0];
+        if (!gc || typeof gc !== 'object' || gc.type === null) {
+            return false;
+        }
+        return this.#canAdoptType(gc.type, map);
+    }
+    #canAdoptType(c, map = adoptionAnyMap) {
+        return !!map.get(this.type)?.includes(c);
+    }
+    #adoptWithSpace(child, index) {
+        const gc = child.#parts[0];
+        const blank = new _a(null, gc, this.options);
+        blank.#parts.push('');
+        gc.push(blank);
+        this.#adopt(child, index);
+    }
+    #adopt(child, index) {
+        const gc = child.#parts[0];
+        this.#parts.splice(index, 1, ...gc.#parts);
+        for (const p of gc.#parts) {
+            if (typeof p === 'object')
+                p.#parent = this;
+        }
+        this.#toString = undefined;
+    }
+    #canUsurpType(c) {
+        const m = usurpMap.get(this.type);
+        return !!m?.has(c);
+    }
+    #canUsurp(child) {
+        if (!child ||
+            typeof child !== 'object' ||
+            child.type !== null ||
+            child.#parts.length !== 1 ||
+            this.type === null ||
+            this.#parts.length !== 1) {
+            return false;
+        }
+        const gc = child.#parts[0];
+        if (!gc || typeof gc !== 'object' || gc.type === null) {
+            return false;
+        }
+        return this.#canUsurpType(gc.type);
+    }
+    #usurp(child) {
+        const m = usurpMap.get(this.type);
+        const gc = child.#parts[0];
+        const nt = m?.get(gc.type);
+        /* c8 ignore start - impossible */
+        if (!nt)
+            return false;
+        /* c8 ignore stop */
+        this.#parts = gc.#parts;
+        for (const p of this.#parts) {
+            if (typeof p === 'object') {
+                p.#parent = this;
+            }
+        }
+        this.type = nt;
+        this.#toString = undefined;
+        this.#emptyExt = false;
+    }
+    static fromGlob(pattern, options = {}) {
+        const ast = new _a(null, undefined, options);
+        _a.#parseAST(pattern, ast, 0, options, 0);
+        return ast;
+    }
+    // returns the regular expression if there's magic, or the unescaped
+    // string if not.
+    toMMPattern() {
+        // should only be called on root
+        /* c8 ignore start */
+        if (this !== this.#root)
+            return this.#root.toMMPattern();
+        /* c8 ignore stop */
+        const glob = this.toString();
+        const [re, body, hasMagic, uflag] = this.toRegExpSource();
+        // if we're in nocase mode, and not nocaseMagicOnly, then we do
+        // still need a regular expression if we have to case-insensitively
+        // match capital/lowercase characters.
+        const anyMagic = hasMagic ||
+            this.#hasMagic ||
+            (this.#options.nocase &&
+                !this.#options.nocaseMagicOnly &&
+                glob.toUpperCase() !== glob.toLowerCase());
+        if (!anyMagic) {
+            return body;
+        }
+        const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');
+        return Object.assign(new RegExp(`^${re}$`, flags), {
+            _src: re,
+            _glob: glob,
+        });
+    }
+    get options() {
+        return this.#options;
+    }
+    // returns the string match, the regexp source, whether there's magic
+    // in the regexp (so a regular expression is required) and whether or
+    // not the uflag is needed for the regular expression (for posix classes)
+    // TODO: instead of injecting the start/end at this point, just return
+    // the BODY of the regexp, along with the start/end portions suitable
+    // for binding the start/end in either a joined full-path makeRe context
+    // (where we bind to (^|/), or a standalone matchPart context (where
+    // we bind to ^, and not /).  Otherwise slashes get duped!
+    //
+    // In part-matching mode, the start is:
+    // - if not isStart: nothing
+    // - if traversal possible, but not allowed: ^(?!\.\.?$)
+    // - if dots allowed or not possible: ^
+    // - if dots possible and not allowed: ^(?!\.)
+    // end is:
+    // - if not isEnd(): nothing
+    // - else: $
+    //
+    // In full-path matching mode, we put the slash at the START of the
+    // pattern, so start is:
+    // - if first pattern: same as part-matching mode
+    // - if not isStart(): nothing
+    // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
+    // - if dots allowed or not possible: /
+    // - if dots possible and not allowed: /(?!\.)
+    // end is:
+    // - if last pattern, same as part-matching mode
+    // - else nothing
+    //
+    // Always put the (?:$|/) on negated tails, though, because that has to be
+    // there to bind the end of the negated pattern portion, and it's easier to
+    // just stick it in now rather than try to inject it later in the middle of
+    // the pattern.
+    //
+    // We can just always return the same end, and leave it up to the caller
+    // to know whether it's going to be used joined or in parts.
+    // And, if the start is adjusted slightly, can do the same there:
+    // - if not isStart: nothing
+    // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
+    // - if dots allowed or not possible: (?:/|^)
+    // - if dots possible and not allowed: (?:/|^)(?!\.)
+    //
+    // But it's better to have a simpler binding without a conditional, for
+    // performance, so probably better to return both start options.
+    //
+    // Then the caller just ignores the end if it's not the first pattern,
+    // and the start always gets applied.
+    //
+    // But that's always going to be $ if it's the ending pattern, or nothing,
+    // so the caller can just attach $ at the end of the pattern when building.
+    //
+    // So the todo is:
+    // - better detect what kind of start is needed
+    // - return both flavors of starting pattern
+    // - attach $ at the end of the pattern when creating the actual RegExp
+    //
+    // Ah, but wait, no, that all only applies to the root when the first pattern
+    // is not an extglob. If the first pattern IS an extglob, then we need all
+    // that dot prevention biz to live in the extglob portions, because eg
+    // +(*|.x*) can match .xy but not .yx.
+    //
+    // So, return the two flavors if it's #root and the first child is not an
+    // AST, otherwise leave it to the child AST to handle it, and there,
+    // use the (?:^|/) style of start binding.
+    //
+    // Even simplified further:
+    // - Since the start for a join is eg /(?!\.) and the start for a part
+    // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
+    // or start or whatever) and prepend ^ or / at the Regexp construction.
+    toRegExpSource(allowDot) {
+        const dot = allowDot ?? !!this.#options.dot;
+        if (this.#root === this) {
+            this.#flatten();
+            this.#fillNegs();
+        }
+        if (!isExtglobAST(this)) {
+            const noEmpty = this.isStart() &&
+                this.isEnd() &&
+                !this.#parts.some(s => typeof s !== 'string');
+            const src = this.#parts
+                .map(p => {
+                const [re, _, hasMagic, uflag] = typeof p === 'string' ?
+                    _a.#parseGlob(p, this.#hasMagic, noEmpty)
+                    : p.toRegExpSource(allowDot);
+                this.#hasMagic = this.#hasMagic || hasMagic;
+                this.#uflag = this.#uflag || uflag;
+                return re;
+            })
+                .join('');
+            let start = '';
+            if (this.isStart()) {
+                if (typeof this.#parts[0] === 'string') {
+                    // this is the string that will match the start of the pattern,
+                    // so we need to protect against dots and such.
+                    // '.' and '..' cannot match unless the pattern is that exactly,
+                    // even if it starts with . or dot:true is set.
+                    const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
+                    if (!dotTravAllowed) {
+                        const aps = addPatternStart;
+                        // check if we have a possibility of matching . or ..,
+                        // and prevent that.
+                        const needNoTrav = 
+                        // dots are allowed, and the pattern starts with [ or .
+                        (dot && aps.has(src.charAt(0))) ||
+                            // the pattern starts with \., and then [ or .
+                            (src.startsWith('\\.') && aps.has(src.charAt(2))) ||
+                            // the pattern starts with \.\., and then [ or .
+                            (src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
+                        // no need to prevent dots if it can't match a dot, or if a
+                        // sub-pattern will be preventing it anyway.
+                        const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
+                        start =
+                            needNoTrav ? startNoTraversal
+                                : needNoDot ? startNoDot
+                                    : '';
+                    }
+                }
+            }
+            // append the "end of path portion" pattern to negation tails
+            let end = '';
+            if (this.isEnd() &&
+                this.#root.#filledNegs &&
+                this.#parent?.type === '!') {
+                end = '(?:$|\\/)';
+            }
+            const final = start + src + end;
+            return [
+                final,
+                unescape(src),
+                (this.#hasMagic = !!this.#hasMagic),
+                this.#uflag,
+            ];
+        }
+        // We need to calculate the body *twice* if it's a repeat pattern
+        // at the start, once in nodot mode, then again in dot mode, so a
+        // pattern like *(?) can match 'x.y'
+        const repeated = this.type === '*' || this.type === '+';
+        // some kind of extglob
+        const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
+        let body = this.#partsToRegExp(dot);
+        if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
+            // invalid extglob, has to at least be *something* present, if it's
+            // the entire path portion.
+            const s = this.toString();
+            const me = this;
+            me.#parts = [s];
+            me.type = null;
+            me.#hasMagic = undefined;
+            return [s, unescape(this.toString()), false, false];
+        }
+        let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?
+            ''
+            : this.#partsToRegExp(true);
+        if (bodyDotAllowed === body) {
+            bodyDotAllowed = '';
+        }
+        if (bodyDotAllowed) {
+            body = `(?:${body})(?:${bodyDotAllowed})*?`;
+        }
+        // an empty !() is exactly equivalent to a starNoEmpty
+        let final = '';
+        if (this.type === '!' && this.#emptyExt) {
+            final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
+        }
+        else {
+            const close = this.type === '!' ?
+                // !() must match something,but !(x) can match ''
+                '))' +
+                    (this.isStart() && !dot && !allowDot ? startNoDot : '') +
+                    star +
+                    ')'
+                : this.type === '@' ? ')'
+                    : this.type === '?' ? ')?'
+                        : this.type === '+' && bodyDotAllowed ? ')'
+                            : this.type === '*' && bodyDotAllowed ? `)?`
+                                : `)${this.type}`;
+            final = start + body + close;
+        }
+        return [
+            final,
+            unescape(body),
+            (this.#hasMagic = !!this.#hasMagic),
+            this.#uflag,
+        ];
+    }
+    #flatten() {
+        if (!isExtglobAST(this)) {
+            for (const p of this.#parts) {
+                if (typeof p === 'object') {
+                    p.#flatten();
+                }
+            }
+        }
+        else {
+            // do up to 10 passes to flatten as much as possible
+            let iterations = 0;
+            let done = false;
+            do {
+                done = true;
+                for (let i = 0; i < this.#parts.length; i++) {
+                    const c = this.#parts[i];
+                    if (typeof c === 'object') {
+                        c.#flatten();
+                        if (this.#canAdopt(c)) {
+                            done = false;
+                            this.#adopt(c, i);
+                        }
+                        else if (this.#canAdoptWithSpace(c)) {
+                            done = false;
+                            this.#adoptWithSpace(c, i);
+                        }
+                        else if (this.#canUsurp(c)) {
+                            done = false;
+                            this.#usurp(c);
+                        }
+                    }
+                }
+            } while (!done && ++iterations < 10);
+        }
+        this.#toString = undefined;
+    }
+    #partsToRegExp(dot) {
+        return this.#parts
+            .map(p => {
+            // extglob ASTs should only contain parent ASTs
+            /* c8 ignore start */
+            if (typeof p === 'string') {
+                throw new Error('string type in extglob ast??');
+            }
+            /* c8 ignore stop */
+            // can ignore hasMagic, because extglobs are already always magic
+            const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
+            this.#uflag = this.#uflag || uflag;
+            return re;
+        })
+            .filter(p => !(this.isStart() && this.isEnd()) || !!p)
+            .join('|');
+    }
+    static #parseGlob(glob, hasMagic, noEmpty = false) {
+        let escaping = false;
+        let re = '';
+        let uflag = false;
+        // multiple stars that aren't globstars coalesce into one *
+        let inStar = false;
+        for (let i = 0; i < glob.length; i++) {
+            const c = glob.charAt(i);
+            if (escaping) {
+                escaping = false;
+                re += (reSpecials.has(c) ? '\\' : '') + c;
+                continue;
+            }
+            if (c === '*') {
+                if (inStar)
+                    continue;
+                inStar = true;
+                re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
+                hasMagic = true;
+                continue;
+            }
+            else {
+                inStar = false;
+            }
+            if (c === '\\') {
+                if (i === glob.length - 1) {
+                    re += '\\\\';
+                }
+                else {
+                    escaping = true;
+                }
+                continue;
+            }
+            if (c === '[') {
+                const [src, needUflag, consumed, magic] = parseClass(glob, i);
+                if (consumed) {
+                    re += src;
+                    uflag = uflag || needUflag;
+                    i += consumed - 1;
+                    hasMagic = hasMagic || magic;
+                    continue;
+                }
+            }
+            if (c === '?') {
+                re += qmark;
+                hasMagic = true;
+                continue;
+            }
+            re += regExpEscape(c);
+        }
+        return [re, unescape(glob), !!hasMagic, uflag];
+    }
+}
+_a = AST;
+//# sourceMappingURL=ast.js.map
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/ast.js.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/ast.js.map
new file mode 100644
index 0000000..f5cc3ee
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/ast.js.map	
@@ -0,0 +1 @@
+{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAAA,8BAA8B;;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAwCxC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AAC7D,MAAM,aAAa,GAAG,CAAC,CAAgB,EAAoB,EAAE,CAC3D,KAAK,CAAC,GAAG,CAAC,CAAgB,CAAC,CAAA;AAC7B,MAAM,YAAY,GAAG,CAAC,CAAM,EAAoC,EAAE,CAChE,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAEvB,wEAAwE;AACxE,EAAE;AACF,4CAA4C;AAC5C,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,EAAE;AACF,2DAA2D;AAC3D,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,EAAE;AACF,oDAAoD;AACpD,8BAA8B;AAC9B,EAAE;AACF,qDAAqD;AACrD,6CAA6C;AAC7C,6CAA6C;AAC7C,EAAE;AACF,qDAAqD;AACrD,6CAA6C;AAC7C,6CAA6C;AAC7C,EAAE;AACF,2CAA2C;AAC3C,8BAA8B;AAC9B,EAAE;AACF,2DAA2D;AAC3D,6CAA6C;AAC7C,6CAA6C;AAC7C,6CAA6C;AAC7C,6CAA6C;AAC7C,EAAE;AACF,6CAA6C;AAC7C,qEAAqE;AACrE,EAAE;AACF,gBAAgB;AAChB,8BAA8B;AAC9B,EAAE;AACF,mBAAmB;AACnB,8DAA8D;AAC9D,EAAE;AACF,mBAAmB;AACnB,8DAA8D;AAC9D,EAAE;AACF,mBAAmB;AACnB,wDAAwD;AACxD,MAAM,WAAW,GAAG,IAAI,GAAG,CAA6B;IACtD,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CAClB,CAAC,CAAA;AAEF,mEAAmE;AACnE,sBAAsB;AACtB,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAA6B;IAC/D,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CAClB,CAAC,CAAA;AAEF,iCAAiC;AACjC,MAAM,cAAc,GAAG,IAAI,GAAG,CAA6B;IACzD,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CAC5B,CAAC,CAAA;AAEF,sEAAsE;AACtE,uEAAuE;AACvE,2EAA2E;AAC3E,mDAAmD;AACnD,MAAM,QAAQ,GAAG,IAAI,GAAG,CAGtB;IACA,CAAC,GAAG,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5B;QACE,GAAG;QACH,IAAI,GAAG,CAAC;YACN,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,GAAG,EAAE,GAAG,CAAC;SACX,CAAC;KACH;IACD;QACE,GAAG;QACH,IAAI,GAAG,CAAC;YACN,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,GAAG,EAAE,GAAG,CAAC;SACX,CAAC;KACH;IACD;QACE,GAAG;QACH,IAAI,GAAG,CAAC;YACN,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,GAAG,EAAE,GAAG,CAAC;SACX,CAAC;KACH;CACF,CAAC,CAAA;AAEF,iEAAiE;AACjE,gEAAgE;AAChE,0CAA0C;AAC1C,uEAAuE;AACvE,MAAM,gBAAgB,GAAG,2BAA2B,CAAA;AACpD,MAAM,UAAU,GAAG,SAAS,CAAA;AAE5B,uEAAuE;AACvE,qEAAqE;AACrE,qEAAqE;AACrE,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AAC3C,0DAA0D;AAC1D,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAA;AACrC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,iBAAiB,CAAC,CAAA;AAC7C,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CACjC,CAAC,CAAC,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAA;AAE/C,gCAAgC;AAChC,MAAM,KAAK,GAAG,MAAM,CAAA;AAEpB,gCAAgC;AAChC,MAAM,IAAI,GAAG,KAAK,GAAG,IAAI,CAAA;AACzB,0EAA0E;AAC1E,sCAAsC;AACtC,MAAM,WAAW,GAAG,KAAK,GAAG,IAAI,CAAA;AAEhC,yEAAyE;AACzE,2DAA2D;AAE3D,IAAI,EAAE,GAAG,CAAC,CAAA;AACV,MAAM,OAAO,GAAG;IACd,IAAI,CAAoB;IACf,KAAK,CAAK;IAEnB,SAAS,CAAU;IACnB,MAAM,GAAY,KAAK,CAAA;IACvB,MAAM,GAAqB,EAAE,CAAA;IAC7B,OAAO,CAAM;IACb,YAAY,CAAQ;IACpB,KAAK,CAAO;IACZ,WAAW,GAAY,KAAK,CAAA;IAC5B,QAAQ,CAAkB;IAC1B,SAAS,CAAS;IAClB,kDAAkD;IAClD,uCAAuC;IACvC,SAAS,GAAY,KAAK,CAAA;IAC1B,EAAE,GAAG,EAAE,EAAE,CAAA;IAET,IAAI,KAAK;QACP,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IACxC,CAAC;IAED,CAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QACxC,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;YACnB,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE;YACxB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAC/B,KAAK,EAAE,IAAI,CAAC,MAAM;SACnB,CAAA;IACH,CAAC;IAED,YACE,IAAwB,EACxB,MAAY,EACZ,UAA4B,EAAE;QAE9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,kCAAkC;QAClC,IAAI,IAAI;YAAE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;QAC/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;QACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAA;QACnE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAA;QACxD,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW;YAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;IACnE,CAAC;IAED,IAAI,QAAQ;QACV,qBAAqB;QACrB,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC,SAAS,CAAA;QACvD,oBAAoB;QACpB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC5B,IAAI,OAAO,CAAC,KAAK,QAAQ;gBAAE,SAAQ;YACnC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ;gBAAE,OAAO,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAA;QAC1D,CAAC;QACD,wEAAwE;QACxE,OAAO,IAAI,CAAC,SAAS,CAAA;IACvB,CAAC;IAED,2BAA2B;IAC3B,QAAQ;QACN,OAAO,CACL,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS;YAC7C,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACZ,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAC7D,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS;oBACb,IAAI,CAAC,IAAI;wBACT,GAAG;wBACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;wBACzC,GAAG,CAAC,CACT,CAAA;IACH,CAAC;IAED,SAAS;QACP,qBAAqB;QACrB,IAAI,IAAI,KAAK,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACpE,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAA;QACjC,oBAAoB;QAEpB,wCAAwC;QACxC,IAAI,CAAC,QAAQ,EAAE,CAAA;QACf,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA;QACvB,IAAI,CAAkB,CAAA;QACtB,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,CAAC,IAAI,KAAK,GAAG;gBAAE,SAAQ;YAC5B,qEAAqE;YACrE,IAAI,CAAC,GAAoB,CAAC,CAAA;YAC1B,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAA;YAClB,OAAO,EAAE,EAAE,CAAC;gBACV,KACE,IAAI,CAAC,GAAG,CAAC,CAAC,YAAY,GAAG,CAAC,EAC1B,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAChC,CAAC,EAAE,EACH,CAAC;oBACD,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;wBAC5B,qBAAqB;wBACrB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;4BAC7B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;wBACjD,CAAC;wBACD,oBAAoB;wBACpB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;oBAC3B,CAAC;gBACH,CAAC;gBACD,CAAC,GAAG,EAAE,CAAA;gBACN,EAAE,GAAG,CAAC,CAAC,OAAO,CAAA;YAChB,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,CAAC,GAAG,KAAuB;QAC7B,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;YACtB,IAAI,CAAC,KAAK,EAAE;gBAAE,SAAQ;YACtB,qBAAqB;YACrB,IACE,OAAO,CAAC,KAAK,QAAQ;gBACrB,CAAC,CAAC,CAAC,YAAY,EAAG,IAAI,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,EACzC,CAAC;gBACD,MAAM,IAAI,KAAK,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAA;YACvC,CAAC;YACD,oBAAoB;YACpB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACrB,CAAC;IACH,CAAC;IAED,MAAM;QACJ,MAAM,GAAG,GACP,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;YAClB,IAAI,CAAC,MAAM;iBACR,KAAK,EAAE;iBACP,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAE,CAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;QAC7D,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QACjD,IACE,IAAI,CAAC,KAAK,EAAE;YACZ,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK;gBAClB,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC,EACzD,CAAC;YACD,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,IAAI,CAAA;QACpC,kDAAkD;QAClD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE;YAAE,OAAO,KAAK,CAAA;QAC1C,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC;YAAE,OAAO,IAAI,CAAA;QACxC,yEAAyE;QACzE,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAA;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;YACtB,IAAI,CAAC,CAAC,EAAE,YAAY,EAAG,IAAI,EAAE,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;gBAC5C,OAAO,KAAK,CAAA;YACd,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK;QACH,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,IAAI,CAAA;QACpC,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,KAAK,GAAG;YAAE,OAAO,IAAI,CAAA;QAC3C,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE;YAAE,OAAO,KAAK,CAAA;QACxC,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,CAAA;QAC5C,0CAA0C;QAC1C,qBAAqB;QACrB,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;QACxD,oBAAoB;QACpB,OAAO,IAAI,CAAC,YAAY,KAAK,EAAE,GAAG,CAAC,CAAA;IACrC,CAAC;IAED,MAAM,CAAC,IAAkB;QACvB,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;;YACxC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;IAClC,CAAC;IAED,KAAK,CAAC,MAAW;QACf,MAAM,CAAC,GAAG,IAAI,EAAG,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QACpC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC5B,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACb,CAAC;QACD,OAAO,CAAC,CAAA;IACV,CAAC;IAED,MAAM,CAAC,SAAS,CACd,GAAW,EACX,GAAQ,EACR,GAAW,EACX,GAAqB,EACrB,QAAgB;QAEhB,MAAM,QAAQ,GAAG,GAAG,CAAC,mBAAmB,IAAI,CAAC,CAAA;QAC7C,IAAI,QAAQ,GAAG,KAAK,CAAA;QACpB,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,IAAI,UAAU,GAAG,CAAC,CAAC,CAAA;QACnB,IAAI,QAAQ,GAAG,KAAK,CAAA;QACpB,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACtB,qDAAqD;YACrD,IAAI,CAAC,GAAG,GAAG,CAAA;YACX,IAAI,GAAG,GAAG,EAAE,CAAA;YACZ,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;gBACtB,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAA;gBACzB,2DAA2D;gBAC3D,0BAA0B;gBAC1B,IAAI,QAAQ,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;oBAC3B,QAAQ,GAAG,CAAC,QAAQ,CAAA;oBACpB,GAAG,IAAI,CAAC,CAAA;oBACR,SAAQ;gBACV,CAAC;gBAED,IAAI,OAAO,EAAE,CAAC;oBACZ,IAAI,CAAC,KAAK,UAAU,GAAG,CAAC,EAAE,CAAC;wBACzB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;4BAC3B,QAAQ,GAAG,IAAI,CAAA;wBACjB,CAAC;oBACH,CAAC;yBAAM,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU,GAAG,CAAC,IAAI,QAAQ,CAAC,EAAE,CAAC;wBAC5D,OAAO,GAAG,KAAK,CAAA;oBACjB,CAAC;oBACD,GAAG,IAAI,CAAC,CAAA;oBACR,SAAQ;gBACV,CAAC;qBAAM,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;oBACrB,OAAO,GAAG,IAAI,CAAA;oBACd,UAAU,GAAG,CAAC,CAAA;oBACd,QAAQ,GAAG,KAAK,CAAA;oBAChB,GAAG,IAAI,CAAC,CAAA;oBACR,SAAQ;gBACV,CAAC;gBAED,2DAA2D;gBAC3D,qCAAqC;gBACrC,MAAM,SAAS,GACb,CAAC,GAAG,CAAC,KAAK;oBACV,aAAa,CAAC,CAAC,CAAC;oBAChB,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG;oBACrB,QAAQ,IAAI,QAAQ,CAAA;gBACtB,IAAI,SAAS,EAAE,CAAC;oBACd,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;oBACb,GAAG,GAAG,EAAE,CAAA;oBACR,MAAM,GAAG,GAAG,IAAI,EAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;oBAC3B,CAAC,GAAG,EAAG,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAA;oBACjD,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;oBACb,SAAQ;gBACV,CAAC;gBACD,GAAG,IAAI,CAAC,CAAA;YACV,CAAC;YACD,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACb,OAAO,CAAC,CAAA;QACV,CAAC;QAED,wCAAwC;QACxC,uBAAuB;QACvB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAA;QACf,IAAI,IAAI,GAAG,IAAI,EAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QAC7B,MAAM,KAAK,GAAU,EAAE,CAAA;QACvB,IAAI,GAAG,GAAG,EAAE,CAAA;QACZ,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;YACtB,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAA;YACzB,2DAA2D;YAC3D,0BAA0B;YAC1B,IAAI,QAAQ,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC3B,QAAQ,GAAG,CAAC,QAAQ,CAAA;gBACpB,GAAG,IAAI,CAAC,CAAA;gBACR,SAAQ;YACV,CAAC;YAED,IAAI,OAAO,EAAE,CAAC;gBACZ,IAAI,CAAC,KAAK,UAAU,GAAG,CAAC,EAAE,CAAC;oBACzB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;wBAC3B,QAAQ,GAAG,IAAI,CAAA;oBACjB,CAAC;gBACH,CAAC;qBAAM,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU,GAAG,CAAC,IAAI,QAAQ,CAAC,EAAE,CAAC;oBAC5D,OAAO,GAAG,KAAK,CAAA;gBACjB,CAAC;gBACD,GAAG,IAAI,CAAC,CAAA;gBACR,SAAQ;YACV,CAAC;iBAAM,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACrB,OAAO,GAAG,IAAI,CAAA;gBACd,UAAU,GAAG,CAAC,CAAA;gBACd,QAAQ,GAAG,KAAK,CAAA;gBAChB,GAAG,IAAI,CAAC,CAAA;gBACR,SAAQ;YACV,CAAC;YAED,MAAM,SAAS,GACb,CAAC,GAAG,CAAC,KAAK;gBACV,aAAa,CAAC,CAAC,CAAC;gBAChB,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG;gBACrB,uDAAuD;gBACvD,CAAC,QAAQ,IAAI,QAAQ,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACzD,oBAAoB;YACpB,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,QAAQ,GAAG,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;gBACpD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBACd,GAAG,GAAG,EAAE,CAAA;gBACR,MAAM,GAAG,GAAG,IAAI,EAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;gBAC5B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBACd,CAAC,GAAG,EAAG,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAAC,CAAA;gBACxD,SAAQ;YACV,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBACd,GAAG,GAAG,EAAE,CAAA;gBACR,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;gBAChB,IAAI,GAAG,IAAI,EAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;gBACzB,SAAQ;YACV,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,IAAI,GAAG,KAAK,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAC1C,GAAG,CAAC,SAAS,GAAG,IAAI,CAAA;gBACtB,CAAC;gBACD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBACd,GAAG,GAAG,EAAE,CAAA;gBACR,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,CAAA;gBACxB,OAAO,CAAC,CAAA;YACV,CAAC;YACD,GAAG,IAAI,CAAC,CAAA;QACV,CAAC;QAED,qBAAqB;QACrB,kEAAkE;QAClE,iCAAiC;QACjC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAA;QACf,GAAG,CAAC,SAAS,GAAG,SAAS,CAAA;QACzB,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;QACrC,OAAO,CAAC,CAAA;IACV,CAAC;IAED,kBAAkB,CAAC,KAAoB;QAIrC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAA;IACpD,CAAC;IAED,SAAS,CACP,KAAoB,EACpB,MAAuC,WAAW;QAKlD,IACE,CAAC,KAAK;YACN,OAAO,KAAK,KAAK,QAAQ;YACzB,KAAK,CAAC,IAAI,KAAK,IAAI;YACnB,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YACzB,IAAI,CAAC,IAAI,KAAK,IAAI,EAClB,CAAC;YACD,OAAO,KAAK,CAAA;QACd,CAAC;QACD,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAC1B,IAAI,CAAC,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACtD,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAQ,IAAoC,CAAC,aAAa,CACxD,EAAE,CAAC,IAAI,EACP,GAAG,CACJ,CAAA;IACH,CAAC;IACD,aAAa,CACX,CAAS,EACT,MAAuC,cAAc;QAErD,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAmB,CAAC,EAAE,QAAQ,CAAC,CAAgB,CAAC,CAAA;IACxE,CAAC;IAED,eAAe,CAEb,KAEC,EACD,KAAa;QAEb,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAgC,CAAA;QACzD,MAAM,KAAK,GAAG,IAAI,EAAG,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAC7C,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACrB,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACd,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IAC3B,CAAC;IAED,MAAM,CACJ,KAEC,EACD,KAAa;QAEb,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAgC,CAAA;QACzD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA;QAC1C,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC;YAC1B,IAAI,OAAO,CAAC,KAAK,QAAQ;gBAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAAA;QAC7C,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAED,aAAa,CAAC,CAAS;QACrB,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAmB,CAAC,CAAA;QAChD,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAgB,CAAC,CAAA;IACnC,CAAC;IAED,SAAS,CAAC,KAAoB;QAI5B,IACE,CAAC,KAAK;YACN,OAAO,KAAK,KAAK,QAAQ;YACzB,KAAK,CAAC,IAAI,KAAK,IAAI;YACnB,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YACzB,IAAI,CAAC,IAAI,KAAK,IAAI;YAClB,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EACxB,CAAC;YACD,OAAO,KAAK,CAAA;QACd,CAAC;QACD,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAC1B,IAAI,CAAC,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACtD,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAQ,IAAoC,CAAC,aAAa,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;IACrE,CAAC;IAED,MAAM,CAAoC,KAA2B;QACnE,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAmB,CAAC,CAAA;QAChD,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAgC,CAAA;QACzD,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;QAC1B,kCAAkC;QAClC,IAAI,CAAC,EAAE;YAAE,OAAO,KAAK,CAAA;QACrB,oBAAoB;QACpB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,CAAA;QACvB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC5B,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;gBAC1B,CAAC,CAAC,OAAO,GAAG,IAAI,CAAA;YAClB,CAAC;QACH,CAAC;QACD,IAAI,CAAC,IAAI,GAAG,EAAE,CAAA;QACd,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;IACxB,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,OAAe,EAAE,UAA4B,EAAE;QAC7D,MAAM,GAAG,GAAG,IAAI,EAAG,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;QAC7C,EAAG,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;QAC1C,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,oEAAoE;IACpE,iBAAiB;IACjB,WAAW;QACT,gCAAgC;QAChC,qBAAqB;QACrB,IAAI,IAAI,KAAK,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAA;QACxD,oBAAoB;QACpB,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;QAC5B,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;QACzD,+DAA+D;QAC/D,mEAAmE;QACnE,sCAAsC;QACtC,MAAM,QAAQ,GACZ,QAAQ;YACR,IAAI,CAAC,SAAS;YACd,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM;gBACnB,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe;gBAC9B,IAAI,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;QAC9C,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QACpE,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE;YACjD,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,IAAI;SACZ,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAED,qEAAqE;IACrE,qEAAqE;IACrE,yEAAyE;IACzE,sEAAsE;IACtE,qEAAqE;IACrE,wEAAwE;IACxE,oEAAoE;IACpE,0DAA0D;IAC1D,EAAE;IACF,uCAAuC;IACvC,4BAA4B;IAC5B,wDAAwD;IACxD,uCAAuC;IACvC,8CAA8C;IAC9C,UAAU;IACV,4BAA4B;IAC5B,YAAY;IACZ,EAAE;IACF,mEAAmE;IACnE,wBAAwB;IACxB,iDAAiD;IACjD,8BAA8B;IAC9B,8DAA8D;IAC9D,uCAAuC;IACvC,8CAA8C;IAC9C,UAAU;IACV,gDAAgD;IAChD,iBAAiB;IACjB,EAAE;IACF,0EAA0E;IAC1E,2EAA2E;IAC3E,2EAA2E;IAC3E,eAAe;IACf,EAAE;IACF,wEAAwE;IACxE,4DAA4D;IAC5D,iEAAiE;IACjE,4BAA4B;IAC5B,8DAA8D;IAC9D,6CAA6C;IAC7C,oDAAoD;IACpD,EAAE;IACF,uEAAuE;IACvE,gEAAgE;IAChE,EAAE;IACF,sEAAsE;IACtE,qCAAqC;IACrC,EAAE;IACF,0EAA0E;IAC1E,2EAA2E;IAC3E,EAAE;IACF,kBAAkB;IAClB,+CAA+C;IAC/C,4CAA4C;IAC5C,uEAAuE;IACvE,EAAE;IACF,6EAA6E;IAC7E,0EAA0E;IAC1E,sEAAsE;IACtE,sCAAsC;IACtC,EAAE;IACF,yEAAyE;IACzE,oEAAoE;IACpE,0CAA0C;IAC1C,EAAE;IACF,2BAA2B;IAC3B,sEAAsE;IACtE,qEAAqE;IACrE,uEAAuE;IACvE,cAAc,CACZ,QAAkB;QAElB,MAAM,GAAG,GAAG,QAAQ,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAA;QAC3C,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC,QAAQ,EAAE,CAAA;YACf,IAAI,CAAC,SAAS,EAAE,CAAA;QAClB,CAAC;QACD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,MAAM,OAAO,GACX,IAAI,CAAC,OAAO,EAAE;gBACd,IAAI,CAAC,KAAK,EAAE;gBACZ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAA;YAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM;iBACpB,GAAG,CAAC,CAAC,CAAC,EAAE;gBACP,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,GAC5B,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;oBACrB,EAAG,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC;oBAC5C,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAA;gBAC9B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAA;gBAC3C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,KAAK,CAAA;gBAClC,OAAO,EAAE,CAAA;YACX,CAAC,CAAC;iBACD,IAAI,CAAC,EAAE,CAAC,CAAA;YAEX,IAAI,KAAK,GAAG,EAAE,CAAA;YACd,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;gBACnB,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;oBACvC,+DAA+D;oBAC/D,+CAA+C;oBAE/C,gEAAgE;oBAChE,+CAA+C;oBAC/C,MAAM,cAAc,GAClB,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;oBAC1D,IAAI,CAAC,cAAc,EAAE,CAAC;wBACpB,MAAM,GAAG,GAAG,eAAe,CAAA;wBAC3B,sDAAsD;wBACtD,oBAAoB;wBACpB,MAAM,UAAU;wBACd,uDAAuD;wBACvD,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;4BAC/B,8CAA8C;4BAC9C,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;4BACjD,gDAAgD;4BAChD,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;wBACtD,2DAA2D;wBAC3D,4CAA4C;wBAC5C,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;wBAE7D,KAAK;4BACH,UAAU,CAAC,CAAC,CAAC,gBAAgB;gCAC7B,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU;oCACxB,CAAC,CAAC,EAAE,CAAA;oBACR,CAAC;gBACH,CAAC;YACH,CAAC;YAED,6DAA6D;YAC7D,IAAI,GAAG,GAAG,EAAE,CAAA;YACZ,IACE,IAAI,CAAC,KAAK,EAAE;gBACZ,IAAI,CAAC,KAAK,CAAC,WAAW;gBACtB,IAAI,CAAC,OAAO,EAAE,IAAI,KAAK,GAAG,EAC1B,CAAC;gBACD,GAAG,GAAG,WAAW,CAAA;YACnB,CAAC;YACD,MAAM,KAAK,GAAG,KAAK,GAAG,GAAG,GAAG,GAAG,CAAA;YAC/B,OAAO;gBACL,KAAK;gBACL,QAAQ,CAAC,GAAG,CAAC;gBACb,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;gBACnC,IAAI,CAAC,MAAM;aACZ,CAAA;QACH,CAAC;QAED,iEAAiE;QACjE,iEAAiE;QACjE,oCAAoC;QAEpC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,CAAA;QACvD,uBAAuB;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAA;QACrD,IAAI,IAAI,GAAI,IAAoC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAA;QAEpE,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;YACjE,mEAAmE;YACnE,2BAA2B;YAC3B,MAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;YACzB,MAAM,EAAE,GAAG,IAAW,CAAA;YACtB,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAA;YACf,EAAE,CAAC,IAAI,GAAG,IAAI,CAAA;YACd,EAAE,CAAC,SAAS,GAAG,SAAS,CAAA;YACxB,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;QACrD,CAAC;QAED,IAAI,cAAc,GAChB,CAAC,QAAQ,IAAI,QAAQ,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;YAC3C,EAAE;YACJ,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;QAC7B,IAAI,cAAc,KAAK,IAAI,EAAE,CAAC;YAC5B,cAAc,GAAG,EAAE,CAAA;QACrB,CAAC;QACD,IAAI,cAAc,EAAE,CAAC;YACnB,IAAI,GAAG,MAAM,IAAI,OAAO,cAAc,KAAK,CAAA;QAC7C,CAAC;QAED,sDAAsD;QACtD,IAAI,KAAK,GAAG,EAAE,CAAA;QACd,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACxC,KAAK,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,WAAW,CAAA;QAClE,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,GACT,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;gBACjB,iDAAiD;gBACjD,IAAI;oBACJ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;oBACvD,IAAI;oBACJ,GAAG;gBACL,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG;oBACzB,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI;wBAC1B,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,GAAG;4BAC3C,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,IAAI;gCAC5C,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAA;YACnB,KAAK,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA;QAC9B,CAAC;QACD,OAAO;YACL,KAAK;YACL,QAAQ,CAAC,IAAI,CAAC;YACd,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;YACnC,IAAI,CAAC,MAAM;SACZ,CAAA;IACH,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAC5B,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;oBAC1B,CAAC,CAAC,QAAQ,EAAE,CAAA;gBACd,CAAC;YACH,CAAC;QACH,CAAC;aAAM,CAAC;YACN,oDAAoD;YACpD,IAAI,UAAU,GAAG,CAAC,CAAA;YAClB,IAAI,IAAI,GAAG,KAAK,CAAA;YAChB,GAAG,CAAC;gBACF,IAAI,GAAG,IAAI,CAAA;gBACX,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC5C,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;oBACxB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;wBAC1B,CAAC,CAAC,QAAQ,EAAE,CAAA;wBACZ,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;4BACtB,IAAI,GAAG,KAAK,CAAA;4BACZ,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;wBACnB,CAAC;6BAAM,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC;4BACtC,IAAI,GAAG,KAAK,CACX;4BAAC,IAAoC,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;wBAC9D,CAAC;6BAAM,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;4BAC7B,IAAI,GAAG,KAAK,CACX;4BAAC,IAAoC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;wBAClD,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,UAAU,GAAG,EAAE,EAAC;QACtC,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAED,cAAc,CAAoC,GAAY;QAC5D,OAAO,IAAI,CAAC,MAAM;aACf,GAAG,CAAC,CAAC,CAAC,EAAE;YACP,+CAA+C;YAC/C,qBAAqB;YACrB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;YACjD,CAAC;YACD,oBAAoB;YACpB,iEAAiE;YACjE,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAA;YACvD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,KAAK,CAAA;YAClC,OAAO,EAAE,CAAA;QACX,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACrD,IAAI,CAAC,GAAG,CAAC,CAAA;IACd,CAAC;IAED,MAAM,CAAC,UAAU,CACf,IAAY,EACZ,QAA6B,EAC7B,UAAmB,KAAK;QAExB,IAAI,QAAQ,GAAG,KAAK,CAAA;QACpB,IAAI,EAAE,GAAG,EAAE,CAAA;QACX,IAAI,KAAK,GAAG,KAAK,CAAA;QACjB,2DAA2D;QAC3D,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;YACxB,IAAI,QAAQ,EAAE,CAAC;gBACb,QAAQ,GAAG,KAAK,CAAA;gBAChB,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;gBACzC,SAAQ;YACV,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,IAAI,MAAM;oBAAE,SAAQ;gBACpB,MAAM,GAAG,IAAI,CAAA;gBACb,EAAE,IAAI,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAA;gBACzD,QAAQ,GAAG,IAAI,CAAA;gBACf,SAAQ;YACV,CAAC;iBAAM,CAAC;gBACN,MAAM,GAAG,KAAK,CAAA;YAChB,CAAC;YACD,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC1B,EAAE,IAAI,MAAM,CAAA;gBACd,CAAC;qBAAM,CAAC;oBACN,QAAQ,GAAG,IAAI,CAAA;gBACjB,CAAC;gBACD,SAAQ;YACV,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;gBAC7D,IAAI,QAAQ,EAAE,CAAC;oBACb,EAAE,IAAI,GAAG,CAAA;oBACT,KAAK,GAAG,KAAK,IAAI,SAAS,CAAA;oBAC1B,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAA;oBACjB,QAAQ,GAAG,QAAQ,IAAI,KAAK,CAAA;oBAC5B,SAAQ;gBACV,CAAC;YACH,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,EAAE,IAAI,KAAK,CAAA;gBACX,QAAQ,GAAG,IAAI,CAAA;gBACf,SAAQ;YACV,CAAC;YACD,EAAE,IAAI,YAAY,CAAC,CAAC,CAAC,CAAA;QACvB,CAAC;QACD,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAChD,CAAC;CACF","sourcesContent":["// parse a single path portion\n\nimport { parseClass } from './brace-expressions.js'\nimport type { MinimatchOptions, MMRegExp } from './index.js'\nimport { unescape } from './unescape.js'\n\n// classes [] are handled by the parseClass method\n// for positive extglobs, we sub-parse the contents, and combine,\n// with the appropriate regexp close.\n// for negative extglobs, we sub-parse the contents, but then\n// have to include the rest of the pattern, then the parent, etc.,\n// as the thing that cannot be because RegExp negative lookaheads\n// are different from globs.\n//\n// So for example:\n// a@(i|w!(x|y)z|j)b => ^a(i|w((!?(x|y)zb).*)z|j)b$\n//   1   2 3   4 5 6      1   2    3   46      5 6\n//\n// Assembling the extglob requires not just the negated patterns themselves,\n// but also anything following the negative patterns up to the boundary\n// of the current pattern, plus anything following in the parent pattern.\n//\n//\n// So, first, we parse the string into an AST of extglobs, without turning\n// anything into regexps yet.\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y']}, 'z'], ['j']]}, 'b']\n//\n// Then, for all the negative extglobs, we append whatever comes after in\n// each parent as their tail\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y'], 'z', 'b'}, 'z'], ['j']]}, 'b']\n//\n// Lastly, we turn each of these pieces into a regexp, and join\n//\n//                                 v----- .* because there's more following,\n//                                 v    v  otherwise, .+ because it must be\n//                                 v    v  *something* there.\n// ['^a', {@ ['i', 'w(?:(!?(?:x|y).*zb$).*)z', 'j' ]}, 'b$']\n//   copy what follows into here--^^^^^\n// ['^a', '(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)', 'b$']\n// ['^a(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)b$']\n\nexport type ExtglobType = '!' | '?' | '+' | '*' | '@'\nconst types = new Set(['!', '?', '+', '*', '@'])\nconst isExtglobType = (c: string | null): c is ExtglobType =>\n  types.has(c as ExtglobType)\nconst isExtglobAST = (c: AST): c is AST & { type: ExtglobType } =>\n  isExtglobType(c.type)\n\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map([\n  ['!', ['@']],\n  ['?', ['?', '@']],\n  ['@', ['@']],\n  ['*', ['*', '+', '?', '@']],\n  ['+', ['+', '@']],\n])\n\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map([\n  ['!', ['?']],\n  ['@', ['?']],\n  ['+', ['?', '*']],\n])\n\n// union of the previous two maps\nconst adoptionAnyMap = new Map([\n  ['!', ['?', '@']],\n  ['?', ['?', '@']],\n  ['@', ['?', '@']],\n  ['*', ['*', '+', '?', '@']],\n  ['+', ['+', '@', '?', '*']],\n])\n\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map<\n  ExtglobType,\n  Map\n>([\n  ['!', new Map([['!', '@']])],\n  [\n    '?',\n    new Map([\n      ['*', '*'],\n      ['+', '*'],\n    ]),\n  ],\n  [\n    '@',\n    new Map([\n      ['!', '!'],\n      ['?', '?'],\n      ['@', '@'],\n      ['*', '*'],\n      ['+', '+'],\n    ]),\n  ],\n  [\n    '+',\n    new Map([\n      ['?', '*'],\n      ['*', '*'],\n    ]),\n  ],\n])\n\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))'\nconst startNoDot = '(?!\\\\.)'\n\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.'])\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.'])\nconst reSpecials = new Set('().*{}+?[]^$\\\\!')\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// any single thing other than /\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?'\n\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\n\nlet ID = 0\nexport class AST {\n  type: ExtglobType | null\n  readonly #root: AST\n\n  #hasMagic?: boolean\n  #uflag: boolean = false\n  #parts: (string | AST)[] = []\n  #parent?: AST\n  #parentIndex: number\n  #negs: AST[]\n  #filledNegs: boolean = false\n  #options: MinimatchOptions\n  #toString?: string\n  // set to true if it's an extglob with no children\n  // (which really means one child of '')\n  #emptyExt: boolean = false\n  id = ++ID\n\n  get depth(): number {\n    return (this.#parent?.depth ?? -1) + 1\n  }\n\n  [Symbol.for('nodejs.util.inspect.custom')]() {\n    return {\n      '@@type': 'AST',\n      id: this.id,\n      type: this.type,\n      root: this.#root.id,\n      parent: this.#parent?.id,\n      depth: this.depth,\n      partsLength: this.#parts.length,\n      parts: this.#parts,\n    }\n  }\n\n  constructor(\n    type: ExtglobType | null,\n    parent?: AST,\n    options: MinimatchOptions = {},\n  ) {\n    this.type = type\n    // extglobs are inherently magical\n    if (type) this.#hasMagic = true\n    this.#parent = parent\n    this.#root = this.#parent ? this.#parent.#root : this\n    this.#options = this.#root === this ? options : this.#root.#options\n    this.#negs = this.#root === this ? [] : this.#root.#negs\n    if (type === '!' && !this.#root.#filledNegs) this.#negs.push(this)\n    this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0\n  }\n\n  get hasMagic(): boolean | undefined {\n    /* c8 ignore start */\n    if (this.#hasMagic !== undefined) return this.#hasMagic\n    /* c8 ignore stop */\n    for (const p of this.#parts) {\n      if (typeof p === 'string') continue\n      if (p.type || p.hasMagic) return (this.#hasMagic = true)\n    }\n    // note: will be undefined until we generate the regexp src and find out\n    return this.#hasMagic\n  }\n\n  // reconstructs the pattern\n  toString(): string {\n    return (\n      this.#toString !== undefined ? this.#toString\n      : !this.type ?\n        (this.#toString = this.#parts.map(p => String(p)).join(''))\n      : (this.#toString =\n          this.type +\n          '(' +\n          this.#parts.map(p => String(p)).join('|') +\n          ')')\n    )\n  }\n\n  #fillNegs() {\n    /* c8 ignore start */\n    if (this !== this.#root) throw new Error('should only call on root')\n    if (this.#filledNegs) return this\n    /* c8 ignore stop */\n\n    // call toString() once to fill this out\n    this.toString()\n    this.#filledNegs = true\n    let n: AST | undefined\n    while ((n = this.#negs.pop())) {\n      if (n.type !== '!') continue\n      // walk up the tree, appending everthing that comes AFTER parentIndex\n      let p: AST | undefined = n\n      let pp = p.#parent\n      while (pp) {\n        for (\n          let i = p.#parentIndex + 1;\n          !pp.type && i < pp.#parts.length;\n          i++\n        ) {\n          for (const part of n.#parts) {\n            /* c8 ignore start */\n            if (typeof part === 'string') {\n              throw new Error('string part in extglob AST??')\n            }\n            /* c8 ignore stop */\n            part.copyIn(pp.#parts[i])\n          }\n        }\n        p = pp\n        pp = p.#parent\n      }\n    }\n    return this\n  }\n\n  push(...parts: (string | AST)[]) {\n    for (const p of parts) {\n      if (p === '') continue\n      /* c8 ignore start */\n      if (\n        typeof p !== 'string' &&\n        !(p instanceof AST && p.#parent === this)\n      ) {\n        throw new Error('invalid part: ' + p)\n      }\n      /* c8 ignore stop */\n      this.#parts.push(p)\n    }\n  }\n\n  toJSON() {\n    const ret: unknown[] =\n      this.type === null ?\n        this.#parts\n          .slice()\n          .map(p => (typeof p === 'string' ? p : p.toJSON()))\n      : [this.type, ...this.#parts.map(p => (p as AST).toJSON())]\n    if (this.isStart() && !this.type) ret.unshift([])\n    if (\n      this.isEnd() &&\n      (this === this.#root ||\n        (this.#root.#filledNegs && this.#parent?.type === '!'))\n    ) {\n      ret.push({})\n    }\n    return ret\n  }\n\n  isStart(): boolean {\n    if (this.#root === this) return true\n    // if (this.type) return !!this.#parent?.isStart()\n    if (!this.#parent?.isStart()) return false\n    if (this.#parentIndex === 0) return true\n    // if everything AHEAD of this is a negation, then it's still the \"start\"\n    const p = this.#parent\n    for (let i = 0; i < this.#parentIndex; i++) {\n      const pp = p.#parts[i]\n      if (!(pp instanceof AST && pp.type === '!')) {\n        return false\n      }\n    }\n    return true\n  }\n\n  isEnd(): boolean {\n    if (this.#root === this) return true\n    if (this.#parent?.type === '!') return true\n    if (!this.#parent?.isEnd()) return false\n    if (!this.type) return this.#parent?.isEnd()\n    // if not root, it'll always have a parent\n    /* c8 ignore start */\n    const pl = this.#parent ? this.#parent.#parts.length : 0\n    /* c8 ignore stop */\n    return this.#parentIndex === pl - 1\n  }\n\n  copyIn(part: AST | string) {\n    if (typeof part === 'string') this.push(part)\n    else this.push(part.clone(this))\n  }\n\n  clone(parent: AST) {\n    const c = new AST(this.type, parent)\n    for (const p of this.#parts) {\n      c.copyIn(p)\n    }\n    return c\n  }\n\n  static #parseAST(\n    str: string,\n    ast: AST,\n    pos: number,\n    opt: MinimatchOptions,\n    extDepth: number,\n  ): number {\n    const maxDepth = opt.maxExtglobRecursion ?? 2\n    let escaping = false\n    let inBrace = false\n    let braceStart = -1\n    let braceNeg = false\n    if (ast.type === null) {\n      // outside of a extglob, append until we find a start\n      let i = pos\n      let acc = ''\n      while (i < str.length) {\n        const c = str.charAt(i++)\n        // still accumulate escapes at this point, but we do ignore\n        // starts that are escaped\n        if (escaping || c === '\\\\') {\n          escaping = !escaping\n          acc += c\n          continue\n        }\n\n        if (inBrace) {\n          if (i === braceStart + 1) {\n            if (c === '^' || c === '!') {\n              braceNeg = true\n            }\n          } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n            inBrace = false\n          }\n          acc += c\n          continue\n        } else if (c === '[') {\n          inBrace = true\n          braceStart = i\n          braceNeg = false\n          acc += c\n          continue\n        }\n\n        // we don't have to check for adoption here, because that's\n        // done at the other recursion point.\n        const doRecurse =\n          !opt.noext &&\n          isExtglobType(c) &&\n          str.charAt(i) === '(' &&\n          extDepth <= maxDepth\n        if (doRecurse) {\n          ast.push(acc)\n          acc = ''\n          const ext = new AST(c, ast)\n          i = AST.#parseAST(str, ext, i, opt, extDepth + 1)\n          ast.push(ext)\n          continue\n        }\n        acc += c\n      }\n      ast.push(acc)\n      return i\n    }\n\n    // some kind of extglob, pos is at the (\n    // find the next | or )\n    let i = pos + 1\n    let part = new AST(null, ast)\n    const parts: AST[] = []\n    let acc = ''\n    while (i < str.length) {\n      const c = str.charAt(i++)\n      // still accumulate escapes at this point, but we do ignore\n      // starts that are escaped\n      if (escaping || c === '\\\\') {\n        escaping = !escaping\n        acc += c\n        continue\n      }\n\n      if (inBrace) {\n        if (i === braceStart + 1) {\n          if (c === '^' || c === '!') {\n            braceNeg = true\n          }\n        } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n          inBrace = false\n        }\n        acc += c\n        continue\n      } else if (c === '[') {\n        inBrace = true\n        braceStart = i\n        braceNeg = false\n        acc += c\n        continue\n      }\n\n      const doRecurse =\n        !opt.noext &&\n        isExtglobType(c) &&\n        str.charAt(i) === '(' &&\n        /* c8 ignore start - the maxDepth is sufficient here */\n        (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)))\n      /* c8 ignore stop */\n      if (doRecurse) {\n        const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1\n        part.push(acc)\n        acc = ''\n        const ext = new AST(c, part)\n        part.push(ext)\n        i = AST.#parseAST(str, ext, i, opt, extDepth + depthAdd)\n        continue\n      }\n      if (c === '|') {\n        part.push(acc)\n        acc = ''\n        parts.push(part)\n        part = new AST(null, ast)\n        continue\n      }\n      if (c === ')') {\n        if (acc === '' && ast.#parts.length === 0) {\n          ast.#emptyExt = true\n        }\n        part.push(acc)\n        acc = ''\n        ast.push(...parts, part)\n        return i\n      }\n      acc += c\n    }\n\n    // unfinished extglob\n    // if we got here, it was a malformed extglob! not an extglob, but\n    // maybe something else in there.\n    ast.type = null\n    ast.#hasMagic = undefined\n    ast.#parts = [str.substring(pos - 1)]\n    return i\n  }\n\n  #canAdoptWithSpace(child?: AST | string): child is AST & {\n    type: null\n    parts: [AST & { type: ExtglobType }]\n  } {\n    return this.#canAdopt(child, adoptionWithSpaceMap)\n  }\n\n  #canAdopt(\n    child?: AST | string,\n    map: Map = adoptionMap,\n  ): child is AST & {\n    type: null\n    parts: [AST & { type: ExtglobType }]\n  } {\n    if (\n      !child ||\n      typeof child !== 'object' ||\n      child.type !== null ||\n      child.#parts.length !== 1 ||\n      this.type === null\n    ) {\n      return false\n    }\n    const gc = child.#parts[0]\n    if (!gc || typeof gc !== 'object' || gc.type === null) {\n      return false\n    }\n    return (this as AST & { type: ExtglobType }).#canAdoptType(\n      gc.type,\n      map,\n    )\n  }\n  #canAdoptType(\n    c: string,\n    map: Map = adoptionAnyMap,\n  ): c is ExtglobType {\n    return !!map.get(this.type as ExtglobType)?.includes(c as ExtglobType)\n  }\n\n  #adoptWithSpace(\n    this: AST & { type: ExtglobType },\n    child: AST & {\n      type: null\n    },\n    index: number,\n  ) {\n    const gc = child.#parts[0] as AST & { type: ExtglobType }\n    const blank = new AST(null, gc, this.options)\n    blank.#parts.push('')\n    gc.push(blank)\n    this.#adopt(child, index)\n  }\n\n  #adopt(\n    child: AST & {\n      type: null\n    },\n    index: number,\n  ) {\n    const gc = child.#parts[0] as AST & { type: ExtglobType }\n    this.#parts.splice(index, 1, ...gc.#parts)\n    for (const p of gc.#parts) {\n      if (typeof p === 'object') p.#parent = this\n    }\n    this.#toString = undefined\n  }\n\n  #canUsurpType(c: string): boolean {\n    const m = usurpMap.get(this.type as ExtglobType)\n    return !!m?.has(c as ExtglobType)\n  }\n\n  #canUsurp(child?: AST | string): child is AST & {\n    type: null\n    parts: [AST & { type: ExtglobType }]\n  } {\n    if (\n      !child ||\n      typeof child !== 'object' ||\n      child.type !== null ||\n      child.#parts.length !== 1 ||\n      this.type === null ||\n      this.#parts.length !== 1\n    ) {\n      return false\n    }\n    const gc = child.#parts[0]\n    if (!gc || typeof gc !== 'object' || gc.type === null) {\n      return false\n    }\n    return (this as AST & { type: ExtglobType }).#canUsurpType(gc.type)\n  }\n\n  #usurp(this: AST & { type: ExtglobType }, child: AST & { type: null }) {\n    const m = usurpMap.get(this.type as ExtglobType)\n    const gc = child.#parts[0] as AST & { type: ExtglobType }\n    const nt = m?.get(gc.type)\n    /* c8 ignore start - impossible */\n    if (!nt) return false\n    /* c8 ignore stop */\n    this.#parts = gc.#parts\n    for (const p of this.#parts) {\n      if (typeof p === 'object') {\n        p.#parent = this\n      }\n    }\n    this.type = nt\n    this.#toString = undefined\n    this.#emptyExt = false\n  }\n\n  static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n    const ast = new AST(null, undefined, options)\n    AST.#parseAST(pattern, ast, 0, options, 0)\n    return ast\n  }\n\n  // returns the regular expression if there's magic, or the unescaped\n  // string if not.\n  toMMPattern(): MMRegExp | string {\n    // should only be called on root\n    /* c8 ignore start */\n    if (this !== this.#root) return this.#root.toMMPattern()\n    /* c8 ignore stop */\n    const glob = this.toString()\n    const [re, body, hasMagic, uflag] = this.toRegExpSource()\n    // if we're in nocase mode, and not nocaseMagicOnly, then we do\n    // still need a regular expression if we have to case-insensitively\n    // match capital/lowercase characters.\n    const anyMagic =\n      hasMagic ||\n      this.#hasMagic ||\n      (this.#options.nocase &&\n        !this.#options.nocaseMagicOnly &&\n        glob.toUpperCase() !== glob.toLowerCase())\n    if (!anyMagic) {\n      return body\n    }\n\n    const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '')\n    return Object.assign(new RegExp(`^${re}$`, flags), {\n      _src: re,\n      _glob: glob,\n    })\n  }\n\n  get options() {\n    return this.#options\n  }\n\n  // returns the string match, the regexp source, whether there's magic\n  // in the regexp (so a regular expression is required) and whether or\n  // not the uflag is needed for the regular expression (for posix classes)\n  // TODO: instead of injecting the start/end at this point, just return\n  // the BODY of the regexp, along with the start/end portions suitable\n  // for binding the start/end in either a joined full-path makeRe context\n  // (where we bind to (^|/), or a standalone matchPart context (where\n  // we bind to ^, and not /).  Otherwise slashes get duped!\n  //\n  // In part-matching mode, the start is:\n  // - if not isStart: nothing\n  // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n  // - if dots allowed or not possible: ^\n  // - if dots possible and not allowed: ^(?!\\.)\n  // end is:\n  // - if not isEnd(): nothing\n  // - else: $\n  //\n  // In full-path matching mode, we put the slash at the START of the\n  // pattern, so start is:\n  // - if first pattern: same as part-matching mode\n  // - if not isStart(): nothing\n  // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n  // - if dots allowed or not possible: /\n  // - if dots possible and not allowed: /(?!\\.)\n  // end is:\n  // - if last pattern, same as part-matching mode\n  // - else nothing\n  //\n  // Always put the (?:$|/) on negated tails, though, because that has to be\n  // there to bind the end of the negated pattern portion, and it's easier to\n  // just stick it in now rather than try to inject it later in the middle of\n  // the pattern.\n  //\n  // We can just always return the same end, and leave it up to the caller\n  // to know whether it's going to be used joined or in parts.\n  // And, if the start is adjusted slightly, can do the same there:\n  // - if not isStart: nothing\n  // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n  // - if dots allowed or not possible: (?:/|^)\n  // - if dots possible and not allowed: (?:/|^)(?!\\.)\n  //\n  // But it's better to have a simpler binding without a conditional, for\n  // performance, so probably better to return both start options.\n  //\n  // Then the caller just ignores the end if it's not the first pattern,\n  // and the start always gets applied.\n  //\n  // But that's always going to be $ if it's the ending pattern, or nothing,\n  // so the caller can just attach $ at the end of the pattern when building.\n  //\n  // So the todo is:\n  // - better detect what kind of start is needed\n  // - return both flavors of starting pattern\n  // - attach $ at the end of the pattern when creating the actual RegExp\n  //\n  // Ah, but wait, no, that all only applies to the root when the first pattern\n  // is not an extglob. If the first pattern IS an extglob, then we need all\n  // that dot prevention biz to live in the extglob portions, because eg\n  // +(*|.x*) can match .xy but not .yx.\n  //\n  // So, return the two flavors if it's #root and the first child is not an\n  // AST, otherwise leave it to the child AST to handle it, and there,\n  // use the (?:^|/) style of start binding.\n  //\n  // Even simplified further:\n  // - Since the start for a join is eg /(?!\\.) and the start for a part\n  // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n  // or start or whatever) and prepend ^ or / at the Regexp construction.\n  toRegExpSource(\n    allowDot?: boolean,\n  ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n    const dot = allowDot ?? !!this.#options.dot\n    if (this.#root === this) {\n      this.#flatten()\n      this.#fillNegs()\n    }\n    if (!isExtglobAST(this)) {\n      const noEmpty =\n        this.isStart() &&\n        this.isEnd() &&\n        !this.#parts.some(s => typeof s !== 'string')\n      const src = this.#parts\n        .map(p => {\n          const [re, _, hasMagic, uflag] =\n            typeof p === 'string' ?\n              AST.#parseGlob(p, this.#hasMagic, noEmpty)\n            : p.toRegExpSource(allowDot)\n          this.#hasMagic = this.#hasMagic || hasMagic\n          this.#uflag = this.#uflag || uflag\n          return re\n        })\n        .join('')\n\n      let start = ''\n      if (this.isStart()) {\n        if (typeof this.#parts[0] === 'string') {\n          // this is the string that will match the start of the pattern,\n          // so we need to protect against dots and such.\n\n          // '.' and '..' cannot match unless the pattern is that exactly,\n          // even if it starts with . or dot:true is set.\n          const dotTravAllowed =\n            this.#parts.length === 1 && justDots.has(this.#parts[0])\n          if (!dotTravAllowed) {\n            const aps = addPatternStart\n            // check if we have a possibility of matching . or ..,\n            // and prevent that.\n            const needNoTrav =\n              // dots are allowed, and the pattern starts with [ or .\n              (dot && aps.has(src.charAt(0))) ||\n              // the pattern starts with \\., and then [ or .\n              (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n              // the pattern starts with \\.\\., and then [ or .\n              (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)))\n            // no need to prevent dots if it can't match a dot, or if a\n            // sub-pattern will be preventing it anyway.\n            const needNoDot = !dot && !allowDot && aps.has(src.charAt(0))\n\n            start =\n              needNoTrav ? startNoTraversal\n              : needNoDot ? startNoDot\n              : ''\n          }\n        }\n      }\n\n      // append the \"end of path portion\" pattern to negation tails\n      let end = ''\n      if (\n        this.isEnd() &&\n        this.#root.#filledNegs &&\n        this.#parent?.type === '!'\n      ) {\n        end = '(?:$|\\\\/)'\n      }\n      const final = start + src + end\n      return [\n        final,\n        unescape(src),\n        (this.#hasMagic = !!this.#hasMagic),\n        this.#uflag,\n      ]\n    }\n\n    // We need to calculate the body *twice* if it's a repeat pattern\n    // at the start, once in nodot mode, then again in dot mode, so a\n    // pattern like *(?) can match 'x.y'\n\n    const repeated = this.type === '*' || this.type === '+'\n    // some kind of extglob\n    const start = this.type === '!' ? '(?:(?!(?:' : '(?:'\n    let body = (this as AST & { type: ExtglobType }).#partsToRegExp(dot)\n\n    if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n      // invalid extglob, has to at least be *something* present, if it's\n      // the entire path portion.\n      const s = this.toString()\n      const me = this as AST\n      me.#parts = [s]\n      me.type = null\n      me.#hasMagic = undefined\n      return [s, unescape(this.toString()), false, false]\n    }\n\n    let bodyDotAllowed =\n      !repeated || allowDot || dot || !startNoDot ?\n        ''\n      : this.#partsToRegExp(true)\n    if (bodyDotAllowed === body) {\n      bodyDotAllowed = ''\n    }\n    if (bodyDotAllowed) {\n      body = `(?:${body})(?:${bodyDotAllowed})*?`\n    }\n\n    // an empty !() is exactly equivalent to a starNoEmpty\n    let final = ''\n    if (this.type === '!' && this.#emptyExt) {\n      final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty\n    } else {\n      const close =\n        this.type === '!' ?\n          // !() must match something,but !(x) can match ''\n          '))' +\n          (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n          star +\n          ')'\n        : this.type === '@' ? ')'\n        : this.type === '?' ? ')?'\n        : this.type === '+' && bodyDotAllowed ? ')'\n        : this.type === '*' && bodyDotAllowed ? `)?`\n        : `)${this.type}`\n      final = start + body + close\n    }\n    return [\n      final,\n      unescape(body),\n      (this.#hasMagic = !!this.#hasMagic),\n      this.#uflag,\n    ]\n  }\n\n  #flatten() {\n    if (!isExtglobAST(this)) {\n      for (const p of this.#parts) {\n        if (typeof p === 'object') {\n          p.#flatten()\n        }\n      }\n    } else {\n      // do up to 10 passes to flatten as much as possible\n      let iterations = 0\n      let done = false\n      do {\n        done = true\n        for (let i = 0; i < this.#parts.length; i++) {\n          const c = this.#parts[i]\n          if (typeof c === 'object') {\n            c.#flatten()\n            if (this.#canAdopt(c)) {\n              done = false\n              this.#adopt(c, i)\n            } else if (this.#canAdoptWithSpace(c)) {\n              done = false\n              ;(this as AST & { type: ExtglobType }).#adoptWithSpace(c, i)\n            } else if (this.#canUsurp(c)) {\n              done = false\n              ;(this as AST & { type: ExtglobType }).#usurp(c)\n            }\n          }\n        }\n      } while (!done && ++iterations < 10)\n    }\n    this.#toString = undefined\n  }\n\n  #partsToRegExp(this: AST & { type: ExtglobType }, dot: boolean) {\n    return this.#parts\n      .map(p => {\n        // extglob ASTs should only contain parent ASTs\n        /* c8 ignore start */\n        if (typeof p === 'string') {\n          throw new Error('string type in extglob ast??')\n        }\n        /* c8 ignore stop */\n        // can ignore hasMagic, because extglobs are already always magic\n        const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot)\n        this.#uflag = this.#uflag || uflag\n        return re\n      })\n      .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n      .join('|')\n  }\n\n  static #parseGlob(\n    glob: string,\n    hasMagic: boolean | undefined,\n    noEmpty: boolean = false,\n  ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n    let escaping = false\n    let re = ''\n    let uflag = false\n    // multiple stars that aren't globstars coalesce into one *\n    let inStar = false\n    for (let i = 0; i < glob.length; i++) {\n      const c = glob.charAt(i)\n      if (escaping) {\n        escaping = false\n        re += (reSpecials.has(c) ? '\\\\' : '') + c\n        continue\n      }\n      if (c === '*') {\n        if (inStar) continue\n        inStar = true\n        re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star\n        hasMagic = true\n        continue\n      } else {\n        inStar = false\n      }\n      if (c === '\\\\') {\n        if (i === glob.length - 1) {\n          re += '\\\\\\\\'\n        } else {\n          escaping = true\n        }\n        continue\n      }\n      if (c === '[') {\n        const [src, needUflag, consumed, magic] = parseClass(glob, i)\n        if (consumed) {\n          re += src\n          uflag = uflag || needUflag\n          i += consumed - 1\n          hasMagic = hasMagic || magic\n          continue\n        }\n      }\n      if (c === '?') {\n        re += qmark\n        hasMagic = true\n        continue\n      }\n      re += regExpEscape(c)\n    }\n    return [re, unescape(glob), !!hasMagic, uflag]\n  }\n}\n"]}
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/brace-expressions.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/brace-expressions.d.ts
new file mode 100644
index 0000000..b1572de
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/brace-expressions.d.ts	
@@ -0,0 +1,8 @@
+export type ParseClassResult = [
+    src: string,
+    uFlag: boolean,
+    consumed: number,
+    hasMagic: boolean
+];
+export declare const parseClass: (glob: string, position: number) => ParseClassResult;
+//# sourceMappingURL=brace-expressions.d.ts.map
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map
new file mode 100644
index 0000000..09b4c11
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map	
@@ -0,0 +1 @@
+{"version":3,"file":"brace-expressions.d.ts","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AAgCA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,OAAO;CAClB,CAAA;AAQD,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,UAAU,MAAM,KACf,gBA2HF,CAAA"}
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/brace-expressions.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/brace-expressions.js
new file mode 100644
index 0000000..4b49d40
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/brace-expressions.js	
@@ -0,0 +1,146 @@
+// translate the various posix character classes into unicode properties
+// this works across all unicode locales
+// { : [, /u flag required, negated]
+const posixClasses = {
+    '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true],
+    '[:alpha:]': ['\\p{L}\\p{Nl}', true],
+    '[:ascii:]': ['\\x' + '00-\\x' + '7f', false],
+    '[:blank:]': ['\\p{Zs}\\t', true],
+    '[:cntrl:]': ['\\p{Cc}', true],
+    '[:digit:]': ['\\p{Nd}', true],
+    '[:graph:]': ['\\p{Z}\\p{C}', true, true],
+    '[:lower:]': ['\\p{Ll}', true],
+    '[:print:]': ['\\p{C}', true],
+    '[:punct:]': ['\\p{P}', true],
+    '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true],
+    '[:upper:]': ['\\p{Lu}', true],
+    '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true],
+    '[:xdigit:]': ['A-Fa-f0-9', false],
+};
+// only need to escape a few things inside of brace expressions
+// escapes: [ \ ] -
+const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&');
+// escape all regexp magic characters
+const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+// everything has already been escaped, we just have to join
+const rangesToString = (ranges) => ranges.join('');
+// takes a glob string at a posix brace expression, and returns
+// an equivalent regular expression source, and boolean indicating
+// whether the /u flag needs to be applied, and the number of chars
+// consumed to parse the character class.
+// This also removes out of order ranges, and returns ($.) if the
+// entire class just no good.
+export const parseClass = (glob, position) => {
+    const pos = position;
+    /* c8 ignore start */
+    if (glob.charAt(pos) !== '[') {
+        throw new Error('not in a brace expression');
+    }
+    /* c8 ignore stop */
+    const ranges = [];
+    const negs = [];
+    let i = pos + 1;
+    let sawStart = false;
+    let uflag = false;
+    let escaping = false;
+    let negate = false;
+    let endPos = pos;
+    let rangeStart = '';
+    WHILE: while (i < glob.length) {
+        const c = glob.charAt(i);
+        if ((c === '!' || c === '^') && i === pos + 1) {
+            negate = true;
+            i++;
+            continue;
+        }
+        if (c === ']' && sawStart && !escaping) {
+            endPos = i + 1;
+            break;
+        }
+        sawStart = true;
+        if (c === '\\') {
+            if (!escaping) {
+                escaping = true;
+                i++;
+                continue;
+            }
+            // escaped \ char, fall through and treat like normal char
+        }
+        if (c === '[' && !escaping) {
+            // either a posix class, a collation equivalent, or just a [
+            for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
+                if (glob.startsWith(cls, i)) {
+                    // invalid, [a-[] is fine, but not [a-[:alpha]]
+                    if (rangeStart) {
+                        return ['$.', false, glob.length - pos, true];
+                    }
+                    i += cls.length;
+                    if (neg)
+                        negs.push(unip);
+                    else
+                        ranges.push(unip);
+                    uflag = uflag || u;
+                    continue WHILE;
+                }
+            }
+        }
+        // now it's just a normal character, effectively
+        escaping = false;
+        if (rangeStart) {
+            // throw this range away if it's not valid, but others
+            // can still match.
+            if (c > rangeStart) {
+                ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));
+            }
+            else if (c === rangeStart) {
+                ranges.push(braceEscape(c));
+            }
+            rangeStart = '';
+            i++;
+            continue;
+        }
+        // now might be the start of a range.
+        // can be either c-d or c-] or c] or c] at this point
+        if (glob.startsWith('-]', i + 1)) {
+            ranges.push(braceEscape(c + '-'));
+            i += 2;
+            continue;
+        }
+        if (glob.startsWith('-', i + 1)) {
+            rangeStart = c;
+            i += 2;
+            continue;
+        }
+        // not the start of a range, just a single character
+        ranges.push(braceEscape(c));
+        i++;
+    }
+    if (endPos < i) {
+        // didn't see the end of the class, not a valid class,
+        // but might still be valid as a literal match.
+        return ['', false, 0, false];
+    }
+    // if we got no ranges and no negates, then we have a range that
+    // cannot possibly match anything, and that poisons the whole glob
+    if (!ranges.length && !negs.length) {
+        return ['$.', false, glob.length - pos, true];
+    }
+    // if we got one positive range, and it's a single character, then that's
+    // not actually a magic pattern, it's just that one literal character.
+    // we should not treat that as "magic", we should just return the literal
+    // character. [_] is a perfectly valid way to escape glob magic chars.
+    if (negs.length === 0 &&
+        ranges.length === 1 &&
+        /^\\?.$/.test(ranges[0]) &&
+        !negate) {
+        const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
+        return [regexpEscape(r), false, endPos - pos, false];
+    }
+    const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';
+    const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';
+    const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'
+        : ranges.length ? sranges
+            : snegs;
+    return [comb, uflag, endPos - pos, true];
+};
+//# sourceMappingURL=brace-expressions.js.map
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/brace-expressions.js.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/brace-expressions.js.map
new file mode 100644
index 0000000..184b5a8
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/brace-expressions.js.map	
@@ -0,0 +1 @@
+{"version":3,"file":"brace-expressions.js","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,wCAAwC;AAExC,8DAA8D;AAC9D,MAAM,YAAY,GAChB;IACE,WAAW,EAAE,CAAC,sBAAsB,EAAE,IAAI,CAAC;IAC3C,WAAW,EAAE,CAAC,eAAe,EAAE,IAAI,CAAC;IACpC,WAAW,EAAE,CAAC,KAAK,GAAG,QAAQ,GAAG,IAAI,EAAE,KAAK,CAAC;IAC7C,WAAW,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC;IACjC,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC;IACzC,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;IAC7B,WAAW,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;IAC7B,WAAW,EAAE,CAAC,uBAAuB,EAAE,IAAI,CAAC;IAC5C,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,UAAU,EAAE,CAAC,6BAA6B,EAAE,IAAI,CAAC;IACjD,YAAY,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC;CACnC,CAAA;AAEH,+DAA+D;AAC/D,mBAAmB;AACnB,MAAM,WAAW,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;AACjE,qCAAqC;AACrC,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CACjC,CAAC,CAAC,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAA;AAE/C,4DAA4D;AAC5D,MAAM,cAAc,GAAG,CAAC,MAAgB,EAAU,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AASpE,+DAA+D;AAC/D,kEAAkE;AAClE,mEAAmE;AACnE,yCAAyC;AACzC,iEAAiE;AACjE,6BAA6B;AAC7B,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,IAAY,EACZ,QAAgB,EACE,EAAE;IACpB,MAAM,GAAG,GAAG,QAAQ,CAAA;IACpB,qBAAqB;IACrB,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;IAC9C,CAAC;IACD,oBAAoB;IACpB,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,MAAM,IAAI,GAAa,EAAE,CAAA;IAEzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAA;IACf,IAAI,QAAQ,GAAG,KAAK,CAAA;IACpB,IAAI,KAAK,GAAG,KAAK,CAAA;IACjB,IAAI,QAAQ,GAAG,KAAK,CAAA;IACpB,IAAI,MAAM,GAAG,KAAK,CAAA;IAClB,IAAI,MAAM,GAAG,GAAG,CAAA;IAChB,IAAI,UAAU,GAAG,EAAE,CAAA;IACnB,KAAK,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC9B,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACxB,IAAI,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,EAAE,CAAC;YAC9C,MAAM,GAAG,IAAI,CAAA;YACb,CAAC,EAAE,CAAA;YACH,SAAQ;QACV,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,QAAQ,IAAI,CAAC,QAAQ,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAA;YACd,MAAK;QACP,CAAC;QAED,QAAQ,GAAG,IAAI,CAAA;QACf,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;YACf,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,QAAQ,GAAG,IAAI,CAAA;gBACf,CAAC,EAAE,CAAA;gBACH,SAAQ;YACV,CAAC;YACD,0DAA0D;QAC5D,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC3B,4DAA4D;YAC5D,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;gBACjE,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;oBAC5B,+CAA+C;oBAC/C,IAAI,UAAU,EAAE,CAAC;wBACf,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;oBAC/C,CAAC;oBACD,CAAC,IAAI,GAAG,CAAC,MAAM,CAAA;oBACf,IAAI,GAAG;wBAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;;wBACnB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;oBACtB,KAAK,GAAG,KAAK,IAAI,CAAC,CAAA;oBAClB,SAAS,KAAK,CAAA;gBAChB,CAAC;YACH,CAAC;QACH,CAAC;QAED,gDAAgD;QAChD,QAAQ,GAAG,KAAK,CAAA;QAChB,IAAI,UAAU,EAAE,CAAC;YACf,sDAAsD;YACtD,mBAAmB;YACnB,IAAI,CAAC,GAAG,UAAU,EAAE,CAAC;gBACnB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;YAC7D,CAAC;iBAAM,IAAI,CAAC,KAAK,UAAU,EAAE,CAAC;gBAC5B,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;YAC7B,CAAC;YACD,UAAU,GAAG,EAAE,CAAA;YACf,CAAC,EAAE,CAAA;YACH,SAAQ;QACV,CAAC;QAED,qCAAqC;QACrC,8DAA8D;QAC9D,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACjC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;YACjC,CAAC,IAAI,CAAC,CAAA;YACN,SAAQ;QACV,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAChC,UAAU,GAAG,CAAC,CAAA;YACd,CAAC,IAAI,CAAC,CAAA;YACN,SAAQ;QACV,CAAC;QAED,oDAAoD;QACpD,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;QAC3B,CAAC,EAAE,CAAA;IACL,CAAC;IAED,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QACf,sDAAsD;QACtD,+CAA+C;QAC/C,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAA;IAC9B,CAAC;IAED,gEAAgE;IAChE,kEAAkE;IAClE,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACnC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;IAC/C,CAAC;IAED,yEAAyE;IACzE,sEAAsE;IACtE,yEAAyE;IACzE,sEAAsE;IACtE,IACE,IAAI,CAAC,MAAM,KAAK,CAAC;QACjB,MAAM,CAAC,MAAM,KAAK,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACxB,CAAC,MAAM,EACP,CAAC;QACD,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAClE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,KAAK,CAAC,CAAA;IACtD,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,GAAG,CAAA;IACxE,MAAM,KAAK,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACpE,MAAM,IAAI,GACR,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG;QAChE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;YACzB,CAAC,CAAC,KAAK,CAAA;IAET,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC,CAAA","sourcesContent":["// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n\n// { : [, /u flag required, negated]\nconst posixClasses: { [k: string]: [e: string, u: boolean, n?: boolean] } =\n  {\n    '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n    '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n    '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n    '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n    '[:cntrl:]': ['\\\\p{Cc}', true],\n    '[:digit:]': ['\\\\p{Nd}', true],\n    '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n    '[:lower:]': ['\\\\p{Ll}', true],\n    '[:print:]': ['\\\\p{C}', true],\n    '[:punct:]': ['\\\\p{P}', true],\n    '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n    '[:upper:]': ['\\\\p{Lu}', true],\n    '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n    '[:xdigit:]': ['A-Fa-f0-9', false],\n  }\n\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s: string) => s.replace(/[[\\]\\\\-]/g, '\\\\$&')\n// escape all regexp magic characters\nconst regexpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges: string[]): string => ranges.join('')\n\nexport type ParseClassResult = [\n  src: string,\n  uFlag: boolean,\n  consumed: number,\n  hasMagic: boolean,\n]\n\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (\n  glob: string,\n  position: number,\n): ParseClassResult => {\n  const pos = position\n  /* c8 ignore start */\n  if (glob.charAt(pos) !== '[') {\n    throw new Error('not in a brace expression')\n  }\n  /* c8 ignore stop */\n  const ranges: string[] = []\n  const negs: string[] = []\n\n  let i = pos + 1\n  let sawStart = false\n  let uflag = false\n  let escaping = false\n  let negate = false\n  let endPos = pos\n  let rangeStart = ''\n  WHILE: while (i < glob.length) {\n    const c = glob.charAt(i)\n    if ((c === '!' || c === '^') && i === pos + 1) {\n      negate = true\n      i++\n      continue\n    }\n\n    if (c === ']' && sawStart && !escaping) {\n      endPos = i + 1\n      break\n    }\n\n    sawStart = true\n    if (c === '\\\\') {\n      if (!escaping) {\n        escaping = true\n        i++\n        continue\n      }\n      // escaped \\ char, fall through and treat like normal char\n    }\n    if (c === '[' && !escaping) {\n      // either a posix class, a collation equivalent, or just a [\n      for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n        if (glob.startsWith(cls, i)) {\n          // invalid, [a-[] is fine, but not [a-[:alpha]]\n          if (rangeStart) {\n            return ['$.', false, glob.length - pos, true]\n          }\n          i += cls.length\n          if (neg) negs.push(unip)\n          else ranges.push(unip)\n          uflag = uflag || u\n          continue WHILE\n        }\n      }\n    }\n\n    // now it's just a normal character, effectively\n    escaping = false\n    if (rangeStart) {\n      // throw this range away if it's not valid, but others\n      // can still match.\n      if (c > rangeStart) {\n        ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c))\n      } else if (c === rangeStart) {\n        ranges.push(braceEscape(c))\n      }\n      rangeStart = ''\n      i++\n      continue\n    }\n\n    // now might be the start of a range.\n    // can be either c-d or c-] or c] or c] at this point\n    if (glob.startsWith('-]', i + 1)) {\n      ranges.push(braceEscape(c + '-'))\n      i += 2\n      continue\n    }\n    if (glob.startsWith('-', i + 1)) {\n      rangeStart = c\n      i += 2\n      continue\n    }\n\n    // not the start of a range, just a single character\n    ranges.push(braceEscape(c))\n    i++\n  }\n\n  if (endPos < i) {\n    // didn't see the end of the class, not a valid class,\n    // but might still be valid as a literal match.\n    return ['', false, 0, false]\n  }\n\n  // if we got no ranges and no negates, then we have a range that\n  // cannot possibly match anything, and that poisons the whole glob\n  if (!ranges.length && !negs.length) {\n    return ['$.', false, glob.length - pos, true]\n  }\n\n  // if we got one positive range, and it's a single character, then that's\n  // not actually a magic pattern, it's just that one literal character.\n  // we should not treat that as \"magic\", we should just return the literal\n  // character. [_] is a perfectly valid way to escape glob magic chars.\n  if (\n    negs.length === 0 &&\n    ranges.length === 1 &&\n    /^\\\\?.$/.test(ranges[0]) &&\n    !negate\n  ) {\n    const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]\n    return [regexpEscape(r), false, endPos - pos, false]\n  }\n\n  const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'\n  const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'\n  const comb =\n    ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n    : ranges.length ? sranges\n    : snegs\n\n  return [comb, uflag, endPos - pos, true]\n}\n"]}
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/escape.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/escape.d.ts
new file mode 100644
index 0000000..141024a
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/escape.d.ts	
@@ -0,0 +1,15 @@
+import type { MinimatchOptions } from './index.js';
+/**
+ * Escape all magic characters in a glob pattern.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape}
+ * option is used, then characters are escaped by wrapping in `[]`, because
+ * a magic character wrapped in a character class can only be satisfied by
+ * that exact character.  In this mode, `\` is _not_ escaped, because it is
+ * not interpreted as a magic character, but instead as a path separator.
+ *
+ * If the {@link MinimatchOptions.magicalBraces} option is used,
+ * then braces (`{` and `}`) will be escaped.
+ */
+export declare const escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+//# sourceMappingURL=escape.d.ts.map
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/escape.d.ts.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/escape.d.ts.map
new file mode 100644
index 0000000..e167e30
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/escape.d.ts.map	
@@ -0,0 +1 @@
+{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,GACjB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAazE,CAAA"}
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/escape.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/escape.js
new file mode 100644
index 0000000..46d0ec8
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/escape.js	
@@ -0,0 +1,26 @@
+/**
+ * Escape all magic characters in a glob pattern.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape}
+ * option is used, then characters are escaped by wrapping in `[]`, because
+ * a magic character wrapped in a character class can only be satisfied by
+ * that exact character.  In this mode, `\` is _not_ escaped, because it is
+ * not interpreted as a magic character, but instead as a path separator.
+ *
+ * If the {@link MinimatchOptions.magicalBraces} option is used,
+ * then braces (`{` and `}`) will be escaped.
+ */
+export const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {
+    // don't need to escape +@! because we escape the parens
+    // that make those magic, and escaping ! as [!] isn't valid,
+    // because [!]] is a valid glob class meaning not ']'.
+    if (magicalBraces) {
+        return windowsPathsNoEscape ?
+            s.replace(/[?*()[\]{}]/g, '[$&]')
+            : s.replace(/[?*()[\]\\{}]/g, '\\$&');
+    }
+    return windowsPathsNoEscape ?
+        s.replace(/[?*()[\]]/g, '[$&]')
+        : s.replace(/[?*()[\]\\]/g, '\\$&');
+};
+//# sourceMappingURL=escape.js.map
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/escape.js.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/escape.js.map
new file mode 100644
index 0000000..4740508
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/escape.js.map	
@@ -0,0 +1 @@
+{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,KAAK,MAC+C,EAAE,EACxE,EAAE;IACF,wDAAwD;IACxD,4DAA4D;IAC5D,sDAAsD;IACtD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC;YACnC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AACvC,CAAC,CAAA","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character.  In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n    magicalBraces = false,\n  }: Pick = {},\n) => {\n  // don't need to escape +@! because we escape the parens\n  // that make those magic, and escaping ! as [!] isn't valid,\n  // because [!]] is a valid glob class meaning not ']'.\n  if (magicalBraces) {\n    return windowsPathsNoEscape ?\n        s.replace(/[?*()[\\]{}]/g, '[$&]')\n      : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&')\n  }\n  return windowsPathsNoEscape ?\n      s.replace(/[?*()[\\]]/g, '[$&]')\n    : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&')\n}\n"]}
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/index.d.ts
new file mode 100644
index 0000000..7e1fc2e
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/index.d.ts	
@@ -0,0 +1,174 @@
+import { AST } from './ast.js';
+export type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
+export interface MinimatchOptions {
+    /** do not expand `{x,y}` style braces */
+    nobrace?: boolean;
+    /** do not treat patterns starting with `#` as a comment */
+    nocomment?: boolean;
+    /** do not treat patterns starting with `!` as a negation */
+    nonegate?: boolean;
+    /** print LOTS of debugging output */
+    debug?: boolean;
+    /** treat `**` the same as `*` */
+    noglobstar?: boolean;
+    /** do not expand extglobs like `+(a|b)` */
+    noext?: boolean;
+    /** return the pattern if nothing matches */
+    nonull?: boolean;
+    /** treat `\\` as a path separator, not an escape character */
+    windowsPathsNoEscape?: boolean;
+    /**
+     * inverse of {@link MinimatchOptions.windowsPathsNoEscape}
+     * @deprecated
+     */
+    allowWindowsEscape?: boolean;
+    /**
+     * Compare a partial path to a pattern. As long as the parts
+     * of the path that are present are not contradicted by the
+     * pattern, it will be treated as a match. This is useful in
+     * applications where you're walking through a folder structure,
+     * and don't yet have the full path, but want to ensure that you
+     * do not walk down paths that can never be a match.
+     */
+    partial?: boolean;
+    /** allow matches that start with `.` even if the pattern does not */
+    dot?: boolean;
+    /** ignore case */
+    nocase?: boolean;
+    /** ignore case only in wildcard patterns */
+    nocaseMagicOnly?: boolean;
+    /** consider braces to be "magic" for the purpose of `hasMagic` */
+    magicalBraces?: boolean;
+    /**
+     * If set, then patterns without slashes will be matched
+     * against the basename of the path if it contains slashes.
+     * For example, `a?b` would match the path `/xyz/123/acb`, but
+     * not `/xyz/acb/123`.
+     */
+    matchBase?: boolean;
+    /** invert the results of negated matches */
+    flipNegate?: boolean;
+    /** do not collapse multiple `/` into a single `/` */
+    preserveMultipleSlashes?: boolean;
+    /**
+     * A number indicating the level of optimization that should be done
+     * to the pattern prior to parsing and using it for matches.
+     */
+    optimizationLevel?: number;
+    /** operating system platform */
+    platform?: Platform;
+    /**
+     * When a pattern starts with a UNC path or drive letter, and in
+     * `nocase:true` mode, do not convert the root portions of the
+     * pattern into a case-insensitive regular expression, and instead
+     * leave them as strings.
+     *
+     * This is the default when the platform is `win32` and
+     * `nocase:true` is set.
+     */
+    windowsNoMagicRoot?: boolean;
+    /**
+     * max number of `{...}` patterns to expand. Default 100_000.
+     */
+    braceExpandMax?: number;
+    /**
+     * Max number of non-adjacent `**` patterns to recursively walk down.
+     *
+     * The default of 200 is almost certainly high enough for most purposes,
+     * and can handle absurdly excessive patterns.
+     */
+    maxGlobstarRecursion?: number;
+    /**
+     * Max depth to traverse for nested extglobs like `*(a|b|c)`
+     *
+     * Default is 2, which is quite low, but any higher value
+     * swiftly results in punishing performance impacts. Note
+     * that this is *not*  relevant when the globstar types can
+     * be safely coalesced into a single set.
+     *
+     * For example, `*(a|@(b|c)|d)` would be flattened into
+     * `*(a|b|c|d)`. Thus, many common extglobs will retain good
+     * performance and  never hit this limit, even if they are
+     * excessively deep and complicated.
+     *
+     * If the limit is hit, then the extglob characters are simply
+     * not parsed, and the pattern effectively switches into
+     * `noextglob: true` mode for the contents of that nested
+     * sub-pattern. This will typically _not_ result in a match,
+     * but is considered a valid trade-off for security and
+     * performance.
+     */
+    maxExtglobRecursion?: number;
+}
+export declare const minimatch: {
+    (p: string, pattern: string, options?: MinimatchOptions): boolean;
+    sep: Sep;
+    GLOBSTAR: typeof GLOBSTAR;
+    filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
+    defaults: (def: MinimatchOptions) => typeof minimatch;
+    braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
+    makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
+    match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
+    AST: typeof AST;
+    Minimatch: typeof Minimatch;
+    escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+    unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+};
+export type Sep = '\\' | '/';
+export declare const sep: Sep;
+export declare const GLOBSTAR: unique symbol;
+export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
+export declare const defaults: (def: MinimatchOptions) => typeof minimatch;
+export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
+export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
+export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
+export type MMRegExp = RegExp & {
+    _src?: string;
+    _glob?: string;
+};
+export type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR;
+export type ParseReturn = ParseReturnFiltered | false;
+export declare class Minimatch {
+    #private;
+    options: MinimatchOptions;
+    set: ParseReturnFiltered[][];
+    pattern: string;
+    windowsPathsNoEscape: boolean;
+    nonegate: boolean;
+    negate: boolean;
+    comment: boolean;
+    empty: boolean;
+    preserveMultipleSlashes: boolean;
+    partial: boolean;
+    globSet: string[];
+    globParts: string[][];
+    nocase: boolean;
+    isWindows: boolean;
+    platform: Platform;
+    windowsNoMagicRoot: boolean;
+    maxGlobstarRecursion: number;
+    regexp: false | null | MMRegExp;
+    constructor(pattern: string, options?: MinimatchOptions);
+    hasMagic(): boolean;
+    debug(..._: unknown[]): void;
+    make(): void;
+    preprocess(globParts: string[][]): string[][];
+    adjascentGlobstarOptimize(globParts: string[][]): string[][];
+    levelOneOptimize(globParts: string[][]): string[][];
+    levelTwoFileOptimize(parts: string | string[]): string[];
+    firstPhasePreProcess(globParts: string[][]): string[][];
+    secondPhasePreProcess(globParts: string[][]): string[][];
+    partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[];
+    parseNegate(): void;
+    matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean;
+    braceExpand(): string[];
+    parse(pattern: string): ParseReturn;
+    makeRe(): false | MMRegExp;
+    slashSplit(p: string): string[];
+    match(f: string, partial?: boolean): boolean;
+    static defaults(def: MinimatchOptions): typeof Minimatch;
+}
+export { AST } from './ast.js';
+export { escape } from './escape.js';
+export { unescape } from './unescape.js';
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/index.d.ts.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/index.d.ts.map
new file mode 100644
index 0000000..7620db9
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/index.d.ts.map	
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI9B,MAAM,MAAM,QAAQ,GAChB,KAAK,GACL,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,CAAA;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,8DAA8D;IAC9D,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qEAAqE;IACrE,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,kBAAkB;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,4CAA4C;IAC5C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,kEAAkE;IAClE,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,qDAAqD;IACrD,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB;;;;;;;;OAQG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAE7B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,eAAO,MAAM,SAAS;QACjB,MAAM,WACA,MAAM,YACN,gBAAgB;;;sBA4Gf,MAAM,YAAW,gBAAgB,MAC1C,GAAG,MAAM;oBAOkB,gBAAgB,KAAG,OAAO,SAAS;2BAuFtD,MAAM,YACN,gBAAgB;sBA2BK,MAAM,YAAW,gBAAgB;kBAKzD,MAAM,EAAE,WACL,MAAM,YACN,gBAAgB;;;;;CApO1B,CAAA;AAkED,MAAM,MAAM,GAAG,GAAG,IAAI,GAAG,GAAG,CAAA;AAQ5B,eAAO,MAAM,GAAG,KAC+C,CAAA;AAG/D,eAAO,MAAM,QAAQ,eAAwB,CAAA;AAmB7C,eAAO,MAAM,MAAM,GAChB,SAAS,MAAM,EAAE,UAAS,gBAAqB,MAC/C,GAAG,MAAM,YACsB,CAAA;AAMlC,eAAO,MAAM,QAAQ,GAAI,KAAK,gBAAgB,KAAG,OAAO,SAyEvD,CAAA;AAaD,eAAO,MAAM,WAAW,GACtB,SAAS,MAAM,EACf,UAAS,gBAAqB,aAY/B,CAAA;AAeD,eAAO,MAAM,MAAM,GAAI,SAAS,MAAM,EAAE,UAAS,gBAAqB,qBAC5B,CAAA;AAG1C,eAAO,MAAM,KAAK,GAChB,MAAM,MAAM,EAAE,EACd,SAAS,MAAM,EACf,UAAS,gBAAqB,aAQ/B,CAAA;AAQD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,QAAQ,CAAA;AACrE,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,KAAK,CAAA;AAErD,qBAAa,SAAS;;IACpB,OAAO,EAAE,gBAAgB,CAAA;IACzB,GAAG,EAAE,mBAAmB,EAAE,EAAE,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;IAEf,oBAAoB,EAAE,OAAO,CAAA;IAC7B,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,OAAO,CAAA;IACd,uBAAuB,EAAE,OAAO,CAAA;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAA;IACrB,MAAM,EAAE,OAAO,CAAA;IAEf,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,QAAQ,CAAA;IAClB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,oBAAoB,EAAE,MAAM,CAAA;IAE5B,MAAM,EAAE,KAAK,GAAG,IAAI,GAAG,QAAQ,CAAA;gBACnB,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAqC3D,QAAQ,IAAI,OAAO;IAYnB,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE;IAErB,IAAI;IA8FJ,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IA8BhC,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IAiB/C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IAoBtC,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAoE7C,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IA0F1C,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE;IAkBxD,UAAU,CACR,CAAC,EAAE,MAAM,EAAE,EACX,CAAC,EAAE,MAAM,EAAE,EACX,YAAY,GAAE,OAAe,GAC5B,KAAK,GAAG,MAAM,EAAE;IA+CnB,WAAW;IAqBX,QAAQ,CACN,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,WAAW,EAAE,EACtB,OAAO,GAAE,OAAe;IAiX1B,WAAW;IAIX,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IA6CnC,MAAM;IAuGN,UAAU,CAAC,CAAC,EAAE,MAAM;IAepB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,UAAe;IAgEvC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,gBAAgB;CAGtC;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/index.js
new file mode 100644
index 0000000..a5e6fa8
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/index.js	
@@ -0,0 +1,1114 @@
+import { expand } from 'brace-expansion';
+import { assertValidPattern } from './assert-valid-pattern.js';
+import { AST } from './ast.js';
+import { escape } from './escape.js';
+import { unescape } from './unescape.js';
+export const minimatch = (p, pattern, options = {}) => {
+    assertValidPattern(pattern);
+    // shortcut: comments match nothing.
+    if (!options.nocomment && pattern.charAt(0) === '#') {
+        return false;
+    }
+    return new Minimatch(pattern, options).match(p);
+};
+// Optimized checking for the most common glob patterns.
+const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
+const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
+const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
+const starDotExtTestNocase = (ext) => {
+    ext = ext.toLowerCase();
+    return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);
+};
+const starDotExtTestNocaseDot = (ext) => {
+    ext = ext.toLowerCase();
+    return (f) => f.toLowerCase().endsWith(ext);
+};
+const starDotStarRE = /^\*+\.\*+$/;
+const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');
+const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');
+const dotStarRE = /^\.\*+$/;
+const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
+const starRE = /^\*+$/;
+const starTest = (f) => f.length !== 0 && !f.startsWith('.');
+const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
+const qmarksRE = /^\?+([^+@!?*[(]*)?$/;
+const qmarksTestNocase = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExt([$0]);
+    if (!ext)
+        return noext;
+    ext = ext.toLowerCase();
+    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
+};
+const qmarksTestNocaseDot = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExtDot([$0]);
+    if (!ext)
+        return noext;
+    ext = ext.toLowerCase();
+    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
+};
+const qmarksTestDot = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExtDot([$0]);
+    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
+};
+const qmarksTest = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExt([$0]);
+    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
+};
+const qmarksTestNoExt = ([$0]) => {
+    const len = $0.length;
+    return (f) => f.length === len && !f.startsWith('.');
+};
+const qmarksTestNoExtDot = ([$0]) => {
+    const len = $0.length;
+    return (f) => f.length === len && f !== '.' && f !== '..';
+};
+/* c8 ignore start */
+const defaultPlatform = (typeof process === 'object' && process ?
+    (typeof process.env === 'object' &&
+        process.env &&
+        process.env.__MINIMATCH_TESTING_PLATFORM__) ||
+        process.platform
+    : 'posix');
+const path = {
+    win32: { sep: '\\' },
+    posix: { sep: '/' },
+};
+/* c8 ignore stop */
+export const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;
+minimatch.sep = sep;
+export const GLOBSTAR = Symbol('globstar **');
+minimatch.GLOBSTAR = GLOBSTAR;
+// any single thing other than /
+// don't need to escape / when using new RegExp()
+const qmark = '[^/]';
+// * => any number of characters
+const star = qmark + '*?';
+// ** when dots are allowed.  Anything goes, except .. and .
+// not (^ or / followed by one or two dots followed by $ or /),
+// followed by anything, any number of times.
+const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?';
+// not a ^ or / followed by a dot,
+// followed by anything, any number of times.
+const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?';
+export const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
+minimatch.filter = filter;
+const ext = (a, b = {}) => Object.assign({}, a, b);
+export const defaults = (def) => {
+    if (!def || typeof def !== 'object' || !Object.keys(def).length) {
+        return minimatch;
+    }
+    const orig = minimatch;
+    const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
+    return Object.assign(m, {
+        Minimatch: class Minimatch extends orig.Minimatch {
+            constructor(pattern, options = {}) {
+                super(pattern, ext(def, options));
+            }
+            static defaults(options) {
+                return orig.defaults(ext(def, options)).Minimatch;
+            }
+        },
+        AST: class AST extends orig.AST {
+            /* c8 ignore start */
+            constructor(type, parent, options = {}) {
+                super(type, parent, ext(def, options));
+            }
+            /* c8 ignore stop */
+            static fromGlob(pattern, options = {}) {
+                return orig.AST.fromGlob(pattern, ext(def, options));
+            }
+        },
+        unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
+        escape: (s, options = {}) => orig.escape(s, ext(def, options)),
+        filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
+        defaults: (options) => orig.defaults(ext(def, options)),
+        makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
+        braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
+        match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
+        sep: orig.sep,
+        GLOBSTAR: GLOBSTAR,
+    });
+};
+minimatch.defaults = defaults;
+// Brace expansion:
+// a{b,c}d -> abd acd
+// a{b,}c -> abc ac
+// a{0..3}d -> a0d a1d a2d a3d
+// a{b,c{d,e}f}g -> abg acdfg acefg
+// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
+//
+// Invalid sets are not expanded.
+// a{2..}b -> a{2..}b
+// a{b}c -> a{b}c
+export const braceExpand = (pattern, options = {}) => {
+    assertValidPattern(pattern);
+    // Thanks to Yeting Li  for
+    // improving this regexp to avoid a ReDOS vulnerability.
+    if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
+        // shortcut. no need to expand.
+        return [pattern];
+    }
+    return expand(pattern, { max: options.braceExpandMax });
+};
+minimatch.braceExpand = braceExpand;
+// parse a component of the expanded set.
+// At this point, no pattern may contain "/" in it
+// so we're going to return a 2d array, where each entry is the full
+// pattern, split on '/', and then turned into a regular expression.
+// A regexp is made at the end which joins each array with an
+// escaped /, and another full one which joins each regexp with |.
+//
+// Following the lead of Bash 4.1, note that "**" only has special meaning
+// when it is the *only* thing in a path portion.  Otherwise, any series
+// of * is equivalent to a single *.  Globstar behavior is enabled by
+// default, and can be disabled by setting options.noglobstar.
+export const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
+minimatch.makeRe = makeRe;
+export const match = (list, pattern, options = {}) => {
+    const mm = new Minimatch(pattern, options);
+    list = list.filter(f => mm.match(f));
+    if (mm.options.nonull && !list.length) {
+        list.push(pattern);
+    }
+    return list;
+};
+minimatch.match = match;
+// replace stuff like \* with *
+const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
+const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+export class Minimatch {
+    options;
+    set;
+    pattern;
+    windowsPathsNoEscape;
+    nonegate;
+    negate;
+    comment;
+    empty;
+    preserveMultipleSlashes;
+    partial;
+    globSet;
+    globParts;
+    nocase;
+    isWindows;
+    platform;
+    windowsNoMagicRoot;
+    maxGlobstarRecursion;
+    regexp;
+    constructor(pattern, options = {}) {
+        assertValidPattern(pattern);
+        options = options || {};
+        this.options = options;
+        this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
+        this.pattern = pattern;
+        this.platform = options.platform || defaultPlatform;
+        this.isWindows = this.platform === 'win32';
+        // avoid the annoying deprecation flag lol
+        const awe = ('allowWindow' + 'sEscape');
+        this.windowsPathsNoEscape =
+            !!options.windowsPathsNoEscape || options[awe] === false;
+        if (this.windowsPathsNoEscape) {
+            this.pattern = this.pattern.replace(/\\/g, '/');
+        }
+        this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
+        this.regexp = null;
+        this.negate = false;
+        this.nonegate = !!options.nonegate;
+        this.comment = false;
+        this.empty = false;
+        this.partial = !!options.partial;
+        this.nocase = !!this.options.nocase;
+        this.windowsNoMagicRoot =
+            options.windowsNoMagicRoot !== undefined ?
+                options.windowsNoMagicRoot
+                : !!(this.isWindows && this.nocase);
+        this.globSet = [];
+        this.globParts = [];
+        this.set = [];
+        // make the set of regexps etc.
+        this.make();
+    }
+    hasMagic() {
+        if (this.options.magicalBraces && this.set.length > 1) {
+            return true;
+        }
+        for (const pattern of this.set) {
+            for (const part of pattern) {
+                if (typeof part !== 'string')
+                    return true;
+            }
+        }
+        return false;
+    }
+    debug(..._) { }
+    make() {
+        const pattern = this.pattern;
+        const options = this.options;
+        // empty patterns and comments match nothing.
+        if (!options.nocomment && pattern.charAt(0) === '#') {
+            this.comment = true;
+            return;
+        }
+        if (!pattern) {
+            this.empty = true;
+            return;
+        }
+        // step 1: figure out negation, etc.
+        this.parseNegate();
+        // step 2: expand braces
+        this.globSet = [...new Set(this.braceExpand())];
+        if (options.debug) {
+            //oxlint-disable-next-line no-console
+            this.debug = (...args) => console.error(...args);
+        }
+        this.debug(this.pattern, this.globSet);
+        // step 3: now we have a set, so turn each one into a series of
+        // path-portion matching patterns.
+        // These will be regexps, except in the case of "**", which is
+        // set to the GLOBSTAR object for globstar behavior,
+        // and will not contain any / characters
+        //
+        // First, we preprocess to make the glob pattern sets a bit simpler
+        // and deduped.  There are some perf-killing patterns that can cause
+        // problems with a glob walk, but we can simplify them down a bit.
+        const rawGlobParts = this.globSet.map(s => this.slashSplit(s));
+        this.globParts = this.preprocess(rawGlobParts);
+        this.debug(this.pattern, this.globParts);
+        // glob --> regexps
+        let set = this.globParts.map((s, _, __) => {
+            if (this.isWindows && this.windowsNoMagicRoot) {
+                // check if it's a drive or unc path.
+                const isUNC = s[0] === '' &&
+                    s[1] === '' &&
+                    (s[2] === '?' || !globMagic.test(s[2])) &&
+                    !globMagic.test(s[3]);
+                const isDrive = /^[a-z]:/i.test(s[0]);
+                if (isUNC) {
+                    return [
+                        ...s.slice(0, 4),
+                        ...s.slice(4).map(ss => this.parse(ss)),
+                    ];
+                }
+                else if (isDrive) {
+                    return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
+                }
+            }
+            return s.map(ss => this.parse(ss));
+        });
+        this.debug(this.pattern, set);
+        // filter out everything that didn't compile properly.
+        this.set = set.filter(s => s.indexOf(false) === -1);
+        // do not treat the ? in UNC paths as magic
+        if (this.isWindows) {
+            for (let i = 0; i < this.set.length; i++) {
+                const p = this.set[i];
+                if (p[0] === '' &&
+                    p[1] === '' &&
+                    this.globParts[i][2] === '?' &&
+                    typeof p[3] === 'string' &&
+                    /^[a-z]:$/i.test(p[3])) {
+                    p[2] = '?';
+                }
+            }
+        }
+        this.debug(this.pattern, this.set);
+    }
+    // various transforms to equivalent pattern sets that are
+    // faster to process in a filesystem walk.  The goal is to
+    // eliminate what we can, and push all ** patterns as far
+    // to the right as possible, even if it increases the number
+    // of patterns that we have to process.
+    preprocess(globParts) {
+        // if we're not in globstar mode, then turn ** into *
+        if (this.options.noglobstar) {
+            for (const partset of globParts) {
+                for (let j = 0; j < partset.length; j++) {
+                    if (partset[j] === '**') {
+                        partset[j] = '*';
+                    }
+                }
+            }
+        }
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            // aggressive optimization for the purpose of fs walking
+            globParts = this.firstPhasePreProcess(globParts);
+            globParts = this.secondPhasePreProcess(globParts);
+        }
+        else if (optimizationLevel >= 1) {
+            // just basic optimizations to remove some .. parts
+            globParts = this.levelOneOptimize(globParts);
+        }
+        else {
+            // just collapse multiple ** portions into one
+            globParts = this.adjascentGlobstarOptimize(globParts);
+        }
+        return globParts;
+    }
+    // just get rid of adjascent ** portions
+    adjascentGlobstarOptimize(globParts) {
+        return globParts.map(parts => {
+            let gs = -1;
+            while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
+                let i = gs;
+                while (parts[i + 1] === '**') {
+                    i++;
+                }
+                if (i !== gs) {
+                    parts.splice(gs, i - gs);
+                }
+            }
+            return parts;
+        });
+    }
+    // get rid of adjascent ** and resolve .. portions
+    levelOneOptimize(globParts) {
+        return globParts.map(parts => {
+            parts = parts.reduce((set, part) => {
+                const prev = set[set.length - 1];
+                if (part === '**' && prev === '**') {
+                    return set;
+                }
+                if (part === '..') {
+                    if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
+                        set.pop();
+                        return set;
+                    }
+                }
+                set.push(part);
+                return set;
+            }, []);
+            return parts.length === 0 ? [''] : parts;
+        });
+    }
+    levelTwoFileOptimize(parts) {
+        if (!Array.isArray(parts)) {
+            parts = this.slashSplit(parts);
+        }
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
// -> 
/
+            if (!this.preserveMultipleSlashes) {
+                for (let i = 1; i < parts.length - 1; i++) {
+                    const p = parts[i];
+                    // don't squeeze out UNC patterns
+                    if (i === 1 && p === '' && parts[0] === '')
+                        continue;
+                    if (p === '.' || p === '') {
+                        didSomething = true;
+                        parts.splice(i, 1);
+                        i--;
+                    }
+                }
+                if (parts[0] === '.' &&
+                    parts.length === 2 &&
+                    (parts[1] === '.' || parts[1] === '')) {
+                    didSomething = true;
+                    parts.pop();
+                }
+            }
+            // 
/

/../ ->

/
+            let dd = 0;
+            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                const p = parts[dd - 1];
+                if (p &&
+                    p !== '.' &&
+                    p !== '..' &&
+                    p !== '**' &&
+                    !(this.isWindows && /^[a-z]:$/i.test(p))) {
+                    didSomething = true;
+                    parts.splice(dd - 1, 2);
+                    dd -= 2;
+                }
+            }
+        } while (didSomething);
+        return parts.length === 0 ? [''] : parts;
+    }
+    // First phase: single-pattern processing
+    // 
 is 1 or more portions
+    //  is 1 or more portions
+    // 

is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + //

// -> 
/
+    // 
/

/../ ->

/
+    // **/**/ -> **/
+    //
+    // **/*/ -> */**/ <== not valid because ** doesn't follow
+    // this WOULD be allowed if ** did follow symlinks, or * didn't
+    firstPhasePreProcess(globParts) {
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

/**/**/ -> 
/**/
+                        gss++;
+                    }
+                    // eg, if gs is 2 and gss is 4, that means we have 3 **
+                    // parts, and can remove 2 of them.
+                    if (gss > gs) {
+                        parts.splice(gs + 1, gss - gs);
+                    }
+                    let next = parts[gs + 1];
+                    const p = parts[gs + 2];
+                    const p2 = parts[gs + 3];
+                    if (next !== '..')
+                        continue;
+                    if (!p ||
+                        p === '.' ||
+                        p === '..' ||
+                        !p2 ||
+                        p2 === '.' ||
+                        p2 === '..') {
+                        continue;
+                    }
+                    didSomething = true;
+                    // edit parts in place, and push the new one
+                    parts.splice(gs, 1);
+                    const other = parts.slice(0);
+                    other[gs] = '**';
+                    globParts.push(other);
+                    gs--;
+                }
+                // 
// -> 
/
+                if (!this.preserveMultipleSlashes) {
+                    for (let i = 1; i < parts.length - 1; i++) {
+                        const p = parts[i];
+                        // don't squeeze out UNC patterns
+                        if (i === 1 && p === '' && parts[0] === '')
+                            continue;
+                        if (p === '.' || p === '') {
+                            didSomething = true;
+                            parts.splice(i, 1);
+                            i--;
+                        }
+                    }
+                    if (parts[0] === '.' &&
+                        parts.length === 2 &&
+                        (parts[1] === '.' || parts[1] === '')) {
+                        didSomething = true;
+                        parts.pop();
+                    }
+                }
+                // 
/

/../ ->

/
+                let dd = 0;
+                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                    const p = parts[dd - 1];
+                    if (p && p !== '.' && p !== '..' && p !== '**') {
+                        didSomething = true;
+                        const needDot = dd === 1 && parts[dd + 1] === '**';
+                        const splin = needDot ? ['.'] : [];
+                        parts.splice(dd - 1, 2, ...splin);
+                        if (parts.length === 0)
+                            parts.push('');
+                        dd -= 2;
+                    }
+                }
+            }
+        } while (didSomething);
+        return globParts;
+    }
+    // second phase: multi-pattern dedupes
+    // {
/*/,
/

/} ->

/*/
+    // {
/,
/} -> 
/
+    // {
/**/,
/} -> 
/**/
+    //
+    // {
/**/,
/**/

/} ->

/**/
+    // ^-- not valid because ** doens't follow symlinks
+    secondPhasePreProcess(globParts) {
+        for (let i = 0; i < globParts.length - 1; i++) {
+            for (let j = i + 1; j < globParts.length; j++) {
+                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
+                if (matched) {
+                    globParts[i] = [];
+                    globParts[j] = matched;
+                    break;
+                }
+            }
+        }
+        return globParts.filter(gs => gs.length);
+    }
+    partsMatch(a, b, emptyGSMatch = false) {
+        let ai = 0;
+        let bi = 0;
+        let result = [];
+        let which = '';
+        while (ai < a.length && bi < b.length) {
+            if (a[ai] === b[bi]) {
+                result.push(which === 'b' ? b[bi] : a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
+                result.push(a[ai]);
+                ai++;
+            }
+            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
+                result.push(b[bi]);
+                bi++;
+            }
+            else if (a[ai] === '*' &&
+                b[bi] &&
+                (this.options.dot || !b[bi].startsWith('.')) &&
+                b[bi] !== '**') {
+                if (which === 'b')
+                    return false;
+                which = 'a';
+                result.push(a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (b[bi] === '*' &&
+                a[ai] &&
+                (this.options.dot || !a[ai].startsWith('.')) &&
+                a[ai] !== '**') {
+                if (which === 'a')
+                    return false;
+                which = 'b';
+                result.push(b[bi]);
+                ai++;
+                bi++;
+            }
+            else {
+                return false;
+            }
+        }
+        // if we fall out of the loop, it means they two are identical
+        // as long as their lengths match
+        return a.length === b.length && result;
+    }
+    parseNegate() {
+        if (this.nonegate)
+            return;
+        const pattern = this.pattern;
+        let negate = false;
+        let negateOffset = 0;
+        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
+            negate = !negate;
+            negateOffset++;
+        }
+        if (negateOffset)
+            this.pattern = pattern.slice(negateOffset);
+        this.negate = negate;
+    }
+    // set partial to true to test if, for example,
+    // "/a/b" matches the start of "/*/b/*/d"
+    // Partial means, if you run out of file before you run
+    // out of pattern, then that's fine, as long as all
+    // the parts match.
+    matchOne(file, pattern, partial = false) {
+        let fileStartIndex = 0;
+        let patternStartIndex = 0;
+        // UNC paths like //?/X:/... can match X:/... and vice versa
+        // Drive letters in absolute drive or unc paths are always compared
+        // case-insensitively.
+        if (this.isWindows) {
+            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
+            const fileUNC = !fileDrive &&
+                file[0] === '' &&
+                file[1] === '' &&
+                file[2] === '?' &&
+                /^[a-z]:$/i.test(file[3]);
+            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
+            const patternUNC = !patternDrive &&
+                pattern[0] === '' &&
+                pattern[1] === '' &&
+                pattern[2] === '?' &&
+                typeof pattern[3] === 'string' &&
+                /^[a-z]:$/i.test(pattern[3]);
+            const fdi = fileUNC ? 3
+                : fileDrive ? 0
+                    : undefined;
+            const pdi = patternUNC ? 3
+                : patternDrive ? 0
+                    : undefined;
+            if (typeof fdi === 'number' && typeof pdi === 'number') {
+                const [fd, pd] = [
+                    file[fdi],
+                    pattern[pdi],
+                ];
+                // start matching at the drive letter index of each
+                if (fd.toLowerCase() === pd.toLowerCase()) {
+                    pattern[pdi] = fd;
+                    patternStartIndex = pdi;
+                    fileStartIndex = fdi;
+                }
+            }
+        }
+        // resolve and reduce . and .. portions in the file as well.
+        // don't need to do the second phase, because it's only one string[]
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            file = this.levelTwoFileOptimize(file);
+        }
+        if (pattern.includes(GLOBSTAR)) {
+            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
+        }
+        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
+    }
+    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
+        // split the pattern into head, tail, and middle of ** delimited parts
+        const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
+        const lastgs = pattern.lastIndexOf(GLOBSTAR);
+        // split the pattern up into globstar-delimited sections
+        // the tail has to be at the end, and the others just have
+        // to be found in order from the head.
+        const [head, body, tail] = partial ?
+            [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1),
+                [],
+            ]
+            : [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1, lastgs),
+                pattern.slice(lastgs + 1),
+            ];
+        // check the head, from the current file/pattern index.
+        if (head.length) {
+            const fileHead = file.slice(fileIndex, fileIndex + head.length);
+            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
+                return false;
+            }
+            fileIndex += head.length;
+            patternIndex += head.length;
+        }
+        // now we know the head matches!
+        // if the last portion is not empty, it MUST match the end
+        // check the tail
+        let fileTailMatch = 0;
+        if (tail.length) {
+            // if head + tail > file, then we cannot possibly match
+            if (tail.length + fileIndex > file.length)
+                return false;
+            // try to match the tail
+            let tailStart = file.length - tail.length;
+            if (this.#matchOne(file, tail, partial, tailStart, 0)) {
+                fileTailMatch = tail.length;
+            }
+            else {
+                // affordance for stuff like a/**/* matching a/b/
+                // if the last file portion is '', and there's more to the pattern
+                // then try without the '' bit.
+                if (file[file.length - 1] !== '' ||
+                    fileIndex + tail.length === file.length) {
+                    return false;
+                }
+                tailStart--;
+                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
+                    return false;
+                }
+                fileTailMatch = tail.length + 1;
+            }
+        }
+        // now we know the tail matches!
+        // the middle is zero or more portions wrapped in **, possibly
+        // containing more ** sections.
+        // so a/**/b/**/c/**/d has become **/b/**/c/**
+        // if it's empty, it means a/**/b, just verify we have no bad dots
+        // if there's no tail, so it ends on /**, then we must have *something*
+        // after the head, or it's not a matc
+        if (!body.length) {
+            let sawSome = !!fileTailMatch;
+            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
+                const f = String(file[i]);
+                sawSome = true;
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            // in partial mode, we just need to get past all file parts
+            return partial || sawSome;
+        }
+        // now we know that there's one or more body sections, which can
+        // be matched anywhere from the 0 index (because the head was pruned)
+        // through to the length-fileTailMatch index.
+        // split the body up into sections, and note the minimum index it can
+        // be found at (start with the length of all previous segments)
+        // [section, before, after]
+        const bodySegments = [[[], 0]];
+        let currentBody = bodySegments[0];
+        let nonGsParts = 0;
+        const nonGsPartsSums = [0];
+        for (const b of body) {
+            if (b === GLOBSTAR) {
+                nonGsPartsSums.push(nonGsParts);
+                currentBody = [[], 0];
+                bodySegments.push(currentBody);
+            }
+            else {
+                currentBody[0].push(b);
+                nonGsParts++;
+            }
+        }
+        let i = bodySegments.length - 1;
+        const fileLength = file.length - fileTailMatch;
+        for (const b of bodySegments) {
+            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
+        }
+        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
+    }
+    // return false for "nope, not matching"
+    // return null for "not matching, cannot keep trying"
+    #matchGlobStarBodySections(file, 
+    // pattern section, last possible position for it
+    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
+        // take the first body segment, and walk from fileIndex to its "after"
+        // value at the end
+        // If it doesn't match at that position, we increment, until we hit
+        // that final possible position, and give up.
+        // If it does match, then advance and try to rest.
+        // If any of them fail we keep walking forward.
+        // this is still a bit recursively painful, but it's more constrained
+        // than previous implementations, because we never test something that
+        // can't possibly be a valid matching condition.
+        const bs = bodySegments[bodyIndex];
+        if (!bs) {
+            // just make sure that there's no bad dots
+            for (let i = fileIndex; i < file.length; i++) {
+                sawTail = true;
+                const f = file[i];
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            return sawTail;
+        }
+        // have a non-globstar body section to test
+        const [body, after] = bs;
+        while (fileIndex <= after) {
+            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
+            // if limit exceeded, no match. intentional false negative,
+            // acceptable break in correctness for security.
+            if (m && globStarDepth < this.maxGlobstarRecursion) {
+                // match! see if the rest match. if so, we're done!
+                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
+                if (sub !== false) {
+                    return sub;
+                }
+            }
+            const f = file[fileIndex];
+            if (f === '.' ||
+                f === '..' ||
+                (!this.options.dot && f.startsWith('.'))) {
+                return false;
+            }
+            fileIndex++;
+        }
+        // walked off. no point continuing
+        return partial || null;
+    }
+    #matchOne(file, pattern, partial, fileIndex, patternIndex) {
+        let fi;
+        let pi;
+        let pl;
+        let fl;
+        for (fi = fileIndex,
+            pi = patternIndex,
+            fl = file.length,
+            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
+            this.debug('matchOne loop');
+            let p = pattern[pi];
+            let f = file[fi];
+            this.debug(pattern, p, f);
+            // should be impossible.
+            // some invalid regexp stuff in the set.
+            /* c8 ignore start */
+            if (p === false || p === GLOBSTAR) {
+                return false;
+            }
+            /* c8 ignore stop */
+            // something other than **
+            // non-magic patterns just have to match exactly
+            // patterns with magic have been turned into regexps.
+            let hit;
+            if (typeof p === 'string') {
+                hit = f === p;
+                this.debug('string match', p, f, hit);
+            }
+            else {
+                hit = p.test(f);
+                this.debug('pattern match', p, f, hit);
+            }
+            if (!hit)
+                return false;
+        }
+        // Note: ending in / means that we'll get a final ""
+        // at the end of the pattern.  This can only match a
+        // corresponding "" at the end of the file.
+        // If the file ends in /, then it can only match a
+        // a pattern that ends in /, unless the pattern just
+        // doesn't have any more for it. But, a/b/ should *not*
+        // match "a/b/*", even though "" matches against the
+        // [^/]*? pattern, except in partial mode, where it might
+        // simply not be reached yet.
+        // However, a/b/ should still satisfy a/*
+        // now either we fell off the end of the pattern, or we're done.
+        if (fi === fl && pi === pl) {
+            // ran out of pattern and filename at the same time.
+            // an exact hit!
+            return true;
+        }
+        else if (fi === fl) {
+            // ran out of file, but still had pattern left.
+            // this is ok if we're doing the match as part of
+            // a glob fs traversal.
+            return partial;
+        }
+        else if (pi === pl) {
+            // ran out of pattern, still have file left.
+            // this is only acceptable if we're on the very last
+            // empty segment of a file with a trailing slash.
+            // a/* should match a/b/
+            return fi === fl - 1 && file[fi] === '';
+            /* c8 ignore start */
+        }
+        else {
+            // should be unreachable.
+            throw new Error('wtf?');
+        }
+        /* c8 ignore stop */
+    }
+    braceExpand() {
+        return braceExpand(this.pattern, this.options);
+    }
+    parse(pattern) {
+        assertValidPattern(pattern);
+        const options = this.options;
+        // shortcuts
+        if (pattern === '**')
+            return GLOBSTAR;
+        if (pattern === '')
+            return '';
+        // far and away, the most common glob pattern parts are
+        // *, *.*, and *.  Add a fast check method for those.
+        let m;
+        let fastTest = null;
+        if ((m = pattern.match(starRE))) {
+            fastTest = options.dot ? starTestDot : starTest;
+        }
+        else if ((m = pattern.match(starDotExtRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    starDotExtTestNocaseDot
+                    : starDotExtTestNocase
+                : options.dot ? starDotExtTestDot
+                    : starDotExtTest)(m[1]);
+        }
+        else if ((m = pattern.match(qmarksRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    qmarksTestNocaseDot
+                    : qmarksTestNocase
+                : options.dot ? qmarksTestDot
+                    : qmarksTest)(m);
+        }
+        else if ((m = pattern.match(starDotStarRE))) {
+            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        }
+        else if ((m = pattern.match(dotStarRE))) {
+            fastTest = dotStarTest;
+        }
+        const re = AST.fromGlob(pattern, this.options).toMMPattern();
+        if (fastTest && typeof re === 'object') {
+            // Avoids overriding in frozen environments
+            Reflect.defineProperty(re, 'test', { value: fastTest });
+        }
+        return re;
+    }
+    makeRe() {
+        if (this.regexp || this.regexp === false)
+            return this.regexp;
+        // at this point, this.set is a 2d array of partial
+        // pattern strings, or "**".
+        //
+        // It's better to use .match().  This function shouldn't
+        // be used, really, but it's pretty convenient sometimes,
+        // when you just want to work with a regex.
+        const set = this.set;
+        if (!set.length) {
+            this.regexp = false;
+            return this.regexp;
+        }
+        const options = this.options;
+        const twoStar = options.noglobstar ? star
+            : options.dot ? twoStarDot
+                : twoStarNoDot;
+        const flags = new Set(options.nocase ? ['i'] : []);
+        // regexpify non-globstar patterns
+        // if ** is only item, then we just do one twoStar
+        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
+        // if ** is last, append (\/twoStar|) to previous
+        // if ** is in the middle, append (\/|\/twoStar\/) to previous
+        // then filter out GLOBSTAR symbols
+        let re = set
+            .map(pattern => {
+            const pp = pattern.map(p => {
+                if (p instanceof RegExp) {
+                    for (const f of p.flags.split(''))
+                        flags.add(f);
+                }
+                return (typeof p === 'string' ? regExpEscape(p)
+                    : p === GLOBSTAR ? GLOBSTAR
+                        : p._src);
+            });
+            pp.forEach((p, i) => {
+                const next = pp[i + 1];
+                const prev = pp[i - 1];
+                if (p !== GLOBSTAR || prev === GLOBSTAR) {
+                    return;
+                }
+                if (prev === undefined) {
+                    if (next !== undefined && next !== GLOBSTAR) {
+                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
+                    }
+                    else {
+                        pp[i] = twoStar;
+                    }
+                }
+                else if (next === undefined) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
+                }
+                else if (next !== GLOBSTAR) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
+                    pp[i + 1] = GLOBSTAR;
+                }
+            });
+            const filtered = pp.filter(p => p !== GLOBSTAR);
+            // For partial matches, we need to make the pattern match
+            // any prefix of the full path. We do this by generating
+            // alternative patterns that match progressively longer prefixes.
+            if (this.partial && filtered.length >= 1) {
+                const prefixes = [];
+                for (let i = 1; i <= filtered.length; i++) {
+                    prefixes.push(filtered.slice(0, i).join('/'));
+                }
+                return '(?:' + prefixes.join('|') + ')';
+            }
+            return filtered.join('/');
+        })
+            .join('|');
+        // need to wrap in parens if we had more than one thing with |,
+        // otherwise only the first will be anchored to ^ and the last to $
+        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
+        // must match entire pattern
+        // ending in a * or ** will make it less strict.
+        re = '^' + open + re + close + '$';
+        // In partial mode, '/' should always match as it's a valid prefix for any pattern
+        if (this.partial) {
+            re = '^(?:\\/|' + open + re.slice(1, -1) + close + ')$';
+        }
+        // can match anything, as long as it's not this.
+        if (this.negate)
+            re = '^(?!' + re + ').+$';
+        try {
+            this.regexp = new RegExp(re, [...flags].join(''));
+            /* c8 ignore start */
+        }
+        catch {
+            // should be impossible
+            this.regexp = false;
+        }
+        /* c8 ignore stop */
+        return this.regexp;
+    }
+    slashSplit(p) {
+        // if p starts with // on windows, we preserve that
+        // so that UNC paths aren't broken.  Otherwise, any number of
+        // / characters are coalesced into one, unless
+        // preserveMultipleSlashes is set to true.
+        if (this.preserveMultipleSlashes) {
+            return p.split('/');
+        }
+        else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
+            // add an extra '' for the one we lose
+            return ['', ...p.split(/\/+/)];
+        }
+        else {
+            return p.split(/\/+/);
+        }
+    }
+    match(f, partial = this.partial) {
+        this.debug('match', f, this.pattern);
+        // short-circuit in the case of busted things.
+        // comments, etc.
+        if (this.comment) {
+            return false;
+        }
+        if (this.empty) {
+            return f === '';
+        }
+        if (f === '/' && partial) {
+            return true;
+        }
+        const options = this.options;
+        // windows: need to use /, not \
+        if (this.isWindows) {
+            f = f.split('\\').join('/');
+        }
+        // treat the test path as a set of pathparts.
+        const ff = this.slashSplit(f);
+        this.debug(this.pattern, 'split', ff);
+        // just ONE of the pattern sets in this.set needs to match
+        // in order for it to be valid.  If negating, then just one
+        // match means that we have failed.
+        // Either way, return on the first hit.
+        const set = this.set;
+        this.debug(this.pattern, 'set', set);
+        // Find the basename of the path by looking for the last non-empty segment
+        let filename = ff[ff.length - 1];
+        if (!filename) {
+            for (let i = ff.length - 2; !filename && i >= 0; i--) {
+                filename = ff[i];
+            }
+        }
+        for (const pattern of set) {
+            let file = ff;
+            if (options.matchBase && pattern.length === 1) {
+                file = [filename];
+            }
+            const hit = this.matchOne(file, pattern, partial);
+            if (hit) {
+                if (options.flipNegate) {
+                    return true;
+                }
+                return !this.negate;
+            }
+        }
+        // didn't get any hits.  this is success if it's a negative
+        // pattern, failure otherwise.
+        if (options.flipNegate) {
+            return false;
+        }
+        return this.negate;
+    }
+    static defaults(def) {
+        return minimatch.defaults(def).Minimatch;
+    }
+}
+/* c8 ignore start */
+export { AST } from './ast.js';
+export { escape } from './escape.js';
+export { unescape } from './unescape.js';
+/* c8 ignore stop */
+minimatch.AST = AST;
+minimatch.Minimatch = Minimatch;
+minimatch.escape = escape;
+minimatch.unescape = unescape;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/index.js.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/index.js.map
new file mode 100644
index 0000000..431b3a1
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/index.js.map	
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAqHxC,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,CAAS,EACT,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE;IACF,kBAAkB,CAAC,OAAO,CAAC,CAAA;IAE3B,oCAAoC;IACpC,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QACpD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACjD,CAAC,CAAA;AAED,wDAAwD;AACxD,MAAM,YAAY,GAAG,oBAAoB,CAAA;AACzC,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,CAAS,EAAE,EAAE,CACpD,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACvC,MAAM,iBAAiB,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACzE,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAE,EAAE;IAC3C,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;IACvB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAC3E,CAAC,CAAA;AACD,MAAM,uBAAuB,GAAG,CAAC,GAAW,EAAE,EAAE;IAC9C,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;IACvB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACrD,CAAC,CAAA;AACD,MAAM,aAAa,GAAG,YAAY,CAAA;AAClC,MAAM,eAAe,GAAG,CAAC,CAAS,EAAE,EAAE,CACpC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACvC,MAAM,kBAAkB,GAAG,CAAC,CAAS,EAAE,EAAE,CACvC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAC5C,MAAM,SAAS,GAAG,SAAS,CAAA;AAC3B,MAAM,WAAW,GAAG,CAAC,CAAS,EAAE,EAAE,CAChC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AAC9C,MAAM,MAAM,GAAG,OAAO,CAAA;AACtB,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AACpE,MAAM,WAAW,GAAG,CAAC,CAAS,EAAE,EAAE,CAChC,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAA;AAC3C,MAAM,QAAQ,GAAG,qBAAqB,CAAA;AACtC,MAAM,gBAAgB,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,CAAmB,EAAE,EAAE;IAC5D,MAAM,KAAK,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACnC,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAA;IACtB,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;IACvB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACjE,CAAC,CAAA;AACD,MAAM,mBAAmB,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,CAAmB,EAAE,EAAE;IAC/D,MAAM,KAAK,GAAG,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACtC,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAA;IACtB,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;IACvB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACjE,CAAC,CAAA;AACD,MAAM,aAAa,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,CAAmB,EAAE,EAAE;IACzD,MAAM,KAAK,GAAG,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACtC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAClE,CAAC,CAAA;AACD,MAAM,UAAU,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,CAAmB,EAAE,EAAE;IACtD,MAAM,KAAK,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACnC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAClE,CAAC,CAAA;AACD,MAAM,eAAe,GAAG,CAAC,CAAC,EAAE,CAAmB,EAAE,EAAE;IACjD,MAAM,GAAG,GAAG,EAAE,CAAC,MAAM,CAAA;IACrB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AAC9D,CAAC,CAAA;AACD,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAmB,EAAE,EAAE;IACpD,MAAM,GAAG,GAAG,EAAE,CAAC,MAAM,CAAA;IACrB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAA;AACnE,CAAC,CAAA;AAED,qBAAqB;AACrB,MAAM,eAAe,GAAa,CAChC,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC;IACtC,CAAC,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;QAC9B,OAAO,CAAC,GAAG;QACX,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC;QAC7C,OAAO,CAAC,QAAQ;IAClB,CAAC,CAAC,OAAO,CAAa,CAAA;AAIxB,MAAM,IAAI,GAAkC;IAC1C,KAAK,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE;IACpB,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;CACpB,CAAA;AACD,oBAAoB;AAEpB,MAAM,CAAC,MAAM,GAAG,GACd,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAA;AAC/D,SAAS,CAAC,GAAG,GAAG,GAAG,CAAA;AAEnB,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;AAC7C,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAA;AAE7B,gCAAgC;AAChC,iDAAiD;AACjD,MAAM,KAAK,GAAG,MAAM,CAAA;AAEpB,gCAAgC;AAChC,MAAM,IAAI,GAAG,KAAK,GAAG,IAAI,CAAA;AAEzB,4DAA4D;AAC5D,+DAA+D;AAC/D,6CAA6C;AAC7C,MAAM,UAAU,GAAG,yCAAyC,CAAA;AAE5D,kCAAkC;AAClC,6CAA6C;AAC7C,MAAM,YAAY,GAAG,yBAAyB,CAAA;AAE9C,MAAM,CAAC,MAAM,MAAM,GACjB,CAAC,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CACpD,CAAC,CAAS,EAAE,EAAE,CACZ,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;AAClC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAA;AAEzB,MAAM,GAAG,GAAG,CAAC,CAAmB,EAAE,IAAsB,EAAE,EAAE,EAAE,CAC5D,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AAEzB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAqB,EAAoB,EAAE;IAClE,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;QAChE,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,MAAM,IAAI,GAAG,SAAS,CAAA;IAEtB,MAAM,CAAC,GAAG,CAAC,CAAS,EAAE,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CACvE,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;IAErC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE;QACtB,SAAS,EAAE,MAAM,SAAU,SAAQ,IAAI,CAAC,SAAS;YAC/C,YAAY,OAAe,EAAE,UAA4B,EAAE;gBACzD,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;YACnC,CAAC;YACD,MAAM,CAAC,QAAQ,CAAC,OAAyB;gBACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAA;YACnD,CAAC;SACF;QAED,GAAG,EAAE,MAAM,GAAI,SAAQ,IAAI,CAAC,GAAG;YAC7B,qBAAqB;YACrB,YACE,IAAwB,EACxB,MAAY,EACZ,UAA4B,EAAE;gBAE9B,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;YACxC,CAAC;YACD,oBAAoB;YAEpB,MAAM,CAAC,QAAQ,CAAC,OAAe,EAAE,UAA4B,EAAE;gBAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;YACtD,CAAC;SACF;QAED,QAAQ,EAAE,CACR,CAAS,EACT,UAGI,EAAE,EACN,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAExC,MAAM,EAAE,CACN,CAAS,EACT,UAGI,EAAE,EACN,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEtC,MAAM,EAAE,CAAC,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CAC1D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEzC,QAAQ,EAAE,CAAC,OAAyB,EAAE,EAAE,CACtC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAElC,MAAM,EAAE,CAAC,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CAC1D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEzC,WAAW,EAAE,CAAC,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CAC/D,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAE9C,KAAK,EAAE,CACL,IAAc,EACd,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEjD,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,QAAQ,EAAE,QAA2B;KACtC,CAAC,CAAA;AACJ,CAAC,CAAA;AACD,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAA;AAE7B,mBAAmB;AACnB,qBAAqB;AACrB,mBAAmB;AACnB,8BAA8B;AAC9B,mCAAmC;AACnC,2CAA2C;AAC3C,EAAE;AACF,iCAAiC;AACjC,qBAAqB;AACrB,iBAAiB;AACjB,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE;IACF,kBAAkB,CAAC,OAAO,CAAC,CAAA;IAE3B,wDAAwD;IACxD,wDAAwD;IACxD,IAAI,OAAO,CAAC,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACzD,+BAA+B;QAC/B,OAAO,CAAC,OAAO,CAAC,CAAA;IAClB,CAAC;IAED,OAAO,MAAM,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC,CAAA;AACzD,CAAC,CAAA;AACD,SAAS,CAAC,WAAW,GAAG,WAAW,CAAA;AAEnC,yCAAyC;AACzC,kDAAkD;AAClD,oEAAoE;AACpE,oEAAoE;AACpE,6DAA6D;AAC7D,kEAAkE;AAClE,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,qEAAqE;AACrE,8DAA8D;AAE9D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CACxE,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,CAAA;AAC1C,SAAS,CAAC,MAAM,GAAG,MAAM,CAAA;AAEzB,MAAM,CAAC,MAAM,KAAK,GAAG,CACnB,IAAc,EACd,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE;IACF,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC1C,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IACpC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACtC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACpB,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AACD,SAAS,CAAC,KAAK,GAAG,KAAK,CAAA;AAEvB,+BAA+B;AAC/B,MAAM,SAAS,GAAG,yBAAyB,CAAA;AAC3C,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CACjC,CAAC,CAAC,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAA;AAU/C,MAAM,OAAO,SAAS;IACpB,OAAO,CAAkB;IACzB,GAAG,CAAyB;IAC5B,OAAO,CAAQ;IAEf,oBAAoB,CAAS;IAC7B,QAAQ,CAAS;IACjB,MAAM,CAAS;IACf,OAAO,CAAS;IAChB,KAAK,CAAS;IACd,uBAAuB,CAAS;IAChC,OAAO,CAAS;IAChB,OAAO,CAAU;IACjB,SAAS,CAAY;IACrB,MAAM,CAAS;IAEf,SAAS,CAAS;IAClB,QAAQ,CAAU;IAClB,kBAAkB,CAAS;IAC3B,oBAAoB,CAAQ;IAE5B,MAAM,CAAyB;IAC/B,YAAY,OAAe,EAAE,UAA4B,EAAE;QACzD,kBAAkB,CAAC,OAAO,CAAC,CAAA;QAE3B,OAAO,GAAG,OAAO,IAAI,EAAE,CAAA;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,IAAI,GAAG,CAAA;QAC/D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,eAAe,CAAA;QACnD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,KAAK,OAAO,CAAA;QAC1C,0CAA0C;QAC1C,MAAM,GAAG,GAAG,CAAC,aAAa,GAAG,SAAS,CAA2B,CAAA;QACjE,IAAI,CAAC,oBAAoB;YACvB,CAAC,CAAC,OAAO,CAAC,oBAAoB,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAA;QAC1D,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC9B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACjD,CAAC;QACD,IAAI,CAAC,uBAAuB,GAAG,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAA;QAChE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;QAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACnB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAA;QAClC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAA;QAChC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAA;QACnC,IAAI,CAAC,kBAAkB;YACrB,OAAO,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC;gBACxC,OAAO,CAAC,kBAAkB;gBAC5B,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,CAAA;QAErC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAA;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAA;QAEb,+BAA+B;QAC/B,IAAI,CAAC,IAAI,EAAE,CAAA;IACb,CAAC;IAED,QAAQ;QACN,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtD,OAAO,IAAI,CAAA;QACb,CAAC;QACD,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;YAC/B,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;gBAC3B,IAAI,OAAO,IAAI,KAAK,QAAQ;oBAAE,OAAO,IAAI,CAAA;YAC3C,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,KAAK,CAAC,GAAG,CAAY,IAAG,CAAC;IAEzB,IAAI;QACF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,6CAA6C;QAC7C,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YACpD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;YACnB,OAAM;QACR,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;YACjB,OAAM;QACR,CAAC;QAED,oCAAoC;QACpC,IAAI,CAAC,WAAW,EAAE,CAAA;QAElB,wBAAwB;QACxB,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAA;QAE/C,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,qCAAqC;YACrC,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA;QAC7D,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAEtC,+DAA+D;QAC/D,kCAAkC;QAClC,8DAA8D;QAC9D,oDAAoD;QACpD,wCAAwC;QACxC,EAAE;QACF,mEAAmE;QACnE,oEAAoE;QACpE,kEAAkE;QAClE,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAA;QAC9C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QAExC,mBAAmB;QACnB,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE;YACxC,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAC9C,qCAAqC;gBACrC,MAAM,KAAK,GACT,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;oBACX,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;oBACX,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACvC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;gBACvB,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;gBACrC,IAAI,KAAK,EAAE,CAAC;oBACV,OAAO;wBACL,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;wBAChB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;qBACxC,CAAA;gBACH,CAAC;qBAAM,IAAI,OAAO,EAAE,CAAC;oBACnB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;gBACxD,CAAC;YACH,CAAC;YACD,OAAO,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAA;QACpC,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;QAE7B,sDAAsD;QACtD,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CACnB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CACF,CAAA;QAE5B,2CAA2C;QAC3C,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACzC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;gBACrB,IACE,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;oBACX,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;oBACX,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG;oBAC5B,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ;oBACxB,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACtB,CAAC;oBACD,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;gBACZ,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;IACpC,CAAC;IAED,yDAAyD;IACzD,0DAA0D;IAC1D,yDAAyD;IACzD,4DAA4D;IAC5D,uCAAuC;IACvC,UAAU,CAAC,SAAqB;QAC9B,qDAAqD;QACrD,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YAC5B,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,CAAC;gBAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBACxC,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;wBACxB,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;oBAClB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,EAAE,iBAAiB,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;QAE9C,IAAI,iBAAiB,IAAI,CAAC,EAAE,CAAC;YAC3B,wDAAwD;YACxD,SAAS,GAAG,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAA;YAChD,SAAS,GAAG,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAA;QACnD,CAAC;aAAM,IAAI,iBAAiB,IAAI,CAAC,EAAE,CAAC;YAClC,mDAAmD;YACnD,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAA;QAC9C,CAAC;aAAM,CAAC;YACN,8CAA8C;YAC9C,SAAS,GAAG,IAAI,CAAC,yBAAyB,CAAC,SAAS,CAAC,CAAA;QACvD,CAAC;QAED,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,wCAAwC;IACxC,yBAAyB,CAAC,SAAqB;QAC7C,OAAO,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC3B,IAAI,EAAE,GAAW,CAAC,CAAC,CAAA;YACnB,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBACjD,IAAI,CAAC,GAAG,EAAE,CAAA;gBACV,OAAO,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;oBAC7B,CAAC,EAAE,CAAA;gBACL,CAAC;gBACD,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;oBACb,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAA;gBAC1B,CAAC;YACH,CAAC;YACD,OAAO,KAAK,CAAA;QACd,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,kDAAkD;IAClD,gBAAgB,CAAC,SAAqB;QACpC,OAAO,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC3B,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,GAAa,EAAE,IAAI,EAAE,EAAE;gBAC3C,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;gBAChC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;oBACnC,OAAO,GAAG,CAAA;gBACZ,CAAC;gBACD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;oBAClB,IAAI,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;wBAC3D,GAAG,CAAC,GAAG,EAAE,CAAA;wBACT,OAAO,GAAG,CAAA;oBACZ,CAAC;gBACH,CAAC;gBACD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;gBACd,OAAO,GAAG,CAAA;YACZ,CAAC,EAAE,EAAE,CAAC,CAAA;YACN,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;QAC1C,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,oBAAoB,CAAC,KAAwB;QAC3C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QAChC,CAAC;QACD,IAAI,YAAY,GAAY,KAAK,CAAA;QAEjC,GAAG,CAAC;YACF,YAAY,GAAG,KAAK,CAAA;YACpB,mCAAmC;YACnC,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC;gBAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC1C,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;oBAClB,iCAAiC;oBACjC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE;wBAAE,SAAQ;oBACpD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;wBAC1B,YAAY,GAAG,IAAI,CAAA;wBACnB,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;wBAClB,CAAC,EAAE,CAAA;oBACL,CAAC;gBACH,CAAC;gBACD,IACE,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG;oBAChB,KAAK,CAAC,MAAM,KAAK,CAAC;oBAClB,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,EACrC,CAAC;oBACD,YAAY,GAAG,IAAI,CAAA;oBACnB,KAAK,CAAC,GAAG,EAAE,CAAA;gBACb,CAAC;YACH,CAAC;YAED,sCAAsC;YACtC,IAAI,EAAE,GAAW,CAAC,CAAA;YAClB,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBACjD,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;gBACvB,IACE,CAAC;oBACD,CAAC,KAAK,GAAG;oBACT,CAAC,KAAK,IAAI;oBACV,CAAC,KAAK,IAAI;oBACV,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EACxC,CAAC;oBACD,YAAY,GAAG,IAAI,CAAA;oBACnB,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;oBACvB,EAAE,IAAI,CAAC,CAAA;gBACT,CAAC;YACH,CAAC;QACH,CAAC,QAAQ,YAAY,EAAC;QACtB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAC1C,CAAC;IAED,yCAAyC;IACzC,8BAA8B;IAC9B,+BAA+B;IAC/B,iDAAiD;IACjD,iBAAiB;IACjB,EAAE;IACF,gEAAgE;IAChE,gEAAgE;IAChE,kEAAkE;IAClE,qDAAqD;IACrD,EAAE;IACF,kFAAkF;IAClF,mCAAmC;IACnC,sCAAsC;IACtC,4BAA4B;IAC5B,EAAE;IACF,qEAAqE;IACrE,+DAA+D;IAC/D,oBAAoB,CAAC,SAAqB;QACxC,IAAI,YAAY,GAAG,KAAK,CAAA;QACxB,GAAG,CAAC;YACF,YAAY,GAAG,KAAK,CAAA;YACpB,kFAAkF;YAClF,KAAK,IAAI,KAAK,IAAI,SAAS,EAAE,CAAC;gBAC5B,IAAI,EAAE,GAAW,CAAC,CAAC,CAAA;gBACnB,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;oBACjD,IAAI,GAAG,GAAW,EAAE,CAAA;oBACpB,OAAO,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;wBAC/B,wCAAwC;wBACxC,GAAG,EAAE,CAAA;oBACP,CAAC;oBACD,uDAAuD;oBACvD,mCAAmC;oBACnC,IAAI,GAAG,GAAG,EAAE,EAAE,CAAC;wBACb,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,CAAA;oBAChC,CAAC;oBAED,IAAI,IAAI,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;oBACxB,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;oBACvB,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;oBACxB,IAAI,IAAI,KAAK,IAAI;wBAAE,SAAQ;oBAC3B,IACE,CAAC,CAAC;wBACF,CAAC,KAAK,GAAG;wBACT,CAAC,KAAK,IAAI;wBACV,CAAC,EAAE;wBACH,EAAE,KAAK,GAAG;wBACV,EAAE,KAAK,IAAI,EACX,CAAC;wBACD,SAAQ;oBACV,CAAC;oBACD,YAAY,GAAG,IAAI,CAAA;oBACnB,4CAA4C;oBAC5C,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;oBACnB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;oBAC5B,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,CAAA;oBAChB,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;oBACrB,EAAE,EAAE,CAAA;gBACN,CAAC;gBAED,mCAAmC;gBACnC,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC;oBAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;wBAC1C,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;wBAClB,iCAAiC;wBACjC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE;4BAAE,SAAQ;wBACpD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;4BAC1B,YAAY,GAAG,IAAI,CAAA;4BACnB,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;4BAClB,CAAC,EAAE,CAAA;wBACL,CAAC;oBACH,CAAC;oBACD,IACE,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG;wBAChB,KAAK,CAAC,MAAM,KAAK,CAAC;wBAClB,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,EACrC,CAAC;wBACD,YAAY,GAAG,IAAI,CAAA;wBACnB,KAAK,CAAC,GAAG,EAAE,CAAA;oBACb,CAAC;gBACH,CAAC;gBAED,sCAAsC;gBACtC,IAAI,EAAE,GAAW,CAAC,CAAA;gBAClB,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;oBACjD,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;oBACvB,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;wBAC/C,YAAY,GAAG,IAAI,CAAA;wBACnB,MAAM,OAAO,GAAG,EAAE,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,IAAI,CAAA;wBAClD,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;wBAClC,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,CAAA;wBACjC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;4BAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;wBACtC,EAAE,IAAI,CAAC,CAAA;oBACT,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC,QAAQ,YAAY,EAAC;QAEtB,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,sCAAsC;IACtC,sDAAsD;IACtD,8CAA8C;IAC9C,oDAAoD;IACpD,EAAE;IACF,2DAA2D;IAC3D,mDAAmD;IACnD,qBAAqB,CAAC,SAAqB;QACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9C,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAC7B,SAAS,CAAC,CAAC,CAAC,EACZ,SAAS,CAAC,CAAC,CAAC,EACZ,CAAC,IAAI,CAAC,uBAAuB,CAC9B,CAAA;gBACD,IAAI,OAAO,EAAE,CAAC;oBACZ,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,CAAA;oBACjB,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,CAAA;oBACtB,MAAK;gBACP,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAA;IAC1C,CAAC;IAED,UAAU,CACR,CAAW,EACX,CAAW,EACX,eAAwB,KAAK;QAE7B,IAAI,EAAE,GAAG,CAAC,CAAA;QACV,IAAI,EAAE,GAAG,CAAC,CAAA;QACV,IAAI,MAAM,GAAa,EAAE,CAAA;QACzB,IAAI,KAAK,GAAW,EAAE,CAAA;QACtB,OAAO,EAAE,GAAG,CAAC,CAAC,MAAM,IAAI,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;YACtC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;gBACpB,MAAM,CAAC,IAAI,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAC1C,EAAE,EAAE,CAAA;gBACJ,EAAE,EAAE,CAAA;YACN,CAAC;iBAAM,IAAI,YAAY,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;gBACjE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAClB,EAAE,EAAE,CAAA;YACN,CAAC;iBAAM,IAAI,YAAY,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;gBACjE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAClB,EAAE,EAAE,CAAA;YACN,CAAC;iBAAM,IACL,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG;gBACb,CAAC,CAAC,EAAE,CAAC;gBACL,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;gBAC5C,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,EACd,CAAC;gBACD,IAAI,KAAK,KAAK,GAAG;oBAAE,OAAO,KAAK,CAAA;gBAC/B,KAAK,GAAG,GAAG,CAAA;gBACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAClB,EAAE,EAAE,CAAA;gBACJ,EAAE,EAAE,CAAA;YACN,CAAC;iBAAM,IACL,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG;gBACb,CAAC,CAAC,EAAE,CAAC;gBACL,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;gBAC5C,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,EACd,CAAC;gBACD,IAAI,KAAK,KAAK,GAAG;oBAAE,OAAO,KAAK,CAAA;gBAC/B,KAAK,GAAG,GAAG,CAAA;gBACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAClB,EAAE,EAAE,CAAA;gBACJ,EAAE,EAAE,CAAA;YACN,CAAC;iBAAM,CAAC;gBACN,OAAO,KAAK,CAAA;YACd,CAAC;QACH,CAAC;QACD,8DAA8D;QAC9D,iCAAiC;QACjC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,MAAM,CAAA;IACxC,CAAC;IAED,WAAW;QACT,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAM;QAEzB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAC5B,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,IAAI,YAAY,GAAG,CAAC,CAAA;QAEpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YACrE,MAAM,GAAG,CAAC,MAAM,CAAA;YAChB,YAAY,EAAE,CAAA;QAChB,CAAC;QAED,IAAI,YAAY;YAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;QAC5D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,+CAA+C;IAC/C,yCAAyC;IACzC,uDAAuD;IACvD,mDAAmD;IACnD,mBAAmB;IACnB,QAAQ,CACN,IAAc,EACd,OAAsB,EACtB,UAAmB,KAAK;QAExB,IAAI,cAAc,GAAG,CAAC,CAAA;QACtB,IAAI,iBAAiB,GAAG,CAAC,CAAA;QAEzB,4DAA4D;QAC5D,mEAAmE;QACnE,sBAAsB;QACtB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,SAAS,GACb,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1D,MAAM,OAAO,GACX,CAAC,SAAS;gBACV,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;gBACd,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;gBACd,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG;gBACf,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAE3B,MAAM,YAAY,GAChB,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;YAChE,MAAM,UAAU,GACd,CAAC,YAAY;gBACb,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE;gBACjB,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE;gBACjB,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG;gBAClB,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ;gBAC9B,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;YAE9B,MAAM,GAAG,GACP,OAAO,CAAC,CAAC,CAAC,CAAC;gBACX,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;oBACf,CAAC,CAAC,SAAS,CAAA;YACb,MAAM,GAAG,GACP,UAAU,CAAC,CAAC,CAAC,CAAC;gBACd,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;oBAClB,CAAC,CAAC,SAAS,CAAA;YACb,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;gBACvD,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAqB;oBACjC,IAAI,CAAC,GAAG,CAAC;oBACT,OAAO,CAAC,GAAG,CAAW;iBACvB,CAAA;gBACD,mDAAmD;gBACnD,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;oBAC1C,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAA;oBACjB,iBAAiB,GAAG,GAAG,CAAA;oBACvB,cAAc,GAAG,GAAG,CAAA;gBACtB,CAAC;YACH,CAAC;QACH,CAAC;QAED,4DAA4D;QAC5D,oEAAoE;QACpE,MAAM,EAAE,iBAAiB,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;QAC9C,IAAI,iBAAiB,IAAI,CAAC,EAAE,CAAC;YAC3B,IAAI,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;QACxC,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/B,OAAO,IAAI,CAAC,cAAc,CACxB,IAAI,EACJ,OAAO,EACP,OAAO,EACP,cAAc,EACd,iBAAiB,CAClB,CAAA;QACH,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CACnB,IAAI,EACJ,OAAO,EACP,OAAO,EACP,cAAc,EACd,iBAAiB,CAClB,CAAA;IACH,CAAC;IAED,cAAc,CACZ,IAAc,EACd,OAAsB,EACtB,OAAgB,EAChB,SAAiB,EACjB,YAAoB;QAEpB,sEAAsE;QACtE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QACvD,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;QAE5C,wDAAwD;QACxD,0DAA0D;QAC1D,sCAAsC;QACtC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GACtB,OAAO,CAAC,CAAC;YACP;gBACE,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC;gBACpC,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;gBAC1B,EAAE;aACH;YACH,CAAC,CAAC;gBACE,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC;gBACpC,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,EAAE,MAAM,CAAC;gBAClC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;aAC1B,CAAA;QAEL,uDAAuD;QACvD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,CAAA;YAC/D,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;gBACnD,OAAO,KAAK,CAAA;YACd,CAAC;YACD,SAAS,IAAI,IAAI,CAAC,MAAM,CAAA;YACxB,YAAY,IAAI,IAAI,CAAC,MAAM,CAAA;QAC7B,CAAC;QACD,gCAAgC;QAEhC,0DAA0D;QAC1D,iBAAiB;QACjB,IAAI,aAAa,GAAW,CAAC,CAAA;QAC7B,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,uDAAuD;YACvD,IAAI,IAAI,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM;gBAAE,OAAO,KAAK,CAAA;YAEvD,wBAAwB;YACxB,IAAI,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;YACzC,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;gBACtD,aAAa,GAAG,IAAI,CAAC,MAAM,CAAA;YAC7B,CAAC;iBAAM,CAAC;gBACN,iDAAiD;gBACjD,kEAAkE;gBAClE,+BAA+B;gBAC/B,IACE,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE;oBAC5B,SAAS,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EACvC,CAAC;oBACD,OAAO,KAAK,CAAA;gBACd,CAAC;gBACD,SAAS,EAAE,CAAA;gBACX,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;oBACvD,OAAO,KAAK,CAAA;gBACd,CAAC;gBACD,aAAa,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAA;YACjC,CAAC;QACH,CAAC;QAED,gCAAgC;QAEhC,8DAA8D;QAC9D,+BAA+B;QAC/B,8CAA8C;QAC9C,kEAAkE;QAClE,uEAAuE;QACvE,qCAAqC;QACrC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,OAAO,GAAG,CAAC,CAAC,aAAa,CAAA;YAC7B,KAAK,IAAI,CAAC,GAAG,SAAS,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,aAAa,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC7D,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;gBACzB,OAAO,GAAG,IAAI,CAAA;gBACd,IACE,CAAC,KAAK,GAAG;oBACT,CAAC,KAAK,IAAI;oBACV,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EACxC,CAAC;oBACD,OAAO,KAAK,CAAA;gBACd,CAAC;YACH,CAAC;YACD,2DAA2D;YAC3D,OAAO,OAAO,IAAI,OAAO,CAAA;QAC3B,CAAC;QAED,gEAAgE;QAChE,qEAAqE;QACrE,6CAA6C;QAC7C,qEAAqE;QACrE,+DAA+D;QAC/D,2BAA2B;QAC3B,MAAM,YAAY,GAA8B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;QACzD,IAAI,WAAW,GAA4B,YAAY,CAAC,CAAC,CAAC,CAAA;QAC1D,IAAI,UAAU,GAAG,CAAC,CAAA;QAClB,MAAM,cAAc,GAAa,CAAC,CAAC,CAAC,CAAA;QACpC,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;YACrB,IAAI,CAAC,KAAK,QAAQ,EAAE,CAAC;gBACnB,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;gBAC/B,WAAW,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;gBACrB,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;YAChC,CAAC;iBAAM,CAAC;gBACN,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;gBACtB,UAAU,EAAE,CAAA;YACd,CAAC;QACH,CAAC;QACD,IAAI,CAAC,GAAG,YAAY,CAAC,MAAM,GAAG,CAAC,CAAA;QAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,GAAG,aAAa,CAAA;QAC9C,KAAK,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC;YAC7B,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,GAAG,CAAE,cAAc,CAAC,CAAC,EAAE,CAAY,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;QACrE,CAAC;QAED,OAAO,CAAC,CAAC,IAAI,CAAC,0BAA0B,CACtC,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,CAAC,EACD,OAAO,EACP,CAAC,EACD,CAAC,CAAC,aAAa,CAChB,CAAA;IACH,CAAC;IAED,wCAAwC;IACxC,qDAAqD;IACrD,0BAA0B,CACxB,IAAc;IACd,iDAAiD;IACjD,YAAuC,EACvC,SAAiB,EACjB,SAAiB,EACjB,OAAgB,EAChB,aAAqB,EACrB,OAAgB;QAEhB,sEAAsE;QACtE,mBAAmB;QACnB,mEAAmE;QACnE,6CAA6C;QAC7C,kDAAkD;QAClD,+CAA+C;QAC/C,qEAAqE;QACrE,sEAAsE;QACtE,gDAAgD;QAChD,MAAM,EAAE,GAAG,YAAY,CAAC,SAAS,CAAC,CAAA;QAClC,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,0CAA0C;YAC1C,KAAK,IAAI,CAAC,GAAG,SAAS,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC7C,OAAO,GAAG,IAAI,CAAA;gBACd,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;gBACjB,IACE,CAAC,KAAK,GAAG;oBACT,CAAC,KAAK,IAAI;oBACV,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EACxC,CAAC;oBACD,OAAO,KAAK,CAAA;gBACd,CAAC;YACH,CAAC;YACD,OAAO,OAAO,CAAA;QAChB,CAAC;QAED,2CAA2C;QAC3C,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,CAAA;QACxB,OAAO,SAAS,IAAI,KAAK,EAAE,CAAC;YAC1B,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CACtB,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,EACtC,IAAI,EACJ,OAAO,EACP,SAAS,EACT,CAAC,CACF,CAAA;YACD,2DAA2D;YAC3D,gDAAgD;YAChD,IAAI,CAAC,IAAI,aAAa,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;gBACnD,mDAAmD;gBACnD,MAAM,GAAG,GAAG,IAAI,CAAC,0BAA0B,CACzC,IAAI,EACJ,YAAY,EACZ,SAAS,GAAG,IAAI,CAAC,MAAM,EACvB,SAAS,GAAG,CAAC,EACb,OAAO,EACP,aAAa,GAAG,CAAC,EACjB,OAAO,CACR,CAAA;gBACD,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;oBAClB,OAAO,GAAG,CAAA;gBACZ,CAAC;YACH,CAAC;YACD,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAA;YACzB,IACE,CAAC,KAAK,GAAG;gBACT,CAAC,KAAK,IAAI;gBACV,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EACxC,CAAC;gBACD,OAAO,KAAK,CAAA;YACd,CAAC;YAED,SAAS,EAAE,CAAA;QACb,CAAC;QACD,kCAAkC;QAClC,OAAO,OAAO,IAAI,IAAI,CAAA;IACxB,CAAC;IAED,SAAS,CACP,IAAc,EACd,OAAsB,EACtB,OAAgB,EAChB,SAAiB,EACjB,YAAoB;QAEpB,IAAI,EAAU,CAAA;QACd,IAAI,EAAU,CAAA;QACd,IAAI,EAAU,CAAA;QACd,IAAI,EAAU,CAAA;QACd,KACE,EAAE,GAAG,SAAS;YACZ,EAAE,GAAG,YAAY;YACjB,EAAE,GAAG,IAAI,CAAC,MAAM;YAChB,EAAE,GAAG,OAAO,CAAC,MAAM,EACrB,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,EAClB,EAAE,EAAE,EAAE,EAAE,EAAE,EACV,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;YAC3B,IAAI,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC,CAAA;YACnB,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAA;YAEhB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;YAEzB,wBAAwB;YACxB,wCAAwC;YACxC,qBAAqB;YACrB,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,QAAQ,EAAE,CAAC;gBAClC,OAAO,KAAK,CAAA;YACd,CAAC;YACD,oBAAoB;YAEpB,0BAA0B;YAC1B,gDAAgD;YAChD,qDAAqD;YACrD,IAAI,GAAY,CAAA;YAChB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;gBAC1B,GAAG,GAAG,CAAC,KAAK,CAAC,CAAA;gBACb,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAA;YACvC,CAAC;iBAAM,CAAC;gBACN,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;gBACf,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAA;YACxC,CAAC;YAED,IAAI,CAAC,GAAG;gBAAE,OAAO,KAAK,CAAA;QACxB,CAAC;QAED,oDAAoD;QACpD,oDAAoD;QACpD,2CAA2C;QAC3C,kDAAkD;QAClD,oDAAoD;QACpD,uDAAuD;QACvD,oDAAoD;QACpD,yDAAyD;QACzD,6BAA6B;QAC7B,yCAAyC;QAEzC,gEAAgE;QAChE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC3B,oDAAoD;YACpD,gBAAgB;YAChB,OAAO,IAAI,CAAA;QACb,CAAC;aAAM,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACrB,+CAA+C;YAC/C,iDAAiD;YACjD,uBAAuB;YACvB,OAAO,OAAO,CAAA;QAChB,CAAC;aAAM,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACrB,4CAA4C;YAC5C,oDAAoD;YACpD,iDAAiD;YACjD,wBAAwB;YACxB,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;YAEvC,qBAAqB;QACvB,CAAC;aAAM,CAAC;YACN,yBAAyB;YACzB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAA;QACzB,CAAC;QACD,oBAAoB;IACtB,CAAC;IAED,WAAW;QACT,OAAO,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAChD,CAAC;IAED,KAAK,CAAC,OAAe;QACnB,kBAAkB,CAAC,OAAO,CAAC,CAAA;QAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,YAAY;QACZ,IAAI,OAAO,KAAK,IAAI;YAAE,OAAO,QAAQ,CAAA;QACrC,IAAI,OAAO,KAAK,EAAE;YAAE,OAAO,EAAE,CAAA;QAE7B,uDAAuD;QACvD,0DAA0D;QAC1D,IAAI,CAA0B,CAAA;QAC9B,IAAI,QAAQ,GAAoC,IAAI,CAAA;QACpD,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;YAChC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAA;QACjD,CAAC;aAAM,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;YAC7C,QAAQ,GAAG,CACT,OAAO,CAAC,MAAM,CAAC,CAAC;gBACd,OAAO,CAAC,GAAG,CAAC,CAAC;oBACX,uBAAuB;oBACzB,CAAC,CAAC,oBAAoB;gBACxB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,iBAAiB;oBACjC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC3B,CAAC;aAAM,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;YACzC,QAAQ,GAAG,CACT,OAAO,CAAC,MAAM,CAAC,CAAC;gBACd,OAAO,CAAC,GAAG,CAAC,CAAC;oBACX,mBAAmB;oBACrB,CAAC,CAAC,gBAAgB;gBACpB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa;oBAC7B,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;QACpB,CAAC;aAAM,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC;YAC9C,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,eAAe,CAAA;QAC/D,CAAC;aAAM,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YAC1C,QAAQ,GAAG,WAAW,CAAA;QACxB,CAAC;QAED,MAAM,EAAE,GAAG,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAA;QAC5D,IAAI,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;YACvC,2CAA2C;YAC3C,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;QACzD,CAAC;QACD,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM;QACJ,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK;YAAE,OAAO,IAAI,CAAC,MAAM,CAAA;QAE5D,mDAAmD;QACnD,4BAA4B;QAC5B,EAAE;QACF,wDAAwD;QACxD,yDAAyD;QACzD,2CAA2C;QAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;QAEpB,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;YACnB,OAAO,IAAI,CAAC,MAAM,CAAA;QACpB,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,MAAM,OAAO,GACX,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI;YACzB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU;gBAC1B,CAAC,CAAC,YAAY,CAAA;QAChB,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QAElD,kCAAkC;QAClC,kDAAkD;QAClD,sEAAsE;QACtE,iDAAiD;QACjD,8DAA8D;QAC9D,mCAAmC;QACnC,IAAI,EAAE,GAAG,GAAG;aACT,GAAG,CAAC,OAAO,CAAC,EAAE;YACb,MAAM,EAAE,GAAiC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;gBACvD,IAAI,CAAC,YAAY,MAAM,EAAE,CAAC;oBACxB,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;wBAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;gBACjD,CAAC;gBACD,OAAO,CACL,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;oBACvC,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ;wBAC3B,CAAC,CAAC,CAAC,CAAC,IAAI,CACT,CAAA;YACH,CAAC,CAAiC,CAAA;YAClC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBAClB,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;gBACtB,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;gBACtB,IAAI,CAAC,KAAK,QAAQ,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;oBACxC,OAAM;gBACR,CAAC;gBACD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;oBACvB,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;wBAC5C,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;oBAClD,CAAC;yBAAM,CAAC;wBACN,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO,CAAA;oBACjB,CAAC;gBACH,CAAC;qBAAM,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;oBAC9B,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,YAAY,GAAG,OAAO,GAAG,IAAI,CAAA;gBAClD,CAAC;qBAAM,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;oBAC7B,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,CAAA;oBACzD,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAA;gBACtB,CAAC;YACH,CAAC,CAAC,CAAA;YACF,MAAM,QAAQ,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAA;YAE/C,yDAAyD;YACzD,wDAAwD;YACxD,iEAAiE;YACjE,IAAI,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;gBACzC,MAAM,QAAQ,GAAa,EAAE,CAAA;gBAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC1C,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;gBAC/C,CAAC;gBACD,OAAO,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAA;YACzC,CAAC;YAED,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC3B,CAAC,CAAC;aACD,IAAI,CAAC,GAAG,CAAC,CAAA;QAEZ,+DAA+D;QAC/D,mEAAmE;QACnE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QAC9D,4BAA4B;QAC5B,gDAAgD;QAChD,EAAE,GAAG,GAAG,GAAG,IAAI,GAAG,EAAE,GAAG,KAAK,GAAG,GAAG,CAAA;QAElC,kFAAkF;QAClF,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,EAAE,GAAG,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAA;QACzD,CAAC;QAED,gDAAgD;QAChD,IAAI,IAAI,CAAC,MAAM;YAAE,EAAE,GAAG,MAAM,GAAG,EAAE,GAAG,MAAM,CAAA;QAE1C,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;YACjD,qBAAqB;QACvB,CAAC;QAAC,MAAM,CAAC;YACP,uBAAuB;YACvB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACrB,CAAC;QACD,oBAAoB;QACpB,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,UAAU,CAAC,CAAS;QAClB,mDAAmD;QACnD,6DAA6D;QAC7D,8CAA8C;QAC9C,0CAA0C;QAC1C,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;YACjC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACrB,CAAC;aAAM,IAAI,IAAI,CAAC,SAAS,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAClD,sCAAsC;YACtC,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;QAChC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACvB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,CAAS,EAAE,OAAO,GAAG,IAAI,CAAC,OAAO;QACrC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACpC,8CAA8C;QAC9C,iBAAiB;QACjB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,EAAE,CAAA;QACjB,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,OAAO,EAAE,CAAC;YACzB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,gCAAgC;QAChC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC7B,CAAC;QAED,6CAA6C;QAC7C,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;QAC7B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;QAErC,0DAA0D;QAC1D,2DAA2D;QAC3D,mCAAmC;QACnC,uCAAuC;QAEvC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;QACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QAEpC,0EAA0E;QAC1E,IAAI,QAAQ,GAAW,EAAE,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QACxC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBACrD,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;YAClB,CAAC;QACH,CAAC;QAED,KAAK,MAAM,OAAO,IAAI,GAAG,EAAE,CAAC;YAC1B,IAAI,IAAI,GAAG,EAAE,CAAA;YACb,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC9C,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAA;YACnB,CAAC;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;YACjD,IAAI,GAAG,EAAE,CAAC;gBACR,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;oBACvB,OAAO,IAAI,CAAA;gBACb,CAAC;gBACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAA;YACrB,CAAC;QACH,CAAC;QAED,2DAA2D;QAC3D,8BAA8B;QAC9B,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAqB;QACnC,OAAO,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,CAAA;IAC1C,CAAC;CACF;AACD,qBAAqB;AACrB,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,oBAAoB;AACpB,SAAS,CAAC,GAAG,GAAG,GAAG,CAAA;AACnB,SAAS,CAAC,SAAS,GAAG,SAAS,CAAA;AAC/B,SAAS,CAAC,MAAM,GAAG,MAAM,CAAA;AACzB,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAA","sourcesContent":["import { expand } from 'brace-expansion'\nimport { assertValidPattern } from './assert-valid-pattern.js'\nimport type { ExtglobType } from './ast.js'\nimport { AST } from './ast.js'\nimport { escape } from './escape.js'\nimport { unescape } from './unescape.js'\n\nexport type Platform =\n  | 'aix'\n  | 'android'\n  | 'darwin'\n  | 'freebsd'\n  | 'haiku'\n  | 'linux'\n  | 'openbsd'\n  | 'sunos'\n  | 'win32'\n  | 'cygwin'\n  | 'netbsd'\n\nexport interface MinimatchOptions {\n  /** do not expand `{x,y}` style braces */\n  nobrace?: boolean\n  /** do not treat patterns starting with `#` as a comment */\n  nocomment?: boolean\n  /** do not treat patterns starting with `!` as a negation */\n  nonegate?: boolean\n  /** print LOTS of debugging output */\n  debug?: boolean\n  /** treat `**` the same as `*` */\n  noglobstar?: boolean\n  /** do not expand extglobs like `+(a|b)` */\n  noext?: boolean\n  /** return the pattern if nothing matches */\n  nonull?: boolean\n  /** treat `\\\\` as a path separator, not an escape character */\n  windowsPathsNoEscape?: boolean\n  /**\n   * inverse of {@link MinimatchOptions.windowsPathsNoEscape}\n   * @deprecated\n   */\n  allowWindowsEscape?: boolean\n  /**\n   * Compare a partial path to a pattern. As long as the parts\n   * of the path that are present are not contradicted by the\n   * pattern, it will be treated as a match. This is useful in\n   * applications where you're walking through a folder structure,\n   * and don't yet have the full path, but want to ensure that you\n   * do not walk down paths that can never be a match.\n   */\n  partial?: boolean\n  /** allow matches that start with `.` even if the pattern does not */\n  dot?: boolean\n  /** ignore case */\n  nocase?: boolean\n  /** ignore case only in wildcard patterns */\n  nocaseMagicOnly?: boolean\n  /** consider braces to be \"magic\" for the purpose of `hasMagic` */\n  magicalBraces?: boolean\n  /**\n   * If set, then patterns without slashes will be matched\n   * against the basename of the path if it contains slashes.\n   * For example, `a?b` would match the path `/xyz/123/acb`, but\n   * not `/xyz/acb/123`.\n   */\n  matchBase?: boolean\n  /** invert the results of negated matches */\n  flipNegate?: boolean\n  /** do not collapse multiple `/` into a single `/` */\n  preserveMultipleSlashes?: boolean\n  /**\n   * A number indicating the level of optimization that should be done\n   * to the pattern prior to parsing and using it for matches.\n   */\n  optimizationLevel?: number\n  /** operating system platform */\n  platform?: Platform\n  /**\n   * When a pattern starts with a UNC path or drive letter, and in\n   * `nocase:true` mode, do not convert the root portions of the\n   * pattern into a case-insensitive regular expression, and instead\n   * leave them as strings.\n   *\n   * This is the default when the platform is `win32` and\n   * `nocase:true` is set.\n   */\n  windowsNoMagicRoot?: boolean\n  /**\n   * max number of `{...}` patterns to expand. Default 100_000.\n   */\n  braceExpandMax?: number\n  /**\n   * Max number of non-adjacent `**` patterns to recursively walk down.\n   *\n   * The default of 200 is almost certainly high enough for most purposes,\n   * and can handle absurdly excessive patterns.\n   */\n  maxGlobstarRecursion?: number\n\n  /**\n   * Max depth to traverse for nested extglobs like `*(a|b|c)`\n   *\n   * Default is 2, which is quite low, but any higher value\n   * swiftly results in punishing performance impacts. Note\n   * that this is *not*  relevant when the globstar types can\n   * be safely coalesced into a single set.\n   *\n   * For example, `*(a|@(b|c)|d)` would be flattened into\n   * `*(a|b|c|d)`. Thus, many common extglobs will retain good\n   * performance and  never hit this limit, even if they are\n   * excessively deep and complicated.\n   *\n   * If the limit is hit, then the extglob characters are simply\n   * not parsed, and the pattern effectively switches into\n   * `noextglob: true` mode for the contents of that nested\n   * sub-pattern. This will typically _not_ result in a match,\n   * but is considered a valid trade-off for security and\n   * performance.\n   */\n  maxExtglobRecursion?: number\n}\n\nexport const minimatch = (\n  p: string,\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // shortcut: comments match nothing.\n  if (!options.nocomment && pattern.charAt(0) === '#') {\n    return false\n  }\n\n  return new Minimatch(pattern, options).match(p)\n}\n\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/\nconst starDotExtTest = (ext: string) => (f: string) =>\n  !f.startsWith('.') && f.endsWith(ext)\nconst starDotExtTestDot = (ext: string) => (f: string) => f.endsWith(ext)\nconst starDotExtTestNocase = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => !f.startsWith('.') && f.toLowerCase().endsWith(ext)\n}\nconst starDotExtTestNocaseDot = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => f.toLowerCase().endsWith(ext)\n}\nconst starDotStarRE = /^\\*+\\.\\*+$/\nconst starDotStarTest = (f: string) =>\n  !f.startsWith('.') && f.includes('.')\nconst starDotStarTestDot = (f: string) =>\n  f !== '.' && f !== '..' && f.includes('.')\nconst dotStarRE = /^\\.\\*+$/\nconst dotStarTest = (f: string) =>\n  f !== '.' && f !== '..' && f.startsWith('.')\nconst starRE = /^\\*+$/\nconst starTest = (f: string) => f.length !== 0 && !f.startsWith('.')\nconst starTestDot = (f: string) =>\n  f.length !== 0 && f !== '.' && f !== '..'\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/\nconst qmarksTestNocase = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestNocaseDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTest = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTestNoExt = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && !f.startsWith('.')\n}\nconst qmarksTestNoExtDot = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && f !== '.' && f !== '..'\n}\n\n/* c8 ignore start */\nconst defaultPlatform: Platform = (\n  typeof process === 'object' && process ?\n    (typeof process.env === 'object' &&\n      process.env &&\n      process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n    process.platform\n  : 'posix') as Platform\n\nexport type Sep = '\\\\' | '/'\n\nconst path: { [k: string]: { sep: Sep } } = {\n  win32: { sep: '\\\\' },\n  posix: { sep: '/' },\n}\n/* c8 ignore stop */\n\nexport const sep =\n  defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep\nminimatch.sep = sep\n\nexport const GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed.  Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?'\n\nexport const filter =\n  (pattern: string, options: MinimatchOptions = {}) =>\n  (p: string) =>\n    minimatch(p, pattern, options)\nminimatch.filter = filter\n\nconst ext = (a: MinimatchOptions, b: MinimatchOptions = {}) =>\n  Object.assign({}, a, b)\n\nexport const defaults = (def: MinimatchOptions): typeof minimatch => {\n  if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n    return minimatch\n  }\n\n  const orig = minimatch\n\n  const m = (p: string, pattern: string, options: MinimatchOptions = {}) =>\n    orig(p, pattern, ext(def, options))\n\n  return Object.assign(m, {\n    Minimatch: class Minimatch extends orig.Minimatch {\n      constructor(pattern: string, options: MinimatchOptions = {}) {\n        super(pattern, ext(def, options))\n      }\n      static defaults(options: MinimatchOptions) {\n        return orig.defaults(ext(def, options)).Minimatch\n      }\n    },\n\n    AST: class AST extends orig.AST {\n      /* c8 ignore start */\n      constructor(\n        type: ExtglobType | null,\n        parent?: AST,\n        options: MinimatchOptions = {},\n      ) {\n        super(type, parent, ext(def, options))\n      }\n      /* c8 ignore stop */\n\n      static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n        return orig.AST.fromGlob(pattern, ext(def, options))\n      }\n    },\n\n    unescape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.unescape(s, ext(def, options)),\n\n    escape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.escape(s, ext(def, options)),\n\n    filter: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.filter(pattern, ext(def, options)),\n\n    defaults: (options: MinimatchOptions) =>\n      orig.defaults(ext(def, options)),\n\n    makeRe: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.makeRe(pattern, ext(def, options)),\n\n    braceExpand: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.braceExpand(pattern, ext(def, options)),\n\n    match: (\n      list: string[],\n      pattern: string,\n      options: MinimatchOptions = {},\n    ) => orig.match(list, pattern, ext(def, options)),\n\n    sep: orig.sep,\n    GLOBSTAR: GLOBSTAR as typeof GLOBSTAR,\n  })\n}\nminimatch.defaults = defaults\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // Thanks to Yeting Li  for\n  // improving this regexp to avoid a ReDOS vulnerability.\n  if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n    // shortcut. no need to expand.\n    return [pattern]\n  }\n\n  return expand(pattern, { max: options.braceExpandMax })\n}\nminimatch.braceExpand = braceExpand\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion.  Otherwise, any series\n// of * is equivalent to a single *.  Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\n\nexport const makeRe = (pattern: string, options: MinimatchOptions = {}) =>\n  new Minimatch(pattern, options).makeRe()\nminimatch.makeRe = makeRe\n\nexport const match = (\n  list: string[],\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  const mm = new Minimatch(pattern, options)\n  list = list.filter(f => mm.match(f))\n  if (mm.options.nonull && !list.length) {\n    list.push(pattern)\n  }\n  return list\n}\nminimatch.match = match\n\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\nexport type MMRegExp = RegExp & {\n  _src?: string\n  _glob?: string\n}\n\nexport type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR\nexport type ParseReturn = ParseReturnFiltered | false\n\nexport class Minimatch {\n  options: MinimatchOptions\n  set: ParseReturnFiltered[][]\n  pattern: string\n\n  windowsPathsNoEscape: boolean\n  nonegate: boolean\n  negate: boolean\n  comment: boolean\n  empty: boolean\n  preserveMultipleSlashes: boolean\n  partial: boolean\n  globSet: string[]\n  globParts: string[][]\n  nocase: boolean\n\n  isWindows: boolean\n  platform: Platform\n  windowsNoMagicRoot: boolean\n  maxGlobstarRecursion: number\n\n  regexp: false | null | MMRegExp\n  constructor(pattern: string, options: MinimatchOptions = {}) {\n    assertValidPattern(pattern)\n\n    options = options || {}\n    this.options = options\n    this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200\n    this.pattern = pattern\n    this.platform = options.platform || defaultPlatform\n    this.isWindows = this.platform === 'win32'\n    // avoid the annoying deprecation flag lol\n    const awe = ('allowWindow' + 'sEscape') as keyof MinimatchOptions\n    this.windowsPathsNoEscape =\n      !!options.windowsPathsNoEscape || options[awe] === false\n    if (this.windowsPathsNoEscape) {\n      this.pattern = this.pattern.replace(/\\\\/g, '/')\n    }\n    this.preserveMultipleSlashes = !!options.preserveMultipleSlashes\n    this.regexp = null\n    this.negate = false\n    this.nonegate = !!options.nonegate\n    this.comment = false\n    this.empty = false\n    this.partial = !!options.partial\n    this.nocase = !!this.options.nocase\n    this.windowsNoMagicRoot =\n      options.windowsNoMagicRoot !== undefined ?\n        options.windowsNoMagicRoot\n      : !!(this.isWindows && this.nocase)\n\n    this.globSet = []\n    this.globParts = []\n    this.set = []\n\n    // make the set of regexps etc.\n    this.make()\n  }\n\n  hasMagic(): boolean {\n    if (this.options.magicalBraces && this.set.length > 1) {\n      return true\n    }\n    for (const pattern of this.set) {\n      for (const part of pattern) {\n        if (typeof part !== 'string') return true\n      }\n    }\n    return false\n  }\n\n  debug(..._: unknown[]) {}\n\n  make() {\n    const pattern = this.pattern\n    const options = this.options\n\n    // empty patterns and comments match nothing.\n    if (!options.nocomment && pattern.charAt(0) === '#') {\n      this.comment = true\n      return\n    }\n\n    if (!pattern) {\n      this.empty = true\n      return\n    }\n\n    // step 1: figure out negation, etc.\n    this.parseNegate()\n\n    // step 2: expand braces\n    this.globSet = [...new Set(this.braceExpand())]\n\n    if (options.debug) {\n      //oxlint-disable-next-line no-console\n      this.debug = (...args: unknown[]) => console.error(...args)\n    }\n\n    this.debug(this.pattern, this.globSet)\n\n    // step 3: now we have a set, so turn each one into a series of\n    // path-portion matching patterns.\n    // These will be regexps, except in the case of \"**\", which is\n    // set to the GLOBSTAR object for globstar behavior,\n    // and will not contain any / characters\n    //\n    // First, we preprocess to make the glob pattern sets a bit simpler\n    // and deduped.  There are some perf-killing patterns that can cause\n    // problems with a glob walk, but we can simplify them down a bit.\n    const rawGlobParts = this.globSet.map(s => this.slashSplit(s))\n    this.globParts = this.preprocess(rawGlobParts)\n    this.debug(this.pattern, this.globParts)\n\n    // glob --> regexps\n    let set = this.globParts.map((s, _, __) => {\n      if (this.isWindows && this.windowsNoMagicRoot) {\n        // check if it's a drive or unc path.\n        const isUNC =\n          s[0] === '' &&\n          s[1] === '' &&\n          (s[2] === '?' || !globMagic.test(s[2])) &&\n          !globMagic.test(s[3])\n        const isDrive = /^[a-z]:/i.test(s[0])\n        if (isUNC) {\n          return [\n            ...s.slice(0, 4),\n            ...s.slice(4).map(ss => this.parse(ss)),\n          ]\n        } else if (isDrive) {\n          return [s[0], ...s.slice(1).map(ss => this.parse(ss))]\n        }\n      }\n      return s.map(ss => this.parse(ss))\n    })\n\n    this.debug(this.pattern, set)\n\n    // filter out everything that didn't compile properly.\n    this.set = set.filter(\n      s => s.indexOf(false) === -1,\n    ) as ParseReturnFiltered[][]\n\n    // do not treat the ? in UNC paths as magic\n    if (this.isWindows) {\n      for (let i = 0; i < this.set.length; i++) {\n        const p = this.set[i]\n        if (\n          p[0] === '' &&\n          p[1] === '' &&\n          this.globParts[i][2] === '?' &&\n          typeof p[3] === 'string' &&\n          /^[a-z]:$/i.test(p[3])\n        ) {\n          p[2] = '?'\n        }\n      }\n    }\n\n    this.debug(this.pattern, this.set)\n  }\n\n  // various transforms to equivalent pattern sets that are\n  // faster to process in a filesystem walk.  The goal is to\n  // eliminate what we can, and push all ** patterns as far\n  // to the right as possible, even if it increases the number\n  // of patterns that we have to process.\n  preprocess(globParts: string[][]) {\n    // if we're not in globstar mode, then turn ** into *\n    if (this.options.noglobstar) {\n      for (const partset of globParts) {\n        for (let j = 0; j < partset.length; j++) {\n          if (partset[j] === '**') {\n            partset[j] = '*'\n          }\n        }\n      }\n    }\n\n    const { optimizationLevel = 1 } = this.options\n\n    if (optimizationLevel >= 2) {\n      // aggressive optimization for the purpose of fs walking\n      globParts = this.firstPhasePreProcess(globParts)\n      globParts = this.secondPhasePreProcess(globParts)\n    } else if (optimizationLevel >= 1) {\n      // just basic optimizations to remove some .. parts\n      globParts = this.levelOneOptimize(globParts)\n    } else {\n      // just collapse multiple ** portions into one\n      globParts = this.adjascentGlobstarOptimize(globParts)\n    }\n\n    return globParts\n  }\n\n  // just get rid of adjascent ** portions\n  adjascentGlobstarOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      let gs: number = -1\n      while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n        let i = gs\n        while (parts[i + 1] === '**') {\n          i++\n        }\n        if (i !== gs) {\n          parts.splice(gs, i - gs)\n        }\n      }\n      return parts\n    })\n  }\n\n  // get rid of adjascent ** and resolve .. portions\n  levelOneOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      parts = parts.reduce((set: string[], part) => {\n        const prev = set[set.length - 1]\n        if (part === '**' && prev === '**') {\n          return set\n        }\n        if (part === '..') {\n          if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n            set.pop()\n            return set\n          }\n        }\n        set.push(part)\n        return set\n      }, [])\n      return parts.length === 0 ? [''] : parts\n    })\n  }\n\n  levelTwoFileOptimize(parts: string | string[]) {\n    if (!Array.isArray(parts)) {\n      parts = this.slashSplit(parts)\n    }\n    let didSomething: boolean = false\n\n    do {\n      didSomething = false\n      // 
// -> 
/\n      if (!this.preserveMultipleSlashes) {\n        for (let i = 1; i < parts.length - 1; i++) {\n          const p = parts[i]\n          // don't squeeze out UNC patterns\n          if (i === 1 && p === '' && parts[0] === '') continue\n          if (p === '.' || p === '') {\n            didSomething = true\n            parts.splice(i, 1)\n            i--\n          }\n        }\n        if (\n          parts[0] === '.' &&\n          parts.length === 2 &&\n          (parts[1] === '.' || parts[1] === '')\n        ) {\n          didSomething = true\n          parts.pop()\n        }\n      }\n\n      // 
/

/../ ->

/\n      let dd: number = 0\n      while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n        const p = parts[dd - 1]\n        if (\n          p &&\n          p !== '.' &&\n          p !== '..' &&\n          p !== '**' &&\n          !(this.isWindows && /^[a-z]:$/i.test(p))\n        ) {\n          didSomething = true\n          parts.splice(dd - 1, 2)\n          dd -= 2\n        }\n      }\n    } while (didSomething)\n    return parts.length === 0 ? [''] : parts\n  }\n\n  // First phase: single-pattern processing\n  // 
 is 1 or more portions\n  //  is 1 or more portions\n  // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n  // 
/

/../ ->

/\n  // **/**/ -> **/\n  //\n  // **/*/ -> */**/ <== not valid because ** doesn't follow\n  // this WOULD be allowed if ** did follow symlinks, or * didn't\n  firstPhasePreProcess(globParts: string[][]) {\n    let didSomething = false\n    do {\n      didSomething = false\n      // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs: number = -1\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss: number = gs\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n            gss++\n          }\n          // eg, if gs is 2 and gss is 4, that means we have 3 **\n          // parts, and can remove 2 of them.\n          if (gss > gs) {\n            parts.splice(gs + 1, gss - gs)\n          }\n\n          let next = parts[gs + 1]\n          const p = parts[gs + 2]\n          const p2 = parts[gs + 3]\n          if (next !== '..') continue\n          if (\n            !p ||\n            p === '.' ||\n            p === '..' ||\n            !p2 ||\n            p2 === '.' ||\n            p2 === '..'\n          ) {\n            continue\n          }\n          didSomething = true\n          // edit parts in place, and push the new one\n          parts.splice(gs, 1)\n          const other = parts.slice(0)\n          other[gs] = '**'\n          globParts.push(other)\n          gs--\n        }\n\n        // 
// -> 
/\n        if (!this.preserveMultipleSlashes) {\n          for (let i = 1; i < parts.length - 1; i++) {\n            const p = parts[i]\n            // don't squeeze out UNC patterns\n            if (i === 1 && p === '' && parts[0] === '') continue\n            if (p === '.' || p === '') {\n              didSomething = true\n              parts.splice(i, 1)\n              i--\n            }\n          }\n          if (\n            parts[0] === '.' &&\n            parts.length === 2 &&\n            (parts[1] === '.' || parts[1] === '')\n          ) {\n            didSomething = true\n            parts.pop()\n          }\n        }\n\n        // 
/

/../ ->

/\n        let dd: number = 0\n        while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n          const p = parts[dd - 1]\n          if (p && p !== '.' && p !== '..' && p !== '**') {\n            didSomething = true\n            const needDot = dd === 1 && parts[dd + 1] === '**'\n            const splin = needDot ? ['.'] : []\n            parts.splice(dd - 1, 2, ...splin)\n            if (parts.length === 0) parts.push('')\n            dd -= 2\n          }\n        }\n      }\n    } while (didSomething)\n\n    return globParts\n  }\n\n  // second phase: multi-pattern dedupes\n  // {
/*/,
/

/} ->

/*/\n  // {
/,
/} -> 
/\n  // {
/**/,
/} -> 
/**/\n  //\n  // {
/**/,
/**/

/} ->

/**/\n  // ^-- not valid because ** doens't follow symlinks\n  secondPhasePreProcess(globParts: string[][]): string[][] {\n    for (let i = 0; i < globParts.length - 1; i++) {\n      for (let j = i + 1; j < globParts.length; j++) {\n        const matched = this.partsMatch(\n          globParts[i],\n          globParts[j],\n          !this.preserveMultipleSlashes,\n        )\n        if (matched) {\n          globParts[i] = []\n          globParts[j] = matched\n          break\n        }\n      }\n    }\n    return globParts.filter(gs => gs.length)\n  }\n\n  partsMatch(\n    a: string[],\n    b: string[],\n    emptyGSMatch: boolean = false,\n  ): false | string[] {\n    let ai = 0\n    let bi = 0\n    let result: string[] = []\n    let which: string = ''\n    while (ai < a.length && bi < b.length) {\n      if (a[ai] === b[bi]) {\n        result.push(which === 'b' ? b[bi] : a[ai])\n        ai++\n        bi++\n      } else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n        result.push(a[ai])\n        ai++\n      } else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n        result.push(b[bi])\n        bi++\n      } else if (\n        a[ai] === '*' &&\n        b[bi] &&\n        (this.options.dot || !b[bi].startsWith('.')) &&\n        b[bi] !== '**'\n      ) {\n        if (which === 'b') return false\n        which = 'a'\n        result.push(a[ai])\n        ai++\n        bi++\n      } else if (\n        b[bi] === '*' &&\n        a[ai] &&\n        (this.options.dot || !a[ai].startsWith('.')) &&\n        a[ai] !== '**'\n      ) {\n        if (which === 'a') return false\n        which = 'b'\n        result.push(b[bi])\n        ai++\n        bi++\n      } else {\n        return false\n      }\n    }\n    // if we fall out of the loop, it means they two are identical\n    // as long as their lengths match\n    return a.length === b.length && result\n  }\n\n  parseNegate() {\n    if (this.nonegate) return\n\n    const pattern = this.pattern\n    let negate = false\n    let negateOffset = 0\n\n    for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n      negate = !negate\n      negateOffset++\n    }\n\n    if (negateOffset) this.pattern = pattern.slice(negateOffset)\n    this.negate = negate\n  }\n\n  // set partial to true to test if, for example,\n  // \"/a/b\" matches the start of \"/*/b/*/d\"\n  // Partial means, if you run out of file before you run\n  // out of pattern, then that's fine, as long as all\n  // the parts match.\n  matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean = false,\n  ) {\n    let fileStartIndex = 0\n    let patternStartIndex = 0\n\n    // UNC paths like //?/X:/... can match X:/... and vice versa\n    // Drive letters in absolute drive or unc paths are always compared\n    // case-insensitively.\n    if (this.isWindows) {\n      const fileDrive =\n        typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0])\n      const fileUNC =\n        !fileDrive &&\n        file[0] === '' &&\n        file[1] === '' &&\n        file[2] === '?' &&\n        /^[a-z]:$/i.test(file[3])\n\n      const patternDrive =\n        typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0])\n      const patternUNC =\n        !patternDrive &&\n        pattern[0] === '' &&\n        pattern[1] === '' &&\n        pattern[2] === '?' &&\n        typeof pattern[3] === 'string' &&\n        /^[a-z]:$/i.test(pattern[3])\n\n      const fdi =\n        fileUNC ? 3\n        : fileDrive ? 0\n        : undefined\n      const pdi =\n        patternUNC ? 3\n        : patternDrive ? 0\n        : undefined\n      if (typeof fdi === 'number' && typeof pdi === 'number') {\n        const [fd, pd]: [string, string] = [\n          file[fdi],\n          pattern[pdi] as string,\n        ]\n        // start matching at the drive letter index of each\n        if (fd.toLowerCase() === pd.toLowerCase()) {\n          pattern[pdi] = fd\n          patternStartIndex = pdi\n          fileStartIndex = fdi\n        }\n      }\n    }\n\n    // resolve and reduce . and .. portions in the file as well.\n    // don't need to do the second phase, because it's only one string[]\n    const { optimizationLevel = 1 } = this.options\n    if (optimizationLevel >= 2) {\n      file = this.levelTwoFileOptimize(file)\n    }\n\n    if (pattern.includes(GLOBSTAR)) {\n      return this.#matchGlobstar(\n        file,\n        pattern,\n        partial,\n        fileStartIndex,\n        patternStartIndex,\n      )\n    }\n\n    return this.#matchOne(\n      file,\n      pattern,\n      partial,\n      fileStartIndex,\n      patternStartIndex,\n    )\n  }\n\n  #matchGlobstar(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    // split the pattern into head, tail, and middle of ** delimited parts\n    const firstgs = pattern.indexOf(GLOBSTAR, patternIndex)\n    const lastgs = pattern.lastIndexOf(GLOBSTAR)\n\n    // split the pattern up into globstar-delimited sections\n    // the tail has to be at the end, and the others just have\n    // to be found in order from the head.\n    const [head, body, tail] =\n      partial ?\n        [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1),\n          [],\n        ]\n      : [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1, lastgs),\n          pattern.slice(lastgs + 1),\n        ]\n\n    // check the head, from the current file/pattern index.\n    if (head.length) {\n      const fileHead = file.slice(fileIndex, fileIndex + head.length)\n      if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n        return false\n      }\n      fileIndex += head.length\n      patternIndex += head.length\n    }\n    // now we know the head matches!\n\n    // if the last portion is not empty, it MUST match the end\n    // check the tail\n    let fileTailMatch: number = 0\n    if (tail.length) {\n      // if head + tail > file, then we cannot possibly match\n      if (tail.length + fileIndex > file.length) return false\n\n      // try to match the tail\n      let tailStart = file.length - tail.length\n      if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n        fileTailMatch = tail.length\n      } else {\n        // affordance for stuff like a/**/* matching a/b/\n        // if the last file portion is '', and there's more to the pattern\n        // then try without the '' bit.\n        if (\n          file[file.length - 1] !== '' ||\n          fileIndex + tail.length === file.length\n        ) {\n          return false\n        }\n        tailStart--\n        if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n          return false\n        }\n        fileTailMatch = tail.length + 1\n      }\n    }\n\n    // now we know the tail matches!\n\n    // the middle is zero or more portions wrapped in **, possibly\n    // containing more ** sections.\n    // so a/**/b/**/c/**/d has become **/b/**/c/**\n    // if it's empty, it means a/**/b, just verify we have no bad dots\n    // if there's no tail, so it ends on /**, then we must have *something*\n    // after the head, or it's not a matc\n    if (!body.length) {\n      let sawSome = !!fileTailMatch\n      for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n        const f = String(file[i])\n        sawSome = true\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      // in partial mode, we just need to get past all file parts\n      return partial || sawSome\n    }\n\n    // now we know that there's one or more body sections, which can\n    // be matched anywhere from the 0 index (because the head was pruned)\n    // through to the length-fileTailMatch index.\n    // split the body up into sections, and note the minimum index it can\n    // be found at (start with the length of all previous segments)\n    // [section, before, after]\n    const bodySegments: [ParseReturn[], number][] = [[[], 0]]\n    let currentBody: [ParseReturn[], number] = bodySegments[0]\n    let nonGsParts = 0\n    const nonGsPartsSums: number[] = [0]\n    for (const b of body) {\n      if (b === GLOBSTAR) {\n        nonGsPartsSums.push(nonGsParts)\n        currentBody = [[], 0]\n        bodySegments.push(currentBody)\n      } else {\n        currentBody[0].push(b)\n        nonGsParts++\n      }\n    }\n    let i = bodySegments.length - 1\n    const fileLength = file.length - fileTailMatch\n    for (const b of bodySegments) {\n      b[1] = fileLength - ((nonGsPartsSums[i--] as number) + b[0].length)\n    }\n\n    return !!this.#matchGlobStarBodySections(\n      file,\n      bodySegments,\n      fileIndex,\n      0,\n      partial,\n      0,\n      !!fileTailMatch,\n    )\n  }\n\n  // return false for \"nope, not matching\"\n  // return null for \"not matching, cannot keep trying\"\n  #matchGlobStarBodySections(\n    file: string[],\n    // pattern section, last possible position for it\n    bodySegments: [ParseReturn[], number][],\n    fileIndex: number,\n    bodyIndex: number,\n    partial: boolean,\n    globStarDepth: number,\n    sawTail: boolean,\n  ): boolean | null {\n    // take the first body segment, and walk from fileIndex to its \"after\"\n    // value at the end\n    // If it doesn't match at that position, we increment, until we hit\n    // that final possible position, and give up.\n    // If it does match, then advance and try to rest.\n    // If any of them fail we keep walking forward.\n    // this is still a bit recursively painful, but it's more constrained\n    // than previous implementations, because we never test something that\n    // can't possibly be a valid matching condition.\n    const bs = bodySegments[bodyIndex]\n    if (!bs) {\n      // just make sure that there's no bad dots\n      for (let i = fileIndex; i < file.length; i++) {\n        sawTail = true\n        const f = file[i]\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      return sawTail\n    }\n\n    // have a non-globstar body section to test\n    const [body, after] = bs\n    while (fileIndex <= after) {\n      const m = this.#matchOne(\n        file.slice(0, fileIndex + body.length),\n        body,\n        partial,\n        fileIndex,\n        0,\n      )\n      // if limit exceeded, no match. intentional false negative,\n      // acceptable break in correctness for security.\n      if (m && globStarDepth < this.maxGlobstarRecursion) {\n        // match! see if the rest match. if so, we're done!\n        const sub = this.#matchGlobStarBodySections(\n          file,\n          bodySegments,\n          fileIndex + body.length,\n          bodyIndex + 1,\n          partial,\n          globStarDepth + 1,\n          sawTail,\n        )\n        if (sub !== false) {\n          return sub\n        }\n      }\n      const f = file[fileIndex]\n      if (\n        f === '.' ||\n        f === '..' ||\n        (!this.options.dot && f.startsWith('.'))\n      ) {\n        return false\n      }\n\n      fileIndex++\n    }\n    // walked off. no point continuing\n    return partial || null\n  }\n\n  #matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    let fi: number\n    let pi: number\n    let pl: number\n    let fl: number\n    for (\n      fi = fileIndex,\n        pi = patternIndex,\n        fl = file.length,\n        pl = pattern.length;\n      fi < fl && pi < pl;\n      fi++, pi++\n    ) {\n      this.debug('matchOne loop')\n      let p = pattern[pi]\n      let f = file[fi]\n\n      this.debug(pattern, p, f)\n\n      // should be impossible.\n      // some invalid regexp stuff in the set.\n      /* c8 ignore start */\n      if (p === false || p === GLOBSTAR) {\n        return false\n      }\n      /* c8 ignore stop */\n\n      // something other than **\n      // non-magic patterns just have to match exactly\n      // patterns with magic have been turned into regexps.\n      let hit: boolean\n      if (typeof p === 'string') {\n        hit = f === p\n        this.debug('string match', p, f, hit)\n      } else {\n        hit = p.test(f)\n        this.debug('pattern match', p, f, hit)\n      }\n\n      if (!hit) return false\n    }\n\n    // Note: ending in / means that we'll get a final \"\"\n    // at the end of the pattern.  This can only match a\n    // corresponding \"\" at the end of the file.\n    // If the file ends in /, then it can only match a\n    // a pattern that ends in /, unless the pattern just\n    // doesn't have any more for it. But, a/b/ should *not*\n    // match \"a/b/*\", even though \"\" matches against the\n    // [^/]*? pattern, except in partial mode, where it might\n    // simply not be reached yet.\n    // However, a/b/ should still satisfy a/*\n\n    // now either we fell off the end of the pattern, or we're done.\n    if (fi === fl && pi === pl) {\n      // ran out of pattern and filename at the same time.\n      // an exact hit!\n      return true\n    } else if (fi === fl) {\n      // ran out of file, but still had pattern left.\n      // this is ok if we're doing the match as part of\n      // a glob fs traversal.\n      return partial\n    } else if (pi === pl) {\n      // ran out of pattern, still have file left.\n      // this is only acceptable if we're on the very last\n      // empty segment of a file with a trailing slash.\n      // a/* should match a/b/\n      return fi === fl - 1 && file[fi] === ''\n\n      /* c8 ignore start */\n    } else {\n      // should be unreachable.\n      throw new Error('wtf?')\n    }\n    /* c8 ignore stop */\n  }\n\n  braceExpand() {\n    return braceExpand(this.pattern, this.options)\n  }\n\n  parse(pattern: string): ParseReturn {\n    assertValidPattern(pattern)\n\n    const options = this.options\n\n    // shortcuts\n    if (pattern === '**') return GLOBSTAR\n    if (pattern === '') return ''\n\n    // far and away, the most common glob pattern parts are\n    // *, *.*, and *.  Add a fast check method for those.\n    let m: RegExpMatchArray | null\n    let fastTest: null | ((f: string) => boolean) = null\n    if ((m = pattern.match(starRE))) {\n      fastTest = options.dot ? starTestDot : starTest\n    } else if ((m = pattern.match(starDotExtRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            starDotExtTestNocaseDot\n          : starDotExtTestNocase\n        : options.dot ? starDotExtTestDot\n        : starDotExtTest)(m[1])\n    } else if ((m = pattern.match(qmarksRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            qmarksTestNocaseDot\n          : qmarksTestNocase\n        : options.dot ? qmarksTestDot\n        : qmarksTest)(m)\n    } else if ((m = pattern.match(starDotStarRE))) {\n      fastTest = options.dot ? starDotStarTestDot : starDotStarTest\n    } else if ((m = pattern.match(dotStarRE))) {\n      fastTest = dotStarTest\n    }\n\n    const re = AST.fromGlob(pattern, this.options).toMMPattern()\n    if (fastTest && typeof re === 'object') {\n      // Avoids overriding in frozen environments\n      Reflect.defineProperty(re, 'test', { value: fastTest })\n    }\n    return re\n  }\n\n  makeRe() {\n    if (this.regexp || this.regexp === false) return this.regexp\n\n    // at this point, this.set is a 2d array of partial\n    // pattern strings, or \"**\".\n    //\n    // It's better to use .match().  This function shouldn't\n    // be used, really, but it's pretty convenient sometimes,\n    // when you just want to work with a regex.\n    const set = this.set\n\n    if (!set.length) {\n      this.regexp = false\n      return this.regexp\n    }\n    const options = this.options\n\n    const twoStar =\n      options.noglobstar ? star\n      : options.dot ? twoStarDot\n      : twoStarNoDot\n    const flags = new Set(options.nocase ? ['i'] : [])\n\n    // regexpify non-globstar patterns\n    // if ** is only item, then we just do one twoStar\n    // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n    // if ** is last, append (\\/twoStar|) to previous\n    // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n    // then filter out GLOBSTAR symbols\n    let re = set\n      .map(pattern => {\n        const pp: (string | typeof GLOBSTAR)[] = pattern.map(p => {\n          if (p instanceof RegExp) {\n            for (const f of p.flags.split('')) flags.add(f)\n          }\n          return (\n            typeof p === 'string' ? regExpEscape(p)\n            : p === GLOBSTAR ? GLOBSTAR\n            : p._src\n          )\n        }) as (string | typeof GLOBSTAR)[]\n        pp.forEach((p, i) => {\n          const next = pp[i + 1]\n          const prev = pp[i - 1]\n          if (p !== GLOBSTAR || prev === GLOBSTAR) {\n            return\n          }\n          if (prev === undefined) {\n            if (next !== undefined && next !== GLOBSTAR) {\n              pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next\n            } else {\n              pp[i] = twoStar\n            }\n          } else if (next === undefined) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?'\n          } else if (next !== GLOBSTAR) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next\n            pp[i + 1] = GLOBSTAR\n          }\n        })\n        const filtered = pp.filter(p => p !== GLOBSTAR)\n\n        // For partial matches, we need to make the pattern match\n        // any prefix of the full path. We do this by generating\n        // alternative patterns that match progressively longer prefixes.\n        if (this.partial && filtered.length >= 1) {\n          const prefixes: string[] = []\n          for (let i = 1; i <= filtered.length; i++) {\n            prefixes.push(filtered.slice(0, i).join('/'))\n          }\n          return '(?:' + prefixes.join('|') + ')'\n        }\n\n        return filtered.join('/')\n      })\n      .join('|')\n\n    // need to wrap in parens if we had more than one thing with |,\n    // otherwise only the first will be anchored to ^ and the last to $\n    const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', '']\n    // must match entire pattern\n    // ending in a * or ** will make it less strict.\n    re = '^' + open + re + close + '$'\n\n    // In partial mode, '/' should always match as it's a valid prefix for any pattern\n    if (this.partial) {\n      re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$'\n    }\n\n    // can match anything, as long as it's not this.\n    if (this.negate) re = '^(?!' + re + ').+$'\n\n    try {\n      this.regexp = new RegExp(re, [...flags].join(''))\n      /* c8 ignore start */\n    } catch {\n      // should be impossible\n      this.regexp = false\n    }\n    /* c8 ignore stop */\n    return this.regexp\n  }\n\n  slashSplit(p: string) {\n    // if p starts with // on windows, we preserve that\n    // so that UNC paths aren't broken.  Otherwise, any number of\n    // / characters are coalesced into one, unless\n    // preserveMultipleSlashes is set to true.\n    if (this.preserveMultipleSlashes) {\n      return p.split('/')\n    } else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n      // add an extra '' for the one we lose\n      return ['', ...p.split(/\\/+/)]\n    } else {\n      return p.split(/\\/+/)\n    }\n  }\n\n  match(f: string, partial = this.partial) {\n    this.debug('match', f, this.pattern)\n    // short-circuit in the case of busted things.\n    // comments, etc.\n    if (this.comment) {\n      return false\n    }\n    if (this.empty) {\n      return f === ''\n    }\n\n    if (f === '/' && partial) {\n      return true\n    }\n\n    const options = this.options\n\n    // windows: need to use /, not \\\n    if (this.isWindows) {\n      f = f.split('\\\\').join('/')\n    }\n\n    // treat the test path as a set of pathparts.\n    const ff = this.slashSplit(f)\n    this.debug(this.pattern, 'split', ff)\n\n    // just ONE of the pattern sets in this.set needs to match\n    // in order for it to be valid.  If negating, then just one\n    // match means that we have failed.\n    // Either way, return on the first hit.\n\n    const set = this.set\n    this.debug(this.pattern, 'set', set)\n\n    // Find the basename of the path by looking for the last non-empty segment\n    let filename: string = ff[ff.length - 1]\n    if (!filename) {\n      for (let i = ff.length - 2; !filename && i >= 0; i--) {\n        filename = ff[i]\n      }\n    }\n\n    for (const pattern of set) {\n      let file = ff\n      if (options.matchBase && pattern.length === 1) {\n        file = [filename]\n      }\n      const hit = this.matchOne(file, pattern, partial)\n      if (hit) {\n        if (options.flipNegate) {\n          return true\n        }\n        return !this.negate\n      }\n    }\n\n    // didn't get any hits.  this is success if it's a negative\n    // pattern, failure otherwise.\n    if (options.flipNegate) {\n      return false\n    }\n    return this.negate\n  }\n\n  static defaults(def: MinimatchOptions) {\n    return minimatch.defaults(def).Minimatch\n  }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js'\nexport { escape } from './escape.js'\nexport { unescape } from './unescape.js'\n/* c8 ignore stop */\nminimatch.AST = AST\nminimatch.Minimatch = Minimatch\nminimatch.escape = escape\nminimatch.unescape = unescape\n"]}
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/package.json
new file mode 100644
index 0000000..3dbc1ca
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/package.json	
@@ -0,0 +1,3 @@
+{
+  "type": "module"
+}
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/unescape.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/unescape.d.ts
new file mode 100644
index 0000000..c4a1447
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/unescape.d.ts	
@@ -0,0 +1,22 @@
+import type { MinimatchOptions } from './index.js';
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+export declare const unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+//# sourceMappingURL=unescape.d.ts.map
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/unescape.d.ts.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/unescape.d.ts.map
new file mode 100644
index 0000000..09d6eab
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/unescape.d.ts.map	
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.d.ts","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAczE,CAAA"}
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/unescape.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/unescape.js
new file mode 100644
index 0000000..19ce86e
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/unescape.js	
@@ -0,0 +1,34 @@
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+export const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
+    if (magicalBraces) {
+        return windowsPathsNoEscape ?
+            s.replace(/\[([^/\\])\]/g, '$1')
+            : s
+                .replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
+                .replace(/\\([^/])/g, '$1');
+    }
+    return windowsPathsNoEscape ?
+        s.replace(/\[([^/\\{}])\]/g, '$1')
+        : s
+            .replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
+            .replace(/\\([^/{}])/g, '$1');
+};
+//# sourceMappingURL=unescape.js.map
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/unescape.js.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/unescape.js.map
new file mode 100644
index 0000000..6d50739
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/dist/esm/unescape.js.map	
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,IAAI,MACgD,EAAE,EACxE,EAAE;IACF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;YAClC,CAAC,CAAC,CAAC;iBACE,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC;iBAC3C,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;aACE,OAAO,CAAC,4BAA4B,EAAE,MAAM,CAAC;aAC7C,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;AACrC,CAAC,CAAA","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\n\nexport const unescape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n    magicalBraces = true,\n  }: Pick = {},\n) => {\n  if (magicalBraces) {\n    return windowsPathsNoEscape ?\n        s.replace(/\\[([^/\\\\])\\]/g, '$1')\n      : s\n          .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n          .replace(/\\\\([^/])/g, '$1')\n  }\n  return windowsPathsNoEscape ?\n      s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n    : s\n        .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n        .replace(/\\\\([^/{}])/g, '$1')\n}\n"]}
\ No newline at end of file
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/package.json
new file mode 100644
index 0000000..211875c
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/minimatch/package.json	
@@ -0,0 +1,73 @@
+{
+  "author": "Isaac Z. Schlueter  (http://blog.izs.me)",
+  "name": "minimatch",
+  "description": "a glob matcher in javascript",
+  "version": "10.2.5",
+  "repository": {
+    "type": "git",
+    "url": "git@github.com:isaacs/minimatch"
+  },
+  "main": "./dist/commonjs/index.js",
+  "types": "./dist/commonjs/index.d.ts",
+  "exports": {
+    "./package.json": "./package.json",
+    ".": {
+      "import": {
+        "types": "./dist/esm/index.d.ts",
+        "default": "./dist/esm/index.js"
+      },
+      "require": {
+        "types": "./dist/commonjs/index.d.ts",
+        "default": "./dist/commonjs/index.js"
+      }
+    }
+  },
+  "files": [
+    "dist"
+  ],
+  "scripts": {
+    "preversion": "npm test",
+    "postversion": "npm publish",
+    "prepublishOnly": "git push origin --follow-tags",
+    "prepare": "tshy",
+    "pretest": "npm run prepare",
+    "presnap": "npm run prepare",
+    "test": "tap",
+    "snap": "tap",
+    "format": "prettier --write .",
+    "benchmark": "node benchmark/index.js",
+    "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts",
+    "lint": "oxlint --fix src test",
+    "postsnap": "npm run lint",
+    "postlint": "npm run format"
+  },
+  "engines": {
+    "node": "18 || 20 || >=22"
+  },
+  "devDependencies": {
+    "@types/node": "^25.5.0",
+    "mkdirp": "^3.0.1",
+    "oxlint": "^1.57.0",
+    "oxlint-tsgolint": "^0.18.1",
+    "prettier": "^3.8.1",
+    "tap": "^21.6.2",
+    "tshy": "^4.0.0",
+    "typedoc": "^0.28.18"
+  },
+  "funding": {
+    "url": "https://github.com/sponsors/isaacs"
+  },
+  "license": "BlueOak-1.0.0",
+  "tshy": {
+    "exports": {
+      "./package.json": "./package.json",
+      ".": "./src/index.ts"
+    },
+    "selfLink": false
+  },
+  "type": "module",
+  "module": "./dist/esm/index.js",
+  "dependencies": {
+    "brace-expansion": "^5.0.5"
+  }
+}
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/ms/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/ms/index.js
new file mode 100644
index 0000000..ea734fb
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/ms/index.js	
@@ -0,0 +1,162 @@
+/**
+ * Helpers.
+ */
+
+var s = 1000;
+var m = s * 60;
+var h = m * 60;
+var d = h * 24;
+var w = d * 7;
+var y = d * 365.25;
+
+/**
+ * Parse or format the given `val`.
+ *
+ * Options:
+ *
+ *  - `long` verbose formatting [false]
+ *
+ * @param {String|Number} val
+ * @param {Object} [options]
+ * @throws {Error} throw an error if val is not a non-empty string or a number
+ * @return {String|Number}
+ * @api public
+ */
+
+module.exports = function (val, options) {
+  options = options || {};
+  var type = typeof val;
+  if (type === 'string' && val.length > 0) {
+    return parse(val);
+  } else if (type === 'number' && isFinite(val)) {
+    return options.long ? fmtLong(val) : fmtShort(val);
+  }
+  throw new Error(
+    'val is not a non-empty string or a valid number. val=' +
+      JSON.stringify(val)
+  );
+};
+
+/**
+ * Parse the given `str` and return milliseconds.
+ *
+ * @param {String} str
+ * @return {Number}
+ * @api private
+ */
+
+function parse(str) {
+  str = String(str);
+  if (str.length > 100) {
+    return;
+  }
+  var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
+    str
+  );
+  if (!match) {
+    return;
+  }
+  var n = parseFloat(match[1]);
+  var type = (match[2] || 'ms').toLowerCase();
+  switch (type) {
+    case 'years':
+    case 'year':
+    case 'yrs':
+    case 'yr':
+    case 'y':
+      return n * y;
+    case 'weeks':
+    case 'week':
+    case 'w':
+      return n * w;
+    case 'days':
+    case 'day':
+    case 'd':
+      return n * d;
+    case 'hours':
+    case 'hour':
+    case 'hrs':
+    case 'hr':
+    case 'h':
+      return n * h;
+    case 'minutes':
+    case 'minute':
+    case 'mins':
+    case 'min':
+    case 'm':
+      return n * m;
+    case 'seconds':
+    case 'second':
+    case 'secs':
+    case 'sec':
+    case 's':
+      return n * s;
+    case 'milliseconds':
+    case 'millisecond':
+    case 'msecs':
+    case 'msec':
+    case 'ms':
+      return n;
+    default:
+      return undefined;
+  }
+}
+
+/**
+ * Short format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtShort(ms) {
+  var msAbs = Math.abs(ms);
+  if (msAbs >= d) {
+    return Math.round(ms / d) + 'd';
+  }
+  if (msAbs >= h) {
+    return Math.round(ms / h) + 'h';
+  }
+  if (msAbs >= m) {
+    return Math.round(ms / m) + 'm';
+  }
+  if (msAbs >= s) {
+    return Math.round(ms / s) + 's';
+  }
+  return ms + 'ms';
+}
+
+/**
+ * Long format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtLong(ms) {
+  var msAbs = Math.abs(ms);
+  if (msAbs >= d) {
+    return plural(ms, msAbs, d, 'day');
+  }
+  if (msAbs >= h) {
+    return plural(ms, msAbs, h, 'hour');
+  }
+  if (msAbs >= m) {
+    return plural(ms, msAbs, m, 'minute');
+  }
+  if (msAbs >= s) {
+    return plural(ms, msAbs, s, 'second');
+  }
+  return ms + ' ms';
+}
+
+/**
+ * Pluralization helper.
+ */
+
+function plural(ms, msAbs, n, name) {
+  var isPlural = msAbs >= n * 1.5;
+  return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
+}
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/ms/license.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/ms/license.md
new file mode 100644
index 0000000..fa5d39b
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/ms/license.md	
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2020 Vercel, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/ms/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/ms/package.json
new file mode 100644
index 0000000..4997189
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/ms/package.json	
@@ -0,0 +1,38 @@
+{
+  "name": "ms",
+  "version": "2.1.3",
+  "description": "Tiny millisecond conversion utility",
+  "repository": "vercel/ms",
+  "main": "./index",
+  "files": [
+    "index.js"
+  ],
+  "scripts": {
+    "precommit": "lint-staged",
+    "lint": "eslint lib/* bin/*",
+    "test": "mocha tests.js"
+  },
+  "eslintConfig": {
+    "extends": "eslint:recommended",
+    "env": {
+      "node": true,
+      "es6": true
+    }
+  },
+  "lint-staged": {
+    "*.js": [
+      "npm run lint",
+      "prettier --single-quote --write",
+      "git add"
+    ]
+  },
+  "license": "MIT",
+  "devDependencies": {
+    "eslint": "4.18.2",
+    "expect.js": "0.3.1",
+    "husky": "0.14.3",
+    "lint-staged": "5.0.0",
+    "mocha": "4.0.1",
+    "prettier": "2.0.5"
+  }
+}
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/ms/readme.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/ms/readme.md
new file mode 100644
index 0000000..0fc1abb
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/ms/readme.md	
@@ -0,0 +1,59 @@
+# ms
+
+![CI](https://github.com/vercel/ms/workflows/CI/badge.svg)
+
+Use this package to easily convert various time formats to milliseconds.
+
+## Examples
+
+```js
+ms('2 days')  // 172800000
+ms('1d')      // 86400000
+ms('10h')     // 36000000
+ms('2.5 hrs') // 9000000
+ms('2h')      // 7200000
+ms('1m')      // 60000
+ms('5s')      // 5000
+ms('1y')      // 31557600000
+ms('100')     // 100
+ms('-3 days') // -259200000
+ms('-1h')     // -3600000
+ms('-200')    // -200
+```
+
+### Convert from Milliseconds
+
+```js
+ms(60000)             // "1m"
+ms(2 * 60000)         // "2m"
+ms(-3 * 60000)        // "-3m"
+ms(ms('10 hours'))    // "10h"
+```
+
+### Time Format Written-Out
+
+```js
+ms(60000, { long: true })             // "1 minute"
+ms(2 * 60000, { long: true })         // "2 minutes"
+ms(-3 * 60000, { long: true })        // "-3 minutes"
+ms(ms('10 hours'), { long: true })    // "10 hours"
+```
+
+## Features
+
+- Works both in [Node.js](https://nodejs.org) and in the browser
+- If a number is supplied to `ms`, a string with a unit is returned
+- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`)
+- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned
+
+## Related Packages
+
+- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time.
+
+## Caught a Bug?
+
+1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
+2. Link the package to the global module directory: `npm link`
+3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms!
+
+As always, you can run the tests using: `npm test`
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/License b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/License
new file mode 100644
index 0000000..c9348b9
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/License	
@@ -0,0 +1,19 @@
+Copyright (c) 2016 Andrey Sidorov (sidorares@yandex.ru) and contributors
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/README.md
new file mode 100644
index 0000000..7b5560f
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/README.md	
@@ -0,0 +1,114 @@
+[npm-image]: https://img.shields.io/npm/v/mysql2.svg
+[npm-url]: https://npmjs.com/package/mysql2
+[node-version-image]: https://img.shields.io/node/v/mysql2.svg
+[node-version-url]: https://nodejs.org/en/download
+[downloads-image]: https://img.shields.io/npm/dm/mysql2.svg
+[downloads-url]: https://npmjs.com/package/mysql2
+[license-url]: https://github.com/sidorares/node-mysql2/blob/master/License
+[license-image]: https://img.shields.io/npm/l/mysql2.svg?maxAge=2592000
+[node-mysql]: https://github.com/mysqljs/mysql
+[mysqljs]: https://github.com/mysqljs
+[mysql-native]: https://github.com/sidorares/nodejs-mysql-native
+[sidorares]: https://github.com/sidorares
+[TooTallNate]: https://gist.github.com/TooTallNate
+[starttls.js]: https://gist.github.com/TooTallNate/848444
+[node-mariasql]: https://github.com/mscdex/node-mariasql
+[contributors]: https://github.com/sidorares/node-mysql2/graphs/contributors
+[contributing]: https://github.com/sidorares/node-mysql2/blob/master/Contributing.md
+[docs-base]: https://sidorares.github.io/node-mysql2/docs
+[docs-base-zh-CN]: https://sidorares.github.io/node-mysql2/zh-CN/docs
+[docs-base-pt-BR]: https://sidorares.github.io/node-mysql2/pt-BR/docs
+[docs-prepared-statements]: https://sidorares.github.io/node-mysql2/docs/documentation/prepared-statements
+[docs-mysql-server]: https://sidorares.github.io/node-mysql2/docs/documentation/mysql-server
+[docs-promise-wrapper]: https://sidorares.github.io/node-mysql2/docs/documentation/promise-wrapper
+[docs-authentication-switch]: https://sidorares.github.io/node-mysql2/docs/documentation/authentication-switch
+[docs-streams]: https://sidorares.github.io/node-mysql2/docs/documentation/extras
+[docs-typescript-docs]: https://sidorares.github.io/node-mysql2/docs/documentation/typescript-examples
+[docs-qs-pooling]: https://sidorares.github.io/node-mysql2/docs#using-connection-pools
+[docs-qs-first-query]: https://sidorares.github.io/node-mysql2/docs#first-query
+[docs-qs-using-prepared-statements]: https://sidorares.github.io/node-mysql2/docs#using-prepared-statements
+[docs-examples]: https://sidorares.github.io/node-mysql2/docs/examples
+[docs-faq]: https://sidorares.github.io/node-mysql2/docs/faq
+[docs-documentation]: https://sidorares.github.io/node-mysql2/docs/documentation
+[docs-contributing]: https://sidorares.github.io/node-mysql2/docs/contributing/website
+[coverage]: https://img.shields.io/codecov/c/github/sidorares/node-mysql2
+[coverage-url]: https://app.codecov.io/github/sidorares/node-mysql2
+[ci-url]: https://github.com/sidorares/node-mysql2/actions/workflows/ci-coverage.yml?query=branch%3Amaster
+[ci-image]: https://img.shields.io/github/actions/workflow/status/sidorares/node-mysql2/ci-coverage.yml?event=push&style=flat&label=CI&branch=master
+
+# MySQL2
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![GitHub Workflow Status (with event)][ci-image]][ci-url]
+[![Codecov][coverage]][coverage-url]
+[![License][license-image]][license-url]
+
+[English][docs-base] | [简体中文][docs-base-zh-CN] | [Português (BR)][docs-base-pt-BR]
+
+> MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl [much more][docs-documentation].
+
+**Table of Contents**
+
+- [History and Why MySQL2](#history-and-why-mysql2)
+- [Installation](#installation)
+- [Documentation](#documentation)
+- [Acknowledgements](#acknowledgements)
+- [Contributing](#contributing)
+
+## History and Why MySQL2
+
+MySQL2 project is a continuation of [MySQL-Native][mysql-native]. Protocol parser code was rewritten from scratch and api changed to match popular [Node MySQL][node-mysql]. MySQL2 team is working together with [Node MySQL][node-mysql] team to factor out shared code and move it under [mysqljs][mysqljs] organization.
+
+MySQL2 is mostly API compatible with [Node MySQL][node-mysql] and supports majority of features. MySQL2 also offers these additional features:
+
+- Faster / Better Performance
+- [Prepared Statements][docs-prepared-statements]
+- MySQL Binary Log Protocol
+- [MySQL Server][docs-mysql-server]
+- Extended support for Encoding and Collation
+- [Promise Wrapper][docs-promise-wrapper]
+- Compression
+- SSL and [Authentication Switch][docs-authentication-switch]
+- [Custom Streams][docs-streams]
+- [Pooling][docs-qs-pooling]
+
+## Installation
+
+MySQL2 is free from native bindings and can be installed on Linux, Mac OS or Windows without any issues.
+
+```bash
+npm install --save mysql2
+```
+
+If you are using TypeScript, you will need to install `@types/node`.
+
+```bash
+npm install --save-dev @types/node
+```
+
+> For TypeScript documentation and examples, see [here][docs-typescript-docs].
+
+## Documentation
+
+- [Quickstart][docs-base]
+  - [First Query][docs-qs-first-query], [Using Prepared Statements][docs-qs-using-prepared-statements], [Using Connection Pools][docs-qs-pooling] and more.
+- [Documentation][docs-documentation]
+- [Examples][docs-examples]
+- [FAQ][docs-faq]
+
+## Acknowledgements
+
+- Internal protocol is written by [@sidorares][sidorares] [MySQL-Native][mysql-native].
+- Constants, SQL parameters interpolation, Pooling, `ConnectionConfig` class taken from [Node MySQL][node-mysql].
+- SSL upgrade code based on [@TooTallNate][TooTallNate] [code][starttls.js].
+- Secure connection / compressed connection api flags compatible to [MariaSQL][node-mariasql] client.
+- [Contributors][contributors].
+
+## Contributing
+
+Want to improve something in **MySQL2**?
+Please check [Contributing.md][contributing] for detailed instruction on how to get started.
+
+To contribute in **MySQL2 Documentation**, please visit the [Website Contributing Guidelines][docs-contributing] for detailed instruction on how to get started.
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/index.d.ts
new file mode 100644
index 0000000..35e7952
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/index.d.ts	
@@ -0,0 +1 @@
+export * from './typings/mysql/index.js';
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/index.js
new file mode 100644
index 0000000..c6a80d4
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/index.js	
@@ -0,0 +1,77 @@
+'use strict';
+
+const SqlString = require('sql-escaper');
+
+const ConnectionConfig = require('./lib/connection_config.js');
+const parserCache = require('./lib/parsers/parser_cache.js');
+
+const Connection = require('./lib/connection.js');
+
+exports.createConnection = require('./lib/create_connection.js');
+exports.connect = exports.createConnection;
+exports.Connection = Connection;
+exports.ConnectionConfig = ConnectionConfig;
+
+const Pool = require('./lib/pool.js');
+const PoolCluster = require('./lib/pool_cluster.js');
+const createPool = require('./lib/create_pool.js');
+const createPoolCluster = require('./lib/create_pool_cluster.js');
+
+exports.createPool = createPool;
+
+exports.createPoolCluster = createPoolCluster;
+
+exports.createQuery = Connection.createQuery;
+
+exports.Pool = Pool;
+
+exports.PoolCluster = PoolCluster;
+
+exports.createServer = function (handler) {
+  const Server = require('./lib/server.js');
+  const s = new Server();
+  if (handler) {
+    s.on('connection', handler);
+  }
+  return s;
+};
+
+exports.PoolConnection = require('./lib/pool_connection.js');
+exports.authPlugins = require('./lib/auth_plugins');
+exports.escape = SqlString.escape;
+exports.escapeId = SqlString.escapeId;
+exports.format = SqlString.format;
+exports.raw = SqlString.raw;
+
+exports.__defineGetter__(
+  'createConnectionPromise',
+  () => require('./promise.js').createConnection
+);
+
+exports.__defineGetter__(
+  'createPoolPromise',
+  () => require('./promise.js').createPool
+);
+
+exports.__defineGetter__(
+  'createPoolClusterPromise',
+  () => require('./promise.js').createPoolCluster
+);
+
+exports.__defineGetter__('Types', () => require('./lib/constants/types.js'));
+
+exports.__defineGetter__('Charsets', () =>
+  require('./lib/constants/charsets.js')
+);
+
+exports.__defineGetter__('CharsetToEncoding', () =>
+  require('./lib/constants/charset_encodings.js')
+);
+
+exports.setMaxParserCache = function (max) {
+  parserCache.setMaxCache(max);
+};
+
+exports.clearParserCache = function () {
+  parserCache.clearCache();
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_41.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_41.js
new file mode 100644
index 0000000..9245380
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_41.js	
@@ -0,0 +1,95 @@
+'use strict';
+
+/*
+4.1 authentication: (http://bazaar.launchpad.net/~mysql/mysql-server/5.5/view/head:/sql/password.c)
+
+  SERVER:  public_seed=create_random_string()
+           send(public_seed)
+
+  CLIENT:  recv(public_seed)
+           hash_stage1=sha1("password")
+           hash_stage2=sha1(hash_stage1)
+           reply=xor(hash_stage1, sha1(public_seed,hash_stage2)
+
+           // this three steps are done in scramble()
+
+           send(reply)
+
+
+  SERVER:  recv(reply)
+           hash_stage1=xor(reply, sha1(public_seed,hash_stage2))
+           candidate_hash2=sha1(hash_stage1)
+           check(candidate_hash2==hash_stage2)
+
+server stores sha1(sha1(password)) ( hash_stag2)
+*/
+
+const crypto = require('crypto');
+
+function sha1(msg, msg1, msg2) {
+  const hash = crypto.createHash('sha1');
+  hash.update(msg);
+  if (msg1) {
+    hash.update(msg1);
+  }
+
+  if (msg2) {
+    hash.update(msg2);
+  }
+
+  return hash.digest();
+}
+
+function xor(a, b) {
+  const result = Buffer.allocUnsafe(a.length);
+  for (let i = 0; i < a.length; i++) {
+    result[i] = a[i] ^ b[i];
+  }
+  return result;
+}
+
+exports.xor = xor;
+
+function token(password, scramble1, scramble2) {
+  if (!password) {
+    return Buffer.alloc(0);
+  }
+  const stage1 = sha1(password);
+  return exports.calculateTokenFromPasswordSha(stage1, scramble1, scramble2);
+}
+
+exports.calculateTokenFromPasswordSha = function (
+  passwordSha,
+  scramble1,
+  scramble2
+) {
+  // we use AUTH 41 here, and we need only the bytes we just need.
+  const authPluginData1 = scramble1.slice(0, 8);
+  const authPluginData2 = scramble2.slice(0, 12);
+  const stage2 = sha1(passwordSha);
+  const stage3 = sha1(authPluginData1, authPluginData2, stage2);
+  return xor(stage3, passwordSha);
+};
+
+exports.calculateToken = token;
+
+exports.verifyToken = function (publicSeed1, publicSeed2, token, doubleSha) {
+  const hashStage1 = xor(token, sha1(publicSeed1, publicSeed2, doubleSha));
+  const candidateHash2 = sha1(hashStage1);
+  return candidateHash2.compare(doubleSha) === 0;
+};
+
+exports.doubleSha1 = function (password) {
+  return sha1(sha1(password));
+};
+
+function xorRotating(a, seed) {
+  const result = Buffer.allocUnsafe(a.length);
+  const seedLen = seed.length;
+
+  for (let i = 0; i < a.length; i++) {
+    result[i] = a[i] ^ seed[i % seedLen];
+  }
+  return result;
+}
+exports.xorRotating = xorRotating;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js
new file mode 100644
index 0000000..4bf9630
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js	
@@ -0,0 +1,115 @@
+'use strict';
+
+// https://mysqlserverteam.com/mysql-8-0-4-new-default-authentication-plugin-caching_sha2_password/
+
+const PLUGIN_NAME = 'caching_sha2_password';
+const crypto = require('crypto');
+const { xor, xorRotating } = require('../auth_41');
+
+const REQUEST_SERVER_KEY_PACKET = Buffer.from([2]);
+const FAST_AUTH_SUCCESS_PACKET = Buffer.from([3]);
+const PERFORM_FULL_AUTHENTICATION_PACKET = Buffer.from([4]);
+
+const STATE_INITIAL = 0;
+const STATE_TOKEN_SENT = 1;
+const STATE_WAIT_SERVER_KEY = 2;
+const STATE_FINAL = -1;
+
+function sha256(msg) {
+  const hash = crypto.createHash('sha256');
+  hash.update(msg);
+  return hash.digest();
+}
+
+function calculateToken(password, scramble) {
+  if (!password) {
+    return Buffer.alloc(0);
+  }
+  const stage1 = sha256(Buffer.from(password));
+  const stage2 = sha256(stage1);
+  const stage3 = sha256(Buffer.concat([stage2, scramble]));
+  return xor(stage1, stage3);
+}
+
+function encrypt(password, scramble, key) {
+  const stage1 = xorRotating(Buffer.from(`${password}\0`, 'utf8'), scramble);
+  return crypto.publicEncrypt(
+    {
+      key,
+      oaepHash: 'sha1',
+      padding: crypto.constants.RSA_PKCS1_OAEP_PADDING,
+    },
+    stage1
+  );
+}
+
+const pluginFactory =
+  (pluginOptions = {}) =>
+  ({ connection }) => {
+    let state = 0;
+    let scramble = null;
+
+    const password = connection.config.password;
+
+    const authWithKey = (serverKey) => {
+      const _password = encrypt(password, scramble, serverKey);
+      state = STATE_FINAL;
+      return _password;
+    };
+
+    return (data) => {
+      switch (state) {
+        case STATE_INITIAL:
+          scramble = data.slice(0, 20);
+          state = STATE_TOKEN_SENT;
+          return calculateToken(password, scramble);
+
+        case STATE_TOKEN_SENT:
+          if (FAST_AUTH_SUCCESS_PACKET.equals(data)) {
+            state = STATE_FINAL;
+            return null;
+          }
+
+          if (PERFORM_FULL_AUTHENTICATION_PACKET.equals(data)) {
+            const isSecureConnection =
+              typeof pluginOptions.overrideIsSecure === 'undefined'
+                ? connection.config.ssl || connection.config.socketPath
+                : pluginOptions.overrideIsSecure;
+            if (isSecureConnection) {
+              state = STATE_FINAL;
+              return Buffer.from(`${password}\0`, 'utf8');
+            }
+
+            // if client provides key we can save one extra roundrip on first connection
+            if (pluginOptions.serverPublicKey) {
+              return authWithKey(pluginOptions.serverPublicKey);
+            }
+
+            state = STATE_WAIT_SERVER_KEY;
+            return REQUEST_SERVER_KEY_PACKET;
+          }
+          throw new Error(
+            `Invalid AuthMoreData packet received by ${PLUGIN_NAME} plugin in STATE_TOKEN_SENT state.`
+          );
+        case STATE_WAIT_SERVER_KEY:
+          if (pluginOptions.onServerPublicKey) {
+            pluginOptions.onServerPublicKey(data);
+          }
+          return authWithKey(data);
+        case STATE_FINAL:
+          throw new Error(
+            `Unexpected data in AuthMoreData packet received by ${PLUGIN_NAME} plugin in STATE_FINAL state.`
+          );
+      }
+
+      throw new Error(
+        `Unexpected data in AuthMoreData packet received by ${PLUGIN_NAME} plugin in state ${state}`
+      );
+    };
+  };
+
+// Export the plugin factory as default
+module.exports = pluginFactory;
+
+// Export calculateToken for reuse in initial handshake optimization
+module.exports.calculateToken = calculateToken;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.md
new file mode 100644
index 0000000..5d67239
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.md	
@@ -0,0 +1,18 @@
+##
+
+https://dev.mysql.com/doc/refman/8.0/en/caching-sha2-pluggable-authentication.html
+
+```js
+const mysql = require('mysql');
+mysql.createConnection({
+  authPlugins: {
+    caching_sha2_password: mysql.authPlugins.caching_sha2_password({
+      onServerPublikKey: function (key) {
+        console.log(key);
+      },
+      serverPublicKey: 'xxxyyy',
+      overrideIsSecure: true, //
+    }),
+  },
+});
+```
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/index.js
new file mode 100644
index 0000000..dd4dc98
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/index.js	
@@ -0,0 +1,8 @@
+'use strict';
+
+module.exports = {
+  caching_sha2_password: require('./caching_sha2_password'),
+  mysql_clear_password: require('./mysql_clear_password'),
+  mysql_native_password: require('./mysql_native_password'),
+  sha256_password: require('./sha256_password'),
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js
new file mode 100644
index 0000000..1e0e321
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js	
@@ -0,0 +1,17 @@
+'use strict';
+
+function bufferFromStr(str) {
+  return Buffer.from(`${str}\0`);
+}
+
+const create_mysql_clear_password_plugin = (pluginOptions) =>
+  function mysql_clear_password_plugin({ connection, command }) {
+    const password =
+      command.password || pluginOptions.password || connection.config.password;
+
+    return function (/* pluginData */) {
+      return bufferFromStr(password);
+    };
+  };
+
+module.exports = create_mysql_clear_password_plugin;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js
new file mode 100644
index 0000000..b4f4b87
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js	
@@ -0,0 +1,34 @@
+'use strict';
+
+//const PLUGIN_NAME = 'mysql_native_password';
+const auth41 = require('../auth_41.js');
+
+module.exports =
+  (pluginOptions) =>
+  ({ connection, command }) => {
+    const password =
+      command.password || pluginOptions.password || connection.config.password;
+    const passwordSha1 =
+      command.passwordSha1 ||
+      pluginOptions.passwordSha1 ||
+      connection.config.passwordSha1;
+    return (data) => {
+      const authPluginData1 = data.slice(0, 8);
+      const authPluginData2 = data.slice(8, 20);
+      let authToken;
+      if (passwordSha1) {
+        authToken = auth41.calculateTokenFromPasswordSha(
+          passwordSha1,
+          authPluginData1,
+          authPluginData2
+        );
+      } else {
+        authToken = auth41.calculateToken(
+          password,
+          authPluginData1,
+          authPluginData2
+        );
+      }
+      return authToken;
+    };
+  };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/sha256_password.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/sha256_password.js
new file mode 100644
index 0000000..53c2083
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/auth_plugins/sha256_password.js	
@@ -0,0 +1,74 @@
+'use strict';
+
+const PLUGIN_NAME = 'sha256_password';
+const crypto = require('crypto');
+const { xorRotating } = require('../auth_41');
+const Tls = require('tls');
+
+const REQUEST_SERVER_KEY_PACKET = Buffer.from([1]);
+
+const STATE_INITIAL = 0;
+const STATE_WAIT_SERVER_KEY = 1;
+const STATE_FINAL = -1;
+
+function encrypt(password, scramble, key) {
+  const stage1 = xorRotating(Buffer.from(`${password}\0`, 'utf8'), scramble);
+  return crypto.publicEncrypt(
+    {
+      key,
+      oaepHash: 'sha1',
+    },
+    stage1
+  );
+}
+
+module.exports =
+  (pluginOptions = {}) =>
+  ({ connection }) => {
+    let state = 0;
+    let scramble = null;
+
+    const password = connection.config.password;
+
+    const authWithKey = (serverKey) => {
+      const _password = encrypt(password, scramble, serverKey);
+      state = STATE_FINAL;
+      return _password;
+    };
+
+    return (data) => {
+      switch (state) {
+        case STATE_INITIAL:
+          if (
+            connection.stream instanceof Tls.TLSSocket &&
+            connection.stream.encrypted === true
+          ) {
+            // We don't need to encrypt passwords over TLS connection
+            return Buffer.from(`${password}\0`, 'utf8');
+          }
+
+          scramble = data.slice(0, 20);
+          // if client provides key we can save one extra roundrip on first connection
+          if (pluginOptions.serverPublicKey) {
+            return authWithKey(pluginOptions.serverPublicKey);
+          }
+
+          state = STATE_WAIT_SERVER_KEY;
+          return REQUEST_SERVER_KEY_PACKET;
+
+        case STATE_WAIT_SERVER_KEY:
+          if (pluginOptions.onServerPublicKey) {
+            pluginOptions.onServerPublicKey(data);
+          }
+          return authWithKey(data);
+        case STATE_FINAL:
+          throw new Error(
+            `Unexpected data in AuthMoreData packet received by ${PLUGIN_NAME} plugin in STATE_FINAL state.`
+          );
+      }
+
+      throw new Error(
+        `Unexpected data in AuthMoreData packet received by ${PLUGIN_NAME} plugin in state ${state}`
+      );
+    };
+  };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/base/connection.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/base/connection.js
new file mode 100644
index 0000000..845876c
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/base/connection.js	
@@ -0,0 +1,1135 @@
+// This file was modified by Oracle on June 1, 2021.
+// The changes involve new logic to handle an additional ERR Packet sent by
+// the MySQL server when the connection is closed unexpectedly.
+// Modifications copyright (c) 2021, Oracle and/or its affiliates.
+
+// This file was modified by Oracle on June 17, 2021.
+// The changes involve logic to ensure the socket connection is closed when
+// there is a fatal error.
+// Modifications copyright (c) 2021, Oracle and/or its affiliates.
+
+// This file was modified by Oracle on September 21, 2021.
+// The changes involve passing additional authentication factor passwords
+// to the ChangeUser Command instance.
+// Modifications copyright (c) 2021, Oracle and/or its affiliates.
+
+'use strict';
+
+const Net = require('net');
+const Tls = require('tls');
+const Timers = require('timers');
+const EventEmitter = require('events').EventEmitter;
+const Readable = require('stream').Readable;
+const Queue = require('denque');
+const SqlString = require('sql-escaper');
+const { createLRU } = require('lru.min');
+const PacketParser = require('../packet_parser.js');
+const Packets = require('../packets/index.js');
+const Commands = require('../commands/index.js');
+const ConnectionConfig = require('../connection_config.js');
+const CharsetToEncoding = require('../constants/charset_encodings.js');
+const {
+  traceCallback,
+  tracePromise,
+  getServerContext,
+  shouldTrace,
+  queryChannel,
+  executeChannel,
+  connectChannel,
+} = require('../tracing.js');
+
+let _connectionId = 0;
+
+let convertNamedPlaceholders = null;
+
+class BaseConnection extends EventEmitter {
+  constructor(opts) {
+    super();
+    this.config = opts.config;
+    // TODO: fill defaults
+    // if no params, connect to /var/lib/mysql/mysql.sock ( /tmp/mysql.sock on OSX )
+    // if host is given, connect to host:3306
+    // TODO: use `/usr/local/mysql/bin/mysql_config --socket` output? as default socketPath
+    // if there is no host/port and no socketPath parameters?
+    if (!opts.config.stream) {
+      if (opts.config.socketPath) {
+        this.stream = Net.connect(opts.config.socketPath);
+      } else {
+        this.stream = Net.connect(opts.config.port, opts.config.host);
+
+        // Optionally enable keep-alive on the socket.
+        if (this.config.enableKeepAlive) {
+          this.stream.on('connect', () => {
+            this.stream.setKeepAlive(true, this.config.keepAliveInitialDelay);
+          });
+        }
+
+        // Enable TCP_NODELAY flag. This is needed so that the network packets
+        // are sent immediately to the server
+        this.stream.setNoDelay(true);
+      }
+      // if stream is a function, treat it as "stream agent / factory"
+    } else if (typeof opts.config.stream === 'function') {
+      this.stream = opts.config.stream(opts);
+    } else {
+      this.stream = opts.config.stream;
+    }
+
+    this._internalId = _connectionId++;
+    this._commands = new Queue();
+    this._command = null;
+    this._paused = false;
+    this._paused_packets = new Queue();
+    this._statements = createLRU({
+      max: this.config.maxPreparedStatements,
+      onEviction: function (_, statement) {
+        statement.close();
+      },
+    });
+    this.serverCapabilityFlags = 0;
+    this.authorized = false;
+    this.sequenceId = 0;
+    this.compressedSequenceId = 0;
+    this.threadId = null;
+    this._handshakePacket = null;
+    this._fatalError = null;
+    this._protocolError = null;
+    this._outOfOrderPackets = [];
+    this.clientEncoding = CharsetToEncoding[this.config.charsetNumber];
+    this.stream.on('error', this._handleNetworkError.bind(this));
+    // see https://gist.github.com/khoomeister/4985691#use-that-instead-of-bind
+    this.packetParser = new PacketParser((p) => {
+      this.handlePacket(p);
+    });
+    this.stream.on('data', (data) => {
+      if (this.connectTimeout) {
+        Timers.clearTimeout(this.connectTimeout);
+        this.connectTimeout = null;
+      }
+      this.packetParser.execute(data);
+    });
+    this.stream.on('end', () => {
+      // emit the end event so that the pooled connection can close the connection
+      this.emit('end');
+    });
+    this.stream.on('close', () => {
+      // we need to set this flag everywhere where we want connection to close
+      if (this._closing) {
+        return;
+      }
+      if (!this._protocolError) {
+        // no particular error message before disconnect
+        this._protocolError = new Error(
+          'Connection lost: The server closed the connection.'
+        );
+        this._protocolError.fatal = true;
+        this._protocolError.code = 'PROTOCOL_CONNECTION_LOST';
+      }
+      this._notifyError(this._protocolError);
+    });
+    let handshakeCommand;
+    if (!this.config.isServer) {
+      handshakeCommand = new Commands.ClientHandshake(this.config.clientFlags);
+      handshakeCommand.on('end', () => {
+        // this happens when handshake finishes early either because there was
+        // some fatal error or the server sent an error packet instead of
+        // an hello packet (for example, 'Too many connections' error)
+        if (
+          !handshakeCommand.handshake ||
+          this._fatalError ||
+          this._protocolError
+        ) {
+          return;
+        }
+        this._handshakePacket = handshakeCommand.handshake;
+        this.threadId = handshakeCommand.handshake.connectionId;
+        this.emit('connect', handshakeCommand.handshake);
+      });
+      handshakeCommand.on('error', (err) => {
+        this._closing = true;
+        this._notifyError(err);
+      });
+      this.addCommand(handshakeCommand);
+
+      // Trace the connection handshake
+      if (shouldTrace(connectChannel)) {
+        const config = this.config;
+        tracePromise(
+          connectChannel,
+          () =>
+            new Promise((resolve, reject) => {
+              /* eslint-disable prefer-const */
+              let onConnect, onError;
+              onConnect = (param) => {
+                this.removeListener('error', onError);
+                resolve(param);
+              };
+              onError = (err) => {
+                this.removeListener('connect', onConnect);
+                reject(err);
+              };
+              /* eslint-enable prefer-const */
+              this.once('connect', onConnect);
+              this.once('error', onError);
+            }),
+          () => {
+            const server = getServerContext(config);
+            return {
+              database: config.database || '',
+              serverAddress: server.serverAddress,
+              serverPort: server.serverPort,
+              user: config.user || '',
+            };
+          }
+        ).catch(() => {
+          // errors are already handled by the handshake error listener
+        });
+      }
+    }
+    // in case there was no initial handshake but we need to read sting, assume it utf-8
+    // most common example: "Too many connections" error ( packet is sent immediately on connection attempt, we don't know server encoding yet)
+    // will be overwritten with actual encoding value as soon as server handshake packet is received
+    this.serverEncoding = 'utf8';
+    if (this.config.connectTimeout) {
+      const timeoutHandler = this._handleTimeoutError.bind(this);
+      this.connectTimeout = Timers.setTimeout(
+        timeoutHandler,
+        this.config.connectTimeout
+      );
+    }
+  }
+
+  _addCommandClosedState(cmd) {
+    const err = new Error(
+      "Can't add new command when connection is in closed state"
+    );
+    err.fatal = true;
+    if (cmd.onResult) {
+      cmd.onResult(err);
+    } else {
+      this.emit('error', err);
+    }
+  }
+
+  _handleFatalError(err) {
+    err.fatal = true;
+    // stop receiving packets
+    this.stream.removeAllListeners('data');
+    this.addCommand = this._addCommandClosedState;
+    this.write = () => {
+      this.emit('error', new Error("Can't write in closed state"));
+    };
+    this._notifyError(err);
+    this._fatalError = err;
+  }
+
+  _handleNetworkError(err) {
+    if (this.connectTimeout) {
+      Timers.clearTimeout(this.connectTimeout);
+      this.connectTimeout = null;
+    }
+    // Do not throw an error when a connection ends with a RST,ACK packet
+    if (err.code === 'ECONNRESET' && this._closing) {
+      return;
+    }
+    this._handleFatalError(err);
+  }
+
+  _handleTimeoutError() {
+    if (this.connectTimeout) {
+      Timers.clearTimeout(this.connectTimeout);
+      this.connectTimeout = null;
+    }
+    this.stream.destroy && this.stream.destroy();
+    const err = new Error('connect ETIMEDOUT');
+    err.errorno = 'ETIMEDOUT';
+    err.code = 'ETIMEDOUT';
+    err.syscall = 'connect';
+    this._handleNetworkError(err);
+  }
+
+  // notify all commands in the queue and bubble error as connection "error"
+  // called on stream error or unexpected termination
+  _notifyError(err) {
+    if (this.connectTimeout) {
+      Timers.clearTimeout(this.connectTimeout);
+      this.connectTimeout = null;
+    }
+    // prevent from emitting 'PROTOCOL_CONNECTION_LOST' after EPIPE or ECONNRESET
+    if (this._fatalError) {
+      return;
+    }
+    let command;
+    // if there is no active command, notify connection
+    // if there are commands and all of them have callbacks, pass error via callback
+    let bubbleErrorToConnection = !this._command;
+    if (this._command && this._command.onResult) {
+      this._command.onResult(err);
+      this._command = null;
+      // connection handshake is special because we allow it to be implicit
+      // if error happened during handshake, but there are others commands in queue
+      // then bubble error to other commands and not to connection
+    } else if (
+      !(
+        this._command &&
+        this._command.constructor === Commands.ClientHandshake &&
+        this._commands.length > 0
+      )
+    ) {
+      bubbleErrorToConnection = true;
+    }
+    while ((command = this._commands.shift())) {
+      if (command.onResult) {
+        command.onResult(err);
+      } else {
+        bubbleErrorToConnection = true;
+      }
+    }
+    // notify connection if some comands in the queue did not have callbacks
+    // or if this is pool connection ( so it can be removed from pool )
+    if (bubbleErrorToConnection || this._pool) {
+      this.emit('error', err);
+    }
+    // close connection after emitting the event in case of a fatal error
+    if (err.fatal) {
+      this.close();
+    }
+  }
+
+  write(buffer) {
+    const result = this.stream.write(buffer, (err) => {
+      if (err) {
+        this._handleNetworkError(err);
+      }
+    });
+
+    if (!result) {
+      this.stream.emit('pause');
+    }
+  }
+
+  // http://dev.mysql.com/doc/internals/en/sequence-id.html
+  //
+  // The sequence-id is incremented with each packet and may wrap around.
+  // It starts at 0 and is reset to 0 when a new command
+  // begins in the Command Phase.
+  // http://dev.mysql.com/doc/internals/en/example-several-mysql-packets.html
+  _resetSequenceId() {
+    this.sequenceId = 0;
+    this.compressedSequenceId = 0;
+  }
+
+  _bumpCompressedSequenceId(numPackets) {
+    this.compressedSequenceId += numPackets;
+    this.compressedSequenceId %= 256;
+  }
+
+  _bumpSequenceId(numPackets) {
+    this.sequenceId += numPackets;
+    this.sequenceId %= 256;
+  }
+
+  writePacket(packet) {
+    const MAX_PACKET_LENGTH = 16777215;
+    const length = packet.length();
+    let chunk, offset, header;
+    if (length < MAX_PACKET_LENGTH) {
+      packet.writeHeader(this.sequenceId);
+      if (this.config.debug) {
+        console.log(
+          `${this._internalId} ${this.connectionId} <== ${this._command._commandName}#${this._command.stateName()}(${[this.sequenceId, packet._name, packet.length()].join(',')})`
+        );
+        console.log(
+          `${this._internalId} ${this.connectionId} <== ${packet.buffer.toString('hex')}`
+        );
+      }
+      this._bumpSequenceId(1);
+      this.write(packet.buffer);
+    } else {
+      if (this.config.debug) {
+        console.log(
+          `${this._internalId} ${this.connectionId} <== Writing large packet, raw content not written:`
+        );
+        console.log(
+          `${this._internalId} ${this.connectionId} <== ${this._command._commandName}#${this._command.stateName()}(${[this.sequenceId, packet._name, packet.length()].join(',')})`
+        );
+      }
+      for (offset = 4; offset < 4 + length; offset += MAX_PACKET_LENGTH) {
+        chunk = packet.buffer.slice(offset, offset + MAX_PACKET_LENGTH);
+        if (chunk.length === MAX_PACKET_LENGTH) {
+          header = Buffer.from([0xff, 0xff, 0xff, this.sequenceId]);
+        } else {
+          header = Buffer.from([
+            chunk.length & 0xff,
+            (chunk.length >> 8) & 0xff,
+            (chunk.length >> 16) & 0xff,
+            this.sequenceId,
+          ]);
+        }
+        this._bumpSequenceId(1);
+        this.write(header);
+        this.write(chunk);
+      }
+    }
+  }
+
+  // 0.11+ environment
+  startTLS(onSecure) {
+    if (this.config.debug) {
+      console.log('Upgrading connection to TLS');
+    }
+    const secureContext = Tls.createSecureContext({
+      ca: this.config.ssl.ca,
+      cert: this.config.ssl.cert,
+      ciphers: this.config.ssl.ciphers,
+      key: this.config.ssl.key,
+      passphrase: this.config.ssl.passphrase,
+      minVersion: this.config.ssl.minVersion,
+      maxVersion: this.config.ssl.maxVersion,
+    });
+    const rejectUnauthorized = this.config.ssl.rejectUnauthorized;
+    const verifyIdentity = this.config.ssl.verifyIdentity;
+    const servername = Net.isIP(this.config.host)
+      ? undefined
+      : this.config.host;
+
+    let secureEstablished = false;
+    this.stream.removeAllListeners('data');
+    const secureSocket = Tls.connect(
+      {
+        rejectUnauthorized,
+        requestCert: rejectUnauthorized,
+        checkServerIdentity: verifyIdentity
+          ? Tls.checkServerIdentity
+          : function () {
+              return undefined;
+            },
+        secureContext,
+        isServer: false,
+        socket: this.stream,
+        servername,
+      },
+      () => {
+        secureEstablished = true;
+        if (rejectUnauthorized) {
+          if (typeof servername === 'string' && verifyIdentity) {
+            const cert = secureSocket.getPeerCertificate(true);
+            const serverIdentityCheckError = Tls.checkServerIdentity(
+              servername,
+              cert
+            );
+            if (serverIdentityCheckError) {
+              onSecure(serverIdentityCheckError);
+              return;
+            }
+          }
+        }
+        onSecure();
+      }
+    );
+    // error handler for secure socket
+    secureSocket.on('error', (err) => {
+      if (secureEstablished) {
+        this._handleNetworkError(err);
+      } else {
+        onSecure(err);
+      }
+    });
+    secureSocket.on('data', (data) => {
+      this.packetParser.execute(data);
+    });
+    this.stream = secureSocket;
+  }
+
+  protocolError(message, code) {
+    // Starting with MySQL 8.0.24, if the client closes the connection
+    // unexpectedly, the server will send a last ERR Packet, which we can
+    // safely ignore.
+    // https://dev.mysql.com/worklog/task/?id=12999
+    if (this._closing) {
+      return;
+    }
+
+    const err = new Error(message);
+    err.fatal = true;
+    err.code = code || 'PROTOCOL_ERROR';
+    this.emit('error', err);
+  }
+
+  get state() {
+    // Error state has highest priority
+    if (this._fatalError || this._protocolError) {
+      return 'error';
+    }
+
+    // Closing state has second priority
+    if (this._closing || (this.stream && this.stream.destroyed)) {
+      return 'disconnected';
+    }
+
+    // Authenticated state has third priority
+    if (this.authorized) {
+      return 'authenticated';
+    }
+
+    // Connected state: handshake completed but not yet authorized
+    // This matches the original mysql driver's 'connected' state
+    if (this._handshakePacket) {
+      return 'connected';
+    }
+
+    // Protocol handshake state: connection established, handshake in progress
+    if (this.stream && !this.stream.destroyed) {
+      return 'protocol_handshake';
+    }
+
+    // Default: not connected
+    return 'disconnected';
+  }
+
+  get fatalError() {
+    return this._fatalError;
+  }
+
+  handlePacket(packet) {
+    if (this._paused) {
+      this._paused_packets.push(packet);
+      return;
+    }
+    if (this.config.debug) {
+      if (packet) {
+        console.log(
+          ` raw: ${packet.buffer
+            .slice(packet.offset, packet.offset + packet.length())
+            .toString('hex')}`
+        );
+        console.trace();
+        const commandName = this._command
+          ? this._command._commandName
+          : '(no command)';
+        const stateName = this._command
+          ? this._command.stateName()
+          : '(no command)';
+        console.log(
+          `${this._internalId} ${this.connectionId} ==> ${commandName}#${stateName}(${[packet.sequenceId, packet.type(), packet.length()].join(',')})`
+        );
+      }
+    }
+    if (!this._command) {
+      const marker = packet.peekByte();
+      // If it's an Err Packet, we should use it.
+      if (marker === 0xff) {
+        const error = Packets.Error.fromPacket(packet);
+        this.protocolError(error.message, error.code);
+      } else {
+        // Otherwise, it means it's some other unexpected packet.
+        this.protocolError(
+          'Unexpected packet while no commands in the queue',
+          'PROTOCOL_UNEXPECTED_PACKET'
+        );
+      }
+      this.close();
+      return;
+    }
+    if (packet) {
+      // Note: when server closes connection due to inactivity, Err packet ER_CLIENT_INTERACTION_TIMEOUT from MySQL 8.0.24, sequenceId will be 0
+      if (this.sequenceId !== packet.sequenceId) {
+        const err = new Error(
+          `Warning: got packets out of order. Expected ${this.sequenceId} but received ${packet.sequenceId}`
+        );
+        err.expected = this.sequenceId;
+        err.received = packet.sequenceId;
+        this.emit('warn', err); // REVIEW
+        console.error(err.message);
+      }
+      this._bumpSequenceId(packet.numPackets);
+    }
+    try {
+      if (this._fatalError) {
+        // skip remaining packets after client is in the error state
+        return;
+      }
+      const done = this._command.execute(packet, this);
+      if (done) {
+        this._command = this._commands.shift();
+        if (this._command) {
+          this.sequenceId = 0;
+          this.compressedSequenceId = 0;
+          this.handlePacket();
+        }
+      }
+    } catch (err) {
+      this._handleFatalError(err);
+      this.stream.destroy();
+    }
+  }
+
+  addCommand(cmd) {
+    // this.compressedSequenceId = 0;
+    // this.sequenceId = 0;
+    if (this.config.debug) {
+      const commandName = cmd.constructor.name;
+      console.log(`Add command: ${commandName}`);
+      cmd._commandName = commandName;
+    }
+    if (!this._command) {
+      this._command = cmd;
+      this.handlePacket();
+    } else {
+      this._commands.push(cmd);
+    }
+    return cmd;
+  }
+
+  format(sql, values) {
+    if (typeof this.config.queryFormat === 'function') {
+      return this.config.queryFormat.call(
+        this,
+        sql,
+        values,
+        this.config.timezone
+      );
+    }
+    const opts = {
+      sql: sql,
+      values: values,
+    };
+    this._resolveNamedPlaceholders(opts);
+    return SqlString.format(
+      opts.sql,
+      opts.values,
+      this.config.stringifyObjects,
+      this.config.timezone
+    );
+  }
+
+  escape(value) {
+    return SqlString.escape(value, false, this.config.timezone);
+  }
+
+  escapeId(value) {
+    return SqlString.escapeId(value, false);
+  }
+
+  raw(sql) {
+    return SqlString.raw(sql);
+  }
+
+  _resolveNamedPlaceholders(options) {
+    let unnamed;
+    if (this.config.namedPlaceholders || options.namedPlaceholders) {
+      if (Array.isArray(options.values)) {
+        // if an array is provided as the values, assume the conversion is not necessary.
+        // this allows the usage of unnamed placeholders even if the namedPlaceholders flag is enabled.
+        return;
+      }
+      if (convertNamedPlaceholders === null) {
+        convertNamedPlaceholders = require('named-placeholders')();
+      }
+      unnamed = convertNamedPlaceholders(options.sql, options.values);
+      options.sql = unnamed[0];
+      options.values = unnamed[1];
+    }
+  }
+
+  query(sql, values, cb) {
+    let cmdQuery;
+    if (sql.constructor === Commands.Query) {
+      cmdQuery = sql;
+    } else {
+      cmdQuery = BaseConnection.createQuery(sql, values, cb, this.config);
+    }
+    this._resolveNamedPlaceholders(cmdQuery);
+    const rawSql = this.format(
+      cmdQuery.sql,
+      cmdQuery.values !== undefined ? cmdQuery.values : []
+    );
+    cmdQuery.sql = rawSql;
+
+    if (cmdQuery.onResult) {
+      // Callback mode: traceCallback wraps the callback with tracing lifecycle, or calls through directly when no subscribers are registered
+      traceCallback(
+        queryChannel,
+        (wrappedCb) => {
+          cmdQuery.onResult = wrappedCb;
+          this.addCommand(cmdQuery);
+        },
+        0,
+        () => {
+          const server = getServerContext(this.config);
+          return {
+            query: cmdQuery.sql,
+            values: cmdQuery.values,
+            database: this.config.database || '',
+            serverAddress: server.serverAddress,
+            serverPort: server.serverPort,
+          };
+        },
+        null,
+        cmdQuery.onResult
+      );
+    } else if (shouldTrace(queryChannel)) {
+      // Event-emitter mode: tracePromise wraps the async lifecycle
+      tracePromise(
+        queryChannel,
+        () =>
+          new Promise((resolve, reject) => {
+            cmdQuery.once('error', reject);
+            cmdQuery.once('end', () => resolve());
+            this.addCommand(cmdQuery);
+          }),
+        () => {
+          const server = getServerContext(this.config);
+          return {
+            query: cmdQuery.sql,
+            values: cmdQuery.values,
+            database: this.config.database || '',
+            serverAddress: server.serverAddress,
+            serverPort: server.serverPort,
+          };
+        }
+      ).catch(() => {
+        // errors are already emitted on the command
+      });
+    } else {
+      this.addCommand(cmdQuery);
+    }
+
+    return cmdQuery;
+  }
+
+  pause() {
+    this._paused = true;
+    this.stream.pause();
+  }
+
+  resume() {
+    let packet;
+    this._paused = false;
+    while ((packet = this._paused_packets.shift())) {
+      this.handlePacket(packet);
+      // don't resume if packet handler paused connection
+      if (this._paused) {
+        return;
+      }
+    }
+    this.stream.resume();
+  }
+
+  // TODO: named placeholders support
+  prepare(options, cb) {
+    if (typeof options === 'string') {
+      options = { sql: options };
+    }
+    return this.addCommand(new Commands.Prepare(options, cb));
+  }
+
+  unprepare(sql) {
+    let options = {};
+    if (typeof sql === 'object') {
+      options = sql;
+    } else {
+      options.sql = sql;
+    }
+    const key = BaseConnection.statementKey(options);
+    const stmt = this._statements.get(key);
+    if (stmt) {
+      this._statements.delete(key);
+      stmt.close();
+    }
+    return stmt;
+  }
+
+  execute(sql, values, cb) {
+    let options = {
+      infileStreamFactory: this.config.infileStreamFactory,
+    };
+    if (typeof sql === 'object') {
+      // execute(options, cb)
+      options = {
+        ...options,
+        ...sql,
+        sql: sql.sql,
+        values: sql.values,
+      };
+      if (typeof values === 'function') {
+        cb = values;
+      } else {
+        options.values = options.values || values;
+      }
+    } else if (typeof values === 'function') {
+      // execute(sql, cb)
+      cb = values;
+      options.sql = sql;
+      options.values = undefined;
+    } else {
+      // execute(sql, values, cb)
+      options.sql = sql;
+      options.values = values;
+    }
+    this._resolveNamedPlaceholders(options);
+    // check for values containing undefined
+    if (options.values) {
+      //If namedPlaceholder is not enabled and object is passed as bind parameters
+      if (!Array.isArray(options.values)) {
+        throw new TypeError(
+          'Bind parameters must be array if namedPlaceholders parameter is not enabled'
+        );
+      }
+      options.values.forEach((val) => {
+        //If namedPlaceholder is not enabled and object is passed as bind parameters
+        if (!Array.isArray(options.values)) {
+          throw new TypeError(
+            'Bind parameters must be array if namedPlaceholders parameter is not enabled'
+          );
+        }
+        if (val === undefined) {
+          throw new TypeError(
+            'Bind parameters must not contain undefined. To pass SQL NULL specify JS null'
+          );
+        }
+        if (typeof val === 'function') {
+          throw new TypeError(
+            'Bind parameters must not contain function(s). To pass the body of a function as a string call .toString() first'
+          );
+        }
+      });
+    }
+    const executeCommand = new Commands.Execute(options, cb);
+
+    const prepareAndExecute = (errorCb) => {
+      const prepareCommand = new Commands.Prepare(options, (err, stmt) => {
+        if (err) {
+          // skip execute command if prepare failed
+          executeCommand.start = function () {
+            return null;
+          };
+          errorCb(err);
+          executeCommand.emit('end');
+          return;
+        }
+        executeCommand.statement = stmt;
+      });
+      this.addCommand(prepareCommand);
+      this.addCommand(executeCommand);
+    };
+
+    if (executeCommand.onResult) {
+      // Callback mode: traceCallback wraps the callback with tracing lifecycle, or calls through directly when no subscribers are registered
+      const origExecCb = executeCommand.onResult;
+      traceCallback(
+        executeChannel,
+        (wrappedCb) => {
+          executeCommand.onResult = wrappedCb;
+          prepareAndExecute(wrappedCb);
+        },
+        0,
+        () => {
+          const server = getServerContext(this.config);
+          return {
+            query: options.sql,
+            values: options.values,
+            database: this.config.database || '',
+            serverAddress: server.serverAddress,
+            serverPort: server.serverPort,
+          };
+        },
+        null,
+        origExecCb
+      );
+    } else if (shouldTrace(executeChannel)) {
+      // Event-emitter mode: tracePromise wraps the async lifecycle
+      tracePromise(
+        executeChannel,
+        () =>
+          new Promise((resolve, reject) => {
+            prepareAndExecute((err) => {
+              executeCommand.emit('error', err);
+            });
+            executeCommand.once('error', reject);
+            executeCommand.once('end', () => resolve());
+          }),
+        () => {
+          const server = getServerContext(this.config);
+          return {
+            query: options.sql,
+            values: options.values,
+            database: this.config.database || '',
+            serverAddress: server.serverAddress,
+            serverPort: server.serverPort,
+          };
+        }
+      ).catch(() => {
+        // errors are already emitted on the command
+      });
+    } else {
+      prepareAndExecute((err) => {
+        executeCommand.emit('error', err);
+      });
+    }
+
+    return executeCommand;
+  }
+
+  changeUser(options, callback) {
+    if (!callback && typeof options === 'function') {
+      callback = options;
+      options = {};
+    }
+    const charsetNumber = options.charset
+      ? ConnectionConfig.getCharsetNumber(options.charset)
+      : this.config.charsetNumber;
+    return this.addCommand(
+      new Commands.ChangeUser(
+        {
+          user: options.user || this.config.user,
+          // for the purpose of multi-factor authentication, or not, the main
+          // password (used for the 1st authentication factor) can also be
+          // provided via the "password1" option
+          password:
+            options.password ||
+            options.password1 ||
+            this.config.password ||
+            this.config.password1,
+          password2: options.password2 || this.config.password2,
+          password3: options.password3 || this.config.password3,
+          passwordSha1: options.passwordSha1 || this.config.passwordSha1,
+          database: options.database || this.config.database,
+          timeout: options.timeout,
+          charsetNumber: charsetNumber,
+          currentConfig: this.config,
+        },
+        (err) => {
+          if (err) {
+            err.fatal = true;
+          }
+          if (callback) {
+            callback(err);
+          }
+        }
+      )
+    );
+  }
+
+  // transaction helpers
+  beginTransaction(cb) {
+    return this.query('START TRANSACTION', cb);
+  }
+
+  commit(cb) {
+    return this.query('COMMIT', cb);
+  }
+
+  rollback(cb) {
+    return this.query('ROLLBACK', cb);
+  }
+
+  ping(cb) {
+    return this.addCommand(new Commands.Ping(cb));
+  }
+
+  _registerSlave(opts, cb) {
+    return this.addCommand(new Commands.RegisterSlave(opts, cb));
+  }
+
+  _binlogDump(opts, cb) {
+    return this.addCommand(new Commands.BinlogDump(opts, cb));
+  }
+
+  // currently just alias to close
+  destroy() {
+    this.close();
+  }
+
+  close() {
+    if (this.connectTimeout) {
+      Timers.clearTimeout(this.connectTimeout);
+      this.connectTimeout = null;
+    }
+    this._closing = true;
+    this.stream.end();
+    this.addCommand = this._addCommandClosedState;
+  }
+
+  createBinlogStream(opts) {
+    // TODO: create proper stream class
+    // TODO: use through2
+    let test = 1;
+    const stream = new Readable({ objectMode: true });
+    stream._read = function () {
+      return {
+        data: test++,
+      };
+    };
+    this._registerSlave(opts, () => {
+      const dumpCmd = this._binlogDump(opts);
+      dumpCmd.on('event', (ev) => {
+        stream.push(ev);
+      });
+      dumpCmd.on('eof', () => {
+        stream.push(null);
+        // if non-blocking, then close stream to prevent errors
+        if (opts.flags && opts.flags & 0x01) {
+          this.close();
+        }
+      });
+      // TODO: pipe errors as well
+    });
+    return stream;
+  }
+
+  connect(cb) {
+    if (!cb) {
+      return;
+    }
+
+    if (this._fatalError || this._protocolError) {
+      return cb(this._fatalError || this._protocolError);
+    }
+
+    if (this._handshakePacket) {
+      return cb(null, this);
+    }
+
+    /* eslint-disable prefer-const */
+    let onError, onConnect;
+
+    onError = (param) => {
+      this.removeListener('connect', onConnect);
+      cb(param);
+    };
+
+    onConnect = (param) => {
+      this.removeListener('error', onError);
+      cb(null, param);
+    };
+    /* eslint-enable prefer-const */
+
+    this.once('error', onError);
+    this.once('connect', onConnect);
+  }
+
+  // ===================================
+  // outgoing server connection methods
+  // ===================================
+  writeColumns(columns) {
+    this.writePacket(Packets.ResultSetHeader.toPacket(columns.length));
+    columns.forEach((column) => {
+      this.writePacket(
+        Packets.ColumnDefinition.toPacket(column, this.serverConfig.encoding)
+      );
+    });
+    this.writeEof();
+  }
+
+  // row is array of columns, not hash
+  writeTextRow(column) {
+    this.writePacket(
+      Packets.TextRow.toPacket(column, this.serverConfig.encoding)
+    );
+  }
+
+  writeBinaryRow(column) {
+    this.writePacket(
+      Packets.BinaryRow.toPacket(column, this.serverConfig.encoding)
+    );
+  }
+
+  writeTextResult(rows, columns, binary = false) {
+    this.writeColumns(columns);
+    rows.forEach((row) => {
+      const arrayRow = new Array(columns.length);
+      columns.forEach((column) => {
+        arrayRow.push(row[column.name]);
+      });
+      if (binary) {
+        this.writeBinaryRow(arrayRow);
+      } else this.writeTextRow(arrayRow);
+    });
+    this.writeEof();
+  }
+
+  writeEof(warnings, statusFlags) {
+    this.writePacket(Packets.EOF.toPacket(warnings, statusFlags));
+  }
+
+  writeOk(args) {
+    if (!args) {
+      args = { affectedRows: 0 };
+    }
+    this.writePacket(Packets.OK.toPacket(args, this.serverConfig.encoding));
+  }
+
+  writeError(args) {
+    // if we want to send error before initial hello was sent, use default encoding
+    const encoding = this.serverConfig ? this.serverConfig.encoding : 'cesu8';
+    this.writePacket(Packets.Error.toPacket(args, encoding));
+  }
+
+  serverHandshake(args) {
+    this.serverConfig = args;
+    this.serverConfig.encoding =
+      CharsetToEncoding[this.serverConfig.characterSet];
+    return this.addCommand(new Commands.ServerHandshake(args));
+  }
+
+  [Symbol.dispose]() {
+    if (!this._closing) {
+      this.end();
+    }
+  }
+
+  // ===============================================================
+  end(callback) {
+    if (this.config.isServer) {
+      this._closing = true;
+      const quitCmd = new EventEmitter();
+      setImmediate(() => {
+        this.stream.end();
+        quitCmd.emit('end');
+      });
+      return quitCmd;
+    }
+    // trigger error if more commands enqueued after end command
+    const quitCmd = this.addCommand(new Commands.Quit(callback));
+    this.addCommand = this._addCommandClosedState;
+    return quitCmd;
+  }
+
+  static createQuery(sql, values, cb, config) {
+    let options = {
+      rowsAsArray: config.rowsAsArray,
+      infileStreamFactory: config.infileStreamFactory,
+    };
+    if (typeof sql === 'object') {
+      // query(options, cb)
+      options = {
+        ...options,
+        ...sql,
+        sql: sql.sql,
+        values: sql.values,
+      };
+      if (typeof values === 'function') {
+        cb = values;
+      } else if (values !== undefined) {
+        options.values = values;
+      }
+    } else if (typeof values === 'function') {
+      // query(sql, cb)
+      cb = values;
+      options.sql = sql;
+      options.values = undefined;
+    } else {
+      // query(sql, values, cb)
+      options.sql = sql;
+      options.values = values;
+    }
+    return new Commands.Query(options, cb);
+  }
+
+  static statementKey(options) {
+    return `${typeof options.nestTables}/${options.nestTables}/${options.rowsAsArray}${options.sql}`;
+  }
+}
+
+module.exports = BaseConnection;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/base/pool.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/base/pool.js
new file mode 100644
index 0000000..ce10348
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/base/pool.js	
@@ -0,0 +1,313 @@
+'use strict';
+
+const process = require('process');
+const SqlString = require('sql-escaper');
+const EventEmitter = require('events').EventEmitter;
+const PoolConnection = require('../pool_connection.js');
+const Queue = require('denque');
+const BaseConnection = require('./connection.js');
+const Errors = require('../constants/errors.js');
+const {
+  traceCallback,
+  getServerContext,
+  poolConnectChannel,
+} = require('../tracing.js');
+
+// Source: https://github.com/go-sql-driver/mysql/blob/76c00e35a8d48f8f70f0e7dffe584692bd3fa612/packets.go#L598-L613
+function isReadOnlyError(err) {
+  if (!err || !err.errno) {
+    return false;
+  }
+  // 1792: ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
+  // 1290: ER_OPTION_PREVENTS_STATEMENT (returned by Aurora during failover)
+  // 1836: ER_READ_ONLY_MODE
+  return (
+    err.errno === Errors.ER_OPTION_PREVENTS_STATEMENT ||
+    err.errno === Errors.ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION ||
+    err.errno === Errors.ER_READ_ONLY_MODE
+  );
+}
+
+function spliceConnection(queue, connection) {
+  const len = queue.length;
+  for (let i = 0; i < len; i++) {
+    if (queue.get(i) === connection) {
+      queue.removeOne(i);
+      break;
+    }
+  }
+}
+
+class BasePool extends EventEmitter {
+  constructor(options) {
+    super();
+    this.config = options.config;
+    this.config.connectionConfig.pool = this;
+    this._allConnections = new Queue();
+    this._freeConnections = new Queue();
+    this._connectionQueue = new Queue();
+    this._closed = false;
+    if (this.config.maxIdle < this.config.connectionLimit) {
+      // create idle connection timeout automatically release job
+      this._removeIdleTimeoutConnections();
+    }
+  }
+
+  getConnection(cb) {
+    const _getConnection = (cb) => {
+      if (this._closed) {
+        return process.nextTick(() => cb(new Error('Pool is closed.')));
+      }
+      let connection;
+      if (this._freeConnections.length > 0) {
+        connection = this._freeConnections.pop();
+        this.emit('acquire', connection);
+        return process.nextTick(() => {
+          connection._released = false;
+          cb(null, connection);
+        });
+      }
+      if (
+        this.config.connectionLimit === 0 ||
+        this._allConnections.length < this.config.connectionLimit
+      ) {
+        connection = new PoolConnection(this, {
+          config: this.config.connectionConfig,
+        });
+        this._allConnections.push(connection);
+        return connection.connect((err) => {
+          if (this._closed) {
+            return cb(new Error('Pool is closed.'));
+          }
+          if (err) {
+            return cb(err);
+          }
+          this.emit('connection', connection);
+          this.emit('acquire', connection);
+          return cb(null, connection);
+        });
+      }
+      if (!this.config.waitForConnections) {
+        return process.nextTick(() =>
+          cb(new Error('No connections available.'))
+        );
+      }
+      if (
+        this.config.queueLimit &&
+        this._connectionQueue.length >= this.config.queueLimit
+      ) {
+        return cb(new Error('Queue limit reached.'));
+      }
+      this.emit('enqueue');
+      return this._connectionQueue.push(cb);
+    };
+    const config = this.config.connectionConfig;
+    traceCallback(
+      poolConnectChannel,
+      _getConnection,
+      0,
+      () => {
+        const server = getServerContext(config);
+        return {
+          database: config.database || '',
+          serverAddress: server.serverAddress,
+          serverPort: server.serverPort,
+        };
+      },
+      null,
+      cb
+    );
+  }
+
+  releaseConnection(connection) {
+    let cb;
+    if (!connection._pool) {
+      // The connection has been removed from the pool and is no longer good.
+      if (this._connectionQueue.length) {
+        cb = this._connectionQueue.shift();
+        process.nextTick(this.getConnection.bind(this, cb));
+      }
+    } else if (this._connectionQueue.length) {
+      cb = this._connectionQueue.shift();
+      process.nextTick(() => {
+        connection._released = false;
+        cb(null, connection);
+      });
+    } else {
+      this._freeConnections.push(connection);
+      this.emit('release', connection);
+    }
+  }
+
+  [Symbol.dispose]() {
+    if (!this._closed) {
+      this.end();
+    }
+  }
+
+  end(cb) {
+    this._closed = true;
+    clearTimeout(this._removeIdleTimeoutConnectionsTimer);
+    if (typeof cb !== 'function') {
+      cb = function (err) {
+        if (err) {
+          throw err;
+        }
+      };
+    }
+    let calledBack = false;
+    let closedConnections = 0;
+    let connection;
+    const endCB = function (err) {
+      if (calledBack) {
+        return;
+      }
+      if (err || ++closedConnections >= this._allConnections.length) {
+        calledBack = true;
+        cb(err);
+        return;
+      }
+    }.bind(this);
+    if (this._allConnections.length === 0) {
+      endCB();
+      return;
+    }
+    for (let i = 0; i < this._allConnections.length; i++) {
+      connection = this._allConnections.get(i);
+      connection._realEnd(endCB);
+    }
+  }
+
+  query(sql, values, cb) {
+    const cmdQuery = BaseConnection.createQuery(
+      sql,
+      values,
+      cb,
+      this.config.connectionConfig
+    );
+    if (typeof cmdQuery.namedPlaceholders === 'undefined') {
+      cmdQuery.namedPlaceholders =
+        this.config.connectionConfig.namedPlaceholders;
+    }
+    this.getConnection((err, conn) => {
+      if (err) {
+        if (typeof cmdQuery.onResult === 'function') {
+          cmdQuery.onResult(err);
+        } else {
+          cmdQuery.emit('error', err);
+        }
+        return;
+      }
+      try {
+        let queryError = null;
+        const origOnResult = cmdQuery.onResult;
+        if (origOnResult) {
+          cmdQuery.onResult = function (err, rows, fields) {
+            queryError = err || null;
+            origOnResult(err, rows, fields);
+          };
+        } else {
+          cmdQuery.once('error', (err) => {
+            queryError = err;
+          });
+        }
+        conn.query(cmdQuery).once('end', () => {
+          if (isReadOnlyError(queryError)) {
+            conn.destroy();
+          } else {
+            conn.release();
+          }
+        });
+      } catch (e) {
+        conn.release();
+        throw e;
+      }
+    });
+    return cmdQuery;
+  }
+
+  execute(sql, values, cb) {
+    // TODO construct execute command first here and pass it to connection.execute
+    // so that polymorphic arguments logic is there in one place
+    if (typeof values === 'function') {
+      cb = values;
+      values = [];
+    }
+    this.getConnection((err, conn) => {
+      if (err) {
+        return cb(err);
+      }
+      try {
+        conn
+          .execute(sql, values, (err, rows, fields) => {
+            if (isReadOnlyError(err)) {
+              conn.destroy();
+            }
+            cb(err, rows, fields);
+          })
+          .once('end', () => {
+            conn.release();
+          });
+      } catch (e) {
+        conn.release();
+        return cb(e);
+      }
+    });
+  }
+
+  _removeConnection(connection) {
+    // Remove connection from all connections
+    spliceConnection(this._allConnections, connection);
+    // Remove connection from free connections
+    spliceConnection(this._freeConnections, connection);
+    this.releaseConnection(connection);
+  }
+
+  _removeIdleTimeoutConnections() {
+    if (this._removeIdleTimeoutConnectionsTimer) {
+      clearTimeout(this._removeIdleTimeoutConnectionsTimer);
+    }
+
+    this._removeIdleTimeoutConnectionsTimer = setTimeout(() => {
+      try {
+        while (
+          this._freeConnections.length > this.config.maxIdle ||
+          (this._freeConnections.length > 0 &&
+            Date.now() - this._freeConnections.get(0).lastActiveTime >
+              this.config.idleTimeout)
+        ) {
+          if (this.config.connectionConfig.gracefulEnd) {
+            this._freeConnections.get(0).end();
+          } else {
+            this._freeConnections.get(0).destroy();
+          }
+        }
+      } finally {
+        this._removeIdleTimeoutConnections();
+      }
+    }, 1000);
+  }
+
+  format(sql, values) {
+    return SqlString.format(
+      sql,
+      values,
+      this.config.connectionConfig.stringifyObjects,
+      this.config.connectionConfig.timezone
+    );
+  }
+
+  escape(value) {
+    return SqlString.escape(
+      value,
+      this.config.connectionConfig.stringifyObjects,
+      this.config.connectionConfig.timezone
+    );
+  }
+
+  escapeId(value) {
+    return SqlString.escapeId(value, false);
+  }
+}
+
+module.exports = BasePool;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/auth_switch.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/auth_switch.js
new file mode 100644
index 0000000..eab7458
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/auth_switch.js	
@@ -0,0 +1,129 @@
+// This file was modified by Oracle on July 5, 2021.
+// Errors generated by asynchronous authentication plugins are now being
+// handled and subsequently emitted at the command level.
+// Modifications copyright (c) 2021, Oracle and/or its affiliates.
+
+'use strict';
+
+const Packets = require('../packets/index.js');
+const sha256_password = require('../auth_plugins/sha256_password');
+const caching_sha2_password = require('../auth_plugins/caching_sha2_password.js');
+const mysql_native_password = require('../auth_plugins/mysql_native_password.js');
+const mysql_clear_password = require('../auth_plugins/mysql_clear_password.js');
+
+// Use Object.create(null) to avoid prototype pollution
+// This prevents server-controlled pluginName values like "toString" or "__proto__"
+// from resolving to prototype properties
+const standardAuthPlugins = Object.assign(Object.create(null), {
+  sha256_password: sha256_password({}),
+  caching_sha2_password: caching_sha2_password({}),
+  mysql_native_password: mysql_native_password({}),
+  mysql_clear_password: mysql_clear_password({}),
+});
+
+// Helper function to get auth plugin (custom or standard)
+function getAuthPlugin(pluginName, connection) {
+  const customPlugins = connection.config.authPlugins;
+
+  // Check custom plugins with hasOwnProperty for safety
+  if (
+    customPlugins &&
+    Object.prototype.hasOwnProperty.call(customPlugins, pluginName)
+  ) {
+    return customPlugins[pluginName];
+  }
+
+  // Safe to access standardAuthPlugins directly since it has no prototype
+  return standardAuthPlugins[pluginName];
+}
+
+function warnLegacyAuthSwitch() {
+  console.warn(
+    'WARNING! authSwitchHandler api is deprecated, please use new authPlugins api'
+  );
+}
+
+function authSwitchPluginError(error, command) {
+  // Authentication errors are fatal
+  error.code = 'AUTH_SWITCH_PLUGIN_ERROR';
+  error.fatal = true;
+
+  command.emit('error', error);
+}
+
+function authSwitchRequest(packet, connection, command) {
+  const { pluginName, pluginData } =
+    Packets.AuthSwitchRequest.fromPacket(packet);
+
+  // legacy plugin api don't allow to override mysql_native_password
+  // if pluginName is mysql_native_password it's using standard auth4.1 auth
+  if (
+    connection.config.authSwitchHandler &&
+    pluginName !== 'mysql_native_password'
+  ) {
+    const legacySwitchHandler = connection.config.authSwitchHandler;
+    warnLegacyAuthSwitch();
+    legacySwitchHandler({ pluginName, pluginData }, (err, data) => {
+      if (err) {
+        return authSwitchPluginError(err, command);
+      }
+      connection.writePacket(new Packets.AuthSwitchResponse(data).toPacket());
+    });
+    return;
+  }
+
+  const authPlugin = getAuthPlugin(pluginName, connection);
+  if (!authPlugin) {
+    throw new Error(
+      `Server requests authentication using unknown plugin ${pluginName}. See ${'TODO: add plugins doco here'} on how to configure or author authentication plugins.`
+    );
+  }
+  connection._authPlugin = authPlugin({ connection, command });
+  Promise.resolve(connection._authPlugin(pluginData))
+    .then((data) => {
+      if (data) {
+        connection.writePacket(new Packets.AuthSwitchResponse(data).toPacket());
+      }
+    })
+    .catch((err) => {
+      authSwitchPluginError(err, command);
+    });
+}
+
+function authSwitchRequestMoreData(packet, connection, command) {
+  const { data } = Packets.AuthSwitchRequestMoreData.fromPacket(packet);
+
+  if (connection.config.authSwitchHandler) {
+    const legacySwitchHandler = connection.config.authSwitchHandler;
+    warnLegacyAuthSwitch();
+    legacySwitchHandler({ pluginData: data }, (err, data) => {
+      if (err) {
+        return authSwitchPluginError(err, command);
+      }
+      connection.writePacket(new Packets.AuthSwitchResponse(data).toPacket());
+    });
+    return;
+  }
+
+  if (!connection._authPlugin) {
+    throw new Error(
+      'AuthPluginMoreData received but no auth plugin instance found'
+    );
+  }
+  Promise.resolve(connection._authPlugin(data))
+    .then((data) => {
+      if (data) {
+        connection.writePacket(new Packets.AuthSwitchResponse(data).toPacket());
+      }
+    })
+    .catch((err) => {
+      authSwitchPluginError(err, command);
+    });
+}
+
+module.exports = {
+  authSwitchRequest,
+  authSwitchRequestMoreData,
+  getAuthPlugin,
+  standardAuthPlugins,
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/binlog_dump.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/binlog_dump.js
new file mode 100644
index 0000000..63e4960
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/binlog_dump.js	
@@ -0,0 +1,109 @@
+'use strict';
+
+const Command = require('./command');
+const Packets = require('../packets');
+
+const eventParsers = [];
+
+class BinlogEventHeader {
+  constructor(packet) {
+    this.timestamp = packet.readInt32();
+    this.eventType = packet.readInt8();
+    this.serverId = packet.readInt32();
+    this.eventSize = packet.readInt32();
+    this.logPos = packet.readInt32();
+    this.flags = packet.readInt16();
+  }
+}
+
+class BinlogDump extends Command {
+  constructor(opts) {
+    super();
+    // this.onResult = callback;
+    this.opts = opts;
+  }
+
+  start(packet, connection) {
+    const newPacket = new Packets.BinlogDump(this.opts);
+    connection.writePacket(newPacket.toPacket(1));
+    return BinlogDump.prototype.binlogData;
+  }
+
+  binlogData(packet) {
+    // ok - continue consuming events
+    // error - error
+    // eof - end of binlog
+    if (packet.isEOF()) {
+      this.emit('eof');
+      return null;
+    }
+    // binlog event header
+    packet.readInt8();
+    const header = new BinlogEventHeader(packet);
+    const EventParser = eventParsers[header.eventType];
+    let event;
+    if (EventParser) {
+      event = new EventParser(packet);
+    } else {
+      event = {
+        name: 'UNKNOWN',
+      };
+    }
+    event.header = header;
+    this.emit('event', event);
+    return BinlogDump.prototype.binlogData;
+  }
+}
+
+class RotateEvent {
+  constructor(packet) {
+    this.pposition = packet.readInt32();
+    // TODO: read uint64 here
+    packet.readInt32(); // positionDword2
+    this.nextBinlog = packet.readString();
+    this.name = 'RotateEvent';
+  }
+}
+
+class FormatDescriptionEvent {
+  constructor(packet) {
+    this.binlogVersion = packet.readInt16();
+    this.serverVersion = packet.readString(50).replace(/\u0000.*/, ''); // eslint-disable-line no-control-regex
+    this.createTimestamp = packet.readInt32();
+    this.eventHeaderLength = packet.readInt8(); // should be 19
+    this.eventsLength = packet.readBuffer();
+    this.name = 'FormatDescriptionEvent';
+  }
+}
+
+class QueryEvent {
+  constructor(packet) {
+    const parseStatusVars = require('../packets/binlog_query_statusvars.js');
+    this.slaveProxyId = packet.readInt32();
+    this.executionTime = packet.readInt32();
+    const schemaLength = packet.readInt8();
+    this.errorCode = packet.readInt16();
+    const statusVarsLength = packet.readInt16();
+    const statusVars = packet.readBuffer(statusVarsLength);
+    this.schema = packet.readString(schemaLength);
+    packet.readInt8(); // should be zero
+    this.statusVars = parseStatusVars(statusVars);
+    this.query = packet.readString();
+    this.name = 'QueryEvent';
+  }
+}
+
+class XidEvent {
+  constructor(packet) {
+    this.binlogVersion = packet.readInt16();
+    this.xid = packet.readInt64();
+    this.name = 'XidEvent';
+  }
+}
+
+eventParsers[2] = QueryEvent;
+eventParsers[4] = RotateEvent;
+eventParsers[15] = FormatDescriptionEvent;
+eventParsers[16] = XidEvent;
+
+module.exports = BinlogDump;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/change_user.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/change_user.js
new file mode 100644
index 0000000..d9a7de4
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/change_user.js	
@@ -0,0 +1,68 @@
+// This file was modified by Oracle on September 21, 2021.
+// The changes involve saving additional authentication factor passwords
+// in the command scope and enabling multi-factor authentication in the
+// client-side when the server supports it.
+// Modifications copyright (c) 2021, Oracle and/or its affiliates.
+
+'use strict';
+
+const Command = require('./command.js');
+const Packets = require('../packets/index.js');
+const ClientConstants = require('../constants/client');
+const ClientHandshake = require('./client_handshake.js');
+const CharsetToEncoding = require('../constants/charset_encodings.js');
+
+class ChangeUser extends Command {
+  constructor(options, callback) {
+    super();
+    this.onResult = callback;
+    this.user = options.user;
+    this.password = options.password;
+    // "password1" is an alias of "password"
+    this.password1 = options.password;
+    this.password2 = options.password2;
+    this.password3 = options.password3;
+    this.database = options.database;
+    this.passwordSha1 = options.passwordSha1;
+    this.charsetNumber = options.charsetNumber;
+    this.currentConfig = options.currentConfig;
+    this.authenticationFactor = 0;
+  }
+  start(packet, connection) {
+    const newPacket = new Packets.ChangeUser({
+      flags: connection.config.clientFlags,
+      user: this.user,
+      database: this.database,
+      charsetNumber: this.charsetNumber,
+      password: this.password,
+      passwordSha1: this.passwordSha1,
+      authPluginData1: connection._handshakePacket.authPluginData1,
+      authPluginData2: connection._handshakePacket.authPluginData2,
+    });
+    this.currentConfig.user = this.user;
+    this.currentConfig.password = this.password;
+    this.currentConfig.database = this.database;
+    this.currentConfig.charsetNumber = this.charsetNumber;
+    connection.clientEncoding = CharsetToEncoding[this.charsetNumber];
+    // clear prepared statements cache as all statements become invalid after changeUser
+    connection._statements.clear();
+    connection.writePacket(newPacket.toPacket());
+    // check if the server supports multi-factor authentication
+    const multiFactorAuthentication =
+      connection.serverCapabilityFlags &
+      ClientConstants.MULTI_FACTOR_AUTHENTICATION;
+    if (multiFactorAuthentication) {
+      // if the server supports multi-factor authentication, we enable it in
+      // the client
+      this.authenticationFactor = 1;
+    }
+    return ChangeUser.prototype.handshakeResult;
+  }
+}
+
+ChangeUser.prototype.handshakeResult =
+  ClientHandshake.prototype.handshakeResult;
+ChangeUser.prototype.calculateNativePasswordAuthToken =
+  ClientHandshake.prototype.calculateNativePasswordAuthToken;
+
+module.exports = ChangeUser;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/client_handshake.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/client_handshake.js
new file mode 100644
index 0000000..581e9ab
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/client_handshake.js	
@@ -0,0 +1,383 @@
+// This file was modified by Oracle on June 17, 2021.
+// Handshake errors are now maked as fatal and the corresponding events are
+// emitted in the command instance itself.
+// Modifications copyright (c) 2021, Oracle and/or its affiliates.
+
+// This file was modified by Oracle on September 21, 2021.
+// Handshake workflow now supports additional authentication factors requested
+// by the server.
+// Modifications copyright (c) 2021, Oracle and/or its affiliates.
+
+'use strict';
+
+const Command = require('./command.js');
+const Packets = require('../packets/index.js');
+const ClientConstants = require('../constants/client.js');
+const CharsetToEncoding = require('../constants/charset_encodings.js');
+const auth41 = require('../auth_41.js');
+const { getAuthPlugin } = require('./auth_switch.js');
+const {
+  calculateToken: calculateSha2Token,
+} = require('../auth_plugins/caching_sha2_password.js');
+
+function flagNames(flags) {
+  const res = [];
+  for (const c in ClientConstants) {
+    if (flags & ClientConstants[c]) {
+      res.push(c.replace(/_/g, ' ').toLowerCase());
+    }
+  }
+  return res;
+}
+
+class ClientHandshake extends Command {
+  constructor(clientFlags) {
+    super();
+    this.handshake = null;
+    this.clientFlags = clientFlags;
+    this.authenticationFactor = 0;
+  }
+
+  start() {
+    return ClientHandshake.prototype.handshakeInit;
+  }
+
+  sendSSLRequest(connection) {
+    const sslRequest = new Packets.SSLRequest(
+      this.clientFlags,
+      connection.config.charsetNumber
+    );
+    connection.writePacket(sslRequest.toPacket());
+  }
+
+  sendCredentials(connection) {
+    if (connection.config.debug) {
+      console.log(
+        'Sending handshake packet: flags:%d=(%s)',
+        this.clientFlags,
+        flagNames(this.clientFlags).join(', ')
+      );
+    }
+    this.user = connection.config.user;
+    this.password = connection.config.password;
+    // "password1" is an alias to the original "password" value
+    // to make it easier to integrate multi-factor authentication
+    this.password1 = connection.config.password;
+    // "password2" and "password3" are the 2nd and 3rd factor authentication
+    // passwords, which can be undefined depending on the authentication
+    // plugin being used
+    this.password2 = connection.config.password2;
+    this.password3 = connection.config.password3;
+    this.passwordSha1 = connection.config.passwordSha1;
+    this.database = connection.config.database;
+    this.authPluginName = this.handshake.authPluginName;
+
+    // Optimization: Try to use the server's preferred authentication method
+    // to avoid an unnecessary auth switch roundtrip
+    const serverAuthMethod = this.handshake.authPluginName;
+    const isSecureConnection =
+      connection.config.ssl || connection.config.socketPath;
+
+    // Combine auth plugin data for easier handling
+    // Note: authPluginData2 can include a trailing NUL byte when PLUGIN_AUTH is set
+    // We must ensure exactly 20 bytes for the scramble
+    const authPluginData =
+      this.handshake.authPluginData1 && this.handshake.authPluginData2
+        ? Buffer.concat([
+            this.handshake.authPluginData1,
+            this.handshake.authPluginData2,
+          ]).slice(0, 20)
+        : Buffer.alloc(20);
+
+    // Check if user has custom auth plugin or legacy handler for the server-advertised method
+    // If so, we must not bypass the auth switch flow with our built-in implementation
+    const hasCustomAuthPlugin =
+      connection.config.authPlugins &&
+      Object.prototype.hasOwnProperty.call(
+        connection.config.authPlugins,
+        serverAuthMethod
+      );
+    const hasLegacyAuthSwitchHandler =
+      typeof connection.config.authSwitchHandler === 'function';
+
+    // Determine which auth method to use
+    // Try to use server's preferred method if we can, otherwise fallback to native
+    const canUseDirectAuth =
+      !hasCustomAuthPlugin &&
+      !hasLegacyAuthSwitchHandler &&
+      this.canUseAuthMethodDirectly(serverAuthMethod, isSecureConnection);
+
+    const clientAuthMethod = canUseDirectAuth
+      ? serverAuthMethod
+      : 'mysql_native_password';
+
+    // Calculate the auth token for the chosen method
+    const authToken = this.calculateAuthToken(
+      clientAuthMethod,
+      this.password,
+      authPluginData
+    );
+
+    if (connection.config.debug) {
+      console.log(
+        'Server auth method: %s, Using auth method: %s',
+        serverAuthMethod,
+        clientAuthMethod
+      );
+    }
+
+    const handshakeResponse = new Packets.HandshakeResponse({
+      flags: this.clientFlags,
+      user: this.user,
+      database: this.database,
+      password: this.password,
+      passwordSha1: this.passwordSha1,
+      charsetNumber: connection.config.charsetNumber,
+      authPluginData1: this.handshake.authPluginData1,
+      authPluginData2: this.handshake.authPluginData2,
+      compress: connection.config.compress,
+      connectAttributes: connection.config.connectAttributes,
+      authToken: authToken,
+      authPluginName: clientAuthMethod,
+    });
+    connection.writePacket(handshakeResponse.toPacket());
+
+    // If we used a non-native auth method in the initial handshake response,
+    // we need to prepare for potential AuthMoreData packets by creating
+    // the appropriate auth plugin instance
+    if (clientAuthMethod !== 'mysql_native_password') {
+      this.initializeAuthPlugin(clientAuthMethod, authPluginData, connection);
+    }
+  }
+
+  calculateNativePasswordAuthToken(authPluginData) {
+    // TODO: dont split into authPluginData1 and authPluginData2, instead join when 1 & 2 received
+    const authPluginData1 = authPluginData.slice(0, 8);
+    const authPluginData2 = authPluginData.slice(8, 20);
+    let authToken;
+    if (this.passwordSha1) {
+      authToken = auth41.calculateTokenFromPasswordSha(
+        this.passwordSha1,
+        authPluginData1,
+        authPluginData2
+      );
+    } else {
+      authToken = auth41.calculateToken(
+        this.password,
+        authPluginData1,
+        authPluginData2
+      );
+    }
+    return authToken;
+  }
+
+  calculateSha256Token(password, scramble) {
+    // Reuse the token calculation from caching_sha2_password plugin
+    // to avoid code duplication and ensure consistency
+    return calculateSha2Token(password, scramble);
+  }
+
+  // Helper: Calculate auth token for a specific auth method
+  calculateAuthToken(authMethod, password, authPluginData) {
+    switch (authMethod) {
+      case 'mysql_native_password':
+        return this.calculateNativePasswordAuthToken(authPluginData);
+
+      case 'caching_sha2_password':
+        return this.calculateSha256Token(password, authPluginData);
+
+      case 'sha256_password':
+      case 'mysql_clear_password':
+        // These methods send plaintext password over secure connections
+        return password
+          ? Buffer.from(`${password}\0`, 'utf8')
+          : Buffer.alloc(0);
+
+      default:
+        // Unknown method - use native password as fallback
+        return this.calculateNativePasswordAuthToken(authPluginData);
+    }
+  }
+
+  // Helper: Determine if we can use a specific auth method directly
+  canUseAuthMethodDirectly(authMethod, isSecureConnection) {
+    switch (authMethod) {
+      case 'mysql_native_password':
+      case 'caching_sha2_password':
+        // These methods work with or without SSL
+        return true;
+
+      case 'sha256_password':
+      case 'mysql_clear_password':
+        // These methods require secure connection for direct use
+        return isSecureConnection;
+
+      default:
+        // Unknown methods - fallback to native password
+        return false;
+    }
+  }
+
+  // Helper: Initialize auth plugin for handling subsequent AuthMoreData packets
+  initializeAuthPlugin(authMethod, authPluginData, connection) {
+    const authPlugin = getAuthPlugin(authMethod, connection);
+    if (!authPlugin) {
+      return; // Plugin not found, will fallback to auth switch if needed
+    }
+
+    // Initialize the plugin with connection and command context
+    const pluginHandler = authPlugin({ connection, command: this });
+    connection._authPlugin = pluginHandler;
+
+    // Prime the plugin by calling it with the scramble data
+    // This advances the plugin's state machine (e.g., to STATE_TOKEN_SENT)
+    // We don't send the result because we already included it in the handshake response
+    try {
+      Promise.resolve(pluginHandler(authPluginData)).catch((err) => {
+        // Ignore errors during initialization since we already sent the token
+        if (connection.config.debug) {
+          console.log('Auth plugin initialization:', err.message);
+        }
+      });
+    } catch (err) {
+      // Ignore synchronous errors during initialization
+      if (connection.config.debug) {
+        console.log('Auth plugin initialization error:', err.message);
+      }
+    }
+  }
+
+  handshakeInit(helloPacket, connection) {
+    this.on('error', (e) => {
+      connection._fatalError = e;
+      connection._protocolError = e;
+    });
+    this.handshake = Packets.Handshake.fromPacket(helloPacket);
+    if (connection.config.debug) {
+      console.log(
+        'Server hello packet: capability flags:%d=(%s)',
+        this.handshake.capabilityFlags,
+        flagNames(this.handshake.capabilityFlags).join(', ')
+      );
+    }
+    connection.serverCapabilityFlags = this.handshake.capabilityFlags;
+    connection.serverEncoding = CharsetToEncoding[this.handshake.characterSet];
+    connection.connectionId = this.handshake.connectionId;
+    const serverSSLSupport =
+      this.handshake.capabilityFlags & ClientConstants.SSL;
+    // multi factor authentication is enabled with the
+    // "MULTI_FACTOR_AUTHENTICATION" capability and should only be used if it
+    // is supported by the server
+    const multiFactorAuthentication =
+      this.handshake.capabilityFlags &
+      ClientConstants.MULTI_FACTOR_AUTHENTICATION;
+    this.clientFlags = this.clientFlags | multiFactorAuthentication;
+    // use compression only if requested by client and supported by server
+    connection.config.compress =
+      connection.config.compress &&
+      this.handshake.capabilityFlags & ClientConstants.COMPRESS;
+    this.clientFlags = this.clientFlags | connection.config.compress;
+    if (connection.config.ssl) {
+      // client requires SSL but server does not support it
+      if (!serverSSLSupport) {
+        const err = new Error('Server does not support secure connection');
+        err.code = 'HANDSHAKE_NO_SSL_SUPPORT';
+        err.fatal = true;
+        this.emit('error', err);
+        return false;
+      }
+      // send ssl upgrade request and immediately upgrade connection to secure
+      this.clientFlags |= ClientConstants.SSL;
+      this.sendSSLRequest(connection);
+      connection.startTLS((err) => {
+        // after connection is secure
+        if (err) {
+          // SSL negotiation error are fatal
+          err.code = 'HANDSHAKE_SSL_ERROR';
+          err.fatal = true;
+          this.emit('error', err);
+          return;
+        }
+        // rest of communication is encrypted
+        this.sendCredentials(connection);
+      });
+    } else {
+      this.sendCredentials(connection);
+    }
+    if (multiFactorAuthentication) {
+      // if the server supports multi-factor authentication, we enable it in
+      // the client
+      this.authenticationFactor = 1;
+    }
+    return ClientHandshake.prototype.handshakeResult;
+  }
+
+  handshakeResult(packet, connection) {
+    const marker = packet.peekByte();
+    // packet can be OK_Packet, ERR_Packet, AuthSwitchRequest, AuthNextFactor
+    // or AuthMoreData
+    if (marker === 0xfe || marker === 1 || marker === 0x02) {
+      const authSwitch = require('./auth_switch');
+      try {
+        if (marker === 1) {
+          authSwitch.authSwitchRequestMoreData(packet, connection, this);
+        } else {
+          // if authenticationFactor === 0, it means the server does not support
+          // the multi-factor authentication capability
+          if (this.authenticationFactor !== 0) {
+            // if we are past the first authentication factor, we should use the
+            // corresponding password (if there is one)
+            connection.config.password =
+              this[`password${this.authenticationFactor}`];
+            // update the current authentication factor
+            this.authenticationFactor += 1;
+          }
+          // if marker === 0x02, it means it is an AuthNextFactor packet,
+          // which is similar in structure to an AuthSwitchRequest packet,
+          // so, we can use it directly
+          authSwitch.authSwitchRequest(packet, connection, this);
+        }
+        return ClientHandshake.prototype.handshakeResult;
+      } catch (err) {
+        // Authentication errors are fatal
+        err.code = 'AUTH_SWITCH_PLUGIN_ERROR';
+        err.fatal = true;
+
+        if (this.onResult) {
+          this.onResult(err);
+        } else {
+          this.emit('error', err);
+        }
+        return null;
+      }
+    }
+    if (marker !== 0) {
+      const err = new Error('Unexpected packet during handshake phase');
+      // Unknown handshake errors are fatal
+      err.code = 'HANDSHAKE_UNKNOWN_ERROR';
+      err.fatal = true;
+
+      if (this.onResult) {
+        this.onResult(err);
+      } else {
+        this.emit('error', err);
+      }
+      return null;
+    }
+    // this should be called from ClientHandshake command only
+    // and skipped when called from ChangeUser command
+    if (!connection.authorized) {
+      connection.authorized = true;
+      if (connection.config.compress) {
+        const enableCompression =
+          require('../compressed_protocol.js').enableCompression;
+        enableCompression(connection);
+      }
+    }
+    if (this.onResult) {
+      this.onResult(null);
+    }
+    return null;
+  }
+}
+module.exports = ClientHandshake;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/close_statement.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/close_statement.js
new file mode 100644
index 0000000..15919c1
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/close_statement.js	
@@ -0,0 +1,18 @@
+'use strict';
+
+const Command = require('./command');
+const Packets = require('../packets/index.js');
+
+class CloseStatement extends Command {
+  constructor(id) {
+    super();
+    this.id = id;
+  }
+
+  start(packet, connection) {
+    connection.writePacket(new Packets.CloseStatement(this.id).toPacket(1));
+    return null;
+  }
+}
+
+module.exports = CloseStatement;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/command.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/command.js
new file mode 100644
index 0000000..3d31886
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/command.js	
@@ -0,0 +1,54 @@
+'use strict';
+
+const EventEmitter = require('events').EventEmitter;
+const Timers = require('timers');
+
+class Command extends EventEmitter {
+  constructor() {
+    super();
+    this.next = null;
+  }
+
+  // slow. debug only
+  stateName() {
+    const state = this.next;
+    for (const i in this) {
+      if (this[i] === state && i !== 'next') {
+        return i;
+      }
+    }
+    return 'unknown name';
+  }
+
+  execute(packet, connection) {
+    if (!this.next) {
+      this.next = this.start;
+      connection._resetSequenceId();
+    }
+    if (packet && packet.isError()) {
+      const err = packet.asError(connection.clientEncoding);
+      err.sql = this.sql || this.query;
+      if (this.queryTimeout) {
+        Timers.clearTimeout(this.queryTimeout);
+        this.queryTimeout = null;
+      }
+      if (this.onResult) {
+        this.onResult(err);
+        this.emit('end');
+      } else {
+        this.emit('error', err);
+        this.emit('end');
+      }
+      return true;
+    }
+    // TODO: don't return anything from execute, it's ugly and error-prone. Listen for 'end' event in connection
+    this.next = this.next(packet, connection);
+    if (this.next) {
+      return false;
+    }
+    this.emit('end');
+    return true;
+  }
+}
+
+module.exports = Command;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/execute.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/execute.js
new file mode 100644
index 0000000..a540337
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/execute.js	
@@ -0,0 +1,112 @@
+'use strict';
+
+const Command = require('./command.js');
+const Query = require('./query.js');
+const Packets = require('../packets/index.js');
+
+const getBinaryParser = require('../parsers/binary_parser.js');
+const getStaticBinaryParser = require('../parsers/static_binary_parser.js');
+
+class Execute extends Command {
+  constructor(options, callback) {
+    super();
+    this.statement = options.statement;
+    this.sql = options.sql;
+    this.values = options.values;
+    this.onResult = callback;
+    this.parameters = options.values;
+    this.insertId = 0;
+    this.timeout = options.timeout;
+    this.queryTimeout = null;
+    this._rows = [];
+    this._fields = [];
+    this._result = [];
+    this._fieldCount = 0;
+    this._rowParser = null;
+    this._executeOptions = options;
+    this._resultIndex = 0;
+    this._localStream = null;
+    this._unpipeStream = function () {};
+    this._streamFactory = options.infileStreamFactory;
+    this._connection = null;
+  }
+
+  buildParserFromFields(fields, connection) {
+    if (this.options.disableEval) {
+      return getStaticBinaryParser(fields, this.options, connection.config);
+    }
+
+    return getBinaryParser(fields, this.options, connection.config);
+  }
+
+  start(packet, connection) {
+    this._connection = connection;
+    this.options = Object.assign({}, connection.config, this._executeOptions);
+    this._setTimeout();
+    const executePacket = new Packets.Execute(
+      this.statement.id,
+      this.parameters,
+      connection.config.charsetNumber,
+      connection.config.timezone
+    );
+    //For reasons why this try-catch is here, please see
+    // https://github.com/sidorares/node-mysql2/pull/689
+    //For additional discussion, see
+    // 1. https://github.com/sidorares/node-mysql2/issues/493
+    // 2. https://github.com/sidorares/node-mysql2/issues/187
+    // 3. https://github.com/sidorares/node-mysql2/issues/480
+    try {
+      connection.writePacket(executePacket.toPacket(1));
+    } catch (error) {
+      this.onResult(error);
+    }
+    return Execute.prototype.resultsetHeader;
+  }
+
+  readField(packet, connection) {
+    let fields;
+    // disabling for now, but would be great to find reliable way to parse fields only once
+    // fields reported by prepare can be empty at all or just incorrect - see #169
+    //
+    // perfomance optimisation: if we already have this field parsed in statement header, use one from header
+    // const field = this.statement.columns.length == this._fieldCount ?
+    //  this.statement.columns[this._receivedFieldsCount] : new Packets.ColumnDefinition(packet);
+    const field = new Packets.ColumnDefinition(
+      packet,
+      connection.clientEncoding
+    );
+    this._receivedFieldsCount++;
+    this._fields[this._resultIndex].push(field);
+    if (this._receivedFieldsCount === this._fieldCount) {
+      fields = this._fields[this._resultIndex];
+      this.emit('fields', fields, this._resultIndex);
+      return Execute.prototype.fieldsEOF;
+    }
+    return Execute.prototype.readField;
+  }
+
+  fieldsEOF(packet, connection) {
+    // check EOF
+    if (!packet.isEOF()) {
+      return connection.protocolError('Expected EOF packet');
+    }
+    this._rowParser = new (this.buildParserFromFields(
+      this._fields[this._resultIndex],
+      connection
+    ))();
+    return Execute.prototype.row;
+  }
+}
+
+Execute.prototype.done = Query.prototype.done;
+Execute.prototype.doneInsert = Query.prototype.doneInsert;
+Execute.prototype.resultsetHeader = Query.prototype.resultsetHeader;
+Execute.prototype._findOrCreateReadStream =
+  Query.prototype._findOrCreateReadStream;
+Execute.prototype._streamLocalInfile = Query.prototype._streamLocalInfile;
+Execute.prototype._setTimeout = Query.prototype._setTimeout;
+Execute.prototype._handleTimeoutError = Query.prototype._handleTimeoutError;
+Execute.prototype.row = Query.prototype.row;
+Execute.prototype.stream = Query.prototype.stream;
+
+module.exports = Execute;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/index.js
new file mode 100644
index 0000000..b79818d
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/index.js	
@@ -0,0 +1,27 @@
+'use strict';
+
+const ClientHandshake = require('./client_handshake.js');
+const ServerHandshake = require('./server_handshake.js');
+const Query = require('./query.js');
+const Prepare = require('./prepare.js');
+const CloseStatement = require('./close_statement.js');
+const Execute = require('./execute.js');
+const Ping = require('./ping.js');
+const RegisterSlave = require('./register_slave.js');
+const BinlogDump = require('./binlog_dump.js');
+const ChangeUser = require('./change_user.js');
+const Quit = require('./quit.js');
+
+module.exports = {
+  ClientHandshake,
+  ServerHandshake,
+  Query,
+  Prepare,
+  CloseStatement,
+  Execute,
+  Ping,
+  RegisterSlave,
+  BinlogDump,
+  ChangeUser,
+  Quit,
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/ping.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/ping.js
new file mode 100644
index 0000000..dc820ef
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/ping.js	
@@ -0,0 +1,36 @@
+'use strict';
+
+const Command = require('./command');
+const CommandCode = require('../constants/commands');
+const Packet = require('../packets/packet');
+
+// TODO: time statistics?
+// usefull for queue size and network latency monitoring
+// store created,sent,reply timestamps
+class Ping extends Command {
+  constructor(callback) {
+    super();
+    this.onResult = callback;
+  }
+
+  start(packet, connection) {
+    const ping = new Packet(
+      0,
+      Buffer.from([1, 0, 0, 0, CommandCode.PING]),
+      0,
+      5
+    );
+    connection.writePacket(ping);
+    return Ping.prototype.pingResponse;
+  }
+
+  pingResponse() {
+    // TODO: check it's OK packet. error check already done in caller
+    if (this.onResult) {
+      process.nextTick(this.onResult.bind(this));
+    }
+    return null;
+  }
+}
+
+module.exports = Ping;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/prepare.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/prepare.js
new file mode 100644
index 0000000..ab217a8
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/prepare.js	
@@ -0,0 +1,143 @@
+'use strict';
+
+const Packets = require('../packets/index.js');
+const Command = require('./command.js');
+const CloseStatement = require('./close_statement.js');
+const Execute = require('./execute.js');
+
+class PreparedStatementInfo {
+  constructor(query, id, columns, parameters, connection) {
+    this.query = query;
+    this.id = id;
+    this.columns = columns;
+    this.parameters = parameters;
+    this.rowParser = null;
+    this._connection = connection;
+  }
+
+  close() {
+    return this._connection.addCommand(new CloseStatement(this.id));
+  }
+
+  execute(parameters, callback) {
+    if (typeof parameters === 'function') {
+      callback = parameters;
+      parameters = [];
+    }
+    return this._connection.addCommand(
+      new Execute({ statement: this, values: parameters }, callback)
+    );
+  }
+}
+
+class Prepare extends Command {
+  constructor(options, callback) {
+    super();
+    this.query = options.sql;
+    this.onResult = callback;
+    this.id = 0;
+    this.fieldCount = 0;
+    this.parameterCount = 0;
+    this.fields = [];
+    this.parameterDefinitions = [];
+    this.options = options;
+  }
+
+  start(packet, connection) {
+    const Connection = connection.constructor;
+    this.key = Connection.statementKey(this.options);
+    const statement = connection._statements.get(this.key);
+    if (statement) {
+      if (this.onResult) {
+        this.onResult(null, statement);
+      }
+      return null;
+    }
+    const cmdPacket = new Packets.PrepareStatement(
+      this.query,
+      connection.config.charsetNumber,
+      this.options.values
+    );
+    connection.writePacket(cmdPacket.toPacket(1));
+    return Prepare.prototype.prepareHeader;
+  }
+
+  prepareHeader(packet, connection) {
+    const header = new Packets.PreparedStatementHeader(packet);
+    this.id = header.id;
+    this.fieldCount = header.fieldCount;
+    this.parameterCount = header.parameterCount;
+    if (this.parameterCount > 0) {
+      return Prepare.prototype.readParameter;
+    }
+    if (this.fieldCount > 0) {
+      return Prepare.prototype.readField;
+    }
+    return this.prepareDone(connection);
+  }
+
+  readParameter(packet, connection) {
+    // there might be scenarios when mysql server reports more parameters than
+    // are actually present in the array of parameter definitions.
+    // if EOF packet is received we switch to "read fields" state if there are
+    // any fields reported by the server, otherwise we finish the command.
+    if (packet.isEOF()) {
+      if (this.fieldCount > 0) {
+        return Prepare.prototype.readField;
+      }
+      return this.prepareDone(connection);
+    }
+    const def = new Packets.ColumnDefinition(packet, connection.clientEncoding);
+    this.parameterDefinitions.push(def);
+    if (this.parameterDefinitions.length === this.parameterCount) {
+      return Prepare.prototype.parametersEOF;
+    }
+    return this.readParameter;
+  }
+
+  readField(packet, connection) {
+    if (packet.isEOF()) {
+      return this.prepareDone(connection);
+    }
+    const def = new Packets.ColumnDefinition(packet, connection.clientEncoding);
+    this.fields.push(def);
+    if (this.fields.length === this.fieldCount) {
+      return Prepare.prototype.fieldsEOF;
+    }
+    return Prepare.prototype.readField;
+  }
+
+  parametersEOF(packet, connection) {
+    if (!packet.isEOF()) {
+      return connection.protocolError('Expected EOF packet after parameters');
+    }
+    if (this.fieldCount > 0) {
+      return Prepare.prototype.readField;
+    }
+    return this.prepareDone(connection);
+  }
+
+  fieldsEOF(packet, connection) {
+    if (!packet.isEOF()) {
+      return connection.protocolError('Expected EOF packet after fields');
+    }
+    return this.prepareDone(connection);
+  }
+
+  prepareDone(connection) {
+    const statement = new PreparedStatementInfo(
+      this.query,
+      this.id,
+      this.fields,
+      this.parameterDefinitions,
+      connection
+    );
+    connection._statements.set(this.key, statement);
+    if (this.onResult) {
+      this.onResult(null, statement);
+    }
+    return null;
+  }
+}
+
+module.exports = Prepare;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/query.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/query.js
new file mode 100644
index 0000000..ec9f6d3
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/query.js	
@@ -0,0 +1,361 @@
+'use strict';
+
+const process = require('process');
+const Timers = require('timers');
+
+const Readable = require('stream').Readable;
+
+const Command = require('./command.js');
+const Packets = require('../packets/index.js');
+const getTextParser = require('../parsers/text_parser.js');
+const staticParser = require('../parsers/static_text_parser.js');
+const ServerStatus = require('../constants/server_status.js');
+
+const EmptyPacket = new Packets.Packet(0, Buffer.allocUnsafe(4), 0, 4);
+
+// http://dev.mysql.com/doc/internals/en/com-query.html
+class Query extends Command {
+  constructor(options, callback) {
+    super();
+    this.sql = options.sql;
+    this.values = options.values;
+    this._queryOptions = options;
+    this.namedPlaceholders = options.namedPlaceholders || false;
+    this.onResult = callback;
+    this.timeout = options.timeout;
+    this.queryTimeout = null;
+    this._fieldCount = 0;
+    this._rowParser = null;
+    this._fields = [];
+    this._rows = [];
+    this._receivedFieldsCount = 0;
+    this._resultIndex = 0;
+    this._localStream = null;
+    this._unpipeStream = function () {};
+    this._streamFactory = options.infileStreamFactory;
+    this._connection = null;
+  }
+
+  then() {
+    const err =
+      "You have tried to call .then(), .catch(), or invoked await on the result of query that is not a promise, which is a programming error. Try calling con.promise().query(), or require('mysql2/promise') instead of 'mysql2' for a promise-compatible version of the query interface. To learn how to use async/await or Promises check out documentation at https://sidorares.github.io/node-mysql2/docs#using-promise-wrapper, or the mysql2 documentation at https://sidorares.github.io/node-mysql2/docs/documentation/promise-wrapper";
+
+    console.log(err);
+    throw new Error(err);
+  }
+
+  /* eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }] */
+  start(_packet, connection) {
+    if (connection.config.debug) {
+      console.log('        Sending query command: %s', this.sql);
+    }
+    this._connection = connection;
+    this.options = Object.assign({}, connection.config, this._queryOptions);
+    this._setTimeout();
+
+    const cmdPacket = new Packets.Query(
+      this.sql,
+      connection.config.charsetNumber
+    );
+    connection.writePacket(cmdPacket.toPacket(1));
+    return Query.prototype.resultsetHeader;
+  }
+
+  done() {
+    this._unpipeStream();
+    // if all ready timeout, return null directly
+    if (this.timeout && !this.queryTimeout) {
+      return null;
+    }
+    // else clear timer
+    if (this.queryTimeout) {
+      Timers.clearTimeout(this.queryTimeout);
+      this.queryTimeout = null;
+    }
+    if (this.onResult) {
+      let rows, fields;
+      if (this._resultIndex === 0) {
+        rows = this._rows[0];
+        fields = this._fields[0];
+      } else {
+        rows = this._rows;
+        fields = this._fields;
+      }
+      if (fields) {
+        process.nextTick(() => {
+          this.onResult(null, rows, fields);
+        });
+      } else {
+        process.nextTick(() => {
+          this.onResult(null, rows);
+        });
+      }
+    }
+    return null;
+  }
+
+  doneInsert(rs) {
+    if (this._localStreamError) {
+      if (this.onResult) {
+        this.onResult(this._localStreamError, rs);
+      } else {
+        this.emit('error', this._localStreamError);
+      }
+      return null;
+    }
+    this._rows.push(rs);
+    this._fields.push(void 0);
+    this.emit('fields', void 0);
+    this.emit('result', rs);
+    if (rs.serverStatus & ServerStatus.SERVER_MORE_RESULTS_EXISTS) {
+      this._resultIndex++;
+      return this.resultsetHeader;
+    }
+    return this.done();
+  }
+
+  resultsetHeader(packet, connection) {
+    const rs = new Packets.ResultSetHeader(packet, connection);
+    this._fieldCount = rs.fieldCount;
+    if (connection.config.debug) {
+      console.log(
+        `        Resultset header received, expecting ${rs.fieldCount} column definition packets`
+      );
+    }
+    if (this._fieldCount === 0) {
+      return this.doneInsert(rs);
+    }
+    if (this._fieldCount === null) {
+      return this._streamLocalInfile(connection, rs.infileName);
+    }
+    this._receivedFieldsCount = 0;
+    this._rows.push([]);
+    this._fields.push([]);
+    return this.readField;
+  }
+
+  _streamLocalInfile(connection, path) {
+    if (this._streamFactory) {
+      this._localStream = this._streamFactory(path);
+    } else {
+      this._localStreamError = new Error(
+        `As a result of LOCAL INFILE command server wants to read ${path} file, but as of v2.0 you must provide streamFactory option returning ReadStream.`
+      );
+      connection.writePacket(EmptyPacket);
+      return this.infileOk;
+    }
+
+    const onConnectionError = () => {
+      this._unpipeStream();
+    };
+    const onDrain = () => {
+      this._localStream.resume();
+    };
+    const onPause = () => {
+      this._localStream.pause();
+    };
+    const onData = function (data) {
+      const dataWithHeader = Buffer.allocUnsafe(data.length + 4);
+      data.copy(dataWithHeader, 4);
+      connection.writePacket(
+        new Packets.Packet(0, dataWithHeader, 0, dataWithHeader.length)
+      );
+    };
+    const onEnd = () => {
+      connection.removeListener('error', onConnectionError);
+      connection.writePacket(EmptyPacket);
+    };
+    const onError = (err) => {
+      this._localStreamError = err;
+      connection.removeListener('error', onConnectionError);
+      connection.writePacket(EmptyPacket);
+    };
+    this._unpipeStream = () => {
+      connection.stream.removeListener('pause', onPause);
+      connection.stream.removeListener('drain', onDrain);
+      this._localStream.removeListener('data', onData);
+      this._localStream.removeListener('end', onEnd);
+      this._localStream.removeListener('error', onError);
+    };
+    connection.stream.on('pause', onPause);
+    connection.stream.on('drain', onDrain);
+    this._localStream.on('data', onData);
+    this._localStream.on('end', onEnd);
+    this._localStream.on('error', onError);
+    connection.once('error', onConnectionError);
+    return this.infileOk;
+  }
+
+  readField(packet, connection) {
+    this._receivedFieldsCount++;
+    // Often there is much more data in the column definition than in the row itself
+    // If you set manually _fields[0] to array of ColumnDefinition's (from previous call)
+    // you can 'cache' result of parsing. Field packets still received, but ignored in that case
+    // this is the reason _receivedFieldsCount exist (otherwise we could just use current length of fields array)
+    if (this._fields[this._resultIndex].length !== this._fieldCount) {
+      const field = new Packets.ColumnDefinition(
+        packet,
+        connection.clientEncoding
+      );
+      this._fields[this._resultIndex].push(field);
+      if (connection.config.debug) {
+        console.log('        Column definition:');
+        console.log(`          name: ${field.name}`);
+        console.log(`          type: ${field.columnType}`);
+        console.log(`         flags: ${field.flags}`);
+      }
+    }
+    // last field received
+    if (this._receivedFieldsCount === this._fieldCount) {
+      const fields = this._fields[this._resultIndex];
+      this.emit('fields', fields);
+      if (this.options.disableEval) {
+        this._rowParser = staticParser(fields, this.options, connection.config);
+      } else {
+        this._rowParser = new (getTextParser(
+          fields,
+          this.options,
+          connection.config
+        ))(fields);
+      }
+      return Query.prototype.fieldsEOF;
+    }
+    return Query.prototype.readField;
+  }
+
+  fieldsEOF(packet, connection) {
+    // check EOF
+    if (!packet.isEOF()) {
+      return connection.protocolError('Expected EOF packet');
+    }
+    return this.row;
+  }
+
+  row(packet, _connection) {
+    if (packet.isEOF()) {
+      const status = packet.eofStatusFlags();
+      const moreResults = status & ServerStatus.SERVER_MORE_RESULTS_EXISTS;
+      if (moreResults) {
+        this._resultIndex++;
+        return Query.prototype.resultsetHeader;
+      }
+      return this.done();
+    }
+    let row;
+    try {
+      row = this._rowParser.next(
+        packet,
+        this._fields[this._resultIndex],
+        this.options
+      );
+    } catch (err) {
+      this._localStreamError = err;
+      return this.doneInsert(null);
+    }
+    if (this.onResult) {
+      this._rows[this._resultIndex].push(row);
+    } else {
+      this.emit('result', row, this._resultIndex);
+    }
+    return Query.prototype.row;
+  }
+
+  infileOk(packet, connection) {
+    const rs = new Packets.ResultSetHeader(packet, connection);
+    return this.doneInsert(rs);
+  }
+
+  stream(options) {
+    options = options || Object.create(null);
+    options.objectMode = true;
+
+    const stream = new Readable({
+      ...options,
+      emitClose: true,
+      autoDestroy: true,
+      read: () => {
+        this._connection && this._connection.resume();
+      },
+    });
+
+    // Prevent a breaking change for users that rely on `end` event
+    stream.once('close', () => {
+      if (!stream.readableEnded) {
+        stream.emit('end');
+      }
+    });
+
+    const onResult = (row, index) => {
+      if (stream.destroyed) return;
+
+      if (!stream.push(row)) {
+        this._connection && this._connection.pause();
+      }
+
+      stream.emit('result', row, index); // replicate old emitter
+    };
+
+    const onFields = (fields) => {
+      if (stream.destroyed) return;
+
+      stream.emit('fields', fields); // replicate old emitter
+    };
+
+    const onEnd = () => {
+      if (stream.destroyed) return;
+
+      stream.push(null); // pushing null, indicating EOF
+    };
+
+    const onError = (err) => {
+      stream.destroy(err);
+    };
+
+    stream._destroy = (err, cb) => {
+      this._connection && this._connection.resume();
+
+      this.removeListener('result', onResult);
+      this.removeListener('fields', onFields);
+      this.removeListener('end', onEnd);
+      this.removeListener('error', onError);
+
+      cb(err); // Pass on any errors
+    };
+
+    this.on('result', onResult);
+    this.on('fields', onFields);
+    this.on('end', onEnd);
+    this.on('error', onError);
+
+    return stream;
+  }
+
+  _setTimeout() {
+    if (this.timeout) {
+      const timeoutHandler = this._handleTimeoutError.bind(this);
+      this.queryTimeout = Timers.setTimeout(timeoutHandler, this.timeout);
+    }
+  }
+
+  _handleTimeoutError() {
+    if (this.queryTimeout) {
+      Timers.clearTimeout(this.queryTimeout);
+      this.queryTimeout = null;
+    }
+
+    const err = new Error('Query inactivity timeout');
+    err.errorno = 'PROTOCOL_SEQUENCE_TIMEOUT';
+    err.code = 'PROTOCOL_SEQUENCE_TIMEOUT';
+    err.syscall = 'query';
+
+    if (this.onResult) {
+      this.onResult(err);
+    } else {
+      this.emit('error', err);
+    }
+  }
+}
+
+Query.prototype.catch = Query.prototype.then;
+
+module.exports = Query;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/quit.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/quit.js
new file mode 100644
index 0000000..02ed763
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/quit.js	
@@ -0,0 +1,29 @@
+'use strict';
+
+const Command = require('./command.js');
+const CommandCode = require('../constants/commands.js');
+const Packet = require('../packets/packet.js');
+
+class Quit extends Command {
+  constructor(callback) {
+    super();
+    this.onResult = callback;
+  }
+
+  start(packet, connection) {
+    connection._closing = true;
+    const quit = new Packet(
+      0,
+      Buffer.from([1, 0, 0, 0, CommandCode.QUIT]),
+      0,
+      5
+    );
+    if (this.onResult) {
+      this.onResult();
+    }
+    connection.writePacket(quit);
+    return null;
+  }
+}
+
+module.exports = Quit;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/register_slave.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/register_slave.js
new file mode 100644
index 0000000..4ebfe61
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/register_slave.js	
@@ -0,0 +1,27 @@
+'use strict';
+
+const Command = require('./command');
+const Packets = require('../packets');
+
+class RegisterSlave extends Command {
+  constructor(opts, callback) {
+    super();
+    this.onResult = callback;
+    this.opts = opts;
+  }
+
+  start(packet, connection) {
+    const newPacket = new Packets.RegisterSlave(this.opts);
+    connection.writePacket(newPacket.toPacket(1));
+    return RegisterSlave.prototype.registerResponse;
+  }
+
+  registerResponse() {
+    if (this.onResult) {
+      process.nextTick(this.onResult.bind(this));
+    }
+    return null;
+  }
+}
+
+module.exports = RegisterSlave;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/server_handshake.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/server_handshake.js
new file mode 100644
index 0000000..ce76494
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/commands/server_handshake.js	
@@ -0,0 +1,202 @@
+'use strict';
+
+const CommandCode = require('../constants/commands.js');
+const Errors = require('../constants/errors.js');
+
+const Command = require('./command.js');
+const Packets = require('../packets/index.js');
+
+class ServerHandshake extends Command {
+  constructor(args) {
+    super();
+    this.args = args;
+    /*
+    this.protocolVersion = args.protocolVersion || 10;
+    this.serverVersion   = args.serverVersion;
+    this.connectionId    = args.connectionId,
+    this.statusFlags     = args.statusFlags,
+    this.characterSet    = args.characterSet,
+    this.capabilityFlags = args.capabilityFlags || 512;
+    */
+  }
+
+  start(packet, connection) {
+    const serverHelloPacket = new Packets.Handshake(this.args);
+    this.serverHello = serverHelloPacket;
+    serverHelloPacket.setScrambleData((err) => {
+      if (err) {
+        connection.emit('error', new Error('Error generating random bytes'));
+        return;
+      }
+      connection.writePacket(serverHelloPacket.toPacket(0));
+    });
+    return ServerHandshake.prototype.readClientReply;
+  }
+
+  readClientReply(packet, connection) {
+    // check auth here
+    const clientHelloReply = Packets.HandshakeResponse.fromPacket(packet);
+    // TODO check we don't have something similar already
+    connection.clientHelloReply = clientHelloReply;
+    if (this.args.authCallback) {
+      this.args.authCallback(
+        {
+          user: clientHelloReply.user,
+          database: clientHelloReply.database,
+          address: connection.stream.remoteAddress,
+          authPluginData1: this.serverHello.authPluginData1,
+          authPluginData2: this.serverHello.authPluginData2,
+          authToken: clientHelloReply.authToken,
+        },
+        (err, mysqlError) => {
+          // if (err)
+          if (!mysqlError) {
+            connection.writeOk();
+          } else {
+            // TODO create constants / errorToCode
+            // 1045 = ER_ACCESS_DENIED_ERROR
+            connection.writeError({
+              message: mysqlError.message || '',
+              code: mysqlError.code || 1045,
+            });
+            connection.close();
+          }
+        }
+      );
+    } else {
+      connection.writeOk();
+    }
+    return ServerHandshake.prototype.dispatchCommands;
+  }
+
+  _isStatement(query, name) {
+    const firstWord = query.split(' ')[0].toUpperCase();
+    return firstWord === name;
+  }
+
+  dispatchCommands(packet, connection) {
+    // command from client to server
+    let knownCommand = true;
+    const encoding = connection.clientHelloReply.encoding;
+    const commandCode = packet.readInt8();
+    switch (commandCode) {
+      case CommandCode.STMT_PREPARE:
+        if (connection.listeners('stmt_prepare').length) {
+          const query = packet.readString(undefined, encoding);
+          connection.emit('stmt_prepare', query);
+        } else {
+          connection.writeError({
+            code: Errors.HA_ERR_INTERNAL_ERROR,
+            message: 'No query handler for prepared statements.',
+          });
+        }
+        break;
+      case CommandCode.STMT_EXECUTE:
+        if (connection.listeners('stmt_execute').length) {
+          const { stmtId, flags, iterationCount, values } =
+            Packets.Execute.fromPacket(packet, encoding);
+          connection.emit(
+            'stmt_execute',
+            stmtId,
+            flags,
+            iterationCount,
+            values
+          );
+        } else {
+          connection.writeError({
+            code: Errors.HA_ERR_INTERNAL_ERROR,
+            message: 'No query handler for execute statements.',
+          });
+        }
+        break;
+      case CommandCode.QUIT:
+        if (connection.listeners('quit').length) {
+          connection.emit('quit');
+        } else {
+          connection.stream.end();
+        }
+        break;
+      case CommandCode.INIT_DB:
+        if (connection.listeners('init_db').length) {
+          const schemaName = packet.readString(undefined, encoding);
+          connection.emit('init_db', schemaName);
+        } else {
+          connection.writeOk();
+        }
+        break;
+      case CommandCode.QUERY:
+        if (connection.listeners('query').length) {
+          const query = packet.readString(undefined, encoding);
+          if (
+            this._isStatement(query, 'PREPARE') ||
+            this._isStatement(query, 'SET')
+          ) {
+            connection.emit('stmt_prepare', query);
+          } else if (this._isStatement(query, 'EXECUTE')) {
+            connection.emit('stmt_execute', null, null, null, null, query);
+          } else connection.emit('query', query);
+        } else {
+          connection.writeError({
+            code: Errors.HA_ERR_INTERNAL_ERROR,
+            message: 'No query handler',
+          });
+        }
+        break;
+      case CommandCode.FIELD_LIST:
+        if (connection.listeners('field_list').length) {
+          const table = packet.readNullTerminatedString(encoding);
+          const fields = packet.readString(undefined, encoding);
+          connection.emit('field_list', table, fields);
+        } else {
+          connection.writeError({
+            code: Errors.ER_WARN_DEPRECATED_SYNTAX,
+            message:
+              'As of MySQL 5.7.11, COM_FIELD_LIST is deprecated and will be removed in a future version of MySQL.',
+          });
+        }
+        break;
+      case CommandCode.PING:
+        if (connection.listeners('ping').length) {
+          connection.emit('ping');
+        } else {
+          connection.writeOk();
+        }
+        break;
+      default:
+        knownCommand = false;
+    }
+    if (connection.listeners('packet').length) {
+      connection.emit('packet', packet.clone(), knownCommand, commandCode);
+    } else if (!knownCommand) {
+      console.log('Unknown command:', commandCode);
+    }
+    return ServerHandshake.prototype.dispatchCommands;
+  }
+}
+
+module.exports = ServerHandshake;
+
+// TODO: implement server-side 4.1 authentication
+/*
+4.1 authentication: (http://bazaar.launchpad.net/~mysql/mysql-server/5.5/view/head:/sql/password.c)
+
+  SERVER:  public_seed=create_random_string()
+           send(public_seed)
+
+  CLIENT:  recv(public_seed)
+           hash_stage1=sha1("password")
+           hash_stage2=sha1(hash_stage1)
+           reply=xor(hash_stage1, sha1(public_seed,hash_stage2)
+
+           // this three steps are done in scramble()
+
+           send(reply)
+
+
+  SERVER:  recv(reply)
+           hash_stage1=xor(reply, sha1(public_seed,hash_stage2))
+           candidate_hash2=sha1(hash_stage1)
+           check(candidate_hash2==hash_stage2)
+
+server stores sha1(sha1(password)) ( hash_stag2)
+*/
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/compressed_protocol.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/compressed_protocol.js
new file mode 100644
index 0000000..2c42350
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/compressed_protocol.js	
@@ -0,0 +1,153 @@
+'use strict';
+
+// connection mixins
+// implementation of http://dev.mysql.com/doc/internals/en/compression.html
+
+const zlib = require('zlib');
+const PacketParser = require('./packet_parser.js');
+
+class Queue {
+  constructor() {
+    this._queue = [];
+    this._running = false;
+  }
+
+  push(fn) {
+    this._queue.push(fn);
+    if (!this._running) {
+      this._running = true;
+      process.nextTick(() => this._next());
+    }
+  }
+
+  _next() {
+    const task = this._queue.shift();
+    if (!task) {
+      this._running = false;
+      return;
+    }
+    task({
+      done: () => process.nextTick(() => this._next()),
+    });
+  }
+}
+
+function handleCompressedPacket(packet) {
+  // eslint-disable-next-line consistent-this, no-invalid-this
+  const connection = this;
+  const deflatedLength = packet.readInt24();
+  const body = packet.readBuffer();
+
+  if (deflatedLength !== 0) {
+    connection.inflateQueue.push((task) => {
+      zlib.inflate(body, (err, data) => {
+        if (err) {
+          connection._handleNetworkError(err);
+          return;
+        }
+        connection._bumpCompressedSequenceId(packet.numPackets);
+        connection._inflatedPacketsParser.execute(data);
+        task.done();
+      });
+    });
+  } else {
+    connection.inflateQueue.push((task) => {
+      connection._bumpCompressedSequenceId(packet.numPackets);
+      connection._inflatedPacketsParser.execute(body);
+      task.done();
+    });
+  }
+}
+
+function writeCompressed(buffer) {
+  // http://dev.mysql.com/doc/internals/en/example-several-mysql-packets.html
+  // note: sending a MySQL Packet of the size 2^24−5 to 2^24−1 via compression
+  // leads to at least one extra compressed packet.
+  // (this is because "length of the packet before compression" need to fit
+  // into 3 byte unsigned int. "length of the packet before compression" includes
+  // 4 byte packet header, hence 2^24−5)
+  const MAX_COMPRESSED_LENGTH = 16777210;
+  let start;
+  if (buffer.length > MAX_COMPRESSED_LENGTH) {
+    for (start = 0; start < buffer.length; start += MAX_COMPRESSED_LENGTH) {
+      writeCompressed.call(
+        // eslint-disable-next-line no-invalid-this
+        this,
+        buffer.slice(start, start + MAX_COMPRESSED_LENGTH)
+      );
+    }
+    return;
+  }
+
+  // eslint-disable-next-line no-invalid-this, consistent-this
+  const connection = this;
+
+  let packetLen = buffer.length;
+  const compressHeader = Buffer.allocUnsafe(7);
+
+  // seqqueue is used here because zlib async execution is routed via thread pool
+  // internally and when we have multiple compressed packets arriving we need
+  // to assemble uncompressed result sequentially
+  (function (seqId) {
+    connection.deflateQueue.push((task) => {
+      zlib.deflate(buffer, (err, compressed) => {
+        if (err) {
+          connection._handleFatalError(err);
+          return;
+        }
+        let compressedLength = compressed.length;
+
+        if (compressedLength < packetLen) {
+          compressHeader.writeUInt8(compressedLength & 0xff, 0);
+          compressHeader.writeUInt16LE(compressedLength >> 8, 1);
+          compressHeader.writeUInt8(seqId, 3);
+          compressHeader.writeUInt8(packetLen & 0xff, 4);
+          compressHeader.writeUInt16LE(packetLen >> 8, 5);
+          connection.writeUncompressed(compressHeader);
+          connection.writeUncompressed(compressed);
+        } else {
+          // http://dev.mysql.com/doc/internals/en/uncompressed-payload.html
+          // To send an uncompressed payload:
+          //   - set length of payload before compression to 0
+          //   - the compressed payload contains the uncompressed payload instead.
+          compressedLength = packetLen;
+          packetLen = 0;
+          compressHeader.writeUInt8(compressedLength & 0xff, 0);
+          compressHeader.writeUInt16LE(compressedLength >> 8, 1);
+          compressHeader.writeUInt8(seqId, 3);
+          compressHeader.writeUInt8(packetLen & 0xff, 4);
+          compressHeader.writeUInt16LE(packetLen >> 8, 5);
+          connection.writeUncompressed(compressHeader);
+          connection.writeUncompressed(buffer);
+        }
+        task.done();
+      });
+    });
+  })(connection.compressedSequenceId);
+  connection._bumpCompressedSequenceId(1);
+}
+
+function enableCompression(connection) {
+  connection._lastWrittenPacketId = 0;
+  connection._lastReceivedPacketId = 0;
+
+  connection._handleCompressedPacket = handleCompressedPacket;
+  connection._inflatedPacketsParser = new PacketParser((p) => {
+    connection.handlePacket(p);
+  }, 4);
+  connection._inflatedPacketsParser._lastPacket = 0;
+  connection.packetParser = new PacketParser((packet) => {
+    connection._handleCompressedPacket(packet);
+  }, 7);
+
+  connection.writeUncompressed = connection.write;
+  connection.write = writeCompressed;
+
+  connection.inflateQueue = new Queue();
+  connection.deflateQueue = new Queue();
+}
+
+module.exports = {
+  enableCompression: enableCompression,
+  Queue: Queue,
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/connection.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/connection.js
new file mode 100644
index 0000000..b21cff8
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/connection.js	
@@ -0,0 +1,12 @@
+'use strict';
+
+const BaseConnection = require('./base/connection.js');
+
+class Connection extends BaseConnection {
+  promise(promiseImpl) {
+    const PromiseConnection = require('./promise/connection.js');
+    return new PromiseConnection(this, promiseImpl);
+  }
+}
+
+module.exports = Connection;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/connection_config.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/connection_config.js
new file mode 100644
index 0000000..485334e
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/connection_config.js	
@@ -0,0 +1,296 @@
+// This file was modified by Oracle on September 21, 2021.
+// New connection options for additional authentication factors were
+// introduced.
+// Multi-factor authentication capability is now enabled if one of these
+// options is used.
+// Modifications copyright (c) 2021, Oracle and/or its affiliates.
+
+'use strict';
+
+const { URL } = require('url');
+const ClientConstants = require('./constants/client');
+const Charsets = require('./constants/charsets');
+const { version } = require('../package.json');
+let SSLProfiles = null;
+
+const validOptions = {
+  authPlugins: 1,
+  authSwitchHandler: 1,
+  bigNumberStrings: 1,
+  charset: 1,
+  charsetNumber: 1,
+  compress: 1,
+  connectAttributes: 1,
+  connectTimeout: 1,
+  database: 1,
+  dateStrings: 1,
+  debug: 1,
+  decimalNumbers: 1,
+  enableKeepAlive: 1,
+  flags: 1,
+  host: 1,
+  insecureAuth: 1,
+  infileStreamFactory: 1,
+  isServer: 1,
+  keepAliveInitialDelay: 1,
+  localAddress: 1,
+  maxPreparedStatements: 1,
+  multipleStatements: 1,
+  namedPlaceholders: 1,
+  nestTables: 1,
+  password: 1,
+  // with multi-factor authentication, the main password (used for the first
+  // authentication factor) can be provided via password1
+  password1: 1,
+  password2: 1,
+  password3: 1,
+  passwordSha1: 1,
+  pool: 1,
+  port: 1,
+  queryFormat: 1,
+  rowsAsArray: 1,
+  socketPath: 1,
+  ssl: 1,
+  stream: 1,
+  stringifyObjects: 1,
+  supportBigNumbers: 1,
+  timezone: 1,
+  trace: 1,
+  typeCast: 1,
+  uri: 1,
+  user: 1,
+  disableEval: 1,
+  // These options are used for Pool
+  connectionLimit: 1,
+  maxIdle: 1,
+  idleTimeout: 1,
+  Promise: 1,
+  queueLimit: 1,
+  waitForConnections: 1,
+  jsonStrings: 1,
+  gracefulEnd: 1,
+};
+
+class ConnectionConfig {
+  constructor(options) {
+    if (typeof options === 'string') {
+      options = ConnectionConfig.parseUrl(options);
+    } else if (options && options.uri) {
+      const uriOptions = ConnectionConfig.parseUrl(options.uri);
+      for (const key in uriOptions) {
+        if (!Object.prototype.hasOwnProperty.call(uriOptions, key)) continue;
+        if (options[key]) continue;
+        options[key] = uriOptions[key];
+      }
+    }
+    for (const key in options) {
+      if (!Object.prototype.hasOwnProperty.call(options, key)) continue;
+      if (validOptions[key] !== 1) {
+        // REVIEW: Should this be emitted somehow?
+        console.error(
+          `Ignoring invalid configuration option passed to Connection: ${key}. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection`
+        );
+      }
+    }
+    this.isServer = options.isServer;
+    this.stream = options.stream;
+    this.host = options.host || 'localhost';
+    this.port =
+      (typeof options.port === 'string'
+        ? parseInt(options.port, 10)
+        : options.port) || 3306;
+    this.localAddress = options.localAddress;
+    this.socketPath = options.socketPath;
+    this.user = options.user || undefined;
+    // for the purpose of multi-factor authentication, or not, the main
+    // password (used for the 1st authentication factor) can also be
+    // provided via the "password1" option
+    this.password = options.password || options.password1 || undefined;
+    this.password2 = options.password2 || undefined;
+    this.password3 = options.password3 || undefined;
+    this.passwordSha1 = options.passwordSha1 || undefined;
+    this.database = options.database;
+    this.connectTimeout = isNaN(options.connectTimeout)
+      ? 10 * 1000
+      : options.connectTimeout;
+    this.insecureAuth = options.insecureAuth || false;
+    this.infileStreamFactory = options.infileStreamFactory || undefined;
+    this.supportBigNumbers = options.supportBigNumbers || false;
+    this.bigNumberStrings = options.bigNumberStrings || false;
+    this.decimalNumbers = options.decimalNumbers || false;
+    this.dateStrings = options.dateStrings || false;
+    this.debug = options.debug;
+    this.trace = options.trace !== false;
+    this.stringifyObjects = options.stringifyObjects || false;
+    this.enableKeepAlive = options.enableKeepAlive !== false;
+    this.keepAliveInitialDelay = options.keepAliveInitialDelay;
+    if (
+      options.timezone &&
+      !/^(?:local|Z|[ +-]\d\d:\d\d)$/.test(options.timezone)
+    ) {
+      // strictly supports timezones specified by mysqljs/mysql:
+      // https://github.com/mysqljs/mysql#user-content-connection-options
+
+      console.error(
+        `Ignoring invalid timezone passed to Connection: ${options.timezone}. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection`
+      );
+      // SqlStrings falls back to UTC on invalid timezone
+      this.timezone = 'Z';
+    } else {
+      this.timezone = options.timezone || 'local';
+    }
+    this.queryFormat = options.queryFormat;
+    this.pool = options.pool || undefined;
+    this.ssl =
+      typeof options.ssl === 'string'
+        ? ConnectionConfig.getSSLProfile(options.ssl)
+        : options.ssl || false;
+    this.multipleStatements = options.multipleStatements || false;
+    this.rowsAsArray = options.rowsAsArray || false;
+    this.namedPlaceholders = options.namedPlaceholders || false;
+    this.nestTables =
+      options.nestTables === undefined ? undefined : options.nestTables;
+    this.typeCast = options.typeCast === undefined ? true : options.typeCast;
+    this.disableEval = Boolean(options.disableEval);
+    if (this.timezone[0] === ' ') {
+      // "+" is a url encoded char for space so it
+      // gets translated to space when giving a
+      // connection string..
+      this.timezone = `+${this.timezone.slice(1)}`;
+    }
+    if (this.ssl) {
+      if (typeof this.ssl !== 'object') {
+        throw new TypeError(
+          `SSL profile must be an object, instead it's a ${typeof this.ssl}`
+        );
+      }
+      // Default rejectUnauthorized to true
+      this.ssl.rejectUnauthorized = this.ssl.rejectUnauthorized !== false;
+    }
+    this.maxPacketSize = 0;
+    this.charsetNumber = options.charset
+      ? ConnectionConfig.getCharsetNumber(options.charset)
+      : options.charsetNumber || Charsets.UTF8MB4_UNICODE_CI;
+    this.compress = options.compress || false;
+    this.authPlugins = options.authPlugins;
+    this.authSwitchHandler = options.authSwitchHandler;
+    this.clientFlags = ConnectionConfig.mergeFlags(
+      ConnectionConfig.getDefaultFlags(options),
+      options.flags || ''
+    );
+    // Default connection attributes
+    // https://dev.mysql.com/doc/refman/8.0/en/performance-schema-connection-attribute-tables.html
+    const defaultConnectAttributes = {
+      _client_name: 'Node-MySQL-2',
+      _client_version: version,
+    };
+    this.connectAttributes = {
+      ...defaultConnectAttributes,
+      ...(options.connectAttributes || {}),
+    };
+    this.maxPreparedStatements = options.maxPreparedStatements || 16000;
+    this.jsonStrings = options.jsonStrings || false;
+    this.gracefulEnd = options.gracefulEnd || false;
+  }
+
+  static mergeFlags(default_flags, user_flags) {
+    let flags = 0x0,
+      i;
+    if (!Array.isArray(user_flags)) {
+      user_flags = String(user_flags || '')
+        .toUpperCase()
+        .split(/\s*,+\s*/);
+    }
+    // add default flags unless "blacklisted"
+    for (i in default_flags) {
+      if (user_flags.indexOf(`-${default_flags[i]}`) >= 0) {
+        continue;
+      }
+      flags |= ClientConstants[default_flags[i]] || 0x0;
+    }
+    // add user flags unless already already added
+    for (i in user_flags) {
+      if (user_flags[i][0] === '-') {
+        continue;
+      }
+      if (default_flags.indexOf(user_flags[i]) >= 0) {
+        continue;
+      }
+      flags |= ClientConstants[user_flags[i]] || 0x0;
+    }
+    return flags;
+  }
+
+  static getDefaultFlags(options) {
+    const defaultFlags = [
+      'LONG_PASSWORD',
+      'FOUND_ROWS',
+      'LONG_FLAG',
+      'CONNECT_WITH_DB',
+      'ODBC',
+      'LOCAL_FILES',
+      'IGNORE_SPACE',
+      'PROTOCOL_41',
+      'IGNORE_SIGPIPE',
+      'TRANSACTIONS',
+      'RESERVED',
+      'SECURE_CONNECTION',
+      'MULTI_RESULTS',
+      'TRANSACTIONS',
+      'SESSION_TRACK',
+      'CONNECT_ATTRS',
+    ];
+    if (options && options.multipleStatements) {
+      defaultFlags.push('MULTI_STATEMENTS');
+    }
+    defaultFlags.push('PLUGIN_AUTH');
+    defaultFlags.push('PLUGIN_AUTH_LENENC_CLIENT_DATA');
+
+    return defaultFlags;
+  }
+
+  static getCharsetNumber(charset) {
+    const num = Charsets[charset.toUpperCase()];
+    if (num === undefined) {
+      throw new TypeError(`Unknown charset '${charset}'`);
+    }
+    return num;
+  }
+
+  static getSSLProfile(name) {
+    if (!SSLProfiles) {
+      SSLProfiles = require('./constants/ssl_profiles.js');
+    }
+    const ssl = SSLProfiles[name];
+    if (ssl === undefined) {
+      throw new TypeError(`Unknown SSL profile '${name}'`);
+    }
+    return ssl;
+  }
+
+  static parseUrl(url) {
+    const parsedUrl = new URL(url);
+    const options = {
+      host: decodeURIComponent(parsedUrl.hostname),
+      port: parseInt(parsedUrl.port, 10),
+      database: decodeURIComponent(parsedUrl.pathname.slice(1)),
+      user: decodeURIComponent(parsedUrl.username),
+      password: decodeURIComponent(parsedUrl.password),
+    };
+    for (const [key, value] of parsedUrl.searchParams) {
+      if (key in options) {
+        continue;
+      }
+      try {
+        // Try to parse this as a JSON expression first
+        options[key] = JSON.parse(value);
+      } catch {
+        // Otherwise assume it is a plain string
+        options[key] = value;
+      }
+    }
+    return options;
+  }
+}
+
+module.exports = ConnectionConfig;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/charset_encodings.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/charset_encodings.js
new file mode 100644
index 0000000..bef8283
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/charset_encodings.js	
@@ -0,0 +1,317 @@
+'use strict';
+
+// see tools/generate-charset-mapping.js
+// basicalliy result of "SHOW COLLATION" query
+
+module.exports = [
+  'utf8',
+  'big5',
+  'latin2',
+  'dec8',
+  'cp850',
+  'latin1',
+  'hp8',
+  'koi8r',
+  'latin1',
+  'latin2',
+  'swe7',
+  'ascii',
+  'eucjp',
+  'sjis',
+  'cp1251',
+  'latin1',
+  'hebrew',
+  'utf8',
+  'tis620',
+  'euckr',
+  'latin7',
+  'latin2',
+  'koi8u',
+  'cp1251',
+  'gb2312',
+  'greek',
+  'cp1250',
+  'latin2',
+  'gbk',
+  'cp1257',
+  'latin5',
+  'latin1',
+  'armscii8',
+  'cesu8',
+  'cp1250',
+  'ucs2',
+  'cp866',
+  'keybcs2',
+  'macintosh',
+  'macroman',
+  'cp852',
+  'latin7',
+  'latin7',
+  'macintosh',
+  'cp1250',
+  'utf8',
+  'utf8',
+  'latin1',
+  'latin1',
+  'latin1',
+  'cp1251',
+  'cp1251',
+  'cp1251',
+  'macroman',
+  'utf16',
+  'utf16',
+  'utf16-le',
+  'cp1256',
+  'cp1257',
+  'cp1257',
+  'utf32',
+  'utf32',
+  'utf16-le',
+  'binary',
+  'armscii8',
+  'ascii',
+  'cp1250',
+  'cp1256',
+  'cp866',
+  'dec8',
+  'greek',
+  'hebrew',
+  'hp8',
+  'keybcs2',
+  'koi8r',
+  'koi8u',
+  'cesu8',
+  'latin2',
+  'latin5',
+  'latin7',
+  'cp850',
+  'cp852',
+  'swe7',
+  'cesu8',
+  'big5',
+  'euckr',
+  'gb2312',
+  'gbk',
+  'sjis',
+  'tis620',
+  'ucs2',
+  'eucjp',
+  'geostd8',
+  'geostd8',
+  'latin1',
+  'cp932',
+  'cp932',
+  'eucjpms',
+  'eucjpms',
+  'cp1250',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf16',
+  'utf8',
+  'utf8',
+  'utf8',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'ucs2',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'ucs2',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf32',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'cesu8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'cesu8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'gb18030',
+  'gb18030',
+  'gb18030',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+  'utf8',
+];
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/charsets.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/charsets.js
new file mode 100644
index 0000000..2cb0a97
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/charsets.js	
@@ -0,0 +1,317 @@
+'use strict';
+
+exports.BIG5_CHINESE_CI = 1;
+exports.LATIN2_CZECH_CS = 2;
+exports.DEC8_SWEDISH_CI = 3;
+exports.CP850_GENERAL_CI = 4;
+exports.LATIN1_GERMAN1_CI = 5;
+exports.HP8_ENGLISH_CI = 6;
+exports.KOI8R_GENERAL_CI = 7;
+exports.LATIN1_SWEDISH_CI = 8;
+exports.LATIN2_GENERAL_CI = 9;
+exports.SWE7_SWEDISH_CI = 10;
+exports.ASCII_GENERAL_CI = 11;
+exports.UJIS_JAPANESE_CI = 12;
+exports.SJIS_JAPANESE_CI = 13;
+exports.CP1251_BULGARIAN_CI = 14;
+exports.LATIN1_DANISH_CI = 15;
+exports.HEBREW_GENERAL_CI = 16;
+exports.TIS620_THAI_CI = 18;
+exports.EUCKR_KOREAN_CI = 19;
+exports.LATIN7_ESTONIAN_CS = 20;
+exports.LATIN2_HUNGARIAN_CI = 21;
+exports.KOI8U_GENERAL_CI = 22;
+exports.CP1251_UKRAINIAN_CI = 23;
+exports.GB2312_CHINESE_CI = 24;
+exports.GREEK_GENERAL_CI = 25;
+exports.CP1250_GENERAL_CI = 26;
+exports.LATIN2_CROATIAN_CI = 27;
+exports.GBK_CHINESE_CI = 28;
+exports.CP1257_LITHUANIAN_CI = 29;
+exports.LATIN5_TURKISH_CI = 30;
+exports.LATIN1_GERMAN2_CI = 31;
+exports.ARMSCII8_GENERAL_CI = 32;
+exports.UTF8_GENERAL_CI = 33;
+exports.CP1250_CZECH_CS = 34;
+exports.UCS2_GENERAL_CI = 35;
+exports.CP866_GENERAL_CI = 36;
+exports.KEYBCS2_GENERAL_CI = 37;
+exports.MACCE_GENERAL_CI = 38;
+exports.MACROMAN_GENERAL_CI = 39;
+exports.CP852_GENERAL_CI = 40;
+exports.LATIN7_GENERAL_CI = 41;
+exports.LATIN7_GENERAL_CS = 42;
+exports.MACCE_BIN = 43;
+exports.CP1250_CROATIAN_CI = 44;
+exports.UTF8MB4_GENERAL_CI = 45;
+exports.UTF8MB4_BIN = 46;
+exports.LATIN1_BIN = 47;
+exports.LATIN1_GENERAL_CI = 48;
+exports.LATIN1_GENERAL_CS = 49;
+exports.CP1251_BIN = 50;
+exports.CP1251_GENERAL_CI = 51;
+exports.CP1251_GENERAL_CS = 52;
+exports.MACROMAN_BIN = 53;
+exports.UTF16_GENERAL_CI = 54;
+exports.UTF16_BIN = 55;
+exports.UTF16LE_GENERAL_CI = 56;
+exports.CP1256_GENERAL_CI = 57;
+exports.CP1257_BIN = 58;
+exports.CP1257_GENERAL_CI = 59;
+exports.UTF32_GENERAL_CI = 60;
+exports.UTF32_BIN = 61;
+exports.UTF16LE_BIN = 62;
+exports.BINARY = 63;
+exports.ARMSCII8_BIN = 64;
+exports.ASCII_BIN = 65;
+exports.CP1250_BIN = 66;
+exports.CP1256_BIN = 67;
+exports.CP866_BIN = 68;
+exports.DEC8_BIN = 69;
+exports.GREEK_BIN = 70;
+exports.HEBREW_BIN = 71;
+exports.HP8_BIN = 72;
+exports.KEYBCS2_BIN = 73;
+exports.KOI8R_BIN = 74;
+exports.KOI8U_BIN = 75;
+exports.UTF8_TOLOWER_CI = 76;
+exports.LATIN2_BIN = 77;
+exports.LATIN5_BIN = 78;
+exports.LATIN7_BIN = 79;
+exports.CP850_BIN = 80;
+exports.CP852_BIN = 81;
+exports.SWE7_BIN = 82;
+exports.UTF8_BIN = 83;
+exports.BIG5_BIN = 84;
+exports.EUCKR_BIN = 85;
+exports.GB2312_BIN = 86;
+exports.GBK_BIN = 87;
+exports.SJIS_BIN = 88;
+exports.TIS620_BIN = 89;
+exports.UCS2_BIN = 90;
+exports.UJIS_BIN = 91;
+exports.GEOSTD8_GENERAL_CI = 92;
+exports.GEOSTD8_BIN = 93;
+exports.LATIN1_SPANISH_CI = 94;
+exports.CP932_JAPANESE_CI = 95;
+exports.CP932_BIN = 96;
+exports.EUCJPMS_JAPANESE_CI = 97;
+exports.EUCJPMS_BIN = 98;
+exports.CP1250_POLISH_CI = 99;
+exports.UTF16_UNICODE_CI = 101;
+exports.UTF16_ICELANDIC_CI = 102;
+exports.UTF16_LATVIAN_CI = 103;
+exports.UTF16_ROMANIAN_CI = 104;
+exports.UTF16_SLOVENIAN_CI = 105;
+exports.UTF16_POLISH_CI = 106;
+exports.UTF16_ESTONIAN_CI = 107;
+exports.UTF16_SPANISH_CI = 108;
+exports.UTF16_SWEDISH_CI = 109;
+exports.UTF16_TURKISH_CI = 110;
+exports.UTF16_CZECH_CI = 111;
+exports.UTF16_DANISH_CI = 112;
+exports.UTF16_LITHUANIAN_CI = 113;
+exports.UTF16_SLOVAK_CI = 114;
+exports.UTF16_SPANISH2_CI = 115;
+exports.UTF16_ROMAN_CI = 116;
+exports.UTF16_PERSIAN_CI = 117;
+exports.UTF16_ESPERANTO_CI = 118;
+exports.UTF16_HUNGARIAN_CI = 119;
+exports.UTF16_SINHALA_CI = 120;
+exports.UTF16_GERMAN2_CI = 121;
+exports.UTF16_CROATIAN_CI = 122;
+exports.UTF16_UNICODE_520_CI = 123;
+exports.UTF16_VIETNAMESE_CI = 124;
+exports.UCS2_UNICODE_CI = 128;
+exports.UCS2_ICELANDIC_CI = 129;
+exports.UCS2_LATVIAN_CI = 130;
+exports.UCS2_ROMANIAN_CI = 131;
+exports.UCS2_SLOVENIAN_CI = 132;
+exports.UCS2_POLISH_CI = 133;
+exports.UCS2_ESTONIAN_CI = 134;
+exports.UCS2_SPANISH_CI = 135;
+exports.UCS2_SWEDISH_CI = 136;
+exports.UCS2_TURKISH_CI = 137;
+exports.UCS2_CZECH_CI = 138;
+exports.UCS2_DANISH_CI = 139;
+exports.UCS2_LITHUANIAN_CI = 140;
+exports.UCS2_SLOVAK_CI = 141;
+exports.UCS2_SPANISH2_CI = 142;
+exports.UCS2_ROMAN_CI = 143;
+exports.UCS2_PERSIAN_CI = 144;
+exports.UCS2_ESPERANTO_CI = 145;
+exports.UCS2_HUNGARIAN_CI = 146;
+exports.UCS2_SINHALA_CI = 147;
+exports.UCS2_GERMAN2_CI = 148;
+exports.UCS2_CROATIAN_CI = 149;
+exports.UCS2_UNICODE_520_CI = 150;
+exports.UCS2_VIETNAMESE_CI = 151;
+exports.UCS2_GENERAL_MYSQL500_CI = 159;
+exports.UTF32_UNICODE_CI = 160;
+exports.UTF32_ICELANDIC_CI = 161;
+exports.UTF32_LATVIAN_CI = 162;
+exports.UTF32_ROMANIAN_CI = 163;
+exports.UTF32_SLOVENIAN_CI = 164;
+exports.UTF32_POLISH_CI = 165;
+exports.UTF32_ESTONIAN_CI = 166;
+exports.UTF32_SPANISH_CI = 167;
+exports.UTF32_SWEDISH_CI = 168;
+exports.UTF32_TURKISH_CI = 169;
+exports.UTF32_CZECH_CI = 170;
+exports.UTF32_DANISH_CI = 171;
+exports.UTF32_LITHUANIAN_CI = 172;
+exports.UTF32_SLOVAK_CI = 173;
+exports.UTF32_SPANISH2_CI = 174;
+exports.UTF32_ROMAN_CI = 175;
+exports.UTF32_PERSIAN_CI = 176;
+exports.UTF32_ESPERANTO_CI = 177;
+exports.UTF32_HUNGARIAN_CI = 178;
+exports.UTF32_SINHALA_CI = 179;
+exports.UTF32_GERMAN2_CI = 180;
+exports.UTF32_CROATIAN_CI = 181;
+exports.UTF32_UNICODE_520_CI = 182;
+exports.UTF32_VIETNAMESE_CI = 183;
+exports.UTF8_UNICODE_CI = 192;
+exports.UTF8_ICELANDIC_CI = 193;
+exports.UTF8_LATVIAN_CI = 194;
+exports.UTF8_ROMANIAN_CI = 195;
+exports.UTF8_SLOVENIAN_CI = 196;
+exports.UTF8_POLISH_CI = 197;
+exports.UTF8_ESTONIAN_CI = 198;
+exports.UTF8_SPANISH_CI = 199;
+exports.UTF8_SWEDISH_CI = 200;
+exports.UTF8_TURKISH_CI = 201;
+exports.UTF8_CZECH_CI = 202;
+exports.UTF8_DANISH_CI = 203;
+exports.UTF8_LITHUANIAN_CI = 204;
+exports.UTF8_SLOVAK_CI = 205;
+exports.UTF8_SPANISH2_CI = 206;
+exports.UTF8_ROMAN_CI = 207;
+exports.UTF8_PERSIAN_CI = 208;
+exports.UTF8_ESPERANTO_CI = 209;
+exports.UTF8_HUNGARIAN_CI = 210;
+exports.UTF8_SINHALA_CI = 211;
+exports.UTF8_GERMAN2_CI = 212;
+exports.UTF8_CROATIAN_CI = 213;
+exports.UTF8_UNICODE_520_CI = 214;
+exports.UTF8_VIETNAMESE_CI = 215;
+exports.UTF8_GENERAL_MYSQL500_CI = 223;
+exports.UTF8MB4_UNICODE_CI = 224;
+exports.UTF8MB4_ICELANDIC_CI = 225;
+exports.UTF8MB4_LATVIAN_CI = 226;
+exports.UTF8MB4_ROMANIAN_CI = 227;
+exports.UTF8MB4_SLOVENIAN_CI = 228;
+exports.UTF8MB4_POLISH_CI = 229;
+exports.UTF8MB4_ESTONIAN_CI = 230;
+exports.UTF8MB4_SPANISH_CI = 231;
+exports.UTF8MB4_SWEDISH_CI = 232;
+exports.UTF8MB4_TURKISH_CI = 233;
+exports.UTF8MB4_CZECH_CI = 234;
+exports.UTF8MB4_DANISH_CI = 235;
+exports.UTF8MB4_LITHUANIAN_CI = 236;
+exports.UTF8MB4_SLOVAK_CI = 237;
+exports.UTF8MB4_SPANISH2_CI = 238;
+exports.UTF8MB4_ROMAN_CI = 239;
+exports.UTF8MB4_PERSIAN_CI = 240;
+exports.UTF8MB4_ESPERANTO_CI = 241;
+exports.UTF8MB4_HUNGARIAN_CI = 242;
+exports.UTF8MB4_SINHALA_CI = 243;
+exports.UTF8MB4_GERMAN2_CI = 244;
+exports.UTF8MB4_CROATIAN_CI = 245;
+exports.UTF8MB4_UNICODE_520_CI = 246;
+exports.UTF8MB4_VIETNAMESE_CI = 247;
+exports.GB18030_CHINESE_CI = 248;
+exports.GB18030_BIN = 249;
+exports.GB18030_UNICODE_520_CI = 250;
+exports.UTF8_GENERAL50_CI = 253; // deprecated
+exports.UTF8MB4_0900_AI_CI = 255;
+exports.UTF8MB4_DE_PB_0900_AI_CI = 256;
+exports.UTF8MB4_IS_0900_AI_CI = 257;
+exports.UTF8MB4_LV_0900_AI_CI = 258;
+exports.UTF8MB4_RO_0900_AI_CI = 259;
+exports.UTF8MB4_SL_0900_AI_CI = 260;
+exports.UTF8MB4_PL_0900_AI_CI = 261;
+exports.UTF8MB4_ET_0900_AI_CI = 262;
+exports.UTF8MB4_ES_0900_AI_CI = 263;
+exports.UTF8MB4_SV_0900_AI_CI = 264;
+exports.UTF8MB4_TR_0900_AI_CI = 265;
+exports.UTF8MB4_CS_0900_AI_CI = 266;
+exports.UTF8MB4_DA_0900_AI_CI = 267;
+exports.UTF8MB4_LT_0900_AI_CI = 268;
+exports.UTF8MB4_SK_0900_AI_CI = 269;
+exports.UTF8MB4_ES_TRAD_0900_AI_CI = 270;
+exports.UTF8MB4_LA_0900_AI_CI = 271;
+exports.UTF8MB4_EO_0900_AI_CI = 273;
+exports.UTF8MB4_HU_0900_AI_CI = 274;
+exports.UTF8MB4_HR_0900_AI_CI = 275;
+exports.UTF8MB4_VI_0900_AI_CI = 277;
+exports.UTF8MB4_0900_AS_CS = 278;
+exports.UTF8MB4_DE_PB_0900_AS_CS = 279;
+exports.UTF8MB4_IS_0900_AS_CS = 280;
+exports.UTF8MB4_LV_0900_AS_CS = 281;
+exports.UTF8MB4_RO_0900_AS_CS = 282;
+exports.UTF8MB4_SL_0900_AS_CS = 283;
+exports.UTF8MB4_PL_0900_AS_CS = 284;
+exports.UTF8MB4_ET_0900_AS_CS = 285;
+exports.UTF8MB4_ES_0900_AS_CS = 286;
+exports.UTF8MB4_SV_0900_AS_CS = 287;
+exports.UTF8MB4_TR_0900_AS_CS = 288;
+exports.UTF8MB4_CS_0900_AS_CS = 289;
+exports.UTF8MB4_DA_0900_AS_CS = 290;
+exports.UTF8MB4_LT_0900_AS_CS = 291;
+exports.UTF8MB4_SK_0900_AS_CS = 292;
+exports.UTF8MB4_ES_TRAD_0900_AS_CS = 293;
+exports.UTF8MB4_LA_0900_AS_CS = 294;
+exports.UTF8MB4_EO_0900_AS_CS = 296;
+exports.UTF8MB4_HU_0900_AS_CS = 297;
+exports.UTF8MB4_HR_0900_AS_CS = 298;
+exports.UTF8MB4_VI_0900_AS_CS = 300;
+exports.UTF8MB4_JA_0900_AS_CS = 303;
+exports.UTF8MB4_JA_0900_AS_CS_KS = 304;
+exports.UTF8MB4_0900_AS_CI = 305;
+exports.UTF8MB4_RU_0900_AI_CI = 306;
+exports.UTF8MB4_RU_0900_AS_CS = 307;
+exports.UTF8MB4_ZH_0900_AS_CS = 308;
+exports.UTF8MB4_0900_BIN = 309;
+
+// short aliases
+exports.BIG5 = exports.BIG5_CHINESE_CI;
+exports.DEC8 = exports.DEC8_SWEDISH_CI;
+exports.CP850 = exports.CP850_GENERAL_CI;
+exports.HP8 = exports.HP8_ENGLISH_CI;
+exports.KOI8R = exports.KOI8R_GENERAL_CI;
+exports.LATIN1 = exports.LATIN1_SWEDISH_CI;
+exports.LATIN2 = exports.LATIN2_GENERAL_CI;
+exports.SWE7 = exports.SWE7_SWEDISH_CI;
+exports.ASCII = exports.ASCII_GENERAL_CI;
+exports.UJIS = exports.UJIS_JAPANESE_CI;
+exports.SJIS = exports.SJIS_JAPANESE_CI;
+exports.HEBREW = exports.HEBREW_GENERAL_CI;
+exports.TIS620 = exports.TIS620_THAI_CI;
+exports.EUCKR = exports.EUCKR_KOREAN_CI;
+exports.KOI8U = exports.KOI8U_GENERAL_CI;
+exports.GB2312 = exports.GB2312_CHINESE_CI;
+exports.GREEK = exports.GREEK_GENERAL_CI;
+exports.CP1250 = exports.CP1250_GENERAL_CI;
+exports.GBK = exports.GBK_CHINESE_CI;
+exports.LATIN5 = exports.LATIN5_TURKISH_CI;
+exports.ARMSCII8 = exports.ARMSCII8_GENERAL_CI;
+exports.UTF8 = exports.UTF8_GENERAL_CI;
+exports.UCS2 = exports.UCS2_GENERAL_CI;
+exports.CP866 = exports.CP866_GENERAL_CI;
+exports.KEYBCS2 = exports.KEYBCS2_GENERAL_CI;
+exports.MACCE = exports.MACCE_GENERAL_CI;
+exports.MACROMAN = exports.MACROMAN_GENERAL_CI;
+exports.CP852 = exports.CP852_GENERAL_CI;
+exports.LATIN7 = exports.LATIN7_GENERAL_CI;
+exports.UTF8MB4 = exports.UTF8MB4_GENERAL_CI;
+exports.CP1251 = exports.CP1251_GENERAL_CI;
+exports.UTF16 = exports.UTF16_GENERAL_CI;
+exports.UTF16LE = exports.UTF16LE_GENERAL_CI;
+exports.CP1256 = exports.CP1256_GENERAL_CI;
+exports.CP1257 = exports.CP1257_GENERAL_CI;
+exports.UTF32 = exports.UTF32_GENERAL_CI;
+exports.CP932 = exports.CP932_JAPANESE_CI;
+exports.EUCJPMS = exports.EUCJPMS_JAPANESE_CI;
+exports.GB18030 = exports.GB18030_CHINESE_CI;
+exports.GEOSTD8 = exports.GEOSTD8_GENERAL_CI;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/client.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/client.js
new file mode 100644
index 0000000..9c1c07d
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/client.js	
@@ -0,0 +1,38 @@
+// This file was modified by Oracle on September 21, 2021.
+// New capability for multi-factor authentication based on mandatory session
+// trackers, that are signaled with an extra single-byte prefix on new
+// versions of the MySQL server.
+// Modifications copyright (c) 2021, Oracle and/or its affiliates.
+
+'use strict';
+
+// Manually extracted from mysql-5.5.23/include/mysql_com.h
+exports.LONG_PASSWORD = 0x00000001; /* new more secure passwords */
+exports.FOUND_ROWS = 0x00000002; /* found instead of affected rows */
+exports.LONG_FLAG = 0x00000004; /* get all column flags */
+exports.CONNECT_WITH_DB = 0x00000008; /* one can specify db on connect */
+exports.NO_SCHEMA = 0x00000010; /* don't allow database.table.column */
+exports.COMPRESS = 0x00000020; /* can use compression protocol */
+exports.ODBC = 0x00000040; /* odbc client */
+exports.LOCAL_FILES = 0x00000080; /* can use LOAD DATA LOCAL */
+exports.IGNORE_SPACE = 0x00000100; /* ignore spaces before '' */
+exports.PROTOCOL_41 = 0x00000200; /* new 4.1 protocol */
+exports.INTERACTIVE = 0x00000400; /* this is an interactive client */
+exports.SSL = 0x00000800; /* switch to ssl after handshake */
+exports.IGNORE_SIGPIPE = 0x00001000; /* IGNORE sigpipes */
+exports.TRANSACTIONS = 0x00002000; /* client knows about transactions */
+exports.RESERVED = 0x00004000; /* old flag for 4.1 protocol  */
+exports.SECURE_CONNECTION = 0x00008000; /* new 4.1 authentication */
+exports.MULTI_STATEMENTS = 0x00010000; /* enable/disable multi-stmt support */
+exports.MULTI_RESULTS = 0x00020000; /* enable/disable multi-results */
+exports.PS_MULTI_RESULTS = 0x00040000; /* multi-results in ps-protocol */
+exports.PLUGIN_AUTH = 0x00080000; /* client supports plugin authentication */
+exports.CONNECT_ATTRS = 0x00100000; /* permits connection attributes */
+exports.PLUGIN_AUTH_LENENC_CLIENT_DATA = 0x00200000; /* Understands length-encoded integer for auth response data in Protocol::HandshakeResponse41. */
+exports.CAN_HANDLE_EXPIRED_PASSWORDS = 0x00400000; /* Announces support for expired password extension. */
+exports.SESSION_TRACK = 0x00800000; /* Can set SERVER_SESSION_STATE_CHANGED in the Status Flags and send session-state change data after a OK packet. */
+
+exports.SSL_VERIFY_SERVER_CERT = 0x40000000;
+exports.REMEMBER_OPTIONS = 0x80000000;
+
+exports.MULTI_FACTOR_AUTHENTICATION = 0x10000000; /* multi-factor authentication */
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/commands.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/commands.js
new file mode 100644
index 0000000..1e6f827
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/commands.js	
@@ -0,0 +1,36 @@
+'use strict';
+
+module.exports = {
+  SLEEP: 0x00, // deprecated
+  QUIT: 0x01,
+  INIT_DB: 0x02,
+  QUERY: 0x03,
+  FIELD_LIST: 0x04,
+  CREATE_DB: 0x05,
+  DROP_DB: 0x06,
+  REFRESH: 0x07,
+  SHUTDOWN: 0x08,
+  STATISTICS: 0x09,
+  PROCESS_INFO: 0x0a, // deprecated
+  CONNECT: 0x0b, // deprecated
+  PROCESS_KILL: 0x0c,
+  DEBUG: 0x0d,
+  PING: 0x0e,
+  TIME: 0x0f, // deprecated
+  DELAYED_INSERT: 0x10, // deprecated
+  CHANGE_USER: 0x11,
+  BINLOG_DUMP: 0x12,
+  TABLE_DUMP: 0x13,
+  CONNECT_OUT: 0x14,
+  REGISTER_SLAVE: 0x15,
+  STMT_PREPARE: 0x16,
+  STMT_EXECUTE: 0x17,
+  STMT_SEND_LONG_DATA: 0x18,
+  STMT_CLOSE: 0x19,
+  STMT_RESET: 0x1a,
+  SET_OPTION: 0x1b,
+  STMT_FETCH: 0x1c,
+  DAEMON: 0x1d, // deprecated
+  BINLOG_DUMP_GTID: 0x1e,
+  UNKNOWN: 0xff, // bad!
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/cursor.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/cursor.js
new file mode 100644
index 0000000..86157d2
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/cursor.js	
@@ -0,0 +1,8 @@
+'use strict';
+
+module.exports = {
+  NO_CURSOR: 0,
+  READ_ONLY: 1,
+  FOR_UPDATE: 2,
+  SCROLLABLE: 3,
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/encoding_charset.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/encoding_charset.js
new file mode 100644
index 0000000..64045e6
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/encoding_charset.js	
@@ -0,0 +1,50 @@
+'use strict';
+
+// inverse of charset_encodings
+// given encoding, get matching mysql charset number
+
+module.exports = {
+  big5: 1,
+  latin2: 2,
+  dec8: 3,
+  cp850: 4,
+  latin1: 5,
+  hp8: 6,
+  koi8r: 7,
+  swe7: 10,
+  ascii: 11,
+  eucjp: 12,
+  sjis: 13,
+  cp1251: 14,
+  hebrew: 16,
+  tis620: 18,
+  euckr: 19,
+  latin7: 20,
+  koi8u: 22,
+  gb2312: 24,
+  greek: 25,
+  cp1250: 26,
+  gbk: 28,
+  cp1257: 29,
+  latin5: 30,
+  armscii8: 32,
+  cesu8: 33,
+  ucs2: 35,
+  cp866: 36,
+  keybcs2: 37,
+  macintosh: 38,
+  macroman: 39,
+  cp852: 40,
+  utf8: 45,
+  utf8mb4: 45,
+  utf16: 54,
+  utf16le: 56,
+  cp1256: 57,
+  utf32: 60,
+  binary: 63,
+  geostd8: 92,
+  cp932: 95,
+  eucjpms: 97,
+  gb18030: 248,
+  utf8mb3: 192,
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/errors.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/errors.js
new file mode 100644
index 0000000..b1d5927
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/errors.js	
@@ -0,0 +1,3973 @@
+// This file was modified by Oracle on June 1, 2021.
+// An entry was created for a new error reported by the MySQL server due to
+// client inactivity.
+// Modifications copyright (c) 2021, Oracle and/or its affiliates.
+
+'use strict';
+
+// originally copied from https://raw.githubusercontent.com/mysqljs/mysql/7770ee5bb13260c56a160b91fe480d9165dbeeba/lib/protocol/constants/errors.js
+// (c) node-mysql authors
+
+// updated to contain error codes as is contained in MySQL 8.0
+// by adapting node-mysql: /.../generate-error-constants.js
+
+/**
+ * MySQL error constants
+ *
+ * Extracted from version 8.0.33
+ *
+ * !! Generated by generate-error-constants.js, do not modify by hand !!
+ */
+
+exports.EE_CANTCREATEFILE = 1;
+exports.EE_READ = 2;
+exports.EE_WRITE = 3;
+exports.EE_BADCLOSE = 4;
+exports.EE_OUTOFMEMORY = 5;
+exports.EE_DELETE = 6;
+exports.EE_LINK = 7;
+exports.EE_EOFERR = 9;
+exports.EE_CANTLOCK = 10;
+exports.EE_CANTUNLOCK = 11;
+exports.EE_DIR = 12;
+exports.EE_STAT = 13;
+exports.EE_CANT_CHSIZE = 14;
+exports.EE_CANT_OPEN_STREAM = 15;
+exports.EE_GETWD = 16;
+exports.EE_SETWD = 17;
+exports.EE_LINK_WARNING = 18;
+exports.EE_OPEN_WARNING = 19;
+exports.EE_DISK_FULL = 20;
+exports.EE_CANT_MKDIR = 21;
+exports.EE_UNKNOWN_CHARSET = 22;
+exports.EE_OUT_OF_FILERESOURCES = 23;
+exports.EE_CANT_READLINK = 24;
+exports.EE_CANT_SYMLINK = 25;
+exports.EE_REALPATH = 26;
+exports.EE_SYNC = 27;
+exports.EE_UNKNOWN_COLLATION = 28;
+exports.EE_FILENOTFOUND = 29;
+exports.EE_FILE_NOT_CLOSED = 30;
+exports.EE_CHANGE_OWNERSHIP = 31;
+exports.EE_CHANGE_PERMISSIONS = 32;
+exports.EE_CANT_SEEK = 33;
+exports.EE_CAPACITY_EXCEEDED = 34;
+exports.EE_DISK_FULL_WITH_RETRY_MSG = 35;
+exports.EE_FAILED_TO_CREATE_TIMER = 36;
+exports.EE_FAILED_TO_DELETE_TIMER = 37;
+exports.EE_FAILED_TO_CREATE_TIMER_QUEUE = 38;
+exports.EE_FAILED_TO_START_TIMER_NOTIFY_THREAD = 39;
+exports.EE_FAILED_TO_CREATE_TIMER_NOTIFY_THREAD_INTERRUPT_EVENT = 40;
+exports.EE_EXITING_TIMER_NOTIFY_THREAD = 41;
+exports.EE_WIN_LIBRARY_LOAD_FAILED = 42;
+exports.EE_WIN_RUN_TIME_ERROR_CHECK = 43;
+exports.EE_FAILED_TO_DETERMINE_LARGE_PAGE_SIZE = 44;
+exports.EE_FAILED_TO_KILL_ALL_THREADS = 45;
+exports.EE_FAILED_TO_CREATE_IO_COMPLETION_PORT = 46;
+exports.EE_FAILED_TO_OPEN_DEFAULTS_FILE = 47;
+exports.EE_FAILED_TO_HANDLE_DEFAULTS_FILE = 48;
+exports.EE_WRONG_DIRECTIVE_IN_CONFIG_FILE = 49;
+exports.EE_SKIPPING_DIRECTIVE_DUE_TO_MAX_INCLUDE_RECURSION = 50;
+exports.EE_INCORRECT_GRP_DEFINITION_IN_CONFIG_FILE = 51;
+exports.EE_OPTION_WITHOUT_GRP_IN_CONFIG_FILE = 52;
+exports.EE_CONFIG_FILE_PERMISSION_ERROR = 53;
+exports.EE_IGNORE_WORLD_WRITABLE_CONFIG_FILE = 54;
+exports.EE_USING_DISABLED_OPTION = 55;
+exports.EE_USING_DISABLED_SHORT_OPTION = 56;
+exports.EE_USING_PASSWORD_ON_CLI_IS_INSECURE = 57;
+exports.EE_UNKNOWN_SUFFIX_FOR_VARIABLE = 58;
+exports.EE_SSL_ERROR_FROM_FILE = 59;
+exports.EE_SSL_ERROR = 60;
+exports.EE_NET_SEND_ERROR_IN_BOOTSTRAP = 61;
+exports.EE_PACKETS_OUT_OF_ORDER = 62;
+exports.EE_UNKNOWN_PROTOCOL_OPTION = 63;
+exports.EE_FAILED_TO_LOCATE_SERVER_PUBLIC_KEY = 64;
+exports.EE_PUBLIC_KEY_NOT_IN_PEM_FORMAT = 65;
+exports.EE_DEBUG_INFO = 66;
+exports.EE_UNKNOWN_VARIABLE = 67;
+exports.EE_UNKNOWN_OPTION = 68;
+exports.EE_UNKNOWN_SHORT_OPTION = 69;
+exports.EE_OPTION_WITHOUT_ARGUMENT = 70;
+exports.EE_OPTION_REQUIRES_ARGUMENT = 71;
+exports.EE_SHORT_OPTION_REQUIRES_ARGUMENT = 72;
+exports.EE_OPTION_IGNORED_DUE_TO_INVALID_VALUE = 73;
+exports.EE_OPTION_WITH_EMPTY_VALUE = 74;
+exports.EE_FAILED_TO_ASSIGN_MAX_VALUE_TO_OPTION = 75;
+exports.EE_INCORRECT_BOOLEAN_VALUE_FOR_OPTION = 76;
+exports.EE_FAILED_TO_SET_OPTION_VALUE = 77;
+exports.EE_INCORRECT_INT_VALUE_FOR_OPTION = 78;
+exports.EE_INCORRECT_UINT_VALUE_FOR_OPTION = 79;
+exports.EE_ADJUSTED_SIGNED_VALUE_FOR_OPTION = 80;
+exports.EE_ADJUSTED_UNSIGNED_VALUE_FOR_OPTION = 81;
+exports.EE_ADJUSTED_ULONGLONG_VALUE_FOR_OPTION = 82;
+exports.EE_ADJUSTED_DOUBLE_VALUE_FOR_OPTION = 83;
+exports.EE_INVALID_DECIMAL_VALUE_FOR_OPTION = 84;
+exports.EE_COLLATION_PARSER_ERROR = 85;
+exports.EE_FAILED_TO_RESET_BEFORE_PRIMARY_IGNORABLE_CHAR = 86;
+exports.EE_FAILED_TO_RESET_BEFORE_TERTIARY_IGNORABLE_CHAR = 87;
+exports.EE_SHIFT_CHAR_OUT_OF_RANGE = 88;
+exports.EE_RESET_CHAR_OUT_OF_RANGE = 89;
+exports.EE_UNKNOWN_LDML_TAG = 90;
+exports.EE_FAILED_TO_RESET_BEFORE_SECONDARY_IGNORABLE_CHAR = 91;
+exports.EE_FAILED_PROCESSING_DIRECTIVE = 92;
+exports.EE_PTHREAD_KILL_FAILED = 93;
+exports.HA_ERR_KEY_NOT_FOUND = 120;
+exports.HA_ERR_FOUND_DUPP_KEY = 121;
+exports.HA_ERR_INTERNAL_ERROR = 122;
+exports.HA_ERR_RECORD_CHANGED = 123;
+exports.HA_ERR_WRONG_INDEX = 124;
+exports.HA_ERR_ROLLED_BACK = 125;
+exports.HA_ERR_CRASHED = 126;
+exports.HA_ERR_WRONG_IN_RECORD = 127;
+exports.HA_ERR_OUT_OF_MEM = 128;
+exports.HA_ERR_NOT_A_TABLE = 130;
+exports.HA_ERR_WRONG_COMMAND = 131;
+exports.HA_ERR_OLD_FILE = 132;
+exports.HA_ERR_NO_ACTIVE_RECORD = 133;
+exports.HA_ERR_RECORD_DELETED = 134;
+exports.HA_ERR_RECORD_FILE_FULL = 135;
+exports.HA_ERR_INDEX_FILE_FULL = 136;
+exports.HA_ERR_END_OF_FILE = 137;
+exports.HA_ERR_UNSUPPORTED = 138;
+exports.HA_ERR_TOO_BIG_ROW = 139;
+exports.HA_WRONG_CREATE_OPTION = 140;
+exports.HA_ERR_FOUND_DUPP_UNIQUE = 141;
+exports.HA_ERR_UNKNOWN_CHARSET = 142;
+exports.HA_ERR_WRONG_MRG_TABLE_DEF = 143;
+exports.HA_ERR_CRASHED_ON_REPAIR = 144;
+exports.HA_ERR_CRASHED_ON_USAGE = 145;
+exports.HA_ERR_LOCK_WAIT_TIMEOUT = 146;
+exports.HA_ERR_LOCK_TABLE_FULL = 147;
+exports.HA_ERR_READ_ONLY_TRANSACTION = 148;
+exports.HA_ERR_LOCK_DEADLOCK = 149;
+exports.HA_ERR_CANNOT_ADD_FOREIGN = 150;
+exports.HA_ERR_NO_REFERENCED_ROW = 151;
+exports.HA_ERR_ROW_IS_REFERENCED = 152;
+exports.HA_ERR_NO_SAVEPOINT = 153;
+exports.HA_ERR_NON_UNIQUE_BLOCK_SIZE = 154;
+exports.HA_ERR_NO_SUCH_TABLE = 155;
+exports.HA_ERR_TABLE_EXIST = 156;
+exports.HA_ERR_NO_CONNECTION = 157;
+exports.HA_ERR_NULL_IN_SPATIAL = 158;
+exports.HA_ERR_TABLE_DEF_CHANGED = 159;
+exports.HA_ERR_NO_PARTITION_FOUND = 160;
+exports.HA_ERR_RBR_LOGGING_FAILED = 161;
+exports.HA_ERR_DROP_INDEX_FK = 162;
+exports.HA_ERR_FOREIGN_DUPLICATE_KEY = 163;
+exports.HA_ERR_TABLE_NEEDS_UPGRADE = 164;
+exports.HA_ERR_TABLE_READONLY = 165;
+exports.HA_ERR_AUTOINC_READ_FAILED = 166;
+exports.HA_ERR_AUTOINC_ERANGE = 167;
+exports.HA_ERR_GENERIC = 168;
+exports.HA_ERR_RECORD_IS_THE_SAME = 169;
+exports.HA_ERR_LOGGING_IMPOSSIBLE = 170;
+exports.HA_ERR_CORRUPT_EVENT = 171;
+exports.HA_ERR_NEW_FILE = 172;
+exports.HA_ERR_ROWS_EVENT_APPLY = 173;
+exports.HA_ERR_INITIALIZATION = 174;
+exports.HA_ERR_FILE_TOO_SHORT = 175;
+exports.HA_ERR_WRONG_CRC = 176;
+exports.HA_ERR_TOO_MANY_CONCURRENT_TRXS = 177;
+exports.HA_ERR_NOT_IN_LOCK_PARTITIONS = 178;
+exports.HA_ERR_INDEX_COL_TOO_LONG = 179;
+exports.HA_ERR_INDEX_CORRUPT = 180;
+exports.HA_ERR_UNDO_REC_TOO_BIG = 181;
+exports.HA_FTS_INVALID_DOCID = 182;
+exports.HA_ERR_TABLE_IN_FK_CHECK = 183;
+exports.HA_ERR_TABLESPACE_EXISTS = 184;
+exports.HA_ERR_TOO_MANY_FIELDS = 185;
+exports.HA_ERR_ROW_IN_WRONG_PARTITION = 186;
+exports.HA_ERR_INNODB_READ_ONLY = 187;
+exports.HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT = 188;
+exports.HA_ERR_TEMP_FILE_WRITE_FAILURE = 189;
+exports.HA_ERR_INNODB_FORCED_RECOVERY = 190;
+exports.HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE = 191;
+exports.HA_ERR_FK_DEPTH_EXCEEDED = 192;
+exports.HA_MISSING_CREATE_OPTION = 193;
+exports.HA_ERR_SE_OUT_OF_MEMORY = 194;
+exports.HA_ERR_TABLE_CORRUPT = 195;
+exports.HA_ERR_QUERY_INTERRUPTED = 196;
+exports.HA_ERR_TABLESPACE_MISSING = 197;
+exports.HA_ERR_TABLESPACE_IS_NOT_EMPTY = 198;
+exports.HA_ERR_WRONG_FILE_NAME = 199;
+exports.HA_ERR_NOT_ALLOWED_COMMAND = 200;
+exports.HA_ERR_COMPUTE_FAILED = 201;
+exports.HA_ERR_ROW_FORMAT_CHANGED = 202;
+exports.HA_ERR_NO_WAIT_LOCK = 203;
+exports.HA_ERR_DISK_FULL_NOWAIT = 204;
+exports.HA_ERR_NO_SESSION_TEMP = 205;
+exports.HA_ERR_WRONG_TABLE_NAME = 206;
+exports.HA_ERR_TOO_LONG_PATH = 207;
+exports.HA_ERR_SAMPLING_INIT_FAILED = 208;
+exports.HA_ERR_FTS_TOO_MANY_NESTED_EXP = 209;
+exports.ER_HASHCHK = 1000;
+exports.ER_NISAMCHK = 1001;
+exports.ER_NO = 1002;
+exports.ER_YES = 1003;
+exports.ER_CANT_CREATE_FILE = 1004;
+exports.ER_CANT_CREATE_TABLE = 1005;
+exports.ER_CANT_CREATE_DB = 1006;
+exports.ER_DB_CREATE_EXISTS = 1007;
+exports.ER_DB_DROP_EXISTS = 1008;
+exports.ER_DB_DROP_DELETE = 1009;
+exports.ER_DB_DROP_RMDIR = 1010;
+exports.ER_CANT_DELETE_FILE = 1011;
+exports.ER_CANT_FIND_SYSTEM_REC = 1012;
+exports.ER_CANT_GET_STAT = 1013;
+exports.ER_CANT_GET_WD = 1014;
+exports.ER_CANT_LOCK = 1015;
+exports.ER_CANT_OPEN_FILE = 1016;
+exports.ER_FILE_NOT_FOUND = 1017;
+exports.ER_CANT_READ_DIR = 1018;
+exports.ER_CANT_SET_WD = 1019;
+exports.ER_CHECKREAD = 1020;
+exports.ER_DISK_FULL = 1021;
+exports.ER_DUP_KEY = 1022;
+exports.ER_ERROR_ON_CLOSE = 1023;
+exports.ER_ERROR_ON_READ = 1024;
+exports.ER_ERROR_ON_RENAME = 1025;
+exports.ER_ERROR_ON_WRITE = 1026;
+exports.ER_FILE_USED = 1027;
+exports.ER_FILSORT_ABORT = 1028;
+exports.ER_FORM_NOT_FOUND = 1029;
+exports.ER_GET_ERRNO = 1030;
+exports.ER_ILLEGAL_HA = 1031;
+exports.ER_KEY_NOT_FOUND = 1032;
+exports.ER_NOT_FORM_FILE = 1033;
+exports.ER_NOT_KEYFILE = 1034;
+exports.ER_OLD_KEYFILE = 1035;
+exports.ER_OPEN_AS_READONLY = 1036;
+exports.ER_OUTOFMEMORY = 1037;
+exports.ER_OUT_OF_SORTMEMORY = 1038;
+exports.ER_UNEXPECTED_EOF = 1039;
+exports.ER_CON_COUNT_ERROR = 1040;
+exports.ER_OUT_OF_RESOURCES = 1041;
+exports.ER_BAD_HOST_ERROR = 1042;
+exports.ER_HANDSHAKE_ERROR = 1043;
+exports.ER_DBACCESS_DENIED_ERROR = 1044;
+exports.ER_ACCESS_DENIED_ERROR = 1045;
+exports.ER_NO_DB_ERROR = 1046;
+exports.ER_UNKNOWN_COM_ERROR = 1047;
+exports.ER_BAD_NULL_ERROR = 1048;
+exports.ER_BAD_DB_ERROR = 1049;
+exports.ER_TABLE_EXISTS_ERROR = 1050;
+exports.ER_BAD_TABLE_ERROR = 1051;
+exports.ER_NON_UNIQ_ERROR = 1052;
+exports.ER_SERVER_SHUTDOWN = 1053;
+exports.ER_BAD_FIELD_ERROR = 1054;
+exports.ER_WRONG_FIELD_WITH_GROUP = 1055;
+exports.ER_WRONG_GROUP_FIELD = 1056;
+exports.ER_WRONG_SUM_SELECT = 1057;
+exports.ER_WRONG_VALUE_COUNT = 1058;
+exports.ER_TOO_LONG_IDENT = 1059;
+exports.ER_DUP_FIELDNAME = 1060;
+exports.ER_DUP_KEYNAME = 1061;
+exports.ER_DUP_ENTRY = 1062;
+exports.ER_WRONG_FIELD_SPEC = 1063;
+exports.ER_PARSE_ERROR = 1064;
+exports.ER_EMPTY_QUERY = 1065;
+exports.ER_NONUNIQ_TABLE = 1066;
+exports.ER_INVALID_DEFAULT = 1067;
+exports.ER_MULTIPLE_PRI_KEY = 1068;
+exports.ER_TOO_MANY_KEYS = 1069;
+exports.ER_TOO_MANY_KEY_PARTS = 1070;
+exports.ER_TOO_LONG_KEY = 1071;
+exports.ER_KEY_COLUMN_DOES_NOT_EXITS = 1072;
+exports.ER_BLOB_USED_AS_KEY = 1073;
+exports.ER_TOO_BIG_FIELDLENGTH = 1074;
+exports.ER_WRONG_AUTO_KEY = 1075;
+exports.ER_READY = 1076;
+exports.ER_NORMAL_SHUTDOWN = 1077;
+exports.ER_GOT_SIGNAL = 1078;
+exports.ER_SHUTDOWN_COMPLETE = 1079;
+exports.ER_FORCING_CLOSE = 1080;
+exports.ER_IPSOCK_ERROR = 1081;
+exports.ER_NO_SUCH_INDEX = 1082;
+exports.ER_WRONG_FIELD_TERMINATORS = 1083;
+exports.ER_BLOBS_AND_NO_TERMINATED = 1084;
+exports.ER_TEXTFILE_NOT_READABLE = 1085;
+exports.ER_FILE_EXISTS_ERROR = 1086;
+exports.ER_LOAD_INFO = 1087;
+exports.ER_ALTER_INFO = 1088;
+exports.ER_WRONG_SUB_KEY = 1089;
+exports.ER_CANT_REMOVE_ALL_FIELDS = 1090;
+exports.ER_CANT_DROP_FIELD_OR_KEY = 1091;
+exports.ER_INSERT_INFO = 1092;
+exports.ER_UPDATE_TABLE_USED = 1093;
+exports.ER_NO_SUCH_THREAD = 1094;
+exports.ER_KILL_DENIED_ERROR = 1095;
+exports.ER_NO_TABLES_USED = 1096;
+exports.ER_TOO_BIG_SET = 1097;
+exports.ER_NO_UNIQUE_LOGFILE = 1098;
+exports.ER_TABLE_NOT_LOCKED_FOR_WRITE = 1099;
+exports.ER_TABLE_NOT_LOCKED = 1100;
+exports.ER_BLOB_CANT_HAVE_DEFAULT = 1101;
+exports.ER_WRONG_DB_NAME = 1102;
+exports.ER_WRONG_TABLE_NAME = 1103;
+exports.ER_TOO_BIG_SELECT = 1104;
+exports.ER_UNKNOWN_ERROR = 1105;
+exports.ER_UNKNOWN_PROCEDURE = 1106;
+exports.ER_WRONG_PARAMCOUNT_TO_PROCEDURE = 1107;
+exports.ER_WRONG_PARAMETERS_TO_PROCEDURE = 1108;
+exports.ER_UNKNOWN_TABLE = 1109;
+exports.ER_FIELD_SPECIFIED_TWICE = 1110;
+exports.ER_INVALID_GROUP_FUNC_USE = 1111;
+exports.ER_UNSUPPORTED_EXTENSION = 1112;
+exports.ER_TABLE_MUST_HAVE_COLUMNS = 1113;
+exports.ER_RECORD_FILE_FULL = 1114;
+exports.ER_UNKNOWN_CHARACTER_SET = 1115;
+exports.ER_TOO_MANY_TABLES = 1116;
+exports.ER_TOO_MANY_FIELDS = 1117;
+exports.ER_TOO_BIG_ROWSIZE = 1118;
+exports.ER_STACK_OVERRUN = 1119;
+exports.ER_WRONG_OUTER_JOIN = 1120;
+exports.ER_NULL_COLUMN_IN_INDEX = 1121;
+exports.ER_CANT_FIND_UDF = 1122;
+exports.ER_CANT_INITIALIZE_UDF = 1123;
+exports.ER_UDF_NO_PATHS = 1124;
+exports.ER_UDF_EXISTS = 1125;
+exports.ER_CANT_OPEN_LIBRARY = 1126;
+exports.ER_CANT_FIND_DL_ENTRY = 1127;
+exports.ER_FUNCTION_NOT_DEFINED = 1128;
+exports.ER_HOST_IS_BLOCKED = 1129;
+exports.ER_HOST_NOT_PRIVILEGED = 1130;
+exports.ER_PASSWORD_ANONYMOUS_USER = 1131;
+exports.ER_PASSWORD_NOT_ALLOWED = 1132;
+exports.ER_PASSWORD_NO_MATCH = 1133;
+exports.ER_UPDATE_INFO = 1134;
+exports.ER_CANT_CREATE_THREAD = 1135;
+exports.ER_WRONG_VALUE_COUNT_ON_ROW = 1136;
+exports.ER_CANT_REOPEN_TABLE = 1137;
+exports.ER_INVALID_USE_OF_NULL = 1138;
+exports.ER_REGEXP_ERROR = 1139;
+exports.ER_MIX_OF_GROUP_FUNC_AND_FIELDS = 1140;
+exports.ER_NONEXISTING_GRANT = 1141;
+exports.ER_TABLEACCESS_DENIED_ERROR = 1142;
+exports.ER_COLUMNACCESS_DENIED_ERROR = 1143;
+exports.ER_ILLEGAL_GRANT_FOR_TABLE = 1144;
+exports.ER_GRANT_WRONG_HOST_OR_USER = 1145;
+exports.ER_NO_SUCH_TABLE = 1146;
+exports.ER_NONEXISTING_TABLE_GRANT = 1147;
+exports.ER_NOT_ALLOWED_COMMAND = 1148;
+exports.ER_SYNTAX_ERROR = 1149;
+exports.ER_UNUSED1 = 1150;
+exports.ER_UNUSED2 = 1151;
+exports.ER_ABORTING_CONNECTION = 1152;
+exports.ER_NET_PACKET_TOO_LARGE = 1153;
+exports.ER_NET_READ_ERROR_FROM_PIPE = 1154;
+exports.ER_NET_FCNTL_ERROR = 1155;
+exports.ER_NET_PACKETS_OUT_OF_ORDER = 1156;
+exports.ER_NET_UNCOMPRESS_ERROR = 1157;
+exports.ER_NET_READ_ERROR = 1158;
+exports.ER_NET_READ_INTERRUPTED = 1159;
+exports.ER_NET_ERROR_ON_WRITE = 1160;
+exports.ER_NET_WRITE_INTERRUPTED = 1161;
+exports.ER_TOO_LONG_STRING = 1162;
+exports.ER_TABLE_CANT_HANDLE_BLOB = 1163;
+exports.ER_TABLE_CANT_HANDLE_AUTO_INCREMENT = 1164;
+exports.ER_UNUSED3 = 1165;
+exports.ER_WRONG_COLUMN_NAME = 1166;
+exports.ER_WRONG_KEY_COLUMN = 1167;
+exports.ER_WRONG_MRG_TABLE = 1168;
+exports.ER_DUP_UNIQUE = 1169;
+exports.ER_BLOB_KEY_WITHOUT_LENGTH = 1170;
+exports.ER_PRIMARY_CANT_HAVE_NULL = 1171;
+exports.ER_TOO_MANY_ROWS = 1172;
+exports.ER_REQUIRES_PRIMARY_KEY = 1173;
+exports.ER_NO_RAID_COMPILED = 1174;
+exports.ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE = 1175;
+exports.ER_KEY_DOES_NOT_EXITS = 1176;
+exports.ER_CHECK_NO_SUCH_TABLE = 1177;
+exports.ER_CHECK_NOT_IMPLEMENTED = 1178;
+exports.ER_CANT_DO_THIS_DURING_AN_TRANSACTION = 1179;
+exports.ER_ERROR_DURING_COMMIT = 1180;
+exports.ER_ERROR_DURING_ROLLBACK = 1181;
+exports.ER_ERROR_DURING_FLUSH_LOGS = 1182;
+exports.ER_ERROR_DURING_CHECKPOINT = 1183;
+exports.ER_NEW_ABORTING_CONNECTION = 1184;
+exports.ER_DUMP_NOT_IMPLEMENTED = 1185;
+exports.ER_FLUSH_MASTER_BINLOG_CLOSED = 1186;
+exports.ER_INDEX_REBUILD = 1187;
+exports.ER_SOURCE = 1188;
+exports.ER_SOURCE_NET_READ = 1189;
+exports.ER_SOURCE_NET_WRITE = 1190;
+exports.ER_FT_MATCHING_KEY_NOT_FOUND = 1191;
+exports.ER_LOCK_OR_ACTIVE_TRANSACTION = 1192;
+exports.ER_UNKNOWN_SYSTEM_VARIABLE = 1193;
+exports.ER_CRASHED_ON_USAGE = 1194;
+exports.ER_CRASHED_ON_REPAIR = 1195;
+exports.ER_WARNING_NOT_COMPLETE_ROLLBACK = 1196;
+exports.ER_TRANS_CACHE_FULL = 1197;
+exports.ER_SLAVE_MUST_STOP = 1198;
+exports.ER_REPLICA_NOT_RUNNING = 1199;
+exports.ER_BAD_REPLICA = 1200;
+exports.ER_CONNECTION_METADATA = 1201;
+exports.ER_REPLICA_THREAD = 1202;
+exports.ER_TOO_MANY_USER_CONNECTIONS = 1203;
+exports.ER_SET_CONSTANTS_ONLY = 1204;
+exports.ER_LOCK_WAIT_TIMEOUT = 1205;
+exports.ER_LOCK_TABLE_FULL = 1206;
+exports.ER_READ_ONLY_TRANSACTION = 1207;
+exports.ER_DROP_DB_WITH_READ_LOCK = 1208;
+exports.ER_CREATE_DB_WITH_READ_LOCK = 1209;
+exports.ER_WRONG_ARGUMENTS = 1210;
+exports.ER_NO_PERMISSION_TO_CREATE_USER = 1211;
+exports.ER_UNION_TABLES_IN_DIFFERENT_DIR = 1212;
+exports.ER_LOCK_DEADLOCK = 1213;
+exports.ER_TABLE_CANT_HANDLE_FT = 1214;
+exports.ER_CANNOT_ADD_FOREIGN = 1215;
+exports.ER_NO_REFERENCED_ROW = 1216;
+exports.ER_ROW_IS_REFERENCED = 1217;
+exports.ER_CONNECT_TO_SOURCE = 1218;
+exports.ER_QUERY_ON_MASTER = 1219;
+exports.ER_ERROR_WHEN_EXECUTING_COMMAND = 1220;
+exports.ER_WRONG_USAGE = 1221;
+exports.ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT = 1222;
+exports.ER_CANT_UPDATE_WITH_READLOCK = 1223;
+exports.ER_MIXING_NOT_ALLOWED = 1224;
+exports.ER_DUP_ARGUMENT = 1225;
+exports.ER_USER_LIMIT_REACHED = 1226;
+exports.ER_SPECIFIC_ACCESS_DENIED_ERROR = 1227;
+exports.ER_LOCAL_VARIABLE = 1228;
+exports.ER_GLOBAL_VARIABLE = 1229;
+exports.ER_NO_DEFAULT = 1230;
+exports.ER_WRONG_VALUE_FOR_VAR = 1231;
+exports.ER_WRONG_TYPE_FOR_VAR = 1232;
+exports.ER_VAR_CANT_BE_READ = 1233;
+exports.ER_CANT_USE_OPTION_HERE = 1234;
+exports.ER_NOT_SUPPORTED_YET = 1235;
+exports.ER_SOURCE_FATAL_ERROR_READING_BINLOG = 1236;
+exports.ER_REPLICA_IGNORED_TABLE = 1237;
+exports.ER_INCORRECT_GLOBAL_LOCAL_VAR = 1238;
+exports.ER_WRONG_FK_DEF = 1239;
+exports.ER_KEY_REF_DO_NOT_MATCH_TABLE_REF = 1240;
+exports.ER_OPERAND_COLUMNS = 1241;
+exports.ER_SUBQUERY_NO_1_ROW = 1242;
+exports.ER_UNKNOWN_STMT_HANDLER = 1243;
+exports.ER_CORRUPT_HELP_DB = 1244;
+exports.ER_CYCLIC_REFERENCE = 1245;
+exports.ER_AUTO_CONVERT = 1246;
+exports.ER_ILLEGAL_REFERENCE = 1247;
+exports.ER_DERIVED_MUST_HAVE_ALIAS = 1248;
+exports.ER_SELECT_REDUCED = 1249;
+exports.ER_TABLENAME_NOT_ALLOWED_HERE = 1250;
+exports.ER_NOT_SUPPORTED_AUTH_MODE = 1251;
+exports.ER_SPATIAL_CANT_HAVE_NULL = 1252;
+exports.ER_COLLATION_CHARSET_MISMATCH = 1253;
+exports.ER_SLAVE_WAS_RUNNING = 1254;
+exports.ER_SLAVE_WAS_NOT_RUNNING = 1255;
+exports.ER_TOO_BIG_FOR_UNCOMPRESS = 1256;
+exports.ER_ZLIB_Z_MEM_ERROR = 1257;
+exports.ER_ZLIB_Z_BUF_ERROR = 1258;
+exports.ER_ZLIB_Z_DATA_ERROR = 1259;
+exports.ER_CUT_VALUE_GROUP_CONCAT = 1260;
+exports.ER_WARN_TOO_FEW_RECORDS = 1261;
+exports.ER_WARN_TOO_MANY_RECORDS = 1262;
+exports.ER_WARN_NULL_TO_NOTNULL = 1263;
+exports.ER_WARN_DATA_OUT_OF_RANGE = 1264;
+exports.WARN_DATA_TRUNCATED = 1265;
+exports.ER_WARN_USING_OTHER_HANDLER = 1266;
+exports.ER_CANT_AGGREGATE_2COLLATIONS = 1267;
+exports.ER_DROP_USER = 1268;
+exports.ER_REVOKE_GRANTS = 1269;
+exports.ER_CANT_AGGREGATE_3COLLATIONS = 1270;
+exports.ER_CANT_AGGREGATE_NCOLLATIONS = 1271;
+exports.ER_VARIABLE_IS_NOT_STRUCT = 1272;
+exports.ER_UNKNOWN_COLLATION = 1273;
+exports.ER_REPLICA_IGNORED_SSL_PARAMS = 1274;
+exports.ER_SERVER_IS_IN_SECURE_AUTH_MODE = 1275;
+exports.ER_WARN_FIELD_RESOLVED = 1276;
+exports.ER_BAD_REPLICA_UNTIL_COND = 1277;
+exports.ER_MISSING_SKIP_REPLICA = 1278;
+exports.ER_UNTIL_COND_IGNORED = 1279;
+exports.ER_WRONG_NAME_FOR_INDEX = 1280;
+exports.ER_WRONG_NAME_FOR_CATALOG = 1281;
+exports.ER_WARN_QC_RESIZE = 1282;
+exports.ER_BAD_FT_COLUMN = 1283;
+exports.ER_UNKNOWN_KEY_CACHE = 1284;
+exports.ER_WARN_HOSTNAME_WONT_WORK = 1285;
+exports.ER_UNKNOWN_STORAGE_ENGINE = 1286;
+exports.ER_WARN_DEPRECATED_SYNTAX = 1287;
+exports.ER_NON_UPDATABLE_TABLE = 1288;
+exports.ER_FEATURE_DISABLED = 1289;
+exports.ER_OPTION_PREVENTS_STATEMENT = 1290;
+exports.ER_DUPLICATED_VALUE_IN_TYPE = 1291;
+exports.ER_TRUNCATED_WRONG_VALUE = 1292;
+exports.ER_TOO_MUCH_AUTO_TIMESTAMP_COLS = 1293;
+exports.ER_INVALID_ON_UPDATE = 1294;
+exports.ER_UNSUPPORTED_PS = 1295;
+exports.ER_GET_ERRMSG = 1296;
+exports.ER_GET_TEMPORARY_ERRMSG = 1297;
+exports.ER_UNKNOWN_TIME_ZONE = 1298;
+exports.ER_WARN_INVALID_TIMESTAMP = 1299;
+exports.ER_INVALID_CHARACTER_STRING = 1300;
+exports.ER_WARN_ALLOWED_PACKET_OVERFLOWED = 1301;
+exports.ER_CONFLICTING_DECLARATIONS = 1302;
+exports.ER_SP_NO_RECURSIVE_CREATE = 1303;
+exports.ER_SP_ALREADY_EXISTS = 1304;
+exports.ER_SP_DOES_NOT_EXIST = 1305;
+exports.ER_SP_DROP_FAILED = 1306;
+exports.ER_SP_STORE_FAILED = 1307;
+exports.ER_SP_LILABEL_MISMATCH = 1308;
+exports.ER_SP_LABEL_REDEFINE = 1309;
+exports.ER_SP_LABEL_MISMATCH = 1310;
+exports.ER_SP_UNINIT_VAR = 1311;
+exports.ER_SP_BADSELECT = 1312;
+exports.ER_SP_BADRETURN = 1313;
+exports.ER_SP_BADSTATEMENT = 1314;
+exports.ER_UPDATE_LOG_DEPRECATED_IGNORED = 1315;
+exports.ER_UPDATE_LOG_DEPRECATED_TRANSLATED = 1316;
+exports.ER_QUERY_INTERRUPTED = 1317;
+exports.ER_SP_WRONG_NO_OF_ARGS = 1318;
+exports.ER_SP_COND_MISMATCH = 1319;
+exports.ER_SP_NORETURN = 1320;
+exports.ER_SP_NORETURNEND = 1321;
+exports.ER_SP_BAD_CURSOR_QUERY = 1322;
+exports.ER_SP_BAD_CURSOR_SELECT = 1323;
+exports.ER_SP_CURSOR_MISMATCH = 1324;
+exports.ER_SP_CURSOR_ALREADY_OPEN = 1325;
+exports.ER_SP_CURSOR_NOT_OPEN = 1326;
+exports.ER_SP_UNDECLARED_VAR = 1327;
+exports.ER_SP_WRONG_NO_OF_FETCH_ARGS = 1328;
+exports.ER_SP_FETCH_NO_DATA = 1329;
+exports.ER_SP_DUP_PARAM = 1330;
+exports.ER_SP_DUP_VAR = 1331;
+exports.ER_SP_DUP_COND = 1332;
+exports.ER_SP_DUP_CURS = 1333;
+exports.ER_SP_CANT_ALTER = 1334;
+exports.ER_SP_SUBSELECT_NYI = 1335;
+exports.ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG = 1336;
+exports.ER_SP_VARCOND_AFTER_CURSHNDLR = 1337;
+exports.ER_SP_CURSOR_AFTER_HANDLER = 1338;
+exports.ER_SP_CASE_NOT_FOUND = 1339;
+exports.ER_FPARSER_TOO_BIG_FILE = 1340;
+exports.ER_FPARSER_BAD_HEADER = 1341;
+exports.ER_FPARSER_EOF_IN_COMMENT = 1342;
+exports.ER_FPARSER_ERROR_IN_PARAMETER = 1343;
+exports.ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER = 1344;
+exports.ER_VIEW_NO_EXPLAIN = 1345;
+exports.ER_FRM_UNKNOWN_TYPE = 1346;
+exports.ER_WRONG_OBJECT = 1347;
+exports.ER_NONUPDATEABLE_COLUMN = 1348;
+exports.ER_VIEW_SELECT_DERIVED = 1349;
+exports.ER_VIEW_SELECT_CLAUSE = 1350;
+exports.ER_VIEW_SELECT_VARIABLE = 1351;
+exports.ER_VIEW_SELECT_TMPTABLE = 1352;
+exports.ER_VIEW_WRONG_LIST = 1353;
+exports.ER_WARN_VIEW_MERGE = 1354;
+exports.ER_WARN_VIEW_WITHOUT_KEY = 1355;
+exports.ER_VIEW_INVALID = 1356;
+exports.ER_SP_NO_DROP_SP = 1357;
+exports.ER_SP_GOTO_IN_HNDLR = 1358;
+exports.ER_TRG_ALREADY_EXISTS = 1359;
+exports.ER_TRG_DOES_NOT_EXIST = 1360;
+exports.ER_TRG_ON_VIEW_OR_TEMP_TABLE = 1361;
+exports.ER_TRG_CANT_CHANGE_ROW = 1362;
+exports.ER_TRG_NO_SUCH_ROW_IN_TRG = 1363;
+exports.ER_NO_DEFAULT_FOR_FIELD = 1364;
+exports.ER_DIVISION_BY_ZERO = 1365;
+exports.ER_TRUNCATED_WRONG_VALUE_FOR_FIELD = 1366;
+exports.ER_ILLEGAL_VALUE_FOR_TYPE = 1367;
+exports.ER_VIEW_NONUPD_CHECK = 1368;
+exports.ER_VIEW_CHECK_FAILED = 1369;
+exports.ER_PROCACCESS_DENIED_ERROR = 1370;
+exports.ER_RELAY_LOG_FAIL = 1371;
+exports.ER_PASSWD_LENGTH = 1372;
+exports.ER_UNKNOWN_TARGET_BINLOG = 1373;
+exports.ER_IO_ERR_LOG_INDEX_READ = 1374;
+exports.ER_BINLOG_PURGE_PROHIBITED = 1375;
+exports.ER_FSEEK_FAIL = 1376;
+exports.ER_BINLOG_PURGE_FATAL_ERR = 1377;
+exports.ER_LOG_IN_USE = 1378;
+exports.ER_LOG_PURGE_UNKNOWN_ERR = 1379;
+exports.ER_RELAY_LOG_INIT = 1380;
+exports.ER_NO_BINARY_LOGGING = 1381;
+exports.ER_RESERVED_SYNTAX = 1382;
+exports.ER_WSAS_FAILED = 1383;
+exports.ER_DIFF_GROUPS_PROC = 1384;
+exports.ER_NO_GROUP_FOR_PROC = 1385;
+exports.ER_ORDER_WITH_PROC = 1386;
+exports.ER_LOGGING_PROHIBIT_CHANGING_OF = 1387;
+exports.ER_NO_FILE_MAPPING = 1388;
+exports.ER_WRONG_MAGIC = 1389;
+exports.ER_PS_MANY_PARAM = 1390;
+exports.ER_KEY_PART_0 = 1391;
+exports.ER_VIEW_CHECKSUM = 1392;
+exports.ER_VIEW_MULTIUPDATE = 1393;
+exports.ER_VIEW_NO_INSERT_FIELD_LIST = 1394;
+exports.ER_VIEW_DELETE_MERGE_VIEW = 1395;
+exports.ER_CANNOT_USER = 1396;
+exports.ER_XAER_NOTA = 1397;
+exports.ER_XAER_INVAL = 1398;
+exports.ER_XAER_RMFAIL = 1399;
+exports.ER_XAER_OUTSIDE = 1400;
+exports.ER_XAER_RMERR = 1401;
+exports.ER_XA_RBROLLBACK = 1402;
+exports.ER_NONEXISTING_PROC_GRANT = 1403;
+exports.ER_PROC_AUTO_GRANT_FAIL = 1404;
+exports.ER_PROC_AUTO_REVOKE_FAIL = 1405;
+exports.ER_DATA_TOO_LONG = 1406;
+exports.ER_SP_BAD_SQLSTATE = 1407;
+exports.ER_STARTUP = 1408;
+exports.ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR = 1409;
+exports.ER_CANT_CREATE_USER_WITH_GRANT = 1410;
+exports.ER_WRONG_VALUE_FOR_TYPE = 1411;
+exports.ER_TABLE_DEF_CHANGED = 1412;
+exports.ER_SP_DUP_HANDLER = 1413;
+exports.ER_SP_NOT_VAR_ARG = 1414;
+exports.ER_SP_NO_RETSET = 1415;
+exports.ER_CANT_CREATE_GEOMETRY_OBJECT = 1416;
+exports.ER_FAILED_ROUTINE_BREAK_BINLOG = 1417;
+exports.ER_BINLOG_UNSAFE_ROUTINE = 1418;
+exports.ER_BINLOG_CREATE_ROUTINE_NEED_SUPER = 1419;
+exports.ER_EXEC_STMT_WITH_OPEN_CURSOR = 1420;
+exports.ER_STMT_HAS_NO_OPEN_CURSOR = 1421;
+exports.ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG = 1422;
+exports.ER_NO_DEFAULT_FOR_VIEW_FIELD = 1423;
+exports.ER_SP_NO_RECURSION = 1424;
+exports.ER_TOO_BIG_SCALE = 1425;
+exports.ER_TOO_BIG_PRECISION = 1426;
+exports.ER_M_BIGGER_THAN_D = 1427;
+exports.ER_WRONG_LOCK_OF_SYSTEM_TABLE = 1428;
+exports.ER_CONNECT_TO_FOREIGN_DATA_SOURCE = 1429;
+exports.ER_QUERY_ON_FOREIGN_DATA_SOURCE = 1430;
+exports.ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST = 1431;
+exports.ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE = 1432;
+exports.ER_FOREIGN_DATA_STRING_INVALID = 1433;
+exports.ER_CANT_CREATE_FEDERATED_TABLE = 1434;
+exports.ER_TRG_IN_WRONG_SCHEMA = 1435;
+exports.ER_STACK_OVERRUN_NEED_MORE = 1436;
+exports.ER_TOO_LONG_BODY = 1437;
+exports.ER_WARN_CANT_DROP_DEFAULT_KEYCACHE = 1438;
+exports.ER_TOO_BIG_DISPLAYWIDTH = 1439;
+exports.ER_XAER_DUPID = 1440;
+exports.ER_DATETIME_FUNCTION_OVERFLOW = 1441;
+exports.ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG = 1442;
+exports.ER_VIEW_PREVENT_UPDATE = 1443;
+exports.ER_PS_NO_RECURSION = 1444;
+exports.ER_SP_CANT_SET_AUTOCOMMIT = 1445;
+exports.ER_MALFORMED_DEFINER = 1446;
+exports.ER_VIEW_FRM_NO_USER = 1447;
+exports.ER_VIEW_OTHER_USER = 1448;
+exports.ER_NO_SUCH_USER = 1449;
+exports.ER_FORBID_SCHEMA_CHANGE = 1450;
+exports.ER_ROW_IS_REFERENCED_2 = 1451;
+exports.ER_NO_REFERENCED_ROW_2 = 1452;
+exports.ER_SP_BAD_VAR_SHADOW = 1453;
+exports.ER_TRG_NO_DEFINER = 1454;
+exports.ER_OLD_FILE_FORMAT = 1455;
+exports.ER_SP_RECURSION_LIMIT = 1456;
+exports.ER_SP_PROC_TABLE_CORRUPT = 1457;
+exports.ER_SP_WRONG_NAME = 1458;
+exports.ER_TABLE_NEEDS_UPGRADE = 1459;
+exports.ER_SP_NO_AGGREGATE = 1460;
+exports.ER_MAX_PREPARED_STMT_COUNT_REACHED = 1461;
+exports.ER_VIEW_RECURSIVE = 1462;
+exports.ER_NON_GROUPING_FIELD_USED = 1463;
+exports.ER_TABLE_CANT_HANDLE_SPKEYS = 1464;
+exports.ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA = 1465;
+exports.ER_REMOVED_SPACES = 1466;
+exports.ER_AUTOINC_READ_FAILED = 1467;
+exports.ER_USERNAME = 1468;
+exports.ER_HOSTNAME = 1469;
+exports.ER_WRONG_STRING_LENGTH = 1470;
+exports.ER_NON_INSERTABLE_TABLE = 1471;
+exports.ER_ADMIN_WRONG_MRG_TABLE = 1472;
+exports.ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT = 1473;
+exports.ER_NAME_BECOMES_EMPTY = 1474;
+exports.ER_AMBIGUOUS_FIELD_TERM = 1475;
+exports.ER_FOREIGN_SERVER_EXISTS = 1476;
+exports.ER_FOREIGN_SERVER_DOESNT_EXIST = 1477;
+exports.ER_ILLEGAL_HA_CREATE_OPTION = 1478;
+exports.ER_PARTITION_REQUIRES_VALUES_ERROR = 1479;
+exports.ER_PARTITION_WRONG_VALUES_ERROR = 1480;
+exports.ER_PARTITION_MAXVALUE_ERROR = 1481;
+exports.ER_PARTITION_SUBPARTITION_ERROR = 1482;
+exports.ER_PARTITION_SUBPART_MIX_ERROR = 1483;
+exports.ER_PARTITION_WRONG_NO_PART_ERROR = 1484;
+exports.ER_PARTITION_WRONG_NO_SUBPART_ERROR = 1485;
+exports.ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR = 1486;
+exports.ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR = 1487;
+exports.ER_FIELD_NOT_FOUND_PART_ERROR = 1488;
+exports.ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR = 1489;
+exports.ER_INCONSISTENT_PARTITION_INFO_ERROR = 1490;
+exports.ER_PARTITION_FUNC_NOT_ALLOWED_ERROR = 1491;
+exports.ER_PARTITIONS_MUST_BE_DEFINED_ERROR = 1492;
+exports.ER_RANGE_NOT_INCREASING_ERROR = 1493;
+exports.ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR = 1494;
+exports.ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR = 1495;
+exports.ER_PARTITION_ENTRY_ERROR = 1496;
+exports.ER_MIX_HANDLER_ERROR = 1497;
+exports.ER_PARTITION_NOT_DEFINED_ERROR = 1498;
+exports.ER_TOO_MANY_PARTITIONS_ERROR = 1499;
+exports.ER_SUBPARTITION_ERROR = 1500;
+exports.ER_CANT_CREATE_HANDLER_FILE = 1501;
+exports.ER_BLOB_FIELD_IN_PART_FUNC_ERROR = 1502;
+exports.ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF = 1503;
+exports.ER_NO_PARTS_ERROR = 1504;
+exports.ER_PARTITION_MGMT_ON_NONPARTITIONED = 1505;
+exports.ER_FOREIGN_KEY_ON_PARTITIONED = 1506;
+exports.ER_DROP_PARTITION_NON_EXISTENT = 1507;
+exports.ER_DROP_LAST_PARTITION = 1508;
+exports.ER_COALESCE_ONLY_ON_HASH_PARTITION = 1509;
+exports.ER_REORG_HASH_ONLY_ON_SAME_NO = 1510;
+exports.ER_REORG_NO_PARAM_ERROR = 1511;
+exports.ER_ONLY_ON_RANGE_LIST_PARTITION = 1512;
+exports.ER_ADD_PARTITION_SUBPART_ERROR = 1513;
+exports.ER_ADD_PARTITION_NO_NEW_PARTITION = 1514;
+exports.ER_COALESCE_PARTITION_NO_PARTITION = 1515;
+exports.ER_REORG_PARTITION_NOT_EXIST = 1516;
+exports.ER_SAME_NAME_PARTITION = 1517;
+exports.ER_NO_BINLOG_ERROR = 1518;
+exports.ER_CONSECUTIVE_REORG_PARTITIONS = 1519;
+exports.ER_REORG_OUTSIDE_RANGE = 1520;
+exports.ER_PARTITION_FUNCTION_FAILURE = 1521;
+exports.ER_PART_STATE_ERROR = 1522;
+exports.ER_LIMITED_PART_RANGE = 1523;
+exports.ER_PLUGIN_IS_NOT_LOADED = 1524;
+exports.ER_WRONG_VALUE = 1525;
+exports.ER_NO_PARTITION_FOR_GIVEN_VALUE = 1526;
+exports.ER_FILEGROUP_OPTION_ONLY_ONCE = 1527;
+exports.ER_CREATE_FILEGROUP_FAILED = 1528;
+exports.ER_DROP_FILEGROUP_FAILED = 1529;
+exports.ER_TABLESPACE_AUTO_EXTEND_ERROR = 1530;
+exports.ER_WRONG_SIZE_NUMBER = 1531;
+exports.ER_SIZE_OVERFLOW_ERROR = 1532;
+exports.ER_ALTER_FILEGROUP_FAILED = 1533;
+exports.ER_BINLOG_ROW_LOGGING_FAILED = 1534;
+exports.ER_BINLOG_ROW_WRONG_TABLE_DEF = 1535;
+exports.ER_BINLOG_ROW_RBR_TO_SBR = 1536;
+exports.ER_EVENT_ALREADY_EXISTS = 1537;
+exports.ER_EVENT_STORE_FAILED = 1538;
+exports.ER_EVENT_DOES_NOT_EXIST = 1539;
+exports.ER_EVENT_CANT_ALTER = 1540;
+exports.ER_EVENT_DROP_FAILED = 1541;
+exports.ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG = 1542;
+exports.ER_EVENT_ENDS_BEFORE_STARTS = 1543;
+exports.ER_EVENT_EXEC_TIME_IN_THE_PAST = 1544;
+exports.ER_EVENT_OPEN_TABLE_FAILED = 1545;
+exports.ER_EVENT_NEITHER_M_EXPR_NOR_M_AT = 1546;
+exports.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED = 1547;
+exports.ER_CANNOT_LOAD_FROM_TABLE = 1548;
+exports.ER_EVENT_CANNOT_DELETE = 1549;
+exports.ER_EVENT_COMPILE_ERROR = 1550;
+exports.ER_EVENT_SAME_NAME = 1551;
+exports.ER_EVENT_DATA_TOO_LONG = 1552;
+exports.ER_DROP_INDEX_FK = 1553;
+exports.ER_WARN_DEPRECATED_SYNTAX_WITH_VER = 1554;
+exports.ER_CANT_WRITE_LOCK_LOG_TABLE = 1555;
+exports.ER_CANT_LOCK_LOG_TABLE = 1556;
+exports.ER_FOREIGN_DUPLICATE_KEY = 1557;
+exports.ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE = 1558;
+exports.ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR = 1559;
+exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1560;
+exports.ER_NDB_CANT_SWITCH_BINLOG_FORMAT = 1561;
+exports.ER_PARTITION_NO_TEMPORARY = 1562;
+exports.ER_PARTITION_CONST_DOMAIN_ERROR = 1563;
+exports.ER_PARTITION_FUNCTION_IS_NOT_ALLOWED = 1564;
+exports.ER_DDL_LOG_ERROR = 1565;
+exports.ER_NULL_IN_VALUES_LESS_THAN = 1566;
+exports.ER_WRONG_PARTITION_NAME = 1567;
+exports.ER_CANT_CHANGE_TX_CHARACTERISTICS = 1568;
+exports.ER_DUP_ENTRY_AUTOINCREMENT_CASE = 1569;
+exports.ER_EVENT_MODIFY_QUEUE_ERROR = 1570;
+exports.ER_EVENT_SET_VAR_ERROR = 1571;
+exports.ER_PARTITION_MERGE_ERROR = 1572;
+exports.ER_CANT_ACTIVATE_LOG = 1573;
+exports.ER_RBR_NOT_AVAILABLE = 1574;
+exports.ER_BASE64_DECODE_ERROR = 1575;
+exports.ER_EVENT_RECURSION_FORBIDDEN = 1576;
+exports.ER_EVENTS_DB_ERROR = 1577;
+exports.ER_ONLY_INTEGERS_ALLOWED = 1578;
+exports.ER_UNSUPORTED_LOG_ENGINE = 1579;
+exports.ER_BAD_LOG_STATEMENT = 1580;
+exports.ER_CANT_RENAME_LOG_TABLE = 1581;
+exports.ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT = 1582;
+exports.ER_WRONG_PARAMETERS_TO_NATIVE_FCT = 1583;
+exports.ER_WRONG_PARAMETERS_TO_STORED_FCT = 1584;
+exports.ER_NATIVE_FCT_NAME_COLLISION = 1585;
+exports.ER_DUP_ENTRY_WITH_KEY_NAME = 1586;
+exports.ER_BINLOG_PURGE_EMFILE = 1587;
+exports.ER_EVENT_CANNOT_CREATE_IN_THE_PAST = 1588;
+exports.ER_EVENT_CANNOT_ALTER_IN_THE_PAST = 1589;
+exports.ER_SLAVE_INCIDENT = 1590;
+exports.ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT = 1591;
+exports.ER_BINLOG_UNSAFE_STATEMENT = 1592;
+exports.ER_BINLOG_FATAL_ERROR = 1593;
+exports.ER_SLAVE_RELAY_LOG_READ_FAILURE = 1594;
+exports.ER_SLAVE_RELAY_LOG_WRITE_FAILURE = 1595;
+exports.ER_SLAVE_CREATE_EVENT_FAILURE = 1596;
+exports.ER_SLAVE_MASTER_COM_FAILURE = 1597;
+exports.ER_BINLOG_LOGGING_IMPOSSIBLE = 1598;
+exports.ER_VIEW_NO_CREATION_CTX = 1599;
+exports.ER_VIEW_INVALID_CREATION_CTX = 1600;
+exports.ER_SR_INVALID_CREATION_CTX = 1601;
+exports.ER_TRG_CORRUPTED_FILE = 1602;
+exports.ER_TRG_NO_CREATION_CTX = 1603;
+exports.ER_TRG_INVALID_CREATION_CTX = 1604;
+exports.ER_EVENT_INVALID_CREATION_CTX = 1605;
+exports.ER_TRG_CANT_OPEN_TABLE = 1606;
+exports.ER_CANT_CREATE_SROUTINE = 1607;
+exports.ER_NEVER_USED = 1608;
+exports.ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT = 1609;
+exports.ER_REPLICA_CORRUPT_EVENT = 1610;
+exports.ER_LOAD_DATA_INVALID_COLUMN = 1611;
+exports.ER_LOG_PURGE_NO_FILE = 1612;
+exports.ER_XA_RBTIMEOUT = 1613;
+exports.ER_XA_RBDEADLOCK = 1614;
+exports.ER_NEED_REPREPARE = 1615;
+exports.ER_DELAYED_NOT_SUPPORTED = 1616;
+exports.WARN_NO_CONNECTION_METADATA = 1617;
+exports.WARN_OPTION_IGNORED = 1618;
+exports.ER_PLUGIN_DELETE_BUILTIN = 1619;
+exports.WARN_PLUGIN_BUSY = 1620;
+exports.ER_VARIABLE_IS_READONLY = 1621;
+exports.ER_WARN_ENGINE_TRANSACTION_ROLLBACK = 1622;
+exports.ER_SLAVE_HEARTBEAT_FAILURE = 1623;
+exports.ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE = 1624;
+exports.ER_NDB_REPLICATION_SCHEMA_ERROR = 1625;
+exports.ER_CONFLICT_FN_PARSE_ERROR = 1626;
+exports.ER_EXCEPTIONS_WRITE_ERROR = 1627;
+exports.ER_TOO_LONG_TABLE_COMMENT = 1628;
+exports.ER_TOO_LONG_FIELD_COMMENT = 1629;
+exports.ER_FUNC_INEXISTENT_NAME_COLLISION = 1630;
+exports.ER_DATABASE_NAME = 1631;
+exports.ER_TABLE_NAME = 1632;
+exports.ER_PARTITION_NAME = 1633;
+exports.ER_SUBPARTITION_NAME = 1634;
+exports.ER_TEMPORARY_NAME = 1635;
+exports.ER_RENAMED_NAME = 1636;
+exports.ER_TOO_MANY_CONCURRENT_TRXS = 1637;
+exports.WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED = 1638;
+exports.ER_DEBUG_SYNC_TIMEOUT = 1639;
+exports.ER_DEBUG_SYNC_HIT_LIMIT = 1640;
+exports.ER_DUP_SIGNAL_SET = 1641;
+exports.ER_SIGNAL_WARN = 1642;
+exports.ER_SIGNAL_NOT_FOUND = 1643;
+exports.ER_SIGNAL_EXCEPTION = 1644;
+exports.ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER = 1645;
+exports.ER_SIGNAL_BAD_CONDITION_TYPE = 1646;
+exports.WARN_COND_ITEM_TRUNCATED = 1647;
+exports.ER_COND_ITEM_TOO_LONG = 1648;
+exports.ER_UNKNOWN_LOCALE = 1649;
+exports.ER_REPLICA_IGNORE_SERVER_IDS = 1650;
+exports.ER_QUERY_CACHE_DISABLED = 1651;
+exports.ER_SAME_NAME_PARTITION_FIELD = 1652;
+exports.ER_PARTITION_COLUMN_LIST_ERROR = 1653;
+exports.ER_WRONG_TYPE_COLUMN_VALUE_ERROR = 1654;
+exports.ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR = 1655;
+exports.ER_MAXVALUE_IN_VALUES_IN = 1656;
+exports.ER_TOO_MANY_VALUES_ERROR = 1657;
+exports.ER_ROW_SINGLE_PARTITION_FIELD_ERROR = 1658;
+exports.ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD = 1659;
+exports.ER_PARTITION_FIELDS_TOO_LONG = 1660;
+exports.ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE = 1661;
+exports.ER_BINLOG_ROW_MODE_AND_STMT_ENGINE = 1662;
+exports.ER_BINLOG_UNSAFE_AND_STMT_ENGINE = 1663;
+exports.ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE = 1664;
+exports.ER_BINLOG_STMT_MODE_AND_ROW_ENGINE = 1665;
+exports.ER_BINLOG_ROW_INJECTION_AND_STMT_MODE = 1666;
+exports.ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1667;
+exports.ER_BINLOG_UNSAFE_LIMIT = 1668;
+exports.ER_UNUSED4 = 1669;
+exports.ER_BINLOG_UNSAFE_SYSTEM_TABLE = 1670;
+exports.ER_BINLOG_UNSAFE_AUTOINC_COLUMNS = 1671;
+exports.ER_BINLOG_UNSAFE_UDF = 1672;
+exports.ER_BINLOG_UNSAFE_SYSTEM_VARIABLE = 1673;
+exports.ER_BINLOG_UNSAFE_SYSTEM_FUNCTION = 1674;
+exports.ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS = 1675;
+exports.ER_MESSAGE_AND_STATEMENT = 1676;
+exports.ER_SLAVE_CONVERSION_FAILED = 1677;
+exports.ER_REPLICA_CANT_CREATE_CONVERSION = 1678;
+exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1679;
+exports.ER_PATH_LENGTH = 1680;
+exports.ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT = 1681;
+exports.ER_WRONG_NATIVE_TABLE_STRUCTURE = 1682;
+exports.ER_WRONG_PERFSCHEMA_USAGE = 1683;
+exports.ER_WARN_I_S_SKIPPED_TABLE = 1684;
+exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1685;
+exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1686;
+exports.ER_SPATIAL_MUST_HAVE_GEOM_COL = 1687;
+exports.ER_TOO_LONG_INDEX_COMMENT = 1688;
+exports.ER_LOCK_ABORTED = 1689;
+exports.ER_DATA_OUT_OF_RANGE = 1690;
+exports.ER_WRONG_SPVAR_TYPE_IN_LIMIT = 1691;
+exports.ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1692;
+exports.ER_BINLOG_UNSAFE_MIXED_STATEMENT = 1693;
+exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1694;
+exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1695;
+exports.ER_FAILED_READ_FROM_PAR_FILE = 1696;
+exports.ER_VALUES_IS_NOT_INT_TYPE_ERROR = 1697;
+exports.ER_ACCESS_DENIED_NO_PASSWORD_ERROR = 1698;
+exports.ER_SET_PASSWORD_AUTH_PLUGIN = 1699;
+exports.ER_GRANT_PLUGIN_USER_EXISTS = 1700;
+exports.ER_TRUNCATE_ILLEGAL_FK = 1701;
+exports.ER_PLUGIN_IS_PERMANENT = 1702;
+exports.ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN = 1703;
+exports.ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX = 1704;
+exports.ER_STMT_CACHE_FULL = 1705;
+exports.ER_MULTI_UPDATE_KEY_CONFLICT = 1706;
+exports.ER_TABLE_NEEDS_REBUILD = 1707;
+exports.WARN_OPTION_BELOW_LIMIT = 1708;
+exports.ER_INDEX_COLUMN_TOO_LONG = 1709;
+exports.ER_ERROR_IN_TRIGGER_BODY = 1710;
+exports.ER_ERROR_IN_UNKNOWN_TRIGGER_BODY = 1711;
+exports.ER_INDEX_CORRUPT = 1712;
+exports.ER_UNDO_RECORD_TOO_BIG = 1713;
+exports.ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT = 1714;
+exports.ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE = 1715;
+exports.ER_BINLOG_UNSAFE_REPLACE_SELECT = 1716;
+exports.ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT = 1717;
+exports.ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT = 1718;
+exports.ER_BINLOG_UNSAFE_UPDATE_IGNORE = 1719;
+exports.ER_PLUGIN_NO_UNINSTALL = 1720;
+exports.ER_PLUGIN_NO_INSTALL = 1721;
+exports.ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT = 1722;
+exports.ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC = 1723;
+exports.ER_BINLOG_UNSAFE_INSERT_TWO_KEYS = 1724;
+exports.ER_TABLE_IN_FK_CHECK = 1725;
+exports.ER_UNSUPPORTED_ENGINE = 1726;
+exports.ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST = 1727;
+exports.ER_CANNOT_LOAD_FROM_TABLE_V2 = 1728;
+exports.ER_SOURCE_DELAY_VALUE_OUT_OF_RANGE = 1729;
+exports.ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT = 1730;
+exports.ER_PARTITION_EXCHANGE_DIFFERENT_OPTION = 1731;
+exports.ER_PARTITION_EXCHANGE_PART_TABLE = 1732;
+exports.ER_PARTITION_EXCHANGE_TEMP_TABLE = 1733;
+exports.ER_PARTITION_INSTEAD_OF_SUBPARTITION = 1734;
+exports.ER_UNKNOWN_PARTITION = 1735;
+exports.ER_TABLES_DIFFERENT_METADATA = 1736;
+exports.ER_ROW_DOES_NOT_MATCH_PARTITION = 1737;
+exports.ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX = 1738;
+exports.ER_WARN_INDEX_NOT_APPLICABLE = 1739;
+exports.ER_PARTITION_EXCHANGE_FOREIGN_KEY = 1740;
+exports.ER_NO_SUCH_KEY_VALUE = 1741;
+exports.ER_RPL_INFO_DATA_TOO_LONG = 1742;
+exports.ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE = 1743;
+exports.ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE = 1744;
+exports.ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX = 1745;
+exports.ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT = 1746;
+exports.ER_PARTITION_CLAUSE_ON_NONPARTITIONED = 1747;
+exports.ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET = 1748;
+exports.ER_NO_SUCH_PARTITION = 1749;
+exports.ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE = 1750;
+exports.ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE = 1751;
+exports.ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE = 1752;
+exports.ER_MTA_FEATURE_IS_NOT_SUPPORTED = 1753;
+exports.ER_MTA_UPDATED_DBS_GREATER_MAX = 1754;
+exports.ER_MTA_CANT_PARALLEL = 1755;
+exports.ER_MTA_INCONSISTENT_DATA = 1756;
+exports.ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING = 1757;
+exports.ER_DA_INVALID_CONDITION_NUMBER = 1758;
+exports.ER_INSECURE_PLAIN_TEXT = 1759;
+exports.ER_INSECURE_CHANGE_SOURCE = 1760;
+exports.ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO = 1761;
+exports.ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO = 1762;
+exports.ER_SQLTHREAD_WITH_SECURE_REPLICA = 1763;
+exports.ER_TABLE_HAS_NO_FT = 1764;
+exports.ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER = 1765;
+exports.ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION = 1766;
+exports.ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST = 1767;
+exports.ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION = 1768;
+exports.ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION = 1769;
+exports.ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL = 1770;
+exports.ER_SKIPPING_LOGGED_TRANSACTION = 1771;
+exports.ER_MALFORMED_GTID_SET_SPECIFICATION = 1772;
+exports.ER_MALFORMED_GTID_SET_ENCODING = 1773;
+exports.ER_MALFORMED_GTID_SPECIFICATION = 1774;
+exports.ER_GNO_EXHAUSTED = 1775;
+exports.ER_BAD_REPLICA_AUTO_POSITION = 1776;
+exports.ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF = 1777;
+exports.ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET = 1778;
+exports.ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON = 1779;
+exports.ER_GTID_MODE_REQUIRES_BINLOG = 1780;
+exports.ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF = 1781;
+exports.ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON = 1782;
+exports.ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF = 1783;
+exports.ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF = 1784;
+exports.ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE = 1785;
+exports.ER_GTID_UNSAFE_CREATE_SELECT = 1786;
+exports.ER_GTID_UNSAFE_CREATE_DROP_TEMP_TABLE_IN_TRANSACTION = 1787;
+exports.ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME = 1788;
+exports.ER_SOURCE_HAS_PURGED_REQUIRED_GTIDS = 1789;
+exports.ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID = 1790;
+exports.ER_UNKNOWN_EXPLAIN_FORMAT = 1791;
+exports.ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION = 1792;
+exports.ER_TOO_LONG_TABLE_PARTITION_COMMENT = 1793;
+exports.ER_REPLICA_CONFIGURATION = 1794;
+exports.ER_INNODB_FT_LIMIT = 1795;
+exports.ER_INNODB_NO_FT_TEMP_TABLE = 1796;
+exports.ER_INNODB_FT_WRONG_DOCID_COLUMN = 1797;
+exports.ER_INNODB_FT_WRONG_DOCID_INDEX = 1798;
+exports.ER_INNODB_ONLINE_LOG_TOO_BIG = 1799;
+exports.ER_UNKNOWN_ALTER_ALGORITHM = 1800;
+exports.ER_UNKNOWN_ALTER_LOCK = 1801;
+exports.ER_MTA_CHANGE_SOURCE_CANT_RUN_WITH_GAPS = 1802;
+exports.ER_MTA_RECOVERY_FAILURE = 1803;
+exports.ER_MTA_RESET_WORKERS = 1804;
+exports.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 = 1805;
+exports.ER_REPLICA_SILENT_RETRY_TRANSACTION = 1806;
+exports.ER_DISCARD_FK_CHECKS_RUNNING = 1807;
+exports.ER_TABLE_SCHEMA_MISMATCH = 1808;
+exports.ER_TABLE_IN_SYSTEM_TABLESPACE = 1809;
+exports.ER_IO_READ_ERROR = 1810;
+exports.ER_IO_WRITE_ERROR = 1811;
+exports.ER_TABLESPACE_MISSING = 1812;
+exports.ER_TABLESPACE_EXISTS = 1813;
+exports.ER_TABLESPACE_DISCARDED = 1814;
+exports.ER_INTERNAL_ERROR = 1815;
+exports.ER_INNODB_IMPORT_ERROR = 1816;
+exports.ER_INNODB_INDEX_CORRUPT = 1817;
+exports.ER_INVALID_YEAR_COLUMN_LENGTH = 1818;
+exports.ER_NOT_VALID_PASSWORD = 1819;
+exports.ER_MUST_CHANGE_PASSWORD = 1820;
+exports.ER_FK_NO_INDEX_CHILD = 1821;
+exports.ER_FK_NO_INDEX_PARENT = 1822;
+exports.ER_FK_FAIL_ADD_SYSTEM = 1823;
+exports.ER_FK_CANNOT_OPEN_PARENT = 1824;
+exports.ER_FK_INCORRECT_OPTION = 1825;
+exports.ER_FK_DUP_NAME = 1826;
+exports.ER_PASSWORD_FORMAT = 1827;
+exports.ER_FK_COLUMN_CANNOT_DROP = 1828;
+exports.ER_FK_COLUMN_CANNOT_DROP_CHILD = 1829;
+exports.ER_FK_COLUMN_NOT_NULL = 1830;
+exports.ER_DUP_INDEX = 1831;
+exports.ER_FK_COLUMN_CANNOT_CHANGE = 1832;
+exports.ER_FK_COLUMN_CANNOT_CHANGE_CHILD = 1833;
+exports.ER_UNUSED5 = 1834;
+exports.ER_MALFORMED_PACKET = 1835;
+exports.ER_READ_ONLY_MODE = 1836;
+exports.ER_GTID_NEXT_TYPE_UNDEFINED_GTID = 1837;
+exports.ER_VARIABLE_NOT_SETTABLE_IN_SP = 1838;
+exports.ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF = 1839;
+exports.ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY = 1840;
+exports.ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY = 1841;
+exports.ER_GTID_PURGED_WAS_CHANGED = 1842;
+exports.ER_GTID_EXECUTED_WAS_CHANGED = 1843;
+exports.ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES = 1844;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED = 1845;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON = 1846;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY = 1847;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION = 1848;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME = 1849;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE = 1850;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK = 1851;
+exports.ER_UNUSED6 = 1852;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK = 1853;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC = 1854;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS = 1855;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS = 1856;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS = 1857;
+exports.ER_SQL_REPLICA_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE = 1858;
+exports.ER_DUP_UNKNOWN_IN_INDEX = 1859;
+exports.ER_IDENT_CAUSES_TOO_LONG_PATH = 1860;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL = 1861;
+exports.ER_MUST_CHANGE_PASSWORD_LOGIN = 1862;
+exports.ER_ROW_IN_WRONG_PARTITION = 1863;
+exports.ER_MTA_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX = 1864;
+exports.ER_INNODB_NO_FT_USES_PARSER = 1865;
+exports.ER_BINLOG_LOGICAL_CORRUPTION = 1866;
+exports.ER_WARN_PURGE_LOG_IN_USE = 1867;
+exports.ER_WARN_PURGE_LOG_IS_ACTIVE = 1868;
+exports.ER_AUTO_INCREMENT_CONFLICT = 1869;
+exports.WARN_ON_BLOCKHOLE_IN_RBR = 1870;
+exports.ER_REPLICA_CM_INIT_REPOSITORY = 1871;
+exports.ER_REPLICA_AM_INIT_REPOSITORY = 1872;
+exports.ER_ACCESS_DENIED_CHANGE_USER_ERROR = 1873;
+exports.ER_INNODB_READ_ONLY = 1874;
+exports.ER_STOP_REPLICA_SQL_THREAD_TIMEOUT = 1875;
+exports.ER_STOP_REPLICA_IO_THREAD_TIMEOUT = 1876;
+exports.ER_TABLE_CORRUPT = 1877;
+exports.ER_TEMP_FILE_WRITE_FAILURE = 1878;
+exports.ER_INNODB_FT_AUX_NOT_HEX_ID = 1879;
+exports.ER_OLD_TEMPORALS_UPGRADED = 1880;
+exports.ER_INNODB_FORCED_RECOVERY = 1881;
+exports.ER_AES_INVALID_IV = 1882;
+exports.ER_PLUGIN_CANNOT_BE_UNINSTALLED = 1883;
+exports.ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_ASSIGNED_GTID = 1884;
+exports.ER_REPLICA_HAS_MORE_GTIDS_THAN_SOURCE = 1885;
+exports.ER_MISSING_KEY = 1886;
+exports.WARN_NAMED_PIPE_ACCESS_EVERYONE = 1887;
+exports.ER_FILE_CORRUPT = 3000;
+exports.ER_ERROR_ON_SOURCE = 3001;
+exports.ER_INCONSISTENT_ERROR = 3002;
+exports.ER_STORAGE_ENGINE_NOT_LOADED = 3003;
+exports.ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER = 3004;
+exports.ER_WARN_LEGACY_SYNTAX_CONVERTED = 3005;
+exports.ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN = 3006;
+exports.ER_CANNOT_DISCARD_TEMPORARY_TABLE = 3007;
+exports.ER_FK_DEPTH_EXCEEDED = 3008;
+exports.ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2 = 3009;
+exports.ER_WARN_TRIGGER_DOESNT_HAVE_CREATED = 3010;
+exports.ER_REFERENCED_TRG_DOES_NOT_EXIST = 3011;
+exports.ER_EXPLAIN_NOT_SUPPORTED = 3012;
+exports.ER_INVALID_FIELD_SIZE = 3013;
+exports.ER_MISSING_HA_CREATE_OPTION = 3014;
+exports.ER_ENGINE_OUT_OF_MEMORY = 3015;
+exports.ER_PASSWORD_EXPIRE_ANONYMOUS_USER = 3016;
+exports.ER_REPLICA_SQL_THREAD_MUST_STOP = 3017;
+exports.ER_NO_FT_MATERIALIZED_SUBQUERY = 3018;
+exports.ER_INNODB_UNDO_LOG_FULL = 3019;
+exports.ER_INVALID_ARGUMENT_FOR_LOGARITHM = 3020;
+exports.ER_REPLICA_CHANNEL_IO_THREAD_MUST_STOP = 3021;
+exports.ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO = 3022;
+exports.ER_WARN_ONLY_SOURCE_LOG_FILE_NO_POS = 3023;
+exports.ER_QUERY_TIMEOUT = 3024;
+exports.ER_NON_RO_SELECT_DISABLE_TIMER = 3025;
+exports.ER_DUP_LIST_ENTRY = 3026;
+exports.ER_SQL_MODE_NO_EFFECT = 3027;
+exports.ER_AGGREGATE_ORDER_FOR_UNION = 3028;
+exports.ER_AGGREGATE_ORDER_NON_AGG_QUERY = 3029;
+exports.ER_REPLICA_WORKER_STOPPED_PREVIOUS_THD_ERROR = 3030;
+exports.ER_DONT_SUPPORT_REPLICA_PRESERVE_COMMIT_ORDER = 3031;
+exports.ER_SERVER_OFFLINE_MODE = 3032;
+exports.ER_GIS_DIFFERENT_SRIDS = 3033;
+exports.ER_GIS_UNSUPPORTED_ARGUMENT = 3034;
+exports.ER_GIS_UNKNOWN_ERROR = 3035;
+exports.ER_GIS_UNKNOWN_EXCEPTION = 3036;
+exports.ER_GIS_INVALID_DATA = 3037;
+exports.ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION = 3038;
+exports.ER_BOOST_GEOMETRY_CENTROID_EXCEPTION = 3039;
+exports.ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION = 3040;
+exports.ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION = 3041;
+exports.ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION = 3042;
+exports.ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION = 3043;
+exports.ER_STD_BAD_ALLOC_ERROR = 3044;
+exports.ER_STD_DOMAIN_ERROR = 3045;
+exports.ER_STD_LENGTH_ERROR = 3046;
+exports.ER_STD_INVALID_ARGUMENT = 3047;
+exports.ER_STD_OUT_OF_RANGE_ERROR = 3048;
+exports.ER_STD_OVERFLOW_ERROR = 3049;
+exports.ER_STD_RANGE_ERROR = 3050;
+exports.ER_STD_UNDERFLOW_ERROR = 3051;
+exports.ER_STD_LOGIC_ERROR = 3052;
+exports.ER_STD_RUNTIME_ERROR = 3053;
+exports.ER_STD_UNKNOWN_EXCEPTION = 3054;
+exports.ER_GIS_DATA_WRONG_ENDIANESS = 3055;
+exports.ER_CHANGE_SOURCE_PASSWORD_LENGTH = 3056;
+exports.ER_USER_LOCK_WRONG_NAME = 3057;
+exports.ER_USER_LOCK_DEADLOCK = 3058;
+exports.ER_REPLACE_INACCESSIBLE_ROWS = 3059;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS = 3060;
+exports.ER_ILLEGAL_USER_VAR = 3061;
+exports.ER_GTID_MODE_OFF = 3062;
+exports.ER_UNSUPPORTED_BY_REPLICATION_THREAD = 3063;
+exports.ER_INCORRECT_TYPE = 3064;
+exports.ER_FIELD_IN_ORDER_NOT_SELECT = 3065;
+exports.ER_AGGREGATE_IN_ORDER_NOT_SELECT = 3066;
+exports.ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN = 3067;
+exports.ER_NET_OK_PACKET_TOO_LARGE = 3068;
+exports.ER_INVALID_JSON_DATA = 3069;
+exports.ER_INVALID_GEOJSON_MISSING_MEMBER = 3070;
+exports.ER_INVALID_GEOJSON_WRONG_TYPE = 3071;
+exports.ER_INVALID_GEOJSON_UNSPECIFIED = 3072;
+exports.ER_DIMENSION_UNSUPPORTED = 3073;
+exports.ER_REPLICA_CHANNEL_DOES_NOT_EXIST = 3074;
+exports.ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT = 3075;
+exports.ER_REPLICA_CHANNEL_NAME_INVALID_OR_TOO_LONG = 3076;
+exports.ER_REPLICA_NEW_CHANNEL_WRONG_REPOSITORY = 3077;
+exports.ER_SLAVE_CHANNEL_DELETE = 3078;
+exports.ER_REPLICA_MULTIPLE_CHANNELS_CMD = 3079;
+exports.ER_REPLICA_MAX_CHANNELS_EXCEEDED = 3080;
+exports.ER_REPLICA_CHANNEL_MUST_STOP = 3081;
+exports.ER_REPLICA_CHANNEL_NOT_RUNNING = 3082;
+exports.ER_REPLICA_CHANNEL_WAS_RUNNING = 3083;
+exports.ER_REPLICA_CHANNEL_WAS_NOT_RUNNING = 3084;
+exports.ER_REPLICA_CHANNEL_SQL_THREAD_MUST_STOP = 3085;
+exports.ER_REPLICA_CHANNEL_SQL_SKIP_COUNTER = 3086;
+exports.ER_WRONG_FIELD_WITH_GROUP_V2 = 3087;
+exports.ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2 = 3088;
+exports.ER_WARN_DEPRECATED_SYSVAR_UPDATE = 3089;
+exports.ER_WARN_DEPRECATED_SQLMODE = 3090;
+exports.ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID = 3091;
+exports.ER_GROUP_REPLICATION_CONFIGURATION = 3092;
+exports.ER_GROUP_REPLICATION_RUNNING = 3093;
+exports.ER_GROUP_REPLICATION_APPLIER_INIT_ERROR = 3094;
+exports.ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT = 3095;
+exports.ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR = 3096;
+exports.ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR = 3097;
+exports.ER_BEFORE_DML_VALIDATION_ERROR = 3098;
+exports.ER_PREVENTS_VARIABLE_WITHOUT_RBR = 3099;
+exports.ER_RUN_HOOK_ERROR = 3100;
+exports.ER_TRANSACTION_ROLLBACK_DURING_COMMIT = 3101;
+exports.ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED = 3102;
+exports.ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN = 3103;
+exports.ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN = 3104;
+exports.ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN = 3105;
+exports.ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN = 3106;
+exports.ER_GENERATED_COLUMN_NON_PRIOR = 3107;
+exports.ER_DEPENDENT_BY_GENERATED_COLUMN = 3108;
+exports.ER_GENERATED_COLUMN_REF_AUTO_INC = 3109;
+exports.ER_FEATURE_NOT_AVAILABLE = 3110;
+exports.ER_CANT_SET_GTID_MODE = 3111;
+exports.ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF = 3112;
+exports.ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION = 3113;
+exports.ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON = 3114;
+exports.ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF = 3115;
+exports.ER_CANT_ENFORCE_GTID_CONSISTENCY_WITH_ONGOING_GTID_VIOLATING_TX = 3116;
+exports.ER_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TX = 3117;
+exports.ER_ACCOUNT_HAS_BEEN_LOCKED = 3118;
+exports.ER_WRONG_TABLESPACE_NAME = 3119;
+exports.ER_TABLESPACE_IS_NOT_EMPTY = 3120;
+exports.ER_WRONG_FILE_NAME = 3121;
+exports.ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION = 3122;
+exports.ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR = 3123;
+exports.ER_WARN_BAD_MAX_EXECUTION_TIME = 3124;
+exports.ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME = 3125;
+exports.ER_WARN_CONFLICTING_HINT = 3126;
+exports.ER_WARN_UNKNOWN_QB_NAME = 3127;
+exports.ER_UNRESOLVED_HINT_NAME = 3128;
+exports.ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE = 3129;
+exports.ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED = 3130;
+exports.ER_LOCKING_SERVICE_WRONG_NAME = 3131;
+exports.ER_LOCKING_SERVICE_DEADLOCK = 3132;
+exports.ER_LOCKING_SERVICE_TIMEOUT = 3133;
+exports.ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED = 3134;
+exports.ER_SQL_MODE_MERGED = 3135;
+exports.ER_VTOKEN_PLUGIN_TOKEN_MISMATCH = 3136;
+exports.ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND = 3137;
+exports.ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID = 3138;
+exports.ER_REPLICA_CHANNEL_OPERATION_NOT_ALLOWED = 3139;
+exports.ER_INVALID_JSON_TEXT = 3140;
+exports.ER_INVALID_JSON_TEXT_IN_PARAM = 3141;
+exports.ER_INVALID_JSON_BINARY_DATA = 3142;
+exports.ER_INVALID_JSON_PATH = 3143;
+exports.ER_INVALID_JSON_CHARSET = 3144;
+exports.ER_INVALID_JSON_CHARSET_IN_FUNCTION = 3145;
+exports.ER_INVALID_TYPE_FOR_JSON = 3146;
+exports.ER_INVALID_CAST_TO_JSON = 3147;
+exports.ER_INVALID_JSON_PATH_CHARSET = 3148;
+exports.ER_INVALID_JSON_PATH_WILDCARD = 3149;
+exports.ER_JSON_VALUE_TOO_BIG = 3150;
+exports.ER_JSON_KEY_TOO_BIG = 3151;
+exports.ER_JSON_USED_AS_KEY = 3152;
+exports.ER_JSON_VACUOUS_PATH = 3153;
+exports.ER_JSON_BAD_ONE_OR_ALL_ARG = 3154;
+exports.ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE = 3155;
+exports.ER_INVALID_JSON_VALUE_FOR_CAST = 3156;
+exports.ER_JSON_DOCUMENT_TOO_DEEP = 3157;
+exports.ER_JSON_DOCUMENT_NULL_KEY = 3158;
+exports.ER_SECURE_TRANSPORT_REQUIRED = 3159;
+exports.ER_NO_SECURE_TRANSPORTS_CONFIGURED = 3160;
+exports.ER_DISABLED_STORAGE_ENGINE = 3161;
+exports.ER_USER_DOES_NOT_EXIST = 3162;
+exports.ER_USER_ALREADY_EXISTS = 3163;
+exports.ER_AUDIT_API_ABORT = 3164;
+exports.ER_INVALID_JSON_PATH_ARRAY_CELL = 3165;
+exports.ER_BUFPOOL_RESIZE_INPROGRESS = 3166;
+exports.ER_FEATURE_DISABLED_SEE_DOC = 3167;
+exports.ER_SERVER_ISNT_AVAILABLE = 3168;
+exports.ER_SESSION_WAS_KILLED = 3169;
+exports.ER_CAPACITY_EXCEEDED = 3170;
+exports.ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER = 3171;
+exports.ER_TABLE_NEEDS_UPG_PART = 3172;
+exports.ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID = 3173;
+exports.ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL = 3174;
+exports.ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT = 3175;
+exports.ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE = 3176;
+exports.ER_LOCK_REFUSED_BY_ENGINE = 3177;
+exports.ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN = 3178;
+exports.ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE = 3179;
+exports.ER_MASTER_KEY_ROTATION_ERROR_BY_SE = 3180;
+exports.ER_MASTER_KEY_ROTATION_BINLOG_FAILED = 3181;
+exports.ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE = 3182;
+exports.ER_TABLESPACE_CANNOT_ENCRYPT = 3183;
+exports.ER_INVALID_ENCRYPTION_OPTION = 3184;
+exports.ER_CANNOT_FIND_KEY_IN_KEYRING = 3185;
+exports.ER_CAPACITY_EXCEEDED_IN_PARSER = 3186;
+exports.ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE = 3187;
+exports.ER_KEYRING_UDF_KEYRING_SERVICE_ERROR = 3188;
+exports.ER_USER_COLUMN_OLD_LENGTH = 3189;
+exports.ER_CANT_RESET_SOURCE = 3190;
+exports.ER_GROUP_REPLICATION_MAX_GROUP_SIZE = 3191;
+exports.ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED = 3192;
+exports.ER_TABLE_REFERENCED = 3193;
+exports.ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE = 3194;
+exports.ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO = 3195;
+exports.ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID = 3196;
+exports.ER_XA_RETRY = 3197;
+exports.ER_KEYRING_AWS_UDF_AWS_KMS_ERROR = 3198;
+exports.ER_BINLOG_UNSAFE_XA = 3199;
+exports.ER_UDF_ERROR = 3200;
+exports.ER_KEYRING_MIGRATION_FAILURE = 3201;
+exports.ER_KEYRING_ACCESS_DENIED_ERROR = 3202;
+exports.ER_KEYRING_MIGRATION_STATUS = 3203;
+exports.ER_PLUGIN_FAILED_TO_OPEN_TABLES = 3204;
+exports.ER_PLUGIN_FAILED_TO_OPEN_TABLE = 3205;
+exports.ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED = 3206;
+exports.ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET = 3207;
+exports.ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY = 3208;
+exports.ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED = 3209;
+exports.ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED = 3210;
+exports.ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE = 3211;
+exports.ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED = 3212;
+exports.ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS = 3213;
+exports.ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE = 3214;
+exports.ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT = 3215;
+exports.ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED = 3216;
+exports.ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE = 3217;
+exports.ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE = 3218;
+exports.ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR = 3219;
+exports.ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY = 3220;
+exports.ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY = 3221;
+exports.ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS = 3222;
+exports.ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC = 3223;
+exports.ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER = 3224;
+exports.ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER = 3225;
+exports.WARN_DEPRECATED_MAXDB_SQL_MODE_FOR_TIMESTAMP = 3226;
+exports.ER_XA_REPLICATION_FILTERS = 3227;
+exports.ER_CANT_OPEN_ERROR_LOG = 3228;
+exports.ER_GROUPING_ON_TIMESTAMP_IN_DST = 3229;
+exports.ER_CANT_START_SERVER_NAMED_PIPE = 3230;
+exports.ER_WRITE_SET_EXCEEDS_LIMIT = 3231;
+exports.ER_DEPRECATED_TLS_VERSION_SESSION_57 = 3232;
+exports.ER_WARN_DEPRECATED_TLS_VERSION_57 = 3233;
+exports.ER_WARN_WRONG_NATIVE_TABLE_STRUCTURE = 3234;
+exports.ER_AES_INVALID_KDF_NAME = 3235;
+exports.ER_AES_INVALID_KDF_ITERATIONS = 3236;
+exports.WARN_AES_KEY_SIZE = 3237;
+exports.ER_AES_INVALID_KDF_OPTION_SIZE = 3238;
+exports.ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE = 3500;
+exports.ER_ACL_OPERATION_FAILED = 3501;
+exports.ER_UNSUPPORTED_INDEX_ALGORITHM = 3502;
+exports.ER_NO_SUCH_DB = 3503;
+exports.ER_TOO_BIG_ENUM = 3504;
+exports.ER_TOO_LONG_SET_ENUM_VALUE = 3505;
+exports.ER_INVALID_DD_OBJECT = 3506;
+exports.ER_UPDATING_DD_TABLE = 3507;
+exports.ER_INVALID_DD_OBJECT_ID = 3508;
+exports.ER_INVALID_DD_OBJECT_NAME = 3509;
+exports.ER_TABLESPACE_MISSING_WITH_NAME = 3510;
+exports.ER_TOO_LONG_ROUTINE_COMMENT = 3511;
+exports.ER_SP_LOAD_FAILED = 3512;
+exports.ER_INVALID_BITWISE_OPERANDS_SIZE = 3513;
+exports.ER_INVALID_BITWISE_AGGREGATE_OPERANDS_SIZE = 3514;
+exports.ER_WARN_UNSUPPORTED_HINT = 3515;
+exports.ER_UNEXPECTED_GEOMETRY_TYPE = 3516;
+exports.ER_SRS_PARSE_ERROR = 3517;
+exports.ER_SRS_PROJ_PARAMETER_MISSING = 3518;
+exports.ER_WARN_SRS_NOT_FOUND = 3519;
+exports.ER_SRS_NOT_CARTESIAN = 3520;
+exports.ER_SRS_NOT_CARTESIAN_UNDEFINED = 3521;
+exports.ER_PK_INDEX_CANT_BE_INVISIBLE = 3522;
+exports.ER_UNKNOWN_AUTHID = 3523;
+exports.ER_FAILED_ROLE_GRANT = 3524;
+exports.ER_OPEN_ROLE_TABLES = 3525;
+exports.ER_FAILED_DEFAULT_ROLES = 3526;
+exports.ER_COMPONENTS_NO_SCHEME = 3527;
+exports.ER_COMPONENTS_NO_SCHEME_SERVICE = 3528;
+exports.ER_COMPONENTS_CANT_LOAD = 3529;
+exports.ER_ROLE_NOT_GRANTED = 3530;
+exports.ER_FAILED_REVOKE_ROLE = 3531;
+exports.ER_RENAME_ROLE = 3532;
+exports.ER_COMPONENTS_CANT_ACQUIRE_SERVICE_IMPLEMENTATION = 3533;
+exports.ER_COMPONENTS_CANT_SATISFY_DEPENDENCY = 3534;
+exports.ER_COMPONENTS_LOAD_CANT_REGISTER_SERVICE_IMPLEMENTATION = 3535;
+exports.ER_COMPONENTS_LOAD_CANT_INITIALIZE = 3536;
+exports.ER_COMPONENTS_UNLOAD_NOT_LOADED = 3537;
+exports.ER_COMPONENTS_UNLOAD_CANT_DEINITIALIZE = 3538;
+exports.ER_COMPONENTS_CANT_RELEASE_SERVICE = 3539;
+exports.ER_COMPONENTS_UNLOAD_CANT_UNREGISTER_SERVICE = 3540;
+exports.ER_COMPONENTS_CANT_UNLOAD = 3541;
+exports.ER_WARN_UNLOAD_THE_NOT_PERSISTED = 3542;
+exports.ER_COMPONENT_TABLE_INCORRECT = 3543;
+exports.ER_COMPONENT_MANIPULATE_ROW_FAILED = 3544;
+exports.ER_COMPONENTS_UNLOAD_DUPLICATE_IN_GROUP = 3545;
+exports.ER_CANT_SET_GTID_PURGED_DUE_SETS_CONSTRAINTS = 3546;
+exports.ER_CANNOT_LOCK_USER_MANAGEMENT_CACHES = 3547;
+exports.ER_SRS_NOT_FOUND = 3548;
+exports.ER_VARIABLE_NOT_PERSISTED = 3549;
+exports.ER_IS_QUERY_INVALID_CLAUSE = 3550;
+exports.ER_UNABLE_TO_STORE_STATISTICS = 3551;
+exports.ER_NO_SYSTEM_SCHEMA_ACCESS = 3552;
+exports.ER_NO_SYSTEM_TABLESPACE_ACCESS = 3553;
+exports.ER_NO_SYSTEM_TABLE_ACCESS = 3554;
+exports.ER_NO_SYSTEM_TABLE_ACCESS_FOR_DICTIONARY_TABLE = 3555;
+exports.ER_NO_SYSTEM_TABLE_ACCESS_FOR_SYSTEM_TABLE = 3556;
+exports.ER_NO_SYSTEM_TABLE_ACCESS_FOR_TABLE = 3557;
+exports.ER_INVALID_OPTION_KEY = 3558;
+exports.ER_INVALID_OPTION_VALUE = 3559;
+exports.ER_INVALID_OPTION_KEY_VALUE_PAIR = 3560;
+exports.ER_INVALID_OPTION_START_CHARACTER = 3561;
+exports.ER_INVALID_OPTION_END_CHARACTER = 3562;
+exports.ER_INVALID_OPTION_CHARACTERS = 3563;
+exports.ER_DUPLICATE_OPTION_KEY = 3564;
+exports.ER_WARN_SRS_NOT_FOUND_AXIS_ORDER = 3565;
+exports.ER_NO_ACCESS_TO_NATIVE_FCT = 3566;
+exports.ER_RESET_SOURCE_TO_VALUE_OUT_OF_RANGE = 3567;
+exports.ER_UNRESOLVED_TABLE_LOCK = 3568;
+exports.ER_DUPLICATE_TABLE_LOCK = 3569;
+exports.ER_BINLOG_UNSAFE_SKIP_LOCKED = 3570;
+exports.ER_BINLOG_UNSAFE_NOWAIT = 3571;
+exports.ER_LOCK_NOWAIT = 3572;
+exports.ER_CTE_RECURSIVE_REQUIRES_UNION = 3573;
+exports.ER_CTE_RECURSIVE_REQUIRES_NONRECURSIVE_FIRST = 3574;
+exports.ER_CTE_RECURSIVE_FORBIDS_AGGREGATION = 3575;
+exports.ER_CTE_RECURSIVE_FORBIDDEN_JOIN_ORDER = 3576;
+exports.ER_CTE_RECURSIVE_REQUIRES_SINGLE_REFERENCE = 3577;
+exports.ER_SWITCH_TMP_ENGINE = 3578;
+exports.ER_WINDOW_NO_SUCH_WINDOW = 3579;
+exports.ER_WINDOW_CIRCULARITY_IN_WINDOW_GRAPH = 3580;
+exports.ER_WINDOW_NO_CHILD_PARTITIONING = 3581;
+exports.ER_WINDOW_NO_INHERIT_FRAME = 3582;
+exports.ER_WINDOW_NO_REDEFINE_ORDER_BY = 3583;
+exports.ER_WINDOW_FRAME_START_ILLEGAL = 3584;
+exports.ER_WINDOW_FRAME_END_ILLEGAL = 3585;
+exports.ER_WINDOW_FRAME_ILLEGAL = 3586;
+exports.ER_WINDOW_RANGE_FRAME_ORDER_TYPE = 3587;
+exports.ER_WINDOW_RANGE_FRAME_TEMPORAL_TYPE = 3588;
+exports.ER_WINDOW_RANGE_FRAME_NUMERIC_TYPE = 3589;
+exports.ER_WINDOW_RANGE_BOUND_NOT_CONSTANT = 3590;
+exports.ER_WINDOW_DUPLICATE_NAME = 3591;
+exports.ER_WINDOW_ILLEGAL_ORDER_BY = 3592;
+exports.ER_WINDOW_INVALID_WINDOW_FUNC_USE = 3593;
+exports.ER_WINDOW_INVALID_WINDOW_FUNC_ALIAS_USE = 3594;
+exports.ER_WINDOW_NESTED_WINDOW_FUNC_USE_IN_WINDOW_SPEC = 3595;
+exports.ER_WINDOW_ROWS_INTERVAL_USE = 3596;
+exports.ER_WINDOW_NO_GROUP_ORDER = 3597;
+exports.ER_WINDOW_EXPLAIN_JSON = 3598;
+exports.ER_WINDOW_FUNCTION_IGNORES_FRAME = 3599;
+exports.ER_WL9236_NOW = 3600;
+exports.ER_INVALID_NO_OF_ARGS = 3601;
+exports.ER_FIELD_IN_GROUPING_NOT_GROUP_BY = 3602;
+exports.ER_TOO_LONG_TABLESPACE_COMMENT = 3603;
+exports.ER_ENGINE_CANT_DROP_TABLE = 3604;
+exports.ER_ENGINE_CANT_DROP_MISSING_TABLE = 3605;
+exports.ER_TABLESPACE_DUP_FILENAME = 3606;
+exports.ER_DB_DROP_RMDIR2 = 3607;
+exports.ER_IMP_NO_FILES_MATCHED = 3608;
+exports.ER_IMP_SCHEMA_DOES_NOT_EXIST = 3609;
+exports.ER_IMP_TABLE_ALREADY_EXISTS = 3610;
+exports.ER_IMP_INCOMPATIBLE_MYSQLD_VERSION = 3611;
+exports.ER_IMP_INCOMPATIBLE_DD_VERSION = 3612;
+exports.ER_IMP_INCOMPATIBLE_SDI_VERSION = 3613;
+exports.ER_WARN_INVALID_HINT = 3614;
+exports.ER_VAR_DOES_NOT_EXIST = 3615;
+exports.ER_LONGITUDE_OUT_OF_RANGE = 3616;
+exports.ER_LATITUDE_OUT_OF_RANGE = 3617;
+exports.ER_NOT_IMPLEMENTED_FOR_GEOGRAPHIC_SRS = 3618;
+exports.ER_ILLEGAL_PRIVILEGE_LEVEL = 3619;
+exports.ER_NO_SYSTEM_VIEW_ACCESS = 3620;
+exports.ER_COMPONENT_FILTER_FLABBERGASTED = 3621;
+exports.ER_PART_EXPR_TOO_LONG = 3622;
+exports.ER_UDF_DROP_DYNAMICALLY_REGISTERED = 3623;
+exports.ER_UNABLE_TO_STORE_COLUMN_STATISTICS = 3624;
+exports.ER_UNABLE_TO_UPDATE_COLUMN_STATISTICS = 3625;
+exports.ER_UNABLE_TO_DROP_COLUMN_STATISTICS = 3626;
+exports.ER_UNABLE_TO_BUILD_HISTOGRAM = 3627;
+exports.ER_MANDATORY_ROLE = 3628;
+exports.ER_MISSING_TABLESPACE_FILE = 3629;
+exports.ER_PERSIST_ONLY_ACCESS_DENIED_ERROR = 3630;
+exports.ER_CMD_NEED_SUPER = 3631;
+exports.ER_PATH_IN_DATADIR = 3632;
+exports.ER_CLONE_DDL_IN_PROGRESS = 3633;
+exports.ER_CLONE_TOO_MANY_CONCURRENT_CLONES = 3634;
+exports.ER_APPLIER_LOG_EVENT_VALIDATION_ERROR = 3635;
+exports.ER_CTE_MAX_RECURSION_DEPTH = 3636;
+exports.ER_NOT_HINT_UPDATABLE_VARIABLE = 3637;
+exports.ER_CREDENTIALS_CONTRADICT_TO_HISTORY = 3638;
+exports.ER_WARNING_PASSWORD_HISTORY_CLAUSES_VOID = 3639;
+exports.ER_CLIENT_DOES_NOT_SUPPORT = 3640;
+exports.ER_I_S_SKIPPED_TABLESPACE = 3641;
+exports.ER_TABLESPACE_ENGINE_MISMATCH = 3642;
+exports.ER_WRONG_SRID_FOR_COLUMN = 3643;
+exports.ER_CANNOT_ALTER_SRID_DUE_TO_INDEX = 3644;
+exports.ER_WARN_BINLOG_PARTIAL_UPDATES_DISABLED = 3645;
+exports.ER_WARN_BINLOG_V1_ROW_EVENTS_DISABLED = 3646;
+exports.ER_WARN_BINLOG_PARTIAL_UPDATES_SUGGESTS_PARTIAL_IMAGES = 3647;
+exports.ER_COULD_NOT_APPLY_JSON_DIFF = 3648;
+exports.ER_CORRUPTED_JSON_DIFF = 3649;
+exports.ER_RESOURCE_GROUP_EXISTS = 3650;
+exports.ER_RESOURCE_GROUP_NOT_EXISTS = 3651;
+exports.ER_INVALID_VCPU_ID = 3652;
+exports.ER_INVALID_VCPU_RANGE = 3653;
+exports.ER_INVALID_THREAD_PRIORITY = 3654;
+exports.ER_DISALLOWED_OPERATION = 3655;
+exports.ER_RESOURCE_GROUP_BUSY = 3656;
+exports.ER_RESOURCE_GROUP_DISABLED = 3657;
+exports.ER_FEATURE_UNSUPPORTED = 3658;
+exports.ER_ATTRIBUTE_IGNORED = 3659;
+exports.ER_INVALID_THREAD_ID = 3660;
+exports.ER_RESOURCE_GROUP_BIND_FAILED = 3661;
+exports.ER_INVALID_USE_OF_FORCE_OPTION = 3662;
+exports.ER_GROUP_REPLICATION_COMMAND_FAILURE = 3663;
+exports.ER_SDI_OPERATION_FAILED = 3664;
+exports.ER_MISSING_JSON_TABLE_VALUE = 3665;
+exports.ER_WRONG_JSON_TABLE_VALUE = 3666;
+exports.ER_TF_MUST_HAVE_ALIAS = 3667;
+exports.ER_TF_FORBIDDEN_JOIN_TYPE = 3668;
+exports.ER_JT_VALUE_OUT_OF_RANGE = 3669;
+exports.ER_JT_MAX_NESTED_PATH = 3670;
+exports.ER_PASSWORD_EXPIRATION_NOT_SUPPORTED_BY_AUTH_METHOD = 3671;
+exports.ER_INVALID_GEOJSON_CRS_NOT_TOP_LEVEL = 3672;
+exports.ER_BAD_NULL_ERROR_NOT_IGNORED = 3673;
+exports.WARN_USELESS_SPATIAL_INDEX = 3674;
+exports.ER_DISK_FULL_NOWAIT = 3675;
+exports.ER_PARSE_ERROR_IN_DIGEST_FN = 3676;
+exports.ER_UNDISCLOSED_PARSE_ERROR_IN_DIGEST_FN = 3677;
+exports.ER_SCHEMA_DIR_EXISTS = 3678;
+exports.ER_SCHEMA_DIR_MISSING = 3679;
+exports.ER_SCHEMA_DIR_CREATE_FAILED = 3680;
+exports.ER_SCHEMA_DIR_UNKNOWN = 3681;
+exports.ER_ONLY_IMPLEMENTED_FOR_SRID_0_AND_4326 = 3682;
+exports.ER_BINLOG_EXPIRE_LOG_DAYS_AND_SECS_USED_TOGETHER = 3683;
+exports.ER_REGEXP_BUFFER_OVERFLOW = 3684;
+exports.ER_REGEXP_ILLEGAL_ARGUMENT = 3685;
+exports.ER_REGEXP_INDEX_OUTOFBOUNDS_ERROR = 3686;
+exports.ER_REGEXP_INTERNAL_ERROR = 3687;
+exports.ER_REGEXP_RULE_SYNTAX = 3688;
+exports.ER_REGEXP_BAD_ESCAPE_SEQUENCE = 3689;
+exports.ER_REGEXP_UNIMPLEMENTED = 3690;
+exports.ER_REGEXP_MISMATCHED_PAREN = 3691;
+exports.ER_REGEXP_BAD_INTERVAL = 3692;
+exports.ER_REGEXP_MAX_LT_MIN = 3693;
+exports.ER_REGEXP_INVALID_BACK_REF = 3694;
+exports.ER_REGEXP_LOOK_BEHIND_LIMIT = 3695;
+exports.ER_REGEXP_MISSING_CLOSE_BRACKET = 3696;
+exports.ER_REGEXP_INVALID_RANGE = 3697;
+exports.ER_REGEXP_STACK_OVERFLOW = 3698;
+exports.ER_REGEXP_TIME_OUT = 3699;
+exports.ER_REGEXP_PATTERN_TOO_BIG = 3700;
+exports.ER_CANT_SET_ERROR_LOG_SERVICE = 3701;
+exports.ER_EMPTY_PIPELINE_FOR_ERROR_LOG_SERVICE = 3702;
+exports.ER_COMPONENT_FILTER_DIAGNOSTICS = 3703;
+exports.ER_NOT_IMPLEMENTED_FOR_CARTESIAN_SRS = 3704;
+exports.ER_NOT_IMPLEMENTED_FOR_PROJECTED_SRS = 3705;
+exports.ER_NONPOSITIVE_RADIUS = 3706;
+exports.ER_RESTART_SERVER_FAILED = 3707;
+exports.ER_SRS_MISSING_MANDATORY_ATTRIBUTE = 3708;
+exports.ER_SRS_MULTIPLE_ATTRIBUTE_DEFINITIONS = 3709;
+exports.ER_SRS_NAME_CANT_BE_EMPTY_OR_WHITESPACE = 3710;
+exports.ER_SRS_ORGANIZATION_CANT_BE_EMPTY_OR_WHITESPACE = 3711;
+exports.ER_SRS_ID_ALREADY_EXISTS = 3712;
+exports.ER_WARN_SRS_ID_ALREADY_EXISTS = 3713;
+exports.ER_CANT_MODIFY_SRID_0 = 3714;
+exports.ER_WARN_RESERVED_SRID_RANGE = 3715;
+exports.ER_CANT_MODIFY_SRS_USED_BY_COLUMN = 3716;
+exports.ER_SRS_INVALID_CHARACTER_IN_ATTRIBUTE = 3717;
+exports.ER_SRS_ATTRIBUTE_STRING_TOO_LONG = 3718;
+exports.ER_DEPRECATED_UTF8_ALIAS = 3719;
+exports.ER_DEPRECATED_NATIONAL = 3720;
+exports.ER_INVALID_DEFAULT_UTF8MB4_COLLATION = 3721;
+exports.ER_UNABLE_TO_COLLECT_LOG_STATUS = 3722;
+exports.ER_RESERVED_TABLESPACE_NAME = 3723;
+exports.ER_UNABLE_TO_SET_OPTION = 3724;
+exports.ER_REPLICA_POSSIBLY_DIVERGED_AFTER_DDL = 3725;
+exports.ER_SRS_NOT_GEOGRAPHIC = 3726;
+exports.ER_POLYGON_TOO_LARGE = 3727;
+exports.ER_SPATIAL_UNIQUE_INDEX = 3728;
+exports.ER_INDEX_TYPE_NOT_SUPPORTED_FOR_SPATIAL_INDEX = 3729;
+exports.ER_FK_CANNOT_DROP_PARENT = 3730;
+exports.ER_GEOMETRY_PARAM_LONGITUDE_OUT_OF_RANGE = 3731;
+exports.ER_GEOMETRY_PARAM_LATITUDE_OUT_OF_RANGE = 3732;
+exports.ER_FK_CANNOT_USE_VIRTUAL_COLUMN = 3733;
+exports.ER_FK_NO_COLUMN_PARENT = 3734;
+exports.ER_CANT_SET_ERROR_SUPPRESSION_LIST = 3735;
+exports.ER_SRS_GEOGCS_INVALID_AXES = 3736;
+exports.ER_SRS_INVALID_SEMI_MAJOR_AXIS = 3737;
+exports.ER_SRS_INVALID_INVERSE_FLATTENING = 3738;
+exports.ER_SRS_INVALID_ANGULAR_UNIT = 3739;
+exports.ER_SRS_INVALID_PRIME_MERIDIAN = 3740;
+exports.ER_TRANSFORM_SOURCE_SRS_NOT_SUPPORTED = 3741;
+exports.ER_TRANSFORM_TARGET_SRS_NOT_SUPPORTED = 3742;
+exports.ER_TRANSFORM_SOURCE_SRS_MISSING_TOWGS84 = 3743;
+exports.ER_TRANSFORM_TARGET_SRS_MISSING_TOWGS84 = 3744;
+exports.ER_TEMP_TABLE_PREVENTS_SWITCH_SESSION_BINLOG_FORMAT = 3745;
+exports.ER_TEMP_TABLE_PREVENTS_SWITCH_GLOBAL_BINLOG_FORMAT = 3746;
+exports.ER_RUNNING_APPLIER_PREVENTS_SWITCH_GLOBAL_BINLOG_FORMAT = 3747;
+exports.ER_CLIENT_GTID_UNSAFE_CREATE_DROP_TEMP_TABLE_IN_TRX_IN_SBR = 3748;
+exports.ER_XA_CANT_CREATE_MDL_BACKUP = 3749;
+exports.ER_TABLE_WITHOUT_PK = 3750;
+exports.ER_WARN_DATA_TRUNCATED_FUNCTIONAL_INDEX = 3751;
+exports.ER_WARN_DATA_OUT_OF_RANGE_FUNCTIONAL_INDEX = 3752;
+exports.ER_FUNCTIONAL_INDEX_ON_JSON_OR_GEOMETRY_FUNCTION = 3753;
+exports.ER_FUNCTIONAL_INDEX_REF_AUTO_INCREMENT = 3754;
+exports.ER_CANNOT_DROP_COLUMN_FUNCTIONAL_INDEX = 3755;
+exports.ER_FUNCTIONAL_INDEX_PRIMARY_KEY = 3756;
+exports.ER_FUNCTIONAL_INDEX_ON_LOB = 3757;
+exports.ER_FUNCTIONAL_INDEX_FUNCTION_IS_NOT_ALLOWED = 3758;
+exports.ER_FULLTEXT_FUNCTIONAL_INDEX = 3759;
+exports.ER_SPATIAL_FUNCTIONAL_INDEX = 3760;
+exports.ER_WRONG_KEY_COLUMN_FUNCTIONAL_INDEX = 3761;
+exports.ER_FUNCTIONAL_INDEX_ON_FIELD = 3762;
+exports.ER_GENERATED_COLUMN_NAMED_FUNCTION_IS_NOT_ALLOWED = 3763;
+exports.ER_GENERATED_COLUMN_ROW_VALUE = 3764;
+exports.ER_GENERATED_COLUMN_VARIABLES = 3765;
+exports.ER_DEPENDENT_BY_DEFAULT_GENERATED_VALUE = 3766;
+exports.ER_DEFAULT_VAL_GENERATED_NON_PRIOR = 3767;
+exports.ER_DEFAULT_VAL_GENERATED_REF_AUTO_INC = 3768;
+exports.ER_DEFAULT_VAL_GENERATED_FUNCTION_IS_NOT_ALLOWED = 3769;
+exports.ER_DEFAULT_VAL_GENERATED_NAMED_FUNCTION_IS_NOT_ALLOWED = 3770;
+exports.ER_DEFAULT_VAL_GENERATED_ROW_VALUE = 3771;
+exports.ER_DEFAULT_VAL_GENERATED_VARIABLES = 3772;
+exports.ER_DEFAULT_AS_VAL_GENERATED = 3773;
+exports.ER_UNSUPPORTED_ACTION_ON_DEFAULT_VAL_GENERATED = 3774;
+exports.ER_GTID_UNSAFE_ALTER_ADD_COL_WITH_DEFAULT_EXPRESSION = 3775;
+exports.ER_FK_CANNOT_CHANGE_ENGINE = 3776;
+exports.ER_WARN_DEPRECATED_USER_SET_EXPR = 3777;
+exports.ER_WARN_DEPRECATED_UTF8MB3_COLLATION = 3778;
+exports.ER_WARN_DEPRECATED_NESTED_COMMENT_SYNTAX = 3779;
+exports.ER_FK_INCOMPATIBLE_COLUMNS = 3780;
+exports.ER_GR_HOLD_WAIT_TIMEOUT = 3781;
+exports.ER_GR_HOLD_KILLED = 3782;
+exports.ER_GR_HOLD_MEMBER_STATUS_ERROR = 3783;
+exports.ER_RPL_ENCRYPTION_FAILED_TO_FETCH_KEY = 3784;
+exports.ER_RPL_ENCRYPTION_KEY_NOT_FOUND = 3785;
+exports.ER_RPL_ENCRYPTION_KEYRING_INVALID_KEY = 3786;
+exports.ER_RPL_ENCRYPTION_HEADER_ERROR = 3787;
+exports.ER_RPL_ENCRYPTION_FAILED_TO_ROTATE_LOGS = 3788;
+exports.ER_RPL_ENCRYPTION_KEY_EXISTS_UNEXPECTED = 3789;
+exports.ER_RPL_ENCRYPTION_FAILED_TO_GENERATE_KEY = 3790;
+exports.ER_RPL_ENCRYPTION_FAILED_TO_STORE_KEY = 3791;
+exports.ER_RPL_ENCRYPTION_FAILED_TO_REMOVE_KEY = 3792;
+exports.ER_RPL_ENCRYPTION_UNABLE_TO_CHANGE_OPTION = 3793;
+exports.ER_RPL_ENCRYPTION_MASTER_KEY_RECOVERY_FAILED = 3794;
+exports.ER_SLOW_LOG_MODE_IGNORED_WHEN_NOT_LOGGING_TO_FILE = 3795;
+exports.ER_GRP_TRX_CONSISTENCY_NOT_ALLOWED = 3796;
+exports.ER_GRP_TRX_CONSISTENCY_BEFORE = 3797;
+exports.ER_GRP_TRX_CONSISTENCY_AFTER_ON_TRX_BEGIN = 3798;
+exports.ER_GRP_TRX_CONSISTENCY_BEGIN_NOT_ALLOWED = 3799;
+exports.ER_FUNCTIONAL_INDEX_ROW_VALUE_IS_NOT_ALLOWED = 3800;
+exports.ER_RPL_ENCRYPTION_FAILED_TO_ENCRYPT = 3801;
+exports.ER_PAGE_TRACKING_NOT_STARTED = 3802;
+exports.ER_PAGE_TRACKING_RANGE_NOT_TRACKED = 3803;
+exports.ER_PAGE_TRACKING_CANNOT_PURGE = 3804;
+exports.ER_RPL_ENCRYPTION_CANNOT_ROTATE_BINLOG_MASTER_KEY = 3805;
+exports.ER_BINLOG_MASTER_KEY_RECOVERY_OUT_OF_COMBINATION = 3806;
+exports.ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_OPERATE_KEY = 3807;
+exports.ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_ROTATE_LOGS = 3808;
+exports.ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_REENCRYPT_LOG = 3809;
+exports.ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_CLEANUP_UNUSED_KEYS = 3810;
+exports.ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_CLEANUP_AUX_KEY = 3811;
+exports.ER_NON_BOOLEAN_EXPR_FOR_CHECK_CONSTRAINT = 3812;
+exports.ER_COLUMN_CHECK_CONSTRAINT_REFERENCES_OTHER_COLUMN = 3813;
+exports.ER_CHECK_CONSTRAINT_NAMED_FUNCTION_IS_NOT_ALLOWED = 3814;
+exports.ER_CHECK_CONSTRAINT_FUNCTION_IS_NOT_ALLOWED = 3815;
+exports.ER_CHECK_CONSTRAINT_VARIABLES = 3816;
+exports.ER_CHECK_CONSTRAINT_ROW_VALUE = 3817;
+exports.ER_CHECK_CONSTRAINT_REFERS_AUTO_INCREMENT_COLUMN = 3818;
+exports.ER_CHECK_CONSTRAINT_VIOLATED = 3819;
+exports.ER_CHECK_CONSTRAINT_REFERS_UNKNOWN_COLUMN = 3820;
+exports.ER_CHECK_CONSTRAINT_NOT_FOUND = 3821;
+exports.ER_CHECK_CONSTRAINT_DUP_NAME = 3822;
+exports.ER_CHECK_CONSTRAINT_CLAUSE_USING_FK_REFER_ACTION_COLUMN = 3823;
+exports.WARN_UNENCRYPTED_TABLE_IN_ENCRYPTED_DB = 3824;
+exports.ER_INVALID_ENCRYPTION_REQUEST = 3825;
+exports.ER_CANNOT_SET_TABLE_ENCRYPTION = 3826;
+exports.ER_CANNOT_SET_DATABASE_ENCRYPTION = 3827;
+exports.ER_CANNOT_SET_TABLESPACE_ENCRYPTION = 3828;
+exports.ER_TABLESPACE_CANNOT_BE_ENCRYPTED = 3829;
+exports.ER_TABLESPACE_CANNOT_BE_DECRYPTED = 3830;
+exports.ER_TABLESPACE_TYPE_UNKNOWN = 3831;
+exports.ER_TARGET_TABLESPACE_UNENCRYPTED = 3832;
+exports.ER_CANNOT_USE_ENCRYPTION_CLAUSE = 3833;
+exports.ER_INVALID_MULTIPLE_CLAUSES = 3834;
+exports.ER_UNSUPPORTED_USE_OF_GRANT_AS = 3835;
+exports.ER_UKNOWN_AUTH_ID_OR_ACCESS_DENIED_FOR_GRANT_AS = 3836;
+exports.ER_DEPENDENT_BY_FUNCTIONAL_INDEX = 3837;
+exports.ER_PLUGIN_NOT_EARLY = 3838;
+exports.ER_INNODB_REDO_LOG_ARCHIVE_START_SUBDIR_PATH = 3839;
+exports.ER_INNODB_REDO_LOG_ARCHIVE_START_TIMEOUT = 3840;
+exports.ER_INNODB_REDO_LOG_ARCHIVE_DIRS_INVALID = 3841;
+exports.ER_INNODB_REDO_LOG_ARCHIVE_LABEL_NOT_FOUND = 3842;
+exports.ER_INNODB_REDO_LOG_ARCHIVE_DIR_EMPTY = 3843;
+exports.ER_INNODB_REDO_LOG_ARCHIVE_NO_SUCH_DIR = 3844;
+exports.ER_INNODB_REDO_LOG_ARCHIVE_DIR_CLASH = 3845;
+exports.ER_INNODB_REDO_LOG_ARCHIVE_DIR_PERMISSIONS = 3846;
+exports.ER_INNODB_REDO_LOG_ARCHIVE_FILE_CREATE = 3847;
+exports.ER_INNODB_REDO_LOG_ARCHIVE_ACTIVE = 3848;
+exports.ER_INNODB_REDO_LOG_ARCHIVE_INACTIVE = 3849;
+exports.ER_INNODB_REDO_LOG_ARCHIVE_FAILED = 3850;
+exports.ER_INNODB_REDO_LOG_ARCHIVE_SESSION = 3851;
+exports.ER_STD_REGEX_ERROR = 3852;
+exports.ER_INVALID_JSON_TYPE = 3853;
+exports.ER_CANNOT_CONVERT_STRING = 3854;
+exports.ER_DEPENDENT_BY_PARTITION_FUNC = 3855;
+exports.ER_WARN_DEPRECATED_FLOAT_AUTO_INCREMENT = 3856;
+exports.ER_RPL_CANT_STOP_REPLICA_WHILE_LOCKED_BACKUP = 3857;
+exports.ER_WARN_DEPRECATED_FLOAT_DIGITS = 3858;
+exports.ER_WARN_DEPRECATED_FLOAT_UNSIGNED = 3859;
+exports.ER_WARN_DEPRECATED_INTEGER_DISPLAY_WIDTH = 3860;
+exports.ER_WARN_DEPRECATED_ZEROFILL = 3861;
+exports.ER_CLONE_DONOR = 3862;
+exports.ER_CLONE_PROTOCOL = 3863;
+exports.ER_CLONE_DONOR_VERSION = 3864;
+exports.ER_CLONE_OS = 3865;
+exports.ER_CLONE_PLATFORM = 3866;
+exports.ER_CLONE_CHARSET = 3867;
+exports.ER_CLONE_CONFIG = 3868;
+exports.ER_CLONE_SYS_CONFIG = 3869;
+exports.ER_CLONE_PLUGIN_MATCH = 3870;
+exports.ER_CLONE_LOOPBACK = 3871;
+exports.ER_CLONE_ENCRYPTION = 3872;
+exports.ER_CLONE_DISK_SPACE = 3873;
+exports.ER_CLONE_IN_PROGRESS = 3874;
+exports.ER_CLONE_DISALLOWED = 3875;
+exports.ER_CANNOT_GRANT_ROLES_TO_ANONYMOUS_USER = 3876;
+exports.ER_SECONDARY_ENGINE_PLUGIN = 3877;
+exports.ER_SECOND_PASSWORD_CANNOT_BE_EMPTY = 3878;
+exports.ER_DB_ACCESS_DENIED = 3879;
+exports.ER_DA_AUTH_ID_WITH_SYSTEM_USER_PRIV_IN_MANDATORY_ROLES = 3880;
+exports.ER_DA_RPL_GTID_TABLE_CANNOT_OPEN = 3881;
+exports.ER_GEOMETRY_IN_UNKNOWN_LENGTH_UNIT = 3882;
+exports.ER_DA_PLUGIN_INSTALL_ERROR = 3883;
+exports.ER_NO_SESSION_TEMP = 3884;
+exports.ER_DA_UNKNOWN_ERROR_NUMBER = 3885;
+exports.ER_COLUMN_CHANGE_SIZE = 3886;
+exports.ER_REGEXP_INVALID_CAPTURE_GROUP_NAME = 3887;
+exports.ER_DA_SSL_LIBRARY_ERROR = 3888;
+exports.ER_SECONDARY_ENGINE = 3889;
+exports.ER_SECONDARY_ENGINE_DDL = 3890;
+exports.ER_INCORRECT_CURRENT_PASSWORD = 3891;
+exports.ER_MISSING_CURRENT_PASSWORD = 3892;
+exports.ER_CURRENT_PASSWORD_NOT_REQUIRED = 3893;
+exports.ER_PASSWORD_CANNOT_BE_RETAINED_ON_PLUGIN_CHANGE = 3894;
+exports.ER_CURRENT_PASSWORD_CANNOT_BE_RETAINED = 3895;
+exports.ER_PARTIAL_REVOKES_EXIST = 3896;
+exports.ER_CANNOT_GRANT_SYSTEM_PRIV_TO_MANDATORY_ROLE = 3897;
+exports.ER_XA_REPLICATION_FILTERS = 3898;
+exports.ER_UNSUPPORTED_SQL_MODE = 3899;
+exports.ER_REGEXP_INVALID_FLAG = 3900;
+exports.ER_PARTIAL_REVOKE_AND_DB_GRANT_BOTH_EXISTS = 3901;
+exports.ER_UNIT_NOT_FOUND = 3902;
+exports.ER_INVALID_JSON_VALUE_FOR_FUNC_INDEX = 3903;
+exports.ER_JSON_VALUE_OUT_OF_RANGE_FOR_FUNC_INDEX = 3904;
+exports.ER_EXCEEDED_MV_KEYS_NUM = 3905;
+exports.ER_EXCEEDED_MV_KEYS_SPACE = 3906;
+exports.ER_FUNCTIONAL_INDEX_DATA_IS_TOO_LONG = 3907;
+exports.ER_WRONG_MVI_VALUE = 3908;
+exports.ER_WARN_FUNC_INDEX_NOT_APPLICABLE = 3909;
+exports.ER_GRP_RPL_UDF_ERROR = 3910;
+exports.ER_UPDATE_GTID_PURGED_WITH_GR = 3911;
+exports.ER_GROUPING_ON_TIMESTAMP_IN_DST = 3912;
+exports.ER_TABLE_NAME_CAUSES_TOO_LONG_PATH = 3913;
+exports.ER_AUDIT_LOG_INSUFFICIENT_PRIVILEGE = 3914;
+exports.ER_AUDIT_LOG_PASSWORD_HAS_BEEN_COPIED = 3915;
+exports.ER_DA_GRP_RPL_STARTED_AUTO_REJOIN = 3916;
+exports.ER_SYSVAR_CHANGE_DURING_QUERY = 3917;
+exports.ER_GLOBSTAT_CHANGE_DURING_QUERY = 3918;
+exports.ER_GRP_RPL_MESSAGE_SERVICE_INIT_FAILURE = 3919;
+exports.ER_CHANGE_SOURCE_WRONG_COMPRESSION_ALGORITHM_CLIENT = 3920;
+exports.ER_CHANGE_SOURCE_WRONG_COMPRESSION_LEVEL_CLIENT = 3921;
+exports.ER_WRONG_COMPRESSION_ALGORITHM_CLIENT = 3922;
+exports.ER_WRONG_COMPRESSION_LEVEL_CLIENT = 3923;
+exports.ER_CHANGE_SOURCE_WRONG_COMPRESSION_ALGORITHM_LIST_CLIENT = 3924;
+exports.ER_CLIENT_PRIVILEGE_CHECKS_USER_CANNOT_BE_ANONYMOUS = 3925;
+exports.ER_CLIENT_PRIVILEGE_CHECKS_USER_DOES_NOT_EXIST = 3926;
+exports.ER_CLIENT_PRIVILEGE_CHECKS_USER_CORRUPT = 3927;
+exports.ER_CLIENT_PRIVILEGE_CHECKS_USER_NEEDS_RPL_APPLIER_PRIV = 3928;
+exports.ER_WARN_DA_PRIVILEGE_NOT_REGISTERED = 3929;
+exports.ER_CLIENT_KEYRING_UDF_KEY_INVALID = 3930;
+exports.ER_CLIENT_KEYRING_UDF_KEY_TYPE_INVALID = 3931;
+exports.ER_CLIENT_KEYRING_UDF_KEY_TOO_LONG = 3932;
+exports.ER_CLIENT_KEYRING_UDF_KEY_TYPE_TOO_LONG = 3933;
+exports.ER_JSON_SCHEMA_VALIDATION_ERROR_WITH_DETAILED_REPORT = 3934;
+exports.ER_DA_UDF_INVALID_CHARSET_SPECIFIED = 3935;
+exports.ER_DA_UDF_INVALID_CHARSET = 3936;
+exports.ER_DA_UDF_INVALID_COLLATION = 3937;
+exports.ER_DA_UDF_INVALID_EXTENSION_ARGUMENT_TYPE = 3938;
+exports.ER_MULTIPLE_CONSTRAINTS_WITH_SAME_NAME = 3939;
+exports.ER_CONSTRAINT_NOT_FOUND = 3940;
+exports.ER_ALTER_CONSTRAINT_ENFORCEMENT_NOT_SUPPORTED = 3941;
+exports.ER_TABLE_VALUE_CONSTRUCTOR_MUST_HAVE_COLUMNS = 3942;
+exports.ER_TABLE_VALUE_CONSTRUCTOR_CANNOT_HAVE_DEFAULT = 3943;
+exports.ER_CLIENT_QUERY_FAILURE_INVALID_NON_ROW_FORMAT = 3944;
+exports.ER_REQUIRE_ROW_FORMAT_INVALID_VALUE = 3945;
+exports.ER_FAILED_TO_DETERMINE_IF_ROLE_IS_MANDATORY = 3946;
+exports.ER_FAILED_TO_FETCH_MANDATORY_ROLE_LIST = 3947;
+exports.ER_CLIENT_LOCAL_FILES_DISABLED = 3948;
+exports.ER_IMP_INCOMPATIBLE_CFG_VERSION = 3949;
+exports.ER_DA_OOM = 3950;
+exports.ER_DA_UDF_INVALID_ARGUMENT_TO_SET_CHARSET = 3951;
+exports.ER_DA_UDF_INVALID_RETURN_TYPE_TO_SET_CHARSET = 3952;
+exports.ER_MULTIPLE_INTO_CLAUSES = 3953;
+exports.ER_MISPLACED_INTO = 3954;
+exports.ER_USER_ACCESS_DENIED_FOR_USER_ACCOUNT_BLOCKED_BY_PASSWORD_LOCK = 3955;
+exports.ER_WARN_DEPRECATED_YEAR_UNSIGNED = 3956;
+exports.ER_CLONE_NETWORK_PACKET = 3957;
+exports.ER_SDI_OPERATION_FAILED_MISSING_RECORD = 3958;
+exports.ER_DEPENDENT_BY_CHECK_CONSTRAINT = 3959;
+exports.ER_GRP_OPERATION_NOT_ALLOWED_GR_MUST_STOP = 3960;
+exports.ER_WARN_DEPRECATED_JSON_TABLE_ON_ERROR_ON_EMPTY = 3961;
+exports.ER_WARN_DEPRECATED_INNER_INTO = 3962;
+exports.ER_WARN_DEPRECATED_VALUES_FUNCTION_ALWAYS_NULL = 3963;
+exports.ER_WARN_DEPRECATED_SQL_CALC_FOUND_ROWS = 3964;
+exports.ER_WARN_DEPRECATED_FOUND_ROWS = 3965;
+exports.ER_MISSING_JSON_VALUE = 3966;
+exports.ER_MULTIPLE_JSON_VALUES = 3967;
+exports.ER_HOSTNAME_TOO_LONG = 3968;
+exports.ER_WARN_CLIENT_DEPRECATED_PARTITION_PREFIX_KEY = 3969;
+exports.ER_GROUP_REPLICATION_USER_EMPTY_MSG = 3970;
+exports.ER_GROUP_REPLICATION_USER_MANDATORY_MSG = 3971;
+exports.ER_GROUP_REPLICATION_PASSWORD_LENGTH = 3972;
+exports.ER_SUBQUERY_TRANSFORM_REJECTED = 3973;
+exports.ER_DA_GRP_RPL_RECOVERY_ENDPOINT_FORMAT = 3974;
+exports.ER_DA_GRP_RPL_RECOVERY_ENDPOINT_INVALID = 3975;
+exports.ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART = 3976;
+exports.ER_STATEMENT_NOT_ALLOWED_AFTER_START_TRANSACTION = 3977;
+exports.ER_FOREIGN_KEY_WITH_ATOMIC_CREATE_SELECT = 3978;
+exports.ER_NOT_ALLOWED_WITH_START_TRANSACTION = 3979;
+exports.ER_INVALID_JSON_ATTRIBUTE = 3980;
+exports.ER_ENGINE_ATTRIBUTE_NOT_SUPPORTED = 3981;
+exports.ER_INVALID_USER_ATTRIBUTE_JSON = 3982;
+exports.ER_INNODB_REDO_DISABLED = 3983;
+exports.ER_INNODB_REDO_ARCHIVING_ENABLED = 3984;
+exports.ER_MDL_OUT_OF_RESOURCES = 3985;
+exports.ER_IMPLICIT_COMPARISON_FOR_JSON = 3986;
+exports.ER_FUNCTION_DOES_NOT_SUPPORT_CHARACTER_SET = 3987;
+exports.ER_IMPOSSIBLE_STRING_CONVERSION = 3988;
+exports.ER_SCHEMA_READ_ONLY = 3989;
+exports.ER_RPL_ASYNC_RECONNECT_GTID_MODE_OFF = 3990;
+exports.ER_RPL_ASYNC_RECONNECT_AUTO_POSITION_OFF = 3991;
+exports.ER_DISABLE_GTID_MODE_REQUIRES_ASYNC_RECONNECT_OFF = 3992;
+exports.ER_DISABLE_AUTO_POSITION_REQUIRES_ASYNC_RECONNECT_OFF = 3993;
+exports.ER_INVALID_PARAMETER_USE = 3994;
+exports.ER_CHARACTER_SET_MISMATCH = 3995;
+exports.ER_WARN_VAR_VALUE_CHANGE_NOT_SUPPORTED = 3996;
+exports.ER_INVALID_TIME_ZONE_INTERVAL = 3997;
+exports.ER_INVALID_CAST = 3998;
+exports.ER_HYPERGRAPH_NOT_SUPPORTED_YET = 3999;
+exports.ER_WARN_HYPERGRAPH_EXPERIMENTAL = 4000;
+exports.ER_DA_NO_ERROR_LOG_PARSER_CONFIGURED = 4001;
+exports.ER_DA_ERROR_LOG_TABLE_DISABLED = 4002;
+exports.ER_DA_ERROR_LOG_MULTIPLE_FILTERS = 4003;
+exports.ER_DA_CANT_OPEN_ERROR_LOG = 4004;
+exports.ER_USER_REFERENCED_AS_DEFINER = 4005;
+exports.ER_CANNOT_USER_REFERENCED_AS_DEFINER = 4006;
+exports.ER_REGEX_NUMBER_TOO_BIG = 4007;
+exports.ER_SPVAR_NONINTEGER_TYPE = 4008;
+exports.WARN_UNSUPPORTED_ACL_TABLES_READ = 4009;
+exports.ER_BINLOG_UNSAFE_ACL_TABLE_READ_IN_DML_DDL = 4010;
+exports.ER_STOP_REPLICA_MONITOR_IO_THREAD_TIMEOUT = 4011;
+exports.ER_STARTING_REPLICA_MONITOR_IO_THREAD = 4012;
+exports.ER_CANT_USE_ANONYMOUS_TO_GTID_WITH_GTID_MODE_NOT_ON = 4013;
+exports.ER_CANT_COMBINE_ANONYMOUS_TO_GTID_AND_AUTOPOSITION = 4014;
+exports.ER_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_REQUIRES_GTID_MODE_ON = 4015;
+exports.ER_SQL_REPLICA_SKIP_COUNTER_USED_WITH_GTID_MODE_ON = 4016;
+exports.ER_USING_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_AS_LOCAL_OR_UUID = 4017;
+exports.ER_CANT_SET_ANONYMOUS_TO_GTID_AND_WAIT_UNTIL_SQL_THD_AFTER_GTIDS = 4018;
+exports.ER_CANT_SET_SQL_AFTER_OR_BEFORE_GTIDS_WITH_ANONYMOUS_TO_GTID = 4019;
+exports.ER_ANONYMOUS_TO_GTID_UUID_SAME_AS_GROUP_NAME = 4020;
+exports.ER_CANT_USE_SAME_UUID_AS_GROUP_NAME = 4021;
+exports.ER_GRP_RPL_RECOVERY_CHANNEL_STILL_RUNNING = 4022;
+exports.ER_INNODB_INVALID_AUTOEXTEND_SIZE_VALUE = 4023;
+exports.ER_INNODB_INCOMPATIBLE_WITH_TABLESPACE = 4024;
+exports.ER_INNODB_AUTOEXTEND_SIZE_OUT_OF_RANGE = 4025;
+exports.ER_CANNOT_USE_AUTOEXTEND_SIZE_CLAUSE = 4026;
+exports.ER_ROLE_GRANTED_TO_ITSELF = 4027;
+exports.ER_TABLE_MUST_HAVE_A_VISIBLE_COLUMN = 4028;
+exports.ER_INNODB_COMPRESSION_FAILURE = 4029;
+exports.ER_WARN_ASYNC_CONN_FAILOVER_NETWORK_NAMESPACE = 4030;
+exports.ER_CLIENT_INTERACTION_TIMEOUT = 4031;
+exports.ER_INVALID_CAST_TO_GEOMETRY = 4032;
+exports.ER_INVALID_CAST_POLYGON_RING_DIRECTION = 4033;
+exports.ER_GIS_DIFFERENT_SRIDS_AGGREGATION = 4034;
+exports.ER_RELOAD_KEYRING_FAILURE = 4035;
+exports.ER_SDI_GET_KEYS_INVALID_TABLESPACE = 4036;
+exports.ER_CHANGE_RPL_SRC_WRONG_COMPRESSION_ALGORITHM_SIZE = 4037;
+exports.ER_WARN_DEPRECATED_TLS_VERSION_FOR_CHANNEL_CLI = 4038;
+exports.ER_CANT_USE_SAME_UUID_AS_VIEW_CHANGE_UUID = 4039;
+exports.ER_ANONYMOUS_TO_GTID_UUID_SAME_AS_VIEW_CHANGE_UUID = 4040;
+exports.ER_GRP_RPL_VIEW_CHANGE_UUID_FAIL_GET_VARIABLE = 4041;
+exports.ER_WARN_ADUIT_LOG_MAX_SIZE_AND_PRUNE_SECONDS = 4042;
+exports.ER_WARN_ADUIT_LOG_MAX_SIZE_CLOSE_TO_ROTATE_ON_SIZE = 4043;
+exports.ER_KERBEROS_CREATE_USER = 4044;
+exports.ER_INSTALL_PLUGIN_CONFLICT_CLIENT = 4045;
+exports.ER_DA_ERROR_LOG_COMPONENT_FLUSH_FAILED = 4046;
+exports.ER_WARN_SQL_AFTER_MTS_GAPS_GAP_NOT_CALCULATED = 4047;
+exports.ER_INVALID_ASSIGNMENT_TARGET = 4048;
+exports.ER_OPERATION_NOT_ALLOWED_ON_GR_SECONDARY = 4049;
+exports.ER_GRP_RPL_FAILOVER_CHANNEL_STATUS_PROPAGATION = 4050;
+exports.ER_WARN_AUDIT_LOG_FORMAT_UNIX_TIMESTAMP_ONLY_WHEN_JSON = 4051;
+exports.ER_INVALID_MFA_PLUGIN_SPECIFIED = 4052;
+exports.ER_IDENTIFIED_BY_UNSUPPORTED = 4053;
+exports.ER_INVALID_PLUGIN_FOR_REGISTRATION = 4054;
+exports.ER_PLUGIN_REQUIRES_REGISTRATION = 4055;
+exports.ER_MFA_METHOD_EXISTS = 4056;
+exports.ER_MFA_METHOD_NOT_EXISTS = 4057;
+exports.ER_AUTHENTICATION_POLICY_MISMATCH = 4058;
+exports.ER_PLUGIN_REGISTRATION_DONE = 4059;
+exports.ER_INVALID_USER_FOR_REGISTRATION = 4060;
+exports.ER_USER_REGISTRATION_FAILED = 4061;
+exports.ER_MFA_METHODS_INVALID_ORDER = 4062;
+exports.ER_MFA_METHODS_IDENTICAL = 4063;
+exports.ER_INVALID_MFA_OPERATIONS_FOR_PASSWORDLESS_USER = 4064;
+exports.ER_CHANGE_REPLICATION_SOURCE_NO_OPTIONS_FOR_GTID_ONLY = 4065;
+exports.ER_CHANGE_REP_SOURCE_CANT_DISABLE_REQ_ROW_FORMAT_WITH_GTID_ONLY = 4066;
+exports.ER_CHANGE_REP_SOURCE_CANT_DISABLE_AUTO_POSITION_WITH_GTID_ONLY = 4067;
+exports.ER_CHANGE_REP_SOURCE_CANT_DISABLE_GTID_ONLY_WITHOUT_POSITIONS = 4068;
+exports.ER_CHANGE_REP_SOURCE_CANT_DISABLE_AUTO_POS_WITHOUT_POSITIONS = 4069;
+exports.ER_CHANGE_REP_SOURCE_GR_CHANNEL_WITH_GTID_MODE_NOT_ON = 4070;
+exports.ER_CANT_USE_GTID_ONLY_WITH_GTID_MODE_NOT_ON = 4071;
+exports.ER_WARN_C_DISABLE_GTID_ONLY_WITH_SOURCE_AUTO_POS_INVALID_POS = 4072;
+exports.ER_DA_SSL_FIPS_MODE_ERROR = 4073;
+exports.ER_VALUE_OUT_OF_RANGE = 4074;
+exports.ER_FULLTEXT_WITH_ROLLUP = 4075;
+exports.ER_REGEXP_MISSING_RESOURCE = 4076;
+exports.ER_WARN_REGEXP_USING_DEFAULT = 4077;
+exports.ER_REGEXP_MISSING_FILE = 4078;
+exports.ER_WARN_DEPRECATED_COLLATION = 4079;
+exports.ER_CONCURRENT_PROCEDURE_USAGE = 4080;
+exports.ER_DA_GLOBAL_CONN_LIMIT = 4081;
+exports.ER_DA_CONN_LIMIT = 4082;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE_INSTANT = 4083;
+exports.ER_WARN_SF_UDF_NAME_COLLISION = 4084;
+exports.ER_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK = 4085;
+exports.ER_TOO_MANY_WINDOWS = 4086;
+exports.ER_MYSQLBACKUP_CLIENT_MSG = 4087;
+exports.ER_COMMENT_CONTAINS_INVALID_STRING = 4088;
+exports.ER_DEFINITION_CONTAINS_INVALID_STRING = 4089;
+exports.ER_CANT_EXECUTE_COMMAND_WITH_ASSIGNED_GTID_NEXT = 4090;
+exports.ER_XA_TEMP_TABLE = 4091;
+exports.ER_INNODB_MAX_ROW_VERSION = 4092;
+exports.ER_INNODB_INSTANT_ADD_NOT_SUPPORTED_MAX_SIZE = 4093;
+exports.ER_OPERATION_NOT_ALLOWED_WHILE_PRIMARY_CHANGE_IS_RUNNING = 4094;
+exports.ER_WARN_DEPRECATED_DATETIME_DELIMITER = 4095;
+exports.ER_WARN_DEPRECATED_SUPERFLUOUS_DELIMITER = 4096;
+exports.ER_CANNOT_PERSIST_SENSITIVE_VARIABLES = 4097;
+exports.ER_WARN_CANNOT_SECURELY_PERSIST_SENSITIVE_VARIABLES = 4098;
+exports.ER_WARN_TRG_ALREADY_EXISTS = 4099;
+exports.ER_IF_NOT_EXISTS_UNSUPPORTED_TRG_EXISTS_ON_DIFFERENT_TABLE = 4100;
+exports.ER_IF_NOT_EXISTS_UNSUPPORTED_UDF_NATIVE_FCT_NAME_COLLISION = 4101;
+exports.ER_SET_PASSWORD_AUTH_PLUGIN_ERROR = 4102;
+exports.ER_REDUCED_DBLWR_FILE_CORRUPTED = 4103;
+exports.ER_REDUCED_DBLWR_PAGE_FOUND = 4104;
+exports.ER_SRS_INVALID_LATITUDE_OF_ORIGIN = 4105;
+exports.ER_SRS_INVALID_LONGITUDE_OF_ORIGIN = 4106;
+exports.ER_SRS_UNUSED_PROJ_PARAMETER_PRESENT = 4107;
+exports.ER_GIPK_COLUMN_EXISTS = 4108;
+exports.ER_GIPK_FAILED_AUTOINC_COLUMN_EXISTS = 4109;
+exports.ER_GIPK_COLUMN_ALTER_NOT_ALLOWED = 4110;
+exports.ER_DROP_PK_COLUMN_TO_DROP_GIPK = 4111;
+exports.ER_CREATE_SELECT_WITH_GIPK_DISALLOWED_IN_SBR = 4112;
+exports.ER_DA_EXPIRE_LOGS_DAYS_IGNORED = 4113;
+exports.ER_CTE_RECURSIVE_NOT_UNION = 4114;
+exports.ER_COMMAND_BACKEND_FAILED_TO_FETCH_SECURITY_CTX = 4115;
+exports.ER_COMMAND_SERVICE_BACKEND_FAILED = 4116;
+exports.ER_CLIENT_FILE_PRIVILEGE_FOR_REPLICATION_CHECKS = 4117;
+exports.ER_GROUP_REPLICATION_FORCE_MEMBERS_COMMAND_FAILURE = 4118;
+exports.ER_WARN_DEPRECATED_IDENT = 4119;
+exports.ER_INTERSECT_ALL_MAX_DUPLICATES_EXCEEDED = 4120;
+exports.ER_TP_QUERY_THRS_PER_GRP_EXCEEDS_TXN_THR_LIMIT = 4121;
+exports.ER_BAD_TIMESTAMP_FORMAT = 4122;
+exports.ER_SHAPE_PRIDICTION_UDF = 4123;
+exports.ER_SRS_INVALID_HEIGHT = 4124;
+exports.ER_SRS_INVALID_SCALING = 4125;
+exports.ER_SRS_INVALID_ZONE_WIDTH = 4126;
+exports.ER_SRS_INVALID_LATITUDE_POLAR_STERE_VAR_A = 4127;
+exports.ER_WARN_DEPRECATED_CLIENT_NO_SCHEMA_OPTION = 4128;
+exports.ER_TABLE_NOT_EMPTY = 4129;
+exports.ER_TABLE_NO_PRIMARY_KEY = 4130;
+exports.ER_TABLE_IN_SHARED_TABLESPACE = 4131;
+exports.ER_INDEX_OTHER_THAN_PK = 4132;
+exports.ER_LOAD_BULK_DATA_UNSORTED = 4133;
+exports.ER_BULK_EXECUTOR_ERROR = 4134;
+exports.ER_BULK_READER_LIBCURL_INIT_FAILED = 4135;
+exports.ER_BULK_READER_LIBCURL_ERROR = 4136;
+exports.ER_BULK_READER_SERVER_ERROR = 4137;
+exports.ER_BULK_READER_COMMUNICATION_ERROR = 4138;
+exports.ER_BULK_LOAD_DATA_FAILED = 4139;
+exports.ER_BULK_LOADER_COLUMN_TOO_BIG_FOR_LEFTOVER_BUFFER = 4140;
+exports.ER_BULK_LOADER_COMPONENT_ERROR = 4141;
+exports.ER_BULK_LOADER_FILE_CONTAINS_LESS_LINES_THAN_IGNORE_CLAUSE = 4142;
+exports.ER_BULK_PARSER_MISSING_ENCLOSED_BY = 4143;
+exports.ER_BULK_PARSER_ROW_BUFFER_MAX_TOTAL_COLS_EXCEEDED = 4144;
+exports.ER_BULK_PARSER_COPY_BUFFER_SIZE_EXCEEDED = 4145;
+exports.ER_BULK_PARSER_UNEXPECTED_END_OF_INPUT = 4146;
+exports.ER_BULK_PARSER_UNEXPECTED_ROW_TERMINATOR = 4147;
+exports.ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_ENDING_ENCLOSED_BY = 4148;
+exports.ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_NULL_ESCAPE = 4149;
+exports.ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_COLUMN_TERMINATOR = 4150;
+exports.ER_BULK_PARSER_INCOMPLETE_ESCAPE_SEQUENCE = 4151;
+exports.ER_LOAD_BULK_DATA_FAILED = 4152;
+exports.ER_LOAD_BULK_DATA_WRONG_VALUE_FOR_FIELD = 4153;
+exports.ER_LOAD_BULK_DATA_WARN_NULL_TO_NOTNULL = 4154;
+exports.ER_REQUIRE_TABLE_PRIMARY_KEY_CHECK_GENERATE_WITH_GR = 4155;
+exports.ER_CANT_CHANGE_SYS_VAR_IN_READ_ONLY_MODE = 4156;
+exports.ER_INNODB_INSTANT_ADD_DROP_NOT_SUPPORTED_MAX_SIZE = 4157;
+exports.ER_INNODB_INSTANT_ADD_NOT_SUPPORTED_MAX_FIELDS = 4158;
+exports.ER_CANT_SET_PERSISTED = 4159;
+exports.ER_INSTALL_COMPONENT_SET_NULL_VALUE = 4160;
+exports.ER_INSTALL_COMPONENT_SET_UNUSED_VALUE = 4161;
+exports.ER_WARN_DEPRECATED_USER_DEFINED_COLLATIONS = 4162;
+
+// Lookup-by-number table
+exports[1] = 'EE_CANTCREATEFILE';
+exports[2] = 'EE_READ';
+exports[3] = 'EE_WRITE';
+exports[4] = 'EE_BADCLOSE';
+exports[5] = 'EE_OUTOFMEMORY';
+exports[6] = 'EE_DELETE';
+exports[7] = 'EE_LINK';
+exports[9] = 'EE_EOFERR';
+exports[10] = 'EE_CANTLOCK';
+exports[11] = 'EE_CANTUNLOCK';
+exports[12] = 'EE_DIR';
+exports[13] = 'EE_STAT';
+exports[14] = 'EE_CANT_CHSIZE';
+exports[15] = 'EE_CANT_OPEN_STREAM';
+exports[16] = 'EE_GETWD';
+exports[17] = 'EE_SETWD';
+exports[18] = 'EE_LINK_WARNING';
+exports[19] = 'EE_OPEN_WARNING';
+exports[20] = 'EE_DISK_FULL';
+exports[21] = 'EE_CANT_MKDIR';
+exports[22] = 'EE_UNKNOWN_CHARSET';
+exports[23] = 'EE_OUT_OF_FILERESOURCES';
+exports[24] = 'EE_CANT_READLINK';
+exports[25] = 'EE_CANT_SYMLINK';
+exports[26] = 'EE_REALPATH';
+exports[27] = 'EE_SYNC';
+exports[28] = 'EE_UNKNOWN_COLLATION';
+exports[29] = 'EE_FILENOTFOUND';
+exports[30] = 'EE_FILE_NOT_CLOSED';
+exports[31] = 'EE_CHANGE_OWNERSHIP';
+exports[32] = 'EE_CHANGE_PERMISSIONS';
+exports[33] = 'EE_CANT_SEEK';
+exports[34] = 'EE_CAPACITY_EXCEEDED';
+exports[35] = 'EE_DISK_FULL_WITH_RETRY_MSG';
+exports[36] = 'EE_FAILED_TO_CREATE_TIMER';
+exports[37] = 'EE_FAILED_TO_DELETE_TIMER';
+exports[38] = 'EE_FAILED_TO_CREATE_TIMER_QUEUE';
+exports[39] = 'EE_FAILED_TO_START_TIMER_NOTIFY_THREAD';
+exports[40] = 'EE_FAILED_TO_CREATE_TIMER_NOTIFY_THREAD_INTERRUPT_EVENT';
+exports[41] = 'EE_EXITING_TIMER_NOTIFY_THREAD';
+exports[42] = 'EE_WIN_LIBRARY_LOAD_FAILED';
+exports[43] = 'EE_WIN_RUN_TIME_ERROR_CHECK';
+exports[44] = 'EE_FAILED_TO_DETERMINE_LARGE_PAGE_SIZE';
+exports[45] = 'EE_FAILED_TO_KILL_ALL_THREADS';
+exports[46] = 'EE_FAILED_TO_CREATE_IO_COMPLETION_PORT';
+exports[47] = 'EE_FAILED_TO_OPEN_DEFAULTS_FILE';
+exports[48] = 'EE_FAILED_TO_HANDLE_DEFAULTS_FILE';
+exports[49] = 'EE_WRONG_DIRECTIVE_IN_CONFIG_FILE';
+exports[50] = 'EE_SKIPPING_DIRECTIVE_DUE_TO_MAX_INCLUDE_RECURSION';
+exports[51] = 'EE_INCORRECT_GRP_DEFINITION_IN_CONFIG_FILE';
+exports[52] = 'EE_OPTION_WITHOUT_GRP_IN_CONFIG_FILE';
+exports[53] = 'EE_CONFIG_FILE_PERMISSION_ERROR';
+exports[54] = 'EE_IGNORE_WORLD_WRITABLE_CONFIG_FILE';
+exports[55] = 'EE_USING_DISABLED_OPTION';
+exports[56] = 'EE_USING_DISABLED_SHORT_OPTION';
+exports[57] = 'EE_USING_PASSWORD_ON_CLI_IS_INSECURE';
+exports[58] = 'EE_UNKNOWN_SUFFIX_FOR_VARIABLE';
+exports[59] = 'EE_SSL_ERROR_FROM_FILE';
+exports[60] = 'EE_SSL_ERROR';
+exports[61] = 'EE_NET_SEND_ERROR_IN_BOOTSTRAP';
+exports[62] = 'EE_PACKETS_OUT_OF_ORDER';
+exports[63] = 'EE_UNKNOWN_PROTOCOL_OPTION';
+exports[64] = 'EE_FAILED_TO_LOCATE_SERVER_PUBLIC_KEY';
+exports[65] = 'EE_PUBLIC_KEY_NOT_IN_PEM_FORMAT';
+exports[66] = 'EE_DEBUG_INFO';
+exports[67] = 'EE_UNKNOWN_VARIABLE';
+exports[68] = 'EE_UNKNOWN_OPTION';
+exports[69] = 'EE_UNKNOWN_SHORT_OPTION';
+exports[70] = 'EE_OPTION_WITHOUT_ARGUMENT';
+exports[71] = 'EE_OPTION_REQUIRES_ARGUMENT';
+exports[72] = 'EE_SHORT_OPTION_REQUIRES_ARGUMENT';
+exports[73] = 'EE_OPTION_IGNORED_DUE_TO_INVALID_VALUE';
+exports[74] = 'EE_OPTION_WITH_EMPTY_VALUE';
+exports[75] = 'EE_FAILED_TO_ASSIGN_MAX_VALUE_TO_OPTION';
+exports[76] = 'EE_INCORRECT_BOOLEAN_VALUE_FOR_OPTION';
+exports[77] = 'EE_FAILED_TO_SET_OPTION_VALUE';
+exports[78] = 'EE_INCORRECT_INT_VALUE_FOR_OPTION';
+exports[79] = 'EE_INCORRECT_UINT_VALUE_FOR_OPTION';
+exports[80] = 'EE_ADJUSTED_SIGNED_VALUE_FOR_OPTION';
+exports[81] = 'EE_ADJUSTED_UNSIGNED_VALUE_FOR_OPTION';
+exports[82] = 'EE_ADJUSTED_ULONGLONG_VALUE_FOR_OPTION';
+exports[83] = 'EE_ADJUSTED_DOUBLE_VALUE_FOR_OPTION';
+exports[84] = 'EE_INVALID_DECIMAL_VALUE_FOR_OPTION';
+exports[85] = 'EE_COLLATION_PARSER_ERROR';
+exports[86] = 'EE_FAILED_TO_RESET_BEFORE_PRIMARY_IGNORABLE_CHAR';
+exports[87] = 'EE_FAILED_TO_RESET_BEFORE_TERTIARY_IGNORABLE_CHAR';
+exports[88] = 'EE_SHIFT_CHAR_OUT_OF_RANGE';
+exports[89] = 'EE_RESET_CHAR_OUT_OF_RANGE';
+exports[90] = 'EE_UNKNOWN_LDML_TAG';
+exports[91] = 'EE_FAILED_TO_RESET_BEFORE_SECONDARY_IGNORABLE_CHAR';
+exports[92] = 'EE_FAILED_PROCESSING_DIRECTIVE';
+exports[93] = 'EE_PTHREAD_KILL_FAILED';
+exports[120] = 'HA_ERR_KEY_NOT_FOUND';
+exports[121] = 'HA_ERR_FOUND_DUPP_KEY';
+exports[122] = 'HA_ERR_INTERNAL_ERROR';
+exports[123] = 'HA_ERR_RECORD_CHANGED';
+exports[124] = 'HA_ERR_WRONG_INDEX';
+exports[125] = 'HA_ERR_ROLLED_BACK';
+exports[126] = 'HA_ERR_CRASHED';
+exports[127] = 'HA_ERR_WRONG_IN_RECORD';
+exports[128] = 'HA_ERR_OUT_OF_MEM';
+exports[130] = 'HA_ERR_NOT_A_TABLE';
+exports[131] = 'HA_ERR_WRONG_COMMAND';
+exports[132] = 'HA_ERR_OLD_FILE';
+exports[133] = 'HA_ERR_NO_ACTIVE_RECORD';
+exports[134] = 'HA_ERR_RECORD_DELETED';
+exports[135] = 'HA_ERR_RECORD_FILE_FULL';
+exports[136] = 'HA_ERR_INDEX_FILE_FULL';
+exports[137] = 'HA_ERR_END_OF_FILE';
+exports[138] = 'HA_ERR_UNSUPPORTED';
+exports[139] = 'HA_ERR_TOO_BIG_ROW';
+exports[140] = 'HA_WRONG_CREATE_OPTION';
+exports[141] = 'HA_ERR_FOUND_DUPP_UNIQUE';
+exports[142] = 'HA_ERR_UNKNOWN_CHARSET';
+exports[143] = 'HA_ERR_WRONG_MRG_TABLE_DEF';
+exports[144] = 'HA_ERR_CRASHED_ON_REPAIR';
+exports[145] = 'HA_ERR_CRASHED_ON_USAGE';
+exports[146] = 'HA_ERR_LOCK_WAIT_TIMEOUT';
+exports[147] = 'HA_ERR_LOCK_TABLE_FULL';
+exports[148] = 'HA_ERR_READ_ONLY_TRANSACTION';
+exports[149] = 'HA_ERR_LOCK_DEADLOCK';
+exports[150] = 'HA_ERR_CANNOT_ADD_FOREIGN';
+exports[151] = 'HA_ERR_NO_REFERENCED_ROW';
+exports[152] = 'HA_ERR_ROW_IS_REFERENCED';
+exports[153] = 'HA_ERR_NO_SAVEPOINT';
+exports[154] = 'HA_ERR_NON_UNIQUE_BLOCK_SIZE';
+exports[155] = 'HA_ERR_NO_SUCH_TABLE';
+exports[156] = 'HA_ERR_TABLE_EXIST';
+exports[157] = 'HA_ERR_NO_CONNECTION';
+exports[158] = 'HA_ERR_NULL_IN_SPATIAL';
+exports[159] = 'HA_ERR_TABLE_DEF_CHANGED';
+exports[160] = 'HA_ERR_NO_PARTITION_FOUND';
+exports[161] = 'HA_ERR_RBR_LOGGING_FAILED';
+exports[162] = 'HA_ERR_DROP_INDEX_FK';
+exports[163] = 'HA_ERR_FOREIGN_DUPLICATE_KEY';
+exports[164] = 'HA_ERR_TABLE_NEEDS_UPGRADE';
+exports[165] = 'HA_ERR_TABLE_READONLY';
+exports[166] = 'HA_ERR_AUTOINC_READ_FAILED';
+exports[167] = 'HA_ERR_AUTOINC_ERANGE';
+exports[168] = 'HA_ERR_GENERIC';
+exports[169] = 'HA_ERR_RECORD_IS_THE_SAME';
+exports[170] = 'HA_ERR_LOGGING_IMPOSSIBLE';
+exports[171] = 'HA_ERR_CORRUPT_EVENT';
+exports[172] = 'HA_ERR_NEW_FILE';
+exports[173] = 'HA_ERR_ROWS_EVENT_APPLY';
+exports[174] = 'HA_ERR_INITIALIZATION';
+exports[175] = 'HA_ERR_FILE_TOO_SHORT';
+exports[176] = 'HA_ERR_WRONG_CRC';
+exports[177] = 'HA_ERR_TOO_MANY_CONCURRENT_TRXS';
+exports[178] = 'HA_ERR_NOT_IN_LOCK_PARTITIONS';
+exports[179] = 'HA_ERR_INDEX_COL_TOO_LONG';
+exports[180] = 'HA_ERR_INDEX_CORRUPT';
+exports[181] = 'HA_ERR_UNDO_REC_TOO_BIG';
+exports[182] = 'HA_FTS_INVALID_DOCID';
+exports[183] = 'HA_ERR_TABLE_IN_FK_CHECK';
+exports[184] = 'HA_ERR_TABLESPACE_EXISTS';
+exports[185] = 'HA_ERR_TOO_MANY_FIELDS';
+exports[186] = 'HA_ERR_ROW_IN_WRONG_PARTITION';
+exports[187] = 'HA_ERR_INNODB_READ_ONLY';
+exports[188] = 'HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT';
+exports[189] = 'HA_ERR_TEMP_FILE_WRITE_FAILURE';
+exports[190] = 'HA_ERR_INNODB_FORCED_RECOVERY';
+exports[191] = 'HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE';
+exports[192] = 'HA_ERR_FK_DEPTH_EXCEEDED';
+exports[193] = 'HA_MISSING_CREATE_OPTION';
+exports[194] = 'HA_ERR_SE_OUT_OF_MEMORY';
+exports[195] = 'HA_ERR_TABLE_CORRUPT';
+exports[196] = 'HA_ERR_QUERY_INTERRUPTED';
+exports[197] = 'HA_ERR_TABLESPACE_MISSING';
+exports[198] = 'HA_ERR_TABLESPACE_IS_NOT_EMPTY';
+exports[199] = 'HA_ERR_WRONG_FILE_NAME';
+exports[200] = 'HA_ERR_NOT_ALLOWED_COMMAND';
+exports[201] = 'HA_ERR_COMPUTE_FAILED';
+exports[202] = 'HA_ERR_ROW_FORMAT_CHANGED';
+exports[203] = 'HA_ERR_NO_WAIT_LOCK';
+exports[204] = 'HA_ERR_DISK_FULL_NOWAIT';
+exports[205] = 'HA_ERR_NO_SESSION_TEMP';
+exports[206] = 'HA_ERR_WRONG_TABLE_NAME';
+exports[207] = 'HA_ERR_TOO_LONG_PATH';
+exports[208] = 'HA_ERR_SAMPLING_INIT_FAILED';
+exports[209] = 'HA_ERR_FTS_TOO_MANY_NESTED_EXP';
+exports[1000] = 'ER_HASHCHK';
+exports[1001] = 'ER_NISAMCHK';
+exports[1002] = 'ER_NO';
+exports[1003] = 'ER_YES';
+exports[1004] = 'ER_CANT_CREATE_FILE';
+exports[1005] = 'ER_CANT_CREATE_TABLE';
+exports[1006] = 'ER_CANT_CREATE_DB';
+exports[1007] = 'ER_DB_CREATE_EXISTS';
+exports[1008] = 'ER_DB_DROP_EXISTS';
+exports[1009] = 'ER_DB_DROP_DELETE';
+exports[1010] = 'ER_DB_DROP_RMDIR';
+exports[1011] = 'ER_CANT_DELETE_FILE';
+exports[1012] = 'ER_CANT_FIND_SYSTEM_REC';
+exports[1013] = 'ER_CANT_GET_STAT';
+exports[1014] = 'ER_CANT_GET_WD';
+exports[1015] = 'ER_CANT_LOCK';
+exports[1016] = 'ER_CANT_OPEN_FILE';
+exports[1017] = 'ER_FILE_NOT_FOUND';
+exports[1018] = 'ER_CANT_READ_DIR';
+exports[1019] = 'ER_CANT_SET_WD';
+exports[1020] = 'ER_CHECKREAD';
+exports[1021] = 'ER_DISK_FULL';
+exports[1022] = 'ER_DUP_KEY';
+exports[1023] = 'ER_ERROR_ON_CLOSE';
+exports[1024] = 'ER_ERROR_ON_READ';
+exports[1025] = 'ER_ERROR_ON_RENAME';
+exports[1026] = 'ER_ERROR_ON_WRITE';
+exports[1027] = 'ER_FILE_USED';
+exports[1028] = 'ER_FILSORT_ABORT';
+exports[1029] = 'ER_FORM_NOT_FOUND';
+exports[1030] = 'ER_GET_ERRNO';
+exports[1031] = 'ER_ILLEGAL_HA';
+exports[1032] = 'ER_KEY_NOT_FOUND';
+exports[1033] = 'ER_NOT_FORM_FILE';
+exports[1034] = 'ER_NOT_KEYFILE';
+exports[1035] = 'ER_OLD_KEYFILE';
+exports[1036] = 'ER_OPEN_AS_READONLY';
+exports[1037] = 'ER_OUTOFMEMORY';
+exports[1038] = 'ER_OUT_OF_SORTMEMORY';
+exports[1039] = 'ER_UNEXPECTED_EOF';
+exports[1040] = 'ER_CON_COUNT_ERROR';
+exports[1041] = 'ER_OUT_OF_RESOURCES';
+exports[1042] = 'ER_BAD_HOST_ERROR';
+exports[1043] = 'ER_HANDSHAKE_ERROR';
+exports[1044] = 'ER_DBACCESS_DENIED_ERROR';
+exports[1045] = 'ER_ACCESS_DENIED_ERROR';
+exports[1046] = 'ER_NO_DB_ERROR';
+exports[1047] = 'ER_UNKNOWN_COM_ERROR';
+exports[1048] = 'ER_BAD_NULL_ERROR';
+exports[1049] = 'ER_BAD_DB_ERROR';
+exports[1050] = 'ER_TABLE_EXISTS_ERROR';
+exports[1051] = 'ER_BAD_TABLE_ERROR';
+exports[1052] = 'ER_NON_UNIQ_ERROR';
+exports[1053] = 'ER_SERVER_SHUTDOWN';
+exports[1054] = 'ER_BAD_FIELD_ERROR';
+exports[1055] = 'ER_WRONG_FIELD_WITH_GROUP';
+exports[1056] = 'ER_WRONG_GROUP_FIELD';
+exports[1057] = 'ER_WRONG_SUM_SELECT';
+exports[1058] = 'ER_WRONG_VALUE_COUNT';
+exports[1059] = 'ER_TOO_LONG_IDENT';
+exports[1060] = 'ER_DUP_FIELDNAME';
+exports[1061] = 'ER_DUP_KEYNAME';
+exports[1062] = 'ER_DUP_ENTRY';
+exports[1063] = 'ER_WRONG_FIELD_SPEC';
+exports[1064] = 'ER_PARSE_ERROR';
+exports[1065] = 'ER_EMPTY_QUERY';
+exports[1066] = 'ER_NONUNIQ_TABLE';
+exports[1067] = 'ER_INVALID_DEFAULT';
+exports[1068] = 'ER_MULTIPLE_PRI_KEY';
+exports[1069] = 'ER_TOO_MANY_KEYS';
+exports[1070] = 'ER_TOO_MANY_KEY_PARTS';
+exports[1071] = 'ER_TOO_LONG_KEY';
+exports[1072] = 'ER_KEY_COLUMN_DOES_NOT_EXITS';
+exports[1073] = 'ER_BLOB_USED_AS_KEY';
+exports[1074] = 'ER_TOO_BIG_FIELDLENGTH';
+exports[1075] = 'ER_WRONG_AUTO_KEY';
+exports[1076] = 'ER_READY';
+exports[1077] = 'ER_NORMAL_SHUTDOWN';
+exports[1078] = 'ER_GOT_SIGNAL';
+exports[1079] = 'ER_SHUTDOWN_COMPLETE';
+exports[1080] = 'ER_FORCING_CLOSE';
+exports[1081] = 'ER_IPSOCK_ERROR';
+exports[1082] = 'ER_NO_SUCH_INDEX';
+exports[1083] = 'ER_WRONG_FIELD_TERMINATORS';
+exports[1084] = 'ER_BLOBS_AND_NO_TERMINATED';
+exports[1085] = 'ER_TEXTFILE_NOT_READABLE';
+exports[1086] = 'ER_FILE_EXISTS_ERROR';
+exports[1087] = 'ER_LOAD_INFO';
+exports[1088] = 'ER_ALTER_INFO';
+exports[1089] = 'ER_WRONG_SUB_KEY';
+exports[1090] = 'ER_CANT_REMOVE_ALL_FIELDS';
+exports[1091] = 'ER_CANT_DROP_FIELD_OR_KEY';
+exports[1092] = 'ER_INSERT_INFO';
+exports[1093] = 'ER_UPDATE_TABLE_USED';
+exports[1094] = 'ER_NO_SUCH_THREAD';
+exports[1095] = 'ER_KILL_DENIED_ERROR';
+exports[1096] = 'ER_NO_TABLES_USED';
+exports[1097] = 'ER_TOO_BIG_SET';
+exports[1098] = 'ER_NO_UNIQUE_LOGFILE';
+exports[1099] = 'ER_TABLE_NOT_LOCKED_FOR_WRITE';
+exports[1100] = 'ER_TABLE_NOT_LOCKED';
+exports[1101] = 'ER_BLOB_CANT_HAVE_DEFAULT';
+exports[1102] = 'ER_WRONG_DB_NAME';
+exports[1103] = 'ER_WRONG_TABLE_NAME';
+exports[1104] = 'ER_TOO_BIG_SELECT';
+exports[1105] = 'ER_UNKNOWN_ERROR';
+exports[1106] = 'ER_UNKNOWN_PROCEDURE';
+exports[1107] = 'ER_WRONG_PARAMCOUNT_TO_PROCEDURE';
+exports[1108] = 'ER_WRONG_PARAMETERS_TO_PROCEDURE';
+exports[1109] = 'ER_UNKNOWN_TABLE';
+exports[1110] = 'ER_FIELD_SPECIFIED_TWICE';
+exports[1111] = 'ER_INVALID_GROUP_FUNC_USE';
+exports[1112] = 'ER_UNSUPPORTED_EXTENSION';
+exports[1113] = 'ER_TABLE_MUST_HAVE_COLUMNS';
+exports[1114] = 'ER_RECORD_FILE_FULL';
+exports[1115] = 'ER_UNKNOWN_CHARACTER_SET';
+exports[1116] = 'ER_TOO_MANY_TABLES';
+exports[1117] = 'ER_TOO_MANY_FIELDS';
+exports[1118] = 'ER_TOO_BIG_ROWSIZE';
+exports[1119] = 'ER_STACK_OVERRUN';
+exports[1120] = 'ER_WRONG_OUTER_JOIN';
+exports[1121] = 'ER_NULL_COLUMN_IN_INDEX';
+exports[1122] = 'ER_CANT_FIND_UDF';
+exports[1123] = 'ER_CANT_INITIALIZE_UDF';
+exports[1124] = 'ER_UDF_NO_PATHS';
+exports[1125] = 'ER_UDF_EXISTS';
+exports[1126] = 'ER_CANT_OPEN_LIBRARY';
+exports[1127] = 'ER_CANT_FIND_DL_ENTRY';
+exports[1128] = 'ER_FUNCTION_NOT_DEFINED';
+exports[1129] = 'ER_HOST_IS_BLOCKED';
+exports[1130] = 'ER_HOST_NOT_PRIVILEGED';
+exports[1131] = 'ER_PASSWORD_ANONYMOUS_USER';
+exports[1132] = 'ER_PASSWORD_NOT_ALLOWED';
+exports[1133] = 'ER_PASSWORD_NO_MATCH';
+exports[1134] = 'ER_UPDATE_INFO';
+exports[1135] = 'ER_CANT_CREATE_THREAD';
+exports[1136] = 'ER_WRONG_VALUE_COUNT_ON_ROW';
+exports[1137] = 'ER_CANT_REOPEN_TABLE';
+exports[1138] = 'ER_INVALID_USE_OF_NULL';
+exports[1139] = 'ER_REGEXP_ERROR';
+exports[1140] = 'ER_MIX_OF_GROUP_FUNC_AND_FIELDS';
+exports[1141] = 'ER_NONEXISTING_GRANT';
+exports[1142] = 'ER_TABLEACCESS_DENIED_ERROR';
+exports[1143] = 'ER_COLUMNACCESS_DENIED_ERROR';
+exports[1144] = 'ER_ILLEGAL_GRANT_FOR_TABLE';
+exports[1145] = 'ER_GRANT_WRONG_HOST_OR_USER';
+exports[1146] = 'ER_NO_SUCH_TABLE';
+exports[1147] = 'ER_NONEXISTING_TABLE_GRANT';
+exports[1148] = 'ER_NOT_ALLOWED_COMMAND';
+exports[1149] = 'ER_SYNTAX_ERROR';
+exports[1150] = 'ER_UNUSED1';
+exports[1151] = 'ER_UNUSED2';
+exports[1152] = 'ER_ABORTING_CONNECTION';
+exports[1153] = 'ER_NET_PACKET_TOO_LARGE';
+exports[1154] = 'ER_NET_READ_ERROR_FROM_PIPE';
+exports[1155] = 'ER_NET_FCNTL_ERROR';
+exports[1156] = 'ER_NET_PACKETS_OUT_OF_ORDER';
+exports[1157] = 'ER_NET_UNCOMPRESS_ERROR';
+exports[1158] = 'ER_NET_READ_ERROR';
+exports[1159] = 'ER_NET_READ_INTERRUPTED';
+exports[1160] = 'ER_NET_ERROR_ON_WRITE';
+exports[1161] = 'ER_NET_WRITE_INTERRUPTED';
+exports[1162] = 'ER_TOO_LONG_STRING';
+exports[1163] = 'ER_TABLE_CANT_HANDLE_BLOB';
+exports[1164] = 'ER_TABLE_CANT_HANDLE_AUTO_INCREMENT';
+exports[1165] = 'ER_UNUSED3';
+exports[1166] = 'ER_WRONG_COLUMN_NAME';
+exports[1167] = 'ER_WRONG_KEY_COLUMN';
+exports[1168] = 'ER_WRONG_MRG_TABLE';
+exports[1169] = 'ER_DUP_UNIQUE';
+exports[1170] = 'ER_BLOB_KEY_WITHOUT_LENGTH';
+exports[1171] = 'ER_PRIMARY_CANT_HAVE_NULL';
+exports[1172] = 'ER_TOO_MANY_ROWS';
+exports[1173] = 'ER_REQUIRES_PRIMARY_KEY';
+exports[1174] = 'ER_NO_RAID_COMPILED';
+exports[1175] = 'ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE';
+exports[1176] = 'ER_KEY_DOES_NOT_EXITS';
+exports[1177] = 'ER_CHECK_NO_SUCH_TABLE';
+exports[1178] = 'ER_CHECK_NOT_IMPLEMENTED';
+exports[1179] = 'ER_CANT_DO_THIS_DURING_AN_TRANSACTION';
+exports[1180] = 'ER_ERROR_DURING_COMMIT';
+exports[1181] = 'ER_ERROR_DURING_ROLLBACK';
+exports[1182] = 'ER_ERROR_DURING_FLUSH_LOGS';
+exports[1183] = 'ER_ERROR_DURING_CHECKPOINT';
+exports[1184] = 'ER_NEW_ABORTING_CONNECTION';
+exports[1185] = 'ER_DUMP_NOT_IMPLEMENTED';
+exports[1186] = 'ER_FLUSH_MASTER_BINLOG_CLOSED';
+exports[1187] = 'ER_INDEX_REBUILD';
+exports[1188] = 'ER_SOURCE';
+exports[1189] = 'ER_SOURCE_NET_READ';
+exports[1190] = 'ER_SOURCE_NET_WRITE';
+exports[1191] = 'ER_FT_MATCHING_KEY_NOT_FOUND';
+exports[1192] = 'ER_LOCK_OR_ACTIVE_TRANSACTION';
+exports[1193] = 'ER_UNKNOWN_SYSTEM_VARIABLE';
+exports[1194] = 'ER_CRASHED_ON_USAGE';
+exports[1195] = 'ER_CRASHED_ON_REPAIR';
+exports[1196] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK';
+exports[1197] = 'ER_TRANS_CACHE_FULL';
+exports[1198] = 'ER_SLAVE_MUST_STOP';
+exports[1199] = 'ER_REPLICA_NOT_RUNNING';
+exports[1200] = 'ER_BAD_REPLICA';
+exports[1201] = 'ER_CONNECTION_METADATA';
+exports[1202] = 'ER_REPLICA_THREAD';
+exports[1203] = 'ER_TOO_MANY_USER_CONNECTIONS';
+exports[1204] = 'ER_SET_CONSTANTS_ONLY';
+exports[1205] = 'ER_LOCK_WAIT_TIMEOUT';
+exports[1206] = 'ER_LOCK_TABLE_FULL';
+exports[1207] = 'ER_READ_ONLY_TRANSACTION';
+exports[1208] = 'ER_DROP_DB_WITH_READ_LOCK';
+exports[1209] = 'ER_CREATE_DB_WITH_READ_LOCK';
+exports[1210] = 'ER_WRONG_ARGUMENTS';
+exports[1211] = 'ER_NO_PERMISSION_TO_CREATE_USER';
+exports[1212] = 'ER_UNION_TABLES_IN_DIFFERENT_DIR';
+exports[1213] = 'ER_LOCK_DEADLOCK';
+exports[1214] = 'ER_TABLE_CANT_HANDLE_FT';
+exports[1215] = 'ER_CANNOT_ADD_FOREIGN';
+exports[1216] = 'ER_NO_REFERENCED_ROW';
+exports[1217] = 'ER_ROW_IS_REFERENCED';
+exports[1218] = 'ER_CONNECT_TO_SOURCE';
+exports[1219] = 'ER_QUERY_ON_MASTER';
+exports[1220] = 'ER_ERROR_WHEN_EXECUTING_COMMAND';
+exports[1221] = 'ER_WRONG_USAGE';
+exports[1222] = 'ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT';
+exports[1223] = 'ER_CANT_UPDATE_WITH_READLOCK';
+exports[1224] = 'ER_MIXING_NOT_ALLOWED';
+exports[1225] = 'ER_DUP_ARGUMENT';
+exports[1226] = 'ER_USER_LIMIT_REACHED';
+exports[1227] = 'ER_SPECIFIC_ACCESS_DENIED_ERROR';
+exports[1228] = 'ER_LOCAL_VARIABLE';
+exports[1229] = 'ER_GLOBAL_VARIABLE';
+exports[1230] = 'ER_NO_DEFAULT';
+exports[1231] = 'ER_WRONG_VALUE_FOR_VAR';
+exports[1232] = 'ER_WRONG_TYPE_FOR_VAR';
+exports[1233] = 'ER_VAR_CANT_BE_READ';
+exports[1234] = 'ER_CANT_USE_OPTION_HERE';
+exports[1235] = 'ER_NOT_SUPPORTED_YET';
+exports[1236] = 'ER_SOURCE_FATAL_ERROR_READING_BINLOG';
+exports[1237] = 'ER_REPLICA_IGNORED_TABLE';
+exports[1238] = 'ER_INCORRECT_GLOBAL_LOCAL_VAR';
+exports[1239] = 'ER_WRONG_FK_DEF';
+exports[1240] = 'ER_KEY_REF_DO_NOT_MATCH_TABLE_REF';
+exports[1241] = 'ER_OPERAND_COLUMNS';
+exports[1242] = 'ER_SUBQUERY_NO_1_ROW';
+exports[1243] = 'ER_UNKNOWN_STMT_HANDLER';
+exports[1244] = 'ER_CORRUPT_HELP_DB';
+exports[1245] = 'ER_CYCLIC_REFERENCE';
+exports[1246] = 'ER_AUTO_CONVERT';
+exports[1247] = 'ER_ILLEGAL_REFERENCE';
+exports[1248] = 'ER_DERIVED_MUST_HAVE_ALIAS';
+exports[1249] = 'ER_SELECT_REDUCED';
+exports[1250] = 'ER_TABLENAME_NOT_ALLOWED_HERE';
+exports[1251] = 'ER_NOT_SUPPORTED_AUTH_MODE';
+exports[1252] = 'ER_SPATIAL_CANT_HAVE_NULL';
+exports[1253] = 'ER_COLLATION_CHARSET_MISMATCH';
+exports[1254] = 'ER_SLAVE_WAS_RUNNING';
+exports[1255] = 'ER_SLAVE_WAS_NOT_RUNNING';
+exports[1256] = 'ER_TOO_BIG_FOR_UNCOMPRESS';
+exports[1257] = 'ER_ZLIB_Z_MEM_ERROR';
+exports[1258] = 'ER_ZLIB_Z_BUF_ERROR';
+exports[1259] = 'ER_ZLIB_Z_DATA_ERROR';
+exports[1260] = 'ER_CUT_VALUE_GROUP_CONCAT';
+exports[1261] = 'ER_WARN_TOO_FEW_RECORDS';
+exports[1262] = 'ER_WARN_TOO_MANY_RECORDS';
+exports[1263] = 'ER_WARN_NULL_TO_NOTNULL';
+exports[1264] = 'ER_WARN_DATA_OUT_OF_RANGE';
+exports[1265] = 'WARN_DATA_TRUNCATED';
+exports[1266] = 'ER_WARN_USING_OTHER_HANDLER';
+exports[1267] = 'ER_CANT_AGGREGATE_2COLLATIONS';
+exports[1268] = 'ER_DROP_USER';
+exports[1269] = 'ER_REVOKE_GRANTS';
+exports[1270] = 'ER_CANT_AGGREGATE_3COLLATIONS';
+exports[1271] = 'ER_CANT_AGGREGATE_NCOLLATIONS';
+exports[1272] = 'ER_VARIABLE_IS_NOT_STRUCT';
+exports[1273] = 'ER_UNKNOWN_COLLATION';
+exports[1274] = 'ER_REPLICA_IGNORED_SSL_PARAMS';
+exports[1275] = 'ER_SERVER_IS_IN_SECURE_AUTH_MODE';
+exports[1276] = 'ER_WARN_FIELD_RESOLVED';
+exports[1277] = 'ER_BAD_REPLICA_UNTIL_COND';
+exports[1278] = 'ER_MISSING_SKIP_REPLICA';
+exports[1279] = 'ER_UNTIL_COND_IGNORED';
+exports[1280] = 'ER_WRONG_NAME_FOR_INDEX';
+exports[1281] = 'ER_WRONG_NAME_FOR_CATALOG';
+exports[1282] = 'ER_WARN_QC_RESIZE';
+exports[1283] = 'ER_BAD_FT_COLUMN';
+exports[1284] = 'ER_UNKNOWN_KEY_CACHE';
+exports[1285] = 'ER_WARN_HOSTNAME_WONT_WORK';
+exports[1286] = 'ER_UNKNOWN_STORAGE_ENGINE';
+exports[1287] = 'ER_WARN_DEPRECATED_SYNTAX';
+exports[1288] = 'ER_NON_UPDATABLE_TABLE';
+exports[1289] = 'ER_FEATURE_DISABLED';
+exports[1290] = 'ER_OPTION_PREVENTS_STATEMENT';
+exports[1291] = 'ER_DUPLICATED_VALUE_IN_TYPE';
+exports[1292] = 'ER_TRUNCATED_WRONG_VALUE';
+exports[1293] = 'ER_TOO_MUCH_AUTO_TIMESTAMP_COLS';
+exports[1294] = 'ER_INVALID_ON_UPDATE';
+exports[1295] = 'ER_UNSUPPORTED_PS';
+exports[1296] = 'ER_GET_ERRMSG';
+exports[1297] = 'ER_GET_TEMPORARY_ERRMSG';
+exports[1298] = 'ER_UNKNOWN_TIME_ZONE';
+exports[1299] = 'ER_WARN_INVALID_TIMESTAMP';
+exports[1300] = 'ER_INVALID_CHARACTER_STRING';
+exports[1301] = 'ER_WARN_ALLOWED_PACKET_OVERFLOWED';
+exports[1302] = 'ER_CONFLICTING_DECLARATIONS';
+exports[1303] = 'ER_SP_NO_RECURSIVE_CREATE';
+exports[1304] = 'ER_SP_ALREADY_EXISTS';
+exports[1305] = 'ER_SP_DOES_NOT_EXIST';
+exports[1306] = 'ER_SP_DROP_FAILED';
+exports[1307] = 'ER_SP_STORE_FAILED';
+exports[1308] = 'ER_SP_LILABEL_MISMATCH';
+exports[1309] = 'ER_SP_LABEL_REDEFINE';
+exports[1310] = 'ER_SP_LABEL_MISMATCH';
+exports[1311] = 'ER_SP_UNINIT_VAR';
+exports[1312] = 'ER_SP_BADSELECT';
+exports[1313] = 'ER_SP_BADRETURN';
+exports[1314] = 'ER_SP_BADSTATEMENT';
+exports[1315] = 'ER_UPDATE_LOG_DEPRECATED_IGNORED';
+exports[1316] = 'ER_UPDATE_LOG_DEPRECATED_TRANSLATED';
+exports[1317] = 'ER_QUERY_INTERRUPTED';
+exports[1318] = 'ER_SP_WRONG_NO_OF_ARGS';
+exports[1319] = 'ER_SP_COND_MISMATCH';
+exports[1320] = 'ER_SP_NORETURN';
+exports[1321] = 'ER_SP_NORETURNEND';
+exports[1322] = 'ER_SP_BAD_CURSOR_QUERY';
+exports[1323] = 'ER_SP_BAD_CURSOR_SELECT';
+exports[1324] = 'ER_SP_CURSOR_MISMATCH';
+exports[1325] = 'ER_SP_CURSOR_ALREADY_OPEN';
+exports[1326] = 'ER_SP_CURSOR_NOT_OPEN';
+exports[1327] = 'ER_SP_UNDECLARED_VAR';
+exports[1328] = 'ER_SP_WRONG_NO_OF_FETCH_ARGS';
+exports[1329] = 'ER_SP_FETCH_NO_DATA';
+exports[1330] = 'ER_SP_DUP_PARAM';
+exports[1331] = 'ER_SP_DUP_VAR';
+exports[1332] = 'ER_SP_DUP_COND';
+exports[1333] = 'ER_SP_DUP_CURS';
+exports[1334] = 'ER_SP_CANT_ALTER';
+exports[1335] = 'ER_SP_SUBSELECT_NYI';
+exports[1336] = 'ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG';
+exports[1337] = 'ER_SP_VARCOND_AFTER_CURSHNDLR';
+exports[1338] = 'ER_SP_CURSOR_AFTER_HANDLER';
+exports[1339] = 'ER_SP_CASE_NOT_FOUND';
+exports[1340] = 'ER_FPARSER_TOO_BIG_FILE';
+exports[1341] = 'ER_FPARSER_BAD_HEADER';
+exports[1342] = 'ER_FPARSER_EOF_IN_COMMENT';
+exports[1343] = 'ER_FPARSER_ERROR_IN_PARAMETER';
+exports[1344] = 'ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER';
+exports[1345] = 'ER_VIEW_NO_EXPLAIN';
+exports[1346] = 'ER_FRM_UNKNOWN_TYPE';
+exports[1347] = 'ER_WRONG_OBJECT';
+exports[1348] = 'ER_NONUPDATEABLE_COLUMN';
+exports[1349] = 'ER_VIEW_SELECT_DERIVED';
+exports[1350] = 'ER_VIEW_SELECT_CLAUSE';
+exports[1351] = 'ER_VIEW_SELECT_VARIABLE';
+exports[1352] = 'ER_VIEW_SELECT_TMPTABLE';
+exports[1353] = 'ER_VIEW_WRONG_LIST';
+exports[1354] = 'ER_WARN_VIEW_MERGE';
+exports[1355] = 'ER_WARN_VIEW_WITHOUT_KEY';
+exports[1356] = 'ER_VIEW_INVALID';
+exports[1357] = 'ER_SP_NO_DROP_SP';
+exports[1358] = 'ER_SP_GOTO_IN_HNDLR';
+exports[1359] = 'ER_TRG_ALREADY_EXISTS';
+exports[1360] = 'ER_TRG_DOES_NOT_EXIST';
+exports[1361] = 'ER_TRG_ON_VIEW_OR_TEMP_TABLE';
+exports[1362] = 'ER_TRG_CANT_CHANGE_ROW';
+exports[1363] = 'ER_TRG_NO_SUCH_ROW_IN_TRG';
+exports[1364] = 'ER_NO_DEFAULT_FOR_FIELD';
+exports[1365] = 'ER_DIVISION_BY_ZERO';
+exports[1366] = 'ER_TRUNCATED_WRONG_VALUE_FOR_FIELD';
+exports[1367] = 'ER_ILLEGAL_VALUE_FOR_TYPE';
+exports[1368] = 'ER_VIEW_NONUPD_CHECK';
+exports[1369] = 'ER_VIEW_CHECK_FAILED';
+exports[1370] = 'ER_PROCACCESS_DENIED_ERROR';
+exports[1371] = 'ER_RELAY_LOG_FAIL';
+exports[1372] = 'ER_PASSWD_LENGTH';
+exports[1373] = 'ER_UNKNOWN_TARGET_BINLOG';
+exports[1374] = 'ER_IO_ERR_LOG_INDEX_READ';
+exports[1375] = 'ER_BINLOG_PURGE_PROHIBITED';
+exports[1376] = 'ER_FSEEK_FAIL';
+exports[1377] = 'ER_BINLOG_PURGE_FATAL_ERR';
+exports[1378] = 'ER_LOG_IN_USE';
+exports[1379] = 'ER_LOG_PURGE_UNKNOWN_ERR';
+exports[1380] = 'ER_RELAY_LOG_INIT';
+exports[1381] = 'ER_NO_BINARY_LOGGING';
+exports[1382] = 'ER_RESERVED_SYNTAX';
+exports[1383] = 'ER_WSAS_FAILED';
+exports[1384] = 'ER_DIFF_GROUPS_PROC';
+exports[1385] = 'ER_NO_GROUP_FOR_PROC';
+exports[1386] = 'ER_ORDER_WITH_PROC';
+exports[1387] = 'ER_LOGGING_PROHIBIT_CHANGING_OF';
+exports[1388] = 'ER_NO_FILE_MAPPING';
+exports[1389] = 'ER_WRONG_MAGIC';
+exports[1390] = 'ER_PS_MANY_PARAM';
+exports[1391] = 'ER_KEY_PART_0';
+exports[1392] = 'ER_VIEW_CHECKSUM';
+exports[1393] = 'ER_VIEW_MULTIUPDATE';
+exports[1394] = 'ER_VIEW_NO_INSERT_FIELD_LIST';
+exports[1395] = 'ER_VIEW_DELETE_MERGE_VIEW';
+exports[1396] = 'ER_CANNOT_USER';
+exports[1397] = 'ER_XAER_NOTA';
+exports[1398] = 'ER_XAER_INVAL';
+exports[1399] = 'ER_XAER_RMFAIL';
+exports[1400] = 'ER_XAER_OUTSIDE';
+exports[1401] = 'ER_XAER_RMERR';
+exports[1402] = 'ER_XA_RBROLLBACK';
+exports[1403] = 'ER_NONEXISTING_PROC_GRANT';
+exports[1404] = 'ER_PROC_AUTO_GRANT_FAIL';
+exports[1405] = 'ER_PROC_AUTO_REVOKE_FAIL';
+exports[1406] = 'ER_DATA_TOO_LONG';
+exports[1407] = 'ER_SP_BAD_SQLSTATE';
+exports[1408] = 'ER_STARTUP';
+exports[1409] = 'ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR';
+exports[1410] = 'ER_CANT_CREATE_USER_WITH_GRANT';
+exports[1411] = 'ER_WRONG_VALUE_FOR_TYPE';
+exports[1412] = 'ER_TABLE_DEF_CHANGED';
+exports[1413] = 'ER_SP_DUP_HANDLER';
+exports[1414] = 'ER_SP_NOT_VAR_ARG';
+exports[1415] = 'ER_SP_NO_RETSET';
+exports[1416] = 'ER_CANT_CREATE_GEOMETRY_OBJECT';
+exports[1417] = 'ER_FAILED_ROUTINE_BREAK_BINLOG';
+exports[1418] = 'ER_BINLOG_UNSAFE_ROUTINE';
+exports[1419] = 'ER_BINLOG_CREATE_ROUTINE_NEED_SUPER';
+exports[1420] = 'ER_EXEC_STMT_WITH_OPEN_CURSOR';
+exports[1421] = 'ER_STMT_HAS_NO_OPEN_CURSOR';
+exports[1422] = 'ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG';
+exports[1423] = 'ER_NO_DEFAULT_FOR_VIEW_FIELD';
+exports[1424] = 'ER_SP_NO_RECURSION';
+exports[1425] = 'ER_TOO_BIG_SCALE';
+exports[1426] = 'ER_TOO_BIG_PRECISION';
+exports[1427] = 'ER_M_BIGGER_THAN_D';
+exports[1428] = 'ER_WRONG_LOCK_OF_SYSTEM_TABLE';
+exports[1429] = 'ER_CONNECT_TO_FOREIGN_DATA_SOURCE';
+exports[1430] = 'ER_QUERY_ON_FOREIGN_DATA_SOURCE';
+exports[1431] = 'ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST';
+exports[1432] = 'ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE';
+exports[1433] = 'ER_FOREIGN_DATA_STRING_INVALID';
+exports[1434] = 'ER_CANT_CREATE_FEDERATED_TABLE';
+exports[1435] = 'ER_TRG_IN_WRONG_SCHEMA';
+exports[1436] = 'ER_STACK_OVERRUN_NEED_MORE';
+exports[1437] = 'ER_TOO_LONG_BODY';
+exports[1438] = 'ER_WARN_CANT_DROP_DEFAULT_KEYCACHE';
+exports[1439] = 'ER_TOO_BIG_DISPLAYWIDTH';
+exports[1440] = 'ER_XAER_DUPID';
+exports[1441] = 'ER_DATETIME_FUNCTION_OVERFLOW';
+exports[1442] = 'ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG';
+exports[1443] = 'ER_VIEW_PREVENT_UPDATE';
+exports[1444] = 'ER_PS_NO_RECURSION';
+exports[1445] = 'ER_SP_CANT_SET_AUTOCOMMIT';
+exports[1446] = 'ER_MALFORMED_DEFINER';
+exports[1447] = 'ER_VIEW_FRM_NO_USER';
+exports[1448] = 'ER_VIEW_OTHER_USER';
+exports[1449] = 'ER_NO_SUCH_USER';
+exports[1450] = 'ER_FORBID_SCHEMA_CHANGE';
+exports[1451] = 'ER_ROW_IS_REFERENCED_2';
+exports[1452] = 'ER_NO_REFERENCED_ROW_2';
+exports[1453] = 'ER_SP_BAD_VAR_SHADOW';
+exports[1454] = 'ER_TRG_NO_DEFINER';
+exports[1455] = 'ER_OLD_FILE_FORMAT';
+exports[1456] = 'ER_SP_RECURSION_LIMIT';
+exports[1457] = 'ER_SP_PROC_TABLE_CORRUPT';
+exports[1458] = 'ER_SP_WRONG_NAME';
+exports[1459] = 'ER_TABLE_NEEDS_UPGRADE';
+exports[1460] = 'ER_SP_NO_AGGREGATE';
+exports[1461] = 'ER_MAX_PREPARED_STMT_COUNT_REACHED';
+exports[1462] = 'ER_VIEW_RECURSIVE';
+exports[1463] = 'ER_NON_GROUPING_FIELD_USED';
+exports[1464] = 'ER_TABLE_CANT_HANDLE_SPKEYS';
+exports[1465] = 'ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA';
+exports[1466] = 'ER_REMOVED_SPACES';
+exports[1467] = 'ER_AUTOINC_READ_FAILED';
+exports[1468] = 'ER_USERNAME';
+exports[1469] = 'ER_HOSTNAME';
+exports[1470] = 'ER_WRONG_STRING_LENGTH';
+exports[1471] = 'ER_NON_INSERTABLE_TABLE';
+exports[1472] = 'ER_ADMIN_WRONG_MRG_TABLE';
+exports[1473] = 'ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT';
+exports[1474] = 'ER_NAME_BECOMES_EMPTY';
+exports[1475] = 'ER_AMBIGUOUS_FIELD_TERM';
+exports[1476] = 'ER_FOREIGN_SERVER_EXISTS';
+exports[1477] = 'ER_FOREIGN_SERVER_DOESNT_EXIST';
+exports[1478] = 'ER_ILLEGAL_HA_CREATE_OPTION';
+exports[1479] = 'ER_PARTITION_REQUIRES_VALUES_ERROR';
+exports[1480] = 'ER_PARTITION_WRONG_VALUES_ERROR';
+exports[1481] = 'ER_PARTITION_MAXVALUE_ERROR';
+exports[1482] = 'ER_PARTITION_SUBPARTITION_ERROR';
+exports[1483] = 'ER_PARTITION_SUBPART_MIX_ERROR';
+exports[1484] = 'ER_PARTITION_WRONG_NO_PART_ERROR';
+exports[1485] = 'ER_PARTITION_WRONG_NO_SUBPART_ERROR';
+exports[1486] = 'ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR';
+exports[1487] = 'ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR';
+exports[1488] = 'ER_FIELD_NOT_FOUND_PART_ERROR';
+exports[1489] = 'ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR';
+exports[1490] = 'ER_INCONSISTENT_PARTITION_INFO_ERROR';
+exports[1491] = 'ER_PARTITION_FUNC_NOT_ALLOWED_ERROR';
+exports[1492] = 'ER_PARTITIONS_MUST_BE_DEFINED_ERROR';
+exports[1493] = 'ER_RANGE_NOT_INCREASING_ERROR';
+exports[1494] = 'ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR';
+exports[1495] = 'ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR';
+exports[1496] = 'ER_PARTITION_ENTRY_ERROR';
+exports[1497] = 'ER_MIX_HANDLER_ERROR';
+exports[1498] = 'ER_PARTITION_NOT_DEFINED_ERROR';
+exports[1499] = 'ER_TOO_MANY_PARTITIONS_ERROR';
+exports[1500] = 'ER_SUBPARTITION_ERROR';
+exports[1501] = 'ER_CANT_CREATE_HANDLER_FILE';
+exports[1502] = 'ER_BLOB_FIELD_IN_PART_FUNC_ERROR';
+exports[1503] = 'ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF';
+exports[1504] = 'ER_NO_PARTS_ERROR';
+exports[1505] = 'ER_PARTITION_MGMT_ON_NONPARTITIONED';
+exports[1506] = 'ER_FOREIGN_KEY_ON_PARTITIONED';
+exports[1507] = 'ER_DROP_PARTITION_NON_EXISTENT';
+exports[1508] = 'ER_DROP_LAST_PARTITION';
+exports[1509] = 'ER_COALESCE_ONLY_ON_HASH_PARTITION';
+exports[1510] = 'ER_REORG_HASH_ONLY_ON_SAME_NO';
+exports[1511] = 'ER_REORG_NO_PARAM_ERROR';
+exports[1512] = 'ER_ONLY_ON_RANGE_LIST_PARTITION';
+exports[1513] = 'ER_ADD_PARTITION_SUBPART_ERROR';
+exports[1514] = 'ER_ADD_PARTITION_NO_NEW_PARTITION';
+exports[1515] = 'ER_COALESCE_PARTITION_NO_PARTITION';
+exports[1516] = 'ER_REORG_PARTITION_NOT_EXIST';
+exports[1517] = 'ER_SAME_NAME_PARTITION';
+exports[1518] = 'ER_NO_BINLOG_ERROR';
+exports[1519] = 'ER_CONSECUTIVE_REORG_PARTITIONS';
+exports[1520] = 'ER_REORG_OUTSIDE_RANGE';
+exports[1521] = 'ER_PARTITION_FUNCTION_FAILURE';
+exports[1522] = 'ER_PART_STATE_ERROR';
+exports[1523] = 'ER_LIMITED_PART_RANGE';
+exports[1524] = 'ER_PLUGIN_IS_NOT_LOADED';
+exports[1525] = 'ER_WRONG_VALUE';
+exports[1526] = 'ER_NO_PARTITION_FOR_GIVEN_VALUE';
+exports[1527] = 'ER_FILEGROUP_OPTION_ONLY_ONCE';
+exports[1528] = 'ER_CREATE_FILEGROUP_FAILED';
+exports[1529] = 'ER_DROP_FILEGROUP_FAILED';
+exports[1530] = 'ER_TABLESPACE_AUTO_EXTEND_ERROR';
+exports[1531] = 'ER_WRONG_SIZE_NUMBER';
+exports[1532] = 'ER_SIZE_OVERFLOW_ERROR';
+exports[1533] = 'ER_ALTER_FILEGROUP_FAILED';
+exports[1534] = 'ER_BINLOG_ROW_LOGGING_FAILED';
+exports[1535] = 'ER_BINLOG_ROW_WRONG_TABLE_DEF';
+exports[1536] = 'ER_BINLOG_ROW_RBR_TO_SBR';
+exports[1537] = 'ER_EVENT_ALREADY_EXISTS';
+exports[1538] = 'ER_EVENT_STORE_FAILED';
+exports[1539] = 'ER_EVENT_DOES_NOT_EXIST';
+exports[1540] = 'ER_EVENT_CANT_ALTER';
+exports[1541] = 'ER_EVENT_DROP_FAILED';
+exports[1542] = 'ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG';
+exports[1543] = 'ER_EVENT_ENDS_BEFORE_STARTS';
+exports[1544] = 'ER_EVENT_EXEC_TIME_IN_THE_PAST';
+exports[1545] = 'ER_EVENT_OPEN_TABLE_FAILED';
+exports[1546] = 'ER_EVENT_NEITHER_M_EXPR_NOR_M_AT';
+exports[1547] = 'ER_COL_COUNT_DOESNT_MATCH_CORRUPTED';
+exports[1548] = 'ER_CANNOT_LOAD_FROM_TABLE';
+exports[1549] = 'ER_EVENT_CANNOT_DELETE';
+exports[1550] = 'ER_EVENT_COMPILE_ERROR';
+exports[1551] = 'ER_EVENT_SAME_NAME';
+exports[1552] = 'ER_EVENT_DATA_TOO_LONG';
+exports[1553] = 'ER_DROP_INDEX_FK';
+exports[1554] = 'ER_WARN_DEPRECATED_SYNTAX_WITH_VER';
+exports[1555] = 'ER_CANT_WRITE_LOCK_LOG_TABLE';
+exports[1556] = 'ER_CANT_LOCK_LOG_TABLE';
+exports[1557] = 'ER_FOREIGN_DUPLICATE_KEY';
+exports[1558] = 'ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE';
+exports[1559] = 'ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR';
+exports[1560] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT';
+exports[1561] = 'ER_NDB_CANT_SWITCH_BINLOG_FORMAT';
+exports[1562] = 'ER_PARTITION_NO_TEMPORARY';
+exports[1563] = 'ER_PARTITION_CONST_DOMAIN_ERROR';
+exports[1564] = 'ER_PARTITION_FUNCTION_IS_NOT_ALLOWED';
+exports[1565] = 'ER_DDL_LOG_ERROR';
+exports[1566] = 'ER_NULL_IN_VALUES_LESS_THAN';
+exports[1567] = 'ER_WRONG_PARTITION_NAME';
+exports[1568] = 'ER_CANT_CHANGE_TX_CHARACTERISTICS';
+exports[1569] = 'ER_DUP_ENTRY_AUTOINCREMENT_CASE';
+exports[1570] = 'ER_EVENT_MODIFY_QUEUE_ERROR';
+exports[1571] = 'ER_EVENT_SET_VAR_ERROR';
+exports[1572] = 'ER_PARTITION_MERGE_ERROR';
+exports[1573] = 'ER_CANT_ACTIVATE_LOG';
+exports[1574] = 'ER_RBR_NOT_AVAILABLE';
+exports[1575] = 'ER_BASE64_DECODE_ERROR';
+exports[1576] = 'ER_EVENT_RECURSION_FORBIDDEN';
+exports[1577] = 'ER_EVENTS_DB_ERROR';
+exports[1578] = 'ER_ONLY_INTEGERS_ALLOWED';
+exports[1579] = 'ER_UNSUPORTED_LOG_ENGINE';
+exports[1580] = 'ER_BAD_LOG_STATEMENT';
+exports[1581] = 'ER_CANT_RENAME_LOG_TABLE';
+exports[1582] = 'ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT';
+exports[1583] = 'ER_WRONG_PARAMETERS_TO_NATIVE_FCT';
+exports[1584] = 'ER_WRONG_PARAMETERS_TO_STORED_FCT';
+exports[1585] = 'ER_NATIVE_FCT_NAME_COLLISION';
+exports[1586] = 'ER_DUP_ENTRY_WITH_KEY_NAME';
+exports[1587] = 'ER_BINLOG_PURGE_EMFILE';
+exports[1588] = 'ER_EVENT_CANNOT_CREATE_IN_THE_PAST';
+exports[1589] = 'ER_EVENT_CANNOT_ALTER_IN_THE_PAST';
+exports[1590] = 'ER_SLAVE_INCIDENT';
+exports[1591] = 'ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT';
+exports[1592] = 'ER_BINLOG_UNSAFE_STATEMENT';
+exports[1593] = 'ER_BINLOG_FATAL_ERROR';
+exports[1594] = 'ER_SLAVE_RELAY_LOG_READ_FAILURE';
+exports[1595] = 'ER_SLAVE_RELAY_LOG_WRITE_FAILURE';
+exports[1596] = 'ER_SLAVE_CREATE_EVENT_FAILURE';
+exports[1597] = 'ER_SLAVE_MASTER_COM_FAILURE';
+exports[1598] = 'ER_BINLOG_LOGGING_IMPOSSIBLE';
+exports[1599] = 'ER_VIEW_NO_CREATION_CTX';
+exports[1600] = 'ER_VIEW_INVALID_CREATION_CTX';
+exports[1601] = 'ER_SR_INVALID_CREATION_CTX';
+exports[1602] = 'ER_TRG_CORRUPTED_FILE';
+exports[1603] = 'ER_TRG_NO_CREATION_CTX';
+exports[1604] = 'ER_TRG_INVALID_CREATION_CTX';
+exports[1605] = 'ER_EVENT_INVALID_CREATION_CTX';
+exports[1606] = 'ER_TRG_CANT_OPEN_TABLE';
+exports[1607] = 'ER_CANT_CREATE_SROUTINE';
+exports[1608] = 'ER_NEVER_USED';
+exports[1609] = 'ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT';
+exports[1610] = 'ER_REPLICA_CORRUPT_EVENT';
+exports[1611] = 'ER_LOAD_DATA_INVALID_COLUMN';
+exports[1612] = 'ER_LOG_PURGE_NO_FILE';
+exports[1613] = 'ER_XA_RBTIMEOUT';
+exports[1614] = 'ER_XA_RBDEADLOCK';
+exports[1615] = 'ER_NEED_REPREPARE';
+exports[1616] = 'ER_DELAYED_NOT_SUPPORTED';
+exports[1617] = 'WARN_NO_CONNECTION_METADATA';
+exports[1618] = 'WARN_OPTION_IGNORED';
+exports[1619] = 'ER_PLUGIN_DELETE_BUILTIN';
+exports[1620] = 'WARN_PLUGIN_BUSY';
+exports[1621] = 'ER_VARIABLE_IS_READONLY';
+exports[1622] = 'ER_WARN_ENGINE_TRANSACTION_ROLLBACK';
+exports[1623] = 'ER_SLAVE_HEARTBEAT_FAILURE';
+exports[1624] = 'ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE';
+exports[1625] = 'ER_NDB_REPLICATION_SCHEMA_ERROR';
+exports[1626] = 'ER_CONFLICT_FN_PARSE_ERROR';
+exports[1627] = 'ER_EXCEPTIONS_WRITE_ERROR';
+exports[1628] = 'ER_TOO_LONG_TABLE_COMMENT';
+exports[1629] = 'ER_TOO_LONG_FIELD_COMMENT';
+exports[1630] = 'ER_FUNC_INEXISTENT_NAME_COLLISION';
+exports[1631] = 'ER_DATABASE_NAME';
+exports[1632] = 'ER_TABLE_NAME';
+exports[1633] = 'ER_PARTITION_NAME';
+exports[1634] = 'ER_SUBPARTITION_NAME';
+exports[1635] = 'ER_TEMPORARY_NAME';
+exports[1636] = 'ER_RENAMED_NAME';
+exports[1637] = 'ER_TOO_MANY_CONCURRENT_TRXS';
+exports[1638] = 'WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED';
+exports[1639] = 'ER_DEBUG_SYNC_TIMEOUT';
+exports[1640] = 'ER_DEBUG_SYNC_HIT_LIMIT';
+exports[1641] = 'ER_DUP_SIGNAL_SET';
+exports[1642] = 'ER_SIGNAL_WARN';
+exports[1643] = 'ER_SIGNAL_NOT_FOUND';
+exports[1644] = 'ER_SIGNAL_EXCEPTION';
+exports[1645] = 'ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER';
+exports[1646] = 'ER_SIGNAL_BAD_CONDITION_TYPE';
+exports[1647] = 'WARN_COND_ITEM_TRUNCATED';
+exports[1648] = 'ER_COND_ITEM_TOO_LONG';
+exports[1649] = 'ER_UNKNOWN_LOCALE';
+exports[1650] = 'ER_REPLICA_IGNORE_SERVER_IDS';
+exports[1651] = 'ER_QUERY_CACHE_DISABLED';
+exports[1652] = 'ER_SAME_NAME_PARTITION_FIELD';
+exports[1653] = 'ER_PARTITION_COLUMN_LIST_ERROR';
+exports[1654] = 'ER_WRONG_TYPE_COLUMN_VALUE_ERROR';
+exports[1655] = 'ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR';
+exports[1656] = 'ER_MAXVALUE_IN_VALUES_IN';
+exports[1657] = 'ER_TOO_MANY_VALUES_ERROR';
+exports[1658] = 'ER_ROW_SINGLE_PARTITION_FIELD_ERROR';
+exports[1659] = 'ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD';
+exports[1660] = 'ER_PARTITION_FIELDS_TOO_LONG';
+exports[1661] = 'ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE';
+exports[1662] = 'ER_BINLOG_ROW_MODE_AND_STMT_ENGINE';
+exports[1663] = 'ER_BINLOG_UNSAFE_AND_STMT_ENGINE';
+exports[1664] = 'ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE';
+exports[1665] = 'ER_BINLOG_STMT_MODE_AND_ROW_ENGINE';
+exports[1666] = 'ER_BINLOG_ROW_INJECTION_AND_STMT_MODE';
+exports[1667] = 'ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE';
+exports[1668] = 'ER_BINLOG_UNSAFE_LIMIT';
+exports[1669] = 'ER_UNUSED4';
+exports[1670] = 'ER_BINLOG_UNSAFE_SYSTEM_TABLE';
+exports[1671] = 'ER_BINLOG_UNSAFE_AUTOINC_COLUMNS';
+exports[1672] = 'ER_BINLOG_UNSAFE_UDF';
+exports[1673] = 'ER_BINLOG_UNSAFE_SYSTEM_VARIABLE';
+exports[1674] = 'ER_BINLOG_UNSAFE_SYSTEM_FUNCTION';
+exports[1675] = 'ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS';
+exports[1676] = 'ER_MESSAGE_AND_STATEMENT';
+exports[1677] = 'ER_SLAVE_CONVERSION_FAILED';
+exports[1678] = 'ER_REPLICA_CANT_CREATE_CONVERSION';
+exports[1679] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT';
+exports[1680] = 'ER_PATH_LENGTH';
+exports[1681] = 'ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT';
+exports[1682] = 'ER_WRONG_NATIVE_TABLE_STRUCTURE';
+exports[1683] = 'ER_WRONG_PERFSCHEMA_USAGE';
+exports[1684] = 'ER_WARN_I_S_SKIPPED_TABLE';
+exports[1685] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT';
+exports[1686] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT';
+exports[1687] = 'ER_SPATIAL_MUST_HAVE_GEOM_COL';
+exports[1688] = 'ER_TOO_LONG_INDEX_COMMENT';
+exports[1689] = 'ER_LOCK_ABORTED';
+exports[1690] = 'ER_DATA_OUT_OF_RANGE';
+exports[1691] = 'ER_WRONG_SPVAR_TYPE_IN_LIMIT';
+exports[1692] = 'ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE';
+exports[1693] = 'ER_BINLOG_UNSAFE_MIXED_STATEMENT';
+exports[1694] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN';
+exports[1695] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN';
+exports[1696] = 'ER_FAILED_READ_FROM_PAR_FILE';
+exports[1697] = 'ER_VALUES_IS_NOT_INT_TYPE_ERROR';
+exports[1698] = 'ER_ACCESS_DENIED_NO_PASSWORD_ERROR';
+exports[1699] = 'ER_SET_PASSWORD_AUTH_PLUGIN';
+exports[1700] = 'ER_GRANT_PLUGIN_USER_EXISTS';
+exports[1701] = 'ER_TRUNCATE_ILLEGAL_FK';
+exports[1702] = 'ER_PLUGIN_IS_PERMANENT';
+exports[1703] = 'ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN';
+exports[1704] = 'ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX';
+exports[1705] = 'ER_STMT_CACHE_FULL';
+exports[1706] = 'ER_MULTI_UPDATE_KEY_CONFLICT';
+exports[1707] = 'ER_TABLE_NEEDS_REBUILD';
+exports[1708] = 'WARN_OPTION_BELOW_LIMIT';
+exports[1709] = 'ER_INDEX_COLUMN_TOO_LONG';
+exports[1710] = 'ER_ERROR_IN_TRIGGER_BODY';
+exports[1711] = 'ER_ERROR_IN_UNKNOWN_TRIGGER_BODY';
+exports[1712] = 'ER_INDEX_CORRUPT';
+exports[1713] = 'ER_UNDO_RECORD_TOO_BIG';
+exports[1714] = 'ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT';
+exports[1715] = 'ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE';
+exports[1716] = 'ER_BINLOG_UNSAFE_REPLACE_SELECT';
+exports[1717] = 'ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT';
+exports[1718] = 'ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT';
+exports[1719] = 'ER_BINLOG_UNSAFE_UPDATE_IGNORE';
+exports[1720] = 'ER_PLUGIN_NO_UNINSTALL';
+exports[1721] = 'ER_PLUGIN_NO_INSTALL';
+exports[1722] = 'ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT';
+exports[1723] = 'ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC';
+exports[1724] = 'ER_BINLOG_UNSAFE_INSERT_TWO_KEYS';
+exports[1725] = 'ER_TABLE_IN_FK_CHECK';
+exports[1726] = 'ER_UNSUPPORTED_ENGINE';
+exports[1727] = 'ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST';
+exports[1728] = 'ER_CANNOT_LOAD_FROM_TABLE_V2';
+exports[1729] = 'ER_SOURCE_DELAY_VALUE_OUT_OF_RANGE';
+exports[1730] = 'ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT';
+exports[1731] = 'ER_PARTITION_EXCHANGE_DIFFERENT_OPTION';
+exports[1732] = 'ER_PARTITION_EXCHANGE_PART_TABLE';
+exports[1733] = 'ER_PARTITION_EXCHANGE_TEMP_TABLE';
+exports[1734] = 'ER_PARTITION_INSTEAD_OF_SUBPARTITION';
+exports[1735] = 'ER_UNKNOWN_PARTITION';
+exports[1736] = 'ER_TABLES_DIFFERENT_METADATA';
+exports[1737] = 'ER_ROW_DOES_NOT_MATCH_PARTITION';
+exports[1738] = 'ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX';
+exports[1739] = 'ER_WARN_INDEX_NOT_APPLICABLE';
+exports[1740] = 'ER_PARTITION_EXCHANGE_FOREIGN_KEY';
+exports[1741] = 'ER_NO_SUCH_KEY_VALUE';
+exports[1742] = 'ER_RPL_INFO_DATA_TOO_LONG';
+exports[1743] = 'ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE';
+exports[1744] = 'ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE';
+exports[1745] = 'ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX';
+exports[1746] = 'ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT';
+exports[1747] = 'ER_PARTITION_CLAUSE_ON_NONPARTITIONED';
+exports[1748] = 'ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET';
+exports[1749] = 'ER_NO_SUCH_PARTITION';
+exports[1750] = 'ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE';
+exports[1751] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE';
+exports[1752] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE';
+exports[1753] = 'ER_MTA_FEATURE_IS_NOT_SUPPORTED';
+exports[1754] = 'ER_MTA_UPDATED_DBS_GREATER_MAX';
+exports[1755] = 'ER_MTA_CANT_PARALLEL';
+exports[1756] = 'ER_MTA_INCONSISTENT_DATA';
+exports[1757] = 'ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING';
+exports[1758] = 'ER_DA_INVALID_CONDITION_NUMBER';
+exports[1759] = 'ER_INSECURE_PLAIN_TEXT';
+exports[1760] = 'ER_INSECURE_CHANGE_SOURCE';
+exports[1761] = 'ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO';
+exports[1762] = 'ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO';
+exports[1763] = 'ER_SQLTHREAD_WITH_SECURE_REPLICA';
+exports[1764] = 'ER_TABLE_HAS_NO_FT';
+exports[1765] = 'ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER';
+exports[1766] = 'ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION';
+exports[1767] = 'ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST';
+exports[1768] = 'ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION';
+exports[1769] = 'ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION';
+exports[1770] = 'ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL';
+exports[1771] = 'ER_SKIPPING_LOGGED_TRANSACTION';
+exports[1772] = 'ER_MALFORMED_GTID_SET_SPECIFICATION';
+exports[1773] = 'ER_MALFORMED_GTID_SET_ENCODING';
+exports[1774] = 'ER_MALFORMED_GTID_SPECIFICATION';
+exports[1775] = 'ER_GNO_EXHAUSTED';
+exports[1776] = 'ER_BAD_REPLICA_AUTO_POSITION';
+exports[1777] = 'ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF';
+exports[1778] = 'ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET';
+exports[1779] = 'ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON';
+exports[1780] = 'ER_GTID_MODE_REQUIRES_BINLOG';
+exports[1781] = 'ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF';
+exports[1782] = 'ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON';
+exports[1783] = 'ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF';
+exports[1784] = 'ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF';
+exports[1785] = 'ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE';
+exports[1786] = 'ER_GTID_UNSAFE_CREATE_SELECT';
+exports[1787] = 'ER_GTID_UNSAFE_CREATE_DROP_TEMP_TABLE_IN_TRANSACTION';
+exports[1788] = 'ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME';
+exports[1789] = 'ER_SOURCE_HAS_PURGED_REQUIRED_GTIDS';
+exports[1790] = 'ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID';
+exports[1791] = 'ER_UNKNOWN_EXPLAIN_FORMAT';
+exports[1792] = 'ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION';
+exports[1793] = 'ER_TOO_LONG_TABLE_PARTITION_COMMENT';
+exports[1794] = 'ER_REPLICA_CONFIGURATION';
+exports[1795] = 'ER_INNODB_FT_LIMIT';
+exports[1796] = 'ER_INNODB_NO_FT_TEMP_TABLE';
+exports[1797] = 'ER_INNODB_FT_WRONG_DOCID_COLUMN';
+exports[1798] = 'ER_INNODB_FT_WRONG_DOCID_INDEX';
+exports[1799] = 'ER_INNODB_ONLINE_LOG_TOO_BIG';
+exports[1800] = 'ER_UNKNOWN_ALTER_ALGORITHM';
+exports[1801] = 'ER_UNKNOWN_ALTER_LOCK';
+exports[1802] = 'ER_MTA_CHANGE_SOURCE_CANT_RUN_WITH_GAPS';
+exports[1803] = 'ER_MTA_RECOVERY_FAILURE';
+exports[1804] = 'ER_MTA_RESET_WORKERS';
+exports[1805] = 'ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2';
+exports[1806] = 'ER_REPLICA_SILENT_RETRY_TRANSACTION';
+exports[1807] = 'ER_DISCARD_FK_CHECKS_RUNNING';
+exports[1808] = 'ER_TABLE_SCHEMA_MISMATCH';
+exports[1809] = 'ER_TABLE_IN_SYSTEM_TABLESPACE';
+exports[1810] = 'ER_IO_READ_ERROR';
+exports[1811] = 'ER_IO_WRITE_ERROR';
+exports[1812] = 'ER_TABLESPACE_MISSING';
+exports[1813] = 'ER_TABLESPACE_EXISTS';
+exports[1814] = 'ER_TABLESPACE_DISCARDED';
+exports[1815] = 'ER_INTERNAL_ERROR';
+exports[1816] = 'ER_INNODB_IMPORT_ERROR';
+exports[1817] = 'ER_INNODB_INDEX_CORRUPT';
+exports[1818] = 'ER_INVALID_YEAR_COLUMN_LENGTH';
+exports[1819] = 'ER_NOT_VALID_PASSWORD';
+exports[1820] = 'ER_MUST_CHANGE_PASSWORD';
+exports[1821] = 'ER_FK_NO_INDEX_CHILD';
+exports[1822] = 'ER_FK_NO_INDEX_PARENT';
+exports[1823] = 'ER_FK_FAIL_ADD_SYSTEM';
+exports[1824] = 'ER_FK_CANNOT_OPEN_PARENT';
+exports[1825] = 'ER_FK_INCORRECT_OPTION';
+exports[1826] = 'ER_FK_DUP_NAME';
+exports[1827] = 'ER_PASSWORD_FORMAT';
+exports[1828] = 'ER_FK_COLUMN_CANNOT_DROP';
+exports[1829] = 'ER_FK_COLUMN_CANNOT_DROP_CHILD';
+exports[1830] = 'ER_FK_COLUMN_NOT_NULL';
+exports[1831] = 'ER_DUP_INDEX';
+exports[1832] = 'ER_FK_COLUMN_CANNOT_CHANGE';
+exports[1833] = 'ER_FK_COLUMN_CANNOT_CHANGE_CHILD';
+exports[1834] = 'ER_UNUSED5';
+exports[1835] = 'ER_MALFORMED_PACKET';
+exports[1836] = 'ER_READ_ONLY_MODE';
+exports[1837] = 'ER_GTID_NEXT_TYPE_UNDEFINED_GTID';
+exports[1838] = 'ER_VARIABLE_NOT_SETTABLE_IN_SP';
+exports[1839] = 'ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF';
+exports[1840] = 'ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY';
+exports[1841] = 'ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY';
+exports[1842] = 'ER_GTID_PURGED_WAS_CHANGED';
+exports[1843] = 'ER_GTID_EXECUTED_WAS_CHANGED';
+exports[1844] = 'ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES';
+exports[1845] = 'ER_ALTER_OPERATION_NOT_SUPPORTED';
+exports[1846] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON';
+exports[1847] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY';
+exports[1848] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION';
+exports[1849] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME';
+exports[1850] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE';
+exports[1851] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK';
+exports[1852] = 'ER_UNUSED6';
+exports[1853] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK';
+exports[1854] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC';
+exports[1855] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS';
+exports[1856] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS';
+exports[1857] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS';
+exports[1858] = 'ER_SQL_REPLICA_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE';
+exports[1859] = 'ER_DUP_UNKNOWN_IN_INDEX';
+exports[1860] = 'ER_IDENT_CAUSES_TOO_LONG_PATH';
+exports[1861] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL';
+exports[1862] = 'ER_MUST_CHANGE_PASSWORD_LOGIN';
+exports[1863] = 'ER_ROW_IN_WRONG_PARTITION';
+exports[1864] = 'ER_MTA_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX';
+exports[1865] = 'ER_INNODB_NO_FT_USES_PARSER';
+exports[1866] = 'ER_BINLOG_LOGICAL_CORRUPTION';
+exports[1867] = 'ER_WARN_PURGE_LOG_IN_USE';
+exports[1868] = 'ER_WARN_PURGE_LOG_IS_ACTIVE';
+exports[1869] = 'ER_AUTO_INCREMENT_CONFLICT';
+exports[1870] = 'WARN_ON_BLOCKHOLE_IN_RBR';
+exports[1871] = 'ER_REPLICA_CM_INIT_REPOSITORY';
+exports[1872] = 'ER_REPLICA_AM_INIT_REPOSITORY';
+exports[1873] = 'ER_ACCESS_DENIED_CHANGE_USER_ERROR';
+exports[1874] = 'ER_INNODB_READ_ONLY';
+exports[1875] = 'ER_STOP_REPLICA_SQL_THREAD_TIMEOUT';
+exports[1876] = 'ER_STOP_REPLICA_IO_THREAD_TIMEOUT';
+exports[1877] = 'ER_TABLE_CORRUPT';
+exports[1878] = 'ER_TEMP_FILE_WRITE_FAILURE';
+exports[1879] = 'ER_INNODB_FT_AUX_NOT_HEX_ID';
+exports[1880] = 'ER_OLD_TEMPORALS_UPGRADED';
+exports[1881] = 'ER_INNODB_FORCED_RECOVERY';
+exports[1882] = 'ER_AES_INVALID_IV';
+exports[1883] = 'ER_PLUGIN_CANNOT_BE_UNINSTALLED';
+exports[1884] = 'ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_ASSIGNED_GTID';
+exports[1885] = 'ER_REPLICA_HAS_MORE_GTIDS_THAN_SOURCE';
+exports[1886] = 'ER_MISSING_KEY';
+exports[1887] = 'WARN_NAMED_PIPE_ACCESS_EVERYONE';
+exports[3000] = 'ER_FILE_CORRUPT';
+exports[3001] = 'ER_ERROR_ON_SOURCE';
+exports[3002] = 'ER_INCONSISTENT_ERROR';
+exports[3003] = 'ER_STORAGE_ENGINE_NOT_LOADED';
+exports[3004] = 'ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER';
+exports[3005] = 'ER_WARN_LEGACY_SYNTAX_CONVERTED';
+exports[3006] = 'ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN';
+exports[3007] = 'ER_CANNOT_DISCARD_TEMPORARY_TABLE';
+exports[3008] = 'ER_FK_DEPTH_EXCEEDED';
+exports[3009] = 'ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2';
+exports[3010] = 'ER_WARN_TRIGGER_DOESNT_HAVE_CREATED';
+exports[3011] = 'ER_REFERENCED_TRG_DOES_NOT_EXIST';
+exports[3012] = 'ER_EXPLAIN_NOT_SUPPORTED';
+exports[3013] = 'ER_INVALID_FIELD_SIZE';
+exports[3014] = 'ER_MISSING_HA_CREATE_OPTION';
+exports[3015] = 'ER_ENGINE_OUT_OF_MEMORY';
+exports[3016] = 'ER_PASSWORD_EXPIRE_ANONYMOUS_USER';
+exports[3017] = 'ER_REPLICA_SQL_THREAD_MUST_STOP';
+exports[3018] = 'ER_NO_FT_MATERIALIZED_SUBQUERY';
+exports[3019] = 'ER_INNODB_UNDO_LOG_FULL';
+exports[3020] = 'ER_INVALID_ARGUMENT_FOR_LOGARITHM';
+exports[3021] = 'ER_REPLICA_CHANNEL_IO_THREAD_MUST_STOP';
+exports[3022] = 'ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO';
+exports[3023] = 'ER_WARN_ONLY_SOURCE_LOG_FILE_NO_POS';
+exports[3024] = 'ER_QUERY_TIMEOUT';
+exports[3025] = 'ER_NON_RO_SELECT_DISABLE_TIMER';
+exports[3026] = 'ER_DUP_LIST_ENTRY';
+exports[3027] = 'ER_SQL_MODE_NO_EFFECT';
+exports[3028] = 'ER_AGGREGATE_ORDER_FOR_UNION';
+exports[3029] = 'ER_AGGREGATE_ORDER_NON_AGG_QUERY';
+exports[3030] = 'ER_REPLICA_WORKER_STOPPED_PREVIOUS_THD_ERROR';
+exports[3031] = 'ER_DONT_SUPPORT_REPLICA_PRESERVE_COMMIT_ORDER';
+exports[3032] = 'ER_SERVER_OFFLINE_MODE';
+exports[3033] = 'ER_GIS_DIFFERENT_SRIDS';
+exports[3034] = 'ER_GIS_UNSUPPORTED_ARGUMENT';
+exports[3035] = 'ER_GIS_UNKNOWN_ERROR';
+exports[3036] = 'ER_GIS_UNKNOWN_EXCEPTION';
+exports[3037] = 'ER_GIS_INVALID_DATA';
+exports[3038] = 'ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION';
+exports[3039] = 'ER_BOOST_GEOMETRY_CENTROID_EXCEPTION';
+exports[3040] = 'ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION';
+exports[3041] = 'ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION';
+exports[3042] = 'ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION';
+exports[3043] = 'ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION';
+exports[3044] = 'ER_STD_BAD_ALLOC_ERROR';
+exports[3045] = 'ER_STD_DOMAIN_ERROR';
+exports[3046] = 'ER_STD_LENGTH_ERROR';
+exports[3047] = 'ER_STD_INVALID_ARGUMENT';
+exports[3048] = 'ER_STD_OUT_OF_RANGE_ERROR';
+exports[3049] = 'ER_STD_OVERFLOW_ERROR';
+exports[3050] = 'ER_STD_RANGE_ERROR';
+exports[3051] = 'ER_STD_UNDERFLOW_ERROR';
+exports[3052] = 'ER_STD_LOGIC_ERROR';
+exports[3053] = 'ER_STD_RUNTIME_ERROR';
+exports[3054] = 'ER_STD_UNKNOWN_EXCEPTION';
+exports[3055] = 'ER_GIS_DATA_WRONG_ENDIANESS';
+exports[3056] = 'ER_CHANGE_SOURCE_PASSWORD_LENGTH';
+exports[3057] = 'ER_USER_LOCK_WRONG_NAME';
+exports[3058] = 'ER_USER_LOCK_DEADLOCK';
+exports[3059] = 'ER_REPLACE_INACCESSIBLE_ROWS';
+exports[3060] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS';
+exports[3061] = 'ER_ILLEGAL_USER_VAR';
+exports[3062] = 'ER_GTID_MODE_OFF';
+exports[3063] = 'ER_UNSUPPORTED_BY_REPLICATION_THREAD';
+exports[3064] = 'ER_INCORRECT_TYPE';
+exports[3065] = 'ER_FIELD_IN_ORDER_NOT_SELECT';
+exports[3066] = 'ER_AGGREGATE_IN_ORDER_NOT_SELECT';
+exports[3067] = 'ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN';
+exports[3068] = 'ER_NET_OK_PACKET_TOO_LARGE';
+exports[3069] = 'ER_INVALID_JSON_DATA';
+exports[3070] = 'ER_INVALID_GEOJSON_MISSING_MEMBER';
+exports[3071] = 'ER_INVALID_GEOJSON_WRONG_TYPE';
+exports[3072] = 'ER_INVALID_GEOJSON_UNSPECIFIED';
+exports[3073] = 'ER_DIMENSION_UNSUPPORTED';
+exports[3074] = 'ER_REPLICA_CHANNEL_DOES_NOT_EXIST';
+exports[3075] = 'ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT';
+exports[3076] = 'ER_REPLICA_CHANNEL_NAME_INVALID_OR_TOO_LONG';
+exports[3077] = 'ER_REPLICA_NEW_CHANNEL_WRONG_REPOSITORY';
+exports[3078] = 'ER_SLAVE_CHANNEL_DELETE';
+exports[3079] = 'ER_REPLICA_MULTIPLE_CHANNELS_CMD';
+exports[3080] = 'ER_REPLICA_MAX_CHANNELS_EXCEEDED';
+exports[3081] = 'ER_REPLICA_CHANNEL_MUST_STOP';
+exports[3082] = 'ER_REPLICA_CHANNEL_NOT_RUNNING';
+exports[3083] = 'ER_REPLICA_CHANNEL_WAS_RUNNING';
+exports[3084] = 'ER_REPLICA_CHANNEL_WAS_NOT_RUNNING';
+exports[3085] = 'ER_REPLICA_CHANNEL_SQL_THREAD_MUST_STOP';
+exports[3086] = 'ER_REPLICA_CHANNEL_SQL_SKIP_COUNTER';
+exports[3087] = 'ER_WRONG_FIELD_WITH_GROUP_V2';
+exports[3088] = 'ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2';
+exports[3089] = 'ER_WARN_DEPRECATED_SYSVAR_UPDATE';
+exports[3090] = 'ER_WARN_DEPRECATED_SQLMODE';
+exports[3091] = 'ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID';
+exports[3092] = 'ER_GROUP_REPLICATION_CONFIGURATION';
+exports[3093] = 'ER_GROUP_REPLICATION_RUNNING';
+exports[3094] = 'ER_GROUP_REPLICATION_APPLIER_INIT_ERROR';
+exports[3095] = 'ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT';
+exports[3096] = 'ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR';
+exports[3097] = 'ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR';
+exports[3098] = 'ER_BEFORE_DML_VALIDATION_ERROR';
+exports[3099] = 'ER_PREVENTS_VARIABLE_WITHOUT_RBR';
+exports[3100] = 'ER_RUN_HOOK_ERROR';
+exports[3101] = 'ER_TRANSACTION_ROLLBACK_DURING_COMMIT';
+exports[3102] = 'ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED';
+exports[3103] = 'ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN';
+exports[3104] = 'ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN';
+exports[3105] = 'ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN';
+exports[3106] = 'ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN';
+exports[3107] = 'ER_GENERATED_COLUMN_NON_PRIOR';
+exports[3108] = 'ER_DEPENDENT_BY_GENERATED_COLUMN';
+exports[3109] = 'ER_GENERATED_COLUMN_REF_AUTO_INC';
+exports[3110] = 'ER_FEATURE_NOT_AVAILABLE';
+exports[3111] = 'ER_CANT_SET_GTID_MODE';
+exports[3112] = 'ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF';
+exports[3113] = 'ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION';
+exports[3114] = 'ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON';
+exports[3115] = 'ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF';
+exports[3116] =
+  'ER_CANT_ENFORCE_GTID_CONSISTENCY_WITH_ONGOING_GTID_VIOLATING_TX';
+exports[3117] =
+  'ER_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TX';
+exports[3118] = 'ER_ACCOUNT_HAS_BEEN_LOCKED';
+exports[3119] = 'ER_WRONG_TABLESPACE_NAME';
+exports[3120] = 'ER_TABLESPACE_IS_NOT_EMPTY';
+exports[3121] = 'ER_WRONG_FILE_NAME';
+exports[3122] = 'ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION';
+exports[3123] = 'ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR';
+exports[3124] = 'ER_WARN_BAD_MAX_EXECUTION_TIME';
+exports[3125] = 'ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME';
+exports[3126] = 'ER_WARN_CONFLICTING_HINT';
+exports[3127] = 'ER_WARN_UNKNOWN_QB_NAME';
+exports[3128] = 'ER_UNRESOLVED_HINT_NAME';
+exports[3129] = 'ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE';
+exports[3130] = 'ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED';
+exports[3131] = 'ER_LOCKING_SERVICE_WRONG_NAME';
+exports[3132] = 'ER_LOCKING_SERVICE_DEADLOCK';
+exports[3133] = 'ER_LOCKING_SERVICE_TIMEOUT';
+exports[3134] = 'ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED';
+exports[3135] = 'ER_SQL_MODE_MERGED';
+exports[3136] = 'ER_VTOKEN_PLUGIN_TOKEN_MISMATCH';
+exports[3137] = 'ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND';
+exports[3138] = 'ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID';
+exports[3139] = 'ER_REPLICA_CHANNEL_OPERATION_NOT_ALLOWED';
+exports[3140] = 'ER_INVALID_JSON_TEXT';
+exports[3141] = 'ER_INVALID_JSON_TEXT_IN_PARAM';
+exports[3142] = 'ER_INVALID_JSON_BINARY_DATA';
+exports[3143] = 'ER_INVALID_JSON_PATH';
+exports[3144] = 'ER_INVALID_JSON_CHARSET';
+exports[3145] = 'ER_INVALID_JSON_CHARSET_IN_FUNCTION';
+exports[3146] = 'ER_INVALID_TYPE_FOR_JSON';
+exports[3147] = 'ER_INVALID_CAST_TO_JSON';
+exports[3148] = 'ER_INVALID_JSON_PATH_CHARSET';
+exports[3149] = 'ER_INVALID_JSON_PATH_WILDCARD';
+exports[3150] = 'ER_JSON_VALUE_TOO_BIG';
+exports[3151] = 'ER_JSON_KEY_TOO_BIG';
+exports[3152] = 'ER_JSON_USED_AS_KEY';
+exports[3153] = 'ER_JSON_VACUOUS_PATH';
+exports[3154] = 'ER_JSON_BAD_ONE_OR_ALL_ARG';
+exports[3155] = 'ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE';
+exports[3156] = 'ER_INVALID_JSON_VALUE_FOR_CAST';
+exports[3157] = 'ER_JSON_DOCUMENT_TOO_DEEP';
+exports[3158] = 'ER_JSON_DOCUMENT_NULL_KEY';
+exports[3159] = 'ER_SECURE_TRANSPORT_REQUIRED';
+exports[3160] = 'ER_NO_SECURE_TRANSPORTS_CONFIGURED';
+exports[3161] = 'ER_DISABLED_STORAGE_ENGINE';
+exports[3162] = 'ER_USER_DOES_NOT_EXIST';
+exports[3163] = 'ER_USER_ALREADY_EXISTS';
+exports[3164] = 'ER_AUDIT_API_ABORT';
+exports[3165] = 'ER_INVALID_JSON_PATH_ARRAY_CELL';
+exports[3166] = 'ER_BUFPOOL_RESIZE_INPROGRESS';
+exports[3167] = 'ER_FEATURE_DISABLED_SEE_DOC';
+exports[3168] = 'ER_SERVER_ISNT_AVAILABLE';
+exports[3169] = 'ER_SESSION_WAS_KILLED';
+exports[3170] = 'ER_CAPACITY_EXCEEDED';
+exports[3171] = 'ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER';
+exports[3172] = 'ER_TABLE_NEEDS_UPG_PART';
+exports[3173] = 'ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID';
+exports[3174] = 'ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL';
+exports[3175] = 'ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT';
+exports[3176] = 'ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE';
+exports[3177] = 'ER_LOCK_REFUSED_BY_ENGINE';
+exports[3178] = 'ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN';
+exports[3179] = 'ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE';
+exports[3180] = 'ER_MASTER_KEY_ROTATION_ERROR_BY_SE';
+exports[3181] = 'ER_MASTER_KEY_ROTATION_BINLOG_FAILED';
+exports[3182] = 'ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE';
+exports[3183] = 'ER_TABLESPACE_CANNOT_ENCRYPT';
+exports[3184] = 'ER_INVALID_ENCRYPTION_OPTION';
+exports[3185] = 'ER_CANNOT_FIND_KEY_IN_KEYRING';
+exports[3186] = 'ER_CAPACITY_EXCEEDED_IN_PARSER';
+exports[3187] = 'ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE';
+exports[3188] = 'ER_KEYRING_UDF_KEYRING_SERVICE_ERROR';
+exports[3189] = 'ER_USER_COLUMN_OLD_LENGTH';
+exports[3190] = 'ER_CANT_RESET_SOURCE';
+exports[3191] = 'ER_GROUP_REPLICATION_MAX_GROUP_SIZE';
+exports[3192] = 'ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED';
+exports[3193] = 'ER_TABLE_REFERENCED';
+exports[3194] = 'ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE';
+exports[3195] = 'ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO';
+exports[3196] = 'ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID';
+exports[3197] = 'ER_XA_RETRY';
+exports[3198] = 'ER_KEYRING_AWS_UDF_AWS_KMS_ERROR';
+exports[3199] = 'ER_BINLOG_UNSAFE_XA';
+exports[3200] = 'ER_UDF_ERROR';
+exports[3201] = 'ER_KEYRING_MIGRATION_FAILURE';
+exports[3202] = 'ER_KEYRING_ACCESS_DENIED_ERROR';
+exports[3203] = 'ER_KEYRING_MIGRATION_STATUS';
+exports[3204] = 'ER_PLUGIN_FAILED_TO_OPEN_TABLES';
+exports[3205] = 'ER_PLUGIN_FAILED_TO_OPEN_TABLE';
+exports[3206] = 'ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED';
+exports[3207] = 'ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET';
+exports[3208] = 'ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY';
+exports[3209] = 'ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED';
+exports[3210] = 'ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED';
+exports[3211] = 'ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE';
+exports[3212] = 'ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED';
+exports[3213] = 'ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS';
+exports[3214] = 'ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE';
+exports[3215] = 'ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT';
+exports[3216] = 'ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED';
+exports[3217] = 'ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE';
+exports[3218] = 'ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE';
+exports[3219] = 'ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR';
+exports[3220] = 'ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY';
+exports[3221] = 'ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY';
+exports[3222] = 'ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS';
+exports[3223] = 'ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC';
+exports[3224] = 'ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER';
+exports[3225] = 'ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER';
+exports[3226] = 'WARN_DEPRECATED_MAXDB_SQL_MODE_FOR_TIMESTAMP';
+exports[3227] = 'ER_XA_REPLICATION_FILTERS';
+exports[3228] = 'ER_CANT_OPEN_ERROR_LOG';
+exports[3229] = 'ER_GROUPING_ON_TIMESTAMP_IN_DST';
+exports[3230] = 'ER_CANT_START_SERVER_NAMED_PIPE';
+exports[3231] = 'ER_WRITE_SET_EXCEEDS_LIMIT';
+exports[3232] = 'ER_DEPRECATED_TLS_VERSION_SESSION_57';
+exports[3233] = 'ER_WARN_DEPRECATED_TLS_VERSION_57';
+exports[3234] = 'ER_WARN_WRONG_NATIVE_TABLE_STRUCTURE';
+exports[3235] = 'ER_AES_INVALID_KDF_NAME';
+exports[3236] = 'ER_AES_INVALID_KDF_ITERATIONS';
+exports[3237] = 'WARN_AES_KEY_SIZE';
+exports[3238] = 'ER_AES_INVALID_KDF_OPTION_SIZE';
+exports[3500] = 'ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE';
+exports[3501] = 'ER_ACL_OPERATION_FAILED';
+exports[3502] = 'ER_UNSUPPORTED_INDEX_ALGORITHM';
+exports[3503] = 'ER_NO_SUCH_DB';
+exports[3504] = 'ER_TOO_BIG_ENUM';
+exports[3505] = 'ER_TOO_LONG_SET_ENUM_VALUE';
+exports[3506] = 'ER_INVALID_DD_OBJECT';
+exports[3507] = 'ER_UPDATING_DD_TABLE';
+exports[3508] = 'ER_INVALID_DD_OBJECT_ID';
+exports[3509] = 'ER_INVALID_DD_OBJECT_NAME';
+exports[3510] = 'ER_TABLESPACE_MISSING_WITH_NAME';
+exports[3511] = 'ER_TOO_LONG_ROUTINE_COMMENT';
+exports[3512] = 'ER_SP_LOAD_FAILED';
+exports[3513] = 'ER_INVALID_BITWISE_OPERANDS_SIZE';
+exports[3514] = 'ER_INVALID_BITWISE_AGGREGATE_OPERANDS_SIZE';
+exports[3515] = 'ER_WARN_UNSUPPORTED_HINT';
+exports[3516] = 'ER_UNEXPECTED_GEOMETRY_TYPE';
+exports[3517] = 'ER_SRS_PARSE_ERROR';
+exports[3518] = 'ER_SRS_PROJ_PARAMETER_MISSING';
+exports[3519] = 'ER_WARN_SRS_NOT_FOUND';
+exports[3520] = 'ER_SRS_NOT_CARTESIAN';
+exports[3521] = 'ER_SRS_NOT_CARTESIAN_UNDEFINED';
+exports[3522] = 'ER_PK_INDEX_CANT_BE_INVISIBLE';
+exports[3523] = 'ER_UNKNOWN_AUTHID';
+exports[3524] = 'ER_FAILED_ROLE_GRANT';
+exports[3525] = 'ER_OPEN_ROLE_TABLES';
+exports[3526] = 'ER_FAILED_DEFAULT_ROLES';
+exports[3527] = 'ER_COMPONENTS_NO_SCHEME';
+exports[3528] = 'ER_COMPONENTS_NO_SCHEME_SERVICE';
+exports[3529] = 'ER_COMPONENTS_CANT_LOAD';
+exports[3530] = 'ER_ROLE_NOT_GRANTED';
+exports[3531] = 'ER_FAILED_REVOKE_ROLE';
+exports[3532] = 'ER_RENAME_ROLE';
+exports[3533] = 'ER_COMPONENTS_CANT_ACQUIRE_SERVICE_IMPLEMENTATION';
+exports[3534] = 'ER_COMPONENTS_CANT_SATISFY_DEPENDENCY';
+exports[3535] = 'ER_COMPONENTS_LOAD_CANT_REGISTER_SERVICE_IMPLEMENTATION';
+exports[3536] = 'ER_COMPONENTS_LOAD_CANT_INITIALIZE';
+exports[3537] = 'ER_COMPONENTS_UNLOAD_NOT_LOADED';
+exports[3538] = 'ER_COMPONENTS_UNLOAD_CANT_DEINITIALIZE';
+exports[3539] = 'ER_COMPONENTS_CANT_RELEASE_SERVICE';
+exports[3540] = 'ER_COMPONENTS_UNLOAD_CANT_UNREGISTER_SERVICE';
+exports[3541] = 'ER_COMPONENTS_CANT_UNLOAD';
+exports[3542] = 'ER_WARN_UNLOAD_THE_NOT_PERSISTED';
+exports[3543] = 'ER_COMPONENT_TABLE_INCORRECT';
+exports[3544] = 'ER_COMPONENT_MANIPULATE_ROW_FAILED';
+exports[3545] = 'ER_COMPONENTS_UNLOAD_DUPLICATE_IN_GROUP';
+exports[3546] = 'ER_CANT_SET_GTID_PURGED_DUE_SETS_CONSTRAINTS';
+exports[3547] = 'ER_CANNOT_LOCK_USER_MANAGEMENT_CACHES';
+exports[3548] = 'ER_SRS_NOT_FOUND';
+exports[3549] = 'ER_VARIABLE_NOT_PERSISTED';
+exports[3550] = 'ER_IS_QUERY_INVALID_CLAUSE';
+exports[3551] = 'ER_UNABLE_TO_STORE_STATISTICS';
+exports[3552] = 'ER_NO_SYSTEM_SCHEMA_ACCESS';
+exports[3553] = 'ER_NO_SYSTEM_TABLESPACE_ACCESS';
+exports[3554] = 'ER_NO_SYSTEM_TABLE_ACCESS';
+exports[3555] = 'ER_NO_SYSTEM_TABLE_ACCESS_FOR_DICTIONARY_TABLE';
+exports[3556] = 'ER_NO_SYSTEM_TABLE_ACCESS_FOR_SYSTEM_TABLE';
+exports[3557] = 'ER_NO_SYSTEM_TABLE_ACCESS_FOR_TABLE';
+exports[3558] = 'ER_INVALID_OPTION_KEY';
+exports[3559] = 'ER_INVALID_OPTION_VALUE';
+exports[3560] = 'ER_INVALID_OPTION_KEY_VALUE_PAIR';
+exports[3561] = 'ER_INVALID_OPTION_START_CHARACTER';
+exports[3562] = 'ER_INVALID_OPTION_END_CHARACTER';
+exports[3563] = 'ER_INVALID_OPTION_CHARACTERS';
+exports[3564] = 'ER_DUPLICATE_OPTION_KEY';
+exports[3565] = 'ER_WARN_SRS_NOT_FOUND_AXIS_ORDER';
+exports[3566] = 'ER_NO_ACCESS_TO_NATIVE_FCT';
+exports[3567] = 'ER_RESET_SOURCE_TO_VALUE_OUT_OF_RANGE';
+exports[3568] = 'ER_UNRESOLVED_TABLE_LOCK';
+exports[3569] = 'ER_DUPLICATE_TABLE_LOCK';
+exports[3570] = 'ER_BINLOG_UNSAFE_SKIP_LOCKED';
+exports[3571] = 'ER_BINLOG_UNSAFE_NOWAIT';
+exports[3572] = 'ER_LOCK_NOWAIT';
+exports[3573] = 'ER_CTE_RECURSIVE_REQUIRES_UNION';
+exports[3574] = 'ER_CTE_RECURSIVE_REQUIRES_NONRECURSIVE_FIRST';
+exports[3575] = 'ER_CTE_RECURSIVE_FORBIDS_AGGREGATION';
+exports[3576] = 'ER_CTE_RECURSIVE_FORBIDDEN_JOIN_ORDER';
+exports[3577] = 'ER_CTE_RECURSIVE_REQUIRES_SINGLE_REFERENCE';
+exports[3578] = 'ER_SWITCH_TMP_ENGINE';
+exports[3579] = 'ER_WINDOW_NO_SUCH_WINDOW';
+exports[3580] = 'ER_WINDOW_CIRCULARITY_IN_WINDOW_GRAPH';
+exports[3581] = 'ER_WINDOW_NO_CHILD_PARTITIONING';
+exports[3582] = 'ER_WINDOW_NO_INHERIT_FRAME';
+exports[3583] = 'ER_WINDOW_NO_REDEFINE_ORDER_BY';
+exports[3584] = 'ER_WINDOW_FRAME_START_ILLEGAL';
+exports[3585] = 'ER_WINDOW_FRAME_END_ILLEGAL';
+exports[3586] = 'ER_WINDOW_FRAME_ILLEGAL';
+exports[3587] = 'ER_WINDOW_RANGE_FRAME_ORDER_TYPE';
+exports[3588] = 'ER_WINDOW_RANGE_FRAME_TEMPORAL_TYPE';
+exports[3589] = 'ER_WINDOW_RANGE_FRAME_NUMERIC_TYPE';
+exports[3590] = 'ER_WINDOW_RANGE_BOUND_NOT_CONSTANT';
+exports[3591] = 'ER_WINDOW_DUPLICATE_NAME';
+exports[3592] = 'ER_WINDOW_ILLEGAL_ORDER_BY';
+exports[3593] = 'ER_WINDOW_INVALID_WINDOW_FUNC_USE';
+exports[3594] = 'ER_WINDOW_INVALID_WINDOW_FUNC_ALIAS_USE';
+exports[3595] = 'ER_WINDOW_NESTED_WINDOW_FUNC_USE_IN_WINDOW_SPEC';
+exports[3596] = 'ER_WINDOW_ROWS_INTERVAL_USE';
+exports[3597] = 'ER_WINDOW_NO_GROUP_ORDER';
+exports[3598] = 'ER_WINDOW_EXPLAIN_JSON';
+exports[3599] = 'ER_WINDOW_FUNCTION_IGNORES_FRAME';
+exports[3600] = 'ER_WL9236_NOW';
+exports[3601] = 'ER_INVALID_NO_OF_ARGS';
+exports[3602] = 'ER_FIELD_IN_GROUPING_NOT_GROUP_BY';
+exports[3603] = 'ER_TOO_LONG_TABLESPACE_COMMENT';
+exports[3604] = 'ER_ENGINE_CANT_DROP_TABLE';
+exports[3605] = 'ER_ENGINE_CANT_DROP_MISSING_TABLE';
+exports[3606] = 'ER_TABLESPACE_DUP_FILENAME';
+exports[3607] = 'ER_DB_DROP_RMDIR2';
+exports[3608] = 'ER_IMP_NO_FILES_MATCHED';
+exports[3609] = 'ER_IMP_SCHEMA_DOES_NOT_EXIST';
+exports[3610] = 'ER_IMP_TABLE_ALREADY_EXISTS';
+exports[3611] = 'ER_IMP_INCOMPATIBLE_MYSQLD_VERSION';
+exports[3612] = 'ER_IMP_INCOMPATIBLE_DD_VERSION';
+exports[3613] = 'ER_IMP_INCOMPATIBLE_SDI_VERSION';
+exports[3614] = 'ER_WARN_INVALID_HINT';
+exports[3615] = 'ER_VAR_DOES_NOT_EXIST';
+exports[3616] = 'ER_LONGITUDE_OUT_OF_RANGE';
+exports[3617] = 'ER_LATITUDE_OUT_OF_RANGE';
+exports[3618] = 'ER_NOT_IMPLEMENTED_FOR_GEOGRAPHIC_SRS';
+exports[3619] = 'ER_ILLEGAL_PRIVILEGE_LEVEL';
+exports[3620] = 'ER_NO_SYSTEM_VIEW_ACCESS';
+exports[3621] = 'ER_COMPONENT_FILTER_FLABBERGASTED';
+exports[3622] = 'ER_PART_EXPR_TOO_LONG';
+exports[3623] = 'ER_UDF_DROP_DYNAMICALLY_REGISTERED';
+exports[3624] = 'ER_UNABLE_TO_STORE_COLUMN_STATISTICS';
+exports[3625] = 'ER_UNABLE_TO_UPDATE_COLUMN_STATISTICS';
+exports[3626] = 'ER_UNABLE_TO_DROP_COLUMN_STATISTICS';
+exports[3627] = 'ER_UNABLE_TO_BUILD_HISTOGRAM';
+exports[3628] = 'ER_MANDATORY_ROLE';
+exports[3629] = 'ER_MISSING_TABLESPACE_FILE';
+exports[3630] = 'ER_PERSIST_ONLY_ACCESS_DENIED_ERROR';
+exports[3631] = 'ER_CMD_NEED_SUPER';
+exports[3632] = 'ER_PATH_IN_DATADIR';
+exports[3633] = 'ER_CLONE_DDL_IN_PROGRESS';
+exports[3634] = 'ER_CLONE_TOO_MANY_CONCURRENT_CLONES';
+exports[3635] = 'ER_APPLIER_LOG_EVENT_VALIDATION_ERROR';
+exports[3636] = 'ER_CTE_MAX_RECURSION_DEPTH';
+exports[3637] = 'ER_NOT_HINT_UPDATABLE_VARIABLE';
+exports[3638] = 'ER_CREDENTIALS_CONTRADICT_TO_HISTORY';
+exports[3639] = 'ER_WARNING_PASSWORD_HISTORY_CLAUSES_VOID';
+exports[3640] = 'ER_CLIENT_DOES_NOT_SUPPORT';
+exports[3641] = 'ER_I_S_SKIPPED_TABLESPACE';
+exports[3642] = 'ER_TABLESPACE_ENGINE_MISMATCH';
+exports[3643] = 'ER_WRONG_SRID_FOR_COLUMN';
+exports[3644] = 'ER_CANNOT_ALTER_SRID_DUE_TO_INDEX';
+exports[3645] = 'ER_WARN_BINLOG_PARTIAL_UPDATES_DISABLED';
+exports[3646] = 'ER_WARN_BINLOG_V1_ROW_EVENTS_DISABLED';
+exports[3647] = 'ER_WARN_BINLOG_PARTIAL_UPDATES_SUGGESTS_PARTIAL_IMAGES';
+exports[3648] = 'ER_COULD_NOT_APPLY_JSON_DIFF';
+exports[3649] = 'ER_CORRUPTED_JSON_DIFF';
+exports[3650] = 'ER_RESOURCE_GROUP_EXISTS';
+exports[3651] = 'ER_RESOURCE_GROUP_NOT_EXISTS';
+exports[3652] = 'ER_INVALID_VCPU_ID';
+exports[3653] = 'ER_INVALID_VCPU_RANGE';
+exports[3654] = 'ER_INVALID_THREAD_PRIORITY';
+exports[3655] = 'ER_DISALLOWED_OPERATION';
+exports[3656] = 'ER_RESOURCE_GROUP_BUSY';
+exports[3657] = 'ER_RESOURCE_GROUP_DISABLED';
+exports[3658] = 'ER_FEATURE_UNSUPPORTED';
+exports[3659] = 'ER_ATTRIBUTE_IGNORED';
+exports[3660] = 'ER_INVALID_THREAD_ID';
+exports[3661] = 'ER_RESOURCE_GROUP_BIND_FAILED';
+exports[3662] = 'ER_INVALID_USE_OF_FORCE_OPTION';
+exports[3663] = 'ER_GROUP_REPLICATION_COMMAND_FAILURE';
+exports[3664] = 'ER_SDI_OPERATION_FAILED';
+exports[3665] = 'ER_MISSING_JSON_TABLE_VALUE';
+exports[3666] = 'ER_WRONG_JSON_TABLE_VALUE';
+exports[3667] = 'ER_TF_MUST_HAVE_ALIAS';
+exports[3668] = 'ER_TF_FORBIDDEN_JOIN_TYPE';
+exports[3669] = 'ER_JT_VALUE_OUT_OF_RANGE';
+exports[3670] = 'ER_JT_MAX_NESTED_PATH';
+exports[3671] = 'ER_PASSWORD_EXPIRATION_NOT_SUPPORTED_BY_AUTH_METHOD';
+exports[3672] = 'ER_INVALID_GEOJSON_CRS_NOT_TOP_LEVEL';
+exports[3673] = 'ER_BAD_NULL_ERROR_NOT_IGNORED';
+exports[3674] = 'WARN_USELESS_SPATIAL_INDEX';
+exports[3675] = 'ER_DISK_FULL_NOWAIT';
+exports[3676] = 'ER_PARSE_ERROR_IN_DIGEST_FN';
+exports[3677] = 'ER_UNDISCLOSED_PARSE_ERROR_IN_DIGEST_FN';
+exports[3678] = 'ER_SCHEMA_DIR_EXISTS';
+exports[3679] = 'ER_SCHEMA_DIR_MISSING';
+exports[3680] = 'ER_SCHEMA_DIR_CREATE_FAILED';
+exports[3681] = 'ER_SCHEMA_DIR_UNKNOWN';
+exports[3682] = 'ER_ONLY_IMPLEMENTED_FOR_SRID_0_AND_4326';
+exports[3683] = 'ER_BINLOG_EXPIRE_LOG_DAYS_AND_SECS_USED_TOGETHER';
+exports[3684] = 'ER_REGEXP_BUFFER_OVERFLOW';
+exports[3685] = 'ER_REGEXP_ILLEGAL_ARGUMENT';
+exports[3686] = 'ER_REGEXP_INDEX_OUTOFBOUNDS_ERROR';
+exports[3687] = 'ER_REGEXP_INTERNAL_ERROR';
+exports[3688] = 'ER_REGEXP_RULE_SYNTAX';
+exports[3689] = 'ER_REGEXP_BAD_ESCAPE_SEQUENCE';
+exports[3690] = 'ER_REGEXP_UNIMPLEMENTED';
+exports[3691] = 'ER_REGEXP_MISMATCHED_PAREN';
+exports[3692] = 'ER_REGEXP_BAD_INTERVAL';
+exports[3693] = 'ER_REGEXP_MAX_LT_MIN';
+exports[3694] = 'ER_REGEXP_INVALID_BACK_REF';
+exports[3695] = 'ER_REGEXP_LOOK_BEHIND_LIMIT';
+exports[3696] = 'ER_REGEXP_MISSING_CLOSE_BRACKET';
+exports[3697] = 'ER_REGEXP_INVALID_RANGE';
+exports[3698] = 'ER_REGEXP_STACK_OVERFLOW';
+exports[3699] = 'ER_REGEXP_TIME_OUT';
+exports[3700] = 'ER_REGEXP_PATTERN_TOO_BIG';
+exports[3701] = 'ER_CANT_SET_ERROR_LOG_SERVICE';
+exports[3702] = 'ER_EMPTY_PIPELINE_FOR_ERROR_LOG_SERVICE';
+exports[3703] = 'ER_COMPONENT_FILTER_DIAGNOSTICS';
+exports[3704] = 'ER_NOT_IMPLEMENTED_FOR_CARTESIAN_SRS';
+exports[3705] = 'ER_NOT_IMPLEMENTED_FOR_PROJECTED_SRS';
+exports[3706] = 'ER_NONPOSITIVE_RADIUS';
+exports[3707] = 'ER_RESTART_SERVER_FAILED';
+exports[3708] = 'ER_SRS_MISSING_MANDATORY_ATTRIBUTE';
+exports[3709] = 'ER_SRS_MULTIPLE_ATTRIBUTE_DEFINITIONS';
+exports[3710] = 'ER_SRS_NAME_CANT_BE_EMPTY_OR_WHITESPACE';
+exports[3711] = 'ER_SRS_ORGANIZATION_CANT_BE_EMPTY_OR_WHITESPACE';
+exports[3712] = 'ER_SRS_ID_ALREADY_EXISTS';
+exports[3713] = 'ER_WARN_SRS_ID_ALREADY_EXISTS';
+exports[3714] = 'ER_CANT_MODIFY_SRID_0';
+exports[3715] = 'ER_WARN_RESERVED_SRID_RANGE';
+exports[3716] = 'ER_CANT_MODIFY_SRS_USED_BY_COLUMN';
+exports[3717] = 'ER_SRS_INVALID_CHARACTER_IN_ATTRIBUTE';
+exports[3718] = 'ER_SRS_ATTRIBUTE_STRING_TOO_LONG';
+exports[3719] = 'ER_DEPRECATED_UTF8_ALIAS';
+exports[3720] = 'ER_DEPRECATED_NATIONAL';
+exports[3721] = 'ER_INVALID_DEFAULT_UTF8MB4_COLLATION';
+exports[3722] = 'ER_UNABLE_TO_COLLECT_LOG_STATUS';
+exports[3723] = 'ER_RESERVED_TABLESPACE_NAME';
+exports[3724] = 'ER_UNABLE_TO_SET_OPTION';
+exports[3725] = 'ER_REPLICA_POSSIBLY_DIVERGED_AFTER_DDL';
+exports[3726] = 'ER_SRS_NOT_GEOGRAPHIC';
+exports[3727] = 'ER_POLYGON_TOO_LARGE';
+exports[3728] = 'ER_SPATIAL_UNIQUE_INDEX';
+exports[3729] = 'ER_INDEX_TYPE_NOT_SUPPORTED_FOR_SPATIAL_INDEX';
+exports[3730] = 'ER_FK_CANNOT_DROP_PARENT';
+exports[3731] = 'ER_GEOMETRY_PARAM_LONGITUDE_OUT_OF_RANGE';
+exports[3732] = 'ER_GEOMETRY_PARAM_LATITUDE_OUT_OF_RANGE';
+exports[3733] = 'ER_FK_CANNOT_USE_VIRTUAL_COLUMN';
+exports[3734] = 'ER_FK_NO_COLUMN_PARENT';
+exports[3735] = 'ER_CANT_SET_ERROR_SUPPRESSION_LIST';
+exports[3736] = 'ER_SRS_GEOGCS_INVALID_AXES';
+exports[3737] = 'ER_SRS_INVALID_SEMI_MAJOR_AXIS';
+exports[3738] = 'ER_SRS_INVALID_INVERSE_FLATTENING';
+exports[3739] = 'ER_SRS_INVALID_ANGULAR_UNIT';
+exports[3740] = 'ER_SRS_INVALID_PRIME_MERIDIAN';
+exports[3741] = 'ER_TRANSFORM_SOURCE_SRS_NOT_SUPPORTED';
+exports[3742] = 'ER_TRANSFORM_TARGET_SRS_NOT_SUPPORTED';
+exports[3743] = 'ER_TRANSFORM_SOURCE_SRS_MISSING_TOWGS84';
+exports[3744] = 'ER_TRANSFORM_TARGET_SRS_MISSING_TOWGS84';
+exports[3745] = 'ER_TEMP_TABLE_PREVENTS_SWITCH_SESSION_BINLOG_FORMAT';
+exports[3746] = 'ER_TEMP_TABLE_PREVENTS_SWITCH_GLOBAL_BINLOG_FORMAT';
+exports[3747] = 'ER_RUNNING_APPLIER_PREVENTS_SWITCH_GLOBAL_BINLOG_FORMAT';
+exports[3748] = 'ER_CLIENT_GTID_UNSAFE_CREATE_DROP_TEMP_TABLE_IN_TRX_IN_SBR';
+exports[3749] = 'ER_XA_CANT_CREATE_MDL_BACKUP';
+exports[3750] = 'ER_TABLE_WITHOUT_PK';
+exports[3751] = 'ER_WARN_DATA_TRUNCATED_FUNCTIONAL_INDEX';
+exports[3752] = 'ER_WARN_DATA_OUT_OF_RANGE_FUNCTIONAL_INDEX';
+exports[3753] = 'ER_FUNCTIONAL_INDEX_ON_JSON_OR_GEOMETRY_FUNCTION';
+exports[3754] = 'ER_FUNCTIONAL_INDEX_REF_AUTO_INCREMENT';
+exports[3755] = 'ER_CANNOT_DROP_COLUMN_FUNCTIONAL_INDEX';
+exports[3756] = 'ER_FUNCTIONAL_INDEX_PRIMARY_KEY';
+exports[3757] = 'ER_FUNCTIONAL_INDEX_ON_LOB';
+exports[3758] = 'ER_FUNCTIONAL_INDEX_FUNCTION_IS_NOT_ALLOWED';
+exports[3759] = 'ER_FULLTEXT_FUNCTIONAL_INDEX';
+exports[3760] = 'ER_SPATIAL_FUNCTIONAL_INDEX';
+exports[3761] = 'ER_WRONG_KEY_COLUMN_FUNCTIONAL_INDEX';
+exports[3762] = 'ER_FUNCTIONAL_INDEX_ON_FIELD';
+exports[3763] = 'ER_GENERATED_COLUMN_NAMED_FUNCTION_IS_NOT_ALLOWED';
+exports[3764] = 'ER_GENERATED_COLUMN_ROW_VALUE';
+exports[3765] = 'ER_GENERATED_COLUMN_VARIABLES';
+exports[3766] = 'ER_DEPENDENT_BY_DEFAULT_GENERATED_VALUE';
+exports[3767] = 'ER_DEFAULT_VAL_GENERATED_NON_PRIOR';
+exports[3768] = 'ER_DEFAULT_VAL_GENERATED_REF_AUTO_INC';
+exports[3769] = 'ER_DEFAULT_VAL_GENERATED_FUNCTION_IS_NOT_ALLOWED';
+exports[3770] = 'ER_DEFAULT_VAL_GENERATED_NAMED_FUNCTION_IS_NOT_ALLOWED';
+exports[3771] = 'ER_DEFAULT_VAL_GENERATED_ROW_VALUE';
+exports[3772] = 'ER_DEFAULT_VAL_GENERATED_VARIABLES';
+exports[3773] = 'ER_DEFAULT_AS_VAL_GENERATED';
+exports[3774] = 'ER_UNSUPPORTED_ACTION_ON_DEFAULT_VAL_GENERATED';
+exports[3775] = 'ER_GTID_UNSAFE_ALTER_ADD_COL_WITH_DEFAULT_EXPRESSION';
+exports[3776] = 'ER_FK_CANNOT_CHANGE_ENGINE';
+exports[3777] = 'ER_WARN_DEPRECATED_USER_SET_EXPR';
+exports[3778] = 'ER_WARN_DEPRECATED_UTF8MB3_COLLATION';
+exports[3779] = 'ER_WARN_DEPRECATED_NESTED_COMMENT_SYNTAX';
+exports[3780] = 'ER_FK_INCOMPATIBLE_COLUMNS';
+exports[3781] = 'ER_GR_HOLD_WAIT_TIMEOUT';
+exports[3782] = 'ER_GR_HOLD_KILLED';
+exports[3783] = 'ER_GR_HOLD_MEMBER_STATUS_ERROR';
+exports[3784] = 'ER_RPL_ENCRYPTION_FAILED_TO_FETCH_KEY';
+exports[3785] = 'ER_RPL_ENCRYPTION_KEY_NOT_FOUND';
+exports[3786] = 'ER_RPL_ENCRYPTION_KEYRING_INVALID_KEY';
+exports[3787] = 'ER_RPL_ENCRYPTION_HEADER_ERROR';
+exports[3788] = 'ER_RPL_ENCRYPTION_FAILED_TO_ROTATE_LOGS';
+exports[3789] = 'ER_RPL_ENCRYPTION_KEY_EXISTS_UNEXPECTED';
+exports[3790] = 'ER_RPL_ENCRYPTION_FAILED_TO_GENERATE_KEY';
+exports[3791] = 'ER_RPL_ENCRYPTION_FAILED_TO_STORE_KEY';
+exports[3792] = 'ER_RPL_ENCRYPTION_FAILED_TO_REMOVE_KEY';
+exports[3793] = 'ER_RPL_ENCRYPTION_UNABLE_TO_CHANGE_OPTION';
+exports[3794] = 'ER_RPL_ENCRYPTION_MASTER_KEY_RECOVERY_FAILED';
+exports[3795] = 'ER_SLOW_LOG_MODE_IGNORED_WHEN_NOT_LOGGING_TO_FILE';
+exports[3796] = 'ER_GRP_TRX_CONSISTENCY_NOT_ALLOWED';
+exports[3797] = 'ER_GRP_TRX_CONSISTENCY_BEFORE';
+exports[3798] = 'ER_GRP_TRX_CONSISTENCY_AFTER_ON_TRX_BEGIN';
+exports[3799] = 'ER_GRP_TRX_CONSISTENCY_BEGIN_NOT_ALLOWED';
+exports[3800] = 'ER_FUNCTIONAL_INDEX_ROW_VALUE_IS_NOT_ALLOWED';
+exports[3801] = 'ER_RPL_ENCRYPTION_FAILED_TO_ENCRYPT';
+exports[3802] = 'ER_PAGE_TRACKING_NOT_STARTED';
+exports[3803] = 'ER_PAGE_TRACKING_RANGE_NOT_TRACKED';
+exports[3804] = 'ER_PAGE_TRACKING_CANNOT_PURGE';
+exports[3805] = 'ER_RPL_ENCRYPTION_CANNOT_ROTATE_BINLOG_MASTER_KEY';
+exports[3806] = 'ER_BINLOG_MASTER_KEY_RECOVERY_OUT_OF_COMBINATION';
+exports[3807] = 'ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_OPERATE_KEY';
+exports[3808] = 'ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_ROTATE_LOGS';
+exports[3809] = 'ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_REENCRYPT_LOG';
+exports[3810] = 'ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_CLEANUP_UNUSED_KEYS';
+exports[3811] = 'ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_CLEANUP_AUX_KEY';
+exports[3812] = 'ER_NON_BOOLEAN_EXPR_FOR_CHECK_CONSTRAINT';
+exports[3813] = 'ER_COLUMN_CHECK_CONSTRAINT_REFERENCES_OTHER_COLUMN';
+exports[3814] = 'ER_CHECK_CONSTRAINT_NAMED_FUNCTION_IS_NOT_ALLOWED';
+exports[3815] = 'ER_CHECK_CONSTRAINT_FUNCTION_IS_NOT_ALLOWED';
+exports[3816] = 'ER_CHECK_CONSTRAINT_VARIABLES';
+exports[3817] = 'ER_CHECK_CONSTRAINT_ROW_VALUE';
+exports[3818] = 'ER_CHECK_CONSTRAINT_REFERS_AUTO_INCREMENT_COLUMN';
+exports[3819] = 'ER_CHECK_CONSTRAINT_VIOLATED';
+exports[3820] = 'ER_CHECK_CONSTRAINT_REFERS_UNKNOWN_COLUMN';
+exports[3821] = 'ER_CHECK_CONSTRAINT_NOT_FOUND';
+exports[3822] = 'ER_CHECK_CONSTRAINT_DUP_NAME';
+exports[3823] = 'ER_CHECK_CONSTRAINT_CLAUSE_USING_FK_REFER_ACTION_COLUMN';
+exports[3824] = 'WARN_UNENCRYPTED_TABLE_IN_ENCRYPTED_DB';
+exports[3825] = 'ER_INVALID_ENCRYPTION_REQUEST';
+exports[3826] = 'ER_CANNOT_SET_TABLE_ENCRYPTION';
+exports[3827] = 'ER_CANNOT_SET_DATABASE_ENCRYPTION';
+exports[3828] = 'ER_CANNOT_SET_TABLESPACE_ENCRYPTION';
+exports[3829] = 'ER_TABLESPACE_CANNOT_BE_ENCRYPTED';
+exports[3830] = 'ER_TABLESPACE_CANNOT_BE_DECRYPTED';
+exports[3831] = 'ER_TABLESPACE_TYPE_UNKNOWN';
+exports[3832] = 'ER_TARGET_TABLESPACE_UNENCRYPTED';
+exports[3833] = 'ER_CANNOT_USE_ENCRYPTION_CLAUSE';
+exports[3834] = 'ER_INVALID_MULTIPLE_CLAUSES';
+exports[3835] = 'ER_UNSUPPORTED_USE_OF_GRANT_AS';
+exports[3836] = 'ER_UKNOWN_AUTH_ID_OR_ACCESS_DENIED_FOR_GRANT_AS';
+exports[3837] = 'ER_DEPENDENT_BY_FUNCTIONAL_INDEX';
+exports[3838] = 'ER_PLUGIN_NOT_EARLY';
+exports[3839] = 'ER_INNODB_REDO_LOG_ARCHIVE_START_SUBDIR_PATH';
+exports[3840] = 'ER_INNODB_REDO_LOG_ARCHIVE_START_TIMEOUT';
+exports[3841] = 'ER_INNODB_REDO_LOG_ARCHIVE_DIRS_INVALID';
+exports[3842] = 'ER_INNODB_REDO_LOG_ARCHIVE_LABEL_NOT_FOUND';
+exports[3843] = 'ER_INNODB_REDO_LOG_ARCHIVE_DIR_EMPTY';
+exports[3844] = 'ER_INNODB_REDO_LOG_ARCHIVE_NO_SUCH_DIR';
+exports[3845] = 'ER_INNODB_REDO_LOG_ARCHIVE_DIR_CLASH';
+exports[3846] = 'ER_INNODB_REDO_LOG_ARCHIVE_DIR_PERMISSIONS';
+exports[3847] = 'ER_INNODB_REDO_LOG_ARCHIVE_FILE_CREATE';
+exports[3848] = 'ER_INNODB_REDO_LOG_ARCHIVE_ACTIVE';
+exports[3849] = 'ER_INNODB_REDO_LOG_ARCHIVE_INACTIVE';
+exports[3850] = 'ER_INNODB_REDO_LOG_ARCHIVE_FAILED';
+exports[3851] = 'ER_INNODB_REDO_LOG_ARCHIVE_SESSION';
+exports[3852] = 'ER_STD_REGEX_ERROR';
+exports[3853] = 'ER_INVALID_JSON_TYPE';
+exports[3854] = 'ER_CANNOT_CONVERT_STRING';
+exports[3855] = 'ER_DEPENDENT_BY_PARTITION_FUNC';
+exports[3856] = 'ER_WARN_DEPRECATED_FLOAT_AUTO_INCREMENT';
+exports[3857] = 'ER_RPL_CANT_STOP_REPLICA_WHILE_LOCKED_BACKUP';
+exports[3858] = 'ER_WARN_DEPRECATED_FLOAT_DIGITS';
+exports[3859] = 'ER_WARN_DEPRECATED_FLOAT_UNSIGNED';
+exports[3860] = 'ER_WARN_DEPRECATED_INTEGER_DISPLAY_WIDTH';
+exports[3861] = 'ER_WARN_DEPRECATED_ZEROFILL';
+exports[3862] = 'ER_CLONE_DONOR';
+exports[3863] = 'ER_CLONE_PROTOCOL';
+exports[3864] = 'ER_CLONE_DONOR_VERSION';
+exports[3865] = 'ER_CLONE_OS';
+exports[3866] = 'ER_CLONE_PLATFORM';
+exports[3867] = 'ER_CLONE_CHARSET';
+exports[3868] = 'ER_CLONE_CONFIG';
+exports[3869] = 'ER_CLONE_SYS_CONFIG';
+exports[3870] = 'ER_CLONE_PLUGIN_MATCH';
+exports[3871] = 'ER_CLONE_LOOPBACK';
+exports[3872] = 'ER_CLONE_ENCRYPTION';
+exports[3873] = 'ER_CLONE_DISK_SPACE';
+exports[3874] = 'ER_CLONE_IN_PROGRESS';
+exports[3875] = 'ER_CLONE_DISALLOWED';
+exports[3876] = 'ER_CANNOT_GRANT_ROLES_TO_ANONYMOUS_USER';
+exports[3877] = 'ER_SECONDARY_ENGINE_PLUGIN';
+exports[3878] = 'ER_SECOND_PASSWORD_CANNOT_BE_EMPTY';
+exports[3879] = 'ER_DB_ACCESS_DENIED';
+exports[3880] = 'ER_DA_AUTH_ID_WITH_SYSTEM_USER_PRIV_IN_MANDATORY_ROLES';
+exports[3881] = 'ER_DA_RPL_GTID_TABLE_CANNOT_OPEN';
+exports[3882] = 'ER_GEOMETRY_IN_UNKNOWN_LENGTH_UNIT';
+exports[3883] = 'ER_DA_PLUGIN_INSTALL_ERROR';
+exports[3884] = 'ER_NO_SESSION_TEMP';
+exports[3885] = 'ER_DA_UNKNOWN_ERROR_NUMBER';
+exports[3886] = 'ER_COLUMN_CHANGE_SIZE';
+exports[3887] = 'ER_REGEXP_INVALID_CAPTURE_GROUP_NAME';
+exports[3888] = 'ER_DA_SSL_LIBRARY_ERROR';
+exports[3889] = 'ER_SECONDARY_ENGINE';
+exports[3890] = 'ER_SECONDARY_ENGINE_DDL';
+exports[3891] = 'ER_INCORRECT_CURRENT_PASSWORD';
+exports[3892] = 'ER_MISSING_CURRENT_PASSWORD';
+exports[3893] = 'ER_CURRENT_PASSWORD_NOT_REQUIRED';
+exports[3894] = 'ER_PASSWORD_CANNOT_BE_RETAINED_ON_PLUGIN_CHANGE';
+exports[3895] = 'ER_CURRENT_PASSWORD_CANNOT_BE_RETAINED';
+exports[3896] = 'ER_PARTIAL_REVOKES_EXIST';
+exports[3897] = 'ER_CANNOT_GRANT_SYSTEM_PRIV_TO_MANDATORY_ROLE';
+exports[3898] = 'ER_XA_REPLICATION_FILTERS';
+exports[3899] = 'ER_UNSUPPORTED_SQL_MODE';
+exports[3900] = 'ER_REGEXP_INVALID_FLAG';
+exports[3901] = 'ER_PARTIAL_REVOKE_AND_DB_GRANT_BOTH_EXISTS';
+exports[3902] = 'ER_UNIT_NOT_FOUND';
+exports[3903] = 'ER_INVALID_JSON_VALUE_FOR_FUNC_INDEX';
+exports[3904] = 'ER_JSON_VALUE_OUT_OF_RANGE_FOR_FUNC_INDEX';
+exports[3905] = 'ER_EXCEEDED_MV_KEYS_NUM';
+exports[3906] = 'ER_EXCEEDED_MV_KEYS_SPACE';
+exports[3907] = 'ER_FUNCTIONAL_INDEX_DATA_IS_TOO_LONG';
+exports[3908] = 'ER_WRONG_MVI_VALUE';
+exports[3909] = 'ER_WARN_FUNC_INDEX_NOT_APPLICABLE';
+exports[3910] = 'ER_GRP_RPL_UDF_ERROR';
+exports[3911] = 'ER_UPDATE_GTID_PURGED_WITH_GR';
+exports[3912] = 'ER_GROUPING_ON_TIMESTAMP_IN_DST';
+exports[3913] = 'ER_TABLE_NAME_CAUSES_TOO_LONG_PATH';
+exports[3914] = 'ER_AUDIT_LOG_INSUFFICIENT_PRIVILEGE';
+exports[3915] = 'ER_AUDIT_LOG_PASSWORD_HAS_BEEN_COPIED';
+exports[3916] = 'ER_DA_GRP_RPL_STARTED_AUTO_REJOIN';
+exports[3917] = 'ER_SYSVAR_CHANGE_DURING_QUERY';
+exports[3918] = 'ER_GLOBSTAT_CHANGE_DURING_QUERY';
+exports[3919] = 'ER_GRP_RPL_MESSAGE_SERVICE_INIT_FAILURE';
+exports[3920] = 'ER_CHANGE_SOURCE_WRONG_COMPRESSION_ALGORITHM_CLIENT';
+exports[3921] = 'ER_CHANGE_SOURCE_WRONG_COMPRESSION_LEVEL_CLIENT';
+exports[3922] = 'ER_WRONG_COMPRESSION_ALGORITHM_CLIENT';
+exports[3923] = 'ER_WRONG_COMPRESSION_LEVEL_CLIENT';
+exports[3924] = 'ER_CHANGE_SOURCE_WRONG_COMPRESSION_ALGORITHM_LIST_CLIENT';
+exports[3925] = 'ER_CLIENT_PRIVILEGE_CHECKS_USER_CANNOT_BE_ANONYMOUS';
+exports[3926] = 'ER_CLIENT_PRIVILEGE_CHECKS_USER_DOES_NOT_EXIST';
+exports[3927] = 'ER_CLIENT_PRIVILEGE_CHECKS_USER_CORRUPT';
+exports[3928] = 'ER_CLIENT_PRIVILEGE_CHECKS_USER_NEEDS_RPL_APPLIER_PRIV';
+exports[3929] = 'ER_WARN_DA_PRIVILEGE_NOT_REGISTERED';
+exports[3930] = 'ER_CLIENT_KEYRING_UDF_KEY_INVALID';
+exports[3931] = 'ER_CLIENT_KEYRING_UDF_KEY_TYPE_INVALID';
+exports[3932] = 'ER_CLIENT_KEYRING_UDF_KEY_TOO_LONG';
+exports[3933] = 'ER_CLIENT_KEYRING_UDF_KEY_TYPE_TOO_LONG';
+exports[3934] = 'ER_JSON_SCHEMA_VALIDATION_ERROR_WITH_DETAILED_REPORT';
+exports[3935] = 'ER_DA_UDF_INVALID_CHARSET_SPECIFIED';
+exports[3936] = 'ER_DA_UDF_INVALID_CHARSET';
+exports[3937] = 'ER_DA_UDF_INVALID_COLLATION';
+exports[3938] = 'ER_DA_UDF_INVALID_EXTENSION_ARGUMENT_TYPE';
+exports[3939] = 'ER_MULTIPLE_CONSTRAINTS_WITH_SAME_NAME';
+exports[3940] = 'ER_CONSTRAINT_NOT_FOUND';
+exports[3941] = 'ER_ALTER_CONSTRAINT_ENFORCEMENT_NOT_SUPPORTED';
+exports[3942] = 'ER_TABLE_VALUE_CONSTRUCTOR_MUST_HAVE_COLUMNS';
+exports[3943] = 'ER_TABLE_VALUE_CONSTRUCTOR_CANNOT_HAVE_DEFAULT';
+exports[3944] = 'ER_CLIENT_QUERY_FAILURE_INVALID_NON_ROW_FORMAT';
+exports[3945] = 'ER_REQUIRE_ROW_FORMAT_INVALID_VALUE';
+exports[3946] = 'ER_FAILED_TO_DETERMINE_IF_ROLE_IS_MANDATORY';
+exports[3947] = 'ER_FAILED_TO_FETCH_MANDATORY_ROLE_LIST';
+exports[3948] = 'ER_CLIENT_LOCAL_FILES_DISABLED';
+exports[3949] = 'ER_IMP_INCOMPATIBLE_CFG_VERSION';
+exports[3950] = 'ER_DA_OOM';
+exports[3951] = 'ER_DA_UDF_INVALID_ARGUMENT_TO_SET_CHARSET';
+exports[3952] = 'ER_DA_UDF_INVALID_RETURN_TYPE_TO_SET_CHARSET';
+exports[3953] = 'ER_MULTIPLE_INTO_CLAUSES';
+exports[3954] = 'ER_MISPLACED_INTO';
+exports[3955] =
+  'ER_USER_ACCESS_DENIED_FOR_USER_ACCOUNT_BLOCKED_BY_PASSWORD_LOCK';
+exports[3956] = 'ER_WARN_DEPRECATED_YEAR_UNSIGNED';
+exports[3957] = 'ER_CLONE_NETWORK_PACKET';
+exports[3958] = 'ER_SDI_OPERATION_FAILED_MISSING_RECORD';
+exports[3959] = 'ER_DEPENDENT_BY_CHECK_CONSTRAINT';
+exports[3960] = 'ER_GRP_OPERATION_NOT_ALLOWED_GR_MUST_STOP';
+exports[3961] = 'ER_WARN_DEPRECATED_JSON_TABLE_ON_ERROR_ON_EMPTY';
+exports[3962] = 'ER_WARN_DEPRECATED_INNER_INTO';
+exports[3963] = 'ER_WARN_DEPRECATED_VALUES_FUNCTION_ALWAYS_NULL';
+exports[3964] = 'ER_WARN_DEPRECATED_SQL_CALC_FOUND_ROWS';
+exports[3965] = 'ER_WARN_DEPRECATED_FOUND_ROWS';
+exports[3966] = 'ER_MISSING_JSON_VALUE';
+exports[3967] = 'ER_MULTIPLE_JSON_VALUES';
+exports[3968] = 'ER_HOSTNAME_TOO_LONG';
+exports[3969] = 'ER_WARN_CLIENT_DEPRECATED_PARTITION_PREFIX_KEY';
+exports[3970] = 'ER_GROUP_REPLICATION_USER_EMPTY_MSG';
+exports[3971] = 'ER_GROUP_REPLICATION_USER_MANDATORY_MSG';
+exports[3972] = 'ER_GROUP_REPLICATION_PASSWORD_LENGTH';
+exports[3973] = 'ER_SUBQUERY_TRANSFORM_REJECTED';
+exports[3974] = 'ER_DA_GRP_RPL_RECOVERY_ENDPOINT_FORMAT';
+exports[3975] = 'ER_DA_GRP_RPL_RECOVERY_ENDPOINT_INVALID';
+exports[3976] = 'ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART';
+exports[3977] = 'ER_STATEMENT_NOT_ALLOWED_AFTER_START_TRANSACTION';
+exports[3978] = 'ER_FOREIGN_KEY_WITH_ATOMIC_CREATE_SELECT';
+exports[3979] = 'ER_NOT_ALLOWED_WITH_START_TRANSACTION';
+exports[3980] = 'ER_INVALID_JSON_ATTRIBUTE';
+exports[3981] = 'ER_ENGINE_ATTRIBUTE_NOT_SUPPORTED';
+exports[3982] = 'ER_INVALID_USER_ATTRIBUTE_JSON';
+exports[3983] = 'ER_INNODB_REDO_DISABLED';
+exports[3984] = 'ER_INNODB_REDO_ARCHIVING_ENABLED';
+exports[3985] = 'ER_MDL_OUT_OF_RESOURCES';
+exports[3986] = 'ER_IMPLICIT_COMPARISON_FOR_JSON';
+exports[3987] = 'ER_FUNCTION_DOES_NOT_SUPPORT_CHARACTER_SET';
+exports[3988] = 'ER_IMPOSSIBLE_STRING_CONVERSION';
+exports[3989] = 'ER_SCHEMA_READ_ONLY';
+exports[3990] = 'ER_RPL_ASYNC_RECONNECT_GTID_MODE_OFF';
+exports[3991] = 'ER_RPL_ASYNC_RECONNECT_AUTO_POSITION_OFF';
+exports[3992] = 'ER_DISABLE_GTID_MODE_REQUIRES_ASYNC_RECONNECT_OFF';
+exports[3993] = 'ER_DISABLE_AUTO_POSITION_REQUIRES_ASYNC_RECONNECT_OFF';
+exports[3994] = 'ER_INVALID_PARAMETER_USE';
+exports[3995] = 'ER_CHARACTER_SET_MISMATCH';
+exports[3996] = 'ER_WARN_VAR_VALUE_CHANGE_NOT_SUPPORTED';
+exports[3997] = 'ER_INVALID_TIME_ZONE_INTERVAL';
+exports[3998] = 'ER_INVALID_CAST';
+exports[3999] = 'ER_HYPERGRAPH_NOT_SUPPORTED_YET';
+exports[4000] = 'ER_WARN_HYPERGRAPH_EXPERIMENTAL';
+exports[4001] = 'ER_DA_NO_ERROR_LOG_PARSER_CONFIGURED';
+exports[4002] = 'ER_DA_ERROR_LOG_TABLE_DISABLED';
+exports[4003] = 'ER_DA_ERROR_LOG_MULTIPLE_FILTERS';
+exports[4004] = 'ER_DA_CANT_OPEN_ERROR_LOG';
+exports[4005] = 'ER_USER_REFERENCED_AS_DEFINER';
+exports[4006] = 'ER_CANNOT_USER_REFERENCED_AS_DEFINER';
+exports[4007] = 'ER_REGEX_NUMBER_TOO_BIG';
+exports[4008] = 'ER_SPVAR_NONINTEGER_TYPE';
+exports[4009] = 'WARN_UNSUPPORTED_ACL_TABLES_READ';
+exports[4010] = 'ER_BINLOG_UNSAFE_ACL_TABLE_READ_IN_DML_DDL';
+exports[4011] = 'ER_STOP_REPLICA_MONITOR_IO_THREAD_TIMEOUT';
+exports[4012] = 'ER_STARTING_REPLICA_MONITOR_IO_THREAD';
+exports[4013] = 'ER_CANT_USE_ANONYMOUS_TO_GTID_WITH_GTID_MODE_NOT_ON';
+exports[4014] = 'ER_CANT_COMBINE_ANONYMOUS_TO_GTID_AND_AUTOPOSITION';
+exports[4015] =
+  'ER_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_REQUIRES_GTID_MODE_ON';
+exports[4016] = 'ER_SQL_REPLICA_SKIP_COUNTER_USED_WITH_GTID_MODE_ON';
+exports[4017] =
+  'ER_USING_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_AS_LOCAL_OR_UUID';
+exports[4018] =
+  'ER_CANT_SET_ANONYMOUS_TO_GTID_AND_WAIT_UNTIL_SQL_THD_AFTER_GTIDS';
+exports[4019] = 'ER_CANT_SET_SQL_AFTER_OR_BEFORE_GTIDS_WITH_ANONYMOUS_TO_GTID';
+exports[4020] = 'ER_ANONYMOUS_TO_GTID_UUID_SAME_AS_GROUP_NAME';
+exports[4021] = 'ER_CANT_USE_SAME_UUID_AS_GROUP_NAME';
+exports[4022] = 'ER_GRP_RPL_RECOVERY_CHANNEL_STILL_RUNNING';
+exports[4023] = 'ER_INNODB_INVALID_AUTOEXTEND_SIZE_VALUE';
+exports[4024] = 'ER_INNODB_INCOMPATIBLE_WITH_TABLESPACE';
+exports[4025] = 'ER_INNODB_AUTOEXTEND_SIZE_OUT_OF_RANGE';
+exports[4026] = 'ER_CANNOT_USE_AUTOEXTEND_SIZE_CLAUSE';
+exports[4027] = 'ER_ROLE_GRANTED_TO_ITSELF';
+exports[4028] = 'ER_TABLE_MUST_HAVE_A_VISIBLE_COLUMN';
+exports[4029] = 'ER_INNODB_COMPRESSION_FAILURE';
+exports[4030] = 'ER_WARN_ASYNC_CONN_FAILOVER_NETWORK_NAMESPACE';
+exports[4031] = 'ER_CLIENT_INTERACTION_TIMEOUT';
+exports[4032] = 'ER_INVALID_CAST_TO_GEOMETRY';
+exports[4033] = 'ER_INVALID_CAST_POLYGON_RING_DIRECTION';
+exports[4034] = 'ER_GIS_DIFFERENT_SRIDS_AGGREGATION';
+exports[4035] = 'ER_RELOAD_KEYRING_FAILURE';
+exports[4036] = 'ER_SDI_GET_KEYS_INVALID_TABLESPACE';
+exports[4037] = 'ER_CHANGE_RPL_SRC_WRONG_COMPRESSION_ALGORITHM_SIZE';
+exports[4038] = 'ER_WARN_DEPRECATED_TLS_VERSION_FOR_CHANNEL_CLI';
+exports[4039] = 'ER_CANT_USE_SAME_UUID_AS_VIEW_CHANGE_UUID';
+exports[4040] = 'ER_ANONYMOUS_TO_GTID_UUID_SAME_AS_VIEW_CHANGE_UUID';
+exports[4041] = 'ER_GRP_RPL_VIEW_CHANGE_UUID_FAIL_GET_VARIABLE';
+exports[4042] = 'ER_WARN_ADUIT_LOG_MAX_SIZE_AND_PRUNE_SECONDS';
+exports[4043] = 'ER_WARN_ADUIT_LOG_MAX_SIZE_CLOSE_TO_ROTATE_ON_SIZE';
+exports[4044] = 'ER_KERBEROS_CREATE_USER';
+exports[4045] = 'ER_INSTALL_PLUGIN_CONFLICT_CLIENT';
+exports[4046] = 'ER_DA_ERROR_LOG_COMPONENT_FLUSH_FAILED';
+exports[4047] = 'ER_WARN_SQL_AFTER_MTS_GAPS_GAP_NOT_CALCULATED';
+exports[4048] = 'ER_INVALID_ASSIGNMENT_TARGET';
+exports[4049] = 'ER_OPERATION_NOT_ALLOWED_ON_GR_SECONDARY';
+exports[4050] = 'ER_GRP_RPL_FAILOVER_CHANNEL_STATUS_PROPAGATION';
+exports[4051] = 'ER_WARN_AUDIT_LOG_FORMAT_UNIX_TIMESTAMP_ONLY_WHEN_JSON';
+exports[4052] = 'ER_INVALID_MFA_PLUGIN_SPECIFIED';
+exports[4053] = 'ER_IDENTIFIED_BY_UNSUPPORTED';
+exports[4054] = 'ER_INVALID_PLUGIN_FOR_REGISTRATION';
+exports[4055] = 'ER_PLUGIN_REQUIRES_REGISTRATION';
+exports[4056] = 'ER_MFA_METHOD_EXISTS';
+exports[4057] = 'ER_MFA_METHOD_NOT_EXISTS';
+exports[4058] = 'ER_AUTHENTICATION_POLICY_MISMATCH';
+exports[4059] = 'ER_PLUGIN_REGISTRATION_DONE';
+exports[4060] = 'ER_INVALID_USER_FOR_REGISTRATION';
+exports[4061] = 'ER_USER_REGISTRATION_FAILED';
+exports[4062] = 'ER_MFA_METHODS_INVALID_ORDER';
+exports[4063] = 'ER_MFA_METHODS_IDENTICAL';
+exports[4064] = 'ER_INVALID_MFA_OPERATIONS_FOR_PASSWORDLESS_USER';
+exports[4065] = 'ER_CHANGE_REPLICATION_SOURCE_NO_OPTIONS_FOR_GTID_ONLY';
+exports[4066] =
+  'ER_CHANGE_REP_SOURCE_CANT_DISABLE_REQ_ROW_FORMAT_WITH_GTID_ONLY';
+exports[4067] =
+  'ER_CHANGE_REP_SOURCE_CANT_DISABLE_AUTO_POSITION_WITH_GTID_ONLY';
+exports[4068] = 'ER_CHANGE_REP_SOURCE_CANT_DISABLE_GTID_ONLY_WITHOUT_POSITIONS';
+exports[4069] = 'ER_CHANGE_REP_SOURCE_CANT_DISABLE_AUTO_POS_WITHOUT_POSITIONS';
+exports[4070] = 'ER_CHANGE_REP_SOURCE_GR_CHANNEL_WITH_GTID_MODE_NOT_ON';
+exports[4071] = 'ER_CANT_USE_GTID_ONLY_WITH_GTID_MODE_NOT_ON';
+exports[4072] = 'ER_WARN_C_DISABLE_GTID_ONLY_WITH_SOURCE_AUTO_POS_INVALID_POS';
+exports[4073] = 'ER_DA_SSL_FIPS_MODE_ERROR';
+exports[4074] = 'ER_VALUE_OUT_OF_RANGE';
+exports[4075] = 'ER_FULLTEXT_WITH_ROLLUP';
+exports[4076] = 'ER_REGEXP_MISSING_RESOURCE';
+exports[4077] = 'ER_WARN_REGEXP_USING_DEFAULT';
+exports[4078] = 'ER_REGEXP_MISSING_FILE';
+exports[4079] = 'ER_WARN_DEPRECATED_COLLATION';
+exports[4080] = 'ER_CONCURRENT_PROCEDURE_USAGE';
+exports[4081] = 'ER_DA_GLOBAL_CONN_LIMIT';
+exports[4082] = 'ER_DA_CONN_LIMIT';
+exports[4083] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE_INSTANT';
+exports[4084] = 'ER_WARN_SF_UDF_NAME_COLLISION';
+exports[4085] = 'ER_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK';
+exports[4086] = 'ER_TOO_MANY_WINDOWS';
+exports[4087] = 'ER_MYSQLBACKUP_CLIENT_MSG';
+exports[4088] = 'ER_COMMENT_CONTAINS_INVALID_STRING';
+exports[4089] = 'ER_DEFINITION_CONTAINS_INVALID_STRING';
+exports[4090] = 'ER_CANT_EXECUTE_COMMAND_WITH_ASSIGNED_GTID_NEXT';
+exports[4091] = 'ER_XA_TEMP_TABLE';
+exports[4092] = 'ER_INNODB_MAX_ROW_VERSION';
+exports[4093] = 'ER_INNODB_INSTANT_ADD_NOT_SUPPORTED_MAX_SIZE';
+exports[4094] = 'ER_OPERATION_NOT_ALLOWED_WHILE_PRIMARY_CHANGE_IS_RUNNING';
+exports[4095] = 'ER_WARN_DEPRECATED_DATETIME_DELIMITER';
+exports[4096] = 'ER_WARN_DEPRECATED_SUPERFLUOUS_DELIMITER';
+exports[4097] = 'ER_CANNOT_PERSIST_SENSITIVE_VARIABLES';
+exports[4098] = 'ER_WARN_CANNOT_SECURELY_PERSIST_SENSITIVE_VARIABLES';
+exports[4099] = 'ER_WARN_TRG_ALREADY_EXISTS';
+exports[4100] = 'ER_IF_NOT_EXISTS_UNSUPPORTED_TRG_EXISTS_ON_DIFFERENT_TABLE';
+exports[4101] = 'ER_IF_NOT_EXISTS_UNSUPPORTED_UDF_NATIVE_FCT_NAME_COLLISION';
+exports[4102] = 'ER_SET_PASSWORD_AUTH_PLUGIN_ERROR';
+exports[4103] = 'ER_REDUCED_DBLWR_FILE_CORRUPTED';
+exports[4104] = 'ER_REDUCED_DBLWR_PAGE_FOUND';
+exports[4105] = 'ER_SRS_INVALID_LATITUDE_OF_ORIGIN';
+exports[4106] = 'ER_SRS_INVALID_LONGITUDE_OF_ORIGIN';
+exports[4107] = 'ER_SRS_UNUSED_PROJ_PARAMETER_PRESENT';
+exports[4108] = 'ER_GIPK_COLUMN_EXISTS';
+exports[4109] = 'ER_GIPK_FAILED_AUTOINC_COLUMN_EXISTS';
+exports[4110] = 'ER_GIPK_COLUMN_ALTER_NOT_ALLOWED';
+exports[4111] = 'ER_DROP_PK_COLUMN_TO_DROP_GIPK';
+exports[4112] = 'ER_CREATE_SELECT_WITH_GIPK_DISALLOWED_IN_SBR';
+exports[4113] = 'ER_DA_EXPIRE_LOGS_DAYS_IGNORED';
+exports[4114] = 'ER_CTE_RECURSIVE_NOT_UNION';
+exports[4115] = 'ER_COMMAND_BACKEND_FAILED_TO_FETCH_SECURITY_CTX';
+exports[4116] = 'ER_COMMAND_SERVICE_BACKEND_FAILED';
+exports[4117] = 'ER_CLIENT_FILE_PRIVILEGE_FOR_REPLICATION_CHECKS';
+exports[4118] = 'ER_GROUP_REPLICATION_FORCE_MEMBERS_COMMAND_FAILURE';
+exports[4119] = 'ER_WARN_DEPRECATED_IDENT';
+exports[4120] = 'ER_INTERSECT_ALL_MAX_DUPLICATES_EXCEEDED';
+exports[4121] = 'ER_TP_QUERY_THRS_PER_GRP_EXCEEDS_TXN_THR_LIMIT';
+exports[4122] = 'ER_BAD_TIMESTAMP_FORMAT';
+exports[4123] = 'ER_SHAPE_PRIDICTION_UDF';
+exports[4124] = 'ER_SRS_INVALID_HEIGHT';
+exports[4125] = 'ER_SRS_INVALID_SCALING';
+exports[4126] = 'ER_SRS_INVALID_ZONE_WIDTH';
+exports[4127] = 'ER_SRS_INVALID_LATITUDE_POLAR_STERE_VAR_A';
+exports[4128] = 'ER_WARN_DEPRECATED_CLIENT_NO_SCHEMA_OPTION';
+exports[4129] = 'ER_TABLE_NOT_EMPTY';
+exports[4130] = 'ER_TABLE_NO_PRIMARY_KEY';
+exports[4131] = 'ER_TABLE_IN_SHARED_TABLESPACE';
+exports[4132] = 'ER_INDEX_OTHER_THAN_PK';
+exports[4133] = 'ER_LOAD_BULK_DATA_UNSORTED';
+exports[4134] = 'ER_BULK_EXECUTOR_ERROR';
+exports[4135] = 'ER_BULK_READER_LIBCURL_INIT_FAILED';
+exports[4136] = 'ER_BULK_READER_LIBCURL_ERROR';
+exports[4137] = 'ER_BULK_READER_SERVER_ERROR';
+exports[4138] = 'ER_BULK_READER_COMMUNICATION_ERROR';
+exports[4139] = 'ER_BULK_LOAD_DATA_FAILED';
+exports[4140] = 'ER_BULK_LOADER_COLUMN_TOO_BIG_FOR_LEFTOVER_BUFFER';
+exports[4141] = 'ER_BULK_LOADER_COMPONENT_ERROR';
+exports[4142] = 'ER_BULK_LOADER_FILE_CONTAINS_LESS_LINES_THAN_IGNORE_CLAUSE';
+exports[4143] = 'ER_BULK_PARSER_MISSING_ENCLOSED_BY';
+exports[4144] = 'ER_BULK_PARSER_ROW_BUFFER_MAX_TOTAL_COLS_EXCEEDED';
+exports[4145] = 'ER_BULK_PARSER_COPY_BUFFER_SIZE_EXCEEDED';
+exports[4146] = 'ER_BULK_PARSER_UNEXPECTED_END_OF_INPUT';
+exports[4147] = 'ER_BULK_PARSER_UNEXPECTED_ROW_TERMINATOR';
+exports[4148] = 'ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_ENDING_ENCLOSED_BY';
+exports[4149] = 'ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_NULL_ESCAPE';
+exports[4150] = 'ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_COLUMN_TERMINATOR';
+exports[4151] = 'ER_BULK_PARSER_INCOMPLETE_ESCAPE_SEQUENCE';
+exports[4152] = 'ER_LOAD_BULK_DATA_FAILED';
+exports[4153] = 'ER_LOAD_BULK_DATA_WRONG_VALUE_FOR_FIELD';
+exports[4154] = 'ER_LOAD_BULK_DATA_WARN_NULL_TO_NOTNULL';
+exports[4155] = 'ER_REQUIRE_TABLE_PRIMARY_KEY_CHECK_GENERATE_WITH_GR';
+exports[4156] = 'ER_CANT_CHANGE_SYS_VAR_IN_READ_ONLY_MODE';
+exports[4157] = 'ER_INNODB_INSTANT_ADD_DROP_NOT_SUPPORTED_MAX_SIZE';
+exports[4158] = 'ER_INNODB_INSTANT_ADD_NOT_SUPPORTED_MAX_FIELDS';
+exports[4159] = 'ER_CANT_SET_PERSISTED';
+exports[4160] = 'ER_INSTALL_COMPONENT_SET_NULL_VALUE';
+exports[4161] = 'ER_INSTALL_COMPONENT_SET_UNUSED_VALUE';
+exports[4162] = 'ER_WARN_DEPRECATED_USER_DEFINED_COLLATIONS';
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/field_flags.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/field_flags.js
new file mode 100644
index 0000000..184905c
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/field_flags.js	
@@ -0,0 +1,20 @@
+'use strict';
+
+// Manually extracted from mysql-5.5.23/include/mysql_com.h
+exports.NOT_NULL = 1; /* Field can't be NULL */
+exports.PRI_KEY = 2; /* Field is part of a primary key */
+exports.UNIQUE_KEY = 4; /* Field is part of a unique key */
+exports.MULTIPLE_KEY = 8; /* Field is part of a key */
+exports.BLOB = 16; /* Field is a blob */
+exports.UNSIGNED = 32; /* Field is unsigned */
+exports.ZEROFILL = 64; /* Field is zerofill */
+exports.BINARY = 128; /* Field is binary   */
+
+/* The following are only sent to new clients */
+exports.ENUM = 256; /* field is an enum */
+exports.AUTO_INCREMENT = 512; /* field is a autoincrement field */
+exports.TIMESTAMP = 1024; /* Field is a timestamp */
+exports.SET = 2048; /* field is a set */
+exports.NO_DEFAULT_VALUE = 4096; /* Field doesn't have default value */
+exports.ON_UPDATE_NOW = 8192; /* Field is set to NOW on UPDATE */
+exports.NUM = 32768; /* Field is num (for clients) */
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/server_status.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/server_status.js
new file mode 100644
index 0000000..828c851
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/server_status.js	
@@ -0,0 +1,44 @@
+'use strict';
+
+// Manually extracted from mysql-5.5.23/include/mysql_com.h
+
+/**
+  Is raised when a multi-statement transaction
+  has been started, either explicitly, by means
+  of BEGIN or COMMIT AND CHAIN, or
+  implicitly, by the first transactional
+  statement, when autocommit=off.
+*/
+exports.SERVER_STATUS_IN_TRANS = 1;
+exports.SERVER_STATUS_AUTOCOMMIT = 2; /* Server in auto_commit mode */
+exports.SERVER_MORE_RESULTS_EXISTS = 8; /* Multi query - next query exists */
+exports.SERVER_QUERY_NO_GOOD_INDEX_USED = 16;
+exports.SERVER_QUERY_NO_INDEX_USED = 32;
+/**
+  The server was able to fulfill the clients request and opened a
+  read-only non-scrollable cursor for a query. This flag comes
+  in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands.
+*/
+exports.SERVER_STATUS_CURSOR_EXISTS = 64;
+/**
+  This flag is sent when a read-only cursor is exhausted, in reply to
+  COM_STMT_FETCH command.
+*/
+exports.SERVER_STATUS_LAST_ROW_SENT = 128;
+exports.SERVER_STATUS_DB_DROPPED = 256; /* A database was dropped */
+exports.SERVER_STATUS_NO_BACKSLASH_ESCAPES = 512;
+/**
+  Sent to the client if after a prepared statement reprepare
+  we discovered that the new statement returns a different
+  number of result set columns.
+*/
+exports.SERVER_STATUS_METADATA_CHANGED = 1024;
+exports.SERVER_QUERY_WAS_SLOW = 2048;
+
+/**
+  To mark ResultSet containing output parameter values.
+*/
+exports.SERVER_PS_OUT_PARAMS = 4096;
+
+exports.SERVER_STATUS_IN_TRANS_READONLY = 0x2000; // in a read-only transaction
+exports.SERVER_SESSION_STATE_CHANGED = 0x4000;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/session_track.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/session_track.js
new file mode 100644
index 0000000..85d8fbf
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/session_track.js	
@@ -0,0 +1,11 @@
+'use strict';
+
+exports.SYSTEM_VARIABLES = 0;
+exports.SCHEMA = 1;
+exports.STATE_CHANGE = 2;
+exports.STATE_GTIDS = 3;
+exports.TRANSACTION_CHARACTERISTICS = 4;
+exports.TRANSACTION_STATE = 5;
+
+exports.FIRST_KEY = exports.SYSTEM_VARIABLES;
+exports.LAST_KEY = exports.TRANSACTION_STATE;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/ssl_profiles.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/ssl_profiles.js
new file mode 100644
index 0000000..11adc6f
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/ssl_profiles.js	
@@ -0,0 +1,11 @@
+'use strict';
+
+const awsCaBundle = require('aws-ssl-profiles');
+
+/**
+ * @deprecated
+ * Please, use [**aws-ssl-profiles**](https://github.com/mysqljs/aws-ssl-profiles).
+ */
+exports['Amazon RDS'] = {
+  ca: awsCaBundle.ca,
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/types.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/types.js
new file mode 100644
index 0000000..82a6655
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/constants/types.js	
@@ -0,0 +1,64 @@
+'use strict';
+
+module.exports = {
+  0x00: 'DECIMAL', // aka DECIMAL
+  0x01: 'TINY', // aka TINYINT, 1 byte
+  0x02: 'SHORT', // aka SMALLINT, 2 bytes
+  0x03: 'LONG', // aka INT, 4 bytes
+  0x04: 'FLOAT', // aka FLOAT, 4-8 bytes
+  0x05: 'DOUBLE', // aka DOUBLE, 8 bytes
+  0x06: 'NULL', // NULL (used for prepared statements, I think)
+  0x07: 'TIMESTAMP', // aka TIMESTAMP
+  0x08: 'LONGLONG', // aka BIGINT, 8 bytes
+  0x09: 'INT24', // aka MEDIUMINT, 3 bytes
+  0x0a: 'DATE', // aka DATE
+  0x0b: 'TIME', // aka TIME
+  0x0c: 'DATETIME', // aka DATETIME
+  0x0d: 'YEAR', // aka YEAR, 1 byte (don't ask)
+  0x0e: 'NEWDATE', // aka ?
+  0x0f: 'VARCHAR', // aka VARCHAR (?)
+  0x10: 'BIT', // aka BIT, 1-8 byte
+  0xf5: 'JSON',
+  0xf6: 'NEWDECIMAL', // aka DECIMAL
+  0xf7: 'ENUM', // aka ENUM
+  0xf8: 'SET', // aka SET
+  0xf9: 'TINY_BLOB', // aka TINYBLOB, TINYTEXT
+  0xfa: 'MEDIUM_BLOB', // aka MEDIUMBLOB, MEDIUMTEXT
+  0xfb: 'LONG_BLOB', // aka LONGBLOG, LONGTEXT
+  0xfc: 'BLOB', // aka BLOB, TEXT
+  0xfd: 'VAR_STRING', // aka VARCHAR, VARBINARY
+  0xfe: 'STRING', // aka CHAR, BINARY
+  0xff: 'GEOMETRY', // aka GEOMETRY
+};
+
+// Manually extracted from mysql-5.5.23/include/mysql_com.h
+// some more info here: http://dev.mysql.com/doc/refman/5.5/en/c-api-prepared-statement-type-codes.html
+module.exports.DECIMAL = 0x00; // aka DECIMAL (http://dev.mysql.com/doc/refman/5.0/en/precision-math-decimal-changes.html)
+module.exports.TINY = 0x01; // aka TINYINT, 1 byte
+module.exports.SHORT = 0x02; // aka SMALLINT, 2 bytes
+module.exports.LONG = 0x03; // aka INT, 4 bytes
+module.exports.FLOAT = 0x04; // aka FLOAT, 4-8 bytes
+module.exports.DOUBLE = 0x05; // aka DOUBLE, 8 bytes
+module.exports.NULL = 0x06; // NULL (used for prepared statements, I think)
+module.exports.TIMESTAMP = 0x07; // aka TIMESTAMP
+module.exports.LONGLONG = 0x08; // aka BIGINT, 8 bytes
+module.exports.INT24 = 0x09; // aka MEDIUMINT, 3 bytes
+module.exports.DATE = 0x0a; // aka DATE
+module.exports.TIME = 0x0b; // aka TIME
+module.exports.DATETIME = 0x0c; // aka DATETIME
+module.exports.YEAR = 0x0d; // aka YEAR, 1 byte (don't ask)
+module.exports.NEWDATE = 0x0e; // aka ?
+module.exports.VARCHAR = 0x0f; // aka VARCHAR (?)
+module.exports.BIT = 0x10; // aka BIT, 1-8 byte
+module.exports.VECTOR = 0xf2;
+module.exports.JSON = 0xf5;
+module.exports.NEWDECIMAL = 0xf6; // aka DECIMAL
+module.exports.ENUM = 0xf7; // aka ENUM
+module.exports.SET = 0xf8; // aka SET
+module.exports.TINY_BLOB = 0xf9; // aka TINYBLOB, TINYTEXT
+module.exports.MEDIUM_BLOB = 0xfa; // aka MEDIUMBLOB, MEDIUMTEXT
+module.exports.LONG_BLOB = 0xfb; // aka LONGBLOG, LONGTEXT
+module.exports.BLOB = 0xfc; // aka BLOB, TEXT
+module.exports.VAR_STRING = 0xfd; // aka VARCHAR, VARBINARY
+module.exports.STRING = 0xfe; // aka CHAR, BINARY
+module.exports.GEOMETRY = 0xff; // aka GEOMETRY
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/create_connection.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/create_connection.js
new file mode 100644
index 0000000..d39618f
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/create_connection.js	
@@ -0,0 +1,10 @@
+'use strict';
+
+const Connection = require('./connection.js');
+const ConnectionConfig = require('./connection_config.js');
+
+function createConnection(opts) {
+  return new Connection({ config: new ConnectionConfig(opts) });
+}
+
+module.exports = createConnection;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/create_pool.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/create_pool.js
new file mode 100644
index 0000000..ad19d77
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/create_pool.js	
@@ -0,0 +1,10 @@
+'use strict';
+
+const Pool = require('./pool.js');
+const PoolConfig = require('./pool_config.js');
+
+function createPool(config) {
+  return new Pool({ config: new PoolConfig(config) });
+}
+
+module.exports = createPool;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/create_pool_cluster.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/create_pool_cluster.js
new file mode 100644
index 0000000..4ded78b
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/create_pool_cluster.js	
@@ -0,0 +1,9 @@
+'use strict';
+
+const PoolCluster = require('./pool_cluster.js');
+
+function createPoolCluster(config) {
+  return new PoolCluster(config);
+}
+
+module.exports = createPoolCluster;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/helpers.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/helpers.js
new file mode 100644
index 0000000..ed2fa6a
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/helpers.js	
@@ -0,0 +1,83 @@
+'use strict';
+
+/*
+
+  this seems to be not only shorter, but faster than
+  string.replace(/\\/g, '\\\\').
+            replace(/\u0008/g, '\\b').
+            replace(/\t/g, '\\t').
+            replace(/\n/g, '\\n').
+            replace(/\f/g, '\\f').
+            replace(/\r/g, '\\r').
+            replace(/'/g, '\\\'').
+            replace(/"/g, '\\"');
+  or string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&")
+  see http://jsperf.com/string-escape-regexp-vs-json-stringify
+  */
+function srcEscape(str) {
+  return JSON.stringify({
+    [str]: 1,
+  }).slice(1, -3);
+}
+
+exports.srcEscape = srcEscape;
+
+let highlightFn;
+let cardinalRecommended = false;
+try {
+  // the purpose of this is to prevent projects using Webpack from displaying a warning during runtime if cardinal is not a dependency
+  const REQUIRE_TERMINATOR = '';
+  highlightFn = require(`cardinal${REQUIRE_TERMINATOR}`).highlight;
+} catch {
+  highlightFn = (text) => {
+    if (!cardinalRecommended) {
+      console.log('For nicer debug output consider install cardinal@^2.0.0');
+      cardinalRecommended = true;
+    }
+    return text;
+  };
+}
+
+/**
+ * Prints debug message with code frame, will try to use `cardinal` if available.
+ */
+function printDebugWithCode(msg, code) {
+  console.log(`\n\n${msg}:\n`);
+  console.log(`${highlightFn(code)}\n`);
+}
+
+exports.printDebugWithCode = printDebugWithCode;
+
+/**
+ * checks whether the `type` is in the `list`
+ */
+function typeMatch(type, list, Types) {
+  if (Array.isArray(list)) {
+    return list.some((t) => type === Types[t]);
+  }
+
+  return !!list;
+}
+
+exports.typeMatch = typeMatch;
+
+const privateObjectProps = new Set([
+  '__defineGetter__',
+  '__defineSetter__',
+  '__lookupGetter__',
+  '__lookupSetter__',
+  '__proto__',
+]);
+
+exports.privateObjectProps = privateObjectProps;
+
+const fieldEscape = (field, isEval = true) => {
+  if (privateObjectProps.has(field)) {
+    throw new Error(
+      `The field name (${field}) can't be the same as an object's private property.`
+    );
+  }
+
+  return isEval ? srcEscape(field) : field;
+};
+exports.fieldEscape = fieldEscape;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packet_parser.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packet_parser.js
new file mode 100644
index 0000000..989510c
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packet_parser.js	
@@ -0,0 +1,195 @@
+'use strict';
+
+const Packet = require('./packets/packet.js');
+
+const MAX_PACKET_LENGTH = 16777215;
+
+function readPacketLength(b, off) {
+  const b0 = b[off];
+  const b1 = b[off + 1];
+  const b2 = b[off + 2];
+  if (b1 + b2 === 0) {
+    return b0;
+  }
+  return b0 + (b1 << 8) + (b2 << 16);
+}
+
+class PacketParser {
+  constructor(onPacket, packetHeaderLength) {
+    // 4 for normal packets, 7 for comprssed protocol packets
+    if (typeof packetHeaderLength === 'undefined') {
+      packetHeaderLength = 4;
+    }
+    // array of last payload chunks
+    // only used when current payload is not complete
+    this.buffer = [];
+    // total length of chunks on buffer
+    this.bufferLength = 0;
+    this.packetHeaderLength = packetHeaderLength;
+    // incomplete header state: number of header bytes received
+    this.headerLen = 0;
+    // expected payload length
+    this.length = 0;
+    this.largePacketParts = [];
+    this.firstPacketSequenceId = 0;
+    this.onPacket = onPacket;
+    this.execute = PacketParser.prototype.executeStart;
+    this._flushLargePacket =
+      packetHeaderLength === 7
+        ? this._flushLargePacket7
+        : this._flushLargePacket4;
+  }
+
+  _flushLargePacket4() {
+    const numPackets = this.largePacketParts.length;
+    this.largePacketParts.unshift(Buffer.from([0, 0, 0, 0])); // insert header
+    const body = Buffer.concat(this.largePacketParts);
+    const packet = new Packet(this.firstPacketSequenceId, body, 0, body.length);
+    this.largePacketParts.length = 0;
+    packet.numPackets = numPackets;
+    this.onPacket(packet);
+  }
+
+  _flushLargePacket7() {
+    const numPackets = this.largePacketParts.length;
+    this.largePacketParts.unshift(Buffer.from([0, 0, 0, 0, 0, 0, 0])); // insert header
+    const body = Buffer.concat(this.largePacketParts);
+    this.largePacketParts.length = 0;
+    const packet = new Packet(this.firstPacketSequenceId, body, 0, body.length);
+    packet.numPackets = numPackets;
+    this.onPacket(packet);
+  }
+
+  executeStart(chunk) {
+    let start = 0;
+    const end = chunk.length;
+    while (end - start >= 3) {
+      this.length = readPacketLength(chunk, start);
+      if (end - start >= this.length + this.packetHeaderLength) {
+        // at least one full packet
+        const sequenceId = chunk[start + 3];
+        if (
+          this.length < MAX_PACKET_LENGTH &&
+          this.largePacketParts.length === 0
+        ) {
+          this.onPacket(
+            new Packet(
+              sequenceId,
+              chunk,
+              start,
+              start + this.packetHeaderLength + this.length
+            )
+          );
+        } else {
+          // first large packet - remember it's id
+          if (this.largePacketParts.length === 0) {
+            this.firstPacketSequenceId = sequenceId;
+          }
+          this.largePacketParts.push(
+            chunk.slice(
+              start + this.packetHeaderLength,
+              start + this.packetHeaderLength + this.length
+            )
+          );
+          if (this.length < MAX_PACKET_LENGTH) {
+            this._flushLargePacket();
+          }
+        }
+        start += this.packetHeaderLength + this.length;
+      } else {
+        // payload is incomplete
+        this.buffer = [chunk.slice(start + 3, end)];
+        this.bufferLength = end - start - 3;
+        this.execute = PacketParser.prototype.executePayload;
+        return;
+      }
+    }
+    if (end - start > 0) {
+      // there is start of length header, but it's not full 3 bytes
+      this.headerLen = end - start; // 1 or 2 bytes
+      this.length = chunk[start];
+      if (this.headerLen === 2) {
+        this.length = chunk[start] + (chunk[start + 1] << 8);
+        this.execute = PacketParser.prototype.executeHeader3;
+      } else {
+        this.execute = PacketParser.prototype.executeHeader2;
+      }
+    }
+  }
+
+  executePayload(chunk) {
+    let start = 0;
+    const end = chunk.length;
+    const remainingPayload =
+      this.length - this.bufferLength + this.packetHeaderLength - 3;
+    if (end - start >= remainingPayload) {
+      // last chunk for payload
+      const payload = Buffer.allocUnsafe(this.length + this.packetHeaderLength);
+      let offset = 3;
+      for (let i = 0; i < this.buffer.length; ++i) {
+        this.buffer[i].copy(payload, offset);
+        offset += this.buffer[i].length;
+      }
+      chunk.copy(payload, offset, start, start + remainingPayload);
+      const sequenceId = payload[3];
+      if (
+        this.length < MAX_PACKET_LENGTH &&
+        this.largePacketParts.length === 0
+      ) {
+        this.onPacket(
+          new Packet(
+            sequenceId,
+            payload,
+            0,
+            this.length + this.packetHeaderLength
+          )
+        );
+      } else {
+        // first large packet - remember it's id
+        if (this.largePacketParts.length === 0) {
+          this.firstPacketSequenceId = sequenceId;
+        }
+        this.largePacketParts.push(
+          payload.slice(
+            this.packetHeaderLength,
+            this.packetHeaderLength + this.length
+          )
+        );
+        if (this.length < MAX_PACKET_LENGTH) {
+          this._flushLargePacket();
+        }
+      }
+      this.buffer = [];
+      this.bufferLength = 0;
+      this.execute = PacketParser.prototype.executeStart;
+      start += remainingPayload;
+      if (end - start > 0) {
+        return this.execute(chunk.slice(start, end));
+      }
+    } else {
+      this.buffer.push(chunk);
+      this.bufferLength += chunk.length;
+    }
+    return null;
+  }
+
+  executeHeader2(chunk) {
+    this.length += chunk[0] << 8;
+    if (chunk.length > 1) {
+      this.length += chunk[1] << 16;
+      this.execute = PacketParser.prototype.executePayload;
+      return this.executePayload(chunk.slice(2));
+    }
+    this.execute = PacketParser.prototype.executeHeader3;
+
+    return null;
+  }
+
+  executeHeader3(chunk) {
+    this.length += chunk[0] << 16;
+    this.execute = PacketParser.prototype.executePayload;
+    return this.executePayload(chunk.slice(1));
+  }
+}
+
+module.exports = PacketParser;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/auth_next_factor.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/auth_next_factor.js
new file mode 100644
index 0000000..ba9fbd8
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/auth_next_factor.js	
@@ -0,0 +1,35 @@
+// Copyright (c) 2021, Oracle and/or its affiliates.
+
+'use strict';
+
+const Packet = require('../packets/packet');
+
+class AuthNextFactor {
+  constructor(opts) {
+    this.pluginName = opts.pluginName;
+    this.pluginData = opts.pluginData;
+  }
+
+  toPacket(encoding) {
+    const length = 6 + this.pluginName.length + this.pluginData.length;
+    const buffer = Buffer.allocUnsafe(length);
+    const packet = new Packet(0, buffer, 0, length);
+    packet.offset = 4;
+    packet.writeInt8(0x02);
+    packet.writeNullTerminatedString(this.pluginName, encoding);
+    packet.writeBuffer(this.pluginData);
+    return packet;
+  }
+
+  static fromPacket(packet, encoding) {
+    packet.readInt8(); // marker
+    const name = packet.readNullTerminatedString(encoding);
+    const data = packet.readBuffer();
+    return new AuthNextFactor({
+      pluginName: name,
+      pluginData: data,
+    });
+  }
+}
+
+module.exports = AuthNextFactor;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/auth_switch_request.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/auth_switch_request.js
new file mode 100644
index 0000000..7c3ed4d
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/auth_switch_request.js	
@@ -0,0 +1,38 @@
+'use strict';
+
+// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchRequest
+
+const Packet = require('../packets/packet');
+
+class AuthSwitchRequest {
+  constructor(opts) {
+    this.pluginName = opts.pluginName;
+    this.pluginData = opts.pluginData;
+  }
+
+  toPacket() {
+    const length = 6 + this.pluginName.length + this.pluginData.length;
+    const buffer = Buffer.allocUnsafe(length);
+    const packet = new Packet(0, buffer, 0, length);
+    packet.offset = 4;
+    packet.writeInt8(0xfe);
+    // TODO: use server encoding
+    packet.writeNullTerminatedString(this.pluginName, 'cesu8');
+    packet.writeBuffer(this.pluginData);
+    return packet;
+  }
+
+  static fromPacket(packet) {
+    packet.readInt8(); // marker
+    // assert marker == 0xfe?
+    // TODO: use server encoding
+    const name = packet.readNullTerminatedString('cesu8');
+    const data = packet.readBuffer();
+    return new AuthSwitchRequest({
+      pluginName: name,
+      pluginData: data,
+    });
+  }
+}
+
+module.exports = AuthSwitchRequest;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js
new file mode 100644
index 0000000..7294d08
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js	
@@ -0,0 +1,33 @@
+'use strict';
+
+// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchRequest
+
+const Packet = require('../packets/packet');
+
+class AuthSwitchRequestMoreData {
+  constructor(data) {
+    this.data = data;
+  }
+
+  toPacket() {
+    const length = 5 + this.data.length;
+    const buffer = Buffer.allocUnsafe(length);
+    const packet = new Packet(0, buffer, 0, length);
+    packet.offset = 4;
+    packet.writeInt8(0x01);
+    packet.writeBuffer(this.data);
+    return packet;
+  }
+
+  static fromPacket(packet) {
+    packet.readInt8(); // marker
+    const data = packet.readBuffer();
+    return new AuthSwitchRequestMoreData(data);
+  }
+
+  static verifyMarker(packet) {
+    return packet.peekByte() === 0x01;
+  }
+}
+
+module.exports = AuthSwitchRequestMoreData;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/auth_switch_response.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/auth_switch_response.js
new file mode 100644
index 0000000..2a821a0
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/auth_switch_response.js	
@@ -0,0 +1,30 @@
+'use strict';
+
+// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchRequest
+
+const Packet = require('../packets/packet');
+
+class AuthSwitchResponse {
+  constructor(data) {
+    if (!Buffer.isBuffer(data)) {
+      data = Buffer.from(data);
+    }
+    this.data = data;
+  }
+
+  toPacket() {
+    const length = 4 + this.data.length;
+    const buffer = Buffer.allocUnsafe(length);
+    const packet = new Packet(0, buffer, 0, length);
+    packet.offset = 4;
+    packet.writeBuffer(this.data);
+    return packet;
+  }
+
+  static fromPacket(packet) {
+    const data = packet.readBuffer();
+    return new AuthSwitchResponse(data);
+  }
+}
+
+module.exports = AuthSwitchResponse;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/binary_row.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/binary_row.js
new file mode 100644
index 0000000..d374b8d
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/binary_row.js	
@@ -0,0 +1,95 @@
+'use strict';
+
+const Types = require('../constants/types');
+const Packet = require('../packets/packet');
+
+const binaryReader = new Array(256);
+
+class BinaryRow {
+  constructor(columns) {
+    this.columns = columns || [];
+  }
+
+  static toPacket(columns, encoding) {
+    // throw new Error('Not implemented');
+    const sequenceId = 0; // TODO remove, this is calculated now in connecton
+    let length = 0;
+    columns.forEach((val) => {
+      if (val === null || typeof val === 'undefined') {
+        ++length;
+        return;
+      }
+      length += Packet.lengthCodedStringLength(val.toString(10), encoding);
+    });
+
+    length = length + 2;
+
+    const buffer = Buffer.allocUnsafe(length + 4);
+    const packet = new Packet(sequenceId, buffer, 0, length + 4);
+    packet.offset = 4;
+
+    packet.writeInt8(0);
+
+    let bitmap = 0;
+    let bitValue = 1;
+    columns.forEach((parameter) => {
+      if (parameter.type === Types.NULL) {
+        bitmap += bitValue;
+      }
+      bitValue *= 2;
+      if (bitValue === 256) {
+        packet.writeInt8(bitmap);
+        bitmap = 0;
+        bitValue = 1;
+      }
+    });
+    if (bitValue !== 1) {
+      packet.writeInt8(bitmap);
+    }
+
+    columns.forEach((val) => {
+      if (val === null) {
+        packet.writeNull();
+        return;
+      }
+      if (typeof val === 'undefined') {
+        packet.writeInt8(0);
+        return;
+      }
+      packet.writeLengthCodedString(val.toString(10), encoding);
+    });
+    return packet;
+  }
+
+  // TODO: complete list of types...
+  static fromPacket(fields, packet) {
+    const columns = new Array(fields.length);
+    packet.readInt8(); // TODO check it's 0
+    const nullBitmapLength = Math.floor((fields.length + 7 + 2) / 8);
+    // TODO: read and interpret null bitmap
+    packet.skip(nullBitmapLength);
+    for (let i = 0; i < columns.length; ++i) {
+      columns[i] = binaryReader[fields[i].columnType].apply(packet);
+    }
+    return new BinaryRow(columns);
+  }
+}
+
+// TODO: replace with constants.MYSQL_TYPE_*
+binaryReader[Types.DECIMAL] = Packet.prototype.readLengthCodedString;
+binaryReader[1] = Packet.prototype.readInt8; // tiny
+binaryReader[2] = Packet.prototype.readInt16; // short
+binaryReader[3] = Packet.prototype.readInt32; // long
+binaryReader[4] = Packet.prototype.readFloat; // float
+binaryReader[5] = Packet.prototype.readDouble; // double
+binaryReader[6] = Packet.prototype.assertInvalid; // null, should be skipped vie null bitmap
+binaryReader[7] = Packet.prototype.readTimestamp; // timestamp, http://dev.mysql.com/doc/internals/en/prepared-statements.html#packet-ProtocolBinary::MYSQL_TYPE_TIMESTAMP
+binaryReader[8] = Packet.prototype.readInt64; // long long
+binaryReader[9] = Packet.prototype.readInt32; // int24
+binaryReader[10] = Packet.prototype.readTimestamp; // date
+binaryReader[11] = Packet.prototype.readTime; // time, http://dev.mysql.com/doc/internals/en/prepared-statements.html#packet-ProtocolBinary::MYSQL_TYPE_TIME
+binaryReader[12] = Packet.prototype.readDateTime; // datetime, http://dev.mysql.com/doc/internals/en/prepared-statements.html#packet-ProtocolBinary::MYSQL_TYPE_DATETIME
+binaryReader[13] = Packet.prototype.readInt16; // year
+binaryReader[Types.VAR_STRING] = Packet.prototype.readLengthCodedString; // var string
+
+module.exports = BinaryRow;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/binlog_dump.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/binlog_dump.js
new file mode 100644
index 0000000..e014837
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/binlog_dump.js	
@@ -0,0 +1,33 @@
+'use strict';
+
+// http://dev.mysql.com/doc/internals/en/com-binlog-dump.html#packet-COM_BINLOG_DUMP
+
+const Packet = require('../packets/packet');
+const CommandCodes = require('../constants/commands');
+
+// TODO: add flag to constants
+// 0x01 - BINLOG_DUMP_NON_BLOCK
+// send EOF instead of blocking
+class BinlogDump {
+  constructor(opts) {
+    this.binlogPos = opts.binlogPos || 0;
+    this.serverId = opts.serverId || 0;
+    this.flags = opts.flags || 0;
+    this.filename = opts.filename || '';
+  }
+
+  toPacket() {
+    const length = 15 + Buffer.byteLength(this.filename, 'utf8'); // TODO: should be ascii?
+    const buffer = Buffer.allocUnsafe(length);
+    const packet = new Packet(0, buffer, 0, length);
+    packet.offset = 4;
+    packet.writeInt8(CommandCodes.BINLOG_DUMP);
+    packet.writeInt32(this.binlogPos);
+    packet.writeInt16(this.flags);
+    packet.writeInt32(this.serverId);
+    packet.writeString(this.filename);
+    return packet;
+  }
+}
+
+module.exports = BinlogDump;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/binlog_query_statusvars.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/binlog_query_statusvars.js
new file mode 100644
index 0000000..7338d60
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/binlog_query_statusvars.js	
@@ -0,0 +1,115 @@
+'use strict';
+
+// http://dev.mysql.com/doc/internals/en/query-event.html
+
+const keys = {
+  FLAGS2: 0,
+  SQL_MODE: 1,
+  CATALOG: 2,
+  AUTO_INCREMENT: 3,
+  CHARSET: 4,
+  TIME_ZONE: 5,
+  CATALOG_NZ: 6,
+  LC_TIME_NAMES: 7,
+  CHARSET_DATABASE: 8,
+  TABLE_MAP_FOR_UPDATE: 9,
+  MASTER_DATA_WRITTEN: 10,
+  INVOKERS: 11,
+  UPDATED_DB_NAMES: 12,
+  MICROSECONDS: 3,
+};
+
+module.exports = function parseStatusVars(buffer) {
+  const result = {};
+  let offset = 0;
+  let key, length, prevOffset;
+  while (offset < buffer.length) {
+    key = buffer[offset++];
+    switch (key) {
+      case keys.FLAGS2:
+        result.flags = buffer.readUInt32LE(offset);
+        offset += 4;
+        break;
+      case keys.SQL_MODE:
+        // value is 8 bytes, but all dcumented flags are in first 4 bytes
+        result.sqlMode = buffer.readUInt32LE(offset);
+        offset += 8;
+        break;
+      case keys.CATALOG:
+        length = buffer[offset++];
+        result.catalog = buffer.toString('utf8', offset, offset + length);
+        offset += length + 1; // null byte after string
+        break;
+      case keys.CHARSET:
+        result.clientCharset = buffer.readUInt16LE(offset);
+        result.connectionCollation = buffer.readUInt16LE(offset + 2);
+        result.serverCharset = buffer.readUInt16LE(offset + 4);
+        offset += 6;
+        break;
+      case keys.TIME_ZONE:
+        length = buffer[offset++];
+        result.timeZone = buffer.toString('utf8', offset, offset + length);
+        offset += length; // no null byte
+        break;
+      case keys.CATALOG_NZ:
+        length = buffer[offset++];
+        result.catalogNz = buffer.toString('utf8', offset, offset + length);
+        offset += length; // no null byte
+        break;
+      case keys.LC_TIME_NAMES:
+        result.lcTimeNames = buffer.readUInt16LE(offset);
+        offset += 2;
+        break;
+      case keys.CHARSET_DATABASE:
+        result.schemaCharset = buffer.readUInt16LE(offset);
+        offset += 2;
+        break;
+      case keys.TABLE_MAP_FOR_UPDATE:
+        result.mapForUpdate1 = buffer.readUInt32LE(offset);
+        result.mapForUpdate2 = buffer.readUInt32LE(offset + 4);
+        offset += 8;
+        break;
+      case keys.MASTER_DATA_WRITTEN:
+        result.masterDataWritten = buffer.readUInt32LE(offset);
+        offset += 4;
+        break;
+      case keys.INVOKERS:
+        length = buffer[offset++];
+        result.invokerUsername = buffer.toString(
+          'utf8',
+          offset,
+          offset + length
+        );
+        offset += length;
+        length = buffer[offset++];
+        result.invokerHostname = buffer.toString(
+          'utf8',
+          offset,
+          offset + length
+        );
+        offset += length;
+        break;
+      case keys.UPDATED_DB_NAMES:
+        length = buffer[offset++];
+        // length - number of null-terminated strings
+        result.updatedDBs = []; // we'll store them as array here
+        for (; length; --length) {
+          prevOffset = offset;
+          // fast forward to null terminating byte
+          while (buffer[offset++] && offset < buffer.length) {
+            // empty body, everything inside while condition
+          }
+          result.updatedDBs.push(
+            buffer.toString('utf8', prevOffset, offset - 1)
+          );
+        }
+        break;
+      case keys.MICROSECONDS:
+        result.microseconds =
+          // REVIEW: INVALID UNKNOWN VARIABLE!
+          buffer.readInt16LE(offset) + (buffer[offset + 2] << 16);
+        offset += 3;
+    }
+  }
+  return result;
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/change_user.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/change_user.js
new file mode 100644
index 0000000..242145e
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/change_user.js	
@@ -0,0 +1,97 @@
+'use strict';
+
+const CommandCode = require('../constants/commands.js');
+const ClientConstants = require('../constants/client.js');
+const Packet = require('../packets/packet.js');
+const auth41 = require('../auth_41.js');
+const CharsetToEncoding = require('../constants/charset_encodings.js');
+
+// https://dev.mysql.com/doc/internals/en/com-change-user.html#packet-COM_CHANGE_USER
+class ChangeUser {
+  constructor(opts) {
+    this.flags = opts.flags;
+    this.user = opts.user || '';
+    this.database = opts.database || '';
+    this.password = opts.password || '';
+    this.passwordSha1 = opts.passwordSha1;
+    this.authPluginData1 = opts.authPluginData1;
+    this.authPluginData2 = opts.authPluginData2;
+    this.connectAttributes = opts.connectAttrinutes || {};
+    let authToken;
+    if (this.passwordSha1) {
+      authToken = auth41.calculateTokenFromPasswordSha(
+        this.passwordSha1,
+        this.authPluginData1,
+        this.authPluginData2
+      );
+    } else {
+      authToken = auth41.calculateToken(
+        this.password,
+        this.authPluginData1,
+        this.authPluginData2
+      );
+    }
+    this.authToken = authToken;
+    this.charsetNumber = opts.charsetNumber;
+  }
+
+  // TODO
+  // ChangeUser.fromPacket = function(packet)
+  // };
+  serializeToBuffer(buffer) {
+    const isSet = (flag) => this.flags & ClientConstants[flag];
+    const packet = new Packet(0, buffer, 0, buffer.length);
+    packet.offset = 4;
+    const encoding = CharsetToEncoding[this.charsetNumber];
+    packet.writeInt8(CommandCode.CHANGE_USER);
+    packet.writeNullTerminatedString(this.user, encoding);
+    if (isSet('SECURE_CONNECTION')) {
+      packet.writeInt8(this.authToken.length);
+      packet.writeBuffer(this.authToken);
+    } else {
+      packet.writeBuffer(this.authToken);
+      packet.writeInt8(0);
+    }
+    packet.writeNullTerminatedString(this.database, encoding);
+    packet.writeInt16(this.charsetNumber);
+    if (isSet('PLUGIN_AUTH')) {
+      // TODO: read this from parameters
+      packet.writeNullTerminatedString('mysql_native_password', 'latin1');
+    }
+    if (isSet('CONNECT_ATTRS')) {
+      const connectAttributes = this.connectAttributes;
+      const attrNames = Object.keys(connectAttributes);
+      let keysLength = 0;
+      for (let k = 0; k < attrNames.length; ++k) {
+        keysLength += Packet.lengthCodedStringLength(attrNames[k], encoding);
+        keysLength += Packet.lengthCodedStringLength(
+          connectAttributes[attrNames[k]],
+          encoding
+        );
+      }
+      packet.writeLengthCodedNumber(keysLength);
+      for (let k = 0; k < attrNames.length; ++k) {
+        packet.writeLengthCodedString(attrNames[k], encoding);
+        packet.writeLengthCodedString(
+          connectAttributes[attrNames[k]],
+          encoding
+        );
+      }
+    }
+    return packet;
+  }
+
+  toPacket() {
+    if (typeof this.user !== 'string') {
+      throw new Error('"user" connection config property must be a string');
+    }
+    if (typeof this.database !== 'string') {
+      throw new Error('"database" connection config property must be a string');
+    }
+    // dry run: calculate resulting packet length
+    const p = this.serializeToBuffer(Packet.MockBuffer());
+    return this.serializeToBuffer(Buffer.allocUnsafe(p.offset));
+  }
+}
+
+module.exports = ChangeUser;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/close_statement.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/close_statement.js
new file mode 100644
index 0000000..d8be98d
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/close_statement.js	
@@ -0,0 +1,21 @@
+'use strict';
+
+const Packet = require('../packets/packet');
+const CommandCodes = require('../constants/commands');
+
+class CloseStatement {
+  constructor(id) {
+    this.id = id;
+  }
+
+  // note: no response sent back
+  toPacket() {
+    const packet = new Packet(0, Buffer.allocUnsafe(9), 0, 9);
+    packet.offset = 4;
+    packet.writeInt8(CommandCodes.STMT_CLOSE);
+    packet.writeInt32(this.id);
+    return packet;
+  }
+}
+
+module.exports = CloseStatement;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/column_definition.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/column_definition.js
new file mode 100644
index 0000000..7cd3c27
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/column_definition.js	
@@ -0,0 +1,291 @@
+'use strict';
+
+const Packet = require('../packets/packet');
+const StringParser = require('../parsers/string');
+const CharsetToEncoding = require('../constants/charset_encodings.js');
+
+const fields = ['catalog', 'schema', 'table', 'orgTable', 'name', 'orgName'];
+
+// creating JS string is relatively expensive (compared to
+// reading few bytes from buffer) because all string properties
+// except for name are unlikely to be used we postpone
+// string conversion until property access
+//
+// TODO: watch for integration benchmarks (one with real network buffer)
+// there could be bad side effect as keeping reference to a buffer makes it
+// sit in the memory longer (usually until final .query() callback)
+// Latest v8 perform much better in regard to bufferer -> string conversion,
+// at some point of time this optimisation might become unnecessary
+// see https://github.com/sidorares/node-mysql2/pull/137
+//
+class ColumnDefinition {
+  constructor(packet, clientEncoding) {
+    this._buf = packet.buffer;
+    this._clientEncoding = clientEncoding;
+    this._catalogLength = packet.readLengthCodedNumber();
+    this._catalogStart = packet.offset;
+    packet.offset += this._catalogLength;
+    this._schemaLength = packet.readLengthCodedNumber();
+    this._schemaStart = packet.offset;
+    packet.offset += this._schemaLength;
+    this._tableLength = packet.readLengthCodedNumber();
+    this._tableStart = packet.offset;
+    packet.offset += this._tableLength;
+    this._orgTableLength = packet.readLengthCodedNumber();
+    this._orgTableStart = packet.offset;
+    packet.offset += this._orgTableLength;
+    // name is always used, don't make it lazy
+    const _nameLength = packet.readLengthCodedNumber();
+    const _nameStart = packet.offset;
+    packet.offset += _nameLength;
+    this._orgNameLength = packet.readLengthCodedNumber();
+    this._orgNameStart = packet.offset;
+    packet.offset += this._orgNameLength;
+    packet.skip(1); //  length of the following fields (always 0x0c)
+    this.characterSet = packet.readInt16();
+    this.encoding = CharsetToEncoding[this.characterSet];
+    this.name = StringParser.decode(
+      this._buf,
+      this.encoding === 'binary' ? this._clientEncoding : this.encoding,
+      _nameStart,
+      _nameStart + _nameLength
+    );
+    this.columnLength = packet.readInt32();
+    this.columnType = packet.readInt8();
+    this.type = this.columnType;
+    this.flags = packet.readInt16();
+    this.decimals = packet.readInt8();
+  }
+
+  inspect() {
+    return {
+      catalog: this.catalog,
+      schema: this.schema,
+      name: this.name,
+      orgName: this.orgName,
+      table: this.table,
+      orgTable: this.orgTable,
+      characterSet: this.characterSet,
+      encoding: this.encoding,
+      columnLength: this.columnLength,
+      type: this.columnType,
+      flags: this.flags,
+      decimals: this.decimals,
+    };
+  }
+
+  [Symbol.for('nodejs.util.inspect.custom')](depth, inspectOptions, inspect) {
+    const Types = require('../constants/types.js');
+    const typeNames = [];
+    for (const t in Types) {
+      typeNames[Types[t]] = t;
+    }
+    const fiedFlags = require('../constants/field_flags.js');
+    const flagNames = [];
+    // TODO: respect inspectOptions.showHidden
+    //const inspectFlags = inspectOptions.showHidden ? this.flags : this.flags & ~fiedFlags.PRI_KEY;
+    const inspectFlags = this.flags;
+    for (const f in fiedFlags) {
+      if (inspectFlags & fiedFlags[f]) {
+        if (f === 'PRI_KEY') {
+          flagNames.push('PRIMARY KEY');
+        } else if (f === 'NOT_NULL') {
+          flagNames.push('NOT NULL');
+        } else if (f === 'BINARY') {
+          // ignore flag for now
+        } else if (f === 'MULTIPLE_KEY') {
+          // not sure if that should be part of inspection.
+          // in the schema usually this is part of index definition
+          // example: UNIQUE KEY `my_uniq_id` (`id_box_elements`,`id_router`)
+          // note that only first column has MULTIPLE_KEY flag set in this case
+          // so there is no good way of knowing that this is part of index just
+          // by looking at indifidual field flags
+        } else if (f === 'NO_DEFAULT_VALUE') {
+          // almost the same as NOT_NULL?
+        } else if (f === 'BLOB') {
+          // included in the type
+        } else if (f === 'UNSIGNED') {
+          // this should be first after type
+        } else if (f === 'TIMESTAMP') {
+          // timestamp flag is redundant for inspection - already included in type
+        } else if (f === 'ON_UPDATE_NOW') {
+          flagNames.push('ON UPDATE CURRENT_TIMESTAMP');
+        } else {
+          flagNames.push(f);
+        }
+      }
+    }
+
+    if (depth > 1) {
+      return inspect({
+        ...this.inspect(),
+        typeName: typeNames[this.columnType],
+        flags: flagNames,
+      });
+    }
+
+    const isUnsigned = this.flags & fiedFlags.UNSIGNED;
+
+    let typeName = typeNames[this.columnType];
+    if (typeName === 'BLOB') {
+      // TODO: check for non-utf8mb4 encoding
+      if (this.columnLength === 4294967295) {
+        typeName = 'LONGTEXT';
+      } else if (this.columnLength === 67108860) {
+        typeName = 'MEDIUMTEXT';
+      } else if (this.columnLength === 262140) {
+        typeName = 'TEXT';
+      } else if (this.columnLength === 1020) {
+        // 255*4
+        typeName = 'TINYTEXT';
+      } else {
+        typeName = `BLOB(${this.columnLength})`;
+      }
+    } else if (typeName === 'VAR_STRING') {
+      // TODO: check for non-utf8mb4 encoding
+      typeName = `VARCHAR(${Math.ceil(this.columnLength / 4)})`;
+    } else if (typeName === 'TINY') {
+      if (
+        (this.columnLength === 3 && isUnsigned) ||
+        (this.columnLength === 4 && !isUnsigned)
+      ) {
+        typeName = 'TINYINT';
+      } else {
+        typeName = `TINYINT(${this.columnLength})`;
+      }
+    } else if (typeName === 'LONGLONG') {
+      if (this.columnLength === 20) {
+        typeName = 'BIGINT';
+      } else {
+        typeName = `BIGINT(${this.columnLength})`;
+      }
+    } else if (typeName === 'SHORT') {
+      if (isUnsigned && this.columnLength === 5) {
+        typeName = 'SMALLINT';
+      } else if (!isUnsigned && this.columnLength === 6) {
+        typeName = 'SMALLINT';
+      } else {
+        typeName = `SMALLINT(${this.columnLength})`;
+      }
+    } else if (typeName === 'LONG') {
+      if (isUnsigned && this.columnLength === 10) {
+        typeName = 'INT';
+      } else if (!isUnsigned && this.columnLength === 11) {
+        typeName = 'INT';
+      } else {
+        typeName = `INT(${this.columnLength})`;
+      }
+    } else if (typeName === 'INT24') {
+      if (isUnsigned && this.columnLength === 8) {
+        typeName = 'MEDIUMINT';
+      } else if (!isUnsigned && this.columnLength === 9) {
+        typeName = 'MEDIUMINT';
+      } else {
+        typeName = `MEDIUMINT(${this.columnLength})`;
+      }
+    } else if (typeName === 'DOUBLE') {
+      // DOUBLE without modifiers is reported as DOUBLE(22, 31)
+      if (this.columnLength === 22 && this.decimals === 31) {
+        typeName = 'DOUBLE';
+      } else {
+        typeName = `DOUBLE(${this.columnLength},${this.decimals})`;
+      }
+    } else if (typeName === 'FLOAT') {
+      // FLOAT without modifiers is reported as FLOAT(12, 31)
+      if (this.columnLength === 12 && this.decimals === 31) {
+        typeName = 'FLOAT';
+      } else {
+        typeName = `FLOAT(${this.columnLength},${this.decimals})`;
+      }
+    } else if (typeName === 'NEWDECIMAL') {
+      if (this.columnLength === 11 && this.decimals === 0) {
+        typeName = 'DECIMAL';
+      } else if (this.decimals === 0) {
+        // not sure why, but DECIMAL(13) is reported as DECIMAL(14, 0)
+        // and DECIMAL(13, 9) is reported as NEWDECIMAL(15, 9)
+        if (isUnsigned) {
+          typeName = `DECIMAL(${this.columnLength})`;
+        } else {
+          typeName = `DECIMAL(${this.columnLength - 1})`;
+        }
+      } else {
+        typeName = `DECIMAL(${this.columnLength - 2},${this.decimals})`;
+      }
+    } else {
+      typeName = `${typeNames[this.columnType]}(${this.columnLength})`;
+    }
+
+    if (isUnsigned) {
+      typeName += ' UNSIGNED';
+    }
+
+    // TODO respect colors option
+    return `\`${this.name}\` ${[typeName, ...flagNames].join(' ')}`;
+  }
+
+  static toPacket(column, sequenceId) {
+    let length = 17; // = 4 padding + 1 + 12 for the rest
+    fields.forEach((field) => {
+      length += Packet.lengthCodedStringLength(
+        column[field],
+        CharsetToEncoding[column.characterSet]
+      );
+    });
+    const buffer = Buffer.allocUnsafe(length);
+
+    const packet = new Packet(sequenceId, buffer, 0, length);
+    function writeField(name) {
+      packet.writeLengthCodedString(
+        column[name],
+        CharsetToEncoding[column.characterSet]
+      );
+    }
+    packet.offset = 4;
+    fields.forEach(writeField);
+    packet.writeInt8(0x0c);
+    packet.writeInt16(column.characterSet);
+    packet.writeInt32(column.columnLength);
+    packet.writeInt8(column.columnType);
+    packet.writeInt16(column.flags);
+    packet.writeInt8(column.decimals);
+    packet.writeInt16(0); // filler
+    return packet;
+  }
+
+  // node-mysql compatibility: alias "db" to "schema"
+  get db() {
+    return this.schema;
+  }
+}
+
+const addString = function (name) {
+  Object.defineProperty(ColumnDefinition.prototype, name, {
+    get: function () {
+      const start = this[`_${name}Start`];
+      const end = start + this[`_${name}Length`];
+      const val = StringParser.decode(
+        this._buf,
+        this.encoding === 'binary' ? this._clientEncoding : this.encoding,
+        start,
+        end
+      );
+
+      Object.defineProperty(this, name, {
+        value: val,
+        writable: false,
+        configurable: false,
+        enumerable: false,
+      });
+
+      return val;
+    },
+  });
+};
+
+addString('catalog');
+addString('schema');
+addString('table');
+addString('orgTable');
+addString('orgName');
+
+module.exports = ColumnDefinition;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/execute.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/execute.js
new file mode 100644
index 0000000..ffbbc91
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/execute.js	
@@ -0,0 +1,214 @@
+'use strict';
+
+const CursorType = require('../constants/cursor');
+const CommandCodes = require('../constants/commands');
+const Types = require('../constants/types');
+const Packet = require('../packets/packet');
+const CharsetToEncoding = require('../constants/charset_encodings.js');
+
+function isJSON(value) {
+  return (
+    Array.isArray(value) ||
+    value.constructor === Object ||
+    (typeof value.toJSON === 'function' && !Buffer.isBuffer(value))
+  );
+}
+
+/**
+ * Converts a value to an object describing type, String/Buffer representation and length
+ * @param {*} value
+ */
+function toParameter(value, encoding, timezone) {
+  let type = Types.VAR_STRING;
+  let length;
+  let writer = function (value) {
+    // eslint-disable-next-line no-invalid-this
+    return Packet.prototype.writeLengthCodedString.call(this, value, encoding);
+  };
+  if (value !== null) {
+    switch (typeof value) {
+      case 'undefined':
+        throw new TypeError('Bind parameters must not contain undefined');
+
+      case 'number':
+        type = Types.DOUBLE;
+        length = 8;
+        writer = Packet.prototype.writeDouble;
+        break;
+
+      case 'boolean':
+        value = value | 0;
+        type = Types.TINY;
+        length = 1;
+        writer = Packet.prototype.writeInt8;
+        break;
+
+      case 'object':
+        if (Object.prototype.toString.call(value) === '[object Date]') {
+          type = Types.DATETIME;
+          length = 12;
+          writer = function (value) {
+            // eslint-disable-next-line no-invalid-this
+            return Packet.prototype.writeDate.call(this, value, timezone);
+          };
+        } else if (isJSON(value)) {
+          value = JSON.stringify(value);
+          type = Types.JSON;
+        } else if (Buffer.isBuffer(value)) {
+          length = Packet.lengthCodedNumberLength(value.length) + value.length;
+          writer = Packet.prototype.writeLengthCodedBuffer;
+        }
+        break;
+
+      default:
+        value = value.toString();
+    }
+  } else {
+    value = '';
+    type = Types.NULL;
+  }
+  if (!length) {
+    length = Packet.lengthCodedStringLength(value, encoding);
+  }
+  return { value, type, length, writer };
+}
+
+class Execute {
+  constructor(id, parameters, charsetNumber, timezone) {
+    this.id = id;
+    this.parameters = parameters;
+    this.encoding = CharsetToEncoding[charsetNumber];
+    this.timezone = timezone;
+  }
+
+  static fromPacket(packet, encoding) {
+    const stmtId = packet.readInt32();
+    const flags = packet.readInt8();
+    const iterationCount = packet.readInt32();
+
+    let i = packet.offset;
+    while (i < packet.end - 1) {
+      if (
+        (packet.buffer[i + 1] === Types.VAR_STRING ||
+          packet.buffer[i + 1] === Types.NULL ||
+          packet.buffer[i + 1] === Types.DOUBLE ||
+          packet.buffer[i + 1] === Types.TINY ||
+          packet.buffer[i + 1] === Types.DATETIME ||
+          packet.buffer[i + 1] === Types.JSON) &&
+        packet.buffer[i] === 1 &&
+        packet.buffer[i + 2] === 0
+      ) {
+        break;
+      } else {
+        packet.readInt8();
+      }
+      i++;
+    }
+
+    const types = [];
+
+    for (let i = packet.offset + 1; i < packet.end - 1; i++) {
+      if (
+        (packet.buffer[i] === Types.VAR_STRING ||
+          packet.buffer[i] === Types.NULL ||
+          packet.buffer[i] === Types.DOUBLE ||
+          packet.buffer[i] === Types.TINY ||
+          packet.buffer[i] === Types.DATETIME ||
+          packet.buffer[i] === Types.JSON) &&
+        packet.buffer[i + 1] === 0
+      ) {
+        types.push(packet.buffer[i]);
+        packet.skip(2);
+      }
+    }
+
+    packet.skip(1);
+
+    const values = [];
+    for (let i = 0; i < types.length; i++) {
+      if (types[i] === Types.VAR_STRING) {
+        values.push(packet.readLengthCodedString(encoding));
+      } else if (types[i] === Types.DOUBLE) {
+        values.push(packet.readDouble());
+      } else if (types[i] === Types.TINY) {
+        values.push(packet.readInt8());
+      } else if (types[i] === Types.DATETIME) {
+        values.push(packet.readDateTime());
+      } else if (types[i] === Types.JSON) {
+        values.push(JSON.parse(packet.readLengthCodedString(encoding)));
+      }
+      if (types[i] === Types.NULL) {
+        values.push(null);
+      }
+    }
+
+    return { stmtId, flags, iterationCount, values };
+  }
+
+  toPacket() {
+    // TODO: don't try to calculate packet length in advance, allocate some big buffer in advance (header + 256 bytes?)
+    // and copy + reallocate if not enough
+    // 0 + 4 - length, seqId
+    // 4 + 1 - COM_EXECUTE
+    // 5 + 4 - stmtId
+    // 9 + 1 - flags
+    // 10 + 4 - iteration-count (always 1)
+    let length = 14;
+    let parameters;
+    if (this.parameters && this.parameters.length > 0) {
+      length += Math.floor((this.parameters.length + 7) / 8);
+      length += 1; // new-params-bound-flag
+      length += 2 * this.parameters.length; // type byte for each parameter if new-params-bound-flag is set
+      parameters = this.parameters.map((value) =>
+        toParameter(value, this.encoding, this.timezone)
+      );
+      length += parameters.reduce(
+        (accumulator, parameter) => accumulator + parameter.length,
+        0
+      );
+    }
+    const buffer = Buffer.allocUnsafe(length);
+    const packet = new Packet(0, buffer, 0, length);
+    packet.offset = 4;
+    packet.writeInt8(CommandCodes.STMT_EXECUTE);
+    packet.writeInt32(this.id);
+    packet.writeInt8(CursorType.NO_CURSOR); // flags
+    packet.writeInt32(1); // iteration-count, always 1
+    if (parameters) {
+      let bitmap = 0;
+      let bitValue = 1;
+      parameters.forEach((parameter) => {
+        if (parameter.type === Types.NULL) {
+          bitmap += bitValue;
+        }
+        bitValue *= 2;
+        if (bitValue === 256) {
+          packet.writeInt8(bitmap);
+          bitmap = 0;
+          bitValue = 1;
+        }
+      });
+      if (bitValue !== 1) {
+        packet.writeInt8(bitmap);
+      }
+      // TODO: explain meaning of the flag
+      // afaik, if set n*2 bytes with type of parameter are sent before parameters
+      // if not, previous execution types are used (TODO prooflink)
+      packet.writeInt8(1); // new-params-bound-flag
+      // Write parameter types
+      parameters.forEach((parameter) => {
+        packet.writeInt8(parameter.type); // field type
+        packet.writeInt8(0); // parameter flag
+      });
+      // Write parameter values
+      parameters.forEach((parameter) => {
+        if (parameter.type !== Types.NULL) {
+          parameter.writer.call(packet, parameter.value);
+        }
+      });
+    }
+    return packet;
+  }
+}
+
+module.exports = Execute;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/handshake.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/handshake.js
new file mode 100644
index 0000000..ee894a0
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/handshake.js	
@@ -0,0 +1,112 @@
+'use strict';
+
+const Packet = require('../packets/packet');
+const ClientConstants = require('../constants/client.js');
+
+// https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::Handshake
+
+class Handshake {
+  constructor(args) {
+    this.protocolVersion = args.protocolVersion;
+    this.serverVersion = args.serverVersion;
+    this.capabilityFlags = args.capabilityFlags;
+    this.connectionId = args.connectionId;
+    this.authPluginData1 = args.authPluginData1;
+    this.authPluginData2 = args.authPluginData2;
+    this.characterSet = args.characterSet;
+    this.statusFlags = args.statusFlags;
+    this.authPluginName = args.authPluginName;
+  }
+
+  setScrambleData(cb) {
+    require('crypto').randomBytes(20, (err, data) => {
+      if (err) {
+        cb(err);
+        return;
+      }
+      this.authPluginData1 = data.slice(0, 8);
+      this.authPluginData2 = data.slice(8, 20);
+      cb();
+    });
+  }
+
+  toPacket(sequenceId) {
+    const length = 68 + Buffer.byteLength(this.serverVersion, 'utf8');
+    const buffer = Buffer.alloc(length + 4, 0); // zero fill, 10 bytes filler later needs to contain zeros
+    const packet = new Packet(sequenceId, buffer, 0, length + 4);
+    packet.offset = 4;
+    packet.writeInt8(this.protocolVersion);
+    packet.writeString(this.serverVersion, 'cesu8');
+    packet.writeInt8(0);
+    packet.writeInt32(this.connectionId);
+    packet.writeBuffer(this.authPluginData1);
+    packet.writeInt8(0);
+    const capabilityFlagsBuffer = Buffer.allocUnsafe(4);
+    capabilityFlagsBuffer.writeUInt32LE(this.capabilityFlags, 0);
+    packet.writeBuffer(capabilityFlagsBuffer.slice(0, 2));
+    packet.writeInt8(this.characterSet);
+    packet.writeInt16(this.statusFlags);
+    packet.writeBuffer(capabilityFlagsBuffer.slice(2, 4));
+    packet.writeInt8(21); // authPluginDataLength
+    packet.skip(10);
+    packet.writeBuffer(this.authPluginData2);
+    packet.writeInt8(0);
+    packet.writeString('mysql_native_password', 'latin1');
+    packet.writeInt8(0);
+    return packet;
+  }
+
+  static fromPacket(packet) {
+    const args = {};
+    args.protocolVersion = packet.readInt8();
+    args.serverVersion = packet.readNullTerminatedString('cesu8');
+    args.connectionId = packet.readInt32();
+    args.authPluginData1 = packet.readBuffer(8);
+    packet.skip(1);
+    const capabilityFlagsBuffer = Buffer.allocUnsafe(4);
+    capabilityFlagsBuffer[0] = packet.readInt8();
+    capabilityFlagsBuffer[1] = packet.readInt8();
+    if (packet.haveMoreData()) {
+      args.characterSet = packet.readInt8();
+      args.statusFlags = packet.readInt16();
+      // upper 2 bytes
+      capabilityFlagsBuffer[2] = packet.readInt8();
+      capabilityFlagsBuffer[3] = packet.readInt8();
+      args.capabilityFlags = capabilityFlagsBuffer.readUInt32LE(0);
+      if (args.capabilityFlags & ClientConstants.PLUGIN_AUTH) {
+        args.authPluginDataLength = packet.readInt8();
+      } else {
+        args.authPluginDataLength = 0;
+        packet.skip(1);
+      }
+      packet.skip(10);
+    } else {
+      args.capabilityFlags = capabilityFlagsBuffer.readUInt16LE(0);
+    }
+
+    const isSecureConnection =
+      args.capabilityFlags & ClientConstants.SECURE_CONNECTION;
+    if (isSecureConnection) {
+      const authPluginDataLength = args.authPluginDataLength;
+      if (authPluginDataLength === 0) {
+        // for Secure Password Authentication
+        args.authPluginDataLength = 20;
+        args.authPluginData2 = packet.readBuffer(12);
+        packet.skip(1);
+      } else {
+        // length > 0
+        // for Custom Auth Plugin (PLUGIN_AUTH)
+        const len = Math.max(13, authPluginDataLength - 8);
+        args.authPluginData2 = packet.readBuffer(len);
+      }
+    }
+
+    if (args.capabilityFlags & ClientConstants.PLUGIN_AUTH) {
+      args.authPluginName = packet.readNullTerminatedString('ascii');
+    }
+
+    return new Handshake(args);
+  }
+}
+
+module.exports = Handshake;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/handshake_response.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/handshake_response.js
new file mode 100644
index 0000000..05ca962
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/handshake_response.js	
@@ -0,0 +1,173 @@
+'use strict';
+
+const ClientConstants = require('../constants/client.js');
+const CharsetToEncoding = require('../constants/charset_encodings.js');
+const Packet = require('../packets/packet.js');
+
+const auth41 = require('../auth_41.js');
+
+class HandshakeResponse {
+  constructor(handshake) {
+    this.user = handshake.user || '';
+    this.database = handshake.database || '';
+    this.password = handshake.password || '';
+    this.passwordSha1 = handshake.passwordSha1;
+    this.authPluginData1 = handshake.authPluginData1;
+    this.authPluginData2 = handshake.authPluginData2;
+    this.compress = handshake.compress;
+    this.clientFlags = handshake.flags;
+
+    // Accept pre-calculated authToken and authPluginName from caller
+    // This allows the caller to optimize by using the server's preferred auth method
+    if (
+      handshake.authToken !== undefined &&
+      handshake.authPluginName !== undefined
+    ) {
+      // Validate types to fail fast with clear errors
+      if (!Buffer.isBuffer(handshake.authToken)) {
+        throw new TypeError(
+          'HandshakeResponse authToken must be a Buffer when provided'
+        );
+      }
+      if (typeof handshake.authPluginName !== 'string') {
+        throw new TypeError(
+          'HandshakeResponse authPluginName must be a string when provided'
+        );
+      }
+      this.authToken = handshake.authToken;
+      this.authPluginName = handshake.authPluginName;
+    } else {
+      // Fallback to legacy behavior: calculate mysql_native_password token
+      // TODO: pre-4.1 auth support
+      let authToken;
+      if (this.passwordSha1) {
+        authToken = auth41.calculateTokenFromPasswordSha(
+          this.passwordSha1,
+          this.authPluginData1,
+          this.authPluginData2
+        );
+      } else {
+        authToken = auth41.calculateToken(
+          this.password,
+          this.authPluginData1,
+          this.authPluginData2
+        );
+      }
+      this.authToken = authToken;
+      this.authPluginName = 'mysql_native_password';
+    }
+
+    this.charsetNumber = handshake.charsetNumber;
+    this.encoding = CharsetToEncoding[handshake.charsetNumber];
+    this.connectAttributes = handshake.connectAttributes;
+  }
+
+  serializeResponse(buffer) {
+    const isSet = (flag) => this.clientFlags & ClientConstants[flag];
+    const packet = new Packet(0, buffer, 0, buffer.length);
+    packet.offset = 4;
+    packet.writeInt32(this.clientFlags);
+    packet.writeInt32(0); // max packet size. todo: move to config
+    packet.writeInt8(this.charsetNumber);
+    packet.skip(23);
+    const encoding = this.encoding;
+    packet.writeNullTerminatedString(this.user, encoding);
+    let k;
+    if (isSet('PLUGIN_AUTH_LENENC_CLIENT_DATA')) {
+      packet.writeLengthCodedNumber(this.authToken.length);
+      packet.writeBuffer(this.authToken);
+    } else if (isSet('SECURE_CONNECTION')) {
+      packet.writeInt8(this.authToken.length);
+      packet.writeBuffer(this.authToken);
+    } else {
+      packet.writeBuffer(this.authToken);
+      packet.writeInt8(0);
+    }
+    if (isSet('CONNECT_WITH_DB')) {
+      packet.writeNullTerminatedString(this.database, encoding);
+    }
+    if (isSet('PLUGIN_AUTH')) {
+      // Use the auth plugin name specified by the caller (optimized for server's preference)
+      // or fall back to mysql_native_password for backward compatibility
+      packet.writeNullTerminatedString(
+        this.authPluginName || 'mysql_native_password',
+        'latin1'
+      );
+    }
+    if (isSet('CONNECT_ATTRS')) {
+      const connectAttributes = this.connectAttributes || {};
+      const attrNames = Object.keys(connectAttributes);
+      let keysLength = 0;
+      for (k = 0; k < attrNames.length; ++k) {
+        keysLength += Packet.lengthCodedStringLength(attrNames[k], encoding);
+        keysLength += Packet.lengthCodedStringLength(
+          connectAttributes[attrNames[k]],
+          encoding
+        );
+      }
+      packet.writeLengthCodedNumber(keysLength);
+      for (k = 0; k < attrNames.length; ++k) {
+        packet.writeLengthCodedString(attrNames[k], encoding);
+        packet.writeLengthCodedString(
+          connectAttributes[attrNames[k]],
+          encoding
+        );
+      }
+    }
+    return packet;
+  }
+
+  toPacket() {
+    if (typeof this.user !== 'string') {
+      throw new Error('"user" connection config property must be a string');
+    }
+    if (typeof this.database !== 'string') {
+      throw new Error('"database" connection config property must be a string');
+    }
+    // dry run: calculate resulting packet length
+    const p = this.serializeResponse(Packet.MockBuffer());
+    return this.serializeResponse(Buffer.alloc(p.offset));
+  }
+  static fromPacket(packet) {
+    const args = {};
+    args.clientFlags = packet.readInt32();
+    function isSet(flag) {
+      return args.clientFlags & ClientConstants[flag];
+    }
+    args.maxPacketSize = packet.readInt32();
+    args.charsetNumber = packet.readInt8();
+    const encoding = CharsetToEncoding[args.charsetNumber];
+    args.encoding = encoding;
+    packet.skip(23);
+    args.user = packet.readNullTerminatedString(encoding);
+    let authTokenLength;
+    if (isSet('PLUGIN_AUTH_LENENC_CLIENT_DATA')) {
+      authTokenLength = packet.readLengthCodedNumber(encoding);
+      args.authToken = packet.readBuffer(authTokenLength);
+    } else if (isSet('SECURE_CONNECTION')) {
+      authTokenLength = packet.readInt8();
+      args.authToken = packet.readBuffer(authTokenLength);
+    } else {
+      args.authToken = packet.readNullTerminatedString(encoding);
+    }
+    if (isSet('CONNECT_WITH_DB')) {
+      args.database = packet.readNullTerminatedString(encoding);
+    }
+    if (isSet('PLUGIN_AUTH')) {
+      args.authPluginName = packet.readNullTerminatedString(encoding);
+    }
+    if (isSet('CONNECT_ATTRS')) {
+      const keysLength = packet.readLengthCodedNumber(encoding);
+      const keysEnd = packet.offset + keysLength;
+      const attrs = {};
+      while (packet.offset < keysEnd) {
+        attrs[packet.readLengthCodedString(encoding)] =
+          packet.readLengthCodedString(encoding);
+      }
+      args.connectAttributes = attrs;
+    }
+    return args;
+  }
+}
+
+module.exports = HandshakeResponse;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/index.js
new file mode 100644
index 0000000..0d5a0b5
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/index.js	
@@ -0,0 +1,152 @@
+// This file was modified by Oracle on June 1, 2021.
+// A utility method was introduced to generate an Error instance from a
+// binary server packet.
+// Modifications copyright (c) 2021, Oracle and/or its affiliates.
+
+// This file was modified by Oracle on September 21, 2021.
+// The new AuthNextFactor packet is now available.
+// Modifications copyright (c) 2021, Oracle and/or its affiliates.
+
+'use strict';
+
+const process = require('process');
+
+const AuthNextFactor = require('./auth_next_factor');
+const AuthSwitchRequest = require('./auth_switch_request');
+const AuthSwitchRequestMoreData = require('./auth_switch_request_more_data');
+const AuthSwitchResponse = require('./auth_switch_response');
+const BinaryRow = require('./binary_row');
+const BinlogDump = require('./binlog_dump');
+const ChangeUser = require('./change_user');
+const CloseStatement = require('./close_statement');
+const ColumnDefinition = require('./column_definition');
+const Execute = require('./execute');
+const Handshake = require('./handshake');
+const HandshakeResponse = require('./handshake_response');
+const PrepareStatement = require('./prepare_statement');
+const PreparedStatementHeader = require('./prepared_statement_header');
+const Query = require('./query');
+const RegisterSlave = require('./register_slave');
+const ResultSetHeader = require('./resultset_header');
+const SSLRequest = require('./ssl_request');
+const TextRow = require('./text_row');
+
+const ctorMap = {
+  AuthNextFactor,
+  AuthSwitchRequest,
+  AuthSwitchRequestMoreData,
+  AuthSwitchResponse,
+  BinaryRow,
+  BinlogDump,
+  ChangeUser,
+  CloseStatement,
+  ColumnDefinition,
+  Execute,
+  Handshake,
+  HandshakeResponse,
+  PrepareStatement,
+  PreparedStatementHeader,
+  Query,
+  RegisterSlave,
+  ResultSetHeader,
+  SSLRequest,
+  TextRow,
+};
+Object.entries(ctorMap).forEach(([name, ctor]) => {
+  module.exports[name] = ctor;
+  // monkey-patch it to include name if debug is on
+  if (process.env.NODE_DEBUG) {
+    if (ctor.prototype.toPacket) {
+      const old = ctor.prototype.toPacket;
+      ctor.prototype.toPacket = function () {
+        const p = old.call(this);
+        p._name = name;
+        return p;
+      };
+    }
+  }
+});
+
+// simple packets:
+const Packet = require('./packet');
+exports.Packet = Packet;
+
+class OK {
+  static toPacket(args, encoding) {
+    args = args || {};
+    const affectedRows = args.affectedRows || 0;
+    const insertId = args.insertId || 0;
+    const serverStatus = args.serverStatus || 0;
+    const warningCount = args.warningCount || 0;
+    const message = args.message || '';
+
+    let length = 9 + Packet.lengthCodedNumberLength(affectedRows);
+    length += Packet.lengthCodedNumberLength(insertId);
+
+    const buffer = Buffer.allocUnsafe(length);
+    const packet = new Packet(0, buffer, 0, length);
+    packet.offset = 4;
+    packet.writeInt8(0);
+    packet.writeLengthCodedNumber(affectedRows);
+    packet.writeLengthCodedNumber(insertId);
+    packet.writeInt16(serverStatus);
+    packet.writeInt16(warningCount);
+    packet.writeString(message, encoding);
+    packet._name = 'OK';
+    return packet;
+  }
+}
+
+exports.OK = OK;
+
+// warnings, statusFlags
+class EOF {
+  static toPacket(warnings, statusFlags) {
+    if (typeof warnings === 'undefined') {
+      warnings = 0;
+    }
+    if (typeof statusFlags === 'undefined') {
+      statusFlags = 0;
+    }
+    const packet = new Packet(0, Buffer.allocUnsafe(9), 0, 9);
+    packet.offset = 4;
+    packet.writeInt8(0xfe);
+    packet.writeInt16(warnings);
+    packet.writeInt16(statusFlags);
+    packet._name = 'EOF';
+    return packet;
+  }
+}
+
+exports.EOF = EOF;
+
+class Error {
+  static toPacket(args, encoding) {
+    const length = 13 + Buffer.byteLength(args.message, 'utf8');
+    const packet = new Packet(0, Buffer.allocUnsafe(length), 0, length);
+    packet.offset = 4;
+    packet.writeInt8(0xff);
+    packet.writeInt16(args.code);
+    // TODO: sql state parameter
+    packet.writeString('#_____', encoding);
+    packet.writeString(args.message, encoding);
+    packet._name = 'Error';
+    return packet;
+  }
+
+  static fromPacket(packet) {
+    packet.readInt8(); // marker
+    const code = packet.readInt16();
+    packet.readString(1, 'ascii'); // sql state marker
+    // The SQL state of the ERR_Packet which is always 5 bytes long.
+    // https://dev.mysql.com/doc/dev/mysql-server/8.0.11/page_protocol_basic_dt_strings.html#sect_protocol_basic_dt_string_fix
+    packet.readString(5, 'ascii'); // sql state (ignore for now)
+    const message = packet.readNullTerminatedString('utf8');
+    const error = new Error();
+    error.message = message;
+    error.code = code;
+    return error;
+  }
+}
+
+exports.Error = Error;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/packet.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/packet.js
new file mode 100644
index 0000000..22e576f
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/packet.js	
@@ -0,0 +1,978 @@
+// This file was modified by Oracle on June 1, 2021.
+// A comment describing some changes in the strict default SQL mode regarding
+// non-standard dates was introduced.
+// Modifications copyright (c) 2021, Oracle and/or its affiliates.
+
+'use strict';
+
+const ErrorCodeToName = require('../constants/errors.js');
+const NativeBuffer = require('buffer').Buffer;
+const Long = require('long');
+const StringParser = require('../parsers/string.js');
+const Types = require('../constants/types.js');
+const INVALID_DATE = new Date(NaN);
+
+// this is nearly duplicate of previous function so generated code is not slower
+// due to "if (dateStrings)" branching
+const pad = '000000000000';
+function leftPad(num, value) {
+  const s = value.toString();
+  // if we don't need to pad
+  if (s.length >= num) {
+    return s;
+  }
+  return (pad + s).slice(-num);
+}
+
+// The whole reason parse* function below exist
+// is because String creation is relatively expensive (at least with V8), and if we have
+// a buffer with "12345" content ideally we would like to bypass intermediate
+// "12345" string creation and directly build 12345 number out of
+//  data.
+// In my benchmarks the difference is ~25M 8-digit numbers per second vs
+// 4.5 M using Number(packet.readLengthCodedString())
+// not used when size is close to max precision as series of *10 accumulate error
+// and approximate result mihgt be diffreent from (approximate as well) Number(bigNumStringValue))
+// In the futire node version if speed difference is smaller parse* functions might be removed
+// don't consider them as Packet public API
+
+const minus = '-'.charCodeAt(0);
+const plus = '+'.charCodeAt(0);
+
+// TODO: handle E notation
+const dot = '.'.charCodeAt(0);
+const exponent = 'e'.charCodeAt(0);
+const exponentCapital = 'E'.charCodeAt(0);
+
+class Packet {
+  constructor(id, buffer, start, end) {
+    // hot path, enable checks when testing only
+    // if (!Buffer.isBuffer(buffer) || typeof start == 'undefined' || typeof end == 'undefined')
+    //  throw new Error('invalid packet');
+    this.sequenceId = id;
+    this.numPackets = 1;
+    this.buffer = buffer;
+    this.start = start;
+    this.offset = start + 4;
+    this.end = end;
+  }
+
+  // ==============================
+  // readers
+  // ==============================
+  reset() {
+    this.offset = this.start + 4;
+  }
+
+  length() {
+    return this.end - this.start;
+  }
+
+  slice() {
+    return this.buffer.slice(this.start, this.end);
+  }
+
+  dump() {
+    console.log(
+      [this.buffer.asciiSlice(this.start, this.end)],
+      this.buffer.slice(this.start, this.end),
+      this.length(),
+      this.sequenceId
+    );
+  }
+
+  haveMoreData() {
+    return this.end > this.offset;
+  }
+
+  skip(num) {
+    this.offset += num;
+  }
+
+  readInt8() {
+    return this.buffer[this.offset++];
+  }
+
+  readInt16() {
+    this.offset += 2;
+    return this.buffer.readUInt16LE(this.offset - 2);
+  }
+
+  readInt24() {
+    return this.readInt16() + (this.readInt8() << 16);
+  }
+
+  readInt32() {
+    this.offset += 4;
+    return this.buffer.readUInt32LE(this.offset - 4);
+  }
+
+  readSInt8() {
+    return this.buffer.readInt8(this.offset++);
+  }
+
+  readSInt16() {
+    this.offset += 2;
+    return this.buffer.readInt16LE(this.offset - 2);
+  }
+
+  readSInt32() {
+    this.offset += 4;
+    return this.buffer.readInt32LE(this.offset - 4);
+  }
+
+  readInt64JSNumber() {
+    const word0 = this.readInt32();
+    const word1 = this.readInt32();
+    const l = new Long(word0, word1, true);
+    return l.toNumber();
+  }
+
+  readSInt64JSNumber() {
+    const word0 = this.readInt32();
+    const word1 = this.readInt32();
+    if (!(word1 & 0x80000000)) {
+      return word0 + 0x100000000 * word1;
+    }
+    const l = new Long(word0, word1, false);
+    return l.toNumber();
+  }
+
+  readInt64String() {
+    const word0 = this.readInt32();
+    const word1 = this.readInt32();
+    const res = new Long(word0, word1, true);
+    return res.toString();
+  }
+
+  readSInt64String() {
+    const word0 = this.readInt32();
+    const word1 = this.readInt32();
+    const res = new Long(word0, word1, false);
+    return res.toString();
+  }
+
+  readInt64() {
+    const word0 = this.readInt32();
+    const word1 = this.readInt32();
+    let res = new Long(word0, word1, true);
+    const resNumber = res.toNumber();
+    const resString = res.toString();
+    res = resNumber.toString() === resString ? resNumber : resString;
+    return res;
+  }
+
+  readSInt64() {
+    const word0 = this.readInt32();
+    const word1 = this.readInt32();
+    let res = new Long(word0, word1, false);
+    const resNumber = res.toNumber();
+    const resString = res.toString();
+    res = resNumber.toString() === resString ? resNumber : resString;
+    return res;
+  }
+
+  isEOF() {
+    return this.buffer[this.offset] === 0xfe && this.length() < 13;
+  }
+
+  eofStatusFlags() {
+    return this.buffer.readInt16LE(this.offset + 3);
+  }
+
+  eofWarningCount() {
+    return this.buffer.readInt16LE(this.offset + 1);
+  }
+
+  readLengthCodedNumber(bigNumberStrings, signed) {
+    const byte1 = this.buffer[this.offset++];
+    if (byte1 < 251) {
+      return byte1;
+    }
+    return this.readLengthCodedNumberExt(byte1, bigNumberStrings, signed);
+  }
+
+  readLengthCodedNumberSigned(bigNumberStrings) {
+    return this.readLengthCodedNumber(bigNumberStrings, true);
+  }
+
+  readLengthCodedNumberExt(tag, bigNumberStrings, signed) {
+    let word0, word1;
+    let res;
+    if (tag === 0xfb) {
+      return null;
+    }
+    if (tag === 0xfc) {
+      return this.readInt8() + (this.readInt8() << 8);
+    }
+    if (tag === 0xfd) {
+      return this.readInt8() + (this.readInt8() << 8) + (this.readInt8() << 16);
+    }
+    if (tag === 0xfe) {
+      // TODO: check version
+      // Up to MySQL 3.22, 0xfe was followed by a 4-byte integer.
+      word0 = this.readInt32();
+      word1 = this.readInt32();
+      if (word1 === 0) {
+        return word0; // don't convert to float if possible
+      }
+      if (word1 < 2097152) {
+        // max exact float point int, 2^52 / 2^32
+        return word1 * 0x100000000 + word0;
+      }
+      res = new Long(word0, word1, !signed); // Long need unsigned
+      const resNumber = res.toNumber();
+      const resString = res.toString();
+      res = resNumber.toString() === resString ? resNumber : resString;
+      return bigNumberStrings ? resString : res;
+    }
+
+    console.trace();
+    throw new Error(`Should not reach here: ${tag}`);
+  }
+
+  readFloat() {
+    const res = this.buffer.readFloatLE(this.offset);
+    this.offset += 4;
+    return res;
+  }
+
+  readDouble() {
+    const res = this.buffer.readDoubleLE(this.offset);
+    this.offset += 8;
+    return res;
+  }
+
+  readBuffer(len) {
+    if (typeof len === 'undefined') {
+      len = this.end - this.offset;
+    }
+    this.offset += len;
+    return this.buffer.slice(this.offset - len, this.offset);
+  }
+
+  // DATE, DATETIME and TIMESTAMP
+  readDateTime(timezone) {
+    if (!timezone || timezone === 'Z' || timezone === 'local') {
+      const length = this.readInt8();
+      if (length === 0xfb) {
+        return null;
+      }
+      let y = 0;
+      let m = 0;
+      let d = 0;
+      let H = 0;
+      let M = 0;
+      let S = 0;
+      let ms = 0;
+      if (length > 3) {
+        y = this.readInt16();
+        m = this.readInt8();
+        d = this.readInt8();
+      }
+      if (length > 6) {
+        H = this.readInt8();
+        M = this.readInt8();
+        S = this.readInt8();
+      }
+      if (length > 10) {
+        ms = this.readInt32() / 1000;
+      }
+      // NO_ZERO_DATE mode and NO_ZERO_IN_DATE mode are part of the strict
+      // default SQL mode used by MySQL 8.0. This means that non-standard
+      // dates like '0000-00-00' become NULL. For older versions and other
+      // possible MySQL flavours we still need to account for the
+      // non-standard behaviour.
+      if (y + m + d + H + M + S + ms === 0) {
+        return INVALID_DATE;
+      }
+      if (timezone === 'Z') {
+        return new Date(Date.UTC(y, m - 1, d, H, M, S, ms));
+      }
+      return new Date(y, m - 1, d, H, M, S, ms);
+    }
+    let str = this.readDateTimeString(6, 'T', null);
+    if (str.length === 10) {
+      str += 'T00:00:00';
+    }
+    return new Date(str + timezone);
+  }
+
+  readDateTimeString(decimals, timeSep, columnType) {
+    const length = this.readInt8();
+    let y = 0;
+    let m = 0;
+    let d = 0;
+    let H = 0;
+    let M = 0;
+    let S = 0;
+    let ms = 0;
+    let str;
+    if (length > 3) {
+      y = this.readInt16();
+      m = this.readInt8();
+      d = this.readInt8();
+      str = [leftPad(4, y), leftPad(2, m), leftPad(2, d)].join('-');
+    }
+    if (length > 6) {
+      H = this.readInt8();
+      M = this.readInt8();
+      S = this.readInt8();
+      str += `${timeSep || ' '}${[
+        leftPad(2, H),
+        leftPad(2, M),
+        leftPad(2, S),
+      ].join(':')}`;
+    } else if (columnType === Types.DATETIME) {
+      str += ' 00:00:00';
+    }
+    if (length > 10) {
+      ms = this.readInt32();
+      str += '.';
+      if (decimals) {
+        ms = leftPad(6, ms);
+        if (ms.length > decimals) {
+          ms = ms.substring(0, decimals); // rounding is done at the MySQL side, only 0 are here
+        }
+      }
+      str += ms;
+    }
+    return str;
+  }
+
+  // TIME - value as a string, Can be negative
+  readTimeString(convertTtoMs) {
+    const length = this.readInt8();
+    if (length === 0) {
+      return '00:00:00';
+    }
+    const sign = this.readInt8() ? -1 : 1; // 'isNegative' flag byte
+    let d = 0;
+    let H = 0;
+    let M = 0;
+    let S = 0;
+    let ms = 0;
+    if (length > 6) {
+      d = this.readInt32();
+      H = this.readInt8();
+      M = this.readInt8();
+      S = this.readInt8();
+    }
+    if (length > 10) {
+      ms = this.readInt32();
+    }
+    if (convertTtoMs) {
+      H += d * 24;
+      M += H * 60;
+      S += M * 60;
+      ms += S * 1000;
+      ms *= sign;
+      return ms;
+    }
+    // Format follows mySQL TIME format ([-][h]hh:mm:ss[.u[u[u[u[u[u]]]]]])
+    // For positive times below 24 hours, this makes it equal to ISO 8601 times
+    return (
+      (sign === -1 ? '-' : '') +
+      [leftPad(2, d * 24 + H), leftPad(2, M), leftPad(2, S)].join(':') +
+      (ms ? `.${ms}`.replace(/0+$/, '') : '')
+    );
+  }
+
+  readLengthCodedString(encoding) {
+    const len = this.readLengthCodedNumber();
+    // TODO: check manually first byte here to avoid polymorphic return type?
+    if (len === null) {
+      return null;
+    }
+    this.offset += len;
+    // TODO: Use characterSetCode to get proper encoding
+    // https://github.com/sidorares/node-mysql2/pull/374
+    return StringParser.decode(
+      this.buffer,
+      encoding,
+      this.offset - len,
+      this.offset
+    );
+  }
+
+  readLengthCodedBuffer() {
+    const len = this.readLengthCodedNumber();
+    if (len === null) {
+      return null;
+    }
+    return this.readBuffer(len);
+  }
+
+  readNullTerminatedString(encoding) {
+    const start = this.offset;
+    let end = this.offset;
+    while (end < this.end && this.buffer[end] !== 0x00) {
+      end = end + 1;
+    }
+    this.offset = end + 1;
+    return StringParser.decode(this.buffer, encoding, start, end);
+  }
+
+  // TODO reuse?
+  readString(len, encoding) {
+    if (typeof len === 'string' && typeof encoding === 'undefined') {
+      encoding = len;
+      len = undefined;
+    }
+    if (typeof len === 'undefined') {
+      len = this.end - this.offset;
+    }
+    this.offset += len;
+    return StringParser.decode(
+      this.buffer,
+      encoding,
+      this.offset - len,
+      this.offset
+    );
+  }
+
+  parseInt(len, supportBigNumbers) {
+    if (len === null) {
+      return null;
+    }
+    if (len >= 14 && !supportBigNumbers) {
+      const s = this.buffer.toString('ascii', this.offset, this.offset + len);
+      this.offset += len;
+      return Number(s);
+    }
+    let result = 0;
+    const start = this.offset;
+    const end = this.offset + len;
+    let sign = 1;
+    if (len === 0) {
+      return 0; // TODO: assert? exception?
+    }
+    if (this.buffer[this.offset] === minus) {
+      this.offset++;
+      sign = -1;
+    }
+    // max precise int is 9007199254740992
+    let str;
+    const numDigits = end - this.offset;
+    if (supportBigNumbers) {
+      if (numDigits >= 15) {
+        str = this.readString(end - this.offset, 'binary');
+        result = parseInt(str, 10);
+        if (result.toString() === str) {
+          return sign * result;
+        }
+        return sign === -1 ? `-${str}` : str;
+      }
+      if (numDigits > 16) {
+        str = this.readString(end - this.offset);
+        return sign === -1 ? `-${str}` : str;
+      }
+    }
+    if (this.buffer[this.offset] === plus) {
+      this.offset++; // just ignore
+    }
+    while (this.offset < end) {
+      result *= 10;
+      result += this.buffer[this.offset] - 48;
+      this.offset++;
+    }
+    const num = result * sign;
+    if (!supportBigNumbers) {
+      return num;
+    }
+    str = this.buffer.toString('ascii', start, end);
+    if (num.toString() === str) {
+      return num;
+    }
+    return str;
+  }
+
+  // note that if value of inputNumberAsString is bigger than MAX_SAFE_INTEGER
+  // ( or smaller than MIN_SAFE_INTEGER ) the parseIntNoBigCheck result might be
+  // different from what you would get from Number(inputNumberAsString)
+  // String(parseIntNoBigCheck) <> String(Number(inputNumberAsString)) <> inputNumberAsString
+  parseIntNoBigCheck(len) {
+    if (len === null) {
+      return null;
+    }
+    let result = 0;
+    const end = this.offset + len;
+    let sign = 1;
+    if (len === 0) {
+      return 0; // TODO: assert? exception?
+    }
+    if (this.buffer[this.offset] === minus) {
+      this.offset++;
+      sign = -1;
+    }
+    if (this.buffer[this.offset] === plus) {
+      this.offset++; // just ignore
+    }
+    while (this.offset < end) {
+      result *= 10;
+      result += this.buffer[this.offset] - 48;
+      this.offset++;
+    }
+    return result * sign;
+  }
+
+  // adapted from https://github.com/mysqljs/mysql/blob/dc9c152a87ec51a1f647447268917243d2eab1fd/lib/protocol/Parser.js
+  parseGeometryValue() {
+    const buffer = this.readLengthCodedBuffer();
+    let offset = 4;
+    if (buffer === null || !buffer.length) {
+      return null;
+    }
+    const bufferLength = buffer.length;
+    function parseGeometry() {
+      let x, y, i, j, numPoints, numRings, num, line;
+      let result = null;
+      if (offset + 5 > bufferLength) {
+        return null;
+      }
+      const byteOrder = buffer.readUInt8(offset);
+      offset += 1;
+      const wkbType = byteOrder
+        ? buffer.readUInt32LE(offset)
+        : buffer.readUInt32BE(offset);
+      offset += 4;
+      switch (wkbType) {
+        case 1: // WKBPoint
+          if (offset + 16 > bufferLength) {
+            return null;
+          }
+          x = byteOrder
+            ? buffer.readDoubleLE(offset)
+            : buffer.readDoubleBE(offset);
+          offset += 8;
+          y = byteOrder
+            ? buffer.readDoubleLE(offset)
+            : buffer.readDoubleBE(offset);
+          offset += 8;
+          result = { x: x, y: y };
+          break;
+        case 2: // WKBLineString
+          if (offset + 4 > bufferLength) {
+            return null;
+          }
+          numPoints = byteOrder
+            ? buffer.readUInt32LE(offset)
+            : buffer.readUInt32BE(offset);
+          offset += 4;
+          if (numPoints > (bufferLength - offset) / 16) {
+            return null;
+          }
+          result = [];
+          for (i = numPoints; i > 0; i--) {
+            if (offset + 16 > bufferLength) {
+              break;
+            }
+            x = byteOrder
+              ? buffer.readDoubleLE(offset)
+              : buffer.readDoubleBE(offset);
+            offset += 8;
+            y = byteOrder
+              ? buffer.readDoubleLE(offset)
+              : buffer.readDoubleBE(offset);
+            offset += 8;
+            result.push({ x: x, y: y });
+          }
+          break;
+        case 3: // WKBPolygon
+          if (offset + 4 > bufferLength) {
+            return null;
+          }
+          numRings = byteOrder
+            ? buffer.readUInt32LE(offset)
+            : buffer.readUInt32BE(offset);
+          offset += 4;
+          if (numRings > (bufferLength - offset) / 4) {
+            return null;
+          }
+          result = [];
+          for (i = numRings; i > 0; i--) {
+            if (offset + 4 > bufferLength) {
+              break;
+            }
+            numPoints = byteOrder
+              ? buffer.readUInt32LE(offset)
+              : buffer.readUInt32BE(offset);
+            offset += 4;
+            line = [];
+            for (j = numPoints; j > 0; j--) {
+              if (offset + 16 > bufferLength) {
+                break;
+              }
+              x = byteOrder
+                ? buffer.readDoubleLE(offset)
+                : buffer.readDoubleBE(offset);
+              offset += 8;
+              y = byteOrder
+                ? buffer.readDoubleLE(offset)
+                : buffer.readDoubleBE(offset);
+              offset += 8;
+              line.push({ x: x, y: y });
+            }
+            result.push(line);
+          }
+          break;
+        case 4: // WKBMultiPoint
+        case 5: // WKBMultiLineString
+        case 6: // WKBMultiPolygon
+        case 7: // WKBGeometryCollection
+          if (offset + 4 > bufferLength) {
+            return null;
+          }
+          num = byteOrder
+            ? buffer.readUInt32LE(offset)
+            : buffer.readUInt32BE(offset);
+          offset += 4;
+          if (num > (bufferLength - offset) / 9) {
+            return null;
+          }
+          result = [];
+          for (i = num; i > 0; i--) {
+            result.push(parseGeometry());
+          }
+          break;
+      }
+      return result;
+    }
+    return parseGeometry();
+  }
+
+  parseVector() {
+    const bufLen = this.readLengthCodedNumber();
+    const vectorEnd = this.offset + bufLen;
+    const result = [];
+    while (this.offset < vectorEnd && this.offset < this.end) {
+      result.push(this.readFloat());
+    }
+    return result;
+  }
+
+  parseDate(timezone) {
+    const strLen = this.readLengthCodedNumber();
+    if (strLen === null) {
+      return null;
+    }
+    if (strLen !== 10) {
+      // we expect only YYYY-MM-DD here.
+      // if for some reason it's not the case return invalid date
+      return new Date(NaN);
+    }
+    const y = this.parseInt(4);
+    this.offset++; // -
+    const m = this.parseInt(2);
+    this.offset++; // -
+    const d = this.parseInt(2);
+    if (!timezone || timezone === 'local') {
+      return new Date(y, m - 1, d);
+    }
+    if (timezone === 'Z') {
+      return new Date(Date.UTC(y, m - 1, d));
+    }
+    return new Date(
+      `${leftPad(4, y)}-${leftPad(2, m)}-${leftPad(2, d)}T00:00:00${timezone}`
+    );
+  }
+
+  parseDateTime(timezone) {
+    const str = this.readLengthCodedString('binary');
+    if (str === null) {
+      return null;
+    }
+    if (!timezone || timezone === 'local') {
+      return new Date(str);
+    }
+    return new Date(`${str}${timezone}`);
+  }
+
+  parseFloat(len) {
+    if (len === null) {
+      return null;
+    }
+    if (len === 0) {
+      return 0; // TODO: assert? exception?
+    }
+
+    // For numbers with many digits (>17), use built-in parseFloat to avoid
+    // precision loss from accumulated rounding errors in repeated *10 operations.
+    // This fixes issues #2928 (MAX_VALUE doubles) and #3690 (DECIMAL(36,18))
+    // where very large numbers or numbers with many fractional digits lose precision.
+    // The threshold of 17 is based on IEEE 754 double precision (~15-17 significant digits).
+    // Testing shows minimal performance impact as most real-world numbers are shorter.
+    if (len > 17) {
+      const str = this.buffer.toString('utf8', this.offset, this.offset + len);
+      this.offset += len;
+      return Number.parseFloat(str);
+    }
+
+    let result = 0;
+    const end = this.offset + len;
+    let factor = 1;
+    let pastDot = false;
+    let charCode = 0;
+    if (this.buffer[this.offset] === minus) {
+      this.offset++;
+      factor = -1;
+    }
+    if (this.buffer[this.offset] === plus) {
+      this.offset++; // just ignore
+    }
+    while (this.offset < end) {
+      charCode = this.buffer[this.offset];
+      if (charCode === dot) {
+        pastDot = true;
+        this.offset++;
+      } else if (charCode === exponent || charCode === exponentCapital) {
+        // Scientific notation detected - bail out to parseFloat for exact match.
+        // Manual calculation with Math.pow(10, exp) cannot match parseFloat()
+        // exactly for most non-zero exponents due to accumulated rounding errors.
+        const start = end - len;
+        const str = this.buffer.toString('utf8', start, end);
+        this.offset = end;
+        return Number.parseFloat(str);
+      } else {
+        result *= 10;
+        result += this.buffer[this.offset] - 48;
+        this.offset++;
+        if (pastDot) {
+          factor = factor * 10;
+        }
+      }
+    }
+    return result / factor;
+  }
+
+  parseLengthCodedIntNoBigCheck() {
+    return this.parseIntNoBigCheck(this.readLengthCodedNumber());
+  }
+
+  parseLengthCodedInt(supportBigNumbers) {
+    return this.parseInt(this.readLengthCodedNumber(), supportBigNumbers);
+  }
+
+  parseLengthCodedIntString() {
+    return this.readLengthCodedString('binary');
+  }
+
+  parseLengthCodedFloat() {
+    return this.parseFloat(this.readLengthCodedNumber());
+  }
+
+  peekByte() {
+    return this.buffer[this.offset];
+  }
+
+  // OxFE is often used as "Alt" flag - not ok, not error.
+  // For example, it's first byte of AuthSwitchRequest
+  isAlt() {
+    return this.peekByte() === 0xfe;
+  }
+
+  isError() {
+    return this.peekByte() === 0xff;
+  }
+
+  asError(encoding) {
+    this.reset();
+    this.readInt8(); // fieldCount
+    const errorCode = this.readInt16();
+    let sqlState = '';
+    if (this.buffer[this.offset] === 0x23) {
+      this.skip(1);
+      sqlState = this.readBuffer(5).toString();
+    }
+    const message = this.readString(undefined, encoding);
+    const err = new Error(message);
+    err.code = ErrorCodeToName[errorCode];
+    err.errno = errorCode;
+    err.sqlState = sqlState;
+    err.sqlMessage = message;
+    return err;
+  }
+
+  writeInt32(n) {
+    this.buffer.writeUInt32LE(n, this.offset);
+    this.offset += 4;
+  }
+
+  writeInt24(n) {
+    this.writeInt8(n & 0xff);
+    this.writeInt16(n >> 8);
+  }
+
+  writeInt16(n) {
+    this.buffer.writeUInt16LE(n, this.offset);
+    this.offset += 2;
+  }
+
+  writeInt8(n) {
+    this.buffer.writeUInt8(n, this.offset);
+    this.offset++;
+  }
+
+  writeDouble(n) {
+    this.buffer.writeDoubleLE(n, this.offset);
+    this.offset += 8;
+  }
+
+  writeBuffer(b) {
+    b.copy(this.buffer, this.offset);
+    this.offset += b.length;
+  }
+
+  writeNull() {
+    this.buffer[this.offset] = 0xfb;
+    this.offset++;
+  }
+
+  // TODO: refactor following three?
+  writeNullTerminatedString(s, encoding) {
+    const buf = StringParser.encode(s, encoding);
+    this.buffer.length && buf.copy(this.buffer, this.offset);
+    this.offset += buf.length;
+    this.writeInt8(0);
+  }
+
+  writeString(s, encoding) {
+    if (s === null) {
+      this.writeInt8(0xfb);
+      return;
+    }
+    if (s.length === 0) {
+      return;
+    }
+    // const bytes = Buffer.byteLength(s, 'utf8');
+    // this.buffer.write(s, this.offset, bytes, 'utf8');
+    // this.offset += bytes;
+    const buf = StringParser.encode(s, encoding);
+    this.buffer.length && buf.copy(this.buffer, this.offset);
+    this.offset += buf.length;
+  }
+
+  writeLengthCodedString(s, encoding) {
+    const buf = StringParser.encode(s, encoding);
+    this.writeLengthCodedNumber(buf.length);
+    this.buffer.length && buf.copy(this.buffer, this.offset);
+    this.offset += buf.length;
+  }
+
+  writeLengthCodedBuffer(b) {
+    this.writeLengthCodedNumber(b.length);
+    b.copy(this.buffer, this.offset);
+    this.offset += b.length;
+  }
+
+  writeLengthCodedNumber(n) {
+    if (n < 0xfb) {
+      return this.writeInt8(n);
+    }
+    if (n < 0xffff) {
+      this.writeInt8(0xfc);
+      return this.writeInt16(n);
+    }
+    if (n < 0xffffff) {
+      this.writeInt8(0xfd);
+      return this.writeInt24(n);
+    }
+    if (n === null) {
+      return this.writeInt8(0xfb);
+    }
+    this.writeInt8(0xfe);
+    this.buffer.writeUInt32LE(n >>> 0, this.offset);
+    this.offset += 4;
+    this.buffer.writeUInt32LE(Math.floor(n / 0x100000000), this.offset);
+    this.offset += 4;
+    return this.offset;
+  }
+
+  writeDate(d, timezone) {
+    this.buffer.writeUInt8(11, this.offset);
+    if (!timezone || timezone === 'local') {
+      this.buffer.writeUInt16LE(d.getFullYear(), this.offset + 1);
+      this.buffer.writeUInt8(d.getMonth() + 1, this.offset + 3);
+      this.buffer.writeUInt8(d.getDate(), this.offset + 4);
+      this.buffer.writeUInt8(d.getHours(), this.offset + 5);
+      this.buffer.writeUInt8(d.getMinutes(), this.offset + 6);
+      this.buffer.writeUInt8(d.getSeconds(), this.offset + 7);
+      this.buffer.writeUInt32LE(d.getMilliseconds() * 1000, this.offset + 8);
+    } else {
+      if (timezone !== 'Z') {
+        const offset =
+          (timezone[0] === '-' ? -1 : 1) *
+          (parseInt(timezone.substring(1, 3), 10) * 60 +
+            parseInt(timezone.substring(4), 10));
+        if (offset !== 0) {
+          d = new Date(d.getTime() + 60000 * offset);
+        }
+      }
+      this.buffer.writeUInt16LE(d.getUTCFullYear(), this.offset + 1);
+      this.buffer.writeUInt8(d.getUTCMonth() + 1, this.offset + 3);
+      this.buffer.writeUInt8(d.getUTCDate(), this.offset + 4);
+      this.buffer.writeUInt8(d.getUTCHours(), this.offset + 5);
+      this.buffer.writeUInt8(d.getUTCMinutes(), this.offset + 6);
+      this.buffer.writeUInt8(d.getUTCSeconds(), this.offset + 7);
+      this.buffer.writeUInt32LE(d.getUTCMilliseconds() * 1000, this.offset + 8);
+    }
+    this.offset += 12;
+  }
+
+  writeHeader(sequenceId) {
+    const offset = this.offset;
+    this.offset = 0;
+    this.writeInt24(this.buffer.length - 4);
+    this.writeInt8(sequenceId);
+    this.offset = offset;
+  }
+
+  clone() {
+    return new Packet(this.sequenceId, this.buffer, this.start, this.end);
+  }
+
+  type() {
+    if (this.isEOF()) {
+      return 'EOF';
+    }
+    if (this.isError()) {
+      return 'Error';
+    }
+    if (this.buffer[this.offset] === 0) {
+      return 'maybeOK'; // could be other packet types as well
+    }
+    return '';
+  }
+
+  static lengthCodedNumberLength(n) {
+    if (n < 0xfb) {
+      return 1;
+    }
+    if (n < 0xffff) {
+      return 3;
+    }
+    if (n < 0xffffff) {
+      return 5;
+    }
+    return 9;
+  }
+
+  static lengthCodedStringLength(str, encoding) {
+    const buf = StringParser.encode(str, encoding);
+    const slen = buf.length;
+    return Packet.lengthCodedNumberLength(slen) + slen;
+  }
+
+  static MockBuffer() {
+    const noop = function () {};
+    const res = Buffer.alloc(0);
+    for (const op in NativeBuffer.prototype) {
+      if (typeof res[op] === 'function') {
+        res[op] = noop;
+      }
+    }
+    return res;
+  }
+}
+
+module.exports = Packet;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/prepare_statement.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/prepare_statement.js
new file mode 100644
index 0000000..d53c222
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/prepare_statement.js	
@@ -0,0 +1,27 @@
+'use strict';
+
+const Packet = require('../packets/packet');
+const CommandCodes = require('../constants/commands');
+const StringParser = require('../parsers/string.js');
+const CharsetToEncoding = require('../constants/charset_encodings.js');
+
+class PrepareStatement {
+  constructor(sql, charsetNumber) {
+    this.query = sql;
+    this.charsetNumber = charsetNumber;
+    this.encoding = CharsetToEncoding[charsetNumber];
+  }
+
+  toPacket() {
+    const buf = StringParser.encode(this.query, this.encoding);
+    const length = 5 + buf.length;
+    const buffer = Buffer.allocUnsafe(length);
+    const packet = new Packet(0, buffer, 0, length);
+    packet.offset = 4;
+    packet.writeInt8(CommandCodes.STMT_PREPARE);
+    packet.writeBuffer(buf);
+    return packet;
+  }
+}
+
+module.exports = PrepareStatement;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/prepared_statement_header.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/prepared_statement_header.js
new file mode 100644
index 0000000..70b263a
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/prepared_statement_header.js	
@@ -0,0 +1,16 @@
+'use strict';
+
+class PreparedStatementHeader {
+  constructor(packet) {
+    packet.skip(1); // should be 0
+    this.id = packet.readInt32();
+    this.fieldCount = packet.readInt16();
+    this.parameterCount = packet.readInt16();
+    packet.skip(1); // should be 0
+    this.warningCount = packet.readInt16();
+  }
+}
+
+// TODO: toPacket
+
+module.exports = PreparedStatementHeader;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/query.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/query.js
new file mode 100644
index 0000000..b650b35
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/query.js	
@@ -0,0 +1,27 @@
+'use strict';
+
+const Packet = require('../packets/packet.js');
+const CommandCode = require('../constants/commands.js');
+const StringParser = require('../parsers/string.js');
+const CharsetToEncoding = require('../constants/charset_encodings.js');
+
+class Query {
+  constructor(sql, charsetNumber) {
+    this.query = sql;
+    this.charsetNumber = charsetNumber;
+    this.encoding = CharsetToEncoding[charsetNumber];
+  }
+
+  toPacket() {
+    const buf = StringParser.encode(this.query, this.encoding);
+    const length = 5 + buf.length;
+    const buffer = Buffer.allocUnsafe(length);
+    const packet = new Packet(0, buffer, 0, length);
+    packet.offset = 4;
+    packet.writeInt8(CommandCode.QUERY);
+    packet.writeBuffer(buf);
+    return packet;
+  }
+}
+
+module.exports = Query;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/register_slave.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/register_slave.js
new file mode 100644
index 0000000..26e802f
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/register_slave.js	
@@ -0,0 +1,46 @@
+'use strict';
+
+// http://dev.mysql.com/doc/internals/en/com-register-slave.html
+// note that documentation is incorrect, for example command code is actually 0x15 but documented as 0x14
+
+const Packet = require('../packets/packet');
+const CommandCodes = require('../constants/commands');
+
+class RegisterSlave {
+  constructor(opts) {
+    this.serverId = opts.serverId || 0;
+    this.slaveHostname = opts.slaveHostname || '';
+    this.slaveUser = opts.slaveUser || '';
+    this.slavePassword = opts.slavePassword || '';
+    this.slavePort = opts.slavePort || 0;
+    this.replicationRank = opts.replicationRank || 0;
+    this.masterId = opts.masterId || 0;
+  }
+
+  toPacket() {
+    const length =
+      15 + // TODO: should be ascii?
+      Buffer.byteLength(this.slaveHostname, 'utf8') +
+      Buffer.byteLength(this.slaveUser, 'utf8') +
+      Buffer.byteLength(this.slavePassword, 'utf8') +
+      3 +
+      4;
+    const buffer = Buffer.allocUnsafe(length);
+    const packet = new Packet(0, buffer, 0, length);
+    packet.offset = 4;
+    packet.writeInt8(CommandCodes.REGISTER_SLAVE);
+    packet.writeInt32(this.serverId);
+    packet.writeInt8(Buffer.byteLength(this.slaveHostname, 'utf8'));
+    packet.writeString(this.slaveHostname);
+    packet.writeInt8(Buffer.byteLength(this.slaveUser, 'utf8'));
+    packet.writeString(this.slaveUser);
+    packet.writeInt8(Buffer.byteLength(this.slavePassword, 'utf8'));
+    packet.writeString(this.slavePassword);
+    packet.writeInt16(this.slavePort);
+    packet.writeInt32(this.replicationRank);
+    packet.writeInt32(this.masterId);
+    return packet;
+  }
+}
+
+module.exports = RegisterSlave;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/resultset_header.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/resultset_header.js
new file mode 100644
index 0000000..ed0ffd4
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/resultset_header.js	
@@ -0,0 +1,124 @@
+'use strict';
+
+// TODO: rename to OK packet
+// https://dev.mysql.com/doc/internals/en/packet-OK_Packet.html
+
+const Packet = require('./packet.js');
+const ClientConstants = require('../constants/client.js');
+const ServerSatusFlags = require('../constants/server_status.js');
+
+const EncodingToCharset = require('../constants/encoding_charset.js');
+const sessionInfoTypes = require('../constants/session_track.js');
+
+class ResultSetHeader {
+  constructor(packet, connection) {
+    const bigNumberStrings = connection.config.bigNumberStrings;
+    const encoding = connection.serverEncoding;
+    const flags = connection._handshakePacket.capabilityFlags;
+    const isSet = function (flag) {
+      return flags & ClientConstants[flag];
+    };
+    if (packet.buffer[packet.offset] !== 0) {
+      this.fieldCount = packet.readLengthCodedNumber();
+      if (this.fieldCount === null) {
+        this.infileName = packet.readString(undefined, encoding);
+      }
+      return;
+    }
+    this.fieldCount = packet.readInt8(); // skip OK byte
+    this.affectedRows = packet.readLengthCodedNumber(bigNumberStrings);
+    this.insertId = packet.readLengthCodedNumberSigned(bigNumberStrings);
+    this.info = '';
+    if (isSet('PROTOCOL_41')) {
+      this.serverStatus = packet.readInt16();
+      this.warningStatus = packet.readInt16();
+    } else if (isSet('TRANSACTIONS')) {
+      this.serverStatus = packet.readInt16();
+    }
+    let stateChanges = null;
+    if (isSet('SESSION_TRACK') && packet.offset < packet.end) {
+      this.info = packet.readLengthCodedString(encoding);
+
+      if (this.serverStatus && ServerSatusFlags.SERVER_SESSION_STATE_CHANGED) {
+        // session change info record - see
+        // https://dev.mysql.com/doc/internals/en/packet-OK_Packet.html#cs-sect-packet-ok-sessioninfo
+        let len =
+          packet.offset < packet.end ? packet.readLengthCodedNumber() : 0;
+        const end = packet.offset + len;
+        let type, key, stateEnd;
+        if (len > 0) {
+          stateChanges = {
+            systemVariables: {},
+            schema: null,
+            gtids: [],
+            trackStateChange: null,
+          };
+        }
+        while (packet.offset < end) {
+          type = packet.readInt8();
+          len = packet.readLengthCodedNumber();
+          stateEnd = packet.offset + len;
+          if (type === sessionInfoTypes.SYSTEM_VARIABLES) {
+            key = packet.readLengthCodedString(encoding);
+            const val = packet.readLengthCodedString(encoding);
+            stateChanges.systemVariables[key] = val;
+            if (key === 'character_set_client') {
+              const charsetNumber = EncodingToCharset[val];
+              // TODO - better api for driver users to handle unknown encodings?
+              // maybe custom coverter in the config?
+              // For now just ignore character_set_client command if there is
+              // no known mapping from reported encoding to a charset code
+              if (typeof charsetNumber !== 'undefined') {
+                connection.config.charsetNumber = charsetNumber;
+              }
+            }
+          } else if (type === sessionInfoTypes.SCHEMA) {
+            key = packet.readLengthCodedString(encoding);
+            stateChanges.schema = key;
+          } else if (type === sessionInfoTypes.STATE_CHANGE) {
+            stateChanges.trackStateChange =
+              packet.readLengthCodedString(encoding);
+          } else if (type === sessionInfoTypes.STATE_GTIDS) {
+            // TODO: find if the first length coded string means anything. Usually comes as empty
+            // eslint-disable-next-line no-unused-vars
+            const _unknownString = packet.readLengthCodedString(encoding);
+            const gtid = packet.readLengthCodedString(encoding);
+            stateChanges.gtids = gtid.split(',');
+          } else {
+            // unsupported session track type. For now just ignore
+          }
+          packet.offset = stateEnd;
+        }
+      }
+    } else {
+      this.info = packet.readString(undefined, encoding);
+    }
+    if (stateChanges) {
+      this.stateChanges = stateChanges;
+    }
+    const m = this.info.match(/\schanged:\s*(\d+)/i);
+    if (m !== null) {
+      this.changedRows = parseInt(m[1], 10);
+    } else {
+      this.changedRows = 0;
+    }
+  }
+
+  // TODO: should be consistent instance member, but it's just easier here to have just function
+  static toPacket(fieldCount, insertId) {
+    let length = 4 + Packet.lengthCodedNumberLength(fieldCount);
+    if (typeof insertId !== 'undefined') {
+      length += Packet.lengthCodedNumberLength(insertId);
+    }
+    const buffer = Buffer.allocUnsafe(length);
+    const packet = new Packet(0, buffer, 0, length);
+    packet.offset = 4;
+    packet.writeLengthCodedNumber(fieldCount);
+    if (typeof insertId !== 'undefined') {
+      packet.writeLengthCodedNumber(insertId);
+    }
+    return packet;
+  }
+}
+
+module.exports = ResultSetHeader;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/ssl_request.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/ssl_request.js
new file mode 100644
index 0000000..69eec24
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/ssl_request.js	
@@ -0,0 +1,25 @@
+'use strict';
+
+const ClientConstants = require('../constants/client');
+const Packet = require('../packets/packet');
+
+class SSLRequest {
+  constructor(flags, charset) {
+    this.clientFlags = flags | ClientConstants.SSL;
+    this.charset = charset;
+  }
+
+  toPacket() {
+    const length = 36;
+    const buffer = Buffer.allocUnsafe(length);
+    const packet = new Packet(0, buffer, 0, length);
+    buffer.fill(0);
+    packet.offset = 4;
+    packet.writeInt32(this.clientFlags);
+    packet.writeInt32(0); // max packet size. todo: move to config
+    packet.writeInt8(this.charset);
+    return packet;
+  }
+}
+
+module.exports = SSLRequest;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/text_row.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/text_row.js
new file mode 100644
index 0000000..ecb8d10
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/packets/text_row.js	
@@ -0,0 +1,47 @@
+'use strict';
+
+const Packet = require('../packets/packet');
+
+class TextRow {
+  constructor(columns) {
+    this.columns = columns || [];
+  }
+
+  static fromPacket(packet) {
+    // packet.reset(); // set offset to starting point?
+    const columns = [];
+    while (packet.haveMoreData()) {
+      columns.push(packet.readLengthCodedString());
+    }
+    return new TextRow(columns);
+  }
+
+  static toPacket(columns, encoding) {
+    const sequenceId = 0; // TODO remove, this is calculated now in connecton
+    let length = 0;
+    columns.forEach((val) => {
+      if (val === null || typeof val === 'undefined') {
+        ++length;
+        return;
+      }
+      length += Packet.lengthCodedStringLength(val.toString(10), encoding);
+    });
+    const buffer = Buffer.allocUnsafe(length + 4);
+    const packet = new Packet(sequenceId, buffer, 0, length + 4);
+    packet.offset = 4;
+    columns.forEach((val) => {
+      if (val === null) {
+        packet.writeNull();
+        return;
+      }
+      if (typeof val === 'undefined') {
+        packet.writeInt8(0);
+        return;
+      }
+      packet.writeLengthCodedString(val.toString(10), encoding);
+    });
+    return packet;
+  }
+}
+
+module.exports = TextRow;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/binary_parser.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/binary_parser.js
new file mode 100644
index 0000000..b1872b6
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/binary_parser.js	
@@ -0,0 +1,235 @@
+'use strict';
+
+const FieldFlags = require('../constants/field_flags.js');
+const Charsets = require('../constants/charsets.js');
+const Types = require('../constants/types.js');
+const helpers = require('../helpers');
+const genFunc = require('generate-function');
+const parserCache = require('./parser_cache.js');
+const typeNames = [];
+for (const t in Types) {
+  typeNames[Types[t]] = t;
+}
+
+function readCodeFor(field, config, options, fieldNum) {
+  const supportBigNumbers = Boolean(
+    options.supportBigNumbers || config.supportBigNumbers
+  );
+  const bigNumberStrings = Boolean(
+    options.bigNumberStrings || config.bigNumberStrings
+  );
+  const timezone = options.timezone || config.timezone;
+  const dateStrings = options.dateStrings || config.dateStrings;
+  const unsigned = field.flags & FieldFlags.UNSIGNED;
+  switch (field.columnType) {
+    case Types.TINY:
+      return unsigned ? 'packet.readInt8();' : 'packet.readSInt8();';
+    case Types.SHORT:
+      return unsigned ? 'packet.readInt16();' : 'packet.readSInt16();';
+    case Types.LONG:
+    case Types.INT24: // in binary protocol int24 is encoded in 4 bytes int32
+      return unsigned ? 'packet.readInt32();' : 'packet.readSInt32();';
+    case Types.YEAR:
+      return 'packet.readInt16()';
+    case Types.FLOAT:
+      return 'packet.readFloat();';
+    case Types.DOUBLE:
+      return 'packet.readDouble();';
+    case Types.NULL:
+      return 'null;';
+    case Types.DATE:
+    case Types.DATETIME:
+    case Types.TIMESTAMP:
+    case Types.NEWDATE:
+      if (helpers.typeMatch(field.columnType, dateStrings, Types)) {
+        return `packet.readDateTimeString(${parseInt(field.decimals, 10)}, ${null}, ${field.columnType});`;
+      }
+      return `packet.readDateTime(${helpers.srcEscape(timezone)});`;
+    case Types.TIME:
+      return 'packet.readTimeString()';
+    case Types.DECIMAL:
+    case Types.NEWDECIMAL:
+      if (config.decimalNumbers) {
+        return 'packet.parseLengthCodedFloat();';
+      }
+      return 'packet.readLengthCodedString("ascii");';
+    case Types.GEOMETRY:
+      return 'packet.parseGeometryValue();';
+    case Types.VECTOR:
+      return 'packet.parseVector()';
+    case Types.JSON:
+      // Since for JSON columns mysql always returns charset 63 (BINARY),
+      // we have to handle it according to JSON specs and use "utf8",
+      // see https://github.com/sidorares/node-mysql2/issues/409
+      return config.jsonStrings
+        ? 'packet.readLengthCodedString("utf8")'
+        : 'JSON.parse(packet.readLengthCodedString("utf8"));';
+    case Types.LONGLONG:
+      if (!supportBigNumbers) {
+        return unsigned
+          ? 'packet.readInt64JSNumber();'
+          : 'packet.readSInt64JSNumber();';
+      }
+      if (bigNumberStrings) {
+        return unsigned
+          ? 'packet.readInt64String();'
+          : 'packet.readSInt64String();';
+      }
+      return unsigned ? 'packet.readInt64();' : 'packet.readSInt64();';
+
+    default:
+      if (field.characterSet === Charsets.BINARY) {
+        return 'packet.readLengthCodedBuffer();';
+      }
+      return `packet.readLengthCodedString(fields[${fieldNum}].encoding)`;
+  }
+}
+
+function compile(fields, options, config) {
+  const parserFn = genFunc();
+  const nullBitmapLength = Math.floor((fields.length + 7 + 2) / 8);
+
+  function wrap(field, packet) {
+    return {
+      type: typeNames[field.columnType],
+      length: field.columnLength,
+      db: field.schema,
+      table: field.table,
+      name: field.name,
+      string: function (encoding = field.encoding) {
+        if (field.columnType === Types.JSON && encoding === field.encoding) {
+          // Since for JSON columns mysql always returns charset 63 (BINARY),
+          // we have to handle it according to JSON specs and use "utf8",
+          // see https://github.com/sidorares/node-mysql2/issues/1661
+          console.warn(
+            `typeCast: JSON column "${field.name}" is interpreted as BINARY by default, recommended to manually set utf8 encoding: \`field.string("utf8")\``
+          );
+        }
+
+        if (
+          [Types.DATETIME, Types.NEWDATE, Types.TIMESTAMP, Types.DATE].includes(
+            field.columnType
+          )
+        ) {
+          return packet.readDateTimeString(
+            parseInt(field.decimals, 10),
+            ' ',
+            field.columnType
+          );
+        }
+
+        if (field.columnType === Types.TINY) {
+          const unsigned = field.flags & FieldFlags.UNSIGNED;
+
+          return String(unsigned ? packet.readInt8() : packet.readSInt8());
+        }
+
+        if (field.columnType === Types.TIME) {
+          return packet.readTimeString();
+        }
+
+        return packet.readLengthCodedString(encoding);
+      },
+      buffer: function () {
+        return packet.readLengthCodedBuffer();
+      },
+      geometry: function () {
+        return packet.parseGeometryValue();
+      },
+    };
+  }
+
+  parserFn('(function(){');
+  parserFn('return class BinaryRow {');
+  parserFn('constructor() {');
+  parserFn('}');
+
+  parserFn('next(packet, fields, options) {');
+  if (options.rowsAsArray) {
+    parserFn(`const result = new Array(${fields.length});`);
+  } else {
+    parserFn('const result = {};');
+  }
+
+  // Global typeCast
+  if (
+    typeof config.typeCast === 'function' &&
+    typeof options.typeCast !== 'function'
+  ) {
+    options.typeCast = config.typeCast;
+  }
+
+  parserFn('packet.readInt8();'); // status byte
+  for (let i = 0; i < nullBitmapLength; ++i) {
+    parserFn(`const nullBitmaskByte${i} = packet.readInt8();`);
+  }
+
+  let lvalue = '';
+  let currentFieldNullBit = 4;
+  let nullByteIndex = 0;
+  let fieldName = '';
+  let tableName = '';
+
+  for (let i = 0; i < fields.length; i++) {
+    fieldName = helpers.fieldEscape(fields[i].name);
+    // parserFn(`// ${fieldName}: ${typeNames[fields[i].columnType]}`);
+
+    if (typeof options.nestTables === 'string') {
+      lvalue = `result[${helpers.fieldEscape(fields[i].table + options.nestTables + fields[i].name)}]`;
+    } else if (options.nestTables === true) {
+      tableName = helpers.fieldEscape(fields[i].table);
+
+      parserFn(`if (!result[${tableName}]) result[${tableName}] = {};`);
+      lvalue = `result[${tableName}][${fieldName}]`;
+    } else if (options.rowsAsArray) {
+      lvalue = `result[${i.toString(10)}]`;
+    } else {
+      lvalue = `result[${fieldName}]`;
+    }
+
+    parserFn(`if (nullBitmaskByte${nullByteIndex} & ${currentFieldNullBit}) `);
+    parserFn(`${lvalue} = null;`);
+    parserFn('else {');
+
+    if (options.typeCast === false) {
+      parserFn(`${lvalue} = packet.readLengthCodedBuffer();`);
+    } else {
+      const fieldWrapperVar = `fieldWrapper${i}`;
+      parserFn(`const ${fieldWrapperVar} = wrap(fields[${i}], packet);`);
+      const readCode = readCodeFor(fields[i], config, options, i);
+
+      if (typeof options.typeCast === 'function') {
+        parserFn(
+          `${lvalue} = options.typeCast(${fieldWrapperVar}, function() { return ${readCode} });`
+        );
+      } else {
+        parserFn(`${lvalue} = ${readCode};`);
+      }
+    }
+    parserFn('}');
+
+    currentFieldNullBit *= 2;
+    if (currentFieldNullBit === 0x100) {
+      currentFieldNullBit = 1;
+      nullByteIndex++;
+    }
+  }
+
+  parserFn('return result;');
+  parserFn('}');
+  parserFn('};')('})()');
+
+  if (config.debug) {
+    helpers.printDebugWithCode(
+      'Compiled binary protocol row parser',
+      parserFn.toString()
+    );
+  }
+  return parserFn.toFunction({ wrap });
+}
+
+function getBinaryParser(fields, options, config) {
+  return parserCache.getParser('binary', fields, options, config, compile);
+}
+
+module.exports = getBinaryParser;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/parser_cache.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/parser_cache.js
new file mode 100644
index 0000000..707845f
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/parser_cache.js	
@@ -0,0 +1,68 @@
+'use strict';
+
+const { createLRU } = require('lru.min');
+
+const parserCache = createLRU({
+  max: 15000,
+});
+
+function keyFromFields(type, fields, options, config) {
+  const res = [
+    type,
+    typeof options.nestTables,
+    options.nestTables,
+    Boolean(options.rowsAsArray),
+    Boolean(options.supportBigNumbers || config.supportBigNumbers),
+    Boolean(options.bigNumberStrings || config.bigNumberStrings),
+    typeof options.typeCast === 'boolean'
+      ? options.typeCast
+      : typeof options.typeCast,
+    options.timezone || config.timezone,
+    Boolean(options.decimalNumbers),
+    options.dateStrings,
+  ];
+
+  for (let i = 0; i < fields.length; ++i) {
+    const field = fields[i];
+
+    res.push([
+      field.name,
+      field.columnType,
+      field.length,
+      field.schema,
+      field.table,
+      field.flags,
+      field.characterSet,
+    ]);
+  }
+
+  return JSON.stringify(res, null, 0);
+}
+
+function getParser(type, fields, options, config, compiler) {
+  const key = keyFromFields(type, fields, options, config);
+  let parser = parserCache.get(key);
+
+  if (parser) {
+    return parser;
+  }
+
+  parser = compiler(fields, options, config);
+  parserCache.set(key, parser);
+  return parser;
+}
+
+function setMaxCache(max) {
+  parserCache.resize(max);
+}
+
+function clearCache() {
+  parserCache.clear();
+}
+
+module.exports = {
+  getParser: getParser,
+  setMaxCache: setMaxCache,
+  clearCache: clearCache,
+  _keyFromFields: keyFromFields,
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/static_binary_parser.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/static_binary_parser.js
new file mode 100644
index 0000000..8a92878
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/static_binary_parser.js	
@@ -0,0 +1,213 @@
+'use strict';
+
+const FieldFlags = require('../constants/field_flags.js');
+const Charsets = require('../constants/charsets.js');
+const Types = require('../constants/types.js');
+const helpers = require('../helpers');
+
+const typeNames = [];
+for (const t in Types) {
+  typeNames[Types[t]] = t;
+}
+
+function getBinaryParser(fields, _options, config) {
+  function readCode(field, config, options, fieldNum, packet) {
+    const supportBigNumbers = Boolean(
+      options.supportBigNumbers || config.supportBigNumbers
+    );
+    const bigNumberStrings = Boolean(
+      options.bigNumberStrings || config.bigNumberStrings
+    );
+    const timezone = options.timezone || config.timezone;
+    const dateStrings = options.dateStrings || config.dateStrings;
+    const unsigned = field.flags & FieldFlags.UNSIGNED;
+
+    switch (field.columnType) {
+      case Types.TINY:
+        return unsigned ? packet.readInt8() : packet.readSInt8();
+      case Types.SHORT:
+        return unsigned ? packet.readInt16() : packet.readSInt16();
+      case Types.LONG:
+      case Types.INT24: // in binary protocol int24 is encoded in 4 bytes int32
+        return unsigned ? packet.readInt32() : packet.readSInt32();
+      case Types.YEAR:
+        return packet.readInt16();
+      case Types.FLOAT:
+        return packet.readFloat();
+      case Types.DOUBLE:
+        return packet.readDouble();
+      case Types.NULL:
+        return null;
+      case Types.DATE:
+      case Types.DATETIME:
+      case Types.TIMESTAMP:
+      case Types.NEWDATE:
+        return helpers.typeMatch(field.columnType, dateStrings, Types)
+          ? packet.readDateTimeString(
+              parseInt(field.decimals, 10),
+              null,
+              field.columnType
+            )
+          : packet.readDateTime(timezone);
+      case Types.TIME:
+        return packet.readTimeString();
+      case Types.DECIMAL:
+      case Types.NEWDECIMAL:
+        return config.decimalNumbers
+          ? packet.parseLengthCodedFloat()
+          : packet.readLengthCodedString('ascii');
+      case Types.GEOMETRY:
+        return packet.parseGeometryValue();
+      case Types.VECTOR:
+        return packet.parseVector();
+      case Types.JSON:
+        // Since for JSON columns mysql always returns charset 63 (BINARY),
+        // we have to handle it according to JSON specs and use "utf8",
+        // see https://github.com/sidorares/node-mysql2/issues/409
+        return config.jsonStrings
+          ? packet.readLengthCodedString('utf8')
+          : JSON.parse(packet.readLengthCodedString('utf8'));
+      case Types.LONGLONG:
+        if (!supportBigNumbers)
+          return unsigned
+            ? packet.readInt64JSNumber()
+            : packet.readSInt64JSNumber();
+        return bigNumberStrings
+          ? unsigned
+            ? packet.readInt64String()
+            : packet.readSInt64String()
+          : unsigned
+            ? packet.readInt64()
+            : packet.readSInt64();
+      default:
+        return field.characterSet === Charsets.BINARY
+          ? packet.readLengthCodedBuffer()
+          : packet.readLengthCodedString(fields[fieldNum].encoding);
+    }
+  }
+
+  return class BinaryRow {
+    constructor() {}
+
+    next(packet, fields, options) {
+      packet.readInt8(); // status byte
+
+      const nullBitmapLength = Math.floor((fields.length + 7 + 2) / 8);
+      const nullBitmaskBytes = new Array(nullBitmapLength);
+
+      for (let i = 0; i < nullBitmapLength; i++) {
+        nullBitmaskBytes[i] = packet.readInt8();
+      }
+
+      const result = options.rowsAsArray ? new Array(fields.length) : {};
+      let currentFieldNullBit = 4;
+      let nullByteIndex = 0;
+
+      for (let i = 0; i < fields.length; i++) {
+        const field = fields[i];
+        const typeCast =
+          options.typeCast !== undefined ? options.typeCast : config.typeCast;
+
+        let value;
+        if (nullBitmaskBytes[nullByteIndex] & currentFieldNullBit) {
+          value = null;
+        } else if (options.typeCast === false) {
+          value = packet.readLengthCodedBuffer();
+        } else {
+          const next = () => readCode(field, config, options, i, packet);
+          value =
+            typeof typeCast === 'function'
+              ? typeCast(
+                  {
+                    type: typeNames[field.columnType],
+                    length: field.columnLength,
+                    db: field.schema,
+                    table: field.table,
+                    name: field.name,
+                    string: function (encoding = field.encoding) {
+                      if (
+                        field.columnType === Types.JSON &&
+                        encoding === field.encoding
+                      ) {
+                        // Since for JSON columns mysql always returns charset 63 (BINARY),
+                        // we have to handle it according to JSON specs and use "utf8",
+                        // see https://github.com/sidorares/node-mysql2/issues/1661
+                        console.warn(
+                          `typeCast: JSON column "${field.name}" is interpreted as BINARY by default, recommended to manually set utf8 encoding: \`field.string("utf8")\``
+                        );
+                      }
+
+                      if (
+                        [
+                          Types.DATETIME,
+                          Types.NEWDATE,
+                          Types.TIMESTAMP,
+                          Types.DATE,
+                        ].includes(field.columnType)
+                      ) {
+                        return packet.readDateTimeString(
+                          parseInt(field.decimals, 10),
+                          ' ',
+                          field.columnType
+                        );
+                      }
+
+                      if (field.columnType === Types.TINY) {
+                        const unsigned = field.flags & FieldFlags.UNSIGNED;
+
+                        return String(
+                          unsigned ? packet.readInt8() : packet.readSInt8()
+                        );
+                      }
+
+                      if (field.columnType === Types.TIME) {
+                        return packet.readTimeString();
+                      }
+
+                      return packet.readLengthCodedString(encoding);
+                    },
+                    buffer: function () {
+                      return packet.readLengthCodedBuffer();
+                    },
+                    geometry: function () {
+                      return packet.parseGeometryValue();
+                    },
+                  },
+                  next
+                )
+              : next();
+        }
+
+        if (options.rowsAsArray) {
+          result[i] = value;
+        } else if (typeof options.nestTables === 'string') {
+          const key = helpers.fieldEscape(
+            field.table + options.nestTables + field.name,
+            false
+          );
+          result[key] = value;
+        } else if (options.nestTables === true) {
+          const tableName = helpers.fieldEscape(field.table, false);
+          if (!result[tableName]) {
+            result[tableName] = {};
+          }
+          const fieldName = helpers.fieldEscape(field.name, false);
+          result[tableName][fieldName] = value;
+        } else {
+          const key = helpers.fieldEscape(field.name, false);
+          result[key] = value;
+        }
+
+        currentFieldNullBit *= 2;
+        if (currentFieldNullBit === 0x100) {
+          currentFieldNullBit = 1;
+          nullByteIndex++;
+        }
+      }
+
+      return result;
+    }
+  };
+}
+
+module.exports = getBinaryParser;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/static_text_parser.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/static_text_parser.js
new file mode 100644
index 0000000..69cc2a4
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/static_text_parser.js	
@@ -0,0 +1,152 @@
+'use strict';
+
+const Types = require('../constants/types.js');
+const Charsets = require('../constants/charsets.js');
+const helpers = require('../helpers');
+
+const typeNames = [];
+for (const t in Types) {
+  typeNames[Types[t]] = t;
+}
+
+function readField({ packet, type, charset, encoding, config, options }) {
+  const supportBigNumbers = Boolean(
+    options.supportBigNumbers || config.supportBigNumbers
+  );
+  const bigNumberStrings = Boolean(
+    options.bigNumberStrings || config.bigNumberStrings
+  );
+  const timezone = options.timezone || config.timezone;
+  const dateStrings = options.dateStrings || config.dateStrings;
+
+  switch (type) {
+    case Types.TINY:
+    case Types.SHORT:
+    case Types.LONG:
+    case Types.INT24:
+    case Types.YEAR:
+      return packet.parseLengthCodedIntNoBigCheck();
+    case Types.LONGLONG:
+      if (supportBigNumbers && bigNumberStrings) {
+        return packet.parseLengthCodedIntString();
+      }
+      return packet.parseLengthCodedInt(supportBigNumbers);
+    case Types.FLOAT:
+    case Types.DOUBLE:
+      return packet.parseLengthCodedFloat();
+    case Types.NULL:
+    case Types.DECIMAL:
+    case Types.NEWDECIMAL:
+      if (config.decimalNumbers) {
+        return packet.parseLengthCodedFloat();
+      }
+      return packet.readLengthCodedString('ascii');
+    case Types.DATE:
+      if (helpers.typeMatch(type, dateStrings, Types)) {
+        return packet.readLengthCodedString('ascii');
+      }
+      return packet.parseDate(timezone);
+    case Types.DATETIME:
+    case Types.TIMESTAMP:
+      if (helpers.typeMatch(type, dateStrings, Types)) {
+        return packet.readLengthCodedString('ascii');
+      }
+      return packet.parseDateTime(timezone);
+    case Types.TIME:
+      return packet.readLengthCodedString('ascii');
+    case Types.GEOMETRY:
+      return packet.parseGeometryValue();
+    case Types.VECTOR:
+      return packet.parseVector();
+    case Types.JSON:
+      // Since for JSON columns mysql always returns charset 63 (BINARY),
+      // we have to handle it according to JSON specs and use "utf8",
+      // see https://github.com/sidorares/node-mysql2/issues/409
+      return config.jsonStrings
+        ? packet.readLengthCodedString('utf8')
+        : JSON.parse(packet.readLengthCodedString('utf8'));
+    default:
+      if (charset === Charsets.BINARY) {
+        return packet.readLengthCodedBuffer();
+      }
+      return packet.readLengthCodedString(encoding);
+  }
+}
+
+function createTypecastField(field, packet) {
+  return {
+    type: typeNames[field.columnType],
+    length: field.columnLength,
+    db: field.schema,
+    table: field.table,
+    name: field.name,
+    string: function (encoding = field.encoding) {
+      if (field.columnType === Types.JSON && encoding === field.encoding) {
+        // Since for JSON columns mysql always returns charset 63 (BINARY),
+        // we have to handle it according to JSON specs and use "utf8",
+        // see https://github.com/sidorares/node-mysql2/issues/1661
+        console.warn(
+          `typeCast: JSON column "${field.name}" is interpreted as BINARY by default, recommended to manually set utf8 encoding: \`field.string("utf8")\``
+        );
+      }
+      return packet.readLengthCodedString(encoding);
+    },
+    buffer: function () {
+      return packet.readLengthCodedBuffer();
+    },
+    geometry: function () {
+      return packet.parseGeometryValue();
+    },
+  };
+}
+
+function getTextParser(_fields, _options, config) {
+  return {
+    next(packet, fields, options) {
+      const result = options.rowsAsArray ? [] : {};
+      for (let i = 0; i < fields.length; i++) {
+        const field = fields[i];
+        const typeCast = options.typeCast ? options.typeCast : config.typeCast;
+        const next = () =>
+          readField({
+            packet,
+            type: field.columnType,
+            encoding: field.encoding,
+            charset: field.characterSet,
+            config,
+            options,
+          });
+
+        let value;
+
+        if (options.typeCast === false) {
+          value = packet.readLengthCodedBuffer();
+        } else if (typeof typeCast === 'function') {
+          value = typeCast(createTypecastField(field, packet), next);
+        } else {
+          value = next();
+        }
+
+        if (options.rowsAsArray) {
+          result.push(value);
+        } else if (typeof options.nestTables === 'string') {
+          result[
+            `${helpers.fieldEscape(field.table, false)}${options.nestTables}${helpers.fieldEscape(field.name, false)}`
+          ] = value;
+        } else if (options.nestTables) {
+          const tableName = helpers.fieldEscape(field.table, false);
+          if (!result[tableName]) {
+            result[tableName] = {};
+          }
+          result[tableName][helpers.fieldEscape(field.name, false)] = value;
+        } else {
+          result[helpers.fieldEscape(field.name, false)] = value;
+        }
+      }
+
+      return result;
+    },
+  };
+}
+
+module.exports = getTextParser;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/string.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/string.js
new file mode 100644
index 0000000..2368e50
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/string.js	
@@ -0,0 +1,50 @@
+'use strict';
+
+const Iconv = require('iconv-lite');
+const { createLRU } = require('lru.min');
+
+const decoderCache = createLRU({
+  max: 500,
+});
+
+exports.decode = function (buffer, encoding, start, end, options) {
+  if (Buffer.isEncoding(encoding)) {
+    return buffer.toString(encoding, start, end);
+  }
+
+  // Optimize for common case: encoding="short_string", options=undefined.
+  let decoder;
+  if (!options) {
+    decoder = decoderCache.get(encoding);
+    if (!decoder) {
+      decoder = Iconv.getDecoder(encoding);
+      decoderCache.set(encoding, decoder);
+    }
+  } else {
+    const decoderArgs = { encoding, options };
+    const decoderKey = JSON.stringify(decoderArgs);
+    decoder = decoderCache.get(decoderKey);
+    if (!decoder) {
+      decoder = Iconv.getDecoder(decoderArgs.encoding, decoderArgs.options);
+      decoderCache.set(decoderKey, decoder);
+    }
+  }
+
+  const res = decoder.write(buffer.slice(start, end));
+  const trail = decoder.end();
+
+  return trail ? res + trail : res;
+};
+
+exports.encode = function (string, encoding, options) {
+  if (Buffer.isEncoding(encoding)) {
+    return Buffer.from(string, encoding);
+  }
+
+  const encoder = Iconv.getEncoder(encoding, options || {});
+
+  const res = encoder.write(string);
+  const trail = encoder.end();
+
+  return trail && trail.length > 0 ? Buffer.concat([res, trail]) : res;
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/text_parser.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/text_parser.js
new file mode 100644
index 0000000..69b7e21
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/parsers/text_parser.js	
@@ -0,0 +1,214 @@
+'use strict';
+
+const Types = require('../constants/types.js');
+const Charsets = require('../constants/charsets.js');
+const helpers = require('../helpers');
+const genFunc = require('generate-function');
+const parserCache = require('./parser_cache.js');
+
+const typeNames = [];
+for (const t in Types) {
+  typeNames[Types[t]] = t;
+}
+
+function readCodeFor(type, charset, encodingExpr, config, options) {
+  const supportBigNumbers = Boolean(
+    options.supportBigNumbers || config.supportBigNumbers
+  );
+  const bigNumberStrings = Boolean(
+    options.bigNumberStrings || config.bigNumberStrings
+  );
+  const timezone = options.timezone || config.timezone;
+  const dateStrings = options.dateStrings || config.dateStrings;
+
+  switch (type) {
+    case Types.TINY:
+    case Types.SHORT:
+    case Types.LONG:
+    case Types.INT24:
+    case Types.YEAR:
+      return 'packet.parseLengthCodedIntNoBigCheck()';
+    case Types.LONGLONG:
+      if (supportBigNumbers && bigNumberStrings) {
+        return 'packet.parseLengthCodedIntString()';
+      }
+      return `packet.parseLengthCodedInt(${supportBigNumbers})`;
+    case Types.FLOAT:
+    case Types.DOUBLE:
+      return 'packet.parseLengthCodedFloat()';
+    case Types.NULL:
+      return 'packet.readLengthCodedNumber()';
+    case Types.DECIMAL:
+    case Types.NEWDECIMAL:
+      if (config.decimalNumbers) {
+        return 'packet.parseLengthCodedFloat()';
+      }
+      return 'packet.readLengthCodedString("ascii")';
+    case Types.DATE:
+      if (helpers.typeMatch(type, dateStrings, Types)) {
+        return 'packet.readLengthCodedString("ascii")';
+      }
+      return `packet.parseDate(${helpers.srcEscape(timezone)})`;
+    case Types.DATETIME:
+    case Types.TIMESTAMP:
+      if (helpers.typeMatch(type, dateStrings, Types)) {
+        return 'packet.readLengthCodedString("ascii")';
+      }
+      return `packet.parseDateTime(${helpers.srcEscape(timezone)})`;
+    case Types.TIME:
+      return 'packet.readLengthCodedString("ascii")';
+    case Types.GEOMETRY:
+      return 'packet.parseGeometryValue()';
+    case Types.VECTOR:
+      return 'packet.parseVector()';
+    case Types.JSON:
+      // Since for JSON columns mysql always returns charset 63 (BINARY),
+      // we have to handle it according to JSON specs and use "utf8",
+      // see https://github.com/sidorares/node-mysql2/issues/409
+      return config.jsonStrings
+        ? 'packet.readLengthCodedString("utf8")'
+        : 'JSON.parse(packet.readLengthCodedString("utf8"))';
+    default:
+      if (charset === Charsets.BINARY) {
+        return 'packet.readLengthCodedBuffer()';
+      }
+      return `packet.readLengthCodedString(${encodingExpr})`;
+  }
+}
+
+function compile(fields, options, config) {
+  // use global typeCast if current query doesn't specify one
+  if (
+    typeof config.typeCast === 'function' &&
+    typeof options.typeCast !== 'function'
+  ) {
+    options.typeCast = config.typeCast;
+  }
+
+  function wrap(field, _this) {
+    return {
+      type: typeNames[field.columnType],
+      length: field.columnLength,
+      db: field.schema,
+      table: field.table,
+      name: field.name,
+      string: function (encoding = field.encoding) {
+        if (field.columnType === Types.JSON && encoding === field.encoding) {
+          // Since for JSON columns mysql always returns charset 63 (BINARY),
+          // we have to handle it according to JSON specs and use "utf8",
+          // see https://github.com/sidorares/node-mysql2/issues/1661
+          console.warn(
+            `typeCast: JSON column "${field.name}" is interpreted as BINARY by default, recommended to manually set utf8 encoding: \`field.string("utf8")\``
+          );
+        }
+
+        return _this.packet.readLengthCodedString(encoding);
+      },
+      buffer: function () {
+        return _this.packet.readLengthCodedBuffer();
+      },
+      geometry: function () {
+        return _this.packet.parseGeometryValue();
+      },
+    };
+  }
+
+  const parserFn = genFunc();
+
+  parserFn('(function () {')('return class TextRow {');
+
+  // constructor method
+  parserFn('constructor(fields) {');
+  // node-mysql typeCast compatibility wrapper
+  // see https://github.com/mysqljs/mysql/blob/96fdd0566b654436624e2375c7b6604b1f50f825/lib/protocol/packets/Field.js
+  if (typeof options.typeCast === 'function') {
+    parserFn('const _this = this;');
+    parserFn('for(let i=0; i clusterIds[index++ % clusterIds.length];
+  },
+  RANDOM() {
+    return (clusterIds) =>
+      clusterIds[Math.floor(Math.random() * clusterIds.length)];
+  },
+  ORDER() {
+    return (clusterIds) => clusterIds[0];
+  },
+};
+
+const getMonotonicMilliseconds = function () {
+  let ms;
+
+  if (typeof process.hrtime === 'function') {
+    ms = process.hrtime();
+    ms = ms[0] * 1e3 + ms[1] * 1e-6;
+  } else {
+    ms = process.uptime() * 1000;
+  }
+
+  return Math.floor(ms);
+};
+
+const patternRegExp = function (pattern) {
+  if (pattern instanceof RegExp) {
+    return pattern;
+  }
+
+  const source = pattern
+    .replace(/([.+?^=!:${}()|[\]/\\])/g, '\\$1')
+    .replace(/\*/g, '.*');
+
+  return new RegExp(`^${source}$`);
+};
+
+class PoolNamespace {
+  constructor(cluster, pattern, selector) {
+    this._cluster = cluster;
+    this._pattern = pattern;
+    this._selector = makeSelector[selector]();
+  }
+
+  getConnection(cb) {
+    const clusterNode = this._getClusterNode();
+    if (clusterNode === null) {
+      let err = new Error('Pool does Not exist.');
+      err.code = 'POOL_NOEXIST';
+
+      if (this._cluster._findNodeIds(this._pattern, true).length !== 0) {
+        err = new Error('Pool does Not have online node.');
+        err.code = 'POOL_NONEONLINE';
+      }
+
+      return cb(err);
+    }
+    return this._cluster._getConnection(clusterNode, (err, connection) => {
+      if (err) {
+        if (
+          this._cluster._canRetry &&
+          this._cluster._findNodeIds(this._pattern).length !== 0
+        ) {
+          this._cluster.emit('warn', err);
+          return this.getConnection(cb);
+        }
+
+        return cb(err);
+      }
+      return cb(null, connection);
+    });
+  }
+
+  /**
+   * pool cluster query
+   * @param {*} sql
+   * @param {*} values
+   * @param {*} cb
+   * @returns query
+   */
+  query(sql, values, cb) {
+    const query = Connection.createQuery(sql, values, cb, {});
+    this.getConnection((err, conn) => {
+      if (err) {
+        if (typeof query.onResult === 'function') {
+          query.onResult(err);
+        } else {
+          query.emit('error', err);
+        }
+        return;
+      }
+      try {
+        conn.query(query).once('end', () => {
+          conn.release();
+        });
+      } catch (e) {
+        conn.release();
+        throw e;
+      }
+    });
+    return query;
+  }
+
+  /**
+   * pool cluster execute
+   * @param {*} sql
+   * @param {*} values
+   * @param {*} cb
+   */
+  execute(sql, values, cb) {
+    if (typeof values === 'function') {
+      cb = values;
+      values = [];
+    }
+    this.getConnection((err, conn) => {
+      if (err) {
+        return cb(err);
+      }
+      try {
+        conn.execute(sql, values, cb).once('end', () => {
+          conn.release();
+        });
+      } catch (e) {
+        conn.release();
+        throw e;
+      }
+    });
+  }
+
+  _getClusterNode() {
+    const foundNodeIds = this._cluster._findNodeIds(this._pattern);
+    if (foundNodeIds.length === 0) {
+      return null;
+    }
+    const nodeId =
+      foundNodeIds.length === 1
+        ? foundNodeIds[0]
+        : this._selector(foundNodeIds);
+    return this._cluster._getNode(nodeId);
+  }
+}
+
+class PoolCluster extends EventEmitter {
+  constructor(config) {
+    super();
+    config = config || {};
+    this._canRetry =
+      typeof config.canRetry === 'undefined' ? true : config.canRetry;
+    this._removeNodeErrorCount = config.removeNodeErrorCount || 5;
+    this._restoreNodeTimeout = config.restoreNodeTimeout || 0;
+    this._defaultSelector = config.defaultSelector || 'RR';
+    this._closed = false;
+    this._lastId = 0;
+    this._nodes = {};
+    this._serviceableNodeIds = [];
+    this._namespaces = {};
+    this._findCaches = {};
+  }
+
+  of(pattern, selector) {
+    pattern = pattern || '*';
+    selector = selector || this._defaultSelector;
+    selector = selector.toUpperCase();
+    if (!makeSelector[selector] === 'undefined') {
+      selector = this._defaultSelector;
+    }
+    const key = pattern + selector;
+    if (typeof this._namespaces[key] === 'undefined') {
+      this._namespaces[key] = new PoolNamespace(this, pattern, selector);
+    }
+    return this._namespaces[key];
+  }
+
+  add(id, config) {
+    if (typeof id === 'object') {
+      config = id;
+      id = `CLUSTER::${++this._lastId}`;
+    }
+    if (typeof this._nodes[id] === 'undefined') {
+      this._nodes[id] = {
+        id: id,
+        errorCount: 0,
+        pool: new Pool({ config: new PoolConfig(config) }),
+        _offlineUntil: 0,
+      };
+      this._serviceableNodeIds.push(id);
+      this._clearFindCaches();
+    }
+  }
+
+  remove(pattern) {
+    const foundNodeIds = this._findNodeIds(pattern, true);
+
+    for (let i = 0; i < foundNodeIds.length; i++) {
+      const node = this._getNode(foundNodeIds[i]);
+
+      if (node) {
+        this._removeNode(node);
+      }
+    }
+  }
+
+  getConnection(pattern, selector, cb) {
+    let namespace;
+    if (typeof pattern === 'function') {
+      cb = pattern;
+      namespace = this.of();
+    } else {
+      if (typeof selector === 'function') {
+        cb = selector;
+        selector = this._defaultSelector;
+      }
+      namespace = this.of(pattern, selector);
+    }
+    namespace.getConnection(cb);
+  }
+
+  [Symbol.dispose]() {
+    if (!this._closed) {
+      this.end();
+    }
+  }
+
+  end(callback) {
+    const cb =
+      callback !== undefined
+        ? callback
+        : (err) => {
+            if (err) {
+              throw err;
+            }
+          };
+    if (this._closed) {
+      process.nextTick(cb);
+      return;
+    }
+
+    this._closed = true;
+
+    let calledBack = false;
+    let waitingClose = 0;
+    const onEnd = (err) => {
+      if (!calledBack && (err || --waitingClose <= 0)) {
+        calledBack = true;
+        return cb(err);
+      }
+    };
+
+    for (const id in this._nodes) {
+      waitingClose++;
+      this._nodes[id].pool.end(onEnd);
+    }
+
+    if (waitingClose === 0) {
+      process.nextTick(onEnd);
+    }
+  }
+
+  _findNodeIds(pattern, includeOffline) {
+    let currentTime = 0;
+    let foundNodeIds = this._findCaches[pattern];
+
+    if (foundNodeIds === undefined) {
+      const expression = patternRegExp(pattern);
+
+      foundNodeIds = this._serviceableNodeIds.filter((id) =>
+        id.match(expression)
+      );
+    }
+
+    this._findCaches[pattern] = foundNodeIds;
+
+    if (includeOffline) {
+      return foundNodeIds;
+    }
+
+    return foundNodeIds.filter((nodeId) => {
+      const node = this._getNode(nodeId);
+
+      if (!node._offlineUntil) {
+        return true;
+      }
+
+      if (!currentTime) {
+        currentTime = getMonotonicMilliseconds();
+      }
+
+      return node._offlineUntil <= currentTime;
+    });
+  }
+
+  _getNode(id) {
+    return this._nodes[id] || null;
+  }
+
+  _increaseErrorCount(node) {
+    const errorCount = ++node.errorCount;
+
+    if (this._removeNodeErrorCount > errorCount) {
+      return;
+    }
+
+    if (this._restoreNodeTimeout > 0) {
+      node._offlineUntil =
+        getMonotonicMilliseconds() + this._restoreNodeTimeout;
+      this.emit('offline', node.id);
+      return;
+    }
+
+    this._removeNode(node);
+    this.emit('remove', node.id);
+  }
+
+  _decreaseErrorCount(node) {
+    let errorCount = node.errorCount;
+
+    if (errorCount > this._removeNodeErrorCount) {
+      errorCount = this._removeNodeErrorCount;
+    }
+
+    if (errorCount < 1) {
+      errorCount = 1;
+    }
+
+    node.errorCount = errorCount - 1;
+
+    if (node._offlineUntil) {
+      node._offlineUntil = 0;
+      this.emit('online', node.id);
+    }
+  }
+
+  _getConnection(node, cb) {
+    node.pool.getConnection((err, connection) => {
+      if (err) {
+        this._increaseErrorCount(node);
+        return cb(err);
+      }
+      this._decreaseErrorCount(node);
+
+      connection._clusterId = node.id;
+      return cb(null, connection);
+    });
+  }
+
+  _removeNode(node) {
+    const index = this._serviceableNodeIds.indexOf(node.id);
+    if (index !== -1) {
+      this._serviceableNodeIds.splice(index, 1);
+      delete this._nodes[node.id];
+      this._clearFindCaches();
+      node.pool.end();
+    }
+  }
+
+  _clearFindCaches() {
+    this._findCaches = {};
+  }
+}
+
+module.exports = PoolCluster;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/pool_config.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/pool_config.js
new file mode 100644
index 0000000..0a4a260
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/pool_config.js	
@@ -0,0 +1,30 @@
+'use strict';
+
+const ConnectionConfig = require('./connection_config.js');
+
+class PoolConfig {
+  constructor(options) {
+    if (typeof options === 'string') {
+      options = ConnectionConfig.parseUrl(options);
+    }
+    this.connectionConfig = new ConnectionConfig(options);
+    this.waitForConnections =
+      options.waitForConnections === undefined
+        ? true
+        : Boolean(options.waitForConnections);
+    this.connectionLimit = isNaN(options.connectionLimit)
+      ? 10
+      : Number(options.connectionLimit);
+    this.maxIdle = isNaN(options.maxIdle)
+      ? this.connectionLimit
+      : Number(options.maxIdle);
+    this.idleTimeout = isNaN(options.idleTimeout)
+      ? 60000
+      : Number(options.idleTimeout);
+    this.queueLimit = isNaN(options.queueLimit)
+      ? 0
+      : Number(options.queueLimit);
+  }
+}
+
+module.exports = PoolConfig;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/pool_connection.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/pool_connection.js
new file mode 100644
index 0000000..aae5c14
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/pool_connection.js	
@@ -0,0 +1,81 @@
+'use strict';
+
+const Connection = require('./connection.js');
+
+class PoolConnection extends Connection {
+  constructor(pool, options) {
+    super(options);
+    this._pool = pool;
+    this._released = false;
+    this.lastActiveTime = Date.now();
+    this.once('end', () => {
+      this._removeFromPool();
+    });
+    this.once('error', () => {
+      this._removeFromPool();
+    });
+  }
+
+  release() {
+    if (this._released) {
+      return;
+    }
+    if (!this._pool || this._pool._closed) {
+      return;
+    }
+    this._released = true;
+    this.lastActiveTime = Date.now();
+    this._pool.releaseConnection(this);
+  }
+
+  [Symbol.dispose]() {
+    this.release();
+  }
+
+  end(callback) {
+    if (this.config.gracefulEnd) {
+      this._removeFromPool();
+      super.end(callback);
+
+      return;
+    }
+
+    const err = new Error(
+      'Calling conn.end() to release a pooled connection is ' +
+        'deprecated. In next version calling conn.end() will be ' +
+        'restored to default conn.end() behavior. Use ' +
+        'conn.release() instead.'
+    );
+    this.emit('warn', err);
+    console.warn(err.message);
+    this.release();
+    if (typeof callback === 'function') {
+      callback();
+    }
+  }
+
+  destroy() {
+    this._removeFromPool();
+    super.destroy();
+  }
+
+  _removeFromPool() {
+    if (!this._pool || this._pool._closed) {
+      return;
+    }
+    const pool = this._pool;
+    this._pool = null;
+    pool._removeConnection(this);
+  }
+
+  promise(promiseImpl) {
+    const PromisePoolConnection = require('./promise/pool_connection.js');
+    return new PromisePoolConnection(this, promiseImpl);
+  }
+}
+
+PoolConnection.statementKey = Connection.statementKey;
+module.exports = PoolConnection;
+
+// TODO: Remove this when we are removing PoolConnection#end
+PoolConnection.prototype._realEnd = Connection.prototype.end;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/connection.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/connection.js
new file mode 100644
index 0000000..75ccea5
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/connection.js	
@@ -0,0 +1,228 @@
+'use strict';
+
+const EventEmitter = require('events').EventEmitter;
+const PromisePreparedStatementInfo = require('./prepared_statement_info.js');
+const makeDoneCb = require('./make_done_cb.js');
+const inheritEvents = require('./inherit_events.js');
+const BaseConnection = require('../base/connection.js');
+
+class PromiseConnection extends EventEmitter {
+  constructor(connection, promiseImpl) {
+    super();
+    this.connection = connection;
+    this.Promise = promiseImpl || Promise;
+    inheritEvents(connection, this, [
+      'error',
+      'drain',
+      'connect',
+      'end',
+      'enqueue',
+    ]);
+  }
+
+  release() {
+    this.connection.release();
+  }
+
+  query(query, params) {
+    const c = this.connection;
+    const localErr = new Error();
+    if (typeof params === 'function') {
+      throw new Error(
+        'Callback function is not available with promise clients.'
+      );
+    }
+    return new this.Promise((resolve, reject) => {
+      const done = makeDoneCb(resolve, reject, localErr);
+      if (params !== undefined) {
+        c.query(query, params, done);
+      } else {
+        c.query(query, done);
+      }
+    });
+  }
+
+  execute(query, params) {
+    const c = this.connection;
+    const localErr = new Error();
+    if (typeof params === 'function') {
+      throw new Error(
+        'Callback function is not available with promise clients.'
+      );
+    }
+    return new this.Promise((resolve, reject) => {
+      const done = makeDoneCb(resolve, reject, localErr);
+      if (params !== undefined) {
+        c.execute(query, params, done);
+      } else {
+        c.execute(query, done);
+      }
+    });
+  }
+
+  end() {
+    return new this.Promise((resolve) => {
+      this.connection.end(resolve);
+    });
+  }
+
+  async [Symbol.asyncDispose]() {
+    if (!this.connection._closing) {
+      await this.end();
+    }
+  }
+
+  beginTransaction() {
+    const c = this.connection;
+    const localErr = new Error();
+    return new this.Promise((resolve, reject) => {
+      const done = makeDoneCb(resolve, reject, localErr);
+      c.beginTransaction(done);
+    });
+  }
+
+  commit() {
+    const c = this.connection;
+    const localErr = new Error();
+    return new this.Promise((resolve, reject) => {
+      const done = makeDoneCb(resolve, reject, localErr);
+      c.commit(done);
+    });
+  }
+
+  rollback() {
+    const c = this.connection;
+    const localErr = new Error();
+    return new this.Promise((resolve, reject) => {
+      const done = makeDoneCb(resolve, reject, localErr);
+      c.rollback(done);
+    });
+  }
+
+  ping() {
+    const c = this.connection;
+    const localErr = new Error();
+    return new this.Promise((resolve, reject) => {
+      c.ping((err) => {
+        if (err) {
+          localErr.message = err.message;
+          localErr.code = err.code;
+          localErr.errno = err.errno;
+          localErr.sqlState = err.sqlState;
+          localErr.sqlMessage = err.sqlMessage;
+          reject(localErr);
+        } else {
+          resolve(true);
+        }
+      });
+    });
+  }
+
+  connect() {
+    const c = this.connection;
+    const localErr = new Error();
+    return new this.Promise((resolve, reject) => {
+      c.connect((err, param) => {
+        if (err) {
+          localErr.message = err.message;
+          localErr.code = err.code;
+          localErr.errno = err.errno;
+          localErr.sqlState = err.sqlState;
+          localErr.sqlMessage = err.sqlMessage;
+          reject(localErr);
+        } else {
+          resolve(param);
+        }
+      });
+    });
+  }
+
+  prepare(options) {
+    const c = this.connection;
+    const promiseImpl = this.Promise;
+    const localErr = new Error();
+    return new this.Promise((resolve, reject) => {
+      c.prepare(options, (err, statement) => {
+        if (err) {
+          localErr.message = err.message;
+          localErr.code = err.code;
+          localErr.errno = err.errno;
+          localErr.sqlState = err.sqlState;
+          localErr.sqlMessage = err.sqlMessage;
+          reject(localErr);
+        } else {
+          const wrappedStatement = new PromisePreparedStatementInfo(
+            statement,
+            promiseImpl
+          );
+          resolve(wrappedStatement);
+        }
+      });
+    });
+  }
+
+  changeUser(options) {
+    const c = this.connection;
+    const localErr = new Error();
+    return new this.Promise((resolve, reject) => {
+      c.changeUser(options, (err) => {
+        if (err) {
+          localErr.message = err.message;
+          localErr.code = err.code;
+          localErr.errno = err.errno;
+          localErr.sqlState = err.sqlState;
+          localErr.sqlMessage = err.sqlMessage;
+          reject(localErr);
+        } else {
+          resolve();
+        }
+      });
+    });
+  }
+
+  get config() {
+    return this.connection.config;
+  }
+
+  get threadId() {
+    return this.connection.threadId;
+  }
+}
+// patching PromiseConnection
+// create facade functions for prototype functions on "Connection" that are not yet
+// implemented with PromiseConnection
+
+// proxy synchronous functions only
+(function (functionsToWrap) {
+  for (let i = 0; functionsToWrap && i < functionsToWrap.length; i++) {
+    const func = functionsToWrap[i];
+
+    if (
+      typeof BaseConnection.prototype[func] === 'function' &&
+      PromiseConnection.prototype[func] === undefined
+    ) {
+      PromiseConnection.prototype[func] = (function factory(funcName) {
+        return function () {
+          return BaseConnection.prototype[funcName].apply(
+            this.connection,
+            arguments
+          );
+        };
+      })(func);
+    }
+  }
+})([
+  // synchronous functions
+  'close',
+  'createBinlogStream',
+  'destroy',
+  'escape',
+  'escapeId',
+  'format',
+  'pause',
+  'pipe',
+  'resume',
+  'unprepare',
+]);
+
+module.exports = PromiseConnection;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/inherit_events.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/inherit_events.js
new file mode 100644
index 0000000..4127acd
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/inherit_events.js	
@@ -0,0 +1,27 @@
+'use strict';
+
+function inheritEvents(source, target, events) {
+  const listeners = {};
+  target
+    .on('newListener', (eventName) => {
+      if (events.indexOf(eventName) >= 0 && !target.listenerCount(eventName)) {
+        source.on(
+          eventName,
+          (listeners[eventName] = function () {
+            const args = [].slice.call(arguments);
+            args.unshift(eventName);
+
+            target.emit.apply(target, args);
+          })
+        );
+      }
+    })
+    .on('removeListener', (eventName) => {
+      if (events.indexOf(eventName) >= 0 && !target.listenerCount(eventName)) {
+        source.removeListener(eventName, listeners[eventName]);
+        delete listeners[eventName];
+      }
+    });
+}
+
+module.exports = inheritEvents;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/make_done_cb.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/make_done_cb.js
new file mode 100644
index 0000000..124303f
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/make_done_cb.js	
@@ -0,0 +1,19 @@
+'use strict';
+
+function makeDoneCb(resolve, reject, localErr) {
+  return function (err, rows, fields) {
+    if (err) {
+      localErr.message = err.message;
+      localErr.code = err.code;
+      localErr.errno = err.errno;
+      localErr.sql = err.sql;
+      localErr.sqlState = err.sqlState;
+      localErr.sqlMessage = err.sqlMessage;
+      reject(localErr);
+    } else {
+      resolve([rows, fields]);
+    }
+  };
+}
+
+module.exports = makeDoneCb;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/pool.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/pool.js
new file mode 100644
index 0000000..24a8ca9
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/pool.js	
@@ -0,0 +1,118 @@
+'use strict';
+
+const EventEmitter = require('events').EventEmitter;
+const makeDoneCb = require('./make_done_cb.js');
+const PromisePoolConnection = require('./pool_connection.js');
+const inheritEvents = require('./inherit_events.js');
+const BasePool = require('../base/pool.js');
+
+class PromisePool extends EventEmitter {
+  constructor(pool, thePromise) {
+    super();
+    this.pool = pool;
+    this.Promise = thePromise || Promise;
+    inheritEvents(pool, this, ['acquire', 'connection', 'enqueue', 'release']);
+  }
+
+  getConnection() {
+    const corePool = this.pool;
+    return new this.Promise((resolve, reject) => {
+      corePool.getConnection((err, coreConnection) => {
+        if (err) {
+          reject(err);
+        } else {
+          resolve(new PromisePoolConnection(coreConnection, this.Promise));
+        }
+      });
+    });
+  }
+
+  releaseConnection(connection) {
+    if (connection instanceof PromisePoolConnection) connection.release();
+  }
+
+  query(sql, args) {
+    const corePool = this.pool;
+    const localErr = new Error();
+    if (typeof args === 'function') {
+      throw new Error(
+        'Callback function is not available with promise clients.'
+      );
+    }
+    return new this.Promise((resolve, reject) => {
+      const done = makeDoneCb(resolve, reject, localErr);
+      if (args !== undefined) {
+        corePool.query(sql, args, done);
+      } else {
+        corePool.query(sql, done);
+      }
+    });
+  }
+
+  execute(sql, args) {
+    const corePool = this.pool;
+    const localErr = new Error();
+    if (typeof args === 'function') {
+      throw new Error(
+        'Callback function is not available with promise clients.'
+      );
+    }
+    return new this.Promise((resolve, reject) => {
+      const done = makeDoneCb(resolve, reject, localErr);
+      if (args) {
+        corePool.execute(sql, args, done);
+      } else {
+        corePool.execute(sql, done);
+      }
+    });
+  }
+
+  end() {
+    const corePool = this.pool;
+    const localErr = new Error();
+    return new this.Promise((resolve, reject) => {
+      corePool.end((err) => {
+        if (err) {
+          localErr.message = err.message;
+          localErr.code = err.code;
+          localErr.errno = err.errno;
+          localErr.sqlState = err.sqlState;
+          localErr.sqlMessage = err.sqlMessage;
+          reject(localErr);
+        } else {
+          resolve();
+        }
+      });
+    });
+  }
+
+  async [Symbol.asyncDispose]() {
+    if (!this.pool._closed) {
+      await this.end();
+    }
+  }
+}
+
+(function (functionsToWrap) {
+  for (let i = 0; functionsToWrap && i < functionsToWrap.length; i++) {
+    const func = functionsToWrap[i];
+
+    if (
+      typeof BasePool.prototype[func] === 'function' &&
+      PromisePool.prototype[func] === undefined
+    ) {
+      PromisePool.prototype[func] = (function factory(funcName) {
+        return function () {
+          return BasePool.prototype[funcName].apply(this.pool, arguments);
+        };
+      })(func);
+    }
+  }
+})([
+  // synchronous functions
+  'escape',
+  'escapeId',
+  'format',
+]);
+
+module.exports = PromisePool;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/pool_cluster.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/pool_cluster.js
new file mode 100644
index 0000000..0422ce7
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/pool_cluster.js	
@@ -0,0 +1,54 @@
+'use strict';
+
+const PromisePoolConnection = require('./pool_connection');
+const makeDoneCb = require('./make_done_cb');
+
+class PromisePoolNamespace {
+  constructor(poolNamespace, thePromise) {
+    this.poolNamespace = poolNamespace;
+    this.Promise = thePromise || Promise;
+  }
+
+  getConnection() {
+    const corePoolNamespace = this.poolNamespace;
+    return new this.Promise((resolve, reject) => {
+      corePoolNamespace.getConnection((err, coreConnection) => {
+        if (err) {
+          reject(err);
+        } else {
+          resolve(new PromisePoolConnection(coreConnection, this.Promise));
+        }
+      });
+    });
+  }
+
+  query(sql, values) {
+    const corePoolNamespace = this.poolNamespace;
+    const localErr = new Error();
+    if (typeof values === 'function') {
+      throw new Error(
+        'Callback function is not available with promise clients.'
+      );
+    }
+    return new this.Promise((resolve, reject) => {
+      const done = makeDoneCb(resolve, reject, localErr);
+      corePoolNamespace.query(sql, values, done);
+    });
+  }
+
+  execute(sql, values) {
+    const corePoolNamespace = this.poolNamespace;
+    const localErr = new Error();
+    if (typeof values === 'function') {
+      throw new Error(
+        'Callback function is not available with promise clients.'
+      );
+    }
+    return new this.Promise((resolve, reject) => {
+      const done = makeDoneCb(resolve, reject, localErr);
+      corePoolNamespace.execute(sql, values, done);
+    });
+  }
+}
+
+module.exports = PromisePoolNamespace;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/pool_connection.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/pool_connection.js
new file mode 100644
index 0000000..6c37c80
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/pool_connection.js	
@@ -0,0 +1,19 @@
+'use strict';
+
+const PromiseConnection = require('./connection.js');
+
+class PromisePoolConnection extends PromiseConnection {
+  constructor(connection, promiseImpl) {
+    super(connection, promiseImpl);
+  }
+
+  destroy() {
+    return this.connection.destroy();
+  }
+
+  async [Symbol.asyncDispose]() {
+    this.release();
+  }
+}
+
+module.exports = PromisePoolConnection;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/prepared_statement_info.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/prepared_statement_info.js
new file mode 100644
index 0000000..47b9bed
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/promise/prepared_statement_info.js	
@@ -0,0 +1,32 @@
+'use strict';
+
+const makeDoneCb = require('./make_done_cb.js');
+
+class PromisePreparedStatementInfo {
+  constructor(statement, promiseImpl) {
+    this.statement = statement;
+    this.Promise = promiseImpl;
+  }
+
+  execute(parameters) {
+    const s = this.statement;
+    const localErr = new Error();
+    return new this.Promise((resolve, reject) => {
+      const done = makeDoneCb(resolve, reject, localErr);
+      if (parameters) {
+        s.execute(parameters, done);
+      } else {
+        s.execute(done);
+      }
+    });
+  }
+
+  close() {
+    return new this.Promise((resolve) => {
+      this.statement.close();
+      resolve();
+    });
+  }
+}
+
+module.exports = PromisePreparedStatementInfo;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/results_stream.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/results_stream.js
new file mode 100644
index 0000000..79c780c
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/results_stream.js	
@@ -0,0 +1,38 @@
+'use strict';
+
+const Readable = require('stream').Readable;
+
+// copy-paste from https://github.com/mysqljs/mysql/blob/master/lib/protocol/sequences/Query.js
+module.exports = function (command, connectionStream) {
+  command.stream = function (options) {
+    let stream;
+
+    options = options || {};
+    options.objectMode = true;
+    ((stream = new Readable(options)),
+      (stream._read = function () {
+        connectionStream.resume();
+      }));
+
+    this.on('result', (row, i) => {
+      if (!stream.push(row)) {
+        connectionStream.pause();
+      }
+      stream.emit('result', row, i); // replicate old emitter
+    });
+
+    this.on('error', (err) => {
+      stream.emit('error', err); // Pass on any errors
+    });
+
+    this.on('end', () => {
+      stream.push(null); // pushing null, indicating EOF
+    });
+
+    this.on('fields', (fields, i) => {
+      stream.emit('fields', fields, i); // replicate old emitter
+    });
+
+    return stream;
+  };
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/server.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/server.js
new file mode 100644
index 0000000..e0633e8
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/server.js	
@@ -0,0 +1,37 @@
+'use strict';
+
+const net = require('net');
+const EventEmitter = require('events').EventEmitter;
+
+const Connection = require('./connection');
+const ConnectionConfig = require('./connection_config');
+
+// TODO: inherit Server from net.Server
+class Server extends EventEmitter {
+  constructor() {
+    super();
+    this.connections = [];
+    this._server = net.createServer(this._handleConnection.bind(this));
+  }
+
+  _handleConnection(socket) {
+    const connectionConfig = new ConnectionConfig({
+      stream: socket,
+      isServer: true,
+    });
+    const connection = new Connection({ config: connectionConfig });
+    this.emit('connection', connection);
+  }
+
+  listen(port) {
+    this._port = port;
+    this._server.listen.apply(this._server, arguments);
+    return this;
+  }
+
+  close(cb) {
+    this._server.close(cb);
+  }
+}
+
+module.exports = Server;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/tracing.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/tracing.js
new file mode 100644
index 0000000..200ab27
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/lib/tracing.js	
@@ -0,0 +1,81 @@
+'use strict';
+
+const process = require('process');
+
+// Safe load: use getBuiltinModule if available, fallback to require, catch if unavailable
+const dc = (() => {
+  try {
+    return 'getBuiltinModule' in process
+      ? process.getBuiltinModule('node:diagnostics_channel')
+      : require('node:diagnostics_channel');
+  } catch {
+    return undefined;
+  }
+})();
+
+const hasTracingChannel = typeof dc?.tracingChannel === 'function';
+
+const queryChannel = hasTracingChannel
+  ? dc.tracingChannel('mysql2:query')
+  : undefined;
+
+const executeChannel = hasTracingChannel
+  ? dc.tracingChannel('mysql2:execute')
+  : undefined;
+
+const connectChannel = hasTracingChannel
+  ? dc.tracingChannel('mysql2:connect')
+  : undefined;
+
+const poolConnectChannel = hasTracingChannel
+  ? dc.tracingChannel('mysql2:pool:connect')
+  : undefined;
+
+function getServerContext(config) {
+  if (config.socketPath) {
+    return { serverAddress: config.socketPath, serverPort: undefined };
+  }
+  return {
+    serverAddress: config.host || 'localhost',
+    serverPort: config.port || 3306,
+  };
+}
+
+// Node 20+: TracingChannel has an aggregated hasSubscribers getter.
+// Node 18.x: that getter is missing (undefined), fall back to start sub-channel.
+function shouldTrace(channel) {
+  if (channel === undefined || channel === null) {
+    return false;
+  }
+  return channel.hasSubscribers ?? channel.start?.hasSubscribers ?? false;
+}
+
+// Generic traceCallback wrapper — calls fn synchronously, wraps the callback
+// at args[position] to emit asyncStart/asyncEnd/error. No promises involved.
+function traceCallback(channel, fn, position, context, thisArg, ...args) {
+  if (shouldTrace(channel)) {
+    return channel.traceCallback(fn, position, context(), thisArg, ...args);
+  }
+  return fn.apply(thisArg, args);
+}
+
+// tracePromise for operations that are inherently async (connection handshake)
+function tracePromise(channel, fn, contextFactory) {
+  if (shouldTrace(channel)) {
+    return channel.tracePromise(fn, contextFactory());
+  }
+  return fn();
+}
+
+module.exports = {
+  dc,
+  hasTracingChannel,
+  shouldTrace,
+  queryChannel,
+  executeChannel,
+  connectChannel,
+  poolConnectChannel,
+  getServerContext,
+  traceCallback,
+  tracePromise,
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/package.json
new file mode 100644
index 0000000..dd84292
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/package.json	
@@ -0,0 +1,95 @@
+{
+  "name": "mysql2",
+  "version": "3.20.0",
+  "description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS",
+  "main": "index.js",
+  "typings": "typings/mysql/index",
+  "type": "commonjs",
+  "scripts": {
+    "lint": "eslint . && prettier --check .",
+    "lint:fix": "eslint . --fix && prettier --write .",
+    "test": "poku",
+    "test:bun": "bun poku",
+    "test:deno": "deno run -A npm:poku",
+    "test:docker:up": "docker compose -f test/docker-compose.yml up --abort-on-container-exit --remove-orphans",
+    "test:docker:down": "docker compose -f test/docker-compose.yml down",
+    "test:docker:node": "npm run test:docker:up -- node && npm run test:docker:down",
+    "test:docker:bun": "npm run test:docker:up -- bun && npm run test:docker:down",
+    "test:docker:deno": "npm run test:docker:up -- deno && npm run test:docker:down",
+    "test:docker:coverage": "npm run test:docker:up -- coverage && npm run test:docker:down",
+    "test:coverage": "c8 npm test",
+    "test:build": "rollup -c",
+    "typecheck": "cd \"test/tsc-build\" && tsc -p \"tsconfig.json\" && cd .. && tsc -p \"tsconfig.json\" --noEmit",
+    "benchmark": "node ./benchmarks/benchmark.js",
+    "wait-port": "wait-on"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sidorares/node-mysql2.git"
+  },
+  "homepage": "https://sidorares.github.io/node-mysql2/docs",
+  "keywords": [
+    "mysql",
+    "client",
+    "server"
+  ],
+  "files": [
+    "lib",
+    "typings/mysql",
+    "index.js",
+    "index.d.ts",
+    "promise.js",
+    "promise.d.ts"
+  ],
+  "exports": {
+    ".": "./index.js",
+    "./package.json": "./package.json",
+    "./promise": "./promise.js",
+    "./promise.js": "./promise.js"
+  },
+  "engines": {
+    "node": ">= 8.0"
+  },
+  "author": "Andrey Sidorov ",
+  "license": "MIT",
+  "dependencies": {
+    "aws-ssl-profiles": "^1.1.2",
+    "denque": "^2.1.0",
+    "generate-function": "^2.3.1",
+    "iconv-lite": "^0.7.2",
+    "long": "^5.3.2",
+    "lru.min": "^1.1.4",
+    "named-placeholders": "^1.1.6",
+    "sql-escaper": "^1.3.3"
+  },
+  "peerDependencies": {
+    "@types/node": ">= 8"
+  },
+  "devDependencies": {
+    "@eslint/eslintrc": "^3.3.3",
+    "@eslint/js": "^9.39.2",
+    "@eslint/markdown": "^7.5.1",
+    "@ianvs/prettier-plugin-sort-imports": "^4.7.1",
+    "@pokujs/multi-suite": "^1.0.0",
+    "@rollup/plugin-commonjs": "^29.0.2",
+    "@rollup/plugin-json": "^6.1.0",
+    "@rollup/plugin-node-resolve": "^16.0.3",
+    "@types/node": "^25.3.0",
+    "@typescript-eslint/eslint-plugin": "^8.56.0",
+    "@typescript-eslint/parser": "^8.56.0",
+    "assert-diff": "^3.0.4",
+    "benchmark": "^2.1.4",
+    "c8": "^11.0.0",
+    "error-stack-parser": "^2.1.4",
+    "eslint-config-prettier": "^10.1.8",
+    "eslint-plugin-async-await": "^0.0.0",
+    "eslint-plugin-prettier": "^5.5.5",
+    "globals": "^17.3.0",
+    "poku": "^4.1.0",
+    "portfinder": "^1.0.38",
+    "prettier": "^3.8.1",
+    "rollup": "^4.59.0",
+    "tsx": "^4.21.0",
+    "typescript": "^5.9.3"
+  }
+}
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/promise.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/promise.d.ts
new file mode 100644
index 0000000..a5097d1
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/promise.d.ts	
@@ -0,0 +1,139 @@
+import { EventEmitter } from 'events';
+
+import {
+  RowDataPacket,
+  OkPacket,
+  ResultSetHeader,
+  FieldPacket,
+  QueryOptions,
+  ConnectionOptions,
+  PoolOptions,
+  PoolClusterOptions,
+  Pool as CorePool,
+  ConnectionState,
+} from './index.js';
+import { ExecutableBase as ExecutableBaseClass } from './typings/mysql/lib/protocol/sequences/promise/ExecutableBase.js';
+import { QueryableBase as QueryableBaseClass } from './typings/mysql/lib/protocol/sequences/promise/QueryableBase.js';
+
+export * from './index.js';
+
+// Expose class interfaces
+declare class QueryableAndExecutableBase extends QueryableBaseClass(
+  ExecutableBaseClass(EventEmitter)
+) {}
+
+export interface PreparedStatementInfo {
+  close(): Promise;
+  execute(
+    parameters: any | any[] | { [param: string]: any }
+  ): Promise<
+    [
+      (
+        | RowDataPacket[][]
+        | RowDataPacket[]
+        | OkPacket
+        | OkPacket[]
+        | ResultSetHeader
+      ),
+      FieldPacket[],
+    ]
+  >;
+}
+
+export declare class Connection extends QueryableAndExecutableBase {
+  config: ConnectionOptions;
+
+  threadId: number;
+
+  readonly state: ConnectionState;
+
+  connect(): Promise;
+
+  ping(): Promise;
+
+  beginTransaction(): Promise;
+
+  commit(): Promise;
+
+  rollback(): Promise;
+
+  changeUser(options: ConnectionOptions): Promise;
+
+  prepare(options: string | QueryOptions): Promise;
+
+  unprepare(sql: string | QueryOptions): void;
+
+  end(options?: any): Promise;
+
+  [Symbol.asyncDispose](): Promise;
+
+  destroy(): void;
+
+  pause(): void;
+
+  resume(): void;
+
+  escape(value: any): string;
+
+  escapeId(value: string): string;
+  escapeId(values: string[]): string;
+
+  format(sql: string, values?: any | any[] | { [param: string]: any }): string;
+}
+
+export declare class PoolConnection extends Connection {
+  release(): void;
+  connection: Connection;
+  [Symbol.asyncDispose](): Promise;
+}
+
+export interface Pool extends Connection {
+  getConnection(): Promise;
+
+  releaseConnection(connection: PoolConnection): void;
+
+  on(event: 'connection', listener: (connection: PoolConnection) => any): this;
+  on(event: 'acquire', listener: (connection: PoolConnection) => any): this;
+  on(event: 'release', listener: (connection: PoolConnection) => any): this;
+  on(event: 'enqueue', listener: () => any): this;
+
+  end(): Promise;
+
+  pool: CorePool;
+}
+
+export interface PoolNamespace extends QueryableAndExecutableBase {
+  getConnection(): Promise;
+}
+
+export interface PoolCluster extends EventEmitter {
+  config: PoolClusterOptions;
+
+  add(config: PoolOptions): void;
+  add(group: string, connectionUri: string): void;
+  add(group: string, config: PoolOptions): void;
+
+  end(): Promise;
+
+  [Symbol.asyncDispose](): Promise;
+
+  getConnection(): Promise;
+  getConnection(group: string): Promise;
+  getConnection(group: string, selector: string): Promise;
+
+  of(pattern: string, selector?: string): PoolNamespace;
+
+  on(event: string, listener: (...args: any[]) => void): this;
+  on(event: 'remove', listener: (nodeId: number) => void): this;
+  on(event: 'warn', listener: (err: Error) => void): this;
+}
+
+export function createConnection(connectionUri: string): Promise;
+export function createConnection(
+  config: ConnectionOptions
+): Promise;
+
+export function createPool(connectionUri: string): Pool;
+export function createPool(config: PoolOptions): Pool;
+
+export function createPoolCluster(config?: PoolClusterOptions): PoolCluster;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/promise.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/promise.js
new file mode 100644
index 0000000..3c1e843
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/promise.js	
@@ -0,0 +1,210 @@
+'use strict';
+
+const SqlString = require('sql-escaper');
+const EventEmitter = require('events').EventEmitter;
+const parserCache = require('./lib/parsers/parser_cache.js');
+const PoolCluster = require('./lib/pool_cluster.js');
+const createConnection = require('./lib/create_connection.js');
+const createPool = require('./lib/create_pool.js');
+const createPoolCluster = require('./lib/create_pool_cluster.js');
+const PromiseConnection = require('./lib/promise/connection.js');
+const PromisePool = require('./lib/promise/pool.js');
+const makeDoneCb = require('./lib/promise/make_done_cb.js');
+const PromisePoolConnection = require('./lib/promise/pool_connection.js');
+const inheritEvents = require('./lib/promise/inherit_events.js');
+const PromisePoolNamespace = require('./lib/promise/pool_cluster');
+
+function createConnectionPromise(opts) {
+  const coreConnection = createConnection(opts);
+  const createConnectionErr = new Error();
+  const thePromise = opts.Promise || Promise;
+  if (!thePromise) {
+    throw new Error(
+      'no Promise implementation available.' +
+        'Use promise-enabled node version or pass userland Promise' +
+        " implementation as parameter, for example: { Promise: require('bluebird') }"
+    );
+  }
+  return new thePromise((resolve, reject) => {
+    coreConnection.once('connect', () => {
+      resolve(new PromiseConnection(coreConnection, thePromise));
+    });
+    coreConnection.once('error', (err) => {
+      createConnectionErr.message = err.message;
+      createConnectionErr.code = err.code;
+      createConnectionErr.errno = err.errno;
+      createConnectionErr.sqlState = err.sqlState;
+      reject(createConnectionErr);
+    });
+  });
+}
+
+// note: the callback of "changeUser" is not called on success
+// hence there is no possibility to call "resolve"
+
+function createPromisePool(opts) {
+  const corePool = createPool(opts);
+  const thePromise = opts.Promise || Promise;
+  if (!thePromise) {
+    throw new Error(
+      'no Promise implementation available.' +
+        'Use promise-enabled node version or pass userland Promise' +
+        " implementation as parameter, for example: { Promise: require('bluebird') }"
+    );
+  }
+
+  return new PromisePool(corePool, thePromise);
+}
+
+class PromisePoolCluster extends EventEmitter {
+  constructor(poolCluster, thePromise) {
+    super();
+    this.poolCluster = poolCluster;
+    this.Promise = thePromise || Promise;
+    inheritEvents(poolCluster, this, ['warn', 'remove', 'online', 'offline']);
+  }
+
+  getConnection(pattern, selector) {
+    const corePoolCluster = this.poolCluster;
+    return new this.Promise((resolve, reject) => {
+      corePoolCluster.getConnection(
+        pattern,
+        selector,
+        (err, coreConnection) => {
+          if (err) {
+            reject(err);
+          } else {
+            resolve(new PromisePoolConnection(coreConnection, this.Promise));
+          }
+        }
+      );
+    });
+  }
+
+  query(sql, args) {
+    const corePoolCluster = this.poolCluster;
+    const localErr = new Error();
+    if (typeof args === 'function') {
+      throw new Error(
+        'Callback function is not available with promise clients.'
+      );
+    }
+    return new this.Promise((resolve, reject) => {
+      const done = makeDoneCb(resolve, reject, localErr);
+      corePoolCluster.query(sql, args, done);
+    });
+  }
+
+  execute(sql, args) {
+    const corePoolCluster = this.poolCluster;
+    const localErr = new Error();
+    if (typeof args === 'function') {
+      throw new Error(
+        'Callback function is not available with promise clients.'
+      );
+    }
+    return new this.Promise((resolve, reject) => {
+      const done = makeDoneCb(resolve, reject, localErr);
+      corePoolCluster.execute(sql, args, done);
+    });
+  }
+
+  of(pattern, selector) {
+    return new PromisePoolNamespace(
+      this.poolCluster.of(pattern, selector),
+      this.Promise
+    );
+  }
+
+  end() {
+    const corePoolCluster = this.poolCluster;
+    const localErr = new Error();
+    return new this.Promise((resolve, reject) => {
+      corePoolCluster.end((err) => {
+        if (err) {
+          localErr.message = err.message;
+          localErr.code = err.code;
+          localErr.errno = err.errno;
+          localErr.sqlState = err.sqlState;
+          localErr.sqlMessage = err.sqlMessage;
+          reject(localErr);
+        } else {
+          resolve();
+        }
+      });
+    });
+  }
+
+  async [Symbol.asyncDispose]() {
+    if (!this.poolCluster._closed) {
+      await this.end();
+    }
+  }
+}
+
+/**
+ * proxy poolCluster synchronous functions
+ */
+(function (functionsToWrap) {
+  for (let i = 0; functionsToWrap && i < functionsToWrap.length; i++) {
+    const func = functionsToWrap[i];
+
+    if (
+      typeof PoolCluster.prototype[func] === 'function' &&
+      PromisePoolCluster.prototype[func] === undefined
+    ) {
+      PromisePoolCluster.prototype[func] = (function factory(funcName) {
+        return function () {
+          return PoolCluster.prototype[funcName].apply(
+            this.poolCluster,
+            arguments
+          );
+        };
+      })(func);
+    }
+  }
+})(['add', 'remove']);
+
+function createPromisePoolCluster(opts) {
+  const corePoolCluster = createPoolCluster(opts);
+  const thePromise = (opts && opts.Promise) || Promise;
+  if (!thePromise) {
+    throw new Error(
+      'no Promise implementation available.' +
+        'Use promise-enabled node version or pass userland Promise' +
+        " implementation as parameter, for example: { Promise: require('bluebird') }"
+    );
+  }
+  return new PromisePoolCluster(corePoolCluster, thePromise);
+}
+
+exports.createConnection = createConnectionPromise;
+exports.createPool = createPromisePool;
+exports.createPoolCluster = createPromisePoolCluster;
+exports.escape = SqlString.escape;
+exports.escapeId = SqlString.escapeId;
+exports.format = SqlString.format;
+exports.raw = SqlString.raw;
+exports.Connection = PromiseConnection;
+exports.PoolConnection = PromisePoolConnection;
+exports.PromisePool = PromisePool;
+exports.PromiseConnection = PromiseConnection;
+exports.PromisePoolConnection = PromisePoolConnection;
+
+exports.__defineGetter__('Types', () => require('./lib/constants/types.js'));
+
+exports.__defineGetter__('Charsets', () =>
+  require('./lib/constants/charsets.js')
+);
+
+exports.__defineGetter__('CharsetToEncoding', () =>
+  require('./lib/constants/charset_encodings.js')
+);
+
+exports.setMaxParserCache = function (max) {
+  parserCache.setMaxCache(max);
+};
+
+exports.clearParserCache = function () {
+  parserCache.clearCache();
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/LICENSE.txt b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/LICENSE.txt
new file mode 100644
index 0000000..fc35417
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/LICENSE.txt	
@@ -0,0 +1,15 @@
+ISC License
+
+Copyright (c) 2016, Felix Frederick Becker
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/index.d.ts
new file mode 100644
index 0000000..7e9fa22
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/index.d.ts	
@@ -0,0 +1,89 @@
+import { Pool as BasePool, PoolOptions } from './lib/Pool.js';
+import {
+  Connection as BaseConnection,
+  ConnectionOptions,
+  SslOptions,
+} from './lib/Connection.js';
+import {
+  Query as BaseQuery,
+  QueryOptions,
+  QueryError,
+} from './lib/protocol/sequences/Query.js';
+import {
+  PoolCluster as BasePoolCluster,
+  PoolClusterOptions,
+  PoolNamespace,
+} from './lib/PoolCluster.js';
+import {
+  Prepare as BasePrepare,
+  PrepareStatementInfo,
+} from './lib/protocol/sequences/Prepare.js';
+import { Server } from './lib/Server.js';
+import {
+  escape as SqlStringEscape,
+  escapeId as SqlStringEscapeId,
+  format as SqlStringFormat,
+  raw as SqlStringRaw,
+} from 'sql-escaper';
+export type { Raw, SqlValue, Timezone } from 'sql-escaper';
+
+export {
+  ConnectionOptions,
+  SslOptions,
+  PoolOptions,
+  PoolClusterOptions,
+  PoolNamespace,
+  QueryOptions,
+  QueryError,
+  PrepareStatementInfo,
+};
+
+export * from './lib/protocol/packets/index.js';
+export * from './lib/Auth.js';
+export * from './lib/constants/index.js';
+export * from './lib/parsers/index.js';
+export * from './lib/Connection.js';
+export * from './lib/PoolConnection.js';
+
+// Expose class interfaces
+export interface Pool extends BasePool {}
+export interface PoolCluster extends BasePoolCluster {}
+export interface Query extends BaseQuery {}
+export interface Prepare extends BasePrepare {}
+
+export function createConnection(connectionUri: string): BaseConnection;
+export function createConnection(config: ConnectionOptions): BaseConnection;
+
+export function createPool(connectionUri: string): BasePool;
+export function createPool(config: PoolOptions): BasePool;
+
+export function createPoolCluster(config?: PoolClusterOptions): PoolCluster;
+
+export const escape: typeof SqlStringEscape;
+export const escapeId: typeof SqlStringEscapeId;
+export const format: typeof SqlStringFormat;
+export const raw: typeof SqlStringRaw;
+
+export interface ConnectionConfig extends ConnectionOptions {
+  mergeFlags(defaultFlags: string[], userFlags: string[] | string): number;
+  getDefaultFlags(options?: ConnectionOptions): string[];
+  getCharsetNumber(charset: string): number;
+  getSSLProfile(name: string): { ca: string[] };
+  parseUrl(url: string): {
+    host: string;
+    port: number;
+    database: string;
+    user: string;
+    password: string;
+    [key: string]: any;
+  };
+}
+
+export function createServer(handler: (conn: BaseConnection) => any): Server;
+
+export type {
+  QueryTraceContext,
+  ExecuteTraceContext,
+  ConnectTraceContext,
+  PoolConnectTraceContext,
+} from './lib/Tracing.js';
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/info.txt b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/info.txt
new file mode 100644
index 0000000..8ee9419
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/info.txt	
@@ -0,0 +1 @@
+temporary workaround, see https://github.com/sidorares/node-mysql2/issues/1210
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/Auth.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/Auth.d.ts
new file mode 100644
index 0000000..c2adc98
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/Auth.d.ts	
@@ -0,0 +1,30 @@
+import { RsaPublicKey, RsaPrivateKey, KeyLike } from 'crypto';
+import { Connection } from './Connection.js';
+
+export type AuthPlugin = (pluginMetadata: {
+  connection: Connection;
+  command: string;
+}) => (
+  pluginData: Buffer
+) => Promise | string | Buffer | Promise | null;
+
+type AuthPluginDefinition = (pluginOptions?: T) => AuthPlugin;
+
+export const authPlugins: {
+  caching_sha2_password: AuthPluginDefinition<{
+    overrideIsSecure?: boolean;
+    serverPublicKey?: RsaPublicKey | RsaPrivateKey | KeyLike;
+    onServerPublicKey?: (data: Buffer) => void;
+  }>;
+  mysql_clear_password: AuthPluginDefinition<{
+    password?: string;
+  }>;
+  mysql_native_password: AuthPluginDefinition<{
+    password?: string;
+    passwordSha1?: string;
+  }>;
+  sha256_password: AuthPluginDefinition<{
+    serverPublicKey?: RsaPublicKey | RsaPrivateKey | KeyLike;
+    onServerPublicKey?: (data: Buffer) => void;
+  }>;
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/Connection.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/Connection.d.ts
new file mode 100644
index 0000000..7aae055
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/Connection.d.ts	
@@ -0,0 +1,442 @@
+// This file was modified by Oracle on November 04, 2021.
+// Type definitions and corresponding descriptions were introduced for the
+// connection options relevant for multifactor authentication.
+// Modifications copyright (c) 2021, Oracle and/or its affiliates.
+
+import { EventEmitter } from 'events';
+import { Readable } from 'stream';
+import { Timezone } from 'sql-escaper';
+import { Query, QueryError } from './protocol/sequences/Query.js';
+import { Prepare, PrepareStatementInfo } from './protocol/sequences/Prepare.js';
+import {
+  OkPacket,
+  FieldPacket,
+  RowDataPacket,
+  ResultSetHeader,
+  OkPacketParams,
+  ErrorPacketParams,
+} from './protocol/packets/index.js';
+import { Connection as PromiseConnection } from '../../../promise.js';
+import { AuthPlugin } from './Auth.js';
+import { QueryableBase } from './protocol/sequences/QueryableBase.js';
+import { ExecutableBase } from './protocol/sequences/ExecutableBase.js';
+import { TypeCast } from './parsers/typeCast.js';
+
+export interface SslOptions {
+  /**
+   * A string or buffer holding the PFX or PKCS12 encoded private key, certificate and CA certificates
+   */
+  pfx?: string;
+
+  /**
+   * Either a string/buffer or list of strings/Buffers holding the PEM encoded private key(s) to use
+   */
+  key?: string | string[] | Buffer | Buffer[];
+
+  /**
+   * A string of passphrase for the private key or pfx
+   */
+  passphrase?: string;
+
+  /**
+   * A string/buffer or list of strings/Buffers holding the PEM encoded certificate(s)
+   */
+  cert?: string | string[] | Buffer | Buffer[];
+
+  /**
+   * Either a string/Buffer or list of strings/Buffers of PEM encoded CA certificates to trust.
+   */
+  ca?: string | string[] | Buffer | Buffer[];
+
+  /**
+   * Either a string or list of strings of PEM encoded CRLs (Certificate Revocation List)
+   */
+  crl?: string | string[];
+
+  /**
+   * A string describing the ciphers to use or exclude
+   */
+  ciphers?: string;
+
+  /**
+   * You can also connect to a MySQL server without properly providing the appropriate CA to trust. You should not do this.
+   */
+  rejectUnauthorized?: boolean;
+
+  /**
+   * Configure the minimum supported version of SSL, the default is TLSv1.2.
+   */
+  minVersion?: string;
+
+  /**
+   * Configure the maximum supported version of SSL, the default is TLSv1.3.
+   */
+  maxVersion?: string;
+
+  /**
+   * You can verify the server name identity presented on the server certificate when connecting to a MySQL server.
+   * You should enable this but it is disabled by default right now for backwards compatibility.
+   */
+  verifyIdentity?: boolean;
+}
+
+export interface ConnectionOptions {
+  /**
+   * DECIMAL and NEWDECIMAL types will be returned as numbers if this option is set to `true` ( default: `false`).
+   */
+  decimalNumbers?: boolean;
+
+  /**
+   * The MySQL user to authenticate as
+   */
+  user?: string;
+
+  /**
+   * The password of that MySQL user
+   */
+  password?: string;
+
+  /**
+   * Alias for the MySQL user password. Makes a bit more sense in a multifactor authentication setup (see
+   * "password2" and "password3")
+   */
+  password1?: string;
+
+  /**
+   * 2nd factor authentication password. Mandatory when the authentication policy for the MySQL user account
+   * requires an additional authentication method that needs a password.
+   * https://dev.mysql.com/doc/refman/8.0/en/multifactor-authentication.html
+   */
+  password2?: string;
+
+  /**
+   * 3rd factor authentication password. Mandatory when the authentication policy for the MySQL user account
+   * requires two additional authentication methods and the last one needs a password.
+   * https://dev.mysql.com/doc/refman/8.0/en/multifactor-authentication.html
+   */
+  password3?: string;
+
+  /**
+   * Name of the database to use for this connection
+   */
+  database?: string;
+
+  /**
+   * The charset for the connection. This is called 'collation' in the SQL-level of MySQL (like utf8_general_ci).
+   * If a SQL-level charset is specified (like utf8mb4) then the default collation for that charset is used.
+   * (Default: 'UTF8_GENERAL_CI')
+   */
+  charset?: string;
+
+  /**
+   * The hostname of the database you are connecting to. (Default: localhost)
+   */
+  host?: string;
+
+  /**
+   * The port number to connect to. (Default: 3306)
+   */
+  port?: number;
+
+  /**
+   * The source IP address to use for TCP connection
+   */
+  localAddress?: string;
+
+  /**
+   * The path to a unix domain socket to connect to. When used host and port are ignored
+   */
+  socketPath?: string;
+
+  /**
+   * The timezone used to store local dates. (Default: 'local')
+   */
+  timezone?: Timezone;
+
+  /**
+   * The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: 10 seconds)
+   */
+  connectTimeout?: number;
+
+  /**
+   * Stringify objects instead of converting to values. (Default: 'false')
+   */
+  stringifyObjects?: boolean;
+
+  /**
+   * Allow connecting to MySQL instances that ask for the old (insecure) authentication method. (Default: false)
+   */
+  insecureAuth?: boolean;
+
+  /**
+   * By specifying a function that returns a readable stream, an arbitrary stream can be sent when sending a local fs file.
+   */
+  infileStreamFactory?: (path: string) => Readable;
+
+  /**
+   * Determines if column values should be converted to native JavaScript types.
+   *
+   * @default true
+   *
+   * It is not recommended (and may go away / change in the future) to disable type casting, but you can currently do so on either the connection or query level.
+   *
+   * ---
+   *
+   * You can also specify a function to do the type casting yourself:
+   * ```ts
+   * (field: Field, next: () => unknown) => {
+   *   return next();
+   * }
+   * ```
+   *
+   * ---
+   *
+   * **WARNING:**
+   *
+   * YOU MUST INVOKE the parser using one of these three field functions in your custom typeCast callback. They can only be called once:
+   *
+   * ```js
+   * field.string();
+   * field.buffer();
+   * field.geometry();
+   * ```
+
+   * Which are aliases for:
+   *
+   * ```js
+   * parser.parseLengthCodedString();
+   * parser.parseLengthCodedBuffer();
+   * parser.parseGeometryValue();
+   * ```
+   *
+   * You can find which field function you need to use by looking at `RowDataPacket.prototype._typeCast`.
+   */
+  typeCast?: TypeCast;
+
+  /**
+   * A custom query format function
+   */
+  queryFormat?: (query: string, values: any) => void;
+
+  /**
+   * When dealing with big numbers (BIGINT and DECIMAL columns) in the database, you should enable this option
+   * (Default: false)
+   */
+  supportBigNumbers?: boolean;
+
+  /**
+   * Enabling both supportBigNumbers and bigNumberStrings forces big numbers (BIGINT and DECIMAL columns) to be
+   * always returned as JavaScript String objects (Default: false). Enabling supportBigNumbers but leaving
+   * bigNumberStrings disabled will return big numbers as String objects only when they cannot be accurately
+   * represented with [JavaScript Number objects](https://262.ecma-international.org/5.1/#sec-8.5)
+   * (which happens when they exceed the [-2^53, +2^53] range), otherwise they will be returned as Number objects.
+   * This option is ignored if supportBigNumbers is disabled.
+   */
+  bigNumberStrings?: boolean;
+
+  /**
+   * Force date types (TIMESTAMP, DATETIME, DATE) to be returned as strings rather then inflated into JavaScript Date
+   * objects. Can be true/false or an array of type names to keep as strings.
+   *
+   * (Default: false)
+   */
+  dateStrings?: boolean | Array<'TIMESTAMP' | 'DATETIME' | 'DATE'>;
+
+  /**
+   * This will print all incoming and outgoing packets on stdout.
+   * You can also restrict debugging to packet types by passing an array of types (strings) to debug;
+   *
+   * (Default: false)
+   */
+  debug?: any;
+
+  /**
+   * Generates stack traces on Error to include call site of library entrance ('long stack traces'). Slight
+   * performance penalty for most calls. (Default: true)
+   */
+  trace?: boolean;
+
+  /**
+   * Allow multiple mysql statements per query. Be careful with this, it exposes you to SQL injection attacks. (Default: false)
+   */
+  multipleStatements?: boolean;
+
+  /**
+   * List of connection flags to use other than the default ones. It is also possible to blacklist default ones
+   */
+  flags?: Array;
+
+  /**
+   * object with ssl parameters or a string containing name of ssl profile
+   */
+  ssl?: string | SslOptions;
+
+  /**
+   * Return each row as an array, not as an object.
+   * This is useful when you have duplicate column names.
+   * This can also be set in the `QueryOption` object to be applied per-query.
+   */
+  rowsAsArray?: boolean;
+
+  /**
+   * Enable keep-alive on the socket. (Default: true)
+   */
+  enableKeepAlive?: boolean;
+
+  /**
+   * If keep-alive is enabled users can supply an initial delay. (Default: 0)
+   */
+  keepAliveInitialDelay?: number;
+
+  charsetNumber?: number;
+
+  compress?: boolean;
+
+  authSwitchHandler?: (data: any, callback: () => void) => any;
+
+  connectAttributes?: { [param: string]: any };
+
+  isServer?: boolean;
+
+  maxPreparedStatements?: number;
+
+  namedPlaceholders?: boolean;
+
+  nestTables?: boolean | string;
+
+  passwordSha1?: string;
+
+  pool?: any;
+
+  stream?: any;
+
+  uri?: string;
+
+  connectionLimit?: number;
+
+  maxIdle?: number;
+
+  idleTimeout?: number;
+
+  Promise?: any;
+
+  queueLimit?: number;
+
+  waitForConnections?: boolean;
+
+  disableEval?: boolean;
+
+  authPlugins?: {
+    [key: string]: AuthPlugin;
+  };
+
+  /**
+   * Force JSON to be returned as string
+   *
+   * (Default: false)
+   */
+  jsonStrings?: boolean;
+
+  gracefulEnd?: boolean;
+}
+
+export type ConnectionState =
+  | 'disconnected'
+  | 'protocol_handshake'
+  | 'connected'
+  | 'authenticated'
+  | 'error';
+
+declare class Connection extends QueryableBase(ExecutableBase(EventEmitter)) {
+  config: ConnectionOptions;
+
+  threadId: number;
+
+  authorized: boolean;
+
+  readonly state: ConnectionState;
+
+  static createQuery<
+    T extends
+      | RowDataPacket[][]
+      | RowDataPacket[]
+      | OkPacket
+      | OkPacket[]
+      | ResultSetHeader,
+  >(
+    sql: string,
+    callback?: (err: QueryError | null, result: T, fields: FieldPacket[]) => any
+  ): Query;
+  static createQuery<
+    T extends
+      | RowDataPacket[][]
+      | RowDataPacket[]
+      | OkPacket
+      | OkPacket[]
+      | ResultSetHeader,
+  >(
+    sql: string,
+    values: any | any[] | { [param: string]: any },
+    callback?: (err: QueryError | null, result: T, fields: FieldPacket[]) => any
+  ): Query;
+
+  beginTransaction(callback: (err: QueryError | null) => void): void;
+
+  connect(callback?: (err: QueryError | null) => void): void;
+
+  commit(callback?: (err: QueryError | null) => void): void;
+
+  changeUser(
+    options: ConnectionOptions,
+    callback?: (err: QueryError | null) => void
+  ): void;
+
+  end(callback?: (err: QueryError | null) => void): void;
+  end(options: any, callback?: (err: QueryError | null) => void): void;
+
+  [Symbol.dispose](): void;
+
+  destroy(): void;
+
+  pause(): void;
+
+  resume(): void;
+
+  escape(value: any): string;
+
+  escapeId(value: string): string;
+  escapeId(values: string[]): string;
+
+  format(sql: string, values?: any | any[] | { [param: string]: any }): string;
+
+  on(event: string, listener: (...args: any[]) => void): this;
+
+  rollback(callback: (err: QueryError | null) => void): void;
+
+  prepare(
+    sql: string,
+    callback?: (err: QueryError | null, statement: PrepareStatementInfo) => any
+  ): Prepare;
+
+  unprepare(sql: string): PrepareStatementInfo;
+
+  serverHandshake(args: any): any;
+
+  promise(promiseImpl?: PromiseConstructor): PromiseConnection;
+
+  ping(callback?: (err: QueryError | null) => any): void;
+
+  writeOk(args?: OkPacketParams): void;
+
+  writeError(args?: ErrorPacketParams): void;
+
+  writeEof(warnings?: number, statusFlags?: number): void;
+
+  writeTextResult(rows?: Array, columns?: Array): void;
+
+  writePacket(packet: any): void;
+
+  sequenceId: number;
+}
+
+export { Connection };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/Pool.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/Pool.d.ts
new file mode 100644
index 0000000..db2be07
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/Pool.d.ts	
@@ -0,0 +1,71 @@
+import { EventEmitter } from 'events';
+import { PrepareStatementInfo } from './protocol/sequences/Prepare.js';
+import { ConnectionOptions } from './Connection.js';
+import { PoolConnection } from './PoolConnection.js';
+import {
+  Pool as PromisePool,
+  PoolConnection as PromisePoolConnection,
+} from '../../../promise.js';
+import { QueryableBase } from './protocol/sequences/QueryableBase.js';
+import { ExecutableBase } from './protocol/sequences/ExecutableBase.js';
+
+export interface PoolOptions extends ConnectionOptions {
+  /**
+   * Determines the pool's action when no connections are available and the limit has been reached. If true, the pool will queue
+   * the connection request and call it when one becomes available. If false, the pool will immediately call back with an error.
+   * (Default: true)
+   */
+  waitForConnections?: boolean;
+
+  /**
+   * The maximum number of connections to create at once. (Default: 10)
+   */
+  connectionLimit?: number;
+
+  /**
+   * The maximum number of idle connections. (Default: same as `connectionLimit`)
+   */
+  maxIdle?: number;
+
+  /**
+   * The idle connections timeout, in milliseconds. (Default: 60000)
+   */
+  idleTimeout?: number;
+
+  /**
+   * The maximum number of connection requests the pool will queue before returning an error from getConnection. If set to 0, there
+   * is no limit to the number of queued connection requests. (Default: 0)
+   */
+  queueLimit?: number;
+}
+
+declare class Pool extends QueryableBase(ExecutableBase(EventEmitter)) {
+  getConnection(
+    callback: (
+      err: NodeJS.ErrnoException | null,
+      connection: PoolConnection
+    ) => any
+  ): void;
+
+  releaseConnection(connection: PoolConnection | PromisePoolConnection): void;
+
+  end(
+    callback?: (err: NodeJS.ErrnoException | null, ...args: any[]) => any
+  ): void;
+
+  [Symbol.dispose](): void;
+
+  on(event: string, listener: (...args: any[]) => void): this;
+  on(event: 'connection', listener: (connection: PoolConnection) => any): this;
+  on(event: 'acquire', listener: (connection: PoolConnection) => any): this;
+  on(event: 'release', listener: (connection: PoolConnection) => any): this;
+  on(event: 'enqueue', listener: () => any): this;
+
+  unprepare(sql: string): PrepareStatementInfo;
+
+  promise(promiseImpl?: PromiseConstructor): PromisePool;
+
+  config: PoolOptions;
+}
+
+export { Pool };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts
new file mode 100644
index 0000000..90fe224
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts	
@@ -0,0 +1,92 @@
+import { EventEmitter } from 'events';
+import { PoolConnection } from './PoolConnection.js';
+import { PoolOptions } from './Pool.js';
+import { ExecutableBase as ExecutableBaseClass } from './protocol/sequences/ExecutableBase.js';
+import { QueryableBase as QueryableBaseClass } from './protocol/sequences/QueryableBase.js';
+
+// Expose class interfaces
+declare class QueryableAndExecutableBase extends QueryableBaseClass(
+  ExecutableBaseClass(EventEmitter)
+) {}
+
+export interface PoolClusterOptions {
+  /**
+   * If true, PoolCluster will attempt to reconnect when connection fails. (Default: true)
+   */
+  canRetry?: boolean;
+
+  /**
+   * If connection fails, node's errorCount increases. When errorCount is greater than removeNodeErrorCount,
+   * remove a node in the PoolCluster. (Default: 5)
+   */
+  removeNodeErrorCount?: number;
+
+  /**
+   * If connection fails, specifies the number of milliseconds before another connection attempt will be made.
+   * If set to 0, then node will be removed instead and never re-used. (Default: 0)
+   */
+  restoreNodeTimeout?: number;
+
+  /**
+   * The default selector. (Default: RR)
+   * RR: Select one alternately. (Round-Robin)
+   * RANDOM: Select the node by random function.
+   * ORDER: Select the first node available unconditionally.
+   */
+  defaultSelector?: string;
+}
+
+export interface PoolNamespace extends QueryableAndExecutableBase {
+  getConnection(
+    callback: (
+      err: NodeJS.ErrnoException | null,
+      connection: PoolConnection
+    ) => any
+  ): void;
+}
+
+declare class PoolCluster extends EventEmitter {
+  config: PoolClusterOptions;
+
+  add(config: PoolOptions): void;
+  add(group: string, connectionUri: string): void;
+  add(group: string, config: PoolOptions): void;
+
+  remove(pattern: string): void;
+
+  end(callback?: (err: NodeJS.ErrnoException | null) => void): void;
+
+  [Symbol.dispose](): void;
+
+  getConnection(
+    callback: (
+      err: NodeJS.ErrnoException | null,
+      connection: PoolConnection
+    ) => void
+  ): void;
+  getConnection(
+    group: string,
+    callback: (
+      err: NodeJS.ErrnoException | null,
+      connection: PoolConnection
+    ) => void
+  ): void;
+  getConnection(
+    group: string,
+    selector: string,
+    callback: (
+      err: NodeJS.ErrnoException | null,
+      connection: PoolConnection
+    ) => void
+  ): void;
+
+  of(pattern: string, selector?: string): PoolNamespace;
+
+  on(event: string, listener: (...args: any[]) => void): this;
+  on(event: 'online', listener: (nodeId: number) => void): this;
+  on(event: 'offline', listener: (nodeId: number) => void): this;
+  on(event: 'remove', listener: (nodeId: number) => void): this;
+  on(event: 'warn', listener: (err: Error) => void): this;
+}
+
+export { PoolCluster };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/PoolConnection.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/PoolConnection.d.ts
new file mode 100644
index 0000000..8e7865b
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/PoolConnection.d.ts	
@@ -0,0 +1,11 @@
+import { Connection } from './Connection.js';
+import { Pool as PromisePool } from '../../../promise.js';
+
+declare class PoolConnection extends Connection {
+  connection: Connection;
+  release(): void;
+  [Symbol.dispose](): void;
+  promise(promiseImpl?: PromiseConstructor): PromisePool;
+}
+
+export { PoolConnection };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/Server.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/Server.d.ts
new file mode 100644
index 0000000..195adee
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/Server.d.ts	
@@ -0,0 +1,11 @@
+import { EventEmitter } from 'events';
+import { Connection } from './Connection.js';
+
+declare class Server extends EventEmitter {
+  connections: Array;
+
+  listen(port: number): Server;
+  close(callback: (error: Error, count: number) => any): void;
+}
+
+export { Server };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/Tracing.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/Tracing.d.ts
new file mode 100644
index 0000000..3f5a52e
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/Tracing.d.ts	
@@ -0,0 +1,71 @@
+import type { TracingChannel } from 'node:diagnostics_channel';
+
+export interface QueryTraceContext {
+  query: string;
+  values: any;
+  database: string;
+  serverAddress: string;
+  serverPort: number | undefined;
+}
+
+export interface ExecuteTraceContext {
+  query: string;
+  values: any;
+  database: string;
+  serverAddress: string;
+  serverPort: number | undefined;
+}
+
+export interface ConnectTraceContext {
+  database: string;
+  serverAddress: string;
+  serverPort: number | undefined;
+  user: string;
+}
+
+export interface PoolConnectTraceContext {
+  database: string;
+  serverAddress: string;
+  serverPort: number | undefined;
+}
+
+export declare const dc: typeof import('node:diagnostics_channel') | undefined;
+export declare const hasTracingChannel: boolean;
+
+export declare function shouldTrace(
+  channel: TracingChannel | undefined | null
+): boolean;
+
+export declare function traceCallback(
+  channel: TracingChannel | undefined | null,
+  fn: (...args: any[]) => any,
+  position: number,
+  contextFactory: () => T,
+  thisArg: any,
+  ...args: any[]
+): any;
+
+export declare function tracePromise(
+  channel: TracingChannel | undefined | null,
+  fn: () => Promise,
+  contextFactory: () => T
+): Promise;
+
+export declare const queryChannel:
+  | TracingChannel
+  | undefined;
+export declare const executeChannel:
+  | TracingChannel
+  | undefined;
+export declare const connectChannel:
+  | TracingChannel
+  | undefined;
+export declare const poolConnectChannel:
+  | TracingChannel
+  | undefined;
+
+export declare function getServerContext(config: {
+  socketPath?: string;
+  host?: string;
+  port?: number;
+}): { serverAddress: string; serverPort: number | undefined };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/constants/CharsetToEncoding.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/constants/CharsetToEncoding.d.ts
new file mode 100644
index 0000000..aa28389
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/constants/CharsetToEncoding.d.ts	
@@ -0,0 +1,8 @@
+/**
+ * Constant `CharsetToEncoding`.
+ *
+ * Please note that `CharsetToEncoding` can only be accessed from the `mysql` object and not imported directly.
+ */
+declare const CharsetToEncoding: string[];
+
+export { CharsetToEncoding };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/constants/Charsets.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/constants/Charsets.d.ts
new file mode 100644
index 0000000..0b35769
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/constants/Charsets.d.ts	
@@ -0,0 +1,326 @@
+interface Charsets {
+  BIG5_CHINESE_CI: number;
+  LATIN2_CZECH_CS: number;
+  DEC8_SWEDISH_CI: number;
+  CP850_GENERAL_CI: number;
+  LATIN1_GERMAN1_CI: number;
+  HP8_ENGLISH_CI: number;
+  KOI8R_GENERAL_CI: number;
+  LATIN1_SWEDISH_CI: number;
+  LATIN2_GENERAL_CI: number;
+  SWE7_SWEDISH_CI: number;
+  ASCII_GENERAL_CI: number;
+  UJIS_JAPANESE_CI: number;
+  SJIS_JAPANESE_CI: number;
+  CP1251_BULGARIAN_CI: number;
+  LATIN1_DANISH_CI: number;
+  HEBREW_GENERAL_CI: number;
+  TIS620_THAI_CI: number;
+  EUCKR_KOREAN_CI: number;
+  LATIN7_ESTONIAN_CS: number;
+  LATIN2_HUNGARIAN_CI: number;
+  KOI8U_GENERAL_CI: number;
+  CP1251_UKRAINIAN_CI: number;
+  GB2312_CHINESE_CI: number;
+  GREEK_GENERAL_CI: number;
+  CP1250_GENERAL_CI: number;
+  LATIN2_CROATIAN_CI: number;
+  GBK_CHINESE_CI: number;
+  CP1257_LITHUANIAN_CI: number;
+  LATIN5_TURKISH_CI: number;
+  LATIN1_GERMAN2_CI: number;
+  ARMSCII8_GENERAL_CI: number;
+  UTF8_GENERAL_CI: number;
+  CP1250_CZECH_CS: number;
+  UCS2_GENERAL_CI: number;
+  CP866_GENERAL_CI: number;
+  KEYBCS2_GENERAL_CI: number;
+  MACCE_GENERAL_CI: number;
+  MACROMAN_GENERAL_CI: number;
+  CP852_GENERAL_CI: number;
+  LATIN7_GENERAL_CI: number;
+  LATIN7_GENERAL_CS: number;
+  MACCE_BIN: number;
+  CP1250_CROATIAN_CI: number;
+  UTF8MB4_GENERAL_CI: number;
+  UTF8MB4_BIN: number;
+  LATIN1_BIN: number;
+  LATIN1_GENERAL_CI: number;
+  LATIN1_GENERAL_CS: number;
+  CP1251_BIN: number;
+  CP1251_GENERAL_CI: number;
+  CP1251_GENERAL_CS: number;
+  MACROMAN_BIN: number;
+  UTF16_GENERAL_CI: number;
+  UTF16_BIN: number;
+  UTF16LE_GENERAL_CI: number;
+  CP1256_GENERAL_CI: number;
+  CP1257_BIN: number;
+  CP1257_GENERAL_CI: number;
+  UTF32_GENERAL_CI: number;
+  UTF32_BIN: number;
+  UTF16LE_BIN: number;
+  BINARY: number;
+  ARMSCII8_BIN: number;
+  ASCII_BIN: number;
+  CP1250_BIN: number;
+  CP1256_BIN: number;
+  CP866_BIN: number;
+  DEC8_BIN: number;
+  GREEK_BIN: number;
+  HEBREW_BIN: number;
+  HP8_BIN: number;
+  KEYBCS2_BIN: number;
+  KOI8R_BIN: number;
+  KOI8U_BIN: number;
+  UTF8_TOLOWER_CI: number;
+  LATIN2_BIN: number;
+  LATIN5_BIN: number;
+  LATIN7_BIN: number;
+  CP850_BIN: number;
+  CP852_BIN: number;
+  SWE7_BIN: number;
+  UTF8_BIN: number;
+  BIG5_BIN: number;
+  EUCKR_BIN: number;
+  GB2312_BIN: number;
+  GBK_BIN: number;
+  SJIS_BIN: number;
+  TIS620_BIN: number;
+  UCS2_BIN: number;
+  UJIS_BIN: number;
+  GEOSTD8_GENERAL_CI: number;
+  GEOSTD8_BIN: number;
+  LATIN1_SPANISH_CI: number;
+  CP932_JAPANESE_CI: number;
+  CP932_BIN: number;
+  EUCJPMS_JAPANESE_CI: number;
+  EUCJPMS_BIN: number;
+  CP1250_POLISH_CI: number;
+  UTF16_UNICODE_CI: number;
+  UTF16_ICELANDIC_CI: number;
+  UTF16_LATVIAN_CI: number;
+  UTF16_ROMANIAN_CI: number;
+  UTF16_SLOVENIAN_CI: number;
+  UTF16_POLISH_CI: number;
+  UTF16_ESTONIAN_CI: number;
+  UTF16_SPANISH_CI: number;
+  UTF16_SWEDISH_CI: number;
+  UTF16_TURKISH_CI: number;
+  UTF16_CZECH_CI: number;
+  UTF16_DANISH_CI: number;
+  UTF16_LITHUANIAN_CI: number;
+  UTF16_SLOVAK_CI: number;
+  UTF16_SPANISH2_CI: number;
+  UTF16_ROMAN_CI: number;
+  UTF16_PERSIAN_CI: number;
+  UTF16_ESPERANTO_CI: number;
+  UTF16_HUNGARIAN_CI: number;
+  UTF16_SINHALA_CI: number;
+  UTF16_GERMAN2_CI: number;
+  UTF16_CROATIAN_CI: number;
+  UTF16_UNICODE_520_CI: number;
+  UTF16_VIETNAMESE_CI: number;
+  UCS2_UNICODE_CI: number;
+  UCS2_ICELANDIC_CI: number;
+  UCS2_LATVIAN_CI: number;
+  UCS2_ROMANIAN_CI: number;
+  UCS2_SLOVENIAN_CI: number;
+  UCS2_POLISH_CI: number;
+  UCS2_ESTONIAN_CI: number;
+  UCS2_SPANISH_CI: number;
+  UCS2_SWEDISH_CI: number;
+  UCS2_TURKISH_CI: number;
+  UCS2_CZECH_CI: number;
+  UCS2_DANISH_CI: number;
+  UCS2_LITHUANIAN_CI: number;
+  UCS2_SLOVAK_CI: number;
+  UCS2_SPANISH2_CI: number;
+  UCS2_ROMAN_CI: number;
+  UCS2_PERSIAN_CI: number;
+  UCS2_ESPERANTO_CI: number;
+  UCS2_HUNGARIAN_CI: number;
+  UCS2_SINHALA_CI: number;
+  UCS2_GERMAN2_CI: number;
+  UCS2_CROATIAN_CI: number;
+  UCS2_UNICODE_520_CI: number;
+  UCS2_VIETNAMESE_CI: number;
+  UCS2_GENERAL_MYSQL500_CI: number;
+  UTF32_UNICODE_CI: number;
+  UTF32_ICELANDIC_CI: number;
+  UTF32_LATVIAN_CI: number;
+  UTF32_ROMANIAN_CI: number;
+  UTF32_SLOVENIAN_CI: number;
+  UTF32_POLISH_CI: number;
+  UTF32_ESTONIAN_CI: number;
+  UTF32_SPANISH_CI: number;
+  UTF32_SWEDISH_CI: number;
+  UTF32_TURKISH_CI: number;
+  UTF32_CZECH_CI: number;
+  UTF32_DANISH_CI: number;
+  UTF32_LITHUANIAN_CI: number;
+  UTF32_SLOVAK_CI: number;
+  UTF32_SPANISH2_CI: number;
+  UTF32_ROMAN_CI: number;
+  UTF32_PERSIAN_CI: number;
+  UTF32_ESPERANTO_CI: number;
+  UTF32_HUNGARIAN_CI: number;
+  UTF32_SINHALA_CI: number;
+  UTF32_GERMAN2_CI: number;
+  UTF32_CROATIAN_CI: number;
+  UTF32_UNICODE_520_CI: number;
+  UTF32_VIETNAMESE_CI: number;
+  UTF8_UNICODE_CI: number;
+  UTF8_ICELANDIC_CI: number;
+  UTF8_LATVIAN_CI: number;
+  UTF8_ROMANIAN_CI: number;
+  UTF8_SLOVENIAN_CI: number;
+  UTF8_POLISH_CI: number;
+  UTF8_ESTONIAN_CI: number;
+  UTF8_SPANISH_CI: number;
+  UTF8_SWEDISH_CI: number;
+  UTF8_TURKISH_CI: number;
+  UTF8_CZECH_CI: number;
+  UTF8_DANISH_CI: number;
+  UTF8_LITHUANIAN_CI: number;
+  UTF8_SLOVAK_CI: number;
+  UTF8_SPANISH2_CI: number;
+  UTF8_ROMAN_CI: number;
+  UTF8_PERSIAN_CI: number;
+  UTF8_ESPERANTO_CI: number;
+  UTF8_HUNGARIAN_CI: number;
+  UTF8_SINHALA_CI: number;
+  UTF8_GERMAN2_CI: number;
+  UTF8_CROATIAN_CI: number;
+  UTF8_UNICODE_520_CI: number;
+  UTF8_VIETNAMESE_CI: number;
+  UTF8_GENERAL_MYSQL500_CI: number;
+  UTF8MB4_UNICODE_CI: number;
+  UTF8MB4_ICELANDIC_CI: number;
+  UTF8MB4_LATVIAN_CI: number;
+  UTF8MB4_ROMANIAN_CI: number;
+  UTF8MB4_SLOVENIAN_CI: number;
+  UTF8MB4_POLISH_CI: number;
+  UTF8MB4_ESTONIAN_CI: number;
+  UTF8MB4_SPANISH_CI: number;
+  UTF8MB4_SWEDISH_CI: number;
+  UTF8MB4_TURKISH_CI: number;
+  UTF8MB4_CZECH_CI: number;
+  UTF8MB4_DANISH_CI: number;
+  UTF8MB4_LITHUANIAN_CI: number;
+  UTF8MB4_SLOVAK_CI: number;
+  UTF8MB4_SPANISH2_CI: number;
+  UTF8MB4_ROMAN_CI: number;
+  UTF8MB4_PERSIAN_CI: number;
+  UTF8MB4_ESPERANTO_CI: number;
+  UTF8MB4_HUNGARIAN_CI: number;
+  UTF8MB4_SINHALA_CI: number;
+  UTF8MB4_GERMAN2_CI: number;
+  UTF8MB4_CROATIAN_CI: number;
+  UTF8MB4_UNICODE_520_CI: number;
+  UTF8MB4_VIETNAMESE_CI: number;
+  GB18030_CHINESE_CI: number;
+  GB18030_BIN: number;
+  GB18030_UNICODE_520_CI: number;
+  /** @deprecated */
+  UTF8_GENERAL50_CI: number;
+  UTF8MB4_0900_AI_CI: number;
+  UTF8MB4_DE_PB_0900_AI_CI: number;
+  UTF8MB4_IS_0900_AI_CI: number;
+  UTF8MB4_LV_0900_AI_CI: number;
+  UTF8MB4_RO_0900_AI_CI: number;
+  UTF8MB4_SL_0900_AI_CI: number;
+  UTF8MB4_PL_0900_AI_CI: number;
+  UTF8MB4_ET_0900_AI_CI: number;
+  UTF8MB4_ES_0900_AI_CI: number;
+  UTF8MB4_SV_0900_AI_CI: number;
+  UTF8MB4_TR_0900_AI_CI: number;
+  UTF8MB4_CS_0900_AI_CI: number;
+  UTF8MB4_DA_0900_AI_CI: number;
+  UTF8MB4_LT_0900_AI_CI: number;
+  UTF8MB4_SK_0900_AI_CI: number;
+  UTF8MB4_ES_TRAD_0900_AI_CI: number;
+  UTF8MB4_LA_0900_AI_CI: number;
+  UTF8MB4_EO_0900_AI_CI: number;
+  UTF8MB4_HU_0900_AI_CI: number;
+  UTF8MB4_HR_0900_AI_CI: number;
+  UTF8MB4_VI_0900_AI_CI: number;
+  UTF8MB4_0900_AS_CS: number;
+  UTF8MB4_DE_PB_0900_AS_CS: number;
+  UTF8MB4_IS_0900_AS_CS: number;
+  UTF8MB4_LV_0900_AS_CS: number;
+  UTF8MB4_RO_0900_AS_CS: number;
+  UTF8MB4_SL_0900_AS_CS: number;
+  UTF8MB4_PL_0900_AS_CS: number;
+  UTF8MB4_ET_0900_AS_CS: number;
+  UTF8MB4_ES_0900_AS_CS: number;
+  UTF8MB4_SV_0900_AS_CS: number;
+  UTF8MB4_TR_0900_AS_CS: number;
+  UTF8MB4_CS_0900_AS_CS: number;
+  UTF8MB4_DA_0900_AS_CS: number;
+  UTF8MB4_LT_0900_AS_CS: number;
+  UTF8MB4_SK_0900_AS_CS: number;
+  UTF8MB4_ES_TRAD_0900_AS_CS: number;
+  UTF8MB4_LA_0900_AS_CS: number;
+  UTF8MB4_EO_0900_AS_CS: number;
+  UTF8MB4_HU_0900_AS_CS: number;
+  UTF8MB4_HR_0900_AS_CS: number;
+  UTF8MB4_VI_0900_AS_CS: number;
+  UTF8MB4_JA_0900_AS_CS: number;
+  UTF8MB4_JA_0900_AS_CS_KS: number;
+  UTF8MB4_0900_AS_CI: number;
+  UTF8MB4_RU_0900_AI_CI: number;
+  UTF8MB4_RU_0900_AS_CS: number;
+  UTF8MB4_ZH_0900_AS_CS: number;
+  UTF8MB4_0900_BIN: number;
+
+  BIG5: number;
+  DEC8: number;
+  CP850: number;
+  HP8: number;
+  KOI8R: number;
+  LATIN1: number;
+  LATIN2: number;
+  SWE7: number;
+  ASCII: number;
+  UJIS: number;
+  SJIS: number;
+  HEBREW: number;
+  TIS620: number;
+  EUCKR: number;
+  KOI8U: number;
+  GB2312: number;
+  GREEK: number;
+  CP1250: number;
+  GBK: number;
+  LATIN5: number;
+  ARMSCII8: number;
+  UTF8: number;
+  UCS2: number;
+  CP866: number;
+  KEYBCS2: number;
+  MACCE: number;
+  MACROMAN: number;
+  CP852: number;
+  LATIN7: number;
+  UTF8MB4: number;
+  CP1251: number;
+  UTF16: number;
+  UTF16LE: number;
+  CP1256: number;
+  CP1257: number;
+  UTF32: number;
+  CP932: number;
+  EUCJPMS: number;
+  GB18030: number;
+  GEOSTD8: number;
+}
+
+/**
+ * Constant `Charsets`.
+ *
+ * Please note that `Charsets` can only be accessed from the `mysql` object and not imported directly.
+ */
+declare const Charsets: Charsets;
+
+export { Charsets };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/constants/Types.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/constants/Types.d.ts
new file mode 100644
index 0000000..2719509
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/constants/Types.d.ts	
@@ -0,0 +1,70 @@
+interface Types {
+  0x00: string;
+  0x01: string;
+  0x02: string;
+  0x03: string;
+  0x04: string;
+  0x05: string;
+  0x06: string;
+  0x07: string;
+  0x08: string;
+  0x09: string;
+  0x0a: string;
+  0x0b: string;
+  0x0c: string;
+  0x0d: string;
+  0x0e: string;
+  0x0f: string;
+  0x10: string;
+  0xf2: string;
+  0xf5: string;
+  0xf6: string;
+  0xf7: string;
+  0xf8: string;
+  0xf9: string;
+  0xfa: string;
+  0xfb: string;
+  0xfc: string;
+  0xfd: string;
+  0xfe: string;
+  0xff: string;
+
+  DECIMAL: number;
+  TINY: number;
+  SHORT: number;
+  LONG: number;
+  FLOAT: number;
+  DOUBLE: number;
+  NULL: number;
+  TIMESTAMP: number;
+  LONGLONG: number;
+  INT24: number;
+  DATE: number;
+  TIME: number;
+  DATETIME: number;
+  YEAR: number;
+  NEWDATE: number;
+  VARCHAR: number;
+  BIT: number;
+  VECTOR: number;
+  JSON: number;
+  NEWDECIMAL: number;
+  ENUM: number;
+  SET: number;
+  TINY_BLOB: number;
+  MEDIUM_BLOB: number;
+  LONG_BLOB: number;
+  BLOB: number;
+  VAR_STRING: number;
+  STRING: number;
+  GEOMETRY: number;
+}
+
+/**
+ * Constant `Types`.
+ *
+ * Please note that `Types` can only be accessed from the `mysql` object and not imported directly.
+ */
+declare const Types: Types;
+
+export { Types };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/constants/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/constants/index.d.ts
new file mode 100644
index 0000000..d08ba2c
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/constants/index.d.ts	
@@ -0,0 +1,5 @@
+import { Types } from './Types.js';
+import { Charsets } from './Charsets.js';
+import { CharsetToEncoding } from './CharsetToEncoding.js';
+
+export { Types, Charsets, CharsetToEncoding };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/parsers/ParserCache.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/parsers/ParserCache.d.ts
new file mode 100644
index 0000000..0f1e7fa
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/parsers/ParserCache.d.ts	
@@ -0,0 +1,4 @@
+declare function setMaxParserCache(max: number): void;
+declare function clearParserCache(): void;
+
+export { setMaxParserCache, clearParserCache };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/parsers/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/parsers/index.d.ts
new file mode 100644
index 0000000..734c4d9
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/parsers/index.d.ts	
@@ -0,0 +1,18 @@
+import { setMaxParserCache, clearParserCache } from './ParserCache.js';
+import {
+  TypeCast,
+  Field as TypeCastField,
+  Geometry as TypeCastGeometry,
+  Next as TypeCastNext,
+  Type as TypeCastType,
+} from './typeCast.js';
+
+export {
+  setMaxParserCache,
+  clearParserCache,
+  TypeCast,
+  TypeCastField,
+  TypeCastGeometry,
+  TypeCastNext,
+  TypeCastType,
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/parsers/typeCast.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/parsers/typeCast.d.ts
new file mode 100644
index 0000000..7d62b98
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/parsers/typeCast.d.ts	
@@ -0,0 +1,54 @@
+export type Geometry = {
+  x: number;
+  y: number;
+};
+
+export type Type = {
+  type:
+    | 'DECIMAL'
+    | 'TINY'
+    | 'SHORT'
+    | 'LONG'
+    | 'FLOAT'
+    | 'DOUBLE'
+    | 'NULL'
+    | 'TIMESTAMP'
+    | 'TIMESTAMP2'
+    | 'LONGLONG'
+    | 'INT24'
+    | 'DATE'
+    | 'TIME'
+    | 'TIME2'
+    | 'DATETIME'
+    | 'DATETIME2'
+    | 'YEAR'
+    | 'NEWDATE'
+    | 'VARCHAR'
+    | 'BIT'
+    | 'VECTOR'
+    | 'JSON'
+    | 'NEWDECIMAL'
+    | 'ENUM'
+    | 'SET'
+    | 'TINY_BLOB'
+    | 'MEDIUM_BLOB'
+    | 'LONG_BLOB'
+    | 'BLOB'
+    | 'VAR_STRING'
+    | 'STRING'
+    | 'GEOMETRY';
+};
+
+export type Field = Type & {
+  length: number;
+  db: string;
+  table: string;
+  name: string;
+  string: (encoding?: BufferEncoding | string | undefined) => string | null;
+  buffer: () => Buffer | null;
+  geometry: () => Geometry | Geometry[] | null;
+};
+
+export type Next = () => unknown;
+
+export type TypeCast = ((field: Field, next: Next) => any) | boolean;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/Field.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/Field.d.ts
new file mode 100644
index 0000000..a8c1690
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/Field.d.ts	
@@ -0,0 +1,10 @@
+// TODO (major version): remove workaround for `Field` compatibility.
+import { TypeCastField } from '../../../lib/parsers/index.js';
+
+/**
+ * @deprecated
+ * `Field` is deprecated and might be removed in the future major release. Please use `TypeCastField` type instead.
+ */
+declare interface Field extends TypeCastField {}
+
+export { Field };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/FieldPacket.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/FieldPacket.d.ts
new file mode 100644
index 0000000..7e88669
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/FieldPacket.d.ts	
@@ -0,0 +1,27 @@
+declare interface FieldPacket {
+  constructor: {
+    name: 'FieldPacket';
+  };
+  catalog: string;
+  charsetNr?: number;
+  db?: string;
+  schema?: string;
+  characterSet?: number;
+  decimals: number;
+  default?: any;
+  flags: number | string[];
+  length?: number;
+  name: string;
+  orgName: string;
+  orgTable: string;
+  protocol41?: boolean;
+  table: string;
+  type?: number;
+  columnType?: number;
+  zerofill?: boolean;
+  typeName?: string;
+  encoding?: string;
+  columnLength?: number;
+}
+
+export { FieldPacket };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/OkPacket.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/OkPacket.d.ts
new file mode 100644
index 0000000..056e960
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/OkPacket.d.ts	
@@ -0,0 +1,23 @@
+/**
+ * @deprecated
+ * `OkPacket` is deprecated and might be removed in the future major release. Please use `ResultSetHeader` instead.
+ */
+declare interface OkPacket {
+  constructor: {
+    name: 'OkPacket';
+  };
+  fieldCount: number;
+  affectedRows: number;
+  /**
+   * @deprecated
+   * `changedRows` is deprecated and might be removed in the future major release. Please use `affectedRows` property instead.
+   */
+  changedRows: number;
+  insertId: number;
+  serverStatus: number;
+  warningCount: number;
+  message: string;
+  protocol41: boolean;
+}
+
+export { OkPacket };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/ProcedurePacket.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/ProcedurePacket.d.ts
new file mode 100644
index 0000000..ff5efb6
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/ProcedurePacket.d.ts	
@@ -0,0 +1,13 @@
+import { OkPacket } from './OkPacket.js';
+import { ResultSetHeader } from './ResultSetHeader.js';
+import { RowDataPacket } from './RowDataPacket.js';
+
+declare type ProcedureCallPacket<
+  T = [RowDataPacket[], ResultSetHeader] | ResultSetHeader,
+> = T extends RowDataPacket[]
+  ? [T, ResultSetHeader]
+  : T extends ResultSetHeader | OkPacket
+    ? ResultSetHeader
+    : [RowDataPacket[], ResultSetHeader] | ResultSetHeader;
+
+export { ProcedureCallPacket };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts
new file mode 100644
index 0000000..00b596f
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts	
@@ -0,0 +1,18 @@
+declare interface ResultSetHeader {
+  constructor: {
+    name: 'ResultSetHeader';
+  };
+  affectedRows: number;
+  fieldCount: number;
+  info: string;
+  insertId: number;
+  serverStatus: number;
+  warningStatus: number;
+  /**
+   * @deprecated
+   * `changedRows` is deprecated and might be removed in the future major release. Please use `affectedRows` property instead.
+   */
+  changedRows: number;
+}
+
+export { ResultSetHeader };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/RowDataPacket.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/RowDataPacket.d.ts
new file mode 100644
index 0000000..d9cac1b
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/RowDataPacket.d.ts	
@@ -0,0 +1,9 @@
+declare interface RowDataPacket {
+  constructor: {
+    name: 'RowDataPacket';
+  };
+  [column: string]: any;
+  [column: number]: any;
+}
+
+export { RowDataPacket };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/index.d.ts
new file mode 100644
index 0000000..352abd2
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/index.d.ts	
@@ -0,0 +1,28 @@
+import { OkPacket } from './OkPacket.js';
+import { RowDataPacket } from './RowDataPacket.js';
+import { FieldPacket } from './FieldPacket.js';
+import { Field } from './Field.js';
+import { ProcedureCallPacket } from './ProcedurePacket.js';
+import { ResultSetHeader } from './ResultSetHeader.js';
+import { OkPacketParams } from './params/OkPacketParams.js';
+import { ErrorPacketParams } from './params/ErrorPacketParams.js';
+
+export type QueryResult =
+  | OkPacket
+  | ResultSetHeader
+  | ResultSetHeader[]
+  | RowDataPacket[]
+  | RowDataPacket[][]
+  | OkPacket[]
+  | ProcedureCallPacket;
+
+export {
+  OkPacket,
+  RowDataPacket,
+  FieldPacket,
+  Field,
+  ProcedureCallPacket,
+  ResultSetHeader,
+  OkPacketParams,
+  ErrorPacketParams,
+};
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/ErrorPacketParams.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/ErrorPacketParams.d.ts
new file mode 100644
index 0000000..dece3db
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/ErrorPacketParams.d.ts	
@@ -0,0 +1,6 @@
+declare interface ErrorPacketParams {
+  message?: string;
+  code?: number | string;
+}
+
+export { ErrorPacketParams };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/OkPacketParams.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/OkPacketParams.d.ts
new file mode 100644
index 0000000..a5d2d00
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/OkPacketParams.d.ts	
@@ -0,0 +1,9 @@
+declare interface OkPacketParams {
+  affectedRows?: number;
+  insertId?: number;
+  serverStatus?: number;
+  warningCount?: number;
+  message?: string;
+}
+
+export { OkPacketParams };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts
new file mode 100644
index 0000000..87f5487
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts	
@@ -0,0 +1,41 @@
+import { FieldPacket, QueryResult } from '../packets/index.js';
+import {
+  Query,
+  QueryError,
+  QueryOptions,
+  ExecuteValues,
+  QueryableConstructor,
+} from './Query.js';
+
+export declare function ExecutableBase(
+  Base?: T
+): {
+  new (...args: any[]): {
+    execute(
+      sql: string,
+      callback?:
+        | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)
+        | undefined
+    ): Query;
+    execute(
+      sql: string,
+      values: ExecuteValues,
+      callback?:
+        | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)
+        | undefined
+    ): Query;
+    execute(
+      options: QueryOptions,
+      callback?:
+        | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)
+        | undefined
+    ): Query;
+    execute(
+      options: QueryOptions,
+      values: ExecuteValues,
+      callback?:
+        | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)
+        | undefined
+    ): Query;
+  };
+} & T;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Prepare.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Prepare.d.ts
new file mode 100644
index 0000000..e8c69dc
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Prepare.d.ts	
@@ -0,0 +1,65 @@
+import { Sequence } from './Sequence.js';
+import { Query, QueryError, StreamOptions } from '../sequences/Query.js';
+import {
+  OkPacket,
+  FieldPacket,
+  RowDataPacket,
+  ResultSetHeader,
+} from '../packets/index.js';
+import { Readable } from 'stream';
+
+export class PrepareStatementInfo {
+  close(): void;
+  execute<
+    T extends
+      | RowDataPacket[][]
+      | RowDataPacket[]
+      | OkPacket
+      | OkPacket[]
+      | ResultSetHeader,
+  >(
+    parameters: any | any[] | { [param: string]: any },
+    callback?: (err: QueryError | null, result: T, fields: FieldPacket[]) => any
+  ): Query;
+}
+
+declare class Prepare extends Sequence {
+  /**
+   * The SQL for a constructed query
+   */
+  sql: string;
+
+  /**
+   * Emits a query packet to start the query
+   */
+  start(): void;
+
+  /**
+   * Determines the packet class to use given the first byte of the packet.
+   *
+   * @param firstByte The first byte of the packet
+   * @param parser The packet parser
+   */
+  determinePacket(firstByte: number, parser: any): any;
+
+  /**
+   * Creates a Readable stream with the given options
+   *
+   * @param options The options for the stream.
+   */
+  stream(options?: StreamOptions): Readable;
+
+  on(event: string, listener: (args: []) => void): this;
+  on(event: 'error', listener: (err: QueryError) => any): this;
+  on(
+    event: 'fields',
+    listener: (fields: FieldPacket, index: number) => any
+  ): this;
+  on(
+    event: 'result',
+    listener: (result: RowDataPacket | OkPacket, index: number) => any
+  ): this;
+  on(event: 'end', listener: () => any): this;
+}
+
+export { Prepare };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Query.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Query.d.ts
new file mode 100644
index 0000000..1762263
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Query.d.ts	
@@ -0,0 +1,228 @@
+import { Sequence } from './Sequence.js';
+import { OkPacket, RowDataPacket, FieldPacket } from '../packets/index.js';
+import { Readable } from 'stream';
+import { Raw, Timezone } from 'sql-escaper';
+import { TypeCast } from '../../parsers/typeCast.js';
+
+export type ExecuteValues =
+  | string
+  | number
+  | bigint
+  | boolean
+  | Date
+  | null
+  | Blob
+  | Buffer
+  | Uint8Array
+  | ExecuteValues[]
+  | { [key: string]: ExecuteValues };
+
+export type QueryValues =
+  | string
+  | number
+  | bigint
+  | boolean
+  | Date
+  | null
+  | undefined
+  | Blob
+  | Buffer
+  | Uint8Array
+  | Raw
+  | ({} | null | undefined)[]
+  | { [key: string]: QueryValues };
+
+export interface QueryOptions {
+  /**
+   * The SQL for the query
+   */
+  sql: string;
+
+  /**
+   * The values for the query
+   */
+  values?: QueryValues;
+
+  /**
+   * This overrides the namedPlaceholders option set at the connection level.
+   */
+  namedPlaceholders?: boolean;
+
+  /**
+   * Every operation takes an optional inactivity timeout option. This allows you to specify appropriate timeouts for
+   * operations. It is important to note that these timeouts are not part of the MySQL protocol, and rather timeout
+   * operations through the client. This means that when a timeout is reached, the connection it occurred on will be
+   * destroyed and no further operations can be performed.
+   */
+  timeout?: number;
+
+  /**
+   * Either a boolean or string. If true, tables will be nested objects. If string (e.g. '_'), tables will be
+   * nested as tableName_fieldName
+   */
+  nestTables?: any;
+
+  /**
+   * Determines if column values should be converted to native JavaScript types.
+   *
+   * @default true
+   *
+   * It is not recommended (and may go away / change in the future) to disable type casting, but you can currently do so on either the connection or query level.
+   *
+   * ---
+   *
+   * You can also specify a function to do the type casting yourself:
+   * ```ts
+   * (field: Field, next: () => unknown) => {
+   *   return next();
+   * }
+   * ```
+   *
+   * ---
+   *
+   * **WARNING:**
+   *
+   * YOU MUST INVOKE the parser using one of these three field functions in your custom typeCast callback. They can only be called once:
+   *
+   * ```js
+   * field.string();
+   * field.buffer();
+   * field.geometry();
+   * ```
+
+   * Which are aliases for:
+   *
+   * ```js
+   * parser.parseLengthCodedString();
+   * parser.parseLengthCodedBuffer();
+   * parser.parseGeometryValue();
+   * ```
+   *
+   * You can find which field function you need to use by looking at `RowDataPacket.prototype._typeCast`.
+   */
+  typeCast?: TypeCast;
+
+  /**
+   * This overrides the same option set at the connection level.
+   *
+   */
+  rowsAsArray?: boolean;
+
+  /**
+   * By specifying a function that returns a readable stream, an arbitrary stream can be sent when sending a local fs file.
+   */
+  infileStreamFactory?: (path: string) => Readable;
+
+  /**
+   * When dealing with big numbers (BIGINT and DECIMAL columns) in the database, you should enable this option
+   * (Default: false)
+   */
+  supportBigNumbers?: boolean;
+
+  /**
+   * Enabling both supportBigNumbers and bigNumberStrings forces big numbers (BIGINT and DECIMAL columns) to be
+   * always returned as JavaScript String objects (Default: false). Enabling supportBigNumbers but leaving
+   * bigNumberStrings disabled will return big numbers as String objects only when they cannot be accurately
+   * represented with JavaScript Number objects (which happens when they exceed the [-2^53, +2^53] range),
+   * otherwise they will be returned as Number objects.
+   * This option is ignored if supportBigNumbers is disabled.
+   */
+  bigNumberStrings?: boolean;
+
+  /**
+   * Force date types (TIMESTAMP, DATETIME, DATE) to be returned as strings rather then inflated into JavaScript Date
+   * objects. Can be true/false or an array of type names to keep as strings.
+   *
+   * (Default: false)
+   */
+  dateStrings?: boolean | Array<'TIMESTAMP' | 'DATETIME' | 'DATE'>;
+
+  /**
+   * The timezone used to store local dates. (Default: 'local')
+   */
+  timezone?: Timezone;
+}
+
+export interface StreamOptions {
+  /**
+   * Sets the max buffer size in objects of a stream
+   */
+  highWaterMark?: number;
+
+  /**
+   * The object mode of the stream is always set to `true`
+   */
+  objectMode?: true;
+}
+
+export interface QueryError extends NodeJS.ErrnoException {
+  /**
+   * Either a MySQL server error (e.g. 'ER_ACCESS_DENIED_ERROR'),
+   * a node.js error (e.g. 'ECONNREFUSED') or an internal error
+   * (e.g. 'PROTOCOL_CONNECTION_LOST').
+   */
+  code: string;
+
+  /**
+   * The sql state marker
+   */
+  sqlStateMarker?: string;
+
+  /**
+   * The sql state
+   */
+  sqlState?: string;
+
+  /**
+   * The field count
+   */
+  fieldCount?: number;
+
+  /**
+   * Boolean, indicating if this error is terminal to the connection object.
+   */
+  fatal: boolean;
+}
+
+declare class Query extends Sequence {
+  /**
+   * The SQL for a constructed query
+   */
+  sql: string;
+
+  /**
+   * Emits a query packet to start the query
+   */
+  start(): void;
+
+  /**
+   * Determines the packet class to use given the first byte of the packet.
+   *
+   * @param firstByte The first byte of the packet
+   * @param parser The packet parser
+   */
+  determinePacket(firstByte: number, parser: any): any;
+
+  /**
+   * Creates a Readable stream with the given options
+   *
+   * @param options The options for the stream.
+   */
+  stream(options?: StreamOptions): Readable;
+
+  on(event: string, listener: (...args: any[]) => void): this;
+  on(event: 'error', listener: (err: QueryError) => any): this;
+  on(
+    event: 'fields',
+    listener: (fields: FieldPacket, index: number) => any
+  ): this;
+  on(
+    event: 'result',
+    listener: (result: RowDataPacket | OkPacket, index: number) => any
+  ): this;
+  on(event: 'end', listener: () => any): this;
+}
+
+export type QueryableConstructor = new (...args: any[]) => T;
+
+export { Query };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/QueryableBase.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/QueryableBase.d.ts
new file mode 100644
index 0000000..8675146
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/QueryableBase.d.ts	
@@ -0,0 +1,41 @@
+import { FieldPacket, QueryResult } from '../packets/index.js';
+import {
+  Query,
+  QueryError,
+  QueryOptions,
+  QueryValues,
+  QueryableConstructor,
+} from './Query.js';
+
+export declare function QueryableBase(
+  Base?: T
+): {
+  new (...args: any[]): {
+    query(
+      sql: string,
+      callback?:
+        | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)
+        | undefined
+    ): Query;
+    query(
+      sql: string,
+      values: QueryValues,
+      callback?:
+        | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)
+        | undefined
+    ): Query;
+    query(
+      options: QueryOptions,
+      callback?:
+        | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)
+        | undefined
+    ): Query;
+    query(
+      options: QueryOptions,
+      values: QueryValues,
+      callback?:
+        | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)
+        | undefined
+    ): Query;
+  };
+} & T;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Sequence.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Sequence.d.ts
new file mode 100644
index 0000000..05c91c3
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Sequence.d.ts	
@@ -0,0 +1,5 @@
+import { EventEmitter } from 'events';
+
+declare class Sequence extends EventEmitter {}
+
+export { Sequence };
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts
new file mode 100644
index 0000000..bbf1e0a
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts	
@@ -0,0 +1,17 @@
+import { FieldPacket, QueryResult } from '../../packets/index.js';
+import { QueryOptions, QueryableConstructor, ExecuteValues } from '../Query.js';
+
+export declare function ExecutableBase(
+  Base?: T
+): {
+  new (...args: any[]): {
+    execute(
+      sql: string,
+      values?: ExecuteValues
+    ): Promise<[T, FieldPacket[]]>;
+    execute(
+      options: QueryOptions,
+      values?: ExecuteValues
+    ): Promise<[T, FieldPacket[]]>;
+  };
+} & T;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts
new file mode 100644
index 0000000..c05f706
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts	
@@ -0,0 +1,18 @@
+import { FieldPacket, QueryResult } from '../../packets/index.js';
+import { QueryOptions, QueryValues, QueryableConstructor } from '../Query.js';
+
+export declare function QueryableBase(
+  Base?: T
+): {
+  new (...args: any[]): {
+    query(
+      sql: string,
+      values?: QueryValues
+    ): Promise<[T, FieldPacket[]]>;
+
+    query(
+      options: QueryOptions,
+      values?: QueryValues
+    ): Promise<[T, FieldPacket[]]>;
+  };
+} & T;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/named-placeholders/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/named-placeholders/LICENSE
new file mode 100644
index 0000000..bc0223f
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/named-placeholders/LICENSE	
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Andrey Sidorov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/named-placeholders/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/named-placeholders/README.md
new file mode 100644
index 0000000..f952730
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/named-placeholders/README.md	
@@ -0,0 +1,27 @@
+[![NPM](https://nodei.co/npm/named-placeholders.png?downloads=true&stars=true)](https://nodei.co/npm/named-placeholders/)
+
+[![CI](https://github.com/mysqljs/named-placeholders/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/mysqljs/named-placeholders/actions/workflows/ci.yml)
+
+# named-placeholders
+
+compiles "select foo where foo.id = :bar and foo.baz < :baz" into "select foo where foo.id = ? and foo.baz < ?" + ["bar", "baz"]
+
+## usage
+
+```sh
+npm install named-placeholders
+```
+
+see [this mysql2 discussion](https://github.com/sidorares/node-mysql2/issues/117)
+
+```js
+var mysql = require('mysql');
+var toUnnamed = require('named-placeholders')();
+
+var q = toUnnamed('select 1+:test', { test: 123 });
+mysql.createConnection().query(q[0], q[1]);
+```
+
+## credits
+
+parser is based on @mscdex code of his excellent [node-mariasql](https://github.com/mscdex/node-mariasql) library
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/named-placeholders/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/named-placeholders/index.js
new file mode 100644
index 0000000..aff6c3d
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/named-placeholders/index.js	
@@ -0,0 +1,179 @@
+'use strict';
+
+// based on code from Brian White @mscdex mariasql library - https://github.com/mscdex/node-mariasql/blob/master/lib/Client.js#L272-L332
+// License: https://github.com/mscdex/node-mariasql/blob/master/LICENSE
+
+const RE_PARAM = /(?:\?)|(?::(\d+|(?:[a-zA-Z][a-zA-Z0-9_]*)))/g,
+  DQUOTE = 34,
+  SQUOTE = 39,
+  BSLASH = 92;
+
+function parse(query) {
+  let ppos = RE_PARAM.exec(query);
+  let curpos = 0;
+  let start = 0;
+  let end;
+  const parts = [];
+  let inQuote = false;
+  let escape = false;
+  let qchr;
+  const tokens = [];
+  let qcnt = 0;
+  let lastTokenEndPos = 0;
+  let i;
+
+  if (ppos) {
+    do {
+      for (i = curpos, end = ppos.index; i < end; ++i) {
+        const chr = query.charCodeAt(i);
+        if (chr === BSLASH) escape = !escape;
+        else {
+          if (escape) {
+            escape = false;
+            continue;
+          }
+          if (inQuote && chr === qchr) {
+            if (query.charCodeAt(i + 1) === qchr) {
+              // quote escaped via "" or ''
+              ++i;
+              continue;
+            }
+            inQuote = false;
+          } else if (!inQuote && (chr === DQUOTE || chr === SQUOTE)) {
+            inQuote = true;
+            qchr = chr;
+          }
+        }
+      }
+      if (!inQuote) {
+        parts.push(query.substring(start, end));
+        tokens.push(ppos[0].length === 1 ? qcnt++ : ppos[1]);
+        start = end + ppos[0].length;
+        lastTokenEndPos = start;
+      }
+      curpos = end + ppos[0].length;
+    } while ((ppos = RE_PARAM.exec(query)));
+
+    if (tokens.length) {
+      if (curpos < query.length) {
+        parts.push(query.substring(lastTokenEndPos));
+      }
+      return [parts, tokens];
+    }
+  }
+  return [query];
+}
+
+function createCompiler(config) {
+  if (!config) config = {};
+  if (!config.placeholder) {
+    config.placeholder = '?';
+  }
+  let ncache = 100;
+  let cache;
+  if (typeof config.cache === 'number') {
+    ncache = config.cache;
+  }
+  if (typeof config.cache === 'object') {
+    cache = config.cache;
+  }
+  if (config.cache !== false && !cache) {
+    cache = require('lru.min').createLRU({ max: ncache });
+  }
+
+  function toArrayParams(tree, params) {
+    const arr = [];
+    if (tree.length === 1) {
+      return [tree[0], []];
+    }
+
+    if (typeof params === 'undefined')
+      throw new Error(
+        'Named query contains placeholders, but parameters object is undefined'
+      );
+
+    const tokens = tree[1];
+    for (let i = 0; i < tokens.length; ++i) {
+      arr.push(params[tokens[i]]);
+    }
+    return [tree[0], arr];
+  }
+
+  function noTailingSemicolon(s) {
+    if (s.slice(-1) === ':') {
+      return s.slice(0, -1);
+    }
+    return s;
+  }
+
+  function join(tree) {
+    if (tree.length === 1) {
+      return tree;
+    }
+
+    let unnamed = noTailingSemicolon(tree[0][0]);
+    for (let i = 1; i < tree[0].length; ++i) {
+      if (tree[0][i - 1].slice(-1) === ':') {
+        unnamed += config.placeholder;
+      }
+      unnamed += config.placeholder;
+      unnamed += noTailingSemicolon(tree[0][i]);
+    }
+
+    const last = tree[0][tree[0].length - 1];
+    if (tree[0].length === tree[1].length) {
+      if (last.slice(-1) === ':') {
+        unnamed += config.placeholder;
+      }
+      unnamed += config.placeholder;
+    }
+    return [unnamed, tree[1]];
+  }
+
+  function compile(query, paramsObj) {
+    let tree;
+    if (cache && (tree = cache.get(query))) {
+      return toArrayParams(tree, paramsObj);
+    }
+    tree = join(parse(query));
+    if (cache) {
+      cache.set(query, tree);
+    }
+    return toArrayParams(tree, paramsObj);
+  }
+
+  compile.parse = parse;
+  return compile;
+}
+
+// named :one :two to postgres-style numbered $1 $2 $3
+function toNumbered(q, params) {
+  const tree = parse(q);
+  const paramsArr = [];
+  if (tree.length === 1) {
+    return [tree[0], paramsArr];
+  }
+
+  const pIndexes = {};
+  let pLastIndex = 0;
+  let qs = '';
+  let varIndex;
+  const varNames = [];
+  for (let i = 0; i < tree[0].length; ++i) {
+    varIndex = pIndexes[tree[1][i]];
+    if (!varIndex) {
+      varIndex = ++pLastIndex;
+      pIndexes[tree[1][i]] = varIndex;
+    }
+    if (tree[1][i]) {
+      varNames[varIndex - 1] = tree[1][i];
+      qs += `${tree[0][i]}$${varIndex}`;
+    } else {
+      qs += tree[0][i];
+    }
+  }
+  return [qs, varNames.map((n) => params[n])];
+}
+
+module.exports = createCompiler;
+module.exports.toNumbered = toNumbered;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/named-placeholders/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/named-placeholders/package.json
new file mode 100644
index 0000000..f555241
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/named-placeholders/package.json	
@@ -0,0 +1,36 @@
+{
+  "name": "named-placeholders",
+  "version": "1.1.6",
+  "description": "sql named placeholders to unnamed compiler",
+  "main": "index.js",
+  "scripts": {
+    "test": "node --test",
+    "lint": "biome lint --error-on-warnings && prettier --check .",
+    "lint:fix": "biome lint --write && prettier --write .github/workflows/*.yml ."
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/mysqljs/named-placeholders"
+  },
+  "keywords": [
+    "sql",
+    "pdo",
+    "named",
+    "placeholders",
+    "mysql",
+    "postgres"
+  ],
+  "engines": {
+    "node": ">=8.0.0"
+  },
+  "author": "Andrey Sidorov ",
+  "files": [],
+  "license": "MIT",
+  "dependencies": {
+    "lru.min": "^1.1.0"
+  },
+  "devDependencies": {
+    "@biomejs/biome": "^2.3.8",
+    "prettier": "^3.7.4"
+  }
+}
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/HISTORY.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/HISTORY.md
new file mode 100644
index 0000000..63d537d
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/HISTORY.md	
@@ -0,0 +1,114 @@
+1.0.0 / 2024-08-31
+==================
+
+  * Drop support for node <18
+  * Added an option preferred encodings array #59
+
+0.6.3 / 2022-01-22
+==================
+
+  * Revert "Lazy-load modules from main entry point"
+
+0.6.2 / 2019-04-29
+==================
+
+  * Fix sorting charset, encoding, and language with extra parameters
+
+0.6.1 / 2016-05-02
+==================
+
+  * perf: improve `Accept` parsing speed
+  * perf: improve `Accept-Charset` parsing speed
+  * perf: improve `Accept-Encoding` parsing speed
+  * perf: improve `Accept-Language` parsing speed
+
+0.6.0 / 2015-09-29
+==================
+
+  * Fix including type extensions in parameters in `Accept` parsing
+  * Fix parsing `Accept` parameters with quoted equals
+  * Fix parsing `Accept` parameters with quoted semicolons
+  * Lazy-load modules from main entry point
+  * perf: delay type concatenation until needed
+  * perf: enable strict mode
+  * perf: hoist regular expressions
+  * perf: remove closures getting spec properties
+  * perf: remove a closure from media type parsing
+  * perf: remove property delete from media type parsing
+
+0.5.3 / 2015-05-10
+==================
+
+  * Fix media type parameter matching to be case-insensitive
+
+0.5.2 / 2015-05-06
+==================
+
+  * Fix comparing media types with quoted values
+  * Fix splitting media types with quoted commas
+
+0.5.1 / 2015-02-14
+==================
+
+  * Fix preference sorting to be stable for long acceptable lists
+
+0.5.0 / 2014-12-18
+==================
+
+  * Fix list return order when large accepted list
+  * Fix missing identity encoding when q=0 exists
+  * Remove dynamic building of Negotiator class
+
+0.4.9 / 2014-10-14
+==================
+
+  * Fix error when media type has invalid parameter
+
+0.4.8 / 2014-09-28
+==================
+
+  * Fix all negotiations to be case-insensitive
+  * Stable sort preferences of same quality according to client order
+  * Support Node.js 0.6
+
+0.4.7 / 2014-06-24
+==================
+
+  * Handle invalid provided languages
+  * Handle invalid provided media types
+
+0.4.6 / 2014-06-11
+==================
+
+  *  Order by specificity when quality is the same
+
+0.4.5 / 2014-05-29
+==================
+
+  * Fix regression in empty header handling
+
+0.4.4 / 2014-05-29
+==================
+
+  * Fix behaviors when headers are not present
+
+0.4.3 / 2014-04-16
+==================
+
+  * Handle slashes on media params correctly
+
+0.4.2 / 2014-02-28
+==================
+
+  * Fix media type sorting
+  * Handle media types params strictly
+
+0.4.1 / 2014-01-16
+==================
+
+  * Use most specific matches
+
+0.4.0 / 2014-01-09
+==================
+
+  * Remove preferred prefix from methods
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/LICENSE
new file mode 100644
index 0000000..ea6b9e2
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/LICENSE	
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2012-2014 Federico Romero
+Copyright (c) 2012-2014 Isaac Z. Schlueter
+Copyright (c) 2014-2015 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/README.md
new file mode 100644
index 0000000..6fb7f2d
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/README.md	
@@ -0,0 +1,212 @@
+# negotiator
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][github-actions-ci-image]][github-actions-ci-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+An HTTP content negotiator for Node.js
+
+## Installation
+
+```sh
+$ npm install negotiator
+```
+
+## API
+
+```js
+var Negotiator = require('negotiator')
+```
+
+### Accept Negotiation
+
+```js
+availableMediaTypes = ['text/html', 'text/plain', 'application/json']
+
+// The negotiator constructor receives a request object
+negotiator = new Negotiator(request)
+
+// Let's say Accept header is 'text/html, application/*;q=0.2, image/jpeg;q=0.8'
+
+negotiator.mediaTypes()
+// -> ['text/html', 'image/jpeg', 'application/*']
+
+negotiator.mediaTypes(availableMediaTypes)
+// -> ['text/html', 'application/json']
+
+negotiator.mediaType(availableMediaTypes)
+// -> 'text/html'
+```
+
+You can check a working example at `examples/accept.js`.
+
+#### Methods
+
+##### mediaType()
+
+Returns the most preferred media type from the client.
+
+##### mediaType(availableMediaType)
+
+Returns the most preferred media type from a list of available media types.
+
+##### mediaTypes()
+
+Returns an array of preferred media types ordered by the client preference.
+
+##### mediaTypes(availableMediaTypes)
+
+Returns an array of preferred media types ordered by priority from a list of
+available media types.
+
+### Accept-Language Negotiation
+
+```js
+negotiator = new Negotiator(request)
+
+availableLanguages = ['en', 'es', 'fr']
+
+// Let's say Accept-Language header is 'en;q=0.8, es, pt'
+
+negotiator.languages()
+// -> ['es', 'pt', 'en']
+
+negotiator.languages(availableLanguages)
+// -> ['es', 'en']
+
+language = negotiator.language(availableLanguages)
+// -> 'es'
+```
+
+You can check a working example at `examples/language.js`.
+
+#### Methods
+
+##### language()
+
+Returns the most preferred language from the client.
+
+##### language(availableLanguages)
+
+Returns the most preferred language from a list of available languages.
+
+##### languages()
+
+Returns an array of preferred languages ordered by the client preference.
+
+##### languages(availableLanguages)
+
+Returns an array of preferred languages ordered by priority from a list of
+available languages.
+
+### Accept-Charset Negotiation
+
+```js
+availableCharsets = ['utf-8', 'iso-8859-1', 'iso-8859-5']
+
+negotiator = new Negotiator(request)
+
+// Let's say Accept-Charset header is 'utf-8, iso-8859-1;q=0.8, utf-7;q=0.2'
+
+negotiator.charsets()
+// -> ['utf-8', 'iso-8859-1', 'utf-7']
+
+negotiator.charsets(availableCharsets)
+// -> ['utf-8', 'iso-8859-1']
+
+negotiator.charset(availableCharsets)
+// -> 'utf-8'
+```
+
+You can check a working example at `examples/charset.js`.
+
+#### Methods
+
+##### charset()
+
+Returns the most preferred charset from the client.
+
+##### charset(availableCharsets)
+
+Returns the most preferred charset from a list of available charsets.
+
+##### charsets()
+
+Returns an array of preferred charsets ordered by the client preference.
+
+##### charsets(availableCharsets)
+
+Returns an array of preferred charsets ordered by priority from a list of
+available charsets.
+
+### Accept-Encoding Negotiation
+
+```js
+availableEncodings = ['identity', 'gzip']
+
+negotiator = new Negotiator(request)
+
+// Let's say Accept-Encoding header is 'gzip, compress;q=0.2, identity;q=0.5'
+
+negotiator.encodings()
+// -> ['gzip', 'identity', 'compress']
+
+negotiator.encodings(availableEncodings)
+// -> ['gzip', 'identity']
+
+negotiator.encoding(availableEncodings)
+// -> 'gzip'
+```
+
+You can check a working example at `examples/encoding.js`.
+
+#### Methods
+
+##### encoding()
+
+Returns the most preferred encoding from the client.
+
+##### encoding(availableEncodings)
+
+Returns the most preferred encoding from a list of available encodings.
+
+##### encoding(availableEncodings, { preferred })
+
+Returns the most preferred encoding from a list of available encodings, while prioritizing based on `preferred` array between same-quality encodings.
+
+##### encodings()
+
+Returns an array of preferred encodings ordered by the client preference.
+
+##### encodings(availableEncodings)
+
+Returns an array of preferred encodings ordered by priority from a list of
+available encodings.
+
+##### encodings(availableEncodings, { preferred })
+
+Returns an array of preferred encodings ordered by priority from a list of
+available encodings, while prioritizing based on `preferred` array between same-quality encodings.
+
+## See Also
+
+The [accepts](https://npmjs.org/package/accepts#readme) module builds on
+this module and provides an alternative interface, mime type validation,
+and more.
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/negotiator.svg
+[npm-url]: https://npmjs.org/package/negotiator
+[node-version-image]: https://img.shields.io/node/v/negotiator.svg
+[node-version-url]: https://nodejs.org/en/download/
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/negotiator/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/negotiator?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/negotiator.svg
+[downloads-url]: https://npmjs.org/package/negotiator
+[github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/negotiator/ci/master?label=ci
+[github-actions-ci-url]: https://github.com/jshttp/negotiator/actions/workflows/ci.yml
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/index.js
new file mode 100644
index 0000000..4f51315
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/index.js	
@@ -0,0 +1,83 @@
+/*!
+ * negotiator
+ * Copyright(c) 2012 Federico Romero
+ * Copyright(c) 2012-2014 Isaac Z. Schlueter
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+var preferredCharsets = require('./lib/charset')
+var preferredEncodings = require('./lib/encoding')
+var preferredLanguages = require('./lib/language')
+var preferredMediaTypes = require('./lib/mediaType')
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = Negotiator;
+module.exports.Negotiator = Negotiator;
+
+/**
+ * Create a Negotiator instance from a request.
+ * @param {object} request
+ * @public
+ */
+
+function Negotiator(request) {
+  if (!(this instanceof Negotiator)) {
+    return new Negotiator(request);
+  }
+
+  this.request = request;
+}
+
+Negotiator.prototype.charset = function charset(available) {
+  var set = this.charsets(available);
+  return set && set[0];
+};
+
+Negotiator.prototype.charsets = function charsets(available) {
+  return preferredCharsets(this.request.headers['accept-charset'], available);
+};
+
+Negotiator.prototype.encoding = function encoding(available, opts) {
+  var set = this.encodings(available, opts);
+  return set && set[0];
+};
+
+Negotiator.prototype.encodings = function encodings(available, options) {
+  var opts = options || {};
+  return preferredEncodings(this.request.headers['accept-encoding'], available, opts.preferred);
+};
+
+Negotiator.prototype.language = function language(available) {
+  var set = this.languages(available);
+  return set && set[0];
+};
+
+Negotiator.prototype.languages = function languages(available) {
+  return preferredLanguages(this.request.headers['accept-language'], available);
+};
+
+Negotiator.prototype.mediaType = function mediaType(available) {
+  var set = this.mediaTypes(available);
+  return set && set[0];
+};
+
+Negotiator.prototype.mediaTypes = function mediaTypes(available) {
+  return preferredMediaTypes(this.request.headers.accept, available);
+};
+
+// Backwards compatibility
+Negotiator.prototype.preferredCharset = Negotiator.prototype.charset;
+Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets;
+Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding;
+Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings;
+Negotiator.prototype.preferredLanguage = Negotiator.prototype.language;
+Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages;
+Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType;
+Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes;
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/lib/charset.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/lib/charset.js
new file mode 100644
index 0000000..cdd0148
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/lib/charset.js	
@@ -0,0 +1,169 @@
+/**
+ * negotiator
+ * Copyright(c) 2012 Isaac Z. Schlueter
+ * Copyright(c) 2014 Federico Romero
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = preferredCharsets;
+module.exports.preferredCharsets = preferredCharsets;
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/;
+
+/**
+ * Parse the Accept-Charset header.
+ * @private
+ */
+
+function parseAcceptCharset(accept) {
+  var accepts = accept.split(',');
+
+  for (var i = 0, j = 0; i < accepts.length; i++) {
+    var charset = parseCharset(accepts[i].trim(), i);
+
+    if (charset) {
+      accepts[j++] = charset;
+    }
+  }
+
+  // trim accepts
+  accepts.length = j;
+
+  return accepts;
+}
+
+/**
+ * Parse a charset from the Accept-Charset header.
+ * @private
+ */
+
+function parseCharset(str, i) {
+  var match = simpleCharsetRegExp.exec(str);
+  if (!match) return null;
+
+  var charset = match[1];
+  var q = 1;
+  if (match[2]) {
+    var params = match[2].split(';')
+    for (var j = 0; j < params.length; j++) {
+      var p = params[j].trim().split('=');
+      if (p[0] === 'q') {
+        q = parseFloat(p[1]);
+        break;
+      }
+    }
+  }
+
+  return {
+    charset: charset,
+    q: q,
+    i: i
+  };
+}
+
+/**
+ * Get the priority of a charset.
+ * @private
+ */
+
+function getCharsetPriority(charset, accepted, index) {
+  var priority = {o: -1, q: 0, s: 0};
+
+  for (var i = 0; i < accepted.length; i++) {
+    var spec = specify(charset, accepted[i], index);
+
+    if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
+      priority = spec;
+    }
+  }
+
+  return priority;
+}
+
+/**
+ * Get the specificity of the charset.
+ * @private
+ */
+
+function specify(charset, spec, index) {
+  var s = 0;
+  if(spec.charset.toLowerCase() === charset.toLowerCase()){
+    s |= 1;
+  } else if (spec.charset !== '*' ) {
+    return null
+  }
+
+  return {
+    i: index,
+    o: spec.i,
+    q: spec.q,
+    s: s
+  }
+}
+
+/**
+ * Get the preferred charsets from an Accept-Charset header.
+ * @public
+ */
+
+function preferredCharsets(accept, provided) {
+  // RFC 2616 sec 14.2: no header = *
+  var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');
+
+  if (!provided) {
+    // sorted list of all charsets
+    return accepts
+      .filter(isQuality)
+      .sort(compareSpecs)
+      .map(getFullCharset);
+  }
+
+  var priorities = provided.map(function getPriority(type, index) {
+    return getCharsetPriority(type, accepts, index);
+  });
+
+  // sorted list of accepted charsets
+  return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {
+    return provided[priorities.indexOf(priority)];
+  });
+}
+
+/**
+ * Compare two specs.
+ * @private
+ */
+
+function compareSpecs(a, b) {
+  return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;
+}
+
+/**
+ * Get full charset string.
+ * @private
+ */
+
+function getFullCharset(spec) {
+  return spec.charset;
+}
+
+/**
+ * Check if a spec has any quality.
+ * @private
+ */
+
+function isQuality(spec) {
+  return spec.q > 0;
+}
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/lib/encoding.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/lib/encoding.js
new file mode 100644
index 0000000..9ebb633
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/lib/encoding.js	
@@ -0,0 +1,205 @@
+/**
+ * negotiator
+ * Copyright(c) 2012 Isaac Z. Schlueter
+ * Copyright(c) 2014 Federico Romero
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = preferredEncodings;
+module.exports.preferredEncodings = preferredEncodings;
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/;
+
+/**
+ * Parse the Accept-Encoding header.
+ * @private
+ */
+
+function parseAcceptEncoding(accept) {
+  var accepts = accept.split(',');
+  var hasIdentity = false;
+  var minQuality = 1;
+
+  for (var i = 0, j = 0; i < accepts.length; i++) {
+    var encoding = parseEncoding(accepts[i].trim(), i);
+
+    if (encoding) {
+      accepts[j++] = encoding;
+      hasIdentity = hasIdentity || specify('identity', encoding);
+      minQuality = Math.min(minQuality, encoding.q || 1);
+    }
+  }
+
+  if (!hasIdentity) {
+    /*
+     * If identity doesn't explicitly appear in the accept-encoding header,
+     * it's added to the list of acceptable encoding with the lowest q
+     */
+    accepts[j++] = {
+      encoding: 'identity',
+      q: minQuality,
+      i: i
+    };
+  }
+
+  // trim accepts
+  accepts.length = j;
+
+  return accepts;
+}
+
+/**
+ * Parse an encoding from the Accept-Encoding header.
+ * @private
+ */
+
+function parseEncoding(str, i) {
+  var match = simpleEncodingRegExp.exec(str);
+  if (!match) return null;
+
+  var encoding = match[1];
+  var q = 1;
+  if (match[2]) {
+    var params = match[2].split(';');
+    for (var j = 0; j < params.length; j++) {
+      var p = params[j].trim().split('=');
+      if (p[0] === 'q') {
+        q = parseFloat(p[1]);
+        break;
+      }
+    }
+  }
+
+  return {
+    encoding: encoding,
+    q: q,
+    i: i
+  };
+}
+
+/**
+ * Get the priority of an encoding.
+ * @private
+ */
+
+function getEncodingPriority(encoding, accepted, index) {
+  var priority = {encoding: encoding, o: -1, q: 0, s: 0};
+
+  for (var i = 0; i < accepted.length; i++) {
+    var spec = specify(encoding, accepted[i], index);
+
+    if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
+      priority = spec;
+    }
+  }
+
+  return priority;
+}
+
+/**
+ * Get the specificity of the encoding.
+ * @private
+ */
+
+function specify(encoding, spec, index) {
+  var s = 0;
+  if(spec.encoding.toLowerCase() === encoding.toLowerCase()){
+    s |= 1;
+  } else if (spec.encoding !== '*' ) {
+    return null
+  }
+
+  return {
+    encoding: encoding,
+    i: index,
+    o: spec.i,
+    q: spec.q,
+    s: s
+  }
+};
+
+/**
+ * Get the preferred encodings from an Accept-Encoding header.
+ * @public
+ */
+
+function preferredEncodings(accept, provided, preferred) {
+  var accepts = parseAcceptEncoding(accept || '');
+
+  var comparator = preferred ? function comparator (a, b) {
+    if (a.q !== b.q) {
+      return b.q - a.q // higher quality first
+    }
+
+    var aPreferred = preferred.indexOf(a.encoding)
+    var bPreferred = preferred.indexOf(b.encoding)
+
+    if (aPreferred === -1 && bPreferred === -1) {
+      // consider the original specifity/order
+      return (b.s - a.s) || (a.o - b.o) || (a.i - b.i)
+    }
+
+    if (aPreferred !== -1 && bPreferred !== -1) {
+      return aPreferred - bPreferred // consider the preferred order
+    }
+
+    return aPreferred === -1 ? 1 : -1 // preferred first
+  } : compareSpecs;
+
+  if (!provided) {
+    // sorted list of all encodings
+    return accepts
+      .filter(isQuality)
+      .sort(comparator)
+      .map(getFullEncoding);
+  }
+
+  var priorities = provided.map(function getPriority(type, index) {
+    return getEncodingPriority(type, accepts, index);
+  });
+
+  // sorted list of accepted encodings
+  return priorities.filter(isQuality).sort(comparator).map(function getEncoding(priority) {
+    return provided[priorities.indexOf(priority)];
+  });
+}
+
+/**
+ * Compare two specs.
+ * @private
+ */
+
+function compareSpecs(a, b) {
+  return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i);
+}
+
+/**
+ * Get full encoding string.
+ * @private
+ */
+
+function getFullEncoding(spec) {
+  return spec.encoding;
+}
+
+/**
+ * Check if a spec has any quality.
+ * @private
+ */
+
+function isQuality(spec) {
+  return spec.q > 0;
+}
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/lib/language.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/lib/language.js
new file mode 100644
index 0000000..a231672
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/lib/language.js	
@@ -0,0 +1,179 @@
+/**
+ * negotiator
+ * Copyright(c) 2012 Isaac Z. Schlueter
+ * Copyright(c) 2014 Federico Romero
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = preferredLanguages;
+module.exports.preferredLanguages = preferredLanguages;
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;
+
+/**
+ * Parse the Accept-Language header.
+ * @private
+ */
+
+function parseAcceptLanguage(accept) {
+  var accepts = accept.split(',');
+
+  for (var i = 0, j = 0; i < accepts.length; i++) {
+    var language = parseLanguage(accepts[i].trim(), i);
+
+    if (language) {
+      accepts[j++] = language;
+    }
+  }
+
+  // trim accepts
+  accepts.length = j;
+
+  return accepts;
+}
+
+/**
+ * Parse a language from the Accept-Language header.
+ * @private
+ */
+
+function parseLanguage(str, i) {
+  var match = simpleLanguageRegExp.exec(str);
+  if (!match) return null;
+
+  var prefix = match[1]
+  var suffix = match[2]
+  var full = prefix
+
+  if (suffix) full += "-" + suffix;
+
+  var q = 1;
+  if (match[3]) {
+    var params = match[3].split(';')
+    for (var j = 0; j < params.length; j++) {
+      var p = params[j].split('=');
+      if (p[0] === 'q') q = parseFloat(p[1]);
+    }
+  }
+
+  return {
+    prefix: prefix,
+    suffix: suffix,
+    q: q,
+    i: i,
+    full: full
+  };
+}
+
+/**
+ * Get the priority of a language.
+ * @private
+ */
+
+function getLanguagePriority(language, accepted, index) {
+  var priority = {o: -1, q: 0, s: 0};
+
+  for (var i = 0; i < accepted.length; i++) {
+    var spec = specify(language, accepted[i], index);
+
+    if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
+      priority = spec;
+    }
+  }
+
+  return priority;
+}
+
+/**
+ * Get the specificity of the language.
+ * @private
+ */
+
+function specify(language, spec, index) {
+  var p = parseLanguage(language)
+  if (!p) return null;
+  var s = 0;
+  if(spec.full.toLowerCase() === p.full.toLowerCase()){
+    s |= 4;
+  } else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) {
+    s |= 2;
+  } else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) {
+    s |= 1;
+  } else if (spec.full !== '*' ) {
+    return null
+  }
+
+  return {
+    i: index,
+    o: spec.i,
+    q: spec.q,
+    s: s
+  }
+};
+
+/**
+ * Get the preferred languages from an Accept-Language header.
+ * @public
+ */
+
+function preferredLanguages(accept, provided) {
+  // RFC 2616 sec 14.4: no header = *
+  var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || '');
+
+  if (!provided) {
+    // sorted list of all languages
+    return accepts
+      .filter(isQuality)
+      .sort(compareSpecs)
+      .map(getFullLanguage);
+  }
+
+  var priorities = provided.map(function getPriority(type, index) {
+    return getLanguagePriority(type, accepts, index);
+  });
+
+  // sorted list of accepted languages
+  return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) {
+    return provided[priorities.indexOf(priority)];
+  });
+}
+
+/**
+ * Compare two specs.
+ * @private
+ */
+
+function compareSpecs(a, b) {
+  return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;
+}
+
+/**
+ * Get full language string.
+ * @private
+ */
+
+function getFullLanguage(spec) {
+  return spec.full;
+}
+
+/**
+ * Check if a spec has any quality.
+ * @private
+ */
+
+function isQuality(spec) {
+  return spec.q > 0;
+}
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/lib/mediaType.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/lib/mediaType.js
new file mode 100644
index 0000000..8e402ea
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/lib/mediaType.js	
@@ -0,0 +1,294 @@
+/**
+ * negotiator
+ * Copyright(c) 2012 Isaac Z. Schlueter
+ * Copyright(c) 2014 Federico Romero
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = preferredMediaTypes;
+module.exports.preferredMediaTypes = preferredMediaTypes;
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;
+
+/**
+ * Parse the Accept header.
+ * @private
+ */
+
+function parseAccept(accept) {
+  var accepts = splitMediaTypes(accept);
+
+  for (var i = 0, j = 0; i < accepts.length; i++) {
+    var mediaType = parseMediaType(accepts[i].trim(), i);
+
+    if (mediaType) {
+      accepts[j++] = mediaType;
+    }
+  }
+
+  // trim accepts
+  accepts.length = j;
+
+  return accepts;
+}
+
+/**
+ * Parse a media type from the Accept header.
+ * @private
+ */
+
+function parseMediaType(str, i) {
+  var match = simpleMediaTypeRegExp.exec(str);
+  if (!match) return null;
+
+  var params = Object.create(null);
+  var q = 1;
+  var subtype = match[2];
+  var type = match[1];
+
+  if (match[3]) {
+    var kvps = splitParameters(match[3]).map(splitKeyValuePair);
+
+    for (var j = 0; j < kvps.length; j++) {
+      var pair = kvps[j];
+      var key = pair[0].toLowerCase();
+      var val = pair[1];
+
+      // get the value, unwrapping quotes
+      var value = val && val[0] === '"' && val[val.length - 1] === '"'
+        ? val.slice(1, -1)
+        : val;
+
+      if (key === 'q') {
+        q = parseFloat(value);
+        break;
+      }
+
+      // store parameter
+      params[key] = value;
+    }
+  }
+
+  return {
+    type: type,
+    subtype: subtype,
+    params: params,
+    q: q,
+    i: i
+  };
+}
+
+/**
+ * Get the priority of a media type.
+ * @private
+ */
+
+function getMediaTypePriority(type, accepted, index) {
+  var priority = {o: -1, q: 0, s: 0};
+
+  for (var i = 0; i < accepted.length; i++) {
+    var spec = specify(type, accepted[i], index);
+
+    if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
+      priority = spec;
+    }
+  }
+
+  return priority;
+}
+
+/**
+ * Get the specificity of the media type.
+ * @private
+ */
+
+function specify(type, spec, index) {
+  var p = parseMediaType(type);
+  var s = 0;
+
+  if (!p) {
+    return null;
+  }
+
+  if(spec.type.toLowerCase() == p.type.toLowerCase()) {
+    s |= 4
+  } else if(spec.type != '*') {
+    return null;
+  }
+
+  if(spec.subtype.toLowerCase() == p.subtype.toLowerCase()) {
+    s |= 2
+  } else if(spec.subtype != '*') {
+    return null;
+  }
+
+  var keys = Object.keys(spec.params);
+  if (keys.length > 0) {
+    if (keys.every(function (k) {
+      return spec.params[k] == '*' || (spec.params[k] || '').toLowerCase() == (p.params[k] || '').toLowerCase();
+    })) {
+      s |= 1
+    } else {
+      return null
+    }
+  }
+
+  return {
+    i: index,
+    o: spec.i,
+    q: spec.q,
+    s: s,
+  }
+}
+
+/**
+ * Get the preferred media types from an Accept header.
+ * @public
+ */
+
+function preferredMediaTypes(accept, provided) {
+  // RFC 2616 sec 14.2: no header = */*
+  var accepts = parseAccept(accept === undefined ? '*/*' : accept || '');
+
+  if (!provided) {
+    // sorted list of all types
+    return accepts
+      .filter(isQuality)
+      .sort(compareSpecs)
+      .map(getFullType);
+  }
+
+  var priorities = provided.map(function getPriority(type, index) {
+    return getMediaTypePriority(type, accepts, index);
+  });
+
+  // sorted list of accepted types
+  return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) {
+    return provided[priorities.indexOf(priority)];
+  });
+}
+
+/**
+ * Compare two specs.
+ * @private
+ */
+
+function compareSpecs(a, b) {
+  return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;
+}
+
+/**
+ * Get full type string.
+ * @private
+ */
+
+function getFullType(spec) {
+  return spec.type + '/' + spec.subtype;
+}
+
+/**
+ * Check if a spec has any quality.
+ * @private
+ */
+
+function isQuality(spec) {
+  return spec.q > 0;
+}
+
+/**
+ * Count the number of quotes in a string.
+ * @private
+ */
+
+function quoteCount(string) {
+  var count = 0;
+  var index = 0;
+
+  while ((index = string.indexOf('"', index)) !== -1) {
+    count++;
+    index++;
+  }
+
+  return count;
+}
+
+/**
+ * Split a key value pair.
+ * @private
+ */
+
+function splitKeyValuePair(str) {
+  var index = str.indexOf('=');
+  var key;
+  var val;
+
+  if (index === -1) {
+    key = str;
+  } else {
+    key = str.slice(0, index);
+    val = str.slice(index + 1);
+  }
+
+  return [key, val];
+}
+
+/**
+ * Split an Accept header into media types.
+ * @private
+ */
+
+function splitMediaTypes(accept) {
+  var accepts = accept.split(',');
+
+  for (var i = 1, j = 0; i < accepts.length; i++) {
+    if (quoteCount(accepts[j]) % 2 == 0) {
+      accepts[++j] = accepts[i];
+    } else {
+      accepts[j] += ',' + accepts[i];
+    }
+  }
+
+  // trim accepts
+  accepts.length = j + 1;
+
+  return accepts;
+}
+
+/**
+ * Split a string of parameters.
+ * @private
+ */
+
+function splitParameters(str) {
+  var parameters = str.split(';');
+
+  for (var i = 1, j = 0; i < parameters.length; i++) {
+    if (quoteCount(parameters[j]) % 2 == 0) {
+      parameters[++j] = parameters[i];
+    } else {
+      parameters[j] += ';' + parameters[i];
+    }
+  }
+
+  // trim parameters
+  parameters.length = j + 1;
+
+  for (var i = 0; i < parameters.length; i++) {
+    parameters[i] = parameters[i].trim();
+  }
+
+  return parameters;
+}
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/package.json
new file mode 100644
index 0000000..e4bdc1e
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/negotiator/package.json	
@@ -0,0 +1,43 @@
+{
+  "name": "negotiator",
+  "description": "HTTP content negotiation",
+  "version": "1.0.0",
+  "contributors": [
+    "Douglas Christopher Wilson ",
+    "Federico Romero ",
+    "Isaac Z. Schlueter  (http://blog.izs.me/)"
+  ],
+  "license": "MIT",
+  "keywords": [
+    "http",
+    "content negotiation",
+    "accept",
+    "accept-language",
+    "accept-encoding",
+    "accept-charset"
+  ],
+  "repository": "jshttp/negotiator",
+  "devDependencies": {
+    "eslint": "7.32.0",
+    "eslint-plugin-markdown": "2.2.1",
+    "mocha": "9.1.3",
+    "nyc": "15.1.0"
+  },
+  "files": [
+    "lib/",
+    "HISTORY.md",
+    "LICENSE",
+    "index.js",
+    "README.md"
+  ],
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "scripts": {
+    "lint": "eslint .",
+    "test": "mocha --reporter spec --check-leaks --bail test/",
+    "test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/",
+    "test-ci": "nyc --reporter=lcov --reporter=text npm test",
+    "test-cov": "nyc --reporter=html --reporter=text npm test"
+  }
+}
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/.prettierrc.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/.prettierrc.json
new file mode 100644
index 0000000..544138b
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/.prettierrc.json	
@@ -0,0 +1,3 @@
+{
+  "singleQuote": true
+}
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/LICENSE
new file mode 100644
index 0000000..19c91a2
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/LICENSE	
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2010 - present, Remy Sharp, https://remysharp.com 
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/README.md
new file mode 100644
index 0000000..ce94710
--- /dev/null
+++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/README.md	
@@ -0,0 +1,439 @@
+

+ Nodemon Logo +

+ +# nodemon + +nodemon is a tool that helps develop Node.js based applications by automatically restarting the node application when file changes in the directory are detected. + +nodemon does **not** require *any* additional changes to your code or method of development. nodemon is a replacement wrapper for `node`. To use `nodemon`, replace the word `node` on the command line when executing your script. + +[![NPM version](https://badge.fury.io/js/nodemon.svg)](https://npmjs.org/package/nodemon) +[![Backers on Open Collective](https://opencollective.com/nodemon/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/nodemon/sponsors/badge.svg)](#sponsors) + +# Installation + +Either through cloning with git or by using [npm](http://npmjs.org) (the recommended way): + +```bash +npm install -g nodemon # or using yarn: yarn global add nodemon +``` + +And nodemon will be installed globally to your system path. + +You can also install nodemon as a development dependency: + +```bash +npm install --save-dev nodemon # or using yarn: yarn add nodemon -D +``` + +With a local installation, nodemon will not be available in your system path or you can't use it directly from the command line. Instead, the local installation of nodemon can be run by calling it from within an npm script (such as `npm start`) or using `npx nodemon`. + +# Usage + +nodemon wraps your application, so you can pass all the arguments you would normally pass to your app: + +```bash +nodemon [your node app] +``` + +For CLI options, use the `-h` (or `--help`) argument: + +```bash +nodemon -h +``` + +Using nodemon is simple, if my application accepted a host and port as the arguments, I would start it as so: + +```bash +nodemon ./server.js localhost 8080 +``` + +Any output from this script is prefixed with `[nodemon]`, otherwise all output from your application, errors included, will be echoed out as expected. + +You can also pass the `inspect` flag to node through the command line as you would normally: + +```bash +nodemon --inspect ./server.js 80 +``` + +If you have a `package.json` file for your app, you can omit the main script entirely and nodemon will read the `package.json` for the `main` property and use that value as the app ([ref](https://github.com/remy/nodemon/issues/14)). + +nodemon will also search for the `scripts.start` property in `package.json` (as of nodemon 1.1.x). + +Also check out the [FAQ](https://github.com/remy/nodemon/blob/master/faq.md) or [issues](https://github.com/remy/nodemon/issues) for nodemon. + +## Automatic re-running + +nodemon was originally written to restart hanging processes such as web servers, but now supports apps that cleanly exit. If your script exits cleanly, nodemon will continue to monitor the directory (or directories) and restart the script if there are any changes. + +## Manual restarting + +Whilst nodemon is running, if you need to manually restart your application, instead of stopping and restart nodemon, you can type `rs` with a carriage return, and nodemon will restart your process. + +## Config files + +nodemon supports local and global configuration files. These are usually named `nodemon.json` and can be located in the current working directory or in your home directory. An alternative local configuration file can be specified with the `--config ` option. + +The specificity is as follows, so that a command line argument will always override the config file settings: + +- command line arguments +- local config +- global config + +A config file can take any of the command line arguments as JSON key values, for example: + +```json +{ + "verbose": true, + "ignore": ["*.test.js", "**/fixtures/**"], + "execMap": { + "rb": "ruby", + "pde": "processing --sketch={{pwd}} --run" + } +} +``` + +The above `nodemon.json` file might be my global config so that I have support for ruby files and processing files, and I can run `nodemon demo.pde` and nodemon will automatically know how to run the script even though out of the box support for processing scripts. + +A further example of options can be seen in [sample-nodemon.md](https://github.com/remy/nodemon/blob/master/doc/sample-nodemon.md) + +### package.json + +If you want to keep all your package configurations in one place, nodemon supports using `package.json` for configuration. +Specify the config in the same format as you would for a config file but under `nodemonConfig` in the `package.json` file, for example, take the following `package.json`: + +```json +{ + "name": "nodemon", + "homepage": "http://nodemon.io", + "...": "... other standard package.json values", + "nodemonConfig": { + "ignore": ["**/test/**", "**/docs/**"], + "delay": 2500 + } +} +``` + +Note that if you specify a `--config` file or provide a local `nodemon.json` any `package.json` config is ignored. + +*This section needs better documentation, but for now you can also see `nodemon --help config` ([also here](https://github.com/remy/nodemon/blob/master/doc/cli/config.txt))*. + +## Using nodemon as a module + +Please see [doc/requireable.md](doc/requireable.md) + +## Using nodemon as child process + +Please see [doc/events.md](doc/events.md#Using_nodemon_as_child_process) + +## Running non-node scripts + +nodemon can also be used to execute and monitor other programs. nodemon will read the file extension of the script being run and monitor that extension instead of `.js` if there's no `nodemon.json`: + +```bash +nodemon --exec "python -v" ./app.py +``` + +Now nodemon will run `app.py` with python in verbose mode (note that if you're not passing args to the exec program, you don't need the quotes), and look for new or modified files with the `.py` extension. + +### Default executables + +Using the `nodemon.json` config file, you can define your own default executables using the `execMap` property. This is particularly useful if you're working with a language that isn't supported by default by nodemon. + +To add support for nodemon to know about the `.pl` extension (for Perl), the `nodemon.json` file would add: + +```json +{ + "execMap": { + "pl": "perl" + } +} +``` + +Now running the following, nodemon will know to use `perl` as the executable: + +```bash +nodemon script.pl +``` + +It's generally recommended to use the global `nodemon.json` to add your own `execMap` options. However, if there's a common default that's missing, this can be merged in to the project so that nodemon supports it by default, by changing [default.js](https://github.com/remy/nodemon/blob/master/lib/config/defaults.js) and sending a pull request. + +## Monitoring multiple directories + +By default nodemon monitors the current working directory. If you want to take control of that option, use the `--watch` option to add specific paths: + +```bash +nodemon --watch app --watch libs app/server.js +``` + +Now nodemon will only restart if there are changes in the `./app` or `./libs` directory. By default nodemon will traverse sub-directories, so there's no need in explicitly including sub-directories. + +Nodemon also supports unix globbing, e.g `--watch './lib/*'`. The globbing pattern must be quoted. For advanced globbing, [see `picomatch` documentation](https://github.com/micromatch/picomatch#advanced-globbing), the library that nodemon uses through `chokidar` (which in turn uses it through `anymatch`). + +## Specifying extension watch list + +By default, nodemon looks for files with the `.js`, `.mjs`, `.coffee`, `.litcoffee`, and `.json` extensions. If you use the `--exec` option and monitor `app.py` nodemon will monitor files with the extension of `.py`. However, you can specify your own list with the `-e` (or `--ext`) switch like so: + +```bash +nodemon -e js,pug +``` + +Now nodemon will restart on any changes to files in the directory (or subdirectories) with the extensions `.js`, `.pug`. + +## Ignoring files + +By default, nodemon will only restart when a `.js` JavaScript file changes. In some cases you will want to ignore some specific files, directories or file patterns, to prevent nodemon from prematurely restarting your application. + +This can be done via the command line: + +```bash +nodemon --ignore lib/ --ignore tests/ +``` + +Or specific files can be ignored: + +```bash +nodemon --ignore lib/app.js +``` + +Patterns can also be ignored (but be sure to quote the arguments): + +```bash +nodemon --ignore 'lib/*.js' +``` + +**Important** the ignore rules are patterns matched to the full absolute path, and this determines how many files are monitored. If using a wild card glob pattern, it needs to be used as `**` or omitted entirely. For example, `nodemon --ignore '**/test/**'` will work, whereas `--ignore '*/test/*'` will not. + +Note that by default, nodemon will ignore the `.git`, `node_modules`, `bower_components`, `.nyc_output`, `coverage` and `.sass-cache` directories and *add* your ignored patterns to the list. If you want to indeed watch a directory like `node_modules`, you need to [override the underlying default ignore rules](https://github.com/remy/nodemon/blob/master/faq.md#overriding-the-underlying-default-ignore-rules). + +## Application isn't restarting + +In some networked environments (such as a container running nodemon reading across a mounted drive), you will need to use the `legacyWatch: true` which enables Chokidar's polling. + +Via the CLI, use either `--legacy-watch` or `-L` for short: + +```bash +nodemon -L +``` + +Though this should be a last resort as it will poll every file it can find. + +## Delaying restarting + +In some situations, you may want to wait until a number of files have changed. The timeout before checking for new file changes is 1 second. If you're uploading a number of files and it's taking some number of seconds, this could cause your app to restart multiple times unnecessarily. + +To add an extra throttle, or delay restarting, use the `--delay` command: + +```bash +nodemon --delay 10 server.js +``` + +For more precision, milliseconds can be specified. Either as a float: + +```bash +nodemon --delay 2.5 server.js +``` + +Or using the time specifier (ms): + +```bash +nodemon --delay 2500ms server.js +``` + +The delay figure is number of seconds (or milliseconds, if specified) to delay before restarting. So nodemon will only restart your app the given number of seconds after the *last* file change. + +If you are setting this value in `nodemon.json`, the value will always be interpreted in milliseconds. E.g., the following are equivalent: + +```bash +nodemon --delay 2.5 + +{ + "delay": 2500 +} +``` + +## Gracefully reloading down your script + +It is possible to have nodemon send any signal that you specify to your application. + +```bash +nodemon --signal SIGHUP server.js +``` + +Your application can handle the signal as follows. + +```js +process.on("SIGHUP", function () { + reloadSomeConfiguration(); + process.kill(process.pid, "SIGTERM"); +}) +``` + +Please note that nodemon will send this signal to every process in the process tree. + +If you are using `cluster`, then each workers (as well as the master) will receive the signal. If you wish to terminate all workers on receiving a `SIGHUP`, a common pattern is to catch the `SIGHUP` in the master, and forward `SIGTERM` to all workers, while ensuring that all workers ignore `SIGHUP`. + +```js +if (cluster.isMaster) { + process.on("SIGHUP", function () { + for (const worker of Object.values(cluster.workers)) { + worker.process.kill("SIGTERM"); + } + }); +} else { + process.on("SIGHUP", function() {}) +} +``` + +## Controlling shutdown of your script + +nodemon sends a kill signal to your application when it sees a file update. If you need to clean up on shutdown inside your script you can capture the kill signal and handle it yourself. + +The following example will listen once for the `SIGUSR2` signal (used by nodemon to restart), run the clean up process and then kill itself for nodemon to continue control: + +```js +// important to use `on` and not `once` as nodemon can re-send the kill signal +process.on('SIGUSR2', function () { + gracefulShutdown(function () { + process.kill(process.pid, 'SIGTERM'); + }); +}); +``` + +Note that the `process.kill` is *only* called once your shutdown jobs are complete. Hat tip to [Benjie Gillam](http://www.benjiegillam.com/2011/08/node-js-clean-restart-and-faster-development-with-nodemon/) for writing this technique up. + +## Triggering events when nodemon state changes + +If you want growl like notifications when nodemon restarts or to trigger an action when an event happens, then you can either `require` nodemon or add event actions to your `nodemon.json` file. + +For example, to trigger a notification on a Mac when nodemon restarts, `nodemon.json` looks like this: + +```json +{ + "events": { + "restart": "osascript -e 'display notification \"app restarted\" with title \"nodemon\"'" + } +} +``` + +A full list of available events is listed on the [event states wiki](https://github.com/remy/nodemon/wiki/Events#states). Note that you can bind to both states and messages. + +## Pipe output to somewhere else + +```js +nodemon({ + script: ..., + stdout: false // important: this tells nodemon not to output to console +}).on('readable', function() { // the `readable` event indicates that data is ready to pick up + this.stdout.pipe(fs.createWriteStream('output.txt')); + this.stderr.pipe(fs.createWriteStream('err.txt')); +}); +``` + +## Using nodemon in your gulp workflow + +Check out the [gulp-nodemon](https://github.com/JacksonGariety/gulp-nodemon) plugin to integrate nodemon with the rest of your project's gulp workflow. + +## Using nodemon in your Grunt workflow + +Check out the [grunt-nodemon](https://github.com/ChrisWren/grunt-nodemon) plugin to integrate nodemon with the rest of your project's grunt workflow. + +## Pronunciation + +> nodemon, is it pronounced: node-mon, no-demon or node-e-mon (like pokémon)? + +Well...I've been asked this many times before. I like that I've been asked this before. There's been bets as to which one it actually is. + +The answer is simple, but possibly frustrating. I'm not saying (how I pronounce it). It's up to you to call it as you like. All answers are correct :) + +## Design principles + +- Fewer flags is better +- Works across all platforms +- Fewer features +- Let individuals build on top of nodemon +- Offer all CLI functionality as an API +- Contributions must have and pass tests + +Nodemon is not perfect, and CLI arguments has sprawled beyond where I'm completely happy, but perhaps it can be reduced a little one day. + +## FAQ + +See the [FAQ](https://github.com/remy/nodemon/blob/master/faq.md) and please add your own questions if you think they would help others. + +## Backers + +Thank you to all [our backers](https://opencollective.com/nodemon#backer)! 🙏 + +[![nodemon backers](https://opencollective.com/nodemon/backers.svg?width=890)](https://opencollective.com/nodemon#backers) + +## Sponsors + +Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Sponsor this project today ❤️](https://opencollective.com/nodemon#sponsor) + +
Netpositive +Best online casinos not on GamStop in the UK +TheCasinoDB +Goread.io +Best Australian online casinos. Reviewed by Correct Casinos. +Website dedicated to finding the best and safest licensed online casinos in India +nongamstopcasinos.net +Buy Instagram Likes +OnlineCasinosSpelen +Beoordelen van nieuwe online casino's 2023 +CasinoZonderRegistratie.net - Nederlandse Top Casino's +Buy real Instagram followers from Twicsy starting at only $2.97. Twicsy has been voted the best site to buy followers from the likes of US Magazine. +SocialWick offers the best Instagram Followers in the market. If you are looking to boost your organic growth, buy Instagram followers from SocialWick +Buy Telegram Members +We review the entire iGaming industry from A to Z +CryptoCasinos.online +No deposit casino promo Codes 2024 - The best online Casinos websites. No deposit bonus codes, Free Spins and Promo Codes. Stake, Roobet, Jackpotcity and more. +Online casino. +Boost your social media presence effortlessly with top-quality Instagram and TikTok followers and likes. +Social Media Management and all kinds of followers +Betwinner is an online bookmaker offering sports betting, casino games, and more. +At Buzzoid, you can buy Instagram followers quickly, safely, and easily with just a few clicks. Rated world's #1 IG service since 2012. +Zamsino.com +Reviewing and comparing online casinos available to Finnish players. In addition, we publish relevant news and blog posts about the world of iGaming. +Buzzvoice is your one-stop shop for all your social media marketing needs. With Buzzvoice, you can buy followers, comments, likes, video views and more! + +SocialBoosting: Buy Instagram & TikTok Followers, Likes, Views +Ігрові автомати онлайн +Kasinohai.com +Casino Online Chile +casino online chile +Vanguard Media évalue les casinos en ligne pour joueurs français, testant les sites en France. Nos classements stricts garantissent des casinos fiables et sûrs. +Bei Releaf erhalten Sie schnell und diskret Ihr Cannabis Rezept online. Unsere Ärzte prüfen Ihre Angaben und stellen bei Eignung das Rezept aus. Anschließend können Sie legal und sicher medizinisches Cannabis über unsere Partnerapotheken kaufen. +Analysis of online casinos with the best payouts +Download multithreaded HEIC to JPG converter software for Windows 10/11 +We specialize in the online gambling industry, helping players access reliable and verified information about the best online casinos and pokies in Australia. Our team tests casinos and games, collects user reviews from Trustpilot, and organizes them in o +Wolf Winner Casino +AUCrazyVegas +iDealeCasinos + +BetPokies.co.nz is your New Zealand guide in the world of online gambling. Our site was created by gamblers for gamblers. +one x bet - Arabic betting site +Online Casino Zonder Registratie +We test dozens of casinos every month and select the coolest ones for Australian players. +Buy Instagram Followers +Pokies Reviews +Buy TikTok Comments +Mi misión es la educación y transparencia en el mundo de los casinos online +Spreading knowledge about $ETH + +Best online sports betting and casino company. +bestecasinozondercruks +Best online sports betting company in Thailand. +Best online sports betting company in Vietnam. +We testen elke maand tientallen casino’s en kiezen de beste uit voor Nederlandse spelers. +ThePokies Net +Aviator Game Online +Plinko Game +
+ +Please note that links to the sponsors above are not direct endorsements nor affiliated with any of contributors of the nodemon project. + +# License + +MIT [http://rem.mit-license.org](http://rem.mit-license.org) diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/bin/nodemon.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/bin/nodemon.js new file mode 100644 index 0000000..3d490f1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/bin/nodemon.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node + +const cli = require('../lib/cli'); +const nodemon = require('../lib/'); +const options = cli.parse(process.argv); + +nodemon(options); + +const fs = require('fs'); + +// checks for available update and returns an instance +const pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json')); + +if (pkg.version.indexOf('0.0.0') !== 0 && options.noUpdateNotifier !== true) { + require('simple-update-notifier')({ pkg }); +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/bin/windows-kill.exe b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/bin/windows-kill.exe new file mode 100644 index 0000000..98d7d7f Binary files /dev/null and b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/bin/windows-kill.exe differ diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/authors.txt b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/authors.txt new file mode 100644 index 0000000..6c77a12 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/authors.txt @@ -0,0 +1,8 @@ + + Remy Sharp - author and maintainer + https://github.com/remy + https://twitter.com/rem + + Contributors: https://github.com/remy/nodemon/graphs/contributors ❤︎ + + Please help make nodemon better: https://github.com/remy/nodemon/ diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/config.txt b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/config.txt new file mode 100644 index 0000000..5de9bba --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/config.txt @@ -0,0 +1,44 @@ + + Typically the options to control nodemon are passed in via the CLI and are + listed under: nodemon --help options + + nodemon can also be configured via a local and global config file: + + * $HOME/nodemon.json + * $PWD/nodemon.json OR --config + * nodemonConfig in package.json + + All config options in the .json file map 1-to-1 with the CLI options, so a + config could read as: + + { + "ext": "*.pde", + "verbose": true, + "exec": "processing --sketch=game --run" + } + + There are a limited number of variables available in the config (since you + could use backticks on the CLI to use a variable, backticks won't work in + the .json config). + + * {{pwd}} - the current directory + * {{filename}} - the filename you pass to nodemon + + For example: + + { + "ext": "*.pde", + "verbose": true, + "exec": "processing --sketch={{pwd}} --run" + } + + The global config file is useful for setting up default executables + instead of repeating the same option in each of your local configs: + + { + "verbose": true, + "execMap": { + "rb": "ruby", + "pde": "processing --sketch={{pwd}} --run" + } + } diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/help.txt b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/help.txt new file mode 100644 index 0000000..7ba4ff2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/help.txt @@ -0,0 +1,29 @@ + Usage: nodemon [options] [script.js] [args] + + Options: + + --config file ............ alternate nodemon.json config file to use + -e, --ext ................ extensions to look for, ie. js,pug,hbs. + -x, --exec app ........... execute script with "app", ie. -x "python -v". + -w, --watch path ......... watch directory "path" or files. use once for + each directory or file to watch. + -i, --ignore ............. ignore specific files or directories. + -V, --verbose ............ show detail on what is causing restarts. + -- ........... to tell nodemon stop slurping arguments. + + Note: if the script is omitted, nodemon will try to read "main" from + package.json and without a nodemon.json, nodemon will monitor .js, .mjs, .coffee, + .litcoffee, and .json by default. + + For advanced nodemon configuration use nodemon.json: nodemon --help config + See also the sample: https://github.com/remy/nodemon/wiki/Sample-nodemon.json + + Examples: + + $ nodemon server.js + $ nodemon -w ../foo server.js apparg1 apparg2 + $ nodemon --exec python app.py + $ nodemon --exec "make build" -e "styl hbs" + $ nodemon app.js -- --config # pass config to app.js + + \x1B[1mAll options are documented under: \x1B[4mnodemon --help options\x1B[0m diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/logo.txt b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/logo.txt new file mode 100644 index 0000000..150f97f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/logo.txt @@ -0,0 +1,20 @@ + ; ; + kO. x0 + KMX, .:x0kc. 'KMN + 0MMM0: 'oKMMMMMMMXd, ;OMMMX + oMMMMMWKOONMMMMMMMMMMMMMWOOKWMMMMMx + OMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMK. + .oWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd. + KMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN + KMMMMMMMMMMMMMMW0k0WMMMMMMMMMMMMMMW + KMMMMMMMMMMMNk:. :xNMMMMMMMMMMMW + KMMMMMMMMMMK OMMMMMMMMMMW + KMMMMMMMMMMO xMMMMMMMMMMN + KMMMMMMMMMMO xMMMMMMMMMMN + KMMMMMMMMMMO xMMMMMMMMMMN + KMMMMMMMMMMO xMMMMMMMMMMN + KMMMMMMMMMMO xMMMMMMMMMMN + KMMMMMMMMMNc ;NMMMMMMMMMN + KMMMMMW0o' .lOWMMMMMN + KMMKd; ,oKMMN + kX: ,K0 \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/options.txt b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/options.txt new file mode 100644 index 0000000..598ae63 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/options.txt @@ -0,0 +1,36 @@ + +Configuration + --config .......... alternate nodemon.json config file to use + --exitcrash .............. exit on crash, allows nodemon to work with other watchers + -i, --ignore ............. ignore specific files or directories + --no-colors .............. disable color output + --signal ........ use specified kill signal instead of default (ex. SIGTERM) + -w, --watch path ......... watch directory "dir" or files. use once for each + directory or file to watch + --no-update-notifier ..... opt-out of update version check + +Execution + -C, --on-change-only ..... execute script on change only, not startup + --cwd .............. change into before running the script + -e, --ext ................ extensions to look for, ie. "js,pug,hbs" + -I, --no-stdin ........... nodemon passes stdin directly to child process + --spawn .................. force nodemon to use spawn (over fork) [node only] + -x, --exec app ........... execute script with "app", ie. -x "python -v" + -- ........... to tell nodemon stop slurping arguments + +Watching + -d, --delay n ............ debounce restart for "n" seconds + -L, --legacy-watch ....... use polling to watch for changes (typically needed + when watching over a network/Docker) + -P, --polling-interval ... combined with -L, milliseconds to poll for (default 100) + +Information + --dump ................... print full debug configuration + -h, --help ............... default help + --help ........... help on a specific feature. Try "--help topics" + -q, --quiet .............. minimise nodemon messages to start/stop only + -v, --version ............ current nodemon version + -V, --verbose ............ show detail on what is causing restarts + + +> Note that any unrecognised arguments are passed to the executing command. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/topics.txt b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/topics.txt new file mode 100644 index 0000000..9fe3e2b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/topics.txt @@ -0,0 +1,8 @@ + + options .................. show all available nodemon options + config ................... default config options using nodemon.json + authors .................. contributors to this project + logo ..................... <3 + whoami ................... I, AM, NODEMON \o/ + + Please support https://github.com/remy/nodemon/ diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/usage.txt b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/usage.txt new file mode 100644 index 0000000..bca98b5 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/usage.txt @@ -0,0 +1,3 @@ + Usage: nodemon [nodemon options] [script.js] [args] + + See "nodemon --help" for more. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/whoami.txt b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/whoami.txt new file mode 100644 index 0000000..efc3382 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/doc/cli/whoami.txt @@ -0,0 +1,9 @@ +__/\\\\\_____/\\\_______/\\\\\_______/\\\\\\\\\\\\_____/\\\\\\\\\\\\\\\__/\\\\____________/\\\\_______/\\\\\_______/\\\\\_____/\\\_ + _\/\\\\\\___\/\\\_____/\\\///\\\____\/\\\////////\\\__\/\\\///////////__\/\\\\\\________/\\\\\\_____/\\\///\\\____\/\\\\\\___\/\\\_ + _\/\\\/\\\__\/\\\___/\\\/__\///\\\__\/\\\______\//\\\_\/\\\_____________\/\\\//\\\____/\\\//\\\___/\\\/__\///\\\__\/\\\/\\\__\/\\\_ + _\/\\\//\\\_\/\\\__/\\\______\//\\\_\/\\\_______\/\\\_\/\\\\\\\\\\\_____\/\\\\///\\\/\\\/_\/\\\__/\\\______\//\\\_\/\\\//\\\_\/\\\_ + _\/\\\\//\\\\/\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/\\\///////______\/\\\__\///\\\/___\/\\\_\/\\\_______\/\\\_\/\\\\//\\\\/\\\_ + _\/\\\_\//\\\/\\\_\//\\\______/\\\__\/\\\_______\/\\\_\/\\\_____________\/\\\____\///_____\/\\\_\//\\\______/\\\__\/\\\_\//\\\/\\\_ + _\/\\\__\//\\\\\\__\///\\\__/\\\____\/\\\_______/\\\__\/\\\_____________\/\\\_____________\/\\\__\///\\\__/\\\____\/\\\__\//\\\\\\_ + _\/\\\___\//\\\\\____\///\\\\\/_____\/\\\\\\\\\\\\/___\/\\\\\\\\\\\\\\\_\/\\\_____________\/\\\____\///\\\\\/_____\/\\\___\//\\\\\_ + _\///_____\/////_______\/////_______\////////////_____\///////////////__\///______________\///_______\/////_______\///_____\/////__ \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/index.d.ts new file mode 100644 index 0000000..42be595 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/index.d.ts @@ -0,0 +1,124 @@ +import type { WatchOptions } from 'chokidar'; + +export type NodemonEventHandler = + | 'start' + | 'crash' + | 'exit' + | 'quit' + | 'restart' + | 'config:update' + | 'log' + | 'readable' + | 'stdout' + | 'stderr'; + +export type NodemonEventListener = { + on(event: 'start' | 'crash' | 'readable', listener: () => void): Nodemon; + on(event: 'log', listener: (e: NodemonEventLog) => void): Nodemon; + on(event: 'stdout' | 'stderr', listener: (e: string) => void): Nodemon; + on(event: 'restart', listener: (files?: string[]) => void): Nodemon; + on(event: 'quit', listener: (e?: NodemonEventQuit) => void): Nodemon; + on(event: 'exit', listener: (e?: number) => void): Nodemon; + on( + event: 'config:update', + listener: (e?: NodemonEventConfig) => void, + ): Nodemon; +}; + +export type NodemonEventLog = { + /** + - detail: what you get with nodemon --verbose. + - status: subprocess starting, restarting. + - fail: is the subprocess crashing. + - error: is a nodemon system error. + */ + type: 'detail' | 'log' | 'status' | 'error' | 'fail'; + /** the plain text message */ + message: string; + /** contains the terminal escape codes to add colour, plus the "[nodemon]" prefix */ + colour: string; +}; + +export type NodemonEventQuit = 143 | 130; + +export type NodemonEventConfig = { + run: boolean; + system: { + cwd: string; + }; + required: boolean; + dirs: string[]; + timeout: number; + options: NodemonConfig; + lastStarted: number; + loaded: string[]; + load: ( + settings: NodemonSettings, + ready: (config: NodemonEventConfig) => void, + ) => void; + reset: () => void; +}; + +export interface NodemonExecOptions { + script: string; + scriptPosition?: number; + args?: string[]; + ext?: string; // "js,mjs" etc (should really support an array of strings, but I don't think it does right now) + exec?: string; // node, python, etc + execArgs?: string[]; // args passed to node, etc, + nodeArgs?: string[]; // args passed to node, etc, +} + +export interface NodemonConfig { + /** restartable defaults to "rs" as a string the user enters */ + restartable?: false | string; + colours?: boolean; + execMap?: { [key: string]: string }; + ignoreRoot?: string[]; + watch?: string[]; + ignore?: string[]; + stdin?: boolean; + runOnChangeOnly?: boolean; + verbose?: boolean; + signal?: string; + stdout?: boolean; + watchOptions?: WatchOptions; + help?: string; + version?: boolean; + cwd?: string; + dump?: boolean; + delay?: number; + monitor?: string[]; + spawn?: boolean; + noUpdateNotifier?: boolean; + legacyWatch?: boolean; + pollingInterval?: number; + /** @deprecated as this is "on" by default */ + js?: boolean; + quiet?: boolean; + configFile?: string; + exitCrash?: boolean; + execOptions?: NodemonExecOptions; +} + +export interface NodemonSettings extends NodemonConfig, NodemonExecOptions { + events?: Record; + env?: Record; +} + +export type Nodemon = { + (settings: NodemonSettings): Nodemon; + removeAllListeners(event: NodemonEventHandler): Nodemon; + emit(type: NodemonEventHandler, event?: any): Nodemon; + reset(callback: Function): Nodemon; + restart(): Nodemon; + config: NodemonSettings; +} & NodemonEventListener & { + [K in keyof NodemonEventListener as 'addListener']: NodemonEventListener[K]; + } & { + [K in keyof NodemonEventListener as 'once']: NodemonEventListener[K]; + }; + +declare const nodemon: Nodemon; + +export = nodemon; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/jsconfig.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/jsconfig.json new file mode 100644 index 0000000..d77141c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/jsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "typeRoots": ["./index.d.ts", "./node_modules/@types"], + "checkJs": true + }, + "exclude": ["node_modules"] +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/cli/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/cli/index.js new file mode 100644 index 0000000..bf9e809 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/cli/index.js @@ -0,0 +1,49 @@ +var parse = require('./parse'); + +/** + * Converts a string to command line args, in particular + * groups together quoted values. + * This is a utility function to allow calling nodemon as a required + * library, but with the CLI args passed in (instead of an object). + * + * @param {String} string + * @return {Array} + */ +function stringToArgs(string) { + var args = []; + + var parts = string.split(' '); + var length = parts.length; + var i = 0; + var open = false; + var grouped = ''; + var lead = ''; + + for (; i < length; i++) { + lead = parts[i].substring(0, 1); + if (lead === '"' || lead === '\'') { + open = lead; + grouped = parts[i].substring(1); + } else if (open && parts[i].slice(-1) === open) { + open = false; + grouped += ' ' + parts[i].slice(0, -1); + args.push(grouped); + } else if (open) { + grouped += ' ' + parts[i]; + } else { + args.push(parts[i]); + } + } + + return args; +} + +module.exports = { + parse: function (argv) { + if (typeof argv === 'string') { + argv = stringToArgs(argv); + } + + return parse(argv); + }, +}; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/cli/parse.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/cli/parse.js new file mode 100644 index 0000000..560cc71 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/cli/parse.js @@ -0,0 +1,230 @@ +/* + +nodemon is a utility for node, and replaces the use of the executable +node. So the user calls `nodemon foo.js` instead. + +nodemon can be run in a number of ways: + +`nodemon` - tries to use package.json#main property to run +`nodemon` - if no package, looks for index.js +`nodemon app.js` - runs app.js +`nodemon --arg app.js --apparg` - eats arg1, and runs app.js with apparg +`nodemon --apparg` - as above, but passes apparg to package.json#main (or + index.js) +`nodemon --debug app.js + +*/ + +var fs = require('fs'); +var path = require('path'); +var existsSync = fs.existsSync || path.existsSync; + +module.exports = parse; + +/** + * Parses the command line arguments `process.argv` and returns the + * nodemon options, the user script and the executable script. + * + * @param {Array | string} argv full process arguments, including `node` leading arg + * @return {Object} { options, script, args } + */ +function parse(argv) { + if (typeof argv === 'string') { + argv = argv.split(' '); + } + + var eat = function (i, args) { + if (i <= args.length) { + return args.splice(i + 1, 1).pop(); + } + }; + + var args = argv.slice(2); + var script = null; + var nodemonOptions = { scriptPosition: null }; + + var nodemonOpt = nodemonOption.bind(null, nodemonOptions); + var lookForArgs = true; + + // move forward through the arguments + for (var i = 0; i < args.length; i++) { + // if the argument looks like a file, then stop eating + if (!script) { + if (args[i] === '.' || existsSync(args[i])) { + script = args.splice(i, 1).pop(); + + // we capture the position of the script because we'll reinsert it in + // the right place in run.js:command (though I'm not sure we should even + // take it out of the array in the first place, but this solves passing + // arguments to the exec process for now). + nodemonOptions.scriptPosition = i; + i--; + continue; + } + } + + if (lookForArgs) { + // respect the standard way of saying: hereafter belongs to my script + if (args[i] === '--') { + args.splice(i, 1); + nodemonOptions.scriptPosition = i; + // cycle back one argument, as we just ate this one up + i--; + + // ignore all further nodemon arguments + lookForArgs = false; + + // move to the next iteration + continue; + } + + if (nodemonOpt(args[i], eat.bind(null, i, args)) !== false) { + args.splice(i, 1); + // cycle back one argument, as we just ate this one up + i--; + } + } + } + + nodemonOptions.script = script; + nodemonOptions.args = args; + + return nodemonOptions; +} + + +/** + * Given an argument (ie. from process.argv), sets nodemon + * options and can eat up the argument value + * + * @param {import('../..').NodemonSettings} options object that will be updated + * @param {String} arg current argument from argv + * @param {Function} eatNext the callback to eat up the next argument in argv + * @return {Boolean} false if argument was not a nodemon arg + */ +function nodemonOption(options, arg, eatNext) { + // line separation on purpose to help legibility + if (arg === '--help' || arg === '-h' || arg === '-?') { + var help = eatNext(); + options.help = help ? help : true; + } else + + if (arg === '--version' || arg === '-v') { + options.version = true; + } else + + if (arg === '--no-update-notifier') { + options.noUpdateNotifier = true; + } else + + if (arg === '--spawn') { + options.spawn = true; + } else + + if (arg === '--dump') { + options.dump = true; + } else + + if (arg === '--verbose' || arg === '-V') { + options.verbose = true; + } else + + if (arg === '--legacy-watch' || arg === '-L') { + options.legacyWatch = true; + } else + + if (arg === '--polling-interval' || arg === '-P') { + options.pollingInterval = parseInt(eatNext(), 10); + } else + + // Depricated as this is "on" by default + if (arg === '--js') { + options.js = true; + } else + + if (arg === '--quiet' || arg === '-q') { + options.quiet = true; + } else + + if (arg === '--config') { + options.configFile = eatNext(); + } else + + if (arg === '--watch' || arg === '-w') { + if (!options.watch) { options.watch = []; } + options.watch.push(eatNext()); + } else + + if (arg === '--ignore' || arg === '-i') { + if (!options.ignore) { options.ignore = []; } + options.ignore.push(eatNext()); + } else + + if (arg === '--exitcrash') { + options.exitCrash = true; + } else + + if (arg === '--delay' || arg === '-d') { + options.delay = parseDelay(eatNext()); + } else + + if (arg === '--exec' || arg === '-x') { + options.exec = eatNext(); + } else + + if (arg === '--no-stdin' || arg === '-I') { + options.stdin = false; + } else + + if (arg === '--on-change-only' || arg === '-C') { + options.runOnChangeOnly = true; + } else + + if (arg === '--ext' || arg === '-e') { + options.ext = eatNext(); + } else + + if (arg === '--no-colours' || arg === '--no-colors') { + options.colours = false; + } else + + if (arg === '--signal' || arg === '-s') { + options.signal = eatNext(); + } else + + if (arg === '--cwd') { + options.cwd = eatNext(); + + // go ahead and change directory. This is primarily for nodemon tools like + // grunt-nodemon - we're doing this early because it will affect where the + // user script is searched for. + process.chdir(path.resolve(options.cwd)); + } else { + + // this means we didn't match + return false; + } +} + +/** + * Given an argument (ie. from nodemonOption()), will parse and return the + * equivalent millisecond value or 0 if the argument cannot be parsed + * + * @param {String} value argument value given to the --delay option + * @return {Number} millisecond equivalent of the argument + */ +function parseDelay(value) { + var millisPerSecond = 1000; + var millis = 0; + + if (value.match(/^\d*ms$/)) { + // Explicitly parse for milliseconds when using ms time specifier + millis = parseInt(value, 10); + } else { + // Otherwise, parse for seconds, with or without time specifier then convert + millis = parseFloat(value) * millisPerSecond; + } + + return isNaN(millis) ? 0 : millis; +} + diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/config/command.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/config/command.js new file mode 100644 index 0000000..9839b5c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/config/command.js @@ -0,0 +1,43 @@ +module.exports = command; + +/** + * command constructs the executable command to run in a shell including the + * user script, the command arguments. + * + * @param {Object} settings Object as: + * { execOptions: { + * exec: String, + * [script: String], + * [scriptPosition: Number], + * [execArgs: Array] + * } + * } + * @return {Object} an object with the node executable and the + * arguments to the command + */ +function command(settings) { + var options = settings.execOptions; + var executable = options.exec; + var args = []; + + // after "executable" go the exec args (like --debug, etc) + if (options.execArgs) { + [].push.apply(args, options.execArgs); + } + + // then goes the user's script arguments + if (options.args) { + [].push.apply(args, options.args); + } + + // after the "executable" goes the user's script + if (options.script) { + args.splice((options.scriptPosition || 0) + + options.execArgs.length, 0, options.script); + } + + return { + executable: executable, + args: args, + }; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/config/defaults.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/config/defaults.js new file mode 100644 index 0000000..dc95d34 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/config/defaults.js @@ -0,0 +1,34 @@ +var ignoreRoot = require('ignore-by-default').directories(); + +// default options for config.options +const defaults = { + restartable: 'rs', + colours: true, + execMap: { + py: 'python', + rb: 'ruby', + ts: 'ts-node', + // more can be added here such as ls: lsc - but please ensure it's cross + // compatible with linux, mac and windows, or make the default.js + // dynamically append the `.cmd` for node based utilities + }, + ignoreRoot: ignoreRoot.map((_) => `**/${_}/**`), + watch: ['*.*'], + stdin: true, + runOnChangeOnly: false, + verbose: false, + signal: 'SIGUSR2', + // 'stdout' refers to the default behaviour of a required nodemon's child, + // but also includes stderr. If this is false, data is still dispatched via + // nodemon.on('stdout/stderr') + stdout: true, + watchOptions: {}, +}; + +const nodeOptions = process.env.NODE_OPTIONS || ''; // ? + +if (/--(loader|import)\b/.test(nodeOptions)) { + delete defaults.execMap.ts; +} + +module.exports = defaults; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/config/exec.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/config/exec.js new file mode 100644 index 0000000..249742a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/config/exec.js @@ -0,0 +1,240 @@ +const path = require('path'); +const fs = require('fs'); +const existsSync = fs.existsSync; +const utils = require('../utils'); + +module.exports = exec; +module.exports.expandScript = expandScript; + +/** + * Reads the cwd/package.json file and looks to see if it can load a script + * and possibly an exec first from package.main, then package.start. + * + * @return {Object} exec & script if found + */ +function execFromPackage() { + // doing a try/catch because we can't use the path.exist callback pattern + // or we could, but the code would get messy, so this will do exactly + // what we're after - if the file doesn't exist, it'll throw. + try { + // note: this isn't nodemon's package, it's the user's cwd package + var pkg = require(path.join(process.cwd(), 'package.json')); + if (pkg.main !== undefined) { + // no app found to run - so give them a tip and get the feck out + return { exec: null, script: pkg.main }; + } + + if (pkg.scripts && pkg.scripts.start) { + const parts = pkg.scripts.start.split(' '); + + // fixes a loop issue where the script repeats over and over #2258 + if (parts.includes('nodemon')) { + return null; + } + return { exec: pkg.scripts.start }; + } + } catch (e) {} + + return null; +} + +function replace(map, str) { + var re = new RegExp('{{(' + Object.keys(map).join('|') + ')}}', 'g'); + return str.replace(re, function (all, m) { + return map[m] || all || ''; + }); +} + +function expandScript(script, ext) { + if (!ext) { + ext = '.js'; + } + if (script.indexOf(ext) !== -1) { + return script; + } + + if (existsSync(path.resolve(script))) { + return script; + } + + if (existsSync(path.resolve(script + ext))) { + return script + ext; + } + + return script; +} + +/** + * Discovers all the options required to run the script + * and if a custom exec has been passed in, then it will + * also try to work out what extensions to monitor and + * whether there's a special way of running that script. + * + * @param {Object} nodemonOptions + * @param {Object} execMap + * @return {Object} new and updated version of nodemonOptions + */ +function exec(nodemonOptions, execMap) { + if (!execMap) { + execMap = {}; + } + + var options = utils.clone(nodemonOptions || {}); + var script; + + // if there's no script passed, try to get it from the first argument + if (!options.script && (options.args || []).length) { + script = expandScript( + options.args[0], + options.ext && '.' + (options.ext || 'js').split(',')[0] + ); + + // if the script was found, shift it off our args + if (script !== options.args[0]) { + options.script = script; + options.args.shift(); + } + } + + // if there's no exec found yet, then try to read it from the local + // package.json this logic used to sit in the cli/parse, but actually the cli + // should be parsed first, then the user options (via nodemon.json) then + // finally default down to pot shots at the directory via package.json + if (!options.exec && !options.script) { + var found = execFromPackage(); + if (found !== null) { + if (found.exec) { + options.exec = found.exec; + } + if (!options.script) { + options.script = found.script; + } + if (Array.isArray(options.args) && options.scriptPosition === null) { + options.scriptPosition = options.args.length; + } + } + } + + // var options = utils.clone(nodemonOptions || {}); + script = path.basename(options.script || ''); + + var scriptExt = path.extname(script).slice(1); + + var extension = options.ext; + if (extension === undefined) { + var isJS = scriptExt === 'js' || scriptExt === 'mjs' || scriptExt === 'cjs'; + extension = isJS || !scriptExt ? 'js,mjs,cjs' : scriptExt; + extension += ',json'; // Always watch JSON files + } + + var execDefined = !!options.exec; + + // allows the user to simplify cli usage: + // https://github.com/remy/nodemon/issues/195 + // but always give preference to the user defined argument + if (!options.exec && execMap[scriptExt] !== undefined) { + options.exec = execMap[scriptExt]; + execDefined = true; + } + + options.execArgs = nodemonOptions.execArgs || []; + + if (Array.isArray(options.exec)) { + options.execArgs = options.exec; + options.exec = options.execArgs.shift(); + } + + if (options.exec === undefined) { + options.exec = 'node'; + } else { + // allow variable substitution for {{filename}} and {{pwd}} + var substitution = replace.bind(null, { + filename: options.script, + pwd: process.cwd(), + }); + + var newExec = substitution(options.exec); + if ( + newExec !== options.exec && + options.exec.indexOf('{{filename}}') !== -1 + ) { + options.script = null; + } + options.exec = newExec; + + var newExecArgs = options.execArgs.map(substitution); + if (newExecArgs.join('') !== options.execArgs.join('')) { + options.execArgs = newExecArgs; + delete options.script; + } + } + + if (options.exec === 'node' && options.nodeArgs && options.nodeArgs.length) { + options.execArgs = options.execArgs.concat(options.nodeArgs); + } + + // note: indexOf('coffee') handles both .coffee and .litcoffee + if ( + !execDefined && + options.exec === 'node' && + scriptExt.indexOf('coffee') !== -1 + ) { + options.exec = 'coffee'; + + // we need to get execArgs set before the script + // for example, in `nodemon --debug my-script.coffee --my-flag`, debug is an + // execArg, while my-flag is a script arg + var leadingArgs = (options.args || []).splice(0, options.scriptPosition); + options.execArgs = options.execArgs.concat(leadingArgs); + options.scriptPosition = 0; + + if (options.execArgs.length > 0) { + // because this is the coffee executable, we need to combine the exec args + // into a single argument after the nodejs flag + options.execArgs = ['--nodejs', options.execArgs.join(' ')]; + } + } + + if (options.exec === 'coffee') { + // don't override user specified extension tracking + if (options.ext === undefined) { + if (extension) { + extension += ','; + } + extension += 'coffee,litcoffee'; + } + + // because windows can't find 'coffee', it needs the real file 'coffee.cmd' + if (utils.isWindows) { + options.exec += '.cmd'; + } + } + + // allow users to make a mistake on the extension to monitor + // converts .js, pug => js,pug + // BIG NOTE: user can't do this: nodemon -e *.js + // because the terminal will automatically expand the glob against + // the file system :( + extension = (extension.match(/[^,*\s]+/g) || []) + .map((ext) => ext.replace(/^\./, '')) + .join(','); + + options.ext = extension; + + if (options.script) { + options.script = expandScript( + options.script, + extension && '.' + extension.split(',')[0] + ); + } + + options.env = {}; + // make sure it's an object (and since we don't have ) + if ({}.toString.apply(nodemonOptions.env) === '[object Object]') { + options.env = utils.clone(nodemonOptions.env); + } else if (nodemonOptions.env !== undefined) { + throw new Error('nodemon env values must be an object: { PORT: 8000 }'); + } + + return options; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/config/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/config/index.js new file mode 100644 index 0000000..c78c435 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/config/index.js @@ -0,0 +1,93 @@ +/** + * Manages the internal config of nodemon, checking for the state of support + * with fs.watch, how nodemon can watch files (using find or fs methods). + * + * This is *not* the user's config. + */ +var debug = require('debug')('nodemon'); +var load = require('./load'); +var rules = require('../rules'); +var utils = require('../utils'); +var pinVersion = require('../version').pin; +var command = require('./command'); +var rulesToMonitor = require('../monitor/match').rulesToMonitor; +var bus = utils.bus; + +function reset() { + rules.reset(); + + config.dirs = []; + config.options = { ignore: [], watch: [], monitor: [] }; + config.lastStarted = 0; + config.loaded = []; +} + +var config = { + run: false, + system: { + cwd: process.cwd(), + }, + required: false, + dirs: [], + timeout: 1000, + options: {}, +}; + +/** + * Take user defined settings, then detect the local machine capability, then + * look for local and global nodemon.json files and merge together the final + * settings with the config for nodemon. + * + * @param {Object} settings user defined settings for nodemon (typically on + * the cli) + * @param {Function} ready callback fired once the config is loaded + */ +config.load = function (settings, ready) { + reset(); + var config = this; + load(settings, config.options, config, function (options) { + config.options = options; + + if (options.watch.length === 0) { + // this is to catch when the watch is left blank + options.watch.push('*.*'); + } + + if (options['watch_interval']) { // jshint ignore:line + options.watchInterval = options['watch_interval']; // jshint ignore:line + } + + config.watchInterval = options.watchInterval || null; + if (options.signal) { + config.signal = options.signal; + } + + var cmd = command(config.options); + config.command = { + raw: cmd, + string: utils.stringify(cmd.executable, cmd.args), + }; + + // now run automatic checks on system adding to the config object + options.monitor = rulesToMonitor(options.watch, options.ignore, config); + + var cwd = process.cwd(); + debug('config: dirs', config.dirs); + if (config.dirs.length === 0) { + config.dirs.unshift(cwd); + } + + bus.emit('config:update', config); + pinVersion().then(function () { + ready(config); + }).catch(e => { + // this doesn't help testing, but does give exposure on syntax errors + console.error(e.stack); + setTimeout(() => { throw e; }, 0); + }); + }); +}; + +config.reset = reset; + +module.exports = config; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/config/load.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/config/load.js new file mode 100644 index 0000000..7c57d32 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/config/load.js @@ -0,0 +1,225 @@ +var debug = require('debug')('nodemon'); +var fs = require('fs'); +var path = require('path'); +var exists = fs.exists || path.exists; +var utils = require('../utils'); +var rules = require('../rules'); +var parse = require('../rules/parse'); +var exec = require('./exec'); +var defaults = require('./defaults'); + +module.exports = load; +module.exports.mutateExecOptions = mutateExecOptions; + +var existsSync = fs.existsSync || path.existsSync; + +function findAppScript() { + // nodemon has been run alone, so try to read the package file + // or try to read the index.js file + + var pkg = + existsSync(path.join(process.cwd(), 'package.json')) && + require(path.join(process.cwd(), 'package.json')); + if ((!pkg || pkg.main == undefined) && existsSync('./index.js')) { + return 'index.js'; + } +} + +/** + * Load the nodemon config, first reading the global root/nodemon.json, then + * the local nodemon.json to the exec and then overwriting using any user + * specified settings (i.e. from the cli) + * + * @param {Object} settings user defined settings + * @param {Object} options global options + * @param {Object} config the config object to be updated + * @param {Function} callback that receives complete config + */ +function load(settings, options, config, callback) { + config.loaded = []; + // first load the root nodemon.json + loadFile(options, config, utils.home, function (options) { + // then load the user's local configuration file + if (settings.configFile) { + options.configFile = path.resolve(settings.configFile); + } + loadFile(options, config, process.cwd(), function (options) { + // Then merge over with the user settings (parsed from the cli). + // Note that merge protects and favours existing values over new values, + // and thus command line arguments get priority + options = utils.merge(settings, options); + + // legacy support + if (!Array.isArray(options.ignore)) { + options.ignore = [options.ignore]; + } + + if (!options.ignoreRoot) { + options.ignoreRoot = defaults.ignoreRoot; + } + + // blend the user ignore and the default ignore together + if (options.ignoreRoot && options.ignore) { + if (!Array.isArray(options.ignoreRoot)) { + options.ignoreRoot = [options.ignoreRoot]; + } + options.ignore = options.ignoreRoot.concat(options.ignore); + } else { + options.ignore = defaults.ignore.concat(options.ignore); + } + + // add in any missing defaults + options = utils.merge(options, defaults); + + if (!options.script && !options.exec) { + var found = findAppScript(); + if (found) { + if (!options.args) { + options.args = []; + } + // if the script is found as a result of not being on the command + // line, then we move any of the pre double-dash args in execArgs + const n = + options.scriptPosition === null + ? options.args.length + : options.scriptPosition; + + options.execArgs = (options.execArgs || []).concat( + options.args.splice(0, n) + ); + options.scriptPosition = null; + + options.script = found; + } + } + + mutateExecOptions(options); + + if (options.quiet) { + utils.quiet(); + } + + if (options.verbose) { + utils.debug = true; + } + + // simplify the ready callback to be called after the rules are normalised + // from strings to regexp through the rules lib. Note that this gets + // created *after* options is overwritten twice in the lines above. + var ready = function (options) { + normaliseRules(options, callback); + }; + + ready(options); + }); + }); +} + +function normaliseRules(options, ready) { + // convert ignore and watch options to rules/regexp + rules.watch.add(options.watch); + rules.ignore.add(options.ignore); + + // normalise the watch and ignore arrays + options.watch = options.watch === false ? false : rules.rules.watch; + options.ignore = rules.rules.ignore; + + ready(options); +} + +/** + * Looks for a config in the current working directory, and a config in the + * user's home directory, merging the two together, giving priority to local + * config. This can then be overwritten later by command line arguments + * + * @param {Function} ready callback to pass loaded settings to + */ +function loadFile(options, config, dir, ready) { + if (!ready) { + ready = function () {}; + } + + var callback = function (settings) { + // prefer the local nodemon.json and fill in missing items using + // the global options + ready(utils.merge(settings, options)); + }; + + if (!dir) { + return callback({}); + } + + var filename = options.configFile || path.join(dir, 'nodemon.json'); + + if (config.loaded.indexOf(filename) !== -1) { + // don't bother re-parsing the same config file + return callback({}); + } + + fs.readFile(filename, 'utf8', function (err, data) { + if (err) { + if (err.code === 'ENOENT') { + if (!options.configFile && dir !== utils.home) { + // if no specified local config file and local nodemon.json + // doesn't exist, try the package.json + return loadPackageJSON(config, callback); + } + } + return callback({}); + } + + var settings = {}; + + try { + settings = JSON.parse(data.toString('utf8').replace(/^\uFEFF/, '')); + if (!filename.endsWith('package.json') || settings.nodemonConfig) { + config.loaded.push(filename); + } + } catch (e) { + utils.log.fail('Failed to parse config ' + filename); + console.error(e); + process.exit(1); + } + + // options values will overwrite settings + callback(settings); + }); +} + +function loadPackageJSON(config, ready) { + if (!ready) { + ready = () => {}; + } + + const dir = process.cwd(); + const filename = path.join(dir, 'package.json'); + const packageLoadOptions = { configFile: filename }; + return loadFile(packageLoadOptions, config, dir, (settings) => { + ready(settings.nodemonConfig || {}); + }); +} + +function mutateExecOptions(options) { + // work out the execOptions based on the final config we have + options.execOptions = exec( + { + script: options.script, + exec: options.exec, + args: options.args, + scriptPosition: options.scriptPosition, + nodeArgs: options.nodeArgs, + execArgs: options.execArgs, + ext: options.ext, + env: options.env, + }, + options.execMap + ); + + // clean up values that we don't need at the top level + delete options.scriptPosition; + delete options.script; + delete options.args; + delete options.ext; + + return options; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/help/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/help/index.js new file mode 100644 index 0000000..1054b60 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/help/index.js @@ -0,0 +1,27 @@ +var fs = require('fs'); +var path = require('path'); +const supportsColor = require('supports-color'); + +module.exports = help; + +const highlight = supportsColor.stdout ? '\x1B\[$1m' : ''; + +function help(item) { + if (!item) { + item = 'help'; + } else if (item === true) { // if used with -h or --help and no args + item = 'help'; + } + + // cleanse the filename to only contain letters + // aka: /\W/g but figured this was eaiser to read + item = item.replace(/[^a-z]/gi, ''); + + try { + var dir = path.join(__dirname, '..', '..', 'doc', 'cli', item + '.txt'); + var body = fs.readFileSync(dir, 'utf8'); + return body.replace(/\\x1B\[(.)m/g, highlight); + } catch (e) { + return '"' + item + '" help can\'t be found'; + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/index.js new file mode 100644 index 0000000..0eca5c4 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/index.js @@ -0,0 +1 @@ +module.exports = require('./nodemon'); \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/monitor/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/monitor/index.js new file mode 100644 index 0000000..89db029 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/monitor/index.js @@ -0,0 +1,4 @@ +module.exports = { + run: require('./run'), + watch: require('./watch').watch, +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/monitor/match.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/monitor/match.js new file mode 100644 index 0000000..bfa4f0b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/monitor/match.js @@ -0,0 +1,288 @@ +const { minimatch } = require('minimatch'); +const path = require('path'); +const fs = require('fs'); +const debug = require('debug')('nodemon:match'); +const utils = require('../utils'); + +module.exports = match; +module.exports.rulesToMonitor = rulesToMonitor; + +function rulesToMonitor(watch, ignore, config) { + var monitor = []; + + if (!Array.isArray(ignore)) { + if (ignore) { + ignore = [ignore]; + } else { + ignore = []; + } + } + + if (!Array.isArray(watch)) { + if (watch) { + watch = [watch]; + } else { + watch = []; + } + } + + if (watch && watch.length) { + monitor = utils.clone(watch); + } + + if (ignore) { + [].push.apply( + monitor, + (ignore || []).map(function (rule) { + return '!' + rule; + }) + ); + } + + var cwd = process.cwd(); + + // next check if the monitored paths are actual directories + // or just patterns - and expand the rule to include *.* + monitor = monitor.map(function (rule) { + var not = rule.slice(0, 1) === '!'; + + if (not) { + rule = rule.slice(1); + } + + if (rule === '.' || rule === '.*') { + rule = '*.*'; + } + + var dir = path.resolve(cwd, rule); + + try { + var stat = fs.statSync(dir); + if (stat.isDirectory()) { + rule = dir; + if (rule.slice(-1) !== '/') { + rule += '/'; + } + rule += '**/*'; + + // `!not` ... sorry. + if (!not) { + config.dirs.push(dir); + } + } else { + // ensures we end up in the check that tries to get a base directory + // and then adds it to the watch list + throw new Error(); + } + } catch (e) { + var base = tryBaseDir(dir); + if (!not && base) { + if (config.dirs.indexOf(base) === -1) { + config.dirs.push(base); + } + } + } + + if (rule.slice(-1) === '/') { + // just slap on a * anyway + rule += '*'; + } + + // if the url ends with * but not **/* and not *.* + // then convert to **/* - somehow it was missed :-\ + if ( + rule.slice(-4) !== '**/*' && + rule.slice(-1) === '*' && + rule.indexOf('*.') === -1 + ) { + if (rule.slice(-2) !== '**') { + rule += '*/*'; + } + } + + return (not ? '!' : '') + rule; + }); + + return monitor; +} + +function tryBaseDir(dir) { + var stat; + if (/[?*\{\[]+/.test(dir)) { + // if this is pattern, then try to find the base + try { + var base = path.dirname(dir.replace(/([?*\{\[]+.*$)/, 'foo')); + stat = fs.statSync(base); + if (stat.isDirectory()) { + return base; + } + } catch (error) { + // console.log(error); + } + } else { + try { + stat = fs.statSync(dir); + // if this path is actually a single file that exists, then just monitor + // that, *specifically*. + if (stat.isFile() || stat.isDirectory()) { + return dir; + } + } catch (e) { } + } + + return false; +} + +function match(files, monitor, ext) { + // sort the rules by highest specificity (based on number of slashes) + // ignore rules (!) get sorted highest as they take precedent + const cwd = process.cwd(); + var rules = monitor + .sort(function (a, b) { + var r = b.split(path.sep).length - a.split(path.sep).length; + var aIsIgnore = a.slice(0, 1) === '!'; + var bIsIgnore = b.slice(0, 1) === '!'; + + if (aIsIgnore || bIsIgnore) { + if (aIsIgnore) { + return -1; + } + + return 1; + } + + if (r === 0) { + return b.length - a.length; + } + return r; + }) + .map(function (s) { + var prefix = s.slice(0, 1); + + if (prefix === '!') { + if (s.indexOf('!' + cwd) === 0) { + return s; + } + + // if it starts with a period, then let's get the relative path + if (s.indexOf('!.') === 0) { + return '!' + path.resolve(cwd, s.substring(1)); + } + + return '!**' + (prefix !== path.sep ? path.sep : '') + s.slice(1); + } + + // if it starts with a period, then let's get the relative path + if (s.indexOf('.') === 0) { + return path.resolve(cwd, s); + } + + if (s.indexOf(cwd) === 0) { + return s; + } + + return '**' + (prefix !== path.sep ? path.sep : '') + s; + }); + + debug('rules', rules); + + var good = []; + var whitelist = []; // files that we won't check against the extension + var ignored = 0; + var watched = 0; + var usedRules = []; + var minimatchOpts = { + dot: true, + }; + + // enable case-insensitivity on Windows + if (utils.isWindows) { + minimatchOpts.nocase = true; + minimatchOpts.windowsPathsNoEscape = true; + } + + files.forEach(function (file) { + file = path.resolve(cwd, file); + + var matched = false; + for (var i = 0; i < rules.length; i++) { + if (rules[i].slice(0, 1) === '!') { + if (!minimatch(file, rules[i], minimatchOpts)) { + debug('ignored', file, 'rule:', rules[i]); + ignored++; + matched = true; + break; + } + } else { + debug('matched', file, 'rule:', rules[i]); + if (minimatch(file, rules[i], minimatchOpts)) { + watched++; + + // don't repeat the output if a rule is matched + if (usedRules.indexOf(rules[i]) === -1) { + usedRules.push(rules[i]); + utils.log.detail('matched rule: ' + rules[i]); + } + + // if the rule doesn't match the WATCH EVERYTHING + // but *does* match a rule that ends with *.*, then + // white list it - in that we don't run it through + // the extension check too. + if ( + rules[i] !== '**' + path.sep + '*.*' && + rules[i].slice(-3) === '*.*' + ) { + whitelist.push(file); + } else if (path.basename(file) === path.basename(rules[i])) { + // if the file matches the actual rule, then it's put on whitelist + whitelist.push(file); + } else { + good.push(file); + } + matched = true; + } else { + // utils.log.detail('no match: ' + rules[i], file); + } + } + } + if (!matched) { + ignored++; + } + }); + + // finally check the good files against the extensions that we're monitoring + if (ext) { + if (ext.indexOf(',') === -1) { + ext = '**/*.' + ext; + } else { + ext = '**/*.{' + ext + '}'; + } + + good = good.filter(function (file) { + // only compare the filename to the extension test + return minimatch(path.basename(file), ext, minimatchOpts); + }); + debug('good (filtered by ext)', good); + } else { + // else assume *.* + debug('good', good); + } + + if (whitelist.length) debug('whitelist', whitelist); + + var result = good.concat(whitelist); + + if (utils.isWindows) { + // fix for windows testing - I *think* this is okay to do + result = result.map(function (file) { + return file.slice(0, 1).toLowerCase() + file.slice(1); + }); + } + + return { + result: result, + ignored: ignored, + watched: watched, + total: files.length, + }; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/monitor/run.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/monitor/run.js new file mode 100644 index 0000000..5fa7f45 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/monitor/run.js @@ -0,0 +1,562 @@ +var debug = require('debug')('nodemon:run'); +const statSync = require('fs').statSync; +var utils = require('../utils'); +var bus = utils.bus; +var childProcess = require('child_process'); +var spawn = childProcess.spawn; +var exec = childProcess.exec; +var execSync = childProcess.execSync; +var fork = childProcess.fork; +var watch = require('./watch').watch; +var config = require('../config'); +var child = null; // the actual child process we spawn +var killedAfterChange = false; +var noop = () => {}; +var restart = null; +var psTree = require('pstree.remy'); +var path = require('path'); +var signals = require('./signals'); +const undefsafe = require('undefsafe'); +const osRelease = parseInt(require('os').release().split('.')[0], 10); + +function run(options) { + var cmd = config.command.raw; + // moved up + // we need restart function below in the global scope for run.kill + /*jshint validthis:true*/ + restart = run.bind(this, options); + run.restart = restart; + + // binding options with instance of run + // so that we can use it in run.kill + run.options = options; + + var runCmd = !options.runOnChangeOnly || config.lastStarted !== 0; + if (runCmd) { + utils.log.status('starting `' + config.command.string + '`'); + } else { + // should just watch file if command is not to be run + // had another alternate approach + // to stop process being forked/spawned in the below code + // but this approach does early exit and makes code cleaner + debug('start watch on: %s', config.options.watch); + if (config.options.watch !== false) { + watch(); + return; + } + } + + config.lastStarted = Date.now(); + + var stdio = ['pipe', 'pipe', 'pipe']; + + if (config.options.stdout) { + stdio = ['pipe', process.stdout, process.stderr]; + } + + if (config.options.stdin === false) { + stdio = [process.stdin, process.stdout, process.stderr]; + } + + var sh = 'sh'; + var shFlag = '-c'; + + const binPath = process.cwd() + '/node_modules/.bin'; + + const spawnOptions = { + env: Object.assign({}, options.execOptions.env, process.env, { + PATH: + binPath + + path.delimiter + + (undefsafe(options, '.execOptions.env.PATH') || process.env.PATH), + }), + stdio: stdio, + }; + + var executable = cmd.executable; + + if (utils.isWindows) { + // if the exec includes a forward slash, reverse it for windows compat + // but *only* apply to the first command, and none of the arguments. + // ref #1251 and #1236 + if (executable.indexOf('/') !== -1) { + executable = executable + .split(' ') + .map((e, i) => { + if (i === 0) { + return path.normalize(e); + } + return e; + }) + .join(' '); + } + // taken from npm's cli: https://git.io/vNFD4 + sh = process.env.comspec || 'cmd'; + shFlag = '/d /s /c'; + spawnOptions.windowsVerbatimArguments = true; + spawnOptions.windowsHide = true; + } + + var args = runCmd ? utils.stringify(executable, cmd.args) : ':'; + var spawnArgs = [sh, [shFlag, args], spawnOptions]; + + const firstArg = cmd.args[0] || ''; + + var inBinPath = false; + try { + inBinPath = statSync(`${binPath}/${executable}`).isFile(); + } catch (e) {} + + // hasStdio allows us to correctly handle stdin piping + // see: https://git.io/vNtX3 + const hasStdio = utils.satisfies('>= 6.4.0 || < 5'); + + // forking helps with sub-process handling and tends to clean up better + // than spawning, but it should only be used under specific conditions + const shouldFork = + !config.options.spawn && + !inBinPath && + !(firstArg.indexOf('-') === 0) && // don't fork if there's a node exec arg + firstArg !== 'inspect' && // don't fork it's `inspect` debugger + executable === 'node' && // only fork if node + utils.version.major > 4; // only fork if node version > 4 + + if (shouldFork) { + // this assumes the first argument is the script and slices it out, since + // we're forking + var forkArgs = cmd.args.slice(1); + var env = utils.merge(options.execOptions.env, process.env); + stdio.push('ipc'); + const forkOptions = { + env: env, + stdio: stdio, + silent: !hasStdio, + }; + if (utils.isWindows) { + forkOptions.windowsHide = true; + } + child = fork(options.execOptions.script, forkArgs, forkOptions); + utils.log.detail('forking'); + debug('fork', sh, shFlag, args); + } else { + utils.log.detail('spawning'); + child = spawn.apply(null, spawnArgs); + debug('spawn', sh, shFlag, args); + } + + if (config.required) { + var emit = { + stdout: function (data) { + bus.emit('stdout', data); + }, + stderr: function (data) { + bus.emit('stderr', data); + }, + }; + + // now work out what to bind to... + if (config.options.stdout) { + child.on('stdout', emit.stdout).on('stderr', emit.stderr); + } else { + child.stdout.on('data', emit.stdout); + child.stderr.on('data', emit.stderr); + + bus.stdout = child.stdout; + bus.stderr = child.stderr; + } + + if (shouldFork) { + child.on('message', function (message, sendHandle) { + bus.emit('message', message, sendHandle); + }); + } + } + + bus.emit('start'); + + utils.log.detail('child pid: ' + child.pid); + + child.on('error', function (error) { + bus.emit('error', error); + if (error.code === 'ENOENT') { + utils.log.error('unable to run executable: "' + cmd.executable + '"'); + process.exit(1); + } else { + utils.log.error('failed to start child process: ' + error.code); + throw error; + } + }); + + child.on('exit', function (code, signal) { + if (child && child.stdin) { + process.stdin.unpipe(child.stdin); + } + + if (code === 127) { + utils.log.error( + 'failed to start process, "' + cmd.executable + '" exec not found' + ); + bus.emit('error', code); + process.exit(); + } + + // If the command failed with code 2, it may or may not be a syntax error + // See: http://git.io/fNOAR + // We will only assume a parse error, if the child failed quickly + if (code === 2 && Date.now() < config.lastStarted + 500) { + utils.log.error('process failed, unhandled exit code (2)'); + utils.log.error(''); + utils.log.error('Either the command has a syntax error,'); + utils.log.error('or it is exiting with reserved code 2.'); + utils.log.error(''); + utils.log.error('To keep nodemon running even after a code 2,'); + utils.log.error('add this to the end of your command: || exit 1'); + utils.log.error(''); + utils.log.error('Read more here: https://git.io/fNOAG'); + utils.log.error(''); + utils.log.error('nodemon will stop now so that you can fix the command.'); + utils.log.error(''); + bus.emit('error', code); + process.exit(); + } + + // In case we killed the app ourselves, set the signal thusly + if (killedAfterChange) { + killedAfterChange = false; + signal = config.signal; + } + // this is nasty, but it gives it windows support + if (utils.isWindows && signal === 'SIGTERM') { + signal = config.signal; + } + + if (signal === config.signal || code === 0) { + // this was a clean exit, so emit exit, rather than crash + debug('bus.emit(exit) via ' + config.signal); + bus.emit('exit', signal); + + // exit the monitor, but do it gracefully + if (signal === config.signal) { + return restart(); + } + + if (code === 0) { + // clean exit - wait until file change to restart + if (runCmd) { + utils.log.status('clean exit - waiting for changes before restart'); + } + child = null; + } + } else { + bus.emit('crash'); + + // support the old syntax of `exitcrash` - 2024-12-13 + if (options.exitcrash) { + options.exitCrash = true; + delete options.exitcrash; + } + + if (options.exitCrash) { + utils.log.fail('app crashed'); + if (!config.required) { + process.exit(1); + } + } else { + utils.log.fail( + 'app crashed - waiting for file changes before' + ' starting...' + ); + child = null; + } + } + + if (config.options.restartable) { + // stdin needs to kick in again to be able to listen to the + // restart command + process.stdin.resume(); + } + }); + + // moved the run.kill outside to handle both the cases + // intial start + // no start + + // connect stdin to the child process (options.stdin is on by default) + if (options.stdin) { + process.stdin.resume(); + // FIXME decide whether or not we need to decide the encoding + // process.stdin.setEncoding('utf8'); + + // swallow the stdin error if it happens + // ref: https://github.com/remy/nodemon/issues/1195 + if (hasStdio) { + child.stdin.on('error', () => {}); + process.stdin.pipe(child.stdin); + } else { + if (child.stdout) { + child.stdout.pipe(process.stdout); + } else { + utils.log.error( + 'running an unsupported version of node ' + process.version + ); + utils.log.error( + 'nodemon may not work as expected - ' + + 'please consider upgrading to LTS' + ); + } + } + + bus.once('exit', function () { + if (child && process.stdin.unpipe) { + // node > 0.8 + process.stdin.unpipe(child.stdin); + } + }); + } + + debug('start watch on: %s', config.options.watch); + if (config.options.watch !== false) { + watch(); + } +} + +function waitForSubProcesses(pid, callback) { + debug('checking ps tree for pids of ' + pid); + psTree(pid, (err, pids) => { + if (!pids.length) { + return callback(); + } + + utils.log.status( + `still waiting for ${pids.length} sub-process${ + pids.length > 2 ? 'es' : '' + } to finish...` + ); + setTimeout(() => waitForSubProcesses(pid, callback), 1000); + }); +} + +function kill(child, signal, callback) { + if (!callback) { + callback = noop; + } + + if (utils.isWindows) { + const taskKill = () => { + try { + exec('taskkill /pid ' + child.pid + ' /T /F'); + } catch (e) { + utils.log.error('Could not shutdown sub process cleanly'); + } + }; + + // We are handling a 'SIGKILL' , 'SIGUSR2' and 'SIGUSR1' POSIX signal under Windows the + // same way it is handled on a UNIX system: We are performing + // a hard shutdown without waiting for the process to clean-up. + if ( + signal === 'SIGKILL' || + osRelease < 10 || + signal === 'SIGUSR2' || + signal === 'SIGUSR1' + ) { + debug('terminating process group by force: %s', child.pid); + + // We are using the taskkill utility to terminate the whole + // process group ('/t') of the child ('/pid') by force ('/f'). + // We need to end all sub processes, because the 'child' + // process in this context is actually a cmd.exe wrapper. + taskKill(); + callback(); + return; + } + + try { + // We are using the Windows Management Instrumentation Command-line + // (wmic.exe) to resolve the sub-child process identifier, because the + // 'child' process in this context is actually a cmd.exe wrapper. + // We want to send the termination signal directly to the node process. + // The '2> nul' silences the no process found error message. + const resultBuffer = execSync( + `wmic process where (ParentProcessId=${child.pid}) get ProcessId 2> nul` + ); + const result = resultBuffer.toString().match(/^[0-9]+/m); + + // If there is no sub-child process we fall back to the child process. + const processId = Array.isArray(result) ? result[0] : child.pid; + + debug('sending kill signal SIGINT to process: %s', processId); + + // We are using the standalone 'windows-kill' executable to send the + // standard POSIX signal 'SIGINT' to the node process. This fixes #1720. + const windowsKill = path.normalize( + `${__dirname}/../../bin/windows-kill.exe` + ); + + // We have to detach the 'windows-kill' execution completely from this + // process group to avoid terminating the nodemon process itself. + // See: https://github.com/alirdn/windows-kill#how-it-works--limitations + // + // Therefore we are using 'start' to create a new cmd.exe context. + // The '/min' option hides the new terminal window and the '/wait' + // option lets the process wait for the command to finish. + + execSync( + `start "windows-kill" /min /wait "${windowsKill}" -SIGINT ${processId}` + ); + } catch (e) { + taskKill(); + } + callback(); + } else { + // we use psTree to kill the full subtree of nodemon, because when + // spawning processes like `coffee` under the `--debug` flag, it'll spawn + // it's own child, and that can't be killed by nodemon, so psTree gives us + // an array of PIDs that have spawned under nodemon, and we send each the + // configured signal (default: SIGUSR2) signal, which fixes #335 + // note that psTree also works if `ps` is missing by looking in /proc + let sig = signal.replace('SIG', ''); + + psTree(child.pid, function (err, pids) { + // if ps isn't native to the OS, then we need to send the numeric value + // for the signal during the kill, `signals` is a lookup table for that. + if (!psTree.hasPS) { + sig = signals[signal]; + } + + // the sub processes need to be killed from smallest to largest + debug('sending kill signal to ' + pids.join(', ')); + + child.kill(signal); + + pids.sort().forEach((pid) => exec(`kill -${sig} ${pid}`, noop)); + + waitForSubProcesses(child.pid, () => { + // finally kill the main user process + exec(`kill -${sig} ${child.pid}`, callback); + }); + }); + } +} + +run.kill = function (noRestart, callback) { + // I hate code like this :( - Remy (author of said code) + if (typeof noRestart === 'function') { + callback = noRestart; + noRestart = false; + } + + if (!callback) { + callback = noop; + } + + if (child !== null) { + // if the stdin piping is on, we need to unpipe, but also close stdin on + // the child, otherwise linux can throw EPIPE or ECONNRESET errors. + if (run.options.stdin) { + process.stdin.unpipe(child.stdin); + } + + // For the on('exit', ...) handler above the following looks like a + // crash, so we set the killedAfterChange flag if a restart is planned + if (!noRestart) { + killedAfterChange = true; + } + + /* Now kill the entire subtree of processes belonging to nodemon */ + var oldPid = child.pid; + if (child) { + kill(child, config.signal, function () { + // this seems to fix the 0.11.x issue with the "rs" restart command, + // though I'm unsure why. it seems like more data is streamed in to + // stdin after we close. + if (child && run.options.stdin && child.stdin && oldPid === child.pid) { + child.stdin.end(); + } + callback(); + }); + } + } else if (!noRestart) { + // if there's no child, then we need to manually start the process + // this is because as there was no child, the child.on('exit') event + // handler doesn't exist which would normally trigger the restart. + bus.once('start', callback); + run.restart(); + } else { + callback(); + } +}; + +run.restart = noop; + +bus.on('quit', function onQuit(code) { + if (code === undefined) { + code = 0; + } + + // remove event listener + var exitTimer = null; + var exit = function () { + clearTimeout(exitTimer); + exit = noop; // null out in case of race condition + child = null; + if (!config.required) { + // Execute all other quit listeners. + bus.listeners('quit').forEach(function (listener) { + if (listener !== onQuit) { + listener(); + } + }); + process.exit(code); + } else { + bus.emit('exit'); + } + }; + + // if we're not running already, don't bother with trying to kill + if (config.run === false) { + return exit(); + } + + // immediately try to stop any polling + config.run = false; + + if (child) { + // give up waiting for the kids after 10 seconds + exitTimer = setTimeout(exit, 10 * 1000); + child.removeAllListeners('exit'); + child.once('exit', exit); + + kill(child, 'SIGINT'); + } else { + exit(); + } +}); + +bus.on('restart', function () { + // run.kill will send a SIGINT to the child process, which will cause it + // to terminate, which in turn uses the 'exit' event handler to restart + run.kill(); +}); + +// remove the child file on exit +process.on('exit', function () { + utils.log.detail('exiting'); + if (child) { + child.kill(); + } +}); + +// because windows borks when listening for the SIG* events +if (!utils.isWindows) { + bus.once('boot', () => { + // usual suspect: ctrl+c exit + process.once('SIGINT', () => bus.emit('quit', 130)); + process.once('SIGTERM', () => { + bus.emit('quit', 143); + if (child) { + child.kill('SIGTERM'); + } + }); + }); +} + +module.exports = run; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/monitor/signals.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/monitor/signals.js new file mode 100644 index 0000000..daff6e0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/monitor/signals.js @@ -0,0 +1,34 @@ +module.exports = { + SIGHUP: 1, + SIGINT: 2, + SIGQUIT: 3, + SIGILL: 4, + SIGTRAP: 5, + SIGABRT: 6, + SIGBUS: 7, + SIGFPE: 8, + SIGKILL: 9, + SIGUSR1: 10, + SIGSEGV: 11, + SIGUSR2: 12, + SIGPIPE: 13, + SIGALRM: 14, + SIGTERM: 15, + SIGSTKFLT: 16, + SIGCHLD: 17, + SIGCONT: 18, + SIGSTOP: 19, + SIGTSTP: 20, + SIGTTIN: 21, + SIGTTOU: 22, + SIGURG: 23, + SIGXCPU: 24, + SIGXFSZ: 25, + SIGVTALRM: 26, + SIGPROF: 27, + SIGWINCH: 28, + SIGIO: 29, + SIGPWR: 30, + SIGSYS: 31, + SIGRTMIN: 35, +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/monitor/watch.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/monitor/watch.js new file mode 100644 index 0000000..d0ac7fe --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/monitor/watch.js @@ -0,0 +1,244 @@ +module.exports.watch = watch; +module.exports.resetWatchers = resetWatchers; + +var debug = require('debug')('nodemon:watch'); +var debugRoot = require('debug')('nodemon'); +var chokidar = require('chokidar'); +var undefsafe = require('undefsafe'); +var config = require('../config'); +var path = require('path'); +var utils = require('../utils'); +var bus = utils.bus; +var match = require('./match'); +var watchers = []; +var debouncedBus; + +bus.on('reset', resetWatchers); + +function resetWatchers() { + debugRoot('resetting watchers'); + watchers.forEach(function (watcher) { + watcher.close(); + }); + watchers = []; +} + +function watch() { + if (watchers.length) { + debug('early exit on watch, still watching (%s)', watchers.length); + return; + } + + var dirs = [].slice.call(config.dirs); + + debugRoot('start watch on: %s', dirs.join(', ')); + const rootIgnored = config.options.ignore; + debugRoot('ignored', rootIgnored); + + var watchedFiles = []; + + const promise = new Promise(function (resolve) { + const dotFilePattern = /[/\\]\./; + var ignored = match.rulesToMonitor( + [], // not needed + Array.from(rootIgnored), + config + ).map(pattern => pattern.slice(1)); + + const addDotFile = dirs.filter(dir => dir.match(dotFilePattern)); + + // don't ignore dotfiles if explicitly watched. + if (addDotFile.length === 0) { + ignored.push(dotFilePattern); + } + + var watchOptions = { + ignorePermissionErrors: true, + ignored: ignored, + persistent: true, + usePolling: config.options.legacyWatch || false, + interval: config.options.pollingInterval, + // note to future developer: I've gone back and forth on adding `cwd` + // to the props and in some cases it fixes bugs but typically it causes + // bugs elsewhere (since nodemon is used is so many ways). the final + // decision is to *not* use it at all and work around it + // cwd: ... + }; + + if (utils.isWindows) { + watchOptions.disableGlobbing = true; + } + + if (utils.isIBMi) { + watchOptions.usePolling = true; + } + + if (process.env.TEST) { + watchOptions.useFsEvents = false; + } + + var watcher = chokidar.watch( + dirs, + Object.assign({}, watchOptions, config.options.watchOptions || {}) + ); + + watcher.ready = false; + + var total = 0; + + watcher.on('change', filterAndRestart); + watcher.on('unlink', filterAndRestart); + watcher.on('add', function (file) { + if (watcher.ready) { + return filterAndRestart(file); + } + + watchedFiles.push(file); + bus.emit('watching', file); + debug('chokidar watching: %s', file); + }); + watcher.on('ready', function () { + watchedFiles = Array.from(new Set(watchedFiles)); // ensure no dupes + total = watchedFiles.length; + watcher.ready = true; + resolve(total); + debugRoot('watch is complete'); + }); + + watcher.on('error', function (error) { + if (error.code === 'EINVAL') { + utils.log.error( + 'Internal watch failed. Likely cause: too many ' + + 'files being watched (perhaps from the root of a drive?\n' + + 'See https://github.com/paulmillr/chokidar/issues/229 for details' + ); + } else { + utils.log.error('Internal watch failed: ' + error.message); + process.exit(1); + } + }); + + watchers.push(watcher); + }); + + return promise.catch(e => { + // this is a core error and it should break nodemon - so I have to break + // out of a promise using the setTimeout + setTimeout(() => { + throw e; + }); + }).then(function () { + utils.log.detail(`watching ${watchedFiles.length} file${ + watchedFiles.length === 1 ? '' : 's'}`); + return watchedFiles; + }); +} + +function filterAndRestart(files) { + if (!Array.isArray(files)) { + files = [files]; + } + + if (files.length) { + var cwd = process.cwd(); + if (this.options && this.options.cwd) { + cwd = this.options.cwd; + } + + utils.log.detail( + 'files triggering change check: ' + + files + .map(file => { + const res = path.relative(cwd, file); + return res; + }) + .join(', ') + ); + + // make sure the path is right and drop an empty + // filenames (sometimes on windows) + files = files.filter(Boolean).map(file => { + return path.relative(process.cwd(), path.relative(cwd, file)); + }); + + if (utils.isWindows) { + // ensure the drive letter is in uppercase (c:\foo -> C:\foo) + files = files.map(f => { + if (f.indexOf(':') === -1) { return f; } + return f[0].toUpperCase() + f.slice(1); + }); + } + + + debug('filterAndRestart on', files); + + var matched = match( + files, + config.options.monitor, + undefsafe(config, 'options.execOptions.ext') + ); + + debug('matched?', JSON.stringify(matched)); + + // if there's no matches, then test to see if the changed file is the + // running script, if so, let's allow a restart + if (config.options.execOptions && config.options.execOptions.script) { + const script = path.resolve(config.options.execOptions.script); + if (matched.result.length === 0 && script) { + const length = script.length; + files.find(file => { + if (file.substr(-length, length) === script) { + matched = { + result: [file], + total: 1, + }; + return true; + } + }); + } + } + + utils.log.detail( + 'changes after filters (before/after): ' + + [files.length, matched.result.length].join('/') + ); + + // reset the last check so we're only looking at recently modified files + config.lastStarted = Date.now(); + + if (matched.result.length) { + if (config.options.delay > 0) { + utils.log.detail('delaying restart for ' + config.options.delay + 'ms'); + if (debouncedBus === undefined) { + debouncedBus = debounce(restartBus, config.options.delay); + } + debouncedBus(matched); + } else { + return restartBus(matched); + } + } + } +} + +function restartBus(matched) { + utils.log.status('restarting due to changes...'); + matched.result.map(file => { + utils.log.detail(path.relative(process.cwd(), file)); + }); + + if (config.options.verbose) { + utils.log._log(''); + } + + bus.emit('restart', matched.result); +} + +function debounce(fn, delay) { + var timer = null; + return function () { + const context = this; + const args = arguments; + clearTimeout(timer); + timer = setTimeout(() =>fn.apply(context, args), delay); + }; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/nodemon.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/nodemon.js new file mode 100644 index 0000000..75619ba --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/nodemon.js @@ -0,0 +1,317 @@ +var debug = require('debug')('nodemon'); +var path = require('path'); +var monitor = require('./monitor'); +var cli = require('./cli'); +var version = require('./version'); +var util = require('util'); +var utils = require('./utils'); +var bus = utils.bus; +var help = require('./help'); +/** @type {import('..').NodemonEventConfig} */ +var config = require('./config'); +var spawn = require('./spawn'); +const defaults = require('./config/defaults') +var eventHandlers = {}; + +// this is fairly dirty, but theoretically sound since it's part of the +// stable module API +config.required = utils.isRequired; + +/** + * @param {import('..').NodemonSettings | string} settings + * @returns {import('..').Nodemon} + */ +function nodemon(settings) { + bus.emit('boot'); + nodemon.reset(); + + /** @type {import('..').NodemonSettings} */ + let options + + // allow the cli string as the argument to nodemon, and allow for + // `node nodemon -V app.js` or just `-V app.js` + if (typeof settings === 'string') { + settings = settings.trim(); + if (settings.indexOf('node') !== 0) { + if (settings.indexOf('nodemon') !== 0) { + settings = 'nodemon ' + settings; + } + settings = 'node ' + settings; + } + options = cli.parse(settings); + } else options = settings; + + // set the debug flag as early as possible to get all the detailed logging + if (options.verbose) { + utils.debug = true; + } + + if (options.help) { + if (process.stdout.isTTY) { + process.stdout._handle.setBlocking(true); // nodejs/node#6456 + } + console.log(help(options.help)); + if (!config.required) { + process.exit(0); + } + } + + if (options.version) { + version().then(function (v) { + console.log(v); + if (!config.required) { + process.exit(0); + } + }); + return; + } + + // nodemon tools like grunt-nodemon. This affects where + // the script is being run from, and will affect where + // nodemon looks for the nodemon.json files + if (options.cwd) { + // this is protection to make sure we haven't dont the chdir already... + // say like in cli/parse.js (which is where we do this once already!) + if (process.cwd() !== path.resolve(config.system.cwd, options.cwd)) { + process.chdir(options.cwd); + } + } + + config.load(options, function (config) { + if (!config.options.dump && !config.options.execOptions.script && + config.options.execOptions.exec === 'node') { + if (!config.required) { + console.log(help('usage')); + process.exit(); + } + return; + } + + // before we print anything, update the colour setting on logging + utils.colours = config.options.colours; + + // always echo out the current version + utils.log.info(version.pinned); + + const cwd = process.cwd(); + + if (config.options.cwd) { + utils.log.detail('process root: ' + cwd); + } + + config.loaded.map(file => file.replace(cwd, '.')).forEach(file => { + utils.log.detail('reading config ' + file); + }); + + if (config.options.stdin && config.options.restartable) { + // allow nodemon to restart when the use types 'rs\n' + process.stdin.resume(); + process.stdin.setEncoding('utf8'); + process.stdin.on('data', data => { + const str = data.toString().trim().toLowerCase(); + + // if the keys entered match the restartable value, then restart! + if (str === config.options.restartable) { + bus.emit('restart'); + } else if (data.charCodeAt(0) === 12) { // ctrl+l + console.clear(); + } + }); + } else if (config.options.stdin) { + // so let's make sure we don't eat the key presses + // but also, since we're wrapping, watch out for + // special keys, like ctrl+c x 2 or '.exit' or ctrl+d or ctrl+l + var ctrlC = false; + var buffer = ''; + + process.stdin.on('data', function (data) { + data = data.toString(); + buffer += data; + const chr = data.charCodeAt(0); + + // if restartable, echo back + if (chr === 3) { + if (ctrlC) { + process.exit(0); + } + + ctrlC = true; + return; + } else if (buffer === '.exit' || chr === 4) { // ctrl+d + process.exit(); + } else if (chr === 13 || chr === 10) { // enter / carriage return + buffer = ''; + } else if (chr === 12) { // ctrl+l + console.clear(); + buffer = ''; + } + ctrlC = false; + }); + if (process.stdin.setRawMode) { + process.stdin.setRawMode(true); + } + } + + if (config.options.restartable) { + utils.log.info('to restart at any time, enter `' + + config.options.restartable + '`'); + } + + if (!config.required) { + const restartSignal = config.options.signal === 'SIGUSR2' ? 'SIGHUP' : 'SIGUSR2'; + process.on(restartSignal, nodemon.restart); + utils.bus.on('error', () => { + utils.log.fail((new Error().stack)); + }); + utils.log.detail((config.options.restartable ? 'or ' : '') + 'send ' + + restartSignal + ' to ' + process.pid + ' to restart'); + } + + const ignoring = config.options.monitor.map(function (rule) { + if (rule.slice(0, 1) !== '!') { + return false; + } + + rule = rule.slice(1); + + // don't notify of default ignores + if (defaults.ignoreRoot.indexOf(rule) !== -1) { + return false; + // return rule.slice(3).slice(0, -3); + } + + if (rule.startsWith(cwd)) { + return rule.replace(cwd, '.'); + } + + return rule; + }).filter(Boolean).join(' '); + if (ignoring) utils.log.detail('ignoring: ' + ignoring); + + utils.log.info('watching path(s): ' + config.options.monitor.map(function (rule) { + if (rule.slice(0, 1) !== '!') { + try { + rule = path.relative(process.cwd(), rule); + } catch (e) {} + + return rule; + } + + return false; + }).filter(Boolean).join(' ')); + + utils.log.info('watching extensions: ' + (config.options.execOptions.ext || '(all)')); + + if (config.options.dump) { + utils.log._log('log', '--------------'); + utils.log._log('log', 'node: ' + process.version); + utils.log._log('log', 'nodemon: ' + version.pinned); + utils.log._log('log', 'command: ' + process.argv.join(' ')); + utils.log._log('log', 'cwd: ' + cwd); + utils.log._log('log', ['OS:', process.platform, process.arch].join(' ')); + utils.log._log('log', '--------------'); + utils.log._log('log', util.inspect(config, { depth: null })); + utils.log._log('log', '--------------'); + if (!config.required) { + process.exit(); + } + + return; + } + + config.run = true; + + if (config.options.stdout === false) { + nodemon.on('start', function () { + nodemon.stdout = bus.stdout; + nodemon.stderr = bus.stderr; + + bus.emit('readable'); + }); + } + + if (config.options.events && Object.keys(config.options.events).length) { + Object.keys(config.options.events).forEach(function (key) { + utils.log.detail('bind ' + key + ' -> `' + + config.options.events[key] + '`'); + nodemon.on(key, function () { + if (config.options && config.options.events) { + spawn(config.options.events[key], config, + [].slice.apply(arguments)); + } + }); + }); + } + + monitor.run(config.options); + + }); + + return nodemon; +} + +nodemon.restart = function () { + utils.log.status('restarting child process'); + bus.emit('restart'); + return nodemon; +}; + +nodemon.addListener = nodemon.on = function (event, handler) { + if (!eventHandlers[event]) { eventHandlers[event] = []; } + eventHandlers[event].push(handler); + bus.on(event, handler); + return nodemon; +}; + +nodemon.once = function (event, handler) { + if (!eventHandlers[event]) { eventHandlers[event] = []; } + eventHandlers[event].push(handler); + bus.once(event, function () { + debug('bus.once(%s)', event); + eventHandlers[event].splice(eventHandlers[event].indexOf(handler), 1); + handler.apply(this, arguments); + }); + return nodemon; +}; + +nodemon.emit = function () { + bus.emit.apply(bus, [].slice.call(arguments)); + return nodemon; +}; + +nodemon.removeAllListeners = function (event) { + // unbind only the `nodemon.on` event handlers + Object.keys(eventHandlers).filter(function (e) { + return event ? e === event : true; + }).forEach(function (event) { + eventHandlers[event].forEach(function (handler) { + bus.removeListener(event, handler); + eventHandlers[event].splice(eventHandlers[event].indexOf(handler), 1); + }); + }); + + return nodemon; +}; + +nodemon.reset = function (done) { + bus.emit('reset', done); +}; + +bus.on('reset', function (done) { + debug('reset'); + nodemon.removeAllListeners(); + monitor.run.kill(true, function () { + utils.reset(); + config.reset(); + config.run = false; + if (done) { + done(); + } + }); +}); + +// expose the full config +nodemon.config = config; + +module.exports = nodemon; + diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/rules/add.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/rules/add.js new file mode 100644 index 0000000..11f1fd7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/rules/add.js @@ -0,0 +1,89 @@ +'use strict'; + +var utils = require('../utils'); + +// internal +var reEscComments = /\\#/g; +// note that '^^' is used in place of escaped comments +var reUnescapeComments = /\^\^/g; +var reComments = /#.*$/; +var reEscapeChars = /[.|\-[\]()\\]/g; +var reAsterisk = /\*/g; + +module.exports = add; + +/** + * Converts file patterns or regular expressions to nodemon + * compatible RegExp matching rules. Note: the `rules` argument + * object is modified to include the new rule and new RegExp + * + * ### Example: + * + * var rules = { watch: [], ignore: [] }; + * add(rules, 'watch', '*.js'); + * add(rules, 'ignore', '/public/'); + * add(rules, 'watch', ':(\d)*\.js'); // note: string based regexp + * add(rules, 'watch', /\d*\.js/); + * + * @param {Object} rules containing `watch` and `ignore`. Also updated during + * execution + * @param {String} which must be either "watch" or "ignore" + * @param {String|RegExp} rule the actual rule. + */ +function add(rules, which, rule) { + if (!{ ignore: 1, watch: 1}[which]) { + throw new Error('rules/index.js#add requires "ignore" or "watch" as the ' + + 'first argument'); + } + + if (Array.isArray(rule)) { + rule.forEach(function (rule) { + add(rules, which, rule); + }); + return; + } + + // support the rule being a RegExp, but reformat it to + // the custom : format that we're working with. + if (rule instanceof RegExp) { + // rule = ':' + rule.toString().replace(/^\/(.*?)\/$/g, '$1'); + utils.log.error('RegExp format no longer supported, but globs are.'); + return; + } + + // remove comments and trim lines + // this mess of replace methods is escaping "\#" to allow for emacs temp files + + // first up strip comments and remove blank head or tails + rule = (rule || '').replace(reEscComments, '^^') + .replace(reComments, '') + .replace(reUnescapeComments, '#').trim(); + + var regexp = false; + + if (typeof rule === 'string' && rule.substring(0, 1) === ':') { + rule = rule.substring(1); + utils.log.error('RegExp no longer supported: ' + rule); + regexp = true; + } else if (rule.length === 0) { + // blank line (or it was a comment) + return; + } + + if (regexp) { + // rules[which].push(rule); + } else { + // rule = rule.replace(reEscapeChars, '\\$&') + // .replace(reAsterisk, '.*'); + + rules[which].push(rule); + // compile a regexp of all the rules for this ignore or watch + var re = rules[which].map(function (rule) { + return rule.replace(reEscapeChars, '\\$&') + .replace(reAsterisk, '.*'); + }).join('|'); + + // used for the directory matching + rules[which].re = new RegExp(re); + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/rules/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/rules/index.js new file mode 100644 index 0000000..04aa92f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/rules/index.js @@ -0,0 +1,53 @@ +'use strict'; +var utils = require('../utils'); +var add = require('./add'); +var parse = require('./parse'); + +// exported +var rules = { ignore: [], watch: [] }; + +/** + * Loads a nodemon config file and populates the ignore + * and watch rules with it's contents, and calls callback + * with the new rules + * + * @param {String} filename + * @param {Function} callback + */ +function load(filename, callback) { + parse(filename, function (err, result) { + if (err) { + // we should have bombed already, but + utils.log.error(err); + callback(err); + } + + if (result.raw) { + result.raw.forEach(add.bind(null, rules, 'ignore')); + } else { + result.ignore.forEach(add.bind(null, rules, 'ignore')); + result.watch.forEach(add.bind(null, rules, 'watch')); + } + + callback(null, rules); + }); +} + +module.exports = { + reset: function () { // just used for testing + rules.ignore.length = rules.watch.length = 0; + delete rules.ignore.re; + delete rules.watch.re; + }, + load: load, + ignore: { + test: add.bind(null, rules, 'ignore'), + add: add.bind(null, rules, 'ignore'), + }, + watch: { + test: add.bind(null, rules, 'watch'), + add: add.bind(null, rules, 'watch'), + }, + add: add.bind(null, rules), + rules: rules, +}; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/rules/parse.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/rules/parse.js new file mode 100644 index 0000000..6e1cace --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/rules/parse.js @@ -0,0 +1,43 @@ +'use strict'; +var fs = require('fs'); + +/** + * Parse the nodemon config file, supporting both old style + * plain text config file, and JSON version of the config + * + * @param {String} filename + * @param {Function} callback + */ +function parse(filename, callback) { + var rules = { + ignore: [], + watch: [], + }; + + fs.readFile(filename, 'utf8', function (err, content) { + + if (err) { + return callback(err); + } + + var json = null; + try { + json = JSON.parse(content); + } catch (e) {} + + if (json !== null) { + rules = { + ignore: json.ignore || [], + watch: json.watch || [], + }; + + return callback(null, rules); + } + + // otherwise return the raw file + return callback(null, { raw: content.split(/\n/) }); + }); +} + +module.exports = parse; + diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/spawn.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/spawn.js new file mode 100644 index 0000000..256734a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/spawn.js @@ -0,0 +1,74 @@ +const path = require('path'); +const utils = require('./utils'); +const merge = utils.merge; +const bus = utils.bus; +const spawn = require('child_process').spawn; + +module.exports = function spawnCommand(command, config, eventArgs) { + var stdio = ['pipe', 'pipe', 'pipe']; + + if (config.options.stdout) { + stdio = ['pipe', process.stdout, process.stderr]; + } + + const env = merge(process.env, { FILENAME: eventArgs[0] }); + + var sh = 'sh'; + var shFlag = '-c'; + var spawnOptions = { + env: merge(config.options.execOptions.env, env), + stdio: stdio, + }; + + if (!Array.isArray(command)) { + command = [command]; + } + + if (utils.isWindows) { + // if the exec includes a forward slash, reverse it for windows compat + // but *only* apply to the first command, and none of the arguments. + // ref #1251 and #1236 + command = command.map(executable => { + if (executable.indexOf('/') === -1) { + return executable; + } + + return executable.split(' ').map((e, i) => { + if (i === 0) { + return path.normalize(e); + } + return e; + }).join(' '); + }); + // taken from npm's cli: https://git.io/vNFD4 + sh = process.env.comspec || 'cmd'; + shFlag = '/d /s /c'; + spawnOptions.windowsVerbatimArguments = true; + spawnOptions.windowsHide = true; + } + + const args = command.join(' '); + const child = spawn(sh, [shFlag, args], spawnOptions); + + if (config.required) { + var emit = { + stdout: function (data) { + bus.emit('stdout', data); + }, + stderr: function (data) { + bus.emit('stderr', data); + }, + }; + + // now work out what to bind to... + if (config.options.stdout) { + child.on('stdout', emit.stdout).on('stderr', emit.stderr); + } else { + child.stdout.on('data', emit.stdout); + child.stderr.on('data', emit.stderr); + + bus.stdout = child.stdout; + bus.stderr = child.stderr; + } + } +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/bus.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/bus.js new file mode 100644 index 0000000..4e120c5 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/bus.js @@ -0,0 +1,44 @@ +var events = require('events'); +var debug = require('debug')('nodemon'); +var util = require('util'); + +var Bus = function () { + events.EventEmitter.call(this); +}; + +util.inherits(Bus, events.EventEmitter); + +var bus = new Bus(); + +// /* +var collected = {}; +bus.on('newListener', function (event) { + debug('bus new listener: %s (%s)', event, bus.listeners(event).length); + if (!collected[event]) { + collected[event] = true; + bus.on(event, function () { + debug('bus emit: %s', event); + }); + } +}); + +// */ + +// proxy process messages (if forked) to the bus +process.on('message', function (event) { + debug('process.message(%s)', event); + bus.emit(event); +}); + +var emit = bus.emit; + +// if nodemon was spawned via a fork, allow upstream communication +// via process.send +if (process.send) { + bus.emit = function (event, data) { + process.send({ type: event, data: data }); + emit.apply(bus, arguments); + }; +} + +module.exports = bus; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/clone.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/clone.js new file mode 100644 index 0000000..6ba6330 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/clone.js @@ -0,0 +1,40 @@ +module.exports = clone; + +// via http://stackoverflow.com/a/728694/22617 +function clone(obj) { + // Handle the 3 simple types, and null or undefined + if (null === obj || 'object' !== typeof obj) { + return obj; + } + + var copy; + + // Handle Date + if (obj instanceof Date) { + copy = new Date(); + copy.setTime(obj.getTime()); + return copy; + } + + // Handle Array + if (obj instanceof Array) { + copy = []; + for (var i = 0, len = obj.length; i < len; i++) { + copy[i] = clone(obj[i]); + } + return copy; + } + + // Handle Object + if (obj instanceof Object) { + copy = {}; + for (var attr in obj) { + if (obj.hasOwnProperty && obj.hasOwnProperty(attr)) { + copy[attr] = clone(obj[attr]); + } + } + return copy; + } + + throw new Error('Unable to copy obj! Its type isn\'t supported.'); +} \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/colour.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/colour.js new file mode 100644 index 0000000..8c1b590 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/colour.js @@ -0,0 +1,26 @@ +/** + * Encodes a string in a colour: red, yellow or green + * @param {String} c colour to highlight in + * @param {String} str the string to encode + * @return {String} coloured string for terminal printing + */ +function colour(c, str) { + return (colour[c] || colour.black) + str + colour.black; +} + +function strip(str) { + re.lastIndex = 0; // reset position + return str.replace(re, ''); +} + +colour.red = '\x1B[31m'; +colour.yellow = '\x1B[33m'; +colour.green = '\x1B[32m'; +colour.black = '\x1B[39m'; + +var reStr = Object.keys(colour).map(key => colour[key]).join('|'); +var re = new RegExp(('(' + reStr + ')').replace(/\[/g, '\\['), 'g'); + +colour.strip = strip; + +module.exports = colour; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/index.js new file mode 100644 index 0000000..9265121 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/index.js @@ -0,0 +1,103 @@ +var noop = function () { }; +var path = require('path'); +const semver = require('semver'); +var version = process.versions.node.split('.') || [null, null, null]; + +var utils = (module.exports = { + semver: semver, + satisfies: test => semver.satisfies(process.versions.node, test), + version: { + major: parseInt(version[0] || 0, 10), + minor: parseInt(version[1] || 0, 10), + patch: parseInt(version[2] || 0, 10), + }, + clone: require('./clone'), + merge: require('./merge'), + bus: require('./bus'), + isWindows: process.platform === 'win32', + isMac: process.platform === 'darwin', + isLinux: process.platform === 'linux', + isIBMi: require('os').type() === 'OS400', + isRequired: (function () { + var p = module.parent; + while (p) { + // in electron.js engine it happens + if (!p.filename) { + return true; + } + if (p.filename.indexOf('bin' + path.sep + 'nodemon.js') !== -1) { + return false; + } + p = p.parent; + } + + return true; + })(), + home: process.env.HOME || process.env.HOMEPATH, + quiet: function () { + // nukes the logging + if (!this.debug) { + for (var method in utils.log) { + if (typeof utils.log[method] === 'function') { + utils.log[method] = noop; + } + } + } + }, + reset: function () { + if (!this.debug) { + for (var method in utils.log) { + if (typeof utils.log[method] === 'function') { + delete utils.log[method]; + } + } + } + this.debug = false; + }, + regexpToText: function (t) { + return t + .replace(/\.\*\\./g, '*.') + .replace(/\\{2}/g, '^^') + .replace(/\\/g, '') + .replace(/\^\^/g, '\\'); + }, + stringify: function (exec, args) { + // serializes an executable string and array of arguments into a string + args = args || []; + + return [exec] + .concat( + args.map(function (arg) { + // if an argument contains a space, we want to show it with quotes + // around it to indicate that it is a single argument + if (arg.length > 0 && arg.indexOf(' ') === -1) { + return arg; + } + // this should correctly escape nested quotes + return JSON.stringify(arg); + }) + ) + .join(' ') + .trim(); + }, +}); + +utils.log = require('./log')(utils.isRequired); + +Object.defineProperty(utils, 'debug', { + set: function (value) { + this.log.debug = value; + }, + get: function () { + return this.log.debug; + }, +}); + +Object.defineProperty(utils, 'colours', { + set: function (value) { + this.log.useColours = value; + }, + get: function () { + return this.log.useColours; + }, +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/log.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/log.js new file mode 100644 index 0000000..6580087 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/log.js @@ -0,0 +1,82 @@ +var colour = require('./colour'); +var bus = require('./bus'); +var required = false; +var useColours = true; + +var coding = { + log: 'black', + info: 'yellow', + status: 'green', + detail: 'yellow', + fail: 'red', + error: 'red', +}; + +function log(type, text) { + var msg = '[nodemon] ' + (text || ''); + + if (useColours) { + msg = colour(coding[type], msg); + } + + // always push the message through our bus, using nextTick + // to help testing and get _out of_ promises. + process.nextTick(() => { + bus.emit('log', { type: type, message: text, colour: msg }); + }); + + // but if we're running on the command line, also echo out + // question: should we actually just consume our own events? + if (!required) { + if (type === 'error') { + console.error(msg); + } else { + console.log(msg || ''); + } + } +} + +var Logger = function (r) { + if (!(this instanceof Logger)) { + return new Logger(r); + } + this.required(r); + return this; +}; + +Object.keys(coding).forEach(function (type) { + Logger.prototype[type] = log.bind(null, type); +}); + +// detail is for messages that are turned on during debug +Logger.prototype.detail = function (msg) { + if (this.debug) { + log('detail', msg); + } +}; + +Logger.prototype.required = function (val) { + required = val; +}; + +Logger.prototype.debug = false; +Logger.prototype._log = function (type, msg) { + if (required) { + bus.emit('log', { type: type, message: msg || '', colour: msg || '' }); + } else if (type === 'error') { + console.error(msg); + } else { + console.log(msg || ''); + } +}; + +Object.defineProperty(Logger.prototype, 'useColours', { + set: function (val) { + useColours = val; + }, + get: function () { + return useColours; + }, +}); + +module.exports = Logger; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/merge.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/merge.js new file mode 100644 index 0000000..1f3440b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/utils/merge.js @@ -0,0 +1,47 @@ +var clone = require('./clone'); + +module.exports = merge; + +function typesMatch(a, b) { + return (typeof a === typeof b) && (Array.isArray(a) === Array.isArray(b)); +} + +/** + * A deep merge of the source based on the target. + * @param {Object} source [description] + * @param {Object} target [description] + * @return {Object} [description] + */ +function merge(source, target, result) { + if (result === undefined) { + result = clone(source); + } + + // merge missing values from the target to the source + Object.getOwnPropertyNames(target).forEach(function (key) { + if (source[key] === undefined) { + result[key] = target[key]; + } + }); + + Object.getOwnPropertyNames(source).forEach(function (key) { + var value = source[key]; + + if (target[key] && typesMatch(value, target[key])) { + // merge empty values + if (value === '') { + result[key] = target[key]; + } + + if (Array.isArray(value)) { + if (value.length === 0 && target[key].length) { + result[key] = target[key].slice(0); + } + } else if (typeof value === 'object') { + result[key] = merge(value, target[key]); + } + } + }); + + return result; +} \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/version.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/version.js new file mode 100644 index 0000000..d0f5104 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/lib/version.js @@ -0,0 +1,100 @@ +module.exports = version; +module.exports.pin = pin; + +var fs = require('fs'); +var path = require('path'); +var exec = require('child_process').exec; +var root = null; + +function pin() { + return version().then(function (v) { + version.pinned = v; + }); +} + +function version(callback) { + // first find the package.json as this will be our root + var promise = findPackage(path.dirname(module.parent.filename)) + .then(function (dir) { + // now try to load the package + var v = require(path.resolve(dir, 'package.json')).version; + + if (v && v !== '0.0.0-development') { + return v; + } + + root = dir; + + // else we're in development, give the commit out + // get the last commit and whether the working dir is dirty + var promises = [ + branch().catch(function () { return 'master'; }), + commit().catch(function () { return ''; }), + dirty().catch(function () { return 0; }), + ]; + + // use the cached result as the export + return Promise.all(promises).then(function (res) { + var branch = res[0]; + var commit = res[1]; + var dirtyCount = parseInt(res[2], 10); + var curr = branch + ': ' + commit; + if (dirtyCount !== 0) { + curr += ' (' + dirtyCount + ' dirty files)'; + } + + return curr; + }); + }).catch(function (error) { + console.log(error.stack); + throw error; + }); + + if (callback) { + promise.then(function (res) { + callback(null, res); + }, callback); + } + + return promise; +} + +function findPackage(dir) { + if (dir === '/') { + return Promise.reject(new Error('package not found')); + } + return new Promise(function (resolve) { + fs.stat(path.resolve(dir, 'package.json'), function (error, exists) { + if (error || !exists) { + return resolve(findPackage(path.resolve(dir, '..'))); + } + + resolve(dir); + }); + }); +} + +function command(cmd) { + return new Promise(function (resolve, reject) { + exec(cmd, { cwd: root }, function (err, stdout, stderr) { + var error = stderr.trim(); + if (error) { + return reject(new Error(error)); + } + resolve(stdout.split('\n').join('')); + }); + }); +} + +function commit() { + return command('git rev-parse HEAD'); +} + +function branch() { + return command('git rev-parse --abbrev-ref HEAD'); +} + +function dirty() { + return command('expr $(git status --porcelain 2>/dev/null| ' + + 'egrep "^(M| M)" | wc -l)'); +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/package.json new file mode 100644 index 0000000..f742a1e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/nodemon/package.json @@ -0,0 +1,78 @@ +{ + "name": "nodemon", + "homepage": "https://nodemon.io", + "author": { + "name": "Remy Sharp", + "url": "https://github.com/remy" + }, + "bin": { + "nodemon": "./bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "repository": { + "type": "git", + "url": "https://github.com/remy/nodemon.git" + }, + "description": "Simple monitor script for use during development of a Node.js app.", + "keywords": [ + "cli", + "monitor", + "monitor", + "development", + "restart", + "autoload", + "reload", + "terminal" + ], + "license": "MIT", + "types": "./index.d.ts", + "main": "./lib/nodemon", + "scripts": { + "commitmsg": "commitlint -e", + "coverage": "istanbul cover _mocha -- --timeout 30000 --ui bdd --reporter list test/**/*.test.js", + "lint": "eslint lib/**/*.js", + "test": "npm run lint && npm run spec", + "spec": "for FILE in test/**/*.test.js; do echo $FILE; TEST=1 mocha --exit --timeout 30000 $FILE; if [ $? -ne 0 ]; then exit 1; fi; sleep 1; done", + "postspec": "npm run clean", + "clean": "rm -rf test/fixtures/test*.js test/fixtures/test*.md", + "web": "node web", + "semantic-release": "semantic-release", + "prepush": "npm run lint", + "killall": "ps auxww | grep node | grep -v grep | awk '{ print $2 }' | xargs kill -9" + }, + "devDependencies": { + "@commitlint/cli": "^11.0.0", + "@commitlint/config-conventional": "^11.0.0", + "async": "1.4.2", + "coffee-script": "~1.7.1", + "eslint": "^7.32.0", + "husky": "^7.0.4", + "mocha": "^2.5.3", + "nyc": "^15.1.0", + "proxyquire": "^1.8.0", + "semantic-release": "^25.0.0", + "should": "~4.0.0" + }, + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^10.2.1", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "version": "3.1.14", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + }, + "publishConfig": { + "provenance": true + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/normalize-path/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/normalize-path/LICENSE new file mode 100644 index 0000000..d32ab44 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/normalize-path/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2018, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/normalize-path/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/normalize-path/README.md new file mode 100644 index 0000000..726d4d6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/normalize-path/README.md @@ -0,0 +1,127 @@ +# normalize-path [![NPM version](https://img.shields.io/npm/v/normalize-path.svg?style=flat)](https://www.npmjs.com/package/normalize-path) [![NPM monthly downloads](https://img.shields.io/npm/dm/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![NPM total downloads](https://img.shields.io/npm/dt/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/normalize-path.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/normalize-path) + +> Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save normalize-path +``` + +## Usage + +```js +const normalize = require('normalize-path'); + +console.log(normalize('\\foo\\bar\\baz\\')); +//=> '/foo/bar/baz' +``` + +**win32 namespaces** + +```js +console.log(normalize('\\\\?\\UNC\\Server01\\user\\docs\\Letter.txt')); +//=> '//?/UNC/Server01/user/docs/Letter.txt' + +console.log(normalize('\\\\.\\CdRomX')); +//=> '//./CdRomX' +``` + +**Consecutive slashes** + +Condenses multiple consecutive forward slashes (except for leading slashes in win32 namespaces) to a single slash. + +```js +console.log(normalize('.//foo//bar///////baz/')); +//=> './foo/bar/baz' +``` + +### Trailing slashes + +By default trailing slashes are removed. Pass `false` as the last argument to disable this behavior and _**keep** trailing slashes_: + +```js +console.log(normalize('foo\\bar\\baz\\', false)); //=> 'foo/bar/baz/' +console.log(normalize('./foo/bar/baz/', false)); //=> './foo/bar/baz/' +``` + +## Release history + +### v3.0 + +No breaking changes in this release. + +* a check was added to ensure that [win32 namespaces](https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces) are handled properly by win32 `path.parse()` after a path has been normalized by this library. +* a minor optimization was made to simplify how the trailing separator was handled + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +Other useful path-related libraries: + +* [contains-path](https://www.npmjs.com/package/contains-path): Return true if a file path contains the given path. | [homepage](https://github.com/jonschlinkert/contains-path "Return true if a file path contains the given path.") +* [is-absolute](https://www.npmjs.com/package/is-absolute): Returns true if a file path is absolute. Does not rely on the path module… [more](https://github.com/jonschlinkert/is-absolute) | [homepage](https://github.com/jonschlinkert/is-absolute "Returns true if a file path is absolute. Does not rely on the path module and can be used as a polyfill for node.js native `path.isAbolute`.") +* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.") +* [parse-filepath](https://www.npmjs.com/package/parse-filepath): Pollyfill for node.js `path.parse`, parses a filepath into an object. | [homepage](https://github.com/jonschlinkert/parse-filepath "Pollyfill for node.js `path.parse`, parses a filepath into an object.") +* [path-ends-with](https://www.npmjs.com/package/path-ends-with): Return `true` if a file path ends with the given string/suffix. | [homepage](https://github.com/jonschlinkert/path-ends-with "Return `true` if a file path ends with the given string/suffix.") +* [unixify](https://www.npmjs.com/package/unixify): Convert Windows file paths to unix paths. | [homepage](https://github.com/jonschlinkert/unixify "Convert Windows file paths to unix paths.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 35 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [phated](https://github.com/phated) | + +### Author + +**Jon Schlinkert** + +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on April 19, 2018._ \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/normalize-path/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/normalize-path/index.js new file mode 100644 index 0000000..6fac553 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/normalize-path/index.js @@ -0,0 +1,35 @@ +/*! + * normalize-path + * + * Copyright (c) 2014-2018, Jon Schlinkert. + * Released under the MIT License. + */ + +module.exports = function(path, stripTrailing) { + if (typeof path !== 'string') { + throw new TypeError('expected path to be a string'); + } + + if (path === '\\' || path === '/') return '/'; + + var len = path.length; + if (len <= 1) return path; + + // ensure that win32 namespaces has two leading slashes, so that the path is + // handled properly by the win32 version of path.parse() after being normalized + // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces + var prefix = ''; + if (len > 4 && path[3] === '\\') { + var ch = path[2]; + if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') { + path = path.slice(2); + prefix = '//'; + } + } + + var segs = path.split(/[/\\]+/); + if (stripTrailing !== false && segs[segs.length - 1] === '') { + segs.pop(); + } + return prefix + segs.join('/'); +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/normalize-path/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/normalize-path/package.json new file mode 100644 index 0000000..ad61098 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/normalize-path/package.json @@ -0,0 +1,77 @@ +{ + "name": "normalize-path", + "description": "Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled.", + "version": "3.0.0", + "homepage": "https://github.com/jonschlinkert/normalize-path", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Blaine Bublitz (https://twitter.com/BlaineBublitz)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "jonschlinkert/normalize-path", + "bugs": { + "url": "https://github.com/jonschlinkert/normalize-path/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "gulp-format-md": "^1.0.0", + "minimist": "^1.2.0", + "mocha": "^3.5.3" + }, + "keywords": [ + "absolute", + "backslash", + "delimiter", + "file", + "file-path", + "filepath", + "fix", + "forward", + "fp", + "fs", + "normalize", + "path", + "relative", + "separator", + "slash", + "slashes", + "trailing", + "unix", + "urix" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "description": "Other useful path-related libraries:", + "list": [ + "contains-path", + "is-absolute", + "is-relative", + "parse-filepath", + "path-ends-with", + "path-ends-with", + "unixify" + ] + }, + "lint": { + "reflinks": true + } + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/.eslintrc b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/.eslintrc new file mode 100644 index 0000000..21f9039 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/.eslintrc @@ -0,0 +1,53 @@ +{ + "root": true, + "extends": "@ljharb", + "rules": { + "complexity": 0, + "func-style": [2, "declaration"], + "indent": [2, 4], + "max-lines": 1, + "max-lines-per-function": 1, + "max-params": [2, 4], + "max-statements": 0, + "max-statements-per-line": [2, { "max": 2 }], + "no-magic-numbers": 0, + "no-param-reassign": 1, + "strict": 0, // TODO + }, + "overrides": [ + { + "files": ["test/**", "test-*", "example/**"], + "extends": "@ljharb/eslint-config/tests", + "rules": { + "id-length": 0, + }, + }, + { + "files": ["example/**"], + "rules": { + "no-console": 0, + }, + }, + { + "files": ["test/browser/**"], + "env": { + "browser": true, + }, + }, + { + "files": ["test/bigint*"], + "rules": { + "new-cap": [2, { "capIsNewExceptions": ["BigInt"] }], + }, + }, + { + "files": "index.js", + "globals": { + "HTMLElement": false, + }, + "rules": { + "no-use-before-define": 1, + }, + }, + ], +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/.github/FUNDING.yml b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/.github/FUNDING.yml new file mode 100644 index 0000000..730276b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/object-inspect +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/.nycrc b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/.nycrc new file mode 100644 index 0000000..58a5db7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "instrumentation": false, + "sourceMap": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "example", + "test", + "test-core-js.js" + ] +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/CHANGELOG.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/CHANGELOG.md new file mode 100644 index 0000000..bdf9002 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/CHANGELOG.md @@ -0,0 +1,424 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.13.4](https://github.com/inspect-js/object-inspect/compare/v1.13.3...v1.13.4) - 2025-02-04 + +### Commits + +- [Fix] avoid being fooled by a `Symbol.toStringTag` [`fa5870d`](https://github.com/inspect-js/object-inspect/commit/fa5870da468a525d2f20193700f70752f506cbf7) +- [Tests] fix tests in node v6.0 - v6.4 [`2abfe1b`](https://github.com/inspect-js/object-inspect/commit/2abfe1bc3c69f9293c07c5cd65a9d7d87a628b84) +- [Dev Deps] update `es-value-fixtures`, `for-each`, `has-symbols` [`3edfb01`](https://github.com/inspect-js/object-inspect/commit/3edfb01cc8cce220fba0dfdfe2dc8bc955758cdd) + +## [v1.13.3](https://github.com/inspect-js/object-inspect/compare/v1.13.2...v1.13.3) - 2024-11-09 + +### Commits + +- [actions] split out node 10-20, and 20+ [`44395a8`](https://github.com/inspect-js/object-inspect/commit/44395a8fc1deda6718a5e125e86b9ffcaa1c7580) +- [Fix] `quoteStyle`: properly escape only the containing quotes [`5137f8f`](https://github.com/inspect-js/object-inspect/commit/5137f8f7bea69a7fc671bb683fd35f244f38fc52) +- [Refactor] clean up `quoteStyle` code [`450680c`](https://github.com/inspect-js/object-inspect/commit/450680cd50de4e689ee3b8e1d6db3a1bcf3fc18c) +- [Tests] add `quoteStyle` escaping tests [`e997c59`](https://github.com/inspect-js/object-inspect/commit/e997c595aeaea84fd98ca35d7e1c3b5ab3ae26e0) +- [Dev Deps] update `auto-changelog`, `es-value-fixtures`, `tape` [`d5a469c`](https://github.com/inspect-js/object-inspect/commit/d5a469c99ec07ccaeafc36ac4b36a93285086d48) +- [Tests] replace `aud` with `npm audit` [`fb7815f`](https://github.com/inspect-js/object-inspect/commit/fb7815f9b72cae277a04f65bbb0543f85b88be62) +- [Dev Deps] update `mock-property` [`11c817b`](https://github.com/inspect-js/object-inspect/commit/11c817bf10392aa017755962ba6bc89d731359ee) + +## [v1.13.2](https://github.com/inspect-js/object-inspect/compare/v1.13.1...v1.13.2) - 2024-06-21 + +### Commits + +- [readme] update badges [`8a51e6b`](https://github.com/inspect-js/object-inspect/commit/8a51e6bedaf389ec40cc4659e9df53e8543d176e) +- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`ef05f58`](https://github.com/inspect-js/object-inspect/commit/ef05f58c9761a41416ab907299bf0fa79517014b) +- [Dev Deps] update `error-cause`, `has-tostringtag`, `tape` [`c0c6c26`](https://github.com/inspect-js/object-inspect/commit/c0c6c26c44cee6671f7c5d43d2b91d27c5c00d90) +- [Fix] Don't throw when `global` is not defined [`d4d0965`](https://github.com/inspect-js/object-inspect/commit/d4d096570f7dbd0e03266a96de11d05eb7b63e0f) +- [meta] add missing `engines.node` [`17a352a`](https://github.com/inspect-js/object-inspect/commit/17a352af6fe1ba6b70a19081674231eb1a50c940) +- [Dev Deps] update `globalthis` [`9c08884`](https://github.com/inspect-js/object-inspect/commit/9c08884aa662a149e2f11403f413927736b97da7) +- [Dev Deps] update `error-cause` [`6af352d`](https://github.com/inspect-js/object-inspect/commit/6af352d7c3929a4cc4c55768c27bf547a5e900f4) +- [Dev Deps] update `npmignore` [`94e617d`](https://github.com/inspect-js/object-inspect/commit/94e617d38831722562fa73dff4c895746861d267) +- [Dev Deps] update `mock-property` [`2ac24d7`](https://github.com/inspect-js/object-inspect/commit/2ac24d7e58cd388ad093c33249e413e05bbfd6c3) +- [Dev Deps] update `tape` [`46125e5`](https://github.com/inspect-js/object-inspect/commit/46125e58f1d1dcfb170ed3d1ea69da550ea8d77b) + +## [v1.13.1](https://github.com/inspect-js/object-inspect/compare/v1.13.0...v1.13.1) - 2023-10-19 + +### Commits + +- [Fix] in IE 8, global can !== window despite them being prototypes of each other [`30d0859`](https://github.com/inspect-js/object-inspect/commit/30d0859dc4606cf75c2410edcd5d5c6355f8d372) + +## [v1.13.0](https://github.com/inspect-js/object-inspect/compare/v1.12.3...v1.13.0) - 2023-10-14 + +### Commits + +- [New] add special handling for the global object [`431bab2`](https://github.com/inspect-js/object-inspect/commit/431bab21a490ee51d35395966a504501e8c685da) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`fd4f619`](https://github.com/inspect-js/object-inspect/commit/fd4f6193562b4b0e95dcf5c0201b4e8cbbc4f58d) +- [Dev Deps] update `mock-property`, `tape` [`b453f6c`](https://github.com/inspect-js/object-inspect/commit/b453f6ceeebf8a1b738a1029754092e0367a4134) +- [Dev Deps] update `error-cause` [`e8ffc57`](https://github.com/inspect-js/object-inspect/commit/e8ffc577d73b92bb6a4b00c44f14e3319e374888) +- [Dev Deps] update `tape` [`054b8b9`](https://github.com/inspect-js/object-inspect/commit/054b8b9b98633284cf989e582450ebfbbe53503c) +- [Dev Deps] temporarily remove `aud` due to breaking change in transitive deps [`2476845`](https://github.com/inspect-js/object-inspect/commit/2476845e0678dd290c541c81cd3dec8420782c52) +- [Dev Deps] pin `glob`, since v10.3.8+ requires a broken `jackspeak` [`383fa5e`](https://github.com/inspect-js/object-inspect/commit/383fa5eebc0afd705cc778a4b49d8e26452e49a8) +- [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6 [`68c244c`](https://github.com/inspect-js/object-inspect/commit/68c244c5174cdd877e5dcb8ee90aa3f44b2f25be) + +## [v1.12.3](https://github.com/inspect-js/object-inspect/compare/v1.12.2...v1.12.3) - 2023-01-12 + +### Commits + +- [Fix] in eg FF 24, collections lack forEach [`75fc226`](https://github.com/inspect-js/object-inspect/commit/75fc22673c82d45f28322b1946bb0eb41b672b7f) +- [actions] update rebase action to use reusable workflow [`250a277`](https://github.com/inspect-js/object-inspect/commit/250a277a095e9dacc029ab8454dcfc15de549dcd) +- [Dev Deps] update `aud`, `es-value-fixtures`, `tape` [`66a19b3`](https://github.com/inspect-js/object-inspect/commit/66a19b3209ccc3c5ef4b34c3cb0160e65d1ce9d5) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `error-cause` [`c43d332`](https://github.com/inspect-js/object-inspect/commit/c43d3324b48384a16fd3dc444e5fc589d785bef3) +- [Tests] add `@pkgjs/support` to `postlint` [`e2618d2`](https://github.com/inspect-js/object-inspect/commit/e2618d22a7a3fa361b6629b53c1752fddc9c4d80) + +## [v1.12.2](https://github.com/inspect-js/object-inspect/compare/v1.12.1...v1.12.2) - 2022-05-26 + +### Commits + +- [Fix] use `util.inspect` for a custom inspection symbol method [`e243bf2`](https://github.com/inspect-js/object-inspect/commit/e243bf2eda6c4403ac6f1146fddb14d12e9646c1) +- [meta] add support info [`ca20ba3`](https://github.com/inspect-js/object-inspect/commit/ca20ba35713c17068ca912a86c542f5e8acb656c) +- [Fix] ignore `cause` in node v16.9 and v16.10 where it has a bug [`86aa553`](https://github.com/inspect-js/object-inspect/commit/86aa553a4a455562c2c56f1540f0bf857b9d314b) + +## [v1.12.1](https://github.com/inspect-js/object-inspect/compare/v1.12.0...v1.12.1) - 2022-05-21 + +### Commits + +- [Tests] use `mock-property` [`4ec8893`](https://github.com/inspect-js/object-inspect/commit/4ec8893ea9bfd28065ca3638cf6762424bf44352) +- [meta] use `npmignore` to autogenerate an npmignore file [`07f868c`](https://github.com/inspect-js/object-inspect/commit/07f868c10bd25a9d18686528339bb749c211fc9a) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`b05244b`](https://github.com/inspect-js/object-inspect/commit/b05244b4f331e00c43b3151bc498041be77ccc91) +- [Dev Deps] update `@ljharb/eslint-config`, `error-cause`, `es-value-fixtures`, `functions-have-names`, `tape` [`d037398`](https://github.com/inspect-js/object-inspect/commit/d037398dcc5d531532e4c19c4a711ed677f579c1) +- [Fix] properly handle callable regexes in older engines [`848fe48`](https://github.com/inspect-js/object-inspect/commit/848fe48bd6dd0064ba781ee6f3c5e54a94144c37) + +## [v1.12.0](https://github.com/inspect-js/object-inspect/compare/v1.11.1...v1.12.0) - 2021-12-18 + +### Commits + +- [New] add `numericSeparator` boolean option [`2d2d537`](https://github.com/inspect-js/object-inspect/commit/2d2d537f5359a4300ce1c10241369f8024f89e11) +- [Robustness] cache more prototype methods [`191533d`](https://github.com/inspect-js/object-inspect/commit/191533da8aec98a05eadd73a5a6e979c9c8653e8) +- [New] ensure an Error’s `cause` is displayed [`53bc2ce`](https://github.com/inspect-js/object-inspect/commit/53bc2cee4e5a9cc4986f3cafa22c0685f340715e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`bc164b6`](https://github.com/inspect-js/object-inspect/commit/bc164b6e2e7d36b263970f16f54de63048b84a36) +- [Robustness] cache `RegExp.prototype.test` [`a314ab8`](https://github.com/inspect-js/object-inspect/commit/a314ab8271b905cbabc594c82914d2485a8daf12) +- [meta] fix auto-changelog settings [`5ed0983`](https://github.com/inspect-js/object-inspect/commit/5ed0983be72f73e32e2559997517a95525c7e20d) + +## [v1.11.1](https://github.com/inspect-js/object-inspect/compare/v1.11.0...v1.11.1) - 2021-12-05 + +### Commits + +- [meta] add `auto-changelog` [`7dbdd22`](https://github.com/inspect-js/object-inspect/commit/7dbdd228401d6025d8b7391476d88aee9ea9bbdf) +- [actions] reuse common workflows [`c8823bc`](https://github.com/inspect-js/object-inspect/commit/c8823bc0a8790729680709d45fb6e652432e91aa) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`7532b12`](https://github.com/inspect-js/object-inspect/commit/7532b120598307497b712890f75af8056f6d37a6) +- [Refactor] use `has-tostringtag` to behave correctly in the presence of symbol shams [`94abb5d`](https://github.com/inspect-js/object-inspect/commit/94abb5d4e745bf33253942dea86b3e538d2ff6c6) +- [actions] update codecov uploader [`5ed5102`](https://github.com/inspect-js/object-inspect/commit/5ed51025267a00e53b1341357315490ac4eb0874) +- [Dev Deps] update `eslint`, `tape` [`37b2ad2`](https://github.com/inspect-js/object-inspect/commit/37b2ad26c08d94bfd01d5d07069a0b28ef4e2ad7) +- [meta] add `sideEffects` flag [`d341f90`](https://github.com/inspect-js/object-inspect/commit/d341f905ef8bffa6a694cda6ddc5ba343532cd4f) + +## [v1.11.0](https://github.com/inspect-js/object-inspect/compare/v1.10.3...v1.11.0) - 2021-07-12 + +### Commits + +- [New] `customInspect`: add `symbol` option, to mimic modern util.inspect behavior [`e973a6e`](https://github.com/inspect-js/object-inspect/commit/e973a6e21f8140c5837cf25e9d89bdde88dc3120) +- [Dev Deps] update `eslint` [`05f1cb3`](https://github.com/inspect-js/object-inspect/commit/05f1cb3cbcfe1f238e8b51cf9bc294305b7ed793) + +## [v1.10.3](https://github.com/inspect-js/object-inspect/compare/v1.10.2...v1.10.3) - 2021-05-07 + +### Commits + +- [Fix] handle core-js Symbol shams [`4acfc2c`](https://github.com/inspect-js/object-inspect/commit/4acfc2c4b503498759120eb517abad6d51c9c5d6) +- [readme] update badges [`95c323a`](https://github.com/inspect-js/object-inspect/commit/95c323ad909d6cbabb95dd6015c190ba6db9c1f2) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud` [`cb38f48`](https://github.com/inspect-js/object-inspect/commit/cb38f485de6ec7a95109b5a9bbd0a1deba2f6611) + +## [v1.10.2](https://github.com/inspect-js/object-inspect/compare/v1.10.1...v1.10.2) - 2021-04-17 + +### Commits + +- [Fix] use a robust check for a boxed Symbol [`87f12d6`](https://github.com/inspect-js/object-inspect/commit/87f12d6e69ce530be04659c81a4cd502943acac5) + +## [v1.10.1](https://github.com/inspect-js/object-inspect/compare/v1.10.0...v1.10.1) - 2021-04-17 + +### Commits + +- [Fix] use a robust check for a boxed bigint [`d5ca829`](https://github.com/inspect-js/object-inspect/commit/d5ca8298b6d2e5c7b9334a5b21b96ed95d225c91) + +## [v1.10.0](https://github.com/inspect-js/object-inspect/compare/v1.9.0...v1.10.0) - 2021-04-17 + +### Commits + +- [Tests] increase coverage [`d8abb8a`](https://github.com/inspect-js/object-inspect/commit/d8abb8a62c2f084919df994a433b346e0d87a227) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`4bfec2e`](https://github.com/inspect-js/object-inspect/commit/4bfec2e30aaef6ddef6cbb1448306f9f8b9520b7) +- [New] respect `Symbol.toStringTag` on objects [`799b58f`](https://github.com/inspect-js/object-inspect/commit/799b58f536a45e4484633a8e9daeb0330835f175) +- [Fix] do not allow Symbol.toStringTag to masquerade as builtins [`d6c5b37`](https://github.com/inspect-js/object-inspect/commit/d6c5b37d7e94427796b82432fb0c8964f033a6ab) +- [New] add `WeakRef` support [`b6d898e`](https://github.com/inspect-js/object-inspect/commit/b6d898ee21868c780a7ee66b28532b5b34ed7f09) +- [meta] do not publish github action workflow files [`918cdfc`](https://github.com/inspect-js/object-inspect/commit/918cdfc4b6fe83f559ff6ef04fe66201e3ff5cbd) +- [meta] create `FUNDING.yml` [`0bb5fc5`](https://github.com/inspect-js/object-inspect/commit/0bb5fc516dbcd2cd728bd89cee0b580acc5ce301) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`22c8dc0`](https://github.com/inspect-js/object-inspect/commit/22c8dc0cac113d70f4781e49a950070923a671be) +- [meta] use `prepublishOnly` script for npm 7+ [`e52ee09`](https://github.com/inspect-js/object-inspect/commit/e52ee09e8050b8dbac94ef57f786675567728223) +- [Dev Deps] update `eslint` [`7c4e6fd`](https://github.com/inspect-js/object-inspect/commit/7c4e6fdedcd27cc980e13c9ad834d05a96f3d40c) + +## [v1.9.0](https://github.com/inspect-js/object-inspect/compare/v1.8.0...v1.9.0) - 2020-11-30 + +### Commits + +- [Tests] migrate tests to Github Actions [`d262251`](https://github.com/inspect-js/object-inspect/commit/d262251e13e16d3490b5473672f6b6d6ff86675d) +- [New] add enumerable own Symbols to plain object output [`ee60c03`](https://github.com/inspect-js/object-inspect/commit/ee60c033088cff9d33baa71e59a362a541b48284) +- [Tests] add passing tests [`01ac3e4`](https://github.com/inspect-js/object-inspect/commit/01ac3e4b5a30f97875a63dc9b1416b3bd626afc9) +- [actions] add "Require Allow Edits" action [`c2d7746`](https://github.com/inspect-js/object-inspect/commit/c2d774680cde4ca4af332d84d4121b26f798ba9e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `core-js` [`70058de`](https://github.com/inspect-js/object-inspect/commit/70058de1579fc54d1d15ed6c2dbe246637ce70ff) +- [Fix] hex characters in strings should be uppercased, to match node `assert` [`6ab8faa`](https://github.com/inspect-js/object-inspect/commit/6ab8faaa0abc08fe7a8e2afd8b39c6f1f0e00113) +- [Tests] run `nyc` on all tests [`4c47372`](https://github.com/inspect-js/object-inspect/commit/4c473727879ddc8e28b599202551ddaaf07b6210) +- [Tests] node 0.8 has an unpredictable property order; fix `groups` test by removing property [`f192069`](https://github.com/inspect-js/object-inspect/commit/f192069a978a3b60e6f0e0d45ac7df260ab9a778) +- [New] add enumerable properties to Function inspect result, per node’s `assert` [`fd38e1b`](https://github.com/inspect-js/object-inspect/commit/fd38e1bc3e2a1dc82091ce3e021917462eee64fc) +- [Tests] fix tests for node < 10, due to regex match `groups` [`2ac6462`](https://github.com/inspect-js/object-inspect/commit/2ac6462cc4f72eaa0b63a8cfee9aabe3008b2330) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`44b59e2`](https://github.com/inspect-js/object-inspect/commit/44b59e2676a7f825ef530dfd19dafb599e3b9456) +- [Robustness] cache `Symbol.prototype.toString` [`f3c2074`](https://github.com/inspect-js/object-inspect/commit/f3c2074d8f32faf8292587c07c9678ea931703dd) +- [Dev Deps] update `eslint` [`9411294`](https://github.com/inspect-js/object-inspect/commit/94112944b9245e3302e25453277876402d207e7f) +- [meta] `require-allow-edits` no longer requires an explicit github token [`36c0220`](https://github.com/inspect-js/object-inspect/commit/36c02205de3c2b0e84d53777c5c9fd54a36c48ab) +- [actions] update rebase checkout action to v2 [`55a39a6`](https://github.com/inspect-js/object-inspect/commit/55a39a64e944f19c6a7d8efddf3df27700f20d14) +- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`f59fd3c`](https://github.com/inspect-js/object-inspect/commit/f59fd3cf406c3a7c7ece140904a80bbc6bacfcca) +- [Dev Deps] update `eslint` [`a492bec`](https://github.com/inspect-js/object-inspect/commit/a492becec644b0155c9c4bc1caf6f9fac11fb2c7) + +## [v1.8.0](https://github.com/inspect-js/object-inspect/compare/v1.7.0...v1.8.0) - 2020-06-18 + +### Fixed + +- [New] add `indent` option [`#27`](https://github.com/inspect-js/object-inspect/issues/27) + +### Commits + +- [Tests] add codecov [`4324cbb`](https://github.com/inspect-js/object-inspect/commit/4324cbb1a2bd7710822a4151ff373570db22453e) +- [New] add `maxStringLength` option [`b3995cb`](https://github.com/inspect-js/object-inspect/commit/b3995cb71e15b5ee127a3094c43994df9d973502) +- [New] add `customInspect` option, to disable custom inspect methods [`28b9179`](https://github.com/inspect-js/object-inspect/commit/28b9179ee802bb3b90810100c11637db90c2fb6d) +- [Tests] add Date and RegExp tests [`3b28eca`](https://github.com/inspect-js/object-inspect/commit/3b28eca57b0367aeadffac604ea09e8bdae7d97b) +- [actions] add automatic rebasing / merge commit blocking [`0d9c6c0`](https://github.com/inspect-js/object-inspect/commit/0d9c6c044e83475ff0bfffb9d35b149834c83a2e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `tape`; add `aud` [`7c204f2`](https://github.com/inspect-js/object-inspect/commit/7c204f22b9e41bc97147f4d32d4cb045b17769a6) +- [readme] fix repo URLs, remove testling [`34ca9a0`](https://github.com/inspect-js/object-inspect/commit/34ca9a0dabfe75bd311f806a326fadad029909a3) +- [Fix] when truncating a deep array, note it as `[Array]` instead of just `[Object]` [`f74c82d`](https://github.com/inspect-js/object-inspect/commit/f74c82dd0b35386445510deb250f34c41be3ec0e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`1a8a5ea`](https://github.com/inspect-js/object-inspect/commit/1a8a5ea069ea2bee89d77caedad83ffa23d35711) +- [Fix] do not be fooled by a function’s own `toString` method [`7cb5c65`](https://github.com/inspect-js/object-inspect/commit/7cb5c657a976f94715c19c10556a30f15bb7d5d7) +- [patch] indicate explicitly that anon functions are anonymous, to match node [`81ebdd4`](https://github.com/inspect-js/object-inspect/commit/81ebdd4215005144074bbdff3f6bafa01407910a) +- [Dev Deps] loosen the `core-js` dep [`e7472e8`](https://github.com/inspect-js/object-inspect/commit/e7472e8e242117670560bd995830c2a4d12080f5) +- [Dev Deps] update `tape` [`699827e`](https://github.com/inspect-js/object-inspect/commit/699827e6b37258b5203c33c78c009bf4b0e6a66d) +- [meta] add `safe-publish-latest` [`c5d2868`](https://github.com/inspect-js/object-inspect/commit/c5d2868d6eb33c472f37a20f89ceef2787046088) +- [Dev Deps] update `@ljharb/eslint-config` [`9199501`](https://github.com/inspect-js/object-inspect/commit/919950195d486114ccebacbdf9d74d7f382693b0) + +## [v1.7.0](https://github.com/inspect-js/object-inspect/compare/v1.6.0...v1.7.0) - 2019-11-10 + +### Commits + +- [Tests] use shared travis-ci configs [`19899ed`](https://github.com/inspect-js/object-inspect/commit/19899edbf31f4f8809acf745ce34ad1ce1bfa63b) +- [Tests] add linting [`a00f057`](https://github.com/inspect-js/object-inspect/commit/a00f057d917f66ea26dd37769c6b810ec4af97e8) +- [Tests] lint last file [`2698047`](https://github.com/inspect-js/object-inspect/commit/2698047b58af1e2e88061598ef37a75f228dddf6) +- [Tests] up to `node` `v12.7`, `v11.15`, `v10.16`, `v8.16`, `v6.17` [`589e87a`](https://github.com/inspect-js/object-inspect/commit/589e87a99cadcff4b600e6a303418e9d922836e8) +- [New] add support for `WeakMap` and `WeakSet` [`3ddb3e4`](https://github.com/inspect-js/object-inspect/commit/3ddb3e4e0c8287130c61a12e0ed9c104b1549306) +- [meta] clean up license so github can detect it properly [`27527bb`](https://github.com/inspect-js/object-inspect/commit/27527bb801520c9610c68cc3b55d6f20a2bee56d) +- [Tests] cover `util.inspect.custom` [`36d47b9`](https://github.com/inspect-js/object-inspect/commit/36d47b9c59056a57ef2f1491602c726359561800) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `tape` [`b614eaa`](https://github.com/inspect-js/object-inspect/commit/b614eaac901da0e5c69151f534671f990a94cace) +- [Tests] fix coverage thresholds [`7b7b176`](https://github.com/inspect-js/object-inspect/commit/7b7b176e15f8bd6e8b2f261ff5a493c2fe78d9c2) +- [Tests] bigint tests now can run on unflagged node [`063af31`](https://github.com/inspect-js/object-inspect/commit/063af31ce9cd13c202e3b67c07ba06dc9b7c0f81) +- [Refactor] add early bailout to `isMap` and `isSet` checks [`fc51047`](https://github.com/inspect-js/object-inspect/commit/fc5104714a3671d37e225813db79470d6335683b) +- [meta] add `funding` field [`7f9953a`](https://github.com/inspect-js/object-inspect/commit/7f9953a113eec7b064a6393cf9f90ba15f1d131b) +- [Tests] Fix invalid strict-mode syntax with hexadecimal [`a8b5425`](https://github.com/inspect-js/object-inspect/commit/a8b542503b4af1599a275209a1a99f5fdedb1ead) +- [Dev Deps] update `@ljharb/eslint-config` [`98df157`](https://github.com/inspect-js/object-inspect/commit/98df1577314d9188a3fc3f17fdcf2fba697ae1bd) +- add copyright to LICENSE [`bb69fd0`](https://github.com/inspect-js/object-inspect/commit/bb69fd017a062d299e44da1f9b2c7dcd67f621e6) +- [Tests] use `npx aud` in `posttest` [`4838353`](https://github.com/inspect-js/object-inspect/commit/4838353593974cf7f905b9ef04c03c094f0cdbe2) +- [Tests] move `0.6` to allowed failures, because it won‘t build on travis [`1bff32a`](https://github.com/inspect-js/object-inspect/commit/1bff32aa52e8aea687f0856b28ba754b3e43ebf7) + +## [v1.6.0](https://github.com/inspect-js/object-inspect/compare/v1.5.0...v1.6.0) - 2018-05-02 + +### Commits + +- [New] add support for boxed BigInt primitives [`356c66a`](https://github.com/inspect-js/object-inspect/commit/356c66a410e7aece7162c8319880a5ef647beaa9) +- [Tests] up to `node` `v10.0`, `v9.11`, `v8.11`, `v6.14`, `v4.9` [`c77b65b`](https://github.com/inspect-js/object-inspect/commit/c77b65bba593811b906b9ec57561c5cba92e2db3) +- [New] Add support for upcoming `BigInt` [`1ac548e`](https://github.com/inspect-js/object-inspect/commit/1ac548e4b27e26466c28c9a5e63e5d4e0591c31f) +- [Tests] run bigint tests in CI with --harmony-bigint flag [`d31b738`](https://github.com/inspect-js/object-inspect/commit/d31b73831880254b5c6cf5691cda9a149fbc5f04) +- [Dev Deps] update `core-js`, `tape` [`ff9eff6`](https://github.com/inspect-js/object-inspect/commit/ff9eff67113341ee1aaf80c1c22d683f43bfbccf) +- [Docs] fix example to use `safer-buffer` [`48cae12`](https://github.com/inspect-js/object-inspect/commit/48cae12a73ec6cacc955175bc56bbe6aee6a211f) + +## [v1.5.0](https://github.com/inspect-js/object-inspect/compare/v1.4.1...v1.5.0) - 2017-12-25 + +### Commits + +- [New] add `quoteStyle` option [`f5a72d2`](https://github.com/inspect-js/object-inspect/commit/f5a72d26edb3959b048f74c056ca7100a6b091e4) +- [Tests] add more test coverage [`30ebe4e`](https://github.com/inspect-js/object-inspect/commit/30ebe4e1fa943b99ecbb85be7614256d536e2759) +- [Tests] require 0.6 to pass [`99a008c`](https://github.com/inspect-js/object-inspect/commit/99a008ccace189a60fd7da18bf00e32c9572b980) + +## [v1.4.1](https://github.com/inspect-js/object-inspect/compare/v1.4.0...v1.4.1) - 2017-12-19 + +### Commits + +- [Tests] up to `node` `v9.3`, `v8.9`, `v6.12` [`6674476`](https://github.com/inspect-js/object-inspect/commit/6674476cc56acaac1bde96c84fed5ef631911906) +- [Fix] `inspect(Object(-0))` should be “Object(-0)”, not “Object(0)” [`d0a031f`](https://github.com/inspect-js/object-inspect/commit/d0a031f1cbb3024ee9982bfe364dd18a7e4d1bd3) + +## [v1.4.0](https://github.com/inspect-js/object-inspect/compare/v1.3.0...v1.4.0) - 2017-10-24 + +### Commits + +- [Tests] add `npm run coverage` [`3b48fb2`](https://github.com/inspect-js/object-inspect/commit/3b48fb25db037235eeb808f0b2830aad7aa36f70) +- [Tests] remove commented-out osx builds [`71e24db`](https://github.com/inspect-js/object-inspect/commit/71e24db8ad6ee3b9b381c5300b0475f2ba595a73) +- [New] add support for `util.inspect.custom`, in node only. [`20cca77`](https://github.com/inspect-js/object-inspect/commit/20cca7762d7e17f15b21a90793dff84acce155df) +- [Tests] up to `node` `v8.6`; use `nvm install-latest-npm` to ensure new npm doesn’t break old node [`252952d`](https://github.com/inspect-js/object-inspect/commit/252952d230d8065851dd3d4d5fe8398aae068529) +- [Tests] up to `node` `v8.8` [`4aa868d`](https://github.com/inspect-js/object-inspect/commit/4aa868d3a62914091d489dd6ec6eed194ee67cd3) +- [Dev Deps] update `core-js`, `tape` [`59483d1`](https://github.com/inspect-js/object-inspect/commit/59483d1df418f852f51fa0db7b24aa6b0209a27a) + +## [v1.3.0](https://github.com/inspect-js/object-inspect/compare/v1.2.2...v1.3.0) - 2017-07-31 + +### Fixed + +- [Fix] Map/Set: work around core-js bug < v2.5.0 [`#9`](https://github.com/inspect-js/object-inspect/issues/9) + +### Commits + +- [New] add support for arrays with additional object keys [`0d19937`](https://github.com/inspect-js/object-inspect/commit/0d199374ee37959e51539616666f420ccb29acb9) +- [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`; fix new npm breaking on older nodes [`e24784a`](https://github.com/inspect-js/object-inspect/commit/e24784a90c49117787157a12a63897c49cf89bbb) +- Only apps should have lockfiles [`c6faebc`](https://github.com/inspect-js/object-inspect/commit/c6faebcb2ee486a889a4a1c4d78c0776c7576185) +- [Dev Deps] update `tape` [`7345a0a`](https://github.com/inspect-js/object-inspect/commit/7345a0aeba7e91b888a079c10004d17696a7f586) + +## [v1.2.2](https://github.com/inspect-js/object-inspect/compare/v1.2.1...v1.2.2) - 2017-03-24 + +### Commits + +- [Tests] up to `node` `v7.7`, `v6.10`, `v4.8`; improve test matrix [`a2ddc15`](https://github.com/inspect-js/object-inspect/commit/a2ddc15a1f2c65af18076eea1c0eb9cbceb478a0) +- [Tests] up to `node` `v7.0`, `v6.9`, `v5.12`, `v4.6`, `io.js` `v3.3`; improve test matrix [`a48949f`](https://github.com/inspect-js/object-inspect/commit/a48949f6b574b2d4d2298109d8e8d0eb3e7a83e7) +- [Performance] check for primitive types as early as possible. [`3b8092a`](https://github.com/inspect-js/object-inspect/commit/3b8092a2a4deffd0575f94334f00194e2d48dad3) +- [Refactor] remove unneeded `else`s. [`7255034`](https://github.com/inspect-js/object-inspect/commit/725503402e08de4f96f6bf2d8edef44ac36f26b6) +- [Refactor] avoid recreating `lowbyte` function every time. [`81edd34`](https://github.com/inspect-js/object-inspect/commit/81edd3475bd15bdd18e84de7472033dcf5004aaa) +- [Fix] differentiate -0 from 0 [`521d345`](https://github.com/inspect-js/object-inspect/commit/521d3456b009da7bf1c5785c8a9df5a9f8718264) +- [Refactor] move object key gathering into separate function [`aca6265`](https://github.com/inspect-js/object-inspect/commit/aca626536eaeef697196c6e9db3e90e7e0355b6a) +- [Refactor] consolidate wrapping logic for boxed primitives into a function. [`4e440cd`](https://github.com/inspect-js/object-inspect/commit/4e440cd9065df04802a2a1dead03f48c353ca301) +- [Robustness] use `typeof` instead of comparing to literal `undefined` [`5ca6f60`](https://github.com/inspect-js/object-inspect/commit/5ca6f601937506daff8ed2fcf686363b55807b69) +- [Refactor] consolidate Map/Set notations. [`4e576e5`](https://github.com/inspect-js/object-inspect/commit/4e576e5d7ed2f9ec3fb7f37a0d16732eb10758a9) +- [Tests] ensure that this function remains anonymous, despite ES6 name inference. [`7540ae5`](https://github.com/inspect-js/object-inspect/commit/7540ae591278756db614fa4def55ca413150e1a3) +- [Refactor] explicitly coerce Error objects to strings. [`7f4ca84`](https://github.com/inspect-js/object-inspect/commit/7f4ca8424ee8dc2c0ca5a422d94f7fac40327261) +- [Refactor] split up `var` declarations for debuggability [`6f2c11e`](https://github.com/inspect-js/object-inspect/commit/6f2c11e6a85418586a00292dcec5e97683f89bc3) +- [Robustness] cache `Object.prototype.toString` [`df44a20`](https://github.com/inspect-js/object-inspect/commit/df44a20adfccf31529d60d1df2079bfc3c836e27) +- [Dev Deps] update `tape` [`3ec714e`](https://github.com/inspect-js/object-inspect/commit/3ec714eba57bc3f58a6eb4fca1376f49e70d300a) +- [Dev Deps] update `tape` [`beb72d9`](https://github.com/inspect-js/object-inspect/commit/beb72d969653747d7cde300393c28755375329b0) + +## [v1.2.1](https://github.com/inspect-js/object-inspect/compare/v1.2.0...v1.2.1) - 2016-04-09 + +### Fixed + +- [Fix] fix Boolean `false` object inspection. [`#7`](https://github.com/substack/object-inspect/pull/7) + +## [v1.2.0](https://github.com/inspect-js/object-inspect/compare/v1.1.0...v1.2.0) - 2016-04-09 + +### Fixed + +- [New] add support for inspecting String/Number/Boolean objects. [`#6`](https://github.com/inspect-js/object-inspect/issues/6) + +### Commits + +- [Dev Deps] update `tape` [`742caa2`](https://github.com/inspect-js/object-inspect/commit/742caa262cf7af4c815d4821c8bd0129c1446432) + +## [v1.1.0](https://github.com/inspect-js/object-inspect/compare/1.0.2...v1.1.0) - 2015-12-14 + +### Merged + +- [New] add ES6 Map/Set support. [`#4`](https://github.com/inspect-js/object-inspect/pull/4) + +### Fixed + +- [New] add ES6 Map/Set support. [`#3`](https://github.com/inspect-js/object-inspect/issues/3) + +### Commits + +- Update `travis.yml` to test on bunches of `iojs` and `node` versions. [`4c1fd65`](https://github.com/inspect-js/object-inspect/commit/4c1fd65cc3bd95307e854d114b90478324287fd2) +- [Dev Deps] update `tape` [`88a907e`](https://github.com/inspect-js/object-inspect/commit/88a907e33afbe408e4b5d6e4e42a33143f88848c) + +## [1.0.2](https://github.com/inspect-js/object-inspect/compare/1.0.1...1.0.2) - 2015-08-07 + +### Commits + +- [Fix] Cache `Object.prototype.hasOwnProperty` in case it's deleted later. [`1d0075d`](https://github.com/inspect-js/object-inspect/commit/1d0075d3091dc82246feeb1f9871cb2b8ed227b3) +- [Dev Deps] Update `tape` [`ca8d5d7`](https://github.com/inspect-js/object-inspect/commit/ca8d5d75635ddbf76f944e628267581e04958457) +- gitignore node_modules since this is a reusable modules. [`ed41407`](https://github.com/inspect-js/object-inspect/commit/ed41407811743ca530cdeb28f982beb96026af82) + +## [1.0.1](https://github.com/inspect-js/object-inspect/compare/1.0.0...1.0.1) - 2015-07-19 + +### Commits + +- Make `inspect` work with symbol primitives and objects, including in node 0.11 and 0.12. [`ddf1b94`](https://github.com/inspect-js/object-inspect/commit/ddf1b94475ab951f1e3bccdc0a48e9073cfbfef4) +- bump tape [`103d674`](https://github.com/inspect-js/object-inspect/commit/103d67496b504bdcfdd765d303a773f87ec106e2) +- use newer travis config [`d497276`](https://github.com/inspect-js/object-inspect/commit/d497276c1da14234bb5098a59cf20de75fbc316a) + +## [1.0.0](https://github.com/inspect-js/object-inspect/compare/0.4.0...1.0.0) - 2014-08-05 + +### Commits + +- error inspect works properly [`260a22d`](https://github.com/inspect-js/object-inspect/commit/260a22d134d3a8a482c67d52091c6040c34f4299) +- seen coverage [`57269e8`](https://github.com/inspect-js/object-inspect/commit/57269e8baa992a7439047f47325111fdcbcb8417) +- htmlelement instance coverage [`397ffe1`](https://github.com/inspect-js/object-inspect/commit/397ffe10a1980350868043ef9de65686d438979f) +- more element coverage [`6905cc2`](https://github.com/inspect-js/object-inspect/commit/6905cc2f7df35600177e613b0642b4df5efd3eca) +- failing test for type errors [`385b615`](https://github.com/inspect-js/object-inspect/commit/385b6152e49b51b68449a662f410b084ed7c601a) +- fn name coverage [`edc906d`](https://github.com/inspect-js/object-inspect/commit/edc906d40fca6b9194d304062c037ee8e398c4c2) +- server-side element test [`362d1d3`](https://github.com/inspect-js/object-inspect/commit/362d1d3e86f187651c29feeb8478110afada385b) +- custom inspect fn [`e89b0f6`](https://github.com/inspect-js/object-inspect/commit/e89b0f6fe6d5e03681282af83732a509160435a6) +- fixed browser test [`b530882`](https://github.com/inspect-js/object-inspect/commit/b5308824a1c8471c5617e394766a03a6977102a9) +- depth test, matches node [`1cfd9e0`](https://github.com/inspect-js/object-inspect/commit/1cfd9e0285a4ae1dff44101ad482915d9bf47e48) +- exercise hasOwnProperty path [`8d753fb`](https://github.com/inspect-js/object-inspect/commit/8d753fb362a534fa1106e4d80f2ee9bea06a66d9) +- more cases covered for errors [`c5c46a5`](https://github.com/inspect-js/object-inspect/commit/c5c46a569ec4606583497e8550f0d8c7ad39a4a4) +- \W obj key test case [`b0eceee`](https://github.com/inspect-js/object-inspect/commit/b0eceeea6e0eb94d686c1046e99b9e25e5005f75) +- coverage for explicit depth param [`e12b91c`](https://github.com/inspect-js/object-inspect/commit/e12b91cd59683362f3a0e80f46481a0211e26c15) + +## [0.4.0](https://github.com/inspect-js/object-inspect/compare/0.3.1...0.4.0) - 2014-03-21 + +### Commits + +- passing lowbyte interpolation test [`b847511`](https://github.com/inspect-js/object-inspect/commit/b8475114f5def7e7961c5353d48d3d8d9a520985) +- lowbyte test [`4a2b0e1`](https://github.com/inspect-js/object-inspect/commit/4a2b0e142667fc933f195472759385ac08f3946c) + +## [0.3.1](https://github.com/inspect-js/object-inspect/compare/0.3.0...0.3.1) - 2014-03-04 + +### Commits + +- sort keys [`a07b19c`](https://github.com/inspect-js/object-inspect/commit/a07b19cc3b1521a82d4fafb6368b7a9775428a05) + +## [0.3.0](https://github.com/inspect-js/object-inspect/compare/0.2.0...0.3.0) - 2014-03-04 + +### Commits + +- [] and {} instead of [ ] and { } [`654c44b`](https://github.com/inspect-js/object-inspect/commit/654c44b2865811f3519e57bb8526e0821caf5c6b) + +## [0.2.0](https://github.com/inspect-js/object-inspect/compare/0.1.3...0.2.0) - 2014-03-04 + +### Commits + +- failing holes test [`99cdfad`](https://github.com/inspect-js/object-inspect/commit/99cdfad03c6474740275a75636fe6ca86c77737a) +- regex already work [`e324033`](https://github.com/inspect-js/object-inspect/commit/e324033267025995ec97d32ed0a65737c99477a6) +- failing undef/null test [`1f88a00`](https://github.com/inspect-js/object-inspect/commit/1f88a00265d3209719dda8117b7e6360b4c20943) +- holes in the all example [`7d345f3`](https://github.com/inspect-js/object-inspect/commit/7d345f3676dcbe980cff89a4f6c243269ebbb709) +- check for .inspect(), fixes Buffer use-case [`c3f7546`](https://github.com/inspect-js/object-inspect/commit/c3f75466dbca125347d49847c05262c292f12b79) +- fixes for holes [`ce25f73`](https://github.com/inspect-js/object-inspect/commit/ce25f736683de4b92ff27dc5471218415e2d78d8) +- weird null behavior [`405c1ea`](https://github.com/inspect-js/object-inspect/commit/405c1ea72cd5a8cf3b498c3eaa903d01b9fbcab5) +- tape is actually a devDependency, upgrade [`703b0ce`](https://github.com/inspect-js/object-inspect/commit/703b0ce6c5817b4245a082564bccd877e0bb6990) +- put date in the example [`a342219`](https://github.com/inspect-js/object-inspect/commit/a3422190eeaa013215f46df2d0d37b48595ac058) +- passing the null test [`4ab737e`](https://github.com/inspect-js/object-inspect/commit/4ab737ebf862a75d247ebe51e79307a34d6380d4) + +## [0.1.3](https://github.com/inspect-js/object-inspect/compare/0.1.1...0.1.3) - 2013-07-26 + +### Commits + +- special isElement() check [`882768a`](https://github.com/inspect-js/object-inspect/commit/882768a54035d30747be9de1baf14e5aa0daa128) +- oh right old IEs don't have indexOf either [`36d1275`](https://github.com/inspect-js/object-inspect/commit/36d12756c38b08a74370b0bb696c809e529913a5) + +## [0.1.1](https://github.com/inspect-js/object-inspect/compare/0.1.0...0.1.1) - 2013-07-26 + +### Commits + +- tests! [`4422fd9`](https://github.com/inspect-js/object-inspect/commit/4422fd95532c2745aa6c4f786f35f1090be29998) +- fix for ie<9, doesn't have hasOwnProperty [`6b7d611`](https://github.com/inspect-js/object-inspect/commit/6b7d61183050f6da801ea04473211da226482613) +- fix for all IEs: no f.name [`4e0c2f6`](https://github.com/inspect-js/object-inspect/commit/4e0c2f6dfd01c306d067d7163319acc97c94ee50) +- badges [`5ed0d88`](https://github.com/inspect-js/object-inspect/commit/5ed0d88e4e407f9cb327fa4a146c17921f9680f3) + +## [0.1.0](https://github.com/inspect-js/object-inspect/compare/0.0.0...0.1.0) - 2013-07-26 + +### Commits + +- [Function] for functions [`ad5c485`](https://github.com/inspect-js/object-inspect/commit/ad5c485098fc83352cb540a60b2548ca56820e0b) + +## 0.0.0 - 2013-07-26 + +### Commits + +- working browser example [`34be6b6`](https://github.com/inspect-js/object-inspect/commit/34be6b6548f9ce92bdc3c27572857ba0c4a1218d) +- package.json etc [`cad51f2`](https://github.com/inspect-js/object-inspect/commit/cad51f23fc6bcf1a456ed6abe16088256c2f632f) +- docs complete [`b80cce2`](https://github.com/inspect-js/object-inspect/commit/b80cce2490c4e7183a9ee11ea89071f0abec4446) +- circular example [`4b4a7b9`](https://github.com/inspect-js/object-inspect/commit/4b4a7b92209e4e6b4630976cb6bcd17d14165a59) +- string rep [`7afb479`](https://github.com/inspect-js/object-inspect/commit/7afb479baa798d27f09e0a178b72ea327f60f5c8) diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/LICENSE new file mode 100644 index 0000000..ca64cc1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 James Halliday + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/example/all.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/example/all.js new file mode 100644 index 0000000..2f3355c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/example/all.js @@ -0,0 +1,23 @@ +'use strict'; + +var inspect = require('../'); +var Buffer = require('safer-buffer').Buffer; + +var holes = ['a', 'b']; +holes[4] = 'e'; +holes[6] = 'g'; + +var obj = { + a: 1, + b: [3, 4, undefined, null], + c: undefined, + d: null, + e: { + regex: /^x/i, + buf: Buffer.from('abc'), + holes: holes + }, + now: new Date() +}; +obj.self = obj; +console.log(inspect(obj)); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/example/circular.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/example/circular.js new file mode 100644 index 0000000..487a7c1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/example/circular.js @@ -0,0 +1,6 @@ +'use strict'; + +var inspect = require('../'); +var obj = { a: 1, b: [3, 4] }; +obj.c = obj; +console.log(inspect(obj)); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/example/fn.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/example/fn.js new file mode 100644 index 0000000..9b5db8d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/example/fn.js @@ -0,0 +1,5 @@ +'use strict'; + +var inspect = require('../'); +var obj = [1, 2, function f(n) { return n + 5; }, 4]; +console.log(inspect(obj)); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/example/inspect.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/example/inspect.js new file mode 100644 index 0000000..e2df7c9 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/example/inspect.js @@ -0,0 +1,10 @@ +'use strict'; + +/* eslint-env browser */ +var inspect = require('../'); + +var d = document.createElement('div'); +d.setAttribute('id', 'beep'); +d.innerHTML = 'woooiiiii'; + +console.log(inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }])); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/index.js new file mode 100644 index 0000000..a4b2d4c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/index.js @@ -0,0 +1,544 @@ +var hasMap = typeof Map === 'function' && Map.prototype; +var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; +var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; +var mapForEach = hasMap && Map.prototype.forEach; +var hasSet = typeof Set === 'function' && Set.prototype; +var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; +var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; +var setForEach = hasSet && Set.prototype.forEach; +var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; +var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; +var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; +var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; +var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; +var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; +var booleanValueOf = Boolean.prototype.valueOf; +var objectToString = Object.prototype.toString; +var functionToString = Function.prototype.toString; +var $match = String.prototype.match; +var $slice = String.prototype.slice; +var $replace = String.prototype.replace; +var $toUpperCase = String.prototype.toUpperCase; +var $toLowerCase = String.prototype.toLowerCase; +var $test = RegExp.prototype.test; +var $concat = Array.prototype.concat; +var $join = Array.prototype.join; +var $arrSlice = Array.prototype.slice; +var $floor = Math.floor; +var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; +var gOPS = Object.getOwnPropertySymbols; +var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; +var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; +// ie, `has-tostringtag/shams +var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') + ? Symbol.toStringTag + : null; +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( + [].__proto__ === Array.prototype // eslint-disable-line no-proto + ? function (O) { + return O.__proto__; // eslint-disable-line no-proto + } + : null +); + +function addNumericSeparator(num, str) { + if ( + num === Infinity + || num === -Infinity + || num !== num + || (num && num > -1000 && num < 1000) + || $test.call(/e/, str) + ) { + return str; + } + var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; + if (typeof num === 'number') { + var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num) + if (int !== num) { + var intStr = String(int); + var dec = $slice.call(str, intStr.length + 1); + return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); + } + } + return $replace.call(str, sepRegex, '$&_'); +} + +var utilInspect = require('./util.inspect'); +var inspectCustom = utilInspect.custom; +var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; + +var quotes = { + __proto__: null, + 'double': '"', + single: "'" +}; +var quoteREs = { + __proto__: null, + 'double': /(["\\])/g, + single: /(['\\])/g +}; + +module.exports = function inspect_(obj, options, depth, seen) { + var opts = options || {}; + + if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + if ( + has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' + ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity + : opts.maxStringLength !== null + ) + ) { + throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); + } + var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; + if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { + throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); + } + + if ( + has(opts, 'indent') + && opts.indent !== null + && opts.indent !== '\t' + && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) + ) { + throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); + } + if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { + throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); + } + var numericSeparator = opts.numericSeparator; + + if (typeof obj === 'undefined') { + return 'undefined'; + } + if (obj === null) { + return 'null'; + } + if (typeof obj === 'boolean') { + return obj ? 'true' : 'false'; + } + + if (typeof obj === 'string') { + return inspectString(obj, opts); + } + if (typeof obj === 'number') { + if (obj === 0) { + return Infinity / obj > 0 ? '0' : '-0'; + } + var str = String(obj); + return numericSeparator ? addNumericSeparator(obj, str) : str; + } + if (typeof obj === 'bigint') { + var bigIntStr = String(obj) + 'n'; + return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; + } + + var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; + if (typeof depth === 'undefined') { depth = 0; } + if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { + return isArray(obj) ? '[Array]' : '[Object]'; + } + + var indent = getIndent(opts, depth); + + if (typeof seen === 'undefined') { + seen = []; + } else if (indexOf(seen, obj) >= 0) { + return '[Circular]'; + } + + function inspect(value, from, noIndent) { + if (from) { + seen = $arrSlice.call(seen); + seen.push(from); + } + if (noIndent) { + var newOpts = { + depth: opts.depth + }; + if (has(opts, 'quoteStyle')) { + newOpts.quoteStyle = opts.quoteStyle; + } + return inspect_(value, newOpts, depth + 1, seen); + } + return inspect_(value, opts, depth + 1, seen); + } + + if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable + var name = nameOf(obj); + var keys = arrObjKeys(obj, inspect); + return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); + } + if (isSymbol(obj)) { + var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); + return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; + } + if (isElement(obj)) { + var s = '<' + $toLowerCase.call(String(obj.nodeName)); + var attrs = obj.attributes || []; + for (var i = 0; i < attrs.length; i++) { + s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); + } + s += '>'; + if (obj.childNodes && obj.childNodes.length) { s += '...'; } + s += ''; + return s; + } + if (isArray(obj)) { + if (obj.length === 0) { return '[]'; } + var xs = arrObjKeys(obj, inspect); + if (indent && !singleLineValues(xs)) { + return '[' + indentedJoin(xs, indent) + ']'; + } + return '[ ' + $join.call(xs, ', ') + ' ]'; + } + if (isError(obj)) { + var parts = arrObjKeys(obj, inspect); + if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) { + return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; + } + if (parts.length === 0) { return '[' + String(obj) + ']'; } + return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; + } + if (typeof obj === 'object' && customInspect) { + if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) { + return utilInspect(obj, { depth: maxDepth - depth }); + } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { + return obj.inspect(); + } + } + if (isMap(obj)) { + var mapParts = []; + if (mapForEach) { + mapForEach.call(obj, function (value, key) { + mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); + }); + } + return collectionOf('Map', mapSize.call(obj), mapParts, indent); + } + if (isSet(obj)) { + var setParts = []; + if (setForEach) { + setForEach.call(obj, function (value) { + setParts.push(inspect(value, obj)); + }); + } + return collectionOf('Set', setSize.call(obj), setParts, indent); + } + if (isWeakMap(obj)) { + return weakCollectionOf('WeakMap'); + } + if (isWeakSet(obj)) { + return weakCollectionOf('WeakSet'); + } + if (isWeakRef(obj)) { + return weakCollectionOf('WeakRef'); + } + if (isNumber(obj)) { + return markBoxed(inspect(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect(bigIntValueOf.call(obj))); + } + if (isBoolean(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString(obj)) { + return markBoxed(inspect(String(obj))); + } + // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other + /* eslint-env browser */ + if (typeof window !== 'undefined' && obj === window) { + return '{ [object Window] }'; + } + if ( + (typeof globalThis !== 'undefined' && obj === globalThis) + || (typeof global !== 'undefined' && obj === global) + ) { + return '{ [object globalThis] }'; + } + if (!isDate(obj) && !isRegExp(obj)) { + var ys = arrObjKeys(obj, inspect); + var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; + var protoTag = obj instanceof Object ? '' : 'null prototype'; + var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; + var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; + var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); + if (ys.length === 0) { return tag + '{}'; } + if (indent) { + return tag + '{' + indentedJoin(ys, indent) + '}'; + } + return tag + '{ ' + $join.call(ys, ', ') + ' }'; + } + return String(obj); +}; + +function wrapQuotes(s, defaultStyle, opts) { + var style = opts.quoteStyle || defaultStyle; + var quoteChar = quotes[style]; + return quoteChar + s + quoteChar; +} + +function quote(s) { + return $replace.call(String(s), /"/g, '"'); +} + +function canTrustToString(obj) { + return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined')); +} +function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); } +function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); } +function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); } +function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); } +function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); } +function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); } +function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); } + +// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives +function isSymbol(obj) { + if (hasShammedSymbols) { + return obj && typeof obj === 'object' && obj instanceof Symbol; + } + if (typeof obj === 'symbol') { + return true; + } + if (!obj || typeof obj !== 'object' || !symToString) { + return false; + } + try { + symToString.call(obj); + return true; + } catch (e) {} + return false; +} + +function isBigInt(obj) { + if (!obj || typeof obj !== 'object' || !bigIntValueOf) { + return false; + } + try { + bigIntValueOf.call(obj); + return true; + } catch (e) {} + return false; +} + +var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; +function has(obj, key) { + return hasOwn.call(obj, key); +} + +function toStr(obj) { + return objectToString.call(obj); +} + +function nameOf(f) { + if (f.name) { return f.name; } + var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); + if (m) { return m[1]; } + return null; +} + +function indexOf(xs, x) { + if (xs.indexOf) { return xs.indexOf(x); } + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) { return i; } + } + return -1; +} + +function isMap(x) { + if (!mapSize || !x || typeof x !== 'object') { + return false; + } + try { + mapSize.call(x); + try { + setSize.call(x); + } catch (s) { + return true; + } + return x instanceof Map; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakMap(x) { + if (!weakMapHas || !x || typeof x !== 'object') { + return false; + } + try { + weakMapHas.call(x, weakMapHas); + try { + weakSetHas.call(x, weakSetHas); + } catch (s) { + return true; + } + return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakRef(x) { + if (!weakRefDeref || !x || typeof x !== 'object') { + return false; + } + try { + weakRefDeref.call(x); + return true; + } catch (e) {} + return false; +} + +function isSet(x) { + if (!setSize || !x || typeof x !== 'object') { + return false; + } + try { + setSize.call(x); + try { + mapSize.call(x); + } catch (m) { + return true; + } + return x instanceof Set; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakSet(x) { + if (!weakSetHas || !x || typeof x !== 'object') { + return false; + } + try { + weakSetHas.call(x, weakSetHas); + try { + weakMapHas.call(x, weakMapHas); + } catch (s) { + return true; + } + return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isElement(x) { + if (!x || typeof x !== 'object') { return false; } + if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { + return true; + } + return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; +} + +function inspectString(str, opts) { + if (str.length > opts.maxStringLength) { + var remaining = str.length - opts.maxStringLength; + var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); + return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; + } + var quoteRE = quoteREs[opts.quoteStyle || 'single']; + quoteRE.lastIndex = 0; + // eslint-disable-next-line no-control-regex + var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s, 'single', opts); +} + +function lowbyte(c) { + var n = c.charCodeAt(0); + var x = { + 8: 'b', + 9: 't', + 10: 'n', + 12: 'f', + 13: 'r' + }[n]; + if (x) { return '\\' + x; } + return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); +} + +function markBoxed(str) { + return 'Object(' + str + ')'; +} + +function weakCollectionOf(type) { + return type + ' { ? }'; +} + +function collectionOf(type, size, entries, indent) { + var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); + return type + ' (' + size + ') {' + joinedEntries + '}'; +} + +function singleLineValues(xs) { + for (var i = 0; i < xs.length; i++) { + if (indexOf(xs[i], '\n') >= 0) { + return false; + } + } + return true; +} + +function getIndent(opts, depth) { + var baseIndent; + if (opts.indent === '\t') { + baseIndent = '\t'; + } else if (typeof opts.indent === 'number' && opts.indent > 0) { + baseIndent = $join.call(Array(opts.indent + 1), ' '); + } else { + return null; + } + return { + base: baseIndent, + prev: $join.call(Array(depth + 1), baseIndent) + }; +} + +function indentedJoin(xs, indent) { + if (xs.length === 0) { return ''; } + var lineJoiner = '\n' + indent.prev + indent.base; + return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; +} + +function arrObjKeys(obj, inspect) { + var isArr = isArray(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i = 0; i < obj.length; i++) { + xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; + } + } + var syms = typeof gOPS === 'function' ? gOPS(obj) : []; + var symMap; + if (hasShammedSymbols) { + symMap = {}; + for (var k = 0; k < syms.length; k++) { + symMap['$' + syms[k]] = syms[k]; + } + } + + for (var key in obj) { // eslint-disable-line no-restricted-syntax + if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { + // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section + continue; // eslint-disable-line no-restricted-syntax, no-continue + } else if ($test.call(/[^\w$]/, key)) { + xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); + } else { + xs.push(key + ': ' + inspect(obj[key], obj)); + } + } + if (typeof gOPS === 'function') { + for (var j = 0; j < syms.length; j++) { + if (isEnumerable.call(obj, syms[j])) { + xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); + } + } + } + return xs; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/package-support.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/package-support.json new file mode 100644 index 0000000..5cc12d0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/package-support.json @@ -0,0 +1,20 @@ +{ + "versions": [ + { + "version": "*", + "target": { + "node": "all" + }, + "response": { + "type": "time-permitting" + }, + "backing": { + "npm-funding": true, + "donations": [ + "https://github.com/ljharb", + "https://tidelift.com/funding/github/npm/object-inspect" + ] + } + } + ] +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/package.json new file mode 100644 index 0000000..9fd97ff --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/package.json @@ -0,0 +1,105 @@ +{ + "name": "object-inspect", + "version": "1.13.4", + "description": "string representations of objects in node and the browser", + "main": "index.js", + "sideEffects": false, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.1", + "@pkgjs/support": "^0.0.6", + "auto-changelog": "^2.5.0", + "core-js": "^2.6.12", + "error-cause": "^1.0.8", + "es-value-fixtures": "^1.7.1", + "eslint": "=8.8.0", + "for-each": "^0.3.4", + "functions-have-names": "^1.2.3", + "glob": "=10.3.7", + "globalthis": "^1.0.4", + "has-symbols": "^1.1.0", + "has-tostringtag": "^1.0.2", + "in-publish": "^2.0.1", + "jackspeak": "=2.1.1", + "make-arrow-function": "^1.2.0", + "mock-property": "^1.1.0", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "safer-buffer": "^2.1.2", + "semver": "^6.3.1", + "string.prototype.repeat": "^1.0.0", + "tape": "^5.9.0" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "pretest": "npm run lint", + "lint": "eslint --ext=js,mjs .", + "postlint": "npx @pkgjs/support validate", + "test": "npm run tests-only && npm run test:corejs", + "tests-only": "nyc tape 'test/*.js'", + "test:corejs": "nyc tape test-core-js.js 'test/*.js'", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "testling": { + "files": [ + "test/*.js", + "test/browser/*.js" + ], + "browsers": [ + "ie/6..latest", + "chrome/latest", + "firefox/latest", + "safari/latest", + "opera/latest", + "iphone/latest", + "ipad/latest", + "android/latest" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/inspect-js/object-inspect.git" + }, + "homepage": "https://github.com/inspect-js/object-inspect", + "keywords": [ + "inspect", + "util.inspect", + "object", + "stringify", + "pretty" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "browser": { + "./util.inspect.js": false + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows", + "./test-core-js.js" + ] + }, + "support": true, + "engines": { + "node": ">= 0.4" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/readme.markdown b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/readme.markdown new file mode 100644 index 0000000..f91617d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/readme.markdown @@ -0,0 +1,84 @@ +# object-inspect [![Version Badge][npm-version-svg]][package-url] + +string representations of objects in node and the browser + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +# example + +## circular + +``` js +var inspect = require('object-inspect'); +var obj = { a: 1, b: [3,4] }; +obj.c = obj; +console.log(inspect(obj)); +``` + +## dom element + +``` js +var inspect = require('object-inspect'); + +var d = document.createElement('div'); +d.setAttribute('id', 'beep'); +d.innerHTML = 'woooiiiii'; + +console.log(inspect([ d, { a: 3, b : 4, c: [5,6,[7,[8,[9]]]] } ])); +``` + +output: + +``` +[
...
, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [ ... ] ] ] ] } ] +``` + +# methods + +``` js +var inspect = require('object-inspect') +``` + +## var s = inspect(obj, opts={}) + +Return a string `s` with the string representation of `obj` up to a depth of `opts.depth`. + +Additional options: + - `quoteStyle`: must be "single" or "double", if present. Default `'single'` for strings, `'double'` for HTML elements. + - `maxStringLength`: must be `0`, a positive integer, `Infinity`, or `null`, if present. Default `Infinity`. + - `customInspect`: When `true`, a custom inspect method function will be invoked (either undere the `util.inspect.custom` symbol, or the `inspect` property). When the string `'symbol'`, only the symbol method will be invoked. Default `true`. + - `indent`: must be "\t", `null`, or a positive integer. Default `null`. + - `numericSeparator`: must be a boolean, if present. Default `false`. If `true`, all numbers will be printed with numeric separators (eg, `1234.5678` will be printed as `'1_234.567_8'`) + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install object-inspect +``` + +# license + +MIT + +[package-url]: https://npmjs.org/package/object-inspect +[npm-version-svg]: https://versionbadg.es/inspect-js/object-inspect.svg +[deps-svg]: https://david-dm.org/inspect-js/object-inspect.svg +[deps-url]: https://david-dm.org/inspect-js/object-inspect +[dev-deps-svg]: https://david-dm.org/inspect-js/object-inspect/dev-status.svg +[dev-deps-url]: https://david-dm.org/inspect-js/object-inspect#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/object-inspect.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/object-inspect.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/object-inspect.svg +[downloads-url]: https://npm-stat.com/charts.html?package=object-inspect +[codecov-image]: https://codecov.io/gh/inspect-js/object-inspect/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/object-inspect/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/object-inspect +[actions-url]: https://github.com/inspect-js/object-inspect/actions diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test-core-js.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test-core-js.js new file mode 100644 index 0000000..e53c400 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test-core-js.js @@ -0,0 +1,26 @@ +'use strict'; + +require('core-js'); + +var inspect = require('./'); +var test = require('tape'); + +test('Maps', function (t) { + t.equal(inspect(new Map([[1, 2]])), 'Map (1) {1 => 2}'); + t.end(); +}); + +test('WeakMaps', function (t) { + t.equal(inspect(new WeakMap([[{}, 2]])), 'WeakMap { ? }'); + t.end(); +}); + +test('Sets', function (t) { + t.equal(inspect(new Set([[1, 2]])), 'Set (1) {[ 1, 2 ]}'); + t.end(); +}); + +test('WeakSets', function (t) { + t.equal(inspect(new WeakSet([[1, 2]])), 'WeakSet { ? }'); + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/bigint.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/bigint.js new file mode 100644 index 0000000..4ecc31d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/bigint.js @@ -0,0 +1,58 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); +var hasToStringTag = require('has-tostringtag/shams')(); + +test('bigint', { skip: typeof BigInt === 'undefined' }, function (t) { + t.test('primitives', function (st) { + st.plan(3); + + st.equal(inspect(BigInt(-256)), '-256n'); + st.equal(inspect(BigInt(0)), '0n'); + st.equal(inspect(BigInt(256)), '256n'); + }); + + t.test('objects', function (st) { + st.plan(3); + + st.equal(inspect(Object(BigInt(-256))), 'Object(-256n)'); + st.equal(inspect(Object(BigInt(0))), 'Object(0n)'); + st.equal(inspect(Object(BigInt(256))), 'Object(256n)'); + }); + + t.test('syntactic primitives', function (st) { + st.plan(3); + + /* eslint-disable no-new-func */ + st.equal(inspect(Function('return -256n')()), '-256n'); + st.equal(inspect(Function('return 0n')()), '0n'); + st.equal(inspect(Function('return 256n')()), '256n'); + }); + + t.test('toStringTag', { skip: !hasToStringTag }, function (st) { + st.plan(1); + + var faker = {}; + faker[Symbol.toStringTag] = 'BigInt'; + st.equal( + inspect(faker), + '{ [Symbol(Symbol.toStringTag)]: \'BigInt\' }', + 'object lying about being a BigInt inspects as an object' + ); + }); + + t.test('numericSeparator', function (st) { + st.equal(inspect(BigInt(0), { numericSeparator: false }), '0n', '0n, numericSeparator false'); + st.equal(inspect(BigInt(0), { numericSeparator: true }), '0n', '0n, numericSeparator true'); + + st.equal(inspect(BigInt(1234), { numericSeparator: false }), '1234n', '1234n, numericSeparator false'); + st.equal(inspect(BigInt(1234), { numericSeparator: true }), '1_234n', '1234n, numericSeparator true'); + st.equal(inspect(BigInt(-1234), { numericSeparator: false }), '-1234n', '1234n, numericSeparator false'); + st.equal(inspect(BigInt(-1234), { numericSeparator: true }), '-1_234n', '1234n, numericSeparator true'); + + st.end(); + }); + + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/browser/dom.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/browser/dom.js new file mode 100644 index 0000000..210c0b2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/browser/dom.js @@ -0,0 +1,15 @@ +var inspect = require('../../'); +var test = require('tape'); + +test('dom element', function (t) { + t.plan(1); + + var d = document.createElement('div'); + d.setAttribute('id', 'beep'); + d.innerHTML = 'woooiiiii'; + + t.equal( + inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }]), + '[
...
, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [Object] ] ] ] } ]' + ); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/circular.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/circular.js new file mode 100644 index 0000000..5df4233 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/circular.js @@ -0,0 +1,16 @@ +var inspect = require('../'); +var test = require('tape'); + +test('circular', function (t) { + t.plan(2); + var obj = { a: 1, b: [3, 4] }; + obj.c = obj; + t.equal(inspect(obj), '{ a: 1, b: [ 3, 4 ], c: [Circular] }'); + + var double = {}; + double.a = [double]; + double.b = {}; + double.b.inner = double.b; + double.b.obj = double; + t.equal(inspect(double), '{ a: [ [Circular] ], b: { inner: [Circular], obj: [Circular] } }'); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/deep.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/deep.js new file mode 100644 index 0000000..99ce32a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/deep.js @@ -0,0 +1,12 @@ +var inspect = require('../'); +var test = require('tape'); + +test('deep', function (t) { + t.plan(4); + var obj = [[[[[[500]]]]]]; + t.equal(inspect(obj), '[ [ [ [ [ [Array] ] ] ] ] ]'); + t.equal(inspect(obj, { depth: 4 }), '[ [ [ [ [Array] ] ] ] ]'); + t.equal(inspect(obj, { depth: 2 }), '[ [ [Array] ] ]'); + + t.equal(inspect([[[{ a: 1 }]]], { depth: 3 }), '[ [ [ [Object] ] ] ]'); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/element.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/element.js new file mode 100644 index 0000000..47fa9e2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/element.js @@ -0,0 +1,53 @@ +var inspect = require('../'); +var test = require('tape'); + +test('element', function (t) { + t.plan(3); + var elem = { + nodeName: 'div', + attributes: [{ name: 'class', value: 'row' }], + getAttribute: function (key) { return key; }, + childNodes: [] + }; + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); + t.deepEqual(inspect(obj, { quoteStyle: 'single' }), "[ 1,
, 3 ]"); + t.deepEqual(inspect(obj, { quoteStyle: 'double' }), '[ 1,
, 3 ]'); +}); + +test('element no attr', function (t) { + t.plan(1); + var elem = { + nodeName: 'div', + getAttribute: function (key) { return key; }, + childNodes: [] + }; + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); +}); + +test('element with contents', function (t) { + t.plan(1); + var elem = { + nodeName: 'div', + getAttribute: function (key) { return key; }, + childNodes: [{ nodeName: 'b' }] + }; + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
...
, 3 ]'); +}); + +test('element instance', function (t) { + t.plan(1); + var h = global.HTMLElement; + global.HTMLElement = function (name, attr) { + this.nodeName = name; + this.attributes = attr; + }; + global.HTMLElement.prototype.getAttribute = function () {}; + + var elem = new global.HTMLElement('div', []); + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); + global.HTMLElement = h; +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/err.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/err.js new file mode 100644 index 0000000..cc1d884 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/err.js @@ -0,0 +1,48 @@ +var test = require('tape'); +var ErrorWithCause = require('error-cause/Error'); + +var inspect = require('../'); + +test('type error', function (t) { + t.plan(1); + var aerr = new TypeError(); + aerr.foo = 555; + aerr.bar = [1, 2, 3]; + + var berr = new TypeError('tuv'); + berr.baz = 555; + + var cerr = new SyntaxError(); + cerr.message = 'whoa'; + cerr['a-b'] = 5; + + var withCause = new ErrorWithCause('foo', { cause: 'bar' }); + var withCausePlus = new ErrorWithCause('foo', { cause: 'bar' }); + withCausePlus.foo = 'bar'; + var withUndefinedCause = new ErrorWithCause('foo', { cause: undefined }); + var withEnumerableCause = new Error('foo'); + withEnumerableCause.cause = 'bar'; + + var obj = [ + new TypeError(), + new TypeError('xxx'), + aerr, + berr, + cerr, + withCause, + withCausePlus, + withUndefinedCause, + withEnumerableCause + ]; + t.equal(inspect(obj), '[ ' + [ + '[TypeError]', + '[TypeError: xxx]', + '{ [TypeError] foo: 555, bar: [ 1, 2, 3 ] }', + '{ [TypeError: tuv] baz: 555 }', + '{ [SyntaxError: whoa] message: \'whoa\', \'a-b\': 5 }', + 'cause' in Error.prototype ? '[Error: foo]' : '{ [Error: foo] [cause]: \'bar\' }', + '{ [Error: foo] ' + ('cause' in Error.prototype ? '' : '[cause]: \'bar\', ') + 'foo: \'bar\' }', + 'cause' in Error.prototype ? '[Error: foo]' : '{ [Error: foo] [cause]: undefined }', + '{ [Error: foo] cause: \'bar\' }' + ].join(', ') + ' ]'); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/fakes.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/fakes.js new file mode 100644 index 0000000..a65c08c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/fakes.js @@ -0,0 +1,29 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); +var hasToStringTag = require('has-tostringtag/shams')(); +var forEach = require('for-each'); + +test('fakes', { skip: !hasToStringTag }, function (t) { + forEach([ + 'Array', + 'Boolean', + 'Date', + 'Error', + 'Number', + 'RegExp', + 'String' + ], function (expected) { + var faker = {}; + faker[Symbol.toStringTag] = expected; + + t.equal( + inspect(faker), + '{ [Symbol(Symbol.toStringTag)]: \'' + expected + '\' }', + 'faker masquerading as ' + expected + ' is not shown as one' + ); + }); + + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/fn.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/fn.js new file mode 100644 index 0000000..de3ca62 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/fn.js @@ -0,0 +1,76 @@ +var inspect = require('../'); +var test = require('tape'); +var arrow = require('make-arrow-function')(); +var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames(); + +test('function', function (t) { + t.plan(1); + var obj = [1, 2, function f(n) { return n; }, 4]; + t.equal(inspect(obj), '[ 1, 2, [Function: f], 4 ]'); +}); + +test('function name', function (t) { + t.plan(1); + var f = (function () { + return function () {}; + }()); + f.toString = function toStr() { return 'function xxx () {}'; }; + var obj = [1, 2, f, 4]; + t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)] { toString: [Function: toStr] }, 4 ]'); +}); + +test('anon function', function (t) { + var f = (function () { + return function () {}; + }()); + var obj = [1, 2, f, 4]; + t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)], 4 ]'); + + t.end(); +}); + +test('arrow function', { skip: !arrow }, function (t) { + t.equal(inspect(arrow), '[Function (anonymous)]'); + + t.end(); +}); + +test('truly nameless function', { skip: !arrow || !functionsHaveConfigurableNames }, function (t) { + function f() {} + Object.defineProperty(f, 'name', { value: false }); + t.equal(f.name, false); + t.equal( + inspect(f), + '[Function: f]', + 'named function with falsy `.name` does not hide its original name' + ); + + function g() {} + Object.defineProperty(g, 'name', { value: true }); + t.equal(g.name, true); + t.equal( + inspect(g), + '[Function: true]', + 'named function with truthy `.name` hides its original name' + ); + + var anon = function () {}; // eslint-disable-line func-style + Object.defineProperty(anon, 'name', { value: null }); + t.equal(anon.name, null); + t.equal( + inspect(anon), + '[Function (anonymous)]', + 'anon function with falsy `.name` does not hide its anonymity' + ); + + var anon2 = function () {}; // eslint-disable-line func-style + Object.defineProperty(anon2, 'name', { value: 1 }); + t.equal(anon2.name, 1); + t.equal( + inspect(anon2), + '[Function: 1]', + 'anon function with truthy `.name` hides its anonymity' + ); + + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/global.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/global.js new file mode 100644 index 0000000..c57216a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/global.js @@ -0,0 +1,17 @@ +'use strict'; + +var inspect = require('../'); + +var test = require('tape'); +var globalThis = require('globalthis')(); + +test('global object', function (t) { + /* eslint-env browser */ + var expected = typeof window === 'undefined' ? 'globalThis' : 'Window'; + t.equal( + inspect([globalThis]), + '[ { [object ' + expected + '] } ]' + ); + + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/has.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/has.js new file mode 100644 index 0000000..01800de --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/has.js @@ -0,0 +1,15 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); +var mockProperty = require('mock-property'); + +test('when Object#hasOwnProperty is deleted', function (t) { + t.plan(1); + var arr = [1, , 3]; // eslint-disable-line no-sparse-arrays + + t.teardown(mockProperty(Array.prototype, 1, { value: 2 })); // this is needed to account for "in" vs "hasOwnProperty" + t.teardown(mockProperty(Object.prototype, 'hasOwnProperty', { 'delete': true })); + + t.equal(inspect(arr), '[ 1, , 3 ]'); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/holes.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/holes.js new file mode 100644 index 0000000..87fc8c8 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/holes.js @@ -0,0 +1,15 @@ +var test = require('tape'); +var inspect = require('../'); + +var xs = ['a', 'b']; +xs[5] = 'f'; +xs[7] = 'j'; +xs[8] = 'k'; + +test('holes', function (t) { + t.plan(1); + t.equal( + inspect(xs), + "[ 'a', 'b', , , , 'f', , 'j', 'k' ]" + ); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/indent-option.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/indent-option.js new file mode 100644 index 0000000..89d8fce --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/indent-option.js @@ -0,0 +1,271 @@ +var test = require('tape'); +var forEach = require('for-each'); + +var inspect = require('../'); + +test('bad indent options', function (t) { + forEach([ + undefined, + true, + false, + -1, + 1.2, + Infinity, + -Infinity, + NaN + ], function (indent) { + t['throws']( + function () { inspect('', { indent: indent }); }, + TypeError, + inspect(indent) + ' is invalid' + ); + }); + + t.end(); +}); + +test('simple object with indent', function (t) { + t.plan(2); + + var obj = { a: 1, b: 2 }; + + var expectedSpaces = [ + '{', + ' a: 1,', + ' b: 2', + '}' + ].join('\n'); + var expectedTabs = [ + '{', + ' a: 1,', + ' b: 2', + '}' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('two deep object with indent', function (t) { + t.plan(2); + + var obj = { a: 1, b: { c: 3, d: 4 } }; + + var expectedSpaces = [ + '{', + ' a: 1,', + ' b: {', + ' c: 3,', + ' d: 4', + ' }', + '}' + ].join('\n'); + var expectedTabs = [ + '{', + ' a: 1,', + ' b: {', + ' c: 3,', + ' d: 4', + ' }', + '}' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('simple array with all single line elements', function (t) { + t.plan(2); + + var obj = [1, 2, 3, 'asdf\nsdf']; + + var expected = '[ 1, 2, 3, \'asdf\\nsdf\' ]'; + + t.equal(inspect(obj, { indent: 2 }), expected, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expected, 'tabs'); +}); + +test('array with complex elements', function (t) { + t.plan(2); + + var obj = [1, { a: 1, b: { c: 1 } }, 'asdf\nsdf']; + + var expectedSpaces = [ + '[', + ' 1,', + ' {', + ' a: 1,', + ' b: {', + ' c: 1', + ' }', + ' },', + ' \'asdf\\nsdf\'', + ']' + ].join('\n'); + var expectedTabs = [ + '[', + ' 1,', + ' {', + ' a: 1,', + ' b: {', + ' c: 1', + ' }', + ' },', + ' \'asdf\\nsdf\'', + ']' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('values', function (t) { + t.plan(2); + var obj = [{}, [], { 'a-b': 5 }]; + + var expectedSpaces = [ + '[', + ' {},', + ' [],', + ' {', + ' \'a-b\': 5', + ' }', + ']' + ].join('\n'); + var expectedTabs = [ + '[', + ' {},', + ' [],', + ' {', + ' \'a-b\': 5', + ' }', + ']' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('Map', { skip: typeof Map !== 'function' }, function (t) { + var map = new Map(); + map.set({ a: 1 }, ['b']); + map.set(3, NaN); + + var expectedStringSpaces = [ + 'Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + '}' + ].join('\n'); + var expectedStringTabs = [ + 'Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + '}' + ].join('\n'); + var expectedStringTabsDoubleQuotes = [ + 'Map (2) {', + ' { a: 1 } => [ "b" ],', + ' 3 => NaN', + '}' + ].join('\n'); + + t.equal( + inspect(map, { indent: 2 }), + expectedStringSpaces, + 'Map keys are not indented (two)' + ); + t.equal( + inspect(map, { indent: '\t' }), + expectedStringTabs, + 'Map keys are not indented (tabs)' + ); + t.equal( + inspect(map, { indent: '\t', quoteStyle: 'double' }), + expectedStringTabsDoubleQuotes, + 'Map keys are not indented (tabs + double quotes)' + ); + + t.equal(inspect(new Map(), { indent: 2 }), 'Map (0) {}', 'empty Map should show as empty (two)'); + t.equal(inspect(new Map(), { indent: '\t' }), 'Map (0) {}', 'empty Map should show as empty (tabs)'); + + var nestedMap = new Map(); + nestedMap.set(nestedMap, map); + var expectedNestedSpaces = [ + 'Map (1) {', + ' [Circular] => Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + ' }', + '}' + ].join('\n'); + var expectedNestedTabs = [ + 'Map (1) {', + ' [Circular] => Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + ' }', + '}' + ].join('\n'); + t.equal(inspect(nestedMap, { indent: 2 }), expectedNestedSpaces, 'Map containing a Map should work (two)'); + t.equal(inspect(nestedMap, { indent: '\t' }), expectedNestedTabs, 'Map containing a Map should work (tabs)'); + + t.end(); +}); + +test('Set', { skip: typeof Set !== 'function' }, function (t) { + var set = new Set(); + set.add({ a: 1 }); + set.add(['b']); + var expectedStringSpaces = [ + 'Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + '}' + ].join('\n'); + var expectedStringTabs = [ + 'Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + '}' + ].join('\n'); + t.equal(inspect(set, { indent: 2 }), expectedStringSpaces, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (two)'); + t.equal(inspect(set, { indent: '\t' }), expectedStringTabs, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (tabs)'); + + t.equal(inspect(new Set(), { indent: 2 }), 'Set (0) {}', 'empty Set should show as empty (two)'); + t.equal(inspect(new Set(), { indent: '\t' }), 'Set (0) {}', 'empty Set should show as empty (tabs)'); + + var nestedSet = new Set(); + nestedSet.add(set); + nestedSet.add(nestedSet); + var expectedNestedSpaces = [ + 'Set (2) {', + ' Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + ' },', + ' [Circular]', + '}' + ].join('\n'); + var expectedNestedTabs = [ + 'Set (2) {', + ' Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + ' },', + ' [Circular]', + '}' + ].join('\n'); + t.equal(inspect(nestedSet, { indent: 2 }), expectedNestedSpaces, 'Set containing a Set should work (two)'); + t.equal(inspect(nestedSet, { indent: '\t' }), expectedNestedTabs, 'Set containing a Set should work (tabs)'); + + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/inspect.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/inspect.js new file mode 100644 index 0000000..1abf81b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/inspect.js @@ -0,0 +1,139 @@ +var test = require('tape'); +var hasSymbols = require('has-symbols/shams')(); +var utilInspect = require('../util.inspect'); +var repeat = require('string.prototype.repeat'); + +var inspect = require('..'); + +test('inspect', function (t) { + t.plan(5); + + var obj = [{ inspect: function xyzInspect() { return '!XYZ¡'; } }, []]; + var stringResult = '[ !XYZ¡, [] ]'; + var falseResult = '[ { inspect: [Function: xyzInspect] }, [] ]'; + + t.equal(inspect(obj), stringResult); + t.equal(inspect(obj, { customInspect: true }), stringResult); + t.equal(inspect(obj, { customInspect: 'symbol' }), falseResult); + t.equal(inspect(obj, { customInspect: false }), falseResult); + t['throws']( + function () { inspect(obj, { customInspect: 'not a boolean or "symbol"' }); }, + TypeError, + '`customInspect` must be a boolean or the string "symbol"' + ); +}); + +test('inspect custom symbol', { skip: !hasSymbols || !utilInspect || !utilInspect.custom }, function (t) { + t.plan(4); + + var obj = { inspect: function stringInspect() { return 'string'; } }; + obj[utilInspect.custom] = function custom() { return 'symbol'; }; + + var symbolResult = '[ symbol, [] ]'; + var stringResult = '[ string, [] ]'; + var falseResult = '[ { inspect: [Function: stringInspect]' + (utilInspect.custom ? ', [' + inspect(utilInspect.custom) + ']: [Function: custom]' : '') + ' }, [] ]'; + + var symbolStringFallback = utilInspect.custom ? symbolResult : stringResult; + var symbolFalseFallback = utilInspect.custom ? symbolResult : falseResult; + + t.equal(inspect([obj, []]), symbolStringFallback); + t.equal(inspect([obj, []], { customInspect: true }), symbolStringFallback); + t.equal(inspect([obj, []], { customInspect: 'symbol' }), symbolFalseFallback); + t.equal(inspect([obj, []], { customInspect: false }), falseResult); +}); + +test('symbols', { skip: !hasSymbols }, function (t) { + t.plan(2); + + var obj = { a: 1 }; + obj[Symbol('test')] = 2; + obj[Symbol.iterator] = 3; + Object.defineProperty(obj, Symbol('non-enum'), { + enumerable: false, + value: 4 + }); + + if (typeof Symbol.iterator === 'symbol') { + t.equal(inspect(obj), '{ a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }', 'object with symbols'); + t.equal(inspect([obj, []]), '[ { a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }, [] ]', 'object with symbols in array'); + } else { + // symbol sham key ordering is unreliable + t.match( + inspect(obj), + /^(?:{ a: 1, \[Symbol\(test\)\]: 2, \[Symbol\(Symbol.iterator\)\]: 3 }|{ a: 1, \[Symbol\(Symbol.iterator\)\]: 3, \[Symbol\(test\)\]: 2 })$/, + 'object with symbols (nondeterministic symbol sham key ordering)' + ); + t.match( + inspect([obj, []]), + /^\[ (?:{ a: 1, \[Symbol\(test\)\]: 2, \[Symbol\(Symbol.iterator\)\]: 3 }|{ a: 1, \[Symbol\(Symbol.iterator\)\]: 3, \[Symbol\(test\)\]: 2 }), \[\] \]$/, + 'object with symbols in array (nondeterministic symbol sham key ordering)' + ); + } +}); + +test('maxStringLength', function (t) { + t['throws']( + function () { inspect('', { maxStringLength: -1 }); }, + TypeError, + 'maxStringLength must be >= 0, or Infinity, not negative' + ); + + var str = repeat('a', 1e8); + + t.equal( + inspect([str], { maxStringLength: 10 }), + '[ \'aaaaaaaaaa\'... 99999990 more characters ]', + 'maxStringLength option limits output' + ); + + t.equal( + inspect(['f'], { maxStringLength: null }), + '[ \'\'... 1 more character ]', + 'maxStringLength option accepts `null`' + ); + + t.equal( + inspect([str], { maxStringLength: Infinity }), + '[ \'' + str + '\' ]', + 'maxStringLength option accepts ∞' + ); + + t.end(); +}); + +test('inspect options', { skip: !utilInspect.custom }, function (t) { + var obj = {}; + obj[utilInspect.custom] = function () { + return JSON.stringify(arguments); + }; + t.equal( + inspect(obj), + utilInspect(obj, { depth: 5 }), + 'custom symbols will use node\'s inspect' + ); + t.equal( + inspect(obj, { depth: 2 }), + utilInspect(obj, { depth: 2 }), + 'a reduced depth will be passed to node\'s inspect' + ); + t.equal( + inspect({ d1: obj }, { depth: 3 }), + '{ d1: ' + utilInspect(obj, { depth: 2 }) + ' }', + 'deep objects will receive a reduced depth' + ); + t.equal( + inspect({ d1: obj }, { depth: 1 }), + '{ d1: [Object] }', + 'unlike nodejs inspect, customInspect will not be used once the depth is exceeded.' + ); + t.end(); +}); + +test('inspect URL', { skip: typeof URL === 'undefined' }, function (t) { + t.match( + inspect(new URL('https://nodejs.org')), + /nodejs\.org/, // Different environments stringify it differently + 'url can be inspected' + ); + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/lowbyte.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/lowbyte.js new file mode 100644 index 0000000..68a345d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/lowbyte.js @@ -0,0 +1,12 @@ +var test = require('tape'); +var inspect = require('../'); + +var obj = { x: 'a\r\nb', y: '\x05! \x1f \x12' }; + +test('interpolate low bytes', function (t) { + t.plan(1); + t.equal( + inspect(obj), + "{ x: 'a\\r\\nb', y: '\\x05! \\x1F \\x12' }" + ); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/number.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/number.js new file mode 100644 index 0000000..8f287e8 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/number.js @@ -0,0 +1,58 @@ +var test = require('tape'); +var v = require('es-value-fixtures'); +var forEach = require('for-each'); + +var inspect = require('../'); + +test('negative zero', function (t) { + t.equal(inspect(0), '0', 'inspect(0) === "0"'); + t.equal(inspect(Object(0)), 'Object(0)', 'inspect(Object(0)) === "Object(0)"'); + + t.equal(inspect(-0), '-0', 'inspect(-0) === "-0"'); + t.equal(inspect(Object(-0)), 'Object(-0)', 'inspect(Object(-0)) === "Object(-0)"'); + + t.end(); +}); + +test('numericSeparator', function (t) { + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { inspect(true, { numericSeparator: nonBoolean }); }, + TypeError, + inspect(nonBoolean) + ' is not a boolean' + ); + }); + + t.test('3 digit numbers', function (st) { + var failed = false; + for (var i = -999; i < 1000; i += 1) { + var actual = inspect(i); + var actualSepNo = inspect(i, { numericSeparator: false }); + var actualSepYes = inspect(i, { numericSeparator: true }); + var expected = String(i); + if (actual !== expected || actualSepNo !== expected || actualSepYes !== expected) { + failed = true; + t.equal(actual, expected); + t.equal(actualSepNo, expected); + t.equal(actualSepYes, expected); + } + } + + st.notOk(failed, 'all 3 digit numbers passed'); + + st.end(); + }); + + t.equal(inspect(1e3), '1000', '1000'); + t.equal(inspect(1e3, { numericSeparator: false }), '1000', '1000, numericSeparator false'); + t.equal(inspect(1e3, { numericSeparator: true }), '1_000', '1000, numericSeparator true'); + t.equal(inspect(-1e3), '-1000', '-1000'); + t.equal(inspect(-1e3, { numericSeparator: false }), '-1000', '-1000, numericSeparator false'); + t.equal(inspect(-1e3, { numericSeparator: true }), '-1_000', '-1000, numericSeparator true'); + + t.equal(inspect(1234.5678, { numericSeparator: true }), '1_234.567_8', 'fractional numbers get separators'); + t.equal(inspect(1234.56789, { numericSeparator: true }), '1_234.567_89', 'fractional numbers get separators'); + t.equal(inspect(1234.567891, { numericSeparator: true }), '1_234.567_891', 'fractional numbers get separators'); + + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/quoteStyle.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/quoteStyle.js new file mode 100644 index 0000000..da23e63 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/quoteStyle.js @@ -0,0 +1,26 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); + +test('quoteStyle option', function (t) { + t['throws'](function () { inspect(null, { quoteStyle: false }); }, 'false is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: true }); }, 'true is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: '' }); }, '"" is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: {} }); }, '{} is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: [] }); }, '[] is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: 42 }); }, '42 is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: NaN }); }, 'NaN is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: function () {} }); }, 'a function is not a valid value'); + + t.equal(inspect('"', { quoteStyle: 'single' }), '\'"\'', 'double quote, quoteStyle: "single"'); + t.equal(inspect('"', { quoteStyle: 'double' }), '"\\""', 'double quote, quoteStyle: "double"'); + + t.equal(inspect('\'', { quoteStyle: 'single' }), '\'\\\'\'', 'single quote, quoteStyle: "single"'); + t.equal(inspect('\'', { quoteStyle: 'double' }), '"\'"', 'single quote, quoteStyle: "double"'); + + t.equal(inspect('`', { quoteStyle: 'single' }), '\'`\'', 'backtick, quoteStyle: "single"'); + t.equal(inspect('`', { quoteStyle: 'double' }), '"`"', 'backtick, quoteStyle: "double"'); + + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/toStringTag.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/toStringTag.js new file mode 100644 index 0000000..95f8270 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/toStringTag.js @@ -0,0 +1,40 @@ +'use strict'; + +var test = require('tape'); +var hasToStringTag = require('has-tostringtag/shams')(); + +var inspect = require('../'); + +test('Symbol.toStringTag', { skip: !hasToStringTag }, function (t) { + t.plan(4); + + var obj = { a: 1 }; + t.equal(inspect(obj), '{ a: 1 }', 'object, no Symbol.toStringTag'); + + obj[Symbol.toStringTag] = 'foo'; + t.equal(inspect(obj), '{ a: 1, [Symbol(Symbol.toStringTag)]: \'foo\' }', 'object with Symbol.toStringTag'); + + t.test('null objects', { skip: 'toString' in { __proto__: null } }, function (st) { + st.plan(2); + + var dict = { __proto__: null, a: 1 }; + st.equal(inspect(dict), '[Object: null prototype] { a: 1 }', 'null object with Symbol.toStringTag'); + + dict[Symbol.toStringTag] = 'Dict'; + st.equal(inspect(dict), '[Dict: null prototype] { a: 1, [Symbol(Symbol.toStringTag)]: \'Dict\' }', 'null object with Symbol.toStringTag'); + }); + + t.test('instances', function (st) { + st.plan(4); + + function C() { + this.a = 1; + } + st.equal(Object.prototype.toString.call(new C()), '[object Object]', 'instance, no toStringTag, Object.prototype.toString'); + st.equal(inspect(new C()), 'C { a: 1 }', 'instance, no toStringTag'); + + C.prototype[Symbol.toStringTag] = 'Class!'; + st.equal(Object.prototype.toString.call(new C()), '[object Class!]', 'instance, with toStringTag, Object.prototype.toString'); + st.equal(inspect(new C()), 'C [Class!] { a: 1 }', 'instance, with toStringTag'); + }); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/undef.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/undef.js new file mode 100644 index 0000000..e3f4961 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/undef.js @@ -0,0 +1,12 @@ +var test = require('tape'); +var inspect = require('../'); + +var obj = { a: 1, b: [3, 4, undefined, null], c: undefined, d: null }; + +test('undef and null', function (t) { + t.plan(1); + t.equal( + inspect(obj), + '{ a: 1, b: [ 3, 4, undefined, null ], c: undefined, d: null }' + ); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/values.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/values.js new file mode 100644 index 0000000..15986cd --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/test/values.js @@ -0,0 +1,261 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); +var mockProperty = require('mock-property'); +var hasSymbols = require('has-symbols/shams')(); +var hasToStringTag = require('has-tostringtag/shams')(); +var forEach = require('for-each'); +var semver = require('semver'); + +test('values', function (t) { + t.plan(1); + var obj = [{}, [], { 'a-b': 5 }]; + t.equal(inspect(obj), '[ {}, [], { \'a-b\': 5 } ]'); +}); + +test('arrays with properties', function (t) { + t.plan(1); + var arr = [3]; + arr.foo = 'bar'; + var obj = [1, 2, arr]; + obj.baz = 'quux'; + obj.index = -1; + t.equal(inspect(obj), '[ 1, 2, [ 3, foo: \'bar\' ], baz: \'quux\', index: -1 ]'); +}); + +test('has', function (t) { + t.plan(1); + t.teardown(mockProperty(Object.prototype, 'hasOwnProperty', { 'delete': true })); + + t.equal(inspect({ a: 1, b: 2 }), '{ a: 1, b: 2 }'); +}); + +test('indexOf seen', function (t) { + t.plan(1); + var xs = [1, 2, 3, {}]; + xs.push(xs); + + var seen = []; + seen.indexOf = undefined; + + t.equal( + inspect(xs, {}, 0, seen), + '[ 1, 2, 3, {}, [Circular] ]' + ); +}); + +test('seen seen', function (t) { + t.plan(1); + var xs = [1, 2, 3]; + + var seen = [xs]; + seen.indexOf = undefined; + + t.equal( + inspect(xs, {}, 0, seen), + '[Circular]' + ); +}); + +test('seen seen seen', function (t) { + t.plan(1); + var xs = [1, 2, 3]; + + var seen = [5, xs]; + seen.indexOf = undefined; + + t.equal( + inspect(xs, {}, 0, seen), + '[Circular]' + ); +}); + +test('symbols', { skip: !hasSymbols }, function (t) { + var sym = Symbol('foo'); + t.equal(inspect(sym), 'Symbol(foo)', 'Symbol("foo") should be "Symbol(foo)"'); + if (typeof sym === 'symbol') { + // Symbol shams are incapable of differentiating boxed from unboxed symbols + t.equal(inspect(Object(sym)), 'Object(Symbol(foo))', 'Object(Symbol("foo")) should be "Object(Symbol(foo))"'); + } + + t.test('toStringTag', { skip: !hasToStringTag }, function (st) { + st.plan(1); + + var faker = {}; + faker[Symbol.toStringTag] = 'Symbol'; + st.equal( + inspect(faker), + '{ [Symbol(Symbol.toStringTag)]: \'Symbol\' }', + 'object lying about being a Symbol inspects as an object' + ); + }); + + t.end(); +}); + +test('Map', { skip: typeof Map !== 'function' }, function (t) { + var map = new Map(); + map.set({ a: 1 }, ['b']); + map.set(3, NaN); + var expectedString = 'Map (2) {' + inspect({ a: 1 }) + ' => ' + inspect(['b']) + ', 3 => NaN}'; + t.equal(inspect(map), expectedString, 'new Map([[{ a: 1 }, ["b"]], [3, NaN]]) should show size and contents'); + t.equal(inspect(new Map()), 'Map (0) {}', 'empty Map should show as empty'); + + var nestedMap = new Map(); + nestedMap.set(nestedMap, map); + t.equal(inspect(nestedMap), 'Map (1) {[Circular] => ' + expectedString + '}', 'Map containing a Map should work'); + + t.end(); +}); + +test('WeakMap', { skip: typeof WeakMap !== 'function' }, function (t) { + var map = new WeakMap(); + map.set({ a: 1 }, ['b']); + var expectedString = 'WeakMap { ? }'; + t.equal(inspect(map), expectedString, 'new WeakMap([[{ a: 1 }, ["b"]]]) should not show size or contents'); + t.equal(inspect(new WeakMap()), 'WeakMap { ? }', 'empty WeakMap should not show as empty'); + + t.end(); +}); + +test('Set', { skip: typeof Set !== 'function' }, function (t) { + var set = new Set(); + set.add({ a: 1 }); + set.add(['b']); + var expectedString = 'Set (2) {' + inspect({ a: 1 }) + ', ' + inspect(['b']) + '}'; + t.equal(inspect(set), expectedString, 'new Set([{ a: 1 }, ["b"]]) should show size and contents'); + t.equal(inspect(new Set()), 'Set (0) {}', 'empty Set should show as empty'); + + var nestedSet = new Set(); + nestedSet.add(set); + nestedSet.add(nestedSet); + t.equal(inspect(nestedSet), 'Set (2) {' + expectedString + ', [Circular]}', 'Set containing a Set should work'); + + t.end(); +}); + +test('WeakSet', { skip: typeof WeakSet !== 'function' }, function (t) { + var map = new WeakSet(); + map.add({ a: 1 }); + var expectedString = 'WeakSet { ? }'; + t.equal(inspect(map), expectedString, 'new WeakSet([{ a: 1 }]) should not show size or contents'); + t.equal(inspect(new WeakSet()), 'WeakSet { ? }', 'empty WeakSet should not show as empty'); + + t.end(); +}); + +test('WeakRef', { skip: typeof WeakRef !== 'function' }, function (t) { + var ref = new WeakRef({ a: 1 }); + var expectedString = 'WeakRef { ? }'; + t.equal(inspect(ref), expectedString, 'new WeakRef({ a: 1 }) should not show contents'); + + t.end(); +}); + +test('FinalizationRegistry', { skip: typeof FinalizationRegistry !== 'function' }, function (t) { + var registry = new FinalizationRegistry(function () {}); + var expectedString = 'FinalizationRegistry [FinalizationRegistry] {}'; + t.equal(inspect(registry), expectedString, 'new FinalizationRegistry(function () {}) should work normallys'); + + t.end(); +}); + +test('Strings', function (t) { + var str = 'abc'; + + t.equal(inspect(str), "'" + str + "'", 'primitive string shows as such'); + t.equal(inspect(str, { quoteStyle: 'single' }), "'" + str + "'", 'primitive string shows as such, single quoted'); + t.equal(inspect(str, { quoteStyle: 'double' }), '"' + str + '"', 'primitive string shows as such, double quoted'); + t.equal(inspect(Object(str)), 'Object(' + inspect(str) + ')', 'String object shows as such'); + t.equal(inspect(Object(str), { quoteStyle: 'single' }), 'Object(' + inspect(str, { quoteStyle: 'single' }) + ')', 'String object shows as such, single quoted'); + t.equal(inspect(Object(str), { quoteStyle: 'double' }), 'Object(' + inspect(str, { quoteStyle: 'double' }) + ')', 'String object shows as such, double quoted'); + + t.end(); +}); + +test('Numbers', function (t) { + var num = 42; + + t.equal(inspect(num), String(num), 'primitive number shows as such'); + t.equal(inspect(Object(num)), 'Object(' + inspect(num) + ')', 'Number object shows as such'); + + t.end(); +}); + +test('Booleans', function (t) { + t.equal(inspect(true), String(true), 'primitive true shows as such'); + t.equal(inspect(Object(true)), 'Object(' + inspect(true) + ')', 'Boolean object true shows as such'); + + t.equal(inspect(false), String(false), 'primitive false shows as such'); + t.equal(inspect(Object(false)), 'Object(' + inspect(false) + ')', 'Boolean false object shows as such'); + + t.end(); +}); + +test('Date', function (t) { + var now = new Date(); + t.equal(inspect(now), String(now), 'Date shows properly'); + t.equal(inspect(new Date(NaN)), 'Invalid Date', 'Invalid Date shows properly'); + + t.end(); +}); + +test('RegExps', function (t) { + t.equal(inspect(/a/g), '/a/g', 'regex shows properly'); + t.equal(inspect(new RegExp('abc', 'i')), '/abc/i', 'new RegExp shows properly'); + + var match = 'abc abc'.match(/[ab]+/); + delete match.groups; // for node < 10 + t.equal(inspect(match), '[ \'ab\', index: 0, input: \'abc abc\' ]', 'RegExp match object shows properly'); + + t.end(); +}); + +test('Proxies', { skip: typeof Proxy !== 'function' || !hasToStringTag }, function (t) { + var target = { proxy: true }; + var fake = new Proxy(target, { has: function () { return false; } }); + + // needed to work around a weird difference in node v6.0 - v6.4 where non-present properties are not logged + var isNode60 = semver.satisfies(process.version, '6.0 - 6.4'); + + forEach([ + 'Boolean', + 'Number', + 'String', + 'Symbol', + 'Date' + ], function (tag) { + target[Symbol.toStringTag] = tag; + + t.equal( + inspect(fake), + '{ ' + (isNode60 ? '' : 'proxy: true, ') + '[Symbol(Symbol.toStringTag)]: \'' + tag + '\' }', + 'Proxy for + ' + tag + ' shows as the target, which has no slots' + ); + }); + + t.end(); +}); + +test('fakers', { skip: !hasToStringTag }, function (t) { + var target = { proxy: false }; + + forEach([ + 'Boolean', + 'Number', + 'String', + 'Symbol', + 'Date' + ], function (tag) { + target[Symbol.toStringTag] = tag; + + t.equal( + inspect(target), + '{ proxy: false, [Symbol(Symbol.toStringTag)]: \'' + tag + '\' }', + 'Object pretending to be ' + tag + ' does not trick us' + ); + }); + + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/util.inspect.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/util.inspect.js new file mode 100644 index 0000000..7784fab --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/object-inspect/util.inspect.js @@ -0,0 +1 @@ +module.exports = require('util').inspect; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/on-finished/HISTORY.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/on-finished/HISTORY.md new file mode 100644 index 0000000..1917595 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/on-finished/HISTORY.md @@ -0,0 +1,98 @@ +2.4.1 / 2022-02-22 +================== + + * Fix error on early async hooks implementations + +2.4.0 / 2022-02-21 +================== + + * Prevent loss of async hooks context + +2.3.0 / 2015-05-26 +================== + + * Add defined behavior for HTTP `CONNECT` requests + * Add defined behavior for HTTP `Upgrade` requests + * deps: ee-first@1.1.1 + +2.2.1 / 2015-04-22 +================== + + * Fix `isFinished(req)` when data buffered + +2.2.0 / 2014-12-22 +================== + + * Add message object to callback arguments + +2.1.1 / 2014-10-22 +================== + + * Fix handling of pipelined requests + +2.1.0 / 2014-08-16 +================== + + * Check if `socket` is detached + * Return `undefined` for `isFinished` if state unknown + +2.0.0 / 2014-08-16 +================== + + * Add `isFinished` function + * Move to `jshttp` organization + * Remove support for plain socket argument + * Rename to `on-finished` + * Support both `req` and `res` as arguments + * deps: ee-first@1.0.5 + +1.2.2 / 2014-06-10 +================== + + * Reduce listeners added to emitters + - avoids "event emitter leak" warnings when used multiple times on same request + +1.2.1 / 2014-06-08 +================== + + * Fix returned value when already finished + +1.2.0 / 2014-06-05 +================== + + * Call callback when called on already-finished socket + +1.1.4 / 2014-05-27 +================== + + * Support node.js 0.8 + +1.1.3 / 2014-04-30 +================== + + * Make sure errors passed as instanceof `Error` + +1.1.2 / 2014-04-18 +================== + + * Default the `socket` to passed-in object + +1.1.1 / 2014-01-16 +================== + + * Rename module to `finished` + +1.1.0 / 2013-12-25 +================== + + * Call callback when called on already-errored socket + +1.0.1 / 2013-12-20 +================== + + * Actually pass the error to the callback + +1.0.0 / 2013-12-20 +================== + + * Initial release diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/on-finished/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/on-finished/LICENSE new file mode 100644 index 0000000..5931fd2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/on-finished/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2013 Jonathan Ong +Copyright (c) 2014 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/on-finished/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/on-finished/README.md new file mode 100644 index 0000000..8973cde --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/on-finished/README.md @@ -0,0 +1,162 @@ +# on-finished + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][ci-image]][ci-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +Execute a callback when a HTTP request closes, finishes, or errors. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install on-finished +``` + +## API + +```js +var onFinished = require('on-finished') +``` + +### onFinished(res, listener) + +Attach a listener to listen for the response to finish. The listener will +be invoked only once when the response finished. If the response finished +to an error, the first argument will contain the error. If the response +has already finished, the listener will be invoked. + +Listening to the end of a response would be used to close things associated +with the response, like open files. + +Listener is invoked as `listener(err, res)`. + + + +```js +onFinished(res, function (err, res) { + // clean up open fds, etc. + // err contains the error if request error'd +}) +``` + +### onFinished(req, listener) + +Attach a listener to listen for the request to finish. The listener will +be invoked only once when the request finished. If the request finished +to an error, the first argument will contain the error. If the request +has already finished, the listener will be invoked. + +Listening to the end of a request would be used to know when to continue +after reading the data. + +Listener is invoked as `listener(err, req)`. + + + +```js +var data = '' + +req.setEncoding('utf8') +req.on('data', function (str) { + data += str +}) + +onFinished(req, function (err, req) { + // data is read unless there is err +}) +``` + +### onFinished.isFinished(res) + +Determine if `res` is already finished. This would be useful to check and +not even start certain operations if the response has already finished. + +### onFinished.isFinished(req) + +Determine if `req` is already finished. This would be useful to check and +not even start certain operations if the request has already finished. + +## Special Node.js requests + +### HTTP CONNECT method + +The meaning of the `CONNECT` method from RFC 7231, section 4.3.6: + +> The CONNECT method requests that the recipient establish a tunnel to +> the destination origin server identified by the request-target and, +> if successful, thereafter restrict its behavior to blind forwarding +> of packets, in both directions, until the tunnel is closed. Tunnels +> are commonly used to create an end-to-end virtual connection, through +> one or more proxies, which can then be secured using TLS (Transport +> Layer Security, [RFC5246]). + +In Node.js, these request objects come from the `'connect'` event on +the HTTP server. + +When this module is used on a HTTP `CONNECT` request, the request is +considered "finished" immediately, **due to limitations in the Node.js +interface**. This means if the `CONNECT` request contains a request entity, +the request will be considered "finished" even before it has been read. + +There is no such thing as a response object to a `CONNECT` request in +Node.js, so there is no support for one. + +### HTTP Upgrade request + +The meaning of the `Upgrade` header from RFC 7230, section 6.1: + +> The "Upgrade" header field is intended to provide a simple mechanism +> for transitioning from HTTP/1.1 to some other protocol on the same +> connection. + +In Node.js, these request objects come from the `'upgrade'` event on +the HTTP server. + +When this module is used on a HTTP request with an `Upgrade` header, the +request is considered "finished" immediately, **due to limitations in the +Node.js interface**. This means if the `Upgrade` request contains a request +entity, the request will be considered "finished" even before it has been +read. + +There is no such thing as a response object to a `Upgrade` request in +Node.js, so there is no support for one. + +## Example + +The following code ensures that file descriptors are always closed +once the response finishes. + +```js +var destroy = require('destroy') +var fs = require('fs') +var http = require('http') +var onFinished = require('on-finished') + +http.createServer(function onRequest (req, res) { + var stream = fs.createReadStream('package.json') + stream.pipe(res) + onFinished(res, function () { + destroy(stream) + }) +}) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/on-finished/master?label=ci +[ci-url]: https://github.com/jshttp/on-finished/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/on-finished/master +[coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master +[node-image]: https://badgen.net/npm/node/on-finished +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/on-finished +[npm-url]: https://npmjs.org/package/on-finished +[npm-version-image]: https://badgen.net/npm/v/on-finished diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/on-finished/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/on-finished/index.js new file mode 100644 index 0000000..e68df7b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/on-finished/index.js @@ -0,0 +1,234 @@ +/*! + * on-finished + * Copyright(c) 2013 Jonathan Ong + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = onFinished +module.exports.isFinished = isFinished + +/** + * Module dependencies. + * @private + */ + +var asyncHooks = tryRequireAsyncHooks() +var first = require('ee-first') + +/** + * Variables. + * @private + */ + +/* istanbul ignore next */ +var defer = typeof setImmediate === 'function' + ? setImmediate + : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) } + +/** + * Invoke callback when the response has finished, useful for + * cleaning up resources afterwards. + * + * @param {object} msg + * @param {function} listener + * @return {object} + * @public + */ + +function onFinished (msg, listener) { + if (isFinished(msg) !== false) { + defer(listener, null, msg) + return msg + } + + // attach the listener to the message + attachListener(msg, wrap(listener)) + + return msg +} + +/** + * Determine if message is already finished. + * + * @param {object} msg + * @return {boolean} + * @public + */ + +function isFinished (msg) { + var socket = msg.socket + + if (typeof msg.finished === 'boolean') { + // OutgoingMessage + return Boolean(msg.finished || (socket && !socket.writable)) + } + + if (typeof msg.complete === 'boolean') { + // IncomingMessage + return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable)) + } + + // don't know + return undefined +} + +/** + * Attach a finished listener to the message. + * + * @param {object} msg + * @param {function} callback + * @private + */ + +function attachFinishedListener (msg, callback) { + var eeMsg + var eeSocket + var finished = false + + function onFinish (error) { + eeMsg.cancel() + eeSocket.cancel() + + finished = true + callback(error) + } + + // finished on first message event + eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish) + + function onSocket (socket) { + // remove listener + msg.removeListener('socket', onSocket) + + if (finished) return + if (eeMsg !== eeSocket) return + + // finished on first socket event + eeSocket = first([[socket, 'error', 'close']], onFinish) + } + + if (msg.socket) { + // socket already assigned + onSocket(msg.socket) + return + } + + // wait for socket to be assigned + msg.on('socket', onSocket) + + if (msg.socket === undefined) { + // istanbul ignore next: node.js 0.8 patch + patchAssignSocket(msg, onSocket) + } +} + +/** + * Attach the listener to the message. + * + * @param {object} msg + * @return {function} + * @private + */ + +function attachListener (msg, listener) { + var attached = msg.__onFinished + + // create a private single listener with queue + if (!attached || !attached.queue) { + attached = msg.__onFinished = createListener(msg) + attachFinishedListener(msg, attached) + } + + attached.queue.push(listener) +} + +/** + * Create listener on message. + * + * @param {object} msg + * @return {function} + * @private + */ + +function createListener (msg) { + function listener (err) { + if (msg.__onFinished === listener) msg.__onFinished = null + if (!listener.queue) return + + var queue = listener.queue + listener.queue = null + + for (var i = 0; i < queue.length; i++) { + queue[i](err, msg) + } + } + + listener.queue = [] + + return listener +} + +/** + * Patch ServerResponse.prototype.assignSocket for node.js 0.8. + * + * @param {ServerResponse} res + * @param {function} callback + * @private + */ + +// istanbul ignore next: node.js 0.8 patch +function patchAssignSocket (res, callback) { + var assignSocket = res.assignSocket + + if (typeof assignSocket !== 'function') return + + // res.on('socket', callback) is broken in 0.8 + res.assignSocket = function _assignSocket (socket) { + assignSocket.call(this, socket) + callback(socket) + } +} + +/** + * Try to require async_hooks + * @private + */ + +function tryRequireAsyncHooks () { + try { + return require('async_hooks') + } catch (e) { + return {} + } +} + +/** + * Wrap function with async resource, if possible. + * AsyncResource.bind static method backported. + * @private + */ + +function wrap (fn) { + var res + + // create anonymous resource + if (asyncHooks.AsyncResource) { + res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn') + } + + // incompatible node.js + if (!res || !res.runInAsyncScope) { + return fn + } + + // return bound function + return res.runInAsyncScope.bind(res, fn, null) +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/on-finished/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/on-finished/package.json new file mode 100644 index 0000000..644cd81 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/on-finished/package.json @@ -0,0 +1,39 @@ +{ + "name": "on-finished", + "description": "Execute a callback when a request closes, finishes, or errors", + "version": "2.4.1", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "repository": "jshttp/on-finished", + "dependencies": { + "ee-first": "1.1.1" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.1", + "nyc": "15.1.0" + }, + "engines": { + "node": ">= 0.8" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/once/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/once/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/once/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/once/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/once/README.md new file mode 100644 index 0000000..1f1ffca --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/once/README.md @@ -0,0 +1,79 @@ +# once + +Only call a function once. + +## usage + +```javascript +var once = require('once') + +function load (file, cb) { + cb = once(cb) + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Or add to the Function.prototype in a responsible way: + +```javascript +// only has to be done once +require('once').proto() + +function load (file, cb) { + cb = cb.once() + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Ironically, the prototype feature makes this module twice as +complicated as necessary. + +To check whether you function has been called, use `fn.called`. Once the +function is called for the first time the return value of the original +function is saved in `fn.value` and subsequent calls will continue to +return this value. + +```javascript +var once = require('once') + +function load (cb) { + cb = once(cb) + var stream = createStream() + stream.once('data', cb) + stream.once('end', function () { + if (!cb.called) cb(new Error('not found')) + }) +} +``` + +## `once.strict(func)` + +Throw an error if the function is called twice. + +Some functions are expected to be called only once. Using `once` for them would +potentially hide logical errors. + +In the example below, the `greet` function has to call the callback only once: + +```javascript +function greet (name, cb) { + // return is missing from the if statement + // when no name is passed, the callback is called twice + if (!name) cb('Hello anonymous') + cb('Hello ' + name) +} + +function log (msg) { + console.log(msg) +} + +// this will print 'Hello anonymous' but the logical error will be missed +greet(null, once(msg)) + +// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time +greet(null, once.strict(msg)) +``` diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/once/once.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/once/once.js new file mode 100644 index 0000000..2354067 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/once/once.js @@ -0,0 +1,42 @@ +var wrappy = require('wrappy') +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/once/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/once/package.json new file mode 100644 index 0000000..16815b2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/once/package.json @@ -0,0 +1,33 @@ +{ + "name": "once", + "version": "1.4.0", + "description": "Run a function exactly one time", + "main": "once.js", + "directories": { + "test": "test" + }, + "dependencies": { + "wrappy": "1" + }, + "devDependencies": { + "tap": "^7.0.1" + }, + "scripts": { + "test": "tap test/*.js" + }, + "files": [ + "once.js" + ], + "repository": { + "type": "git", + "url": "git://github.com/isaacs/once" + }, + "keywords": [ + "once", + "function", + "one", + "single" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC" +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/parseurl/HISTORY.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/parseurl/HISTORY.md new file mode 100644 index 0000000..8e40954 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/parseurl/HISTORY.md @@ -0,0 +1,58 @@ +1.3.3 / 2019-04-15 +================== + + * Fix Node.js 0.8 return value inconsistencies + +1.3.2 / 2017-09-09 +================== + + * perf: reduce overhead for full URLs + * perf: unroll the "fast-path" `RegExp` + +1.3.1 / 2016-01-17 +================== + + * perf: enable strict mode + +1.3.0 / 2014-08-09 +================== + + * Add `parseurl.original` for parsing `req.originalUrl` with fallback + * Return `undefined` if `req.url` is `undefined` + +1.2.0 / 2014-07-21 +================== + + * Cache URLs based on original value + * Remove no-longer-needed URL mis-parse work-around + * Simplify the "fast-path" `RegExp` + +1.1.3 / 2014-07-08 +================== + + * Fix typo + +1.1.2 / 2014-07-08 +================== + + * Seriously fix Node.js 0.8 compatibility + +1.1.1 / 2014-07-08 +================== + + * Fix Node.js 0.8 compatibility + +1.1.0 / 2014-07-08 +================== + + * Incorporate URL href-only parse fast-path + +1.0.1 / 2014-03-08 +================== + + * Add missing `require` + +1.0.0 / 2014-03-08 +================== + + * Genesis from `connect` diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/parseurl/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/parseurl/LICENSE new file mode 100644 index 0000000..27653d3 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/parseurl/LICENSE @@ -0,0 +1,24 @@ + +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/parseurl/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/parseurl/README.md new file mode 100644 index 0000000..443e716 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/parseurl/README.md @@ -0,0 +1,133 @@ +# parseurl + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Parse a URL with memoization. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install parseurl +``` + +## API + +```js +var parseurl = require('parseurl') +``` + +### parseurl(req) + +Parse the URL of the given request object (looks at the `req.url` property) +and return the result. The result is the same as `url.parse` in Node.js core. +Calling this function multiple times on the same `req` where `req.url` does +not change will return a cached parsed object, rather than parsing again. + +### parseurl.original(req) + +Parse the original URL of the given request object and return the result. +This works by trying to parse `req.originalUrl` if it is a string, otherwise +parses `req.url`. The result is the same as `url.parse` in Node.js core. +Calling this function multiple times on the same `req` where `req.originalUrl` +does not change will return a cached parsed object, rather than parsing again. + +## Benchmark + +```bash +$ npm run-script bench + +> parseurl@1.3.3 bench nodejs-parseurl +> node benchmark/index.js + + http_parser@2.8.0 + node@10.6.0 + v8@6.7.288.46-node.13 + uv@1.21.0 + zlib@1.2.11 + ares@1.14.0 + modules@64 + nghttp2@1.32.0 + napi@3 + openssl@1.1.0h + icu@61.1 + unicode@10.0 + cldr@33.0 + tz@2018c + +> node benchmark/fullurl.js + + Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy" + + 4 tests completed. + + fasturl x 2,207,842 ops/sec ±3.76% (184 runs sampled) + nativeurl - legacy x 507,180 ops/sec ±0.82% (191 runs sampled) + nativeurl - whatwg x 290,044 ops/sec ±1.96% (189 runs sampled) + parseurl x 488,907 ops/sec ±2.13% (192 runs sampled) + +> node benchmark/pathquery.js + + Parsing URL "/foo/bar?user=tj&pet=fluffy" + + 4 tests completed. + + fasturl x 3,812,564 ops/sec ±3.15% (188 runs sampled) + nativeurl - legacy x 2,651,631 ops/sec ±1.68% (189 runs sampled) + nativeurl - whatwg x 161,837 ops/sec ±2.26% (189 runs sampled) + parseurl x 4,166,338 ops/sec ±2.23% (184 runs sampled) + +> node benchmark/samerequest.js + + Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object + + 4 tests completed. + + fasturl x 3,821,651 ops/sec ±2.42% (185 runs sampled) + nativeurl - legacy x 2,651,162 ops/sec ±1.90% (187 runs sampled) + nativeurl - whatwg x 175,166 ops/sec ±1.44% (188 runs sampled) + parseurl x 14,912,606 ops/sec ±3.59% (183 runs sampled) + +> node benchmark/simplepath.js + + Parsing URL "/foo/bar" + + 4 tests completed. + + fasturl x 12,421,765 ops/sec ±2.04% (191 runs sampled) + nativeurl - legacy x 7,546,036 ops/sec ±1.41% (188 runs sampled) + nativeurl - whatwg x 198,843 ops/sec ±1.83% (189 runs sampled) + parseurl x 24,244,006 ops/sec ±0.51% (194 runs sampled) + +> node benchmark/slash.js + + Parsing URL "/" + + 4 tests completed. + + fasturl x 17,159,456 ops/sec ±3.25% (188 runs sampled) + nativeurl - legacy x 11,635,097 ops/sec ±3.79% (184 runs sampled) + nativeurl - whatwg x 240,693 ops/sec ±0.83% (189 runs sampled) + parseurl x 42,279,067 ops/sec ±0.55% (190 runs sampled) +``` + +## License + + [MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/parseurl/master +[coveralls-url]: https://coveralls.io/r/pillarjs/parseurl?branch=master +[node-image]: https://badgen.net/npm/node/parseurl +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/parseurl +[npm-url]: https://npmjs.org/package/parseurl +[npm-version-image]: https://badgen.net/npm/v/parseurl +[travis-image]: https://badgen.net/travis/pillarjs/parseurl/master +[travis-url]: https://travis-ci.org/pillarjs/parseurl diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/parseurl/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/parseurl/index.js new file mode 100644 index 0000000..ece7223 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/parseurl/index.js @@ -0,0 +1,158 @@ +/*! + * parseurl + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var url = require('url') +var parse = url.parse +var Url = url.Url + +/** + * Module exports. + * @public + */ + +module.exports = parseurl +module.exports.original = originalurl + +/** + * Parse the `req` url with memoization. + * + * @param {ServerRequest} req + * @return {Object} + * @public + */ + +function parseurl (req) { + var url = req.url + + if (url === undefined) { + // URL is undefined + return undefined + } + + var parsed = req._parsedUrl + + if (fresh(url, parsed)) { + // Return cached URL parse + return parsed + } + + // Parse the URL + parsed = fastparse(url) + parsed._raw = url + + return (req._parsedUrl = parsed) +}; + +/** + * Parse the `req` original url with fallback and memoization. + * + * @param {ServerRequest} req + * @return {Object} + * @public + */ + +function originalurl (req) { + var url = req.originalUrl + + if (typeof url !== 'string') { + // Fallback + return parseurl(req) + } + + var parsed = req._parsedOriginalUrl + + if (fresh(url, parsed)) { + // Return cached URL parse + return parsed + } + + // Parse the URL + parsed = fastparse(url) + parsed._raw = url + + return (req._parsedOriginalUrl = parsed) +}; + +/** + * Parse the `str` url with fast-path short-cut. + * + * @param {string} str + * @return {Object} + * @private + */ + +function fastparse (str) { + if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) { + return parse(str) + } + + var pathname = str + var query = null + var search = null + + // This takes the regexp from https://github.com/joyent/node/pull/7878 + // Which is /^(\/[^?#\s]*)(\?[^#\s]*)?$/ + // And unrolls it into a for loop + for (var i = 1; i < str.length; i++) { + switch (str.charCodeAt(i)) { + case 0x3f: /* ? */ + if (search === null) { + pathname = str.substring(0, i) + query = str.substring(i + 1) + search = str.substring(i) + } + break + case 0x09: /* \t */ + case 0x0a: /* \n */ + case 0x0c: /* \f */ + case 0x0d: /* \r */ + case 0x20: /* */ + case 0x23: /* # */ + case 0xa0: + case 0xfeff: + return parse(str) + } + } + + var url = Url !== undefined + ? new Url() + : {} + + url.path = str + url.href = str + url.pathname = pathname + + if (search !== null) { + url.query = query + url.search = search + } + + return url +} + +/** + * Determine if parsed is still fresh for url. + * + * @param {string} url + * @param {object} parsedUrl + * @return {boolean} + * @private + */ + +function fresh (url, parsedUrl) { + return typeof parsedUrl === 'object' && + parsedUrl !== null && + (Url === undefined || parsedUrl instanceof Url) && + parsedUrl._raw === url +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/parseurl/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/parseurl/package.json new file mode 100644 index 0000000..6b443ca --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/parseurl/package.json @@ -0,0 +1,40 @@ +{ + "name": "parseurl", + "description": "parse a url with memoization", + "version": "1.3.3", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "repository": "pillarjs/parseurl", + "license": "MIT", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "5.16.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.17.1", + "eslint-plugin-node": "7.0.1", + "eslint-plugin-promise": "4.1.1", + "eslint-plugin-standard": "4.0.0", + "fast-url-parser": "1.1.3", + "istanbul": "0.4.5", + "mocha": "6.1.3" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint .", + "test": "mocha --check-leaks --bail --reporter spec test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/LICENSE new file mode 100644 index 0000000..983fbe8 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/Readme.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/Readme.md new file mode 100644 index 0000000..f33e392 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/Readme.md @@ -0,0 +1,224 @@ +# Path-to-RegExp + +> Turn a path string such as `/user/:name` into a regular expression. + +[![NPM version][npm-image]][npm-url] +[![NPM downloads][downloads-image]][downloads-url] +[![Build status][build-image]][build-url] +[![Build coverage][coverage-image]][coverage-url] +[![License][license-image]][license-url] + +## Installation + +``` +npm install path-to-regexp --save +``` + +## Usage + +```js +const { + match, + pathToRegexp, + compile, + parse, + stringify, +} = require("path-to-regexp"); +``` + +### Parameters + +Parameters match arbitrary strings in a path by matching up to the end of the segment, or up to any proceeding tokens. They are defined by prefixing a colon to the parameter name (`:foo`). Parameter names can use any valid JavaScript identifier, or be double quoted to use other characters (`:"param-name"`). + +```js +const fn = match("/:foo/:bar"); + +fn("/test/route"); +//=> { path: '/test/route', params: { foo: 'test', bar: 'route' } } +``` + +### Wildcard + +Wildcard parameters match one or more characters across multiple segments. They are defined the same way as regular parameters, but are prefixed with an asterisk (`*foo`). + +```js +const fn = match("/*splat"); + +fn("/bar/baz"); +//=> { path: '/bar/baz', params: { splat: [ 'bar', 'baz' ] } } +``` + +### Optional + +Braces can be used to define parts of the path that are optional. + +```js +const fn = match("/users{/:id}/delete"); + +fn("/users/delete"); +//=> { path: '/users/delete', params: {} } + +fn("/users/123/delete"); +//=> { path: '/users/123/delete', params: { id: '123' } } +``` + +## Match + +The `match` function returns a function for matching strings against a path: + +- **path** String, `TokenData` object, or array of strings and `TokenData` objects. +- **options** _(optional)_ (Extends [pathToRegexp](#pathToRegexp) options) + - **decode** Function for decoding strings to params, or `false` to disable all processing. (default: `decodeURIComponent`) + +```js +const fn = match("/foo/:bar"); +``` + +**Please note:** `path-to-regexp` is intended for ordered data (e.g. paths, hosts). It can not handle arbitrarily ordered data (e.g. query strings, URL fragments, JSON, etc). + +## PathToRegexp + +The `pathToRegexp` function returns the `regexp` for matching strings against paths, and an array of `keys` for understanding the `RegExp#exec` matches. + +- **path** String, `TokenData` object, or array of strings and `TokenData` objects. +- **options** _(optional)_ (See [parse](#parse) for more options) + - **sensitive** Regexp will be case sensitive. (default: `false`) + - **end** Validate the match reaches the end of the string. (default: `true`) + - **delimiter** The default delimiter for segments, e.g. `[^/]` for `:named` parameters. (default: `'/'`) + - **trailing** Allows optional trailing delimiter to match. (default: `true`) + +```js +const { regexp, keys } = pathToRegexp("/foo/:bar"); + +regexp.exec("/foo/123"); //=> ["/foo/123", "123"] +``` + +## Compile ("Reverse" Path-To-RegExp) + +The `compile` function will return a function for transforming parameters into a valid path: + +- **path** A string or `TokenData` object. +- **options** (See [parse](#parse) for more options) + - **delimiter** The default delimiter for segments, e.g. `[^/]` for `:named` parameters. (default: `'/'`) + - **encode** Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`) + +```js +const toPath = compile("/user/:id"); + +toPath({ id: "name" }); //=> "/user/name" +toPath({ id: "café" }); //=> "/user/caf%C3%A9" + +const toPathRepeated = compile("/*segment"); + +toPathRepeated({ segment: ["foo"] }); //=> "/foo" +toPathRepeated({ segment: ["a", "b", "c"] }); //=> "/a/b/c" + +// When disabling `encode`, you need to make sure inputs are encoded correctly. No arrays are accepted. +const toPathRaw = compile("/user/:id", { encode: false }); + +toPathRaw({ id: "%3A%2F" }); //=> "/user/%3A%2F" +``` + +## Stringify + +Transform a `TokenData` object to a Path-to-RegExp string. + +- **data** A `TokenData` object. + +```js +const data = { + tokens: [ + { type: "text", value: "/" }, + { type: "param", name: "foo" }, + ], +}; + +const path = stringify(data); //=> "/:foo" +``` + +## Developers + +- If you are rewriting paths with match and compile, consider using `encode: false` and `decode: false` to keep raw paths passed around. +- To ensure matches work on paths containing characters usually encoded, such as emoji, consider using [encodeurl](https://github.com/pillarjs/encodeurl) for `encodePath`. + +### Parse + +The `parse` function accepts a string and returns `TokenData`, which can be used with `match` and `compile`. + +- **path** A string. +- **options** _(optional)_ + - **encodePath** A function for encoding input strings. (default: `x => x`, recommended: [`encodeurl`](https://github.com/pillarjs/encodeurl)) + +### Tokens + +`TokenData` has two properties: + +- **tokens** A sequence of tokens, currently of types `text`, `param`, `wildcard`, or `group`. +- **originalPath** The original path used with `parse`, shown in error messages to assist debugging. + +### Custom path + +In some applications you may not be able to use the `path-to-regexp` syntax, but you still want to use this library for `match` and `compile`. For example: + +```js +import { match } from "path-to-regexp"; + +const tokens = [ + { type: "text", value: "/" }, + { type: "param", name: "foo" }, +]; +const originalPath = "/[foo]"; // To help debug error messages. +const path = { tokens, originalPath }; +const fn = match(path); + +fn("/test"); //=> { path: '/test', params: { foo: 'test' } } +``` + +## Errors + +An effort has been made to ensure ambiguous paths from previous releases throw an error. This means you might be seeing an error when things worked before. + +### Missing parameter name + +Parameter names must be provided after `:` or `*`, for example `/*path`. They can be valid JavaScript identifiers (e.g. `:myName`) or JSON strings (`:"my-name"`). + +### Unexpected `?` or `+` + +In past releases, `?`, `*`, and `+` were used to denote optional or repeating parameters. As an alternative, try these: + +- For optional (`?`), use braces: `/file{.:ext}`. +- For one or more (`+`), use a wildcard: `/*path`. +- For zero or more (`*`), use both: `/files{/*path}`. + +### Unexpected `(`, `)`, `[`, `]`, etc. + +Previous versions of Path-to-RegExp used these for RegExp features. This version no longer supports them so they've been reserved to avoid ambiguity. To match these characters literally, escape them with a backslash, e.g. `"\\("`. + +### Unterminated quote + +Parameter names can be wrapped in double quote characters, and this error means you forgot to close the quote character. For example, `:"foo`. + +### Express <= 4.x + +Path-To-RegExp breaks compatibility with Express <= `4.x` in the following ways: + +- The wildcard `*` must have a name and matches the behavior of parameters `:`. +- The optional character `?` is no longer supported, use braces instead: `/:file{.:ext}`. +- Regexp characters are not supported. +- Some characters have been reserved to avoid confusion during upgrade (`()[]?+!`). +- Parameter names now support valid JavaScript identifiers, or quoted like `:"this"`. + +## License + +MIT + +[npm-image]: https://img.shields.io/npm/v/path-to-regexp +[npm-url]: https://npmjs.org/package/path-to-regexp +[downloads-image]: https://img.shields.io/npm/dm/path-to-regexp +[downloads-url]: https://npmjs.org/package/path-to-regexp +[build-image]: https://img.shields.io/github/actions/workflow/status/pillarjs/path-to-regexp/ci.yml?branch=master +[build-url]: https://github.com/pillarjs/path-to-regexp/actions/workflows/ci.yml?query=branch%3Amaster +[coverage-image]: https://img.shields.io/codecov/c/gh/pillarjs/path-to-regexp +[coverage-url]: https://codecov.io/gh/pillarjs/path-to-regexp +[license-image]: http://img.shields.io/npm/l/path-to-regexp.svg?style=flat +[license-url]: LICENSE.md diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/dist/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/dist/index.d.ts new file mode 100644 index 0000000..c173a44 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/dist/index.d.ts @@ -0,0 +1,147 @@ +/** + * Encode a string into another string. + */ +export type Encode = (value: string) => string; +/** + * Decode a string into another string. + */ +export type Decode = (value: string) => string; +export interface ParseOptions { + /** + * A function for encoding input strings. + */ + encodePath?: Encode; +} +export interface PathToRegexpOptions { + /** + * Matches the path completely without trailing characters. (default: `true`) + */ + end?: boolean; + /** + * Allows optional trailing delimiter to match. (default: `true`) + */ + trailing?: boolean; + /** + * Match will be case sensitive. (default: `false`) + */ + sensitive?: boolean; + /** + * The default delimiter for segments. (default: `'/'`) + */ + delimiter?: string; +} +export interface MatchOptions extends PathToRegexpOptions { + /** + * Function for decoding strings for params, or `false` to disable entirely. (default: `decodeURIComponent`) + */ + decode?: Decode | false; +} +export interface CompileOptions { + /** + * Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`) + */ + encode?: Encode | false; + /** + * The default delimiter for segments. (default: `'/'`) + */ + delimiter?: string; +} +/** + * Plain text. + */ +export interface Text { + type: "text"; + value: string; +} +/** + * A parameter designed to match arbitrary text within a segment. + */ +export interface Parameter { + type: "param"; + name: string; +} +/** + * A wildcard parameter designed to match multiple segments. + */ +export interface Wildcard { + type: "wildcard"; + name: string; +} +/** + * A set of possible tokens to expand when matching. + */ +export interface Group { + type: "group"; + tokens: Token[]; +} +/** + * A token that corresponds with a regexp capture. + */ +export type Key = Parameter | Wildcard; +/** + * A sequence of `path-to-regexp` keys that match capturing groups. + */ +export type Keys = Array; +/** + * A sequence of path match characters. + */ +export type Token = Text | Parameter | Wildcard | Group; +/** + * Tokenized path instance. + */ +export declare class TokenData { + readonly tokens: Token[]; + readonly originalPath?: string | undefined; + constructor(tokens: Token[], originalPath?: string | undefined); +} +/** + * ParseError is thrown when there is an error processing the path. + */ +export declare class PathError extends TypeError { + readonly originalPath: string | undefined; + constructor(message: string, originalPath: string | undefined); +} +/** + * Parse a string for the raw tokens. + */ +export declare function parse(str: string, options?: ParseOptions): TokenData; +/** + * Compile a string to a template function for the path. + */ +export declare function compile

(path: Path, options?: CompileOptions & ParseOptions): (params?: P) => string; +export type ParamData = Partial>; +export type PathFunction

= (data?: P) => string; +/** + * A match result contains data about the path match. + */ +export interface MatchResult

{ + path: string; + params: P; +} +/** + * A match is either `false` (no match) or a match result. + */ +export type Match

= false | MatchResult

; +/** + * The match function takes a string and returns whether it matched the path. + */ +export type MatchFunction

= (path: string) => Match

; +/** + * Supported path types. + */ +export type Path = string | TokenData; +/** + * Transform a path into a match function. + */ +export declare function match

(path: Path | Path[], options?: MatchOptions & ParseOptions): MatchFunction

; +/** + * Transform a path into a regular expression and capture keys. + */ +export declare function pathToRegexp(path: Path | Path[], options?: PathToRegexpOptions & ParseOptions): { + regexp: RegExp; + keys: Keys; +}; +/** + * Stringify token data into a path string. + */ +export declare function stringify(data: TokenData): string; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/dist/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/dist/index.js new file mode 100644 index 0000000..97f36e8 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/dist/index.js @@ -0,0 +1,431 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PathError = exports.TokenData = void 0; +exports.parse = parse; +exports.compile = compile; +exports.match = match; +exports.pathToRegexp = pathToRegexp; +exports.stringify = stringify; +const DEFAULT_DELIMITER = "/"; +const NOOP_VALUE = (value) => value; +const ID_START = /^[$_\p{ID_Start}]$/u; +const ID_CONTINUE = /^[$\u200c\u200d\p{ID_Continue}]$/u; +const ID = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u; +/** + * Escape text for stringify to path. + */ +function escapeText(str) { + return str.replace(/[{}()\[\]+?!:*\\]/g, "\\$&"); +} +/** + * Escape a regular expression string. + */ +function escape(str) { + return str.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&"); +} +/** + * Tokenized path instance. + */ +class TokenData { + constructor(tokens, originalPath) { + this.tokens = tokens; + this.originalPath = originalPath; + } +} +exports.TokenData = TokenData; +/** + * ParseError is thrown when there is an error processing the path. + */ +class PathError extends TypeError { + constructor(message, originalPath) { + let text = message; + if (originalPath) + text += `: ${originalPath}`; + text += `; visit https://git.new/pathToRegexpError for info`; + super(text); + this.originalPath = originalPath; + } +} +exports.PathError = PathError; +/** + * Parse a string for the raw tokens. + */ +function parse(str, options = {}) { + const { encodePath = NOOP_VALUE } = options; + const chars = [...str]; + let index = 0; + function consumeUntil(end) { + const output = []; + let path = ""; + function writePath() { + if (!path) + return; + output.push({ + type: "text", + value: encodePath(path), + }); + path = ""; + } + while (index < chars.length) { + const value = chars[index++]; + if (value === end) { + writePath(); + return output; + } + if (value === "\\") { + if (index === chars.length) { + throw new PathError(`Unexpected end after \\ at index ${index}`, str); + } + path += chars[index++]; + continue; + } + if (value === ":" || value === "*") { + const type = value === ":" ? "param" : "wildcard"; + let name = ""; + if (ID_START.test(chars[index])) { + do { + name += chars[index++]; + } while (ID_CONTINUE.test(chars[index])); + } + else if (chars[index] === '"') { + let quoteStart = index; + while (index < chars.length) { + if (chars[++index] === '"') { + index++; + quoteStart = 0; + break; + } + // Increment over escape characters. + if (chars[index] === "\\") + index++; + name += chars[index]; + } + if (quoteStart) { + throw new PathError(`Unterminated quote at index ${quoteStart}`, str); + } + } + if (!name) { + throw new PathError(`Missing parameter name at index ${index}`, str); + } + writePath(); + output.push({ type, name }); + continue; + } + if (value === "{") { + writePath(); + output.push({ + type: "group", + tokens: consumeUntil("}"), + }); + continue; + } + if (value === "}" || + value === "(" || + value === ")" || + value === "[" || + value === "]" || + value === "+" || + value === "?" || + value === "!") { + throw new PathError(`Unexpected ${value} at index ${index - 1}`, str); + } + path += value; + } + if (end) { + throw new PathError(`Unexpected end at index ${index}, expected ${end}`, str); + } + writePath(); + return output; + } + return new TokenData(consumeUntil(""), str); +} +/** + * Compile a string to a template function for the path. + */ +function compile(path, options = {}) { + const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options; + const data = typeof path === "object" ? path : parse(path, options); + const fn = tokensToFunction(data.tokens, delimiter, encode); + return function path(params = {}) { + const missing = []; + const path = fn(params, missing); + if (missing.length) { + throw new TypeError(`Missing parameters: ${missing.join(", ")}`); + } + return path; + }; +} +function tokensToFunction(tokens, delimiter, encode) { + const encoders = tokens.map((token) => tokenToFunction(token, delimiter, encode)); + return (data, missing) => { + let result = ""; + for (const encoder of encoders) { + result += encoder(data, missing); + } + return result; + }; +} +/** + * Convert a single token into a path building function. + */ +function tokenToFunction(token, delimiter, encode) { + if (token.type === "text") + return () => token.value; + if (token.type === "group") { + const fn = tokensToFunction(token.tokens, delimiter, encode); + return (data, missing) => { + const len = missing.length; + const value = fn(data, missing); + if (missing.length === len) + return value; + missing.length = len; // Reset optional group. + return ""; + }; + } + const encodeValue = encode || NOOP_VALUE; + if (token.type === "wildcard" && encode !== false) { + return (data, missing) => { + const value = data[token.name]; + if (value == null) { + missing.push(token.name); + return ""; + } + if (!Array.isArray(value) || value.length === 0) { + throw new TypeError(`Expected "${token.name}" to be a non-empty array`); + } + let result = ""; + for (let i = 0; i < value.length; i++) { + if (typeof value[i] !== "string") { + throw new TypeError(`Expected "${token.name}/${i}" to be a string`); + } + if (i > 0) + result += delimiter; + result += encodeValue(value[i]); + } + return result; + }; + } + return (data, missing) => { + const value = data[token.name]; + if (value == null) { + missing.push(token.name); + return ""; + } + if (typeof value !== "string") { + throw new TypeError(`Expected "${token.name}" to be a string`); + } + return encodeValue(value); + }; +} +/** + * Transform a path into a match function. + */ +function match(path, options = {}) { + const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options; + const { regexp, keys } = pathToRegexp(path, options); + const decoders = keys.map((key) => { + if (decode === false) + return NOOP_VALUE; + if (key.type === "param") + return decode; + return (value) => value.split(delimiter).map(decode); + }); + return function match(input) { + const m = regexp.exec(input); + if (!m) + return false; + const path = m[0]; + const params = Object.create(null); + for (let i = 1; i < m.length; i++) { + if (m[i] === undefined) + continue; + const key = keys[i - 1]; + const decoder = decoders[i - 1]; + params[key.name] = decoder(m[i]); + } + return { path, params }; + }; +} +/** + * Transform a path into a regular expression and capture keys. + */ +function pathToRegexp(path, options = {}) { + const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true, } = options; + const keys = []; + let source = ""; + let combinations = 0; + function process(path) { + if (Array.isArray(path)) { + for (const p of path) + process(p); + return; + } + const data = typeof path === "object" ? path : parse(path, options); + flatten(data.tokens, 0, [], (tokens) => { + if (combinations >= 256) { + throw new PathError("Too many path combinations", data.originalPath); + } + if (combinations > 0) + source += "|"; + source += toRegExpSource(tokens, delimiter, keys, data.originalPath); + combinations++; + }); + } + process(path); + let pattern = `^(?:${source})`; + if (trailing) + pattern += "(?:" + escape(delimiter) + "$)?"; + pattern += end ? "$" : "(?=" + escape(delimiter) + "|$)"; + return { regexp: new RegExp(pattern, sensitive ? "" : "i"), keys }; +} +/** + * Generate a flat list of sequence tokens from the given tokens. + */ +function flatten(tokens, index, result, callback) { + while (index < tokens.length) { + const token = tokens[index++]; + if (token.type === "group") { + const len = result.length; + flatten(token.tokens, 0, result, (seq) => flatten(tokens, index, seq, callback)); + result.length = len; + continue; + } + result.push(token); + } + callback(result); +} +/** + * Transform a flat sequence of tokens into a regular expression. + */ +function toRegExpSource(tokens, delimiter, keys, originalPath) { + let result = ""; + let backtrack = ""; + let wildcardBacktrack = ""; + let prevCaptureType = 0; + let hasSegmentCapture = 0; + let index = 0; + function hasInSegment(index, type) { + while (index < tokens.length) { + const token = tokens[index++]; + if (token.type === type) + return true; + if (token.type === "text") { + if (token.value.includes(delimiter)) + break; + } + } + return false; + } + function peekText(index) { + let result = ""; + while (index < tokens.length) { + const token = tokens[index++]; + if (token.type !== "text") + break; + result += token.value; + } + return result; + } + while (index < tokens.length) { + const token = tokens[index++]; + if (token.type === "text") { + result += escape(token.value); + backtrack += token.value; + if (prevCaptureType === 2) + wildcardBacktrack += token.value; + if (token.value.includes(delimiter)) + hasSegmentCapture = 0; + continue; + } + if (token.type === "param" || token.type === "wildcard") { + if (prevCaptureType && !backtrack) { + throw new PathError(`Missing text before "${token.name}" ${token.type}`, originalPath); + } + if (token.type === "param") { + result += + hasSegmentCapture & 2 // Seen wildcard in segment. + ? `(${negate(delimiter, backtrack)}+)` + : hasInSegment(index, "wildcard") // See wildcard later in segment. + ? `(${negate(delimiter, peekText(index))}+)` + : hasSegmentCapture & 1 // Seen parameter in segment. + ? `(${negate(delimiter, backtrack)}+|${escape(backtrack)})` + : `(${negate(delimiter, "")}+)`; + hasSegmentCapture |= prevCaptureType = 1; + } + else { + result += + hasSegmentCapture & 2 // Seen wildcard in segment. + ? `(${negate(backtrack, "")}+)` + : wildcardBacktrack // No capture in segment, seen wildcard in path. + ? `(${negate(wildcardBacktrack, "")}+|${negate(delimiter, "")}+)` + : `([^]+)`; + wildcardBacktrack = ""; + hasSegmentCapture |= prevCaptureType = 2; + } + keys.push(token); + backtrack = ""; + continue; + } + throw new TypeError(`Unknown token type: ${token.type}`); + } + return result; +} +/** + * Block backtracking on previous text/delimiter. + */ +function negate(a, b) { + if (b.length > a.length) + return negate(b, a); // Longest string first. + if (a === b) + b = ""; // Cleaner regex strings, no duplication. + if (b.length > 1) + return `(?:(?!${escape(a)}|${escape(b)})[^])`; + if (a.length > 1) + return `(?:(?!${escape(a)})[^${escape(b)}])`; + return `[^${escape(a + b)}]`; +} +/** + * Stringify an array of tokens into a path string. + */ +function stringifyTokens(tokens, index) { + let value = ""; + while (index < tokens.length) { + const token = tokens[index++]; + if (token.type === "text") { + value += escapeText(token.value); + continue; + } + if (token.type === "group") { + value += "{" + stringifyTokens(token.tokens, 0) + "}"; + continue; + } + if (token.type === "param") { + value += ":" + stringifyName(token.name, tokens[index]); + continue; + } + if (token.type === "wildcard") { + value += "*" + stringifyName(token.name, tokens[index]); + continue; + } + throw new TypeError(`Unknown token type: ${token.type}`); + } + return value; +} +/** + * Stringify token data into a path string. + */ +function stringify(data) { + return stringifyTokens(data.tokens, 0); +} +/** + * Stringify a parameter name, escaping when it cannot be emitted directly. + */ +function stringifyName(name, next) { + if (!ID.test(name)) + return JSON.stringify(name); + if ((next === null || next === void 0 ? void 0 : next.type) === "text" && ID_CONTINUE.test(next.value[0])) { + return JSON.stringify(name); + } + return name; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/dist/index.js.map b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/dist/index.js.map new file mode 100644 index 0000000..0c65186 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAqJA,sBAiHC;AAKD,0BAmBC;AA2HD,sBA+BC;AAKD,oCAuCC;AAyKD,8BAEC;AA/oBD,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC;AAC5C,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AACvC,MAAM,WAAW,GAAG,mCAAmC,CAAC;AACxD,MAAM,EAAE,GAAG,oDAAoD,CAAC;AAwDhE;;GAEG;AACH,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,GAAG,CAAC,OAAO,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,SAAS,MAAM,CAAC,GAAW;IACzB,OAAO,GAAG,CAAC,OAAO,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC;AAiDD;;GAEG;AACH,MAAa,SAAS;IACpB,YACkB,MAAe,EACf,YAAqB;QADrB,WAAM,GAAN,MAAM,CAAS;QACf,iBAAY,GAAZ,YAAY,CAAS;IACpC,CAAC;CACL;AALD,8BAKC;AAED;;GAEG;AACH,MAAa,SAAU,SAAQ,SAAS;IACtC,YACE,OAAe,EACC,YAAgC;QAEhD,IAAI,IAAI,GAAG,OAAO,CAAC;QACnB,IAAI,YAAY;YAAE,IAAI,IAAI,KAAK,YAAY,EAAE,CAAC;QAC9C,IAAI,IAAI,oDAAoD,CAAC;QAC7D,KAAK,CAAC,IAAI,CAAC,CAAC;QALI,iBAAY,GAAZ,YAAY,CAAoB;IAMlD,CAAC;CACF;AAVD,8BAUC;AAED;;GAEG;AACH,SAAgB,KAAK,CAAC,GAAW,EAAE,UAAwB,EAAE;IAC3D,MAAM,EAAE,UAAU,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC;IAC5C,MAAM,KAAK,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;IACvB,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,SAAS,YAAY,CAAC,GAAW;QAC/B,MAAM,MAAM,GAAY,EAAE,CAAC;QAC3B,IAAI,IAAI,GAAG,EAAE,CAAC;QAEd,SAAS,SAAS;YAChB,IAAI,CAAC,IAAI;gBAAE,OAAO;YAClB,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC;aACxB,CAAC,CAAC;YACH,IAAI,GAAG,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;YAE7B,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;gBAClB,SAAS,EAAE,CAAC;gBACZ,OAAO,MAAM,CAAC;YAChB,CAAC;YAED,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBACnB,IAAI,KAAK,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;oBAC3B,MAAM,IAAI,SAAS,CAAC,oCAAoC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAC;gBACxE,CAAC;gBAED,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;gBACvB,SAAS;YACX,CAAC;YAED,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;gBACnC,MAAM,IAAI,GAAG,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;gBAClD,IAAI,IAAI,GAAG,EAAE,CAAC;gBAEd,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;oBAChC,GAAG,CAAC;wBACF,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;oBACzB,CAAC,QAAQ,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE;gBAC3C,CAAC;qBAAM,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC;oBAChC,IAAI,UAAU,GAAG,KAAK,CAAC;oBAEvB,OAAO,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;wBAC5B,IAAI,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC;4BAC3B,KAAK,EAAE,CAAC;4BACR,UAAU,GAAG,CAAC,CAAC;4BACf,MAAM;wBACR,CAAC;wBAED,oCAAoC;wBACpC,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI;4BAAE,KAAK,EAAE,CAAC;wBAEnC,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;oBACvB,CAAC;oBAED,IAAI,UAAU,EAAE,CAAC;wBACf,MAAM,IAAI,SAAS,CACjB,+BAA+B,UAAU,EAAE,EAC3C,GAAG,CACJ,CAAC;oBACJ,CAAC;gBACH,CAAC;gBAED,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,MAAM,IAAI,SAAS,CAAC,mCAAmC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAC;gBACvE,CAAC;gBAED,SAAS,EAAE,CAAC;gBACZ,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC5B,SAAS;YACX,CAAC;YAED,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;gBAClB,SAAS,EAAE,CAAC;gBACZ,MAAM,CAAC,IAAI,CAAC;oBACV,IAAI,EAAE,OAAO;oBACb,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC;iBAC1B,CAAC,CAAC;gBACH,SAAS;YACX,CAAC;YAED,IACE,KAAK,KAAK,GAAG;gBACb,KAAK,KAAK,GAAG;gBACb,KAAK,KAAK,GAAG;gBACb,KAAK,KAAK,GAAG;gBACb,KAAK,KAAK,GAAG;gBACb,KAAK,KAAK,GAAG;gBACb,KAAK,KAAK,GAAG;gBACb,KAAK,KAAK,GAAG,EACb,CAAC;gBACD,MAAM,IAAI,SAAS,CAAC,cAAc,KAAK,aAAa,KAAK,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YACxE,CAAC;YAED,IAAI,IAAI,KAAK,CAAC;QAChB,CAAC;QAED,IAAI,GAAG,EAAE,CAAC;YACR,MAAM,IAAI,SAAS,CACjB,2BAA2B,KAAK,cAAc,GAAG,EAAE,EACnD,GAAG,CACJ,CAAC;QACJ,CAAC;QAED,SAAS,EAAE,CAAC;QACZ,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,IAAI,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED;;GAEG;AACH,SAAgB,OAAO,CACrB,IAAU,EACV,UAAyC,EAAE;IAE3C,MAAM,EAAE,MAAM,GAAG,kBAAkB,EAAE,SAAS,GAAG,iBAAiB,EAAE,GAClE,OAAO,CAAC;IACV,MAAM,IAAI,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpE,MAAM,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAE5D,OAAO,SAAS,IAAI,CAAC,SAAY,EAAO;QACtC,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAEjC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACnB,MAAM,IAAI,SAAS,CAAC,uBAAuB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnE,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAUD,SAAS,gBAAgB,CACvB,MAAe,EACf,SAAiB,EACjB,MAAsB;IAEtB,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACpC,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAC1C,CAAC;IAEF,OAAO,CAAC,IAAe,EAAE,OAAiB,EAAE,EAAE;QAC5C,IAAI,MAAM,GAAG,EAAE,CAAC;QAEhB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,IAAI,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACnC,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CACtB,KAAY,EACZ,SAAiB,EACjB,MAAsB;IAEtB,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;IAEpD,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC3B,MAAM,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAE7D,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;YACvB,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;YAC3B,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAChC,IAAI,OAAO,CAAC,MAAM,KAAK,GAAG;gBAAE,OAAO,KAAK,CAAC;YAEzC,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,wBAAwB;YAC9C,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,IAAI,UAAU,CAAC;IAEzC,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QAClD,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;YACvB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC/B,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;gBAClB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACzB,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAChD,MAAM,IAAI,SAAS,CAAC,aAAa,KAAK,CAAC,IAAI,2BAA2B,CAAC,CAAC;YAC1E,CAAC;YAED,IAAI,MAAM,GAAG,EAAE,CAAC;YAEhB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACtC,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;oBACjC,MAAM,IAAI,SAAS,CAAC,aAAa,KAAK,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC;gBACtE,CAAC;gBAED,IAAI,CAAC,GAAG,CAAC;oBAAE,MAAM,IAAI,SAAS,CAAC;gBAC/B,MAAM,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAClC,CAAC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACzB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,SAAS,CAAC,aAAa,KAAK,CAAC,IAAI,kBAAkB,CAAC,CAAC;QACjE,CAAC;QAED,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC;AAyBD;;GAEG;AACH,SAAgB,KAAK,CACnB,IAAmB,EACnB,UAAuC,EAAE;IAEzC,MAAM,EAAE,MAAM,GAAG,kBAAkB,EAAE,SAAS,GAAG,iBAAiB,EAAE,GAClE,OAAO,CAAC;IACV,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAErD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAChC,IAAI,MAAM,KAAK,KAAK;YAAE,OAAO,UAAU,CAAC;QACxC,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO;YAAE,OAAO,MAAM,CAAC;QACxC,OAAO,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,KAAK,CAAC,KAAa;QACjC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;QAErB,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAClB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS;gBAAE,SAAS;YAEjC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACxB,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAChC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,CAAC;QAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC1B,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,YAAY,CAC1B,IAAmB,EACnB,UAA8C,EAAE;IAEhD,MAAM,EACJ,SAAS,GAAG,iBAAiB,EAC7B,GAAG,GAAG,IAAI,EACV,SAAS,GAAG,KAAK,EACjB,QAAQ,GAAG,IAAI,GAChB,GAAG,OAAO,CAAC;IACZ,MAAM,IAAI,GAAS,EAAE,CAAC;IACtB,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,YAAY,GAAG,CAAC,CAAC;IAErB,SAAS,OAAO,CAAC,IAAmB;QAClC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,KAAK,MAAM,CAAC,IAAI,IAAI;gBAAE,OAAO,CAAC,CAAC,CAAC,CAAC;YACjC,OAAO;QACT,CAAC;QAED,MAAM,IAAI,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE;YACrC,IAAI,YAAY,IAAI,GAAG,EAAE,CAAC;gBACxB,MAAM,IAAI,SAAS,CAAC,4BAA4B,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;YACvE,CAAC;YAED,IAAI,YAAY,GAAG,CAAC;gBAAE,MAAM,IAAI,GAAG,CAAC;YACpC,MAAM,IAAI,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;YACrE,YAAY,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,CAAC;IAEd,IAAI,OAAO,GAAG,OAAO,MAAM,GAAG,CAAC;IAC/B,IAAI,QAAQ;QAAE,OAAO,IAAI,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;IAC3D,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;IAEzD,OAAO,EAAE,MAAM,EAAE,IAAI,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;AACrE,CAAC;AAED;;GAEG;AACH,SAAS,OAAO,CACd,MAAe,EACf,KAAa,EACb,MAA+B,EAC/B,QAAmD;IAEnD,OAAO,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAE9B,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC3B,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC;YAC1B,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CACvC,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,CACtC,CAAC;YACF,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC;YACpB,SAAS;QACX,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IAED,QAAQ,CAAC,MAAM,CAAC,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CACrB,MAA+B,EAC/B,SAAiB,EACjB,IAAU,EACV,YAAgC;IAEhC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,iBAAiB,GAAG,EAAE,CAAC;IAC3B,IAAI,eAAe,GAAc,CAAC,CAAC;IACnC,IAAI,iBAAiB,GAAG,CAAC,CAAC;IAC1B,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,SAAS,YAAY,CAAC,KAAa,EAAE,IAAmB;QACtD,OAAO,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;YAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YAC9B,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI;gBAAE,OAAO,IAAI,CAAC;YACrC,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBAC1B,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC;oBAAE,MAAM;YAC7C,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,SAAS,QAAQ,CAAC,KAAa;QAC7B,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,OAAO,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;YAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YAC9B,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;gBAAE,MAAM;YACjC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC;QACxB,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAE9B,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC1B,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC9B,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC;YACzB,IAAI,eAAe,KAAK,CAAC;gBAAE,iBAAiB,IAAI,KAAK,CAAC,KAAK,CAAC;YAC5D,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC;gBAAE,iBAAiB,GAAG,CAAC,CAAC;YAC3D,SAAS;QACX,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACxD,IAAI,eAAe,IAAI,CAAC,SAAS,EAAE,CAAC;gBAClC,MAAM,IAAI,SAAS,CACjB,wBAAwB,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,EAAE,EACnD,YAAY,CACb,CAAC;YACJ,CAAC;YAED,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBAC3B,MAAM;oBACJ,iBAAiB,GAAG,CAAC,CAAC,4BAA4B;wBAChD,CAAC,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI;wBACtC,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,iCAAiC;4BACjE,CAAC,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI;4BAC5C,CAAC,CAAC,iBAAiB,GAAG,CAAC,CAAC,6BAA6B;gCACnD,CAAC,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,KAAK,MAAM,CAAC,SAAS,CAAC,GAAG;gCAC3D,CAAC,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC;gBAExC,iBAAiB,IAAI,eAAe,GAAG,CAAC,CAAC;YAC3C,CAAC;iBAAM,CAAC;gBACN,MAAM;oBACJ,iBAAiB,GAAG,CAAC,CAAC,4BAA4B;wBAChD,CAAC,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI;wBAC/B,CAAC,CAAC,iBAAiB,CAAC,gDAAgD;4BAClE,CAAC,CAAC,IAAI,MAAM,CAAC,iBAAiB,EAAE,EAAE,CAAC,KAAK,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI;4BACjE,CAAC,CAAC,QAAQ,CAAC;gBAEjB,iBAAiB,GAAG,EAAE,CAAC;gBACvB,iBAAiB,IAAI,eAAe,GAAG,CAAC,CAAC;YAC3C,CAAC;YAED,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACjB,SAAS,GAAG,EAAE,CAAC;YACf,SAAS;QACX,CAAC;QAED,MAAM,IAAI,SAAS,CAAC,uBAAwB,KAAa,CAAC,IAAI,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,SAAS,MAAM,CAAC,CAAS,EAAE,CAAS;IAClC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM;QAAE,OAAO,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,wBAAwB;IAEtE,IAAI,CAAC,KAAK,CAAC;QAAE,CAAC,GAAG,EAAE,CAAC,CAAC,yCAAyC;IAC9D,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,SAAS,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IAChE,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,SAAS,MAAM,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/D,OAAO,KAAK,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,MAAe,EAAE,KAAa;IACrD,IAAI,KAAK,GAAG,EAAE,CAAC;IAEf,OAAO,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAE9B,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC1B,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACjC,SAAS;QACX,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC3B,KAAK,IAAI,GAAG,GAAG,eAAe,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;YACtD,SAAS;QACX,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC3B,KAAK,IAAI,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACxD,SAAS;QACX,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAC9B,KAAK,IAAI,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACxD,SAAS;QACX,CAAC;QAED,MAAM,IAAI,SAAS,CAAC,uBAAwB,KAAa,CAAC,IAAI,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,IAAe;IACvC,OAAO,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,SAAS,aAAa,CAAC,IAAY,EAAE,IAAuB;IAC1D,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAEhD,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,MAAK,MAAM,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7D,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["const DEFAULT_DELIMITER = \"/\";\nconst NOOP_VALUE = (value: string) => value;\nconst ID_START = /^[$_\\p{ID_Start}]$/u;\nconst ID_CONTINUE = /^[$\\u200c\\u200d\\p{ID_Continue}]$/u;\nconst ID = /^[$_\\p{ID_Start}][$\\u200c\\u200d\\p{ID_Continue}]*$/u;\n\n/**\n * Encode a string into another string.\n */\nexport type Encode = (value: string) => string;\n\n/**\n * Decode a string into another string.\n */\nexport type Decode = (value: string) => string;\n\nexport interface ParseOptions {\n /**\n * A function for encoding input strings.\n */\n encodePath?: Encode;\n}\n\nexport interface PathToRegexpOptions {\n /**\n * Matches the path completely without trailing characters. (default: `true`)\n */\n end?: boolean;\n /**\n * Allows optional trailing delimiter to match. (default: `true`)\n */\n trailing?: boolean;\n /**\n * Match will be case sensitive. (default: `false`)\n */\n sensitive?: boolean;\n /**\n * The default delimiter for segments. (default: `'/'`)\n */\n delimiter?: string;\n}\n\nexport interface MatchOptions extends PathToRegexpOptions {\n /**\n * Function for decoding strings for params, or `false` to disable entirely. (default: `decodeURIComponent`)\n */\n decode?: Decode | false;\n}\n\nexport interface CompileOptions {\n /**\n * Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`)\n */\n encode?: Encode | false;\n /**\n * The default delimiter for segments. (default: `'/'`)\n */\n delimiter?: string;\n}\n\n/**\n * Escape text for stringify to path.\n */\nfunction escapeText(str: string) {\n return str.replace(/[{}()\\[\\]+?!:*\\\\]/g, \"\\\\$&\");\n}\n\n/**\n * Escape a regular expression string.\n */\nfunction escape(str: string) {\n return str.replace(/[.+*?^${}()[\\]|/\\\\]/g, \"\\\\$&\");\n}\n\n/**\n * Plain text.\n */\nexport interface Text {\n type: \"text\";\n value: string;\n}\n\n/**\n * A parameter designed to match arbitrary text within a segment.\n */\nexport interface Parameter {\n type: \"param\";\n name: string;\n}\n\n/**\n * A wildcard parameter designed to match multiple segments.\n */\nexport interface Wildcard {\n type: \"wildcard\";\n name: string;\n}\n\n/**\n * A set of possible tokens to expand when matching.\n */\nexport interface Group {\n type: \"group\";\n tokens: Token[];\n}\n\n/**\n * A token that corresponds with a regexp capture.\n */\nexport type Key = Parameter | Wildcard;\n\n/**\n * A sequence of `path-to-regexp` keys that match capturing groups.\n */\nexport type Keys = Array;\n\n/**\n * A sequence of path match characters.\n */\nexport type Token = Text | Parameter | Wildcard | Group;\n\n/**\n * Tokenized path instance.\n */\nexport class TokenData {\n constructor(\n public readonly tokens: Token[],\n public readonly originalPath?: string,\n ) {}\n}\n\n/**\n * ParseError is thrown when there is an error processing the path.\n */\nexport class PathError extends TypeError {\n constructor(\n message: string,\n public readonly originalPath: string | undefined,\n ) {\n let text = message;\n if (originalPath) text += `: ${originalPath}`;\n text += `; visit https://git.new/pathToRegexpError for info`;\n super(text);\n }\n}\n\n/**\n * Parse a string for the raw tokens.\n */\nexport function parse(str: string, options: ParseOptions = {}): TokenData {\n const { encodePath = NOOP_VALUE } = options;\n const chars = [...str];\n let index = 0;\n\n function consumeUntil(end: string): Token[] {\n const output: Token[] = [];\n let path = \"\";\n\n function writePath() {\n if (!path) return;\n output.push({\n type: \"text\",\n value: encodePath(path),\n });\n path = \"\";\n }\n\n while (index < chars.length) {\n const value = chars[index++];\n\n if (value === end) {\n writePath();\n return output;\n }\n\n if (value === \"\\\\\") {\n if (index === chars.length) {\n throw new PathError(`Unexpected end after \\\\ at index ${index}`, str);\n }\n\n path += chars[index++];\n continue;\n }\n\n if (value === \":\" || value === \"*\") {\n const type = value === \":\" ? \"param\" : \"wildcard\";\n let name = \"\";\n\n if (ID_START.test(chars[index])) {\n do {\n name += chars[index++];\n } while (ID_CONTINUE.test(chars[index]));\n } else if (chars[index] === '\"') {\n let quoteStart = index;\n\n while (index < chars.length) {\n if (chars[++index] === '\"') {\n index++;\n quoteStart = 0;\n break;\n }\n\n // Increment over escape characters.\n if (chars[index] === \"\\\\\") index++;\n\n name += chars[index];\n }\n\n if (quoteStart) {\n throw new PathError(\n `Unterminated quote at index ${quoteStart}`,\n str,\n );\n }\n }\n\n if (!name) {\n throw new PathError(`Missing parameter name at index ${index}`, str);\n }\n\n writePath();\n output.push({ type, name });\n continue;\n }\n\n if (value === \"{\") {\n writePath();\n output.push({\n type: \"group\",\n tokens: consumeUntil(\"}\"),\n });\n continue;\n }\n\n if (\n value === \"}\" ||\n value === \"(\" ||\n value === \")\" ||\n value === \"[\" ||\n value === \"]\" ||\n value === \"+\" ||\n value === \"?\" ||\n value === \"!\"\n ) {\n throw new PathError(`Unexpected ${value} at index ${index - 1}`, str);\n }\n\n path += value;\n }\n\n if (end) {\n throw new PathError(\n `Unexpected end at index ${index}, expected ${end}`,\n str,\n );\n }\n\n writePath();\n return output;\n }\n\n return new TokenData(consumeUntil(\"\"), str);\n}\n\n/**\n * Compile a string to a template function for the path.\n */\nexport function compile

(\n path: Path,\n options: CompileOptions & ParseOptions = {},\n) {\n const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } =\n options;\n const data = typeof path === \"object\" ? path : parse(path, options);\n const fn = tokensToFunction(data.tokens, delimiter, encode);\n\n return function path(params: P = {} as P) {\n const missing: string[] = [];\n const path = fn(params, missing);\n\n if (missing.length) {\n throw new TypeError(`Missing parameters: ${missing.join(\", \")}`);\n }\n\n return path;\n };\n}\n\nexport type ParamData = Partial>;\nexport type PathFunction

= (data?: P) => string;\n\n/**\n * Internal path builder function.\n */\ntype TokenEncoder = (data: ParamData, missing: string[]) => string;\n\nfunction tokensToFunction(\n tokens: Token[],\n delimiter: string,\n encode: Encode | false,\n): TokenEncoder {\n const encoders = tokens.map((token) =>\n tokenToFunction(token, delimiter, encode),\n );\n\n return (data: ParamData, missing: string[]) => {\n let result = \"\";\n\n for (const encoder of encoders) {\n result += encoder(data, missing);\n }\n\n return result;\n };\n}\n\n/**\n * Convert a single token into a path building function.\n */\nfunction tokenToFunction(\n token: Token,\n delimiter: string,\n encode: Encode | false,\n): TokenEncoder {\n if (token.type === \"text\") return () => token.value;\n\n if (token.type === \"group\") {\n const fn = tokensToFunction(token.tokens, delimiter, encode);\n\n return (data, missing) => {\n const len = missing.length;\n const value = fn(data, missing);\n if (missing.length === len) return value;\n\n missing.length = len; // Reset optional group.\n return \"\";\n };\n }\n\n const encodeValue = encode || NOOP_VALUE;\n\n if (token.type === \"wildcard\" && encode !== false) {\n return (data, missing) => {\n const value = data[token.name];\n if (value == null) {\n missing.push(token.name);\n return \"\";\n }\n\n if (!Array.isArray(value) || value.length === 0) {\n throw new TypeError(`Expected \"${token.name}\" to be a non-empty array`);\n }\n\n let result = \"\";\n\n for (let i = 0; i < value.length; i++) {\n if (typeof value[i] !== \"string\") {\n throw new TypeError(`Expected \"${token.name}/${i}\" to be a string`);\n }\n\n if (i > 0) result += delimiter;\n result += encodeValue(value[i]);\n }\n\n return result;\n };\n }\n\n return (data, missing) => {\n const value = data[token.name];\n if (value == null) {\n missing.push(token.name);\n return \"\";\n }\n\n if (typeof value !== \"string\") {\n throw new TypeError(`Expected \"${token.name}\" to be a string`);\n }\n\n return encodeValue(value);\n };\n}\n\n/**\n * A match result contains data about the path match.\n */\nexport interface MatchResult

{\n path: string;\n params: P;\n}\n\n/**\n * A match is either `false` (no match) or a match result.\n */\nexport type Match

= false | MatchResult

;\n\n/**\n * The match function takes a string and returns whether it matched the path.\n */\nexport type MatchFunction

= (path: string) => Match

;\n\n/**\n * Supported path types.\n */\nexport type Path = string | TokenData;\n\n/**\n * Transform a path into a match function.\n */\nexport function match

(\n path: Path | Path[],\n options: MatchOptions & ParseOptions = {},\n): MatchFunction

{\n const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } =\n options;\n const { regexp, keys } = pathToRegexp(path, options);\n\n const decoders = keys.map((key) => {\n if (decode === false) return NOOP_VALUE;\n if (key.type === \"param\") return decode;\n return (value: string) => value.split(delimiter).map(decode);\n });\n\n return function match(input: string) {\n const m = regexp.exec(input);\n if (!m) return false;\n\n const path = m[0];\n const params = Object.create(null);\n\n for (let i = 1; i < m.length; i++) {\n if (m[i] === undefined) continue;\n\n const key = keys[i - 1];\n const decoder = decoders[i - 1];\n params[key.name] = decoder(m[i]);\n }\n\n return { path, params };\n };\n}\n\n/**\n * Transform a path into a regular expression and capture keys.\n */\nexport function pathToRegexp(\n path: Path | Path[],\n options: PathToRegexpOptions & ParseOptions = {},\n) {\n const {\n delimiter = DEFAULT_DELIMITER,\n end = true,\n sensitive = false,\n trailing = true,\n } = options;\n const keys: Keys = [];\n let source = \"\";\n let combinations = 0;\n\n function process(path: Path | Path[]) {\n if (Array.isArray(path)) {\n for (const p of path) process(p);\n return;\n }\n\n const data = typeof path === \"object\" ? path : parse(path, options);\n flatten(data.tokens, 0, [], (tokens) => {\n if (combinations >= 256) {\n throw new PathError(\"Too many path combinations\", data.originalPath);\n }\n\n if (combinations > 0) source += \"|\";\n source += toRegExpSource(tokens, delimiter, keys, data.originalPath);\n combinations++;\n });\n }\n\n process(path);\n\n let pattern = `^(?:${source})`;\n if (trailing) pattern += \"(?:\" + escape(delimiter) + \"$)?\";\n pattern += end ? \"$\" : \"(?=\" + escape(delimiter) + \"|$)\";\n\n return { regexp: new RegExp(pattern, sensitive ? \"\" : \"i\"), keys };\n}\n\n/**\n * Generate a flat list of sequence tokens from the given tokens.\n */\nfunction flatten(\n tokens: Token[],\n index: number,\n result: Exclude[],\n callback: (result: Exclude[]) => void,\n): void {\n while (index < tokens.length) {\n const token = tokens[index++];\n\n if (token.type === \"group\") {\n const len = result.length;\n flatten(token.tokens, 0, result, (seq) =>\n flatten(tokens, index, seq, callback),\n );\n result.length = len;\n continue;\n }\n\n result.push(token);\n }\n\n callback(result);\n}\n\n/**\n * Transform a flat sequence of tokens into a regular expression.\n */\nfunction toRegExpSource(\n tokens: Exclude[],\n delimiter: string,\n keys: Keys,\n originalPath: string | undefined,\n): string {\n let result = \"\";\n let backtrack = \"\";\n let wildcardBacktrack = \"\";\n let prevCaptureType: 0 | 1 | 2 = 0;\n let hasSegmentCapture = 0;\n let index = 0;\n\n function hasInSegment(index: number, type: Token[\"type\"]) {\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type === type) return true;\n if (token.type === \"text\") {\n if (token.value.includes(delimiter)) break;\n }\n }\n return false;\n }\n\n function peekText(index: number) {\n let result = \"\";\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type !== \"text\") break;\n result += token.value;\n }\n return result;\n }\n\n while (index < tokens.length) {\n const token = tokens[index++];\n\n if (token.type === \"text\") {\n result += escape(token.value);\n backtrack += token.value;\n if (prevCaptureType === 2) wildcardBacktrack += token.value;\n if (token.value.includes(delimiter)) hasSegmentCapture = 0;\n continue;\n }\n\n if (token.type === \"param\" || token.type === \"wildcard\") {\n if (prevCaptureType && !backtrack) {\n throw new PathError(\n `Missing text before \"${token.name}\" ${token.type}`,\n originalPath,\n );\n }\n\n if (token.type === \"param\") {\n result +=\n hasSegmentCapture & 2 // Seen wildcard in segment.\n ? `(${negate(delimiter, backtrack)}+)`\n : hasInSegment(index, \"wildcard\") // See wildcard later in segment.\n ? `(${negate(delimiter, peekText(index))}+)`\n : hasSegmentCapture & 1 // Seen parameter in segment.\n ? `(${negate(delimiter, backtrack)}+|${escape(backtrack)})`\n : `(${negate(delimiter, \"\")}+)`;\n\n hasSegmentCapture |= prevCaptureType = 1;\n } else {\n result +=\n hasSegmentCapture & 2 // Seen wildcard in segment.\n ? `(${negate(backtrack, \"\")}+)`\n : wildcardBacktrack // No capture in segment, seen wildcard in path.\n ? `(${negate(wildcardBacktrack, \"\")}+|${negate(delimiter, \"\")}+)`\n : `([^]+)`;\n\n wildcardBacktrack = \"\";\n hasSegmentCapture |= prevCaptureType = 2;\n }\n\n keys.push(token);\n backtrack = \"\";\n continue;\n }\n\n throw new TypeError(`Unknown token type: ${(token as any).type}`);\n }\n\n return result;\n}\n\n/**\n * Block backtracking on previous text/delimiter.\n */\nfunction negate(a: string, b: string): string {\n if (b.length > a.length) return negate(b, a); // Longest string first.\n\n if (a === b) b = \"\"; // Cleaner regex strings, no duplication.\n if (b.length > 1) return `(?:(?!${escape(a)}|${escape(b)})[^])`;\n if (a.length > 1) return `(?:(?!${escape(a)})[^${escape(b)}])`;\n return `[^${escape(a + b)}]`;\n}\n\n/**\n * Stringify an array of tokens into a path string.\n */\nfunction stringifyTokens(tokens: Token[], index: number): string {\n let value = \"\";\n\n while (index < tokens.length) {\n const token = tokens[index++];\n\n if (token.type === \"text\") {\n value += escapeText(token.value);\n continue;\n }\n\n if (token.type === \"group\") {\n value += \"{\" + stringifyTokens(token.tokens, 0) + \"}\";\n continue;\n }\n\n if (token.type === \"param\") {\n value += \":\" + stringifyName(token.name, tokens[index]);\n continue;\n }\n\n if (token.type === \"wildcard\") {\n value += \"*\" + stringifyName(token.name, tokens[index]);\n continue;\n }\n\n throw new TypeError(`Unknown token type: ${(token as any).type}`);\n }\n\n return value;\n}\n\n/**\n * Stringify token data into a path string.\n */\nexport function stringify(data: TokenData): string {\n return stringifyTokens(data.tokens, 0);\n}\n\n/**\n * Stringify a parameter name, escaping when it cannot be emitted directly.\n */\nfunction stringifyName(name: string, next: Token | undefined): string {\n if (!ID.test(name)) return JSON.stringify(name);\n\n if (next?.type === \"text\" && ID_CONTINUE.test(next.value[0])) {\n return JSON.stringify(name);\n }\n\n return name;\n}\n"]} \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/package.json new file mode 100644 index 0000000..44ca91d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/path-to-regexp/package.json @@ -0,0 +1,64 @@ +{ + "name": "path-to-regexp", + "version": "8.4.2", + "description": "Express style path to RegExp utility", + "keywords": [ + "express", + "regexp", + "route", + "routing" + ], + "repository": { + "type": "git", + "url": "https://github.com/pillarjs/path-to-regexp.git" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "license": "MIT", + "exports": "./dist/index.js", + "main": "dist/index.js", + "typings": "dist/index.d.ts", + "files": [ + "dist/" + ], + "scripts": { + "bench": "vitest bench", + "build": "ts-scripts build", + "format": "ts-scripts format", + "lint": "ts-scripts lint", + "prepare": "ts-scripts install && npm run build", + "size": "size-limit", + "specs": "ts-scripts specs", + "test": "ts-scripts test && npm run size" + }, + "devDependencies": { + "@borderless/ts-scripts": "^0.15.0", + "@size-limit/preset-small-lib": "^11.1.2", + "@types/node": "^22.7.2", + "@types/semver": "^7.3.1", + "@vitest/coverage-v8": "^3.0.5", + "recheck": "^4.5.0", + "size-limit": "^11.1.2", + "typescript": "^5.7.3", + "vitest": "^3.0.5" + }, + "publishConfig": { + "access": "public" + }, + "size-limit": [ + { + "path": "dist/index.js", + "limit": "2 kB" + } + ], + "ts-scripts": { + "dist": [ + "dist" + ], + "project": [ + "tsconfig.build.json" + ] + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/LICENSE new file mode 100644 index 0000000..3608dca --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/README.md new file mode 100644 index 0000000..80bae44 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/README.md @@ -0,0 +1,716 @@ +

Picomatch

+ +

+ +version + + +test status + + +coverage status + + +downloads + +

+ +
+
+ +

+Blazing fast and accurate glob matcher written in JavaScript.
+No dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions. +

+ +
+
+ +## Why picomatch? + +* **Lightweight** - No dependencies +* **Minimal** - Tiny API surface. Main export is a function that takes a glob pattern and returns a matcher function. +* **Fast** - Loads in about 2ms (that's several times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps) +* **Performant** - Use the returned matcher function to speed up repeat matching (like when watching files) +* **Accurate matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories, [advanced globbing](#advanced-globbing) with extglobs, braces, and POSIX brackets, and support for escaping special characters with `\` or quotes. +* **Well tested** - Thousands of unit tests + +See the [library comparison](#library-comparisons) to other libraries. + +
+
+ +## Table of Contents + +
Click to expand + +- [Install](#install) +- [Usage](#usage) +- [API](#api) + * [picomatch](#picomatch) + * [.test](#test) + * [.matchBase](#matchbase) + * [.isMatch](#ismatch) + * [.parse](#parse) + * [.scan](#scan) + * [.compileRe](#compilere) + * [.makeRe](#makere) + * [.toRegex](#toregex) +- [Options](#options) + * [Picomatch options](#picomatch-options) + * [Scan Options](#scan-options) + * [Options Examples](#options-examples) +- [Globbing features](#globbing-features) + * [Basic globbing](#basic-globbing) + * [Advanced globbing](#advanced-globbing) + * [Braces](#braces) + * [Matching special characters as literals](#matching-special-characters-as-literals) +- [Library Comparisons](#library-comparisons) +- [Benchmarks](#benchmarks) +- [Philosophies](#philosophies) +- [About](#about) + * [Author](#author) + * [License](#license) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + +
+ +
+
+ +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +npm install --save picomatch +``` + +
+ +## Usage + +The main export is a function that takes a glob pattern and an options object and returns a function for matching strings. + +```js +const pm = require('picomatch'); +const isMatch = pm('*.js'); + +console.log(isMatch('abcd')); //=> false +console.log(isMatch('a.js')); //=> true +console.log(isMatch('a.md')); //=> false +console.log(isMatch('a/b.js')); //=> false +``` + +
+ +## API + +### [picomatch](lib/picomatch.js#L32) + +Creates a matcher function from one or more glob patterns. The returned function takes a string to match as its first argument, and returns true if the string is a match. The returned matcher function also takes a boolean as the second argument that, when true, returns an object with additional information. + +**Params** + +* `globs` **{String|Array}**: One or more glob patterns. +* `options` **{Object=}** +* `returns` **{Function=}**: Returns a matcher function. + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch(glob[, options]); + +const isMatch = picomatch('*.!(*a)'); +console.log(isMatch('a.a')); //=> false +console.log(isMatch('a.b')); //=> true +``` + +### [.test](lib/picomatch.js#L117) + +Test `input` with the given `regex`. This is used by the main `picomatch()` function to test the input string. + +**Params** + +* `input` **{String}**: String to test. +* `regex` **{RegExp}** +* `returns` **{Object}**: Returns an object with matching info. + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.test(input, regex[, options]); + +console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); +// { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } +``` + +### [.matchBase](lib/picomatch.js#L161) + +Match the basename of a filepath. + +**Params** + +* `input` **{String}**: String to test. +* `glob` **{RegExp|String}**: Glob pattern or regex created by [.makeRe](#makeRe). +* `returns` **{Boolean}** + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.matchBase(input, glob[, options]); +console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true +``` + +### [.isMatch](lib/picomatch.js#L183) + +Returns true if **any** of the given glob `patterns` match the specified `string`. + +**Params** + +* **{String|Array}**: str The string to test. +* **{String|Array}**: patterns One or more glob patterns to use for matching. +* **{Object}**: See available [options](#options). +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.isMatch(string, patterns[, options]); + +console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true +console.log(picomatch.isMatch('a.a', 'b.*')); //=> false +``` + +### [.parse](lib/picomatch.js#L199) + +Parse a glob pattern to create the source string for a regular expression. + +**Params** + +* `pattern` **{String}** +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with useful properties and output to be used as a regex source string. + +**Example** + +```js +const picomatch = require('picomatch'); +const result = picomatch.parse(pattern[, options]); +``` + +### [.scan](lib/picomatch.js#L231) + +Scan a glob pattern to separate the pattern into segments. + +**Params** + +* `input` **{String}**: Glob pattern to scan. +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.scan(input[, options]); + +const result = picomatch.scan('!./foo/*.js'); +console.log(result); +{ prefix: '!./', + input: '!./foo/*.js', + start: 3, + base: 'foo', + glob: '*.js', + isBrace: false, + isBracket: false, + isGlob: true, + isExtglob: false, + isGlobstar: false, + negated: true } +``` + +### [.compileRe](lib/picomatch.js#L245) + +Compile a regular expression from the `state` object returned by the +[parse()](#parse) method. + +**Params** + +* `state` **{Object}** +* `options` **{Object}** +* `returnOutput` **{Boolean}**: Intended for implementors, this argument allows you to return the raw output from the parser. +* `returnState` **{Boolean}**: Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. +* `returns` **{RegExp}** + +### [.makeRe](lib/picomatch.js#L286) + +Create a regular expression from a parsed glob pattern. + +**Params** + +* `state` **{String}**: The object returned from the `.parse` method. +* `options` **{Object}** +* `returnOutput` **{Boolean}**: Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. +* `returnState` **{Boolean}**: Implementors may use this argument to return the state from the parsed glob with the returned regular expression. +* `returns` **{RegExp}**: Returns a regex created from the given pattern. + +**Example** + +```js +const picomatch = require('picomatch'); +const state = picomatch.parse('*.js'); +// picomatch.compileRe(state[, options]); + +console.log(picomatch.compileRe(state)); +//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ +``` + +### [.toRegex](lib/picomatch.js#L321) + +Create a regular expression from the given regex source string. + +**Params** + +* `source` **{String}**: Regular expression source string. +* `options` **{Object}** +* `returns` **{RegExp}** + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.toRegex(source[, options]); + +const { output } = picomatch.parse('*.js'); +console.log(picomatch.toRegex(output)); +//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ +``` + +
+ +## Options + +### Picomatch options + +The following options may be used with the main `picomatch()` function or any of the methods on the picomatch API. + +| **Option** | **Type** | **Default value** | **Description** | +| --- | --- | --- | --- | +| `basename` | `boolean` | `false` | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. | +| `bash` | `boolean` | `false` | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (`**`). | +| `capture` | `boolean` | `undefined` | Return regex matches in supporting methods. | +| `contains` | `boolean` | `undefined` | Allows glob to match any part of the given string(s). | +| `cwd` | `string` | `process.cwd()` | Current working directory. Used by `picomatch.split()` | +| `debug` | `boolean` | `undefined` | Debug regular expressions when an error is thrown. | +| `dot` | `boolean` | `false` | Enable dotfile matching. By default, dotfiles are ignored unless a `.` is explicitly defined in the pattern, or `options.dot` is true | +| `expandRange` | `function` | `undefined` | Custom function for expanding ranges in brace patterns, such as `{a..z}`. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. | +| `failglob` | `boolean` | `false` | Throws an error if no matches are found. Based on the bash option of the same name. | +| `fastpaths` | `boolean` | `true` | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to `false`. | +| `flags` | `string` | `undefined` | Regex flags to use in the generated regex. If defined, the `nocase` option will be overridden. | +| [format](#optionsformat) | `function` | `undefined` | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. | +| `ignore` | `array\|string` | `undefined` | One or more glob patterns for excluding strings that should not be matched from the result. | +| `keepQuotes` | `boolean` | `false` | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. | +| `literalBrackets` | `boolean` | `undefined` | When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. | +| `matchBase` | `boolean` | `false` | Alias for `basename` | +| `maxLength` | `number` | `65536` | Limit the max length of the input string. An error is thrown if the input string is longer than this value. | +| `maxExtglobRecursion` | `number\|boolean` | `0` | Limit nested quantified extglobs and other risky repeated extglob forms. When the limit is exceeded, the extglob is treated as a literal string instead of being compiled to regex. Set to `false` to disable this safeguard. | +| `nobrace` | `boolean` | `false` | Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. | +| `nobracket` | `boolean` | `undefined` | Disable matching with regex brackets. | +| `nocase` | `boolean` | `false` | Make matching case-insensitive. Equivalent to the regex `i` flag. Note that this option is overridden by the `flags` option. | +| `nodupes` | `boolean` | `true` | Deprecated, use `nounique` instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. | +| `noext` | `boolean` | `false` | Alias for `noextglob` | +| `noextglob` | `boolean` | `false` | Disable support for matching with extglobs (like `+(a\|b)`) | +| `noglobstar` | `boolean` | `false` | Disable support for matching nested directories with globstars (`**`) | +| `nonegate` | `boolean` | `false` | Disable support for negating with leading `!` | +| `noquantifiers` | `boolean` | `false` | Disable support for regex quantifiers (like `a{1,2}`) and treat them as brace patterns to be expanded. | +| [onIgnore](#optionsonIgnore) | `function` | `undefined` | Function to be called on ignored items. | +| [onMatch](#optionsonMatch) | `function` | `undefined` | Function to be called on matched items. | +| [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. | +| `posix` | `boolean` | `false` | Support POSIX character classes ("posix brackets"). | +| `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself | +| `prepend` | `boolean` | `undefined` | String to prepend to the generated regex used for matching. | +| `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). | +| `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. | +| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. | +| `unescape` | `boolean` | `undefined` | Remove backslashes preceding escaped characters in the glob pattern. By default, backslashes are retained. | +| `unixify` | `boolean` | `undefined` | Alias for `posixSlashes`, for backwards compatibility. | + +picomatch has automatic detection for regex positive and negative lookbehinds. If the pattern contains a negative lookbehind, you must be using Node.js >= 8.10 or else picomatch will throw an error. + +### Scan Options + +In addition to the main [picomatch options](#picomatch-options), the following options may also be used with the [.scan](#scan) method. + +| **Option** | **Type** | **Default value** | **Description** | +| --- | --- | --- | --- | +| `tokens` | `boolean` | `false` | When `true`, the returned object will include an array of tokens (objects), representing each path "segment" in the scanned glob pattern | +| `parts` | `boolean` | `false` | When `true`, the returned object will include an array of strings representing each path "segment" in the scanned glob pattern. This is automatically enabled when `options.tokens` is true | + +**Example** + +```js +const picomatch = require('picomatch'); +const result = picomatch.scan('!./foo/*.js', { tokens: true }); +console.log(result); +// { +// prefix: '!./', +// input: '!./foo/*.js', +// start: 3, +// base: 'foo', +// glob: '*.js', +// isBrace: false, +// isBracket: false, +// isGlob: true, +// isExtglob: false, +// isGlobstar: false, +// negated: true, +// maxDepth: 2, +// tokens: [ +// { value: '!./', depth: 0, isGlob: false, negated: true, isPrefix: true }, +// { value: 'foo', depth: 1, isGlob: false }, +// { value: '*.js', depth: 1, isGlob: true } +// ], +// slashes: [ 2, 6 ], +// parts: [ 'foo', '*.js' ] +// } +``` + +
+ +### Options Examples + +#### options.expandRange + +**Type**: `function` + +**Default**: `undefined` + +Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need. + +**Example** + +The following example shows how to create a glob that matches a folder + +```js +const fill = require('fill-range'); +const regex = pm.makeRe('foo/{01..25}/bar', { + expandRange(a, b) { + return `(${fill(a, b, { toRegex: true })})`; + } +}); + +console.log(regex); +//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/ + +console.log(regex.test('foo/00/bar')) // false +console.log(regex.test('foo/01/bar')) // true +console.log(regex.test('foo/10/bar')) // true +console.log(regex.test('foo/22/bar')) // true +console.log(regex.test('foo/25/bar')) // true +console.log(regex.test('foo/26/bar')) // false +``` + +#### options.format + +**Type**: `function` + +**Default**: `undefined` + +Custom function for formatting strings before they're matched. + +**Example** + +```js +// strip leading './' from strings +const format = str => str.replace(/^\.\//, ''); +const isMatch = picomatch('foo/*.js', { format }); +console.log(isMatch('./foo/bar.js')); //=> true +``` + +#### options.onMatch + +```js +const onMatch = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onMatch }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +#### options.onIgnore + +```js +const onIgnore = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onIgnore, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +#### options.onResult + +```js +const onResult = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onResult, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +
+
+ +## Globbing features + +* [Basic globbing](#basic-globbing) (Wildcard matching) +* [Advanced globbing](#advanced-globbing) (extglobs, posix brackets, brace matching) + +### Basic globbing + +| **Character** | **Description** | +| --- | --- | +| `*` | Matches any character zero or more times, excluding path separators. Does _not match_ path separators or hidden files or directories ("dotfiles"), unless explicitly enabled by setting the `dot` option to `true`. | +| `**` | Matches any character zero or more times, including path separators. Note that `**` will only match path separators (`/`, and `\\` on Windows) when they are the only characters in a path segment. Thus, `foo**/bar` is equivalent to `foo*/bar`, and `foo/a**b/bar` is equivalent to `foo/a*b/bar`, and _more than two_ consecutive stars in a glob path segment are regarded as _a single star_. Thus, `foo/***/bar` is equivalent to `foo/*/bar`. | +| `?` | Matches any character excluding path separators one time. Does _not match_ path separators or leading dots. | +| `[abc]` | Matches any characters inside the brackets. For example, `[abc]` would match the characters `a`, `b` or `c`, and nothing else. | + +#### Matching behavior vs. Bash + +Picomatch's matching features and expected results in unit tests are based on Bash's unit tests and the Bash 4.3 specification, with the following exceptions: + +* Bash will match `foo/bar/baz` with `*`. Picomatch only matches nested directories with `**`. +* Bash greedily matches with negated extglobs. For example, Bash 4.3 says that `!(foo)*` should match `foo` and `foobar`, since the trailing `*` bracktracks to match the preceding pattern. This is very memory-inefficient, and IMHO, also incorrect. Picomatch would return `false` for both `foo` and `foobar`. + +
+ +### Advanced globbing + +* [extglobs](#extglobs) +* [POSIX brackets](#posix-brackets) +* [Braces](#brace-expansion) + +#### Extglobs + +| **Pattern** | **Description** | +| --- | --- | +| `@(pattern)` | Match _only one_ consecutive occurrence of `pattern` | +| `*(pattern)` | Match _zero or more_ consecutive occurrences of `pattern` | +| `+(pattern)` | Match _one or more_ consecutive occurrences of `pattern` | +| `?(pattern)` | Match _zero or **one**_ consecutive occurrences of `pattern` | +| `!(pattern)` | Match _anything but_ `pattern` | + +**Examples** + +```js +const pm = require('picomatch'); + +// *(pattern) matches ZERO or more of "pattern" +console.log(pm.isMatch('a', 'a*(z)')); // true +console.log(pm.isMatch('az', 'a*(z)')); // true +console.log(pm.isMatch('azzz', 'a*(z)')); // true + +// +(pattern) matches ONE or more of "pattern" +console.log(pm.isMatch('a', 'a*(z)')); // true +console.log(pm.isMatch('az', 'a*(z)')); // true +console.log(pm.isMatch('azzz', 'a*(z)')); // true + +// supports multiple extglobs +console.log(pm.isMatch('foo.bar', '!(foo).!(bar)')); // false + +// supports nested extglobs +console.log(pm.isMatch('foo.bar', '!(!(foo)).!(!(bar))')); // true + +// risky quantified extglobs are treated literally by default +console.log(pm.makeRe('+(a|aa)')); +//=> /^(?:\+\(a\|aa\))$/ + +// increase the limit to allow a small amount of nested quantified extglobs +console.log(pm.isMatch('aaa', '+(+(a))', { maxExtglobRecursion: 1 })); // true +``` + +#### POSIX brackets + +POSIX classes are disabled by default. Enable this feature by setting the `posix` option to true. + +**Enable POSIX bracket support** + +```js +console.log(pm.makeRe('[[:word:]]+', { posix: true })); +//=> /^(?:(?=.)[A-Za-z0-9_]+\/?)$/ +``` + +**Supported POSIX classes** + +The following named POSIX bracket expressions are supported: + +* `[:alnum:]` - Alphanumeric characters, equ `[a-zA-Z0-9]` +* `[:alpha:]` - Alphabetical characters, equivalent to `[a-zA-Z]`. +* `[:ascii:]` - ASCII characters, equivalent to `[\\x00-\\x7F]`. +* `[:blank:]` - Space and tab characters, equivalent to `[ \\t]`. +* `[:cntrl:]` - Control characters, equivalent to `[\\x00-\\x1F\\x7F]`. +* `[:digit:]` - Numerical digits, equivalent to `[0-9]`. +* `[:graph:]` - Graph characters, equivalent to `[\\x21-\\x7E]`. +* `[:lower:]` - Lowercase letters, equivalent to `[a-z]`. +* `[:print:]` - Print characters, equivalent to `[\\x20-\\x7E ]`. +* `[:punct:]` - Punctuation and symbols, equivalent to `[\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~]`. +* `[:space:]` - Extended space characters, equivalent to `[ \\t\\r\\n\\v\\f]`. +* `[:upper:]` - Uppercase letters, equivalent to `[A-Z]`. +* `[:word:]` - Word characters (letters, numbers and underscores), equivalent to `[A-Za-z0-9_]`. +* `[:xdigit:]` - Hexadecimal digits, equivalent to `[A-Fa-f0-9]`. + +See the [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) for more information. + +### Braces + +Picomatch does not do brace expansion. For [brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html) and advanced matching with braces, use [micromatch](https://github.com/micromatch/micromatch) instead. Picomatch has very basic support for braces. + +### Matching special characters as literals + +If you wish to match the following special characters in a filepath, and you want to use these characters in your glob pattern, they must be escaped with backslashes or quotes: + +**Special Characters** + +Some characters that are used for matching in regular expressions are also regarded as valid file path characters on some platforms. + +To match any of the following characters as literals: `$^*+?()[] + +Examples: + +```js +console.log(pm.makeRe('foo/bar \\(1\\)')); +console.log(pm.makeRe('foo/bar \\(1\\)')); +``` + +
+
+ +## Library Comparisons + +The following table shows which features are supported by [minimatch](https://github.com/isaacs/minimatch), [micromatch](https://github.com/micromatch/micromatch), [picomatch](https://github.com/micromatch/picomatch), [nanomatch](https://github.com/micromatch/nanomatch), [extglob](https://github.com/micromatch/extglob), [braces](https://github.com/micromatch/braces), and [expand-brackets](https://github.com/micromatch/expand-brackets). + +| **Feature** | `minimatch` | `micromatch` | `picomatch` | `nanomatch` | `extglob` | `braces` | `expand-brackets` | +| --- | --- | --- | --- | --- | --- | --- | --- | +| Wildcard matching (`*?+`) | ✔ | ✔ | ✔ | ✔ | - | - | - | +| Advancing globbing | ✔ | ✔ | ✔ | - | - | - | - | +| Brace _matching_ | ✔ | ✔ | ✔ | - | - | ✔ | - | +| Brace _expansion_ | ✔ | ✔ | - | - | - | ✔ | - | +| Extglobs | partial | ✔ | ✔ | - | ✔ | - | - | +| Posix brackets | - | ✔ | ✔ | - | - | - | ✔ | +| Regular expression syntax | - | ✔ | ✔ | ✔ | ✔ | - | ✔ | +| File system operations | - | - | - | - | - | - | - | + +
+
+ +## Benchmarks + +Performance comparison of picomatch and minimatch. + +``` +# .makeRe star + picomatch x 1,993,050 ops/sec ±0.51% (91 runs sampled) + minimatch x 627,206 ops/sec ±1.96% (87 runs sampled)) + +# .makeRe star; dot=true + picomatch x 1,436,640 ops/sec ±0.62% (91 runs sampled) + minimatch x 525,876 ops/sec ±0.60% (88 runs sampled) + +# .makeRe globstar + picomatch x 1,592,742 ops/sec ±0.42% (90 runs sampled) + minimatch x 962,043 ops/sec ±1.76% (91 runs sampled)d) + +# .makeRe globstars + picomatch x 1,615,199 ops/sec ±0.35% (94 runs sampled) + minimatch x 477,179 ops/sec ±1.33% (91 runs sampled) + +# .makeRe with leading star + picomatch x 1,220,856 ops/sec ±0.40% (92 runs sampled) + minimatch x 453,564 ops/sec ±1.43% (94 runs sampled) + +# .makeRe - basic braces + picomatch x 392,067 ops/sec ±0.70% (90 runs sampled) + minimatch x 99,532 ops/sec ±2.03% (87 runs sampled)) +``` + +
+
+ +## Philosophies + +The goal of this library is to be blazing fast, without compromising on accuracy. + +**Accuracy** + +The number one of goal of this library is accuracy. However, it's not unusual for different glob implementations to have different rules for matching behavior, even with simple wildcard matching. It gets increasingly more complicated when combinations of different features are combined, like when extglobs are combined with globstars, braces, slashes, and so on: `!(**/{a,b,*/c})`. + +Thus, given that there is no canonical glob specification to use as a single source of truth when differences of opinion arise regarding behavior, sometimes we have to implement our best judgement and rely on feedback from users to make improvements. + +**Performance** + +Although this library performs well in benchmarks, and in most cases it's faster than other popular libraries we benchmarked against, we will always choose accuracy over performance. It's not helpful to anyone if our library is faster at returning the wrong answer. + +
+
+ +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards. + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2017-present, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/index.js new file mode 100644 index 0000000..d2f2bc5 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./lib/picomatch'); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/lib/constants.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/lib/constants.js new file mode 100644 index 0000000..4c87872 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/lib/constants.js @@ -0,0 +1,184 @@ +'use strict'; + +const path = require('path'); +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +const DEFAULT_MAX_EXTGLOB_RECURSION = 0; + +/** + * Posix glob regex + */ + +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR = `${QMARK}*?`; + +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE = { + __proto__: null, + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; + +module.exports = { + DEFAULT_MAX_EXTGLOB_RECURSION, + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + __proto__: null, + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + SEP: path.sep, + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/lib/parse.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/lib/parse.js new file mode 100644 index 0000000..caa2b86 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/lib/parse.js @@ -0,0 +1,1392 @@ +'use strict'; + +const constants = require('./constants'); +const utils = require('./utils'); + +/** + * Constants + */ + +const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants; + +/** + * Helpers + */ + +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + try { + /* eslint-disable-next-line no-new */ + new RegExp(value); + } catch (ex) { + return args.map(v => utils.escapeRegex(v)).join('..'); + } + + return value; +}; + +/** + * Create the message for a syntax error + */ + +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; + +const splitTopLevel = input => { + const parts = []; + let bracket = 0; + let paren = 0; + let quote = 0; + let value = ''; + let escaped = false; + + for (const ch of input) { + if (escaped === true) { + value += ch; + escaped = false; + continue; + } + + if (ch === '\\') { + value += ch; + escaped = true; + continue; + } + + if (ch === '"') { + quote = quote === 1 ? 0 : 1; + value += ch; + continue; + } + + if (quote === 0) { + if (ch === '[') { + bracket++; + } else if (ch === ']' && bracket > 0) { + bracket--; + } else if (bracket === 0) { + if (ch === '(') { + paren++; + } else if (ch === ')' && paren > 0) { + paren--; + } else if (ch === '|' && paren === 0) { + parts.push(value); + value = ''; + continue; + } + } + } + + value += ch; + } + + parts.push(value); + return parts; +}; + +const isPlainBranch = branch => { + let escaped = false; + + for (const ch of branch) { + if (escaped === true) { + escaped = false; + continue; + } + + if (ch === '\\') { + escaped = true; + continue; + } + + if (/[?*+@!()[\]{}]/.test(ch)) { + return false; + } + } + + return true; +}; + +const normalizeSimpleBranch = branch => { + let value = branch.trim(); + let changed = true; + + while (changed === true) { + changed = false; + + if (/^@\([^\\()[\]{}|]+\)$/.test(value)) { + value = value.slice(2, -1); + changed = true; + } + } + + if (!isPlainBranch(value)) { + return; + } + + return value.replace(/\\(.)/g, '$1'); +}; + +const hasRepeatedCharPrefixOverlap = branches => { + const values = branches.map(normalizeSimpleBranch).filter(Boolean); + + for (let i = 0; i < values.length; i++) { + for (let j = i + 1; j < values.length; j++) { + const a = values[i]; + const b = values[j]; + const char = a[0]; + + if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) { + continue; + } + + if (a === b || a.startsWith(b) || b.startsWith(a)) { + return true; + } + } + } + + return false; +}; + +const parseRepeatedExtglob = (pattern, requireEnd = true) => { + if ((pattern[0] !== '+' && pattern[0] !== '*') || pattern[1] !== '(') { + return; + } + + let bracket = 0; + let paren = 0; + let quote = 0; + let escaped = false; + + for (let i = 1; i < pattern.length; i++) { + const ch = pattern[i]; + + if (escaped === true) { + escaped = false; + continue; + } + + if (ch === '\\') { + escaped = true; + continue; + } + + if (ch === '"') { + quote = quote === 1 ? 0 : 1; + continue; + } + + if (quote === 1) { + continue; + } + + if (ch === '[') { + bracket++; + continue; + } + + if (ch === ']' && bracket > 0) { + bracket--; + continue; + } + + if (bracket > 0) { + continue; + } + + if (ch === '(') { + paren++; + continue; + } + + if (ch === ')') { + paren--; + + if (paren === 0) { + if (requireEnd === true && i !== pattern.length - 1) { + return; + } + + return { + type: pattern[0], + body: pattern.slice(2, i), + end: i + }; + } + } + } +}; + +const getStarExtglobSequenceOutput = pattern => { + let index = 0; + const chars = []; + + while (index < pattern.length) { + const match = parseRepeatedExtglob(pattern.slice(index), false); + + if (!match || match.type !== '*') { + return; + } + + const branches = splitTopLevel(match.body).map(branch => branch.trim()); + if (branches.length !== 1) { + return; + } + + const branch = normalizeSimpleBranch(branches[0]); + if (!branch || branch.length !== 1) { + return; + } + + chars.push(branch); + index += match.end + 1; + } + + if (chars.length < 1) { + return; + } + + const source = chars.length === 1 + ? utils.escapeRegex(chars[0]) + : `[${chars.map(ch => utils.escapeRegex(ch)).join('')}]`; + + return `${source}*`; +}; + +const repeatedExtglobRecursion = pattern => { + let depth = 0; + let value = pattern.trim(); + let match = parseRepeatedExtglob(value); + + while (match) { + depth++; + value = match.body.trim(); + match = parseRepeatedExtglob(value); + } + + return depth; +}; + +const analyzeRepeatedExtglob = (body, options) => { + if (options.maxExtglobRecursion === false) { + return { risky: false }; + } + + const max = + typeof options.maxExtglobRecursion === 'number' + ? options.maxExtglobRecursion + : constants.DEFAULT_MAX_EXTGLOB_RECURSION; + + const branches = splitTopLevel(body).map(branch => branch.trim()); + + if (branches.length > 1) { + if ( + branches.some(branch => branch === '') || + branches.some(branch => /^[*?]+$/.test(branch)) || + hasRepeatedCharPrefixOverlap(branches) + ) { + return { risky: true }; + } + } + + for (const branch of branches) { + const safeOutput = getStarExtglobSequenceOutput(branch); + if (safeOutput) { + return { risky: true, safeOutput }; + } + + if (repeatedExtglobRecursion(branch) > max) { + return { risky: true }; + } + } + + return { risky: false }; +}; + +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + +const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(win32); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + token.startIndex = state.index; + token.tokensIndex = tokens.length; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + const literal = input.slice(token.startIndex, state.index + 1); + const body = input.slice(token.startIndex + 2, state.index); + const analysis = analyzeRepeatedExtglob(body, opts); + + if ((token.type === 'plus' || token.type === 'star') && analysis.risky) { + const safeOutput = analysis.safeOutput + ? (token.output ? '' : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) + : undefined; + const open = tokens[token.tokensIndex]; + + open.type = 'text'; + open.value = literal; + open.output = safeOutput || utils.escapeRegex(literal); + + for (let i = token.tokensIndex + 1; i < tokens.length; i++) { + tokens[i].value = ''; + tokens[i].output = ''; + delete tokens[i].suffix; + } + + state.output = token.output + open.output; + state.backtrack = true; + + push({ type: 'paren', extglob: true, value, output: '' }); + decrement('parens'); + return; + } + + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if (next === '<' && !utils.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; +}; + +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + +parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(win32); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; +}; + +module.exports = parse; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/lib/picomatch.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/lib/picomatch.js new file mode 100644 index 0000000..782d809 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/lib/picomatch.js @@ -0,0 +1,342 @@ +'use strict'; + +const path = require('path'); +const scan = require('./scan'); +const parse = require('./parse'); +const utils = require('./utils'); +const constants = require('./constants'); +const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + +const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils.isWindows(options); + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; +}; + +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + +picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; +}; + +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + +picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(path.basename(input)); +}; + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + +picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); +}; + +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +picomatch.scan = (input, options) => scan(input, options); + +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + +picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch.compileRe(parsed, options, returnOutput, returnState); +}; + +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; + +/** + * Picomatch constants. + * @return {Object} + */ + +picomatch.constants = constants; + +/** + * Expose "picomatch" + */ + +module.exports = picomatch; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/lib/scan.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/lib/scan.js new file mode 100644 index 0000000..e59cd7a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/lib/scan.js @@ -0,0 +1,391 @@ +'use strict'; + +const utils = require('./utils'); +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ +} = require('./constants'); + +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; + +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; + +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + +const scan = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; +}; + +module.exports = scan; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/lib/utils.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/lib/utils.js new file mode 100644 index 0000000..c3ca766 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/lib/utils.js @@ -0,0 +1,64 @@ +'use strict'; + +const path = require('path'); +const win32 = process.platform === 'win32'; +const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL +} = require('./constants'); + +exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); +exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); +exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); +exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); +exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + +exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); +}; + +exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; +}; + +exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; +}; + +exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; +}; + +exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; +}; + +exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/package.json new file mode 100644 index 0000000..e329d9c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/picomatch/package.json @@ -0,0 +1,81 @@ +{ + "name": "picomatch", + "description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.", + "version": "2.3.2", + "homepage": "https://github.com/micromatch/picomatch", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "funding": "https://github.com/sponsors/jonschlinkert", + "repository": "micromatch/picomatch", + "bugs": { + "url": "https://github.com/micromatch/picomatch/issues" + }, + "license": "MIT", + "files": [ + "index.js", + "lib" + ], + "main": "index.js", + "engines": { + "node": ">=8.6" + }, + "scripts": { + "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .", + "mocha": "mocha --reporter dot", + "test": "npm run lint && npm run mocha", + "test:ci": "npm run test:cover", + "test:cover": "nyc npm run mocha" + }, + "devDependencies": { + "eslint": "^6.8.0", + "fill-range": "^7.0.1", + "gulp-format-md": "^2.0.0", + "mocha": "^6.2.2", + "nyc": "^15.0.0", + "time-require": "github:jonschlinkert/time-require" + }, + "keywords": [ + "glob", + "match", + "picomatch" + ], + "nyc": { + "reporter": [ + "html", + "lcov", + "text-summary" + ] + }, + "verb": { + "toc": { + "render": true, + "method": "preWrite", + "maxdepth": 3 + }, + "layout": "empty", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "braces", + "micromatch" + ] + }, + "reflinks": [ + "braces", + "expand-brackets", + "extglob", + "fill-range", + "micromatch", + "minimatch", + "nanomatch", + "picomatch" + ] + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/proxy-addr/HISTORY.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/proxy-addr/HISTORY.md new file mode 100644 index 0000000..8480242 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/proxy-addr/HISTORY.md @@ -0,0 +1,161 @@ +2.0.7 / 2021-05-31 +================== + + * deps: forwarded@0.2.0 + - Use `req.socket` over deprecated `req.connection` + +2.0.6 / 2020-02-24 +================== + + * deps: ipaddr.js@1.9.1 + +2.0.5 / 2019-04-16 +================== + + * deps: ipaddr.js@1.9.0 + +2.0.4 / 2018-07-26 +================== + + * deps: ipaddr.js@1.8.0 + +2.0.3 / 2018-02-19 +================== + + * deps: ipaddr.js@1.6.0 + +2.0.2 / 2017-09-24 +================== + + * deps: forwarded@~0.1.2 + - perf: improve header parsing + - perf: reduce overhead when no `X-Forwarded-For` header + +2.0.1 / 2017-09-10 +================== + + * deps: forwarded@~0.1.1 + - Fix trimming leading / trailing OWS + - perf: hoist regular expression + * deps: ipaddr.js@1.5.2 + +2.0.0 / 2017-08-08 +================== + + * Drop support for Node.js below 0.10 + +1.1.5 / 2017-07-25 +================== + + * Fix array argument being altered + * deps: ipaddr.js@1.4.0 + +1.1.4 / 2017-03-24 +================== + + * deps: ipaddr.js@1.3.0 + +1.1.3 / 2017-01-14 +================== + + * deps: ipaddr.js@1.2.0 + +1.1.2 / 2016-05-29 +================== + + * deps: ipaddr.js@1.1.1 + - Fix IPv6-mapped IPv4 validation edge cases + +1.1.1 / 2016-05-03 +================== + + * Fix regression matching mixed versions against multiple subnets + +1.1.0 / 2016-05-01 +================== + + * Fix accepting various invalid netmasks + - IPv4 netmasks must be contingous + - IPv6 addresses cannot be used as a netmask + * deps: ipaddr.js@1.1.0 + +1.0.10 / 2015-12-09 +=================== + + * deps: ipaddr.js@1.0.5 + - Fix regression in `isValid` with non-string arguments + +1.0.9 / 2015-12-01 +================== + + * deps: ipaddr.js@1.0.4 + - Fix accepting some invalid IPv6 addresses + - Reject CIDRs with negative or overlong masks + * perf: enable strict mode + +1.0.8 / 2015-05-10 +================== + + * deps: ipaddr.js@1.0.1 + +1.0.7 / 2015-03-16 +================== + + * deps: ipaddr.js@0.1.9 + - Fix OOM on certain inputs to `isValid` + +1.0.6 / 2015-02-01 +================== + + * deps: ipaddr.js@0.1.8 + +1.0.5 / 2015-01-08 +================== + + * deps: ipaddr.js@0.1.6 + +1.0.4 / 2014-11-23 +================== + + * deps: ipaddr.js@0.1.5 + - Fix edge cases with `isValid` + +1.0.3 / 2014-09-21 +================== + + * Use `forwarded` npm module + +1.0.2 / 2014-09-18 +================== + + * Fix a global leak when multiple subnets are trusted + * Support Node.js 0.6 + * deps: ipaddr.js@0.1.3 + +1.0.1 / 2014-06-03 +================== + + * Fix links in npm package + +1.0.0 / 2014-05-08 +================== + + * Add `trust` argument to determine proxy trust on + * Accepts custom function + * Accepts IPv4/IPv6 address(es) + * Accepts subnets + * Accepts pre-defined names + * Add optional `trust` argument to `proxyaddr.all` to + stop at first untrusted + * Add `proxyaddr.compile` to pre-compile `trust` function + to make subsequent calls faster + +0.0.1 / 2014-05-04 +================== + + * Fix bad npm publish + +0.0.0 / 2014-05-04 +================== + + * Initial release diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/proxy-addr/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/proxy-addr/LICENSE new file mode 100644 index 0000000..cab251c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/proxy-addr/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/proxy-addr/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/proxy-addr/README.md new file mode 100644 index 0000000..69c0b63 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/proxy-addr/README.md @@ -0,0 +1,139 @@ +# proxy-addr + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Determine address of proxied request + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install proxy-addr +``` + +## API + +```js +var proxyaddr = require('proxy-addr') +``` + +### proxyaddr(req, trust) + +Return the address of the request, using the given `trust` parameter. + +The `trust` argument is a function that returns `true` if you trust +the address, `false` if you don't. The closest untrusted address is +returned. + +```js +proxyaddr(req, function (addr) { return addr === '127.0.0.1' }) +proxyaddr(req, function (addr, i) { return i < 1 }) +``` + +The `trust` arugment may also be a single IP address string or an +array of trusted addresses, as plain IP addresses, CIDR-formatted +strings, or IP/netmask strings. + +```js +proxyaddr(req, '127.0.0.1') +proxyaddr(req, ['127.0.0.0/8', '10.0.0.0/8']) +proxyaddr(req, ['127.0.0.0/255.0.0.0', '192.168.0.0/255.255.0.0']) +``` + +This module also supports IPv6. Your IPv6 addresses will be normalized +automatically (i.e. `fe80::00ed:1` equals `fe80:0:0:0:0:0:ed:1`). + +```js +proxyaddr(req, '::1') +proxyaddr(req, ['::1/128', 'fe80::/10']) +``` + +This module will automatically work with IPv4-mapped IPv6 addresses +as well to support node.js in IPv6-only mode. This means that you do +not have to specify both `::ffff:a00:1` and `10.0.0.1`. + +As a convenience, this module also takes certain pre-defined names +in addition to IP addresses, which expand into IP addresses: + +```js +proxyaddr(req, 'loopback') +proxyaddr(req, ['loopback', 'fc00:ac:1ab5:fff::1/64']) +``` + + * `loopback`: IPv4 and IPv6 loopback addresses (like `::1` and + `127.0.0.1`). + * `linklocal`: IPv4 and IPv6 link-local addresses (like + `fe80::1:1:1:1` and `169.254.0.1`). + * `uniquelocal`: IPv4 private addresses and IPv6 unique-local + addresses (like `fc00:ac:1ab5:fff::1` and `192.168.0.1`). + +When `trust` is specified as a function, it will be called for each +address to determine if it is a trusted address. The function is +given two arguments: `addr` and `i`, where `addr` is a string of +the address to check and `i` is a number that represents the distance +from the socket address. + +### proxyaddr.all(req, [trust]) + +Return all the addresses of the request, optionally stopping at the +first untrusted. This array is ordered from closest to furthest +(i.e. `arr[0] === req.connection.remoteAddress`). + +```js +proxyaddr.all(req) +``` + +The optional `trust` argument takes the same arguments as `trust` +does in `proxyaddr(req, trust)`. + +```js +proxyaddr.all(req, 'loopback') +``` + +### proxyaddr.compile(val) + +Compiles argument `val` into a `trust` function. This function takes +the same arguments as `trust` does in `proxyaddr(req, trust)` and +returns a function suitable for `proxyaddr(req, trust)`. + +```js +var trust = proxyaddr.compile('loopback') +var addr = proxyaddr(req, trust) +``` + +This function is meant to be optimized for use against every request. +It is recommend to compile a trust function up-front for the trusted +configuration and pass that to `proxyaddr(req, trust)` for each request. + +## Testing + +```sh +$ npm test +``` + +## Benchmarks + +```sh +$ npm run-script bench +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/proxy-addr/master?label=ci +[ci-url]: https://github.com/jshttp/proxy-addr/actions?query=workflow%3Aci +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/proxy-addr/master +[coveralls-url]: https://coveralls.io/r/jshttp/proxy-addr?branch=master +[node-image]: https://badgen.net/npm/node/proxy-addr +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/proxy-addr +[npm-url]: https://npmjs.org/package/proxy-addr +[npm-version-image]: https://badgen.net/npm/v/proxy-addr diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/proxy-addr/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/proxy-addr/index.js new file mode 100644 index 0000000..a909b05 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/proxy-addr/index.js @@ -0,0 +1,327 @@ +/*! + * proxy-addr + * Copyright(c) 2014-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = proxyaddr +module.exports.all = alladdrs +module.exports.compile = compile + +/** + * Module dependencies. + * @private + */ + +var forwarded = require('forwarded') +var ipaddr = require('ipaddr.js') + +/** + * Variables. + * @private + */ + +var DIGIT_REGEXP = /^[0-9]+$/ +var isip = ipaddr.isValid +var parseip = ipaddr.parse + +/** + * Pre-defined IP ranges. + * @private + */ + +var IP_RANGES = { + linklocal: ['169.254.0.0/16', 'fe80::/10'], + loopback: ['127.0.0.1/8', '::1/128'], + uniquelocal: ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', 'fc00::/7'] +} + +/** + * Get all addresses in the request, optionally stopping + * at the first untrusted. + * + * @param {Object} request + * @param {Function|Array|String} [trust] + * @public + */ + +function alladdrs (req, trust) { + // get addresses + var addrs = forwarded(req) + + if (!trust) { + // Return all addresses + return addrs + } + + if (typeof trust !== 'function') { + trust = compile(trust) + } + + for (var i = 0; i < addrs.length - 1; i++) { + if (trust(addrs[i], i)) continue + + addrs.length = i + 1 + } + + return addrs +} + +/** + * Compile argument into trust function. + * + * @param {Array|String} val + * @private + */ + +function compile (val) { + if (!val) { + throw new TypeError('argument is required') + } + + var trust + + if (typeof val === 'string') { + trust = [val] + } else if (Array.isArray(val)) { + trust = val.slice() + } else { + throw new TypeError('unsupported trust argument') + } + + for (var i = 0; i < trust.length; i++) { + val = trust[i] + + if (!Object.prototype.hasOwnProperty.call(IP_RANGES, val)) { + continue + } + + // Splice in pre-defined range + val = IP_RANGES[val] + trust.splice.apply(trust, [i, 1].concat(val)) + i += val.length - 1 + } + + return compileTrust(compileRangeSubnets(trust)) +} + +/** + * Compile `arr` elements into range subnets. + * + * @param {Array} arr + * @private + */ + +function compileRangeSubnets (arr) { + var rangeSubnets = new Array(arr.length) + + for (var i = 0; i < arr.length; i++) { + rangeSubnets[i] = parseipNotation(arr[i]) + } + + return rangeSubnets +} + +/** + * Compile range subnet array into trust function. + * + * @param {Array} rangeSubnets + * @private + */ + +function compileTrust (rangeSubnets) { + // Return optimized function based on length + var len = rangeSubnets.length + return len === 0 + ? trustNone + : len === 1 + ? trustSingle(rangeSubnets[0]) + : trustMulti(rangeSubnets) +} + +/** + * Parse IP notation string into range subnet. + * + * @param {String} note + * @private + */ + +function parseipNotation (note) { + var pos = note.lastIndexOf('/') + var str = pos !== -1 + ? note.substring(0, pos) + : note + + if (!isip(str)) { + throw new TypeError('invalid IP address: ' + str) + } + + var ip = parseip(str) + + if (pos === -1 && ip.kind() === 'ipv6' && ip.isIPv4MappedAddress()) { + // Store as IPv4 + ip = ip.toIPv4Address() + } + + var max = ip.kind() === 'ipv6' + ? 128 + : 32 + + var range = pos !== -1 + ? note.substring(pos + 1, note.length) + : null + + if (range === null) { + range = max + } else if (DIGIT_REGEXP.test(range)) { + range = parseInt(range, 10) + } else if (ip.kind() === 'ipv4' && isip(range)) { + range = parseNetmask(range) + } else { + range = null + } + + if (range <= 0 || range > max) { + throw new TypeError('invalid range on address: ' + note) + } + + return [ip, range] +} + +/** + * Parse netmask string into CIDR range. + * + * @param {String} netmask + * @private + */ + +function parseNetmask (netmask) { + var ip = parseip(netmask) + var kind = ip.kind() + + return kind === 'ipv4' + ? ip.prefixLengthFromSubnetMask() + : null +} + +/** + * Determine address of proxied request. + * + * @param {Object} request + * @param {Function|Array|String} trust + * @public + */ + +function proxyaddr (req, trust) { + if (!req) { + throw new TypeError('req argument is required') + } + + if (!trust) { + throw new TypeError('trust argument is required') + } + + var addrs = alladdrs(req, trust) + var addr = addrs[addrs.length - 1] + + return addr +} + +/** + * Static trust function to trust nothing. + * + * @private + */ + +function trustNone () { + return false +} + +/** + * Compile trust function for multiple subnets. + * + * @param {Array} subnets + * @private + */ + +function trustMulti (subnets) { + return function trust (addr) { + if (!isip(addr)) return false + + var ip = parseip(addr) + var ipconv + var kind = ip.kind() + + for (var i = 0; i < subnets.length; i++) { + var subnet = subnets[i] + var subnetip = subnet[0] + var subnetkind = subnetip.kind() + var subnetrange = subnet[1] + var trusted = ip + + if (kind !== subnetkind) { + if (subnetkind === 'ipv4' && !ip.isIPv4MappedAddress()) { + // Incompatible IP addresses + continue + } + + if (!ipconv) { + // Convert IP to match subnet IP kind + ipconv = subnetkind === 'ipv4' + ? ip.toIPv4Address() + : ip.toIPv4MappedAddress() + } + + trusted = ipconv + } + + if (trusted.match(subnetip, subnetrange)) { + return true + } + } + + return false + } +} + +/** + * Compile trust function for single subnet. + * + * @param {Object} subnet + * @private + */ + +function trustSingle (subnet) { + var subnetip = subnet[0] + var subnetkind = subnetip.kind() + var subnetisipv4 = subnetkind === 'ipv4' + var subnetrange = subnet[1] + + return function trust (addr) { + if (!isip(addr)) return false + + var ip = parseip(addr) + var kind = ip.kind() + + if (kind !== subnetkind) { + if (subnetisipv4 && !ip.isIPv4MappedAddress()) { + // Incompatible IP addresses + return false + } + + // Convert IP to match subnet IP kind + ip = subnetisipv4 + ? ip.toIPv4Address() + : ip.toIPv4MappedAddress() + } + + return ip.match(subnetip, subnetrange) + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/proxy-addr/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/proxy-addr/package.json new file mode 100644 index 0000000..24ba8f7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/proxy-addr/package.json @@ -0,0 +1,47 @@ +{ + "name": "proxy-addr", + "description": "Determine address of proxied request", + "version": "2.0.7", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "keywords": [ + "ip", + "proxy", + "x-forwarded-for" + ], + "repository": "jshttp/proxy-addr", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "devDependencies": { + "benchmark": "2.1.4", + "beautify-benchmark": "0.2.4", + "deep-equal": "1.0.1", + "eslint": "7.26.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.23.4", + "eslint-plugin-markdown": "2.2.0", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.3.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "8.4.0", + "nyc": "15.1.0" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.10" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/.travis.yml b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/.travis.yml new file mode 100644 index 0000000..5bf093e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +cache: + directories: + - ~/.npm +notifications: + email: false +node_js: + - '8' diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/LICENSE new file mode 100644 index 0000000..e83bea6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/LICENSE @@ -0,0 +1,7 @@ +The MIT License (MIT) +Copyright © 2019 Remy Sharp, https://remysharp.com +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/README.md new file mode 100644 index 0000000..5f44c62 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/README.md @@ -0,0 +1,26 @@ +# pstree.remy + +> Cross platform ps-tree (including unix flavours without ps) + +## Installation + +```shel +npm install pstree.remy +``` + +## Usage + +```js +const psTree = psTree require('pstree.remy'); + +psTree(PID, (err, pids) => { + if (err) { + console.error(err); + } + console.log(pids) +}); + +console.log(psTree.hasPS + ? "This platform has the ps shell command" + : "This platform does not have the ps shell command"); +``` diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/lib/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/lib/index.js new file mode 100644 index 0000000..743e997 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/lib/index.js @@ -0,0 +1,37 @@ +const exec = require('child_process').exec; +const tree = require('./tree'); +const utils = require('./utils'); +var hasPS = true; + +// discover if the OS has `ps`, and therefore can use psTree +exec('ps', (error) => { + module.exports.hasPS = hasPS = !error; +}); + +module.exports = function main(pid, callback) { + if (typeof pid === 'number') { + pid = pid.toString(); + } + + if (hasPS && !process.env.NO_PS) { + return tree(pid, callback); + } + + utils + .getStat() + .then(utils.tree) + .then((tree) => utils.pidsForTree(tree, pid)) + .then((res) => + callback( + null, + res.map((p) => p.PID) + ) + ) + .catch((error) => callback(error)); +}; + +if (!module.parent) { + module.exports(process.argv[2], (e, pids) => console.log(pids)); +} + +module.exports.hasPS = hasPS; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/lib/tree.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/lib/tree.js new file mode 100644 index 0000000..bac7cce --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/lib/tree.js @@ -0,0 +1,37 @@ +const spawn = require('child_process').spawn; + +module.exports = function (rootPid, callback) { + const pidsOfInterest = new Set([parseInt(rootPid, 10)]); + var output = ''; + + // *nix + const ps = spawn('ps', ['-A', '-o', 'ppid,pid']); + ps.stdout.on('data', (data) => { + output += data.toString('ascii'); + }); + + ps.on('close', () => { + try { + const res = output + .split('\n') + .slice(1) + .map((_) => _.trim()) + .reduce((acc, line) => { + const pids = line.split(/\s+/); + const ppid = parseInt(pids[0], 10); + + if (pidsOfInterest.has(ppid)) { + const pid = parseInt(pids[1], 10); + acc.push(pid); + pidsOfInterest.add(pid); + } + + return acc; + }, []); + + callback(null, res); + } catch (e) { + callback(e, null); + } + }); +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/lib/utils.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/lib/utils.js new file mode 100644 index 0000000..8fa5719 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/lib/utils.js @@ -0,0 +1,53 @@ +const spawn = require('child_process').spawn; + +module.exports = { tree, pidsForTree, getStat }; + +function getStat() { + return new Promise((resolve) => { + const command = `ls /proc | grep -E '^[0-9]+$' | xargs -I{} cat /proc/{}/stat`; + const spawned = spawn('sh', ['-c', command], { + stdio: ['pipe', 'pipe', 'pipe'], + }); + + var res = ''; + spawned.stdout.on('data', (data) => (res += data)); + spawned.on('close', () => resolve(res)); + }); +} + +function template(s) { + var stat = null; + // 'pid', 'comm', 'state', 'ppid', 'pgrp' + // %d (%s) %c %d %d + s.replace( + /(\d+) \((.*?)\)\s(.+?)\s(\d+)\s/g, + (all, PID, COMMAND, STAT, PPID) => { + stat = { PID, COMMAND, PPID, STAT }; + } + ); + + return stat; +} + +function tree(stats) { + const processes = stats.split('\n').map(template).filter(Boolean); + + return processes; +} + +function pidsForTree(tree, pid) { + if (typeof pid === 'number') { + pid = pid.toString(); + } + const parents = [pid]; + const pids = []; + + tree.forEach((proc) => { + if (parents.indexOf(proc.PPID) !== -1) { + parents.push(proc.PID); + pids.push(proc); + } + }); + + return pids; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/package.json new file mode 100644 index 0000000..35c7068 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/package.json @@ -0,0 +1,33 @@ +{ + "name": "pstree.remy", + "version": "1.1.8", + "main": "lib/index.js", + "prettier": { + "trailingComma": "es5", + "semi": true, + "singleQuote": true + }, + "scripts": { + "test": "tap tests/*.test.js", + "_prepublish": "npm test" + }, + "keywords": [ + "ps", + "pstree", + "ps tree" + ], + "author": "Remy Sharp", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/remy/pstree.git" + }, + "devDependencies": { + "tap": "^11.0.0" + }, + "directories": { + "test": "tests" + }, + "dependencies": {}, + "description": "Collects the full tree of processes from /proc" +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/tests/fixtures/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/tests/fixtures/index.js new file mode 100644 index 0000000..4cdbcb1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/tests/fixtures/index.js @@ -0,0 +1,13 @@ +const spawn = require('child_process').spawn; +function run() { + spawn( + 'sh', + ['-c', 'node -e "setInterval(() => console.log(`running`), 200)"'], + { + stdio: 'pipe', + } + ); +} + +var runCallCount = process.argv[2] || 1; +for (var i = 0; i < runCallCount; i++) run(); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/tests/fixtures/out1 b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/tests/fixtures/out1 new file mode 100644 index 0000000..abfe581 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/tests/fixtures/out1 @@ -0,0 +1,10 @@ +1 (npm) S 0 1 1 34816 1 4210944 11112 0 0 0 45 8 0 0 20 0 10 0 330296 1089871872 11809 18446744073709551615 4194304 29343848 140726436642896 0 0 0 0 4096 2072112895 0 0 0 17 0 0 0 0 0 0 31441000 31537208 37314560 140726436650815 140726436650847 140726436650847 140726436650986 0 +15 (sh) S 1 1 1 34816 1 4210688 115 0 0 0 0 0 0 0 20 0 1 0 330372 4399104 187 18446744073709551615 94374393548800 94374393655428 140722913272992 0 0 0 0 0 65538 0 0 0 17 0 0 0 0 0 0 94374395756424 94374395761184 94374404673536 140722913278928 140722913278959 140722913278959 140722913284080 0 +16 (node) S 15 1 1 34816 1 4210688 6930 103 0 0 32 2 0 0 20 0 10 0 330373 1068478464 8412 18446744073709551615 4194304 29343848 140727228046064 0 0 0 0 4096 134300162 0 0 0 17 1 0 0 1 0 0 31441000 31537208 52584448 140727228050313 140727228050383 140727228050383 140727228055530 0 +27 (sh) S 16 1 1 34816 1 4210688 111 0 0 0 0 0 0 0 20 0 1 0 330410 4399104 193 18446744073709551615 94848235986944 94848236093572 140727019991184 0 0 0 0 0 65538 0 0 0 17 1 0 0 0 0 0 94848238194568 94848238199328 94848261660672 140727019998122 140727019998165 140727019998165 140727020003312 0 +28 (node) S 27 1 1 34816 1 4210688 3576 268 0 0 12 2 0 0 20 0 10 0 330411 930213888 6760 18446744073709551615 4194304 29343848 140726559664992 0 0 0 0 4096 134300162 0 0 0 17 1 0 0 0 0 0 31441000 31537208 32591872 140726559669117 140726559669199 140726559669199 140726559674346 0 +39 (node) S 28 1 1 34816 1 4210688 47517 0 0 0 151 9 0 0 20 0 6 0 330427 985739264 31859 18446744073709551615 4194304 29343848 140737324503920 0 0 0 0 4096 134234626 0 0 0 17 0 0 0 0 0 0 31441000 31537208 51585024 140737324510060 140737324510159 140737324510159 140737324515306 0 +45 (bash) S 0 45 45 34817 50 4210944 752 256 0 0 2 0 0 0 20 0 1 0 331039 18628608 789 18446744073709551615 4194304 5242124 140724425887696 0 0 0 65536 3670020 1266777851 0 0 0 17 1 0 0 0 0 0 7341384 7388228 30310400 140724425891678 140724425891683 140724425891683 140724425891822 0 +cat: /proc/50/stat: No such file or directory +cat: /proc/51/stat: No such file or directory +52 (xargs) S 45 50 45 34817 50 4210688 179 661 0 0 0 0 0 0 20 0 1 0 331544 4608000 346 18446744073709551615 94587588550656 94587588614028 140735223856048 0 0 0 0 0 2560 0 0 0 17 1 0 0 0 0 0 94587590711464 94587590713504 94587603169280 140735223861006 140735223861035 140735223861035 140735223861225 0 diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/tests/fixtures/out2 b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/tests/fixtures/out2 new file mode 100644 index 0000000..3b31137 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/tests/fixtures/out2 @@ -0,0 +1,29 @@ +cat: /proc/4087/stat: No such file or directory +cat: /proc/4088/stat: No such file or directory +1 (init) S 0 1 1 0 -1 4210944 9227 55994 29 319 7 5 68 16 20 0 1 0 1286281 33660928 855 18446744073709551615 1 1 0 0 0 0 0 4096 536962595 0 0 0 17 4 0 0 3 0 0 0 0 0 0 0 0 0 0 +1032 (ntpd) S 1 1032 1032 0 -1 4211008 178 0 1 0 0 0 0 0 20 0 1 0 1287033 25743360 1058 18446744073709551615 1 1 0 0 0 0 0 4096 27207 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +126 (irqbalance) S 1 126 126 0 -1 1077952832 1217 0 0 0 1 6 0 0 20 0 1 0 1286749 20189184 647 18446744073709551615 1 1 0 0 0 0 0 0 3 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +181 (mysqld) S 1 181 181 0 -1 4210944 6399 0 46 0 8 6 0 0 20 0 22 0 1286761 748453888 14476 18446744073709551615 1 1 0 0 0 0 552967 4096 26345 0 0 0 17 4 0 0 10 0 0 0 0 0 0 0 0 0 0 +194 (memcached) S 1 187 187 0 -1 4210944 252 0 4 0 0 0 0 0 20 0 6 0 1286766 333221888 648 18446744073709551615 1 1 0 0 0 0 0 4096 2 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +243 (dbus-daemon) S 1 243 243 0 -1 4211008 67 0 0 0 0 0 0 0 20 0 1 0 1286779 40087552 598 18446744073709551615 1 1 0 0 0 0 0 0 16385 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +254 (rsyslogd) S 1 254 254 0 -1 4211008 107 0 0 0 2 2 0 0 20 0 3 0 1286782 186601472 696 18446744073709551615 1 1 0 0 0 0 0 16781830 1133601 0 0 0 17 5 0 0 0 0 0 0 0 0 0 0 0 0 0 +265 (systemd-logind) S 1 265 265 0 -1 4210944 276 0 2 0 0 0 0 0 20 0 1 0 1286786 35880960 720 18446744073709551615 1 1 0 0 0 0 0 0 0 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +333 (postgres) S 1 303 303 0 -1 4210688 3169 3466 15 18 0 1 1 1 20 0 1 0 1286817 156073984 5002 18446744073709551615 1 1 0 0 0 0 0 19935232 84487 0 0 0 17 5 0 0 1 0 0 0 0 0 0 0 0 0 0 +359 (postgres) S 333 359 359 0 -1 4210752 90 0 0 0 0 0 0 0 20 0 1 0 1286822 156073984 827 18446744073709551615 1 1 0 0 0 0 0 16805888 2567 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +360 (postgres) S 333 360 360 0 -1 4210752 119 0 0 0 0 0 0 0 20 0 1 0 1286822 156073984 827 18446744073709551615 1 1 0 0 0 0 0 16791554 16901 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +361 (postgres) S 333 361 361 0 -1 4210752 87 0 0 0 0 0 0 0 20 0 1 0 1286822 156073984 827 18446744073709551615 1 1 0 0 0 0 0 16791552 16903 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +362 (postgres) S 333 362 362 0 -1 4210752 292 0 3 0 0 0 0 0 20 0 1 0 1286822 156930048 1373 18446744073709551615 1 1 0 0 0 0 0 19927040 27271 0 0 0 17 5 0 0 0 0 0 0 0 0 0 0 0 0 0 +363 (postgres) S 333 363 363 0 -1 4210752 82 0 0 0 0 0 0 0 20 0 1 0 1286822 115924992 887 18446744073709551615 1 1 0 0 0 0 0 16808450 5 0 0 0 17 5 0 0 0 0 0 0 0 0 0 0 0 0 0 +4050 (npm) S 50 50 50 34817 50 4210688 5109 0 0 0 36 3 0 0 20 0 10 0 1292968 738025472 10051 18446744073709551615 4194304 33165900 140723623956256 0 0 0 0 4096 134300162 0 0 0 17 4 0 0 0 0 0 35263056 35370992 48369664 140723623964237 140723623964294 140723623964294 140723623968712 0 +4060 (sh) S 4050 50 50 34817 50 4210688 121 0 0 0 0 0 0 0 20 0 1 0 1293007 4579328 174 18446744073709551615 94347643936768 94347644049516 140735136055088 0 0 0 0 0 65538 1 0 0 17 5 0 0 0 0 0 94347646148008 94347646153216 94347660038144 140735136063095 140735136063129 140735136063129 140735136071664 0 +4061 (node) S 4060 50 50 34817 50 4210688 6501 0 0 0 42 2 0 0 20 0 6 0 1293008 705769472 10211 18446744073709551615 4194304 33165900 140730532686288 0 0 0 0 4096 2072111671 0 0 0 17 5 0 0 0 0 0 35263056 35370992 45867008 140730532695579 140730532695657 140730532695657 140730532704200 0 +4067 (node) S 4061 50 50 34817 50 4210688 6746 221 0 0 38 3 0 0 20 0 10 0 1293051 738910208 10527 18446744073709551615 4194304 33165900 140724824971632 0 0 0 0 4096 2072111671 0 0 0 17 4 0 0 0 0 0 35263056 35370992 68595712 140724824980995 140724824981063 140724824981063 140724824989640 0 +4079 (sh) S 4067 50 50 34817 50 4210688 118 0 0 0 0 0 0 0 20 0 1 0 1293092 4579328 194 18446744073709551615 94573702131712 94573702244460 140724712357120 0 0 0 0 0 65538 1 0 0 17 4 0 0 0 0 0 94573704342952 94573704348160 94573718511616 140724712361487 140724712361583 140724712361583 140724712370160 0 +4080 (node) S 4079 50 50 34817 50 4210688 2428 0 0 0 8 1 0 0 20 0 6 0 1293093 693059584 7251 18446744073709551615 4194304 33165900 140726023392816 0 0 0 0 4096 134234626 0 0 0 17 5 0 0 0 0 0 35263056 35370992 55226368 140726023396847 140726023396935 140726023396935 140726023405512 0 +4086 (sh) S 4067 50 50 34817 50 4210688 131 244 0 0 0 0 0 0 20 0 1 0 1293143 4579328 200 18446744073709551615 94347550273536 94347550386284 140737219399136 0 0 0 0 0 65538 1 0 0 17 5 0 0 0 0 0 94347552484776 94347552489984 94347554299904 140737219403308 140737219403375 140737219403375 140737219411952 0 +4089 (xargs) S 4086 50 50 34817 50 4210688 333 1924 0 0 0 0 0 0 20 0 1 0 1293143 17600512 477 18446744073709551615 4194304 4232732 140721633759248 0 0 0 0 0 0 1 0 0 17 5 0 0 0 0 0 6331920 6332980 32182272 140721633762891 140721633762920 140721633762920 140721633771497 0 +50 (bash) S 0 50 50 34817 50 4210944 43914 1032463 9 705 44 21 4213 818 20 0 1 0 1286336 42266624 3599 18446744073709551615 4194304 5173404 140732749083280 0 0 0 65536 4 1132560123 1 0 0 17 4 0 0 410 0 0 7273968 7310504 21196800 140732749086490 140732749086517 140732749086517 140732749086702 0 +79 (acpid) S 1 79 79 0 -1 4210752 46 0 0 0 0 0 0 0 20 0 1 0 1286717 4493312 407 18446744073709551615 1 1 0 0 0 0 0 4096 16391 0 0 0 17 5 0 0 0 0 0 0 0 0 0 0 0 0 0 +83 (sshd) S 1 83 83 0 -1 4210944 354 0 27 0 0 0 0 0 20 0 1 0 1286718 62873600 1290 18446744073709551615 1 1 0 0 0 0 0 4096 81925 0 0 0 17 4 0 0 30 0 0 0 0 0 0 0 0 0 0 +94 (cron) S 1 94 94 0 -1 1077952576 103 449 0 1 0 0 0 0 20 0 1 0 1286743 24240128 559 18446744073709551615 1 1 0 0 0 0 0 0 65537 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +95 (atd) S 1 95 95 0 -1 1077952576 28 0 0 0 0 0 0 0 20 0 1 0 1286743 19615744 41 18446744073709551615 1 1 0 0 0 0 0 0 81923 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/tests/index.test.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/tests/index.test.js new file mode 100644 index 0000000..50096b9 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/pstree.remy/tests/index.test.js @@ -0,0 +1,51 @@ +const tap = require('tap'); +const test = tap.test; +const readFile = require('fs').readFileSync; +const spawn = require('child_process').spawn; +const pstree = require('../'); +const { tree, pidsForTree, getStat } = require('../lib/utils'); + +if (process.platform !== 'darwin') { + test('reads from /proc', async (t) => { + const ps = await getStat(); + t.ok(ps.split('\n').length > 1); + }); +} + +test('tree for live env', async (t) => { + const pid = 4079; + const fixture = readFile(__dirname + '/fixtures/out2', 'utf8'); + const ps = await tree(fixture); + t.deepEqual( + pidsForTree(ps, pid).map((_) => _.PID), + ['4080'] + ); +}); + +function testTree(t, runCallCount) { + const sub = spawn('node', [`${__dirname}/fixtures/index.js`, runCallCount], { + stdio: 'pipe', + }); + setTimeout(() => { + const pid = sub.pid; + + pstree(pid, (error, pids) => { + pids.concat([pid]).forEach((p) => { + spawn('kill', ['-s', 'SIGTERM', p]); + }); + + // the fixture launches `sh` which launches node which is why we + // are looking for two processes. + // Important: IDKW but MacOS seems to skip the `sh` process. no idea. + t.equal(pids.length, runCallCount * 2); + t.end(); + }); + }, 1000); +} + +test('can read full process tree', (t) => { + testTree(t, 1); +}); +test('can read full process tree with multiple processes', (t) => { + testTree(t, 2); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/.editorconfig b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/.editorconfig new file mode 100644 index 0000000..dd5a8d8 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/.editorconfig @@ -0,0 +1,46 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 180 +quote_type = single + +[test/*] +max_line_length = off + +[LICENSE.md] +indent_size = off + +[*.md] +max_line_length = off + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[LICENSE] +indent_size = 2 +max_line_length = off + +[coverage/**/*] +indent_size = off +indent_style = off +indent = off +max_line_length = off + +[.nycrc] +indent_style = tab + +[tea.yaml] +indent_size = 2 diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/.github/FUNDING.yml b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/.github/FUNDING.yml new file mode 100644 index 0000000..0355f4f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/qs +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/.github/SECURITY.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/.github/SECURITY.md new file mode 100644 index 0000000..b499cb6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/.github/SECURITY.md @@ -0,0 +1,11 @@ +# Security + +Please file a private vulnerability report via GitHub, email [@ljharb](https://github.com/ljharb), or see https://tidelift.com/security if you have a potential security vulnerability to report. + +## Incident Response Plan + +Please see our [Incident Response Plan](https://github.com/ljharb/.github/blob/main/INCIDENT_RESPONSE_PLAN.md). + +## Threat Model + +Please see [THREAT_MODEL.md](./THREAT_MODEL.md). diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/.github/THREAT_MODEL.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/.github/THREAT_MODEL.md new file mode 100644 index 0000000..7e6fef1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/.github/THREAT_MODEL.md @@ -0,0 +1,78 @@ +## Threat Model for qs (querystring parsing library) + +### 1. Library Overview + +- **Library Name:** qs +- **Brief Description:** A JavaScript library for parsing and stringifying URL query strings, supporting nested objects and arrays. It is widely used in Node.js and web applications for processing query parameters[2][6][8]. +- **Key Public APIs/Functions:** `qs.parse()`, `qs.stringify()` + +### 2. Define Scope + +This threat model focuses on the core parsing and stringifying functionality, specifically the handling of nested objects and arrays, option validation, and cycle management in stringification. + +### 3. Conceptual System Diagram + +``` +Caller Application → qs.parse(input, options) → Parsing Engine → Output Object + │ + └→ Options Handling + +Caller Application → qs.stringify(obj, options) → Stringifying Engine → Output String + │ + └→ Options Handling + └→ Cycle Tracking +``` + +**Trust Boundaries:** +- **Input string (parse):** May come from untrusted sources (e.g., user input, network requests) +- **Input object (stringify):** May contain cycles, which can lead to infinite loops during stringification +- **Options:** Provided by the caller +- **Cycle Tracking:** Used only during stringification to detect and handle circular references + +### 4. Identify Assets + +- **Integrity of parsed output:** Prevent malicious manipulation of the output object structure, especially ensuring builtins/globals are not modified as a result of parse[3][4][8]. +- **Confidentiality of processed data:** Avoid leaking sensitive information through errors or output. +- **Availability/performance for host application:** Prevent crashes or resource exhaustion in the consuming application. +- **Security of host application:** Prevent the library from being a vector for attacks (e.g., prototype pollution, DoS). +- **Reputation of library:** Maintain trust by avoiding supply chain attacks and vulnerabilities[1]. + +### 5. Identify Threats + +| Component / API / Interaction | S | T | R | I | D | E | +|---------------------------------------|----|----|----|----|----|----| +| Public API Call (`parse`) | – | ✓ | – | ✓ | ✓ | ✓ | +| Public API Call (`stringify`) | – | ✓ | – | ✓ | ✓ | – | +| Options Handling | ✓ | ✓ | – | ✓ | – | ✓ | +| Dependency Interaction | – | – | – | – | ✓ | – | + +**Key Threats:** +- **Tampering:** Malicious input can, if not prevented, alter parsed output (e.g., prototype pollution via `__proto__`, modification of builtins/globals)[3][4][8]. +- **Information Disclosure:** Error messages may expose internal details or sensitive data. +- **Denial of Service:** Large or malformed input can exhaust memory or CPU. +- **Elevation of Privilege:** Prototype pollution can lead to unintended privilege escalation in the host application[3][4][8]. + +### 6. Mitigation/Countermeasures + +| Threat Identified | Proposed Mitigation | +|---------------------------------------------------|---------------------| +| Tampering (malicious input, prototype pollution) | Strict input validation; keep `allowPrototypes: false` by default; use `plainObjects` for output; ensure builtins/globals are never modified by parse[4][8]. | +| Information Disclosure (error messages) | Generic error messages without stack traces or internal paths. | +| Denial of Service (memory/CPU exhaustion) | Enforce `arrayLimit` and `parameterLimit` with safe defaults; enable `throwOnLimitExceeded`; limit nesting depth[7]. | +| Elevation of Privilege (prototype pollution) | Keep `allowPrototypes: false`; validate options against allowlist; use `plainObjects` to avoid prototype pollution[4][8]. | + +### 7. Risk Ranking + +- **High:** Denial of Service via array parsing or malformed input (historical vulnerability) +- **Medium:** Prototype pollution via options or input (if `allowPrototypes` enabled) +- **Low:** Information disclosure in errors + +### 8. Next Steps & Review + +1. **Audit option validation logic.** +2. **Add depth limiting to nested parsing and stringification.** +3. **Implement fuzz testing for parser and stringifier edge cases.** +4. **Regularly review dependencies for vulnerabilities.** +5. **Keep documentation and threat model up to date.** +6. **Ensure builtins/globals are never modified as a result of parse.** +7. **Support round-trip consistency between parse and stringify as a non-security goal, with the right options[5][9].** diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/.nycrc b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/.nycrc new file mode 100644 index 0000000..1d57cab --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "dist" + ] +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/CHANGELOG.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/CHANGELOG.md new file mode 100644 index 0000000..66f3179 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/CHANGELOG.md @@ -0,0 +1,806 @@ +## **6.15.0** +- [New] `parse`: add `strictMerge` option to wrap object/primitive conflicts in an array (#425, #122) +- [Fix] `duplicates` option should not apply to bracket notation keys (#514) + +## **6.14.2** +- [Fix] `parse`: mark overflow objects for indexed notation exceeding `arrayLimit` (#546) +- [Fix] `arrayLimit` means max count, not max index, in `combine`/`merge`/`parseArrayValue` +- [Fix] `parse`: throw on `arrayLimit` exceeded with indexed notation when `throwOnLimitExceeded` is true (#529) +- [Fix] `parse`: enforce `arrayLimit` on `comma`-parsed values +- [Fix] `parse`: fix error message to reflect arrayLimit as max index; remove extraneous comments (#545) +- [Robustness] avoid `.push`, use `void` +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [meta] fix changelog typo (`arrayLength` → `arrayLimit`) +- [actions] fix rebase workflow permissions + +## **6.14.1** +- [Fix] ensure `arrayLimit` applies to `[]` notation as well +- [Fix] `parse`: when a custom decoder returns `null` for a key, ignore that key +- [Refactor] `parse`: extract key segment splitting helper +- [meta] add threat model +- [actions] add workflow permissions +- [Tests] `stringify`: increase coverage +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `npmignore`, `es-value-fixtures`, `for-each`, `object-inspect` + +## **6.14.0** +- [New] `parse`: add `throwOnParameterLimitExceeded` option (#517) +- [Refactor] `parse`: use `utils.combine` more +- [patch] `parse`: add explicit `throwOnLimitExceeded` default +- [actions] use shared action; re-add finishers +- [meta] Fix changelog formatting bug +- [Deps] update `side-channel` +- [Dev Deps] update `es-value-fixtures`, `has-bigints`, `has-proto`, `has-symbols` +- [Tests] increase coverage + +## **6.13.3** +[Fix] fix regressions from robustness refactor +[actions] update reusable workflows + +## **6.13.2** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.13.1** +- [Fix] `stringify`: avoid a crash when a `filter` key is `null` +- [Fix] `utils.merge`: functions should not be stringified into keys +- [Fix] `parse`: avoid a crash with interpretNumericEntities: true, comma: true, and iso charset +- [Fix] `stringify`: ensure a non-string `filter` does not crash +- [Refactor] use `__proto__` syntax instead of `Object.create` for null objects +- [Refactor] misc cleanup +- [Tests] `utils.merge`: add some coverage +- [Tests] fix a test case +- [actions] split out node 10-20, and 20+ +- [Dev Deps] update `es-value-fixtures`, `mock-property`, `object-inspect`, `tape` + +## **6.13.0** +- [New] `parse`: add `strictDepth` option (#511) +- [Tests] use `npm audit` instead of `aud` + +## **6.12.5** +- [Fix] fix regressions from robustness refactor +- [actions] update reusable workflows + +## **6.12.4** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.12.3** +- [Fix] `parse`: properly account for `strictNullHandling` when `allowEmptyArrays` +- [meta] fix changelog indentation + +## **6.12.2** +- [Fix] `parse`: parse encoded square brackets (#506) +- [readme] add CII best practices badge + +## **6.12.1** +- [Fix] `parse`: Disable `decodeDotInKeys` by default to restore previous behavior (#501) +- [Performance] `utils`: Optimize performance under large data volumes, reduce memory usage, and speed up processing (#502) +- [Refactor] `utils`: use `+=` +- [Tests] increase coverage + +## **6.12.0** + +- [New] `parse`/`stringify`: add `decodeDotInKeys`/`encodeDotKeys` options (#488) +- [New] `parse`: add `duplicates` option +- [New] `parse`/`stringify`: add `allowEmptyArrays` option to allow [] in object values (#487) +- [Refactor] `parse`/`stringify`: move allowDots config logic to its own variable +- [Refactor] `stringify`: move option-handling code into `normalizeStringifyOptions` +- [readme] update readme, add logos (#484) +- [readme] `stringify`: clarify default `arrayFormat` behavior +- [readme] fix line wrapping +- [readme] remove dead badges +- [Deps] update `side-channel` +- [meta] make the dist build 50% smaller +- [meta] add `sideEffects` flag +- [meta] run build in prepack, not prepublish +- [Tests] `parse`: remove useless tests; add coverage +- [Tests] `stringify`: increase coverage +- [Tests] use `mock-property` +- [Tests] `stringify`: improve coverage +- [Dev Deps] update `@ljharb/eslint-config `, `aud`, `has-override-mistake`, `has-property-descriptors`, `mock-property`, `npmignore`, `object-inspect`, `tape` +- [Dev Deps] pin `glob`, since v10.3.8+ requires a broken `jackspeak` +- [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6 + +## **6.11.4** +- [Fix] fix regressions from robustness refactor +- [actions] update reusable workflows + +## **6.11.3** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.11.2** +- [Fix] `parse`: Fix parsing when the global Object prototype is frozen (#473) +- [Tests] add passing test cases with empty keys (#473) + +## **6.11.1** +- [Fix] `stringify`: encode comma values more consistently (#463) +- [readme] add usage of `filter` option for injecting custom serialization, i.e. of custom types (#447) +- [meta] remove extraneous code backticks (#457) +- [meta] fix changelog markdown +- [actions] update checkout action +- [actions] restrict action permissions +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` + +## **6.11.0** +- [New] [Fix] `stringify`: revert 0e903c0; add `commaRoundTrip` option (#442) +- [readme] fix version badge + +## **6.10.7** +- [Fix] fix regressions from robustness refactor +- [actions] update reusable workflows + +## **6.10.6** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.10.5** +- [Fix] `stringify`: with `arrayFormat: comma`, properly include an explicit `[]` on a single-item array (#434) + +## **6.10.4** +- [Fix] `stringify`: with `arrayFormat: comma`, include an explicit `[]` on a single-item array (#441) +- [meta] use `npmignore` to autogenerate an npmignore file +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbol`, `object-inspect`, `tape` + +## **6.10.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [actions] reuse common workflows +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `tape` + +## **6.10.2** +- [Fix] `stringify`: actually fix cyclic references (#426) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] add note and links for coercing primitive values (#408) +- [actions] update codecov uploader +- [actions] update workflows +- [Tests] clean up stringify tests slightly +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `safe-publish-latest`, `tape` + +## **6.10.1** +- [Fix] `stringify`: avoid exception on repeated object values (#402) + +## **6.10.0** +- [New] `stringify`: throw on cycles, instead of an infinite loop (#395, #394, #393) +- [New] `parse`: add `allowSparse` option for collapsing arrays with missing indices (#312) +- [meta] fix README.md (#399) +- [meta] only run `npm run dist` in publish, not install +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbols`, `tape` +- [Tests] fix tests on node v0.6 +- [Tests] use `ljharb/actions/node/install` instead of `ljharb/actions/node/run` +- [Tests] Revert "[meta] ignore eclint transitive audit warning" + +## **6.9.9** +- [Fix] fix regressions from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.9.8** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.9.7** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] add note and links for coercing primitive values (#408) +- [Tests] clean up stringify tests slightly +- [meta] fix README.md (#399) +- Revert "[meta] ignore eclint transitive audit warning" +- [actions] backport actions from main +- [Dev Deps] backport updates from main + +## **6.9.6** +- [Fix] restore `dist` dir; mistakenly removed in d4f6c32 + +## **6.9.5** +- [Fix] `stringify`: do not encode parens for RFC1738 +- [Fix] `stringify`: fix arrayFormat comma with empty array/objects (#350) +- [Refactor] `format`: remove `util.assign` call +- [meta] add "Allow Edits" workflow; update rebase workflow +- [actions] switch Automatic Rebase workflow to `pull_request_target` event +- [Tests] `stringify`: add tests for #378 +- [Tests] migrate tests to Github Actions +- [Tests] run `nyc` on all tests; use `tape` runner +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `mkdirp`, `object-inspect`, `tape`; add `aud` + +## **6.9.4** +- [Fix] `stringify`: when `arrayFormat` is `comma`, respect `serializeDate` (#364) +- [Refactor] `stringify`: reduce branching (part of #350) +- [Refactor] move `maybeMap` to `utils` +- [Dev Deps] update `browserify`, `tape` + +## **6.9.3** +- [Fix] proper comma parsing of URL-encoded commas (#361) +- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) + +## **6.9.2** +- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) +- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) +- [meta] ignore eclint transitive audit warning +- [meta] fix indentation in package.json +- [meta] add tidelift marketing copy +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `has-symbols`, `tape`, `mkdirp`, `iconv-lite` +- [actions] add automatic rebasing / merge commit blocking + +## **6.9.1** +- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) +- [Fix] `parse`: with comma true, do not split non-string values (#334) +- [meta] add `funding` field +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` +- [Tests] use shared travis-ci config + +## **6.9.0** +- [New] `parse`/`stringify`: Pass extra key/value argument to `decoder` (#333) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `evalmd` +- [Tests] `parse`: add passing `arrayFormat` tests +- [Tests] add `posttest` using `npx aud` to run `npm audit` without a lockfile +- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16` +- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray + +## **6.8.5** +- [Fix] fix regressions from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.8.4** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.8.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Tests] clean up stringify tests slightly +- [Docs] add note and links for coercing primitive values (#408) +- [meta] fix README.md (#399) +- [actions] backport actions from main +- [Dev Deps] backport updates from main +- [Refactor] `stringify`: reduce branching +- [meta] do not publish workflow files + +## **6.8.2** +- [Fix] proper comma parsing of URL-encoded commas (#361) +- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) + +## **6.8.1** +- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) +- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) +- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) +- [fix] `parse`: with comma true, do not split non-string values (#334) +- [meta] add tidelift marketing copy +- [meta] add `funding` field +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `has-symbols`, `iconv-lite`, `mkdirp`, `object-inspect` +- [Tests] `parse`: add passing `arrayFormat` tests +- [Tests] use shared travis-ci configs +- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray +- [actions] add automatic rebasing / merge commit blocking + +## **6.8.0** +- [New] add `depth=false` to preserve the original key; [Fix] `depth=0` should preserve the original key (#326) +- [New] [Fix] stringify symbols and bigints +- [Fix] ensure node 0.12 can stringify Symbols +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Refactor] `formats`: tiny bit of cleanup. +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `safe-publish-latest`, `iconv-lite`, `tape` +- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended (#326) +- [Tests] use `eclint` instead of `editorconfig-tools` +- [docs] readme: add security note +- [meta] add github sponsorship +- [meta] add FUNDING.yml +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause + +## **6.7.5** +- [Fix] fix regressions from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.7.4** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.7.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] add note and links for coercing primitive values (#408) +- [meta] fix README.md (#399) +- [meta] do not publish workflow files +- [actions] backport actions from main +- [Dev Deps] backport updates from main +- [Tests] use `nyc` for coverage +- [Tests] clean up stringify tests slightly + +## **6.7.2** +- [Fix] proper comma parsing of URL-encoded commas (#361) +- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) + +## **6.7.1** +- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) +- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) +- [fix] `parse`: with comma true, do not split non-string values (#334) +- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Refactor] `formats`: tiny bit of cleanup. +- readme: add security note +- [meta] add tidelift marketing copy +- [meta] add `funding` field +- [meta] add FUNDING.yml +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `iconv-lite`, `mkdirp`, `object-inspect`, `browserify` +- [Tests] `parse`: add passing `arrayFormat` tests +- [Tests] use shared travis-ci configs +- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray +- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended +- [Tests] use `eclint` instead of `editorconfig-tools` +- [actions] add automatic rebasing / merge commit blocking + +## **6.7.0** +- [New] `stringify`/`parse`: add `comma` as an `arrayFormat` option (#276, #219) +- [Fix] correctly parse nested arrays (#212) +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source, also with an array source +- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty` +- [Refactor] `utils`: `isBuffer`: small tweak; add tests +- [Refactor] use cached `Array.isArray` +- [Refactor] `parse`/`stringify`: make a function to normalize the options +- [Refactor] `utils`: reduce observable [[Get]]s +- [Refactor] `stringify`/`utils`: cache `Array.isArray` +- [Tests] always use `String(x)` over `x.toString()` +- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 +- [Tests] temporarily allow coverage to fail + +## **6.6.3** +- [Fix] fix regressions from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.6.2** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.6.1** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] correctly parse nested arrays +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty` +- [Refactor] `formats`: tiny bit of cleanup. +- [Refactor] `utils`: `isBuffer`: small tweak; add tests +- [Refactor]: `stringify`/`utils`: cache `Array.isArray` +- [Refactor] `utils`: reduce observable [[Get]]s +- [Refactor] use cached `Array.isArray` +- [Refactor] `parse`/`stringify`: make a function to normalize the options +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] do not publish workflow files +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [meta] Fixes typo in CHANGELOG.md +- [actions] backport actions from main +- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 +- [Tests] always use `String(x)` over `x.toString()` +- [Dev Deps] backport from main + +## **6.6.0** +- [New] Add support for iso-8859-1, utf8 "sentinel" and numeric entities (#268) +- [New] move two-value combine to a `utils` function (#189) +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` (#260) +- [Fix] `stringify`: do not crash in an obscure combo of `interpretNumericEntities`, a bad custom `decoder`, & `iso-8859-1` +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [Refactor] `parse`: only need to reassign the var once +- [Refactor] `parse`/`stringify`: clean up `charset` options checking; fix defaults +- [Refactor] add missing defaults +- [Refactor] `parse`: one less `concat` call +- [Refactor] `utils`: `compactQueue`: make it explicitly side-effecting +- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`, `iconv-lite`, `safe-publish-latest`, `tape` +- [Tests] up to `node` `v10.10`, `v9.11`, `v8.12`, `v6.14`, `v4.9`; pin included builds to LTS + +## **6.5.5** +- [Fix] fix regressions from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.5.4** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.5.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] correctly parse nested arrays +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Refactor] `utils`: reduce observable [[Get]]s +- [Refactor] use cached `Array.isArray` +- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [Refactor] `parse`: only need to reassign the var once +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] Clean up license text so it’s properly detected as BSD-3-Clause +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] always use `String(x)` over `x.toString()` +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.5.2** +- [Fix] use `safer-buffer` instead of `Buffer` constructor +- [Refactor] utils: `module.exports` one thing, instead of mutating `exports` (#230) +- [Dev Deps] update `browserify`, `eslint`, `iconv-lite`, `safer-buffer`, `tape`, `browserify` + +## **6.5.1** +- [Fix] Fix parsing & compacting very deep objects (#224) +- [Refactor] name utils functions +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` +- [Tests] up to `node` `v8.4`; use `nvm install-latest-npm` so newer npm doesn’t break older node +- [Tests] Use precise dist for Node.js 0.6 runtime (#225) +- [Tests] make 0.6 required, now that it’s passing +- [Tests] on `node` `v8.2`; fix npm on node 0.6 + +## **6.5.0** +- [New] add `utils.assign` +- [New] pass default encoder/decoder to custom encoder/decoder functions (#206) +- [New] `parse`/`stringify`: add `ignoreQueryPrefix`/`addQueryPrefix` options, respectively (#213) +- [Fix] Handle stringifying empty objects with addQueryPrefix (#217) +- [Fix] do not mutate `options` argument (#207) +- [Refactor] `parse`: cache index to reuse in else statement (#182) +- [Docs] add various badges to readme (#208) +- [Dev Deps] update `eslint`, `browserify`, `iconv-lite`, `tape` +- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4 +- [Tests] add `editorconfig-tools` + +## **6.4.3** +- [Fix] fix regressions from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.4.2** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [readme] replace travis CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.4.1** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] use `safer-buffer` instead of `Buffer` constructor +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Refactor] use cached `Array.isArray` +- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.4.0** +- [New] `qs.stringify`: add `encodeValuesOnly` option +- [Fix] follow `allowPrototypes` option during merge (#201, #201) +- [Fix] support keys starting with brackets (#202, #200) +- [Fix] chmod a-x +- [Dev Deps] update `eslint` +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds +- [eslint] reduce warnings + +## **6.3.5** +- [Fix] fix regressions from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.3.4** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] replace travis CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.3.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Refactor] use cached `Array.isArray` +- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] use `safer-buffer` instead of `Buffer` constructor +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.3.2** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Dev Deps] update `eslint` +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.3.1** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties (thanks, @snyk!) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `iconv-lite`, `qs-iconv`, `tape` +- [Tests] on all node minors; improve test matrix +- [Docs] document stringify option `allowDots` (#195) +- [Docs] add empty object and array values example (#195) +- [Docs] Fix minor inconsistency/typo (#192) +- [Docs] document stringify option `sort` (#191) +- [Refactor] `stringify`: throw faster with an invalid encoder +- [Refactor] remove unnecessary escapes (#184) +- Remove contributing.md, since `qs` is no longer part of `hapi` (#183) + +## **6.3.0** +- [New] Add support for RFC 1738 (#174, #173) +- [New] `stringify`: Add `serializeDate` option to customize Date serialization (#159) +- [Fix] ensure `utils.merge` handles merging two arrays +- [Refactor] only constructors should be capitalized +- [Refactor] capitalized var names are for constructors only +- [Refactor] avoid using a sparse array +- [Robustness] `formats`: cache `String#replace` +- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`; add `safe-publish-latest` +- [Tests] up to `node` `v6.8`, `v4.6`; improve test matrix +- [Tests] flesh out arrayLimit/arrayFormat tests (#107) +- [Tests] skip Object.create tests when null objects are not available +- [Tests] Turn on eslint for test files (#175) + +## **6.2.6** +- [Fix] fix regression from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.2.5** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] replace travis CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.2.4** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Refactor] use cached `Array.isArray` +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] use `safer-buffer` instead of `Buffer` constructor +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.2.3** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.2.2** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties + +## **6.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values +- [Refactor] Be explicit and use `Object.prototype.hasOwnProperty.call` +- [Tests] remove `parallelshell` since it does not reliably report failures +- [Tests] up to `node` `v6.3`, `v5.12` +- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `qs-iconv` + +## [**6.2.0**](https://github.com/ljharb/qs/issues?milestone=36&state=closed) +- [New] pass Buffers to the encoder/decoder directly (#161) +- [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160) +- [Fix] fix compacting of nested sparse arrays (#150) + +## **6.1.4** +- [Fix] fix regression from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.1.3** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] replace travis CI badge with shields.io check-runs badge + +## **6.1.2** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.1.1** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties + +## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=35&state=closed) +- [New] allowDots option for `stringify` (#151) +- [Fix] "sort" option should work at a depth of 3 or more (#151) +- [Fix] Restore `dist` directory; will be removed in v7 (#148) + +## **6.0.6** +- [Fix] fix regression from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.0.5** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] replace travis CI badge with shields.io check-runs badge + +## **6.0.4** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.0.3** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties +- [Fix] Restore `dist` directory; will be removed in v7 (#148) + +## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed) +- Revert ES6 requirement and restore support for node down to v0.8. + +## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed) +- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json + +## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed) +- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4 + +## **5.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values + +## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed) +- [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string + +## [**5.1.0**](https://github.com/ljharb/qs/issues?milestone=29&state=closed) +- [**#117**](https://github.com/ljharb/qs/issues/117) make URI encoding stringified results optional +- [**#106**](https://github.com/ljharb/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify + +## [**5.0.0**](https://github.com/ljharb/qs/issues?milestone=28&state=closed) +- [**#114**](https://github.com/ljharb/qs/issues/114) default allowDots to false +- [**#100**](https://github.com/ljharb/qs/issues/100) include dist to npm + +## [**4.0.0**](https://github.com/ljharb/qs/issues?milestone=26&state=closed) +- [**#98**](https://github.com/ljharb/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional + +## [**3.1.0**](https://github.com/ljharb/qs/issues?milestone=24&state=closed) +- [**#89**](https://github.com/ljharb/qs/issues/89) Add option to disable "Transform dot notation to bracket notation" + +## [**3.0.0**](https://github.com/ljharb/qs/issues?milestone=23&state=closed) +- [**#80**](https://github.com/ljharb/qs/issues/80) qs.parse silently drops properties +- [**#77**](https://github.com/ljharb/qs/issues/77) Perf boost +- [**#60**](https://github.com/ljharb/qs/issues/60) Add explicit option to disable array parsing +- [**#74**](https://github.com/ljharb/qs/issues/74) Bad parse when turning array into object +- [**#81**](https://github.com/ljharb/qs/issues/81) Add a `filter` option +- [**#68**](https://github.com/ljharb/qs/issues/68) Fixed issue with recursion and passing strings into objects. +- [**#66**](https://github.com/ljharb/qs/issues/66) Add mixed array and object dot notation support Closes: #47 +- [**#76**](https://github.com/ljharb/qs/issues/76) RFC 3986 +- [**#85**](https://github.com/ljharb/qs/issues/85) No equal sign +- [**#84**](https://github.com/ljharb/qs/issues/84) update license attribute + +## [**2.4.1**](https://github.com/ljharb/qs/issues?milestone=20&state=closed) +- [**#73**](https://github.com/ljharb/qs/issues/73) Property 'hasOwnProperty' of object # is not a function + +## [**2.4.0**](https://github.com/ljharb/qs/issues?milestone=19&state=closed) +- [**#70**](https://github.com/ljharb/qs/issues/70) Add arrayFormat option + +## [**2.3.3**](https://github.com/ljharb/qs/issues?milestone=18&state=closed) +- [**#59**](https://github.com/ljharb/qs/issues/59) make sure array indexes are >= 0, closes #57 +- [**#58**](https://github.com/ljharb/qs/issues/58) make qs usable for browser loader + +## [**2.3.2**](https://github.com/ljharb/qs/issues?milestone=17&state=closed) +- [**#55**](https://github.com/ljharb/qs/issues/55) allow merging a string into an object + +## [**2.3.1**](https://github.com/ljharb/qs/issues?milestone=16&state=closed) +- [**#52**](https://github.com/ljharb/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". + +## [**2.3.0**](https://github.com/ljharb/qs/issues?milestone=15&state=closed) +- [**#50**](https://github.com/ljharb/qs/issues/50) add option to omit array indices, closes #46 + +## [**2.2.5**](https://github.com/ljharb/qs/issues?milestone=14&state=closed) +- [**#39**](https://github.com/ljharb/qs/issues/39) Is there an alternative to Buffer.isBuffer? +- [**#49**](https://github.com/ljharb/qs/issues/49) refactor utils.merge, fixes #45 +- [**#41**](https://github.com/ljharb/qs/issues/41) avoid browserifying Buffer, for #39 + +## [**2.2.4**](https://github.com/ljharb/qs/issues?milestone=13&state=closed) +- [**#38**](https://github.com/ljharb/qs/issues/38) how to handle object keys beginning with a number + +## [**2.2.3**](https://github.com/ljharb/qs/issues?milestone=12&state=closed) +- [**#37**](https://github.com/ljharb/qs/issues/37) parser discards first empty value in array +- [**#36**](https://github.com/ljharb/qs/issues/36) Update to lab 4.x + +## [**2.2.2**](https://github.com/ljharb/qs/issues?milestone=11&state=closed) +- [**#33**](https://github.com/ljharb/qs/issues/33) Error when plain object in a value +- [**#34**](https://github.com/ljharb/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty +- [**#24**](https://github.com/ljharb/qs/issues/24) Changelog? Semver? + +## [**2.2.1**](https://github.com/ljharb/qs/issues?milestone=10&state=closed) +- [**#32**](https://github.com/ljharb/qs/issues/32) account for circular references properly, closes #31 +- [**#31**](https://github.com/ljharb/qs/issues/31) qs.parse stackoverflow on circular objects + +## [**2.2.0**](https://github.com/ljharb/qs/issues?milestone=9&state=closed) +- [**#26**](https://github.com/ljharb/qs/issues/26) Don't use Buffer global if it's not present +- [**#30**](https://github.com/ljharb/qs/issues/30) Bug when merging non-object values into arrays +- [**#29**](https://github.com/ljharb/qs/issues/29) Don't call Utils.clone at the top of Utils.merge +- [**#23**](https://github.com/ljharb/qs/issues/23) Ability to not limit parameters? + +## [**2.1.0**](https://github.com/ljharb/qs/issues?milestone=8&state=closed) +- [**#22**](https://github.com/ljharb/qs/issues/22) Enable using a RegExp as delimiter + +## [**2.0.0**](https://github.com/ljharb/qs/issues?milestone=7&state=closed) +- [**#18**](https://github.com/ljharb/qs/issues/18) Why is there arrayLimit? +- [**#20**](https://github.com/ljharb/qs/issues/20) Configurable parametersLimit +- [**#21**](https://github.com/ljharb/qs/issues/21) make all limits optional, for #18, for #20 + +## [**1.2.2**](https://github.com/ljharb/qs/issues?milestone=6&state=closed) +- [**#19**](https://github.com/ljharb/qs/issues/19) Don't overwrite null values + +## [**1.2.1**](https://github.com/ljharb/qs/issues?milestone=5&state=closed) +- [**#16**](https://github.com/ljharb/qs/issues/16) ignore non-string delimiters +- [**#15**](https://github.com/ljharb/qs/issues/15) Close code block + +## [**1.2.0**](https://github.com/ljharb/qs/issues?milestone=4&state=closed) +- [**#12**](https://github.com/ljharb/qs/issues/12) Add optional delim argument +- [**#13**](https://github.com/ljharb/qs/issues/13) fix #11: flattened keys in array are now correctly parsed + +## [**1.1.0**](https://github.com/ljharb/qs/issues?milestone=3&state=closed) +- [**#7**](https://github.com/ljharb/qs/issues/7) Empty values of a POST array disappear after being submitted +- [**#9**](https://github.com/ljharb/qs/issues/9) Should not omit equals signs (=) when value is null +- [**#6**](https://github.com/ljharb/qs/issues/6) Minor grammar fix in README + +## [**1.0.2**](https://github.com/ljharb/qs/issues?milestone=2&state=closed) +- [**#5**](https://github.com/ljharb/qs/issues/5) array holes incorrectly copied into object on large index diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/LICENSE.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/LICENSE.md new file mode 100644 index 0000000..fecf6b6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/LICENSE.md @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/ljharb/qs/graphs/contributors) +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/README.md new file mode 100644 index 0000000..0980c9a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/README.md @@ -0,0 +1,758 @@ +

+ qs +

+ +# qs [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/9058/badge)](https://bestpractices.coreinfrastructure.org/projects/9058) + +[![npm badge][npm-badge-png]][package-url] + +A querystring parsing and stringifying library with some added security. + +Lead Maintainer: [Jordan Harband](https://github.com/ljharb) + +The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring). + +## Usage + +```javascript +var qs = require('qs'); +var assert = require('assert'); + +var obj = qs.parse('a=c'); +assert.deepEqual(obj, { a: 'c' }); + +var str = qs.stringify(obj); +assert.equal(str, 'a=c'); +``` + +### Parsing Objects + +[](#preventEval) +```javascript +qs.parse(string, [options]); +``` + +**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`. +For example, the string `'foo[bar]=baz'` converts to: + +```javascript +assert.deepEqual(qs.parse('foo[bar]=baz'), { + foo: { + bar: 'baz' + } +}); +``` + +When using the `plainObjects` option the parsed value is returned as a null object, created via `{ __proto__: null }` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like: + +```javascript +var nullObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true }); +assert.deepEqual(nullObject, { a: { hasOwnProperty: 'b' } }); +``` + +By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. +*WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. +Always be careful with this option. + +```javascript +var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }); +assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } }); +``` + +URI encoded strings work too: + +```javascript +assert.deepEqual(qs.parse('a%5Bb%5D=c'), { + a: { b: 'c' } +}); +``` + +You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`: + +```javascript +assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), { + foo: { + bar: { + baz: 'foobarbaz' + } + } +}); +``` + +By default, when nesting objects **qs** will only parse up to 5 children deep. +This means if you attempt to parse a string like `'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: + +```javascript +var expected = { + a: { + b: { + c: { + d: { + e: { + f: { + '[g][h][i]': 'j' + } + } + } + } + } + } +}; +var string = 'a[b][c][d][e][f][g][h][i]=j'; +assert.deepEqual(qs.parse(string), expected); +``` + +This depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`: + +```javascript +var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); +assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }); +``` + +You can configure **qs** to throw an error when parsing nested input beyond this depth using the `strictDepth` option (defaulted to false): + +```javascript +try { + qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true }); +} catch (err) { + assert(err instanceof RangeError); + assert.strictEqual(err.message, 'Input depth exceeded depth option of 1 and strictDepth is true'); +} +``` + +The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. The strictDepth option adds a layer of protection by throwing an error when the limit is exceeded, allowing you to catch and handle such cases. + +For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: + +```javascript +var limited = qs.parse('a=b&c=d', { parameterLimit: 1 }); +assert.deepEqual(limited, { a: 'b' }); +``` + +If you want an error to be thrown whenever the a limit is exceeded (eg, `parameterLimit`, `arrayLimit`), set the `throwOnLimitExceeded` option to `true`. This option will generate a descriptive error if the query string exceeds a configured limit. +```javascript +try { + qs.parse('a=1&b=2&c=3&d=4', { parameterLimit: 3, throwOnLimitExceeded: true }); +} catch (err) { + assert(err instanceof Error); + assert.strictEqual(err.message, 'Parameter limit exceeded. Only 3 parameters allowed.'); +} +``` + +When `throwOnLimitExceeded` is set to `false` (default), **qs** will parse up to the specified `parameterLimit` and ignore the rest without throwing an error. + +To bypass the leading question mark, use `ignoreQueryPrefix`: + +```javascript +var prefixed = qs.parse('?a=b&c=d', { ignoreQueryPrefix: true }); +assert.deepEqual(prefixed, { a: 'b', c: 'd' }); +``` + +An optional delimiter can also be passed: + +```javascript +var delimited = qs.parse('a=b;c=d', { delimiter: ';' }); +assert.deepEqual(delimited, { a: 'b', c: 'd' }); +``` + +Delimiters can be a regular expression too: + +```javascript +var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); +assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' }); +``` + +Option `allowDots` can be used to enable dot notation: + +```javascript +var withDots = qs.parse('a.b=c', { allowDots: true }); +assert.deepEqual(withDots, { a: { b: 'c' } }); +``` + +Option `decodeDotInKeys` can be used to decode dots in keys +Note: it implies `allowDots`, so `parse` will error if you set `decodeDotInKeys` to `true`, and `allowDots` to `false`. + +```javascript +var withDots = qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { decodeDotInKeys: true }); +assert.deepEqual(withDots, { 'name.obj': { first: 'John', last: 'Doe' }}); +``` + +Option `allowEmptyArrays` can be used to allowing empty array values in object +```javascript +var withEmptyArrays = qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }); +assert.deepEqual(withEmptyArrays, { foo: [], bar: 'baz' }); +``` + +Option `duplicates` can be used to change the behavior when duplicate keys are encountered +```javascript +assert.deepEqual(qs.parse('foo=bar&foo=baz'), { foo: ['bar', 'baz'] }); +assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }), { foo: ['bar', 'baz'] }); +assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), { foo: 'bar' }); +assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), { foo: 'baz' }); +``` + +Note that keys with bracket notation (`[]`) always combine into arrays, regardless of the `duplicates` setting: +```javascript +assert.deepEqual(qs.parse('a=1&a=2&b[]=1&b[]=2', { duplicates: 'last' }), { a: '2', b: ['1', '2'] }); +``` + +If you have to deal with legacy browsers or services, there's also support for decoding percent-encoded octets as iso-8859-1: + +```javascript +var oldCharset = qs.parse('a=%A7', { charset: 'iso-8859-1' }); +assert.deepEqual(oldCharset, { a: '§' }); +``` + +Some services add an initial `utf8=✓` value to forms so that old Internet Explorer versions are more likely to submit the form as utf-8. +Additionally, the server can check the value against wrong encodings of the checkmark character and detect that a query string or `application/x-www-form-urlencoded` body was *not* sent as utf-8, eg. if the form had an `accept-charset` parameter or the containing page had a different character set. + +**qs** supports this mechanism via the `charsetSentinel` option. +If specified, the `utf8` parameter will be omitted from the returned object. +It will be used to switch to `iso-8859-1`/`utf-8` mode depending on how the checkmark is encoded. + +**Important**: When you specify both the `charset` option and the `charsetSentinel` option, the `charset` will be overridden when the request contains a `utf8` parameter from which the actual charset can be deduced. +In that sense the `charset` will behave as the default charset rather than the authoritative charset. + +```javascript +var detectedAsUtf8 = qs.parse('utf8=%E2%9C%93&a=%C3%B8', { + charset: 'iso-8859-1', + charsetSentinel: true +}); +assert.deepEqual(detectedAsUtf8, { a: 'ø' }); + +// Browsers encode the checkmark as ✓ when submitting as iso-8859-1: +var detectedAsIso8859_1 = qs.parse('utf8=%26%2310003%3B&a=%F8', { + charset: 'utf-8', + charsetSentinel: true +}); +assert.deepEqual(detectedAsIso8859_1, { a: 'ø' }); +``` + +If you want to decode the `&#...;` syntax to the actual character, you can specify the `interpretNumericEntities` option as well: + +```javascript +var detectedAsIso8859_1 = qs.parse('a=%26%239786%3B', { + charset: 'iso-8859-1', + interpretNumericEntities: true +}); +assert.deepEqual(detectedAsIso8859_1, { a: '☺' }); +``` + +It also works when the charset has been detected in `charsetSentinel` mode. + +### Parsing Arrays + +**qs** can also parse arrays using a similar `[]` notation: + +```javascript +var withArray = qs.parse('a[]=b&a[]=c'); +assert.deepEqual(withArray, { a: ['b', 'c'] }); +``` + +You may specify an index as well: + +```javascript +var withIndexes = qs.parse('a[1]=c&a[0]=b'); +assert.deepEqual(withIndexes, { a: ['b', 'c'] }); +``` + +Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number to create an array. +When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving their order: + +```javascript +var noSparse = qs.parse('a[1]=b&a[15]=c'); +assert.deepEqual(noSparse, { a: ['b', 'c'] }); +``` + +You may also use `allowSparse` option to parse sparse arrays: + +```javascript +var sparseArray = qs.parse('a[1]=2&a[3]=5', { allowSparse: true }); +assert.deepEqual(sparseArray, { a: [, '2', , '5'] }); +``` + +Note that an empty string is also a value, and will be preserved: + +```javascript +var withEmptyString = qs.parse('a[]=&a[]=b'); +assert.deepEqual(withEmptyString, { a: ['', 'b'] }); + +var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c'); +assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] }); +``` + +**qs** will also limit arrays to a maximum of `20` elements. +Any array members with an index of `20` or greater will instead be converted to an object with the index as the key. +This is needed to handle cases when someone sent, for example, `a[999999999]` and it will take significant time to iterate over this huge array. + +```javascript +var withMaxIndex = qs.parse('a[100]=b'); +assert.deepEqual(withMaxIndex, { a: { '100': 'b' } }); +``` + +This limit can be overridden by passing an `arrayLimit` option: + +```javascript +var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 }); +assert.deepEqual(withArrayLimit, { a: { '1': 'b' } }); +``` + +If you want to throw an error whenever the array limit is exceeded, set the `throwOnLimitExceeded` option to `true`. This option will generate a descriptive error if the query string exceeds a configured limit. +```javascript +try { + qs.parse('a[1]=b', { arrayLimit: 0, throwOnLimitExceeded: true }); +} catch (err) { + assert(err instanceof Error); + assert.strictEqual(err.message, 'Array limit exceeded. Only 0 elements allowed in an array.'); +} +``` + +When `throwOnLimitExceeded` is set to `false` (default), **qs** will parse up to the specified `arrayLimit` and if the limit is exceeded, the array will instead be converted to an object with the index as the key + +To prevent array syntax (`a[]`, `a[0]`) from being parsed as arrays, set `parseArrays` to `false`. +Note that duplicate keys (e.g. `a=b&a=c`) may still produce arrays when `duplicates` is `'combine'` (the default). + +```javascript +var noParsingArrays = qs.parse('a[]=b', { parseArrays: false }); +assert.deepEqual(noParsingArrays, { a: { '0': 'b' } }); +``` + +If you mix notations, **qs** will merge the two items into an object: + +```javascript +var mixedNotation = qs.parse('a[0]=b&a[b]=c'); +assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } }); +``` + +When a key appears as both a plain value and an object, **qs** will by default wrap the conflicting values in an array (`strictMerge` defaults to `true`): + +```javascript +assert.deepEqual(qs.parse('a[b]=c&a=d'), { a: [{ b: 'c' }, 'd'] }); +assert.deepEqual(qs.parse('a=d&a[b]=c'), { a: ['d', { b: 'c' }] }); +``` + +To restore the legacy behavior (where the primitive is used as a key with value `true`), set `strictMerge` to `false`: + +```javascript +assert.deepEqual(qs.parse('a[b]=c&a=d', { strictMerge: false }), { a: { b: 'c', d: true } }); +``` + +You can also create arrays of objects: + +```javascript +var arraysOfObjects = qs.parse('a[][b]=c'); +assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] }); +``` + +Some people use comma to join array, **qs** can parse it: +```javascript +var arraysOfObjects = qs.parse('a=b,c', { comma: true }) +assert.deepEqual(arraysOfObjects, { a: ['b', 'c'] }) +``` +(_this cannot convert nested objects, such as `a={b:1},{c:d}`_) + +### Parsing primitive/scalar values (numbers, booleans, null, etc) + +By default, all values are parsed as strings. +This behavior will not change and is explained in [issue #91](https://github.com/ljharb/qs/issues/91). + +```javascript +var primitiveValues = qs.parse('a=15&b=true&c=null'); +assert.deepEqual(primitiveValues, { a: '15', b: 'true', c: 'null' }); +``` + +If you wish to auto-convert values which look like numbers, booleans, and other values into their primitive counterparts, you can use the [query-types Express JS middleware](https://github.com/xpepermint/query-types) which will auto-convert all request query parameters. + +### Stringifying + +[](#preventEval) +```javascript +qs.stringify(object, [options]); +``` + +When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect: + +```javascript +assert.equal(qs.stringify({ a: 'b' }), 'a=b'); +assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); +``` + +This encoding can be disabled by setting the `encode` option to `false`: + +```javascript +var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false }); +assert.equal(unencoded, 'a[b]=c'); +``` + +Encoding can be disabled for keys by setting the `encodeValuesOnly` option to `true`: +```javascript +var encodedValues = qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true } +); +assert.equal(encodedValues,'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h'); +``` + +This encoding can also be replaced by a custom encoding method set as `encoder` option: + +```javascript +var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) { + // Passed in values `a`, `b`, `c` + return // Return encoded string +}}) +``` + +_(Note: the `encoder` option does not apply if `encode` is `false`)_ + +Analogue to the `encoder` there is a `decoder` option for `parse` to override decoding of properties and values: + +```javascript +var decoded = qs.parse('x=z', { decoder: function (str) { + // Passed in values `x`, `z` + return // Return decoded string +}}) +``` + +You can encode keys and values using different logic by using the type argument provided to the encoder: + +```javascript +var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str, defaultEncoder, charset, type) { + if (type === 'key') { + return // Encoded key + } else if (type === 'value') { + return // Encoded value + } +}}) +``` + +The type argument is also provided to the decoder: + +```javascript +var decoded = qs.parse('x=z', { decoder: function (str, defaultDecoder, charset, type) { + if (type === 'key') { + return // Decoded key + } else if (type === 'value') { + return // Decoded value + } +}}) +``` + +Examples beyond this point will be shown as though the output is not URI encoded for clarity. +Please note that the return values in these cases *will* be URI encoded during real usage. + +When arrays are stringified, they follow the `arrayFormat` option, which defaults to `indices`: + +```javascript +qs.stringify({ a: ['b', 'c', 'd'] }); +// 'a[0]=b&a[1]=c&a[2]=d' +``` + +You may override this by setting the `indices` option to `false`, or to be more explicit, the `arrayFormat` option to `repeat`: + +```javascript +qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); +// 'a=b&a=c&a=d' +``` + +You may use the `arrayFormat` option to specify the format of the output array: + +```javascript +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) +// 'a[0]=b&a[1]=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) +// 'a[]=b&a[]=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) +// 'a=b&a=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'comma' }) +// 'a=b,c' +``` + +Note: when using `arrayFormat` set to `'comma'`, you can also pass the `commaRoundTrip` option set to `true` or `false`, to append `[]` on single-item arrays, so that they can round trip through a parse. + +When objects are stringified, by default they use bracket notation: + +```javascript +qs.stringify({ a: { b: { c: 'd', e: 'f' } } }); +// 'a[b][c]=d&a[b][e]=f' +``` + +You may override this to use dot notation by setting the `allowDots` option to `true`: + +```javascript +qs.stringify({ a: { b: { c: 'd', e: 'f' } } }, { allowDots: true }); +// 'a.b.c=d&a.b.e=f' +``` + +You may encode the dot notation in the keys of object with option `encodeDotInKeys` by setting it to `true`: +Note: it implies `allowDots`, so `stringify` will error if you set `decodeDotInKeys` to `true`, and `allowDots` to `false`. +Caveat: when `encodeValuesOnly` is `true` as well as `encodeDotInKeys`, only dots in keys and nothing else will be encoded. +```javascript +qs.stringify({ "name.obj": { "first": "John", "last": "Doe" } }, { allowDots: true, encodeDotInKeys: true }) +// 'name%252Eobj.first=John&name%252Eobj.last=Doe' +``` + +You may allow empty array values by setting the `allowEmptyArrays` option to `true`: +```javascript +qs.stringify({ foo: [], bar: 'baz' }, { allowEmptyArrays: true }); +// 'foo[]&bar=baz' +``` + +Empty strings and null values will omit the value, but the equals sign (=) remains in place: + +```javascript +assert.equal(qs.stringify({ a: '' }), 'a='); +``` + +Key with no values (such as an empty object or array) will return nothing: + +```javascript +assert.equal(qs.stringify({ a: [] }), ''); +assert.equal(qs.stringify({ a: {} }), ''); +assert.equal(qs.stringify({ a: [{}] }), ''); +assert.equal(qs.stringify({ a: { b: []} }), ''); +assert.equal(qs.stringify({ a: { b: {}} }), ''); +``` + +Properties that are set to `undefined` will be omitted entirely: + +```javascript +assert.equal(qs.stringify({ a: null, b: undefined }), 'a='); +``` + +The query string may optionally be prepended with a question mark: + +```javascript +assert.equal(qs.stringify({ a: 'b', c: 'd' }, { addQueryPrefix: true }), '?a=b&c=d'); +``` + +Note that when the output is an empty string, the prefix will not be added: + +```javascript +assert.equal(qs.stringify({}, { addQueryPrefix: true }), ''); +``` + +The delimiter may be overridden with stringify as well: + +```javascript +assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); +``` + +If you only want to override the serialization of `Date` objects, you can provide a `serializeDate` option: + +```javascript +var date = new Date(7); +assert.equal(qs.stringify({ a: date }), 'a=1970-01-01T00:00:00.007Z'.replace(/:/g, '%3A')); +assert.equal( + qs.stringify({ a: date }, { serializeDate: function (d) { return d.getTime(); } }), + 'a=7' +); +``` + +You may use the `sort` option to affect the order of parameter keys: + +```javascript +function alphabeticalSort(a, b) { + return a.localeCompare(b); +} +assert.equal(qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort: alphabeticalSort }), 'a=c&b=f&z=y'); +``` + +Finally, you can use the `filter` option to restrict which keys will be included in the stringified output. +If you pass a function, it will be called for each key to obtain the replacement value. +Otherwise, if you pass an array, it will be used to select properties and array indices for stringification: + +```javascript +function filterFunc(prefix, value) { + if (prefix == 'b') { + // Return an `undefined` value to omit a property. + return; + } + if (prefix == 'e[f]') { + return value.getTime(); + } + if (prefix == 'e[g][0]') { + return value * 2; + } + return value; +} +qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc }); +// 'a=b&c=d&e[f]=123&e[g][0]=4' +qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }); +// 'a=b&e=f' +qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }); +// 'a[0]=b&a[2]=d' +``` + +You could also use `filter` to inject custom serialization for user defined types. +Consider you're working with some api that expects query strings of the format for ranges: + +``` +https://domain.com/endpoint?range=30...70 +``` + +For which you model as: + +```javascript +class Range { + constructor(from, to) { + this.from = from; + this.to = to; + } +} +``` + +You could _inject_ a custom serializer to handle values of this type: + +```javascript +qs.stringify( + { + range: new Range(30, 70), + }, + { + filter: (prefix, value) => { + if (value instanceof Range) { + return `${value.from}...${value.to}`; + } + // serialize the usual way + return value; + }, + } +); +// range=30...70 +``` + +### Handling of `null` values + +By default, `null` values are treated like empty strings: + +```javascript +var withNull = qs.stringify({ a: null, b: '' }); +assert.equal(withNull, 'a=&b='); +``` + +Parsing does not distinguish between parameters with and without equal signs. +Both are converted to empty strings. + +```javascript +var equalsInsensitive = qs.parse('a&b='); +assert.deepEqual(equalsInsensitive, { a: '', b: '' }); +``` + +To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null` +values have no `=` sign: + +```javascript +var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); +assert.equal(strictNull, 'a&b='); +``` + +To parse values without `=` back to `null` use the `strictNullHandling` flag: + +```javascript +var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true }); +assert.deepEqual(parsedStrictNull, { a: null, b: '' }); +``` + +To completely skip rendering keys with `null` values, use the `skipNulls` flag: + +```javascript +var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true }); +assert.equal(nullsSkipped, 'a=b'); +``` + +If you're communicating with legacy systems, you can switch to `iso-8859-1` using the `charset` option: + +```javascript +var iso = qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }); +assert.equal(iso, '%E6=%E6'); +``` + +Characters that don't exist in `iso-8859-1` will be converted to numeric entities, similar to what browsers do: + +```javascript +var numeric = qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }); +assert.equal(numeric, 'a=%26%239786%3B'); +``` + +You can use the `charsetSentinel` option to announce the character by including an `utf8=✓` parameter with the proper encoding if the checkmark, similar to what Ruby on Rails and others do when submitting forms. + +```javascript +var sentinel = qs.stringify({ a: '☺' }, { charsetSentinel: true }); +assert.equal(sentinel, 'utf8=%E2%9C%93&a=%E2%98%BA'); + +var isoSentinel = qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }); +assert.equal(isoSentinel, 'utf8=%26%2310003%3B&a=%E6'); +``` + +### Dealing with special character sets + +By default the encoding and decoding of characters is done in `utf-8`, and `iso-8859-1` support is also built in via the `charset` parameter. + +If you wish to encode querystrings to a different character set (i.e. +[Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the +[`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library: + +```javascript +var encoder = require('qs-iconv/encoder')('shift_jis'); +var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder }); +assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I'); +``` + +This also works for decoding of query strings: + +```javascript +var decoder = require('qs-iconv/decoder')('shift_jis'); +var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder }); +assert.deepEqual(obj, { a: 'こんにちは!' }); +``` + +### RFC 3986 and RFC 1738 space encoding + +RFC3986 used as default option and encodes ' ' to *%20* which is backward compatible. +In the same time, output can be stringified as per RFC1738 with ' ' equal to '+'. + +``` +assert.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); +assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC3986' }), 'a=b%20c'); +assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC1738' }), 'a=b+c'); +``` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +## qs for enterprise + +Available as part of the Tidelift Subscription + +The maintainers of qs and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. +Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. +[Learn more.](https://tidelift.com/subscription/pkg/npm-qs?utm_source=npm-qs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +[package-url]: https://npmjs.org/package/qs +[npm-version-svg]: https://versionbadg.es/ljharb/qs.svg +[deps-svg]: https://david-dm.org/ljharb/qs.svg +[deps-url]: https://david-dm.org/ljharb/qs +[dev-deps-svg]: https://david-dm.org/ljharb/qs/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/qs#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/qs.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/qs.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/qs.svg +[downloads-url]: https://npm-stat.com/charts.html?package=qs +[codecov-image]: https://codecov.io/gh/ljharb/qs/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/qs/ +[actions-image]: https://img.shields.io/github/check-runs/ljharb/qs/main +[actions-url]: https://github.com/ljharb/qs/actions + +## Acknowledgements + +qs logo by [NUMI](https://github.com/numi-hq/open-design): + +[NUMI Logo](https://numi.tech/?ref=qs) diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/dist/qs.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/dist/qs.js new file mode 100644 index 0000000..9cc9e70 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/dist/qs.js @@ -0,0 +1,141 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function parseQueryStringValues(e,t){var r={__proto__:null},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,t.throwOnLimitExceeded?a+1:a);if(t.throwOnLimitExceeded&&o.length>a)throw new RangeError("Parameter limit exceeded. Only "+a+" parameter"+(1===a?"":"s")+" allowed.");var l,n=-1,s=t.charset;if(t.charsetSentinel)for(l=0;l-1&&(c=isArray(c)?[c]:c),t.comma&&isArray(c)&&c.length>t.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");c=utils.combine([],c,t.arrayLimit,t.plainObjects)}if(null!==d){var f=has.call(r,d);f&&("combine"===t.duplicates||p.indexOf("[]=")>-1)?r[d]=utils.combine(r[d],c,t.arrayLimit,t.plainObjects):f&&"last"!==t.duplicates||(r[d]=c)}}return r},parseObject=function(e,t,r,i){var a=0;if(e.length>0&&"[]"===e[e.length-1]){var o=e.slice(0,-1).join("");a=Array.isArray(t)&&t[o]?t[o].length:0}for(var l=i?t:parseArrayValue(t,r,a),n=e.length-1;n>=0;--n){var s,d=e[n];if("[]"===d&&r.parseArrays)s=utils.isOverflow(l)?l:r.allowEmptyArrays&&(""===l||r.strictNullHandling&&null===l)?[]:utils.combine([],l,r.arrayLimit,r.plainObjects);else{s=r.plainObjects?{__proto__:null}:{};var c="["===d.charAt(0)&&"]"===d.charAt(d.length-1)?d.slice(1,-1):d,p=r.decodeDotInKeys?c.replace(/%2E/g,"."):c,u=parseInt(p,10),y=!isNaN(u)&&d!==p&&String(u)===p&&u>=0&&r.parseArrays;if(r.parseArrays||""!==p)if(y&&u0?g.join(",")||null:void 0}];else if(isArray(f))S=f;else{var N=Object.keys(g);S=u?N.sort(u):N}var T=l?String(r).replace(/\./g,"%2E"):String(r),O=o&&isArray(g)&&1===g.length?T+"[]":T;if(a&&isArray(g)&&0===g.length)return O+"[]";for(var k=0;k0?c+y:""}; + +},{"1":1,"46":46,"5":5}],5:[function(require,module,exports){ +"use strict";var formats=require(1),getSideChannel=require(46),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,overflowChannel=getSideChannel(),markOverflow=function markOverflow(e,r){return overflowChannel.set(e,r),e},isOverflow=function isOverflow(e){return overflowChannel.has(e)},getMaxIndex=function getMaxIndex(e){return overflowChannel.get(e)},setMaxIndex=function setMaxIndex(e,r){overflowChannel.set(e,r)},hexTable=function(){for(var e=[],r=0;r<256;++r)e[e.length]="%"+((r<16?"0":"")+r.toString(16)).toUpperCase();return e}(),compactQueue=function compactQueue(e){for(;e.length>1;){var r=e.pop(),t=r.obj[r.prop];if(isArray(t)){for(var n=[],o=0;ot.arrayLimit)return markOverflow(arrayToObject(e.concat(r),t),n);e[n]=r}else{if(!e||"object"!=typeof e)return[e,r];if(isOverflow(e)){var o=getMaxIndex(e)+1;e[o]=r,setMaxIndex(e,o)}else{if(t&&t.strictMerge)return[e,r];(t&&(t.plainObjects||t.allowPrototypes)||!has.call(Object.prototype,r))&&(e[r]=!0)}}return e}if(!e||"object"!=typeof e){if(isOverflow(r)){for(var a=Object.keys(r),i=t&&t.plainObjects?{__proto__:null,0:e}:{0:e},c=0;ct.arrayLimit?markOverflow(arrayToObject(l,t),l.length-1):l}var f=e;return isArray(e)&&!isArray(r)&&(f=arrayToObject(e,t)),isArray(e)&&isArray(r)?(r.forEach(function(r,n){if(has.call(e,n)){var o=e[n];o&&"object"==typeof o&&r&&"object"==typeof r?e[n]=merge(o,r,t):e[e.length]=r}else e[n]=r}),e):Object.keys(r).reduce(function(e,n){var o=r[n];if(has.call(e,n)?e[n]=merge(e[n],o,t):e[n]=o,isOverflow(r)&&!isOverflow(e)&&markOverflow(e,getMaxIndex(r)),isOverflow(e)){var a=parseInt(n,10);String(a)===n&&a>=0&&a>getMaxIndex(e)&&setMaxIndex(e,a)}return e},f)},assign=function assignSingleSource(e,r){return Object.keys(r).reduce(function(e,t){return e[t]=r[t],e},e)},decode=function(e,r,t){var n=e.replace(/\+/g," ");if("iso-8859-1"===t)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},limit=1024,encode=function encode(e,r,t,n,o){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===t)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var i="",c=0;c=limit?a.slice(c,c+limit):a,f=[],s=0;s=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===formats.RFC1738&&(40===u||41===u)?f[f.length]=l.charAt(s):u<128?f[f.length]=hexTable[u]:u<2048?f[f.length]=hexTable[192|u>>6]+hexTable[128|63&u]:u<55296||u>=57344?f[f.length]=hexTable[224|u>>12]+hexTable[128|u>>6&63]+hexTable[128|63&u]:(s+=1,u=65536+((1023&u)<<10|1023&l.charCodeAt(s)),f[f.length]=hexTable[240|u>>18]+hexTable[128|u>>12&63]+hexTable[128|u>>6&63]+hexTable[128|63&u])}i+=f.join("")}return i},compact=function compact(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],n=0;nt?markOverflow(arrayToObject(a,{plainObjects:n}),a.length-1):a},maybeMap=function maybeMap(e,r){if(isArray(e)){for(var t=[],n=0;n-1?callBindBasic([t]):t}; + +},{"10":10,"25":25}],25:[function(require,module,exports){ +"use strict";var undefined,$Object=require(22),$Error=require(16),$EvalError=require(15),$RangeError=require(17),$ReferenceError=require(18),$SyntaxError=require(19),$TypeError=require(20),$URIError=require(21),abs=require(34),floor=require(35),max=require(37),min=require(38),pow=require(39),round=require(40),sign=require(41),$Function=Function,getEvalledConstructor=function(r){try{return $Function('"use strict"; return ('+r+").constructor;")()}catch(r){}},$gOPD=require(30),$defineProperty=require(14),throwTypeError=function(){throw new $TypeError},ThrowTypeError=$gOPD?function(){try{return throwTypeError}catch(r){try{return $gOPD(arguments,"callee").get}catch(r){return throwTypeError}}}():throwTypeError,hasSymbols=require(31)(),getProto=require(28),$ObjectGPO=require(26),$ReflectGPO=require(27),$apply=require(8),$call=require(9),needsEval={},TypedArray="undefined"!=typeof Uint8Array&&getProto?getProto(Uint8Array):undefined,INTRINSICS={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?undefined:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?undefined:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined,"%AsyncFromSyncIteratorPrototype%":undefined,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":"undefined"==typeof Atomics?undefined:Atomics,"%BigInt%":"undefined"==typeof BigInt?undefined:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?undefined:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?undefined:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?undefined:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float16Array%":"undefined"==typeof Float16Array?undefined:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?undefined:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?undefined:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?undefined:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":"undefined"==typeof Int8Array?undefined:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?undefined:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?undefined:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined,"%JSON%":"object"==typeof JSON?JSON:undefined,"%Map%":"undefined"==typeof Map?undefined:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&hasSymbols&&getProto?getProto((new Map)[Symbol.iterator]()):undefined,"%Math%":Math,"%Number%":Number,"%Object%":$Object,"%Object.getOwnPropertyDescriptor%":$gOPD,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?undefined:Promise,"%Proxy%":"undefined"==typeof Proxy?undefined:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":"undefined"==typeof Reflect?undefined:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?undefined:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&hasSymbols&&getProto?getProto((new Set)[Symbol.iterator]()):undefined,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?undefined:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined,"%Symbol%":hasSymbols?Symbol:undefined,"%SyntaxError%":$SyntaxError,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError,"%Uint8Array%":"undefined"==typeof Uint8Array?undefined:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?undefined:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?undefined:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?undefined:Uint32Array,"%URIError%":$URIError,"%WeakMap%":"undefined"==typeof WeakMap?undefined:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?undefined:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?undefined:WeakSet,"%Function.prototype.call%":$call,"%Function.prototype.apply%":$apply,"%Object.defineProperty%":$defineProperty,"%Object.getPrototypeOf%":$ObjectGPO,"%Math.abs%":abs,"%Math.floor%":floor,"%Math.max%":max,"%Math.min%":min,"%Math.pow%":pow,"%Math.round%":round,"%Math.sign%":sign,"%Reflect.getPrototypeOf%":$ReflectGPO};if(getProto)try{null.error}catch(r){var errorProto=getProto(getProto(r));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function doEval(r){var e;if("%AsyncFunction%"===r)e=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===r)e=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===r)e=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===r){var t=doEval("%AsyncGeneratorFunction%");t&&(e=t.prototype)}else if("%AsyncIteratorPrototype%"===r){var o=doEval("%AsyncGenerator%");o&&getProto&&(e=getProto(o.prototype))}return INTRINSICS[r]=e,e},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=require(24),hasOwn=require(33),$concat=bind.call($call,Array.prototype.concat),$spliceApply=bind.call($apply,Array.prototype.splice),$replace=bind.call($call,String.prototype.replace),$strSlice=bind.call($call,String.prototype.slice),$exec=bind.call($call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function stringToPath(r){var e=$strSlice(r,0,1),t=$strSlice(r,-1);if("%"===e&&"%"!==t)throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if("%"===t&&"%"!==e)throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var o=[];return $replace(r,rePropName,function(r,e,t,n){o[o.length]=t?$replace(n,reEscapeChar,"$1"):e||r}),o},getBaseIntrinsic=function getBaseIntrinsic(r,e){var t,o=r;if(hasOwn(LEGACY_ALIASES,o)&&(o="%"+(t=LEGACY_ALIASES[o])[0]+"%"),hasOwn(INTRINSICS,o)){var n=INTRINSICS[o];if(n===needsEval&&(n=doEval(o)),void 0===n&&!e)throw new $TypeError("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:t,name:o,value:n}}throw new $SyntaxError("intrinsic "+r+" does not exist!")};module.exports=function GetIntrinsic(r,e){if("string"!=typeof r||0===r.length)throw new $TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new $TypeError('"allowMissing" argument must be a boolean');if(null===$exec(/^%?[^%]*%?$/,r))throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=stringToPath(r),o=t.length>0?t[0]:"",n=getBaseIntrinsic("%"+o+"%",e),a=n.name,i=n.value,y=!1,p=n.alias;p&&(o=p[0],$spliceApply(t,$concat([0,1],p)));for(var d=1,s=!0;d=t.length){var c=$gOPD(i,f);i=(s=!!c)&&"get"in c&&!("originalValue"in c.get)?c.get:i[f]}else s=hasOwn(i,f),i=i[f];s&&!y&&(INTRINSICS[a]=i)}}return i}; + +},{"14":14,"15":15,"16":16,"17":17,"18":18,"19":19,"20":20,"21":21,"22":22,"24":24,"26":26,"27":27,"28":28,"30":30,"31":31,"33":33,"34":34,"35":35,"37":37,"38":38,"39":39,"40":40,"41":41,"8":8,"9":9}],13:[function(require,module,exports){ +"use strict";var hasProtoAccessor,callBind=require(10),gOPD=require(30);try{hasProtoAccessor=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var desc=!!hasProtoAccessor&&gOPD&&gOPD(Object.prototype,"__proto__"),$Object=Object,$getPrototypeOf=$Object.getPrototypeOf;module.exports=desc&&"function"==typeof desc.get?callBind([desc.get]):"function"==typeof $getPrototypeOf&&function getDunder(t){return $getPrototypeOf(null==t?t:$Object(t))}; + +},{"10":10,"30":30}],30:[function(require,module,exports){ +"use strict";var $gOPD=require(29);if($gOPD)try{$gOPD([],"length")}catch(g){$gOPD=null}module.exports=$gOPD; + +},{"29":29}],14:[function(require,module,exports){ +"use strict";var $defineProperty=Object.defineProperty||!1;if($defineProperty)try{$defineProperty({},"a",{value:1})}catch(e){$defineProperty=!1}module.exports=$defineProperty; + +},{}],15:[function(require,module,exports){ +"use strict";module.exports=EvalError; + +},{}],16:[function(require,module,exports){ +"use strict";module.exports=Error; + +},{}],17:[function(require,module,exports){ +"use strict";module.exports=RangeError; + +},{}],18:[function(require,module,exports){ +"use strict";module.exports=ReferenceError; + +},{}],19:[function(require,module,exports){ +"use strict";module.exports=SyntaxError; + +},{}],21:[function(require,module,exports){ +"use strict";module.exports=URIError; + +},{}],22:[function(require,module,exports){ +"use strict";module.exports=Object; + +},{}],23:[function(require,module,exports){ +"use strict";var ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr=Object.prototype.toString,max=Math.max,funcType="[object Function]",concatty=function concatty(t,n){for(var r=[],o=0;o-1e3&&t<1e3||$test.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-$floor(-t):$floor(t);if(n!==t){var o=String(n),i=$slice.call(e,o.length+1);return $replace.call(o,r,"$&_")+"."+$replace.call($replace.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace.call(e,r,"$&_")}var utilInspect=require(6),inspectCustom=utilInspect.custom,inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null,quotes={__proto__:null,double:'"',single:"'"},quoteREs={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function wrapQuotes(t,e,r){var n=r.quoteStyle||e,o=quotes[n];return o+t+o}function quote(t){return $replace.call(String(t),/"/g,""")}function canTrustToString(t){return!toStringTag||!("object"==typeof t&&(toStringTag in t||void 0!==t[toStringTag]))}function isArray(t){return"[object Array]"===toStr(t)&&canTrustToString(t)}function isDate(t){return"[object Date]"===toStr(t)&&canTrustToString(t)}function isRegExp(t){return"[object RegExp]"===toStr(t)&&canTrustToString(t)}function isError(t){return"[object Error]"===toStr(t)&&canTrustToString(t)}function isString(t){return"[object String]"===toStr(t)&&canTrustToString(t)}function isNumber(t){return"[object Number]"===toStr(t)&&canTrustToString(t)}function isBoolean(t){return"[object Boolean]"===toStr(t)&&canTrustToString(t)}function isSymbol(t){if(hasShammedSymbols)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!symToString)return!1;try{return symToString.call(t),!0}catch(t){}return!1}function isBigInt(t){if(!t||"object"!=typeof t||!bigIntValueOf)return!1;try{return bigIntValueOf.call(t),!0}catch(t){}return!1}module.exports=function inspect_(t,e,r,n){var o=e||{};if(has(o,"quoteStyle")&&!has(quotes,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has(o,"maxStringLength")&&("number"==typeof o.maxStringLength?o.maxStringLength<0&&o.maxStringLength!==1/0:null!==o.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=!has(o,"customInspect")||o.customInspect;if("boolean"!=typeof i&&"symbol"!==i)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has(o,"indent")&&null!==o.indent&&"\t"!==o.indent&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has(o,"numericSeparator")&&"boolean"!=typeof o.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return inspectString(t,o);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var c=String(t);return a?addNumericSeparator(t,c):c}if("bigint"==typeof t){var l=String(t)+"n";return a?addNumericSeparator(t,l):l}var u=void 0===o.depth?5:o.depth;if(void 0===r&&(r=0),r>=u&&u>0&&"object"==typeof t)return isArray(t)?"[Array]":"[Object]";var p=getIndent(o,r);if(void 0===n)n=[];else if(indexOf(n,t)>=0)return"[Circular]";function inspect(t,e,i){if(e&&(n=$arrSlice.call(n)).push(e),i){var a={depth:o.depth};return has(o,"quoteStyle")&&(a.quoteStyle=o.quoteStyle),inspect_(t,a,r+1,n)}return inspect_(t,o,r+1,n)}if("function"==typeof t&&!isRegExp(t)){var s=nameOf(t),f=arrObjKeys(t,inspect);return"[Function"+(s?": "+s:" (anonymous)")+"]"+(f.length>0?" { "+$join.call(f,", ")+" }":"")}if(isSymbol(t)){var y=hasShammedSymbols?$replace.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(t);return"object"!=typeof t||hasShammedSymbols?y:markBoxed(y)}if(isElement(t)){for(var S="<"+$toLowerCase.call(String(t.nodeName)),g=t.attributes||[],m=0;m"}if(isArray(t)){if(0===t.length)return"[]";var b=arrObjKeys(t,inspect);return p&&!singleLineValues(b)?"["+indentedJoin(b,p)+"]":"[ "+$join.call(b,", ")+" ]"}if(isError(t)){var h=arrObjKeys(t,inspect);return"cause"in Error.prototype||!("cause"in t)||isEnumerable.call(t,"cause")?0===h.length?"["+String(t)+"]":"{ ["+String(t)+"] "+$join.call(h,", ")+" }":"{ ["+String(t)+"] "+$join.call($concat.call("[cause]: "+inspect(t.cause),h),", ")+" }"}if("object"==typeof t&&i){if(inspectSymbol&&"function"==typeof t[inspectSymbol]&&utilInspect)return utilInspect(t,{depth:u-r});if("symbol"!==i&&"function"==typeof t.inspect)return t.inspect()}if(isMap(t)){var d=[];return mapForEach&&mapForEach.call(t,function(e,r){d.push(inspect(r,t,!0)+" => "+inspect(e,t))}),collectionOf("Map",mapSize.call(t),d,p)}if(isSet(t)){var O=[];return setForEach&&setForEach.call(t,function(e){O.push(inspect(e,t))}),collectionOf("Set",setSize.call(t),O,p)}if(isWeakMap(t))return weakCollectionOf("WeakMap");if(isWeakSet(t))return weakCollectionOf("WeakSet");if(isWeakRef(t))return weakCollectionOf("WeakRef");if(isNumber(t))return markBoxed(inspect(Number(t)));if(isBigInt(t))return markBoxed(inspect(bigIntValueOf.call(t)));if(isBoolean(t))return markBoxed(booleanValueOf.call(t));if(isString(t))return markBoxed(inspect(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||"undefined"!=typeof global&&t===global)return"{ [object globalThis] }";if(!isDate(t)&&!isRegExp(t)){var j=arrObjKeys(t,inspect),w=gPO?gPO(t)===Object.prototype:t instanceof Object||t.constructor===Object,$=t instanceof Object?"":"null prototype",v=!w&&toStringTag&&Object(t)===t&&toStringTag in t?$slice.call(toStr(t),8,-1):$?"Object":"",k=(w||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(v||$?"["+$join.call($concat.call([],v||[],$||[]),": ")+"] ":"");return 0===j.length?k+"{}":p?k+"{"+indentedJoin(j,p)+"}":k+"{ "+$join.call(j,", ")+" }"}return String(t)};var hasOwn=Object.prototype.hasOwnProperty||function(t){return t in this};function has(t,e){return hasOwn.call(t,e)}function toStr(t){return objectToString.call(t)}function nameOf(t){if(t.name)return t.name;var e=$match.call(functionToString.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function indexOf(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return inspectString($slice.call(t,0,e.maxStringLength),e)+n}var o=quoteREs[e.quoteStyle||"single"];return o.lastIndex=0,wrapQuotes($replace.call($replace.call(t,o,"\\$1"),/[\x00-\x1f]/g,lowbyte),"single",e)}function lowbyte(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+$toUpperCase.call(e.toString(16))}function markBoxed(t){return"Object("+t+")"}function weakCollectionOf(t){return t+" { ? }"}function collectionOf(t,e,r,n){return t+" ("+e+") {"+(n?indentedJoin(r,n):$join.call(r,", "))+"}"}function singleLineValues(t){for(var e=0;e=0)return!1;return!0}function getIndent(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=$join.call(Array(t.indent+1)," ")}return{base:r,prev:$join.call(Array(e+1),r)}}function indentedJoin(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+$join.call(t,","+r)+"\n"+e.prev}function arrObjKeys(t,e){var r=isArray(t),n=[];if(r){n.length=t.length;for(var o=0;o -1) { + return val.split(','); + } + + if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) { + throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); + } + + return val; +}; + +// This is what browsers will submit when the ✓ character occurs in an +// application/x-www-form-urlencoded body and the encoding of the page containing +// the form is iso-8859-1, or when the submitted form has an accept-charset +// attribute of iso-8859-1. Presumably also with other charsets that do not contain +// the ✓ character, such as us-ascii. +var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') + +// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. +var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') + +var parseValues = function parseQueryStringValues(str, options) { + var obj = { __proto__: null }; + + var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; + cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']'); + + var limit = options.parameterLimit === Infinity ? void undefined : options.parameterLimit; + var parts = cleanStr.split( + options.delimiter, + options.throwOnLimitExceeded ? limit + 1 : limit + ); + + if (options.throwOnLimitExceeded && parts.length > limit) { + throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.'); + } + + var skipIndex = -1; // Keep track of where the utf8 sentinel was found + var i; + + var charset = options.charset; + if (options.charsetSentinel) { + for (i = 0; i < parts.length; ++i) { + if (parts[i].indexOf('utf8=') === 0) { + if (parts[i] === charsetSentinel) { + charset = 'utf-8'; + } else if (parts[i] === isoSentinel) { + charset = 'iso-8859-1'; + } + skipIndex = i; + i = parts.length; // The eslint settings do not allow break; + } + } + } + + for (i = 0; i < parts.length; ++i) { + if (i === skipIndex) { + continue; + } + var part = parts[i]; + + var bracketEqualsPos = part.indexOf(']='); + var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; + + var key; + var val; + if (pos === -1) { + key = options.decoder(part, defaults.decoder, charset, 'key'); + val = options.strictNullHandling ? null : ''; + } else { + key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); + + if (key !== null) { + val = utils.maybeMap( + parseArrayValue( + part.slice(pos + 1), + options, + isArray(obj[key]) ? obj[key].length : 0 + ), + function (encodedVal) { + return options.decoder(encodedVal, defaults.decoder, charset, 'value'); + } + ); + } + } + + if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { + val = interpretNumericEntities(String(val)); + } + + if (part.indexOf('[]=') > -1) { + val = isArray(val) ? [val] : val; + } + + if (options.comma && isArray(val) && val.length > options.arrayLimit) { + if (options.throwOnLimitExceeded) { + throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); + } + val = utils.combine([], val, options.arrayLimit, options.plainObjects); + } + + if (key !== null) { + var existing = has.call(obj, key); + if (existing && (options.duplicates === 'combine' || part.indexOf('[]=') > -1)) { + obj[key] = utils.combine( + obj[key], + val, + options.arrayLimit, + options.plainObjects + ); + } else if (!existing || options.duplicates === 'last') { + obj[key] = val; + } + } + } + + return obj; +}; + +var parseObject = function (chain, val, options, valuesParsed) { + var currentArrayLength = 0; + if (chain.length > 0 && chain[chain.length - 1] === '[]') { + var parentKey = chain.slice(0, -1).join(''); + currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0; + } + + var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength); + + for (var i = chain.length - 1; i >= 0; --i) { + var obj; + var root = chain[i]; + + if (root === '[]' && options.parseArrays) { + if (utils.isOverflow(leaf)) { + // leaf is already an overflow object, preserve it + obj = leaf; + } else { + obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null)) + ? [] + : utils.combine( + [], + leaf, + options.arrayLimit, + options.plainObjects + ); + } + } else { + obj = options.plainObjects ? { __proto__: null } : {}; + var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; + var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot; + var index = parseInt(decodedRoot, 10); + var isValidArrayIndex = !isNaN(index) + && root !== decodedRoot + && String(index) === decodedRoot + && index >= 0 + && options.parseArrays; + if (!options.parseArrays && decodedRoot === '') { + obj = { 0: leaf }; + } else if (isValidArrayIndex && index < options.arrayLimit) { + obj = []; + obj[index] = leaf; + } else if (isValidArrayIndex && options.throwOnLimitExceeded) { + throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); + } else if (isValidArrayIndex) { + obj[index] = leaf; + utils.markOverflow(obj, index); + } else if (decodedRoot !== '__proto__') { + obj[decodedRoot] = leaf; + } + } + + leaf = obj; + } + + return leaf; +}; + +var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) { + var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; + + if (options.depth <= 0) { + if (!options.plainObjects && has.call(Object.prototype, key)) { + if (!options.allowPrototypes) { + return; + } + } + + return [key]; + } + + var brackets = /(\[[^[\]]*])/; + var child = /(\[[^[\]]*])/g; + + var segment = brackets.exec(key); + var parent = segment ? key.slice(0, segment.index) : key; + + var keys = []; + + if (parent) { + if (!options.plainObjects && has.call(Object.prototype, parent)) { + if (!options.allowPrototypes) { + return; + } + } + + keys[keys.length] = parent; + } + + var i = 0; + while ((segment = child.exec(key)) !== null && i < options.depth) { + i += 1; + + var segmentContent = segment[1].slice(1, -1); + if (!options.plainObjects && has.call(Object.prototype, segmentContent)) { + if (!options.allowPrototypes) { + return; + } + } + + keys[keys.length] = segment[1]; + } + + if (segment) { + if (options.strictDepth === true) { + throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true'); + } + + keys[keys.length] = '[' + key.slice(segment.index) + ']'; + } + + return keys; +}; + +var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { + if (!givenKey) { + return; + } + + var keys = splitKeyIntoSegments(givenKey, options); + + if (!keys) { + return; + } + + return parseObject(keys, val, options, valuesParsed); +}; + +var normalizeParseOptions = function normalizeParseOptions(opts) { + if (!opts) { + return defaults; + } + + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + + if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') { + throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided'); + } + + if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + + if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') { + throw new TypeError('`throwOnLimitExceeded` option must be a boolean'); + } + + var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; + + var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates; + + if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') { + throw new TypeError('The duplicates option must be either combine, first, or last'); + } + + var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + + return { + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, + allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, + arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, + decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys, + decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, + delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, + // eslint-disable-next-line no-implicit-coercion, no-extra-parens + depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, + duplicates: duplicates, + ignoreQueryPrefix: opts.ignoreQueryPrefix === true, + interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, + parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, + parseArrays: opts.parseArrays !== false, + plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, + strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth, + strictMerge: typeof opts.strictMerge === 'boolean' ? !!opts.strictMerge : defaults.strictMerge, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling, + throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false + }; +}; + +module.exports = function (str, opts) { + var options = normalizeParseOptions(opts); + + if (str === '' || str === null || typeof str === 'undefined') { + return options.plainObjects ? { __proto__: null } : {}; + } + + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; + var obj = options.plainObjects ? { __proto__: null } : {}; + + // Iterate over the keys and setup the new object + + var keys = Object.keys(tempObj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); + obj = utils.merge(obj, newObj, options); + } + + if (options.allowSparse === true) { + return obj; + } + + return utils.compact(obj); +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/lib/stringify.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/lib/stringify.js new file mode 100644 index 0000000..2666eaf --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/lib/stringify.js @@ -0,0 +1,356 @@ +'use strict'; + +var getSideChannel = require('side-channel'); +var utils = require('./utils'); +var formats = require('./formats'); +var has = Object.prototype.hasOwnProperty; + +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + comma: 'comma', + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; + }, + repeat: function repeat(prefix) { + return prefix; + } +}; + +var isArray = Array.isArray; +var push = Array.prototype.push; +var pushToArray = function (arr, valueOrArray) { + push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); +}; + +var toISO = Date.prototype.toISOString; + +var defaultFormat = formats['default']; +var defaults = { + addQueryPrefix: false, + allowDots: false, + allowEmptyArrays: false, + arrayFormat: 'indices', + charset: 'utf-8', + charsetSentinel: false, + commaRoundTrip: false, + delimiter: '&', + encode: true, + encodeDotInKeys: false, + encoder: utils.encode, + encodeValuesOnly: false, + filter: void undefined, + format: defaultFormat, + formatter: formats.formatters[defaultFormat], + // deprecated + indices: false, + serializeDate: function serializeDate(date) { + return toISO.call(date); + }, + skipNulls: false, + strictNullHandling: false +}; + +var isNonNullishPrimitive = function isNonNullishPrimitive(v) { + return typeof v === 'string' + || typeof v === 'number' + || typeof v === 'boolean' + || typeof v === 'symbol' + || typeof v === 'bigint'; +}; + +var sentinel = {}; + +var stringify = function stringify( + object, + prefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + encoder, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + sideChannel +) { + var obj = object; + + var tmpSc = sideChannel; + var step = 0; + var findFlag = false; + while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { + // Where object last appeared in the ref tree + var pos = tmpSc.get(object); + step += 1; + if (typeof pos !== 'undefined') { + if (pos === step) { + throw new RangeError('Cyclic object value'); + } else { + findFlag = true; // Break while + } + } + if (typeof tmpSc.get(sentinel) === 'undefined') { + step = 0; + } + } + + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (generateArrayPrefix === 'comma' && isArray(obj)) { + obj = utils.maybeMap(obj, function (value) { + if (value instanceof Date) { + return serializeDate(value); + } + return value; + }); + } + + if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; + } + + obj = ''; + } + + if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); + return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; + } + return [formatter(prefix) + '=' + formatter(String(obj))]; + } + + var values = []; + + if (typeof obj === 'undefined') { + return values; + } + + var objKeys; + if (generateArrayPrefix === 'comma' && isArray(obj)) { + // we need to join elements in + if (encodeValuesOnly && encoder) { + obj = utils.maybeMap(obj, encoder); + } + objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; + } else if (isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + + var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix); + + var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix; + + if (allowEmptyArrays && isArray(obj) && obj.length === 0) { + return adjustedPrefix + '[]'; + } + + for (var j = 0; j < objKeys.length; ++j) { + var key = objKeys[j]; + var value = typeof key === 'object' && key && typeof key.value !== 'undefined' + ? key.value + : obj[key]; + + if (skipNulls && value === null) { + continue; + } + + var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key); + var keyPrefix = isArray(obj) + ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix + : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']'); + + sideChannel.set(object, step); + var valueSideChannel = getSideChannel(); + valueSideChannel.set(sentinel, sideChannel); + pushToArray(values, stringify( + value, + keyPrefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + valueSideChannel + )); + } + + return values; +}; + +var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { + if (!opts) { + return defaults; + } + + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + + if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { + throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); + } + + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + + var charset = opts.charset || defaults.charset; + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + + var format = formats['default']; + if (typeof opts.format !== 'undefined') { + if (!has.call(formats.formatters, opts.format)) { + throw new TypeError('Unknown format option provided.'); + } + format = opts.format; + } + var formatter = formats.formatters[format]; + + var filter = defaults.filter; + if (typeof opts.filter === 'function' || isArray(opts.filter)) { + filter = opts.filter; + } + + var arrayFormat; + if (opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if ('indices' in opts) { + arrayFormat = opts.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = defaults.arrayFormat; + } + + if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { + throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); + } + + var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + + return { + addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + arrayFormat: arrayFormat, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + commaRoundTrip: !!opts.commaRoundTrip, + delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, + encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, + encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, + filter: filter, + format: format, + formatter: formatter, + serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, + skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, + sort: typeof opts.sort === 'function' ? opts.sort : null, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling + }; +}; + +module.exports = function (object, opts) { + var obj = object; + var options = normalizeStringifyOptions(opts); + + var objKeys; + var filter; + + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } else if (isArray(options.filter)) { + filter = options.filter; + objKeys = filter; + } + + var keys = []; + + if (typeof obj !== 'object' || obj === null) { + return ''; + } + + var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; + var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; + + if (!objKeys) { + objKeys = Object.keys(obj); + } + + if (options.sort) { + objKeys.sort(options.sort); + } + + var sideChannel = getSideChannel(); + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + var value = obj[key]; + + if (options.skipNulls && value === null) { + continue; + } + pushToArray(keys, stringify( + value, + key, + generateArrayPrefix, + commaRoundTrip, + options.allowEmptyArrays, + options.strictNullHandling, + options.skipNulls, + options.encodeDotInKeys, + options.encode ? options.encoder : null, + options.filter, + options.sort, + options.allowDots, + options.serializeDate, + options.format, + options.formatter, + options.encodeValuesOnly, + options.charset, + sideChannel + )); + } + + var joined = keys.join(options.delimiter); + var prefix = options.addQueryPrefix === true ? '?' : ''; + + if (options.charsetSentinel) { + if (options.charset === 'iso-8859-1') { + // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark + prefix += 'utf8=%26%2310003%3B&'; + } else { + // encodeURIComponent('✓') + prefix += 'utf8=%E2%9C%93&'; + } + } + + return joined.length > 0 ? prefix + joined : ''; +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/lib/utils.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/lib/utils.js new file mode 100644 index 0000000..9aa39e1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/lib/utils.js @@ -0,0 +1,342 @@ +'use strict'; + +var formats = require('./formats'); +var getSideChannel = require('side-channel'); + +var has = Object.prototype.hasOwnProperty; +var isArray = Array.isArray; + +// Track objects created from arrayLimit overflow using side-channel +// Stores the current max numeric index for O(1) lookup +var overflowChannel = getSideChannel(); + +var markOverflow = function markOverflow(obj, maxIndex) { + overflowChannel.set(obj, maxIndex); + return obj; +}; + +var isOverflow = function isOverflow(obj) { + return overflowChannel.has(obj); +}; + +var getMaxIndex = function getMaxIndex(obj) { + return overflowChannel.get(obj); +}; + +var setMaxIndex = function setMaxIndex(obj, maxIndex) { + overflowChannel.set(obj, maxIndex); +}; + +var hexTable = (function () { + var array = []; + for (var i = 0; i < 256; ++i) { + array[array.length] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase(); + } + + return array; +}()); + +var compactQueue = function compactQueue(queue) { + while (queue.length > 1) { + var item = queue.pop(); + var obj = item.obj[item.prop]; + + if (isArray(obj)) { + var compacted = []; + + for (var j = 0; j < obj.length; ++j) { + if (typeof obj[j] !== 'undefined') { + compacted[compacted.length] = obj[j]; + } + } + + item.obj[item.prop] = compacted; + } + } +}; + +var arrayToObject = function arrayToObject(source, options) { + var obj = options && options.plainObjects ? { __proto__: null } : {}; + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } + + return obj; +}; + +var merge = function merge(target, source, options) { + /* eslint no-param-reassign: 0 */ + if (!source) { + return target; + } + + if (typeof source !== 'object' && typeof source !== 'function') { + if (isArray(target)) { + var nextIndex = target.length; + if (options && typeof options.arrayLimit === 'number' && nextIndex > options.arrayLimit) { + return markOverflow(arrayToObject(target.concat(source), options), nextIndex); + } + target[nextIndex] = source; + } else if (target && typeof target === 'object') { + if (isOverflow(target)) { + // Add at next numeric index for overflow objects + var newIndex = getMaxIndex(target) + 1; + target[newIndex] = source; + setMaxIndex(target, newIndex); + } else if (options && options.strictMerge) { + return [target, source]; + } else if ( + (options && (options.plainObjects || options.allowPrototypes)) + || !has.call(Object.prototype, source) + ) { + target[source] = true; + } + } else { + return [target, source]; + } + + return target; + } + + if (!target || typeof target !== 'object') { + if (isOverflow(source)) { + // Create new object with target at 0, source values shifted by 1 + var sourceKeys = Object.keys(source); + var result = options && options.plainObjects + ? { __proto__: null, 0: target } + : { 0: target }; + for (var m = 0; m < sourceKeys.length; m++) { + var oldKey = parseInt(sourceKeys[m], 10); + result[oldKey + 1] = source[sourceKeys[m]]; + } + return markOverflow(result, getMaxIndex(source) + 1); + } + var combined = [target].concat(source); + if (options && typeof options.arrayLimit === 'number' && combined.length > options.arrayLimit) { + return markOverflow(arrayToObject(combined, options), combined.length - 1); + } + return combined; + } + + var mergeTarget = target; + if (isArray(target) && !isArray(source)) { + mergeTarget = arrayToObject(target, options); + } + + if (isArray(target) && isArray(source)) { + source.forEach(function (item, i) { + if (has.call(target, i)) { + var targetItem = target[i]; + if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { + target[i] = merge(targetItem, item, options); + } else { + target[target.length] = item; + } + } else { + target[i] = item; + } + }); + return target; + } + + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; + + if (has.call(acc, key)) { + acc[key] = merge(acc[key], value, options); + } else { + acc[key] = value; + } + + if (isOverflow(source) && !isOverflow(acc)) { + markOverflow(acc, getMaxIndex(source)); + } + if (isOverflow(acc)) { + var keyNum = parseInt(key, 10); + if (String(keyNum) === key && keyNum >= 0 && keyNum > getMaxIndex(acc)) { + setMaxIndex(acc, keyNum); + } + } + + return acc; + }, mergeTarget); +}; + +var assign = function assignSingleSource(target, source) { + return Object.keys(source).reduce(function (acc, key) { + acc[key] = source[key]; + return acc; + }, target); +}; + +var decode = function (str, defaultDecoder, charset) { + var strWithoutPlus = str.replace(/\+/g, ' '); + if (charset === 'iso-8859-1') { + // unescape never throws, no try...catch needed: + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); + } + // utf-8 + try { + return decodeURIComponent(strWithoutPlus); + } catch (e) { + return strWithoutPlus; + } +}; + +var limit = 1024; + +/* eslint operator-linebreak: [2, "before"] */ + +var encode = function encode(str, defaultEncoder, charset, kind, format) { + // This code was originally written by Brian White (mscdex) for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; + } + + var string = str; + if (typeof str === 'symbol') { + string = Symbol.prototype.toString.call(str); + } else if (typeof str !== 'string') { + string = String(str); + } + + if (charset === 'iso-8859-1') { + return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { + return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; + }); + } + + var out = ''; + for (var j = 0; j < string.length; j += limit) { + var segment = string.length >= limit ? string.slice(j, j + limit) : string; + var arr = []; + + for (var i = 0; i < segment.length; ++i) { + var c = segment.charCodeAt(i); + if ( + c === 0x2D // - + || c === 0x2E // . + || c === 0x5F // _ + || c === 0x7E // ~ + || (c >= 0x30 && c <= 0x39) // 0-9 + || (c >= 0x41 && c <= 0x5A) // a-z + || (c >= 0x61 && c <= 0x7A) // A-Z + || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) + ) { + arr[arr.length] = segment.charAt(i); + continue; + } + + if (c < 0x80) { + arr[arr.length] = hexTable[c]; + continue; + } + + if (c < 0x800) { + arr[arr.length] = hexTable[0xC0 | (c >> 6)] + + hexTable[0x80 | (c & 0x3F)]; + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + arr[arr.length] = hexTable[0xE0 | (c >> 12)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + continue; + } + + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF)); + + arr[arr.length] = hexTable[0xF0 | (c >> 18)] + + hexTable[0x80 | ((c >> 12) & 0x3F)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + } + + out += arr.join(''); + } + + return out; +}; + +var compact = function compact(value) { + var queue = [{ obj: { o: value }, prop: 'o' }]; + var refs = []; + + for (var i = 0; i < queue.length; ++i) { + var item = queue[i]; + var obj = item.obj[item.prop]; + + var keys = Object.keys(obj); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + var val = obj[key]; + if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { + queue[queue.length] = { obj: obj, prop: key }; + refs[refs.length] = val; + } + } + } + + compactQueue(queue); + + return value; +}; + +var isRegExp = function isRegExp(obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + +var isBuffer = function isBuffer(obj) { + if (!obj || typeof obj !== 'object') { + return false; + } + + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +}; + +var combine = function combine(a, b, arrayLimit, plainObjects) { + // If 'a' is already an overflow object, add to it + if (isOverflow(a)) { + var newIndex = getMaxIndex(a) + 1; + a[newIndex] = b; + setMaxIndex(a, newIndex); + return a; + } + + var result = [].concat(a, b); + if (result.length > arrayLimit) { + return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1); + } + return result; +}; + +var maybeMap = function maybeMap(val, fn) { + if (isArray(val)) { + var mapped = []; + for (var i = 0; i < val.length; i += 1) { + mapped[mapped.length] = fn(val[i]); + } + return mapped; + } + return fn(val); +}; + +module.exports = { + arrayToObject: arrayToObject, + assign: assign, + combine: combine, + compact: compact, + decode: decode, + encode: encode, + isBuffer: isBuffer, + isOverflow: isOverflow, + isRegExp: isRegExp, + markOverflow: markOverflow, + maybeMap: maybeMap, + merge: merge +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/package.json new file mode 100644 index 0000000..73edd39 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/package.json @@ -0,0 +1,94 @@ +{ + "name": "qs", + "description": "A querystring parser that supports nesting and arrays, with a depth limit", + "homepage": "https://github.com/ljharb/qs", + "version": "6.15.0", + "repository": { + "type": "git", + "url": "https://github.com/ljharb/qs.git" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "main": "lib/index.js", + "sideEffects": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "keywords": [ + "querystring", + "qs", + "query", + "url", + "parse", + "stringify" + ], + "engines": { + "node": ">=0.6" + }, + "dependencies": { + "side-channel": "^1.1.0" + }, + "devDependencies": { + "@browserify/envify": "^6.0.0", + "@browserify/uglifyify": "^6.0.0", + "@ljharb/eslint-config": "^22.1.3", + "browserify": "^16.5.2", + "bundle-collapser": "^1.4.0", + "common-shakeify": "~1.0.0", + "eclint": "^2.8.1", + "es-value-fixtures": "^1.7.1", + "eslint": "^9.39.2", + "evalmd": "^0.0.19", + "for-each": "^0.3.5", + "glob": "=10.3.7", + "has-bigints": "^1.1.0", + "has-override-mistake": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "iconv-lite": "^0.5.1", + "in-publish": "^2.0.1", + "jackspeak": "=2.1.1", + "jiti": "^0.0.0", + "mkdirp": "^0.5.5", + "mock-property": "^1.1.0", + "module-deps": "^6.2.3", + "npmignore": "^0.3.5", + "nyc": "^10.3.2", + "object-inspect": "^1.13.4", + "qs-iconv": "^1.0.4", + "safe-publish-latest": "^2.0.0", + "safer-buffer": "^2.1.2", + "tape": "^5.9.0", + "unassertify": "^3.0.1" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated && npm run dist", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run --silent readme && npm run --silent lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/**/*.js'", + "posttest": "npx npm@'>=10.2' audit --production", + "readme": "evalmd README.md", + "postlint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", + "lint": "eslint .", + "dist": "mkdirp dist && browserify --standalone Qs -g unassertify -g @browserify/envify -g [@browserify/uglifyify --mangle.keep_fnames --compress.keep_fnames --format.indent_level=1 --compress.arrows=false --compress.passes=4 --compress.typeofs=false] -p common-shakeify -p bundle-collapser/plugin lib/index.js > dist/qs.js" + }, + "license": "BSD-3-Clause", + "publishConfig": { + "ignore": [ + "!dist/*", + "bower.json", + "component.json", + ".github/workflows", + "logos", + "tea.yaml" + ] + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/test/empty-keys-cases.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/test/empty-keys-cases.js new file mode 100644 index 0000000..2b1190e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/test/empty-keys-cases.js @@ -0,0 +1,267 @@ +'use strict'; + +module.exports = { + emptyTestCases: [ + { + input: '&', + withEmptyKeys: {}, + stringifyOutput: { + brackets: '', + indices: '', + repeat: '' + }, + noEmptyKeys: {} + }, + { + input: '&&', + withEmptyKeys: {}, + stringifyOutput: { + brackets: '', + indices: '', + repeat: '' + }, + noEmptyKeys: {} + }, + { + input: '&=', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '&=&', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '&=&=', + withEmptyKeys: { '': ['', ''] }, + stringifyOutput: { + brackets: '[]=&[]=', + indices: '[0]=&[1]=', + repeat: '=&=' + }, + noEmptyKeys: {} + }, + { + input: '&=&=&', + withEmptyKeys: { '': ['', ''] }, + stringifyOutput: { + brackets: '[]=&[]=', + indices: '[0]=&[1]=', + repeat: '=&=' + }, + noEmptyKeys: {} + }, + { + input: '=', + withEmptyKeys: { '': '' }, + noEmptyKeys: {}, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + } + }, + { + input: '=&', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '=&&&', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '=&=&=&', + withEmptyKeys: { '': ['', '', ''] }, + stringifyOutput: { + brackets: '[]=&[]=&[]=', + indices: '[0]=&[1]=&[2]=', + repeat: '=&=&=' + }, + noEmptyKeys: {} + }, + { + input: '=&a[]=b&a[1]=c', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: '=a', + withEmptyKeys: { '': 'a' }, + noEmptyKeys: {}, + stringifyOutput: { + brackets: '=a', + indices: '=a', + repeat: '=a' + } + }, + { + input: 'a==a', + withEmptyKeys: { a: '=a' }, + noEmptyKeys: { a: '=a' }, + stringifyOutput: { + brackets: 'a==a', + indices: 'a==a', + repeat: 'a==a' + } + }, + { + input: '=&a[]=b', + withEmptyKeys: { '': '', a: ['b'] }, + stringifyOutput: { + brackets: '=&a[]=b', + indices: '=&a[0]=b', + repeat: '=&a=b' + }, + noEmptyKeys: { a: ['b'] } + }, + { + input: '=&a[]=b&a[]=c&a[2]=d', + withEmptyKeys: { '': '', a: ['b', 'c', 'd'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c&a[]=d', + indices: '=&a[0]=b&a[1]=c&a[2]=d', + repeat: '=&a=b&a=c&a=d' + }, + noEmptyKeys: { a: ['b', 'c', 'd'] } + }, + { + input: '=a&=b', + withEmptyKeys: { '': ['a', 'b'] }, + stringifyOutput: { + brackets: '[]=a&[]=b', + indices: '[0]=a&[1]=b', + repeat: '=a&=b' + }, + noEmptyKeys: {} + }, + { + input: '=a&foo=b', + withEmptyKeys: { '': 'a', foo: 'b' }, + noEmptyKeys: { foo: 'b' }, + stringifyOutput: { + brackets: '=a&foo=b', + indices: '=a&foo=b', + repeat: '=a&foo=b' + } + }, + { + input: 'a[]=b&a=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a[]=b&a=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a[0]=b&a=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a=b&a[]=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a=b&a[0]=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: '[]=a&[]=b& []=1', + withEmptyKeys: { '': ['a', 'b'], ' ': ['1'] }, + stringifyOutput: { + brackets: '[]=a&[]=b& []=1', + indices: '[0]=a&[1]=b& [0]=1', + repeat: '=a&=b& =1' + }, + noEmptyKeys: { 0: 'a', 1: 'b', ' ': ['1'] } + }, + { + input: '[0]=a&[1]=b&a[0]=1&a[1]=2', + withEmptyKeys: { '': ['a', 'b'], a: ['1', '2'] }, + noEmptyKeys: { 0: 'a', 1: 'b', a: ['1', '2'] }, + stringifyOutput: { + brackets: '[]=a&[]=b&a[]=1&a[]=2', + indices: '[0]=a&[1]=b&a[0]=1&a[1]=2', + repeat: '=a&=b&a=1&a=2' + } + }, + { + input: '[deep]=a&[deep]=2', + withEmptyKeys: { '': { deep: ['a', '2'] } + }, + stringifyOutput: { + brackets: '[deep][]=a&[deep][]=2', + indices: '[deep][0]=a&[deep][1]=2', + repeat: '[deep]=a&[deep]=2' + }, + noEmptyKeys: { deep: ['a', '2'] } + }, + { + input: '%5B0%5D=a&%5B1%5D=b', + withEmptyKeys: { '': ['a', 'b'] }, + stringifyOutput: { + brackets: '[]=a&[]=b', + indices: '[0]=a&[1]=b', + repeat: '=a&=b' + }, + noEmptyKeys: { 0: 'a', 1: 'b' } + } + ] +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/test/parse.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/test/parse.js new file mode 100644 index 0000000..292039d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/test/parse.js @@ -0,0 +1,1568 @@ +'use strict'; + +var test = require('tape'); +var hasPropertyDescriptors = require('has-property-descriptors')(); +var iconv = require('iconv-lite'); +var mockProperty = require('mock-property'); +var hasOverrideMistake = require('has-override-mistake')(); +var SaferBuffer = require('safer-buffer').Buffer; +var v = require('es-value-fixtures'); +var inspect = require('object-inspect'); +var emptyTestCases = require('./empty-keys-cases').emptyTestCases; +var hasProto = require('has-proto')(); + +var qs = require('../'); +var utils = require('../lib/utils'); + +test('parse()', function (t) { + t.test('parses a simple string', function (st) { + st.deepEqual(qs.parse('0=foo'), { 0: 'foo' }); + st.deepEqual(qs.parse('foo=c++'), { foo: 'c ' }); + st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } }); + st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } }); + st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } }); + st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null }); + st.deepEqual(qs.parse('foo'), { foo: '' }); + st.deepEqual(qs.parse('foo='), { foo: '' }); + st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' }); + st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' }); + st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' }); + st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' }); + st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' }); + st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null }); + st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' }); + st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), { + cht: 'p3', + chd: 't:60,40', + chs: '250x100', + chl: 'Hello|World' + }); + st.end(); + }); + + t.test('comma: false', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b,c'), { a: 'b,c' }); + st.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }); + st.end(); + }); + + t.test('comma: true', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b,c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a=c', { comma: true }), { a: ['b', 'c'] }); + st.end(); + }); + + t.test('allows enabling dot notation', function (st) { + st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' }); + st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } }); + + st.end(); + }); + + t.test('decode dot keys correctly', function (st) { + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: false, decodeDotInKeys: false }), + { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name.obj.first=John&name.obj.last=Doe', { allowDots: true, decodeDotInKeys: false }), + { name: { obj: { first: 'John', last: 'Doe' } } }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: false }), + { 'name%2Eobj': { first: 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: true }), + { 'name.obj': { first: 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys true' + ); + + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { allowDots: false, decodeDotInKeys: false } + ), + { 'name%2Eobj%2Esubobject.first%2Egodly%2Ename': 'John', 'name%2Eobj%2Esubobject.last': 'Doe' }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse( + 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', + { allowDots: true, decodeDotInKeys: false } + ), + { name: { obj: { subobject: { first: { godly: { name: 'John' } }, last: 'Doe' } } } }, + 'with allowDots true and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { allowDots: true, decodeDotInKeys: true } + ), + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys true' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe'), + { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, + 'with allowDots and decodeDotInKeys undefined' + ); + + st.end(); + }); + + t.test('decodes dot in key of object, and allow enabling dot notation when decodeDotInKeys is set to true and allowDots is undefined', function (st) { + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { decodeDotInKeys: true } + ), + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + 'with allowDots undefined and decodeDotInKeys true' + ); + + st.end(); + }); + + t.test('throws when decodeDotInKeys is not of type boolean', function (st) { + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 0 }); }, + TypeError + ); + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allows empty arrays in obj values', function (st) { + st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }), { foo: [], bar: 'baz' }); + st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: false }), { foo: [''], bar: 'baz' }); + + st.end(); + }); + + t.test('throws when allowEmptyArrays is not of type boolean', function (st) { + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 0 }); }, + TypeError + ); + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allowEmptyArrays + strictNullHandling', function (st) { + st.deepEqual( + qs.parse('testEmptyArray[]', { strictNullHandling: true, allowEmptyArrays: true }), + { testEmptyArray: [] } + ); + + st.end(); + }); + + t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string'); + t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string'); + t.deepEqual( + qs.parse('a[b][c][d][e][f][g][h]=i'), + { a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }, + 'defaults to a depth of 5' + ); + + t.test('only parses one level when depth = 1', function (st) { + st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } }); + st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } }); + st.end(); + }); + + t.test('uses original key when depth = 0', function (st) { + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: 0 }), { 'a[0]': 'b', 'a[1]': 'c' }); + st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: 0 }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); + st.end(); + }); + + t.test('uses original key when depth = false', function (st) { + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: false }), { 'a[0]': 'b', 'a[1]': 'c' }); + st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: false }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); + st.end(); + }); + + t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array'); + + t.test('parses an explicit array', function (st) { + st.deepEqual(qs.parse('a[]=b'), { a: ['b'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] }); + st.end(); + }); + + t.test('parses a mix of simple and explicit arrays', function (st) { + st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] }); + + st.deepEqual(qs.parse('a[1]=b&a=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); + st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); + + st.deepEqual(qs.parse('a=b&a[1]=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); + st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); + + st.end(); + }); + + t.test('parses a nested array', function (st) { + st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } }); + st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } }); + st.end(); + }); + + t.test('allows to specify array indices', function (st) { + st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] }); + st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 20 }), { a: ['c'] }); + st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 0 }), { a: { 1: 'c' } }); + st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] }); + st.end(); + }); + + t.test('limits specific array indices to arrayLimit', function (st) { + st.deepEqual(qs.parse('a[19]=a', { arrayLimit: 20 }), { a: ['a'] }); + st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: { 20: 'a' } }); + + st.deepEqual(qs.parse('a[19]=a'), { a: ['a'] }); + st.deepEqual(qs.parse('a[20]=a'), { a: { 20: 'a' } }); + st.end(); + }); + + t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number'); + + t.test('supports encoded = signs', function (st) { + st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' }); + st.end(); + }); + + t.test('is ok with url encoded strings', function (st) { + st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } }); + st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } }); + st.end(); + }); + + t.test('allows brackets in the value', function (st) { + st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' }); + st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' }); + st.end(); + }); + + t.test('allows empty values', function (st) { + st.deepEqual(qs.parse(''), {}); + st.deepEqual(qs.parse(null), {}); + st.deepEqual(qs.parse(undefined), {}); + st.end(); + }); + + t.test('transforms arrays to objects', function (st) { + st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); + st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { 0: 'b', t: 'u' } }); + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { 0: 'b', t: 'u', hasOwnProperty: 'c' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { 0: 'b', x: 'y' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { 0: 'b', hasOwnProperty: 'c', x: 'y' } }); + st.end(); + }); + + t.test('transforms arrays to objects (dot notation)', function (st) { + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); + st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] }); + st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); + st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + st.end(); + }); + + t.test('correctly prunes undefined values when converting an array to an object', function (st) { + st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { 2: 'b', 99999999: 'c' } }); + st.end(); + }); + + t.test('supports malformed uri characters', function (st) { + st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null }); + st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' }); + st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' }); + st.end(); + }); + + t.test('doesn\'t produce empty keys', function (st) { + st.deepEqual(qs.parse('_r=1&'), { _r: '1' }); + st.end(); + }); + + t.test('cannot access Object prototype', function (st) { + qs.parse('constructor[prototype][bad]=bad'); + qs.parse('bad[constructor][prototype][bad]=bad'); + st.equal(typeof Object.prototype.bad, 'undefined'); + st.end(); + }); + + t.test('parses arrays of objects', function (st) { + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); + st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] }); + st.end(); + }); + + t.test('allows for empty strings in arrays', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] }); + + st.deepEqual( + qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 20 + array indices: null then empty string works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }), + { a: { 0: 'b', 1: null, 2: 'c', 3: '' } }, + 'with arrayLimit 0 + array brackets: null then empty string works' + ); + + st.deepEqual( + qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 20 + array indices: empty string then null works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }), + { a: { 0: 'b', 1: '', 2: 'c', 3: null } }, + 'with arrayLimit 0 + array brackets: empty string then null works' + ); + + st.deepEqual( + qs.parse('a[]=&a[]=b&a[]=c'), + { a: ['', 'b', 'c'] }, + 'array brackets: empty strings work' + ); + st.end(); + }); + + t.test('compacts sparse arrays', function (st) { + st.deepEqual(qs.parse('a[10]=1&a[2]=2', { arrayLimit: 20 }), { a: ['2', '1'] }); + st.deepEqual(qs.parse('a[1][b][2][c]=1', { arrayLimit: 20 }), { a: [{ b: [{ c: '1' }] }] }); + st.deepEqual(qs.parse('a[1][2][3][c]=1', { arrayLimit: 20 }), { a: [[[{ c: '1' }]]] }); + st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { arrayLimit: 20 }), { a: [[[{ c: ['1'] }]]] }); + st.end(); + }); + + t.test('parses sparse arrays', function (st) { + /* eslint no-sparse-arrays: 0 */ + st.deepEqual(qs.parse('a[4]=1&a[1]=2', { allowSparse: true }), { a: [, '2', , , '1'] }); + st.deepEqual(qs.parse('a[1][b][2][c]=1', { allowSparse: true }), { a: [, { b: [, , { c: '1' }] }] }); + st.deepEqual(qs.parse('a[1][2][3][c]=1', { allowSparse: true }), { a: [, [, , [, , , { c: '1' }]]] }); + st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { allowSparse: true }), { a: [, [, , [, , , { c: [, '1'] }]]] }); + st.end(); + }); + + t.test('parses semi-parsed strings', function (st) { + st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } }); + st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } }); + st.end(); + }); + + t.test('parses buffers correctly', function (st) { + var b = SaferBuffer.from('test'); + st.deepEqual(qs.parse({ a: b }), { a: b }); + st.end(); + }); + + t.test('parses jquery-param strings', function (st) { + // readable = 'filter[0][]=int1&filter[0][]==&filter[0][]=77&filter[]=and&filter[2][]=int2&filter[2][]==&filter[2][]=8' + var encoded = 'filter%5B0%5D%5B%5D=int1&filter%5B0%5D%5B%5D=%3D&filter%5B0%5D%5B%5D=77&filter%5B%5D=and&filter%5B2%5D%5B%5D=int2&filter%5B2%5D%5B%5D=%3D&filter%5B2%5D%5B%5D=8'; + var expected = { filter: [['int1', '=', '77'], 'and', ['int2', '=', '8']] }; + st.deepEqual(qs.parse(encoded), expected); + st.end(); + }); + + t.test('continues parsing when no parent is found', function (st) { + st.deepEqual(qs.parse('[]=&a=b'), { 0: '', a: 'b' }); + st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { 0: null, a: 'b' }); + st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' }); + st.end(); + }); + + t.test('does not error when parsing a very long array', function (st) { + var str = 'a[]=a'; + while (Buffer.byteLength(str) < 128 * 1024) { + str = str + '&' + str; + } + + st.doesNotThrow(function () { + qs.parse(str); + }); + + st.end(); + }); + + t.test('does not throw when a native prototype has an enumerable property', function (st) { + st.intercept(Object.prototype, 'crash', { value: '' }); + st.intercept(Array.prototype, 'crash', { value: '' }); + + st.doesNotThrow(qs.parse.bind(null, 'a=b')); + st.deepEqual(qs.parse('a=b'), { a: 'b' }); + st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c')); + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); + + st.end(); + }); + + t.test('parses a string with an alternative string delimiter', function (st) { + st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('parses a string with an alternative RegExp delimiter', function (st) { + st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('does not use non-splittable objects as delimiters', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('allows overriding parameter limit', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' }); + st.end(); + }); + + t.test('allows setting the parameter limit to Infinity', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('allows overriding array limit', function (st) { + st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { 0: 'b' } }); + st.deepEqual(qs.parse('a[0]=b', { arrayLimit: 0 }), { a: { 0: 'b' } }); + + st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } }); + st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: 0 }), { a: { '-1': 'b' } }); + + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: -1 }), { a: { 0: 'b', 1: 'c' } }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); + + st.end(); + }); + + t.test('allows disabling array parsing', function (st) { + var indices = qs.parse('a[0]=b&a[1]=c', { parseArrays: false }); + st.deepEqual(indices, { a: { 0: 'b', 1: 'c' } }); + st.equal(Array.isArray(indices.a), false, 'parseArrays:false, indices case is not an array'); + + var emptyBrackets = qs.parse('a[]=b', { parseArrays: false }); + st.deepEqual(emptyBrackets, { a: { 0: 'b' } }); + st.equal(Array.isArray(emptyBrackets.a), false, 'parseArrays:false, empty brackets case is not an array'); + + st.end(); + }); + + t.test('allows for query string prefix', function (st) { + st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); + st.deepEqual(qs.parse('foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); + st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: false }), { '?foo': 'bar' }); + + st.end(); + }); + + t.test('parses an object', function (st) { + var input = { + 'user[name]': { 'pop[bob]': 3 }, + 'user[email]': null + }; + + var expected = { + user: { + name: { 'pop[bob]': 3 }, + email: null + } + }; + + var result = qs.parse(input); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('parses string with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo=bar,tee', { comma: true }), { foo: ['bar', 'tee'] }); + st.deepEqual(qs.parse('foo[bar]=coffee,tee', { comma: true }), { foo: { bar: ['coffee', 'tee'] } }); + st.deepEqual(qs.parse('foo=', { comma: true }), { foo: '' }); + st.deepEqual(qs.parse('foo', { comma: true }), { foo: '' }); + st.deepEqual(qs.parse('foo', { comma: true, strictNullHandling: true }), { foo: null }); + + // test cases inversed from from stringify tests + st.deepEqual(qs.parse('a[0]=c'), { a: ['c'] }); + st.deepEqual(qs.parse('a[]=c'), { a: ['c'] }); + st.deepEqual(qs.parse('a[]=c', { comma: true }), { a: ['c'] }); + + st.deepEqual(qs.parse('a[0]=c&a[1]=d'), { a: ['c', 'd'] }); + st.deepEqual(qs.parse('a[]=c&a[]=d'), { a: ['c', 'd'] }); + st.deepEqual(qs.parse('a=c,d', { comma: true }), { a: ['c', 'd'] }); + + st.end(); + }); + + t.test('parses values with comma as array divider', function (st) { + st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: false }), { foo: 'bar,tee' }); + st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: true }), { foo: ['bar', 'tee'] }); + st.end(); + }); + + t.test('use number decoder, parses string that has one number with comma option enabled', function (st) { + var decoder = function (str, defaultDecoder, charset, type) { + if (!isNaN(Number(str))) { + return parseFloat(str); + } + return defaultDecoder(str, defaultDecoder, charset, type); + }; + + st.deepEqual(qs.parse('foo=1', { comma: true, decoder: decoder }), { foo: 1 }); + st.deepEqual(qs.parse('foo=0', { comma: true, decoder: decoder }), { foo: 0 }); + + st.end(); + }); + + t.test('parses brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=', { comma: true }), { foo: [['1', '2', '3'], ''] }); + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); + + st.end(); + }); + + t.test('parses url-encoded brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=', { comma: true }), { foo: [['1', '2', '3'], ''] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); + + st.end(); + }); + + t.test('parses comma delimited array while having percent-encoded comma treated as normal text', function (st) { + st.deepEqual(qs.parse('foo=a%2Cb', { comma: true }), { foo: 'a,b' }); + st.deepEqual(qs.parse('foo=a%2C%20b,d', { comma: true }), { foo: ['a, b', 'd'] }); + st.deepEqual(qs.parse('foo=a%2C%20b,c%2C%20d', { comma: true }), { foo: ['a, b', 'c, d'] }); + + st.end(); + }); + + t.test('parses an object in dot notation', function (st) { + var input = { + 'user.name': { 'pop[bob]': 3 }, + 'user.email.': null + }; + + var expected = { + user: { + name: { 'pop[bob]': 3 }, + email: null + } + }; + + var result = qs.parse(input, { allowDots: true }); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('parses an object and not child values', function (st) { + var input = { + 'user[name]': { 'pop[bob]': { test: 3 } }, + 'user[email]': null + }; + + var expected = { + user: { + name: { 'pop[bob]': { test: 3 } }, + email: null + } + }; + + var result = qs.parse(input); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('does not blow up when Buffer global is missing', function (st) { + var restore = mockProperty(global, 'Buffer', { 'delete': true }); + + var result = qs.parse('a=b&c=d'); + + restore(); + + st.deepEqual(result, { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('does not crash when parsing circular references', function (st) { + var a = {}; + a.b = a; + + var parsed; + + st.doesNotThrow(function () { + parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); + }); + + st.equal('foo' in parsed, true, 'parsed has "foo" property'); + st.equal('bar' in parsed.foo, true); + st.equal('baz' in parsed.foo, true); + st.equal(parsed.foo.bar, 'baz'); + st.deepEqual(parsed.foo.baz, a); + st.end(); + }); + + t.test('does not crash when parsing deep objects', function (st) { + var parsed; + var str = 'foo'; + + for (var i = 0; i < 5000; i++) { + str += '[p]'; + } + + str += '=bar'; + + st.doesNotThrow(function () { + parsed = qs.parse(str, { depth: 5000 }); + }); + + st.equal('foo' in parsed, true, 'parsed has "foo" property'); + + var depth = 0; + var ref = parsed.foo; + while ((ref = ref.p)) { + depth += 1; + } + + st.equal(depth, 5000, 'parsed is 5000 properties deep'); + + st.end(); + }); + + t.test('parses null objects correctly', { skip: !hasProto }, function (st) { + var a = { __proto__: null, b: 'c' }; + + st.deepEqual(qs.parse(a), { b: 'c' }); + var result = qs.parse({ a: a }); + st.equal('a' in result, true, 'result has "a" property'); + st.deepEqual(result.a, a); + st.end(); + }); + + t.test('parses dates correctly', function (st) { + var now = new Date(); + st.deepEqual(qs.parse({ a: now }), { a: now }); + st.end(); + }); + + t.test('parses regular expressions correctly', function (st) { + var re = /^test$/; + st.deepEqual(qs.parse({ a: re }), { a: re }); + st.end(); + }); + + t.test('does not allow overwriting prototype properties', function (st) { + st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: false }), {}); + st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: false }), {}); + + st.deepEqual( + qs.parse('toString', { allowPrototypes: false }), + {}, + 'bare "toString" results in {}' + ); + + st.end(); + }); + + t.test('can allow overwriting prototype properties', function (st) { + st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } }); + st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' }); + + st.deepEqual( + qs.parse('toString', { allowPrototypes: true }), + { toString: '' }, + 'bare "toString" results in { toString: "" }' + ); + + st.end(); + }); + + t.test('does not crash when the global Object prototype is frozen', { skip: !hasPropertyDescriptors || !hasOverrideMistake }, function (st) { + // We can't actually freeze the global Object prototype as that will interfere with other tests, and once an object is frozen, it + // can't be unfrozen. Instead, we add a new non-writable property to simulate this. + st.teardown(mockProperty(Object.prototype, 'frozenProp', { value: 'foo', nonWritable: true, nonEnumerable: true })); + + st['throws']( + function () { + var obj = {}; + obj.frozenProp = 'bar'; + }, + // node < 6 has a different error message + /^TypeError: Cannot assign to read only property 'frozenProp' of (?:object '#'|#)/, + 'regular assignment of an inherited non-writable property throws' + ); + + var parsed; + st.doesNotThrow( + function () { + parsed = qs.parse('frozenProp', { allowPrototypes: false }); + }, + 'parsing a nonwritable Object.prototype property does not throw' + ); + + st.deepEqual(parsed, {}, 'bare "frozenProp" results in {}'); + + st.end(); + }); + + t.test('params starting with a closing bracket', function (st) { + st.deepEqual(qs.parse(']=toString'), { ']': 'toString' }); + st.deepEqual(qs.parse(']]=toString'), { ']]': 'toString' }); + st.deepEqual(qs.parse(']hello]=toString'), { ']hello]': 'toString' }); + st.end(); + }); + + t.test('params starting with a starting bracket', function (st) { + st.deepEqual(qs.parse('[=toString'), { '[': 'toString' }); + st.deepEqual(qs.parse('[[=toString'), { '[[': 'toString' }); + st.deepEqual(qs.parse('[hello[=toString'), { '[hello[': 'toString' }); + st.end(); + }); + + t.test('add keys to objects', function (st) { + st.deepEqual( + qs.parse('a[b]=c&a=d', { strictMerge: false }), + { a: { b: 'c', d: true } }, + 'can add keys to objects' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { strictMerge: false }), + { a: { b: 'c' } }, + 'can not overwrite prototype' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { strictMerge: false, allowPrototypes: true }), + { a: { b: 'c', toString: true } }, + 'can overwrite prototype with allowPrototypes true' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { strictMerge: false, plainObjects: true }), + { __proto__: null, a: { __proto__: null, b: 'c', toString: true } }, + 'can overwrite prototype with plainObjects true' + ); + + st.end(); + }); + + t.test('strictMerge wraps object and primitive into an array', function (st) { + st.deepEqual( + qs.parse('a[b]=c&a=d'), + { a: [{ b: 'c' }, 'd'] }, + 'object then primitive produces array' + ); + + st.deepEqual( + qs.parse('a=d&a[b]=c'), + { a: ['d', { b: 'c' }] }, + 'primitive then object produces array' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString'), + { a: [{ b: 'c' }, 'toString'] }, + 'prototype-colliding value is preserved in array' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { plainObjects: true }), + { __proto__: null, a: [{ __proto__: null, b: 'c' }, 'toString'] }, + 'plainObjects preserved in array wrapping' + ); + + st.end(); + }); + + t.test('dunder proto is ignored', function (st) { + var payload = 'categories[__proto__]=login&categories[__proto__]&categories[length]=42'; + var result = qs.parse(payload, { allowPrototypes: true }); + + st.deepEqual( + result, + { + categories: { + length: '42' + } + }, + 'silent [[Prototype]] payload' + ); + + var plainResult = qs.parse(payload, { allowPrototypes: true, plainObjects: true }); + + st.deepEqual( + plainResult, + { + __proto__: null, + categories: { + __proto__: null, + length: '42' + } + }, + 'silent [[Prototype]] payload: plain objects' + ); + + var query = qs.parse('categories[__proto__]=cats&categories[__proto__]=dogs&categories[some][json]=toInject', { allowPrototypes: true }); + + st.notOk(Array.isArray(query.categories), 'is not an array'); + st.notOk(query.categories instanceof Array, 'is not instanceof an array'); + st.deepEqual(query.categories, { some: { json: 'toInject' } }); + st.equal(JSON.stringify(query.categories), '{"some":{"json":"toInject"}}', 'stringifies as a non-array'); + + st.deepEqual( + qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true }), + { + foo: { + bar: 'stuffs' + } + }, + 'hidden values' + ); + + st.deepEqual( + qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true, plainObjects: true }), + { + __proto__: null, + foo: { + __proto__: null, + bar: 'stuffs' + } + }, + 'hidden values: plain objects' + ); + + st.end(); + }); + + t.test('can return null objects', { skip: !hasProto }, function (st) { + var expected = { + __proto__: null, + a: { + __proto__: null, + b: 'c', + hasOwnProperty: 'd' + } + }; + st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected); + st.deepEqual(qs.parse(null, { plainObjects: true }), { __proto__: null }); + var expectedArray = { + __proto__: null, + a: { + __proto__: null, + 0: 'b', + c: 'd' + } + }; + st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray); + st.end(); + }); + + t.test('can parse with custom encoding', function (st) { + st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', { + decoder: function (str) { + var reg = /%([0-9A-F]{2})/ig; + var result = []; + var parts = reg.exec(str); + while (parts) { + result.push(parseInt(parts[1], 16)); + parts = reg.exec(str); + } + return String(iconv.decode(SaferBuffer.from(result), 'shift_jis')); + } + }), { 県: '大阪府' }); + st.end(); + }); + + t.test('receives the default decoder as a second argument', function (st) { + st.plan(1); + qs.parse('a', { + decoder: function (str, defaultDecoder) { + st.equal(defaultDecoder, utils.decode); + } + }); + st.end(); + }); + + t.test('throws error with wrong decoder', function (st) { + st['throws'](function () { + qs.parse({}, { decoder: 'string' }); + }, new TypeError('Decoder has to be a function.')); + st.end(); + }); + + t.test('does not mutate the options argument', function (st) { + var options = {}; + qs.parse('a[b]=true', options); + st.deepEqual(options, {}); + st.end(); + }); + + t.test('throws if an invalid charset is specified', function (st) { + st['throws'](function () { + qs.parse('a=b', { charset: 'foobar' }); + }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); + st.end(); + }); + + t.test('parses an iso-8859-1 string if asked to', function (st) { + st.deepEqual(qs.parse('%A2=%BD', { charset: 'iso-8859-1' }), { '¢': '½' }); + st.end(); + }); + + var urlEncodedCheckmarkInUtf8 = '%E2%9C%93'; + var urlEncodedOSlashInUtf8 = '%C3%B8'; + var urlEncodedNumCheckmark = '%26%2310003%3B'; + var urlEncodedNumSmiley = '%26%239786%3B'; + + t.test('prefers an utf-8 charset specified by the utf8 sentinel to a default charset of iso-8859-1', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'iso-8859-1' }), { ø: 'ø' }); + st.end(); + }); + + t.test('prefers an iso-8859-1 charset specified by the utf8 sentinel to a default charset of utf-8', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { 'ø': 'ø' }); + st.end(); + }); + + t.test('does not require the utf8 sentinel to be defined before the parameters whose decoding it affects', function (st) { + st.deepEqual(qs.parse('a=' + urlEncodedOSlashInUtf8 + '&utf8=' + urlEncodedNumCheckmark, { charsetSentinel: true, charset: 'utf-8' }), { a: 'ø' }); + st.end(); + }); + + t.test('ignores an utf8 sentinel with an unknown value', function (st) { + st.deepEqual(qs.parse('utf8=foo&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { ø: 'ø' }); + st.end(); + }); + + t.test('uses the utf8 sentinel to switch to utf-8 when no default charset is given', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { ø: 'ø' }); + st.end(); + }); + + t.test('uses the utf8 sentinel to switch to iso-8859-1 when no default charset is given', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { 'ø': 'ø' }); + st.end(); + }); + + t.test('interprets numeric entities in iso-8859-1 when `interpretNumericEntities`', function (st) { + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1', interpretNumericEntities: true }), { foo: '☺' }); + st.end(); + }); + + t.test('handles a custom decoder returning `null`, in the `iso-8859-1` charset, when `interpretNumericEntities`', function (st) { + st.deepEqual(qs.parse('foo=&bar=' + urlEncodedNumSmiley, { + charset: 'iso-8859-1', + decoder: function (str, defaultDecoder, charset) { + return str ? defaultDecoder(str, defaultDecoder, charset) : null; + }, + interpretNumericEntities: true + }), { foo: null, bar: '☺' }); + st.end(); + }); + + t.test('handles a custom decoder returning `null`, with a string key of `null`', function (st) { + st.deepEqual( + qs.parse('null=1&ToNull=2', { + decoder: function (str, defaultDecoder, charset) { + return str === 'ToNull' ? null : defaultDecoder(str, defaultDecoder, charset); + } + }), + { 'null': '1' }, + '"null" key is not overridden by `null` decoder result' + ); + + st.end(); + }); + + t.test('does not interpret numeric entities in iso-8859-1 when `interpretNumericEntities` is absent', function (st) { + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1' }), { foo: '☺' }); + st.end(); + }); + + t.test('does not interpret numeric entities when the charset is utf-8, even when `interpretNumericEntities`', function (st) { + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'utf-8', interpretNumericEntities: true }), { foo: '☺' }); + st.end(); + }); + + t.test('interpretNumericEntities with comma:true and iso charset does not crash', function (st) { + st.deepEqual( + qs.parse('b&a[]=1,' + urlEncodedNumSmiley, { comma: true, charset: 'iso-8859-1', interpretNumericEntities: true }), + { b: '', a: ['1,☺'] } + ); + + st.end(); + }); + + t.test('does not interpret %uXXXX syntax in iso-8859-1 mode', function (st) { + st.deepEqual(qs.parse('%u263A=%u263A', { charset: 'iso-8859-1' }), { '%u263A': '%u263A' }); + st.end(); + }); + + t.test('allows for decoding keys and values differently', function (st) { + var decoder = function (str, defaultDecoder, charset, type) { + if (type === 'key') { + return defaultDecoder(str, defaultDecoder, charset, type).toLowerCase(); + } + if (type === 'value') { + return defaultDecoder(str, defaultDecoder, charset, type).toUpperCase(); + } + throw 'this should never happen! type: ' + type; + }; + + st.deepEqual(qs.parse('KeY=vAlUe', { decoder: decoder }), { key: 'VALUE' }); + st.end(); + }); + + t.test('parameter limit tests', function (st) { + st.test('does not throw error when within parameter limit', function (sst) { + var result = qs.parse('a=1&b=2&c=3', { parameterLimit: 5, throwOnLimitExceeded: true }); + sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses without errors'); + sst.end(); + }); + + st.test('throws error when throwOnLimitExceeded is present but not boolean', function (sst) { + sst['throws']( + function () { + qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: 3, throwOnLimitExceeded: 'true' }); + }, + new TypeError('`throwOnLimitExceeded` option must be a boolean'), + 'throws error when throwOnLimitExceeded is present and not boolean' + ); + sst.end(); + }); + + st.test('throws error when parameter limit exceeded', function (sst) { + sst['throws']( + function () { + qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Parameter limit exceeded. Only 3 parameters allowed.'), + 'throws error when parameter limit is exceeded' + ); + sst.end(); + }); + + st.test('silently truncates when throwOnLimitExceeded is not given', function (sst) { + var result = qs.parse('a=1&b=2&c=3&d=4&e=5', { parameterLimit: 3 }); + sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses and truncates silently'); + sst.end(); + }); + + st.test('silently truncates when parameter limit exceeded without error', function (sst) { + var result = qs.parse('a=1&b=2&c=3&d=4&e=5', { parameterLimit: 3, throwOnLimitExceeded: false }); + sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses and truncates silently'); + sst.end(); + }); + + st.test('allows unlimited parameters when parameterLimit set to Infinity', function (sst) { + var result = qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: Infinity }); + sst.deepEqual(result, { a: '1', b: '2', c: '3', d: '4', e: '5', f: '6' }, 'parses all parameters without truncation'); + sst.end(); + }); + + st.end(); + }); + + t.test('array limit tests', function (st) { + st.test('does not throw error when array is within limit', function (sst) { + var result = qs.parse('a[]=1&a[]=2&a[]=3', { arrayLimit: 5, throwOnLimitExceeded: true }); + sst.deepEqual(result, { a: ['1', '2', '3'] }, 'parses array without errors'); + sst.end(); + }); + + st.test('throws error when throwOnLimitExceeded is present but not boolean for array limit', function (sst) { + sst['throws']( + function () { + qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3, throwOnLimitExceeded: 'true' }); + }, + new TypeError('`throwOnLimitExceeded` option must be a boolean'), + 'throws error when throwOnLimitExceeded is present and not boolean for array limit' + ); + sst.end(); + }); + + st.test('throws error when array limit exceeded', function (sst) { + // 4 elements exceeds limit of 3 + sst['throws']( + function () { + qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'throws error when array limit is exceeded' + ); + sst.end(); + }); + + st.test('does not throw when at limit', function (sst) { + // 3 elements = limit of 3, should not throw + var result = qs.parse('a[]=1&a[]=2&a[]=3', { arrayLimit: 3, throwOnLimitExceeded: true }); + sst.ok(Array.isArray(result.a), 'result is an array'); + sst.deepEqual(result.a, ['1', '2', '3'], 'all values present'); + sst.end(); + }); + + st.test('converts array to object if length is greater than limit', function (sst) { + var result = qs.parse('a[1]=1&a[2]=2&a[3]=3&a[4]=4&a[5]=5&a[6]=6', { arrayLimit: 5 }); + + sst.deepEqual(result, { a: { 1: '1', 2: '2', 3: '3', 4: '4', 5: '5', 6: '6' } }, 'parses into object if array length is greater than limit'); + sst.end(); + }); + + st.test('throws error when indexed notation exceeds arrayLimit with throwOnLimitExceeded', function (sst) { + sst['throws']( + function () { + qs.parse('a[1001]=b', { arrayLimit: 1000, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 1000 elements allowed in an array.'), + 'throws error for a single index exceeding arrayLimit' + ); + + sst['throws']( + function () { + qs.parse('a[0]=1&a[1]=2&a[2]=3&a[10]=4', { arrayLimit: 6, throwOnLimitExceeded: true, allowSparse: true }); + }, + new RangeError('Array limit exceeded. Only 6 elements allowed in an array.'), + 'throws error when a sparse index exceeds arrayLimit' + ); + + sst.end(); + }); + + st.test('does not throw for indexed notation within arrayLimit with throwOnLimitExceeded', function (sst) { + var result = qs.parse('a[4]=b', { arrayLimit: 5, throwOnLimitExceeded: true, allowSparse: true }); + sst.ok(Array.isArray(result.a), 'result is an array'); + sst.equal(result.a.length, 5, 'array has correct length'); + sst.equal(result.a[4], 'b', 'value at index 4 is correct'); + sst.end(); + }); + + st.test('silently converts to object for indexed notation exceeding arrayLimit without throwOnLimitExceeded', function (sst) { + var result = qs.parse('a[1001]=b', { arrayLimit: 1000 }); + sst.deepEqual(result, { a: { 1001: 'b' } }, 'converts to object without throwing'); + sst.end(); + }); + + st.end(); + }); + + t.end(); +}); + +test('parses empty keys', function (t) { + emptyTestCases.forEach(function (testCase) { + t.test('skips empty string key with ' + testCase.input, function (st) { + st.deepEqual(qs.parse(testCase.input), testCase.noEmptyKeys); + + st.end(); + }); + }); +}); + +test('`duplicates` option', function (t) { + v.nonStrings.concat('not a valid option').forEach(function (invalidOption) { + if (typeof invalidOption !== 'undefined') { + t['throws']( + function () { qs.parse('', { duplicates: invalidOption }); }, + TypeError, + 'throws on invalid option: ' + inspect(invalidOption) + ); + } + }); + + t.deepEqual( + qs.parse('foo=bar&foo=baz'), + { foo: ['bar', 'baz'] }, + 'duplicates: default, combine' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }), + { foo: ['bar', 'baz'] }, + 'duplicates: combine' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), + { foo: 'bar' }, + 'duplicates: first' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), + { foo: 'baz' }, + 'duplicates: last' + ); + + t.test('bracket notation always combines regardless of duplicates', function (st) { + st.deepEqual( + qs.parse('a=1&a=2&b[]=1&b[]=2', { duplicates: 'last' }), + { a: '2', b: ['1', '2'] }, + 'duplicates last: unbracketed takes last, bracketed combines' + ); + + st.deepEqual( + qs.parse('b[]=1&b[]=2', { duplicates: 'last' }), + { b: ['1', '2'] }, + 'duplicates last: bracketed always combines' + ); + + st.deepEqual( + qs.parse('b[]=1&b[]=2', { duplicates: 'first' }), + { b: ['1', '2'] }, + 'duplicates first: bracketed always combines' + ); + + st.deepEqual( + qs.parse('a=1&a=2&b[]=1&b[]=2', { duplicates: 'first' }), + { a: '1', b: ['1', '2'] }, + 'duplicates first: unbracketed takes first, bracketed combines' + ); + + st.end(); + }); + + t.end(); +}); + +test('qs strictDepth option - throw cases', function (t) { + t.test('throws an exception when depth exceeds the limit with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + + t.test('throws an exception for multiple nested arrays with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[0][1][2][3][4]=b', { depth: 3, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + + t.test('throws an exception for nested objects and arrays with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][0][d][e]=f', { depth: 3, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + + t.test('throws an exception for different types of values with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 3, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + +}); + +test('qs strictDepth option - non-throw cases', function (t) { + t.test('when depth is 0 and strictDepth true, do not throw', function (st) { + st.doesNotThrow( + function () { + qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 0, strictDepth: true }); + }, + RangeError, + 'does not throw RangeError' + ); + st.end(); + }); + + t.test('parses successfully when depth is within the limit with strictDepth: true', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b]=c', { depth: 1, strictDepth: true }); + st.deepEqual(result, { a: { b: 'c' } }, 'parses correctly'); + } + ); + st.end(); + }); + + t.test('does not throw an exception when depth exceeds the limit with strictDepth: false', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); + st.deepEqual(result, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }, 'parses with depth limit'); + } + ); + st.end(); + }); + + t.test('parses successfully when depth is within the limit with strictDepth: false', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b]=c', { depth: 1 }); + st.deepEqual(result, { a: { b: 'c' } }, 'parses correctly'); + } + ); + st.end(); + }); + + t.test('does not throw when depth is exactly at the limit with strictDepth: true', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b][c]=d', { depth: 2, strictDepth: true }); + st.deepEqual(result, { a: { b: { c: 'd' } } }, 'parses correctly'); + } + ); + st.end(); + }); +}); + +test('DOS', function (t) { + var arr = []; + for (var i = 0; i < 105; i++) { + arr[arr.length] = 'x'; + } + var attack = 'a[]=' + arr.join('&a[]='); + var result = qs.parse(attack, { arrayLimit: 100 }); + + t.notOk(Array.isArray(result.a), 'arrayLimit is respected: result is an object, not an array'); + t.equal(Object.keys(result.a).length, 105, 'all values are preserved'); + + t.end(); +}); + +test('arrayLimit boundary conditions', function (t) { + // arrayLimit is the max number of elements allowed in an array + t.test('exactly at the limit stays as array', function (st) { + // 3 elements = limit of 3 + var result = qs.parse('a[]=1&a[]=2&a[]=3', { arrayLimit: 3 }); + st.ok(Array.isArray(result.a), 'result is an array when count equals limit'); + st.deepEqual(result.a, ['1', '2', '3'], 'all values present'); + st.end(); + }); + + t.test('one over the limit converts to object', function (st) { + // 4 elements exceeds limit of 3 + var result = qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3 }); + st.notOk(Array.isArray(result.a), 'result is not an array when over limit'); + st.deepEqual(result.a, { 0: '1', 1: '2', 2: '3', 3: '4' }, 'all values preserved as object'); + st.end(); + }); + + t.test('arrayLimit 1 with one value', function (st) { + // 1 element = limit of 1 + var result = qs.parse('a[]=1', { arrayLimit: 1 }); + st.ok(Array.isArray(result.a), 'result is an array when count equals limit'); + st.deepEqual(result.a, ['1'], 'value preserved as array'); + st.end(); + }); + + t.test('arrayLimit 1 with two values converts to object', function (st) { + // 2 elements exceeds limit of 1 + var result = qs.parse('a[]=1&a[]=2', { arrayLimit: 1 }); + st.notOk(Array.isArray(result.a), 'result is not an array'); + st.deepEqual(result.a, { 0: '1', 1: '2' }, 'all values preserved as object'); + st.end(); + }); + + t.end(); +}); + +test('comma + arrayLimit', function (t) { + t.test('comma-separated values within arrayLimit stay as array', function (st) { + var result = qs.parse('a=1,2,3', { comma: true, arrayLimit: 5 }); + st.ok(Array.isArray(result.a), 'result is an array'); + st.deepEqual(result.a, ['1', '2', '3'], 'all values present'); + st.end(); + }); + + t.test('comma-separated values exceeding arrayLimit convert to object', function (st) { + var result = qs.parse('a=1,2,3,4', { comma: true, arrayLimit: 3 }); + st.notOk(Array.isArray(result.a), 'result is not an array when over limit'); + st.deepEqual(result.a, { 0: '1', 1: '2', 2: '3', 3: '4' }, 'all values preserved as object'); + st.end(); + }); + + t.test('comma-separated values exceeding arrayLimit with throwOnLimitExceeded throws', function (st) { + st['throws']( + function () { + qs.parse('a=1,2,3,4', { comma: true, arrayLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'throws error when comma-split exceeds array limit' + ); + st.end(); + }); + + t.test('comma-separated values at exactly arrayLimit stay as array', function (st) { + var result = qs.parse('a=1,2,3', { comma: true, arrayLimit: 3 }); + st.ok(Array.isArray(result.a), 'result is an array when exactly at limit'); + st.deepEqual(result.a, ['1', '2', '3'], 'all values present'); + st.end(); + }); + + t.end(); +}); + +test('mixed array and object notation', function (t) { + t.test('array brackets with object key - under limit', function (st) { + st.deepEqual( + qs.parse('a[]=b&a[c]=d'), + { a: { 0: 'b', c: 'd' } }, + 'mixing [] and [key] converts to object' + ); + st.end(); + }); + + t.test('array index with object key - under limit', function (st) { + st.deepEqual( + qs.parse('a[0]=b&a[c]=d'), + { a: { 0: 'b', c: 'd' } }, + 'mixing [0] and [key] produces object' + ); + st.end(); + }); + + t.test('plain value with array brackets - under limit', function (st) { + st.deepEqual( + qs.parse('a=b&a[]=c', { arrayLimit: 20 }), + { a: ['b', 'c'] }, + 'plain value combined with [] stays as array under limit' + ); + st.end(); + }); + + t.test('array brackets with plain value - under limit', function (st) { + st.deepEqual( + qs.parse('a[]=b&a=c', { arrayLimit: 20 }), + { a: ['b', 'c'] }, + '[] combined with plain value stays as array under limit' + ); + st.end(); + }); + + t.test('plain value with array index - under limit', function (st) { + st.deepEqual( + qs.parse('a=b&a[0]=c', { arrayLimit: 20 }), + { a: ['b', 'c'] }, + 'plain value combined with [0] stays as array under limit' + ); + st.end(); + }); + + t.test('multiple plain values with duplicates combine', function (st) { + st.deepEqual( + qs.parse('a=b&a=c&a=d', { arrayLimit: 20 }), + { a: ['b', 'c', 'd'] }, + 'duplicate plain keys combine into array' + ); + st.end(); + }); + + t.test('multiple plain values exceeding limit', function (st) { + // 3 elements (indices 0-2), max index 2 > limit 1 + st.deepEqual( + qs.parse('a=b&a=c&a=d', { arrayLimit: 1 }), + { a: { 0: 'b', 1: 'c', 2: 'd' } }, + 'duplicate plain keys convert to object when exceeding limit' + ); + st.end(); + }); + + t.test('mixed notation produces consistent results when arrayLimit is exceeded', function (st) { + var expected = { a: { 0: 'b', 1: 'c', 2: 'd' } }; + + st.deepEqual( + qs.parse('a[]=b&a[1]=c&a=d', { arrayLimit: -1 }), + expected, + 'arrayLimit -1' + ); + + st.deepEqual( + qs.parse('a[]=b&a[1]=c&a=d', { arrayLimit: 0 }), + expected, + 'arrayLimit 0' + ); + + st.deepEqual( + qs.parse('a[]=b&a[1]=c&a=d', { arrayLimit: 1 }), + expected, + 'arrayLimit 1' + ); + + st.end(); + }); + + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/test/stringify.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/test/stringify.js new file mode 100644 index 0000000..4d77694 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/test/stringify.js @@ -0,0 +1,1310 @@ +'use strict'; + +var test = require('tape'); +var qs = require('../'); +var utils = require('../lib/utils'); +var iconv = require('iconv-lite'); +var SaferBuffer = require('safer-buffer').Buffer; +var hasSymbols = require('has-symbols'); +var mockProperty = require('mock-property'); +var emptyTestCases = require('./empty-keys-cases').emptyTestCases; +var hasProto = require('has-proto')(); +var hasBigInt = require('has-bigints')(); + +test('stringify()', function (t) { + t.test('stringifies a querystring object', function (st) { + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: 1 }), 'a=1'); + st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2'); + st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z'); + st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC'); + st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80'); + st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90'); + st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7'); + st.end(); + }); + + t.test('stringifies falsy values', function (st) { + st.equal(qs.stringify(undefined), ''); + st.equal(qs.stringify(null), ''); + st.equal(qs.stringify(null, { strictNullHandling: true }), ''); + st.equal(qs.stringify(false), ''); + st.equal(qs.stringify(0), ''); + st.end(); + }); + + t.test('stringifies symbols', { skip: !hasSymbols() }, function (st) { + st.equal(qs.stringify(Symbol.iterator), ''); + st.equal(qs.stringify([Symbol.iterator]), '0=Symbol%28Symbol.iterator%29'); + st.equal(qs.stringify({ a: Symbol.iterator }), 'a=Symbol%28Symbol.iterator%29'); + st.equal( + qs.stringify({ a: [Symbol.iterator] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'a[]=Symbol%28Symbol.iterator%29' + ); + st.end(); + }); + + t.test('stringifies bigints', { skip: !hasBigInt }, function (st) { + var three = BigInt(3); + var encodeWithN = function (value, defaultEncoder, charset) { + var result = defaultEncoder(value, defaultEncoder, charset); + return typeof value === 'bigint' ? result + 'n' : result; + }; + st.equal(qs.stringify(three), ''); + st.equal(qs.stringify([three]), '0=3'); + st.equal(qs.stringify([three], { encoder: encodeWithN }), '0=3n'); + st.equal(qs.stringify({ a: three }), 'a=3'); + st.equal(qs.stringify({ a: three }, { encoder: encodeWithN }), 'a=3n'); + st.equal( + qs.stringify({ a: [three] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'a[]=3' + ); + st.equal( + qs.stringify({ a: [three] }, { encodeValuesOnly: true, encoder: encodeWithN, arrayFormat: 'brackets' }), + 'a[]=3n' + ); + st.end(); + }); + + t.test('encodes dot in key of object when encodeDotInKeys and allowDots is provided', function (st) { + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: false } + ), + 'name.obj%5Bfirst%5D=John&name.obj%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: false } + ), + 'name.obj.first=John&name.obj.last=Doe', + 'with allowDots true and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: true } + ), + 'name%252Eobj%5Bfirst%5D=John&name%252Eobj%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys true' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: true } + ), + 'name%252Eobj.first=John&name%252Eobj.last=Doe', + 'with allowDots true and encodeDotInKeys true' + ); + + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: false } + ), + 'name.obj.subobject%5Bfirst.godly.name%5D=John&name.obj.subobject%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: false } + ), + 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject%5Bfirst.godly.name%5D=John&name%252Eobj%252Esubobject%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys true' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + 'with allowDots true and encodeDotInKeys true' + ); + + st.end(); + }); + + t.test('should encode dot in key of object, and automatically set allowDots to `true` when encodeDotInKeys is true and allowDots in undefined', function (st) { + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + 'with allowDots undefined and encodeDotInKeys true' + ); + st.end(); + }); + + t.test('should encode dot in key of object when encodeDotInKeys and allowDots is provided, and nothing else when encodeValuesOnly is provided', function (st) { + st.equal( + qs.stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { + encodeDotInKeys: true, allowDots: true, encodeValuesOnly: true + }), + 'name%2Eobj.first=John&name%2Eobj.last=Doe' + ); + + st.equal( + qs.stringify({ 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, { allowDots: true, encodeDotInKeys: true, encodeValuesOnly: true }), + 'name%2Eobj%2Esubobject.first%2Egodly%2Ename=John&name%2Eobj%2Esubobject.last=Doe' + ); + + st.end(); + }); + + t.test('throws when `commaRoundTrip` is not a boolean', function (st) { + st['throws']( + function () { qs.stringify({}, { commaRoundTrip: 'not a boolean' }); }, + TypeError, + 'throws when `commaRoundTrip` is not a boolean' + ); + + st.end(); + }); + + t.test('throws when `encodeDotInKeys` is not a boolean', function (st) { + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 0 }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('adds query prefix', function (st) { + st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b'); + st.end(); + }); + + t.test('with query prefix, outputs blank string given an empty object', function (st) { + st.equal(qs.stringify({}, { addQueryPrefix: true }), ''); + st.end(); + }); + + t.test('stringifies nested falsy values', function (st) { + st.equal(qs.stringify({ a: { b: { c: null } } }), 'a%5Bb%5D%5Bc%5D='); + st.equal(qs.stringify({ a: { b: { c: null } } }, { strictNullHandling: true }), 'a%5Bb%5D%5Bc%5D'); + st.equal(qs.stringify({ a: { b: { c: false } } }), 'a%5Bb%5D%5Bc%5D=false'); + st.end(); + }); + + t.test('stringifies a nested object', function (st) { + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e'); + st.end(); + }); + + t.test('`allowDots` option: stringifies a nested object with dots notation', function (st) { + st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c'); + st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e'); + st.end(); + }); + + t.test('stringifies an array value', function (st) { + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }), + 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }), + 'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' }), + 'a=b%2Cc%2Cd', + 'comma => comma' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma', commaRoundTrip: true }), + 'a=b%2Cc%2Cd', + 'comma round trip => comma' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }), + 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', + 'default => indices' + ); + st.end(); + }); + + t.test('`skipNulls` option', function (st) { + st.equal( + qs.stringify({ a: 'b', c: null }, { skipNulls: true }), + 'a=b', + 'omits nulls when asked' + ); + + st.equal( + qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), + 'a%5Bb%5D=c', + 'omits nested nulls when asked' + ); + + st.end(); + }); + + t.test('omits array indices when asked', function (st) { + st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d'); + + st.end(); + }); + + t.test('omits object key/value pair when value is empty array', function (st) { + st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); + + st.end(); + }); + + t.test('should not omit object key/value pair when value is empty array and when asked', function (st) { + st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); + st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: false }), 'b=zz'); + st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: true }), 'a[]&b=zz'); + + st.end(); + }); + + t.test('should throw when allowEmptyArrays is not of type boolean', function (st) { + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 0 }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allowEmptyArrays + strictNullHandling', function (st) { + st.equal( + qs.stringify( + { testEmptyArray: [] }, + { strictNullHandling: true, allowEmptyArrays: true } + ), + 'testEmptyArray[]' + ); + + st.end(); + }); + + t.test('stringifies an array value with one item vs multiple items', function (st) { + st.test('non-array item', function (s2t) { + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=c'); + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=c'); + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true }), 'a=c'); + + s2t.end(); + }); + + st.test('array with a single item', function (s2t) { + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c'); + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c'); + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a[]=c'); // so it parses back as an array + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true }), 'a[0]=c'); + + s2t.end(); + }); + + st.test('array with multiple items', function (s2t) { + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c&a[1]=d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c&a[]=d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c,d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c,d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true }), 'a[0]=c&a[1]=d'); + + s2t.end(); + }); + + st.test('array with multiple items with a comma inside', function (s2t) { + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c%2Cd,e'); + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma' }), 'a=c%2Cd%2Ce'); + + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd,e'); + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd%2Ce'); + + s2t.end(); + }); + + st.end(); + }); + + t.test('stringifies a nested array value', function (st) { + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[b][0]=c&a[b][1]=d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[b][]=c&a[b][]=d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a[b]=c,d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true }), 'a[b][0]=c&a[b][1]=d'); + st.end(); + }); + + t.test('stringifies comma and empty array values', function (st) { + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'indices' }), 'a[0]=,&a[1]=&a[2]=c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'brackets' }), 'a[]=,&a[]=&a[]=c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'comma' }), 'a=,,,c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'repeat' }), 'a=,&a=&a=c,d%'); + + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=%2C&a[1]=&a[2]=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=%2C&a[]=&a[]=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C,,c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); + + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a%5B0%5D=%2C&a%5B1%5D=&a%5B2%5D=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a%5B%5D=%2C&a%5B%5D=&a%5B%5D=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C%2C%2Cc%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); + + st.end(); + }); + + t.test('stringifies comma and empty non-array values', function (st) { + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'indices' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'brackets' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'comma' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'repeat' }), 'a=,&b=&c=c,d%'); + + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); + + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); + + st.end(); + }); + + t.test('stringifies a nested array value with dots notation', function (st) { + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' } + ), + 'a.b[0]=c&a.b[1]=d', + 'indices: stringifies with dots + indices' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' } + ), + 'a.b[]=c&a.b[]=d', + 'brackets: stringifies with dots + brackets' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' } + ), + 'a.b=c,d', + 'comma: stringifies with dots + comma' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true } + ), + 'a.b[0]=c&a.b[1]=d', + 'default: stringifies with dots + indices' + ); + st.end(); + }); + + t.test('stringifies an object inside an array', function (st) { + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), + 'a[0][b]=c', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), + 'a[b]=c', + 'repeat => repeat' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), + 'a[][b]=c', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { encodeValuesOnly: true }), + 'a[0][b]=c', + 'default => indices' + ); + + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), + 'a[0][b][c][0]=1', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), + 'a[b][c]=1', + 'repeat => repeat' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), + 'a[][b][c][]=1', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { encodeValuesOnly: true }), + 'a[0][b][c][0]=1', + 'default => indices' + ); + + st.end(); + }); + + t.test('stringifies an array with mixed objects and primitives', function (st) { + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), + 'a[0][b]=1&a[1]=2&a[2]=3', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'a[][b]=1&a[]=2&a[]=3', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), + '???', + 'brackets => brackets', + { skip: 'TODO: figure out what this should do' } + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true }), + 'a[0][b]=1&a[1]=2&a[2]=3', + 'default => indices' + ); + + st.end(); + }); + + t.test('stringifies an object inside an array with dots notation', function (st) { + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false, arrayFormat: 'indices' } + ), + 'a[0].b=c', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false, arrayFormat: 'brackets' } + ), + 'a[].b=c', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false } + ), + 'a[0].b=c', + 'default => indices' + ); + + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false, arrayFormat: 'indices' } + ), + 'a[0].b.c[0]=1', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false, arrayFormat: 'brackets' } + ), + 'a[].b.c[]=1', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false } + ), + 'a[0].b.c[0]=1', + 'default => indices' + ); + + st.end(); + }); + + t.test('does not omit object keys when indices = false', function (st) { + st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when indices=true', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when arrayFormat=indices', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses repeat notation for arrays when arrayFormat=repeat', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c'); + st.end(); + }); + + t.test('uses brackets notation for arrays when arrayFormat=brackets', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c'); + st.end(); + }); + + t.test('stringifies a complicated object', function (st) { + st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e'); + st.end(); + }); + + t.test('stringifies an empty value', function (st) { + st.equal(qs.stringify({ a: '' }), 'a='); + st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a'); + + st.equal(qs.stringify({ a: '', b: '' }), 'a=&b='); + st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b='); + + st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D='); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D'); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D='); + + st.end(); + }); + + t.test('stringifies an empty array in different arrayFormat', function (st) { + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false }), 'b[0]=&c=c'); + // arrayFormat default + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' }), 'b[0]=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' }), 'b[]=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' }), 'b=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' }), 'b=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', commaRoundTrip: true }), 'b[]=&c=c'); + // with strictNullHandling + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', strictNullHandling: true }), 'b[0]&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', strictNullHandling: true }), 'b[]&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', strictNullHandling: true }), 'b&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true }), 'b&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true, commaRoundTrip: true }), 'b[]&c=c'); + // with skipNulls + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', skipNulls: true }), 'c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', skipNulls: true }), 'c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', skipNulls: true }), 'c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', skipNulls: true }), 'c=c'); + + st.end(); + }); + + t.test('stringifies a null object', { skip: !hasProto }, function (st) { + st.equal(qs.stringify({ __proto__: null, a: 'b' }), 'a=b'); + st.end(); + }); + + t.test('returns an empty string for invalid input', function (st) { + st.equal(qs.stringify(undefined), ''); + st.equal(qs.stringify(false), ''); + st.equal(qs.stringify(null), ''); + st.equal(qs.stringify(''), ''); + st.end(); + }); + + t.test('stringifies an object with a null object as a child', { skip: !hasProto }, function (st) { + st.equal(qs.stringify({ a: { __proto__: null, b: 'c' } }), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('drops keys with a value of undefined', function (st) { + st.equal(qs.stringify({ a: undefined }), ''); + + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D'); + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D='); + st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D='); + st.end(); + }); + + t.test('url encodes values', function (st) { + st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); + st.end(); + }); + + t.test('stringifies a date', function (st) { + var now = new Date(); + var str = 'a=' + encodeURIComponent(now.toISOString()); + st.equal(qs.stringify({ a: now }), str); + st.end(); + }); + + t.test('stringifies the weird object from qs', function (st) { + st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F'); + st.end(); + }); + + t.test('skips properties that are part of the object prototype', function (st) { + st.intercept(Object.prototype, 'crash', { value: 'test' }); + + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + + st.end(); + }); + + t.test('stringifies boolean values', function (st) { + st.equal(qs.stringify({ a: true }), 'a=true'); + st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true'); + st.equal(qs.stringify({ b: false }), 'b=false'); + st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false'); + st.end(); + }); + + t.test('stringifies buffer values', function (st) { + st.equal(qs.stringify({ a: SaferBuffer.from('test') }), 'a=test'); + st.equal(qs.stringify({ a: { b: SaferBuffer.from('test') } }), 'a%5Bb%5D=test'); + st.end(); + }); + + t.test('stringifies an object using an alternative delimiter', function (st) { + st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); + st.end(); + }); + + t.test('does not blow up when Buffer global is missing', function (st) { + var restore = mockProperty(global, 'Buffer', { 'delete': true }); + + var result = qs.stringify({ a: 'b', c: 'd' }); + + restore(); + + st.equal(result, 'a=b&c=d'); + st.end(); + }); + + t.test('does not crash when parsing circular references', function (st) { + var a = {}; + a.b = a; + + st['throws']( + function () { qs.stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); }, + /RangeError: Cyclic object value/, + 'cyclic values throw' + ); + + var circular = { + a: 'value' + }; + circular.a = circular; + st['throws']( + function () { qs.stringify(circular); }, + /RangeError: Cyclic object value/, + 'cyclic values throw' + ); + + var arr = ['a']; + st.doesNotThrow( + function () { qs.stringify({ x: arr, y: arr }); }, + 'non-cyclic values do not throw' + ); + + st.end(); + }); + + t.test('non-circular duplicated references can still work', function (st) { + var hourOfDay = { + 'function': 'hour_of_day' + }; + + var p1 = { + 'function': 'gte', + arguments: [hourOfDay, 0] + }; + var p2 = { + 'function': 'lte', + arguments: [hourOfDay, 23] + }; + + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), + 'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23' + ); + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'filters[$and][][function]=gte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=0&filters[$and][][function]=lte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=23' + ); + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), + 'filters[$and][function]=gte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=0&filters[$and][function]=lte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=23' + ); + + st.end(); + }); + + t.test('selects properties when filter=array', function (st) { + st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b'); + st.equal(qs.stringify({ a: 1 }, { filter: [] }), ''); + + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2], arrayFormat: 'indices' } + ), + 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' } + ), + 'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2] } + ), + 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', + 'default => indices' + ); + + st.end(); + }); + + t.test('supports custom representations when filter=function', function (st) { + var calls = 0; + var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } }; + var filterFunc = function (prefix, value) { + calls += 1; + if (calls === 1) { + st.equal(prefix, '', 'prefix is empty'); + st.equal(value, obj); + } else if (prefix === 'c') { + return void 0; + } else if (value instanceof Date) { + st.equal(prefix, 'e[f]'); + return value.getTime(); + } + return value; + }; + + st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000'); + st.equal(calls, 5); + st.end(); + }); + + t.test('can disable uri encoding', function (st) { + st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c'); + st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c'); + st.end(); + }); + + t.test('can sort the keys', function (st) { + var sort = function (a, b) { + return a.localeCompare(b); + }; + st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y'); + st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a'); + st.end(); + }); + + t.test('can sort the keys at depth 3 or more too', function (st) { + var sort = function (a, b) { + return a.localeCompare(b); + }; + st.equal( + qs.stringify( + { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, + { sort: sort, encode: false } + ), + 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb' + ); + st.equal( + qs.stringify( + { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, + { sort: null, encode: false } + ), + 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b' + ); + st.end(); + }); + + t.test('can stringify with custom encoding', function (st) { + st.equal(qs.stringify({ 県: '大阪府', '': '' }, { + encoder: function (str) { + if (str.length === 0) { + return ''; + } + var buf = iconv.encode(str, 'shiftjis'); + var result = []; + for (var i = 0; i < buf.length; ++i) { + result.push(buf.readUInt8(i).toString(16)); + } + return '%' + result.join('%'); + } + }), '%8c%a7=%91%e5%8d%e3%95%7b&='); + st.end(); + }); + + t.test('receives the default encoder as a second argument', function (st) { + st.plan(8); + + qs.stringify({ a: 1, b: new Date(), c: true, d: [1] }, { + encoder: function (str) { + st.match(typeof str, /^(?:string|number|boolean)$/); + return ''; + } + }); + + st.end(); + }); + + t.test('receives the default encoder as a second argument', function (st) { + st.plan(2); + + qs.stringify({ a: 1 }, { + encoder: function (str, defaultEncoder) { + st.equal(defaultEncoder, utils.encode); + } + }); + + st.end(); + }); + + t.test('throws error with wrong encoder', function (st) { + st['throws'](function () { + qs.stringify({}, { encoder: 'string' }); + }, new TypeError('Encoder has to be a function.')); + st.end(); + }); + + t.test('can use custom encoder for a buffer object', { skip: typeof Buffer === 'undefined' }, function (st) { + st.equal(qs.stringify({ a: SaferBuffer.from([1]) }, { + encoder: function (buffer) { + if (typeof buffer === 'string') { + return buffer; + } + return String.fromCharCode(buffer.readUInt8(0) + 97); + } + }), 'a=b'); + + st.equal(qs.stringify({ a: SaferBuffer.from('a b') }, { + encoder: function (buffer) { + return buffer; + } + }), 'a=a b'); + st.end(); + }); + + t.test('serializeDate option', function (st) { + var date = new Date(); + st.equal( + qs.stringify({ a: date }), + 'a=' + date.toISOString().replace(/:/g, '%3A'), + 'default is toISOString' + ); + + var mutatedDate = new Date(); + mutatedDate.toISOString = function () { + throw new SyntaxError(); + }; + st['throws'](function () { + mutatedDate.toISOString(); + }, SyntaxError); + st.equal( + qs.stringify({ a: mutatedDate }), + 'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'), + 'toISOString works even when method is not locally present' + ); + + var specificDate = new Date(6); + st.equal( + qs.stringify( + { a: specificDate }, + { serializeDate: function (d) { return d.getTime() * 7; } } + ), + 'a=42', + 'custom serializeDate function called' + ); + + st.equal( + qs.stringify( + { a: [date] }, + { + serializeDate: function (d) { return d.getTime(); }, + arrayFormat: 'comma' + } + ), + 'a=' + date.getTime(), + 'works with arrayFormat comma' + ); + st.equal( + qs.stringify( + { a: [date] }, + { + serializeDate: function (d) { return d.getTime(); }, + arrayFormat: 'comma', + commaRoundTrip: true + } + ), + 'a%5B%5D=' + date.getTime(), + 'works with arrayFormat comma' + ); + + st.end(); + }); + + t.test('RFC 1738 serialization', function (st) { + st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c'); + st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d'); + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC1738 }), 'a+b=a+b'); + + st.equal(qs.stringify({ 'foo(ref)': 'bar' }, { format: qs.formats.RFC1738 }), 'foo(ref)=bar'); + + st.end(); + }); + + t.test('RFC 3986 spaces serialization', function (st) { + st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c'); + st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d'); + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC3986 }), 'a%20b=a%20b'); + + st.end(); + }); + + t.test('Backward compatibility to RFC 3986', function (st) { + st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }), 'a%20b=a%20b'); + + st.end(); + }); + + t.test('Edge cases and unknown formats', function (st) { + ['UFO1234', false, 1234, null, {}, []].forEach(function (format) { + st['throws']( + function () { + qs.stringify({ a: 'b c' }, { format: format }); + }, + new TypeError('Unknown format option provided.') + ); + }); + st.end(); + }); + + t.test('encodeValuesOnly', function (st) { + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'indices' } + ), + 'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h', + 'encodeValuesOnly + indices' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'brackets' } + ), + 'a=b&c[]=d&c[]=e%3Df&f[][]=g&f[][]=h', + 'encodeValuesOnly + brackets' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'repeat' } + ), + 'a=b&c=d&c=e%3Df&f=g&f=h', + 'encodeValuesOnly + repeat' + ); + + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'indices' } + ), + 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h', + 'no encodeValuesOnly + indices' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'brackets' } + ), + 'a=b&c%5B%5D=d&c%5B%5D=e&f%5B%5D%5B%5D=g&f%5B%5D%5B%5D=h', + 'no encodeValuesOnly + brackets' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'repeat' } + ), + 'a=b&c=d&c=e&f=g&f=h', + 'no encodeValuesOnly + repeat' + ); + + st.end(); + }); + + t.test('encodeValuesOnly - strictNullHandling', function (st) { + st.equal( + qs.stringify( + { a: { b: null } }, + { encodeValuesOnly: true, strictNullHandling: true } + ), + 'a[b]' + ); + st.end(); + }); + + t.test('throws if an invalid charset is specified', function (st) { + st['throws'](function () { + qs.stringify({ a: 'b' }, { charset: 'foobar' }); + }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); + st.end(); + }); + + t.test('respects a charset of iso-8859-1', function (st) { + st.equal(qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }), '%E6=%E6'); + st.end(); + }); + + t.test('encodes unrepresentable chars as numeric entities in iso-8859-1 mode', function (st) { + st.equal(qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }), 'a=%26%239786%3B'); + st.end(); + }); + + t.test('respects an explicit charset of utf-8 (the default)', function (st) { + st.equal(qs.stringify({ a: 'æ' }, { charset: 'utf-8' }), 'a=%C3%A6'); + st.end(); + }); + + t.test('`charsetSentinel` option', function (st) { + st.equal( + qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), + 'utf8=%E2%9C%93&a=%C3%A6', + 'adds the right sentinel when instructed to and the charset is utf-8' + ); + + st.equal( + qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), + 'utf8=%26%2310003%3B&a=%E6', + 'adds the right sentinel when instructed to and the charset is iso-8859-1' + ); + + st.end(); + }); + + t.test('does not mutate the options argument', function (st) { + var options = {}; + qs.stringify({}, options); + st.deepEqual(options, {}); + st.end(); + }); + + t.test('strictNullHandling works with custom filter', function (st) { + var filter = function (prefix, value) { + return value; + }; + + var options = { strictNullHandling: true, filter: filter }; + st.equal(qs.stringify({ key: null }, options), 'key'); + st.end(); + }); + + t.test('strictNullHandling works with null serializeDate', function (st) { + var serializeDate = function () { + return null; + }; + var options = { strictNullHandling: true, serializeDate: serializeDate }; + var date = new Date(); + st.equal(qs.stringify({ key: date }, options), 'key'); + st.end(); + }); + + t.test('allows for encoding keys and values differently', function (st) { + var encoder = function (str, defaultEncoder, charset, type) { + if (type === 'key') { + return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase(); + } + if (type === 'value') { + return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase(); + } + throw 'this should never happen! type: ' + type; + }; + + st.deepEqual(qs.stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE'); + st.end(); + }); + + t.test('objects inside arrays', function (st) { + var obj = { a: { b: { c: 'd', e: 'f' } } }; + var withArray = { a: { b: [{ c: 'd', e: 'f' }] } }; + + st.equal(qs.stringify(obj, { encode: false }), 'a[b][c]=d&a[b][e]=f', 'no array, no arrayFormat'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'brackets' }), 'a[b][c]=d&a[b][e]=f', 'no array, bracket'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'indices' }), 'a[b][c]=d&a[b][e]=f', 'no array, indices'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'no array, repeat'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), 'a[b][c]=d&a[b][e]=f', 'no array, comma'); + + st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'brackets' }), 'a[b][][c]=d&a[b][][e]=f', 'array, bracket'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'array, repeat'); + st.equal( + qs.stringify(withArray, { encode: false, arrayFormat: 'comma' }), + '???', + 'array, comma', + { skip: 'TODO: figure out what this should do' } + ); + + st.end(); + }); + + t.test('stringifies sparse arrays', function (st) { + /* eslint no-sparse-arrays: 0 */ + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1]=2&a[4]=1'); + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=2&a[]=1'); + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=2&a=1'); + + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][b][2][c]=1'); + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][b][][c]=1'); + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[b][c]=1'); + + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); + + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c][1]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c][]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); + + st.end(); + }); + + t.test('encodes a very long string', function (st) { + var chars = []; + var expected = []; + for (var i = 0; i < 5e3; i++) { + chars.push(' ' + i); + + expected.push('%20' + i); + } + + var obj = { + foo: chars.join('') + }; + + st.equal( + qs.stringify(obj, { arrayFormat: 'brackets', charset: 'utf-8' }), + 'foo=' + expected.join('') + ); + + st.end(); + }); + + t.end(); +}); + +test('stringifies empty keys', function (t) { + emptyTestCases.forEach(function (testCase) { + t.test('stringifies an object with empty string key with ' + testCase.input, function (st) { + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'indices' }), + testCase.stringifyOutput.indices, + 'test case: ' + testCase.input + ', indices' + ); + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'brackets' }), + testCase.stringifyOutput.brackets, + 'test case: ' + testCase.input + ', brackets' + ); + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'repeat' }), + testCase.stringifyOutput.repeat, + 'test case: ' + testCase.input + ', repeat' + ); + + st.end(); + }); + }); + + t.test('edge case with object/arrays', function (st) { + st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false }), '[][0]=2&[][1]=3'); + st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false }), '[][0]=2&[][1]=3&[a]=2'); + st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3'); + st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3&[a]=2'); + + st.end(); + }); + + t.test('stringifies non-string keys', function (st) { + var S = Object('abc'); + S.toString = function () { + return 'd'; + }; + var actual = qs.stringify({ a: 'b', 'false': {}, 1e+22: 'c', d: 'e' }, { + filter: ['a', false, null, 10000000000000000000000, S], + allowDots: true, + encodeDotInKeys: true + }); + + st.equal(actual, 'a=b&1e%2B22=c&d=e', 'stringifies correctly'); + + st.end(); + }); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/test/utils.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/test/utils.js new file mode 100644 index 0000000..dc2f444 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/qs/test/utils.js @@ -0,0 +1,404 @@ +'use strict'; + +var test = require('tape'); +var inspect = require('object-inspect'); +var SaferBuffer = require('safer-buffer').Buffer; +var forEach = require('for-each'); +var v = require('es-value-fixtures'); + +var utils = require('../lib/utils'); + +test('merge()', function (t) { + t.deepEqual(utils.merge(null, true), [null, true], 'merges true into null'); + + t.deepEqual(utils.merge(null, [42]), [null, 42], 'merges null into an array'); + + t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key'); + + var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } }); + t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array'); + + var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } }); + t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array'); + + var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' }); + t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array'); + + var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] }); + t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] }); + + var noOptionsNonObjectSource = utils.merge({ foo: 'baz' }, 'bar'); + t.deepEqual(noOptionsNonObjectSource, { foo: 'baz', bar: true }); + + var func = function f() {}; + t.deepEqual( + utils.merge(func, { foo: 'bar' }), + [func, { foo: 'bar' }], + 'functions can not be merged into' + ); + + func.bar = 'baz'; + t.deepEqual( + utils.merge({ foo: 'bar' }, func), + { foo: 'bar', bar: 'baz' }, + 'functions can be merge sources' + ); + + t.test( + 'avoids invoking array setters unnecessarily', + { skip: typeof Object.defineProperty !== 'function' }, + function (st) { + var setCount = 0; + var getCount = 0; + var observed = []; + Object.defineProperty(observed, 0, { + get: function () { + getCount += 1; + return { bar: 'baz' }; + }, + set: function () { setCount += 1; } + }); + utils.merge(observed, [null]); + st.equal(setCount, 0); + st.equal(getCount, 1); + observed[0] = observed[0]; // eslint-disable-line no-self-assign + st.equal(setCount, 1); + st.equal(getCount, 2); + st.end(); + } + ); + + t.test('with overflow objects (from arrayLimit)', function (st) { + // arrayLimit is max index, so with limit 0, max index 0 is allowed (1 element) + // To create overflow, need 2+ elements with limit 0, or 3+ with limit 1, etc. + st.test('merges primitive into overflow object at next index', function (s2t) { + // Create an overflow object via combine: 3 elements (indices 0-2) with limit 0 + var overflow = utils.combine(['a', 'b'], 'c', 0, false); + s2t.ok(utils.isOverflow(overflow), 'overflow object is marked'); + var merged = utils.merge(overflow, 'd'); + s2t.deepEqual(merged, { 0: 'a', 1: 'b', 2: 'c', 3: 'd' }, 'adds primitive at next numeric index'); + s2t.end(); + }); + + st.test('merges primitive into regular object with numeric keys normally', function (s2t) { + var obj = { 0: 'a', 1: 'b' }; + s2t.notOk(utils.isOverflow(obj), 'plain object is not marked as overflow'); + var merged = utils.merge(obj, 'c'); + s2t.deepEqual(merged, { 0: 'a', 1: 'b', c: true }, 'adds primitive as key (not at next index)'); + s2t.end(); + }); + + st.test('merges primitive into object with non-numeric keys normally', function (s2t) { + var obj = { foo: 'bar' }; + var merged = utils.merge(obj, 'baz'); + s2t.deepEqual(merged, { foo: 'bar', baz: true }, 'adds primitive as key with value true'); + s2t.end(); + }); + + st.test('with strictMerge, wraps object and primitive in array', function (s2t) { + var obj = { foo: 'bar' }; + var merged = utils.merge(obj, 'baz', { strictMerge: true }); + s2t.deepEqual(merged, [{ foo: 'bar' }, 'baz'], 'wraps in array with strictMerge'); + s2t.end(); + }); + + st.test('merges overflow object into primitive', function (s2t) { + // Create an overflow object via combine: 2 elements (indices 0-1) with limit 0 + var overflow = utils.combine(['a'], 'b', 0, false); + s2t.ok(utils.isOverflow(overflow), 'overflow object is marked'); + var merged = utils.merge('c', overflow); + s2t.ok(utils.isOverflow(merged), 'result is also marked as overflow'); + s2t.deepEqual(merged, { 0: 'c', 1: 'a', 2: 'b' }, 'creates object with primitive at 0, source values shifted'); + s2t.end(); + }); + + st.test('merges overflow object with multiple values into primitive', function (s2t) { + // Create an overflow object via combine: 3 elements (indices 0-2) with limit 0 + var overflow = utils.combine(['b', 'c'], 'd', 0, false); + s2t.ok(utils.isOverflow(overflow), 'overflow object is marked'); + var merged = utils.merge('a', overflow); + s2t.deepEqual(merged, { 0: 'a', 1: 'b', 2: 'c', 3: 'd' }, 'shifts all source indices by 1'); + s2t.end(); + }); + + st.test('merges regular object into primitive as array', function (s2t) { + var obj = { foo: 'bar' }; + var merged = utils.merge('a', obj); + s2t.deepEqual(merged, ['a', { foo: 'bar' }], 'creates array with primitive and object'); + s2t.end(); + }); + + st.end(); + }); + + t.end(); +}); + +test('assign()', function (t) { + var target = { a: 1, b: 2 }; + var source = { b: 3, c: 4 }; + var result = utils.assign(target, source); + + t.equal(result, target, 'returns the target'); + t.deepEqual(target, { a: 1, b: 3, c: 4 }, 'target and source are merged'); + t.deepEqual(source, { b: 3, c: 4 }, 'source is untouched'); + + t.end(); +}); + +test('combine()', function (t) { + t.test('both arrays', function (st) { + var a = [1]; + var b = [2]; + var combined = utils.combine(a, b); + + st.deepEqual(a, [1], 'a is not mutated'); + st.deepEqual(b, [2], 'b is not mutated'); + st.notEqual(a, combined, 'a !== combined'); + st.notEqual(b, combined, 'b !== combined'); + st.deepEqual(combined, [1, 2], 'combined is a + b'); + + st.end(); + }); + + t.test('one array, one non-array', function (st) { + var aN = 1; + var a = [aN]; + var bN = 2; + var b = [bN]; + + var combinedAnB = utils.combine(aN, b); + st.deepEqual(b, [bN], 'b is not mutated'); + st.notEqual(aN, combinedAnB, 'aN + b !== aN'); + st.notEqual(a, combinedAnB, 'aN + b !== a'); + st.notEqual(bN, combinedAnB, 'aN + b !== bN'); + st.notEqual(b, combinedAnB, 'aN + b !== b'); + st.deepEqual([1, 2], combinedAnB, 'first argument is array-wrapped when not an array'); + + var combinedABn = utils.combine(a, bN); + st.deepEqual(a, [aN], 'a is not mutated'); + st.notEqual(aN, combinedABn, 'a + bN !== aN'); + st.notEqual(a, combinedABn, 'a + bN !== a'); + st.notEqual(bN, combinedABn, 'a + bN !== bN'); + st.notEqual(b, combinedABn, 'a + bN !== b'); + st.deepEqual([1, 2], combinedABn, 'second argument is array-wrapped when not an array'); + + st.end(); + }); + + t.test('neither is an array', function (st) { + var combined = utils.combine(1, 2); + st.notEqual(1, combined, '1 + 2 !== 1'); + st.notEqual(2, combined, '1 + 2 !== 2'); + st.deepEqual([1, 2], combined, 'both arguments are array-wrapped when not an array'); + + st.end(); + }); + + t.test('with arrayLimit', function (st) { + st.test('under the limit', function (s2t) { + var combined = utils.combine(['a', 'b'], 'c', 10, false); + s2t.deepEqual(combined, ['a', 'b', 'c'], 'returns array when under limit'); + s2t.ok(Array.isArray(combined), 'result is an array'); + s2t.end(); + }); + + st.test('exactly at the limit stays as array', function (s2t) { + var combined = utils.combine(['a', 'b'], 'c', 3, false); + s2t.deepEqual(combined, ['a', 'b', 'c'], 'stays as array when count equals limit'); + s2t.ok(Array.isArray(combined), 'result is an array'); + s2t.end(); + }); + + st.test('over the limit', function (s2t) { + var combined = utils.combine(['a', 'b', 'c'], 'd', 3, false); + s2t.deepEqual(combined, { 0: 'a', 1: 'b', 2: 'c', 3: 'd' }, 'converts to object when over limit'); + s2t.notOk(Array.isArray(combined), 'result is not an array'); + s2t.end(); + }); + + st.test('with arrayLimit 1', function (s2t) { + var combined = utils.combine([], 'a', 1, false); + s2t.deepEqual(combined, ['a'], 'stays as array when count equals limit'); + s2t.ok(Array.isArray(combined), 'result is an array'); + s2t.end(); + }); + + st.test('with arrayLimit 0 converts single element to object', function (s2t) { + var combined = utils.combine([], 'a', 0, false); + s2t.deepEqual(combined, { 0: 'a' }, 'converts to object when count exceeds limit'); + s2t.notOk(Array.isArray(combined), 'result is not an array'); + s2t.end(); + }); + + st.test('with arrayLimit 0 and two elements converts to object', function (s2t) { + var combined = utils.combine(['a'], 'b', 0, false); + s2t.deepEqual(combined, { 0: 'a', 1: 'b' }, 'converts to object when count exceeds limit'); + s2t.notOk(Array.isArray(combined), 'result is not an array'); + s2t.end(); + }); + + st.test('with plainObjects option', function (s2t) { + var combined = utils.combine(['a', 'b'], 'c', 1, true); + var expected = { __proto__: null, 0: 'a', 1: 'b', 2: 'c' }; + s2t.deepEqual(combined, expected, 'converts to object with null prototype'); + s2t.equal(Object.getPrototypeOf(combined), null, 'result has null prototype when plainObjects is true'); + s2t.end(); + }); + + st.end(); + }); + + t.test('with existing overflow object', function (st) { + st.test('adds to existing overflow object at next index', function (s2t) { + // Create overflow object first via combine: 3 elements (indices 0-2) with limit 0 + var overflow = utils.combine(['a', 'b'], 'c', 0, false); + s2t.ok(utils.isOverflow(overflow), 'initial object is marked as overflow'); + + var combined = utils.combine(overflow, 'd', 10, false); + s2t.equal(combined, overflow, 'returns the same object (mutated)'); + s2t.deepEqual(combined, { 0: 'a', 1: 'b', 2: 'c', 3: 'd' }, 'adds value at next numeric index'); + s2t.end(); + }); + + st.test('does not treat plain object with numeric keys as overflow', function (s2t) { + var plainObj = { 0: 'a', 1: 'b' }; + s2t.notOk(utils.isOverflow(plainObj), 'plain object is not marked as overflow'); + + // combine treats this as a regular value, not an overflow object to append to + var combined = utils.combine(plainObj, 'c', 10, false); + s2t.deepEqual(combined, [{ 0: 'a', 1: 'b' }, 'c'], 'concatenates as regular values'); + s2t.end(); + }); + + st.end(); + }); + + t.end(); +}); + +test('decode', function (t) { + t.equal( + utils.decode('a+b'), + 'a b', + 'decodes + to space' + ); + + t.equal( + utils.decode('name%2Eobj'), + 'name.obj', + 'decodes a string' + ); + t.equal( + utils.decode('name%2Eobj%2Efoo', null, 'iso-8859-1'), + 'name.obj.foo', + 'decodes a string in iso-8859-1' + ); + + t.end(); +}); + +test('encode', function (t) { + forEach(v.nullPrimitives, function (nullish) { + t['throws']( + function () { utils.encode(nullish); }, + TypeError, + inspect(nullish) + ' is not a string' + ); + }); + + t.equal(utils.encode(''), '', 'empty string returns itself'); + t.deepEqual(utils.encode([]), [], 'empty array returns itself'); + t.deepEqual(utils.encode({ length: 0 }), { length: 0 }, 'empty arraylike returns itself'); + + t.test('symbols', { skip: !v.hasSymbols }, function (st) { + st.equal(utils.encode(Symbol('x')), 'Symbol%28x%29', 'symbol is encoded'); + + st.end(); + }); + + t.equal( + utils.encode('(abc)'), + '%28abc%29', + 'encodes parentheses' + ); + t.equal( + utils.encode({ toString: function () { return '(abc)'; } }), + '%28abc%29', + 'toStrings and encodes parentheses' + ); + + t.equal( + utils.encode('abc 123 💩', null, 'iso-8859-1'), + 'abc%20123%20%26%2355357%3B%26%2356489%3B', + 'encodes in iso-8859-1' + ); + + var longString = ''; + var expectedString = ''; + for (var i = 0; i < 1500; i++) { + longString += ' '; + expectedString += '%20'; + } + + t.equal( + utils.encode(longString), + expectedString, + 'encodes a long string' + ); + + t.equal( + utils.encode('\x28\x29'), + '%28%29', + 'encodes parens normally' + ); + t.equal( + utils.encode('\x28\x29', null, null, null, 'RFC1738'), + '()', + 'does not encode parens in RFC1738' + ); + + // todo RFC1738 format + + t.equal( + utils.encode('Āက豈'), + '%C4%80%E1%80%80%EF%A4%80', + 'encodes multibyte chars' + ); + + t.equal( + utils.encode('\uD83D \uDCA9'), + '%F0%9F%90%A0%F0%BA%90%80', + 'encodes lone surrogates' + ); + + t.end(); +}); + +test('isBuffer()', function (t) { + forEach([null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], function () {}, /a/g], function (x) { + t.equal(utils.isBuffer(x), false, inspect(x) + ' is not a buffer'); + }); + + var fakeBuffer = { constructor: Buffer }; + t.equal(utils.isBuffer(fakeBuffer), false, 'fake buffer is not a buffer'); + + var saferBuffer = SaferBuffer.from('abc'); + t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer'); + + var buffer = Buffer.from && Buffer.alloc ? Buffer.from('abc') : new Buffer('abc'); + t.equal(utils.isBuffer(buffer), true, 'real Buffer instance is a buffer'); + t.end(); +}); + +test('isRegExp()', function (t) { + t.equal(utils.isRegExp(/a/g), true, 'RegExp is a RegExp'); + t.equal(utils.isRegExp(new RegExp('a', 'g')), true, 'new RegExp is a RegExp'); + t.equal(utils.isRegExp(new Date()), false, 'Date is not a RegExp'); + + forEach(v.primitives, function (primitive) { + t.equal(utils.isRegExp(primitive), false, inspect(primitive) + ' is not a RegExp'); + }); + + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/range-parser/HISTORY.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/range-parser/HISTORY.md new file mode 100644 index 0000000..70a973d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/range-parser/HISTORY.md @@ -0,0 +1,56 @@ +1.2.1 / 2019-05-10 +================== + + * Improve error when `str` is not a string + +1.2.0 / 2016-06-01 +================== + + * Add `combine` option to combine overlapping ranges + +1.1.0 / 2016-05-13 +================== + + * Fix incorrectly returning -1 when there is at least one valid range + * perf: remove internal function + +1.0.3 / 2015-10-29 +================== + + * perf: enable strict mode + +1.0.2 / 2014-09-08 +================== + + * Support Node.js 0.6 + +1.0.1 / 2014-09-07 +================== + + * Move repository to jshttp + +1.0.0 / 2013-12-11 +================== + + * Add repository to package.json + * Add MIT license + +0.0.4 / 2012-06-17 +================== + + * Change ret -1 for unsatisfiable and -2 when invalid + +0.0.3 / 2012-06-17 +================== + + * Fix last-byte-pos default to len - 1 + +0.0.2 / 2012-06-14 +================== + + * Add `.type` + +0.0.1 / 2012-06-11 +================== + + * Initial release diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/range-parser/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/range-parser/LICENSE new file mode 100644 index 0000000..3599954 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/range-parser/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2012-2014 TJ Holowaychuk +Copyright (c) 2015-2016 Douglas Christopher Wilson + +```js +var parseRange = require('range-parser') +``` + +### parseRange(size, header, options) + +Parse the given `header` string where `size` is the maximum size of the resource. +An array of ranges will be returned or negative numbers indicating an error parsing. + + * `-2` signals a malformed header string + * `-1` signals an unsatisfiable range + + + +```js +// parse header from request +var range = parseRange(size, req.headers.range) + +// the type of the range +if (range.type === 'bytes') { + // the ranges + range.forEach(function (r) { + // do something with r.start and r.end + }) +} +``` + +#### Options + +These properties are accepted in the options object. + +##### combine + +Specifies if overlapping & adjacent ranges should be combined, defaults to `false`. +When `true`, ranges will be combined and returned as if they were specified that +way in the header. + + + +```js +parseRange(100, 'bytes=50-55,0-10,5-10,56-60', { combine: true }) +// => [ +// { start: 0, end: 10 }, +// { start: 50, end: 60 } +// ] +``` + +## License + +[MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/range-parser/master +[coveralls-url]: https://coveralls.io/r/jshttp/range-parser?branch=master +[node-image]: https://badgen.net/npm/node/range-parser +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/range-parser +[npm-url]: https://npmjs.org/package/range-parser +[npm-version-image]: https://badgen.net/npm/v/range-parser +[travis-image]: https://badgen.net/travis/jshttp/range-parser/master +[travis-url]: https://travis-ci.org/jshttp/range-parser diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/range-parser/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/range-parser/index.js new file mode 100644 index 0000000..b7dc5c0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/range-parser/index.js @@ -0,0 +1,162 @@ +/*! + * range-parser + * Copyright(c) 2012-2014 TJ Holowaychuk + * Copyright(c) 2015-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = rangeParser + +/** + * Parse "Range" header `str` relative to the given file `size`. + * + * @param {Number} size + * @param {String} str + * @param {Object} [options] + * @return {Array} + * @public + */ + +function rangeParser (size, str, options) { + if (typeof str !== 'string') { + throw new TypeError('argument str must be a string') + } + + var index = str.indexOf('=') + + if (index === -1) { + return -2 + } + + // split the range string + var arr = str.slice(index + 1).split(',') + var ranges = [] + + // add ranges type + ranges.type = str.slice(0, index) + + // parse all ranges + for (var i = 0; i < arr.length; i++) { + var range = arr[i].split('-') + var start = parseInt(range[0], 10) + var end = parseInt(range[1], 10) + + // -nnn + if (isNaN(start)) { + start = size - end + end = size - 1 + // nnn- + } else if (isNaN(end)) { + end = size - 1 + } + + // limit last-byte-pos to current length + if (end > size - 1) { + end = size - 1 + } + + // invalid or unsatisifiable + if (isNaN(start) || isNaN(end) || start > end || start < 0) { + continue + } + + // add range + ranges.push({ + start: start, + end: end + }) + } + + if (ranges.length < 1) { + // unsatisifiable + return -1 + } + + return options && options.combine + ? combineRanges(ranges) + : ranges +} + +/** + * Combine overlapping & adjacent ranges. + * @private + */ + +function combineRanges (ranges) { + var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart) + + for (var j = 0, i = 1; i < ordered.length; i++) { + var range = ordered[i] + var current = ordered[j] + + if (range.start > current.end + 1) { + // next range + ordered[++j] = range + } else if (range.end > current.end) { + // extend range + current.end = range.end + current.index = Math.min(current.index, range.index) + } + } + + // trim ordered array + ordered.length = j + 1 + + // generate combined range + var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex) + + // copy ranges type + combined.type = ranges.type + + return combined +} + +/** + * Map function to add index value to ranges. + * @private + */ + +function mapWithIndex (range, index) { + return { + start: range.start, + end: range.end, + index: index + } +} + +/** + * Map function to remove index value from ranges. + * @private + */ + +function mapWithoutIndex (range) { + return { + start: range.start, + end: range.end + } +} + +/** + * Sort function to sort ranges by index. + * @private + */ + +function sortByRangeIndex (a, b) { + return a.index - b.index +} + +/** + * Sort function to sort ranges by start position. + * @private + */ + +function sortByRangeStart (a, b) { + return a.start - b.start +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/range-parser/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/range-parser/package.json new file mode 100644 index 0000000..abea6d8 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/range-parser/package.json @@ -0,0 +1,44 @@ +{ + "name": "range-parser", + "author": "TJ Holowaychuk (http://tjholowaychuk.com)", + "description": "Range header field string parser", + "version": "1.2.1", + "contributors": [ + "Douglas Christopher Wilson ", + "James Wyatt Cready ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "keywords": [ + "range", + "parser", + "http" + ], + "repository": "jshttp/range-parser", + "devDependencies": { + "deep-equal": "1.0.1", + "eslint": "5.16.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-markdown": "1.0.0", + "eslint-plugin-import": "2.17.2", + "eslint-plugin-node": "8.0.1", + "eslint-plugin-promise": "4.1.1", + "eslint-plugin-standard": "4.0.0", + "mocha": "6.1.4", + "nyc": "14.1.1" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-travis": "nyc --reporter=text npm test" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/raw-body/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/raw-body/LICENSE new file mode 100644 index 0000000..1029a7a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/raw-body/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2013-2014 Jonathan Ong +Copyright (c) 2014-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/raw-body/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/raw-body/README.md new file mode 100644 index 0000000..d9b36d6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/raw-body/README.md @@ -0,0 +1,223 @@ +# raw-body + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build status][github-actions-ci-image]][github-actions-ci-url] +[![Test coverage][coveralls-image]][coveralls-url] + +Gets the entire buffer of a stream either as a `Buffer` or a string. +Validates the stream's length against an expected length and maximum limit. +Ideal for parsing request bodies. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install raw-body +``` + +### TypeScript + +This module includes a [TypeScript](https://www.typescriptlang.org/) +declaration file to enable auto complete in compatible editors and type +information for TypeScript projects. This module depends on the Node.js +types, so install `@types/node`: + +```sh +$ npm install @types/node +``` + +## API + +```js +var getRawBody = require('raw-body') +``` + +### getRawBody(stream, [options], [callback]) + +**Returns a promise if no callback specified and global `Promise` exists.** + +Options: + +- `length` - The length of the stream. + If the contents of the stream do not add up to this length, + an `400` error code is returned. +- `limit` - The byte limit of the body. + This is the number of bytes or any string format supported by + [bytes](https://www.npmjs.com/package/bytes), + for example `1000`, `'500kb'` or `'3mb'`. + If the body ends up being larger than this limit, + a `413` error code is returned. +- `encoding` - The encoding to use to decode the body into a string. + By default, a `Buffer` instance will be returned when no encoding is specified. + Most likely, you want `utf-8`, so setting `encoding` to `true` will decode as `utf-8`. + You can use any type of encoding supported by [iconv-lite](https://www.npmjs.org/package/iconv-lite#readme). + +You can also pass a string in place of options to just specify the encoding. + +If an error occurs, the stream will be paused, everything unpiped, +and you are responsible for correctly disposing the stream. +For HTTP requests, you may need to finish consuming the stream if +you want to keep the socket open for future requests. For streams +that use file descriptors, you should `stream.destroy()` or +`stream.close()` to prevent leaks. + +## Errors + +This module creates errors depending on the error condition during reading. +The error may be an error from the underlying Node.js implementation, but is +otherwise an error created by this module, which has the following attributes: + + * `limit` - the limit in bytes + * `length` and `expected` - the expected length of the stream + * `received` - the received bytes + * `encoding` - the invalid encoding + * `status` and `statusCode` - the corresponding status code for the error + * `type` - the error type + +### Types + +The errors from this module have a `type` property which allows for the programmatic +determination of the type of error returned. + +#### encoding.unsupported + +This error will occur when the `encoding` option is specified, but the value does +not map to an encoding supported by the [iconv-lite](https://www.npmjs.org/package/iconv-lite#readme) +module. + +#### entity.too.large + +This error will occur when the `limit` option is specified, but the stream has +an entity that is larger. + +#### request.aborted + +This error will occur when the request stream is aborted by the client before +reading the body has finished. + +#### request.size.invalid + +This error will occur when the `length` option is specified, but the stream has +emitted more bytes. + +#### stream.encoding.set + +This error will occur when the given stream has an encoding set on it, making it +a decoded stream. The stream should not have an encoding set and is expected to +emit `Buffer` objects. + +#### stream.not.readable + +This error will occur when the given stream is not readable. + +## Examples + +### Simple Express example + +```js +var contentType = require('content-type') +var express = require('express') +var getRawBody = require('raw-body') + +var app = express() + +app.use(function (req, res, next) { + getRawBody(req, { + length: req.headers['content-length'], + limit: '1mb', + encoding: contentType.parse(req).parameters.charset + }, function (err, string) { + if (err) return next(err) + req.text = string + next() + }) +}) + +// now access req.text +``` + +### Simple Koa example + +```js +var contentType = require('content-type') +var getRawBody = require('raw-body') +var koa = require('koa') + +var app = koa() + +app.use(function * (next) { + this.text = yield getRawBody(this.req, { + length: this.req.headers['content-length'], + limit: '1mb', + encoding: contentType.parse(this.req).parameters.charset + }) + yield next +}) + +// now access this.text +``` + +### Using as a promise + +To use this library as a promise, simply omit the `callback` and a promise is +returned, provided that a global `Promise` is defined. + +```js +var getRawBody = require('raw-body') +var http = require('http') + +var server = http.createServer(function (req, res) { + getRawBody(req) + .then(function (buf) { + res.statusCode = 200 + res.end(buf.length + ' bytes submitted') + }) + .catch(function (err) { + res.statusCode = 500 + res.end(err.message) + }) +}) + +server.listen(3000) +``` + +### Using with TypeScript + +```ts +import * as getRawBody from 'raw-body'; +import * as http from 'http'; + +const server = http.createServer((req, res) => { + getRawBody(req) + .then((buf) => { + res.statusCode = 200; + res.end(buf.length + ' bytes submitted'); + }) + .catch((err) => { + res.statusCode = err.statusCode; + res.end(err.message); + }); +}); + +server.listen(3000); +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/raw-body.svg +[npm-url]: https://npmjs.org/package/raw-body +[node-version-image]: https://img.shields.io/node/v/raw-body.svg +[node-version-url]: https://nodejs.org/en/download/ +[coveralls-image]: https://img.shields.io/coveralls/stream-utils/raw-body/master.svg +[coveralls-url]: https://coveralls.io/r/stream-utils/raw-body?branch=master +[downloads-image]: https://img.shields.io/npm/dm/raw-body.svg +[downloads-url]: https://npmjs.org/package/raw-body +[github-actions-ci-image]: https://img.shields.io/github/actions/workflow/status/stream-utils/raw-body/ci.yml?branch=master&label=ci +[github-actions-ci-url]: https://github.com/jshttp/stream-utils/raw-body?query=workflow%3Aci diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/raw-body/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/raw-body/index.d.ts new file mode 100644 index 0000000..b504611 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/raw-body/index.d.ts @@ -0,0 +1,85 @@ +declare namespace getRawBody { + export type Encoding = string | true; + + export interface Options { + /** + * The expected length of the stream. + */ + length?: number | string | null; + /** + * The byte limit of the body. This is the number of bytes or any string + * format supported by `bytes`, for example `1000`, `'500kb'` or `'3mb'`. + */ + limit?: number | string | null; + /** + * The encoding to use to decode the body into a string. By default, a + * `Buffer` instance will be returned when no encoding is specified. Most + * likely, you want `utf-8`, so setting encoding to `true` will decode as + * `utf-8`. You can use any type of encoding supported by `iconv-lite`. + */ + encoding?: Encoding | null; + } + + export interface RawBodyError extends Error { + /** + * The limit in bytes. + */ + limit?: number; + /** + * The expected length of the stream. + */ + length?: number; + expected?: number; + /** + * The received bytes. + */ + received?: number; + /** + * The encoding. + */ + encoding?: string; + /** + * The corresponding status code for the error. + */ + status: number; + statusCode: number; + /** + * The error type. + */ + type: string; + } +} + +/** + * Gets the entire buffer of a stream either as a `Buffer` or a string. + * Validates the stream's length against an expected length and maximum + * limit. Ideal for parsing request bodies. + */ +declare function getRawBody( + stream: NodeJS.ReadableStream, + callback: (err: getRawBody.RawBodyError, body: Buffer) => void +): void; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options: (getRawBody.Options & { encoding: getRawBody.Encoding }) | getRawBody.Encoding, + callback: (err: getRawBody.RawBodyError, body: string) => void +): void; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options: getRawBody.Options, + callback: (err: getRawBody.RawBodyError, body: Buffer) => void +): void; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options: (getRawBody.Options & { encoding: getRawBody.Encoding }) | getRawBody.Encoding +): Promise; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options?: getRawBody.Options +): Promise; + +export = getRawBody; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/raw-body/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/raw-body/index.js new file mode 100644 index 0000000..9cdcd12 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/raw-body/index.js @@ -0,0 +1,336 @@ +/*! + * raw-body + * Copyright(c) 2013-2014 Jonathan Ong + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var asyncHooks = tryRequireAsyncHooks() +var bytes = require('bytes') +var createError = require('http-errors') +var iconv = require('iconv-lite') +var unpipe = require('unpipe') + +/** + * Module exports. + * @public + */ + +module.exports = getRawBody + +/** + * Module variables. + * @private + */ + +var ICONV_ENCODING_MESSAGE_REGEXP = /^Encoding not recognized: / + +/** + * Get the decoder for a given encoding. + * + * @param {string} encoding + * @private + */ + +function getDecoder (encoding) { + if (!encoding) return null + + try { + return iconv.getDecoder(encoding) + } catch (e) { + // error getting decoder + if (!ICONV_ENCODING_MESSAGE_REGEXP.test(e.message)) throw e + + // the encoding was not found + throw createError(415, 'specified encoding unsupported', { + encoding: encoding, + type: 'encoding.unsupported' + }) + } +} + +/** + * Get the raw body of a stream (typically HTTP). + * + * @param {object} stream + * @param {object|string|function} [options] + * @param {function} [callback] + * @public + */ + +function getRawBody (stream, options, callback) { + var done = callback + var opts = options || {} + + // light validation + if (stream === undefined) { + throw new TypeError('argument stream is required') + } else if (typeof stream !== 'object' || stream === null || typeof stream.on !== 'function') { + throw new TypeError('argument stream must be a stream') + } + + if (options === true || typeof options === 'string') { + // short cut for encoding + opts = { + encoding: options + } + } + + if (typeof options === 'function') { + done = options + opts = {} + } + + // validate callback is a function, if provided + if (done !== undefined && typeof done !== 'function') { + throw new TypeError('argument callback must be a function') + } + + // require the callback without promises + if (!done && !global.Promise) { + throw new TypeError('argument callback is required') + } + + // get encoding + var encoding = opts.encoding !== true + ? opts.encoding + : 'utf-8' + + // convert the limit to an integer + var limit = bytes.parse(opts.limit) + + // convert the expected length to an integer + var length = opts.length != null && !isNaN(opts.length) + ? parseInt(opts.length, 10) + : null + + if (done) { + // classic callback style + return readStream(stream, encoding, length, limit, wrap(done)) + } + + return new Promise(function executor (resolve, reject) { + readStream(stream, encoding, length, limit, function onRead (err, buf) { + if (err) return reject(err) + resolve(buf) + }) + }) +} + +/** + * Halt a stream. + * + * @param {Object} stream + * @private + */ + +function halt (stream) { + // unpipe everything from the stream + unpipe(stream) + + // pause stream + if (typeof stream.pause === 'function') { + stream.pause() + } +} + +/** + * Read the data from the stream. + * + * @param {object} stream + * @param {string} encoding + * @param {number} length + * @param {number} limit + * @param {function} callback + * @public + */ + +function readStream (stream, encoding, length, limit, callback) { + var complete = false + var sync = true + + // check the length and limit options. + // note: we intentionally leave the stream paused, + // so users should handle the stream themselves. + if (limit !== null && length !== null && length > limit) { + return done(createError(413, 'request entity too large', { + expected: length, + length: length, + limit: limit, + type: 'entity.too.large' + })) + } + + // streams1: assert request encoding is buffer. + // streams2+: assert the stream encoding is buffer. + // stream._decoder: streams1 + // state.encoding: streams2 + // state.decoder: streams2, specifically < 0.10.6 + var state = stream._readableState + if (stream._decoder || (state && (state.encoding || state.decoder))) { + // developer error + return done(createError(500, 'stream encoding should not be set', { + type: 'stream.encoding.set' + })) + } + + if (typeof stream.readable !== 'undefined' && !stream.readable) { + return done(createError(500, 'stream is not readable', { + type: 'stream.not.readable' + })) + } + + var received = 0 + var decoder + + try { + decoder = getDecoder(encoding) + } catch (err) { + return done(err) + } + + var buffer = decoder + ? '' + : [] + + // attach listeners + stream.on('aborted', onAborted) + stream.on('close', cleanup) + stream.on('data', onData) + stream.on('end', onEnd) + stream.on('error', onEnd) + + // mark sync section complete + sync = false + + function done () { + var args = new Array(arguments.length) + + // copy arguments + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + + // mark complete + complete = true + + if (sync) { + process.nextTick(invokeCallback) + } else { + invokeCallback() + } + + function invokeCallback () { + cleanup() + + if (args[0]) { + // halt the stream on error + halt(stream) + } + + callback.apply(null, args) + } + } + + function onAborted () { + if (complete) return + + done(createError(400, 'request aborted', { + code: 'ECONNABORTED', + expected: length, + length: length, + received: received, + type: 'request.aborted' + })) + } + + function onData (chunk) { + if (complete) return + + received += chunk.length + + if (limit !== null && received > limit) { + done(createError(413, 'request entity too large', { + limit: limit, + received: received, + type: 'entity.too.large' + })) + } else if (decoder) { + buffer += decoder.write(chunk) + } else { + buffer.push(chunk) + } + } + + function onEnd (err) { + if (complete) return + if (err) return done(err) + + if (length !== null && received !== length) { + done(createError(400, 'request size did not match content length', { + expected: length, + length: length, + received: received, + type: 'request.size.invalid' + })) + } else { + var string = decoder + ? buffer + (decoder.end() || '') + : Buffer.concat(buffer) + done(null, string) + } + } + + function cleanup () { + buffer = null + + stream.removeListener('aborted', onAborted) + stream.removeListener('data', onData) + stream.removeListener('end', onEnd) + stream.removeListener('error', onEnd) + stream.removeListener('close', cleanup) + } +} + +/** + * Try to require async_hooks + * @private + */ + +function tryRequireAsyncHooks () { + try { + return require('async_hooks') + } catch (e) { + return {} + } +} + +/** + * Wrap function with async resource, if possible. + * AsyncResource.bind static method backported. + * @private + */ + +function wrap (fn) { + var res + + // create anonymous resource + if (asyncHooks.AsyncResource) { + res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn') + } + + // incompatible node.js + if (!res || !res.runInAsyncScope) { + return fn + } + + // return bound function + return res.runInAsyncScope.bind(res, fn, null) +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/raw-body/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/raw-body/package.json new file mode 100644 index 0000000..eab819f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/raw-body/package.json @@ -0,0 +1,46 @@ +{ + "name": "raw-body", + "description": "Get and validate the raw body of a readable stream.", + "version": "3.0.2", + "author": "Jonathan Ong (http://jongleberry.com)", + "contributors": [ + "Douglas Christopher Wilson ", + "Raynos " + ], + "license": "MIT", + "repository": "stream-utils/raw-body", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "devDependencies": { + "@stylistic/eslint-plugin": "^5.1.0", + "@stylistic/eslint-plugin-js": "^4.1.0", + "bluebird": "3.7.2", + "eslint": "^9.0.0", + "mocha": "10.7.0", + "neostandard": "^0.12.0", + "nyc": "17.0.0", + "readable-stream": "2.3.7", + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "LICENSE", + "README.md", + "index.d.ts", + "index.js" + ], + "scripts": { + "lint": "eslint", + "lint:fix": "eslint --fix", + "test": "mocha --trace-deprecation --reporter spec --check-leaks test/", + "test:ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test:cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/readdirp/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/readdirp/LICENSE new file mode 100644 index 0000000..037cbb4 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/readdirp/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/readdirp/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/readdirp/README.md new file mode 100644 index 0000000..465593c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/readdirp/README.md @@ -0,0 +1,122 @@ +# readdirp [![Weekly downloads](https://img.shields.io/npm/dw/readdirp.svg)](https://github.com/paulmillr/readdirp) + +Recursive version of [fs.readdir](https://nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback). Exposes a **stream API** and a **promise API**. + + +```sh +npm install readdirp +``` + +```javascript +const readdirp = require('readdirp'); + +// Use streams to achieve small RAM & CPU footprint. +// 1) Streams example with for-await. +for await (const entry of readdirp('.')) { + const {path} = entry; + console.log(`${JSON.stringify({path})}`); +} + +// 2) Streams example, non for-await. +// Print out all JS files along with their size within the current folder & subfolders. +readdirp('.', {fileFilter: '*.js', alwaysStat: true}) + .on('data', (entry) => { + const {path, stats: {size}} = entry; + console.log(`${JSON.stringify({path, size})}`); + }) + // Optionally call stream.destroy() in `warn()` in order to abort and cause 'close' to be emitted + .on('warn', error => console.error('non-fatal error', error)) + .on('error', error => console.error('fatal error', error)) + .on('end', () => console.log('done')); + +// 3) Promise example. More RAM and CPU than streams / for-await. +const files = await readdirp.promise('.'); +console.log(files.map(file => file.path)); + +// Other options. +readdirp('test', { + fileFilter: '*.js', + directoryFilter: ['!.git', '!*modules'] + // directoryFilter: (di) => di.basename.length === 9 + type: 'files_directories', + depth: 1 +}); +``` + +For more examples, check out `examples` directory. + +## API + +`const stream = readdirp(root[, options])` — **Stream API** + +- Reads given root recursively and returns a `stream` of [entry infos](#entryinfo) +- Optionally can be used like `for await (const entry of stream)` with node.js 10+ (`asyncIterator`). +- `on('data', (entry) => {})` [entry info](#entryinfo) for every file / dir. +- `on('warn', (error) => {})` non-fatal `Error` that prevents a file / dir from being processed. Example: inaccessible to the user. +- `on('error', (error) => {})` fatal `Error` which also ends the stream. Example: illegal options where passed. +- `on('end')` — we are done. Called when all entries were found and no more will be emitted. +- `on('close')` — stream is destroyed via `stream.destroy()`. + Could be useful if you want to manually abort even on a non fatal error. + At that point the stream is no longer `readable` and no more entries, warning or errors are emitted +- To learn more about streams, consult the very detailed [nodejs streams documentation](https://nodejs.org/api/stream.html) + or the [stream-handbook](https://github.com/substack/stream-handbook) + +`const entries = await readdirp.promise(root[, options])` — **Promise API**. Returns a list of [entry infos](#entryinfo). + +First argument is awalys `root`, path in which to start reading and recursing into subdirectories. + +### options + +- `fileFilter: ["*.js"]`: filter to include or exclude files. A `Function`, Glob string or Array of glob strings. + - **Function**: a function that takes an entry info as a parameter and returns true to include or false to exclude the entry + - **Glob string**: a string (e.g., `*.js`) which is matched using [picomatch](https://github.com/micromatch/picomatch), so go there for more + information. Globstars (`**`) are not supported since specifying a recursive pattern for an already recursive function doesn't make sense. Negated globs (as explained in the minimatch documentation) are allowed, e.g., `!*.txt` matches everything but text files. + - **Array of glob strings**: either need to be all inclusive or all exclusive (negated) patterns otherwise an error is thrown. + `['*.json', '*.js']` includes all JavaScript and Json files. + `['!.git', '!node_modules']` includes all directories except the '.git' and 'node_modules'. + - Directories that do not pass a filter will not be recursed into. +- `directoryFilter: ['!.git']`: filter to include/exclude directories found and to recurse into. Directories that do not pass a filter will not be recursed into. +- `depth: 5`: depth at which to stop recursing even if more subdirectories are found +- `type: 'files'`: determines if data events on the stream should be emitted for `'files'` (default), `'directories'`, `'files_directories'`, or `'all'`. Setting to `'all'` will also include entries for other types of file descriptors like character devices, unix sockets and named pipes. +- `alwaysStat: false`: always return `stats` property for every file. Default is `false`, readdirp will return `Dirent` entries. Setting it to `true` can double readdir execution time - use it only when you need file `size`, `mtime` etc. Cannot be enabled on node <10.10.0. +- `lstat: false`: include symlink entries in the stream along with files. When `true`, `fs.lstat` would be used instead of `fs.stat` + +### `EntryInfo` + +Has the following properties: + +- `path: 'assets/javascripts/react.js'`: path to the file/directory (relative to given root) +- `fullPath: '/Users/dev/projects/app/assets/javascripts/react.js'`: full path to the file/directory found +- `basename: 'react.js'`: name of the file/directory +- `dirent: fs.Dirent`: built-in [dir entry object](https://nodejs.org/api/fs.html#fs_class_fs_dirent) - only with `alwaysStat: false` +- `stats: fs.Stats`: built in [stat object](https://nodejs.org/api/fs.html#fs_class_fs_stats) - only with `alwaysStat: true` + +## Changelog + +- 3.5 (Oct 13, 2020) disallows recursive directory-based symlinks. + Before, it could have entered infinite loop. +- 3.4 (Mar 19, 2020) adds support for directory-based symlinks. +- 3.3 (Dec 6, 2019) stabilizes RAM consumption and enables perf management with `highWaterMark` option. Fixes race conditions related to `for-await` looping. +- 3.2 (Oct 14, 2019) improves performance by 250% and makes streams implementation more idiomatic. +- 3.1 (Jul 7, 2019) brings `bigint` support to `stat` output on Windows. This is backwards-incompatible for some cases. Be careful. It you use it incorrectly, you'll see "TypeError: Cannot mix BigInt and other types, use explicit conversions". +- 3.0 brings huge performance improvements and stream backpressure support. +- Upgrading 2.x to 3.x: + - Signature changed from `readdirp(options)` to `readdirp(root, options)` + - Replaced callback API with promise API. + - Renamed `entryType` option to `type` + - Renamed `entryType: 'both'` to `'files_directories'` + - `EntryInfo` + - Renamed `stat` to `stats` + - Emitted only when `alwaysStat: true` + - `dirent` is emitted instead of `stats` by default with `alwaysStat: false` + - Renamed `name` to `basename` + - Removed `parentDir` and `fullParentDir` properties +- Supported node.js versions: + - 3.x: node 8+ + - 2.x: node 0.6+ + +## License + +Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller () + +MIT License, see [LICENSE](LICENSE) file. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/readdirp/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/readdirp/index.d.ts new file mode 100644 index 0000000..cbbd76c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/readdirp/index.d.ts @@ -0,0 +1,43 @@ +// TypeScript Version: 3.2 + +/// + +import * as fs from 'fs'; +import { Readable } from 'stream'; + +declare namespace readdir { + interface EntryInfo { + path: string; + fullPath: string; + basename: string; + stats?: fs.Stats; + dirent?: fs.Dirent; + } + + interface ReaddirpOptions { + root?: string; + fileFilter?: string | string[] | ((entry: EntryInfo) => boolean); + directoryFilter?: string | string[] | ((entry: EntryInfo) => boolean); + type?: 'files' | 'directories' | 'files_directories' | 'all'; + lstat?: boolean; + depth?: number; + alwaysStat?: boolean; + } + + interface ReaddirpStream extends Readable, AsyncIterable { + read(): EntryInfo; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + function promise( + root: string, + options?: ReaddirpOptions + ): Promise; +} + +declare function readdir( + root: string, + options?: readdir.ReaddirpOptions +): readdir.ReaddirpStream; + +export = readdir; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/readdirp/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/readdirp/index.js new file mode 100644 index 0000000..cf739b2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/readdirp/index.js @@ -0,0 +1,287 @@ +'use strict'; + +const fs = require('fs'); +const { Readable } = require('stream'); +const sysPath = require('path'); +const { promisify } = require('util'); +const picomatch = require('picomatch'); + +const readdir = promisify(fs.readdir); +const stat = promisify(fs.stat); +const lstat = promisify(fs.lstat); +const realpath = promisify(fs.realpath); + +/** + * @typedef {Object} EntryInfo + * @property {String} path + * @property {String} fullPath + * @property {fs.Stats=} stats + * @property {fs.Dirent=} dirent + * @property {String} basename + */ + +const BANG = '!'; +const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR'; +const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]); +const FILE_TYPE = 'files'; +const DIR_TYPE = 'directories'; +const FILE_DIR_TYPE = 'files_directories'; +const EVERYTHING_TYPE = 'all'; +const ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]; + +const isNormalFlowError = error => NORMAL_FLOW_ERRORS.has(error.code); +const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10)); +const wantBigintFsStats = process.platform === 'win32' && (maj > 10 || (maj === 10 && min >= 5)); + +const normalizeFilter = filter => { + if (filter === undefined) return; + if (typeof filter === 'function') return filter; + + if (typeof filter === 'string') { + const glob = picomatch(filter.trim()); + return entry => glob(entry.basename); + } + + if (Array.isArray(filter)) { + const positive = []; + const negative = []; + for (const item of filter) { + const trimmed = item.trim(); + if (trimmed.charAt(0) === BANG) { + negative.push(picomatch(trimmed.slice(1))); + } else { + positive.push(picomatch(trimmed)); + } + } + + if (negative.length > 0) { + if (positive.length > 0) { + return entry => + positive.some(f => f(entry.basename)) && !negative.some(f => f(entry.basename)); + } + return entry => !negative.some(f => f(entry.basename)); + } + return entry => positive.some(f => f(entry.basename)); + } +}; + +class ReaddirpStream extends Readable { + static get defaultOptions() { + return { + root: '.', + /* eslint-disable no-unused-vars */ + fileFilter: (path) => true, + directoryFilter: (path) => true, + /* eslint-enable no-unused-vars */ + type: FILE_TYPE, + lstat: false, + depth: 2147483648, + alwaysStat: false + }; + } + + constructor(options = {}) { + super({ + objectMode: true, + autoDestroy: true, + highWaterMark: options.highWaterMark || 4096 + }); + const opts = { ...ReaddirpStream.defaultOptions, ...options }; + const { root, type } = opts; + + this._fileFilter = normalizeFilter(opts.fileFilter); + this._directoryFilter = normalizeFilter(opts.directoryFilter); + + const statMethod = opts.lstat ? lstat : stat; + // Use bigint stats if it's windows and stat() supports options (node 10+). + if (wantBigintFsStats) { + this._stat = path => statMethod(path, { bigint: true }); + } else { + this._stat = statMethod; + } + + this._maxDepth = opts.depth; + this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsEverything = type === EVERYTHING_TYPE; + this._root = sysPath.resolve(root); + this._isDirent = ('Dirent' in fs) && !opts.alwaysStat; + this._statsProp = this._isDirent ? 'dirent' : 'stats'; + this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent }; + + // Launch stream with one parent, the root dir. + this.parents = [this._exploreDir(root, 1)]; + this.reading = false; + this.parent = undefined; + } + + async _read(batch) { + if (this.reading) return; + this.reading = true; + + try { + while (!this.destroyed && batch > 0) { + const { path, depth, files = [] } = this.parent || {}; + + if (files.length > 0) { + const slice = files.splice(0, batch).map(dirent => this._formatEntry(dirent, path)); + for (const entry of await Promise.all(slice)) { + if (this.destroyed) return; + + const entryType = await this._getEntryType(entry); + if (entryType === 'directory' && this._directoryFilter(entry)) { + if (depth <= this._maxDepth) { + this.parents.push(this._exploreDir(entry.fullPath, depth + 1)); + } + + if (this._wantsDir) { + this.push(entry); + batch--; + } + } else if ((entryType === 'file' || this._includeAsFile(entry)) && this._fileFilter(entry)) { + if (this._wantsFile) { + this.push(entry); + batch--; + } + } + } + } else { + const parent = this.parents.pop(); + if (!parent) { + this.push(null); + break; + } + this.parent = await parent; + if (this.destroyed) return; + } + } + } catch (error) { + this.destroy(error); + } finally { + this.reading = false; + } + } + + async _exploreDir(path, depth) { + let files; + try { + files = await readdir(path, this._rdOptions); + } catch (error) { + this._onError(error); + } + return { files, depth, path }; + } + + async _formatEntry(dirent, path) { + let entry; + try { + const basename = this._isDirent ? dirent.name : dirent; + const fullPath = sysPath.resolve(sysPath.join(path, basename)); + entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename }; + entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath); + } catch (err) { + this._onError(err); + } + return entry; + } + + _onError(err) { + if (isNormalFlowError(err) && !this.destroyed) { + this.emit('warn', err); + } else { + this.destroy(err); + } + } + + async _getEntryType(entry) { + // entry may be undefined, because a warning or an error were emitted + // and the statsProp is undefined + const stats = entry && entry[this._statsProp]; + if (!stats) { + return; + } + if (stats.isFile()) { + return 'file'; + } + if (stats.isDirectory()) { + return 'directory'; + } + if (stats && stats.isSymbolicLink()) { + const full = entry.fullPath; + try { + const entryRealPath = await realpath(full); + const entryRealPathStats = await lstat(entryRealPath); + if (entryRealPathStats.isFile()) { + return 'file'; + } + if (entryRealPathStats.isDirectory()) { + const len = entryRealPath.length; + if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) { + const recursiveError = new Error( + `Circular symlink detected: "${full}" points to "${entryRealPath}"` + ); + recursiveError.code = RECURSIVE_ERROR_CODE; + return this._onError(recursiveError); + } + return 'directory'; + } + } catch (error) { + this._onError(error); + } + } + } + + _includeAsFile(entry) { + const stats = entry && entry[this._statsProp]; + + return stats && this._wantsEverything && !stats.isDirectory(); + } +} + +/** + * @typedef {Object} ReaddirpArguments + * @property {Function=} fileFilter + * @property {Function=} directoryFilter + * @property {String=} type + * @property {Number=} depth + * @property {String=} root + * @property {Boolean=} lstat + * @property {Boolean=} bigint + */ + +/** + * Main function which ends up calling readdirRec and reads all files and directories in given root recursively. + * @param {String} root Root directory + * @param {ReaddirpArguments=} options Options to specify root (start directory), filters and recursion depth + */ +const readdirp = (root, options = {}) => { + let type = options.entryType || options.type; + if (type === 'both') type = FILE_DIR_TYPE; // backwards-compatibility + if (type) options.type = type; + if (!root) { + throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)'); + } else if (typeof root !== 'string') { + throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)'); + } else if (type && !ALL_TYPES.includes(type)) { + throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`); + } + + options.root = root; + return new ReaddirpStream(options); +}; + +const readdirpPromise = (root, options = {}) => { + return new Promise((resolve, reject) => { + const files = []; + readdirp(root, options) + .on('data', entry => files.push(entry)) + .on('end', () => resolve(files)) + .on('error', error => reject(error)); + }); +}; + +readdirp.promise = readdirpPromise; +readdirp.ReaddirpStream = ReaddirpStream; +readdirp.default = readdirp; + +module.exports = readdirp; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/readdirp/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/readdirp/package.json new file mode 100644 index 0000000..dba5388 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/readdirp/package.json @@ -0,0 +1,122 @@ +{ + "name": "readdirp", + "description": "Recursive version of fs.readdir with streaming API.", + "version": "3.6.0", + "homepage": "https://github.com/paulmillr/readdirp", + "repository": { + "type": "git", + "url": "git://github.com/paulmillr/readdirp.git" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/paulmillr/readdirp/issues" + }, + "author": "Thorsten Lorenz (thlorenz.com)", + "contributors": [ + "Thorsten Lorenz (thlorenz.com)", + "Paul Miller (https://paulmillr.com)" + ], + "main": "index.js", + "engines": { + "node": ">=8.10.0" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "recursive", + "fs", + "stream", + "streams", + "readdir", + "filesystem", + "find", + "filter" + ], + "scripts": { + "dtslint": "dtslint", + "nyc": "nyc", + "mocha": "mocha --exit", + "lint": "eslint --report-unused-disable-directives --ignore-path .gitignore .", + "test": "npm run lint && nyc npm run mocha" + }, + "dependencies": { + "picomatch": "^2.2.1" + }, + "devDependencies": { + "@types/node": "^14", + "chai": "^4.2", + "chai-subset": "^1.6", + "dtslint": "^3.3.0", + "eslint": "^7.0.0", + "mocha": "^7.1.1", + "nyc": "^15.0.0", + "rimraf": "^3.0.0", + "typescript": "^4.0.3" + }, + "nyc": { + "reporter": [ + "html", + "text" + ] + }, + "eslintConfig": { + "root": true, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": 9, + "sourceType": "script" + }, + "env": { + "node": true, + "es6": true + }, + "rules": { + "array-callback-return": "error", + "no-empty": [ + "error", + { + "allowEmptyCatch": true + } + ], + "no-else-return": [ + "error", + { + "allowElseIf": false + } + ], + "no-lonely-if": "error", + "no-var": "error", + "object-shorthand": "error", + "prefer-arrow-callback": [ + "error", + { + "allowNamedFunctions": true + } + ], + "prefer-const": [ + "error", + { + "ignoreReadBeforeAssign": true + } + ], + "prefer-destructuring": [ + "error", + { + "object": true, + "array": false + } + ], + "prefer-spread": "error", + "prefer-template": "error", + "radix": "error", + "semi": "error", + "strict": "error", + "quotes": [ + "error", + "single" + ] + } + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/HISTORY.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/HISTORY.md new file mode 100644 index 0000000..b292257 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/HISTORY.md @@ -0,0 +1,228 @@ +2.2.0 / 2025-03-26 +================== + +* Remove `setImmediate` support check +* Restore `debug` dependency + +2.1.0 / 2025-02-10 +================== + +* Updated `engines` field to Node@18 or higher +* Remove `Object.setPrototypeOf` polyfill +* Use `Array.flat` instead of `array-flatten` package +* Replace `methods` dependency with standard library +* deps: parseurl@^1.3.3 +* deps: is-promise@^4.0.0 +* Replace `utils-merge` dependency with `Object.assign` +* deps: Remove unused dep `after` + +2.0.0 / 2024-09-09 +================== + +* Drop support for node <18 +* deps: path-to-regexp@^8.0.0 + - Drop support for partial capture group `router.route('/user(s?)/:user/:op')` but still have optional non-capture `/user{s}/:user/:op` + - `:name?` becomes `{:name}` + - `:name*` becomes `*name`. + - The splat change also changes splat from strings to an array of strings + - Optional splats become `{*name}` + - `:name+` becomes `*name` and thus equivalent to `*name` so I dropped those tests + - Strings as regular expressions are fully removed, need to be converted to native regular expressions + +2.0.0-beta.2 / 2024-03-20 +========================= + +This incorporates all changes after 1.3.5 up to 1.3.8. + + * Add support for returned, rejected Promises to `router.param` + +2.0.0-beta.1 / 2020-03-29 +========================= + +This incorporates all changes after 1.3.3 up to 1.3.5. + + * Internalize private `router.process_params` method + * Remove `debug` dependency + * deps: array-flatten@3.0.0 + * deps: parseurl@~1.3.3 + * deps: path-to-regexp@3.2.0 + - Add new `?`, `*`, and `+` parameter modifiers. + - Matching group expressions are only RegExp syntax. + `(*)` is no longer valid and must be written as `(.*)`, for example. + - Named matching groups no longer available by position in `req.params`. + `/:foo(.*)` only captures as `req.params.foo` and not available as + `req.params[0]`. + - Regular expressions can only be used in a matching group. + `/\\d+` is no longer valid and must be written as `/(\\d+)`. + - Matching groups are now literal regular expressions. + `:foo` named captures can no longer be included inside a capture group. + - Special `*` path segment behavior removed. + `/foo/*/bar` will match a literal `*` as the middle segment. + * deps: setprototypeof@1.2.0 + +2.0.0-alpha.1 / 2018-07-27 +========================== + + * Add basic support for returned, rejected Promises + - Rejected Promises from middleware functions `next(error)` + * Drop support for Node.js below 0.10 + * deps: debug@3.1.0 + - Add `DEBUG_HIDE_DATE` environment variable + - Change timer to per-namespace instead of global + - Change non-TTY date format + - Remove `DEBUG_FD` environment variable support + - Support 256 namespace colors + +1.3.8 / 2023-02-24 +================== + + * Fix routing requests without method + +1.3.7 / 2022-04-28 +================== + + * Fix hanging on large stack of sync routes + +1.3.6 / 2021-11-15 +================== + + * Fix handling very large stacks of sync middleware + * deps: safe-buffer@5.2.1 + +1.3.5 / 2020-03-24 +================== + + * Fix incorrect middleware execution with unanchored `RegExp`s + * perf: use plain object for internal method map + +1.3.4 / 2020-01-24 +================== + + * deps: array-flatten@3.0.0 + * deps: parseurl@~1.3.3 + * deps: setprototypeof@1.2.0 + +1.3.3 / 2018-07-06 +================== + + * Fix JSDoc for `Router` constructor + +1.3.2 / 2017-09-24 +================== + + * deps: debug@2.6.9 + * deps: parseurl@~1.3.2 + - perf: reduce overhead for full URLs + - perf: unroll the "fast-path" `RegExp` + * deps: setprototypeof@1.1.0 + * deps: utils-merge@1.0.1 + +1.3.1 / 2017-05-19 +================== + + * deps: debug@2.6.8 + - Fix `DEBUG_MAX_ARRAY_LENGTH` + - deps: ms@2.0.0 + +1.3.0 / 2017-02-25 +================== + + * Add `next("router")` to exit from router + * Fix case where `router.use` skipped requests routes did not + * Use `%o` in path debug to tell types apart + * deps: setprototypeof@1.0.3 + * perf: add fast match path for `*` route + +1.2.0 / 2017-02-17 +================== + + * Skip routing when `req.url` is not set + * deps: debug@2.6.1 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable set to `3` or higher + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + +1.1.5 / 2017-01-28 +================== + + * deps: array-flatten@2.1.1 + * deps: setprototypeof@1.0.2 + - Fix using fallback even when native method exists + +1.1.4 / 2016-01-21 +================== + + * deps: array-flatten@2.0.0 + * deps: methods@~1.1.2 + - perf: enable strict mode + * deps: parseurl@~1.3.1 + - perf: enable strict mode + +1.1.3 / 2015-08-02 +================== + + * Fix infinite loop condition using `mergeParams: true` + * Fix inner numeric indices incorrectly altering parent `req.params` + * deps: array-flatten@1.1.1 + - perf: enable strict mode + * deps: path-to-regexp@0.1.7 + - Fix regression with escaped round brackets and matching groups + +1.1.2 / 2015-07-06 +================== + + * Fix hiding platform issues with `decodeURIComponent` + - Only `URIError`s are a 400 + * Fix using `*` before params in routes + * Fix using capture groups before params in routes + * deps: path-to-regexp@0.1.6 + * perf: enable strict mode + * perf: remove argument reassignments in routing + * perf: skip attempting to decode zero length string + * perf: use plain for loops + +1.1.1 / 2015-05-25 +================== + + * Fix issue where `next('route')` in `router.param` would incorrectly skip values + * deps: array-flatten@1.1.0 + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + +1.1.0 / 2015-04-22 +================== + + * Use `setprototypeof` instead of `__proto__` + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + +1.0.0 / 2015-01-13 +================== + + * Fix crash from error within `OPTIONS` response handler + * deps: array-flatten@1.0.2 + - Remove redundant code path + +1.0.0-beta.3 / 2015-01-11 +========================= + + * Fix duplicate methods appearing in OPTIONS responses + * Fix OPTIONS responses to include the HEAD method properly + * Remove support for leading colon in `router.param(name, fn)` + * Use `array-flatten` for flattening arrays + * deps: debug@~2.1.1 + * deps: methods@~1.1.1 + +1.0.0-beta.2 / 2014-11-19 +========================= + + * Match routes iteratively to prevent stack overflows + +1.0.0-beta.1 / 2014-11-16 +========================= + + * Initial release ported from Express 4.x + - Altered to work without Express diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/LICENSE new file mode 100644 index 0000000..237e1b6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2013 Roman Shtylman +Copyright (c) 2014-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/README.md new file mode 100644 index 0000000..218fd57 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/README.md @@ -0,0 +1,416 @@ +# router + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Simple middleware-style router + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```bash +$ npm install router +``` + +## API + +```js +var finalhandler = require('finalhandler') +var http = require('http') +var Router = require('router') + +var router = Router() +router.get('/', function (req, res) { + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end('Hello World!') +}) + +var server = http.createServer(function (req, res) { + router(req, res, finalhandler(req, res)) +}) + +server.listen(3000) +``` + +This module is currently an extracted version from the Express project, +but with the main change being it can be used with a plain `http.createServer` +object or other web frameworks by removing Express-specific API calls. + +## Router(options) + +Options + +- `strict` - When `false` trailing slashes are optional (default: `false`) +- `caseSensitive` - When `true` the routing will be case sensitive. (default: `false`) +- `mergeParams` - When `true` any `req.params` passed to the router will be + merged into the router's `req.params`. (default: `false`) ([example](#example-using-mergeparams)) + +Returns a function with the signature `router(req, res, callback)` where +`callback([err])` must be provided to handle errors and fall-through from +not handling requests. + +### router.use([path], ...middleware) + +Use the given [middleware function](#middleware) for all http methods on the +given `path`, defaulting to the root path. + +`router` does not automatically see `use` as a handler. As such, it will not +consider it one for handling `OPTIONS` requests. + +* Note: If a `path` is specified, that `path` is stripped from the start of + `req.url`. + + + +```js +router.use(function (req, res, next) { + // do your things + + // continue to the next middleware + // the request will stall if this is not called + next() + + // note: you should NOT call `next` if you have begun writing to the response +}) +``` + +[Middleware](#middleware) can themselves use `next('router')` at any time to +exit the current router instance completely, invoking the top-level callback. + +### router\[method](path, ...[middleware], handler) + +The [http methods](https://github.com/jshttp/methods/blob/master/index.js) provide +the routing functionality in `router`. + +Method middleware and handlers follow usual [middleware](#middleware) behavior, +except they will only be called when the method and path match the request. + + + +```js +// handle a `GET` request +router.get('/', function (req, res) { + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end('Hello World!') +}) +``` + +[Middleware](#middleware) given before the handler have one additional trick, +they may invoke `next('route')`. Calling `next('route')` bypasses the remaining +middleware and the handler mounted for this route, passing the request to the +next route suitable for handling this request. + +Route handlers and middleware can themselves use `next('router')` at any time +to exit the current router instance completely, invoking the top-level callback. + +### router.param(name, param_middleware) + +Maps the specified path parameter `name` to a specialized param-capturing middleware. + +This function positions the middleware in the same stack as `.use`. + +The function can optionally return a `Promise` object. If a `Promise` object +is returned from the function, the router will attach an `onRejected` callback +using `.then`. If the promise is rejected, `next` will be called with the +rejected value, or an error if the value is falsy. + +Parameter mapping is used to provide pre-conditions to routes +which use normalized placeholders. For example a _:user_id_ parameter +could automatically load a user's information from the database without +any additional code: + + + +```js +router.param('user_id', function (req, res, next, id) { + User.find(id, function (err, user) { + if (err) { + return next(err) + } else if (!user) { + return next(new Error('failed to load user')) + } + req.user = user + + // continue processing the request + next() + }) +}) +``` + +### router.route(path) + +Creates an instance of a single `Route` for the given `path`. +(See `Router.Route` below) + +Routes can be used to handle http `methods` with their own, optional middleware. + +Using `router.route(path)` is a recommended approach to avoiding duplicate +route naming and thus typo errors. + + + +```js +var api = router.route('/api/') +``` + +## Router.Route(path) + +Represents a single route as an instance that can be used to handle http +`methods` with it's own, optional middleware. + +### route\[method](handler) + +These are functions which you can directly call on a route to register a new +`handler` for the `method` on the route. + + + +```js +// handle a `GET` request +var status = router.route('/status') + +status.get(function (req, res) { + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end('All Systems Green!') +}) +``` + +### route.all(handler) + +Adds a handler for all HTTP methods to this route. + +The handler can behave like middleware and call `next` to continue processing +rather than responding. + + + +```js +router.route('/') + .all(function (req, res, next) { + next() + }) + .all(checkSomething) + .get(function (req, res) { + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end('Hello World!') + }) +``` + +## Middleware + +Middleware (and method handlers) are functions that follow specific function +parameters and have defined behavior when used with `router`. The most common +format is with three parameters - "req", "res" and "next". + +- `req` - This is a [HTTP incoming message](https://nodejs.org/api/http.html#http_http_incomingmessage) instance. +- `res` - This is a [HTTP server response](https://nodejs.org/api/http.html#http_class_http_serverresponse) instance. +- `next` - Calling this function that tells `router` to proceed to the next matching middleware or method handler. It accepts an error as the first argument. + +The function can optionally return a `Promise` object. If a `Promise` object +is returned from the function, the router will attach an `onRejected` callback +using `.then`. If the promise is rejected, `next` will be called with the +rejected value, or an error if the value is falsy. + +Middleware and method handlers can also be defined with four arguments. When +the function has four parameters defined, the first argument is an error and +subsequent arguments remain, becoming - "err", "req", "res", "next". These +functions are "error handling middleware", and can be used for handling +errors that occurred in previous handlers (E.g. from calling `next(err)`). +This is most used when you want to define arbitrary rendering of errors. + + + +```js +router.get('/error_route', function (req, res, next) { + return next(new Error('Bad Request')) +}) + +router.use(function (err, req, res, next) { + res.end(err.message) //= > "Bad Request" +}) +``` + +Error handling middleware will **only** be invoked when an error was given. As +long as the error is in the pipeline, normal middleware and handlers will be +bypassed - only error handling middleware will be invoked with an error. + +## Examples + +```js +// import our modules +var http = require('http') +var Router = require('router') +var finalhandler = require('finalhandler') +var compression = require('compression') +var bodyParser = require('body-parser') + +// store our message to display +var message = 'Hello World!' + +// initialize the router & server and add a final callback. +var router = Router() +var server = http.createServer(function onRequest (req, res) { + router(req, res, finalhandler(req, res)) +}) + +// use some middleware and compress all outgoing responses +router.use(compression()) + +// handle `GET` requests to `/message` +router.get('/message', function (req, res) { + res.statusCode = 200 + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end(message + '\n') +}) + +// create and mount a new router for our API +var api = Router() +router.use('/api/', api) + +// add a body parsing middleware to our API +api.use(bodyParser.json()) + +// handle `PATCH` requests to `/api/set-message` +api.patch('/set-message', function (req, res) { + if (req.body.value) { + message = req.body.value + + res.statusCode = 200 + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end(message + '\n') + } else { + res.statusCode = 400 + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end('Invalid API Syntax\n') + } +}) + +// make our http server listen to connections +server.listen(8080) +``` + +You can get the message by running this command in your terminal, + or navigating to `127.0.0.1:8080` in a web browser. +```bash +curl http://127.0.0.1:8080 +``` + +You can set the message by sending it a `PATCH` request via this command: +```bash +curl http://127.0.0.1:8080/api/set-message -X PATCH -H "Content-Type: application/json" -d '{"value":"Cats!"}' +``` + +### Example using mergeParams + +```js +var http = require('http') +var Router = require('router') +var finalhandler = require('finalhandler') + +// this example is about the mergeParams option +var opts = { mergeParams: true } + +// make a router with out special options +var router = Router(opts) +var server = http.createServer(function onRequest (req, res) { + // set something to be passed into the router + req.params = { type: 'kitten' } + + router(req, res, finalhandler(req, res)) +}) + +router.get('/', function (req, res) { + res.statusCode = 200 + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + + // with respond with the the params that were passed in + res.end(req.params.type + '\n') +}) + +// make another router with our options +var handler = Router(opts) + +// mount our new router to a route that accepts a param +router.use('/:path', handler) + +handler.get('/', function (req, res) { + res.statusCode = 200 + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + + // will respond with the param of the router's parent route + res.end(req.params.path + '\n') +}) + +// make our http server listen to connections +server.listen(8080) +``` + +Now you can get the type, or what path you are requesting: +```bash +curl http://127.0.0.1:8080 +> kitten +curl http://127.0.0.1:8080/such_path +> such_path +``` + +### Example of advanced `.route()` usage + +This example shows how to implement routes where there is a custom +handler to execute when the path matched, but no methods matched. +Without any special handling, this would be treated as just a +generic non-match by `router` (which typically results in a 404), +but with a custom handler, a `405 Method Not Allowed` can be sent. + +```js +var http = require('http') +var finalhandler = require('finalhandler') +var Router = require('router') + +// create the router and server +var router = new Router() +var server = http.createServer(function onRequest (req, res) { + router(req, res, finalhandler(req, res)) +}) + +// register a route and add all methods +router.route('/pet/:id') + .get(function (req, res) { + // this is GET /pet/:id + res.setHeader('Content-Type', 'application/json') + res.end(JSON.stringify({ name: 'tobi' })) + }) + .delete(function (req, res) { + // this is DELETE /pet/:id + res.end() + }) + .all(function (req, res) { + // this is called for all other methods not + // defined above for /pet/:id + res.statusCode = 405 + res.end() + }) + +// make our http server listen to connections +server.listen(8080) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/pillarjs/router/master?label=ci +[ci-url]: https://github.com/pillarjs/router/actions/workflows/ci.yml +[npm-image]: https://img.shields.io/npm/v/router.svg +[npm-url]: https://npmjs.org/package/router +[node-version-image]: https://img.shields.io/node/v/router.svg +[node-version-url]: http://nodejs.org/download/ +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/router/master.svg +[coveralls-url]: https://coveralls.io/r/pillarjs/router?branch=master +[downloads-image]: https://img.shields.io/npm/dm/router.svg +[downloads-url]: https://npmjs.org/package/router diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/index.js new file mode 100644 index 0000000..4358aeb --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/index.js @@ -0,0 +1,748 @@ +/*! + * router + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +const isPromise = require('is-promise') +const Layer = require('./lib/layer') +const { METHODS } = require('node:http') +const parseUrl = require('parseurl') +const Route = require('./lib/route') +const debug = require('debug')('router') +const deprecate = require('depd')('router') + +/** + * Module variables. + * @private + */ + +const slice = Array.prototype.slice +const flatten = Array.prototype.flat +const methods = METHODS.map((method) => method.toLowerCase()) + +/** + * Expose `Router`. + */ + +module.exports = Router + +/** + * Expose `Route`. + */ + +module.exports.Route = Route + +/** + * Initialize a new `Router` with the given `options`. + * + * @param {object} [options] + * @return {Router} which is a callable function + * @public + */ + +function Router (options) { + if (!(this instanceof Router)) { + return new Router(options) + } + + const opts = options || {} + + function router (req, res, next) { + router.handle(req, res, next) + } + + // inherit from the correct prototype + Object.setPrototypeOf(router, this) + + router.caseSensitive = opts.caseSensitive + router.mergeParams = opts.mergeParams + router.params = {} + router.strict = opts.strict + router.stack = [] + + return router +} + +/** + * Router prototype inherits from a Function. + */ + +/* istanbul ignore next */ +Router.prototype = function () {} + +/** + * Map the given param placeholder `name`(s) to the given callback. + * + * Parameter mapping is used to provide pre-conditions to routes + * which use normalized placeholders. For example a _:user_id_ parameter + * could automatically load a user's information from the database without + * any additional code. + * + * The callback uses the same signature as middleware, the only difference + * being that the value of the placeholder is passed, in this case the _id_ + * of the user. Once the `next()` function is invoked, just like middleware + * it will continue on to execute the route, or subsequent parameter functions. + * + * Just like in middleware, you must either respond to the request or call next + * to avoid stalling the request. + * + * router.param('user_id', function(req, res, next, id){ + * User.find(id, function(err, user){ + * if (err) { + * return next(err) + * } else if (!user) { + * return next(new Error('failed to load user')) + * } + * req.user = user + * next() + * }) + * }) + * + * @param {string} name + * @param {function} fn + * @public + */ + +Router.prototype.param = function param (name, fn) { + if (!name) { + throw new TypeError('argument name is required') + } + + if (typeof name !== 'string') { + throw new TypeError('argument name must be a string') + } + + if (!fn) { + throw new TypeError('argument fn is required') + } + + if (typeof fn !== 'function') { + throw new TypeError('argument fn must be a function') + } + + let params = this.params[name] + + if (!params) { + params = this.params[name] = [] + } + + params.push(fn) + + return this +} + +/** + * Dispatch a req, res into the router. + * + * @private + */ + +Router.prototype.handle = function handle (req, res, callback) { + if (!callback) { + throw new TypeError('argument callback is required') + } + + debug('dispatching %s %s', req.method, req.url) + + let idx = 0 + let methods + const protohost = getProtohost(req.url) || '' + let removed = '' + const self = this + let slashAdded = false + let sync = 0 + const paramcalled = {} + + // middleware and routes + const stack = this.stack + + // manage inter-router variables + const parentParams = req.params + const parentUrl = req.baseUrl || '' + let done = restore(callback, req, 'baseUrl', 'next', 'params') + + // setup next layer + req.next = next + + // for options requests, respond with a default if nothing else responds + if (req.method === 'OPTIONS') { + methods = [] + done = wrap(done, generateOptionsResponder(res, methods)) + } + + // setup basic req values + req.baseUrl = parentUrl + req.originalUrl = req.originalUrl || req.url + + next() + + function next (err) { + let layerError = err === 'route' + ? null + : err + + // remove added slash + if (slashAdded) { + req.url = req.url.slice(1) + slashAdded = false + } + + // restore altered req.url + if (removed.length !== 0) { + req.baseUrl = parentUrl + req.url = protohost + removed + req.url.slice(protohost.length) + removed = '' + } + + // signal to exit router + if (layerError === 'router') { + setImmediate(done, null) + return + } + + // no more matching layers + if (idx >= stack.length) { + setImmediate(done, layerError) + return + } + + // max sync stack + if (++sync > 100) { + return setImmediate(next, err) + } + + // get pathname of request + const path = getPathname(req) + + if (path == null) { + return done(layerError) + } + + // find next matching layer + let layer + let match + let route + + while (match !== true && idx < stack.length) { + layer = stack[idx++] + match = matchLayer(layer, path) + route = layer.route + + if (typeof match !== 'boolean') { + // hold on to layerError + layerError = layerError || match + } + + if (match !== true) { + continue + } + + if (!route) { + // process non-route handlers normally + continue + } + + if (layerError) { + // routes do not match with a pending error + match = false + continue + } + + const method = req.method + const hasMethod = route._handlesMethod(method) + + // build up automatic options response + if (!hasMethod && method === 'OPTIONS' && methods) { + methods.push.apply(methods, route._methods()) + } + + // don't even bother matching route + if (!hasMethod && method !== 'HEAD') { + match = false + } + } + + // no match + if (match !== true) { + return done(layerError) + } + + // store route for dispatch on change + if (route) { + req.route = route + } + + // Capture one-time layer values + req.params = self.mergeParams + ? mergeParams(layer.params, parentParams) + : layer.params + const layerPath = layer.path + + // this should be done for the layer + processParams(self.params, layer, paramcalled, req, res, function (err) { + if (err) { + next(layerError || err) + } else if (route) { + layer.handleRequest(req, res, next) + } else { + trimPrefix(layer, layerError, layerPath, path) + } + + sync = 0 + }) + } + + function trimPrefix (layer, layerError, layerPath, path) { + if (layerPath.length !== 0) { + // Validate path is a prefix match + if (layerPath !== path.substring(0, layerPath.length)) { + next(layerError) + return + } + + // Validate path breaks on a path separator + const c = path[layerPath.length] + if (c && c !== '/') { + next(layerError) + return + } + + // Trim off the part of the url that matches the route + // middleware (.use stuff) needs to have the path stripped + debug('trim prefix (%s) from url %s', layerPath, req.url) + removed = layerPath + req.url = protohost + req.url.slice(protohost.length + removed.length) + + // Ensure leading slash + if (!protohost && req.url[0] !== '/') { + req.url = '/' + req.url + slashAdded = true + } + + // Setup base URL (no trailing slash) + req.baseUrl = parentUrl + (removed[removed.length - 1] === '/' + ? removed.substring(0, removed.length - 1) + : removed) + } + + debug('%s %s : %s', layer.name, layerPath, req.originalUrl) + + if (layerError) { + layer.handleError(layerError, req, res, next) + } else { + layer.handleRequest(req, res, next) + } + } +} + +/** + * Use the given middleware function, with optional path, defaulting to "/". + * + * Use (like `.all`) will run for any http METHOD, but it will not add + * handlers for those methods so OPTIONS requests will not consider `.use` + * functions even if they could respond. + * + * The other difference is that _route_ path is stripped and not visible + * to the handler function. The main effect of this feature is that mounted + * handlers can operate without any code changes regardless of the "prefix" + * pathname. + * + * @public + */ + +Router.prototype.use = function use (handler) { + let offset = 0 + let path = '/' + + // default path to '/' + // disambiguate router.use([handler]) + if (typeof handler !== 'function') { + let arg = handler + + while (Array.isArray(arg) && arg.length !== 0) { + arg = arg[0] + } + + // first arg is the path + if (typeof arg !== 'function') { + offset = 1 + path = handler + } + } + + const callbacks = flatten.call(slice.call(arguments, offset), Infinity) + + if (callbacks.length === 0) { + throw new TypeError('argument handler is required') + } + + for (let i = 0; i < callbacks.length; i++) { + const fn = callbacks[i] + + if (typeof fn !== 'function') { + throw new TypeError('argument handler must be a function') + } + + // add the middleware + debug('use %o %s', path, fn.name || '') + + const layer = new Layer(path, { + sensitive: this.caseSensitive, + strict: false, + end: false + }, fn) + + layer.route = undefined + + this.stack.push(layer) + } + + return this +} + +/** + * Create a new Route for the given path. + * + * Each route contains a separate middleware stack and VERB handlers. + * + * See the Route api documentation for details on adding handlers + * and middleware to routes. + * + * @param {string} path + * @return {Route} + * @public + */ + +Router.prototype.route = function route (path) { + const route = new Route(path) + + const layer = new Layer(path, { + sensitive: this.caseSensitive, + strict: this.strict, + end: true + }, handle) + + function handle (req, res, next) { + route.dispatch(req, res, next) + } + + layer.route = route + + this.stack.push(layer) + return route +} + +// create Router#VERB functions +methods.concat('all').forEach(function (method) { + Router.prototype[method] = function (path) { + const route = this.route(path) + route[method].apply(route, slice.call(arguments, 1)) + return this + } +}) + +/** + * Generate a callback that will make an OPTIONS response. + * + * @param {OutgoingMessage} res + * @param {array} methods + * @private + */ + +function generateOptionsResponder (res, methods) { + return function onDone (fn, err) { + if (err || methods.length === 0) { + return fn(err) + } + + trySendOptionsResponse(res, methods, fn) + } +} + +/** + * Get pathname of request. + * + * @param {IncomingMessage} req + * @private + */ + +function getPathname (req) { + try { + return parseUrl(req).pathname + } catch (err) { + return undefined + } +} + +/** + * Get get protocol + host for a URL. + * + * @param {string} url + * @private + */ + +function getProtohost (url) { + if (typeof url !== 'string' || url.length === 0 || url[0] === '/') { + return undefined + } + + const searchIndex = url.indexOf('?') + const pathLength = searchIndex !== -1 + ? searchIndex + : url.length + const fqdnIndex = url.substring(0, pathLength).indexOf('://') + + return fqdnIndex !== -1 + ? url.substring(0, url.indexOf('/', 3 + fqdnIndex)) + : undefined +} + +/** + * Match path to a layer. + * + * @param {Layer} layer + * @param {string} path + * @private + */ + +function matchLayer (layer, path) { + try { + return layer.match(path) + } catch (err) { + return err + } +} + +/** + * Merge params with parent params + * + * @private + */ + +function mergeParams (params, parent) { + if (typeof parent !== 'object' || !parent) { + return params + } + + // make copy of parent for base + const obj = Object.assign({}, parent) + + // simple non-numeric merging + if (!(0 in params) || !(0 in parent)) { + return Object.assign(obj, params) + } + + let i = 0 + let o = 0 + + // determine numeric gap in params + while (i in params) { + i++ + } + + // determine numeric gap in parent + while (o in parent) { + o++ + } + + // offset numeric indices in params before merge + for (i--; i >= 0; i--) { + params[i + o] = params[i] + + // create holes for the merge when necessary + if (i < o) { + delete params[i] + } + } + + return Object.assign(obj, params) +} + +/** + * Process any parameters for the layer. + * + * @private + */ + +function processParams (params, layer, called, req, res, done) { + // captured parameters from the layer, keys and values + const keys = layer.keys + + // fast track + if (!keys || keys.length === 0) { + return done() + } + + let i = 0 + let paramIndex = 0 + let key + let paramVal + let paramCallbacks + let paramCalled + + // process params in order + // param callbacks can be async + function param (err) { + if (err) { + return done(err) + } + + if (i >= keys.length) { + return done() + } + + paramIndex = 0 + key = keys[i++] + paramVal = req.params[key] + paramCallbacks = params[key] + paramCalled = called[key] + + if (paramVal === undefined || !paramCallbacks) { + return param() + } + + // param previously called with same value or error occurred + if (paramCalled && (paramCalled.match === paramVal || + (paramCalled.error && paramCalled.error !== 'route'))) { + // restore value + req.params[key] = paramCalled.value + + // next param + return param(paramCalled.error) + } + + called[key] = paramCalled = { + error: null, + match: paramVal, + value: paramVal + } + + paramCallback() + } + + // single param callbacks + function paramCallback (err) { + const fn = paramCallbacks[paramIndex++] + + // store updated value + paramCalled.value = req.params[key] + + if (err) { + // store error + paramCalled.error = err + param(err) + return + } + + if (!fn) return param() + + try { + const ret = fn(req, res, paramCallback, paramVal, key) + if (isPromise(ret)) { + if (!(ret instanceof Promise)) { + deprecate('parameters that are Promise-like are deprecated, use a native Promise instead') + } + + ret.then(null, function (error) { + paramCallback(error || new Error('Rejected promise')) + }) + } + } catch (e) { + paramCallback(e) + } + } + + param() +} + +/** + * Restore obj props after function + * + * @private + */ + +function restore (fn, obj) { + const props = new Array(arguments.length - 2) + const vals = new Array(arguments.length - 2) + + for (let i = 0; i < props.length; i++) { + props[i] = arguments[i + 2] + vals[i] = obj[props[i]] + } + + return function () { + // restore vals + for (let i = 0; i < props.length; i++) { + obj[props[i]] = vals[i] + } + + return fn.apply(this, arguments) + } +} + +/** + * Send an OPTIONS response. + * + * @private + */ + +function sendOptionsResponse (res, methods) { + const options = Object.create(null) + + // build unique method map + for (let i = 0; i < methods.length; i++) { + options[methods[i]] = true + } + + // construct the allow list + const allow = Object.keys(options).sort().join(', ') + + // send response + res.setHeader('Allow', allow) + res.setHeader('Content-Length', Buffer.byteLength(allow)) + res.setHeader('Content-Type', 'text/plain') + res.setHeader('X-Content-Type-Options', 'nosniff') + res.end(allow) +} + +/** + * Try to send an OPTIONS response. + * + * @private + */ + +function trySendOptionsResponse (res, methods, next) { + try { + sendOptionsResponse(res, methods) + } catch (err) { + next(err) + } +} + +/** + * Wrap a function + * + * @private + */ + +function wrap (old, fn) { + return function proxy () { + const args = new Array(arguments.length + 1) + + args[0] = old + for (let i = 0, len = arguments.length; i < len; i++) { + args[i + 1] = arguments[i] + } + + fn.apply(this, args) + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/lib/layer.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/lib/layer.js new file mode 100644 index 0000000..6a4408f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/lib/layer.js @@ -0,0 +1,247 @@ +/*! + * router + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +const isPromise = require('is-promise') +const pathRegexp = require('path-to-regexp') +const debug = require('debug')('router:layer') +const deprecate = require('depd')('router') + +/** + * Module variables. + * @private + */ + +const TRAILING_SLASH_REGEXP = /\/+$/ +const MATCHING_GROUP_REGEXP = /\((?:\?<(.*?)>)?(?!\?)/g + +/** + * Expose `Layer`. + */ + +module.exports = Layer + +function Layer (path, options, fn) { + if (!(this instanceof Layer)) { + return new Layer(path, options, fn) + } + + debug('new %o', path) + const opts = options || {} + + this.handle = fn + this.keys = [] + this.name = fn.name || '' + this.params = undefined + this.path = undefined + this.slash = path === '/' && opts.end === false + + function matcher (_path) { + if (_path instanceof RegExp) { + const keys = [] + let name = 0 + let m + // eslint-disable-next-line no-cond-assign + while (m = MATCHING_GROUP_REGEXP.exec(_path.source)) { + keys.push({ + name: m[1] || name++, + offset: m.index + }) + } + + return function regexpMatcher (p) { + const match = _path.exec(p) + if (!match) { + return false + } + + const params = {} + for (let i = 1; i < match.length; i++) { + const key = keys[i - 1] + const prop = key.name + const val = decodeParam(match[i]) + + if (val !== undefined) { + params[prop] = val + } + } + + return { + params, + path: match[0] + } + } + } + + return pathRegexp.match((opts.strict ? _path : loosen(_path)), { + sensitive: opts.sensitive, + end: opts.end, + trailing: !opts.strict, + decode: decodeParam + }) + } + this.matchers = Array.isArray(path) ? path.map(matcher) : [matcher(path)] +} + +/** + * Handle the error for the layer. + * + * @param {Error} error + * @param {Request} req + * @param {Response} res + * @param {function} next + * @api private + */ + +Layer.prototype.handleError = function handleError (error, req, res, next) { + const fn = this.handle + + if (fn.length !== 4) { + // not a standard error handler + return next(error) + } + + try { + // invoke function + const ret = fn(error, req, res, next) + + // wait for returned promise + if (isPromise(ret)) { + if (!(ret instanceof Promise)) { + deprecate('handlers that are Promise-like are deprecated, use a native Promise instead') + } + + ret.then(null, function (error) { + next(error || new Error('Rejected promise')) + }) + } + } catch (err) { + next(err) + } +} + +/** + * Handle the request for the layer. + * + * @param {Request} req + * @param {Response} res + * @param {function} next + * @api private + */ + +Layer.prototype.handleRequest = function handleRequest (req, res, next) { + const fn = this.handle + + if (fn.length > 3) { + // not a standard request handler + return next() + } + + try { + // invoke function + const ret = fn(req, res, next) + + // wait for returned promise + if (isPromise(ret)) { + if (!(ret instanceof Promise)) { + deprecate('handlers that are Promise-like are deprecated, use a native Promise instead') + } + + ret.then(null, function (error) { + next(error || new Error('Rejected promise')) + }) + } + } catch (err) { + next(err) + } +} + +/** + * Check if this route matches `path`, if so + * populate `.params`. + * + * @param {String} path + * @return {Boolean} + * @api private + */ + +Layer.prototype.match = function match (path) { + let match + + if (path != null) { + // fast path non-ending match for / (any path matches) + if (this.slash) { + this.params = {} + this.path = '' + return true + } + + let i = 0 + while (!match && i < this.matchers.length) { + // match the path + match = this.matchers[i](path) + i++ + } + } + + if (!match) { + this.params = undefined + this.path = undefined + return false + } + + // store values + this.params = match.params + this.path = match.path + this.keys = Object.keys(match.params) + + return true +} + +/** + * Decode param value. + * + * @param {string} val + * @return {string} + * @private + */ + +function decodeParam (val) { + if (typeof val !== 'string' || val.length === 0) { + return val + } + + try { + return decodeURIComponent(val) + } catch (err) { + if (err instanceof URIError) { + err.message = 'Failed to decode param \'' + val + '\'' + err.status = 400 + } + + throw err + } +} + +/** + * Loosens the given path for path-to-regexp matching. + */ +function loosen (path) { + if (path instanceof RegExp || path === '/') { + return path + } + + return Array.isArray(path) + ? path.map(function (p) { return loosen(p) }) + : String(path).replace(TRAILING_SLASH_REGEXP, '') +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/lib/route.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/lib/route.js new file mode 100644 index 0000000..1887d78 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/lib/route.js @@ -0,0 +1,242 @@ +/*! + * router + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +const debug = require('debug')('router:route') +const Layer = require('./layer') +const { METHODS } = require('node:http') + +/** + * Module variables. + * @private + */ + +const slice = Array.prototype.slice +const flatten = Array.prototype.flat +const methods = METHODS.map((method) => method.toLowerCase()) + +/** + * Expose `Route`. + */ + +module.exports = Route + +/** + * Initialize `Route` with the given `path`, + * + * @param {String} path + * @api private + */ + +function Route (path) { + debug('new %o', path) + this.path = path + this.stack = [] + + // route handlers for various http methods + this.methods = Object.create(null) +} + +/** + * @private + */ + +Route.prototype._handlesMethod = function _handlesMethod (method) { + if (this.methods._all) { + return true + } + + // normalize name + let name = typeof method === 'string' + ? method.toLowerCase() + : method + + if (name === 'head' && !this.methods.head) { + name = 'get' + } + + return Boolean(this.methods[name]) +} + +/** + * @return {array} supported HTTP methods + * @private + */ + +Route.prototype._methods = function _methods () { + const methods = Object.keys(this.methods) + + // append automatic head + if (this.methods.get && !this.methods.head) { + methods.push('head') + } + + for (let i = 0; i < methods.length; i++) { + // make upper case + methods[i] = methods[i].toUpperCase() + } + + return methods +} + +/** + * dispatch req, res into this route + * + * @private + */ + +Route.prototype.dispatch = function dispatch (req, res, done) { + let idx = 0 + const stack = this.stack + let sync = 0 + + if (stack.length === 0) { + return done() + } + + let method = typeof req.method === 'string' + ? req.method.toLowerCase() + : req.method + + if (method === 'head' && !this.methods.head) { + method = 'get' + } + + req.route = this + + next() + + function next (err) { + // signal to exit route + if (err && err === 'route') { + return done() + } + + // signal to exit router + if (err && err === 'router') { + return done(err) + } + + // no more matching layers + if (idx >= stack.length) { + return done(err) + } + + // max sync stack + if (++sync > 100) { + return setImmediate(next, err) + } + + let layer + let match + + // find next matching layer + while (match !== true && idx < stack.length) { + layer = stack[idx++] + match = !layer.method || layer.method === method + } + + // no match + if (match !== true) { + return done(err) + } + + if (err) { + layer.handleError(err, req, res, next) + } else { + layer.handleRequest(req, res, next) + } + + sync = 0 + } +} + +/** + * Add a handler for all HTTP verbs to this route. + * + * Behaves just like middleware and can respond or call `next` + * to continue processing. + * + * You can use multiple `.all` call to add multiple handlers. + * + * function check_something(req, res, next){ + * next() + * } + * + * function validate_user(req, res, next){ + * next() + * } + * + * route + * .all(validate_user) + * .all(check_something) + * .get(function(req, res, next){ + * res.send('hello world') + * }) + * + * @param {array|function} handler + * @return {Route} for chaining + * @api public + */ + +Route.prototype.all = function all (handler) { + const callbacks = flatten.call(slice.call(arguments), Infinity) + + if (callbacks.length === 0) { + throw new TypeError('argument handler is required') + } + + for (let i = 0; i < callbacks.length; i++) { + const fn = callbacks[i] + + if (typeof fn !== 'function') { + throw new TypeError('argument handler must be a function') + } + + const layer = Layer('/', {}, fn) + layer.method = undefined + + this.methods._all = true + this.stack.push(layer) + } + + return this +} + +methods.forEach(function (method) { + Route.prototype[method] = function (handler) { + const callbacks = flatten.call(slice.call(arguments), Infinity) + + if (callbacks.length === 0) { + throw new TypeError('argument handler is required') + } + + for (let i = 0; i < callbacks.length; i++) { + const fn = callbacks[i] + + if (typeof fn !== 'function') { + throw new TypeError('argument handler must be a function') + } + + debug('%s %s', method, this.path) + + const layer = Layer('/', {}, fn) + layer.method = method + + this.methods[method] = true + this.stack.push(layer) + } + + return this + } +}) diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/package.json new file mode 100644 index 0000000..123eca2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/router/package.json @@ -0,0 +1,44 @@ +{ + "name": "router", + "description": "Simple middleware-style router", + "version": "2.2.0", + "author": "Douglas Christopher Wilson ", + "contributors": [ + "Blake Embrey " + ], + "license": "MIT", + "repository": "pillarjs/router", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "devDependencies": { + "finalhandler": "^2.1.0", + "mocha": "10.2.0", + "nyc": "15.1.0", + "run-series": "^1.1.9", + "standard": "^17.1.0", + "supertest": "6.3.3" + }, + "files": [ + "lib/", + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 18" + }, + "scripts": { + "lint": "standard", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test:debug": "mocha --reporter spec --bail --check-leaks test/ --inspect --inspect-brk", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/LICENSE new file mode 100644 index 0000000..4fe9e6f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Nikita Skovoroda + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/Porting-Buffer.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/Porting-Buffer.md new file mode 100644 index 0000000..68d86ba --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/Porting-Buffer.md @@ -0,0 +1,268 @@ +# Porting to the Buffer.from/Buffer.alloc API + + +## Overview + +- [Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x.](#variant-1) (*recommended*) +- [Variant 2: Use a polyfill](#variant-2) +- [Variant 3: manual detection, with safeguards](#variant-3) + +### Finding problematic bits of code using grep + +Just run `grep -nrE '[^a-zA-Z](Slow)?Buffer\s*\(' --exclude-dir node_modules`. + +It will find all the potentially unsafe places in your own code (with some considerably unlikely +exceptions). + +### Finding problematic bits of code using Node.js 8 + +If you’re using Node.js ≥ 8.0.0 (which is recommended), Node.js exposes multiple options that help with finding the relevant pieces of code: + +- `--trace-warnings` will make Node.js show a stack trace for this warning and other warnings that are printed by Node.js. +- `--trace-deprecation` does the same thing, but only for deprecation warnings. +- `--pending-deprecation` will show more types of deprecation warnings. In particular, it will show the `Buffer()` deprecation warning, even on Node.js 8. + +You can set these flags using an environment variable: + +```console +$ export NODE_OPTIONS='--trace-warnings --pending-deprecation' +$ cat example.js +'use strict'; +const foo = new Buffer('foo'); +$ node example.js +(node:7147) [DEP0005] DeprecationWarning: The Buffer() and new Buffer() constructors are not recommended for use due to security and usability concerns. Please use the new Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() construction methods instead. + at showFlaggedDeprecation (buffer.js:127:13) + at new Buffer (buffer.js:148:3) + at Object. (/path/to/example.js:2:13) + [... more stack trace lines ...] +``` + +### Finding problematic bits of code using linters + +Eslint rules [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +also find calls to deprecated `Buffer()` API. Those rules are included in some pre-sets. + +There is a drawback, though, that it doesn't always +[work correctly](https://github.com/chalker/safer-buffer#why-not-safe-buffer) when `Buffer` is +overriden e.g. with a polyfill, so recommended is a combination of this and some other method +described above. + + +## Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x. + +This is the recommended solution nowadays that would imply only minimal overhead. + +The Node.js 5.x release line has been unsupported since July 2016, and the Node.js 4.x release line reaches its End of Life in April 2018 (→ [Schedule](https://github.com/nodejs/Release#release-schedule)). This means that these versions of Node.js will *not* receive any updates, even in case of security issues, so using these release lines should be avoided, if at all possible. + +What you would do in this case is to convert all `new Buffer()` or `Buffer()` calls to use `Buffer.alloc()` or `Buffer.from()`, in the following way: + +- For `new Buffer(number)`, replace it with `Buffer.alloc(number)`. +- For `new Buffer(string)` (or `new Buffer(string, encoding)`), replace it with `Buffer.from(string)` (or `Buffer.from(string, encoding)`). +- For all other combinations of arguments (these are much rarer), also replace `new Buffer(...arguments)` with `Buffer.from(...arguments)`. + +Note that `Buffer.alloc()` is also _faster_ on the current Node.js versions than +`new Buffer(size).fill(0)`, which is what you would otherwise need to ensure zero-filling. + +Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +is recommended to avoid accidential unsafe Buffer API usage. + +There is also a [JSCodeshift codemod](https://github.com/joyeecheung/node-dep-codemod#dep005) +for automatically migrating Buffer constructors to `Buffer.alloc()` or `Buffer.from()`. +Note that it currently only works with cases where the arguments are literals or where the +constructor is invoked with two arguments. + +_If you currently support those older Node.js versions and dropping them would be a semver-major change +for you, or if you support older branches of your packages, consider using [Variant 2](#variant-2) +or [Variant 3](#variant-3) on older branches, so people using those older branches will also receive +the fix. That way, you will eradicate potential issues caused by unguarded Buffer API usage and +your users will not observe a runtime deprecation warning when running your code on Node.js 10._ + + +## Variant 2: Use a polyfill + +Utilize [safer-buffer](https://www.npmjs.com/package/safer-buffer) as a polyfill to support older +Node.js versions. + +You would take exacly the same steps as in [Variant 1](#variant-1), but with a polyfill +`const Buffer = require('safer-buffer').Buffer` in all files where you use the new `Buffer` api. + +Make sure that you do not use old `new Buffer` API — in any files where the line above is added, +using old `new Buffer()` API will _throw_. It will be easy to notice that in CI, though. + +Alternatively, you could use [buffer-from](https://www.npmjs.com/package/buffer-from) and/or +[buffer-alloc](https://www.npmjs.com/package/buffer-alloc) [ponyfills](https://ponyfill.com/) — +those are great, the only downsides being 4 deps in the tree and slightly more code changes to +migrate off them (as you would be using e.g. `Buffer.from` under a different name). If you need only +`Buffer.from` polyfilled — `buffer-from` alone which comes with no extra dependencies. + +_Alternatively, you could use [safe-buffer](https://www.npmjs.com/package/safe-buffer) — it also +provides a polyfill, but takes a different approach which has +[it's drawbacks](https://github.com/chalker/safer-buffer#why-not-safe-buffer). It will allow you +to also use the older `new Buffer()` API in your code, though — but that's arguably a benefit, as +it is problematic, can cause issues in your code, and will start emitting runtime deprecation +warnings starting with Node.js 10._ + +Note that in either case, it is important that you also remove all calls to the old Buffer +API manually — just throwing in `safe-buffer` doesn't fix the problem by itself, it just provides +a polyfill for the new API. I have seen people doing that mistake. + +Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +is recommended. + +_Don't forget to drop the polyfill usage once you drop support for Node.js < 4.5.0._ + + +## Variant 3 — manual detection, with safeguards + +This is useful if you create Buffer instances in only a few places (e.g. one), or you have your own +wrapper around them. + +### Buffer(0) + +This special case for creating empty buffers can be safely replaced with `Buffer.concat([])`, which +returns the same result all the way down to Node.js 0.8.x. + +### Buffer(notNumber) + +Before: + +```js +var buf = new Buffer(notNumber, encoding); +``` + +After: + +```js +var buf; +if (Buffer.from && Buffer.from !== Uint8Array.from) { + buf = Buffer.from(notNumber, encoding); +} else { + if (typeof notNumber === 'number') + throw new Error('The "size" argument must be of type number.'); + buf = new Buffer(notNumber, encoding); +} +``` + +`encoding` is optional. + +Note that the `typeof notNumber` before `new Buffer` is required (for cases when `notNumber` argument is not +hard-coded) and _is not caused by the deprecation of Buffer constructor_ — it's exactly _why_ the +Buffer constructor is deprecated. Ecosystem packages lacking this type-check caused numereous +security issues — situations when unsanitized user input could end up in the `Buffer(arg)` create +problems ranging from DoS to leaking sensitive information to the attacker from the process memory. + +When `notNumber` argument is hardcoded (e.g. literal `"abc"` or `[0,1,2]`), the `typeof` check can +be omitted. + +Also note that using TypeScript does not fix this problem for you — when libs written in +`TypeScript` are used from JS, or when user input ends up there — it behaves exactly as pure JS, as +all type checks are translation-time only and are not present in the actual JS code which TS +compiles to. + +### Buffer(number) + +For Node.js 0.10.x (and below) support: + +```js +var buf; +if (Buffer.alloc) { + buf = Buffer.alloc(number); +} else { + buf = new Buffer(number); + buf.fill(0); +} +``` + +Otherwise (Node.js ≥ 0.12.x): + +```js +const buf = Buffer.alloc ? Buffer.alloc(number) : new Buffer(number).fill(0); +``` + +## Regarding Buffer.allocUnsafe + +Be extra cautious when using `Buffer.allocUnsafe`: + * Don't use it if you don't have a good reason to + * e.g. you probably won't ever see a performance difference for small buffers, in fact, those + might be even faster with `Buffer.alloc()`, + * if your code is not in the hot code path — you also probably won't notice a difference, + * keep in mind that zero-filling minimizes the potential risks. + * If you use it, make sure that you never return the buffer in a partially-filled state, + * if you are writing to it sequentially — always truncate it to the actuall written length + +Errors in handling buffers allocated with `Buffer.allocUnsafe` could result in various issues, +ranged from undefined behaviour of your code to sensitive data (user input, passwords, certs) +leaking to the remote attacker. + +_Note that the same applies to `new Buffer` usage without zero-filling, depending on the Node.js +version (and lacking type checks also adds DoS to the list of potential problems)._ + + +## FAQ + + +### What is wrong with the `Buffer` constructor? + +The `Buffer` constructor could be used to create a buffer in many different ways: + +- `new Buffer(42)` creates a `Buffer` of 42 bytes. Before Node.js 8, this buffer contained + *arbitrary memory* for performance reasons, which could include anything ranging from + program source code to passwords and encryption keys. +- `new Buffer('abc')` creates a `Buffer` that contains the UTF-8-encoded version of + the string `'abc'`. A second argument could specify another encoding: For example, + `new Buffer(string, 'base64')` could be used to convert a Base64 string into the original + sequence of bytes that it represents. +- There are several other combinations of arguments. + +This meant that, in code like `var buffer = new Buffer(foo);`, *it is not possible to tell +what exactly the contents of the generated buffer are* without knowing the type of `foo`. + +Sometimes, the value of `foo` comes from an external source. For example, this function +could be exposed as a service on a web server, converting a UTF-8 string into its Base64 form: + +``` +function stringToBase64(req, res) { + // The request body should have the format of `{ string: 'foobar' }` + const rawBytes = new Buffer(req.body.string) + const encoded = rawBytes.toString('base64') + res.end({ encoded: encoded }) +} +``` + +Note that this code does *not* validate the type of `req.body.string`: + +- `req.body.string` is expected to be a string. If this is the case, all goes well. +- `req.body.string` is controlled by the client that sends the request. +- If `req.body.string` is the *number* `50`, the `rawBytes` would be 50 bytes: + - Before Node.js 8, the content would be uninitialized + - After Node.js 8, the content would be `50` bytes with the value `0` + +Because of the missing type check, an attacker could intentionally send a number +as part of the request. Using this, they can either: + +- Read uninitialized memory. This **will** leak passwords, encryption keys and other + kinds of sensitive information. (Information leak) +- Force the program to allocate a large amount of memory. For example, when specifying + `500000000` as the input value, each request will allocate 500MB of memory. + This can be used to either exhaust the memory available of a program completely + and make it crash, or slow it down significantly. (Denial of Service) + +Both of these scenarios are considered serious security issues in a real-world +web server context. + +when using `Buffer.from(req.body.string)` instead, passing a number will always +throw an exception instead, giving a controlled behaviour that can always be +handled by the program. + + +### The `Buffer()` constructor has been deprecated for a while. Is this really an issue? + +Surveys of code in the `npm` ecosystem have shown that the `Buffer()` constructor is still +widely used. This includes new code, and overall usage of such code has actually been +*increasing*. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/Readme.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/Readme.md new file mode 100644 index 0000000..14b0822 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/Readme.md @@ -0,0 +1,156 @@ +# safer-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![javascript style guide][standard-image]][standard-url] [![Security Responsible Disclosure][secuirty-image]][secuirty-url] + +[travis-image]: https://travis-ci.org/ChALkeR/safer-buffer.svg?branch=master +[travis-url]: https://travis-ci.org/ChALkeR/safer-buffer +[npm-image]: https://img.shields.io/npm/v/safer-buffer.svg +[npm-url]: https://npmjs.org/package/safer-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com +[secuirty-image]: https://img.shields.io/badge/Security-Responsible%20Disclosure-green.svg +[secuirty-url]: https://github.com/nodejs/security-wg/blob/master/processes/responsible_disclosure_template.md + +Modern Buffer API polyfill without footguns, working on Node.js from 0.8 to current. + +## How to use? + +First, port all `Buffer()` and `new Buffer()` calls to `Buffer.alloc()` and `Buffer.from()` API. + +Then, to achieve compatibility with outdated Node.js versions (`<4.5.0` and 5.x `<5.9.0`), use +`const Buffer = require('safer-buffer').Buffer` in all files where you make calls to the new +Buffer API. _Use `var` instead of `const` if you need that for your Node.js version range support._ + +Also, see the +[porting Buffer](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md) guide. + +## Do I need it? + +Hopefully, not — dropping support for outdated Node.js versions should be fine nowdays, and that +is the recommended path forward. You _do_ need to port to the `Buffer.alloc()` and `Buffer.from()` +though. + +See the [porting guide](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md) +for a better description. + +## Why not [safe-buffer](https://npmjs.com/safe-buffer)? + +_In short: while `safe-buffer` serves as a polyfill for the new API, it allows old API usage and +itself contains footguns._ + +`safe-buffer` could be used safely to get the new API while still keeping support for older +Node.js versions (like this module), but while analyzing ecosystem usage of the old Buffer API +I found out that `safe-buffer` is itself causing problems in some cases. + +For example, consider the following snippet: + +```console +$ cat example.unsafe.js +console.log(Buffer(20)) +$ ./node-v6.13.0-linux-x64/bin/node example.unsafe.js + +$ standard example.unsafe.js +standard: Use JavaScript Standard Style (https://standardjs.com) + /home/chalker/repo/safer-buffer/example.unsafe.js:2:13: 'Buffer()' was deprecated since v6. Use 'Buffer.alloc()' or 'Buffer.from()' (use 'https://www.npmjs.com/package/safe-buffer' for '<4.5.0') instead. +``` + +This is allocates and writes to console an uninitialized chunk of memory. +[standard](https://www.npmjs.com/package/standard) linter (among others) catch that and warn people +to avoid using unsafe API. + +Let's now throw in `safe-buffer`! + +```console +$ cat example.safe-buffer.js +const Buffer = require('safe-buffer').Buffer +console.log(Buffer(20)) +$ standard example.safe-buffer.js +$ ./node-v6.13.0-linux-x64/bin/node example.safe-buffer.js + +``` + +See the problem? Adding in `safe-buffer` _magically removes the lint warning_, but the behavior +remains identiсal to what we had before, and when launched on Node.js 6.x LTS — this dumps out +chunks of uninitialized memory. +_And this code will still emit runtime warnings on Node.js 10.x and above._ + +That was done by design. I first considered changing `safe-buffer`, prohibiting old API usage or +emitting warnings on it, but that significantly diverges from `safe-buffer` design. After some +discussion, it was decided to move my approach into a separate package, and _this is that separate +package_. + +This footgun is not imaginary — I observed top-downloaded packages doing that kind of thing, +«fixing» the lint warning by blindly including `safe-buffer` without any actual changes. + +Also in some cases, even if the API _was_ migrated to use of safe Buffer API — a random pull request +can bring unsafe Buffer API usage back to the codebase by adding new calls — and that could go +unnoticed even if you have a linter prohibiting that (becase of the reason stated above), and even +pass CI. _I also observed that being done in popular packages._ + +Some examples: + * [webdriverio](https://github.com/webdriverio/webdriverio/commit/05cbd3167c12e4930f09ef7cf93b127ba4effae4#diff-124380949022817b90b622871837d56cR31) + (a module with 548 759 downloads/month), + * [websocket-stream](https://github.com/maxogden/websocket-stream/commit/c9312bd24d08271687d76da0fe3c83493871cf61) + (218 288 d/m, fix in [maxogden/websocket-stream#142](https://github.com/maxogden/websocket-stream/pull/142)), + * [node-serialport](https://github.com/node-serialport/node-serialport/commit/e8d9d2b16c664224920ce1c895199b1ce2def48c) + (113 138 d/m, fix in [node-serialport/node-serialport#1510](https://github.com/node-serialport/node-serialport/pull/1510)), + * [karma](https://github.com/karma-runner/karma/commit/3d94b8cf18c695104ca195334dc75ff054c74eec) + (3 973 193 d/m, fix in [karma-runner/karma#2947](https://github.com/karma-runner/karma/pull/2947)), + * [spdy-transport](https://github.com/spdy-http2/spdy-transport/commit/5375ac33f4a62a4f65bcfc2827447d42a5dbe8b1) + (5 970 727 d/m, fix in [spdy-http2/spdy-transport#53](https://github.com/spdy-http2/spdy-transport/pull/53)). + * And there are a lot more over the ecosystem. + +I filed a PR at +[mysticatea/eslint-plugin-node#110](https://github.com/mysticatea/eslint-plugin-node/pull/110) to +partially fix that (for cases when that lint rule is used), but it is a semver-major change for +linter rules and presets, so it would take significant time for that to reach actual setups. +_It also hasn't been released yet (2018-03-20)._ + +Also, `safer-buffer` discourages the usage of `.allocUnsafe()`, which is often done by a mistake. +It still supports it with an explicit concern barier, by placing it under +`require('safer-buffer/dangereous')`. + +## But isn't throwing bad? + +Not really. It's an error that could be noticed and fixed early, instead of causing havoc later like +unguarded `new Buffer()` calls that end up receiving user input can do. + +This package affects only the files where `var Buffer = require('safer-buffer').Buffer` was done, so +it is really simple to keep track of things and make sure that you don't mix old API usage with that. +Also, CI should hint anything that you might have missed. + +New commits, if tested, won't land new usage of unsafe Buffer API this way. +_Node.js 10.x also deals with that by printing a runtime depecation warning._ + +### Would it affect third-party modules? + +No, unless you explicitly do an awful thing like monkey-patching or overriding the built-in `Buffer`. +Don't do that. + +### But I don't want throwing… + +That is also fine! + +Also, it could be better in some cases when you don't comprehensive enough test coverage. + +In that case — just don't override `Buffer` and use +`var SaferBuffer = require('safer-buffer').Buffer` instead. + +That way, everything using `Buffer` natively would still work, but there would be two drawbacks: + +* `Buffer.from`/`Buffer.alloc` won't be polyfilled — use `SaferBuffer.from` and + `SaferBuffer.alloc` instead. +* You are still open to accidentally using the insecure deprecated API — use a linter to catch that. + +Note that using a linter to catch accidential `Buffer` constructor usage in this case is strongly +recommended. `Buffer` is not overriden in this usecase, so linters won't get confused. + +## «Without footguns»? + +Well, it is still possible to do _some_ things with `Buffer` API, e.g. accessing `.buffer` property +on older versions and duping things from there. You shouldn't do that in your code, probabably. + +The intention is to remove the most significant footguns that affect lots of packages in the +ecosystem, and to do it in the proper way. + +Also, this package doesn't protect against security issues affecting some Node.js versions, so for +usage in your own production code, it is still recommended to update to a Node.js version +[supported by upstream](https://github.com/nodejs/release#release-schedule). diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/dangerous.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/dangerous.js new file mode 100644 index 0000000..ca41fdc --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/dangerous.js @@ -0,0 +1,58 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var buffer = require('buffer') +var Buffer = buffer.Buffer +var safer = require('./safer.js') +var Safer = safer.Buffer + +var dangerous = {} + +var key + +for (key in safer) { + if (!safer.hasOwnProperty(key)) continue + dangerous[key] = safer[key] +} + +var Dangereous = dangerous.Buffer = {} + +// Copy Safer API +for (key in Safer) { + if (!Safer.hasOwnProperty(key)) continue + Dangereous[key] = Safer[key] +} + +// Copy those missing unsafe methods, if they are present +for (key in Buffer) { + if (!Buffer.hasOwnProperty(key)) continue + if (Dangereous.hasOwnProperty(key)) continue + Dangereous[key] = Buffer[key] +} + +if (!Dangereous.allocUnsafe) { + Dangereous.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + return Buffer(size) + } +} + +if (!Dangereous.allocUnsafeSlow) { + Dangereous.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + return buffer.SlowBuffer(size) + } +} + +module.exports = dangerous diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/package.json new file mode 100644 index 0000000..d452b04 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/package.json @@ -0,0 +1,34 @@ +{ + "name": "safer-buffer", + "version": "2.1.2", + "description": "Modern Buffer API polyfill without footguns", + "main": "safer.js", + "scripts": { + "browserify-test": "browserify --external tape tests.js > browserify-tests.js && tape browserify-tests.js", + "test": "standard && tape tests.js" + }, + "author": { + "name": "Nikita Skovoroda", + "email": "chalkerx@gmail.com", + "url": "https://github.com/ChALkeR" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/ChALkeR/safer-buffer.git" + }, + "bugs": { + "url": "https://github.com/ChALkeR/safer-buffer/issues" + }, + "devDependencies": { + "standard": "^11.0.1", + "tape": "^4.9.0" + }, + "files": [ + "Porting-Buffer.md", + "Readme.md", + "tests.js", + "dangerous.js", + "safer.js" + ] +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/safer.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/safer.js new file mode 100644 index 0000000..37c7e1a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/safer.js @@ -0,0 +1,77 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var buffer = require('buffer') +var Buffer = buffer.Buffer + +var safer = {} + +var key + +for (key in buffer) { + if (!buffer.hasOwnProperty(key)) continue + if (key === 'SlowBuffer' || key === 'Buffer') continue + safer[key] = buffer[key] +} + +var Safer = safer.Buffer = {} +for (key in Buffer) { + if (!Buffer.hasOwnProperty(key)) continue + if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue + Safer[key] = Buffer[key] +} + +safer.Buffer.prototype = Buffer.prototype + +if (!Safer.from || Safer.from === Uint8Array.from) { + Safer.from = function (value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) + } + if (value && typeof value.length === 'undefined') { + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) + } + return Buffer(value, encodingOrOffset, length) + } +} + +if (!Safer.alloc) { + Safer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + var buf = Buffer(size) + if (!fill || fill.length === 0) { + buf.fill(0) + } else if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + return buf + } +} + +if (!safer.kStringMaxLength) { + try { + safer.kStringMaxLength = process.binding('buffer').kStringMaxLength + } catch (e) { + // we can't determine kStringMaxLength in environments where process.binding + // is unsupported, so let's not set it + } +} + +if (!safer.constants) { + safer.constants = { + MAX_LENGTH: safer.kMaxLength + } + if (safer.kStringMaxLength) { + safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength + } +} + +module.exports = safer diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/tests.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/tests.js new file mode 100644 index 0000000..7ed2777 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/safer-buffer/tests.js @@ -0,0 +1,406 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var test = require('tape') + +var buffer = require('buffer') + +var index = require('./') +var safer = require('./safer') +var dangerous = require('./dangerous') + +/* Inheritance tests */ + +test('Default is Safer', function (t) { + t.equal(index, safer) + t.notEqual(safer, dangerous) + t.notEqual(index, dangerous) + t.end() +}) + +test('Is not a function', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(typeof impl, 'object') + t.equal(typeof impl.Buffer, 'object') + }); + [buffer].forEach(function (impl) { + t.equal(typeof impl, 'object') + t.equal(typeof impl.Buffer, 'function') + }) + t.end() +}) + +test('Constructor throws', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.throws(function () { impl.Buffer() }) + t.throws(function () { impl.Buffer(0) }) + t.throws(function () { impl.Buffer('a') }) + t.throws(function () { impl.Buffer('a', 'utf-8') }) + t.throws(function () { return new impl.Buffer() }) + t.throws(function () { return new impl.Buffer(0) }) + t.throws(function () { return new impl.Buffer('a') }) + t.throws(function () { return new impl.Buffer('a', 'utf-8') }) + }) + t.end() +}) + +test('Safe methods exist', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(typeof impl.Buffer.alloc, 'function', 'alloc') + t.equal(typeof impl.Buffer.from, 'function', 'from') + }) + t.end() +}) + +test('Unsafe methods exist only in Dangerous', function (t) { + [index, safer].forEach(function (impl) { + t.equal(typeof impl.Buffer.allocUnsafe, 'undefined') + t.equal(typeof impl.Buffer.allocUnsafeSlow, 'undefined') + }); + [dangerous].forEach(function (impl) { + t.equal(typeof impl.Buffer.allocUnsafe, 'function') + t.equal(typeof impl.Buffer.allocUnsafeSlow, 'function') + }) + t.end() +}) + +test('Generic methods/properties are defined and equal', function (t) { + ['poolSize', 'isBuffer', 'concat', 'byteLength'].forEach(function (method) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], buffer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Built-in buffer static methods/properties are inherited', function (t) { + Object.keys(buffer).forEach(function (method) { + if (method === 'SlowBuffer' || method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], buffer[method], method) + t.notEqual(typeof impl[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Built-in Buffer static methods/properties are inherited', function (t) { + Object.keys(buffer.Buffer).forEach(function (method) { + if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], buffer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('.prototype property of Buffer is inherited', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.prototype, buffer.Buffer.prototype, 'prototype') + t.notEqual(typeof impl.Buffer.prototype, 'undefined', 'prototype') + }) + t.end() +}) + +test('All Safer methods are present in Dangerous', function (t) { + Object.keys(safer).forEach(function (method) { + if (method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], safer[method], method) + if (method !== 'kStringMaxLength') { + t.notEqual(typeof impl[method], 'undefined', method) + } + }) + }) + Object.keys(safer.Buffer).forEach(function (method) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], safer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Safe methods from Dangerous methods are present in Safer', function (t) { + Object.keys(dangerous).forEach(function (method) { + if (method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], dangerous[method], method) + if (method !== 'kStringMaxLength') { + t.notEqual(typeof impl[method], 'undefined', method) + } + }) + }) + Object.keys(dangerous.Buffer).forEach(function (method) { + if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], dangerous.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +/* Behaviour tests */ + +test('Methods return Buffers', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 10))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 'a'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10, 'x'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(9, 'ab'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(''))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string', 'utf-8'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([0, 42, 3]))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(new Uint8Array([0, 42, 3])))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([]))) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](0))) + t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](10))) + }) + t.end() +}) + +test('Constructor is buffer.Buffer', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.alloc(0).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(0, 10).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(0, 'a').constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(10).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(10, 'x').constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(9, 'ab').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('string').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('string', 'utf-8').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').constructor, buffer.Buffer) + t.equal(impl.Buffer.from([0, 42, 3]).constructor, buffer.Buffer) + t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).constructor, buffer.Buffer) + t.equal(impl.Buffer.from([]).constructor, buffer.Buffer) + }); + [0, 10, 100].forEach(function (arg) { + t.equal(dangerous.Buffer.allocUnsafe(arg).constructor, buffer.Buffer) + t.equal(dangerous.Buffer.allocUnsafeSlow(arg).constructor, buffer.SlowBuffer(0).constructor) + }) + t.end() +}) + +test('Invalid calls throw', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.throws(function () { impl.Buffer.from(0) }) + t.throws(function () { impl.Buffer.from(10) }) + t.throws(function () { impl.Buffer.from(10, 'utf-8') }) + t.throws(function () { impl.Buffer.from('string', 'invalid encoding') }) + t.throws(function () { impl.Buffer.from(-10) }) + t.throws(function () { impl.Buffer.from(1e90) }) + t.throws(function () { impl.Buffer.from(Infinity) }) + t.throws(function () { impl.Buffer.from(-Infinity) }) + t.throws(function () { impl.Buffer.from(NaN) }) + t.throws(function () { impl.Buffer.from(null) }) + t.throws(function () { impl.Buffer.from(undefined) }) + t.throws(function () { impl.Buffer.from() }) + t.throws(function () { impl.Buffer.from({}) }) + t.throws(function () { impl.Buffer.alloc('') }) + t.throws(function () { impl.Buffer.alloc('string') }) + t.throws(function () { impl.Buffer.alloc('string', 'utf-8') }) + t.throws(function () { impl.Buffer.alloc('b25ldHdvdGhyZWU=', 'base64') }) + t.throws(function () { impl.Buffer.alloc(-10) }) + t.throws(function () { impl.Buffer.alloc(1e90) }) + t.throws(function () { impl.Buffer.alloc(2 * (1 << 30)) }) + t.throws(function () { impl.Buffer.alloc(Infinity) }) + t.throws(function () { impl.Buffer.alloc(-Infinity) }) + t.throws(function () { impl.Buffer.alloc(null) }) + t.throws(function () { impl.Buffer.alloc(undefined) }) + t.throws(function () { impl.Buffer.alloc() }) + t.throws(function () { impl.Buffer.alloc([]) }) + t.throws(function () { impl.Buffer.alloc([0, 42, 3]) }) + t.throws(function () { impl.Buffer.alloc({}) }) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.throws(function () { dangerous.Buffer[method]('') }) + t.throws(function () { dangerous.Buffer[method]('string') }) + t.throws(function () { dangerous.Buffer[method]('string', 'utf-8') }) + t.throws(function () { dangerous.Buffer[method](2 * (1 << 30)) }) + t.throws(function () { dangerous.Buffer[method](Infinity) }) + if (dangerous.Buffer[method] === buffer.Buffer.allocUnsafe) { + t.skip('Skipping, older impl of allocUnsafe coerced negative sizes to 0') + } else { + t.throws(function () { dangerous.Buffer[method](-10) }) + t.throws(function () { dangerous.Buffer[method](-1e90) }) + t.throws(function () { dangerous.Buffer[method](-Infinity) }) + } + t.throws(function () { dangerous.Buffer[method](null) }) + t.throws(function () { dangerous.Buffer[method](undefined) }) + t.throws(function () { dangerous.Buffer[method]() }) + t.throws(function () { dangerous.Buffer[method]([]) }) + t.throws(function () { dangerous.Buffer[method]([0, 42, 3]) }) + t.throws(function () { dangerous.Buffer[method]({}) }) + }) + t.end() +}) + +test('Buffers have appropriate lengths', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.alloc(0).length, 0) + t.equal(impl.Buffer.alloc(10).length, 10) + t.equal(impl.Buffer.from('').length, 0) + t.equal(impl.Buffer.from('string').length, 6) + t.equal(impl.Buffer.from('string', 'utf-8').length, 6) + t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').length, 11) + t.equal(impl.Buffer.from([0, 42, 3]).length, 3) + t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).length, 3) + t.equal(impl.Buffer.from([]).length, 0) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.equal(dangerous.Buffer[method](0).length, 0) + t.equal(dangerous.Buffer[method](10).length, 10) + }) + t.end() +}) + +test('Buffers have appropriate lengths (2)', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true; + [ safer.Buffer.alloc, + dangerous.Buffer.allocUnsafe, + dangerous.Buffer.allocUnsafeSlow + ].forEach(function (method) { + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 1e5) + var buf = method(length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + } + }) + t.ok(ok) + t.end() +}) + +test('.alloc(size) is zero-filled and has correct length', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var buf = index.Buffer.alloc(length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + var j + for (j = 0; j < length; j++) { + if (buf[j] !== 0) ok = false + } + buf.fill(1) + for (j = 0; j < length; j++) { + if (buf[j] !== 1) ok = false + } + } + t.ok(ok) + t.end() +}) + +test('.allocUnsafe / .allocUnsafeSlow are fillable and have correct lengths', function (t) { + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var buf = dangerous.Buffer[method](length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + buf.fill(0, 0, length) + var j + for (j = 0; j < length; j++) { + if (buf[j] !== 0) ok = false + } + buf.fill(1, 0, length) + for (j = 0; j < length; j++) { + if (buf[j] !== 1) ok = false + } + } + t.ok(ok, method) + }) + t.end() +}) + +test('.alloc(size, fill) is `fill`-filled', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var fill = Math.round(Math.random() * 255) + var buf = index.Buffer.alloc(length, fill) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + for (var j = 0; j < length; j++) { + if (buf[j] !== fill) ok = false + } + } + t.ok(ok) + t.end() +}) + +test('.alloc(size, fill) is `fill`-filled', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var fill = Math.round(Math.random() * 255) + var buf = index.Buffer.alloc(length, fill) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + for (var j = 0; j < length; j++) { + if (buf[j] !== fill) ok = false + } + } + t.ok(ok) + t.deepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 97)) + t.notDeepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 98)) + + var tmp = new buffer.Buffer(2) + tmp.fill('ok') + if (tmp[1] === tmp[0]) { + // Outdated Node.js + t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('ooooo')) + } else { + t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('okoko')) + } + t.notDeepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('kokok')) + + t.end() +}) + +test('safer.Buffer.from returns results same as Buffer constructor', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.deepEqual(impl.Buffer.from(''), new buffer.Buffer('')) + t.deepEqual(impl.Buffer.from('string'), new buffer.Buffer('string')) + t.deepEqual(impl.Buffer.from('string', 'utf-8'), new buffer.Buffer('string', 'utf-8')) + t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), new buffer.Buffer('b25ldHdvdGhyZWU=', 'base64')) + t.deepEqual(impl.Buffer.from([0, 42, 3]), new buffer.Buffer([0, 42, 3])) + t.deepEqual(impl.Buffer.from(new Uint8Array([0, 42, 3])), new buffer.Buffer(new Uint8Array([0, 42, 3]))) + t.deepEqual(impl.Buffer.from([]), new buffer.Buffer([])) + }) + t.end() +}) + +test('safer.Buffer.from returns consistent results', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.deepEqual(impl.Buffer.from(''), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from([]), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from(new Uint8Array([])), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from('string', 'utf-8'), impl.Buffer.from('string')) + t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from([115, 116, 114, 105, 110, 103])) + t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from(impl.Buffer.from('string'))) + t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), impl.Buffer.from('onetwothree')) + t.notDeepEqual(impl.Buffer.from('b25ldHdvdGhyZWU='), impl.Buffer.from('onetwothree')) + }) + t.end() +}) diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/README.md new file mode 100644 index 0000000..e9d1bc5 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/README.md @@ -0,0 +1,665 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Install + +```bash +npm install semver +```` + +## Usage + +As a node module: + +```js +const semver = require('semver') + +semver.valid('1.2.3') // '1.2.3' +semver.valid('a.b.c') // null +semver.clean(' =v1.2.3 ') // '1.2.3' +semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true +semver.gt('1.2.3', '9.8.7') // false +semver.lt('1.2.3', '9.8.7') // true +semver.minVersion('>=1.0.0') // '1.0.0' +semver.valid(semver.coerce('v2')) // '2.0.0' +semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' +``` + +You can also just load the module for the function that you care about if +you'd like to minimize your footprint. + +```js +// load the whole API at once in a single object +const semver = require('semver') + +// or just load the bits you need +// all of them listed here, just pick and choose what you want + +// classes +const SemVer = require('semver/classes/semver') +const Comparator = require('semver/classes/comparator') +const Range = require('semver/classes/range') + +// functions for working with versions +const semverParse = require('semver/functions/parse') +const semverValid = require('semver/functions/valid') +const semverClean = require('semver/functions/clean') +const semverInc = require('semver/functions/inc') +const semverDiff = require('semver/functions/diff') +const semverMajor = require('semver/functions/major') +const semverMinor = require('semver/functions/minor') +const semverPatch = require('semver/functions/patch') +const semverPrerelease = require('semver/functions/prerelease') +const semverCompare = require('semver/functions/compare') +const semverRcompare = require('semver/functions/rcompare') +const semverCompareLoose = require('semver/functions/compare-loose') +const semverCompareBuild = require('semver/functions/compare-build') +const semverSort = require('semver/functions/sort') +const semverRsort = require('semver/functions/rsort') + +// low-level comparators between versions +const semverGt = require('semver/functions/gt') +const semverLt = require('semver/functions/lt') +const semverEq = require('semver/functions/eq') +const semverNeq = require('semver/functions/neq') +const semverGte = require('semver/functions/gte') +const semverLte = require('semver/functions/lte') +const semverCmp = require('semver/functions/cmp') +const semverCoerce = require('semver/functions/coerce') + +// working with ranges +const semverSatisfies = require('semver/functions/satisfies') +const semverMaxSatisfying = require('semver/ranges/max-satisfying') +const semverMinSatisfying = require('semver/ranges/min-satisfying') +const semverToComparators = require('semver/ranges/to-comparators') +const semverMinVersion = require('semver/ranges/min-version') +const semverValidRange = require('semver/ranges/valid') +const semverOutside = require('semver/ranges/outside') +const semverGtr = require('semver/ranges/gtr') +const semverLtr = require('semver/ranges/ltr') +const semverIntersects = require('semver/ranges/intersects') +const semverSimplifyRange = require('semver/ranges/simplify') +const semverRangeSubset = require('semver/ranges/subset') +``` + +As a command-line utility: + +``` +$ semver -h + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, prerelease, or release. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-n <0|1|false> + Base number for prerelease identifier (default: 0). + Use false to omit the number altogether. + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them. +``` + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. +Support for stripping a leading "v" is kept for compatibility with `v1.0.0` of the SemVer +specification but should not be used anymore. + +## Ranges + +A `version range` is a set of `comparators` that specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and +would match the versions `2.0.0` and `3.1.0`, but not the versions +`1.0.1` or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. +Version `3.4.5` *would* satisfy the range because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose of this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range-matching +semantics. + +Second, a user who has opted into using a prerelease version has +indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +Note that this behavior can be suppressed (treating all prerelease +versions as if they were normal versions, for range-matching) +by setting the `includePrerelease` flag on the options +object to any +[functions](https://github.com/npm/node-semver#functions) that do +range matching. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta') +// '1.2.4-beta.0' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```bash +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +To get out of the prerelease phase, use the `release` option: + +```bash +$ semver 1.2.4-beta.1 -i release +1.2.4 +``` + +#### Prerelease Identifier Base + +The method `.inc` takes an optional parameter 'identifierBase' string +that will let you let your prerelease number as zero-based or one-based. +Set to `false` to omit the prerelease number altogether. +If you do not specify this parameter, it will default to zero-based. + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta', '1') +// '1.2.4-beta.1' +``` + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta', false) +// '1.2.4-beta' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta -n 1 +1.2.4-beta.1 +``` + +```bash +$ semver 1.2.3 -i prerelease --preid beta -n false +1.2.4-beta +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless + `includePrerelease` is specified, in which case any version at all + satisfies) +* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero element in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0-0` +* `^0.2.3` := `>=0.2.3 <0.3.0-0` +* `^0.0.3` := `>=0.0.3 <0.0.4-0` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0-0` +* `^0.0.x` := `>=0.0.0 <0.1.0-0` +* `^0.0` := `>=0.0.0 <0.1.0-0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0-0` +* `^0.x` := `>=0.0.0 <1.0.0-0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `options` object argument. All +options in this object are `false` by default. The options supported +are: + +- `loose`: Be more forgiving about not-quite-valid semver strings. + (Any resulting output will always be 100% strict compliant, of + course.) For backwards compatibility reasons, if the `options` + argument is a boolean value instead of an object, it is interpreted + to be the `loose` param. +- `includePrerelease`: Set to suppress the [default + behavior](https://github.com/npm/node-semver#prerelease-tags) of + excluding prerelease tagged versions from ranges unless they are + explicitly opted into. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, releaseType, options, identifier, identifierBase)`: + Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, `prerelease`, or `release`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, `prerelease` will work the + same as `prepatch`. It increments the patch version and then makes a + prerelease. If the input version is already a prerelease it simply + increments it. + * `release` will remove any prerelease part of the version. + * `identifier` can be used to prefix `premajor`, `preminor`, + `prepatch`, or `prerelease` version increments. `identifierBase` + is the base to be used for the `prerelease` identifier. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. +* `intersects(r1, r2, loose)`: Return true if the two supplied ranges + or comparators intersect. +* `parse(v)`: Attempt to parse a string as a semantic version, returning either + a `SemVer` object or `null`. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of `compare`. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions + are equal. Sorts in ascending order if passed to `Array.sort()`. +* `compareLoose(v1, v2)`: Short for `compare(v1, v2, { loose: true })`. +* `diff(v1, v2)`: Returns the difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + +### Sorting + +* `sort(versions)`: Returns a sorted array of versions based on the `compareBuild` + function. +* `rsort(versions)`: The reverse of `sort`. Returns an array of versions based on + the `compareBuild` function in descending order. + +### Comparators + +* `intersects(comparator)`: Return true if the comparators intersect + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid. +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. +* `minVersion(range)`: Return the lowest version that can match + the given range. +* `gtr(version, range)`: Return `true` if the version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if the version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) +* `intersects(range)`: Return true if any of the range comparators intersect. +* `simplifyRange(versions, range)`: Return a "simplified" range that + matches the same items in the `versions` list as the range specified. Note + that it does *not* guarantee that it would match the same versions in all + cases, only for the set of versions provided. This is useful when + generating ranges by joining together multiple versions with `||` + programmatically, to provide the user with something a bit more + ergonomic. If the provided range is shorter in string-length than the + generated range, then that is returned. +* `subset(subRange, superRange)`: Return `true` if the `subRange` range is + entirely contained by the `superRange` range. + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. + +### Coercion + +* `coerce(version, options)`: Coerces a string to semver if possible + +This aims to provide a very forgiving translation of a non-semver string to +semver. It looks for the first digit in a string and consumes all +remaining characters which satisfy at least a partial semver (e.g., `1`, +`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer +versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All +surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes +`3.4.0`). Only text which lacks digits will fail coercion (`version one` +is not valid). The maximum length for any semver component considered for +coercion is 16 characters; longer components will be ignored +(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any +semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value +components are invalid (`9999999999999999.4.7.4` is likely invalid). + +If the `options.rtl` flag is set, then `coerce` will return the right-most +coercible tuple that does not share an ending index with a longer coercible +tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not +`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of +any other overlapping SemVer tuple. + +If the `options.includePrerelease` flag is set, then the `coerce` result will contain +prerelease and build parts of a version. For example, `1.2.3.4-rc.1+rev.2` +will preserve prerelease `rc.1` and build `rev.2` in the result. + +### Clean + +* `clean(version)`: Clean a string to be a valid semver if possible + +This will return a cleaned and trimmed semver version. If the provided +version is not valid a null will be returned. This does not work for +ranges. + +ex. +* `s.clean(' = v 2.1.5foo')`: `null` +* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean(' = v 2.1.5-foo')`: `null` +* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean('=v2.1.5')`: `'2.1.5'` +* `s.clean(' =v2.1.5')`: `'2.1.5'` +* `s.clean(' 2.1.5 ')`: `'2.1.5'` +* `s.clean('~1.0.0')`: `null` + +## Constants + +As a convenience, helper constants are exported to provide information about what `node-semver` supports: + +### `RELEASE_TYPES` + +- major +- premajor +- minor +- preminor +- patch +- prepatch +- prerelease + +``` +const semver = require('semver'); + +if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) { + console.log('This is a valid release type!'); +} else { + console.warn('This is NOT a valid release type!'); +} +``` + +### `SEMVER_SPEC_VERSION` + +2.0.0 + +``` +const semver = require('semver'); + +console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION); +``` + +## Exported Modules + + + +You may pull in just the part of this semver utility that you need if you +are sensitive to packing and tree-shaking concerns. The main +`require('semver')` export uses getter functions to lazily load the parts +of the API that are used. + +The following modules are available: + +* `require('semver')` +* `require('semver/classes')` +* `require('semver/classes/comparator')` +* `require('semver/classes/range')` +* `require('semver/classes/semver')` +* `require('semver/functions/clean')` +* `require('semver/functions/cmp')` +* `require('semver/functions/coerce')` +* `require('semver/functions/compare')` +* `require('semver/functions/compare-build')` +* `require('semver/functions/compare-loose')` +* `require('semver/functions/diff')` +* `require('semver/functions/eq')` +* `require('semver/functions/gt')` +* `require('semver/functions/gte')` +* `require('semver/functions/inc')` +* `require('semver/functions/lt')` +* `require('semver/functions/lte')` +* `require('semver/functions/major')` +* `require('semver/functions/minor')` +* `require('semver/functions/neq')` +* `require('semver/functions/parse')` +* `require('semver/functions/patch')` +* `require('semver/functions/prerelease')` +* `require('semver/functions/rcompare')` +* `require('semver/functions/rsort')` +* `require('semver/functions/satisfies')` +* `require('semver/functions/sort')` +* `require('semver/functions/valid')` +* `require('semver/ranges/gtr')` +* `require('semver/ranges/intersects')` +* `require('semver/ranges/ltr')` +* `require('semver/ranges/max-satisfying')` +* `require('semver/ranges/min-satisfying')` +* `require('semver/ranges/min-version')` +* `require('semver/ranges/outside')` +* `require('semver/ranges/simplify')` +* `require('semver/ranges/subset')` +* `require('semver/ranges/to-comparators')` +* `require('semver/ranges/valid')` + diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/bin/semver.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/bin/semver.js new file mode 100644 index 0000000..d62bfc0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/bin/semver.js @@ -0,0 +1,191 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +'use strict' + +const argv = process.argv.slice(2) + +let versions = [] + +const range = [] + +let inc = null + +const version = require('../package.json').version + +let loose = false + +let includePrerelease = false + +let coerce = false + +let rtl = false + +let identifier + +let identifierBase + +const semver = require('../') +const parseOptions = require('../internal/parse-options') + +let reverse = false + +let options = {} + +const main = () => { + if (!argv.length) { + return help() + } + while (argv.length) { + let a = argv.shift() + const indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + const value = a.slice(indexOfEqualSign + 1) + a = a.slice(0, indexOfEqualSign) + argv.unshift(value) + } + switch (a) { + case '-rv': case '-rev': case '--rev': case '--reverse': + reverse = true + break + case '-l': case '--loose': + loose = true + break + case '-p': case '--include-prerelease': + includePrerelease = true + break + case '-v': case '--version': + versions.push(argv.shift()) + break + case '-i': case '--inc': case '--increment': + switch (argv[0]) { + case 'major': case 'minor': case 'patch': case 'prerelease': + case 'premajor': case 'preminor': case 'prepatch': + case 'release': + inc = argv.shift() + break + default: + inc = 'patch' + break + } + break + case '--preid': + identifier = argv.shift() + break + case '-r': case '--range': + range.push(argv.shift()) + break + case '-n': + identifierBase = argv.shift() + if (identifierBase === 'false') { + identifierBase = false + } + break + case '-c': case '--coerce': + coerce = true + break + case '--rtl': + rtl = true + break + case '--ltr': + rtl = false + break + case '-h': case '--help': case '-?': + return help() + default: + versions.push(a) + break + } + } + + options = parseOptions({ loose, includePrerelease, rtl }) + + versions = versions.map((v) => { + return coerce ? (semver.coerce(v, options) || { version: v }).version : v + }).filter((v) => { + return semver.valid(v, options) + }) + if (!versions.length) { + return fail() + } + if (inc && (versions.length !== 1 || range.length)) { + return failInc() + } + + for (let i = 0, l = range.length; i < l; i++) { + versions = versions.filter((v) => { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) { + return fail() + } + } + versions + .sort((a, b) => semver[reverse ? 'rcompare' : 'compare'](a, b, options)) + .map(v => semver.clean(v, options)) + .map(v => inc ? semver.inc(v, inc, options, identifier, identifierBase) : v) + .forEach(v => console.log(v)) +} + +const failInc = () => { + console.error('--inc can only be used on a single version with no range') + fail() +} + +const fail = () => process.exit(1) + +const help = () => console.log( +`SemVer ${version} + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, prerelease, or release. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + +-n + Base number to be used for the prerelease identifier. + Can be either 0 or 1, or false to omit the number altogether. + Defaults to 0. + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them.`) + +main() diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/classes/comparator.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/classes/comparator.js new file mode 100644 index 0000000..647c1f0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/classes/comparator.js @@ -0,0 +1,143 @@ +'use strict' + +const ANY = Symbol('SemVer ANY') +// hoisted class for cyclic dependency +class Comparator { + static get ANY () { + return ANY + } + + constructor (comp, options) { + options = parseOptions(options) + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + comp = comp.trim().split(/\s+/).join(' ') + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) + } + + parse (comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const m = comp.match(r) + + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`) + } + + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } + } + + toString () { + return this.value + } + + test (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY || version === ANY) { + return true + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + return cmp(version, this.operator, this.semver, this.options) + } + + intersects (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (this.operator === '') { + if (this.value === '') { + return true + } + return new Range(comp.value, options).test(this.value) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + return new Range(this.value, options).test(comp.semver) + } + + options = parseOptions(options) + + // Special cases where nothing can possibly be lower + if (options.includePrerelease && + (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { + return false + } + if (!options.includePrerelease && + (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { + return false + } + + // Same direction increasing (> or >=) + if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { + return true + } + // Same direction decreasing (< or <=) + if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { + return true + } + // same SemVer and both sides are inclusive (<= or >=) + if ( + (this.semver.version === comp.semver.version) && + this.operator.includes('=') && comp.operator.includes('=')) { + return true + } + // opposite directions less than + if (cmp(this.semver, '<', comp.semver, options) && + this.operator.startsWith('>') && comp.operator.startsWith('<')) { + return true + } + // opposite directions greater than + if (cmp(this.semver, '>', comp.semver, options) && + this.operator.startsWith('<') && comp.operator.startsWith('>')) { + return true + } + return false + } +} + +module.exports = Comparator + +const parseOptions = require('../internal/parse-options') +const { safeRe: re, t } = require('../internal/re') +const cmp = require('../functions/cmp') +const debug = require('../internal/debug') +const SemVer = require('./semver') +const Range = require('./range') diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/classes/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/classes/index.js new file mode 100644 index 0000000..91c24ec --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/classes/index.js @@ -0,0 +1,7 @@ +'use strict' + +module.exports = { + SemVer: require('./semver.js'), + Range: require('./range.js'), + Comparator: require('./comparator.js'), +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/classes/range.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/classes/range.js new file mode 100644 index 0000000..94629ce --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/classes/range.js @@ -0,0 +1,557 @@ +'use strict' + +const SPACE_CHARACTERS = /\s+/g + +// hoisted class for cyclic dependency +class Range { + constructor (range, options) { + options = parseOptions(options) + + if (range instanceof Range) { + if ( + range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease + ) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + // just put it in the set and return + this.raw = range.value + this.set = [[range]] + this.formatted = undefined + return this + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. + this.raw = range.trim().replace(SPACE_CHARACTERS, ' ') + + // First, split on || + this.set = this.raw + .split('||') + // map the range to a 2d array of comparators + .map(r => this.parseRange(r.trim())) + // throw out any comparator lists that are empty + // this generally means that it was not a valid range, which is allowed + // in loose mode, but will still throw if the WHOLE range is invalid. + .filter(c => c.length) + + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`) + } + + // if we have any that are not the null set, throw out null sets. + if (this.set.length > 1) { + // keep the first one, in case they're all null sets + const first = this.set[0] + this.set = this.set.filter(c => !isNullSet(c[0])) + if (this.set.length === 0) { + this.set = [first] + } else if (this.set.length > 1) { + // if we have any that are *, then the range is just * + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c] + break + } + } + } + } + + this.formatted = undefined + } + + get range () { + if (this.formatted === undefined) { + this.formatted = '' + for (let i = 0; i < this.set.length; i++) { + if (i > 0) { + this.formatted += '||' + } + const comps = this.set[i] + for (let k = 0; k < comps.length; k++) { + if (k > 0) { + this.formatted += ' ' + } + this.formatted += comps[k].toString().trim() + } + } + } + return this.formatted + } + + format () { + return this.range + } + + toString () { + return this.range + } + + parseRange (range) { + // memoize range parsing for performance. + // this is a very hot path, and fully deterministic. + const memoOpts = + (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | + (this.options.loose && FLAG_LOOSE) + const memoKey = memoOpts + ':' + range + const cached = cache.get(memoKey) + if (cached) { + return cached + } + + const loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) + debug('hyphen replace', range) + + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + debug('tilde trim', range) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) + debug('caret trim', range) + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + let rangeList = range + .split(' ') + .map(comp => parseComparator(comp, this.options)) + .join(' ') + .split(/\s+/) + // >=0.0.0 is equivalent to * + .map(comp => replaceGTE0(comp, this.options)) + + if (loose) { + // in loose mode, throw out any that are not valid comparators + rangeList = rangeList.filter(comp => { + debug('loose invalid filter', comp, this.options) + return !!comp.match(re[t.COMPARATORLOOSE]) + }) + } + debug('range list', rangeList) + + // if any comparators are the null set, then replace with JUST null set + // if more than one comparator, remove any * comparators + // also, don't include the same comparator more than once + const rangeMap = new Map() + const comparators = rangeList.map(comp => new Comparator(comp, this.options)) + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp] + } + rangeMap.set(comp.value, comp) + } + if (rangeMap.size > 1 && rangeMap.has('')) { + rangeMap.delete('') + } + + const result = [...rangeMap.values()] + cache.set(memoKey, result) + return result + } + + intersects (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some((thisComparators) => { + return ( + isSatisfiable(thisComparators, options) && + range.set.some((rangeComparators) => { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) + } + + // if ANY of the sets match ALL of its comparators, then pass + test (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false + } +} + +module.exports = Range + +const LRU = require('../internal/lrucache') +const cache = new LRU() + +const parseOptions = require('../internal/parse-options') +const Comparator = require('./comparator') +const debug = require('../internal/debug') +const SemVer = require('./semver') +const { + safeRe: re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace, +} = require('../internal/re') +const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants') + +const isNullSet = c => c.value === '<0.0.0-0' +const isAny = c => c.value === '' + +// take a set of comparators and determine whether there +// exists a version which can satisfy it +const isSatisfiable = (comparators, options) => { + let result = true + const remainingComparators = comparators.slice() + let testComparator = remainingComparators.pop() + + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options) + }) + + testComparator = remainingComparators.pop() + } + + return result +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +const parseComparator = (comp, options) => { + comp = comp.replace(re[t.BUILD], '') + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +const isX = id => !id || id.toLowerCase() === 'x' || id === '*' + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 +// ~0.0.1 --> >=0.0.1 <0.1.0-0 +const replaceTildes = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceTilde(c, options)) + .join(' ') +} + +const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, (_, M, m, p, pr) => { + debug('tilde', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0` + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` + } else if (pr) { + debug('replaceTilde pr', pr) + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } else { + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p + } <${M}.${+m + 1}.0-0` + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 +// ^1.2.3 --> >=1.2.3 <2.0.0-0 +// ^1.2.0 --> >=1.2.0 <2.0.0-0 +// ^0.0.1 --> >=0.0.1 <0.0.2-0 +// ^0.1.0 --> >=0.1.0 <0.2.0-0 +const replaceCarets = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceCaret(c, options)) + .join(' ') +} + +const replaceCaret = (comp, options) => { + debug('caret', comp, options) + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + const z = options.includePrerelease ? '-0' : '' + return comp.replace(r, (_, M, m, p, pr) => { + debug('caret', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` + } else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${+M + 1}.0.0-0` + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p + }${z} <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p + }${z} <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p + } <${+M + 1}.0.0-0` + } + } + + debug('caret return', ret) + return ret + }) +} + +const replaceXRanges = (comp, options) => { + debug('replaceXRanges', comp, options) + return comp + .split(/\s+/) + .map((c) => replaceXRange(c, options)) + .join(' ') +} + +const replaceXRange = (comp, options) => { + comp = comp.trim() + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + const xM = isX(M) + const xm = xM || isX(m) + const xp = xm || isX(p) + const anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + if (gtlt === '<') { + pr = '-0' + } + + ret = `${gtlt + M}.${m}.${p}${pr}` + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` + } else if (xp) { + ret = `>=${M}.${m}.0${pr + } <${M}.${+m + 1}.0-0` + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +const replaceStars = (comp, options) => { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp + .trim() + .replace(re[t.STAR], '') +} + +const replaceGTE0 = (comp, options) => { + debug('replaceGTE0', comp, options) + return comp + .trim() + .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 +// TODO build? +const hyphenReplace = incPr => ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr) => { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? '-0' : ''}` + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` + } else if (fpr) { + from = `>=${from}` + } else { + from = `>=${from}${incPr ? '-0' : ''}` + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0` + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0` + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}` + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0` + } else { + to = `<=${to}` + } + + return `${from} ${to}`.trim() +} + +const testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (let i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === Comparator.ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/classes/semver.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/classes/semver.js new file mode 100644 index 0000000..92254be --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/classes/semver.js @@ -0,0 +1,333 @@ +'use strict' + +const debug = require('../internal/debug') +const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') +const { safeRe: re, t } = require('../internal/re') + +const parseOptions = require('../internal/parse-options') +const { compareIdentifiers } = require('../internal/identifiers') +class SemVer { + constructor (version, options) { + options = parseOptions(options) + + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease + + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() + } + + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version + } + + toString () { + return this.version + } + + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 + } + other = new SemVer(other, this.options) + } + + if (other.version === this.version) { + return 0 + } + + return this.compareMain(other) || this.comparePre(other) + } + + compareMain (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + if (this.major < other.major) { + return -1 + } + if (this.major > other.major) { + return 1 + } + if (this.minor < other.minor) { + return -1 + } + if (this.minor > other.minor) { + return 1 + } + if (this.patch < other.patch) { + return -1 + } + if (this.patch > other.patch) { + return 1 + } + return 0 + } + + comparePre (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + let i = 0 + do { + const a = this.prerelease[i] + const b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + let i = 0 + do { + const a = this.build[i] + const b = other.build[i] + debug('build compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier, identifierBase) { + if (release.startsWith('pre')) { + if (!identifier && identifierBase === false) { + throw new Error('invalid increment argument: identifier is empty') + } + // Avoid an invalid semver results + if (identifier) { + const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]) + if (!match || match[1] !== identifier) { + throw new Error(`invalid identifier: ${identifier}`) + } + } + } + + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier, identifierBase) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier, identifierBase) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier, identifierBase) + this.inc('pre', identifier, identifierBase) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier, identifierBase) + } + this.inc('pre', identifier, identifierBase) + break + case 'release': + if (this.prerelease.length === 0) { + throw new Error(`version ${this.raw} is not a prerelease`) + } + this.prerelease.length = 0 + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': { + const base = Number(identifierBase) ? 1 : 0 + + if (this.prerelease.length === 0) { + this.prerelease = [base] + } else { + let i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + if (identifier === this.prerelease.join('.') && identifierBase === false) { + throw new Error('invalid increment argument: identifier already exists') + } + this.prerelease.push(base) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + let prerelease = [identifier, base] + if (identifierBase === false) { + prerelease = [identifier] + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease + } + } else { + this.prerelease = prerelease + } + } + break + } + default: + throw new Error(`invalid increment argument: ${release}`) + } + this.raw = this.format() + if (this.build.length) { + this.raw += `+${this.build.join('.')}` + } + return this + } +} + +module.exports = SemVer diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/clean.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/clean.js new file mode 100644 index 0000000..79703d6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/clean.js @@ -0,0 +1,8 @@ +'use strict' + +const parse = require('./parse') +const clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} +module.exports = clean diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/cmp.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/cmp.js new file mode 100644 index 0000000..77487dc --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/cmp.js @@ -0,0 +1,54 @@ +'use strict' + +const eq = require('./eq') +const neq = require('./neq') +const gt = require('./gt') +const gte = require('./gte') +const lt = require('./lt') +const lte = require('./lte') + +const cmp = (a, op, b, loose) => { + switch (op) { + case '===': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a === b + + case '!==': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError(`Invalid operator: ${op}`) + } +} +module.exports = cmp diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/coerce.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/coerce.js new file mode 100644 index 0000000..cfe0275 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/coerce.js @@ -0,0 +1,62 @@ +'use strict' + +const SemVer = require('../classes/semver') +const parse = require('./parse') +const { safeRe: re, t } = require('../internal/re') + +const coerce = (version, options) => { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + let match = null + if (!options.rtl) { + match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL] + let next + while ((next = coerceRtlRegex.exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + coerceRtlRegex.lastIndex = -1 + } + + if (match === null) { + return null + } + + const major = match[2] + const minor = match[3] || '0' + const patch = match[4] || '0' + const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '' + const build = options.includePrerelease && match[6] ? `+${match[6]}` : '' + + return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options) +} +module.exports = coerce diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/compare-build.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/compare-build.js new file mode 100644 index 0000000..99157cf --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/compare-build.js @@ -0,0 +1,9 @@ +'use strict' + +const SemVer = require('../classes/semver') +const compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose) + const versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} +module.exports = compareBuild diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/compare-loose.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/compare-loose.js new file mode 100644 index 0000000..7531634 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/compare-loose.js @@ -0,0 +1,5 @@ +'use strict' + +const compare = require('./compare') +const compareLoose = (a, b) => compare(a, b, true) +module.exports = compareLoose diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/compare.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/compare.js new file mode 100644 index 0000000..63d8090 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/compare.js @@ -0,0 +1,7 @@ +'use strict' + +const SemVer = require('../classes/semver') +const compare = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)) + +module.exports = compare diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/diff.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/diff.js new file mode 100644 index 0000000..c99ab51 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/diff.js @@ -0,0 +1,60 @@ +'use strict' + +const parse = require('./parse.js') + +const diff = (version1, version2) => { + const v1 = parse(version1, null, true) + const v2 = parse(version2, null, true) + const comparison = v1.compare(v2) + + if (comparison === 0) { + return null + } + + const v1Higher = comparison > 0 + const highVersion = v1Higher ? v1 : v2 + const lowVersion = v1Higher ? v2 : v1 + const highHasPre = !!highVersion.prerelease.length + const lowHasPre = !!lowVersion.prerelease.length + + if (lowHasPre && !highHasPre) { + // Going from prerelease -> no prerelease requires some special casing + + // If the low version has only a major, then it will always be a major + // Some examples: + // 1.0.0-1 -> 1.0.0 + // 1.0.0-1 -> 1.1.1 + // 1.0.0-1 -> 2.0.0 + if (!lowVersion.patch && !lowVersion.minor) { + return 'major' + } + + // If the main part has no difference + if (lowVersion.compareMain(highVersion) === 0) { + if (lowVersion.minor && !lowVersion.patch) { + return 'minor' + } + return 'patch' + } + } + + // add the `pre` prefix if we are going to a prerelease version + const prefix = highHasPre ? 'pre' : '' + + if (v1.major !== v2.major) { + return prefix + 'major' + } + + if (v1.minor !== v2.minor) { + return prefix + 'minor' + } + + if (v1.patch !== v2.patch) { + return prefix + 'patch' + } + + // high and low are prereleases + return 'prerelease' +} + +module.exports = diff diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/eq.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/eq.js new file mode 100644 index 0000000..5f0eead --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/eq.js @@ -0,0 +1,5 @@ +'use strict' + +const compare = require('./compare') +const eq = (a, b, loose) => compare(a, b, loose) === 0 +module.exports = eq diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/gt.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/gt.js new file mode 100644 index 0000000..84a57dd --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/gt.js @@ -0,0 +1,5 @@ +'use strict' + +const compare = require('./compare') +const gt = (a, b, loose) => compare(a, b, loose) > 0 +module.exports = gt diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/gte.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/gte.js new file mode 100644 index 0000000..7c52bdf --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/gte.js @@ -0,0 +1,5 @@ +'use strict' + +const compare = require('./compare') +const gte = (a, b, loose) => compare(a, b, loose) >= 0 +module.exports = gte diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/inc.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/inc.js new file mode 100644 index 0000000..ff999e9 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/inc.js @@ -0,0 +1,21 @@ +'use strict' + +const SemVer = require('../classes/semver') + +const inc = (version, release, options, identifier, identifierBase) => { + if (typeof (options) === 'string') { + identifierBase = identifier + identifier = options + options = undefined + } + + try { + return new SemVer( + version instanceof SemVer ? version.version : version, + options + ).inc(release, identifier, identifierBase).version + } catch (er) { + return null + } +} +module.exports = inc diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/lt.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/lt.js new file mode 100644 index 0000000..2fb32a0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/lt.js @@ -0,0 +1,5 @@ +'use strict' + +const compare = require('./compare') +const lt = (a, b, loose) => compare(a, b, loose) < 0 +module.exports = lt diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/lte.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/lte.js new file mode 100644 index 0000000..da9ee8f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/lte.js @@ -0,0 +1,5 @@ +'use strict' + +const compare = require('./compare') +const lte = (a, b, loose) => compare(a, b, loose) <= 0 +module.exports = lte diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/major.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/major.js new file mode 100644 index 0000000..e6d08dc --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/major.js @@ -0,0 +1,5 @@ +'use strict' + +const SemVer = require('../classes/semver') +const major = (a, loose) => new SemVer(a, loose).major +module.exports = major diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/minor.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/minor.js new file mode 100644 index 0000000..9e70ffd --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/minor.js @@ -0,0 +1,5 @@ +'use strict' + +const SemVer = require('../classes/semver') +const minor = (a, loose) => new SemVer(a, loose).minor +module.exports = minor diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/neq.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/neq.js new file mode 100644 index 0000000..84326b7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/neq.js @@ -0,0 +1,5 @@ +'use strict' + +const compare = require('./compare') +const neq = (a, b, loose) => compare(a, b, loose) !== 0 +module.exports = neq diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/parse.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/parse.js new file mode 100644 index 0000000..d544d33 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/parse.js @@ -0,0 +1,18 @@ +'use strict' + +const SemVer = require('../classes/semver') +const parse = (version, options, throwErrors = false) => { + if (version instanceof SemVer) { + return version + } + try { + return new SemVer(version, options) + } catch (er) { + if (!throwErrors) { + return null + } + throw er + } +} + +module.exports = parse diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/patch.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/patch.js new file mode 100644 index 0000000..7675162 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/patch.js @@ -0,0 +1,5 @@ +'use strict' + +const SemVer = require('../classes/semver') +const patch = (a, loose) => new SemVer(a, loose).patch +module.exports = patch diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/prerelease.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/prerelease.js new file mode 100644 index 0000000..b8fe1db --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/prerelease.js @@ -0,0 +1,8 @@ +'use strict' + +const parse = require('./parse') +const prerelease = (version, options) => { + const parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} +module.exports = prerelease diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/rcompare.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/rcompare.js new file mode 100644 index 0000000..8e1c222 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/rcompare.js @@ -0,0 +1,5 @@ +'use strict' + +const compare = require('./compare') +const rcompare = (a, b, loose) => compare(b, a, loose) +module.exports = rcompare diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/rsort.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/rsort.js new file mode 100644 index 0000000..5d3d200 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/rsort.js @@ -0,0 +1,5 @@ +'use strict' + +const compareBuild = require('./compare-build') +const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) +module.exports = rsort diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/satisfies.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/satisfies.js new file mode 100644 index 0000000..a0264a2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/satisfies.js @@ -0,0 +1,12 @@ +'use strict' + +const Range = require('../classes/range') +const satisfies = (version, range, options) => { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} +module.exports = satisfies diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/sort.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/sort.js new file mode 100644 index 0000000..edb24b1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/sort.js @@ -0,0 +1,5 @@ +'use strict' + +const compareBuild = require('./compare-build') +const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) +module.exports = sort diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/valid.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/valid.js new file mode 100644 index 0000000..0db67ed --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/functions/valid.js @@ -0,0 +1,8 @@ +'use strict' + +const parse = require('./parse') +const valid = (version, options) => { + const v = parse(version, options) + return v ? v.version : null +} +module.exports = valid diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/index.js new file mode 100644 index 0000000..285662a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/index.js @@ -0,0 +1,91 @@ +'use strict' + +// just pre-load all the stuff that index.js lazily exports +const internalRe = require('./internal/re') +const constants = require('./internal/constants') +const SemVer = require('./classes/semver') +const identifiers = require('./internal/identifiers') +const parse = require('./functions/parse') +const valid = require('./functions/valid') +const clean = require('./functions/clean') +const inc = require('./functions/inc') +const diff = require('./functions/diff') +const major = require('./functions/major') +const minor = require('./functions/minor') +const patch = require('./functions/patch') +const prerelease = require('./functions/prerelease') +const compare = require('./functions/compare') +const rcompare = require('./functions/rcompare') +const compareLoose = require('./functions/compare-loose') +const compareBuild = require('./functions/compare-build') +const sort = require('./functions/sort') +const rsort = require('./functions/rsort') +const gt = require('./functions/gt') +const lt = require('./functions/lt') +const eq = require('./functions/eq') +const neq = require('./functions/neq') +const gte = require('./functions/gte') +const lte = require('./functions/lte') +const cmp = require('./functions/cmp') +const coerce = require('./functions/coerce') +const Comparator = require('./classes/comparator') +const Range = require('./classes/range') +const satisfies = require('./functions/satisfies') +const toComparators = require('./ranges/to-comparators') +const maxSatisfying = require('./ranges/max-satisfying') +const minSatisfying = require('./ranges/min-satisfying') +const minVersion = require('./ranges/min-version') +const validRange = require('./ranges/valid') +const outside = require('./ranges/outside') +const gtr = require('./ranges/gtr') +const ltr = require('./ranges/ltr') +const intersects = require('./ranges/intersects') +const simplifyRange = require('./ranges/simplify') +const subset = require('./ranges/subset') +module.exports = { + parse, + valid, + clean, + inc, + diff, + major, + minor, + patch, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt, + lt, + eq, + neq, + gte, + lte, + cmp, + coerce, + Comparator, + Range, + satisfies, + toComparators, + maxSatisfying, + minSatisfying, + minVersion, + validRange, + outside, + gtr, + ltr, + intersects, + simplifyRange, + subset, + SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers, +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/constants.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/constants.js new file mode 100644 index 0000000..6d1db91 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/constants.js @@ -0,0 +1,37 @@ +'use strict' + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +const SEMVER_SPEC_VERSION = '2.0.0' + +const MAX_LENGTH = 256 +const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || +/* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +const MAX_SAFE_COMPONENT_LENGTH = 16 + +// Max safe length for a build identifier. The max length minus 6 characters for +// the shortest version with a build 0.0.0+BUILD. +const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + +const RELEASE_TYPES = [ + 'major', + 'premajor', + 'minor', + 'preminor', + 'patch', + 'prepatch', + 'prerelease', +] + +module.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 0b001, + FLAG_LOOSE: 0b010, +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/debug.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/debug.js new file mode 100644 index 0000000..20d1e9d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/debug.js @@ -0,0 +1,11 @@ +'use strict' + +const debug = ( + typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG) +) ? (...args) => console.error('SEMVER', ...args) + : () => {} + +module.exports = debug diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/identifiers.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/identifiers.js new file mode 100644 index 0000000..d053472 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/identifiers.js @@ -0,0 +1,29 @@ +'use strict' + +const numeric = /^[0-9]+$/ +const compareIdentifiers = (a, b) => { + if (typeof a === 'number' && typeof b === 'number') { + return a === b ? 0 : a < b ? -1 : 1 + } + + const anum = numeric.test(a) + const bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) + +module.exports = { + compareIdentifiers, + rcompareIdentifiers, +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/lrucache.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/lrucache.js new file mode 100644 index 0000000..b8bf526 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/lrucache.js @@ -0,0 +1,42 @@ +'use strict' + +class LRUCache { + constructor () { + this.max = 1000 + this.map = new Map() + } + + get (key) { + const value = this.map.get(key) + if (value === undefined) { + return undefined + } else { + // Remove the key from the map and add it to the end + this.map.delete(key) + this.map.set(key, value) + return value + } + } + + delete (key) { + return this.map.delete(key) + } + + set (key, value) { + const deleted = this.delete(key) + + if (!deleted && value !== undefined) { + // If cache is full, delete the least recently used item + if (this.map.size >= this.max) { + const firstKey = this.map.keys().next().value + this.delete(firstKey) + } + + this.map.set(key, value) + } + + return this + } +} + +module.exports = LRUCache diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/parse-options.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/parse-options.js new file mode 100644 index 0000000..5295454 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/parse-options.js @@ -0,0 +1,17 @@ +'use strict' + +// parse out just the options we care about +const looseOption = Object.freeze({ loose: true }) +const emptyOpts = Object.freeze({ }) +const parseOptions = options => { + if (!options) { + return emptyOpts + } + + if (typeof options !== 'object') { + return looseOption + } + + return options +} +module.exports = parseOptions diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/re.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/re.js new file mode 100644 index 0000000..639fca8 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/internal/re.js @@ -0,0 +1,223 @@ +'use strict' + +const { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH, +} = require('./constants') +const debug = require('./debug') +exports = module.exports = {} + +// The actual regexps go on exports.re +const re = exports.re = [] +const safeRe = exports.safeRe = [] +const src = exports.src = [] +const safeSrc = exports.safeSrc = [] +const t = exports.t = {} +let R = 0 + +const LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +const safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +const makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value + .split(`${token}*`).join(`${token}{0,${max}}`) + .split(`${token}+`).join(`${token}{1,${max}}`) + } + return value +} + +const createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value) + const index = R++ + debug(name, index, value) + t[name] = index + src[index] = value + safeSrc[index] = safe + re[index] = new RegExp(value, isGlobal ? 'g' : undefined) + safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined) +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') +createToken('NUMERICIDENTIFIERLOOSE', '\\d+') + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`) + +// ## Main Version +// Three dot-separated numeric identifiers. + +createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})`) + +createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. +// Non-numeric identifiers include numeric identifiers but can be longer. +// Therefore non-numeric identifiers must go first. + +createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER] +}|${src[t.NUMERICIDENTIFIER]})`) + +createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER] +}|${src[t.NUMERICIDENTIFIERLOOSE]})`) + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] +}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) + +createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] +}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`) + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] +}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +createToken('FULLPLAIN', `v?${src[t.MAINVERSION] +}${src[t.PRERELEASE]}?${ + src[t.BUILD]}?`) + +createToken('FULL', `^${src[t.FULLPLAIN]}$`) + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] +}${src[t.PRERELEASELOOSE]}?${ + src[t.BUILD]}?`) + +createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) + +createToken('GTLT', '((?:<|>)?=?)') + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) +createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) + +createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:${src[t.PRERELEASE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:${src[t.PRERELEASELOOSE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) +createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +createToken('COERCEPLAIN', `${'(^|[^\\d])' + + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`) +createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`) +createToken('COERCEFULL', src[t.COERCEPLAIN] + + `(?:${src[t.PRERELEASE]})?` + + `(?:${src[t.BUILD]})?` + + `(?:$|[^\\d])`) +createToken('COERCERTL', src[t.COERCE], true) +createToken('COERCERTLFULL', src[t.COERCEFULL], true) + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +createToken('LONETILDE', '(?:~>?)') + +createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) +exports.tildeTrimReplace = '$1~' + +createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) +createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +createToken('LONECARET', '(?:\\^)') + +createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) +exports.caretTrimReplace = '$1^' + +createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) +createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) +createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] +}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) +exports.comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAIN]})` + + `\\s*$`) + +createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAINLOOSE]})` + + `\\s*$`) + +// Star ranges basically just allow anything at all. +createToken('STAR', '(<|>)?=?\\s*\\*') +// >=0.0.0 is like a star +createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') +createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/package.json new file mode 100644 index 0000000..a84de91 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/package.json @@ -0,0 +1,78 @@ +{ + "name": "semver", + "version": "7.7.4", + "description": "The semantic version parser used by npm.", + "main": "index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "devDependencies": { + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.29.0", + "benchmark": "^2.1.4", + "tap": "^16.0.0" + }, + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/node-semver.git" + }, + "bin": { + "semver": "bin/semver.js" + }, + "files": [ + "bin/", + "lib/", + "classes/", + "functions/", + "internal/", + "ranges/", + "index.js", + "preload.js", + "range.bnf" + ], + "tap": { + "timeout": 30, + "coverage-map": "map.js", + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": ">=10" + }, + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "engines": ">=10", + "distPaths": [ + "classes/", + "functions/", + "internal/", + "ranges/", + "index.js", + "preload.js", + "range.bnf" + ], + "allowPaths": [ + "/classes/", + "/functions/", + "/internal/", + "/ranges/", + "/index.js", + "/preload.js", + "/range.bnf", + "/benchmarks" + ], + "publish": "true" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/preload.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/preload.js new file mode 100644 index 0000000..e6c47b9 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/preload.js @@ -0,0 +1,4 @@ +'use strict' + +// XXX remove in v8 or beyond +module.exports = require('./index.js') diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/range.bnf b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/range.bnf new file mode 100644 index 0000000..d4c6ae0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | [1-9] ( [0-9] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/gtr.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/gtr.js new file mode 100644 index 0000000..0e7601f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/gtr.js @@ -0,0 +1,6 @@ +'use strict' + +// Determine if version is greater than all the versions possible in the range. +const outside = require('./outside') +const gtr = (version, range, options) => outside(version, range, '>', options) +module.exports = gtr diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/intersects.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/intersects.js new file mode 100644 index 0000000..917be7e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/intersects.js @@ -0,0 +1,9 @@ +'use strict' + +const Range = require('../classes/range') +const intersects = (r1, r2, options) => { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2, options) +} +module.exports = intersects diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/ltr.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/ltr.js new file mode 100644 index 0000000..aa5e568 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/ltr.js @@ -0,0 +1,6 @@ +'use strict' + +const outside = require('./outside') +// Determine if version is less than all the versions possible in the range +const ltr = (version, range, options) => outside(version, range, '<', options) +module.exports = ltr diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/max-satisfying.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/max-satisfying.js new file mode 100644 index 0000000..01fe5ae --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/max-satisfying.js @@ -0,0 +1,27 @@ +'use strict' + +const SemVer = require('../classes/semver') +const Range = require('../classes/range') + +const maxSatisfying = (versions, range, options) => { + let max = null + let maxSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} +module.exports = maxSatisfying diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/min-satisfying.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/min-satisfying.js new file mode 100644 index 0000000..af89c8e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/min-satisfying.js @@ -0,0 +1,26 @@ +'use strict' + +const SemVer = require('../classes/semver') +const Range = require('../classes/range') +const minSatisfying = (versions, range, options) => { + let min = null + let minSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} +module.exports = minSatisfying diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/min-version.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/min-version.js new file mode 100644 index 0000000..09a65aa --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/min-version.js @@ -0,0 +1,63 @@ +'use strict' + +const SemVer = require('../classes/semver') +const Range = require('../classes/range') +const gt = require('../functions/gt') + +const minVersion = (range, loose) => { + range = new Range(range, loose) + + let minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let setMin = null + comparators.forEach((comparator) => { + // Clone to avoid manipulating the comparator's semver object. + const compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!setMin || gt(compver, setMin)) { + setMin = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`) + } + }) + if (setMin && (!minver || gt(minver, setMin))) { + minver = setMin + } + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} +module.exports = minVersion diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/outside.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/outside.js new file mode 100644 index 0000000..ca74421 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/outside.js @@ -0,0 +1,82 @@ +'use strict' + +const SemVer = require('../classes/semver') +const Comparator = require('../classes/comparator') +const { ANY } = Comparator +const Range = require('../classes/range') +const satisfies = require('../functions/satisfies') +const gt = require('../functions/gt') +const lt = require('../functions/lt') +const lte = require('../functions/lte') +const gte = require('../functions/gte') + +const outside = (version, range, hilo, options) => { + version = new SemVer(version, options) + range = new Range(range, options) + + let gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisfies the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let high = null + let low = null + + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +module.exports = outside diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/simplify.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/simplify.js new file mode 100644 index 0000000..262732e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/simplify.js @@ -0,0 +1,49 @@ +'use strict' + +// given a set of versions and a range, create a "simplified" range +// that includes the same versions that the original range does +// If the original range is shorter than the simplified one, return that. +const satisfies = require('../functions/satisfies.js') +const compare = require('../functions/compare.js') +module.exports = (versions, range, options) => { + const set = [] + let first = null + let prev = null + const v = versions.sort((a, b) => compare(a, b, options)) + for (const version of v) { + const included = satisfies(version, range, options) + if (included) { + prev = version + if (!first) { + first = version + } + } else { + if (prev) { + set.push([first, prev]) + } + prev = null + first = null + } + } + if (first) { + set.push([first, null]) + } + + const ranges = [] + for (const [min, max] of set) { + if (min === max) { + ranges.push(min) + } else if (!max && min === v[0]) { + ranges.push('*') + } else if (!max) { + ranges.push(`>=${min}`) + } else if (min === v[0]) { + ranges.push(`<=${max}`) + } else { + ranges.push(`${min} - ${max}`) + } + } + const simplified = ranges.join(' || ') + const original = typeof range.raw === 'string' ? range.raw : String(range) + return simplified.length < original.length ? simplified : range +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/subset.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/subset.js new file mode 100644 index 0000000..99f4321 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/subset.js @@ -0,0 +1,249 @@ +'use strict' + +const Range = require('../classes/range.js') +const Comparator = require('../classes/comparator.js') +const { ANY } = Comparator +const satisfies = require('../functions/satisfies.js') +const compare = require('../functions/compare.js') + +// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: +// - Every simple range `r1, r2, ...` is a null set, OR +// - Every simple range `r1, r2, ...` which is not a null set is a subset of +// some `R1, R2, ...` +// +// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: +// - If c is only the ANY comparator +// - If C is only the ANY comparator, return true +// - Else if in prerelease mode, return false +// - else replace c with `[>=0.0.0]` +// - If C is only the ANY comparator +// - if in prerelease mode, return true +// - else replace C with `[>=0.0.0]` +// - Let EQ be the set of = comparators in c +// - If EQ is more than one, return true (null set) +// - Let GT be the highest > or >= comparator in c +// - Let LT be the lowest < or <= comparator in c +// - If GT and LT, and GT.semver > LT.semver, return true (null set) +// - If any C is a = range, and GT or LT are set, return false +// - If EQ +// - If GT, and EQ does not satisfy GT, return true (null set) +// - If LT, and EQ does not satisfy LT, return true (null set) +// - If EQ satisfies every C, return true +// - Else return false +// - If GT +// - If GT.semver is lower than any > or >= comp in C, return false +// - If GT is >=, and GT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the GT.semver tuple, return false +// - If LT +// - If LT.semver is greater than any < or <= comp in C, return false +// - If LT is <=, and LT.semver does not satisfy every C, return false +// - If LT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the LT.semver tuple, return false +// - Else return true + +const subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true + } + + sub = new Range(sub, options) + dom = new Range(dom, options) + let sawNonNull = false + + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options) + sawNonNull = sawNonNull || isSub !== null + if (isSub) { + continue OUTER + } + } + // the null set is a subset of everything, but null simple ranges in + // a complex range should be ignored. so if we saw a non-null range, + // then we know this isn't a subset, but if EVERY simple range was null, + // then it is a subset. + if (sawNonNull) { + return false + } + } + return true +} + +const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] +const minimumVersion = [new Comparator('>=0.0.0')] + +const simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true + } + + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease + } else { + sub = minimumVersion + } + } + + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true + } else { + dom = minimumVersion + } + } + + const eqSet = new Set() + let gt, lt + for (const c of sub) { + if (c.operator === '>' || c.operator === '>=') { + gt = higherGT(gt, c, options) + } else if (c.operator === '<' || c.operator === '<=') { + lt = lowerLT(lt, c, options) + } else { + eqSet.add(c.semver) + } + } + + if (eqSet.size > 1) { + return null + } + + let gtltComp + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options) + if (gtltComp > 0) { + return null + } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { + return null + } + } + + // will iterate one or zero times + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) { + return null + } + + if (lt && !satisfies(eq, String(lt), options)) { + return null + } + + for (const c of dom) { + if (!satisfies(eq, String(c), options)) { + return false + } + } + + return true + } + + let higher, lower + let hasDomLT, hasDomGT + // if the subset has a prerelease, we need a comparator in the superset + // with the same tuple and a prerelease, or it's not a subset + let needDomLTPre = lt && + !options.includePrerelease && + lt.semver.prerelease.length ? lt.semver : false + let needDomGTPre = gt && + !options.includePrerelease && + gt.semver.prerelease.length ? gt.semver : false + // exception: <1.2.3-0 is the same as <1.2.3 + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && + lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false + } + + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' + hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' + if (gt) { + if (needDomGTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomGTPre.major && + c.semver.minor === needDomGTPre.minor && + c.semver.patch === needDomGTPre.patch) { + needDomGTPre = false + } + } + if (c.operator === '>' || c.operator === '>=') { + higher = higherGT(gt, c, options) + if (higher === c && higher !== gt) { + return false + } + } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { + return false + } + } + if (lt) { + if (needDomLTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomLTPre.major && + c.semver.minor === needDomLTPre.minor && + c.semver.patch === needDomLTPre.patch) { + needDomLTPre = false + } + } + if (c.operator === '<' || c.operator === '<=') { + lower = lowerLT(lt, c, options) + if (lower === c && lower !== lt) { + return false + } + } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { + return false + } + } + if (!c.operator && (lt || gt) && gtltComp !== 0) { + return false + } + } + + // if there was a < or >, and nothing in the dom, then must be false + // UNLESS it was limited by another range in the other direction. + // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 + if (gt && hasDomLT && !lt && gtltComp !== 0) { + return false + } + + if (lt && hasDomGT && !gt && gtltComp !== 0) { + return false + } + + // we needed a prerelease range in a specific tuple, but didn't get one + // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, + // because it includes prereleases in the 1.2.3 tuple + if (needDomGTPre || needDomLTPre) { + return false + } + + return true +} + +// >=1.2.3 is lower than >1.2.3 +const higherGT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp > 0 ? a + : comp < 0 ? b + : b.operator === '>' && a.operator === '>=' ? b + : a +} + +// <=1.2.3 is higher than <1.2.3 +const lowerLT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp < 0 ? a + : comp > 0 ? b + : b.operator === '<' && a.operator === '<=' ? b + : a +} + +module.exports = subset diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/to-comparators.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/to-comparators.js new file mode 100644 index 0000000..5be2519 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/to-comparators.js @@ -0,0 +1,10 @@ +'use strict' + +const Range = require('../classes/range') + +// Mostly just for testing and legacy API reasons +const toComparators = (range, options) => + new Range(range, options).set + .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) + +module.exports = toComparators diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/valid.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/valid.js new file mode 100644 index 0000000..cc6b0e9 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/semver/ranges/valid.js @@ -0,0 +1,13 @@ +'use strict' + +const Range = require('../classes/range') +const validRange = (range, options) => { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} +module.exports = validRange diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/send/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/send/LICENSE new file mode 100644 index 0000000..b6ea1c1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/send/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2012 TJ Holowaychuk +Copyright (c) 2014-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/send/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/send/README.md new file mode 100644 index 0000000..350fccd --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/send/README.md @@ -0,0 +1,317 @@ +# send + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![CI][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Send is a library for streaming files from the file system as a http response +supporting partial responses (Ranges), conditional-GET negotiation (If-Match, +If-Unmodified-Since, If-None-Match, If-Modified-Since), high test coverage, +and granular events which may be leveraged to take appropriate actions in your +application or framework. + +Looking to serve up entire folders mapped to URLs? Try [serve-static](https://www.npmjs.org/package/serve-static). + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```bash +$ npm install send +``` + +## API + +```js +var send = require('send') +``` + +### send(req, path, [options]) + +Create a new `SendStream` for the given path to send to a `res`. The `req` is +the Node.js HTTP request and the `path` is a urlencoded path to send (urlencoded, +not the actual file-system path). + +#### Options + +##### acceptRanges + +Enable or disable accepting ranged requests, defaults to true. +Disabling this will not send `Accept-Ranges` and ignore the contents +of the `Range` request header. + +##### cacheControl + +Enable or disable setting `Cache-Control` response header, defaults to +true. Disabling this will ignore the `immutable` and `maxAge` options. + +##### dotfiles + +Set how "dotfiles" are treated when encountered. A dotfile is a file +or directory that begins with a dot ("."). Note this check is done on +the path itself without checking if the path actually exists on the +disk. If `root` is specified, only the dotfiles above the root are +checked (i.e. the root itself can be within a dotfile when set +to "deny"). + + - `'allow'` No special treatment for dotfiles. + - `'deny'` Send a 403 for any request for a dotfile. + - `'ignore'` Pretend like the dotfile does not exist and 404. + +The default value is _similar_ to `'ignore'`, with the exception that +this default will not ignore the files within a directory that begins +with a dot, for backward-compatibility. + +##### end + +Byte offset at which the stream ends, defaults to the length of the file +minus 1. The end is inclusive in the stream, meaning `end: 3` will include +the 4th byte in the stream. + +##### etag + +Enable or disable etag generation, defaults to true. + +##### extensions + +If a given file doesn't exist, try appending one of the given extensions, +in the given order. By default, this is disabled (set to `false`). An +example value that will serve extension-less HTML files: `['html', 'htm']`. +This is skipped if the requested file already has an extension. + +##### immutable + +Enable or disable the `immutable` directive in the `Cache-Control` response +header, defaults to `false`. If set to `true`, the `maxAge` option should +also be specified to enable caching. The `immutable` directive will prevent +supported clients from making conditional requests during the life of the +`maxAge` option to check if the file has changed. + +##### index + +By default send supports "index.html" files, to disable this +set `false` or to supply a new index pass a string or an array +in preferred order. + +##### lastModified + +Enable or disable `Last-Modified` header, defaults to true. Uses the file +system's last modified value. + +##### maxAge + +Provide a max-age in milliseconds for http caching, defaults to 0. +This can also be a string accepted by the +[ms](https://www.npmjs.org/package/ms#readme) module. + +##### root + +Serve files relative to `path`. + +##### start + +Byte offset at which the stream starts, defaults to 0. The start is inclusive, +meaning `start: 2` will include the 3rd byte in the stream. + +#### Events + +The `SendStream` is an event emitter and will emit the following events: + + - `error` an error occurred `(err)` + - `directory` a directory was requested `(res, path)` + - `file` a file was requested `(path, stat)` + - `headers` the headers are about to be set on a file `(res, path, stat)` + - `stream` file streaming has started `(stream)` + - `end` streaming has completed + +#### .pipe + +The `pipe` method is used to pipe the response into the Node.js HTTP response +object, typically `send(req, path, options).pipe(res)`. + +## Error-handling + +By default when no `error` listeners are present an automatic response will be +made, otherwise you have full control over the response, aka you may show a 5xx +page etc. + +## Caching + +It does _not_ perform internal caching, you should use a reverse proxy cache +such as Varnish for this, or those fancy things called CDNs. If your +application is small enough that it would benefit from single-node memory +caching, it's small enough that it does not need caching at all ;). + +## Debugging + +To enable `debug()` instrumentation output export __DEBUG__: + +``` +$ DEBUG=send node app +``` + +## Running tests + +``` +$ npm install +$ npm test +``` + +## Examples + +### Serve a specific file + +This simple example will send a specific file to all requests. + +```js +var http = require('http') +var send = require('send') + +var server = http.createServer(function onRequest (req, res) { + send(req, '/path/to/index.html') + .pipe(res) +}) + +server.listen(3000) +``` + +### Serve all files from a directory + +This simple example will just serve up all the files in a +given directory as the top-level. For example, a request +`GET /foo.txt` will send back `/www/public/foo.txt`. + +```js +var http = require('http') +var parseUrl = require('parseurl') +var send = require('send') + +var server = http.createServer(function onRequest (req, res) { + send(req, parseUrl(req).pathname, { root: '/www/public' }) + .pipe(res) +}) + +server.listen(3000) +``` + +### Custom file types + +```js +var extname = require('path').extname +var http = require('http') +var parseUrl = require('parseurl') +var send = require('send') + +var server = http.createServer(function onRequest (req, res) { + send(req, parseUrl(req).pathname, { root: '/www/public' }) + .on('headers', function (res, path) { + switch (extname(path)) { + case '.x-mt': + case '.x-mtt': + // custom type for these extensions + res.setHeader('Content-Type', 'application/x-my-type') + break + } + }) + .pipe(res) +}) + +server.listen(3000) +``` + +### Custom directory index view + +This is an example of serving up a structure of directories with a +custom function to render a listing of a directory. + +```js +var http = require('http') +var fs = require('fs') +var parseUrl = require('parseurl') +var send = require('send') + +// Transfer arbitrary files from within /www/example.com/public/* +// with a custom handler for directory listing +var server = http.createServer(function onRequest (req, res) { + send(req, parseUrl(req).pathname, { index: false, root: '/www/public' }) + .once('directory', directory) + .pipe(res) +}) + +server.listen(3000) + +// Custom directory handler +function directory (res, path) { + var stream = this + + // redirect to trailing slash for consistent url + if (!stream.hasTrailingSlash()) { + return stream.redirect(path) + } + + // get directory list + fs.readdir(path, function onReaddir (err, list) { + if (err) return stream.error(err) + + // render an index for the directory + res.setHeader('Content-Type', 'text/plain; charset=UTF-8') + res.end(list.join('\n') + '\n') + }) +} +``` + +### Serving from a root directory with custom error-handling + +```js +var http = require('http') +var parseUrl = require('parseurl') +var send = require('send') + +var server = http.createServer(function onRequest (req, res) { + // your custom error-handling logic: + function error (err) { + res.statusCode = err.status || 500 + res.end(err.message) + } + + // your custom headers + function headers (res, path, stat) { + // serve all files for download + res.setHeader('Content-Disposition', 'attachment') + } + + // your custom directory handling logic: + function redirect () { + res.statusCode = 301 + res.setHeader('Location', req.url + '/') + res.end('Redirecting to ' + req.url + '/') + } + + // transfer arbitrary files from within + // /www/example.com/public/* + send(req, parseUrl(req).pathname, { root: '/www/public' }) + .on('error', error) + .on('directory', redirect) + .on('headers', headers) + .pipe(res) +}) + +server.listen(3000) +``` + +## License + +[MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/send/master +[coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master +[github-actions-ci-image]: https://badgen.net/github/checks/pillarjs/send/master?label=linux +[github-actions-ci-url]: https://github.com/pillarjs/send/actions/workflows/ci.yml +[node-image]: https://badgen.net/npm/node/send +[node-url]: https://nodejs.org/en/download/ +[npm-downloads-image]: https://badgen.net/npm/dm/send +[npm-url]: https://npmjs.org/package/send +[npm-version-image]: https://badgen.net/npm/v/send diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/send/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/send/index.js new file mode 100644 index 0000000..1655053 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/send/index.js @@ -0,0 +1,997 @@ +/*! + * send + * Copyright(c) 2012 TJ Holowaychuk + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var createError = require('http-errors') +var debug = require('debug')('send') +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var etag = require('etag') +var fresh = require('fresh') +var fs = require('fs') +var mime = require('mime-types') +var ms = require('ms') +var onFinished = require('on-finished') +var parseRange = require('range-parser') +var path = require('path') +var statuses = require('statuses') +var Stream = require('stream') +var util = require('util') + +/** + * Path function references. + * @private + */ + +var extname = path.extname +var join = path.join +var normalize = path.normalize +var resolve = path.resolve +var sep = path.sep + +/** + * Regular expression for identifying a bytes Range header. + * @private + */ + +var BYTES_RANGE_REGEXP = /^ *bytes=/ + +/** + * Maximum value allowed for the max age. + * @private + */ + +var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000 // 1 year + +/** + * Regular expression to match a path with a directory up component. + * @private + */ + +var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/ + +/** + * Module exports. + * @public + */ + +module.exports = send + +/** + * Return a `SendStream` for `req` and `path`. + * + * @param {object} req + * @param {string} path + * @param {object} [options] + * @return {SendStream} + * @public + */ + +function send (req, path, options) { + return new SendStream(req, path, options) +} + +/** + * Initialize a `SendStream` with the given `path`. + * + * @param {Request} req + * @param {String} path + * @param {object} [options] + * @private + */ + +function SendStream (req, path, options) { + Stream.call(this) + + var opts = options || {} + + this.options = opts + this.path = path + this.req = req + + this._acceptRanges = opts.acceptRanges !== undefined + ? Boolean(opts.acceptRanges) + : true + + this._cacheControl = opts.cacheControl !== undefined + ? Boolean(opts.cacheControl) + : true + + this._etag = opts.etag !== undefined + ? Boolean(opts.etag) + : true + + this._dotfiles = opts.dotfiles !== undefined + ? opts.dotfiles + : 'ignore' + + if (this._dotfiles !== 'ignore' && this._dotfiles !== 'allow' && this._dotfiles !== 'deny') { + throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"') + } + + this._extensions = opts.extensions !== undefined + ? normalizeList(opts.extensions, 'extensions option') + : [] + + this._immutable = opts.immutable !== undefined + ? Boolean(opts.immutable) + : false + + this._index = opts.index !== undefined + ? normalizeList(opts.index, 'index option') + : ['index.html'] + + this._lastModified = opts.lastModified !== undefined + ? Boolean(opts.lastModified) + : true + + this._maxage = opts.maxAge || opts.maxage + this._maxage = typeof this._maxage === 'string' + ? ms(this._maxage) + : Number(this._maxage) + this._maxage = !isNaN(this._maxage) + ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) + : 0 + + this._root = opts.root + ? resolve(opts.root) + : null +} + +/** + * Inherits from `Stream`. + */ + +util.inherits(SendStream, Stream) + +/** + * Emit error with `status`. + * + * @param {number} status + * @param {Error} [err] + * @private + */ + +SendStream.prototype.error = function error (status, err) { + // emit if listeners instead of responding + if (hasListeners(this, 'error')) { + return this.emit('error', createHttpError(status, err)) + } + + var res = this.res + var msg = statuses.message[status] || String(status) + var doc = createHtmlDocument('Error', escapeHtml(msg)) + + // clear existing headers + clearHeaders(res) + + // add error headers + if (err && err.headers) { + setHeaders(res, err.headers) + } + + // send basic response + res.statusCode = status + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', Buffer.byteLength(doc)) + res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('X-Content-Type-Options', 'nosniff') + res.end(doc) +} + +/** + * Check if the pathname ends with "/". + * + * @return {boolean} + * @private + */ + +SendStream.prototype.hasTrailingSlash = function hasTrailingSlash () { + return this.path[this.path.length - 1] === '/' +} + +/** + * Check if this is a conditional GET request. + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isConditionalGET = function isConditionalGET () { + return this.req.headers['if-match'] || + this.req.headers['if-unmodified-since'] || + this.req.headers['if-none-match'] || + this.req.headers['if-modified-since'] +} + +/** + * Check if the request preconditions failed. + * + * @return {boolean} + * @private + */ + +SendStream.prototype.isPreconditionFailure = function isPreconditionFailure () { + var req = this.req + var res = this.res + + // if-match + var match = req.headers['if-match'] + if (match) { + var etag = res.getHeader('ETag') + return !etag || (match !== '*' && parseTokenList(match).every(function (match) { + return match !== etag && match !== 'W/' + etag && 'W/' + match !== etag + })) + } + + // if-unmodified-since + var unmodifiedSince = parseHttpDate(req.headers['if-unmodified-since']) + if (!isNaN(unmodifiedSince)) { + var lastModified = parseHttpDate(res.getHeader('Last-Modified')) + return isNaN(lastModified) || lastModified > unmodifiedSince + } + + return false +} + +/** + * Strip various content header fields for a change in entity. + * + * @private + */ + +SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields () { + var res = this.res + + res.removeHeader('Content-Encoding') + res.removeHeader('Content-Language') + res.removeHeader('Content-Length') + res.removeHeader('Content-Range') + res.removeHeader('Content-Type') +} + +/** + * Respond with 304 not modified. + * + * @api private + */ + +SendStream.prototype.notModified = function notModified () { + var res = this.res + debug('not modified') + this.removeContentHeaderFields() + res.statusCode = 304 + res.end() +} + +/** + * Raise error that headers already sent. + * + * @api private + */ + +SendStream.prototype.headersAlreadySent = function headersAlreadySent () { + var err = new Error('Can\'t set headers after they are sent.') + debug('headers already sent') + this.error(500, err) +} + +/** + * Check if the request is cacheable, aka + * responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}). + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isCachable = function isCachable () { + var statusCode = this.res.statusCode + return (statusCode >= 200 && statusCode < 300) || + statusCode === 304 +} + +/** + * Handle stat() error. + * + * @param {Error} error + * @private + */ + +SendStream.prototype.onStatError = function onStatError (error) { + switch (error.code) { + case 'ENAMETOOLONG': + case 'ENOENT': + case 'ENOTDIR': + this.error(404, error) + break + default: + this.error(500, error) + break + } +} + +/** + * Check if the cache is fresh. + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isFresh = function isFresh () { + return fresh(this.req.headers, { + etag: this.res.getHeader('ETag'), + 'last-modified': this.res.getHeader('Last-Modified') + }) +} + +/** + * Check if the range is fresh. + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isRangeFresh = function isRangeFresh () { + var ifRange = this.req.headers['if-range'] + + if (!ifRange) { + return true + } + + // if-range as etag + if (ifRange.indexOf('"') !== -1) { + var etag = this.res.getHeader('ETag') + return Boolean(etag && ifRange.indexOf(etag) !== -1) + } + + // if-range as modified date + var lastModified = this.res.getHeader('Last-Modified') + return parseHttpDate(lastModified) <= parseHttpDate(ifRange) +} + +/** + * Redirect to path. + * + * @param {string} path + * @private + */ + +SendStream.prototype.redirect = function redirect (path) { + var res = this.res + + if (hasListeners(this, 'directory')) { + this.emit('directory', res, path) + return + } + + if (this.hasTrailingSlash()) { + this.error(403) + return + } + + var loc = encodeUrl(collapseLeadingSlashes(this.path + '/')) + var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + escapeHtml(loc)) + + // redirect + res.statusCode = 301 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', Buffer.byteLength(doc)) + res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('X-Content-Type-Options', 'nosniff') + res.setHeader('Location', loc) + res.end(doc) +} + +/** + * Pipe to `res. + * + * @param {Stream} res + * @return {Stream} res + * @api public + */ + +SendStream.prototype.pipe = function pipe (res) { + // root path + var root = this._root + + // references + this.res = res + + // decode the path + var path = decode(this.path) + if (path === -1) { + this.error(400) + return res + } + + // null byte(s) + if (~path.indexOf('\0')) { + this.error(400) + return res + } + + var parts + if (root !== null) { + // normalize + if (path) { + path = normalize('.' + sep + path) + } + + // malicious path + if (UP_PATH_REGEXP.test(path)) { + debug('malicious path "%s"', path) + this.error(403) + return res + } + + // explode path parts + parts = path.split(sep) + + // join / normalize from optional root dir + path = normalize(join(root, path)) + } else { + // ".." is malicious without "root" + if (UP_PATH_REGEXP.test(path)) { + debug('malicious path "%s"', path) + this.error(403) + return res + } + + // explode path parts + parts = normalize(path).split(sep) + + // resolve the path + path = resolve(path) + } + + // dotfile handling + if (containsDotFile(parts)) { + debug('%s dotfile "%s"', this._dotfiles, path) + switch (this._dotfiles) { + case 'allow': + break + case 'deny': + this.error(403) + return res + case 'ignore': + default: + this.error(404) + return res + } + } + + // index file support + if (this._index.length && this.hasTrailingSlash()) { + this.sendIndex(path) + return res + } + + this.sendFile(path) + return res +} + +/** + * Transfer `path`. + * + * @param {String} path + * @api public + */ + +SendStream.prototype.send = function send (path, stat) { + var len = stat.size + var options = this.options + var opts = {} + var res = this.res + var req = this.req + var ranges = req.headers.range + var offset = options.start || 0 + + if (res.headersSent) { + // impossible to send now + this.headersAlreadySent() + return + } + + debug('pipe "%s"', path) + + // set header fields + this.setHeader(path, stat) + + // set content-type + this.type(path) + + // conditional GET support + if (this.isConditionalGET()) { + if (this.isPreconditionFailure()) { + this.error(412) + return + } + + if (this.isCachable() && this.isFresh()) { + this.notModified() + return + } + } + + // adjust len to start/end options + len = Math.max(0, len - offset) + if (options.end !== undefined) { + var bytes = options.end - offset + 1 + if (len > bytes) len = bytes + } + + // Range support + if (this._acceptRanges && BYTES_RANGE_REGEXP.test(ranges)) { + // parse + ranges = parseRange(len, ranges, { + combine: true + }) + + // If-Range support + if (!this.isRangeFresh()) { + debug('range stale') + ranges = -2 + } + + // unsatisfiable + if (ranges === -1) { + debug('range unsatisfiable') + + // Content-Range + res.setHeader('Content-Range', contentRange('bytes', len)) + + // 416 Requested Range Not Satisfiable + return this.error(416, { + headers: { 'Content-Range': res.getHeader('Content-Range') } + }) + } + + // valid (syntactically invalid/multiple ranges are treated as a regular response) + if (ranges !== -2 && ranges.length === 1) { + debug('range %j', ranges) + + // Content-Range + res.statusCode = 206 + res.setHeader('Content-Range', contentRange('bytes', len, ranges[0])) + + // adjust for requested range + offset += ranges[0].start + len = ranges[0].end - ranges[0].start + 1 + } + } + + // clone options + for (var prop in options) { + opts[prop] = options[prop] + } + + // set read options + opts.start = offset + opts.end = Math.max(offset, offset + len - 1) + + // content-length + res.setHeader('Content-Length', len) + + // HEAD support + if (req.method === 'HEAD') { + res.end() + return + } + + this.stream(path, opts) +} + +/** + * Transfer file for `path`. + * + * @param {String} path + * @api private + */ +SendStream.prototype.sendFile = function sendFile (path) { + var i = 0 + var self = this + + debug('stat "%s"', path) + fs.stat(path, function onstat (err, stat) { + var pathEndsWithSep = path[path.length - 1] === sep + if (err && err.code === 'ENOENT' && !extname(path) && !pathEndsWithSep) { + // not found, check extensions + return next(err) + } + if (err) return self.onStatError(err) + if (stat.isDirectory()) return self.redirect(path) + if (pathEndsWithSep) return self.error(404) + self.emit('file', path, stat) + self.send(path, stat) + }) + + function next (err) { + if (self._extensions.length <= i) { + return err + ? self.onStatError(err) + : self.error(404) + } + + var p = path + '.' + self._extensions[i++] + + debug('stat "%s"', p) + fs.stat(p, function (err, stat) { + if (err) return next(err) + if (stat.isDirectory()) return next() + self.emit('file', p, stat) + self.send(p, stat) + }) + } +} + +/** + * Transfer index for `path`. + * + * @param {String} path + * @api private + */ +SendStream.prototype.sendIndex = function sendIndex (path) { + var i = -1 + var self = this + + function next (err) { + if (++i >= self._index.length) { + if (err) return self.onStatError(err) + return self.error(404) + } + + var p = join(path, self._index[i]) + + debug('stat "%s"', p) + fs.stat(p, function (err, stat) { + if (err) return next(err) + if (stat.isDirectory()) return next() + self.emit('file', p, stat) + self.send(p, stat) + }) + } + + next() +} + +/** + * Stream `path` to the response. + * + * @param {String} path + * @param {Object} options + * @api private + */ + +SendStream.prototype.stream = function stream (path, options) { + var self = this + var res = this.res + + // pipe + var stream = fs.createReadStream(path, options) + this.emit('stream', stream) + stream.pipe(res) + + // cleanup + function cleanup () { + stream.destroy() + } + + // response finished, cleanup + onFinished(res, cleanup) + + // error handling + stream.on('error', function onerror (err) { + // clean up stream early + cleanup() + + // error + self.onStatError(err) + }) + + // end + stream.on('end', function onend () { + self.emit('end') + }) +} + +/** + * Set content-type based on `path` + * if it hasn't been explicitly set. + * + * @param {String} path + * @api private + */ + +SendStream.prototype.type = function type (path) { + var res = this.res + + if (res.getHeader('Content-Type')) return + + var ext = extname(path) + var type = mime.contentType(ext) || 'application/octet-stream' + + debug('content-type %s', type) + res.setHeader('Content-Type', type) +} + +/** + * Set response header fields, most + * fields may be pre-defined. + * + * @param {String} path + * @param {Object} stat + * @api private + */ + +SendStream.prototype.setHeader = function setHeader (path, stat) { + var res = this.res + + this.emit('headers', res, path, stat) + + if (this._acceptRanges && !res.getHeader('Accept-Ranges')) { + debug('accept ranges') + res.setHeader('Accept-Ranges', 'bytes') + } + + if (this._cacheControl && !res.getHeader('Cache-Control')) { + var cacheControl = 'public, max-age=' + Math.floor(this._maxage / 1000) + + if (this._immutable) { + cacheControl += ', immutable' + } + + debug('cache-control %s', cacheControl) + res.setHeader('Cache-Control', cacheControl) + } + + if (this._lastModified && !res.getHeader('Last-Modified')) { + var modified = stat.mtime.toUTCString() + debug('modified %s', modified) + res.setHeader('Last-Modified', modified) + } + + if (this._etag && !res.getHeader('ETag')) { + var val = etag(stat) + debug('etag %s', val) + res.setHeader('ETag', val) + } +} + +/** + * Clear all headers from a response. + * + * @param {object} res + * @private + */ + +function clearHeaders (res) { + for (const header of res.getHeaderNames()) { + res.removeHeader(header) + } +} + +/** + * Collapse all leading slashes into a single slash + * + * @param {string} str + * @private + */ +function collapseLeadingSlashes (str) { + for (var i = 0; i < str.length; i++) { + if (str[i] !== '/') { + break + } + } + + return i > 1 + ? '/' + str.substr(i) + : str +} + +/** + * Determine if path parts contain a dotfile. + * + * @api private + */ + +function containsDotFile (parts) { + for (var i = 0; i < parts.length; i++) { + var part = parts[i] + if (part.length > 1 && part[0] === '.') { + return true + } + } + + return false +} + +/** + * Create a Content-Range header. + * + * @param {string} type + * @param {number} size + * @param {array} [range] + */ + +function contentRange (type, size, range) { + return type + ' ' + (range ? range.start + '-' + range.end : '*') + '/' + size +} + +/** + * Create a minimal HTML document. + * + * @param {string} title + * @param {string} body + * @private + */ + +function createHtmlDocument (title, body) { + return '\n' + + '\n' + + '\n' + + '\n' + + '' + title + '\n' + + '\n' + + '\n' + + '
' + body + '
\n' + + '\n' + + '\n' +} + +/** + * Create a HttpError object from simple arguments. + * + * @param {number} status + * @param {Error|object} err + * @private + */ + +function createHttpError (status, err) { + if (!err) { + return createError(status) + } + + return err instanceof Error + ? createError(status, err, { expose: false }) + : createError(status, err) +} + +/** + * decodeURIComponent. + * + * Allows V8 to only deoptimize this fn instead of all + * of send(). + * + * @param {String} path + * @api private + */ + +function decode (path) { + try { + return decodeURIComponent(path) + } catch (err) { + return -1 + } +} + +/** + * Determine if emitter has listeners of a given type. + * + * The way to do this check is done three different ways in Node.js >= 0.10 + * so this consolidates them into a minimal set using instance methods. + * + * @param {EventEmitter} emitter + * @param {string} type + * @returns {boolean} + * @private + */ + +function hasListeners (emitter, type) { + var count = typeof emitter.listenerCount !== 'function' + ? emitter.listeners(type).length + : emitter.listenerCount(type) + + return count > 0 +} + +/** + * Normalize the index option into an array. + * + * @param {boolean|string|array} val + * @param {string} name + * @private + */ + +function normalizeList (val, name) { + var list = [].concat(val || []) + + for (var i = 0; i < list.length; i++) { + if (typeof list[i] !== 'string') { + throw new TypeError(name + ' must be array of strings or false') + } + } + + return list +} + +/** + * Parse an HTTP Date into a number. + * + * @param {string} date + * @private + */ + +function parseHttpDate (date) { + var timestamp = date && Date.parse(date) + + return typeof timestamp === 'number' + ? timestamp + : NaN +} + +/** + * Parse a HTTP token list. + * + * @param {string} str + * @private + */ + +function parseTokenList (str) { + var end = 0 + var list = [] + var start = 0 + + // gather tokens + for (var i = 0, len = str.length; i < len; i++) { + switch (str.charCodeAt(i)) { + case 0x20: /* */ + if (start === end) { + start = end = i + 1 + } + break + case 0x2c: /* , */ + if (start !== end) { + list.push(str.substring(start, end)) + } + start = end = i + 1 + break + default: + end = i + 1 + break + } + } + + // final token + if (start !== end) { + list.push(str.substring(start, end)) + } + + return list +} + +/** + * Set an object of headers on a response. + * + * @param {object} res + * @param {object} headers + * @private + */ + +function setHeaders (res, headers) { + var keys = Object.keys(headers) + + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + res.setHeader(key, headers[key]) + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/send/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/send/package.json new file mode 100644 index 0000000..e9d3cc2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/send/package.json @@ -0,0 +1,63 @@ +{ + "name": "send", + "description": "Better streaming static file server with Range and conditional-GET support", + "version": "1.2.1", + "author": "TJ Holowaychuk ", + "contributors": [ + "Douglas Christopher Wilson ", + "James Wyatt Cready ", + "Jesús Leganés Combarro " + ], + "license": "MIT", + "repository": "pillarjs/send", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "keywords": [ + "static", + "file", + "server" + ], + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "devDependencies": { + "after": "^0.8.2", + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.32.0", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "^10.7.0", + "nyc": "^17.0.0", + "supertest": "6.3.4" + }, + "files": [ + "LICENSE", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 18" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --check-leaks --reporter spec", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/serve-static/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/serve-static/LICENSE new file mode 100644 index 0000000..cbe62e8 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/serve-static/LICENSE @@ -0,0 +1,25 @@ +(The MIT License) + +Copyright (c) 2010 Sencha Inc. +Copyright (c) 2011 LearnBoost +Copyright (c) 2011 TJ Holowaychuk +Copyright (c) 2014-2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/serve-static/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/serve-static/README.md new file mode 100644 index 0000000..3ff1f1f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/serve-static/README.md @@ -0,0 +1,253 @@ +# serve-static + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![CI][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install serve-static +``` + +## API + +```js +const serveStatic = require('serve-static') +``` + +### serveStatic(root, options) + +Create a new middleware function to serve files from within a given root +directory. The file to serve will be determined by combining `req.url` +with the provided root directory. When a file is not found, instead of +sending a 404 response, this module will instead call `next()` to move on +to the next middleware, allowing for stacking and fall-backs. + +#### Options + +##### acceptRanges + +Enable or disable accepting ranged requests, defaults to true. +Disabling this will not send `Accept-Ranges` and ignore the contents +of the `Range` request header. + +##### cacheControl + +Enable or disable setting `Cache-Control` response header, defaults to +true. Disabling this will ignore the `immutable` and `maxAge` options. + +##### dotfiles + +Set how "dotfiles" are treated when encountered. A dotfile is a file +or directory that begins with a dot ("."). Note this check is done on +the path itself without checking if the path actually exists on the +disk. If `root` is specified, only the dotfiles above the root are +checked (i.e. the root itself can be within a dotfile when set +to "deny"). + + - `'allow'` No special treatment for dotfiles. + - `'deny'` Deny a request for a dotfile and 403/`next()`. + - `'ignore'` Pretend like the dotfile does not exist and 404/`next()`. + +The default value is `'ignore'`. + +##### etag + +Enable or disable etag generation, defaults to true. + +##### extensions + +Set file extension fallbacks. When set, if a file is not found, the given +extensions will be added to the file name and search for. The first that +exists will be served. Example: `['html', 'htm']`. + +The default value is `false`. + +##### fallthrough + +Set the middleware to have client errors fall-through as just unhandled +requests, otherwise forward a client error. The difference is that client +errors like a bad request or a request to a non-existent file will cause +this middleware to simply `next()` to your next middleware when this value +is `true`. When this value is `false`, these errors (even 404s), will invoke +`next(err)`. + +Typically `true` is desired such that multiple physical directories can be +mapped to the same web address or for routes to fill in non-existent files. + +The value `false` can be used if this middleware is mounted at a path that +is designed to be strictly a single file system directory, which allows for +short-circuiting 404s for less overhead. This middleware will also reply to +all methods. + +The default value is `true`. + +##### immutable + +Enable or disable the `immutable` directive in the `Cache-Control` response +header, defaults to `false`. If set to `true`, the `maxAge` option should +also be specified to enable caching. The `immutable` directive will prevent +supported clients from making conditional requests during the life of the +`maxAge` option to check if the file has changed. + +##### index + +By default this module will send "index.html" files in response to a request +on a directory. To disable this set `false` or to supply a new index pass a +string or an array in preferred order. + +##### lastModified + +Enable or disable `Last-Modified` header, defaults to true. Uses the file +system's last modified value. + +##### maxAge + +Provide a max-age in milliseconds for http caching, defaults to 0. This +can also be a string accepted by the [ms](https://www.npmjs.org/package/ms#readme) +module. + +##### redirect + +Redirect to trailing "/" when the pathname is a dir. Defaults to `true`. + +##### setHeaders + +Function to set custom headers on response. Alterations to the headers need to +occur synchronously. The function is called as `fn(res, path, stat)`, where +the arguments are: + + - `res` the response object + - `path` the file path that is being sent + - `stat` the stat object of the file that is being sent + +## Examples + +### Serve files with vanilla node.js http server + +```js +const finalhandler = require('finalhandler') +const http = require('http') +const serveStatic = require('serve-static') + +// Serve up public/ftp folder +const serve = serveStatic('public/ftp', { index: ['index.html', 'index.htm'] }) + +// Create server +const server = http.createServer((req, res) => { + serve(req, res, finalhandler(req, res)) +}) + +// Listen +server.listen(3000) +``` + +### Serve all files as downloads + +```js +const contentDisposition = require('content-disposition') +const finalhandler = require('finalhandler') +const http = require('http') +const serveStatic = require('serve-static') + +// Serve up public/ftp folder +const serve = serveStatic('public/ftp', { + index: false, + setHeaders: setHeaders +}) + +// Set header to force download +function setHeaders (res, path) { + res.setHeader('Content-Disposition', contentDisposition(path)) +} + +// Create server +const server = http.createServer((req, res) => { + serve(req, res, finalhandler(req, res)) +}) + +// Listen +server.listen(3000) +``` + +### Serving using express + +#### Simple + +This is a simple example of using Express. + +```js +const express = require('express') +const serveStatic = require('serve-static') + +const app = express() + +app.use(serveStatic('public/ftp', { index: ['default.html', 'default.htm'] })) +app.listen(3000) +``` + +#### Multiple roots + +This example shows a simple way to search through multiple directories. +Files are searched for in `public-optimized/` first, then `public/` second +as a fallback. + +```js +const express = require('express') +const path = require('path') +const serveStatic = require('serve-static') + +const app = express() + +app.use(serveStatic(path.join(__dirname, 'public-optimized'))) +app.use(serveStatic(path.join(__dirname, 'public'))) +app.listen(3000) +``` + +#### Different settings for paths + +This example shows how to set a different max age depending on the served +file. In this example, HTML files are not cached, while everything else +is for 1 day. + +```js +const express = require('express') +const path = require('path') +const serveStatic = require('serve-static') + +const app = express() + +app.use(serveStatic(path.join(__dirname, 'public'), { + maxAge: '1d', + setHeaders: setCustomCacheControl +})) + +app.listen(3000) + +function setCustomCacheControl (res, file) { + if (path.extname(file) === '.html') { + // Custom Cache-Control for HTML files + res.setHeader('Cache-Control', 'public, max-age=0') + } +} +``` + +## License + +[MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/serve-static/master +[coveralls-url]: https://coveralls.io/r/expressjs/serve-static?branch=master +[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/serve-static/master?label=linux +[github-actions-ci-url]: https://github.com/expressjs/serve-static/actions/workflows/ci.yml +[node-image]: https://badgen.net/npm/node/serve-static +[node-url]: https://nodejs.org/en/download/ +[npm-downloads-image]: https://badgen.net/npm/dm/serve-static +[npm-url]: https://npmjs.org/package/serve-static +[npm-version-image]: https://badgen.net/npm/v/serve-static diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/serve-static/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/serve-static/index.js new file mode 100644 index 0000000..1bee463 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/serve-static/index.js @@ -0,0 +1,208 @@ +/*! + * serve-static + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * Copyright(c) 2014-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var parseUrl = require('parseurl') +var resolve = require('path').resolve +var send = require('send') +var url = require('url') + +/** + * Module exports. + * @public + */ + +module.exports = serveStatic + +/** + * @param {string} root + * @param {object} [options] + * @return {function} + * @public + */ + +function serveStatic (root, options) { + if (!root) { + throw new TypeError('root path required') + } + + if (typeof root !== 'string') { + throw new TypeError('root path must be a string') + } + + // copy options object + var opts = Object.create(options || null) + + // fall-though + var fallthrough = opts.fallthrough !== false + + // default redirect + var redirect = opts.redirect !== false + + // headers listener + var setHeaders = opts.setHeaders + + if (setHeaders && typeof setHeaders !== 'function') { + throw new TypeError('option setHeaders must be function') + } + + // setup options for send + opts.maxage = opts.maxage || opts.maxAge || 0 + opts.root = resolve(root) + + // construct directory listener + var onDirectory = redirect + ? createRedirectDirectoryListener() + : createNotFoundDirectoryListener() + + return function serveStatic (req, res, next) { + if (req.method !== 'GET' && req.method !== 'HEAD') { + if (fallthrough) { + return next() + } + + // method not allowed + res.statusCode = 405 + res.setHeader('Allow', 'GET, HEAD') + res.setHeader('Content-Length', '0') + res.end() + return + } + + var forwardError = !fallthrough + var originalUrl = parseUrl.original(req) + var path = parseUrl(req).pathname + + // make sure redirect occurs at mount + if (path === '/' && originalUrl.pathname.substr(-1) !== '/') { + path = '' + } + + // create send stream + var stream = send(req, path, opts) + + // add directory handler + stream.on('directory', onDirectory) + + // add headers listener + if (setHeaders) { + stream.on('headers', setHeaders) + } + + // add file listener for fallthrough + if (fallthrough) { + stream.on('file', function onFile () { + // once file is determined, always forward error + forwardError = true + }) + } + + // forward errors + stream.on('error', function error (err) { + if (forwardError || !(err.statusCode < 500)) { + next(err) + return + } + + next() + }) + + // pipe + stream.pipe(res) + } +} + +/** + * Collapse all leading slashes into a single slash + * @private + */ +function collapseLeadingSlashes (str) { + for (var i = 0; i < str.length; i++) { + if (str.charCodeAt(i) !== 0x2f /* / */) { + break + } + } + + return i > 1 + ? '/' + str.substr(i) + : str +} + +/** + * Create a minimal HTML document. + * + * @param {string} title + * @param {string} body + * @private + */ + +function createHtmlDocument (title, body) { + return '\n' + + '\n' + + '\n' + + '\n' + + '' + title + '\n' + + '\n' + + '\n' + + '
' + body + '
\n' + + '\n' + + '\n' +} + +/** + * Create a directory listener that just 404s. + * @private + */ + +function createNotFoundDirectoryListener () { + return function notFound () { + this.error(404) + } +} + +/** + * Create a directory listener that performs a redirect. + * @private + */ + +function createRedirectDirectoryListener () { + return function redirect (res) { + if (this.hasTrailingSlash()) { + this.error(404) + return + } + + // get original URL + var originalUrl = parseUrl.original(this.req) + + // append trailing slash + originalUrl.path = null + originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/') + + // reformat the URL + var loc = encodeUrl(url.format(originalUrl)) + var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + escapeHtml(loc)) + + // send redirect response + res.statusCode = 301 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', Buffer.byteLength(doc)) + res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('X-Content-Type-Options', 'nosniff') + res.setHeader('Location', loc) + res.end(doc) + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/serve-static/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/serve-static/package.json new file mode 100644 index 0000000..5fb5b02 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/serve-static/package.json @@ -0,0 +1,44 @@ +{ + "name": "serve-static", + "description": "Serve static files", + "version": "2.2.1", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "expressjs/serve-static", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.32.0", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "^10.7.0", + "nyc": "^17.0.0", + "supertest": "^6.3.4" + }, + "files": [ + "LICENSE", + "index.js" + ], + "engines": { + "node": ">= 18" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/LICENSE new file mode 100644 index 0000000..61afa2f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Wes Todd + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/README.md new file mode 100644 index 0000000..791eeff --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/README.md @@ -0,0 +1,31 @@ +# Polyfill for `Object.setPrototypeOf` + +[![NPM Version](https://img.shields.io/npm/v/setprototypeof.svg)](https://npmjs.org/package/setprototypeof) +[![NPM Downloads](https://img.shields.io/npm/dm/setprototypeof.svg)](https://npmjs.org/package/setprototypeof) +[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/standard/standard) + +A simple cross platform implementation to set the prototype of an instianted object. Supports all modern browsers and at least back to IE8. + +## Usage: + +``` +$ npm install --save setprototypeof +``` + +```javascript +var setPrototypeOf = require('setprototypeof') + +var obj = {} +setPrototypeOf(obj, { + foo: function () { + return 'bar' + } +}) +obj.foo() // bar +``` + +TypeScript is also supported: + +```typescript +import setPrototypeOf from 'setprototypeof' +``` diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/index.d.ts new file mode 100644 index 0000000..f108ecd --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/index.d.ts @@ -0,0 +1,2 @@ +declare function setPrototypeOf(o: any, proto: object | null): any; +export = setPrototypeOf; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/index.js new file mode 100644 index 0000000..c527055 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/index.js @@ -0,0 +1,17 @@ +'use strict' +/* eslint no-proto: 0 */ +module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties) + +function setProtoOf (obj, proto) { + obj.__proto__ = proto + return obj +} + +function mixinProperties (obj, proto) { + for (var prop in proto) { + if (!Object.prototype.hasOwnProperty.call(obj, prop)) { + obj[prop] = proto[prop] + } + } + return obj +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/package.json new file mode 100644 index 0000000..f20915b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/package.json @@ -0,0 +1,38 @@ +{ + "name": "setprototypeof", + "version": "1.2.0", + "description": "A small polyfill for Object.setprototypeof", + "main": "index.js", + "typings": "index.d.ts", + "scripts": { + "test": "standard && mocha", + "testallversions": "npm run node010 && npm run node4 && npm run node6 && npm run node9 && npm run node11", + "testversion": "docker run -it --rm -v $(PWD):/usr/src/app -w /usr/src/app node:${NODE_VER} npm install mocha@${MOCHA_VER:-latest} && npm t", + "node010": "NODE_VER=0.10 MOCHA_VER=3 npm run testversion", + "node4": "NODE_VER=4 npm run testversion", + "node6": "NODE_VER=6 npm run testversion", + "node9": "NODE_VER=9 npm run testversion", + "node11": "NODE_VER=11 npm run testversion", + "prepublishOnly": "npm t", + "postpublish": "git push origin && git push origin --tags" + }, + "repository": { + "type": "git", + "url": "https://github.com/wesleytodd/setprototypeof.git" + }, + "keywords": [ + "polyfill", + "object", + "setprototypeof" + ], + "author": "Wes Todd", + "license": "ISC", + "bugs": { + "url": "https://github.com/wesleytodd/setprototypeof/issues" + }, + "homepage": "https://github.com/wesleytodd/setprototypeof", + "devDependencies": { + "mocha": "^6.1.4", + "standard": "^13.0.2" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/test/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/test/index.js new file mode 100644 index 0000000..afeb4dd --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/setprototypeof/test/index.js @@ -0,0 +1,24 @@ +'use strict' +/* eslint-env mocha */ +/* eslint no-proto: 0 */ +var assert = require('assert') +var setPrototypeOf = require('..') + +describe('setProtoOf(obj, proto)', function () { + it('should merge objects', function () { + var obj = { a: 1, b: 2 } + var proto = { b: 3, c: 4 } + var mergeObj = setPrototypeOf(obj, proto) + + if (Object.getPrototypeOf) { + assert.strictEqual(Object.getPrototypeOf(obj), proto) + } else if ({ __proto__: [] } instanceof Array) { + assert.strictEqual(obj.__proto__, proto) + } else { + assert.strictEqual(obj.a, 1) + assert.strictEqual(obj.b, 2) + assert.strictEqual(obj.c, 4) + } + assert.strictEqual(mergeObj, obj) + }) +}) diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/.editorconfig b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/.editorconfig new file mode 100644 index 0000000..72e0eba --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/.eslintrc b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/.eslintrc new file mode 100644 index 0000000..93978e7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/.eslintrc @@ -0,0 +1,11 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "max-lines-per-function": 0, + "multiline-comment-style": 1, + "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], + }, +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/.github/FUNDING.yml b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/.github/FUNDING.yml new file mode 100644 index 0000000..eaff735 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/side-channel-list +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/.nycrc b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/.nycrc new file mode 100644 index 0000000..1826526 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/CHANGELOG.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/CHANGELOG.md new file mode 100644 index 0000000..2ec51b7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v1.0.0 - 2024-12-10 + +### Commits + +- Initial implementation, tests, readme, types [`5d6baee`](https://github.com/ljharb/side-channel-list/commit/5d6baee5c9054a1238007f5a1dfc109a7a816251) +- Initial commit [`3ae784c`](https://github.com/ljharb/side-channel-list/commit/3ae784c63a47895fbaeed2a91ab54a8029a7a100) +- npm init [`07055a4`](https://github.com/ljharb/side-channel-list/commit/07055a4d139895565b199dba5fe2479c1a1b9e28) +- Only apps should have lockfiles [`9573058`](https://github.com/ljharb/side-channel-list/commit/9573058a47494e2d68f8c6c77b5d7fbe441949c1) diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/LICENSE new file mode 100644 index 0000000..f82f389 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/README.md new file mode 100644 index 0000000..d9c7a13 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/README.md @@ -0,0 +1,62 @@ +# side-channel-list [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Store information about any JS value in a side channel, using a linked list. + +Warning: this implementation will leak memory until you `delete` the `key`. +Use [`side-channel`](https://npmjs.com/side-channel) for the best available strategy. + +## Getting started + +```sh +npm install --save side-channel-list +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getSideChannelList = require('side-channel-list'); + +const channel = getSideChannelList(); + +const key = {}; +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); + +channel.set(key, 42); + +channel.assert(key); // does not throw +assert.equal(channel.has(key), true); +assert.equal(channel.get(key), 42); + +channel.delete(key); +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/side-channel-list +[npm-version-svg]: https://versionbadg.es/ljharb/side-channel-list.svg +[deps-svg]: https://david-dm.org/ljharb/side-channel-list.svg +[deps-url]: https://david-dm.org/ljharb/side-channel-list +[dev-deps-svg]: https://david-dm.org/ljharb/side-channel-list/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/side-channel-list#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/side-channel-list.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/side-channel-list.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/side-channel-list.svg +[downloads-url]: https://npm-stat.com/charts.html?package=side-channel-list +[codecov-image]: https://codecov.io/gh/ljharb/side-channel-list/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel-list/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel-list +[actions-url]: https://github.com/ljharb/side-channel-list/actions diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/index.d.ts new file mode 100644 index 0000000..c9cabc8 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/index.d.ts @@ -0,0 +1,13 @@ +declare namespace getSideChannelList { + type Channel = { + assert: (key: K) => void; + has: (key: K) => boolean; + get: (key: K) => V | undefined; + set: (key: K, value: V) => void; + delete: (key: K) => boolean; + }; +} + +declare function getSideChannelList(): getSideChannelList.Channel; + +export = getSideChannelList; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/index.js new file mode 100644 index 0000000..8d6f98c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/index.js @@ -0,0 +1,113 @@ +'use strict'; + +var inspect = require('object-inspect'); + +var $TypeError = require('es-errors/type'); + +/* +* This function traverses the list returning the node corresponding to the given key. +* +* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. +* By doing so, all the recently used nodes can be accessed relatively quickly. +*/ +/** @type {import('./list.d.ts').listGetNode} */ +// eslint-disable-next-line consistent-return +var listGetNode = function (list, key, isDelete) { + /** @type {typeof list | NonNullable<(typeof list)['next']>} */ + var prev = list; + /** @type {(typeof list)['next']} */ + var curr; + // eslint-disable-next-line eqeqeq + for (; (curr = prev.next) != null; prev = curr) { + if (curr.key === key) { + prev.next = curr.next; + if (!isDelete) { + // eslint-disable-next-line no-extra-parens + curr.next = /** @type {NonNullable} */ (list.next); + list.next = curr; // eslint-disable-line no-param-reassign + } + return curr; + } + } +}; + +/** @type {import('./list.d.ts').listGet} */ +var listGet = function (objects, key) { + if (!objects) { + return void undefined; + } + var node = listGetNode(objects, key); + return node && node.value; +}; +/** @type {import('./list.d.ts').listSet} */ +var listSet = function (objects, key, value) { + var node = listGetNode(objects, key); + if (node) { + node.value = value; + } else { + // Prepend the new node to the beginning of the list + objects.next = /** @type {import('./list.d.ts').ListNode} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens + key: key, + next: objects.next, + value: value + }); + } +}; +/** @type {import('./list.d.ts').listHas} */ +var listHas = function (objects, key) { + if (!objects) { + return false; + } + return !!listGetNode(objects, key); +}; +/** @type {import('./list.d.ts').listDelete} */ +// eslint-disable-next-line consistent-return +var listDelete = function (objects, key) { + if (objects) { + return listGetNode(objects, key, true); + } +}; + +/** @type {import('.')} */ +module.exports = function getSideChannelList() { + /** @typedef {ReturnType} Channel */ + /** @typedef {Parameters[0]} K */ + /** @typedef {Parameters[1]} V */ + + /** @type {import('./list.d.ts').RootNode | undefined} */ var $o; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + var root = $o && $o.next; + var deletedNode = listDelete($o, key); + if (deletedNode && root && root === deletedNode) { + $o = void undefined; + } + return !!deletedNode; + }, + get: function (key) { + return listGet($o, key); + }, + has: function (key) { + return listHas($o, key); + }, + set: function (key, value) { + if (!$o) { + // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head + $o = { + next: void undefined + }; + } + // eslint-disable-next-line no-extra-parens + listSet(/** @type {NonNullable} */ ($o), key, value); + } + }; + // @ts-expect-error TODO: figure out why this is erroring + return channel; +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/list.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/list.d.ts new file mode 100644 index 0000000..2c759e2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/list.d.ts @@ -0,0 +1,14 @@ +type ListNode = { + key: K; + next: undefined | ListNode; + value: T; +}; +type RootNode = { + next: undefined | ListNode; +}; + +export function listGetNode(list: RootNode, key: ListNode['key'], isDelete?: boolean): ListNode | undefined; +export function listGet(objects: undefined | RootNode, key: ListNode['key']): T | undefined; +export function listSet(objects: RootNode, key: ListNode['key'], value: T): void; +export function listHas(objects: undefined | RootNode, key: ListNode['key']): boolean; +export function listDelete(objects: undefined | RootNode, key: ListNode['key']): ListNode | undefined; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/package.json new file mode 100644 index 0000000..ba0f5c5 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/package.json @@ -0,0 +1,77 @@ +{ + "name": "side-channel-list", + "version": "1.0.0", + "description": "Store information about any JS value in a side channel, using a linked list", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>= 10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/side-channel-list.git" + }, + "keywords": [], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/side-channel-list/issues" + }, + "homepage": "https://github.com/ljharb/side-channel-list#readme", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.6.5", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/test/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/test/index.js new file mode 100644 index 0000000..3ad4368 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/test/index.js @@ -0,0 +1,104 @@ +'use strict'; + +var test = require('tape'); + +var getSideChannelList = require('../'); + +test('getSideChannelList', function (t) { + t.test('export', function (st) { + st.equal(typeof getSideChannelList, 'function', 'is a function'); + + st.equal(getSideChannelList.length, 0, 'takes no arguments'); + + var channel = getSideChannelList(); + st.ok(channel, 'is truthy'); + st.equal(typeof channel, 'object', 'is an object'); + st.end(); + }); + + t.test('assert', function (st) { + var channel = getSideChannelList(); + st['throws']( + function () { channel.assert({}); }, + TypeError, + 'nonexistent value throws' + ); + + var o = {}; + channel.set(o, 'data'); + st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); + + st.end(); + }); + + t.test('has', function (st) { + var channel = getSideChannelList(); + /** @type {unknown[]} */ var o = []; + + st.equal(channel.has(o), false, 'nonexistent value yields false'); + + channel.set(o, 'foo'); + st.equal(channel.has(o), true, 'existent value yields true'); + + st.equal(channel.has('abc'), false, 'non object value non existent yields false'); + + channel.set('abc', 'foo'); + st.equal(channel.has('abc'), true, 'non object value that exists yields true'); + + st.end(); + }); + + t.test('get', function (st) { + var channel = getSideChannelList(); + var o = {}; + st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); + + var data = {}; + channel.set(o, data); + st.equal(channel.get(o), data, '"get" yields data set by "set"'); + + st.end(); + }); + + t.test('set', function (st) { + var channel = getSideChannelList(); + var o = function () {}; + st.equal(channel.get(o), undefined, 'value not set'); + + channel.set(o, 42); + st.equal(channel.get(o), 42, 'value was set'); + + channel.set(o, Infinity); + st.equal(channel.get(o), Infinity, 'value was set again'); + + var o2 = {}; + channel.set(o2, 17); + st.equal(channel.get(o), Infinity, 'o is not modified'); + st.equal(channel.get(o2), 17, 'o2 is set'); + + channel.set(o, 14); + st.equal(channel.get(o), 14, 'o is modified'); + st.equal(channel.get(o2), 17, 'o2 is not modified'); + + st.end(); + }); + + t.test('delete', function (st) { + var channel = getSideChannelList(); + var o = {}; + st.equal(channel['delete']({}), false, 'nonexistent value yields false'); + + channel.set(o, 42); + st.equal(channel.has(o), true, 'value is set'); + + st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); + + st.equal(channel['delete'](o), true, 'deleted value yields true'); + + st.equal(channel.has(o), false, 'value is no longer set'); + + st.end(); + }); + + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/tsconfig.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/tsconfig.json new file mode 100644 index 0000000..d9a6668 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-list/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/.editorconfig b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/.editorconfig new file mode 100644 index 0000000..72e0eba --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/.eslintrc b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/.eslintrc new file mode 100644 index 0000000..93978e7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/.eslintrc @@ -0,0 +1,11 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "max-lines-per-function": 0, + "multiline-comment-style": 1, + "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], + }, +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/.github/FUNDING.yml b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/.github/FUNDING.yml new file mode 100644 index 0000000..f2891bd --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/side-channel-map +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/.nycrc b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/.nycrc new file mode 100644 index 0000000..1826526 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/CHANGELOG.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/CHANGELOG.md new file mode 100644 index 0000000..b6ccea9 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/CHANGELOG.md @@ -0,0 +1,22 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.1](https://github.com/ljharb/side-channel-map/compare/v1.0.0...v1.0.1) - 2024-12-10 + +### Commits + +- [Deps] update `call-bound` [`6d05aaa`](https://github.com/ljharb/side-channel-map/commit/6d05aaa4ce5f2be4e7825df433d650696f0ba40f) +- [types] fix generics ordering [`11c0184`](https://github.com/ljharb/side-channel-map/commit/11c0184132ac11fdc16857e12682e148e5e9ee74) + +## v1.0.0 - 2024-12-10 + +### Commits + +- Initial implementation, tests, readme, types [`ad877b4`](https://github.com/ljharb/side-channel-map/commit/ad877b42926d46d63fff76a2bd01d2b4a01959a9) +- Initial commit [`28f8879`](https://github.com/ljharb/side-channel-map/commit/28f8879c512abe8fcf9b6a4dc7754a0287e5eba4) +- npm init [`2c9604e`](https://github.com/ljharb/side-channel-map/commit/2c9604e5aa40223e425ea7cea78f8a07697504bd) +- Only apps should have lockfiles [`5e7ba9c`](https://github.com/ljharb/side-channel-map/commit/5e7ba9cffe3ef42095815adc8ac1255b49bbadf5) diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/LICENSE new file mode 100644 index 0000000..f82f389 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/README.md new file mode 100644 index 0000000..8fa6f77 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/README.md @@ -0,0 +1,62 @@ +# side-channel-map [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Store information about any JS value in a side channel, using a Map. + +Warning: if the `key` is an object, this implementation will leak memory until you `delete` it. +Use [`side-channel`](https://npmjs.com/side-channel) for the best available strategy. + +## Getting started + +```sh +npm install --save side-channel-map +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getSideChannelMap = require('side-channel-map'); + +const channel = getSideChannelMap(); + +const key = {}; +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); + +channel.set(key, 42); + +channel.assert(key); // does not throw +assert.equal(channel.has(key), true); +assert.equal(channel.get(key), 42); + +channel.delete(key); +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/side-channel-map +[npm-version-svg]: https://versionbadg.es/ljharb/side-channel-map.svg +[deps-svg]: https://david-dm.org/ljharb/side-channel-map.svg +[deps-url]: https://david-dm.org/ljharb/side-channel-map +[dev-deps-svg]: https://david-dm.org/ljharb/side-channel-map/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/side-channel-map#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/side-channel-map.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/side-channel-map.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/side-channel-map.svg +[downloads-url]: https://npm-stat.com/charts.html?package=side-channel-map +[codecov-image]: https://codecov.io/gh/ljharb/side-channel-map/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel-map/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel-map +[actions-url]: https://github.com/ljharb/side-channel-map/actions diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/index.d.ts new file mode 100644 index 0000000..de33e89 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/index.d.ts @@ -0,0 +1,15 @@ +declare namespace getSideChannelMap { + type Channel = { + assert: (key: K) => void; + has: (key: K) => boolean; + get: (key: K) => V | undefined; + set: (key: K, value: V) => void; + delete: (key: K) => boolean; + }; +} + +declare function getSideChannelMap(): getSideChannelMap.Channel; + +declare const x: false | typeof getSideChannelMap; + +export = x; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/index.js new file mode 100644 index 0000000..e111100 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/index.js @@ -0,0 +1,68 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); +var callBound = require('call-bound'); +var inspect = require('object-inspect'); + +var $TypeError = require('es-errors/type'); +var $Map = GetIntrinsic('%Map%', true); + +/** @type {(thisArg: Map, key: K) => V} */ +var $mapGet = callBound('Map.prototype.get', true); +/** @type {(thisArg: Map, key: K, value: V) => void} */ +var $mapSet = callBound('Map.prototype.set', true); +/** @type {(thisArg: Map, key: K) => boolean} */ +var $mapHas = callBound('Map.prototype.has', true); +/** @type {(thisArg: Map, key: K) => boolean} */ +var $mapDelete = callBound('Map.prototype.delete', true); +/** @type {(thisArg: Map) => number} */ +var $mapSize = callBound('Map.prototype.size', true); + +/** @type {import('.')} */ +module.exports = !!$Map && /** @type {Exclude} */ function getSideChannelMap() { + /** @typedef {ReturnType} Channel */ + /** @typedef {Parameters[0]} K */ + /** @typedef {Parameters[1]} V */ + + /** @type {Map | undefined} */ var $m; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + if ($m) { + var result = $mapDelete($m, key); + if ($mapSize($m) === 0) { + $m = void undefined; + } + return result; + } + return false; + }, + get: function (key) { // eslint-disable-line consistent-return + if ($m) { + return $mapGet($m, key); + } + }, + has: function (key) { + if ($m) { + return $mapHas($m, key); + } + return false; + }, + set: function (key, value) { + if (!$m) { + // @ts-expect-error TS can't handle narrowing a variable inside a closure + $m = new $Map(); + } + $mapSet($m, key, value); + } + }; + + // @ts-expect-error TODO: figure out why TS is erroring here + return channel; +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/package.json new file mode 100644 index 0000000..18e8080 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/package.json @@ -0,0 +1,80 @@ +{ + "name": "side-channel-map", + "version": "1.0.1", + "description": "Store information about any JS value in a side channel, using a Map", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>= 10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/side-channel-map.git" + }, + "keywords": [], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/side-channel-map/issues" + }, + "homepage": "https://github.com/ljharb/side-channel-map#readme", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/get-intrinsic": "^1.2.3", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.6.5", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/test/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/test/index.js new file mode 100644 index 0000000..1743323 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/test/index.js @@ -0,0 +1,114 @@ +'use strict'; + +var test = require('tape'); + +var getSideChannelMap = require('../'); + +test('getSideChannelMap', { skip: typeof Map !== 'function' }, function (t) { + var getSideChannel = getSideChannelMap || function () { + throw new EvalError('should never happen'); + }; + + t.test('export', function (st) { + st.equal(typeof getSideChannel, 'function', 'is a function'); + + st.equal(getSideChannel.length, 0, 'takes no arguments'); + + var channel = getSideChannel(); + st.ok(channel, 'is truthy'); + st.equal(typeof channel, 'object', 'is an object'); + st.end(); + }); + + t.test('assert', function (st) { + var channel = getSideChannel(); + st['throws']( + function () { channel.assert({}); }, + TypeError, + 'nonexistent value throws' + ); + + var o = {}; + channel.set(o, 'data'); + st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); + + st.end(); + }); + + t.test('has', function (st) { + var channel = getSideChannel(); + /** @type {unknown[]} */ var o = []; + + st.equal(channel.has(o), false, 'nonexistent value yields false'); + + channel.set(o, 'foo'); + st.equal(channel.has(o), true, 'existent value yields true'); + + st.equal(channel.has('abc'), false, 'non object value non existent yields false'); + + channel.set('abc', 'foo'); + st.equal(channel.has('abc'), true, 'non object value that exists yields true'); + + st.end(); + }); + + t.test('get', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); + + var data = {}; + channel.set(o, data); + st.equal(channel.get(o), data, '"get" yields data set by "set"'); + + st.end(); + }); + + t.test('set', function (st) { + var channel = getSideChannel(); + var o = function () {}; + st.equal(channel.get(o), undefined, 'value not set'); + + channel.set(o, 42); + st.equal(channel.get(o), 42, 'value was set'); + + channel.set(o, Infinity); + st.equal(channel.get(o), Infinity, 'value was set again'); + + var o2 = {}; + channel.set(o2, 17); + st.equal(channel.get(o), Infinity, 'o is not modified'); + st.equal(channel.get(o2), 17, 'o2 is set'); + + channel.set(o, 14); + st.equal(channel.get(o), 14, 'o is modified'); + st.equal(channel.get(o2), 17, 'o2 is not modified'); + + st.end(); + }); + + t.test('delete', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel['delete']({}), false, 'nonexistent value yields false'); + + channel.set(o, 42); + st.equal(channel.has(o), true, 'value is set'); + + st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); + + st.equal(channel['delete'](o), true, 'deleted value yields true'); + + st.equal(channel.has(o), false, 'value is no longer set'); + + st.end(); + }); + + t.end(); +}); + +test('getSideChannelMap, no Maps', { skip: typeof Map === 'function' }, function (t) { + t.equal(getSideChannelMap, false, 'is false'); + + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/tsconfig.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/tsconfig.json new file mode 100644 index 0000000..d9a6668 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-map/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/.editorconfig b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/.editorconfig new file mode 100644 index 0000000..72e0eba --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/.eslintrc b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/.eslintrc new file mode 100644 index 0000000..9b13ad8 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/.eslintrc @@ -0,0 +1,12 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": 0, + "max-lines-per-function": 0, + "multiline-comment-style": 1, + "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], + }, +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/.github/FUNDING.yml b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/.github/FUNDING.yml new file mode 100644 index 0000000..2ae71cd --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/side-channel-weakmap +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/.nycrc b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/.nycrc new file mode 100644 index 0000000..1826526 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/CHANGELOG.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/CHANGELOG.md new file mode 100644 index 0000000..aba7ab0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/CHANGELOG.md @@ -0,0 +1,28 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.2](https://github.com/ljharb/side-channel-weakmap/compare/v1.0.1...v1.0.2) - 2024-12-10 + +### Commits + +- [types] fix generics ordering [`1b62e94`](https://github.com/ljharb/side-channel-weakmap/commit/1b62e94a2ad6ed30b640ba73c4a2535836c67289) + +## [v1.0.1](https://github.com/ljharb/side-channel-weakmap/compare/v1.0.0...v1.0.1) - 2024-12-10 + +### Commits + +- [types] fix generics ordering [`08a4a5d`](https://github.com/ljharb/side-channel-weakmap/commit/08a4a5dbffedc3ebc79f1aaaf5a3dd6d2196dc1b) +- [Deps] update `side-channel-map` [`b53fe44`](https://github.com/ljharb/side-channel-weakmap/commit/b53fe447dfdd3a9aebedfd015b384eac17fce916) + +## v1.0.0 - 2024-12-10 + +### Commits + +- Initial implementation, tests, readme, types [`53c0fa4`](https://github.com/ljharb/side-channel-weakmap/commit/53c0fa4788435a006f58b9d7b43cb65989ecee49) +- Initial commit [`a157947`](https://github.com/ljharb/side-channel-weakmap/commit/a157947f26fcaf2c4a941d3a044e76bf67343532) +- npm init [`54dfc55`](https://github.com/ljharb/side-channel-weakmap/commit/54dfc55bafb16265910d5aad4e743c43aee5bbbb) +- Only apps should have lockfiles [`0ddd6c7`](https://github.com/ljharb/side-channel-weakmap/commit/0ddd6c7b07fe8ee04d67b2e9f7255af7ce62c07d) diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/LICENSE new file mode 100644 index 0000000..3900dd7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/README.md new file mode 100644 index 0000000..856ee36 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/README.md @@ -0,0 +1,62 @@ +# side-channel-weakmap [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Store information about any JS value in a side channel. Uses WeakMap if available. + +Warning: this implementation will leak memory until you `delete` the `key`. +Use [`side-channel`](https://npmjs.com/side-channel) for the best available strategy. + +## Getting started + +```sh +npm install --save side-channel-weakmap +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getSideChannelList = require('side-channel-weakmap'); + +const channel = getSideChannelList(); + +const key = {}; +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); + +channel.set(key, 42); + +channel.assert(key); // does not throw +assert.equal(channel.has(key), true); +assert.equal(channel.get(key), 42); + +channel.delete(key); +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/side-channel-weakmap +[npm-version-svg]: https://versionbadg.es/ljharb/side-channel-weakmap.svg +[deps-svg]: https://david-dm.org/ljharb/side-channel-weakmap.svg +[deps-url]: https://david-dm.org/ljharb/side-channel-weakmap +[dev-deps-svg]: https://david-dm.org/ljharb/side-channel-weakmap/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/side-channel-weakmap#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/side-channel-weakmap.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/side-channel-weakmap.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/side-channel-weakmap.svg +[downloads-url]: https://npm-stat.com/charts.html?package=side-channel-weakmap +[codecov-image]: https://codecov.io/gh/ljharb/side-channel-weakmap/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel-weakmap/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel-weakmap +[actions-url]: https://github.com/ljharb/side-channel-weakmap/actions diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/index.d.ts new file mode 100644 index 0000000..ce1bc2a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/index.d.ts @@ -0,0 +1,15 @@ +declare namespace getSideChannelWeakMap { + type Channel = { + assert: (key: K) => void; + has: (key: K) => boolean; + get: (key: K) => V | undefined; + set: (key: K, value: V) => void; + delete: (key: K) => boolean; + } +} + +declare function getSideChannelWeakMap(): getSideChannelWeakMap.Channel; + +declare const x: false | typeof getSideChannelWeakMap; + +export = x; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/index.js new file mode 100644 index 0000000..e5b8183 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/index.js @@ -0,0 +1,84 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); +var callBound = require('call-bound'); +var inspect = require('object-inspect'); +var getSideChannelMap = require('side-channel-map'); + +var $TypeError = require('es-errors/type'); +var $WeakMap = GetIntrinsic('%WeakMap%', true); + +/** @type {(thisArg: WeakMap, key: K) => V} */ +var $weakMapGet = callBound('WeakMap.prototype.get', true); +/** @type {(thisArg: WeakMap, key: K, value: V) => void} */ +var $weakMapSet = callBound('WeakMap.prototype.set', true); +/** @type {(thisArg: WeakMap, key: K) => boolean} */ +var $weakMapHas = callBound('WeakMap.prototype.has', true); +/** @type {(thisArg: WeakMap, key: K) => boolean} */ +var $weakMapDelete = callBound('WeakMap.prototype.delete', true); + +/** @type {import('.')} */ +module.exports = $WeakMap + ? /** @type {Exclude} */ function getSideChannelWeakMap() { + /** @typedef {ReturnType} Channel */ + /** @typedef {Parameters[0]} K */ + /** @typedef {Parameters[1]} V */ + + /** @type {WeakMap | undefined} */ var $wm; + /** @type {Channel | undefined} */ var $m; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapDelete($wm, key); + } + } else if (getSideChannelMap) { + if ($m) { + return $m['delete'](key); + } + } + return false; + }, + get: function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapGet($wm, key); + } + } + return $m && $m.get(key); + }, + has: function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapHas($wm, key); + } + } + return !!$m && $m.has(key); + }, + set: function (key, value) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if (!$wm) { + $wm = new $WeakMap(); + } + $weakMapSet($wm, key, value); + } else if (getSideChannelMap) { + if (!$m) { + $m = getSideChannelMap(); + } + // eslint-disable-next-line no-extra-parens + /** @type {NonNullable} */ ($m).set(key, value); + } + } + }; + + // @ts-expect-error TODO: figure out why this is erroring + return channel; + } + : getSideChannelMap; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/package.json new file mode 100644 index 0000000..9ef6583 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/package.json @@ -0,0 +1,87 @@ +{ + "name": "side-channel-weakmap", + "version": "1.0.2", + "description": "Store information about any JS value in a side channel. Uses WeakMap if available.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/side-channel-weakmap.git" + }, + "keywords": [ + "weakmap", + "map", + "side", + "channel", + "metadata" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/side-channel-weakmap/issues" + }, + "homepage": "https://github.com/ljharb/side-channel-weakmap#readme", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/call-bind": "^1.0.5", + "@types/get-intrinsic": "^1.2.3", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.6.5", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/test/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/test/index.js new file mode 100644 index 0000000..a01248b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/test/index.js @@ -0,0 +1,114 @@ +'use strict'; + +var test = require('tape'); + +var getSideChannelWeakMap = require('../'); + +test('getSideChannelMap', { skip: typeof WeakMap !== 'function' && typeof Map !== 'function' }, function (t) { + var getSideChannel = getSideChannelWeakMap || function () { + throw new EvalError('should never happen'); + }; + + t.test('export', function (st) { + st.equal(typeof getSideChannel, 'function', 'is a function'); + + st.equal(getSideChannel.length, 0, 'takes no arguments'); + + var channel = getSideChannel(); + st.ok(channel, 'is truthy'); + st.equal(typeof channel, 'object', 'is an object'); + st.end(); + }); + + t.test('assert', function (st) { + var channel = getSideChannel(); + st['throws']( + function () { channel.assert({}); }, + TypeError, + 'nonexistent value throws' + ); + + var o = {}; + channel.set(o, 'data'); + st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); + + st.end(); + }); + + t.test('has', function (st) { + var channel = getSideChannel(); + /** @type {unknown[]} */ var o = []; + + st.equal(channel.has(o), false, 'nonexistent value yields false'); + + channel.set(o, 'foo'); + st.equal(channel.has(o), true, 'existent value yields true'); + + st.equal(channel.has('abc'), false, 'non object value non existent yields false'); + + channel.set('abc', 'foo'); + st.equal(channel.has('abc'), true, 'non object value that exists yields true'); + + st.end(); + }); + + t.test('get', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); + + var data = {}; + channel.set(o, data); + st.equal(channel.get(o), data, '"get" yields data set by "set"'); + + st.end(); + }); + + t.test('set', function (st) { + var channel = getSideChannel(); + var o = function () {}; + st.equal(channel.get(o), undefined, 'value not set'); + + channel.set(o, 42); + st.equal(channel.get(o), 42, 'value was set'); + + channel.set(o, Infinity); + st.equal(channel.get(o), Infinity, 'value was set again'); + + var o2 = {}; + channel.set(o2, 17); + st.equal(channel.get(o), Infinity, 'o is not modified'); + st.equal(channel.get(o2), 17, 'o2 is set'); + + channel.set(o, 14); + st.equal(channel.get(o), 14, 'o is modified'); + st.equal(channel.get(o2), 17, 'o2 is not modified'); + + st.end(); + }); + + t.test('delete', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel['delete']({}), false, 'nonexistent value yields false'); + + channel.set(o, 42); + st.equal(channel.has(o), true, 'value is set'); + + st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); + + st.equal(channel['delete'](o), true, 'deleted value yields true'); + + st.equal(channel.has(o), false, 'value is no longer set'); + + st.end(); + }); + + t.end(); +}); + +test('getSideChannelMap, no WeakMaps and/or Maps', { skip: typeof WeakMap === 'function' || typeof Map === 'function' }, function (t) { + t.equal(getSideChannelWeakMap, false, 'is false'); + + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/tsconfig.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/tsconfig.json new file mode 100644 index 0000000..d9a6668 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel-weakmap/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/.editorconfig b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/.editorconfig new file mode 100644 index 0000000..72e0eba --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/.eslintrc b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/.eslintrc new file mode 100644 index 0000000..9b13ad8 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/.eslintrc @@ -0,0 +1,12 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": 0, + "max-lines-per-function": 0, + "multiline-comment-style": 1, + "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], + }, +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/.github/FUNDING.yml b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/.github/FUNDING.yml new file mode 100644 index 0000000..2a94840 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/side-channel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/.nycrc b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/.nycrc new file mode 100644 index 0000000..1826526 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/CHANGELOG.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/CHANGELOG.md new file mode 100644 index 0000000..58e378c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/CHANGELOG.md @@ -0,0 +1,110 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.0](https://github.com/ljharb/side-channel/compare/v1.0.6...v1.1.0) - 2024-12-11 + +### Commits + +- [Refactor] extract implementations to `side-channel-weakmap`, `side-channel-map`, `side-channel-list` [`ada5955`](https://github.com/ljharb/side-channel/commit/ada595549a5c4c6c853756d598846b180941c6da) +- [New] add `channel.delete` [`c01d2d3`](https://github.com/ljharb/side-channel/commit/c01d2d3fd51dbb1ce6da72ad7916e61bd6172aad) +- [types] improve types [`0c54356`](https://github.com/ljharb/side-channel/commit/0c5435651417df41b8cc1a5f7cdce8bffae68cde) +- [readme] add content [`be24868`](https://github.com/ljharb/side-channel/commit/be248682ac294b0e22c883092c45985aa91c490a) +- [actions] split out node 10-20, and 20+ [`c4488e2`](https://github.com/ljharb/side-channel/commit/c4488e241ef3d49a19fe266ac830a2e644305911) +- [types] use shared tsconfig [`0e0d57c`](https://github.com/ljharb/side-channel/commit/0e0d57c2ff17c7b45c6cbd43ebcf553edc9e3adc) +- [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/get-intrinsic`, `@types/object-inspect`, `@types/tape`, `auto-changelog`, `tape` [`fb4f622`](https://github.com/ljharb/side-channel/commit/fb4f622e64a99a1e40b6e5cd7691674a9dc429e4) +- [Deps] update `call-bind`, `get-intrinsic`, `object-inspect` [`b78336b`](https://github.com/ljharb/side-channel/commit/b78336b886172d1b457d414ac9e28de8c5fecc78) +- [Tests] replace `aud` with `npm audit` [`ee3ab46`](https://github.com/ljharb/side-channel/commit/ee3ab4690d954311c35115651bcfd45edd205aa1) +- [Dev Deps] add missing peer dep [`c03e21a`](https://github.com/ljharb/side-channel/commit/c03e21a7def3b67cdc15ae22316884fefcb2f6a8) + +## [v1.0.6](https://github.com/ljharb/side-channel/compare/v1.0.5...v1.0.6) - 2024-02-29 + +### Commits + +- add types [`9beef66`](https://github.com/ljharb/side-channel/commit/9beef6643e6d717ea57bedabf86448123a7dd9e9) +- [meta] simplify `exports` [`4334cf9`](https://github.com/ljharb/side-channel/commit/4334cf9df654151504c383b62a2f9ebdc8d9d5ac) +- [Deps] update `call-bind` [`d6043c4`](https://github.com/ljharb/side-channel/commit/d6043c4d8f4d7be9037dd0f0419c7a2e0e39ec6a) +- [Dev Deps] update `tape` [`6aca376`](https://github.com/ljharb/side-channel/commit/6aca3761868dc8cd5ff7fd9799bf6b95e09a6eb0) + +## [v1.0.5](https://github.com/ljharb/side-channel/compare/v1.0.4...v1.0.5) - 2024-02-06 + +### Commits + +- [actions] reuse common workflows [`3d2e1ff`](https://github.com/ljharb/side-channel/commit/3d2e1ffd16dd6eaaf3e40ff57951f840d2d63c04) +- [meta] use `npmignore` to autogenerate an npmignore file [`04296ea`](https://github.com/ljharb/side-channel/commit/04296ea17d1544b0a5d20fd5bfb31aa4f6513eb9) +- [meta] add `.editorconfig`; add `eclint` [`130f0a6`](https://github.com/ljharb/side-channel/commit/130f0a6adbc04d385c7456a601d38344dce3d6a9) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `safe-publish-latest`, `tape` [`d480c2f`](https://github.com/ljharb/side-channel/commit/d480c2fbe757489ae9b4275491ffbcc3ac4725e9) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`ecbe70e`](https://github.com/ljharb/side-channel/commit/ecbe70e53a418234081a77971fec1fdfae20c841) +- [actions] update rebase action [`75240b9`](https://github.com/ljharb/side-channel/commit/75240b9963b816e8846400d2287cb68f88c7fba7) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `npmignore`, `tape` [`ae8d281`](https://github.com/ljharb/side-channel/commit/ae8d281572430099109870fd9430d2ca3f320b8d) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`7125b88`](https://github.com/ljharb/side-channel/commit/7125b885fd0eacad4fee9b073b72d14065ece278) +- [Deps] update `call-bind`, `get-intrinsic`, `object-inspect` [`82577c9`](https://github.com/ljharb/side-channel/commit/82577c9796304519139a570f82a317211b5f3b86) +- [Deps] update `call-bind`, `get-intrinsic`, `object-inspect` [`550aadf`](https://github.com/ljharb/side-channel/commit/550aadf20475a6081fd70304cc54f77259a5c8a8) +- [Tests] increase coverage [`5130877`](https://github.com/ljharb/side-channel/commit/5130877a7b27c862e64e6d1c12a178b28808859d) +- [Deps] update `get-intrinsic`, `object-inspect` [`ba0194c`](https://github.com/ljharb/side-channel/commit/ba0194c505b1a8a0427be14cadd5b8a46d4d01b8) +- [meta] add missing `engines.node` [`985fd24`](https://github.com/ljharb/side-channel/commit/985fd249663cb06617a693a94fe08cad12f5cb70) +- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`40227a8`](https://github.com/ljharb/side-channel/commit/40227a87b01709ad2c0eebf87eb4223a800099b9) +- [Deps] update `get-intrinsic` [`a989b40`](https://github.com/ljharb/side-channel/commit/a989b4024958737ae7be9fbffdeff2078f33a0fd) +- [Deps] update `object-inspect` [`aec42d2`](https://github.com/ljharb/side-channel/commit/aec42d2ec541a31aaa02475692c87d489237d9a3) + +## [v1.0.4](https://github.com/ljharb/side-channel/compare/v1.0.3...v1.0.4) - 2020-12-29 + +### Commits + +- [Tests] migrate tests to Github Actions [`10909cb`](https://github.com/ljharb/side-channel/commit/10909cbf8ce9c0bf96f604cf13d7ffd5a22c2d40) +- [Refactor] Use a linked list rather than an array, and move accessed nodes to the beginning [`195613f`](https://github.com/ljharb/side-channel/commit/195613f28b5c1e6072ef0b61b5beebaf2b6a304e) +- [meta] do not publish github action workflow files [`290ec29`](https://github.com/ljharb/side-channel/commit/290ec29cd21a60585145b4a7237ec55228c52c27) +- [Tests] run `nyc` on all tests; use `tape` runner [`ea6d030`](https://github.com/ljharb/side-channel/commit/ea6d030ff3fe6be2eca39e859d644c51ecd88869) +- [actions] add "Allow Edits" workflow [`d464d8f`](https://github.com/ljharb/side-channel/commit/d464d8fe52b5eddf1504a0ed97f0941a90f32c15) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog` [`02daca8`](https://github.com/ljharb/side-channel/commit/02daca87c6809821c97be468d1afa2f5ef447383) +- [Refactor] use `call-bind` and `get-intrinsic` instead of `es-abstract` [`e09d481`](https://github.com/ljharb/side-channel/commit/e09d481528452ebafa5cdeae1af665c35aa2deee) +- [Deps] update `object.assign` [`ee83aa8`](https://github.com/ljharb/side-channel/commit/ee83aa81df313b5e46319a63adb05cf0c179079a) +- [actions] update rebase action to use checkout v2 [`7726b0b`](https://github.com/ljharb/side-channel/commit/7726b0b058b632fccea709f58960871defaaa9d7) + +## [v1.0.3](https://github.com/ljharb/side-channel/compare/v1.0.2...v1.0.3) - 2020-08-23 + +### Commits + +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`1f10561`](https://github.com/ljharb/side-channel/commit/1f105611ef3acf32dec8032ae5c0baa5e56bb868) +- [Deps] update `es-abstract`, `object-inspect` [`bc20159`](https://github.com/ljharb/side-channel/commit/bc201597949a505e37cef9eaf24c7010831e6f03) +- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`b9b2b22`](https://github.com/ljharb/side-channel/commit/b9b2b225f9e0ea72a6ec2b89348f0bd690bc9ed1) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`7055ab4`](https://github.com/ljharb/side-channel/commit/7055ab4de0860606efd2003674a74f1fe6ebc07e) +- [Dev Deps] update `auto-changelog`; add `aud` [`d278c37`](https://github.com/ljharb/side-channel/commit/d278c37d08227be4f84aa769fcd919e73feeba40) +- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`3bcf982`](https://github.com/ljharb/side-channel/commit/3bcf982faa122745b39c33ce83d32fdf003741c6) +- [Tests] only audit prod deps [`18d01c4`](https://github.com/ljharb/side-channel/commit/18d01c4015b82a3d75044c4d5ba7917b2eac01ec) +- [Deps] update `es-abstract` [`6ab096d`](https://github.com/ljharb/side-channel/commit/6ab096d9de2b482cf5e0717e34e212f5b2b9bc9a) +- [Dev Deps] update `tape` [`9dc174c`](https://github.com/ljharb/side-channel/commit/9dc174cc651dfd300b4b72da936a0a7eda5f9452) +- [Deps] update `es-abstract` [`431d0f0`](https://github.com/ljharb/side-channel/commit/431d0f0ff11fbd2ae6f3115582a356d3a1cfce82) +- [Deps] update `es-abstract` [`49869fd`](https://github.com/ljharb/side-channel/commit/49869fd323bf4453f0ba515c0fb265cf5ab7b932) +- [meta] Add package.json to package's exports [`77d9cdc`](https://github.com/ljharb/side-channel/commit/77d9cdceb2a9e47700074f2ae0c0a202e7dac0d4) + +## [v1.0.2](https://github.com/ljharb/side-channel/compare/v1.0.1...v1.0.2) - 2019-12-20 + +### Commits + +- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`4a526df`](https://github.com/ljharb/side-channel/commit/4a526df44e4701566ed001ec78546193f818b082) +- [Deps] update `es-abstract` [`d4f6e62`](https://github.com/ljharb/side-channel/commit/d4f6e629b6fb93a07415db7f30d3c90fd7f264fe) + +## [v1.0.1](https://github.com/ljharb/side-channel/compare/v1.0.0...v1.0.1) - 2019-12-01 + +### Commits + +- [Fix] add missing "exports" [`d212907`](https://github.com/ljharb/side-channel/commit/d2129073abf0701a5343bf28aa2145617604dc2e) + +## v1.0.0 - 2019-12-01 + +### Commits + +- Initial implementation [`dbebd3a`](https://github.com/ljharb/side-channel/commit/dbebd3a4b5ed64242f9a6810efe7c4214cd8cde4) +- Initial tests [`73bdefe`](https://github.com/ljharb/side-channel/commit/73bdefe568c9076cf8c0b8719bc2141aec0e19b8) +- Initial commit [`43c03e1`](https://github.com/ljharb/side-channel/commit/43c03e1c2849ec50a87b7a5cd76238a62b0b8770) +- npm init [`5c090a7`](https://github.com/ljharb/side-channel/commit/5c090a765d66a5527d9889b89aeff78dee91348c) +- [meta] add `auto-changelog` [`a5c4e56`](https://github.com/ljharb/side-channel/commit/a5c4e5675ec02d5eb4d84b4243aeea2a1d38fbec) +- [actions] add automatic rebasing / merge commit blocking [`bab1683`](https://github.com/ljharb/side-channel/commit/bab1683d8f9754b086e94397699fdc645e0d7077) +- [meta] add `funding` field; create FUNDING.yml [`63d7aea`](https://github.com/ljharb/side-channel/commit/63d7aeaf34f5650650ae97ca4b9fae685bd0937c) +- [Tests] add `npm run lint` [`46a5a81`](https://github.com/ljharb/side-channel/commit/46a5a81705cd2664f83df232c01dbbf2ee952885) +- Only apps should have lockfiles [`8b16b03`](https://github.com/ljharb/side-channel/commit/8b16b0305f00895d90c4e2e5773c854cfea0e448) +- [meta] add `safe-publish-latest` [`2f098ef`](https://github.com/ljharb/side-channel/commit/2f098ef092a39399cfe548b19a1fc03c2fd2f490) diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/LICENSE new file mode 100644 index 0000000..3900dd7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/README.md new file mode 100644 index 0000000..cc7e103 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/README.md @@ -0,0 +1,61 @@ +# side-channel [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Store information about any JS value in a side channel. Uses WeakMap if available. + +Warning: in an environment that lacks `WeakMap`, this implementation will leak memory until you `delete` the `key`. + +## Getting started + +```sh +npm install --save side-channel +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getSideChannel = require('side-channel'); + +const channel = getSideChannel(); + +const key = {}; +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); + +channel.set(key, 42); + +channel.assert(key); // does not throw +assert.equal(channel.has(key), true); +assert.equal(channel.get(key), 42); + +channel.delete(key); +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/side-channel +[npm-version-svg]: https://versionbadg.es/ljharb/side-channel.svg +[deps-svg]: https://david-dm.org/ljharb/side-channel.svg +[deps-url]: https://david-dm.org/ljharb/side-channel +[dev-deps-svg]: https://david-dm.org/ljharb/side-channel/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/side-channel#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/side-channel.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/side-channel.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/side-channel.svg +[downloads-url]: https://npm-stat.com/charts.html?package=side-channel +[codecov-image]: https://codecov.io/gh/ljharb/side-channel/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel +[actions-url]: https://github.com/ljharb/side-channel/actions diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/index.d.ts new file mode 100644 index 0000000..18c6317 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/index.d.ts @@ -0,0 +1,14 @@ +import getSideChannelList from 'side-channel-list'; +import getSideChannelMap from 'side-channel-map'; +import getSideChannelWeakMap from 'side-channel-weakmap'; + +declare namespace getSideChannel { + type Channel = + | getSideChannelList.Channel + | ReturnType, false>> + | ReturnType, false>>; +} + +declare function getSideChannel(): getSideChannel.Channel; + +export = getSideChannel; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/index.js new file mode 100644 index 0000000..a8a9b05 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/index.js @@ -0,0 +1,43 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); +var inspect = require('object-inspect'); +var getSideChannelList = require('side-channel-list'); +var getSideChannelMap = require('side-channel-map'); +var getSideChannelWeakMap = require('side-channel-weakmap'); + +var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList; + +/** @type {import('.')} */ +module.exports = function getSideChannel() { + /** @typedef {ReturnType} Channel */ + + /** @type {Channel | undefined} */ var $channelData; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + return !!$channelData && $channelData['delete'](key); + }, + get: function (key) { + return $channelData && $channelData.get(key); + }, + has: function (key) { + return !!$channelData && $channelData.has(key); + }, + set: function (key, value) { + if (!$channelData) { + $channelData = makeChannel(); + } + + $channelData.set(key, value); + } + }; + // @ts-expect-error TODO: figure out why this is erroring + return channel; +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/package.json new file mode 100644 index 0000000..30fa42c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/package.json @@ -0,0 +1,85 @@ +{ + "name": "side-channel", + "version": "1.1.0", + "description": "Store information about any JS value in a side channel. Uses WeakMap if available.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/side-channel.git" + }, + "keywords": [ + "weakmap", + "map", + "side", + "channel", + "metadata" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/side-channel/issues" + }, + "homepage": "https://github.com/ljharb/side-channel#readme", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.6.5", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/test/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/test/index.js new file mode 100644 index 0000000..bd1e7c2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/test/index.js @@ -0,0 +1,104 @@ +'use strict'; + +var test = require('tape'); + +var getSideChannel = require('../'); + +test('getSideChannel', function (t) { + t.test('export', function (st) { + st.equal(typeof getSideChannel, 'function', 'is a function'); + + st.equal(getSideChannel.length, 0, 'takes no arguments'); + + var channel = getSideChannel(); + st.ok(channel, 'is truthy'); + st.equal(typeof channel, 'object', 'is an object'); + st.end(); + }); + + t.test('assert', function (st) { + var channel = getSideChannel(); + st['throws']( + function () { channel.assert({}); }, + TypeError, + 'nonexistent value throws' + ); + + var o = {}; + channel.set(o, 'data'); + st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); + + st.end(); + }); + + t.test('has', function (st) { + var channel = getSideChannel(); + /** @type {unknown[]} */ var o = []; + + st.equal(channel.has(o), false, 'nonexistent value yields false'); + + channel.set(o, 'foo'); + st.equal(channel.has(o), true, 'existent value yields true'); + + st.equal(channel.has('abc'), false, 'non object value non existent yields false'); + + channel.set('abc', 'foo'); + st.equal(channel.has('abc'), true, 'non object value that exists yields true'); + + st.end(); + }); + + t.test('get', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); + + var data = {}; + channel.set(o, data); + st.equal(channel.get(o), data, '"get" yields data set by "set"'); + + st.end(); + }); + + t.test('set', function (st) { + var channel = getSideChannel(); + var o = function () {}; + st.equal(channel.get(o), undefined, 'value not set'); + + channel.set(o, 42); + st.equal(channel.get(o), 42, 'value was set'); + + channel.set(o, Infinity); + st.equal(channel.get(o), Infinity, 'value was set again'); + + var o2 = {}; + channel.set(o2, 17); + st.equal(channel.get(o), Infinity, 'o is not modified'); + st.equal(channel.get(o2), 17, 'o2 is set'); + + channel.set(o, 14); + st.equal(channel.get(o), 14, 'o is modified'); + st.equal(channel.get(o2), 17, 'o2 is not modified'); + + st.end(); + }); + + t.test('delete', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel['delete']({}), false, 'nonexistent value yields false'); + + channel.set(o, 42); + st.equal(channel.has(o), true, 'value is set'); + + st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); + + st.equal(channel['delete'](o), true, 'deleted value yields true'); + + st.equal(channel.has(o), false, 'value is no longer set'); + + st.end(); + }); + + t.end(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/tsconfig.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/tsconfig.json new file mode 100644 index 0000000..d9a6668 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/side-channel/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/LICENSE new file mode 100644 index 0000000..1e0b0c1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Alex Brazier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/README.md new file mode 100644 index 0000000..ec17794 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/README.md @@ -0,0 +1,82 @@ +# simple-update-notifier [![GitHub stars](https://img.shields.io/github/stars/alexbrazier/simple-update-notifier?label=Star%20Project&style=social)](https://github.com/alexbrazier/simple-update-notifier/stargazers) + +[![CI](https://github.com/alexbrazier/simple-update-notifier/workflows/Build%20and%20Deploy/badge.svg)](https://github.com/alexbrazier/simple-update-notifier/actions) +[![Dependencies](https://img.shields.io/librariesio/release/npm/simple-update-notifier)](https://www.npmjs.com/package/simple-update-notifier?activeTab=dependencies) +[![npm](https://img.shields.io/npm/v/simple-update-notifier)](https://www.npmjs.com/package/simple-update-notifier) +[![npm bundle size](https://img.shields.io/bundlephobia/min/simple-update-notifier)](https://bundlephobia.com/result?p=simple-update-notifier) +[![npm downloads](https://img.shields.io/npm/dw/simple-update-notifier)](https://www.npmjs.com/package/simple-update-notifier) +[![License](https://img.shields.io/npm/l/simple-update-notifier)](./LICENSE) + +Simple update notifier to check for npm updates for cli applications. + +Demo in terminal showing an update is required + +Checks for updates for an npm module and outputs to the command line if there is one available. The result is cached for the specified time so it doesn't check every time the app runs. + +## Install + +```bash +npm install simple-update-notifier +OR +yarn add simple-update-notifier +``` + +## Usage + +```js +import updateNotifier from 'simple-update-notifier'; +import packageJson from './package.json' assert { type: 'json' }; + +updateNotifier({ pkg: packageJson }); +``` + +### Options + +#### pkg + +Type: `object` + +##### name + +_Required_\ +Type: `string` + +##### version + +_Required_\ +Type: `string` + +#### updateCheckInterval + +Type: `number`\ +Default: `1000 * 60 * 60 * 24` _(1 day)_ + +How often to check for updates. + +#### shouldNotifyInNpmScript + +Type: `boolean`\ +Default: `false` + +Allows notification to be shown when running as an npm script. + +#### distTag + +Type: `string`\ +Default: `'latest'` + +Which [dist-tag](https://docs.npmjs.com/adding-dist-tags-to-packages) to use to find the latest version. + +#### alwaysRun + +Type: `boolean`\ +Default: `false` + +When set, `updateCheckInterval` will not be respected and a check for an update will always be performed. + +#### debug + +Type: `boolean`\ +Default: `false` + +When set, logs explaining the decision will be output to `stderr` whenever the module opts to not print an update notification diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/build/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/build/index.d.ts new file mode 100644 index 0000000..60f53e0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/build/index.d.ts @@ -0,0 +1,13 @@ +interface IUpdate { + pkg: { + name: string; + version: string; + }; + updateCheckInterval?: number; + shouldNotifyInNpmScript?: boolean; + distTag?: string; + alwaysRun?: boolean; + debug?: boolean; +} +declare const simpleUpdateNotifier: (args: IUpdate) => Promise; +export { simpleUpdateNotifier as default }; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/build/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/build/index.js new file mode 100644 index 0000000..090f9df --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/build/index.js @@ -0,0 +1,210 @@ +'use strict'; + +var process$1 = require('process'); +var semver = require('semver'); +var os = require('os'); +var path = require('path'); +var fs = require('fs'); +var https = require('https'); + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +var packageJson = process$1.env.npm_package_json; +var userAgent = process$1.env.npm_config_user_agent; +var isNpm6 = Boolean(userAgent && userAgent.startsWith('npm')); +var isNpm7 = Boolean(packageJson && packageJson.endsWith('package.json')); +var isNpm = isNpm6 || isNpm7; +var isYarn = Boolean(userAgent && userAgent.startsWith('yarn')); +var isNpmOrYarn = isNpm || isYarn; + +var homeDirectory = os.homedir(); +var configDir = process.env.XDG_CONFIG_HOME || + path.join(homeDirectory, '.config', 'simple-update-notifier'); +var getConfigFile = function (packageName) { + return path.join(configDir, "".concat(packageName.replace('@', '').replace('/', '__'), ".json")); +}; +var createConfigDir = function () { + if (!fs.existsSync(configDir)) { + fs.mkdirSync(configDir, { recursive: true }); + } +}; +var getLastUpdate = function (packageName) { + var configFile = getConfigFile(packageName); + try { + if (!fs.existsSync(configFile)) { + return undefined; + } + var file = JSON.parse(fs.readFileSync(configFile, 'utf8')); + return file.lastUpdateCheck; + } + catch (_a) { + return undefined; + } +}; +var saveLastUpdate = function (packageName) { + var configFile = getConfigFile(packageName); + fs.writeFileSync(configFile, JSON.stringify({ lastUpdateCheck: new Date().getTime() })); +}; + +var getDistVersion = function (packageName, distTag) { return __awaiter(void 0, void 0, void 0, function () { + var url; + return __generator(this, function (_a) { + url = "https://registry.npmjs.org/-/package/".concat(packageName, "/dist-tags"); + return [2 /*return*/, new Promise(function (resolve, reject) { + https + .get(url, function (res) { + var body = ''; + res.on('data', function (chunk) { return (body += chunk); }); + res.on('end', function () { + try { + var json = JSON.parse(body); + var version = json[distTag]; + if (!version) { + reject(new Error('Error getting version')); + } + resolve(version); + } + catch (_a) { + reject(new Error('Could not parse version response')); + } + }); + }) + .on('error', function (err) { return reject(err); }); + })]; + }); +}); }; + +var hasNewVersion = function (_a) { + var pkg = _a.pkg, _b = _a.updateCheckInterval, updateCheckInterval = _b === void 0 ? 1000 * 60 * 60 * 24 : _b, _c = _a.distTag, distTag = _c === void 0 ? 'latest' : _c, alwaysRun = _a.alwaysRun, debug = _a.debug; + return __awaiter(void 0, void 0, void 0, function () { + var lastUpdateCheck, latestVersion; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + createConfigDir(); + lastUpdateCheck = getLastUpdate(pkg.name); + if (!(alwaysRun || + !lastUpdateCheck || + lastUpdateCheck < new Date().getTime() - updateCheckInterval)) return [3 /*break*/, 2]; + return [4 /*yield*/, getDistVersion(pkg.name, distTag)]; + case 1: + latestVersion = _d.sent(); + saveLastUpdate(pkg.name); + if (semver.gt(latestVersion, pkg.version)) { + return [2 /*return*/, latestVersion]; + } + else if (debug) { + console.error("Latest version (".concat(latestVersion, ") not newer than current version (").concat(pkg.version, ")")); + } + return [3 /*break*/, 3]; + case 2: + if (debug) { + console.error("Too recent to check for a new update. simpleUpdateNotifier() interval set to ".concat(updateCheckInterval, "ms but only ").concat(new Date().getTime() - lastUpdateCheck, "ms since last check.")); + } + _d.label = 3; + case 3: return [2 /*return*/, false]; + } + }); + }); +}; + +var borderedText = function (text) { + var lines = text.split('\n'); + var width = Math.max.apply(Math, lines.map(function (l) { return l.length; })); + var res = ["\u250C".concat('─'.repeat(width + 2), "\u2510")]; + for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) { + var line = lines_1[_i]; + res.push("\u2502 ".concat(line.padEnd(width), " \u2502")); + } + res.push("\u2514".concat('─'.repeat(width + 2), "\u2518")); + return res.join('\n'); +}; + +var simpleUpdateNotifier = function (args) { return __awaiter(void 0, void 0, void 0, function () { + var latestVersion, err_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!args.alwaysRun && + (!process.stdout.isTTY || (isNpmOrYarn && !args.shouldNotifyInNpmScript))) { + if (args.debug) { + console.error('Opting out of running simpleUpdateNotifier()'); + } + return [2 /*return*/]; + } + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, hasNewVersion(args)]; + case 2: + latestVersion = _a.sent(); + if (latestVersion) { + console.error(borderedText("New version of ".concat(args.pkg.name, " available!\nCurrent Version: ").concat(args.pkg.version, "\nLatest Version: ").concat(latestVersion))); + } + return [3 /*break*/, 4]; + case 3: + err_1 = _a.sent(); + // Catch any network errors or cache writing errors so module doesn't cause a crash + if (args.debug && err_1 instanceof Error) { + console.error('Unexpected error in simpleUpdateNotifier():', err_1); + } + return [3 /*break*/, 4]; + case 4: return [2 /*return*/]; + } + }); +}); }; + +module.exports = simpleUpdateNotifier; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/package.json new file mode 100644 index 0000000..4d710a7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/package.json @@ -0,0 +1,100 @@ +{ + "name": "simple-update-notifier", + "version": "2.0.0", + "description": "Simple update notifier to check for npm updates for cli applications", + "main": "build/index.js", + "types": "build/index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/alexbrazier/simple-update-notifier.git" + }, + "homepage": "https://github.com/alexbrazier/simple-update-notifier.git", + "author": "alexbrazier", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "jest src --noStackTrace", + "build": "rollup -c rollup.config.js --bundleConfigAsCjs", + "prettier:check": "prettier --check src/**/*.ts", + "prettier": "prettier --write src/**/*.ts", + "eslint": "eslint src/**/*.ts", + "lint": "yarn prettier:check && yarn eslint", + "prepare": "yarn lint && yarn build", + "release": "release-it" + }, + "dependencies": { + "semver": "^7.5.3" + }, + "devDependencies": { + "@babel/preset-env": "^7.22.5", + "@babel/preset-typescript": "^7.22.5", + "@release-it/conventional-changelog": "^5.1.1", + "@types/jest": "^29.5.2", + "@types/node": "^20.3.1", + "@typescript-eslint/eslint-plugin": "^5.60.0", + "@typescript-eslint/parser": "^5.60.0", + "eslint": "^8.43.0", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-prettier": "^4.0.0", + "jest": "^29.5.0", + "prettier": "^2.8.8", + "release-it": "^15.11.0", + "rollup": "^3.25.2", + "rollup-plugin-ts": "^3.2.0", + "typescript": "^5.1.3" + }, + "resolutions": { + "semver": "^7.5.3" + }, + "publishConfig": { + "registry": "https://registry.npmjs.org/" + }, + "files": [ + "build", + "src" + ], + "release-it": { + "git": { + "commitMessage": "chore: release ${version}", + "tagName": "v${version}" + }, + "npm": { + "publish": true + }, + "github": { + "release": true + }, + "plugins": { + "@release-it/conventional-changelog": { + "preset": "angular", + "infile": "CHANGELOG.md" + } + } + }, + "eslintConfig": { + "plugins": [ + "@typescript-eslint", + "prettier" + ], + "extends": [ + "prettier", + "eslint:recommended", + "plugin:@typescript-eslint/recommended" + ], + "parser": "@typescript-eslint/parser", + "rules": { + "prettier/prettier": [ + "error", + { + "quoteProps": "consistent", + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "es5", + "useTabs": false + } + ] + } + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/borderedText.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/borderedText.ts new file mode 100644 index 0000000..7145ac2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/borderedText.ts @@ -0,0 +1,12 @@ +const borderedText = (text: string) => { + const lines = text.split('\n'); + const width = Math.max(...lines.map((l) => l.length)); + const res = [`┌${'─'.repeat(width + 2)}┐`]; + for (const line of lines) { + res.push(`│ ${line.padEnd(width)} │`); + } + res.push(`└${'─'.repeat(width + 2)}┘`); + return res.join('\n'); +}; + +export default borderedText; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/cache.spec.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/cache.spec.ts new file mode 100644 index 0000000..49e1cb2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/cache.spec.ts @@ -0,0 +1,17 @@ +import { createConfigDir, getLastUpdate, saveLastUpdate } from './cache'; + +createConfigDir(); + +jest.useFakeTimers().setSystemTime(new Date('2022-01-01')); + +const fakeTime = new Date('2022-01-01').getTime(); + +test('can save update then get the update details', () => { + saveLastUpdate('test'); + expect(getLastUpdate('test')).toBe(fakeTime); +}); + +test('prefixed module can save update then get the update details', () => { + saveLastUpdate('@alexbrazier/test'); + expect(getLastUpdate('@alexbrazier/test')).toBe(fakeTime); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/cache.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/cache.ts new file mode 100644 index 0000000..e11deba --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/cache.ts @@ -0,0 +1,44 @@ +import os from 'os'; +import path from 'path'; +import fs from 'fs'; + +const homeDirectory = os.homedir(); +const configDir = + process.env.XDG_CONFIG_HOME || + path.join(homeDirectory, '.config', 'simple-update-notifier'); + +const getConfigFile = (packageName: string) => { + return path.join( + configDir, + `${packageName.replace('@', '').replace('/', '__')}.json` + ); +}; + +export const createConfigDir = () => { + if (!fs.existsSync(configDir)) { + fs.mkdirSync(configDir, { recursive: true }); + } +}; + +export const getLastUpdate = (packageName: string) => { + const configFile = getConfigFile(packageName); + + try { + if (!fs.existsSync(configFile)) { + return undefined; + } + const file = JSON.parse(fs.readFileSync(configFile, 'utf8')); + return file.lastUpdateCheck as number; + } catch { + return undefined; + } +}; + +export const saveLastUpdate = (packageName: string) => { + const configFile = getConfigFile(packageName); + + fs.writeFileSync( + configFile, + JSON.stringify({ lastUpdateCheck: new Date().getTime() }) + ); +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/getDistVersion.spec.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/getDistVersion.spec.ts new file mode 100644 index 0000000..b78a42e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/getDistVersion.spec.ts @@ -0,0 +1,35 @@ +import Stream from 'stream'; +import https from 'https'; +import getDistVersion from './getDistVersion'; + +jest.mock('https', () => ({ + get: jest.fn(), +})); + +test('Valid response returns version', async () => { + const st = new Stream(); + (https.get as jest.Mock).mockImplementation((url, cb) => { + cb(st); + + st.emit('data', '{"latest":"1.0.0"}'); + st.emit('end'); + }); + + const version = await getDistVersion('test', 'latest'); + + expect(version).toEqual('1.0.0'); +}); + +test('Invalid response throws error', async () => { + const st = new Stream(); + (https.get as jest.Mock).mockImplementation((url, cb) => { + cb(st); + + st.emit('data', 'some invalid json'); + st.emit('end'); + }); + + expect(getDistVersion('test', 'latest')).rejects.toThrow( + 'Could not parse version response' + ); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/getDistVersion.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/getDistVersion.ts new file mode 100644 index 0000000..d474e1f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/getDistVersion.ts @@ -0,0 +1,29 @@ +import https from 'https'; + +const getDistVersion = async (packageName: string, distTag: string) => { + const url = `https://registry.npmjs.org/-/package/${packageName}/dist-tags`; + + return new Promise((resolve, reject) => { + https + .get(url, (res) => { + let body = ''; + + res.on('data', (chunk) => (body += chunk)); + res.on('end', () => { + try { + const json = JSON.parse(body); + const version = json[distTag]; + if (!version) { + reject(new Error('Error getting version')); + } + resolve(version); + } catch { + reject(new Error('Could not parse version response')); + } + }); + }) + .on('error', (err) => reject(err)); + }); +}; + +export default getDistVersion; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/hasNewVersion.spec.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/hasNewVersion.spec.ts new file mode 100644 index 0000000..af7ab22 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/hasNewVersion.spec.ts @@ -0,0 +1,82 @@ +import hasNewVersion from './hasNewVersion'; +import { getLastUpdate } from './cache'; +import getDistVersion from './getDistVersion'; + +jest.mock('./getDistVersion', () => jest.fn().mockReturnValue('1.0.0')); +jest.mock('./cache', () => ({ + getLastUpdate: jest.fn().mockReturnValue(undefined), + createConfigDir: jest.fn(), + saveLastUpdate: jest.fn(), +})); + +const pkg = { name: 'test', version: '1.0.0' }; + +afterEach(() => jest.clearAllMocks()); + +const defaultArgs = { + pkg, + shouldNotifyInNpmScript: true, + alwaysRun: true, +}; + +test('it should not trigger update for same version', async () => { + const newVersion = await hasNewVersion(defaultArgs); + + expect(newVersion).toBe(false); +}); + +test('it should trigger update for patch version bump', async () => { + (getDistVersion as jest.Mock).mockReturnValue('1.0.1'); + + const newVersion = await hasNewVersion(defaultArgs); + + expect(newVersion).toBe('1.0.1'); +}); + +test('it should trigger update for minor version bump', async () => { + (getDistVersion as jest.Mock).mockReturnValue('1.1.0'); + + const newVersion = await hasNewVersion(defaultArgs); + + expect(newVersion).toBe('1.1.0'); +}); + +test('it should trigger update for major version bump', async () => { + (getDistVersion as jest.Mock).mockReturnValue('2.0.0'); + + const newVersion = await hasNewVersion(defaultArgs); + + expect(newVersion).toBe('2.0.0'); +}); + +test('it should not trigger update if version is lower', async () => { + (getDistVersion as jest.Mock).mockReturnValue('0.0.9'); + + const newVersion = await hasNewVersion(defaultArgs); + + expect(newVersion).toBe(false); +}); + +it('should trigger update check if last update older than config', async () => { + const TWO_WEEKS = new Date().getTime() - 1000 * 60 * 60 * 24 * 14; + (getLastUpdate as jest.Mock).mockReturnValue(TWO_WEEKS); + const newVersion = await hasNewVersion({ + pkg, + shouldNotifyInNpmScript: true, + }); + + expect(newVersion).toBe(false); + expect(getDistVersion).toHaveBeenCalled(); +}); + +it('should not trigger update check if last update is too recent', async () => { + const TWELVE_HOURS = new Date().getTime() - 1000 * 60 * 60 * 12; + (getLastUpdate as jest.Mock).mockReturnValue(TWELVE_HOURS); + const newVersion = await hasNewVersion({ + pkg, + shouldNotifyInNpmScript: true, + }); + + expect(newVersion).toBe(false); + expect(getDistVersion).not.toHaveBeenCalled(); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/hasNewVersion.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/hasNewVersion.ts new file mode 100644 index 0000000..31d5069 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/hasNewVersion.ts @@ -0,0 +1,40 @@ +import semver from 'semver'; +import { createConfigDir, getLastUpdate, saveLastUpdate } from './cache'; +import getDistVersion from './getDistVersion'; +import { IUpdate } from './types'; + +const hasNewVersion = async ({ + pkg, + updateCheckInterval = 1000 * 60 * 60 * 24, + distTag = 'latest', + alwaysRun, + debug, +}: IUpdate) => { + createConfigDir(); + const lastUpdateCheck = getLastUpdate(pkg.name); + if ( + alwaysRun || + !lastUpdateCheck || + lastUpdateCheck < new Date().getTime() - updateCheckInterval + ) { + const latestVersion = await getDistVersion(pkg.name, distTag); + saveLastUpdate(pkg.name); + if (semver.gt(latestVersion, pkg.version)) { + return latestVersion; + } else if (debug) { + console.error( + `Latest version (${latestVersion}) not newer than current version (${pkg.version})` + ); + } + } else if (debug) { + console.error( + `Too recent to check for a new update. simpleUpdateNotifier() interval set to ${updateCheckInterval}ms but only ${ + new Date().getTime() - lastUpdateCheck + }ms since last check.` + ); + } + + return false; +}; + +export default hasNewVersion; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/index.spec.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/index.spec.ts new file mode 100644 index 0000000..98ffb5a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/index.spec.ts @@ -0,0 +1,27 @@ +import simpleUpdateNotifier from '.'; +import hasNewVersion from './hasNewVersion'; + +const consoleSpy = jest.spyOn(console, 'error'); + +jest.mock('./hasNewVersion', () => jest.fn().mockResolvedValue('2.0.0')); + +beforeEach(jest.clearAllMocks); + +test('it logs message if update is available', async () => { + await simpleUpdateNotifier({ + pkg: { name: 'test', version: '1.0.0' }, + alwaysRun: true, + }); + + expect(consoleSpy).toHaveBeenCalledTimes(1); +}); + +test('it does not log message if update is not available', async () => { + (hasNewVersion as jest.Mock).mockResolvedValue(false); + await simpleUpdateNotifier({ + pkg: { name: 'test', version: '2.0.0' }, + alwaysRun: true, + }); + + expect(consoleSpy).toHaveBeenCalledTimes(0); +}); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/index.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/index.ts new file mode 100644 index 0000000..2b0d2cf --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/index.ts @@ -0,0 +1,34 @@ +import isNpmOrYarn from './isNpmOrYarn'; +import hasNewVersion from './hasNewVersion'; +import { IUpdate } from './types'; +import borderedText from './borderedText'; + +const simpleUpdateNotifier = async (args: IUpdate) => { + if ( + !args.alwaysRun && + (!process.stdout.isTTY || (isNpmOrYarn && !args.shouldNotifyInNpmScript)) + ) { + if (args.debug) { + console.error('Opting out of running simpleUpdateNotifier()'); + } + return; + } + + try { + const latestVersion = await hasNewVersion(args); + if (latestVersion) { + console.error( + borderedText(`New version of ${args.pkg.name} available! +Current Version: ${args.pkg.version} +Latest Version: ${latestVersion}`) + ); + } + } catch (err) { + // Catch any network errors or cache writing errors so module doesn't cause a crash + if (args.debug && err instanceof Error) { + console.error('Unexpected error in simpleUpdateNotifier():', err); + } + } +}; + +export default simpleUpdateNotifier; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/isNpmOrYarn.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/isNpmOrYarn.ts new file mode 100644 index 0000000..ee4c837 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/isNpmOrYarn.ts @@ -0,0 +1,12 @@ +import process from 'process'; + +const packageJson = process.env.npm_package_json; +const userAgent = process.env.npm_config_user_agent; +const isNpm6 = Boolean(userAgent && userAgent.startsWith('npm')); +const isNpm7 = Boolean(packageJson && packageJson.endsWith('package.json')); + +const isNpm = isNpm6 || isNpm7; +const isYarn = Boolean(userAgent && userAgent.startsWith('yarn')); +const isNpmOrYarn = isNpm || isYarn; + +export default isNpmOrYarn; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/types.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/types.ts new file mode 100644 index 0000000..c395eb0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/simple-update-notifier/src/types.ts @@ -0,0 +1,8 @@ +export interface IUpdate { + pkg: { name: string; version: string }; + updateCheckInterval?: number; + shouldNotifyInNpmScript?: boolean; + distTag?: string; + alwaysRun?: boolean; + debug?: boolean; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/LICENSE new file mode 100644 index 0000000..278452c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Weslley Araújo, Andrey Sidorov, Douglas Wilson, and contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/README.md new file mode 100644 index 0000000..e1cb22d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/README.md @@ -0,0 +1,424 @@ +# SQL Escaper + +[![NPM Version](https://img.shields.io/npm/v/sql-escaper.svg?label=&color=70a1ff&logo=npm&logoColor=white)](https://www.npmjs.com/package/sql-escaper) +[![NPM Downloads](https://img.shields.io/npm/dm/sql-escaper.svg?label=&logo=npm&logoColor=white&color=45aaf2)](https://www.npmjs.com/package/sql-escaper) +[![Coverage](https://img.shields.io/codecov/c/github/mysqljs/sql-escaper?label=&logo=codecov&logoColor=white&color=98cc00)](https://app.codecov.io/gh/mysqljs/sql-escaper)
+[![GitHub Workflow Status (Node.js)](https://img.shields.io/github/actions/workflow/status/mysqljs/sql-escaper/ci_node.yml?event=push&label=&branch=main&logo=nodedotjs&logoColor=535c68&color=badc58)](https://github.com/mysqljs/sql-escaper/actions/workflows/ci_node.yml?query=branch%3Amain) +[![GitHub Workflow Status (Bun)](https://img.shields.io/github/actions/workflow/status/mysqljs/sql-escaper/ci_bun.yml?event=push&label=&branch=main&logo=bun&logoColor=ffffff&color=f368e0)](https://github.com/mysqljs/sql-escaper/actions/workflows/ci_bun.yml?query=branch%3Amain) +[![GitHub Workflow Status (Deno)](https://img.shields.io/github/actions/workflow/status/mysqljs/sql-escaper/ci_deno.yml?event=push&label=&branch=main&logo=deno&logoColor=ffffff&color=079992)](https://github.com/mysqljs/sql-escaper/actions/workflows/ci_deno.yml?query=branch%3Amain) + +## Motivation + +**SQL Escaper** is a rework of [**sqlstring**](https://github.com/mysqljs/sqlstring) (created by [**Douglas Wilson**](https://github.com/dougwilson)), by using an **AST**-based approach to parse and format SQL queries while maintaining its same API. + +### Rework includes: + +- **TypeScript** by default. +- Support for `Uint8Array` and `BigInt`. +- Support for both **CJS** and **ESM** exports. +- Up to [**~40% faster**](#performance) compared to **sqlstring**. +- Distinguishes when a keyword is used as value. +- Distinguishes when a column has a keyword name. +- Distinguishes between multiple clauses/keywords in the same query. +- Reasonable conservative support for **Node.js v12** _(**sqlstring** supports **Node.js v0.6**)_. + +> [!TIP] +> +> **SQL Escaper** has the same API as the original [**sqlstring**](https://github.com/mysqljs/sqlstring), so it can be used as a drop-in replacement. If **SQL Escaper** breaks any **API** usage compared to **sqlstring**, please, report it as a bug. [Pull Requests are welcome](./CONTRIBUTING.md). + +> [!IMPORTANT] +> +> 🔐 **SQL Escaper** is intended to fix a potential [**SQL Injection vulnerability**](https://flattsecurity.medium.com/finding-an-unseen-sql-injection-by-bypassing-escape-functions-in-mysqljs-mysql-90b27f6542b4) reported in 2022. By combining the original [**sqlstring**](https://github.com/mysqljs/sqlstring) with [**mysqljs/mysql**](https://github.com/mysqljs/mysql) or [**MySQL2**](https://github.com/sidorares/node-mysql2), objects passed as values could be expanded into **SQL** fragments, potentially allowing attackers to manipulate query structure. See [sidorares/node-mysql2#4051](https://github.com/sidorares/node-mysql2/issues/4051) for details. +> +> Regardless of the `stringifyObjects` value, objects used outside of `SET` or `ON DUPLICATE KEY UPDATE` contexts are always stringified as `'[object Object]'`. This is a security measure to prevent [SQL Injection](https://flattsecurity.medium.com/finding-an-unseen-sql-injection-by-bypassing-escape-functions-in-mysqljs-mysql-90b27f6542b4) and is not interpreted as a breaking change for **sqlstring** usage. + +--- + +## Install + +```bash +# Node.js +npm i sql-escaper +``` + +```bash +# Bun +bun add sql-escaper +``` + +```bash +# Deno +deno add npm:sql-escaper +``` + +--- + +### [MySQL2](https://github.com/sidorares/node-mysql2) + +For **MySQL2**, it already uses **SQL Escaper** as its default escaping library since version `3.17.0`, so you just need to update it to the latest version: + +```bash +npm i mysql2@latest +``` + +### [mysqljs/mysql](https://github.com/mysqljs/mysql) + +You can use an overrides in your _package.json_: + +```json +"dependencies": { + "mysql": "^2.18.1" +}, +"overrides": { + "sqlstring": "npm:sql-escaper" +} +``` + +- Next, clean the `node_modules` and reinstall the dependencies (`npm i`). +- Please, note the minimum supported version of **Node.js** is `12`. + +--- + +## Usage + +For _up-to-date_ documentation, always follow the [**README.md**](https://github.com/mysqljs/sql-escaper?tab=readme-ov-file#readme) in the **GitHub** repository. + +### Quickstart + +```js +import { escape, escapeId, format, raw } from 'sql-escaper'; + +escape("Hello 'World'"); +// => "'Hello \\'World\\''" + +escapeId('table.column'); +// => '`table`.`column`' + +format('SELECT * FROM ?? WHERE id = ?', ['users', 42]); +// => 'SELECT * FROM `users` WHERE id = 42' + +format('INSERT INTO users SET ?', [{ name: 'foo', email: 'bar@test.com' }]); +// => "INSERT INTO users SET `name` = 'foo', `email` = 'bar@test.com'" + +escape(raw('NOW()')); +// => 'NOW()' +``` + +### Import + +#### ES Modules + +```js +import { escape, escapeId, format, raw } from 'sql-escaper'; +``` + +#### CommonJS + +```js +const { escape, escapeId, format, raw } = require('sql-escaper'); +``` + +--- + +## API + +### escape + +Escapes a value for safe use in SQL queries. + +```ts +escape(value: SqlValue, stringifyObjects?: boolean, timezone?: Timezone): string +``` + +```js +escape(undefined); // 'NULL' +escape(null); // 'NULL' +escape(true); // 'true' +escape(false); // 'false' +escape(5); // '5' +escape("Hello 'World"); // "'Hello \\'World'" +``` + +#### Dates + +Dates are converted to `YYYY-MM-DD HH:mm:ss.sss` format: + +```js +escape(new Date(2012, 4, 7, 11, 42, 3, 2)); +// => "'2012-05-07 11:42:03.002'" +``` + +Invalid dates return `NULL`: + +```js +escape(new Date(NaN)); // 'NULL' +``` + +You can specify a timezone: + +```js +const date = new Date(Date.UTC(2012, 4, 7, 11, 42, 3, 2)); + +escape(date, false, 'Z'); // "'2012-05-07 11:42:03.002'" +escape(date, false, '+01'); // "'2012-05-07 12:42:03.002'" +escape(date, false, '-05:00'); // "'2012-05-07 06:42:03.002'" +``` + +#### Buffers + +Buffers are converted to hex strings: + +```js +escape(Buffer.from([0, 1, 254, 255])); +// => "X'0001feff'" +``` + +#### Objects + +Objects with a `toSqlString` method will have that method called: + +```js +escape({ toSqlString: () => 'NOW()' }); +// => 'NOW()' +``` + +Plain objects are converted to `key = value` pairs: + +```js +escape({ a: 'b', c: 'd' }); +// => "`a` = 'b', `c` = 'd'" +``` + +Function properties in objects are ignored: + +```js +escape({ a: 'b', c: () => {} }); +// => "`a` = 'b'" +``` + +When `stringifyObjects` is set to a non-nullish value, objects are stringified instead of being expanded into key-value pairs: + +```js +escape({ a: 'b' }, true); +// => "'[object Object]'" +``` + +#### Arrays + +Arrays are turned into comma-separated lists: + +```js +escape([1, 2, 'c']); +// => "1, 2, 'c'" +``` + +Nested arrays are turned into grouped lists (useful for bulk inserts): + +```js +escape([ + [1, 2, 3], + [4, 5, 6], +]); +// => '(1, 2, 3), (4, 5, 6)' +``` + +--- + +### escapeId + +Escapes an identifier (database, table, or column name). + +```ts +escapeId(value: SqlValue, forbidQualified?: boolean): string +``` + +```js +escapeId('id'); +// => '`id`' + +escapeId('table.column'); +// => '`table`.`column`' + +escapeId('i`d'); +// => '`i``d`' +``` + +Qualified identifiers (with `.`) can be forbidden: + +```js +escapeId('id1.id2', true); +// => '`id1.id2`' +``` + +Arrays are turned into comma-separated identifier lists: + +```js +escapeId(['a', 'b', 't.c']); +// => '`a`, `b`, `t`.`c`' +``` + +--- + +### format + +Formats a SQL query by replacing `?` placeholders with escaped values and `??` with escaped identifiers. + +```ts +format(sql: string, values?: SqlValue | SqlValue[], stringifyObjects?: boolean, timezone?: Timezone): string +``` + +```js +format('SELECT * FROM ?? WHERE id = ?', ['users', 42]); +// => 'SELECT * FROM `users` WHERE id = 42' + +format('? and ?', ['a', 'b']); +// => "'a' and 'b'" +``` + +Triple (or more) question marks are ignored: + +```js +format('? or ??? and ?', ['foo', 'bar', 'fizz', 'buzz']); +// => "'foo' or ??? and 'bar'" +``` + +If no values are provided, the SQL is returned unchanged: + +```js +format('SELECT ??'); +// => 'SELECT ??' +``` + +#### Objects in SET clauses + +When `stringifyObjects` is falsy, objects used in `SET` or `ON DUPLICATE KEY UPDATE` contexts are automatically expanded into `key = value` pairs: + +```js +format('UPDATE users SET ?', [{ name: 'foo', email: 'bar@test.com' }]); +// => "UPDATE users SET `name` = 'foo', `email` = 'bar@test.com'" + +format( + 'INSERT INTO users (name, email) VALUES (?, ?) ON DUPLICATE KEY UPDATE ?', + ['foo', 'bar@test.com', { name: 'foo', email: 'bar@test.com' }] +); +// => "INSERT INTO users (name, email) VALUES ('foo', 'bar@test.com') ON DUPLICATE KEY UPDATE `name` = 'foo', `email` = 'bar@test.com'" +``` + +When `stringifyObjects` is truthy, objects are always stringified: + +```js +format('UPDATE users SET ?', [{ name: 'foo' }], true); +// => "UPDATE users SET '[object Object]'" +``` + +--- + +### raw + +Creates a raw SQL value that will not be escaped. + +```ts +raw(sql: string): Raw +``` + +```js +escape(raw('NOW()')); +// => 'NOW()' + +escape({ id: raw('LAST_INSERT_ID()') }); +// => '`id` = LAST_INSERT_ID()' +``` + +Only accepts strings: + +```js +raw(42); // throws TypeError +``` + +--- + +### TypeScript + +You can import the available types: + +```ts +import type { Raw, SqlValue, Timezone } from 'sql-escaper'; +``` + +--- + +## Performance + +Each benchmark formats `10,000` queries using `format` with `100` mixed values (numbers, strings, `null`, and dates), comparing **SQL Escaper** against the original [**sqlstring**](https://github.com/mysqljs/sqlstring) through [**hyperfine**](https://github.com/sharkdp/hyperfine): + +| Benchmark | sqlstring | SQL Escaper | Difference | +| ---------------------------------------- | --------: | ----------: | ---------------: | +| Select 100 values | 248.8 ms | 178.7 ms | **1.39x faster** | +| Insert 100 values | 247.5 ms | 196.2 ms | **1.26x faster** | +| SET with 100 values | 257.5 ms | 205.2 ms | **1.26x faster** | +| SET with 100 objects | 348.3 ms | 250.5 ms | **1.39x faster** | +| ON DUPLICATE KEY UPDATE with 100 values | 466.2 ms | 394.6 ms | **1.18x faster** | +| ON DUPLICATE KEY UPDATE with 100 objects | 558.2 ms | 433.9 ms | **1.29x faster** | + +- See detailed results and how the benchmarks are run in the [**benchmark**](https://github.com/mysqljs/sql-escaper/tree/main/benchmark) directory. + +> [!NOTE] +> +> Benchmarks ran on [**GitHub Actions**](https://github.com/mysqljs/sql-escaper/blob/main/.github/workflows/ci_benchmark.yml) (`ubuntu-latest`) using **Node.js LTS**. +> Results may vary depending on runner hardware and runtime version. + +--- + +## Differences from sqlstring + +- Requires **Node.js 12+** (the original [**sqlstring**](https://github.com/mysqljs/sqlstring) supports **Node.js** 0.6+) + +> [!TIP] +> +> The Node.js 12+ requirement is what allows **SQL Escaper** to leverage modern engine optimizations and achieve the [performance gains](#performance) over the original. + +--- + +## Caution + +> Based on the original [**sqlstring** documentation](https://github.com/mysqljs/sqlstring#readme). + +- The escaping methods in this library only work when the [`NO_BACKSLASH_ESCAPES`](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_backslash_escapes) SQL mode is disabled (which is the default state for MySQL servers). + +- This library performs **client-side escaping** to generate SQL strings. The syntax for `format` may look similar to a prepared statement, but it is not — the escaping rules from this module are used to produce the resulting SQL string. + +- When using `format`, **all** `?` placeholders are replaced, including those contained in comments and strings. + +- When structured user input is provided as the value to escape, care should be taken to validate the shape of the input, as the resulting escaped string may contain more than a single value. + +- `NaN` and `Infinity` are left as-is. MySQL does not support these values, and trying to insert them will trigger MySQL errors. + +- The string provided to `raw()` will **skip all escaping**, so be careful when passing in unvalidated input. + +--- + +## Security Policy + +[![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/mysqljs/sql-escaper/ci_codeql.yml?event=push&label=&branch=main&logo=github&logoColor=white&color=f368e0)](https://github.com/mysqljs/sql-escaper/actions/workflows/ci_codeql.yml?query=branch%3Amain) + +Please check the [**SECURITY.md**](https://github.com/mysqljs/sql-escaper/blob/main/SECURITY.md). + +--- + +## Contributing + +See the [**Contributing Guide**](https://github.com/mysqljs/sql-escaper/blob/main/CONTRIBUTING.md) and please follow our [**Code of Conduct**](https://github.com/mysqljs/sql-escaper/blob/main/CODE_OF_CONDUCT.md) 🚀 + +--- + +## Acknowledgements + +- [![Contributors](https://img.shields.io/github/contributors/mysqljs/sql-escaper?label=Contributors)](https://github.com/mysqljs/sql-escaper/graphs/contributors) +- **SQL Escaper** is adapted from [**sqlstring**](https://github.com/mysqljs/sqlstring) ([**MIT**](https://github.com/mysqljs/sqlstring/blob/master/LICENSE)), modernizing it with high performance, TypeScript support and multi-runtime compatibility. +- Special thanks to [**Douglas Wilson**](https://github.com/dougwilson) for the original **sqlstring** project and its [**contributors**](https://github.com/mysqljs/sqlstring/graphs/contributors). + +--- + +## License + +**SQL Escaper** is under the [**MIT License**](https://github.com/mysqljs/sql-escaper/blob/main/LICENSE). diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/lib/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/lib/index.d.ts new file mode 100644 index 0000000..4dbcfa4 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/lib/index.d.ts @@ -0,0 +1,15 @@ +/** + * Adapted from https://github.com/mysqljs/sqlstring/blob/cd528556b4b6bcf300c3db515026935dedf7cfa1/lib/SqlString.js + * MIT LICENSE: https://github.com/mysqljs/sqlstring/blob/cd528556b4b6bcf300c3db515026935dedf7cfa1/LICENSE + */ +import type { Raw, SqlValue, Timezone } from './types.js'; +import { Buffer } from 'node:buffer'; +export type { Raw, SqlValue, Timezone } from './types.js'; +export declare const dateToString: (date: Date, timezone: Timezone) => string; +export declare const escapeId: (value: SqlValue, forbidQualified?: boolean) => string; +export declare const objectToValues: (object: Record, timezone?: Timezone) => string; +export declare const bufferToString: (buffer: Buffer) => string; +export declare const arrayToList: (array: SqlValue[], timezone?: Timezone) => string; +export declare const escape: (value: SqlValue, stringifyObjects?: boolean, timezone?: Timezone) => string; +export declare const format: (sql: string, values?: SqlValue | SqlValue[], stringifyObjects?: boolean, timezone?: Timezone) => string; +export declare const raw: (sql: string) => Raw; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/lib/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/lib/index.js new file mode 100644 index 0000000..7f670ee --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/lib/index.js @@ -0,0 +1,398 @@ +"use strict"; +/** + * Adapted from https://github.com/mysqljs/sqlstring/blob/cd528556b4b6bcf300c3db515026935dedf7cfa1/lib/SqlString.js + * MIT LICENSE: https://github.com/mysqljs/sqlstring/blob/cd528556b4b6bcf300c3db515026935dedf7cfa1/LICENSE + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.raw = exports.format = exports.escape = exports.arrayToList = exports.bufferToString = exports.objectToValues = exports.escapeId = exports.dateToString = void 0; +const node_buffer_1 = require("node:buffer"); +const regex = { + backtick: /`/g, + dot: /\./g, + timezone: /([+\-\s])(\d\d):?(\d\d)?/, + escapeChars: /[\0\b\t\n\r\x1a"'\\]/g, +}; +const CHARS_ESCAPE_MAP = { + '\0': '\\0', + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\r': '\\r', + '\x1a': '\\Z', + '"': '\\"', + "'": "\\'", + '\\': '\\\\', +}; +const charCode = { + singleQuote: 39, + backtick: 96, + backslash: 92, + dash: 45, + slash: 47, + asterisk: 42, + questionMark: 63, + newline: 10, + space: 32, + tab: 9, + carriageReturn: 13, +}; +const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value); +const isWordChar = (code) => (code >= 65 && code <= 90) || + (code >= 97 && code <= 122) || + (code >= 48 && code <= 57) || + code === 95; +const isWhitespace = (code) => code === charCode.space || + code === charCode.tab || + code === charCode.newline || + code === charCode.carriageReturn; +const hasOnlyWhitespaceBetween = (sql, start, end) => { + if (start >= end) + return true; + for (let i = start; i < end; i++) { + const code = sql.charCodeAt(i); + if (code !== charCode.space && + code !== charCode.tab && + code !== charCode.newline && + code !== charCode.carriageReturn) + return false; + } + return true; +}; +const toLower = (code) => code | 32; +const matchesWord = (sql, position, word, length) => { + for (let offset = 0; offset < word.length; offset++) + if (toLower(sql.charCodeAt(position + offset)) !== word.charCodeAt(offset)) + return false; + return ((position === 0 || !isWordChar(sql.charCodeAt(position - 1))) && + (position + word.length >= length || + !isWordChar(sql.charCodeAt(position + word.length)))); +}; +const skipSqlContext = (sql, position) => { + const currentChar = sql.charCodeAt(position); + const nextChar = sql.charCodeAt(position + 1); + if (currentChar === charCode.singleQuote) { + for (let cursor = position + 1; cursor < sql.length; cursor++) { + if (sql.charCodeAt(cursor) === charCode.backslash) + cursor++; + else if (sql.charCodeAt(cursor) === charCode.singleQuote) + return cursor + 1; + } + return sql.length; + } + if (currentChar === charCode.backtick) { + const length = sql.length; + for (let cursor = position + 1; cursor < length; cursor++) { + if (sql.charCodeAt(cursor) !== charCode.backtick) + continue; + if (sql.charCodeAt(cursor + 1) === charCode.backtick) { + cursor++; + continue; + } + return cursor + 1; + } + return length; + } + if (currentChar === charCode.dash && nextChar === charCode.dash) { + const lineBreak = sql.indexOf('\n', position + 2); + return lineBreak === -1 ? sql.length : lineBreak + 1; + } + if (currentChar === charCode.slash && nextChar === charCode.asterisk) { + const commentEnd = sql.indexOf('*/', position + 2); + return commentEnd === -1 ? sql.length : commentEnd + 2; + } + return -1; +}; +const findNextPlaceholder = (sql, start) => { + const sqlLength = sql.length; + for (let position = start; position < sqlLength; position++) { + const code = sql.charCodeAt(position); + if (code === charCode.questionMark) + return position; + if (code === charCode.singleQuote || + code === charCode.backtick || + code === charCode.dash || + code === charCode.slash) { + const contextEnd = skipSqlContext(sql, position); + if (contextEnd !== -1) + position = contextEnd - 1; + } + } + return -1; +}; +const findSetKeyword = (sql, startFrom = 0) => { + const length = sql.length; + for (let position = startFrom; position < length; position++) { + const code = sql.charCodeAt(position); + const lower = code | 32; + if (code === charCode.singleQuote || + code === charCode.backtick || + code === charCode.dash || + code === charCode.slash) { + const contextEnd = skipSqlContext(sql, position); + if (contextEnd !== -1) { + position = contextEnd - 1; + continue; + } + } + if (lower === 115 && matchesWord(sql, position, 'set', length)) + return position + 3; + if (lower === 107 && matchesWord(sql, position, 'key', length)) { + let cursor = position + 3; + while (cursor < length && isWhitespace(sql.charCodeAt(cursor))) + cursor++; + if (matchesWord(sql, cursor, 'update', length)) + return cursor + 6; + } + } + return -1; +}; +const isDate = (value) => Object.prototype.toString.call(value) === '[object Date]'; +const hasSqlString = (value) => typeof value === 'object' && + value !== null && + 'toSqlString' in value && + typeof value.toSqlString === 'function'; +const escapeString = (value) => { + regex.escapeChars.lastIndex = 0; + let chunkIndex = 0; + let escapedValue = ''; + let match; + for (match = regex.escapeChars.exec(value); match !== null; match = regex.escapeChars.exec(value)) { + escapedValue += value.slice(chunkIndex, match.index); + escapedValue += CHARS_ESCAPE_MAP[match[0]]; + chunkIndex = regex.escapeChars.lastIndex; + } + if (chunkIndex === 0) + return `'${value}'`; + if (chunkIndex < value.length) + return `'${escapedValue}${value.slice(chunkIndex)}'`; + return `'${escapedValue}'`; +}; +const pad2 = (value) => (value < 10 ? '0' + value : '' + value); +const pad3 = (value) => value < 10 ? '00' + value : value < 100 ? '0' + value : '' + value; +const pad4 = (value) => value < 10 + ? '000' + value + : value < 100 + ? '00' + value + : value < 1000 + ? '0' + value + : '' + value; +const convertTimezone = (tz) => { + if (tz === 'Z') + return 0; + const timezoneMatch = tz.match(regex.timezone); + if (timezoneMatch) + return ((timezoneMatch[1] === '-' ? -1 : 1) * + (Number.parseInt(timezoneMatch[2], 10) + + (timezoneMatch[3] ? Number.parseInt(timezoneMatch[3], 10) : 0) / 60) * + 60); + return false; +}; +const dateToString = (date, timezone) => { + if (Number.isNaN(date.getTime())) + return 'NULL'; + let year; + let month; + let day; + let hour; + let minute; + let second; + let millisecond; + if (timezone === 'local') { + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + hour = date.getHours(); + minute = date.getMinutes(); + second = date.getSeconds(); + millisecond = date.getMilliseconds(); + } + else { + const timezoneOffsetMinutes = convertTimezone(timezone); + let time = date.getTime(); + if (timezoneOffsetMinutes !== false && timezoneOffsetMinutes !== 0) + time += timezoneOffsetMinutes * 60000; + const adjustedDate = new Date(time); + year = adjustedDate.getUTCFullYear(); + month = adjustedDate.getUTCMonth() + 1; + day = adjustedDate.getUTCDate(); + hour = adjustedDate.getUTCHours(); + minute = adjustedDate.getUTCMinutes(); + second = adjustedDate.getUTCSeconds(); + millisecond = adjustedDate.getUTCMilliseconds(); + } + // YYYY-MM-DD HH:mm:ss.mmm + return escapeString(pad4(year) + + '-' + + pad2(month) + + '-' + + pad2(day) + + ' ' + + pad2(hour) + + ':' + + pad2(minute) + + ':' + + pad2(second) + + '.' + + pad3(millisecond)); +}; +exports.dateToString = dateToString; +const escapeId = (value, forbidQualified) => { + if (Array.isArray(value)) { + const length = value.length; + const parts = new Array(length); + for (let i = 0; i < length; i++) + parts[i] = (0, exports.escapeId)(value[i], forbidQualified); + return parts.join(', '); + } + const identifier = String(value); + const hasJsonOperator = identifier.indexOf('->') !== -1; + if (forbidQualified || hasJsonOperator) { + if (identifier.indexOf('`') === -1) + return `\`${identifier}\``; + return `\`${identifier.replace(regex.backtick, '``')}\``; + } + if (identifier.indexOf('`') === -1 && identifier.indexOf('.') === -1) + return `\`${identifier}\``; + return `\`${identifier + .replace(regex.backtick, '``') + .replace(regex.dot, '`.`')}\``; +}; +exports.escapeId = escapeId; +const objectToValues = (object, timezone) => { + const keys = Object.keys(object); + const keysLength = keys.length; + if (keysLength === 0) + return ''; + let sql = ''; + for (let i = 0; i < keysLength; i++) { + const key = keys[i]; + const value = object[key]; + if (typeof value === 'function') + continue; + if (sql.length > 0) + sql += ', '; + sql += (0, exports.escapeId)(key); + sql += ' = '; + sql += (0, exports.escape)(value, true, timezone); + } + return sql; +}; +exports.objectToValues = objectToValues; +const bufferToString = (buffer) => `X${escapeString(buffer.toString('hex'))}`; +exports.bufferToString = bufferToString; +const arrayToList = (array, timezone) => { + const length = array.length; + const parts = new Array(length); + for (let i = 0; i < length; i++) { + const value = array[i]; + if (Array.isArray(value)) + parts[i] = `(${(0, exports.arrayToList)(value, timezone)})`; + else + parts[i] = (0, exports.escape)(value, true, timezone); + } + return parts.join(', '); +}; +exports.arrayToList = arrayToList; +const escape = (value, stringifyObjects, timezone) => { + if (value === undefined || value === null) + return 'NULL'; + switch (typeof value) { + case 'boolean': + return value ? 'true' : 'false'; + case 'number': + case 'bigint': + return value + ''; + case 'object': { + if (isDate(value)) + return (0, exports.dateToString)(value, timezone || 'local'); + if (Array.isArray(value)) + return (0, exports.arrayToList)(value, timezone); + if (node_buffer_1.Buffer.isBuffer(value)) + return (0, exports.bufferToString)(value); + if (value instanceof Uint8Array) + return (0, exports.bufferToString)(node_buffer_1.Buffer.from(value)); + if (hasSqlString(value)) + return String(value.toSqlString()); + if (!(stringifyObjects === undefined || stringifyObjects === null)) + return escapeString(String(value)); + if (isRecord(value)) + return (0, exports.objectToValues)(value, timezone); + return escapeString(String(value)); + } + case 'string': + return escapeString(value); + default: + return escapeString(String(value)); + } +}; +exports.escape = escape; +const format = (sql, values, stringifyObjects, timezone) => { + if (values === undefined || values === null) + return sql; + const valuesArray = Array.isArray(values) ? values : [values]; + const length = valuesArray.length; + let setIndex = -2; // -2 = not yet computed, -1 = no SET found + let result = ''; + let chunkIndex = 0; + let valuesIndex = 0; + let placeholderPosition = findNextPlaceholder(sql, 0); + while (valuesIndex < length && placeholderPosition !== -1) { + // Count consecutive question marks to detect ? vs ?? vs ???+ + let placeholderEnd = placeholderPosition + 1; + let escapedValue; + while (sql.charCodeAt(placeholderEnd) === 63) + placeholderEnd++; + const placeholderLength = placeholderEnd - placeholderPosition; + const currentValue = valuesArray[valuesIndex]; + if (placeholderLength > 2) { + placeholderPosition = findNextPlaceholder(sql, placeholderEnd); + continue; + } + if (placeholderLength === 2) + escapedValue = (0, exports.escapeId)(currentValue); + else if (typeof currentValue === 'number') + escapedValue = `${currentValue}`; + else if (typeof currentValue === 'object' && + currentValue !== null && + !stringifyObjects) { + // Lazy: compute SET position only when we first encounter an object + if (setIndex === -2) + setIndex = findSetKeyword(sql); + if (setIndex !== -1 && + setIndex <= placeholderPosition && + hasOnlyWhitespaceBetween(sql, setIndex, placeholderPosition) && + !hasSqlString(currentValue) && + !Array.isArray(currentValue) && + !node_buffer_1.Buffer.isBuffer(currentValue) && + !(currentValue instanceof Uint8Array) && + !isDate(currentValue) && + isRecord(currentValue)) { + escapedValue = (0, exports.objectToValues)(currentValue, timezone); + setIndex = findSetKeyword(sql, placeholderEnd); + } + else + escapedValue = (0, exports.escape)(currentValue, true, timezone); + } + else + escapedValue = (0, exports.escape)(currentValue, stringifyObjects, timezone); + result += sql.slice(chunkIndex, placeholderPosition); + result += escapedValue; + chunkIndex = placeholderEnd; + valuesIndex++; + placeholderPosition = findNextPlaceholder(sql, placeholderEnd); + } + if (chunkIndex === 0) + return sql; + if (chunkIndex < sql.length) + return result + sql.slice(chunkIndex); + return result; +}; +exports.format = format; +const raw = (sql) => { + if (typeof sql !== 'string') + throw new TypeError('argument sql must be a string'); + return { + toSqlString: () => sql, + }; +}; +exports.raw = raw; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/lib/index.mjs b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/lib/index.mjs new file mode 100644 index 0000000..ac99076 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/lib/index.mjs @@ -0,0 +1,305 @@ +import { Buffer } from "node:buffer"; +const regex = { + backtick: /`/g, + dot: /\./g, + timezone: /([+\-\s])(\d\d):?(\d\d)?/, + escapeChars: /[\0\b\t\n\r\x1a"'\\]/g +}; +const CHARS_ESCAPE_MAP = { + "\0": "\\0", + "\b": "\\b", + " ": "\\t", + "\n": "\\n", + "\r": "\\r", + "": "\\Z", + '"': '\\"', + "'": "\\'", + "\\": "\\\\" +}; +const charCode = { + singleQuote: 39, + backtick: 96, + backslash: 92, + dash: 45, + slash: 47, + asterisk: 42, + questionMark: 63, + newline: 10, + space: 32, + tab: 9, + carriageReturn: 13 +}; +const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value); +const isWordChar = (code) => code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 48 && code <= 57 || code === 95; +const isWhitespace = (code) => code === charCode.space || code === charCode.tab || code === charCode.newline || code === charCode.carriageReturn; +const hasOnlyWhitespaceBetween = (sql, start, end) => { + if (start >= end) return true; + for (let i = start; i < end; i++) { + const code = sql.charCodeAt(i); + if (code !== charCode.space && code !== charCode.tab && code !== charCode.newline && code !== charCode.carriageReturn) + return false; + } + return true; +}; +const toLower = (code) => code | 32; +const matchesWord = (sql, position, word, length) => { + for (let offset = 0; offset < word.length; offset++) + if (toLower(sql.charCodeAt(position + offset)) !== word.charCodeAt(offset)) + return false; + return (position === 0 || !isWordChar(sql.charCodeAt(position - 1))) && (position + word.length >= length || !isWordChar(sql.charCodeAt(position + word.length))); +}; +const skipSqlContext = (sql, position) => { + const currentChar = sql.charCodeAt(position); + const nextChar = sql.charCodeAt(position + 1); + if (currentChar === charCode.singleQuote) { + for (let cursor = position + 1; cursor < sql.length; cursor++) { + if (sql.charCodeAt(cursor) === charCode.backslash) cursor++; + else if (sql.charCodeAt(cursor) === charCode.singleQuote) + return cursor + 1; + } + return sql.length; + } + if (currentChar === charCode.backtick) { + const length = sql.length; + for (let cursor = position + 1; cursor < length; cursor++) { + if (sql.charCodeAt(cursor) !== charCode.backtick) continue; + if (sql.charCodeAt(cursor + 1) === charCode.backtick) { + cursor++; + continue; + } + return cursor + 1; + } + return length; + } + if (currentChar === charCode.dash && nextChar === charCode.dash) { + const lineBreak = sql.indexOf("\n", position + 2); + return lineBreak === -1 ? sql.length : lineBreak + 1; + } + if (currentChar === charCode.slash && nextChar === charCode.asterisk) { + const commentEnd = sql.indexOf("*/", position + 2); + return commentEnd === -1 ? sql.length : commentEnd + 2; + } + return -1; +}; +const findNextPlaceholder = (sql, start) => { + const sqlLength = sql.length; + for (let position = start; position < sqlLength; position++) { + const code = sql.charCodeAt(position); + if (code === charCode.questionMark) return position; + if (code === charCode.singleQuote || code === charCode.backtick || code === charCode.dash || code === charCode.slash) { + const contextEnd = skipSqlContext(sql, position); + if (contextEnd !== -1) position = contextEnd - 1; + } + } + return -1; +}; +const findSetKeyword = (sql, startFrom = 0) => { + const length = sql.length; + for (let position = startFrom; position < length; position++) { + const code = sql.charCodeAt(position); + const lower = code | 32; + if (code === charCode.singleQuote || code === charCode.backtick || code === charCode.dash || code === charCode.slash) { + const contextEnd = skipSqlContext(sql, position); + if (contextEnd !== -1) { + position = contextEnd - 1; + continue; + } + } + if (lower === 115 && matchesWord(sql, position, "set", length)) + return position + 3; + if (lower === 107 && matchesWord(sql, position, "key", length)) { + let cursor = position + 3; + while (cursor < length && isWhitespace(sql.charCodeAt(cursor))) cursor++; + if (matchesWord(sql, cursor, "update", length)) return cursor + 6; + } + } + return -1; +}; +const isDate = (value) => Object.prototype.toString.call(value) === "[object Date]"; +const hasSqlString = (value) => typeof value === "object" && value !== null && "toSqlString" in value && typeof value.toSqlString === "function"; +const escapeString = (value) => { + regex.escapeChars.lastIndex = 0; + let chunkIndex = 0; + let escapedValue = ""; + let match; + for (match = regex.escapeChars.exec(value); match !== null; match = regex.escapeChars.exec(value)) { + escapedValue += value.slice(chunkIndex, match.index); + escapedValue += CHARS_ESCAPE_MAP[match[0]]; + chunkIndex = regex.escapeChars.lastIndex; + } + if (chunkIndex === 0) return `'${value}'`; + if (chunkIndex < value.length) + return `'${escapedValue}${value.slice(chunkIndex)}'`; + return `'${escapedValue}'`; +}; +const pad2 = (value) => value < 10 ? "0" + value : "" + value; +const pad3 = (value) => value < 10 ? "00" + value : value < 100 ? "0" + value : "" + value; +const pad4 = (value) => value < 10 ? "000" + value : value < 100 ? "00" + value : value < 1e3 ? "0" + value : "" + value; +const convertTimezone = (tz) => { + if (tz === "Z") return 0; + const timezoneMatch = tz.match(regex.timezone); + if (timezoneMatch) + return (timezoneMatch[1] === "-" ? -1 : 1) * (Number.parseInt(timezoneMatch[2], 10) + (timezoneMatch[3] ? Number.parseInt(timezoneMatch[3], 10) : 0) / 60) * 60; + return false; +}; +const dateToString = (date, timezone) => { + if (Number.isNaN(date.getTime())) return "NULL"; + let year; + let month; + let day; + let hour; + let minute; + let second; + let millisecond; + if (timezone === "local") { + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + hour = date.getHours(); + minute = date.getMinutes(); + second = date.getSeconds(); + millisecond = date.getMilliseconds(); + } else { + const timezoneOffsetMinutes = convertTimezone(timezone); + let time = date.getTime(); + if (timezoneOffsetMinutes !== false && timezoneOffsetMinutes !== 0) + time += timezoneOffsetMinutes * 6e4; + const adjustedDate = new Date(time); + year = adjustedDate.getUTCFullYear(); + month = adjustedDate.getUTCMonth() + 1; + day = adjustedDate.getUTCDate(); + hour = adjustedDate.getUTCHours(); + minute = adjustedDate.getUTCMinutes(); + second = adjustedDate.getUTCSeconds(); + millisecond = adjustedDate.getUTCMilliseconds(); + } + return escapeString( + pad4(year) + "-" + pad2(month) + "-" + pad2(day) + " " + pad2(hour) + ":" + pad2(minute) + ":" + pad2(second) + "." + pad3(millisecond) + ); +}; +const escapeId = (value, forbidQualified) => { + if (Array.isArray(value)) { + const length = value.length; + const parts = new Array(length); + for (let i = 0; i < length; i++) + parts[i] = escapeId(value[i], forbidQualified); + return parts.join(", "); + } + const identifier = String(value); + const hasJsonOperator = identifier.indexOf("->") !== -1; + if (forbidQualified || hasJsonOperator) { + if (identifier.indexOf("`") === -1) return `\`${identifier}\``; + return `\`${identifier.replace(regex.backtick, "``")}\``; + } + if (identifier.indexOf("`") === -1 && identifier.indexOf(".") === -1) + return `\`${identifier}\``; + return `\`${identifier.replace(regex.backtick, "``").replace(regex.dot, "`.`")}\``; +}; +const objectToValues = (object, timezone) => { + const keys = Object.keys(object); + const keysLength = keys.length; + if (keysLength === 0) return ""; + let sql = ""; + for (let i = 0; i < keysLength; i++) { + const key = keys[i]; + const value = object[key]; + if (typeof value === "function") continue; + if (sql.length > 0) sql += ", "; + sql += escapeId(key); + sql += " = "; + sql += escape(value, true, timezone); + } + return sql; +}; +const bufferToString = (buffer) => `X${escapeString(buffer.toString("hex"))}`; +const arrayToList = (array, timezone) => { + const length = array.length; + const parts = new Array(length); + for (let i = 0; i < length; i++) { + const value = array[i]; + if (Array.isArray(value)) parts[i] = `(${arrayToList(value, timezone)})`; + else parts[i] = escape(value, true, timezone); + } + return parts.join(", "); +}; +const escape = (value, stringifyObjects, timezone) => { + if (value === void 0 || value === null) return "NULL"; + switch (typeof value) { + case "boolean": + return value ? "true" : "false"; + case "number": + case "bigint": + return value + ""; + case "object": { + if (isDate(value)) return dateToString(value, timezone || "local"); + if (Array.isArray(value)) return arrayToList(value, timezone); + if (Buffer.isBuffer(value)) return bufferToString(value); + if (value instanceof Uint8Array) + return bufferToString(Buffer.from(value)); + if (hasSqlString(value)) return String(value.toSqlString()); + if (!(stringifyObjects === void 0 || stringifyObjects === null)) + return escapeString(String(value)); + if (isRecord(value)) return objectToValues(value, timezone); + return escapeString(String(value)); + } + case "string": + return escapeString(value); + default: + return escapeString(String(value)); + } +}; +const format = (sql, values, stringifyObjects, timezone) => { + if (values === void 0 || values === null) return sql; + const valuesArray = Array.isArray(values) ? values : [values]; + const length = valuesArray.length; + let setIndex = -2; + let result = ""; + let chunkIndex = 0; + let valuesIndex = 0; + let placeholderPosition = findNextPlaceholder(sql, 0); + while (valuesIndex < length && placeholderPosition !== -1) { + let placeholderEnd = placeholderPosition + 1; + let escapedValue; + while (sql.charCodeAt(placeholderEnd) === 63) placeholderEnd++; + const placeholderLength = placeholderEnd - placeholderPosition; + const currentValue = valuesArray[valuesIndex]; + if (placeholderLength > 2) { + placeholderPosition = findNextPlaceholder(sql, placeholderEnd); + continue; + } + if (placeholderLength === 2) escapedValue = escapeId(currentValue); + else if (typeof currentValue === "number") escapedValue = `${currentValue}`; + else if (typeof currentValue === "object" && currentValue !== null && !stringifyObjects) { + if (setIndex === -2) setIndex = findSetKeyword(sql); + if (setIndex !== -1 && setIndex <= placeholderPosition && hasOnlyWhitespaceBetween(sql, setIndex, placeholderPosition) && !hasSqlString(currentValue) && !Array.isArray(currentValue) && !Buffer.isBuffer(currentValue) && !(currentValue instanceof Uint8Array) && !isDate(currentValue) && isRecord(currentValue)) { + escapedValue = objectToValues(currentValue, timezone); + setIndex = findSetKeyword(sql, placeholderEnd); + } else escapedValue = escape(currentValue, true, timezone); + } else escapedValue = escape(currentValue, stringifyObjects, timezone); + result += sql.slice(chunkIndex, placeholderPosition); + result += escapedValue; + chunkIndex = placeholderEnd; + valuesIndex++; + placeholderPosition = findNextPlaceholder(sql, placeholderEnd); + } + if (chunkIndex === 0) return sql; + if (chunkIndex < sql.length) return result + sql.slice(chunkIndex); + return result; +}; +const raw = (sql) => { + if (typeof sql !== "string") + throw new TypeError("argument sql must be a string"); + return { + toSqlString: () => sql + }; +}; +export { + arrayToList, + bufferToString, + dateToString, + escape, + escapeId, + format, + objectToValues, + raw +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/lib/types.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/lib/types.d.ts new file mode 100644 index 0000000..a8c54a0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/lib/types.d.ts @@ -0,0 +1,5 @@ +export type Raw = { + toSqlString(): string; +}; +export type SqlValue = string | number | bigint | boolean | Date | Buffer | Uint8Array | Raw | Record | SqlValue[] | null | undefined; +export type Timezone = 'local' | 'Z' | (string & NonNullable); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/lib/types.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/lib/types.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/lib/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/package.json new file mode 100644 index 0000000..43f6310 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/sql-escaper/package.json @@ -0,0 +1,81 @@ +{ + "name": "sql-escaper", + "version": "1.3.3", + "description": "🛡️ Faster SQL escape and format for JavaScript (Node.js, Bun, and Deno).", + "main": "./lib/index.js", + "module": "./lib/index.mjs", + "types": "./lib/index.d.ts", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/mysqljs/sql-escaper.git" + }, + "bugs": { + "url": "https://github.com/mysqljs/sql-escaper/issues" + }, + "author": "https://github.com/mysqljs", + "funding": { + "type": "github", + "url": "https://github.com/mysqljs/sql-escaper?sponsor=1" + }, + "files": [ + "lib" + ], + "engines": { + "node": ">=12.0.0", + "bun": ">=1.0.0", + "deno": ">=2.0.0" + }, + "scripts": { + "benchmark": "cd benchmark && npm ci && bash index.sh", + "build:esm": "esbuild src/index.ts --outfile=lib/index.mjs --platform=node --target=node12 --format=esm", + "build": "rm -rf ./lib && tsc && npm run build:esm", + "test:node": "poku", + "test:bun": "bun poku", + "test:deno": "deno run -A npm:poku", + "test:coverage": "mcr --import tsx --config mcr.config.ts npm run test:node", + "lint": "biome lint && prettier --check .", + "lint:fix": "biome lint --write && prettier --write .github/workflows/*.yml .", + "update": "pu minor && npm i && (npm audit fix || true) && npm run lint:fix" + }, + "devDependencies": { + "@biomejs/biome": "^1.9.4", + "@ianvs/prettier-plugin-sort-imports": "^4.7.0", + "@types/node": "^25.2.0", + "esbuild": "^0.27.2", + "monocart-coverage-reports": "^2.12.9", + "packages-update": "^2.0.0", + "poku": "^3.0.3-canary.13a996a9", + "prettier": "^3.8.1", + "tsx": "^4.21.0", + "typescript": "^5.9.3" + }, + "exports": { + ".": { + "import": { + "types": "./lib/index.d.ts", + "default": "./lib/index.mjs" + }, + "require": { + "types": "./lib/index.d.ts", + "default": "./lib/index.js" + } + } + }, + "keywords": [ + "sql", + "escape", + "format", + "sqlstring", + "sql-injection", + "sanitize", + "query", + "mysql", + "node", + "nodejs", + "bun", + "deno", + "typescript", + "fast" + ] +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/HISTORY.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/HISTORY.md new file mode 100644 index 0000000..dc549b8 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/HISTORY.md @@ -0,0 +1,87 @@ +2.0.2 / 2025-06-06 +================== + + * Migrate to `String.prototype.slice()` + +2.0.1 / 2021-01-03 +================== + + * Fix returning values from `Object.prototype` + +2.0.0 / 2020-04-19 +================== + + * Drop support for Node.js 0.6 + * Fix messaging casing of `418 I'm a Teapot` + * Remove code 306 + * Remove `status[code]` exports; use `status.message[code]` + * Remove `status[msg]` exports; use `status.code[msg]` + * Rename `425 Unordered Collection` to standard `425 Too Early` + * Rename `STATUS_CODES` export to `message` + * Return status message for `statuses(code)` when given code + +1.5.0 / 2018-03-27 +================== + + * Add `103 Early Hints` + +1.4.0 / 2017-10-20 +================== + + * Add `STATUS_CODES` export + +1.3.1 / 2016-11-11 +================== + + * Fix return type in JSDoc + +1.3.0 / 2016-05-17 +================== + + * Add `421 Misdirected Request` + * perf: enable strict mode + +1.2.1 / 2015-02-01 +================== + + * Fix message for status 451 + - `451 Unavailable For Legal Reasons` + +1.2.0 / 2014-09-28 +================== + + * Add `208 Already Repored` + * Add `226 IM Used` + * Add `306 (Unused)` + * Add `415 Unable For Legal Reasons` + * Add `508 Loop Detected` + +1.1.1 / 2014-09-24 +================== + + * Add missing 308 to `codes.json` + +1.1.0 / 2014-09-21 +================== + + * Add `codes.json` for universal support + +1.0.4 / 2014-08-20 +================== + + * Package cleanup + +1.0.3 / 2014-06-08 +================== + + * Add 308 to `.redirect` category + +1.0.2 / 2014-03-13 +================== + + * Add `.retry` category + +1.0.1 / 2014-03-12 +================== + + * Initial release diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/LICENSE new file mode 100644 index 0000000..28a3161 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/LICENSE @@ -0,0 +1,23 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/README.md new file mode 100644 index 0000000..89d542f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/README.md @@ -0,0 +1,139 @@ +# statuses + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] +[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] + +HTTP status utility for node. + +This module provides a list of status codes and messages sourced from +a few different projects: + + * The [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml) + * The [Node.js project](https://nodejs.org/) + * The [NGINX project](https://www.nginx.com/) + * The [Apache HTTP Server project](https://httpd.apache.org/) + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install statuses +``` + +## API + + + +```js +var status = require('statuses') +``` + +### status(code) + +Returns the status message string for a known HTTP status code. The code +may be a number or a string. An error is thrown for an unknown status code. + + + +```js +status(403) // => 'Forbidden' +status('403') // => 'Forbidden' +status(306) // throws +``` + +### status(msg) + +Returns the numeric status code for a known HTTP status message. The message +is case-insensitive. An error is thrown for an unknown status message. + + + +```js +status('forbidden') // => 403 +status('Forbidden') // => 403 +status('foo') // throws +``` + +### status.codes + +Returns an array of all the status codes as `Integer`s. + +### status.code[msg] + +Returns the numeric status code for a known status message (in lower-case), +otherwise `undefined`. + + + +```js +status['not found'] // => 404 +``` + +### status.empty[code] + +Returns `true` if a status code expects an empty body. + + + +```js +status.empty[200] // => undefined +status.empty[204] // => true +status.empty[304] // => true +``` + +### status.message[code] + +Returns the string message for a known numeric status code, otherwise +`undefined`. This object is the same format as the +[Node.js http module `http.STATUS_CODES`](https://nodejs.org/dist/latest/docs/api/http.html#http_http_status_codes). + + + +```js +status.message[404] // => 'Not Found' +``` + +### status.redirect[code] + +Returns `true` if a status code is a valid redirect status. + + + +```js +status.redirect[200] // => undefined +status.redirect[301] // => true +``` + +### status.retry[code] + +Returns `true` if you should retry the rest. + + + +```js +status.retry[501] // => undefined +status.retry[503] // => true +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/statuses/master?label=ci +[ci-url]: https://github.com/jshttp/statuses/actions?query=workflow%3Aci +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/statuses/master +[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master +[node-version-image]: https://badgen.net/npm/node/statuses +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/statuses +[npm-url]: https://npmjs.org/package/statuses +[npm-version-image]: https://badgen.net/npm/v/statuses +[ossf-scorecard-badge]: https://api.securityscorecards.dev/projects/github.com/jshttp/statuses/badge +[ossf-scorecard-visualizer]: https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/jshttp/statuses diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/codes.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/codes.json new file mode 100644 index 0000000..1333ed1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/codes.json @@ -0,0 +1,65 @@ +{ + "100": "Continue", + "101": "Switching Protocols", + "102": "Processing", + "103": "Early Hints", + "200": "OK", + "201": "Created", + "202": "Accepted", + "203": "Non-Authoritative Information", + "204": "No Content", + "205": "Reset Content", + "206": "Partial Content", + "207": "Multi-Status", + "208": "Already Reported", + "226": "IM Used", + "300": "Multiple Choices", + "301": "Moved Permanently", + "302": "Found", + "303": "See Other", + "304": "Not Modified", + "305": "Use Proxy", + "307": "Temporary Redirect", + "308": "Permanent Redirect", + "400": "Bad Request", + "401": "Unauthorized", + "402": "Payment Required", + "403": "Forbidden", + "404": "Not Found", + "405": "Method Not Allowed", + "406": "Not Acceptable", + "407": "Proxy Authentication Required", + "408": "Request Timeout", + "409": "Conflict", + "410": "Gone", + "411": "Length Required", + "412": "Precondition Failed", + "413": "Payload Too Large", + "414": "URI Too Long", + "415": "Unsupported Media Type", + "416": "Range Not Satisfiable", + "417": "Expectation Failed", + "418": "I'm a Teapot", + "421": "Misdirected Request", + "422": "Unprocessable Entity", + "423": "Locked", + "424": "Failed Dependency", + "425": "Too Early", + "426": "Upgrade Required", + "428": "Precondition Required", + "429": "Too Many Requests", + "431": "Request Header Fields Too Large", + "451": "Unavailable For Legal Reasons", + "500": "Internal Server Error", + "501": "Not Implemented", + "502": "Bad Gateway", + "503": "Service Unavailable", + "504": "Gateway Timeout", + "505": "HTTP Version Not Supported", + "506": "Variant Also Negotiates", + "507": "Insufficient Storage", + "508": "Loop Detected", + "509": "Bandwidth Limit Exceeded", + "510": "Not Extended", + "511": "Network Authentication Required" +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/index.js new file mode 100644 index 0000000..ea351c5 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/index.js @@ -0,0 +1,146 @@ +/*! + * statuses + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var codes = require('./codes.json') + +/** + * Module exports. + * @public + */ + +module.exports = status + +// status code to message map +status.message = codes + +// status message (lower-case) to code map +status.code = createMessageToStatusCodeMap(codes) + +// array of status codes +status.codes = createStatusCodeList(codes) + +// status codes for redirects +status.redirect = { + 300: true, + 301: true, + 302: true, + 303: true, + 305: true, + 307: true, + 308: true +} + +// status codes for empty bodies +status.empty = { + 204: true, + 205: true, + 304: true +} + +// status codes for when you should retry the request +status.retry = { + 502: true, + 503: true, + 504: true +} + +/** + * Create a map of message to status code. + * @private + */ + +function createMessageToStatusCodeMap (codes) { + var map = {} + + Object.keys(codes).forEach(function forEachCode (code) { + var message = codes[code] + var status = Number(code) + + // populate map + map[message.toLowerCase()] = status + }) + + return map +} + +/** + * Create a list of all status codes. + * @private + */ + +function createStatusCodeList (codes) { + return Object.keys(codes).map(function mapCode (code) { + return Number(code) + }) +} + +/** + * Get the status code for given message. + * @private + */ + +function getStatusCode (message) { + var msg = message.toLowerCase() + + if (!Object.prototype.hasOwnProperty.call(status.code, msg)) { + throw new Error('invalid status message: "' + message + '"') + } + + return status.code[msg] +} + +/** + * Get the status message for given code. + * @private + */ + +function getStatusMessage (code) { + if (!Object.prototype.hasOwnProperty.call(status.message, code)) { + throw new Error('invalid status code: ' + code) + } + + return status.message[code] +} + +/** + * Get the status code. + * + * Given a number, this will throw if it is not a known status + * code, otherwise the code will be returned. Given a string, + * the string will be parsed for a number and return the code + * if valid, otherwise will lookup the code assuming this is + * the status message. + * + * @param {string|number} code + * @returns {number} + * @public + */ + +function status (code) { + if (typeof code === 'number') { + return getStatusMessage(code) + } + + if (typeof code !== 'string') { + throw new TypeError('code must be a number or string') + } + + // '403' + var n = parseInt(code, 10) + if (!isNaN(n)) { + return getStatusMessage(n) + } + + return getStatusCode(code) +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/package.json new file mode 100644 index 0000000..b5d016e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/statuses/package.json @@ -0,0 +1,49 @@ +{ + "name": "statuses", + "description": "HTTP status utility", + "version": "2.0.2", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "repository": "jshttp/statuses", + "license": "MIT", + "keywords": [ + "http", + "status", + "code" + ], + "files": [ + "HISTORY.md", + "index.js", + "codes.json", + "LICENSE" + ], + "devDependencies": { + "csv-parse": "4.16.3", + "eslint": "7.19.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.31.0", + "eslint-plugin-markdown": "1.0.2", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.3.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "8.4.0", + "nyc": "15.1.0", + "raw-body": "2.5.2", + "stream-to-array": "2.3.0" + }, + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "build": "node scripts/build.js", + "fetch": "node scripts/fetch-apache.js && node scripts/fetch-iana.js && node scripts/fetch-nginx.js && node scripts/fetch-node.js", + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "update": "npm run fetch && npm run build", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/supports-color/browser.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/supports-color/browser.js new file mode 100644 index 0000000..62afa3a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/supports-color/browser.js @@ -0,0 +1,5 @@ +'use strict'; +module.exports = { + stdout: false, + stderr: false +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/supports-color/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/supports-color/index.js new file mode 100644 index 0000000..1704131 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/supports-color/index.js @@ -0,0 +1,131 @@ +'use strict'; +const os = require('os'); +const hasFlag = require('has-flag'); + +const env = process.env; + +let forceColor; +if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false')) { + forceColor = false; +} else if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + forceColor = true; +} +if ('FORCE_COLOR' in env) { + forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; +} + +function translateLevel(level) { + if (level === 0) { + return false; + } + + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} + +function supportsColor(stream) { + if (forceColor === false) { + return 0; + } + + if (hasFlag('color=16m') || + hasFlag('color=full') || + hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + + if (stream && !stream.isTTY && forceColor !== true) { + return 0; + } + + const min = forceColor ? 1 : 0; + + if (process.platform === 'win32') { + // Node.js 7.5.0 is the first version of Node.js to include a patch to + // libuv that enables 256 color output on Windows. Anything earlier and it + // won't work. However, here we target Node.js 8 at minimum as it is an LTS + // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows + // release that supports 256 colors. Windows 10 build 14931 is the first release + // that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(process.versions.node.split('.')[0]) >= 8 && + Number(osRelease[0]) >= 10 && + Number(osRelease[2]) >= 10586 + ) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + + return 1; + } + + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } + + return min; + } + + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + + if (env.COLORTERM === 'truecolor') { + return 3; + } + + if ('TERM_PROGRAM' in env) { + const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Apple_Terminal': + return 2; + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + + if ('COLORTERM' in env) { + return 1; + } + + if (env.TERM === 'dumb') { + return min; + } + + return min; +} + +function getSupportLevel(stream) { + const level = supportsColor(stream); + return translateLevel(level); +} + +module.exports = { + supportsColor: getSupportLevel, + stdout: getSupportLevel(process.stdout), + stderr: getSupportLevel(process.stderr) +}; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/supports-color/license b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/supports-color/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/supports-color/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/supports-color/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/supports-color/package.json new file mode 100644 index 0000000..ad199f5 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/supports-color/package.json @@ -0,0 +1,53 @@ +{ + "name": "supports-color", + "version": "5.5.0", + "description": "Detect whether a terminal supports color", + "license": "MIT", + "repository": "chalk/supports-color", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "browser.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect", + "truecolor", + "16m" + ], + "dependencies": { + "has-flag": "^3.0.0" + }, + "devDependencies": { + "ava": "^0.25.0", + "import-fresh": "^2.0.0", + "xo": "^0.20.0" + }, + "browser": "browser.js" +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/supports-color/readme.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/supports-color/readme.md new file mode 100644 index 0000000..f6e4019 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/supports-color/readme.md @@ -0,0 +1,66 @@ +# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) + +> Detect whether a terminal supports color + + +## Install + +``` +$ npm install supports-color +``` + + +## Usage + +```js +const supportsColor = require('supports-color'); + +if (supportsColor.stdout) { + console.log('Terminal stdout supports color'); +} + +if (supportsColor.stdout.has256) { + console.log('Terminal stdout supports 256 colors'); +} + +if (supportsColor.stderr.has16m) { + console.log('Terminal stderr supports 16 million colors (truecolor)'); +} +``` + + +## API + +Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. + +The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: + +- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) +- `.level = 2` and `.has256 = true`: 256 color support +- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) + + +## Info + +It obeys the `--color` and `--no-color` CLI flags. + +Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. + +Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. + + +## Related + +- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/to-regex-range/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/to-regex-range/LICENSE new file mode 100644 index 0000000..7cccaf9 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/to-regex-range/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/to-regex-range/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/to-regex-range/README.md new file mode 100644 index 0000000..38887da --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/to-regex-range/README.md @@ -0,0 +1,305 @@ +# to-regex-range [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/to-regex-range.svg?style=flat)](https://www.npmjs.com/package/to-regex-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/to-regex-range.svg?style=flat)](https://npmjs.org/package/to-regex-range) [![NPM total downloads](https://img.shields.io/npm/dt/to-regex-range.svg?style=flat)](https://npmjs.org/package/to-regex-range) [![Linux Build Status](https://img.shields.io/travis/micromatch/to-regex-range.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/to-regex-range) + +> Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save to-regex-range +``` + +
+What does this do? + +
+ +This libary generates the `source` string to be passed to `new RegExp()` for matching a range of numbers. + +**Example** + +```js +const toRegexRange = require('to-regex-range'); +const regex = new RegExp(toRegexRange('15', '95')); +``` + +A string is returned so that you can do whatever you need with it before passing it to `new RegExp()` (like adding `^` or `$` boundaries, defining flags, or combining it another string). + +
+ +
+ +
+Why use this library? + +
+ +### Convenience + +Creating regular expressions for matching numbers gets deceptively complicated pretty fast. + +For example, let's say you need a validation regex for matching part of a user-id, postal code, social security number, tax id, etc: + +* regex for matching `1` => `/1/` (easy enough) +* regex for matching `1` through `5` => `/[1-5]/` (not bad...) +* regex for matching `1` or `5` => `/(1|5)/` (still easy...) +* regex for matching `1` through `50` => `/([1-9]|[1-4][0-9]|50)/` (uh-oh...) +* regex for matching `1` through `55` => `/([1-9]|[1-4][0-9]|5[0-5])/` (no prob, I can do this...) +* regex for matching `1` through `555` => `/([1-9]|[1-9][0-9]|[1-4][0-9]{2}|5[0-4][0-9]|55[0-5])/` (maybe not...) +* regex for matching `0001` through `5555` => `/(0{3}[1-9]|0{2}[1-9][0-9]|0[1-9][0-9]{2}|[1-4][0-9]{3}|5[0-4][0-9]{2}|55[0-4][0-9]|555[0-5])/` (okay, I get the point!) + +The numbers are contrived, but they're also really basic. In the real world you might need to generate a regex on-the-fly for validation. + +**Learn more** + +If you're interested in learning more about [character classes](http://www.regular-expressions.info/charclass.html) and other regex features, I personally have always found [regular-expressions.info](http://www.regular-expressions.info/charclass.html) to be pretty useful. + +### Heavily tested + +As of April 07, 2019, this library runs [>1m test assertions](./test/test.js) against generated regex-ranges to provide brute-force verification that results are correct. + +Tests run in ~280ms on my MacBook Pro, 2.5 GHz Intel Core i7. + +### Optimized + +Generated regular expressions are optimized: + +* duplicate sequences and character classes are reduced using quantifiers +* smart enough to use `?` conditionals when number(s) or range(s) can be positive or negative +* uses fragment caching to avoid processing the same exact string more than once + +
+ +
+ +## Usage + +Add this library to your javascript application with the following line of code + +```js +const toRegexRange = require('to-regex-range'); +``` + +The main export is a function that takes two integers: the `min` value and `max` value (formatted as strings or numbers). + +```js +const source = toRegexRange('15', '95'); +//=> 1[5-9]|[2-8][0-9]|9[0-5] + +const regex = new RegExp(`^${source}$`); +console.log(regex.test('14')); //=> false +console.log(regex.test('50')); //=> true +console.log(regex.test('94')); //=> true +console.log(regex.test('96')); //=> false +``` + +## Options + +### options.capture + +**Type**: `boolean` + +**Deafault**: `undefined` + +Wrap the returned value in parentheses when there is more than one regex condition. Useful when you're dynamically generating ranges. + +```js +console.log(toRegexRange('-10', '10')); +//=> -[1-9]|-?10|[0-9] + +console.log(toRegexRange('-10', '10', { capture: true })); +//=> (-[1-9]|-?10|[0-9]) +``` + +### options.shorthand + +**Type**: `boolean` + +**Deafault**: `undefined` + +Use the regex shorthand for `[0-9]`: + +```js +console.log(toRegexRange('0', '999999')); +//=> [0-9]|[1-9][0-9]{1,5} + +console.log(toRegexRange('0', '999999', { shorthand: true })); +//=> \d|[1-9]\d{1,5} +``` + +### options.relaxZeros + +**Type**: `boolean` + +**Default**: `true` + +This option relaxes matching for leading zeros when when ranges are zero-padded. + +```js +const source = toRegexRange('-0010', '0010'); +const regex = new RegExp(`^${source}$`); +console.log(regex.test('-10')); //=> true +console.log(regex.test('-010')); //=> true +console.log(regex.test('-0010')); //=> true +console.log(regex.test('10')); //=> true +console.log(regex.test('010')); //=> true +console.log(regex.test('0010')); //=> true +``` + +When `relaxZeros` is false, matching is strict: + +```js +const source = toRegexRange('-0010', '0010', { relaxZeros: false }); +const regex = new RegExp(`^${source}$`); +console.log(regex.test('-10')); //=> false +console.log(regex.test('-010')); //=> false +console.log(regex.test('-0010')); //=> true +console.log(regex.test('10')); //=> false +console.log(regex.test('010')); //=> false +console.log(regex.test('0010')); //=> true +``` + +## Examples + +| **Range** | **Result** | **Compile time** | +| --- | --- | --- | +| `toRegexRange(-10, 10)` | `-[1-9]\|-?10\|[0-9]` | _132μs_ | +| `toRegexRange(-100, -10)` | `-1[0-9]\|-[2-9][0-9]\|-100` | _50μs_ | +| `toRegexRange(-100, 100)` | `-[1-9]\|-?[1-9][0-9]\|-?100\|[0-9]` | _42μs_ | +| `toRegexRange(001, 100)` | `0{0,2}[1-9]\|0?[1-9][0-9]\|100` | _109μs_ | +| `toRegexRange(001, 555)` | `0{0,2}[1-9]\|0?[1-9][0-9]\|[1-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _51μs_ | +| `toRegexRange(0010, 1000)` | `0{0,2}1[0-9]\|0{0,2}[2-9][0-9]\|0?[1-9][0-9]{2}\|1000` | _31μs_ | +| `toRegexRange(1, 50)` | `[1-9]\|[1-4][0-9]\|50` | _24μs_ | +| `toRegexRange(1, 55)` | `[1-9]\|[1-4][0-9]\|5[0-5]` | _23μs_ | +| `toRegexRange(1, 555)` | `[1-9]\|[1-9][0-9]\|[1-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _30μs_ | +| `toRegexRange(1, 5555)` | `[1-9]\|[1-9][0-9]{1,2}\|[1-4][0-9]{3}\|5[0-4][0-9]{2}\|55[0-4][0-9]\|555[0-5]` | _43μs_ | +| `toRegexRange(111, 555)` | `11[1-9]\|1[2-9][0-9]\|[2-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _38μs_ | +| `toRegexRange(29, 51)` | `29\|[34][0-9]\|5[01]` | _24μs_ | +| `toRegexRange(31, 877)` | `3[1-9]\|[4-9][0-9]\|[1-7][0-9]{2}\|8[0-6][0-9]\|87[0-7]` | _32μs_ | +| `toRegexRange(5, 5)` | `5` | _8μs_ | +| `toRegexRange(5, 6)` | `5\|6` | _11μs_ | +| `toRegexRange(1, 2)` | `1\|2` | _6μs_ | +| `toRegexRange(1, 5)` | `[1-5]` | _15μs_ | +| `toRegexRange(1, 10)` | `[1-9]\|10` | _22μs_ | +| `toRegexRange(1, 100)` | `[1-9]\|[1-9][0-9]\|100` | _25μs_ | +| `toRegexRange(1, 1000)` | `[1-9]\|[1-9][0-9]{1,2}\|1000` | _31μs_ | +| `toRegexRange(1, 10000)` | `[1-9]\|[1-9][0-9]{1,3}\|10000` | _34μs_ | +| `toRegexRange(1, 100000)` | `[1-9]\|[1-9][0-9]{1,4}\|100000` | _36μs_ | +| `toRegexRange(1, 1000000)` | `[1-9]\|[1-9][0-9]{1,5}\|1000000` | _42μs_ | +| `toRegexRange(1, 10000000)` | `[1-9]\|[1-9][0-9]{1,6}\|10000000` | _42μs_ | + +## Heads up! + +**Order of arguments** + +When the `min` is larger than the `max`, values will be flipped to create a valid range: + +```js +toRegexRange('51', '29'); +``` + +Is effectively flipped to: + +```js +toRegexRange('29', '51'); +//=> 29|[3-4][0-9]|5[0-1] +``` + +**Steps / increments** + +This library does not support steps (increments). A pr to add support would be welcome. + +## History + +### v2.0.0 - 2017-04-21 + +**New features** + +Adds support for zero-padding! + +### v1.0.0 + +**Optimizations** + +Repeating ranges are now grouped using quantifiers. rocessing time is roughly the same, but the generated regex is much smaller, which should result in faster matching. + +## Attribution + +Inspired by the python library [range-regex](https://github.com/dimka665/range-regex). + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used by micromatch.") +* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") +* [repeat-element](https://www.npmjs.com/package/repeat-element): Create an array by repeating the given value n times. | [homepage](https://github.com/jonschlinkert/repeat-element "Create an array by repeating the given value n times.") +* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string "Repeat the given string n times. Fastest implementation for repeating a string.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 63 | [jonschlinkert](https://github.com/jonschlinkert) | +| 3 | [doowb](https://github.com/doowb) | +| 2 | [realityking](https://github.com/realityking) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +Please consider supporting me on Patreon, or [start your own Patreon page](https://patreon.com/invite/bxpbvm)! + + + + + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 07, 2019._ \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/to-regex-range/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/to-regex-range/index.js new file mode 100644 index 0000000..77fbace --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/to-regex-range/index.js @@ -0,0 +1,288 @@ +/*! + * to-regex-range + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +const isNumber = require('is-number'); + +const toRegexRange = (min, max, options) => { + if (isNumber(min) === false) { + throw new TypeError('toRegexRange: expected the first argument to be a number'); + } + + if (max === void 0 || min === max) { + return String(min); + } + + if (isNumber(max) === false) { + throw new TypeError('toRegexRange: expected the second argument to be a number.'); + } + + let opts = { relaxZeros: true, ...options }; + if (typeof opts.strictZeros === 'boolean') { + opts.relaxZeros = opts.strictZeros === false; + } + + let relax = String(opts.relaxZeros); + let shorthand = String(opts.shorthand); + let capture = String(opts.capture); + let wrap = String(opts.wrap); + let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; + + if (toRegexRange.cache.hasOwnProperty(cacheKey)) { + return toRegexRange.cache[cacheKey].result; + } + + let a = Math.min(min, max); + let b = Math.max(min, max); + + if (Math.abs(a - b) === 1) { + let result = min + '|' + max; + if (opts.capture) { + return `(${result})`; + } + if (opts.wrap === false) { + return result; + } + return `(?:${result})`; + } + + let isPadded = hasPadding(min) || hasPadding(max); + let state = { min, max, a, b }; + let positives = []; + let negatives = []; + + if (isPadded) { + state.isPadded = isPadded; + state.maxLen = String(state.max).length; + } + + if (a < 0) { + let newMin = b < 0 ? Math.abs(b) : 1; + negatives = splitToPatterns(newMin, Math.abs(a), state, opts); + a = state.a = 0; + } + + if (b >= 0) { + positives = splitToPatterns(a, b, state, opts); + } + + state.negatives = negatives; + state.positives = positives; + state.result = collatePatterns(negatives, positives, opts); + + if (opts.capture === true) { + state.result = `(${state.result})`; + } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { + state.result = `(?:${state.result})`; + } + + toRegexRange.cache[cacheKey] = state; + return state.result; +}; + +function collatePatterns(neg, pos, options) { + let onlyNegative = filterPatterns(neg, pos, '-', false, options) || []; + let onlyPositive = filterPatterns(pos, neg, '', false, options) || []; + let intersected = filterPatterns(neg, pos, '-?', true, options) || []; + let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); + return subpatterns.join('|'); +} + +function splitToRanges(min, max) { + let nines = 1; + let zeros = 1; + + let stop = countNines(min, nines); + let stops = new Set([max]); + + while (min <= stop && stop <= max) { + stops.add(stop); + nines += 1; + stop = countNines(min, nines); + } + + stop = countZeros(max + 1, zeros) - 1; + + while (min < stop && stop <= max) { + stops.add(stop); + zeros += 1; + stop = countZeros(max + 1, zeros) - 1; + } + + stops = [...stops]; + stops.sort(compare); + return stops; +} + +/** + * Convert a range to a regex pattern + * @param {Number} `start` + * @param {Number} `stop` + * @return {String} + */ + +function rangeToPattern(start, stop, options) { + if (start === stop) { + return { pattern: start, count: [], digits: 0 }; + } + + let zipped = zip(start, stop); + let digits = zipped.length; + let pattern = ''; + let count = 0; + + for (let i = 0; i < digits; i++) { + let [startDigit, stopDigit] = zipped[i]; + + if (startDigit === stopDigit) { + pattern += startDigit; + + } else if (startDigit !== '0' || stopDigit !== '9') { + pattern += toCharacterClass(startDigit, stopDigit, options); + + } else { + count++; + } + } + + if (count) { + pattern += options.shorthand === true ? '\\d' : '[0-9]'; + } + + return { pattern, count: [count], digits }; +} + +function splitToPatterns(min, max, tok, options) { + let ranges = splitToRanges(min, max); + let tokens = []; + let start = min; + let prev; + + for (let i = 0; i < ranges.length; i++) { + let max = ranges[i]; + let obj = rangeToPattern(String(start), String(max), options); + let zeros = ''; + + if (!tok.isPadded && prev && prev.pattern === obj.pattern) { + if (prev.count.length > 1) { + prev.count.pop(); + } + + prev.count.push(obj.count[0]); + prev.string = prev.pattern + toQuantifier(prev.count); + start = max + 1; + continue; + } + + if (tok.isPadded) { + zeros = padZeros(max, tok, options); + } + + obj.string = zeros + obj.pattern + toQuantifier(obj.count); + tokens.push(obj); + start = max + 1; + prev = obj; + } + + return tokens; +} + +function filterPatterns(arr, comparison, prefix, intersection, options) { + let result = []; + + for (let ele of arr) { + let { string } = ele; + + // only push if _both_ are negative... + if (!intersection && !contains(comparison, 'string', string)) { + result.push(prefix + string); + } + + // or _both_ are positive + if (intersection && contains(comparison, 'string', string)) { + result.push(prefix + string); + } + } + return result; +} + +/** + * Zip strings + */ + +function zip(a, b) { + let arr = []; + for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); + return arr; +} + +function compare(a, b) { + return a > b ? 1 : b > a ? -1 : 0; +} + +function contains(arr, key, val) { + return arr.some(ele => ele[key] === val); +} + +function countNines(min, len) { + return Number(String(min).slice(0, -len) + '9'.repeat(len)); +} + +function countZeros(integer, zeros) { + return integer - (integer % Math.pow(10, zeros)); +} + +function toQuantifier(digits) { + let [start = 0, stop = ''] = digits; + if (stop || start > 1) { + return `{${start + (stop ? ',' + stop : '')}}`; + } + return ''; +} + +function toCharacterClass(a, b, options) { + return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; +} + +function hasPadding(str) { + return /^-?(0+)\d/.test(str); +} + +function padZeros(value, tok, options) { + if (!tok.isPadded) { + return value; + } + + let diff = Math.abs(tok.maxLen - String(value).length); + let relax = options.relaxZeros !== false; + + switch (diff) { + case 0: + return ''; + case 1: + return relax ? '0?' : '0'; + case 2: + return relax ? '0{0,2}' : '00'; + default: { + return relax ? `0{0,${diff}}` : `0{${diff}}`; + } + } +} + +/** + * Cache + */ + +toRegexRange.cache = {}; +toRegexRange.clearCache = () => (toRegexRange.cache = {}); + +/** + * Expose `toRegexRange` + */ + +module.exports = toRegexRange; diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/to-regex-range/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/to-regex-range/package.json new file mode 100644 index 0000000..4ef194f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/to-regex-range/package.json @@ -0,0 +1,88 @@ +{ + "name": "to-regex-range", + "description": "Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions.", + "version": "5.0.1", + "homepage": "https://github.com/micromatch/to-regex-range", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Rouven Weßling (www.rouvenwessling.de)" + ], + "repository": "micromatch/to-regex-range", + "bugs": { + "url": "https://github.com/micromatch/to-regex-range/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=8.0" + }, + "scripts": { + "test": "mocha" + }, + "dependencies": { + "is-number": "^7.0.0" + }, + "devDependencies": { + "fill-range": "^6.0.0", + "gulp-format-md": "^2.0.0", + "mocha": "^6.0.2", + "text-table": "^0.2.0", + "time-diff": "^0.3.1" + }, + "keywords": [ + "bash", + "date", + "expand", + "expansion", + "expression", + "glob", + "match", + "match date", + "match number", + "match numbers", + "match year", + "matches", + "matching", + "number", + "numbers", + "numerical", + "range", + "ranges", + "regex", + "regexp", + "regular", + "regular expression", + "sequence" + ], + "verb": { + "layout": "default", + "toc": false, + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "helpers": { + "examples": { + "displayName": "examples" + } + }, + "related": { + "list": [ + "expand-range", + "fill-range", + "micromatch", + "repeat-element", + "repeat-string" + ] + } + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/toidentifier/HISTORY.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/toidentifier/HISTORY.md new file mode 100644 index 0000000..cb7cc89 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/toidentifier/HISTORY.md @@ -0,0 +1,9 @@ +1.0.1 / 2021-11-14 +================== + + * pref: enable strict mode + +1.0.0 / 2018-07-09 +================== + + * Initial release diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/toidentifier/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/toidentifier/LICENSE new file mode 100644 index 0000000..de22d15 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/toidentifier/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/toidentifier/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/toidentifier/README.md new file mode 100644 index 0000000..57e8a78 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/toidentifier/README.md @@ -0,0 +1,61 @@ +# toidentifier + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][codecov-image]][codecov-url] + +> Convert a string of words to a JavaScript identifier + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```bash +$ npm install toidentifier +``` + +## Example + +```js +var toIdentifier = require('toidentifier') + +console.log(toIdentifier('Bad Request')) +// => "BadRequest" +``` + +## API + +This CommonJS module exports a single default function: `toIdentifier`. + +### toIdentifier(string) + +Given a string as the argument, it will be transformed according to +the following rules and the new string will be returned: + +1. Split into words separated by space characters (`0x20`). +2. Upper case the first character of each word. +3. Join the words together with no separator. +4. Remove all non-word (`[0-9a-z_]`) characters. + +## License + +[MIT](LICENSE) + +[codecov-image]: https://img.shields.io/codecov/c/github/component/toidentifier.svg +[codecov-url]: https://codecov.io/gh/component/toidentifier +[downloads-image]: https://img.shields.io/npm/dm/toidentifier.svg +[downloads-url]: https://npmjs.org/package/toidentifier +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/component/toidentifier/ci/master?label=ci +[github-actions-ci-url]: https://github.com/component/toidentifier?query=workflow%3Aci +[npm-image]: https://img.shields.io/npm/v/toidentifier.svg +[npm-url]: https://npmjs.org/package/toidentifier + + +## + +[npm]: https://www.npmjs.com/ + +[yarn]: https://yarnpkg.com/ diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/toidentifier/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/toidentifier/index.js new file mode 100644 index 0000000..9295d02 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/toidentifier/index.js @@ -0,0 +1,32 @@ +/*! + * toidentifier + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = toIdentifier + +/** + * Trasform the given string into a JavaScript identifier + * + * @param {string} str + * @returns {string} + * @public + */ + +function toIdentifier (str) { + return str + .split(' ') + .map(function (token) { + return token.slice(0, 1).toUpperCase() + token.slice(1) + }) + .join('') + .replace(/[^ _0-9a-z]/gi, '') +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/toidentifier/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/toidentifier/package.json new file mode 100644 index 0000000..42db1a6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/toidentifier/package.json @@ -0,0 +1,38 @@ +{ + "name": "toidentifier", + "description": "Convert a string of words to a JavaScript identifier", + "version": "1.0.1", + "author": "Douglas Christopher Wilson ", + "contributors": [ + "Douglas Christopher Wilson ", + "Nick Baugh (http://niftylettuce.com/)" + ], + "repository": "component/toidentifier", + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.3", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.3.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.1.3", + "nyc": "15.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "license": "MIT", + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/touch/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/touch/LICENSE new file mode 100644 index 0000000..05eeeb8 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/touch/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/touch/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/touch/README.md new file mode 100644 index 0000000..b5a361e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/touch/README.md @@ -0,0 +1,52 @@ +# node-touch + +For all your node touching needs. + +## Installing + +```bash +npm install touch +``` + +## CLI Usage: + +See `man touch` + +This package exports a binary called `nodetouch` that works mostly +like the unix builtin `touch(1)`. + +## API Usage: + +```javascript +var touch = require("touch") +``` + +Gives you the following functions: + +* `touch(filename, options, cb)` +* `touch.sync(filename, options)` +* `touch.ftouch(fd, options, cb)` +* `touch.ftouchSync(fd, options)` + +All the `options` objects are optional. + +All the async functions return a Promise. If a callback function is +provided, then it's attached to the Promise. + +## Options + +* `force` like `touch -f` Boolean +* `time` like `touch -t ` Can be a Date object, or any parseable + Date string, or epoch ms number. +* `atime` like `touch -a` Can be either a Boolean, or a Date. +* `mtime` like `touch -m` Can be either a Boolean, or a Date. +* `ref` like `touch -r ` Must be path to a file. +* `nocreate` like `touch -c` Boolean + +If neither `atime` nor `mtime` are set, then both values are set. If +one of them is set, then the other is not. + +## cli + +This package creates a `nodetouch` command line executable that works +very much like the unix builtin `touch(1)` diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/touch/bin/nodetouch.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/touch/bin/nodetouch.js new file mode 100644 index 0000000..f78f082 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/touch/bin/nodetouch.js @@ -0,0 +1,112 @@ +#!/usr/bin/env node +const touch = require("../index.js") + +const usage = code => { + console[code ? 'error' : 'log']( + 'usage:\n' + + 'touch [-acfm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file ...' + ) + process.exit(code) +} + +const singleFlags = { + a: 'atime', + m: 'mtime', + c: 'nocreate', + f: 'force' +} + +const singleOpts = { + r: 'ref', + t: 'time' +} + +const files = [] +const args = process.argv.slice(2) +const options = {} +for (let i = 0; i < args.length; i++) { + const arg = args[i] + if (!arg.match(/^-/)) { + files.push(arg) + continue + } + + // expand shorthands + if (arg.charAt(1) !== '-') { + const expand = [] + for (let f = 1; f < arg.length; f++) { + const fc = arg.charAt(f) + const sf = singleFlags[fc] + const so = singleOpts[fc] + if (sf) + expand.push('--' + sf) + else if (so) { + const soslice = arg.slice(f + 1) + const soval = soslice.charAt(0) === '=' ? soslice : '=' + soslice + expand.push('--' + so + soval) + f = arg.length + } else if (arg !== '-' + fc) + expand.push('-' + fc) + } + if (expand.length) { + args.splice.apply(args, [i, 1].concat(expand)) + i-- + continue + } + } + + const argsplit = arg.split('=') + const key = argsplit.shift().replace(/^\-\-/, '') + const val = argsplit.length ? argsplit.join('=') : null + + switch (key) { + case 'time': + const timestr = val || args[++i] + // [-t [[CC]YY]MMDDhhmm[.SS]] + const parsedtime = timestr.match( + /^(([0-9]{2})?([0-9]{2}))?([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})(\.([0-9]{2}))?$/ + ) + if (!parsedtime) { + console.error('touch: out of range or illegal ' + + 'time specification: ' + + '[[CC]YY]MMDDhhmm[.SS]') + process.exit(1) + } else { + const y = +parsedtime[1] + const year = parsedtime[2] ? y + : y <= 68 ? 2000 + y + : 1900 + y + + const MM = +parsedtime[4] - 1 + const dd = +parsedtime[5] + const hh = +parsedtime[6] + const mm = +parsedtime[7] + const ss = +parsedtime[8] + + options.time = new Date(Date.UTC(year, MM, dd, hh, mm, ss)) + } + continue + + case 'ref': + options.ref = val || args[++i] + continue + + case 'mtime': + case 'nocreate': + case 'atime': + case 'force': + options[key] = true + continue + + default: + console.error('touch: illegal option -- ' + arg) + usage(1) + } +} + +if (!files.length) + usage() + +process.exitCode = 0 +Promise.all(files.map(f => touch(f, options))) + .catch(er => process.exitCode = 1) diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/touch/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/touch/index.js new file mode 100644 index 0000000..fa6a8d7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/touch/index.js @@ -0,0 +1,224 @@ +'use strict' + +const EE = require('events').EventEmitter +const cons = require('constants') +const fs = require('fs') + +module.exports = (f, options, cb) => { + if (typeof options === 'function') + cb = options, options = {} + + const p = new Promise((res, rej) => { + new Touch(validOpts(options, f, null)) + .on('done', res).on('error', rej) + }) + + return cb ? p.then(res => cb(null, res), cb) : p +} + +module.exports.sync = module.exports.touchSync = (f, options) => + (new TouchSync(validOpts(options, f, null)), undefined) + +module.exports.ftouch = (fd, options, cb) => { + if (typeof options === 'function') + cb = options, options = {} + + const p = new Promise((res, rej) => { + new Touch(validOpts(options, null, fd)) + .on('done', res).on('error', rej) + }) + + return cb ? p.then(res => cb(null, res), cb) : p +} + +module.exports.ftouchSync = (fd, opt) => + (new TouchSync(validOpts(opt, null, fd)), undefined) + +const validOpts = (options, path, fd) => { + options = Object.create(options || {}) + options.fd = fd + options.path = path + + // {mtime: true}, {ctime: true} + // If set to something else, then treat as epoch ms value + const now = new Date(options.time || Date.now()).getTime() / 1000 + if (!options.atime && !options.mtime) + options.atime = options.mtime = now + else { + if (true === options.atime) + options.atime = now + + if (true === options.mtime) + options.mtime = now + } + + let oflags = 0 + if (!options.force) + oflags = oflags | cons.O_RDWR + + if (!options.nocreate) + oflags = oflags | cons.O_CREAT + + options.oflags = oflags + return options +} + +class Touch extends EE { + constructor (options) { + super(options) + this.fd = options.fd + this.path = options.path + this.atime = options.atime + this.mtime = options.mtime + this.ref = options.ref + this.nocreate = !!options.nocreate + this.force = !!options.force + this.closeAfter = options.closeAfter + this.oflags = options.oflags + this.options = options + + if (typeof this.fd !== 'number') { + this.closeAfter = true + this.open() + } else + this.onopen(null, this.fd) + } + + emit (ev, data) { + // we only emit when either done or erroring + // in both cases, need to close + this.close() + return super.emit(ev, data) + } + + close () { + if (typeof this.fd === 'number' && this.closeAfter) + fs.close(this.fd, () => {}) + } + + open () { + fs.open(this.path, this.oflags, (er, fd) => this.onopen(er, fd)) + } + + onopen (er, fd) { + if (er) { + if (er.code === 'EISDIR') + this.onopen(null, null) + else if (er.code === 'ENOENT' && this.nocreate) + this.emit('done') + else + this.emit('error', er) + } else { + this.fd = fd + if (this.ref) + this.statref() + else if (!this.atime || !this.mtime) + this.fstat() + else + this.futimes() + } + } + + statref () { + fs.stat(this.ref, (er, st) => { + if (er) + this.emit('error', er) + else + this.onstatref(st) + }) + } + + onstatref (st) { + this.atime = this.atime && st.atime.getTime()/1000 + this.mtime = this.mtime && st.mtime.getTime()/1000 + if (!this.atime || !this.mtime) + this.fstat() + else + this.futimes() + } + + fstat () { + const stat = this.fd ? 'fstat' : 'stat' + const target = this.fd || this.path + fs[stat](target, (er, st) => { + if (er) + this.emit('error', er) + else + this.onfstat(st) + }) + } + + onfstat (st) { + if (typeof this.atime !== 'number') + this.atime = st.atime.getTime()/1000 + + if (typeof this.mtime !== 'number') + this.mtime = st.mtime.getTime()/1000 + + this.futimes() + } + + futimes () { + const utimes = this.fd ? 'futimes' : 'utimes' + const target = this.fd || this.path + fs[utimes](target, ''+this.atime, ''+this.mtime, er => { + if (er) + this.emit('error', er) + else + this.emit('done') + }) + } +} + +class TouchSync extends Touch { + open () { + try { + this.onopen(null, fs.openSync(this.path, this.oflags)) + } catch (er) { + this.onopen(er) + } + } + + statref () { + let threw = true + try { + this.onstatref(fs.statSync(this.ref)) + threw = false + } finally { + if (threw) + this.close() + } + } + + fstat () { + let threw = true + const stat = this.fd ? 'fstatSync' : 'statSync' + const target = this.fd || this.path + try { + this.onfstat(fs[stat](target)) + threw = false + } finally { + if (threw) + this.close() + } + } + + futimes () { + let threw = true + const utimes = this.fd ? 'futimesSync' : 'utimesSync' + const target = this.fd || this.path + try { + fs[utimes](target, this.atime, this.mtime) + threw = false + } finally { + if (threw) + this.close() + } + this.emit('done') + } + + close () { + if (typeof this.fd === 'number' && this.closeAfter) + try { fs.closeSync(this.fd) } catch (er) {} + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/touch/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/touch/package.json new file mode 100644 index 0000000..a51c29b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/touch/package.json @@ -0,0 +1,25 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "touch", + "description": "like touch(1) in node", + "version": "3.1.1", + "repository": "git://github.com/isaacs/node-touch.git", + "bin": { + "nodetouch": "./bin/nodetouch.js" + }, + "license": "ISC", + "scripts": { + "test": "tap test/*.js --100 -J", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "devDependencies": { + "mutate-fs": "^1.1.0", + "tap": "^10.7.0" + }, + "files": [ + "index.js", + "bin/nodetouch.js" + ] +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/type-is/HISTORY.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/type-is/HISTORY.md new file mode 100644 index 0000000..6812655 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/type-is/HISTORY.md @@ -0,0 +1,292 @@ +2.0.1 / 2025-03-27 +========== + +2.0.0 / 2024-08-31 +========== + + * Drop node <18 + * Use `content-type@^1.0.5` and `media-typer@^1.0.0` for type validation + - No behavior changes, upgrades `media-typer` + * deps: mime-types@^3.0.0 + - Add `application/toml` with extension `.toml` + - Add `application/ubjson` with extension `.ubj` + - Add `application/x-keepass2` with extension `.kdbx` + - Add deprecated iWorks mime types and extensions + - Add extension `.amr` to `audio/amr` + - Add extension `.cjs` to `application/node` + - Add extension `.dbf` to `application/vnd.dbf` + - Add extension `.m4s` to `video/iso.segment` + - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + - Add extension `.mxmf` to `audio/mobile-xmf` + - Add extension `.opus` to `audio/ogg` + - Add extension `.rar` to `application/vnd.rar` + - Add extension `.td` to `application/urc-targetdesc+xml` + - Add extension `.trig` to `application/trig` + - Add extensions from IANA for `application/*+xml` types + - Add `image/avif` with extension `.avif` + - Add `image/ktx2` with extension `.ktx2` + - Add `image/vnd.ms-dds` with extension `.dds` + - Add new upstream MIME types + - Fix extension of `application/vnd.apple.keynote` to be `.key` + - Remove ambigious extensions from IANA for `application/*+xml` types + - Update primary extension to `.es` for `application/ecmascript` + +1.6.18 / 2019-04-26 +=================== + + * Fix regression passing request object to `typeis.is` + +1.6.17 / 2019-04-25 +=================== + + * deps: mime-types@~2.1.24 + - Add Apple file extensions from IANA + - Add extension `.csl` to `application/vnd.citationstyles.style+xml` + - Add extension `.es` to `application/ecmascript` + - Add extension `.nq` to `application/n-quads` + - Add extension `.nt` to `application/n-triples` + - Add extension `.owl` to `application/rdf+xml` + - Add extensions `.siv` and `.sieve` to `application/sieve` + - Add extensions from IANA for `image/*` types + - Add extensions from IANA for `model/*` types + - Add extensions to HEIC image types + - Add new mime types + - Add `text/mdx` with extension `.mdx` + * perf: prevent internal `throw` on invalid type + +1.6.16 / 2018-02-16 +=================== + + * deps: mime-types@~2.1.18 + - Add `application/raml+yaml` with extension `.raml` + - Add `application/wasm` with extension `.wasm` + - Add `text/shex` with extension `.shex` + - Add extensions for JPEG-2000 images + - Add extensions from IANA for `message/*` types + - Add extension `.mjs` to `application/javascript` + - Add extension `.wadl` to `application/vnd.sun.wadl+xml` + - Add extension `.gz` to `application/gzip` + - Add glTF types and extensions + - Add new mime types + - Update extensions `.md` and `.markdown` to be `text/markdown` + - Update font MIME types + - Update `text/hjson` to registered `application/hjson` + +1.6.15 / 2017-03-31 +=================== + + * deps: mime-types@~2.1.15 + - Add new mime types + +1.6.14 / 2016-11-18 +=================== + + * deps: mime-types@~2.1.13 + - Add new mime types + +1.6.13 / 2016-05-18 +=================== + + * deps: mime-types@~2.1.11 + - Add new mime types + +1.6.12 / 2016-02-28 +=================== + + * deps: mime-types@~2.1.10 + - Add new mime types + - Fix extension of `application/dash+xml` + - Update primary extension for `audio/mp4` + +1.6.11 / 2016-01-29 +=================== + + * deps: mime-types@~2.1.9 + - Add new mime types + +1.6.10 / 2015-12-01 +=================== + + * deps: mime-types@~2.1.8 + - Add new mime types + +1.6.9 / 2015-09-27 +================== + + * deps: mime-types@~2.1.7 + - Add new mime types + +1.6.8 / 2015-09-04 +================== + + * deps: mime-types@~2.1.6 + - Add new mime types + +1.6.7 / 2015-08-20 +================== + + * Fix type error when given invalid type to match against + * deps: mime-types@~2.1.5 + - Add new mime types + +1.6.6 / 2015-07-31 +================== + + * deps: mime-types@~2.1.4 + - Add new mime types + +1.6.5 / 2015-07-16 +================== + + * deps: mime-types@~2.1.3 + - Add new mime types + +1.6.4 / 2015-07-01 +================== + + * deps: mime-types@~2.1.2 + - Add new mime types + * perf: enable strict mode + * perf: remove argument reassignment + +1.6.3 / 2015-06-08 +================== + + * deps: mime-types@~2.1.1 + - Add new mime types + * perf: reduce try block size + * perf: remove bitwise operations + +1.6.2 / 2015-05-10 +================== + + * deps: mime-types@~2.0.11 + - Add new mime types + +1.6.1 / 2015-03-13 +================== + + * deps: mime-types@~2.0.10 + - Add new mime types + +1.6.0 / 2015-02-12 +================== + + * fix false-positives in `hasBody` `Transfer-Encoding` check + * support wildcard for both type and subtype (`*/*`) + +1.5.7 / 2015-02-09 +================== + + * fix argument reassignment + * deps: mime-types@~2.0.9 + - Add new mime types + +1.5.6 / 2015-01-29 +================== + + * deps: mime-types@~2.0.8 + - Add new mime types + +1.5.5 / 2014-12-30 +================== + + * deps: mime-types@~2.0.7 + - Add new mime types + - Fix missing extensions + - Fix various invalid MIME type entries + - Remove example template MIME types + - deps: mime-db@~1.5.0 + +1.5.4 / 2014-12-10 +================== + + * deps: mime-types@~2.0.4 + - Add new mime types + - deps: mime-db@~1.3.0 + +1.5.3 / 2014-11-09 +================== + + * deps: mime-types@~2.0.3 + - Add new mime types + - deps: mime-db@~1.2.0 + +1.5.2 / 2014-09-28 +================== + + * deps: mime-types@~2.0.2 + - Add new mime types + - deps: mime-db@~1.1.0 + +1.5.1 / 2014-09-07 +================== + + * Support Node.js 0.6 + * deps: media-typer@0.3.0 + * deps: mime-types@~2.0.1 + - Support Node.js 0.6 + +1.5.0 / 2014-09-05 +================== + + * fix `hasbody` to be true for `content-length: 0` + +1.4.0 / 2014-09-02 +================== + + * update mime-types + +1.3.2 / 2014-06-24 +================== + + * use `~` range on mime-types + +1.3.1 / 2014-06-19 +================== + + * fix global variable leak + +1.3.0 / 2014-06-19 +================== + + * improve type parsing + + - invalid media type never matches + - media type not case-sensitive + - extra LWS does not affect results + +1.2.2 / 2014-06-19 +================== + + * fix behavior on unknown type argument + +1.2.1 / 2014-06-03 +================== + + * switch dependency from `mime` to `mime-types@1.0.0` + +1.2.0 / 2014-05-11 +================== + + * support suffix matching: + + - `+json` matches `application/vnd+json` + - `*/vnd+json` matches `application/vnd+json` + - `application/*+json` matches `application/vnd+json` + +1.1.0 / 2014-04-12 +================== + + * add non-array values support + * expose internal utilities: + + - `.is()` + - `.hasBody()` + - `.normalize()` + - `.match()` + +1.0.1 / 2014-03-30 +================== + + * add `multipart` as a shorthand diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/type-is/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/type-is/LICENSE new file mode 100644 index 0000000..386b7b6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/type-is/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/type-is/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/type-is/README.md new file mode 100644 index 0000000..d23946e --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/type-is/README.md @@ -0,0 +1,198 @@ +# type-is + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Infer the content-type of a request. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install type-is +``` + +## API + +```js +var http = require('http') +var typeis = require('type-is') + +http.createServer(function (req, res) { + var istext = typeis(req, ['text/*']) + res.end('you ' + (istext ? 'sent' : 'did not send') + ' me text') +}) +``` + +### typeis(request, types) + +Checks if the `request` is one of the `types`. If the request has no body, +even if there is a `Content-Type` header, then `null` is returned. If the +`Content-Type` header is invalid or does not matches any of the `types`, then +`false` is returned. Otherwise, a string of the type that matched is returned. + +The `request` argument is expected to be a Node.js HTTP request. The `types` +argument is an array of type strings. + +Each type in the `types` array can be one of the following: + +- A file extension name such as `json`. This name will be returned if matched. +- A mime type such as `application/json`. +- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`. + The full mime type will be returned if matched. +- A suffix such as `+json`. This can be combined with a wildcard such as + `*/vnd+json` or `application/*+json`. The full mime type will be returned + if matched. + +Some examples to illustrate the inputs and returned value: + +```js +// req.headers.content-type = 'application/json' + +typeis(req, ['json']) // => 'json' +typeis(req, ['html', 'json']) // => 'json' +typeis(req, ['application/*']) // => 'application/json' +typeis(req, ['application/json']) // => 'application/json' + +typeis(req, ['html']) // => false +``` + +### typeis.hasBody(request) + +Returns a Boolean if the given `request` has a body, regardless of the +`Content-Type` header. + +Having a body has no relation to how large the body is (it may be 0 bytes). +This is similar to how file existence works. If a body does exist, then this +indicates that there is data to read from the Node.js request stream. + +```js +if (typeis.hasBody(req)) { + // read the body, since there is one + + req.on('data', function (chunk) { + // ... + }) +} +``` + +### typeis.is(mediaType, types) + +Checks if the `mediaType` is one of the `types`. If the `mediaType` is invalid +or does not matches any of the `types`, then `false` is returned. Otherwise, a +string of the type that matched is returned. + +The `mediaType` argument is expected to be a +[media type](https://tools.ietf.org/html/rfc6838) string. The `types` argument +is an array of type strings. + +Each type in the `types` array can be one of the following: + +- A file extension name such as `json`. This name will be returned if matched. +- A mime type such as `application/json`. +- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`. + The full mime type will be returned if matched. +- A suffix such as `+json`. This can be combined with a wildcard such as + `*/vnd+json` or `application/*+json`. The full mime type will be returned + if matched. + +Some examples to illustrate the inputs and returned value: + +```js +var mediaType = 'application/json' + +typeis.is(mediaType, ['json']) // => 'json' +typeis.is(mediaType, ['html', 'json']) // => 'json' +typeis.is(mediaType, ['application/*']) // => 'application/json' +typeis.is(mediaType, ['application/json']) // => 'application/json' + +typeis.is(mediaType, ['html']) // => false +``` + +### typeis.match(expected, actual) + +Match the type string `expected` with `actual`, taking in to account wildcards. +A wildcard can only be in the type of the subtype part of a media type and only +in the `expected` value (as `actual` should be the real media type to match). A +suffix can still be included even with a wildcard subtype. If an input is +malformed, `false` will be returned. + +```js +typeis.match('text/html', 'text/html') // => true +typeis.match('*/html', 'text/html') // => true +typeis.match('text/*', 'text/html') // => true +typeis.match('*/*', 'text/html') // => true +typeis.match('*/*+json', 'application/x-custom+json') // => true +``` + +### typeis.normalize(type) + +Normalize a `type` string. This works by performing the following: + +- If the `type` is not a string, `false` is returned. +- If the string starts with `+` (so it is a `+suffix` shorthand like `+json`), + then it is expanded to contain the complete wildcard notation of `*/*+suffix`. +- If the string contains a `/`, then it is returned as the type. +- Else the string is assumed to be a file extension and the mapped media type is + returned, or `false` is there is no mapping. + +This includes two special mappings: + +- `'multipart'` -> `'multipart/*'` +- `'urlencoded'` -> `'application/x-www-form-urlencoded'` + +## Examples + +### Example body parser + +```js +var express = require('express') +var typeis = require('type-is') + +var app = express() + +app.use(function bodyParser (req, res, next) { + if (!typeis.hasBody(req)) { + return next() + } + + switch (typeis(req, ['urlencoded', 'json', 'multipart'])) { + case 'urlencoded': + // parse urlencoded body + throw new Error('implement urlencoded body parsing') + case 'json': + // parse json body + throw new Error('implement json body parsing') + case 'multipart': + // parse multipart body + throw new Error('implement multipart body parsing') + default: + // 415 error code + res.statusCode = 415 + res.end() + break + } +}) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/type-is/master?label=ci +[ci-url]: https://github.com/jshttp/type-is/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/type-is/master +[coveralls-url]: https://coveralls.io/r/jshttp/type-is?branch=master +[node-version-image]: https://badgen.net/npm/node/type-is +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/type-is +[npm-url]: https://npmjs.org/package/type-is +[npm-version-image]: https://badgen.net/npm/v/type-is +[travis-image]: https://badgen.net/travis/jshttp/type-is/master +[travis-url]: https://travis-ci.org/jshttp/type-is diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/type-is/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/type-is/index.js new file mode 100644 index 0000000..e773845 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/type-is/index.js @@ -0,0 +1,250 @@ +/*! + * type-is + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var contentType = require('content-type') +var mime = require('mime-types') +var typer = require('media-typer') + +/** + * Module exports. + * @public + */ + +module.exports = typeofrequest +module.exports.is = typeis +module.exports.hasBody = hasbody +module.exports.normalize = normalize +module.exports.match = mimeMatch + +/** + * Compare a `value` content-type with `types`. + * Each `type` can be an extension like `html`, + * a special shortcut like `multipart` or `urlencoded`, + * or a mime type. + * + * If no types match, `false` is returned. + * Otherwise, the first `type` that matches is returned. + * + * @param {String} value + * @param {Array} types + * @public + */ + +function typeis (value, types_) { + var i + var types = types_ + + // remove parameters and normalize + var val = tryNormalizeType(value) + + // no type or invalid + if (!val) { + return false + } + + // support flattened arguments + if (types && !Array.isArray(types)) { + types = new Array(arguments.length - 1) + for (i = 0; i < types.length; i++) { + types[i] = arguments[i + 1] + } + } + + // no types, return the content type + if (!types || !types.length) { + return val + } + + var type + for (i = 0; i < types.length; i++) { + if (mimeMatch(normalize(type = types[i]), val)) { + return type[0] === '+' || type.indexOf('*') !== -1 + ? val + : type + } + } + + // no matches + return false +} + +/** + * Check if a request has a request body. + * A request with a body __must__ either have `transfer-encoding` + * or `content-length` headers set. + * http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3 + * + * @param {Object} request + * @return {Boolean} + * @public + */ + +function hasbody (req) { + return req.headers['transfer-encoding'] !== undefined || + !isNaN(req.headers['content-length']) +} + +/** + * Check if the incoming request contains the "Content-Type" + * header field, and it contains any of the give mime `type`s. + * If there is no request body, `null` is returned. + * If there is no content type, `false` is returned. + * Otherwise, it returns the first `type` that matches. + * + * Examples: + * + * // With Content-Type: text/html; charset=utf-8 + * this.is('html'); // => 'html' + * this.is('text/html'); // => 'text/html' + * this.is('text/*', 'application/json'); // => 'text/html' + * + * // When Content-Type is application/json + * this.is('json', 'urlencoded'); // => 'json' + * this.is('application/json'); // => 'application/json' + * this.is('html', 'application/*'); // => 'application/json' + * + * this.is('html'); // => false + * + * @param {Object} req + * @param {(String|Array)} types... + * @return {(String|false|null)} + * @public + */ + +function typeofrequest (req, types_) { + // no body + if (!hasbody(req)) return null + // support flattened arguments + var types = arguments.length > 2 + ? Array.prototype.slice.call(arguments, 1) + : types_ + // request content type + var value = req.headers['content-type'] + + return typeis(value, types) +} + +/** + * Normalize a mime type. + * If it's a shorthand, expand it to a valid mime type. + * + * In general, you probably want: + * + * var type = is(req, ['urlencoded', 'json', 'multipart']); + * + * Then use the appropriate body parsers. + * These three are the most common request body types + * and are thus ensured to work. + * + * @param {String} type + * @return {String|false|null} + * @public + */ + +function normalize (type) { + if (typeof type !== 'string') { + // invalid type + return false + } + + switch (type) { + case 'urlencoded': + return 'application/x-www-form-urlencoded' + case 'multipart': + return 'multipart/*' + } + + if (type[0] === '+') { + // "+json" -> "*/*+json" expando + return '*/*' + type + } + + return type.indexOf('/') === -1 + ? mime.lookup(type) + : type +} + +/** + * Check if `expected` mime type + * matches `actual` mime type with + * wildcard and +suffix support. + * + * @param {String} expected + * @param {String} actual + * @return {Boolean} + * @public + */ + +function mimeMatch (expected, actual) { + // invalid type + if (expected === false) { + return false + } + + // split types + var actualParts = actual.split('/') + var expectedParts = expected.split('/') + + // invalid format + if (actualParts.length !== 2 || expectedParts.length !== 2) { + return false + } + + // validate type + if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) { + return false + } + + // validate suffix wildcard + if (expectedParts[1].slice(0, 2) === '*+') { + return expectedParts[1].length <= actualParts[1].length + 1 && + expectedParts[1].slice(1) === actualParts[1].slice(1 - expectedParts[1].length) + } + + // validate subtype + if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) { + return false + } + + return true +} + +/** + * Normalize a type and remove parameters. + * + * @param {string} value + * @return {(string|null)} + * @private + */ +function normalizeType (value) { + // Parse the type + var type = contentType.parse(value).type + + return typer.test(type) ? type : null +} + +/** + * Try to normalize a type and remove parameters. + * + * @param {string} value + * @return {(string|null)} + * @private + */ +function tryNormalizeType (value) { + try { + return value ? normalizeType(value) : null + } catch (err) { + return null + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/type-is/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/type-is/package.json new file mode 100644 index 0000000..08586d2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/type-is/package.json @@ -0,0 +1,47 @@ +{ + "name": "type-is", + "description": "Infer the content-type of a request.", + "version": "2.0.1", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "repository": "jshttp/type-is", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.1", + "nyc": "15.1.0" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + }, + "keywords": [ + "content", + "type", + "checking" + ] +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/.github/workflows/release.yml b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/.github/workflows/release.yml new file mode 100644 index 0000000..e6ee886 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/.github/workflows/release.yml @@ -0,0 +1,25 @@ +name: Release +on: + push: + branches: + - master +jobs: + release: + name: Release + runs-on: ubuntu-18.04 + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: 16 + - name: Install dependencies + run: npm ci + - name: Test + run: npm run test + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/.jscsrc b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/.jscsrc new file mode 100644 index 0000000..9e01c9b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/.jscsrc @@ -0,0 +1,13 @@ +{ + "preset": "node-style-guide", + "requireCapitalizedComments": null, + "requireSpacesInAnonymousFunctionExpression": { + "beforeOpeningCurlyBrace": true, + "beforeOpeningRoundBrace": true + }, + "disallowSpacesInNamedFunctionExpression": { + "beforeOpeningRoundBrace": true + }, + "excludeFiles": ["node_modules/**"], + "disallowSpacesInFunction": null +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/.jshintrc b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/.jshintrc new file mode 100644 index 0000000..b47f672 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/.jshintrc @@ -0,0 +1,16 @@ +{ + "browser": false, + "camelcase": true, + "curly": true, + "devel": true, + "eqeqeq": true, + "forin": true, + "indent": 2, + "noarg": true, + "node": true, + "quotmark": "single", + "undef": true, + "strict": false, + "unused": true +} + diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/.travis.yml b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/.travis.yml new file mode 100644 index 0000000..a1ace24 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/.travis.yml @@ -0,0 +1,18 @@ +sudo: false +language: node_js +cache: + directories: + - node_modules +notifications: + email: false +node_js: + - '4' +before_install: + - npm i -g npm@^2.0.0 +before_script: + - npm prune +after_success: + - npm run semantic-release +branches: + except: + - "/^v\\d+\\.\\d+\\.\\d+$/" diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/LICENSE new file mode 100644 index 0000000..caaf03a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright © 2016 Remy Sharp, http://remysharp.com + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/README.md new file mode 100644 index 0000000..46a706b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/README.md @@ -0,0 +1,63 @@ +# undefsafe + +Simple *function* for retrieving deep object properties without getting "Cannot read property 'X' of undefined" + +Can also be used to safely set deep values. + +## Usage + +```js +var object = { + a: { + b: { + c: 1, + d: [1,2,3], + e: 'remy' + } + } +}; + +console.log(undefsafe(object, 'a.b.e')); // "remy" +console.log(undefsafe(object, 'a.b.not.found')); // undefined +``` + +Demo: [https://jsbin.com/eroqame/3/edit?js,console](https://jsbin.com/eroqame/3/edit?js,console) + +## Setting + +```js +var object = { + a: { + b: [1,2,3] + } +}; + +// modified object +var res = undefsafe(object, 'a.b.0', 10); + +console.log(object); // { a: { b: [10, 2, 3] } } +console.log(res); // 1 - previous value +``` + +## Star rules in paths + +As of 1.2.0, `undefsafe` supports a `*` in the path if you want to search all of the properties (or array elements) for a particular element. + +The function will only return a single result, either the 3rd argument validation value, or the first positive match. For example, the following github data: + +```js +const githubData = { + commits: [{ + modified: [ + "one", + "two" + ] + }, /* ... */ ] + }; + +// first modified file found in the first commit +console.log(undefsafe(githubData, 'commits.*.modified.0')); + +// returns `two` or undefined if not found +console.log(undefsafe(githubData, 'commits.*.modified.*', 'two')); +``` diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/example.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/example.js new file mode 100644 index 0000000..ed93c23 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/example.js @@ -0,0 +1,14 @@ +var undefsafe = require('undefsafe'); + +var object = { + a: { + b: { + c: 1, + d: [1, 2, 3], + e: 'remy' + } + } +}; + +console.log(undefsafe(object, 'a.b.e')); // "remy" +console.log(undefsafe(object, 'a.b.not.found')); // undefined diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/lib/undefsafe.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/lib/undefsafe.js new file mode 100644 index 0000000..7446878 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/lib/undefsafe.js @@ -0,0 +1,125 @@ +'use strict'; + +function undefsafe(obj, path, value, __res) { + // I'm not super keen on this private function, but it's because + // it'll also be use in the browser and I wont *one* function exposed + function split(path) { + var res = []; + var level = 0; + var key = ''; + + for (var i = 0; i < path.length; i++) { + var c = path.substr(i, 1); + + if (level === 0 && (c === '.' || c === '[')) { + if (c === '[') { + level++; + i++; + c = path.substr(i, 1); + } + + if (key) { + // the first value could be a string + res.push(key); + } + key = ''; + continue; + } + + if (c === ']') { + level--; + key = key.slice(0, -1); + continue; + } + + key += c; + } + + res.push(key); + + return res; + } + + // bail if there's nothing + if (obj === undefined || obj === null) { + return undefined; + } + + var parts = split(path); + var key = null; + var type = typeof obj; + var root = obj; + var parent = obj; + + var star = + parts.filter(function(_) { + return _ === '*'; + }).length > 0; + + // we're dealing with a primitive + if (type !== 'object' && type !== 'function') { + return obj; + } else if (path.trim() === '') { + return obj; + } + + key = parts[0]; + var i = 0; + for (; i < parts.length; i++) { + key = parts[i]; + parent = obj; + + if (key === '*') { + // loop through each property + var prop = ''; + var res = __res || []; + + for (prop in parent) { + var shallowObj = undefsafe( + obj[prop], + parts.slice(i + 1).join('.'), + value, + res + ); + if (shallowObj && shallowObj !== res) { + if ((value && shallowObj === value) || value === undefined) { + if (value !== undefined) { + return shallowObj; + } + + res.push(shallowObj); + } + } + } + + if (res.length === 0) { + return undefined; + } + + return res; + } + + if (Object.getOwnPropertyNames(obj).indexOf(key) == -1) { + return undefined; + } + + obj = obj[key]; + if (obj === undefined || obj === null) { + break; + } + } + + // if we have a null object, make sure it's the one the user was after, + // if it's not (i.e. parts has a length) then give undefined back. + if (obj === null && i !== parts.length - 1) { + obj = undefined; + } else if (!star && value) { + key = path.split('.').pop(); + parent[key] = value; + } + return obj; +} + +if (typeof module !== 'undefined') { + module.exports = undefsafe; +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/package.json new file mode 100644 index 0000000..a454233 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undefsafe/package.json @@ -0,0 +1,34 @@ +{ + "name": "undefsafe", + "description": "Undefined safe way of extracting object properties", + "main": "lib/undefsafe.js", + "tonicExampleFilename": "example.js", + "directories": { + "test": "test" + }, + "scripts": { + "test": "tap test/**/*.test.js -R spec", + "cover": "tap test/*.test.js --cov --coverage-report=lcov", + "semantic-release": "semantic-release" + }, + "prettier": { + "trailingComma": "none", + "singleQuote": true + }, + "repository": { + "type": "git", + "url": "https://github.com/remy/undefsafe.git" + }, + "keywords": [ + "undefined" + ], + "author": "Remy Sharp", + "license": "MIT", + "devDependencies": { + "semantic-release": "^18.0.0", + "tap": "^5.7.1", + "tap-only": "0.0.5" + }, + "dependencies": {}, + "version": "2.0.5" +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/LICENSE new file mode 100644 index 0000000..e7323bb --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Matteo Collina and Undici contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/README.md new file mode 100644 index 0000000..20a721c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/README.md @@ -0,0 +1,6 @@ +# undici-types + +This package is a dual-publish of the [undici](https://www.npmjs.com/package/undici) library types. The `undici` package **still contains types**. This package is for users who _only_ need undici types (such as for `@types/node`). It is published alongside every release of `undici`, so you can always use the same version. + +- [GitHub nodejs/undici](https://github.com/nodejs/undici) +- [Undici Documentation](https://undici.nodejs.org/#/) diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/agent.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/agent.d.ts new file mode 100644 index 0000000..b3b376d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/agent.d.ts @@ -0,0 +1,32 @@ +import { URL } from 'node:url' +import Pool from './pool' +import Dispatcher from './dispatcher' +import TClientStats from './client-stats' +import TPoolStats from './pool-stats' + +export default Agent + +declare class Agent extends Dispatcher { + constructor (opts?: Agent.Options) + /** `true` after `dispatcher.close()` has been called. */ + closed: boolean + /** `true` after `dispatcher.destroyed()` has been called or `dispatcher.close()` has been called and the dispatcher shutdown has completed. */ + destroyed: boolean + /** Dispatches a request. */ + dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean + /** Aggregate stats for a Agent by origin. */ + readonly stats: Record +} + +declare namespace Agent { + export interface Options extends Pool.Options { + /** Default: `(origin, opts) => new Pool(origin, opts)`. */ + factory?(origin: string | URL, opts: Object): Dispatcher; + + interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options['interceptors'] + maxOrigins?: number + } + + export interface DispatchOptions extends Dispatcher.DispatchOptions { + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/api.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/api.d.ts new file mode 100644 index 0000000..b362b14 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/api.d.ts @@ -0,0 +1,43 @@ +import { URL, UrlObject } from 'node:url' +import { Duplex } from 'node:stream' +import Dispatcher from './dispatcher' + +/** Performs an HTTP request. */ +declare function request ( + url: string | URL | UrlObject, + options?: { dispatcher?: Dispatcher } & Omit, 'origin' | 'path' | 'method'> & Partial>, +): Promise> + +/** A faster version of `request`. */ +declare function stream ( + url: string | URL | UrlObject, + options: { dispatcher?: Dispatcher } & Omit, 'origin' | 'path'>, + factory: Dispatcher.StreamFactory +): Promise> + +/** For easy use with `stream.pipeline`. */ +declare function pipeline ( + url: string | URL | UrlObject, + options: { dispatcher?: Dispatcher } & Omit, 'origin' | 'path'>, + handler: Dispatcher.PipelineHandler +): Duplex + +/** Starts two-way communications with the requested resource. */ +declare function connect ( + url: string | URL | UrlObject, + options?: { dispatcher?: Dispatcher } & Omit, 'origin' | 'path'> +): Promise> + +/** Upgrade to a different protocol. */ +declare function upgrade ( + url: string | URL | UrlObject, + options?: { dispatcher?: Dispatcher } & Omit +): Promise + +export { + request, + stream, + pipeline, + connect, + upgrade +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/balanced-pool.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/balanced-pool.d.ts new file mode 100644 index 0000000..1813e0c --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/balanced-pool.d.ts @@ -0,0 +1,30 @@ +import Pool from './pool' +import Dispatcher from './dispatcher' +import { URL } from 'node:url' + +export default BalancedPool + +type BalancedPoolConnectOptions = Omit + +declare class BalancedPool extends Dispatcher { + constructor (url: string | string[] | URL | URL[], options?: Pool.Options) + + addUpstream (upstream: string | URL): BalancedPool + removeUpstream (upstream: string | URL): BalancedPool + getUpstream (upstream: string | URL): Pool | undefined + upstreams: Array + + /** `true` after `pool.close()` has been called. */ + closed: boolean + /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */ + destroyed: boolean + + // Override dispatcher APIs. + override connect ( + options: BalancedPoolConnectOptions + ): Promise + override connect ( + options: BalancedPoolConnectOptions, + callback: (err: Error | null, data: Dispatcher.ConnectData) => void + ): void +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/cache-interceptor.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/cache-interceptor.d.ts new file mode 100644 index 0000000..013e207 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/cache-interceptor.d.ts @@ -0,0 +1,173 @@ +import { Readable, Writable } from 'node:stream' + +export default CacheHandler + +declare namespace CacheHandler { + export type CacheMethods = 'GET' | 'HEAD' | 'OPTIONS' | 'TRACE' + + export interface CacheHandlerOptions { + store: CacheStore + + cacheByDefault?: number + + type?: CacheOptions['type'] + } + + export interface CacheOptions { + store?: CacheStore + + /** + * The methods to cache + * Note we can only cache safe methods. Unsafe methods (i.e. PUT, POST) + * invalidate the cache for a origin. + * @see https://www.rfc-editor.org/rfc/rfc9111.html#name-invalidating-stored-respons + * @see https://www.rfc-editor.org/rfc/rfc9110#section-9.2.1 + */ + methods?: CacheMethods[] + + /** + * RFC9111 allows for caching responses that we aren't explicitly told to + * cache or to not cache. + * @see https://www.rfc-editor.org/rfc/rfc9111.html#section-3-5 + * @default undefined + */ + cacheByDefault?: number + + /** + * TODO docs + * @default 'shared' + */ + type?: 'shared' | 'private' + + } + + export interface CacheControlDirectives { + 'max-stale'?: number; + 'min-fresh'?: number; + 'max-age'?: number; + 's-maxage'?: number; + 'stale-while-revalidate'?: number; + 'stale-if-error'?: number; + public?: true; + private?: true | string[]; + 'no-store'?: true; + 'no-cache'?: true | string[]; + 'must-revalidate'?: true; + 'proxy-revalidate'?: true; + immutable?: true; + 'no-transform'?: true; + 'must-understand'?: true; + 'only-if-cached'?: true; + } + + export interface CacheKey { + origin: string + method: string + path: string + headers?: Record + } + + export interface CacheValue { + statusCode: number + statusMessage: string + headers: Record + vary?: Record + etag?: string + cacheControlDirectives?: CacheControlDirectives + cachedAt: number + staleAt: number + deleteAt: number + } + + export interface DeleteByUri { + origin: string + method: string + path: string + } + + type GetResult = { + statusCode: number + statusMessage: string + headers: Record + vary?: Record + etag?: string + body?: Readable | Iterable | AsyncIterable | Buffer | Iterable | AsyncIterable | string + cacheControlDirectives: CacheControlDirectives, + cachedAt: number + staleAt: number + deleteAt: number + } + + /** + * Underlying storage provider for cached responses + */ + export interface CacheStore { + get(key: CacheKey): GetResult | Promise | undefined + + createWriteStream(key: CacheKey, val: CacheValue): Writable | undefined + + delete(key: CacheKey): void | Promise + } + + export interface MemoryCacheStoreOpts { + /** + * @default Infinity + */ + maxCount?: number + + /** + * @default Infinity + */ + maxSize?: number + + /** + * @default Infinity + */ + maxEntrySize?: number + + errorCallback?: (err: Error) => void + } + + export class MemoryCacheStore implements CacheStore { + constructor (opts?: MemoryCacheStoreOpts) + + get (key: CacheKey): GetResult | Promise | undefined + + createWriteStream (key: CacheKey, value: CacheValue): Writable | undefined + + delete (key: CacheKey): void | Promise + } + + export interface SqliteCacheStoreOpts { + /** + * Location of the database + * @default ':memory:' + */ + location?: string + + /** + * @default Infinity + */ + maxCount?: number + + /** + * @default Infinity + */ + maxEntrySize?: number + } + + export class SqliteCacheStore implements CacheStore { + constructor (opts?: SqliteCacheStoreOpts) + + /** + * Closes the connection to the database + */ + close (): void + + get (key: CacheKey): GetResult | Promise | undefined + + createWriteStream (key: CacheKey, value: CacheValue): Writable | undefined + + delete (key: CacheKey): void | Promise + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/cache.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/cache.d.ts new file mode 100644 index 0000000..4c33335 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/cache.d.ts @@ -0,0 +1,36 @@ +import type { RequestInfo, Response, Request } from './fetch' + +export interface CacheStorage { + match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise, + has (cacheName: string): Promise, + open (cacheName: string): Promise, + delete (cacheName: string): Promise, + keys (): Promise +} + +declare const CacheStorage: { + prototype: CacheStorage + new(): CacheStorage +} + +export interface Cache { + match (request: RequestInfo, options?: CacheQueryOptions): Promise, + matchAll (request?: RequestInfo, options?: CacheQueryOptions): Promise, + add (request: RequestInfo): Promise, + addAll (requests: RequestInfo[]): Promise, + put (request: RequestInfo, response: Response): Promise, + delete (request: RequestInfo, options?: CacheQueryOptions): Promise, + keys (request?: RequestInfo, options?: CacheQueryOptions): Promise +} + +export interface CacheQueryOptions { + ignoreSearch?: boolean, + ignoreMethod?: boolean, + ignoreVary?: boolean +} + +export interface MultiCacheQueryOptions extends CacheQueryOptions { + cacheName?: string +} + +export declare const caches: CacheStorage diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/client-stats.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/client-stats.d.ts new file mode 100644 index 0000000..ad9bd84 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/client-stats.d.ts @@ -0,0 +1,15 @@ +import Client from './client' + +export default ClientStats + +declare class ClientStats { + constructor (pool: Client) + /** If socket has open connection. */ + connected: boolean + /** Number of open socket connections in this client that do not have an active request. */ + pending: number + /** Number of currently active requests of this client. */ + running: number + /** Number of active, pending, or queued requests of this client. */ + size: number +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/client.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/client.d.ts new file mode 100644 index 0000000..04b8f29 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/client.d.ts @@ -0,0 +1,108 @@ +import { URL } from 'node:url' +import Dispatcher from './dispatcher' +import buildConnector from './connector' +import TClientStats from './client-stats' + +type ClientConnectOptions = Omit + +/** + * A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default. + */ +export class Client extends Dispatcher { + constructor (url: string | URL, options?: Client.Options) + /** Property to get and set the pipelining factor. */ + pipelining: number + /** `true` after `client.close()` has been called. */ + closed: boolean + /** `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed. */ + destroyed: boolean + /** Aggregate stats for a Client. */ + readonly stats: TClientStats + + // Override dispatcher APIs. + override connect ( + options: ClientConnectOptions + ): Promise + override connect ( + options: ClientConnectOptions, + callback: (err: Error | null, data: Dispatcher.ConnectData) => void + ): void +} + +export declare namespace Client { + export interface OptionsInterceptors { + Client: readonly Dispatcher.DispatchInterceptor[]; + } + export interface Options { + /** TODO */ + interceptors?: OptionsInterceptors; + /** The maximum length of request headers in bytes. Default: Node.js' `--max-http-header-size` or `16384` (16KiB). */ + maxHeaderSize?: number; + /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers (Node 14 and above only). Default: `300e3` milliseconds (300s). */ + headersTimeout?: number; + /** @deprecated unsupported socketTimeout, use headersTimeout & bodyTimeout instead */ + socketTimeout?: never; + /** @deprecated unsupported requestTimeout, use headersTimeout & bodyTimeout instead */ + requestTimeout?: never; + /** TODO */ + connectTimeout?: number; + /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use `0` to disable it entirely. Default: `300e3` milliseconds (300s). */ + bodyTimeout?: number; + /** @deprecated unsupported idleTimeout, use keepAliveTimeout instead */ + idleTimeout?: never; + /** @deprecated unsupported keepAlive, use pipelining=0 instead */ + keepAlive?: never; + /** the timeout, in milliseconds, after which a socket without active requests will time out. Monitors time between activity on a connected socket. This value may be overridden by *keep-alive* hints from the server. Default: `4e3` milliseconds (4s). */ + keepAliveTimeout?: number; + /** @deprecated unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead */ + maxKeepAliveTimeout?: never; + /** the maximum allowed `idleTimeout`, in milliseconds, when overridden by *keep-alive* hints from the server. Default: `600e3` milliseconds (10min). */ + keepAliveMaxTimeout?: number; + /** A number of milliseconds subtracted from server *keep-alive* hints when overriding `idleTimeout` to account for timing inaccuracies caused by e.g. transport latency. Default: `1e3` milliseconds (1s). */ + keepAliveTimeoutThreshold?: number; + /** TODO */ + socketPath?: string; + /** The amount of concurrent requests to be sent over the single TCP/TLS connection according to [RFC7230](https://tools.ietf.org/html/rfc7230#section-6.3.2). Default: `1`. */ + pipelining?: number; + /** @deprecated use the connect option instead */ + tls?: never; + /** If `true`, an error is thrown when the request content-length header doesn't match the length of the request body. Default: `true`. */ + strictContentLength?: boolean; + /** TODO */ + maxCachedSessions?: number; + /** TODO */ + connect?: Partial | buildConnector.connector; + /** TODO */ + maxRequestsPerClient?: number; + /** TODO */ + localAddress?: string; + /** Max response body size in bytes, -1 is disabled */ + maxResponseSize?: number; + /** Enables a family autodetection algorithm that loosely implements section 5 of RFC 8305. */ + autoSelectFamily?: boolean; + /** The amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the `autoSelectFamily` option. */ + autoSelectFamilyAttemptTimeout?: number; + /** + * @description Enables support for H2 if the server has assigned bigger priority to it through ALPN negotiation. + * @default false + */ + allowH2?: boolean; + /** + * @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame. + * @default 100 + */ + maxConcurrentStreams?: number; + } + export interface SocketInfo { + localAddress?: string + localPort?: number + remoteAddress?: string + remotePort?: number + remoteFamily?: string + timeout?: number + bytesWritten?: number + bytesRead?: number + } +} + +export default Client diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/connector.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/connector.d.ts new file mode 100644 index 0000000..3376df7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/connector.d.ts @@ -0,0 +1,34 @@ +import { TLSSocket, ConnectionOptions } from 'node:tls' +import { IpcNetConnectOpts, Socket, TcpNetConnectOpts } from 'node:net' + +export default buildConnector +declare function buildConnector (options?: buildConnector.BuildOptions): buildConnector.connector + +declare namespace buildConnector { + export type BuildOptions = (ConnectionOptions | TcpNetConnectOpts | IpcNetConnectOpts) & { + allowH2?: boolean; + maxCachedSessions?: number | null; + socketPath?: string | null; + timeout?: number | null; + port?: number; + keepAlive?: boolean | null; + keepAliveInitialDelay?: number | null; + } + + export interface Options { + hostname: string + host?: string + protocol: string + port: string + servername?: string + localAddress?: string | null + httpSocket?: Socket + } + + export type Callback = (...args: CallbackArgs) => void + type CallbackArgs = [null, Socket | TLSSocket] | [Error, null] + + export interface connector { + (options: buildConnector.Options, callback: buildConnector.Callback): void + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/content-type.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/content-type.d.ts new file mode 100644 index 0000000..f2a87f1 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/content-type.d.ts @@ -0,0 +1,21 @@ +/// + +interface MIMEType { + type: string + subtype: string + parameters: Map + essence: string +} + +/** + * Parse a string to a {@link MIMEType} object. Returns `failure` if the string + * couldn't be parsed. + * @see https://mimesniff.spec.whatwg.org/#parse-a-mime-type + */ +export function parseMIMEType (input: string): 'failure' | MIMEType + +/** + * Convert a MIMEType object to a string. + * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type + */ +export function serializeAMimeType (mimeType: MIMEType): string diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/cookies.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/cookies.d.ts new file mode 100644 index 0000000..f746d35 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/cookies.d.ts @@ -0,0 +1,30 @@ +/// + +import type { Headers } from './fetch' + +export interface Cookie { + name: string + value: string + expires?: Date | number + maxAge?: number + domain?: string + path?: string + secure?: boolean + httpOnly?: boolean + sameSite?: 'Strict' | 'Lax' | 'None' + unparsed?: string[] +} + +export function deleteCookie ( + headers: Headers, + name: string, + attributes?: { name?: string, domain?: string } +): void + +export function getCookies (headers: Headers): Record + +export function getSetCookies (headers: Headers): Cookie[] + +export function setCookie (headers: Headers, cookie: Cookie): void + +export function parseCookie (cookie: string): Cookie | null diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/diagnostics-channel.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/diagnostics-channel.d.ts new file mode 100644 index 0000000..3c6a529 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/diagnostics-channel.d.ts @@ -0,0 +1,74 @@ +import { Socket } from 'node:net' +import { URL } from 'node:url' +import buildConnector from './connector' +import Dispatcher from './dispatcher' + +declare namespace DiagnosticsChannel { + interface Request { + origin?: string | URL; + completed: boolean; + method?: Dispatcher.HttpMethod; + path: string; + headers: any; + } + interface Response { + statusCode: number; + statusText: string; + headers: Array; + } + interface ConnectParams { + host: URL['host']; + hostname: URL['hostname']; + protocol: URL['protocol']; + port: URL['port']; + servername: string | null; + } + type Connector = buildConnector.connector + export interface RequestCreateMessage { + request: Request; + } + export interface RequestBodySentMessage { + request: Request; + } + + export interface RequestBodyChunkSentMessage { + request: Request; + chunk: Uint8Array | string; + } + export interface RequestBodyChunkReceivedMessage { + request: Request; + chunk: Buffer; + } + export interface RequestHeadersMessage { + request: Request; + response: Response; + } + export interface RequestTrailersMessage { + request: Request; + trailers: Array; + } + export interface RequestErrorMessage { + request: Request; + error: Error; + } + export interface ClientSendHeadersMessage { + request: Request; + headers: string; + socket: Socket; + } + export interface ClientBeforeConnectMessage { + connectParams: ConnectParams; + connector: Connector; + } + export interface ClientConnectedMessage { + socket: Socket; + connectParams: ConnectParams; + connector: Connector; + } + export interface ClientConnectErrorMessage { + error: Error; + socket: Socket; + connectParams: ConnectParams; + connector: Connector; + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/dispatcher.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/dispatcher.d.ts new file mode 100644 index 0000000..13b33ec --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/dispatcher.d.ts @@ -0,0 +1,276 @@ +import { URL } from 'node:url' +import { Duplex, Readable, Writable } from 'node:stream' +import { EventEmitter } from 'node:events' +import { Blob } from 'node:buffer' +import { IncomingHttpHeaders } from './header' +import BodyReadable from './readable' +import { FormData } from './formdata' +import Errors from './errors' +import { Autocomplete } from './utility' + +type AbortSignal = unknown + +export default Dispatcher + +export type UndiciHeaders = Record | IncomingHttpHeaders | string[] | Iterable<[string, string | string[] | undefined]> | null + +/** Dispatcher is the core API used to dispatch requests. */ +declare class Dispatcher extends EventEmitter { + /** Dispatches a request. This API is expected to evolve through semver-major versions and is less stable than the preceding higher level APIs. It is primarily intended for library developers who implement higher level APIs on top of this. */ + dispatch (options: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean + /** Starts two-way communications with the requested resource. */ + connect(options: Dispatcher.ConnectOptions, callback: (err: Error | null, data: Dispatcher.ConnectData) => void): void + connect(options: Dispatcher.ConnectOptions): Promise> + /** Compose a chain of dispatchers */ + compose (dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher + compose (...dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher + /** Performs an HTTP request. */ + request(options: Dispatcher.RequestOptions, callback: (err: Error | null, data: Dispatcher.ResponseData) => void): void + request(options: Dispatcher.RequestOptions): Promise> + /** For easy use with `stream.pipeline`. */ + pipeline(options: Dispatcher.PipelineOptions, handler: Dispatcher.PipelineHandler): Duplex + /** A faster version of `Dispatcher.request`. */ + stream(options: Dispatcher.RequestOptions, factory: Dispatcher.StreamFactory, callback: (err: Error | null, data: Dispatcher.StreamData) => void): void + stream(options: Dispatcher.RequestOptions, factory: Dispatcher.StreamFactory): Promise> + /** Upgrade to a different protocol. */ + upgrade (options: Dispatcher.UpgradeOptions, callback: (err: Error | null, data: Dispatcher.UpgradeData) => void): void + upgrade (options: Dispatcher.UpgradeOptions): Promise + /** Closes the client and gracefully waits for enqueued requests to complete before invoking the callback (or returning a promise if no callback is provided). */ + close (callback: () => void): void + close (): Promise + /** Destroy the client abruptly with the given err. All the pending and running requests will be asynchronously aborted and error. Waits until socket is closed before invoking the callback (or returning a promise if no callback is provided). Since this operation is asynchronously dispatched there might still be some progress on dispatched requests. */ + destroy (err: Error | null, callback: () => void): void + destroy (callback: () => void): void + destroy (err: Error | null): Promise + destroy (): Promise + + on (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this + on (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this + on (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this + on (eventName: 'drain', callback: (origin: URL) => void): this + + once (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this + once (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this + once (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this + once (eventName: 'drain', callback: (origin: URL) => void): this + + off (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this + off (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this + off (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this + off (eventName: 'drain', callback: (origin: URL) => void): this + + addListener (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this + addListener (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this + addListener (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this + addListener (eventName: 'drain', callback: (origin: URL) => void): this + + removeListener (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this + removeListener (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this + removeListener (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this + removeListener (eventName: 'drain', callback: (origin: URL) => void): this + + prependListener (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this + prependListener (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this + prependListener (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this + prependListener (eventName: 'drain', callback: (origin: URL) => void): this + + prependOnceListener (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this + prependOnceListener (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this + prependOnceListener (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this + prependOnceListener (eventName: 'drain', callback: (origin: URL) => void): this + + listeners (eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[] + listeners (eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[] + listeners (eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[] + listeners (eventName: 'drain'): ((origin: URL) => void)[] + + rawListeners (eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[] + rawListeners (eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[] + rawListeners (eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[] + rawListeners (eventName: 'drain'): ((origin: URL) => void)[] + + emit (eventName: 'connect', origin: URL, targets: readonly Dispatcher[]): boolean + emit (eventName: 'disconnect', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean + emit (eventName: 'connectionError', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean + emit (eventName: 'drain', origin: URL): boolean +} + +declare namespace Dispatcher { + export interface ComposedDispatcher extends Dispatcher {} + export type Dispatch = Dispatcher['dispatch'] + export type DispatcherComposeInterceptor = (dispatch: Dispatch) => Dispatch + export interface DispatchOptions { + origin?: string | URL; + path: string; + method: HttpMethod; + /** Default: `null` */ + body?: string | Buffer | Uint8Array | Readable | null | FormData; + /** Default: `null` */ + headers?: UndiciHeaders; + /** Query string params to be embedded in the request URL. Default: `null` */ + query?: Record; + /** Whether the requests can be safely retried or not. If `false` the request won't be sent until all preceding requests in the pipeline have completed. Default: `true` if `method` is `HEAD` or `GET`. */ + idempotent?: boolean; + /** Whether the response is expected to take a long time and would end up blocking the pipeline. When this is set to `true` further pipelining will be avoided on the same connection until headers have been received. Defaults to `method !== 'HEAD'`. */ + blocking?: boolean; + /** Upgrade the request. Should be used to specify the kind of upgrade i.e. `'Websocket'`. Default: `method === 'CONNECT' || null`. */ + upgrade?: boolean | string | null; + /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers. Defaults to 300 seconds. */ + headersTimeout?: number | null; + /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use 0 to disable it entirely. Defaults to 300 seconds. */ + bodyTimeout?: number | null; + /** Whether the request should stablish a keep-alive or not. Default `false` */ + reset?: boolean; + /** Whether Undici should throw an error upon receiving a 4xx or 5xx response from the server. Defaults to false */ + throwOnError?: boolean; + /** For H2, it appends the expect: 100-continue header, and halts the request body until a 100-continue is received from the remote server */ + expectContinue?: boolean; + } + export interface ConnectOptions { + origin: string | URL; + path: string; + /** Default: `null` */ + headers?: UndiciHeaders; + /** Default: `null` */ + signal?: AbortSignal | EventEmitter | null; + /** This argument parameter is passed through to `ConnectData` */ + opaque?: TOpaque; + /** Default: false */ + redirectionLimitReached?: boolean; + /** Default: `null` */ + responseHeaders?: 'raw' | null; + } + export interface RequestOptions extends DispatchOptions { + /** Default: `null` */ + opaque?: TOpaque; + /** Default: `null` */ + signal?: AbortSignal | EventEmitter | null; + /** Default: false */ + redirectionLimitReached?: boolean; + /** Default: `null` */ + onInfo?: (info: { statusCode: number, headers: Record }) => void; + /** Default: `null` */ + responseHeaders?: 'raw' | null; + /** Default: `64 KiB` */ + highWaterMark?: number; + } + export interface PipelineOptions extends RequestOptions { + /** `true` if the `handler` will return an object stream. Default: `false` */ + objectMode?: boolean; + } + export interface UpgradeOptions { + path: string; + /** Default: `'GET'` */ + method?: string; + /** Default: `null` */ + headers?: UndiciHeaders; + /** A string of comma separated protocols, in descending preference order. Default: `'Websocket'` */ + protocol?: string; + /** Default: `null` */ + signal?: AbortSignal | EventEmitter | null; + /** Default: false */ + redirectionLimitReached?: boolean; + /** Default: `null` */ + responseHeaders?: 'raw' | null; + } + export interface ConnectData { + statusCode: number; + headers: IncomingHttpHeaders; + socket: Duplex; + opaque: TOpaque; + } + export interface ResponseData { + statusCode: number; + headers: IncomingHttpHeaders; + body: BodyReadable & BodyMixin; + trailers: Record; + opaque: TOpaque; + context: object; + } + export interface PipelineHandlerData { + statusCode: number; + headers: IncomingHttpHeaders; + opaque: TOpaque; + body: BodyReadable; + context: object; + } + export interface StreamData { + opaque: TOpaque; + trailers: Record; + } + export interface UpgradeData { + headers: IncomingHttpHeaders; + socket: Duplex; + opaque: TOpaque; + } + export interface StreamFactoryData { + statusCode: number; + headers: IncomingHttpHeaders; + opaque: TOpaque; + context: object; + } + export type StreamFactory = (data: StreamFactoryData) => Writable + + export interface DispatchController { + get aborted () : boolean + get paused () : boolean + get reason () : Error | null + abort (reason: Error): void + pause(): void + resume(): void + } + + export interface DispatchHandler { + onRequestStart?(controller: DispatchController, context: any): void; + onRequestUpgrade?(controller: DispatchController, statusCode: number, headers: IncomingHttpHeaders, socket: Duplex): void; + onResponseStart?(controller: DispatchController, statusCode: number, headers: IncomingHttpHeaders, statusMessage?: string): void; + onResponseData?(controller: DispatchController, chunk: Buffer): void; + onResponseEnd?(controller: DispatchController, trailers: IncomingHttpHeaders): void; + onResponseError?(controller: DispatchController, error: Error): void; + + /** Invoked before request is dispatched on socket. May be invoked multiple times when a request is retried when the request at the head of the pipeline fails. */ + /** @deprecated */ + onConnect?(abort: (err?: Error) => void): void; + /** Invoked when an error has occurred. */ + /** @deprecated */ + onError?(err: Error): void; + /** Invoked when request is upgraded either due to a `Upgrade` header or `CONNECT` method. */ + /** @deprecated */ + onUpgrade?(statusCode: number, headers: Buffer[] | string[] | null, socket: Duplex): void; + /** Invoked when response is received, before headers have been read. **/ + /** @deprecated */ + onResponseStarted?(): void; + /** Invoked when statusCode and headers have been received. May be invoked multiple times due to 1xx informational headers. */ + /** @deprecated */ + onHeaders?(statusCode: number, headers: Buffer[], resume: () => void, statusText: string): boolean; + /** Invoked when response payload data is received. */ + /** @deprecated */ + onData?(chunk: Buffer): boolean; + /** Invoked when response payload and trailers have been received and the request has completed. */ + /** @deprecated */ + onComplete?(trailers: string[] | null): void; + /** Invoked when a body chunk is sent to the server. May be invoked multiple times for chunked requests */ + /** @deprecated */ + onBodySent?(chunkSize: number, totalBytesSent: number): void; + } + export type PipelineHandler = (data: PipelineHandlerData) => Readable + export type HttpMethod = Autocomplete<'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH'> + + /** + * @link https://fetch.spec.whatwg.org/#body-mixin + */ + interface BodyMixin { + readonly body?: never; + readonly bodyUsed: boolean; + arrayBuffer(): Promise; + blob(): Promise; + bytes(): Promise; + formData(): Promise; + json(): Promise; + text(): Promise; + } + + export interface DispatchInterceptor { + (dispatch: Dispatch): Dispatch + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/env-http-proxy-agent.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/env-http-proxy-agent.d.ts new file mode 100644 index 0000000..1733d7f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/env-http-proxy-agent.d.ts @@ -0,0 +1,22 @@ +import Agent from './agent' +import ProxyAgent from './proxy-agent' +import Dispatcher from './dispatcher' + +export default EnvHttpProxyAgent + +declare class EnvHttpProxyAgent extends Dispatcher { + constructor (opts?: EnvHttpProxyAgent.Options) + + dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean +} + +declare namespace EnvHttpProxyAgent { + export interface Options extends Omit { + /** Overrides the value of the HTTP_PROXY environment variable */ + httpProxy?: string; + /** Overrides the value of the HTTPS_PROXY environment variable */ + httpsProxy?: string; + /** Overrides the value of the NO_PROXY environment variable */ + noProxy?: string; + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/errors.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/errors.d.ts new file mode 100644 index 0000000..fbf3195 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/errors.d.ts @@ -0,0 +1,161 @@ +import { IncomingHttpHeaders } from './header' +import Client from './client' + +export default Errors + +declare namespace Errors { + export class UndiciError extends Error { + name: string + code: string + } + + /** Connect timeout error. */ + export class ConnectTimeoutError extends UndiciError { + name: 'ConnectTimeoutError' + code: 'UND_ERR_CONNECT_TIMEOUT' + } + + /** A header exceeds the `headersTimeout` option. */ + export class HeadersTimeoutError extends UndiciError { + name: 'HeadersTimeoutError' + code: 'UND_ERR_HEADERS_TIMEOUT' + } + + /** Headers overflow error. */ + export class HeadersOverflowError extends UndiciError { + name: 'HeadersOverflowError' + code: 'UND_ERR_HEADERS_OVERFLOW' + } + + /** A body exceeds the `bodyTimeout` option. */ + export class BodyTimeoutError extends UndiciError { + name: 'BodyTimeoutError' + code: 'UND_ERR_BODY_TIMEOUT' + } + + export class ResponseError extends UndiciError { + constructor ( + message: string, + code: number, + options: { + headers?: IncomingHttpHeaders | string[] | null, + body?: null | Record | string + } + ) + name: 'ResponseError' + code: 'UND_ERR_RESPONSE' + statusCode: number + body: null | Record | string + headers: IncomingHttpHeaders | string[] | null + } + + /** Passed an invalid argument. */ + export class InvalidArgumentError extends UndiciError { + name: 'InvalidArgumentError' + code: 'UND_ERR_INVALID_ARG' + } + + /** Returned an invalid value. */ + export class InvalidReturnValueError extends UndiciError { + name: 'InvalidReturnValueError' + code: 'UND_ERR_INVALID_RETURN_VALUE' + } + + /** The request has been aborted by the user. */ + export class RequestAbortedError extends UndiciError { + name: 'AbortError' + code: 'UND_ERR_ABORTED' + } + + /** Expected error with reason. */ + export class InformationalError extends UndiciError { + name: 'InformationalError' + code: 'UND_ERR_INFO' + } + + /** Request body length does not match content-length header. */ + export class RequestContentLengthMismatchError extends UndiciError { + name: 'RequestContentLengthMismatchError' + code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH' + } + + /** Response body length does not match content-length header. */ + export class ResponseContentLengthMismatchError extends UndiciError { + name: 'ResponseContentLengthMismatchError' + code: 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH' + } + + /** Trying to use a destroyed client. */ + export class ClientDestroyedError extends UndiciError { + name: 'ClientDestroyedError' + code: 'UND_ERR_DESTROYED' + } + + /** Trying to use a closed client. */ + export class ClientClosedError extends UndiciError { + name: 'ClientClosedError' + code: 'UND_ERR_CLOSED' + } + + /** There is an error with the socket. */ + export class SocketError extends UndiciError { + name: 'SocketError' + code: 'UND_ERR_SOCKET' + socket: Client.SocketInfo | null + } + + /** Encountered unsupported functionality. */ + export class NotSupportedError extends UndiciError { + name: 'NotSupportedError' + code: 'UND_ERR_NOT_SUPPORTED' + } + + /** No upstream has been added to the BalancedPool. */ + export class BalancedPoolMissingUpstreamError extends UndiciError { + name: 'MissingUpstreamError' + code: 'UND_ERR_BPL_MISSING_UPSTREAM' + } + + export class HTTPParserError extends UndiciError { + name: 'HTTPParserError' + code: string + } + + /** The response exceed the length allowed. */ + export class ResponseExceededMaxSizeError extends UndiciError { + name: 'ResponseExceededMaxSizeError' + code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE' + } + + export class RequestRetryError extends UndiciError { + constructor ( + message: string, + statusCode: number, + headers?: IncomingHttpHeaders | string[] | null, + body?: null | Record | string + ) + name: 'RequestRetryError' + code: 'UND_ERR_REQ_RETRY' + statusCode: number + data: { + count: number; + } + + headers: Record + } + + export class SecureProxyConnectionError extends UndiciError { + constructor ( + cause?: Error, + message?: string, + options?: Record + ) + name: 'SecureProxyConnectionError' + code: 'UND_ERR_PRX_TLS' + } + + class MaxOriginsReachedError extends UndiciError { + name: 'MaxOriginsReachedError' + code: 'UND_ERR_MAX_ORIGINS_REACHED' + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/eventsource.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/eventsource.d.ts new file mode 100644 index 0000000..081ca09 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/eventsource.d.ts @@ -0,0 +1,66 @@ +import { MessageEvent, ErrorEvent } from './websocket' +import Dispatcher from './dispatcher' + +import { + EventListenerOptions, + AddEventListenerOptions, + EventListenerOrEventListenerObject +} from './patch' + +interface EventSourceEventMap { + error: ErrorEvent + message: MessageEvent + open: Event +} + +interface EventSource extends EventTarget { + close(): void + readonly CLOSED: 2 + readonly CONNECTING: 0 + readonly OPEN: 1 + onerror: ((this: EventSource, ev: ErrorEvent) => any) | null + onmessage: ((this: EventSource, ev: MessageEvent) => any) | null + onopen: ((this: EventSource, ev: Event) => any) | null + readonly readyState: 0 | 1 | 2 + readonly url: string + readonly withCredentials: boolean + + addEventListener( + type: K, + listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, + options?: boolean | AddEventListenerOptions + ): void + addEventListener( + type: string, + listener: EventListenerOrEventListenerObject, + options?: boolean | AddEventListenerOptions + ): void + removeEventListener( + type: K, + listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, + options?: boolean | EventListenerOptions + ): void + removeEventListener( + type: string, + listener: EventListenerOrEventListenerObject, + options?: boolean | EventListenerOptions + ): void +} + +export declare const EventSource: { + prototype: EventSource + new (url: string | URL, init?: EventSourceInit): EventSource + readonly CLOSED: 2 + readonly CONNECTING: 0 + readonly OPEN: 1 +} + +interface EventSourceInit { + withCredentials?: boolean + // @deprecated use `node.dispatcher` instead + dispatcher?: Dispatcher + node?: { + dispatcher?: Dispatcher + reconnectionTime?: number + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/fetch.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/fetch.d.ts new file mode 100644 index 0000000..ec33e5b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/fetch.d.ts @@ -0,0 +1,211 @@ +// based on https://github.com/Ethan-Arrowood/undici-fetch/blob/249269714db874351589d2d364a0645d5160ae71/index.d.ts (MIT license) +// and https://github.com/node-fetch/node-fetch/blob/914ce6be5ec67a8bab63d68510aabf07cb818b6d/index.d.ts (MIT license) +/// + +import { Blob } from 'node:buffer' +import { URL, URLSearchParams } from 'node:url' +import { ReadableStream } from 'node:stream/web' +import { FormData } from './formdata' +import { HeaderRecord } from './header' +import Dispatcher from './dispatcher' + +export type RequestInfo = string | URL | Request + +export declare function fetch ( + input: RequestInfo, + init?: RequestInit +): Promise + +export type BodyInit = + | ArrayBuffer + | AsyncIterable + | Blob + | FormData + | Iterable + | NodeJS.ArrayBufferView + | URLSearchParams + | null + | string + +export class BodyMixin { + readonly body: ReadableStream | null + readonly bodyUsed: boolean + + readonly arrayBuffer: () => Promise + readonly blob: () => Promise + readonly bytes: () => Promise + /** + * @deprecated This method is not recommended for parsing multipart/form-data bodies in server environments. + * It is recommended to use a library such as [@fastify/busboy](https://www.npmjs.com/package/@fastify/busboy) as follows: + * + * @example + * ```js + * import { Busboy } from '@fastify/busboy' + * import { Readable } from 'node:stream' + * + * const response = await fetch('...') + * const busboy = new Busboy({ headers: { 'content-type': response.headers.get('content-type') } }) + * + * // handle events emitted from `busboy` + * + * Readable.fromWeb(response.body).pipe(busboy) + * ``` + */ + readonly formData: () => Promise + readonly json: () => Promise + readonly text: () => Promise +} + +export interface SpecIterator { + next(...args: [] | [TNext]): IteratorResult; +} + +export interface SpecIterableIterator extends SpecIterator { + [Symbol.iterator](): SpecIterableIterator; +} + +export interface SpecIterable { + [Symbol.iterator](): SpecIterator; +} + +export type HeadersInit = [string, string][] | HeaderRecord | Headers + +export declare class Headers implements SpecIterable<[string, string]> { + constructor (init?: HeadersInit) + readonly append: (name: string, value: string) => void + readonly delete: (name: string) => void + readonly get: (name: string) => string | null + readonly has: (name: string) => boolean + readonly set: (name: string, value: string) => void + readonly getSetCookie: () => string[] + readonly forEach: ( + callbackfn: (value: string, key: string, iterable: Headers) => void, + thisArg?: unknown + ) => void + + readonly keys: () => SpecIterableIterator + readonly values: () => SpecIterableIterator + readonly entries: () => SpecIterableIterator<[string, string]> + readonly [Symbol.iterator]: () => SpecIterableIterator<[string, string]> +} + +export type RequestCache = + | 'default' + | 'force-cache' + | 'no-cache' + | 'no-store' + | 'only-if-cached' + | 'reload' + +export type RequestCredentials = 'omit' | 'include' | 'same-origin' + +type RequestDestination = + | '' + | 'audio' + | 'audioworklet' + | 'document' + | 'embed' + | 'font' + | 'image' + | 'manifest' + | 'object' + | 'paintworklet' + | 'report' + | 'script' + | 'sharedworker' + | 'style' + | 'track' + | 'video' + | 'worker' + | 'xslt' + +export interface RequestInit { + body?: BodyInit | null + cache?: RequestCache + credentials?: RequestCredentials + dispatcher?: Dispatcher + duplex?: RequestDuplex + headers?: HeadersInit + integrity?: string + keepalive?: boolean + method?: string + mode?: RequestMode + redirect?: RequestRedirect + referrer?: string + referrerPolicy?: ReferrerPolicy + signal?: AbortSignal | null + window?: null +} + +export type ReferrerPolicy = + | '' + | 'no-referrer' + | 'no-referrer-when-downgrade' + | 'origin' + | 'origin-when-cross-origin' + | 'same-origin' + | 'strict-origin' + | 'strict-origin-when-cross-origin' + | 'unsafe-url' + +export type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin' + +export type RequestRedirect = 'error' | 'follow' | 'manual' + +export type RequestDuplex = 'half' + +export declare class Request extends BodyMixin { + constructor (input: RequestInfo, init?: RequestInit) + + readonly cache: RequestCache + readonly credentials: RequestCredentials + readonly destination: RequestDestination + readonly headers: Headers + readonly integrity: string + readonly method: string + readonly mode: RequestMode + readonly redirect: RequestRedirect + readonly referrer: string + readonly referrerPolicy: ReferrerPolicy + readonly url: string + + readonly keepalive: boolean + readonly signal: AbortSignal + readonly duplex: RequestDuplex + + readonly clone: () => Request +} + +export interface ResponseInit { + readonly status?: number + readonly statusText?: string + readonly headers?: HeadersInit +} + +export type ResponseType = + | 'basic' + | 'cors' + | 'default' + | 'error' + | 'opaque' + | 'opaqueredirect' + +export type ResponseRedirectStatus = 301 | 302 | 303 | 307 | 308 + +export declare class Response extends BodyMixin { + constructor (body?: BodyInit, init?: ResponseInit) + + readonly headers: Headers + readonly ok: boolean + readonly status: number + readonly statusText: string + readonly type: ResponseType + readonly url: string + readonly redirected: boolean + + readonly clone: () => Response + + static error (): Response + static json (data: any, init?: ResponseInit): Response + static redirect (url: string | URL, status?: ResponseRedirectStatus): Response +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/formdata.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/formdata.d.ts new file mode 100644 index 0000000..b9819a7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/formdata.d.ts @@ -0,0 +1,108 @@ +// Based on https://github.com/octet-stream/form-data/blob/2d0f0dc371517444ce1f22cdde13f51995d0953a/lib/FormData.ts (MIT) +/// + +import { File } from 'node:buffer' +import { SpecIterableIterator } from './fetch' + +/** + * A `string` or `File` that represents a single value from a set of `FormData` key-value pairs. + */ +declare type FormDataEntryValue = string | File + +/** + * Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using fetch(). + */ +export declare class FormData { + /** + * Appends a new value onto an existing key inside a FormData object, + * or adds the key if it does not already exist. + * + * The difference between `set()` and `append()` is that if the specified key already exists, `set()` will overwrite all existing values with the new one, whereas `append()` will append the new value onto the end of the existing set of values. + * + * @param name The name of the field whose data is contained in `value`. + * @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) + or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string. + * @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename. + */ + append (name: string, value: unknown, fileName?: string): void + + /** + * Set a new value for an existing key inside FormData, + * or add the new field if it does not already exist. + * + * @param name The name of the field whose data is contained in `value`. + * @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) + or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string. + * @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename. + * + */ + set (name: string, value: unknown, fileName?: string): void + + /** + * Returns the first value associated with a given key from within a `FormData` object. + * If you expect multiple values and want all of them, use the `getAll()` method instead. + * + * @param {string} name A name of the value you want to retrieve. + * + * @returns A `FormDataEntryValue` containing the value. If the key doesn't exist, the method returns null. + */ + get (name: string): FormDataEntryValue | null + + /** + * Returns all the values associated with a given key from within a `FormData` object. + * + * @param {string} name A name of the value you want to retrieve. + * + * @returns An array of `FormDataEntryValue` whose key matches the value passed in the `name` parameter. If the key doesn't exist, the method returns an empty list. + */ + getAll (name: string): FormDataEntryValue[] + + /** + * Returns a boolean stating whether a `FormData` object contains a certain key. + * + * @param name A string representing the name of the key you want to test for. + * + * @return A boolean value. + */ + has (name: string): boolean + + /** + * Deletes a key and its value(s) from a `FormData` object. + * + * @param name The name of the key you want to delete. + */ + delete (name: string): void + + /** + * Executes given callback function for each field of the FormData instance + */ + forEach: ( + callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData) => void, + thisArg?: unknown + ) => void + + /** + * Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through all keys contained in this `FormData` object. + * Each key is a `string`. + */ + keys: () => SpecIterableIterator + + /** + * Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through all values contained in this object `FormData` object. + * Each value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue). + */ + values: () => SpecIterableIterator + + /** + * Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through the `FormData` key/value pairs. + * The key of each pair is a string; the value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue). + */ + entries: () => SpecIterableIterator<[string, FormDataEntryValue]> + + /** + * An alias for FormData#entries() + */ + [Symbol.iterator]: () => SpecIterableIterator<[string, FormDataEntryValue]> + + readonly [Symbol.toStringTag]: string +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/global-dispatcher.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/global-dispatcher.d.ts new file mode 100644 index 0000000..2760e13 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/global-dispatcher.d.ts @@ -0,0 +1,9 @@ +import Dispatcher from './dispatcher' + +declare function setGlobalDispatcher (dispatcher: DispatcherImplementation): void +declare function getGlobalDispatcher (): Dispatcher + +export { + getGlobalDispatcher, + setGlobalDispatcher +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/global-origin.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/global-origin.d.ts new file mode 100644 index 0000000..265769b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/global-origin.d.ts @@ -0,0 +1,7 @@ +declare function setGlobalOrigin (origin: string | URL | undefined): void +declare function getGlobalOrigin (): URL | undefined + +export { + setGlobalOrigin, + getGlobalOrigin +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/h2c-client.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/h2c-client.d.ts new file mode 100644 index 0000000..7b97449 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/h2c-client.d.ts @@ -0,0 +1,73 @@ +import { URL } from 'node:url' +import Dispatcher from './dispatcher' +import buildConnector from './connector' + +type H2ClientOptions = Omit + +/** + * A basic H2C client, mapped on top a single TCP connection. Pipelining is disabled by default. + */ +export class H2CClient extends Dispatcher { + constructor (url: string | URL, options?: H2CClient.Options) + /** Property to get and set the pipelining factor. */ + pipelining: number + /** `true` after `client.close()` has been called. */ + closed: boolean + /** `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed. */ + destroyed: boolean + + // Override dispatcher APIs. + override connect ( + options: H2ClientOptions + ): Promise + override connect ( + options: H2ClientOptions, + callback: (err: Error | null, data: Dispatcher.ConnectData) => void + ): void +} + +export declare namespace H2CClient { + export interface Options { + /** The maximum length of request headers in bytes. Default: Node.js' `--max-http-header-size` or `16384` (16KiB). */ + maxHeaderSize?: number; + /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers (Node 14 and above only). Default: `300e3` milliseconds (300s). */ + headersTimeout?: number; + /** TODO */ + connectTimeout?: number; + /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use `0` to disable it entirely. Default: `300e3` milliseconds (300s). */ + bodyTimeout?: number; + /** the timeout, in milliseconds, after which a socket without active requests will time out. Monitors time between activity on a connected socket. This value may be overridden by *keep-alive* hints from the server. Default: `4e3` milliseconds (4s). */ + keepAliveTimeout?: number; + /** the maximum allowed `idleTimeout`, in milliseconds, when overridden by *keep-alive* hints from the server. Default: `600e3` milliseconds (10min). */ + keepAliveMaxTimeout?: number; + /** A number of milliseconds subtracted from server *keep-alive* hints when overriding `idleTimeout` to account for timing inaccuracies caused by e.g. transport latency. Default: `1e3` milliseconds (1s). */ + keepAliveTimeoutThreshold?: number; + /** TODO */ + socketPath?: string; + /** The amount of concurrent requests to be sent over the single TCP/TLS connection according to [RFC7230](https://tools.ietf.org/html/rfc7230#section-6.3.2). Default: `1`. */ + pipelining?: number; + /** If `true`, an error is thrown when the request content-length header doesn't match the length of the request body. Default: `true`. */ + strictContentLength?: boolean; + /** TODO */ + maxCachedSessions?: number; + /** TODO */ + connect?: Omit, 'allowH2'> | buildConnector.connector; + /** TODO */ + maxRequestsPerClient?: number; + /** TODO */ + localAddress?: string; + /** Max response body size in bytes, -1 is disabled */ + maxResponseSize?: number; + /** Enables a family autodetection algorithm that loosely implements section 5 of RFC 8305. */ + autoSelectFamily?: boolean; + /** The amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the `autoSelectFamily` option. */ + autoSelectFamilyAttemptTimeout?: number; + /** + * @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame. + * @default 100 + */ + maxConcurrentStreams?: number + } +} + +export default H2CClient diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/handlers.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/handlers.d.ts new file mode 100644 index 0000000..8007dbf --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/handlers.d.ts @@ -0,0 +1,15 @@ +import Dispatcher from './dispatcher' + +export declare class RedirectHandler implements Dispatcher.DispatchHandler { + constructor ( + dispatch: Dispatcher.Dispatch, + maxRedirections: number, + opts: Dispatcher.DispatchOptions, + handler: Dispatcher.DispatchHandler, + redirectionLimitReached: boolean + ) +} + +export declare class DecoratorHandler implements Dispatcher.DispatchHandler { + constructor (handler: Dispatcher.DispatchHandler) +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/header.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/header.d.ts new file mode 100644 index 0000000..efd7b1d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/header.d.ts @@ -0,0 +1,160 @@ +import { Autocomplete } from './utility' + +/** + * The header type declaration of `undici`. + */ +export type IncomingHttpHeaders = Record + +type HeaderNames = Autocomplete< + | 'Accept' + | 'Accept-CH' + | 'Accept-Charset' + | 'Accept-Encoding' + | 'Accept-Language' + | 'Accept-Patch' + | 'Accept-Post' + | 'Accept-Ranges' + | 'Access-Control-Allow-Credentials' + | 'Access-Control-Allow-Headers' + | 'Access-Control-Allow-Methods' + | 'Access-Control-Allow-Origin' + | 'Access-Control-Expose-Headers' + | 'Access-Control-Max-Age' + | 'Access-Control-Request-Headers' + | 'Access-Control-Request-Method' + | 'Age' + | 'Allow' + | 'Alt-Svc' + | 'Alt-Used' + | 'Authorization' + | 'Cache-Control' + | 'Clear-Site-Data' + | 'Connection' + | 'Content-Disposition' + | 'Content-Encoding' + | 'Content-Language' + | 'Content-Length' + | 'Content-Location' + | 'Content-Range' + | 'Content-Security-Policy' + | 'Content-Security-Policy-Report-Only' + | 'Content-Type' + | 'Cookie' + | 'Cross-Origin-Embedder-Policy' + | 'Cross-Origin-Opener-Policy' + | 'Cross-Origin-Resource-Policy' + | 'Date' + | 'Device-Memory' + | 'ETag' + | 'Expect' + | 'Expect-CT' + | 'Expires' + | 'Forwarded' + | 'From' + | 'Host' + | 'If-Match' + | 'If-Modified-Since' + | 'If-None-Match' + | 'If-Range' + | 'If-Unmodified-Since' + | 'Keep-Alive' + | 'Last-Modified' + | 'Link' + | 'Location' + | 'Max-Forwards' + | 'Origin' + | 'Permissions-Policy' + | 'Priority' + | 'Proxy-Authenticate' + | 'Proxy-Authorization' + | 'Range' + | 'Referer' + | 'Referrer-Policy' + | 'Retry-After' + | 'Sec-Fetch-Dest' + | 'Sec-Fetch-Mode' + | 'Sec-Fetch-Site' + | 'Sec-Fetch-User' + | 'Sec-Purpose' + | 'Sec-WebSocket-Accept' + | 'Server' + | 'Server-Timing' + | 'Service-Worker-Navigation-Preload' + | 'Set-Cookie' + | 'SourceMap' + | 'Strict-Transport-Security' + | 'TE' + | 'Timing-Allow-Origin' + | 'Trailer' + | 'Transfer-Encoding' + | 'Upgrade' + | 'Upgrade-Insecure-Requests' + | 'User-Agent' + | 'Vary' + | 'Via' + | 'WWW-Authenticate' + | 'X-Content-Type-Options' + | 'X-Frame-Options' +> + +type IANARegisteredMimeType = Autocomplete< + | 'audio/aac' + | 'video/x-msvideo' + | 'image/avif' + | 'video/av1' + | 'application/octet-stream' + | 'image/bmp' + | 'text/css' + | 'text/csv' + | 'application/vnd.ms-fontobject' + | 'application/epub+zip' + | 'image/gif' + | 'application/gzip' + | 'text/html' + | 'image/x-icon' + | 'text/calendar' + | 'image/jpeg' + | 'text/javascript' + | 'application/json' + | 'application/ld+json' + | 'audio/x-midi' + | 'audio/mpeg' + | 'video/mp4' + | 'video/mpeg' + | 'audio/ogg' + | 'video/ogg' + | 'application/ogg' + | 'audio/opus' + | 'font/otf' + | 'application/pdf' + | 'image/png' + | 'application/rtf' + | 'image/svg+xml' + | 'image/tiff' + | 'video/mp2t' + | 'font/ttf' + | 'text/plain' + | 'application/wasm' + | 'video/webm' + | 'audio/webm' + | 'image/webp' + | 'font/woff' + | 'font/woff2' + | 'application/xhtml+xml' + | 'application/xml' + | 'application/zip' + | 'video/3gpp' + | 'video/3gpp2' + | 'model/gltf+json' + | 'model/gltf-binary' +> + +type KnownHeaderValues = { + 'content-type': IANARegisteredMimeType +} + +export type HeaderRecord = { + [K in HeaderNames | Lowercase]?: Lowercase extends keyof KnownHeaderValues + ? KnownHeaderValues[Lowercase] + : string +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/index.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/index.d.ts new file mode 100644 index 0000000..78ddeaa --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/index.d.ts @@ -0,0 +1,88 @@ +import Dispatcher from './dispatcher' +import { setGlobalDispatcher, getGlobalDispatcher } from './global-dispatcher' +import { setGlobalOrigin, getGlobalOrigin } from './global-origin' +import Pool from './pool' +import { RedirectHandler, DecoratorHandler } from './handlers' + +import BalancedPool from './balanced-pool' +import RoundRobinPool from './round-robin-pool' +import Client from './client' +import H2CClient from './h2c-client' +import buildConnector from './connector' +import errors from './errors' +import Agent from './agent' +import MockClient from './mock-client' +import MockPool from './mock-pool' +import MockAgent from './mock-agent' +import { SnapshotAgent } from './snapshot-agent' +import { MockCallHistory, MockCallHistoryLog } from './mock-call-history' +import mockErrors from './mock-errors' +import ProxyAgent from './proxy-agent' +import EnvHttpProxyAgent from './env-http-proxy-agent' +import RetryHandler from './retry-handler' +import RetryAgent from './retry-agent' +import { request, pipeline, stream, connect, upgrade } from './api' +import interceptors from './interceptors' + +import CacheInterceptor from './cache-interceptor' +declare const cacheStores: { + MemoryCacheStore: typeof CacheInterceptor.MemoryCacheStore; + SqliteCacheStore: typeof CacheInterceptor.SqliteCacheStore; +} + +export * from './util' +export * from './cookies' +export * from './eventsource' +export * from './fetch' +export * from './formdata' +export * from './diagnostics-channel' +export * from './websocket' +export * from './content-type' +export * from './cache' +export { Interceptable } from './mock-interceptor' + +declare function globalThisInstall (): void + +export { Dispatcher, BalancedPool, RoundRobinPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, cacheStores, MockClient, MockPool, MockAgent, SnapshotAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient, globalThisInstall as install } +export default Undici + +declare namespace Undici { + const Dispatcher: typeof import('./dispatcher').default + const Pool: typeof import('./pool').default + const RedirectHandler: typeof import ('./handlers').RedirectHandler + const DecoratorHandler: typeof import ('./handlers').DecoratorHandler + const RetryHandler: typeof import ('./retry-handler').default + const BalancedPool: typeof import('./balanced-pool').default + const RoundRobinPool: typeof import('./round-robin-pool').default + const Client: typeof import('./client').default + const H2CClient: typeof import('./h2c-client').default + const buildConnector: typeof import('./connector').default + const errors: typeof import('./errors').default + const Agent: typeof import('./agent').default + const setGlobalDispatcher: typeof import('./global-dispatcher').setGlobalDispatcher + const getGlobalDispatcher: typeof import('./global-dispatcher').getGlobalDispatcher + const request: typeof import('./api').request + const stream: typeof import('./api').stream + const pipeline: typeof import('./api').pipeline + const connect: typeof import('./api').connect + const upgrade: typeof import('./api').upgrade + const MockClient: typeof import('./mock-client').default + const MockPool: typeof import('./mock-pool').default + const MockAgent: typeof import('./mock-agent').default + const SnapshotAgent: typeof import('./snapshot-agent').SnapshotAgent + const MockCallHistory: typeof import('./mock-call-history').MockCallHistory + const MockCallHistoryLog: typeof import('./mock-call-history').MockCallHistoryLog + const mockErrors: typeof import('./mock-errors').default + const fetch: typeof import('./fetch').fetch + const Headers: typeof import('./fetch').Headers + const Response: typeof import('./fetch').Response + const Request: typeof import('./fetch').Request + const FormData: typeof import('./formdata').FormData + const caches: typeof import('./cache').caches + const interceptors: typeof import('./interceptors').default + const cacheStores: { + MemoryCacheStore: typeof import('./cache-interceptor').default.MemoryCacheStore, + SqliteCacheStore: typeof import('./cache-interceptor').default.SqliteCacheStore + } + const install: typeof globalThisInstall +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/interceptors.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/interceptors.d.ts new file mode 100644 index 0000000..1dfd04f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/interceptors.d.ts @@ -0,0 +1,73 @@ +import CacheHandler from './cache-interceptor' +import Dispatcher from './dispatcher' +import RetryHandler from './retry-handler' +import { LookupOptions } from 'node:dns' + +export default Interceptors + +declare namespace Interceptors { + export type DumpInterceptorOpts = { maxSize?: number } + export type RetryInterceptorOpts = RetryHandler.RetryOptions + export type RedirectInterceptorOpts = { maxRedirections?: number } + export type DecompressInterceptorOpts = { + skipErrorResponses?: boolean + skipStatusCodes?: number[] + } + + export type ResponseErrorInterceptorOpts = { throwOnError: boolean } + export type CacheInterceptorOpts = CacheHandler.CacheOptions + + // DNS interceptor + export type DNSInterceptorRecord = { address: string, ttl: number, family: 4 | 6 } + export type DNSInterceptorOriginRecords = { records: { 4: { ips: DNSInterceptorRecord[] } | null, 6: { ips: DNSInterceptorRecord[] } | null } } + export type DNSStorage = { + size: number + get(origin: string): DNSInterceptorOriginRecords | null + set(origin: string, records: DNSInterceptorOriginRecords | null, options: { ttl: number }): void + delete(origin: string): void + full(): boolean + } + export type DNSInterceptorOpts = { + maxTTL?: number + maxItems?: number + lookup?: (origin: URL, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, addresses: DNSInterceptorRecord[]) => void) => void + pick?: (origin: URL, records: DNSInterceptorOriginRecords, affinity: 4 | 6) => DNSInterceptorRecord + dualStack?: boolean + affinity?: 4 | 6 + storage?: DNSStorage + } + + // Deduplicate interceptor + export type DeduplicateMethods = 'GET' | 'HEAD' | 'OPTIONS' | 'TRACE' + export type DeduplicateInterceptorOpts = { + /** + * The HTTP methods to deduplicate. + * Note: Only safe HTTP methods can be deduplicated. + * @default ['GET'] + */ + methods?: DeduplicateMethods[] + /** + * Header names that, if present in a request, will cause the request to skip deduplication. + * Header name matching is case-insensitive. + * @default [] + */ + skipHeaderNames?: string[] + /** + * Header names to exclude from the deduplication key. + * Requests with different values for these headers will still be deduplicated together. + * Useful for headers like `x-request-id` that vary per request but shouldn't affect deduplication. + * Header name matching is case-insensitive. + * @default [] + */ + excludeHeaderNames?: string[] + } + + export function dump (opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor + export function retry (opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor + export function redirect (opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor + export function decompress (opts?: DecompressInterceptorOpts): Dispatcher.DispatcherComposeInterceptor + export function responseError (opts?: ResponseErrorInterceptorOpts): Dispatcher.DispatcherComposeInterceptor + export function dns (opts?: DNSInterceptorOpts): Dispatcher.DispatcherComposeInterceptor + export function cache (opts?: CacheInterceptorOpts): Dispatcher.DispatcherComposeInterceptor + export function deduplicate (opts?: DeduplicateInterceptorOpts): Dispatcher.DispatcherComposeInterceptor +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-agent.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-agent.d.ts new file mode 100644 index 0000000..330926b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-agent.d.ts @@ -0,0 +1,68 @@ +import Agent from './agent' +import Dispatcher from './dispatcher' +import { Interceptable, MockInterceptor } from './mock-interceptor' +import MockDispatch = MockInterceptor.MockDispatch +import { MockCallHistory } from './mock-call-history' + +export default MockAgent + +interface PendingInterceptor extends MockDispatch { + origin: string; +} + +/** A mocked Agent class that implements the Agent API. It allows one to intercept HTTP requests made through undici and return mocked responses instead. */ +declare class MockAgent extends Dispatcher { + constructor (options?: TMockAgentOptions) + /** Creates and retrieves mock Dispatcher instances which can then be used to intercept HTTP requests. If the number of connections on the mock agent is set to 1, a MockClient instance is returned. Otherwise a MockPool instance is returned. */ + get(origin: string): TInterceptable + get(origin: RegExp): TInterceptable + get(origin: ((origin: string) => boolean)): TInterceptable + /** Dispatches a mocked request. */ + dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean + /** Closes the mock agent and waits for registered mock pools and clients to also close before resolving. */ + close (): Promise + /** Disables mocking in MockAgent. */ + deactivate (): void + /** Enables mocking in a MockAgent instance. When instantiated, a MockAgent is automatically activated. Therefore, this method is only effective after `MockAgent.deactivate` has been called. */ + activate (): void + /** Define host matchers so only matching requests that aren't intercepted by the mock dispatchers will be attempted. */ + enableNetConnect (): void + enableNetConnect (host: string): void + enableNetConnect (host: RegExp): void + enableNetConnect (host: ((host: string) => boolean)): void + /** Causes all requests to throw when requests are not matched in a MockAgent intercept. */ + disableNetConnect (): void + /** get call history. returns the MockAgent call history or undefined if the option is not enabled. */ + getCallHistory (): MockCallHistory | undefined + /** clear every call history. Any MockCallHistoryLog will be deleted on the MockCallHistory instance */ + clearCallHistory (): void + /** Enable call history. Any subsequence calls will then be registered. */ + enableCallHistory (): this + /** Disable call history. Any subsequence calls will then not be registered. */ + disableCallHistory (): this + pendingInterceptors (): PendingInterceptor[] + assertNoPendingInterceptors (options?: { + pendingInterceptorsFormatter?: PendingInterceptorsFormatter; + }): void +} + +interface PendingInterceptorsFormatter { + format(pendingInterceptors: readonly PendingInterceptor[]): string; +} + +declare namespace MockAgent { + /** MockAgent options. */ + export interface Options extends Agent.Options { + /** A custom agent to be encapsulated by the MockAgent. */ + agent?: Dispatcher; + + /** Ignore trailing slashes in the path */ + ignoreTrailingSlash?: boolean; + + /** Accept URLs with search parameters using non standard syntaxes. default false */ + acceptNonStandardSearchParameters?: boolean; + + /** Enable call history. you can either call MockAgent.enableCallHistory(). default false */ + enableCallHistory?: boolean + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-call-history.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-call-history.d.ts new file mode 100644 index 0000000..df07fa0 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-call-history.d.ts @@ -0,0 +1,111 @@ +import Dispatcher from './dispatcher' + +declare namespace MockCallHistoryLog { + /** request's configuration properties */ + export type MockCallHistoryLogProperties = 'protocol' | 'host' | 'port' | 'origin' | 'path' | 'hash' | 'fullUrl' | 'method' | 'searchParams' | 'body' | 'headers' +} + +/** a log reflecting request configuration */ +declare class MockCallHistoryLog { + constructor (requestInit: Dispatcher.DispatchOptions) + /** protocol used. ie. 'https:' or 'http:' etc... */ + protocol: string + /** request's host. */ + host: string + /** request's port. */ + port: string + /** request's origin. ie. https://localhost:3000. */ + origin: string + /** path. never contains searchParams. */ + path: string + /** request's hash. */ + hash: string + /** the full url requested. */ + fullUrl: string + /** request's method. */ + method: string + /** search params. */ + searchParams: Record + /** request's body */ + body: string | null | undefined + /** request's headers */ + headers: Record | null | undefined + + /** returns an Map of property / value pair */ + toMap (): Map | null | undefined> + + /** returns a string computed with all key value pair */ + toString (): string +} + +declare namespace MockCallHistory { + export type FilterCallsOperator = 'AND' | 'OR' + + /** modify the filtering behavior */ + export interface FilterCallsOptions { + /** the operator to apply when filtering. 'OR' will adds any MockCallHistoryLog matching any criteria given. 'AND' will adds only MockCallHistoryLog matching every criteria given. (default 'OR') */ + operator?: FilterCallsOperator | Lowercase + } + /** a function to be executed for filtering MockCallHistoryLog */ + export type FilterCallsFunctionCriteria = (log: MockCallHistoryLog) => boolean + + /** parameter to filter MockCallHistoryLog */ + export type FilterCallsParameter = string | RegExp | undefined | null + + /** an object to execute multiple filtering at once */ + export interface FilterCallsObjectCriteria extends Record { + /** filter by request protocol. ie https: */ + protocol?: FilterCallsParameter; + /** filter by request host. */ + host?: FilterCallsParameter; + /** filter by request port. */ + port?: FilterCallsParameter; + /** filter by request origin. */ + origin?: FilterCallsParameter; + /** filter by request path. */ + path?: FilterCallsParameter; + /** filter by request hash. */ + hash?: FilterCallsParameter; + /** filter by request fullUrl. */ + fullUrl?: FilterCallsParameter; + /** filter by request method. */ + method?: FilterCallsParameter; + } +} + +/** a call history to track requests configuration */ +declare class MockCallHistory { + constructor (name: string) + /** returns an array of MockCallHistoryLog. */ + calls (): Array + /** returns the first MockCallHistoryLog */ + firstCall (): MockCallHistoryLog | undefined + /** returns the last MockCallHistoryLog. */ + lastCall (): MockCallHistoryLog | undefined + /** returns the nth MockCallHistoryLog. */ + nthCall (position: number): MockCallHistoryLog | undefined + /** return all MockCallHistoryLog matching any of criteria given. if an object is used with multiple properties, you can change the operator to apply during filtering on options */ + filterCalls (criteria: MockCallHistory.FilterCallsFunctionCriteria | MockCallHistory.FilterCallsObjectCriteria | RegExp, options?: MockCallHistory.FilterCallsOptions): Array + /** return all MockCallHistoryLog matching the given protocol. if a string is given, it is matched with includes */ + filterCallsByProtocol (protocol: MockCallHistory.FilterCallsParameter): Array + /** return all MockCallHistoryLog matching the given host. if a string is given, it is matched with includes */ + filterCallsByHost (host: MockCallHistory.FilterCallsParameter): Array + /** return all MockCallHistoryLog matching the given port. if a string is given, it is matched with includes */ + filterCallsByPort (port: MockCallHistory.FilterCallsParameter): Array + /** return all MockCallHistoryLog matching the given origin. if a string is given, it is matched with includes */ + filterCallsByOrigin (origin: MockCallHistory.FilterCallsParameter): Array + /** return all MockCallHistoryLog matching the given path. if a string is given, it is matched with includes */ + filterCallsByPath (path: MockCallHistory.FilterCallsParameter): Array + /** return all MockCallHistoryLog matching the given hash. if a string is given, it is matched with includes */ + filterCallsByHash (hash: MockCallHistory.FilterCallsParameter): Array + /** return all MockCallHistoryLog matching the given fullUrl. if a string is given, it is matched with includes */ + filterCallsByFullUrl (fullUrl: MockCallHistory.FilterCallsParameter): Array + /** return all MockCallHistoryLog matching the given method. if a string is given, it is matched with includes */ + filterCallsByMethod (method: MockCallHistory.FilterCallsParameter): Array + /** clear all MockCallHistoryLog on this MockCallHistory. */ + clear (): void + /** use it with for..of loop or spread operator */ + [Symbol.iterator]: () => Generator +} + +export { MockCallHistoryLog, MockCallHistory } diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-client.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-client.d.ts new file mode 100644 index 0000000..702e824 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-client.d.ts @@ -0,0 +1,27 @@ +import Client from './client' +import Dispatcher from './dispatcher' +import MockAgent from './mock-agent' +import { MockInterceptor, Interceptable } from './mock-interceptor' + +export default MockClient + +/** MockClient extends the Client API and allows one to mock requests. */ +declare class MockClient extends Client implements Interceptable { + constructor (origin: string, options: MockClient.Options) + /** Intercepts any matching requests that use the same origin as this mock client. */ + intercept (options: MockInterceptor.Options): MockInterceptor + /** Dispatches a mocked request. */ + dispatch (options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandler): boolean + /** Closes the mock client and gracefully waits for enqueued requests to complete. */ + close (): Promise + /** Clean up all the prepared mocks. */ + cleanMocks (): void +} + +declare namespace MockClient { + /** MockClient options. */ + export interface Options extends Client.Options { + /** The agent to associate this MockClient with. */ + agent: MockAgent; + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-errors.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-errors.d.ts new file mode 100644 index 0000000..eefeecd --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-errors.d.ts @@ -0,0 +1,12 @@ +import Errors from './errors' + +export default MockErrors + +declare namespace MockErrors { + /** The request does not match any registered mock dispatches. */ + export class MockNotMatchedError extends Errors.UndiciError { + constructor (message?: string) + name: 'MockNotMatchedError' + code: 'UND_MOCK_ERR_MOCK_NOT_MATCHED' + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-interceptor.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-interceptor.d.ts new file mode 100644 index 0000000..a48d715 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-interceptor.d.ts @@ -0,0 +1,94 @@ +import { IncomingHttpHeaders } from './header' +import Dispatcher from './dispatcher' +import { BodyInit, Headers } from './fetch' + +/** The scope associated with a mock dispatch. */ +declare class MockScope { + constructor (mockDispatch: MockInterceptor.MockDispatch) + /** Delay a reply by a set amount of time in ms. */ + delay (waitInMs: number): MockScope + /** Persist the defined mock data for the associated reply. It will return the defined mock data indefinitely. */ + persist (): MockScope + /** Define a reply for a set amount of matching requests. */ + times (repeatTimes: number): MockScope +} + +/** The interceptor for a Mock. */ +declare class MockInterceptor { + constructor (options: MockInterceptor.Options, mockDispatches: MockInterceptor.MockDispatch[]) + /** Mock an undici request with the defined reply. */ + reply(replyOptionsCallback: MockInterceptor.MockReplyOptionsCallback): MockScope + reply( + statusCode: number, + data?: TData | Buffer | string | MockInterceptor.MockResponseDataHandler, + responseOptions?: MockInterceptor.MockResponseOptions + ): MockScope + /** Mock an undici request by throwing the defined reply error. */ + replyWithError(error: TError): MockScope + /** Set default reply headers on the interceptor for subsequent mocked replies. */ + defaultReplyHeaders (headers: IncomingHttpHeaders): MockInterceptor + /** Set default reply trailers on the interceptor for subsequent mocked replies. */ + defaultReplyTrailers (trailers: Record): MockInterceptor + /** Set automatically calculated content-length header on subsequent mocked replies. */ + replyContentLength (): MockInterceptor +} + +declare namespace MockInterceptor { + /** MockInterceptor options. */ + export interface Options { + /** Path to intercept on. */ + path: string | RegExp | ((path: string) => boolean); + /** Method to intercept on. Defaults to GET. */ + method?: string | RegExp | ((method: string) => boolean); + /** Body to intercept on. */ + body?: string | RegExp | ((body: string) => boolean); + /** Headers to intercept on. */ + headers?: Record boolean)> | ((headers: Record) => boolean); + /** Query params to intercept on */ + query?: Record; + } + export interface MockDispatch extends Options { + times: number | null; + persist: boolean; + consumed: boolean; + data: MockDispatchData; + } + export interface MockDispatchData extends MockResponseOptions { + error: TError | null; + statusCode?: number; + data?: TData | string; + } + export interface MockResponseOptions { + headers?: IncomingHttpHeaders; + trailers?: Record; + } + + export interface MockResponseCallbackOptions { + path: string; + method: string; + headers?: Headers | Record; + origin?: string; + body?: BodyInit | Dispatcher.DispatchOptions['body'] | null; + } + + export type MockResponseDataHandler = ( + opts: MockResponseCallbackOptions + ) => TData | Buffer | string + + export type MockReplyOptionsCallback = ( + opts: MockResponseCallbackOptions + ) => { statusCode: number, data?: TData | Buffer | string, responseOptions?: MockResponseOptions } +} + +interface Interceptable extends Dispatcher { + /** Intercepts any matching requests that use the same origin as this mock client. */ + intercept(options: MockInterceptor.Options): MockInterceptor; + /** Clean up all the prepared mocks. */ + cleanMocks (): void +} + +export { + Interceptable, + MockInterceptor, + MockScope +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-pool.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-pool.d.ts new file mode 100644 index 0000000..f35f357 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/mock-pool.d.ts @@ -0,0 +1,27 @@ +import Pool from './pool' +import MockAgent from './mock-agent' +import { Interceptable, MockInterceptor } from './mock-interceptor' +import Dispatcher from './dispatcher' + +export default MockPool + +/** MockPool extends the Pool API and allows one to mock requests. */ +declare class MockPool extends Pool implements Interceptable { + constructor (origin: string, options: MockPool.Options) + /** Intercepts any matching requests that use the same origin as this mock pool. */ + intercept (options: MockInterceptor.Options): MockInterceptor + /** Dispatches a mocked request. */ + dispatch (options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandler): boolean + /** Closes the mock pool and gracefully waits for enqueued requests to complete. */ + close (): Promise + /** Clean up all the prepared mocks. */ + cleanMocks (): void +} + +declare namespace MockPool { + /** MockPool options. */ + export interface Options extends Pool.Options { + /** The agent to associate this MockPool with. */ + agent: MockAgent; + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/package.json new file mode 100644 index 0000000..8cc4e30 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/package.json @@ -0,0 +1,55 @@ +{ + "name": "undici-types", + "version": "7.18.2", + "description": "A stand-alone types package for Undici", + "homepage": "https://undici.nodejs.org", + "bugs": { + "url": "https://github.com/nodejs/undici/issues" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/nodejs/undici.git" + }, + "license": "MIT", + "types": "index.d.ts", + "files": [ + "*.d.ts" + ], + "contributors": [ + { + "name": "Daniele Belardi", + "url": "https://github.com/dnlup", + "author": true + }, + { + "name": "Ethan Arrowood", + "url": "https://github.com/ethan-arrowood", + "author": true + }, + { + "name": "Matteo Collina", + "url": "https://github.com/mcollina", + "author": true + }, + { + "name": "Matthew Aitken", + "url": "https://github.com/KhafraDev", + "author": true + }, + { + "name": "Robert Nagy", + "url": "https://github.com/ronag", + "author": true + }, + { + "name": "Szymon Marczak", + "url": "https://github.com/szmarczak", + "author": true + }, + { + "name": "Tomas Della Vedova", + "url": "https://github.com/delvedor", + "author": true + } + ] +} \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/patch.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/patch.d.ts new file mode 100644 index 0000000..8f7acbb --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/patch.d.ts @@ -0,0 +1,29 @@ +/// + +// See https://github.com/nodejs/undici/issues/1740 + +export interface EventInit { + bubbles?: boolean + cancelable?: boolean + composed?: boolean +} + +export interface EventListenerOptions { + capture?: boolean +} + +export interface AddEventListenerOptions extends EventListenerOptions { + once?: boolean + passive?: boolean + signal?: AbortSignal +} + +export type EventListenerOrEventListenerObject = EventListener | EventListenerObject + +export interface EventListenerObject { + handleEvent (object: Event): void +} + +export interface EventListener { + (evt: Event): void +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/pool-stats.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/pool-stats.d.ts new file mode 100644 index 0000000..f76a5f6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/pool-stats.d.ts @@ -0,0 +1,19 @@ +import Pool from './pool' + +export default PoolStats + +declare class PoolStats { + constructor (pool: Pool) + /** Number of open socket connections in this pool. */ + connected: number + /** Number of open socket connections in this pool that do not have an active request. */ + free: number + /** Number of pending requests across all clients in this pool. */ + pending: number + /** Number of queued requests across all clients in this pool. */ + queued: number + /** Number of currently active requests across all clients in this pool. */ + running: number + /** Number of active, pending, or queued requests across all clients in this pool. */ + size: number +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/pool.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/pool.d.ts new file mode 100644 index 0000000..120bb8b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/pool.d.ts @@ -0,0 +1,41 @@ +import Client from './client' +import TPoolStats from './pool-stats' +import { URL } from 'node:url' +import Dispatcher from './dispatcher' + +export default Pool + +type PoolConnectOptions = Omit + +declare class Pool extends Dispatcher { + constructor (url: string | URL, options?: Pool.Options) + /** `true` after `pool.close()` has been called. */ + closed: boolean + /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */ + destroyed: boolean + /** Aggregate stats for a Pool. */ + readonly stats: TPoolStats + + // Override dispatcher APIs. + override connect ( + options: PoolConnectOptions + ): Promise + override connect ( + options: PoolConnectOptions, + callback: (err: Error | null, data: Dispatcher.ConnectData) => void + ): void +} + +declare namespace Pool { + export type PoolStats = TPoolStats + export interface Options extends Client.Options { + /** Default: `(origin, opts) => new Client(origin, opts)`. */ + factory?(origin: URL, opts: object): Dispatcher; + /** The max number of clients to create. `null` if no limit. Default `null`. */ + connections?: number | null; + /** The amount of time before a client is removed from the pool and closed. `null` if no time limit. Default `null` */ + clientTtl?: number | null; + + interceptors?: { Pool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options['interceptors'] + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/proxy-agent.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/proxy-agent.d.ts new file mode 100644 index 0000000..4155542 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/proxy-agent.d.ts @@ -0,0 +1,29 @@ +import Agent from './agent' +import buildConnector from './connector' +import Dispatcher from './dispatcher' +import { IncomingHttpHeaders } from './header' + +export default ProxyAgent + +declare class ProxyAgent extends Dispatcher { + constructor (options: ProxyAgent.Options | string) + + dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean + close (): Promise +} + +declare namespace ProxyAgent { + export interface Options extends Agent.Options { + uri: string; + /** + * @deprecated use opts.token + */ + auth?: string; + token?: string; + headers?: IncomingHttpHeaders; + requestTls?: buildConnector.BuildOptions; + proxyTls?: buildConnector.BuildOptions; + clientFactory?(origin: URL, opts: object): Dispatcher; + proxyTunnel?: boolean; + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/readable.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/readable.d.ts new file mode 100644 index 0000000..723ed1f --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/readable.d.ts @@ -0,0 +1,68 @@ +import { Readable } from 'node:stream' +import { Blob } from 'node:buffer' + +export default BodyReadable + +declare class BodyReadable extends Readable { + constructor (opts: { + resume: (this: Readable, size: number) => void | null; + abort: () => void | null; + contentType?: string; + contentLength?: number; + highWaterMark?: number; + }) + + /** Consumes and returns the body as a string + * https://fetch.spec.whatwg.org/#dom-body-text + */ + text (): Promise + + /** Consumes and returns the body as a JavaScript Object + * https://fetch.spec.whatwg.org/#dom-body-json + */ + json (): Promise + + /** Consumes and returns the body as a Blob + * https://fetch.spec.whatwg.org/#dom-body-blob + */ + blob (): Promise + + /** Consumes and returns the body as an Uint8Array + * https://fetch.spec.whatwg.org/#dom-body-bytes + */ + bytes (): Promise + + /** Consumes and returns the body as an ArrayBuffer + * https://fetch.spec.whatwg.org/#dom-body-arraybuffer + */ + arrayBuffer (): Promise + + /** Not implemented + * + * https://fetch.spec.whatwg.org/#dom-body-formdata + */ + formData (): Promise + + /** Returns true if the body is not null and the body has been consumed + * + * Otherwise, returns false + * + * https://fetch.spec.whatwg.org/#dom-body-bodyused + */ + readonly bodyUsed: boolean + + /** + * If body is null, it should return null as the body + * + * If body is not null, should return the body as a ReadableStream + * + * https://fetch.spec.whatwg.org/#dom-body-body + */ + readonly body: never | undefined + + /** Dumps the response body by reading `limit` number of bytes. + * @param opts.limit Number of bytes to read (optional) - Default: 131072 + * @param opts.signal AbortSignal to cancel the operation (optional) + */ + dump (opts?: { limit: number; signal?: AbortSignal }): Promise +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/retry-agent.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/retry-agent.d.ts new file mode 100644 index 0000000..82268c3 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/retry-agent.d.ts @@ -0,0 +1,8 @@ +import Dispatcher from './dispatcher' +import RetryHandler from './retry-handler' + +export default RetryAgent + +declare class RetryAgent extends Dispatcher { + constructor (dispatcher: Dispatcher, options?: RetryHandler.RetryOptions) +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/retry-handler.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/retry-handler.d.ts new file mode 100644 index 0000000..3bc484b --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/retry-handler.d.ts @@ -0,0 +1,125 @@ +import Dispatcher from './dispatcher' + +export default RetryHandler + +declare class RetryHandler implements Dispatcher.DispatchHandler { + constructor ( + options: Dispatcher.DispatchOptions & { + retryOptions?: RetryHandler.RetryOptions; + }, + retryHandlers: RetryHandler.RetryHandlers + ) +} + +declare namespace RetryHandler { + export type RetryState = { counter: number; } + + export type RetryContext = { + state: RetryState; + opts: Dispatcher.DispatchOptions & { + retryOptions?: RetryHandler.RetryOptions; + }; + } + + export type OnRetryCallback = (result?: Error | null) => void + + export type RetryCallback = ( + err: Error, + context: { + state: RetryState; + opts: Dispatcher.DispatchOptions & { + retryOptions?: RetryHandler.RetryOptions; + }; + }, + callback: OnRetryCallback + ) => void + + export interface RetryOptions { + /** + * If true, the retry handler will throw an error if the request fails, + * this will prevent the folling handlers from being called, and will destroy the socket. + * + * @type {boolean} + * @memberof RetryOptions + * @default true + */ + throwOnError?: boolean; + /** + * Callback to be invoked on every retry iteration. + * It receives the error, current state of the retry object and the options object + * passed when instantiating the retry handler. + * + * @type {RetryCallback} + * @memberof RetryOptions + */ + retry?: RetryCallback; + /** + * Maximum number of retries to allow. + * + * @type {number} + * @memberof RetryOptions + * @default 5 + */ + maxRetries?: number; + /** + * Max number of milliseconds allow between retries + * + * @type {number} + * @memberof RetryOptions + * @default 30000 + */ + maxTimeout?: number; + /** + * Initial number of milliseconds to wait before retrying for the first time. + * + * @type {number} + * @memberof RetryOptions + * @default 500 + */ + minTimeout?: number; + /** + * Factior to multiply the timeout factor between retries. + * + * @type {number} + * @memberof RetryOptions + * @default 2 + */ + timeoutFactor?: number; + /** + * It enables to automatically infer timeout between retries based on the `Retry-After` header. + * + * @type {boolean} + * @memberof RetryOptions + * @default true + */ + retryAfter?: boolean; + /** + * HTTP methods to retry. + * + * @type {Dispatcher.HttpMethod[]} + * @memberof RetryOptions + * @default ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'], + */ + methods?: Dispatcher.HttpMethod[]; + /** + * Error codes to be retried. e.g. `ECONNRESET`, `ENOTFOUND`, `ETIMEDOUT`, `ECONNREFUSED`, etc. + * + * @type {string[]} + * @default ['ECONNRESET','ECONNREFUSED','ENOTFOUND','ENETDOWN','ENETUNREACH','EHOSTDOWN','EHOSTUNREACH','EPIPE'] + */ + errorCodes?: string[]; + /** + * HTTP status codes to be retried. + * + * @type {number[]} + * @memberof RetryOptions + * @default [500, 502, 503, 504, 429], + */ + statusCodes?: number[]; + } + + export interface RetryHandlers { + dispatch: Dispatcher['dispatch']; + handler: Dispatcher.DispatchHandler; + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/round-robin-pool.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/round-robin-pool.d.ts new file mode 100644 index 0000000..05ce210 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/round-robin-pool.d.ts @@ -0,0 +1,41 @@ +import Client from './client' +import TPoolStats from './pool-stats' +import { URL } from 'node:url' +import Dispatcher from './dispatcher' + +export default RoundRobinPool + +type RoundRobinPoolConnectOptions = Omit + +declare class RoundRobinPool extends Dispatcher { + constructor (url: string | URL, options?: RoundRobinPool.Options) + /** `true` after `pool.close()` has been called. */ + closed: boolean + /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */ + destroyed: boolean + /** Aggregate stats for a RoundRobinPool. */ + readonly stats: TPoolStats + + // Override dispatcher APIs. + override connect ( + options: RoundRobinPoolConnectOptions + ): Promise + override connect ( + options: RoundRobinPoolConnectOptions, + callback: (err: Error | null, data: Dispatcher.ConnectData) => void + ): void +} + +declare namespace RoundRobinPool { + export type RoundRobinPoolStats = TPoolStats + export interface Options extends Client.Options { + /** Default: `(origin, opts) => new Client(origin, opts)`. */ + factory?(origin: URL, opts: object): Dispatcher; + /** The max number of clients to create. `null` if no limit. Default `null`. */ + connections?: number | null; + /** The amount of time before a client is removed from the pool and closed. `null` if no time limit. Default `null` */ + clientTtl?: number | null; + + interceptors?: { RoundRobinPool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options['interceptors'] + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/snapshot-agent.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/snapshot-agent.d.ts new file mode 100644 index 0000000..f1d1ccd --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/snapshot-agent.d.ts @@ -0,0 +1,109 @@ +import MockAgent from './mock-agent' + +declare class SnapshotRecorder { + constructor (options?: SnapshotRecorder.Options) + + record (requestOpts: any, response: any): Promise + findSnapshot (requestOpts: any): SnapshotRecorder.Snapshot | undefined + loadSnapshots (filePath?: string): Promise + saveSnapshots (filePath?: string): Promise + clear (): void + getSnapshots (): SnapshotRecorder.Snapshot[] + size (): number + resetCallCounts (): void + deleteSnapshot (requestOpts: any): boolean + getSnapshotInfo (requestOpts: any): SnapshotRecorder.SnapshotInfo | null + replaceSnapshots (snapshotData: SnapshotRecorder.SnapshotData[]): void + destroy (): void +} + +declare namespace SnapshotRecorder { + type SnapshotRecorderMode = 'record' | 'playback' | 'update' + + export interface Options { + snapshotPath?: string + mode?: SnapshotRecorderMode + maxSnapshots?: number + autoFlush?: boolean + flushInterval?: number + matchHeaders?: string[] + ignoreHeaders?: string[] + excludeHeaders?: string[] + matchBody?: boolean + matchQuery?: boolean + caseSensitive?: boolean + shouldRecord?: (requestOpts: any) => boolean + shouldPlayback?: (requestOpts: any) => boolean + excludeUrls?: (string | RegExp)[] + } + + export interface Snapshot { + request: { + method: string + url: string + headers: Record + body?: string + } + responses: { + statusCode: number + headers: Record + body: string + trailers: Record + }[] + callCount: number + timestamp: string + } + + export interface SnapshotInfo { + hash: string + request: { + method: string + url: string + headers: Record + body?: string + } + responseCount: number + callCount: number + timestamp: string + } + + export interface SnapshotData { + hash: string + snapshot: Snapshot + } +} + +declare class SnapshotAgent extends MockAgent { + constructor (options?: SnapshotAgent.Options) + + saveSnapshots (filePath?: string): Promise + loadSnapshots (filePath?: string): Promise + getRecorder (): SnapshotRecorder + getMode (): SnapshotRecorder.SnapshotRecorderMode + clearSnapshots (): void + resetCallCounts (): void + deleteSnapshot (requestOpts: any): boolean + getSnapshotInfo (requestOpts: any): SnapshotRecorder.SnapshotInfo | null + replaceSnapshots (snapshotData: SnapshotRecorder.SnapshotData[]): void +} + +declare namespace SnapshotAgent { + export interface Options extends MockAgent.Options { + mode?: SnapshotRecorder.SnapshotRecorderMode + snapshotPath?: string + maxSnapshots?: number + autoFlush?: boolean + flushInterval?: number + matchHeaders?: string[] + ignoreHeaders?: string[] + excludeHeaders?: string[] + matchBody?: boolean + matchQuery?: boolean + caseSensitive?: boolean + shouldRecord?: (requestOpts: any) => boolean + shouldPlayback?: (requestOpts: any) => boolean + excludeUrls?: (string | RegExp)[] + } +} + +export { SnapshotAgent, SnapshotRecorder } diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/util.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/util.d.ts new file mode 100644 index 0000000..8fc50cc --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/util.d.ts @@ -0,0 +1,18 @@ +export namespace util { + /** + * Retrieves a header name and returns its lowercase value. + * @param value Header name + */ + export function headerNameToString (value: string | Buffer): string + + /** + * Receives a header object and returns the parsed value. + * @param headers Header object + * @param obj Object to specify a proxy object. Used to assign parsed values. + * @returns If `obj` is specified, it is equivalent to `obj`. + */ + export function parseHeaders ( + headers: (Buffer | string | (Buffer | string)[])[], + obj?: Record + ): Record +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/utility.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/utility.d.ts new file mode 100644 index 0000000..bfb3ca7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/utility.d.ts @@ -0,0 +1,7 @@ +type AutocompletePrimitiveBaseType = + T extends string ? string : + T extends number ? number : + T extends boolean ? boolean : + never + +export type Autocomplete = T | (AutocompletePrimitiveBaseType & Record) diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/webidl.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/webidl.d.ts new file mode 100644 index 0000000..d2a8eb9 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/webidl.d.ts @@ -0,0 +1,341 @@ +// These types are not exported, and are only used internally +import * as undici from './index' + +/** + * Take in an unknown value and return one that is of type T + */ +type Converter = (object: unknown) => T + +type SequenceConverter = (object: unknown, iterable?: IterableIterator) => T[] + +type RecordConverter = (object: unknown) => Record + +interface WebidlErrors { + /** + * @description Instantiate an error + */ + exception (opts: { header: string, message: string }): TypeError + /** + * @description Instantiate an error when conversion from one type to another has failed + */ + conversionFailed (opts: { + prefix: string + argument: string + types: string[] + }): TypeError + /** + * @description Throw an error when an invalid argument is provided + */ + invalidArgument (opts: { + prefix: string + value: string + type: string + }): TypeError +} + +interface WebIDLTypes { + UNDEFINED: 1, + BOOLEAN: 2, + STRING: 3, + SYMBOL: 4, + NUMBER: 5, + BIGINT: 6, + NULL: 7 + OBJECT: 8 +} + +interface WebidlUtil { + /** + * @see https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values + */ + Type (object: unknown): WebIDLTypes[keyof WebIDLTypes] + + TypeValueToString (o: unknown): + | 'Undefined' + | 'Boolean' + | 'String' + | 'Symbol' + | 'Number' + | 'BigInt' + | 'Null' + | 'Object' + + Types: WebIDLTypes + + /** + * @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint + */ + ConvertToInt ( + V: unknown, + bitLength: number, + signedness: 'signed' | 'unsigned', + flags?: number + ): number + + /** + * @see https://webidl.spec.whatwg.org/#abstract-opdef-integerpart + */ + IntegerPart (N: number): number + + /** + * Stringifies {@param V} + */ + Stringify (V: any): string + + MakeTypeAssertion (I: I): (arg: any) => arg is I + + /** + * Mark a value as uncloneable for Node.js. + * This is only effective in some newer Node.js versions. + */ + markAsUncloneable (V: any): void + + IsResizableArrayBuffer (V: ArrayBufferLike): boolean + + HasFlag (flag: number, attributes: number): boolean +} + +interface WebidlConverters { + /** + * @see https://webidl.spec.whatwg.org/#es-DOMString + */ + DOMString (V: unknown, prefix: string, argument: string, flags?: number): string + + /** + * @see https://webidl.spec.whatwg.org/#es-ByteString + */ + ByteString (V: unknown, prefix: string, argument: string): string + + /** + * @see https://webidl.spec.whatwg.org/#es-USVString + */ + USVString (V: unknown): string + + /** + * @see https://webidl.spec.whatwg.org/#es-boolean + */ + boolean (V: unknown): boolean + + /** + * @see https://webidl.spec.whatwg.org/#es-any + */ + any (V: Value): Value + + /** + * @see https://webidl.spec.whatwg.org/#es-long-long + */ + ['long long'] (V: unknown): number + + /** + * @see https://webidl.spec.whatwg.org/#es-unsigned-long-long + */ + ['unsigned long long'] (V: unknown): number + + /** + * @see https://webidl.spec.whatwg.org/#es-unsigned-long + */ + ['unsigned long'] (V: unknown): number + + /** + * @see https://webidl.spec.whatwg.org/#es-unsigned-short + */ + ['unsigned short'] (V: unknown, flags?: number): number + + /** + * @see https://webidl.spec.whatwg.org/#idl-ArrayBuffer + */ + ArrayBuffer ( + V: unknown, + prefix: string, + argument: string, + options?: { allowResizable: boolean } + ): ArrayBuffer + + /** + * @see https://webidl.spec.whatwg.org/#idl-SharedArrayBuffer + */ + SharedArrayBuffer ( + V: unknown, + prefix: string, + argument: string, + options?: { allowResizable: boolean } + ): SharedArrayBuffer + + /** + * @see https://webidl.spec.whatwg.org/#es-buffer-source-types + */ + TypedArray ( + V: unknown, + T: new () => NodeJS.TypedArray, + prefix: string, + argument: string, + flags?: number + ): NodeJS.TypedArray + + /** + * @see https://webidl.spec.whatwg.org/#es-buffer-source-types + */ + DataView ( + V: unknown, + prefix: string, + argument: string, + flags?: number + ): DataView + + /** + * @see https://webidl.spec.whatwg.org/#es-buffer-source-types + */ + ArrayBufferView ( + V: unknown, + prefix: string, + argument: string, + flags?: number + ): NodeJS.ArrayBufferView + + /** + * @see https://webidl.spec.whatwg.org/#BufferSource + */ + BufferSource ( + V: unknown, + prefix: string, + argument: string, + flags?: number + ): ArrayBuffer | NodeJS.ArrayBufferView + + /** + * @see https://webidl.spec.whatwg.org/#AllowSharedBufferSource + */ + AllowSharedBufferSource ( + V: unknown, + prefix: string, + argument: string, + flags?: number + ): ArrayBuffer | SharedArrayBuffer | NodeJS.ArrayBufferView + + ['sequence']: SequenceConverter + + ['sequence>']: SequenceConverter + + ['record']: RecordConverter + + /** + * @see https://fetch.spec.whatwg.org/#requestinfo + */ + RequestInfo (V: unknown): undici.Request | string + + /** + * @see https://fetch.spec.whatwg.org/#requestinit + */ + RequestInit (V: unknown): undici.RequestInit + + /** + * @see https://html.spec.whatwg.org/multipage/webappapis.html#eventhandlernonnull + */ + EventHandlerNonNull (V: unknown): Function | null + + WebSocketStreamWrite (V: unknown): ArrayBuffer | NodeJS.TypedArray | string + + [Key: string]: (...args: any[]) => unknown +} + +type WebidlIsFunction = (arg: any) => arg is T + +interface WebidlIs { + Request: WebidlIsFunction + Response: WebidlIsFunction + ReadableStream: WebidlIsFunction + Blob: WebidlIsFunction + URLSearchParams: WebidlIsFunction + File: WebidlIsFunction + FormData: WebidlIsFunction + URL: WebidlIsFunction + WebSocketError: WebidlIsFunction + AbortSignal: WebidlIsFunction + MessagePort: WebidlIsFunction + USVString: WebidlIsFunction + /** + * @see https://webidl.spec.whatwg.org/#BufferSource + */ + BufferSource: WebidlIsFunction +} + +export interface Webidl { + errors: WebidlErrors + util: WebidlUtil + converters: WebidlConverters + is: WebidlIs + attributes: WebIDLExtendedAttributes + + /** + * @description Performs a brand-check on {@param V} to ensure it is a + * {@param cls} object. + */ + brandCheck unknown>(V: unknown, cls: Interface): asserts V is Interface + + brandCheckMultiple unknown)[]> (list: Interfaces): (V: any) => asserts V is Interfaces[number] + + /** + * @see https://webidl.spec.whatwg.org/#es-sequence + * @description Convert a value, V, to a WebIDL sequence type. + */ + sequenceConverter (C: Converter): SequenceConverter + + illegalConstructor (): never + + /** + * @see https://webidl.spec.whatwg.org/#es-to-record + * @description Convert a value, V, to a WebIDL record type. + */ + recordConverter ( + keyConverter: Converter, + valueConverter: Converter + ): RecordConverter + + /** + * Similar to {@link Webidl.brandCheck} but allows skipping the check if third party + * interfaces are allowed. + */ + interfaceConverter (typeCheck: WebidlIsFunction, name: string): ( + V: unknown, + prefix: string, + argument: string + ) => asserts V is Interface + + // TODO(@KhafraDev): a type could likely be implemented that can infer the return type + // from the converters given? + /** + * Converts a value, V, to a WebIDL dictionary types. Allows limiting which keys are + * allowed, values allowed, optional and required keys. Auto converts the value to + * a type given a converter. + */ + dictionaryConverter (converters: { + key: string, + defaultValue?: () => unknown, + required?: boolean, + converter: (...args: unknown[]) => unknown, + allowedValues?: unknown[] + }[]): (V: unknown) => Record + + /** + * @see https://webidl.spec.whatwg.org/#idl-nullable-type + * @description allows a type, V, to be null + */ + nullableConverter ( + converter: Converter + ): (V: unknown) => ReturnType | null + + argumentLengthCheck (args: { length: number }, min: number, context: string): void +} + +interface WebIDLExtendedAttributes { + /** https://webidl.spec.whatwg.org/#Clamp */ + Clamp: number + /** https://webidl.spec.whatwg.org/#EnforceRange */ + EnforceRange: number + /** https://webidl.spec.whatwg.org/#AllowShared */ + AllowShared: number + /** https://webidl.spec.whatwg.org/#AllowResizable */ + AllowResizable: number + /** https://webidl.spec.whatwg.org/#LegacyNullToEmptyString */ + LegacyNullToEmptyString: number +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/websocket.d.ts b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/websocket.d.ts new file mode 100644 index 0000000..6d81a25 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/undici-types/websocket.d.ts @@ -0,0 +1,186 @@ +/// + +import type { Blob } from 'node:buffer' +import type { ReadableStream, WritableStream } from 'node:stream/web' +import type { MessagePort } from 'node:worker_threads' +import { + EventInit, + EventListenerOptions, + AddEventListenerOptions, + EventListenerOrEventListenerObject +} from './patch' +import Dispatcher from './dispatcher' +import { HeadersInit } from './fetch' + +export type BinaryType = 'blob' | 'arraybuffer' + +interface WebSocketEventMap { + close: CloseEvent + error: ErrorEvent + message: MessageEvent + open: Event +} + +interface WebSocket extends EventTarget { + binaryType: BinaryType + + readonly bufferedAmount: number + readonly extensions: string + + onclose: ((this: WebSocket, ev: WebSocketEventMap['close']) => any) | null + onerror: ((this: WebSocket, ev: WebSocketEventMap['error']) => any) | null + onmessage: ((this: WebSocket, ev: WebSocketEventMap['message']) => any) | null + onopen: ((this: WebSocket, ev: WebSocketEventMap['open']) => any) | null + + readonly protocol: string + readonly readyState: number + readonly url: string + + close(code?: number, reason?: string): void + send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void + + readonly CLOSED: number + readonly CLOSING: number + readonly CONNECTING: number + readonly OPEN: number + + addEventListener( + type: K, + listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, + options?: boolean | AddEventListenerOptions + ): void + addEventListener( + type: string, + listener: EventListenerOrEventListenerObject, + options?: boolean | AddEventListenerOptions + ): void + removeEventListener( + type: K, + listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, + options?: boolean | EventListenerOptions + ): void + removeEventListener( + type: string, + listener: EventListenerOrEventListenerObject, + options?: boolean | EventListenerOptions + ): void +} + +export declare const WebSocket: { + prototype: WebSocket + new (url: string | URL, protocols?: string | string[] | WebSocketInit): WebSocket + readonly CLOSED: number + readonly CLOSING: number + readonly CONNECTING: number + readonly OPEN: number +} + +interface CloseEventInit extends EventInit { + code?: number + reason?: string + wasClean?: boolean +} + +interface CloseEvent extends Event { + readonly code: number + readonly reason: string + readonly wasClean: boolean +} + +export declare const CloseEvent: { + prototype: CloseEvent + new (type: string, eventInitDict?: CloseEventInit): CloseEvent +} + +interface MessageEventInit extends EventInit { + data?: T + lastEventId?: string + origin?: string + ports?: MessagePort[] + source?: MessagePort | null +} + +interface MessageEvent extends Event { + readonly data: T + readonly lastEventId: string + readonly origin: string + readonly ports: readonly MessagePort[] + readonly source: MessagePort | null + initMessageEvent( + type: string, + bubbles?: boolean, + cancelable?: boolean, + data?: any, + origin?: string, + lastEventId?: string, + source?: MessagePort | null, + ports?: MessagePort[] + ): void; +} + +export declare const MessageEvent: { + prototype: MessageEvent + new(type: string, eventInitDict?: MessageEventInit): MessageEvent +} + +interface ErrorEventInit extends EventInit { + message?: string + filename?: string + lineno?: number + colno?: number + error?: any +} + +interface ErrorEvent extends Event { + readonly message: string + readonly filename: string + readonly lineno: number + readonly colno: number + readonly error: Error +} + +export declare const ErrorEvent: { + prototype: ErrorEvent + new (type: string, eventInitDict?: ErrorEventInit): ErrorEvent +} + +interface WebSocketInit { + protocols?: string | string[], + dispatcher?: Dispatcher, + headers?: HeadersInit +} + +interface WebSocketStreamOptions { + protocols?: string | string[] + signal?: AbortSignal +} + +interface WebSocketCloseInfo { + closeCode: number + reason: string +} + +interface WebSocketStream { + closed: Promise + opened: Promise<{ + extensions: string + protocol: string + readable: ReadableStream + writable: WritableStream + }> + url: string +} + +export declare const WebSocketStream: { + prototype: WebSocketStream + new (url: string | URL, options?: WebSocketStreamOptions): WebSocketStream +} + +interface WebSocketError extends Event, WebSocketCloseInfo {} + +export declare const WebSocketError: { + prototype: WebSocketError + new (type: string, init?: WebSocketCloseInfo): WebSocketError +} + +export declare const ping: (ws: WebSocket, body?: Buffer) => void diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/unpipe/HISTORY.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/unpipe/HISTORY.md new file mode 100644 index 0000000..85e0f8d --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/unpipe/HISTORY.md @@ -0,0 +1,4 @@ +1.0.0 / 2015-06-14 +================== + + * Initial release diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/unpipe/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/unpipe/LICENSE new file mode 100644 index 0000000..aed0138 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/unpipe/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/unpipe/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/unpipe/README.md new file mode 100644 index 0000000..e536ad2 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/unpipe/README.md @@ -0,0 +1,43 @@ +# unpipe + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Unpipe a stream from all destinations. + +## Installation + +```sh +$ npm install unpipe +``` + +## API + +```js +var unpipe = require('unpipe') +``` + +### unpipe(stream) + +Unpipes all destinations from a given stream. With stream 2+, this is +equivalent to `stream.unpipe()`. When used with streams 1 style streams +(typically Node.js 0.8 and below), this module attempts to undo the +actions done in `stream.pipe(dest)`. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/unpipe.svg +[npm-url]: https://npmjs.org/package/unpipe +[node-image]: https://img.shields.io/node/v/unpipe.svg +[node-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/stream-utils/unpipe.svg +[travis-url]: https://travis-ci.org/stream-utils/unpipe +[coveralls-image]: https://img.shields.io/coveralls/stream-utils/unpipe.svg +[coveralls-url]: https://coveralls.io/r/stream-utils/unpipe?branch=master +[downloads-image]: https://img.shields.io/npm/dm/unpipe.svg +[downloads-url]: https://npmjs.org/package/unpipe diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/unpipe/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/unpipe/index.js new file mode 100644 index 0000000..15c3d97 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/unpipe/index.js @@ -0,0 +1,69 @@ +/*! + * unpipe + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = unpipe + +/** + * Determine if there are Node.js pipe-like data listeners. + * @private + */ + +function hasPipeDataListeners(stream) { + var listeners = stream.listeners('data') + + for (var i = 0; i < listeners.length; i++) { + if (listeners[i].name === 'ondata') { + return true + } + } + + return false +} + +/** + * Unpipe a stream from all destinations. + * + * @param {object} stream + * @public + */ + +function unpipe(stream) { + if (!stream) { + throw new TypeError('argument stream is required') + } + + if (typeof stream.unpipe === 'function') { + // new-style + stream.unpipe() + return + } + + // Node.js 0.8 hack + if (!hasPipeDataListeners(stream)) { + return + } + + var listener + var listeners = stream.listeners('close') + + for (var i = 0; i < listeners.length; i++) { + listener = listeners[i] + + if (listener.name !== 'cleanup' && listener.name !== 'onclose') { + continue + } + + // invoke the listener + listener.call(stream) + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/unpipe/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/unpipe/package.json new file mode 100644 index 0000000..a2b7358 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/unpipe/package.json @@ -0,0 +1,27 @@ +{ + "name": "unpipe", + "description": "Unpipe a stream from all destinations", + "version": "1.0.0", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "stream-utils/unpipe", + "devDependencies": { + "istanbul": "0.3.15", + "mocha": "2.2.5", + "readable-stream": "1.1.13" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/vary/HISTORY.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/vary/HISTORY.md new file mode 100644 index 0000000..f6cbcf7 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/vary/HISTORY.md @@ -0,0 +1,39 @@ +1.1.2 / 2017-09-23 +================== + + * perf: improve header token parsing speed + +1.1.1 / 2017-03-20 +================== + + * perf: hoist regular expression + +1.1.0 / 2015-09-29 +================== + + * Only accept valid field names in the `field` argument + - Ensures the resulting string is a valid HTTP header value + +1.0.1 / 2015-07-08 +================== + + * Fix setting empty header from empty `field` + * perf: enable strict mode + * perf: remove argument reassignments + +1.0.0 / 2014-08-10 +================== + + * Accept valid `Vary` header string as `field` + * Add `vary.append` for low-level string manipulation + * Move to `jshttp` orgainzation + +0.1.0 / 2014-06-05 +================== + + * Support array of fields to set + +0.0.0 / 2014-06-04 +================== + + * Initial release diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/vary/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/vary/LICENSE new file mode 100644 index 0000000..84441fb --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/vary/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/vary/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/vary/README.md new file mode 100644 index 0000000..cc000b3 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/vary/README.md @@ -0,0 +1,101 @@ +# vary + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Manipulate the HTTP Vary header + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install vary +``` + +## API + + + +```js +var vary = require('vary') +``` + +### vary(res, field) + +Adds the given header `field` to the `Vary` response header of `res`. +This can be a string of a single field, a string of a valid `Vary` +header, or an array of multiple fields. + +This will append the header if not already listed, otherwise leaves +it listed in the current location. + + + +```js +// Append "Origin" to the Vary header of the response +vary(res, 'Origin') +``` + +### vary.append(header, field) + +Adds the given header `field` to the `Vary` response header string `header`. +This can be a string of a single field, a string of a valid `Vary` header, +or an array of multiple fields. + +This will append the header if not already listed, otherwise leaves +it listed in the current location. The new header string is returned. + + + +```js +// Get header string appending "Origin" to "Accept, User-Agent" +vary.append('Accept, User-Agent', 'Origin') +``` + +## Examples + +### Updating the Vary header when content is based on it + +```js +var http = require('http') +var vary = require('vary') + +http.createServer(function onRequest (req, res) { + // about to user-agent sniff + vary(res, 'User-Agent') + + var ua = req.headers['user-agent'] || '' + var isMobile = /mobi|android|touch|mini/i.test(ua) + + // serve site, depending on isMobile + res.setHeader('Content-Type', 'text/html') + res.end('You are (probably) ' + (isMobile ? '' : 'not ') + 'a mobile user') +}) +``` + +## Testing + +```sh +$ npm test +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/vary.svg +[npm-url]: https://npmjs.org/package/vary +[node-version-image]: https://img.shields.io/node/v/vary.svg +[node-version-url]: https://nodejs.org/en/download +[travis-image]: https://img.shields.io/travis/jshttp/vary/master.svg +[travis-url]: https://travis-ci.org/jshttp/vary +[coveralls-image]: https://img.shields.io/coveralls/jshttp/vary/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/vary +[downloads-image]: https://img.shields.io/npm/dm/vary.svg +[downloads-url]: https://npmjs.org/package/vary diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/vary/index.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/vary/index.js new file mode 100644 index 0000000..5b5e741 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/vary/index.js @@ -0,0 +1,149 @@ +/*! + * vary + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + */ + +module.exports = vary +module.exports.append = append + +/** + * RegExp to match field-name in RFC 7230 sec 3.2 + * + * field-name = token + * token = 1*tchar + * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" + * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" + * / DIGIT / ALPHA + * ; any VCHAR, except delimiters + */ + +var FIELD_NAME_REGEXP = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/ + +/** + * Append a field to a vary header. + * + * @param {String} header + * @param {String|Array} field + * @return {String} + * @public + */ + +function append (header, field) { + if (typeof header !== 'string') { + throw new TypeError('header argument is required') + } + + if (!field) { + throw new TypeError('field argument is required') + } + + // get fields array + var fields = !Array.isArray(field) + ? parse(String(field)) + : field + + // assert on invalid field names + for (var j = 0; j < fields.length; j++) { + if (!FIELD_NAME_REGEXP.test(fields[j])) { + throw new TypeError('field argument contains an invalid header name') + } + } + + // existing, unspecified vary + if (header === '*') { + return header + } + + // enumerate current values + var val = header + var vals = parse(header.toLowerCase()) + + // unspecified vary + if (fields.indexOf('*') !== -1 || vals.indexOf('*') !== -1) { + return '*' + } + + for (var i = 0; i < fields.length; i++) { + var fld = fields[i].toLowerCase() + + // append value (case-preserving) + if (vals.indexOf(fld) === -1) { + vals.push(fld) + val = val + ? val + ', ' + fields[i] + : fields[i] + } + } + + return val +} + +/** + * Parse a vary header into an array. + * + * @param {String} header + * @return {Array} + * @private + */ + +function parse (header) { + var end = 0 + var list = [] + var start = 0 + + // gather tokens + for (var i = 0, len = header.length; i < len; i++) { + switch (header.charCodeAt(i)) { + case 0x20: /* */ + if (start === end) { + start = end = i + 1 + } + break + case 0x2c: /* , */ + list.push(header.substring(start, end)) + start = end = i + 1 + break + default: + end = i + 1 + break + } + } + + // final token + list.push(header.substring(start, end)) + + return list +} + +/** + * Mark that a request is varied on a header field. + * + * @param {Object} res + * @param {String|Array} field + * @public + */ + +function vary (res, field) { + if (!res || !res.getHeader || !res.setHeader) { + // quack quack + throw new TypeError('res argument is required') + } + + // get existing header + var val = res.getHeader('Vary') || '' + var header = Array.isArray(val) + ? val.join(', ') + : String(val) + + // set new header + if ((val = append(header, field))) { + res.setHeader('Vary', val) + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/vary/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/vary/package.json new file mode 100644 index 0000000..028f72a --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/vary/package.json @@ -0,0 +1,43 @@ +{ + "name": "vary", + "description": "Manipulate the HTTP Vary header", + "version": "1.1.2", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "keywords": [ + "http", + "res", + "vary" + ], + "repository": "jshttp/vary", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.7.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "5.1.1", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-standard": "3.0.1", + "istanbul": "0.4.5", + "mocha": "2.5.3", + "supertest": "1.1.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/wrappy/LICENSE b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/wrappy/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/wrappy/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/wrappy/README.md b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/wrappy/README.md new file mode 100644 index 0000000..98eab25 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/wrappy/README.md @@ -0,0 +1,36 @@ +# wrappy + +Callback wrapping utility + +## USAGE + +```javascript +var wrappy = require("wrappy") + +// var wrapper = wrappy(wrapperFunction) + +// make sure a cb is called only once +// See also: http://npm.im/once for this specific use case +var once = wrappy(function (cb) { + var called = false + return function () { + if (called) return + called = true + return cb.apply(this, arguments) + } +}) + +function printBoo () { + console.log('boo') +} +// has some rando property +printBoo.iAmBooPrinter = true + +var onlyPrintOnce = once(printBoo) + +onlyPrintOnce() // prints 'boo' +onlyPrintOnce() // does nothing + +// random property is retained! +assert.equal(onlyPrintOnce.iAmBooPrinter, true) +``` diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/wrappy/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/wrappy/package.json new file mode 100644 index 0000000..1307520 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/wrappy/package.json @@ -0,0 +1,29 @@ +{ + "name": "wrappy", + "version": "1.0.2", + "description": "Callback wrapping utility", + "main": "wrappy.js", + "files": [ + "wrappy.js" + ], + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^2.3.1" + }, + "scripts": { + "test": "tap --coverage test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/wrappy" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/wrappy/issues" + }, + "homepage": "https://github.com/npm/wrappy" +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/wrappy/wrappy.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/wrappy/wrappy.js new file mode 100644 index 0000000..bb7e7d6 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/node_modules/wrappy/wrappy.js @@ -0,0 +1,33 @@ +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +module.exports = wrappy +function wrappy (fn, cb) { + if (fn && cb) return wrappy(fn)(cb) + + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') + + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k] + }) + + return wrapper + + function wrapper() { + var args = new Array(arguments.length) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + var ret = fn.apply(this, args) + var cb = args[args.length-1] + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k] + }) + } + return ret + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/package-lock.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/package-lock.json new file mode 100644 index 0000000..24bd889 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/package-lock.json @@ -0,0 +1,1271 @@ +{ + "name": "lab5", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "lab5", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "express": "^5.2.1", + "mysql2": "^3.20.0", + "nodemon": "^3.1.14" + } + }, + "node_modules/@types/node": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.5.0.tgz", + "integrity": "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==", + "license": "MIT", + "peer": true, + "dependencies": { + "undici-types": "~7.18.0" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/aws-ssl-profiles": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz", + "integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", + "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.1", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/brace-expansion": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", + "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/content-disposition": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", + "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "license": "MIT", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "license": "ISC" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==", + "license": "MIT" + }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0" + }, + "node_modules/lru.min": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.4.tgz", + "integrity": "sha512-DqC6n3QQ77zdFpCMASA1a3Jlb64Hv2N2DciFGkO/4L9+q/IpIAuRlKOvCXabtRW6cQf8usbmM6BE/TOPysCdIA==", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=1.30.0", + "node": ">=8.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/minimatch": { + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.5" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/mysql2": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.20.0.tgz", + "integrity": "sha512-eCLUs7BNbgA6nf/MZXsaBO1SfGs0LtLVrJD3WeWq+jPLDWkSufTD+aGMwykfUVPdZnblaUK1a8G/P63cl9FkKg==", + "license": "MIT", + "dependencies": { + "aws-ssl-profiles": "^1.1.2", + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.7.2", + "long": "^5.3.2", + "lru.min": "^1.1.4", + "named-placeholders": "^1.1.6", + "sql-escaper": "^1.3.3" + }, + "engines": { + "node": ">= 8.0" + }, + "peerDependencies": { + "@types/node": ">= 8" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.6.tgz", + "integrity": "sha512-Tz09sEL2EEuv5fFowm419c1+a/jSMiBjI9gHxVLrVdbUkkNUUfjsVYs9pVZu5oCon/kmRh9TfLEObFtkVxmY0w==", + "license": "MIT", + "dependencies": { + "lru.min": "^1.1.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nodemon": { + "version": "3.1.14", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.14.tgz", + "integrity": "sha512-jakjZi93UtB3jHMWsXL68FXSAosbLfY0In5gtKq3niLSkrWznrVBzXFNOEMJUfc9+Ke7SHWoAZsiMkNP3vq6Jw==", + "license": "MIT", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^10.2.1", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "license": "MIT" + }, + "node_modules/qs": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz", + "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sql-escaper": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/sql-escaper/-/sql-escaper-1.3.3.tgz", + "integrity": "sha512-BsTCV265VpTp8tm1wyIm1xqQCS+Q9NHx2Sr+WcnUrgLrQ6yiDIvHYJV5gHxsj1lMBy2zm5twLaZao8Jd+S8JJw==", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=2.0.0", + "node": ">=12.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/mysqljs/sql-escaper?sponsor=1" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "license": "ISC", + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "license": "MIT", + "peer": true + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + } + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/package.json b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/package.json new file mode 100644 index 0000000..216b617 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/package.json @@ -0,0 +1,18 @@ +{ + "name": "lab5", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "type": "module", + "dependencies": { + "express": "^5.2.1", + "mysql2": "^3.20.0", + "nodemon": "^3.1.14" + } +} diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/routes/customerRoutes.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/routes/customerRoutes.js new file mode 100644 index 0000000..260f403 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/routes/customerRoutes.js @@ -0,0 +1,16 @@ +import express from "express"; +import { + getAllCustomers, + createCustomer, + removeCustomer, + editCustomer +} from "../controllers/customerController.js"; + +const router = express.Router(); + +router.get("/", getAllCustomers); +router.post("/", createCustomer); +router.put("/:id", editCustomer); +router.delete("/:id", removeCustomer); + +export default router; \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/server.js b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/server.js new file mode 100644 index 0000000..bfd5790 --- /dev/null +++ b/INFO-3168 (JS 2)/Labs/Lab 5/node-lab5/server.js @@ -0,0 +1,12 @@ +import express from "express"; +import customerRoutes from "./routes/customerRoutes.js"; +const app = express(); +app.use(express.json()); +const PORT = 3000; +app.get("/", (req, res) => { + res.send("Customer MVC App Running!"); +}); +app.use("/customers", customerRoutes); +app.listen(PORT, () => { + console.log(`Server running at http://localhost:${PORT}`); +}); diff --git a/INFO-3168 (JS 2)/Projects/Project2/Levi-McLean-customers-app/public/app.js b/INFO-3168 (JS 2)/Projects/Project2/Levi-McLean-customers-app/public/app.js index 3827bef..578f3ff 100644 --- a/INFO-3168 (JS 2)/Projects/Project2/Levi-McLean-customers-app/public/app.js +++ b/INFO-3168 (JS 2)/Projects/Project2/Levi-McLean-customers-app/public/app.js @@ -41,4 +41,51 @@ document.addEventListener("DOMContentLoaded", () => { const objectStore = transaction.objectStore("customers"); const request = objectStore.delete(Number(id)); } + + const customerId = document.getElementById("customer_id"); + const customerName = document.getElementById("customer_name"); + const customerEmail = document.getElementById("customer_email"); + const customerPhone = document.getElementById("customer_phone"); + const message = document.getElementById("message"); + + document.getElementById("new").addEventListener("click", clearForm); + document.getElementById("add_customer").addEventListener("click", addCustomer); + document.getElementById("update_customer").addEventListener("click", updateCustomer); + document.getElementById("delete_customer").addEventListener("click", deleteCustomer); + document.getElementById("find_customer").addEventListener("click", findCustomer); + + function validateInput() { + + } + + function showMessage(msg, isSuccess = true) { + message.textContent = msg; + message.className = "message" + (isSuccess ? "success" : "error"); + setTimeout(() => { + message.textContent = ""; + }, 5000); + } + + function clearForm() { + customerId.value = ""; + customerName.value = ""; + customerEmail.value = ""; + customerPhone.value = ""; + customerId.focus(); + } + + function addCustomer() { + + } + + function updateCustomer() { + + } + + function deleteCustomer() { + + } + function findCustomer() { + + } }); \ No newline at end of file