🎯 MapView v2.0 - Global Deployment Ready

 MAJOR FEATURES:
• Auto-zoom intelligence với smart bounds fitting
• Enhanced 3D GPS markers với pulsing effects
• Professional route display với 6-layer rendering
• Status-based parking icons với availability indicators
• Production-ready build optimizations

🗺️ AUTO-ZOOM FEATURES:
• Smart bounds fitting cho GPS + selected parking
• Adaptive padding (50px) cho visual balance
• Max zoom control (level 16) để tránh quá gần
• Dynamic centering khi không có selection

🎨 ENHANCED VISUALS:
• 3D GPS marker với multi-layer pulse effects
• Advanced parking icons với status colors
• Selection highlighting với animation
• Dimming system cho non-selected items

🛣️ ROUTE SYSTEM:
• OpenRouteService API integration
• Multi-layer route rendering (glow, shadow, main, animated)
• Real-time distance & duration calculation
• Visual route info trong popup

📱 PRODUCTION READY:
• SSR safe với dynamic imports
• Build errors resolved
• Global deployment via Vercel
• Optimized performance

🌍 DEPLOYMENT:
• Vercel: https://whatever-ctk2auuxr-phong12hexdockworks-projects.vercel.app
• Bundle size: 22.8 kB optimized
• Global CDN distribution
• HTTPS enabled

💾 VERSION CONTROL:
• MapView-v2.0.tsx backup created
• MAPVIEW_VERSIONS.md documentation
• Full version history tracking
This commit is contained in:
2025-07-20 19:52:16 +07:00
parent 3203463a6a
commit c65cc97a33
64624 changed files with 7199453 additions and 6462 deletions

25
backend/node_modules/@ljharb/through/.eslintrc generated vendored Normal file
View File

@@ -0,0 +1,25 @@
{
"root": true,
"extends": "@ljharb/eslint-config/node/0.4",
"rules": {
"consistent-return": "warn",
"func-style": "warn",
"max-len": "off",
"max-lines-per-function": "off",
"max-statements-per-line": "warn",
"no-invalid-this": "warn",
"no-param-reassign": "warn",
"no-underscore-dangle": "warn",
},
"overrides": [
{
"files": "test/**",
"rules": {
"no-plusplus": "warn",
},
},
],
}

View File

@@ -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/@ljharb/through
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

13
backend/node_modules/@ljharb/through/.nycrc generated vendored Normal file
View File

@@ -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"
]
}

284
backend/node_modules/@ljharb/through/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,284 @@
# 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).
## [v2.3.14](https://github.com/ljharb/through/compare/v2.3.13...v2.3.14) - 2025-02-07
### Commits
- [types] any falsy value is allowed as `write` or `end` [`0cc4d4d`](https://github.com/ljharb/through/commit/0cc4d4d11ce59315e236e9d858e47ead5845ed04)
- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/node`, `@types/tape`, `auto-changelog`, `tape` [`a51fc2c`](https://github.com/ljharb/through/commit/a51fc2c9971e2e6aa6fa287bfb994e98bb529a9b)
- [Deps] update `call-bind` [`78eabe4`](https://github.com/ljharb/through/commit/78eabe464e182780bbc81fcd6aeb4b37b52cb7a5)
- [Tests] replace `aud` with `npm audit` [`908d64a`](https://github.com/ljharb/through/commit/908d64ae829470c03d3ebc84473991ca5bbca6f7)
- [Dev Deps] add missing peer dep [`80f3805`](https://github.com/ljharb/through/commit/80f3805fdb93d21d4f205996768e0858a423c60d)
## [v2.3.13](https://github.com/ljharb/through/compare/v2.3.12...v2.3.13) - 2024-03-08
### Commits
- [types] use shared tsconfig [`8e77c7b`](https://github.com/ljharb/through/commit/8e77c7bd23365d0950730fa4e402c17549b48680)
- [Tests] increase coverage [`0a0a33f`](https://github.com/ljharb/through/commit/0a0a33fb2a5fbe63d449371f1e3ea91a969b8817)
- [types] fix d.ts errors; use a namespace [`653e55d`](https://github.com/ljharb/through/commit/653e55d7bc2ac4f43500e327e45bb2b8c24e4a1f)
- [actions] remove redundant finisher; use reusable workflows [`65ab32c`](https://github.com/ljharb/through/commit/65ab32c807b748cd96623169b99561aa05993d6d)
- [Dev Deps] update `@arethetypeswrong/cli`, `tape`, `typescript` [`1d2c513`](https://github.com/ljharb/through/commit/1d2c51309a4b5d70aa16431c9514b2805d7374ec)
- [Dev Deps] update `@types/node`, `typescript` [`d5bdc23`](https://github.com/ljharb/through/commit/d5bdc23afc0610c37524b4ef615fd3aee442b16d)
- [Deps] update `call-bind` [`2633dc6`](https://github.com/ljharb/through/commit/2633dc6c9c728099cf105c40ad8990c463fbc054)
- [Tests] install missing `@types/node` [`fe34373`](https://github.com/ljharb/through/commit/fe343735e8df0122d1856fc4f88c46e3ee1a33df)
## [v2.3.12](https://github.com/ljharb/through/compare/v2.3.11...v2.3.12) - 2024-01-24
### Commits
- [patch] add TS types [`0b68b9d`](https://github.com/ljharb/through/commit/0b68b9dc1655edbf5dc81cccdb3ef23dcd8e4bbd)
- [readme] correct requires; remove redundant license section [`90ff780`](https://github.com/ljharb/through/commit/90ff780f9c3f2c2fb345b33c87e0be080dbf7950)
- [Dev Deps] update `aud`, `npmignore`, `tape` [`f4456ce`](https://github.com/ljharb/through/commit/f4456ceaf2b216858e7652c9eef8d96badbad678)
- [Deps] update `call-bind` [`c1b7daa`](https://github.com/ljharb/through/commit/c1b7daaf9ea8138d90caf7cfe7250a09760034c2)
- [Dev Deps] update `tape` [`74a75ac`](https://github.com/ljharb/through/commit/74a75acadcca26c71ec15f0f0d48e3a9265cebf3)
- [meta] add `sideEffects` flag [`dcfef36`](https://github.com/ljharb/through/commit/dcfef3615e7df63219aa6184469f4b2a1e61cb0b)
## [v2.3.11](https://github.com/ljharb/through/compare/v2.3.10...v2.3.11) - 2023-10-11
### Commits
- [Deps] add missing `call-bind` [`da5e46d`](https://github.com/ljharb/through/commit/da5e46d31045e18b79dc137bbc2bde1ebf839b38)
## [v2.3.10](https://github.com/ljharb/through/compare/v2.3.9...v2.3.10) - 2023-10-10
### Commits
- [Robustness] use `call-bind` [`3fc8de1`](https://github.com/ljharb/through/commit/3fc8de1dd6b5c69ebca1b212d4852ca11e853cb2)
- [Dev Deps] update `aud`, `tape` [`db14fcf`](https://github.com/ljharb/through/commit/db14fcf1457d1e35b22856de42767d0bf4773fd8)
## [v2.3.9](https://github.com/ljharb/through/compare/v2.3.8...v2.3.9) - 2023-07-17
### Commits
- [meta] add scripts, dev deps, linting; switch from travis to GHA [`2bc7e2d`](https://github.com/ljharb/through/commit/2bc7e2d1f63caf9cbdd146c9d752d3f62f564405)
- [meta] rename package to scoped [`337610b`](https://github.com/ljharb/through/commit/337610b937196ad26abe40c7d191942c0d54f455)
- [meta] confirmed with dominictarr in writing that this package was only ever MIT [`832061e`](https://github.com/ljharb/through/commit/832061e15beb9643b74e16b1f8343c36620f5be7)
- [Dev Deps] update `from`, `stream-spec`, `tape` [`dae9dda`](https://github.com/ljharb/through/commit/dae9dda68c7df31960239957e7694de1f3bca40a)
- [meta] fix auto-changelog start version [`3ac451b`](https://github.com/ljharb/through/commit/3ac451b684d4b4cb9356eb758691e6438b0083d1)
- [Fix] `node < v0.6` does not have `stream` === `stream.Stream` [`9f72162`](https://github.com/ljharb/through/commit/9f721627f62dfa4dad1f5515f4d3d1aa3613ccb0)
<!-- auto-changelog-above -->
## [v2.3.8](https://github.com/ljharb/through/compare/v2.3.7...v2.3.8) - 2015-07-03
### Merged
- Update package.json [`#35`](https://github.com/dominictarr/through/pull/35)
## [v2.3.7](https://github.com/ljharb/through/compare/v2.3.6...v2.3.7) - 2015-04-06
### Commits
- fix non-strict null check [`7048350`](https://github.com/dominictarr/through/commit/7048350a5dae8bbbb3b9a972ecec4fe2460d113d)
## [v2.3.6](https://github.com/ljharb/through/compare/v2.3.5...v2.3.6) - 2014-09-16
### Commits
- simple async test [`a98561f`](https://github.com/dominictarr/through/commit/a98561fae17615da8fe6c9dc00208c5107bf9774)
- update test to work in the browser (without process.on("exit") [`7dabce0`](https://github.com/dominictarr/through/commit/7dabce06b4d367f280846a72fe468ace54d55456)
- remove concat-stream [`69d31f3`](https://github.com/dominictarr/through/commit/69d31f3efe1600a44787cb198d7b97ae7eaa7167)
- add dev deps [`d387710`](https://github.com/dominictarr/through/commit/d387710cccaeec66dc889377778c17254ea13ef4)
- validate before end [`c267d90`](https://github.com/dominictarr/through/commit/c267d90e3cdb501510edfd590245fd1d58fe29bd)
- use tape@2.3.2 [`1080f0c`](https://github.com/dominictarr/through/commit/1080f0ca8d32813cd50be9eac5975504fb5b8a55)
- testling badge [`aa23057`](https://github.com/dominictarr/through/commit/aa23057876709666ab4d02f0cd7a36797de77c80)
- tidy [`c5d9757`](https://github.com/dominictarr/through/commit/c5d9757c8c8e31d563dc4a4bbb02a5f7e6304360)
## [v2.3.5](https://github.com/ljharb/through/compare/v2.3.4...v2.3.5) - 2013-05-05
### Fixed
- fix spelling Closes #13 [`#13`](https://github.com/dominictarr/through/issues/13)
## [v2.3.4](https://github.com/ljharb/through/compare/v2.3.3...v2.3.4) - 2013-04-29
### Merged
- mark "write" method as code [`#14`](https://github.com/dominictarr/through/pull/14)
### Commits
- fix typo [`e94d772`](https://github.com/dominictarr/through/commit/e94d7726f765e4fcb83169ba845ebbb9fec418c7)
## [v2.3.3](https://github.com/ljharb/through/compare/v2.3.2...v2.3.3) - 2013-04-24
### Merged
- Test on 0.10 on Travis [`#12`](https://github.com/dominictarr/through/pull/12)
## [v2.3.2](https://github.com/ljharb/through/compare/v2.3.1...v2.3.2) - 2013-04-24
### Commits
- check that through ends exactly once [`802ecff`](https://github.com/dominictarr/through/commit/802ecff64d8462be9e1db6a578857393a37b19eb)
- emit "end" exactly once [`6f814a6`](https://github.com/dominictarr/through/commit/6f814a601b37db1f44113e56a1eaa0c32a33b0a2)
## [v2.3.1](https://github.com/ljharb/through/compare/v2.3.0...v2.3.1) - 2013-04-13
### Commits
- syntax error [`b90e6ba`](https://github.com/dominictarr/through/commit/b90e6ba08b626899f8007367d2a934714a9cdc23)
## [v2.3.0](https://github.com/ljharb/through/compare/v2.2.7...v2.3.0) - 2013-04-13
### Commits
- test autoDestroy option [`a2e1d5d`](https://github.com/dominictarr/through/commit/a2e1d5dad7f5ace3a174145ab32d58642bc1d685)
- document autoDestroy [`c4520e5`](https://github.com/dominictarr/through/commit/c4520e59f6a96f12eebfadef6a746d266b481d25)
- implement autoDestroy option [`1cabed2`](https://github.com/dominictarr/through/commit/1cabed2d3a57bec745d6a5c90d0c3077254dadf9)
## [v2.2.7](https://github.com/ljharb/through/compare/v2.2.6...v2.2.7) - 2013-03-15
### Merged
- Typo fix [`#10`](https://github.com/dominictarr/through/pull/10)
### Commits
- wider range [`e685bc2`](https://github.com/dominictarr/through/commit/e685bc2299f28d91c5a9d3eac7d929fdcff5767f)
## [v2.2.6](https://github.com/ljharb/through/compare/v2.2.5...v2.2.6) - 2013-03-13
### Commits
- update stream-spec [`1483cd4`](https://github.com/dominictarr/through/commit/1483cd44dbcd089c3bbb9e0111c09a64d0ecb715)
## [v2.2.5](https://github.com/ljharb/through/compare/v2.2.4...v2.2.5) - 2013-03-13
### Commits
- hopefully make this work in browserify [`a346472`](https://github.com/dominictarr/through/commit/a3464727990c9b273cec1b778b59aabb7bbc77c8)
- narrow testling range, so it does not take as long [`b1e474b`](https://github.com/dominictarr/through/commit/b1e474b029827673de4b35850d2116e7176171bf)
## [v2.2.4](https://github.com/ljharb/through/compare/v2.2.3...v2.2.4) - 2013-03-13
### Commits
- update stream spec [`f0f0c83`](https://github.com/dominictarr/through/commit/f0f0c83cd32a31dcf897b4eb310210440e975d89)
## [v2.2.3](https://github.com/ljharb/through/compare/v2.2.2...v2.2.3) - 2013-03-12
### Commits
- update stream-spec [`2d2e3e4`](https://github.com/dominictarr/through/commit/2d2e3e4ab429cd9c1a9a9d6b49488040012b0d33)
## [v2.2.2](https://github.com/ljharb/through/compare/v2.2.1...v2.2.2) - 2013-03-12
### Commits
- switch tests to use tape [`4a5652f`](https://github.com/dominictarr/through/commit/4a5652f8ada85dd8d212d558f386e2ab57f36d46)
- add testling setup to package.json [`bbe2a05`](https://github.com/dominictarr/through/commit/bbe2a05012b4855624893c24ebed1c24fb3d8107)
- fix test command [`12ec8a3`](https://github.com/dominictarr/through/commit/12ec8a34f6155ca7ea504aa1a0eaa30a869c90bc)
## [v2.2.1](https://github.com/ljharb/through/compare/2.2.0...v2.2.1) - 2013-03-03
### Merged
- doc [`#6`](https://github.com/dominictarr/through/pull/6)
## [2.2.0](https://github.com/ljharb/through/compare/v2.1.0...2.2.0) - 2013-02-11
### Merged
- Alias `queue()` to `push()` [`#5`](https://github.com/dominictarr/through/pull/5)
## [v2.1.0](https://github.com/ljharb/through/compare/v2.0.0...v2.1.0) - 2012-11-27
### Commits
- allow chaining [`6fbfd15`](https://github.com/dominictarr/through/commit/6fbfd158bc64a0df1b9cb8e6e462ab8109caaf09)
## [v2.0.0](https://github.com/ljharb/through/compare/v1.1.2...v2.0.0) - 2012-11-25
### Commits
- explain new api [`f5c1702`](https://github.com/dominictarr/through/commit/f5c17027e88d0cb8f51ba02dff058f909064617a)
- internal buffer should not be exposed [`97b40cc`](https://github.com/dominictarr/through/commit/97b40ccb4fe3058ad6d2d625c6d03297991a551a)
- use queue by default [`105677a`](https://github.com/dominictarr/through/commit/105677a705621f69ac5c2e42dc7f378b62eef937)
## [v1.1.2](https://github.com/ljharb/through/compare/v1.1.1...v1.1.2) - 2012-11-20
### Commits
- Ensure that end will be queued if paused with data [`c3efc00`](https://github.com/dominictarr/through/commit/c3efc00a7f381901096f0b3704aff2e2e3585330)
## [v1.1.1](https://github.com/ljharb/through/compare/v1.1.0...v1.1.1) - 2012-10-11
### Commits
- tidy [`42a2914`](https://github.com/dominictarr/through/commit/42a2914644a52981a9dbc94edbfe2d4677763817)
## [v1.1.0](https://github.com/ljharb/through/compare/v0.1.4...v1.1.0) - 2012-09-15
### Commits
- optional buffering [`63b41c6`](https://github.com/dominictarr/through/commit/63b41c6e073998cd8ed79a729339b1a728be088d)
- test for buffering [`9038d80`](https://github.com/dominictarr/through/commit/9038d8062ce4385fa34198d663597fae2b60b86d)
- test that end, close event correct [`7438a33`](https://github.com/dominictarr/through/commit/7438a333b3ab43121f654c26230fe0f39e3a33b1)
- update docs [`5f55881`](https://github.com/dominictarr/through/commit/5f5588176395d5934287205a599c0789150bc209)
- always emit drain [`58ce6ed`](https://github.com/dominictarr/through/commit/58ce6ed1fce57a777e8031384f1fa75ce185ec5d)
## [v0.1.4](https://github.com/ljharb/through/compare/v0.1.3...v0.1.4) - 2012-08-07
### Commits
- package.json: s/repo/repository/ [`6c811fa`](https://github.com/dominictarr/through/commit/6c811fa1c8d90b54f3d41e969720fb405f1de6c1)
## [v0.1.3](https://github.com/ljharb/through/compare/v0.1.2...v0.1.3) - 2012-08-07
### Commits
- fix repo links [`c49724d`](https://github.com/dominictarr/through/commit/c49724d51a4ca6bd3096451f98a7cd5b45b4386f)
## [v0.1.2](https://github.com/ljharb/through/compare/v0.1.1...v0.1.2) - 2012-07-23
### Commits
- do not emit pause event when already paused [`1e5a27e`](https://github.com/dominictarr/through/commit/1e5a27e2c49a82e769f4364126f7315894e81021)
## [v0.1.1](https://github.com/ljharb/through/compare/v0.1.0...v0.1.1) - 2012-07-23
### Commits
- fix typo [`3258738`](https://github.com/dominictarr/through/commit/325873812e1893472ab141b69fe48665cb5b7ac3)
## [v0.1.0](https://github.com/ljharb/through/compare/v0.0.4...v0.1.0) - 2012-07-23
### Commits
- emit pause on entering pause state [`2a003f9`](https://github.com/dominictarr/through/commit/2a003f9896b19978f6111e077acab870e5c9bbf6)
## [v0.0.4](https://github.com/ljharb/through/compare/v0.0.3...v0.0.4) - 2012-07-07
### Commits
- add opensource [`9691145`](https://github.com/dominictarr/through/commit/9691145e2791855294258ab02bbbdbb132a23c43)
- a bit better test coverage [`320ee05`](https://github.com/dominictarr/through/commit/320ee05d28b9aa7f0242446b803217947ad8d25f)
- do not throw on end if not writable, just ignore [`a04701b`](https://github.com/dominictarr/through/commit/a04701be062484c02d54b6515583b31930bed1f9)
## [v0.0.3](https://github.com/ljharb/through/compare/v0.0.2...v0.0.3) - 2012-07-05
### Commits
- remove from [`682c71e`](https://github.com/dominictarr/through/commit/682c71e0774f6442d7fc64ee4bc9b6a76fead177)
- add travis-ci [`8ccc78c`](https://github.com/dominictarr/through/commit/8ccc78c66989845e4f538fe9a041ebfe9f52f672)
- don't care about 0.4 [`df41950`](https://github.com/dominictarr/through/commit/df419507a80c30586ada6576780228cc39c5fbda)
## [v0.0.2](https://github.com/ljharb/through/compare/v0.0.1...v0.0.2) - 2012-07-05
### Commits
- document [`b238767`](https://github.com/dominictarr/through/commit/b2387678b54fdb08093eb3e23b54f3e1c8477237)
## v0.0.1 - 2012-07-05
### Commits
- initial [`903501a`](https://github.com/dominictarr/through/commit/903501acf73d03f584dd572b885c78c1bc9cca8b)
- add test script [`7359f4d`](https://github.com/dominictarr/through/commit/7359f4dfe0df20938f77bdbdf689eba78b8a0fa4)

24
backend/node_modules/@ljharb/through/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,24 @@
The MIT License
Copyright (c) 2011 Dominic Tarr
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.

81
backend/node_modules/@ljharb/through/README.md generated vendored Normal file
View File

@@ -0,0 +1,81 @@
# @ljharb/through <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
*Note*: This package is a fork of https://npmjs.com/through, and builds off of it.
[![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]
Easy way to create a `Stream` that is both `readable` and `writable`.
* Pass in optional `write` and `end` methods.
* `through` takes care of pause/resume logic if you use `this.queue(data)` instead of `this.emit('data', data)`.
* Use `this.pause()` and `this.resume()` to manage flow.
* Check `this.paused` to see current flow state. (`write` always returns `!this.paused`).
This function is the basis for most of the synchronous streams in [event-stream](http://github.com/dominictarr/event-stream).
``` js
var through = require('@ljharb/through')
through(function write(data) {
this.queue(data) //data *must* not be null
},
function end () { //optional
this.queue(null)
})
```
Or, can also be used _without_ buffering on pause, use `this.emit('data', data)`,
and this.emit('end')
``` js
var through = require('@ljharb/through')
through(function write(data) {
this.emit('data', data)
//this.pause()
},
function end () { //optional
this.emit('end')
})
```
## Extended Options
You will probably not need these 99% of the time.
### autoDestroy=false
By default, `through` emits close when the writable
and readable side of the stream has ended.
If that is not desired, set `autoDestroy=false`.
``` js
var through = require('@ljharb/through')
//like this
var ts = through(write, end, {autoDestroy: false})
//or like this
var ts = through(write, end)
ts.autoDestroy = false
```
[package-url]: https://npmjs.org/package/@ljharb/through
[npm-version-svg]: https://versionbadg.es/ljharb/through.svg
[deps-svg]: https://david-dm.org/ljharb/through.svg
[deps-url]: https://david-dm.org/ljharb/through
[dev-deps-svg]: https://david-dm.org/ljharb/through/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/through#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/@ljharb/through.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/@ljharb/through.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/@ljharb/through.svg
[downloads-url]: https://npm-stat.com/charts.html?package=@ljharb/through
[codecov-image]: https://codecov.io/gh/ljharb/through/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/through/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/through
[actions-url]: https://github.com/ljharb/through/actions

118
backend/node_modules/@ljharb/through/index.js generated vendored Normal file
View File

@@ -0,0 +1,118 @@
'use strict';
var Stream = require('stream').Stream;
var callBind = require('call-bind');
/** @typedef {import('./through').ThroughStream} ThroughStream */
// create a readable writable stream.
/** @type {import('./through')} */
function through(write, end, opts) {
var writeBound = callBind(write || /** @type {(this: ThroughStream, data: unknown) => void} */ function (data) { this.queue(data); });
var endBound = callBind(end || /** @type {(this: ThroughStream) => void} */ function () { this.queue(null); });
var ended = false;
var destroyed = false;
/** @type {unknown[]} */ var buffer = [];
var _ended = false;
// @ts-expect-error
/** @type {ThroughStream} */ var stream = new Stream();
stream.readable = true;
stream.writable = true;
stream.paused = false;
// stream.autoPause = !(opts && opts.autoPause === false)
stream.autoDestroy = !(opts && opts.autoDestroy === false);
stream.write = function (data) {
writeBound(this, data);
return !stream.paused;
};
function drain() {
while (buffer.length && !stream.paused) {
var data = buffer.shift();
if (data === null) { return stream.emit('end'); }
stream.emit('data', data);
}
}
stream.queue = function (data) {
// console.error(ended)
if (_ended) { return stream; }
if (data === null) { _ended = true; }
buffer.push(data);
drain();
return stream;
};
stream.push = stream.queue;
/*
* this will be registered as the first 'end' listener must call destroy next tick, to make sure we're after any stream piped from here.
* this is only a problem if end is not emitted synchronously.
* a nicer way to do this is to make sure this is the last listener for 'end'
*/
stream.on('end', function () {
stream.readable = false;
if (!stream.writable && stream.autoDestroy) {
process.nextTick(function () {
stream.destroy();
});
}
});
function _end() {
stream.writable = false;
endBound(stream);
if (!stream.readable && stream.autoDestroy) { stream.destroy(); }
}
stream.end = function (data) {
if (ended) { return; }
ended = true;
if (arguments.length) { stream.write(data); }
_end(); // will emit or queue
return stream;
};
stream.destroy = function () {
if (destroyed) { return; }
destroyed = true;
ended = true;
buffer.length = 0;
stream.writable = false;
stream.readable = false;
stream.emit('close');
return stream;
};
stream.pause = function () {
if (stream.paused) { return; }
stream.paused = true;
return stream;
};
stream.resume = function () {
if (stream.paused) {
stream.paused = false;
stream.emit('resume');
}
drain();
// may have become paused again, as drain emits 'data'.
if (!stream.paused) { stream.emit('drain'); }
return stream;
};
return stream;
}
/*
* through
*
* a stream that does nothing but re-emit the input.
* useful for aggregating a series of changing but not ending streams into one stream)
*/
module.exports = through;
through.through = through;

76
backend/node_modules/@ljharb/through/package.json generated vendored Normal file
View File

@@ -0,0 +1,76 @@
{
"name": "@ljharb/through",
"version": "2.3.14",
"description": "simplified stream construction",
"main": "index.js",
"types": "./through.d.ts",
"sideEffects": false,
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"lint": "eslint --ext=js,mjs .",
"postlint": "tsc && 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)\")\""
},
"dependencies": {
"call-bind": "^1.0.8"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.3",
"@ljharb/eslint-config": "^21.1.1",
"@ljharb/tsconfig": "^0.2.3",
"@types/call-bind": "^1.0.5",
"@types/node": "^0.12.25",
"@types/tape": "^5.8.1",
"auto-changelog": "^2.5.0",
"encoding": "^0.1.13",
"eslint": "=8.8.0",
"from": "^0.1.7",
"in-publish": "^2.0.1",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"stream-spec": "^0.3.6",
"tape": "^5.9.0",
"typescript": "next"
},
"keywords": [
"stream",
"streams",
"user-streams",
"pipe"
],
"author": "Dominic Tarr <dominic.tarr@gmail.com> (dominictarr.com)",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/ljharb/through.git"
},
"homepage": "https://github.com/ljharb/through",
"testling": {
"files": "test/*.js"
},
"engines": {
"node": ">= 0.4"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true,
"startingVersion": "2.3.9"
},
"publishConfig": {
"ignore": [
".github/workflows"
]
}
}

29
backend/node_modules/@ljharb/through/test/async.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
'use strict';
var from = require('from');
var through = require('../');
var tape = require('tape');
tape('simple async example', function (t) {
var expected = [1, 2, 3, 4, 5];
var actual = [];
from(expected)
.pipe(through(function (data) {
this.pause();
setTimeout(function () {
console.log('pushing data', data);
this.push(data);
this.resume();
}.bind(this), 300);
})).pipe(through(function (data) {
console.log('pushing data second time', data);
this.push(data);
})).on('data', function (d) {
actual.push(d);
}).on('end', function () {
t.deepEqual(actual, expected);
t.end();
});
});

View File

@@ -0,0 +1,32 @@
'use strict';
var test = require('tape');
var through = require('../');
// must emit end before close.
test('end before close', function (assert) {
var ts = through(null, null, { autoDestroy: false });
var ended = false;
var closed = false;
ts.on('end', function () {
assert.ok(!closed);
ended = true;
});
ts.on('close', function () {
assert.ok(ended);
closed = true;
});
ts.write(1);
ts.write(2);
ts.write(3);
ts.end();
assert.ok(ended);
assert.notOk(closed);
ts.destroy();
assert.ok(closed);
assert.end();
});

99
backend/node_modules/@ljharb/through/test/buffering.js generated vendored Normal file
View File

@@ -0,0 +1,99 @@
'use strict';
var test = require('tape');
var through = require('../');
// must emit end before close.
test('buffering', function (assert) {
var ts = through(function (data) {
this.queue(data);
}, function () {
this.queue(null);
});
var ended = false;
var actual = [];
ts.on('data', actual.push.bind(actual));
ts.on('end', function () {
ended = true;
});
ts.write(1);
ts.write(2);
ts.write(3);
assert.deepEqual(actual, [1, 2, 3]);
ts.pause();
ts.write(4);
ts.write(5);
ts.write(6);
assert.deepEqual(actual, [1, 2, 3]);
ts.resume();
assert.deepEqual(actual, [1, 2, 3, 4, 5, 6]);
ts.pause();
ts.end();
assert.ok(!ended);
ts.resume();
assert.ok(ended);
assert.end();
});
test('buffering has data in queue, when ends', function (assert) {
// If stream ends while paused with data in the queue, stream should still emit end after all data is written on resume.
var ts = through(function (data) {
this.queue(data);
}, function () {
this.queue(null);
});
var ended = false;
var actual = [];
ts.on('data', actual.push.bind(actual));
ts.on('end', function () {
ended = true;
});
ts.pause();
ts.write(1);
ts.write(2);
ts.write(3);
ts.end();
assert.deepEqual(actual, [], 'no data written yet, still paused');
assert.ok(!ended, 'end not emitted yet, still paused');
ts.resume();
assert.deepEqual(actual, [1, 2, 3], 'resumed, all data should be delivered');
assert.ok(ended, 'end should be emitted once all data was delivered');
assert.end();
});
test('data pauses', function (t) {
var ts = through();
var results = [];
ts.on('data', function (data) {
ts.pause();
results.push(data);
});
t.equal(ts.paused, false, 'starts not paused');
ts.write(1);
t.equal(ts.paused, true, 'pauses on write');
ts.write(2);
t.equal(ts.paused, true, 'pauses on write');
ts.write(3);
t.equal(ts.paused, true, 'pauses on write');
t.deepEqual(results, [1], 'has not been resumed');
ts.resume();
t.equal(ts.paused, true, 'resume unpauses, but write re-pauses');
t.deepEqual(results, [1, 2], 'has only been resumed once');
ts.resume();
t.deepEqual(results, [1, 2, 3], 'has been resumed twice');
t.end();
});

79
backend/node_modules/@ljharb/through/test/end.js generated vendored Normal file
View File

@@ -0,0 +1,79 @@
'use strict';
var test = require('tape');
var through = require('../');
// must emit end before close.
test('end before close', function (t) {
t.plan(4);
var ts = through();
var ended = false;
var closed = false;
ts.on('end', function () {
t.ok(!closed);
ended = true;
});
ts.on('close', function () {
t.ok(ended);
closed = true;
});
ts.write(1);
ts.write(2);
ts.write(3);
ts.end();
t.ok(ended);
t.ok(closed);
t.end();
});
test('end only once', function (t) {
t.plan(4);
var ts = through();
var ended = false;
ts.on('end', function () {
t.equal(ended, false);
ended = true;
});
ts.queue(null);
ts.queue(null);
ts.queue(null);
ts.resume();
t.equal(ended, true, 'is ended');
ts.end();
t.equal(ended, true, 'is still ended after end()');
ts.end();
t.equal(ended, true, 'is still ended after end() 2x');
t.end();
});
test('end with value', function (t) {
var ts = through(null, null, { autoDestroy: false });
var results = [];
ts.on('data', function (data) {
results.push(data);
});
ts.queue(123);
ts.queue(456);
ts.end('end');
t.deepEqual(results, [123, 456, 'end']);
t.end();
});

137
backend/node_modules/@ljharb/through/test/index.js generated vendored Normal file
View File

@@ -0,0 +1,137 @@
'use strict';
var test = require('tape');
var spec = require('stream-spec');
var through = require('../');
/*
*I'm using these two functions, and not streams and pipe
*so there is less to break. if this test fails it must be
*the implementation of _through_
*/
function write(array, stream) {
array = array.slice();
function next() {
while (array.length) { if (stream.write(array.shift()) === false) { return stream.once('drain', next); } }
stream.end();
}
next();
}
function read(stream, callback) {
var actual = [];
stream.on('data', function (data) {
actual.push(data);
});
stream.once('end', function () {
callback(null, actual);
});
stream.once('error', function (err) {
callback(err);
});
}
test('simple defaults', function (assert) {
var l = 1000;
var expected = [];
while (l--) { expected.push(l * Math.random()); }
var t = through();
var s = spec(t).through().pausable();
read(t, function (err, actual) {
assert.ifError(err);
assert.deepEqual(actual, expected);
assert.end();
});
t.on('close', s.validate);
write(expected, t);
});
test('simple functions', function (assert) {
var l = 1000;
var expected = [];
while (l--) { expected.push(l * Math.random()); }
var t = through(function (data) {
this.emit('data', data * 2);
});
var s = spec(t).through().pausable();
read(t, function (err, actual) {
assert.ifError(err);
assert.deepEqual(actual, expected.map(function (data) {
return data * 2;
}));
assert.end();
});
t.on('close', s.validate);
write(expected, t);
});
test('pauses twice', function (t) {
var ts = through();
t.equal(ts.pause(), ts, 'when pausing, returns stream');
t.equal(ts.pause(), undefined, 'when already paused, returns void');
t.end();
});
test('pauses', function (assert) {
var l = 1000;
var expected = [];
while (l--) { expected.push(l); } // Math.random())
var t = through();
var s = spec(t)
.through()
.pausable();
t.on('data', function () {
if (Math.random() > 0.1) { return; }
t.pause();
process.nextTick(function () {
t.resume();
});
});
read(t, function (err, actual) {
assert.ifError(err);
assert.deepEqual(actual, expected);
});
t.on('close', function () {
s.validate();
assert.end();
});
write(expected, t);
});
test('does not soft-end on `undefined`', function (assert) {
var stream = through();
var count = 0;
stream.on('data', function () {
count += 1;
});
stream.write(undefined);
stream.write(undefined);
assert.equal(count, 2);
assert.end();
});

27
backend/node_modules/@ljharb/through/through.d.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
/// <reference types="node" />
import stream from 'stream';
declare function through(
write?: null | ((data: unknown) => void),
end?: null | (() => void),
opts?: { autoDestroy?: boolean },
): through.ThroughStream;
declare namespace through {
interface ThroughStream extends Omit<NodeJS.ReadWriteStream, 'pause' | 'resume' | 'end' | 'write'> {
autoDestroy: boolean;
paused: boolean;
readable: boolean;
writable: boolean;
destroy(): ThroughStream | undefined;
end(data: unknown): ThroughStream | undefined;
pause(): ThroughStream | undefined;
push(chunk: unknown): ThroughStream;
queue(chunk: unknown): ThroughStream;
resume(): ThroughStream;
write(chunk: unknown): boolean;
}
}
export = through;

11
backend/node_modules/@ljharb/through/tsconfig.json generated vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"extends": "@ljharb/tsconfig",
"compilerOptions": {
"target": "es2021",
},
"exclude": [
"coverage/**",
"example/**",
"test/**/*",
],
}