first commit
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
VITE_API_URL=http://localhost:5000
|
||||||
|
|
||||||
|
PORT=5000
|
||||||
|
CLIENT_URL=http://localhost:5173
|
||||||
|
DB_HOST=localhost
|
||||||
|
DB_PORT=3306
|
||||||
|
DB_USER=root
|
||||||
|
DB_PASSWORD=
|
||||||
|
DB_NAME=secondtech_market
|
||||||
|
JWT_SECRET=ganti_dengan_secret_yang_panjang
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
# SecondTech Market
|
||||||
|
|
||||||
|
Marketplace barang bekas teknologi dengan frontend Vue dan backend Node.js Express.
|
||||||
|
|
||||||
|
## Stack
|
||||||
|
|
||||||
|
- Vue 3
|
||||||
|
- Vite
|
||||||
|
- Tailwind CSS
|
||||||
|
- Vue Router
|
||||||
|
- Express
|
||||||
|
- MySQL
|
||||||
|
- Multer untuk upload foto
|
||||||
|
- JWT untuk sesi login
|
||||||
|
|
||||||
|
## Fitur
|
||||||
|
|
||||||
|
- Register dan login ke database
|
||||||
|
- Password disimpan sebagai hash
|
||||||
|
- Marketplace produk dari MySQL
|
||||||
|
- Detail produk
|
||||||
|
- Search produk
|
||||||
|
- Filter kategori dan kondisi
|
||||||
|
- Upload foto barang dari file perangkat
|
||||||
|
- Dashboard barang saya
|
||||||
|
- Tandai barang terjual
|
||||||
|
- Hapus barang milik sendiri
|
||||||
|
- Tombol WhatsApp penjual
|
||||||
|
- Bookmark barang di browser
|
||||||
|
|
||||||
|
## Setup Database
|
||||||
|
|
||||||
|
1. Buka phpMyAdmin.
|
||||||
|
2. Pilih menu Import.
|
||||||
|
3. Import file `database.sql`.
|
||||||
|
4. Pastikan database `secondtech_market` berhasil dibuat.
|
||||||
|
|
||||||
|
## Setup Environment
|
||||||
|
|
||||||
|
Copy `.env.example` menjadi `.env`, lalu sesuaikan koneksi MySQL:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
DB_HOST=localhost
|
||||||
|
DB_PORT=3306
|
||||||
|
DB_USER=root
|
||||||
|
DB_PASSWORD=
|
||||||
|
DB_NAME=secondtech_market
|
||||||
|
JWT_SECRET=ganti_dengan_secret_yang_panjang
|
||||||
|
```
|
||||||
|
|
||||||
|
Jika frontend memakai port Vite default, biarkan:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
VITE_API_URL=http://localhost:5000
|
||||||
|
CLIENT_URL=http://localhost:5173
|
||||||
|
```
|
||||||
|
|
||||||
|
## Cara Menjalankan
|
||||||
|
|
||||||
|
Install dependency:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
Jalankan backend:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run dev:api
|
||||||
|
```
|
||||||
|
|
||||||
|
Jalankan frontend di terminal lain:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
Buka:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
http://localhost:5173
|
||||||
|
```
|
||||||
|
|
||||||
|
## Upload Foto
|
||||||
|
|
||||||
|
Foto yang diupload tersimpan di:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
server/uploads
|
||||||
|
```
|
||||||
|
|
||||||
|
URL foto disimpan di MySQL sebagai path `/uploads/nama-file`.
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
CREATE DATABASE IF NOT EXISTS secondtech_market
|
||||||
|
CHARACTER SET utf8mb4
|
||||||
|
COLLATE utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
USE secondtech_market;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS users (
|
||||||
|
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
name VARCHAR(120) NOT NULL,
|
||||||
|
email VARCHAR(160) NOT NULL UNIQUE,
|
||||||
|
whatsapp VARCHAR(30) NOT NULL,
|
||||||
|
password_hash VARCHAR(255) NOT NULL,
|
||||||
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS products (
|
||||||
|
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
user_id INT UNSIGNED NULL,
|
||||||
|
title VARCHAR(180) NOT NULL,
|
||||||
|
category VARCHAR(80) NOT NULL,
|
||||||
|
price INT UNSIGNED NOT NULL,
|
||||||
|
`condition` VARCHAR(80) NOT NULL,
|
||||||
|
location VARCHAR(120) NOT NULL,
|
||||||
|
seller VARCHAR(120) NOT NULL,
|
||||||
|
whatsapp VARCHAR(30) NOT NULL,
|
||||||
|
image VARCHAR(255) NOT NULL,
|
||||||
|
description TEXT NOT NULL,
|
||||||
|
status ENUM('Tersedia', 'Terjual') NOT NULL DEFAULT 'Tersedia',
|
||||||
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
|
CONSTRAINT fk_products_user
|
||||||
|
FOREIGN KEY (user_id) REFERENCES users(id)
|
||||||
|
ON DELETE SET NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO products
|
||||||
|
(id, title, category, price, `condition`, location, seller, whatsapp, image, description, status)
|
||||||
|
VALUES
|
||||||
|
(1, 'Laptop Lenovo ThinkPad T480', 'Laptop', 3200000, 'Bekas Normal', 'Yogyakarta', 'Raka SIJA', '6281234567890', 'https://images.unsplash.com/photo-1496181133206-80ce9b88a853?q=80&w=1200&auto=format&fit=crop', 'Laptop bekas cocok untuk belajar coding, jaringan, virtual machine ringan, dan kebutuhan sekolah. RAM 8GB, SSD 256GB, keyboard normal.', 'Tersedia'),
|
||||||
|
(2, 'PC Rakitan i5 Gen 8', 'PC', 4100000, 'Bekas Normal', 'Bantul', 'Dimas Tech', '628111222333', 'https://images.unsplash.com/photo-1587202372775-e229f172b9d7?q=80&w=1200&auto=format&fit=crop', 'PC rakitan untuk lab jaringan, desain ringan, dan multitasking. Intel Core i5, RAM 16GB, SSD 512GB.', 'Tersedia'),
|
||||||
|
(3, 'Monitor LG 24 Inch IPS', 'Monitor', 1150000, 'Bekas Mulus', 'Sleman', 'Adit Hardware', '628555666777', 'https://images.unsplash.com/photo-1527443224154-c4a3942d3acf?q=80&w=1200&auto=format&fit=crop', 'Monitor IPS 24 inch, warna masih bagus, cocok untuk coding dan editing. Include kabel power dan HDMI.', 'Tersedia'),
|
||||||
|
(4, 'Keyboard Mechanical Keychron K2', 'Keyboard', 850000, 'Bekas Normal', 'Solo', 'Naufal Keys', '628333444555', 'https://images.unsplash.com/photo-1618384887929-16ec33fab9ef?q=80&w=1200&auto=format&fit=crop', 'Keyboard mechanical wireless, switch brown, cocok untuk coding. Kondisi normal dan keycap lengkap.', 'Tersedia'),
|
||||||
|
(5, 'MikroTik RB941 hAP Lite', 'Router', 180000, 'Bekas Normal', 'Kulon Progo', 'Lab Network', '628777888999', 'https://images.unsplash.com/photo-1606904825846-647eb07f5be2?q=80&w=1200&auto=format&fit=crop', 'Router MikroTik untuk belajar routing, firewall, DHCP, hotspot, dan konfigurasi dasar jaringan.', 'Tersedia'),
|
||||||
|
(6, 'Switch TP-Link 8 Port Gigabit', 'Switch', 250000, 'Bekas Normal', 'Magelang', 'Fajar Net', '628999111222', 'https://images.unsplash.com/photo-1558494949-ef010cbdcc31?q=80&w=1200&auto=format&fit=crop', 'Switch 8 port gigabit, cocok untuk lab kecil, warnet mini, dan praktik jaringan lokal.', 'Tersedia'),
|
||||||
|
(7, 'Server Dell PowerEdge R620', 'Server', 6500000, 'Bekas Server Room', 'Jakarta', 'Server Bekas ID', '628222333444', 'https://images.unsplash.com/photo-1558494949-ef010cbdcc31?q=80&w=1200&auto=format&fit=crop', 'Server rackmount bekas data center, cocok untuk belajar virtualization, Proxmox, Docker, dan homelab.', 'Tersedia'),
|
||||||
|
(8, 'Access Point TP-Link EAP225', 'Access Point', 620000, 'Bekas Mulus', 'Semarang', 'WiFi Store', '6281212121212', 'https://images.unsplash.com/photo-1544197150-b99a580bb7a8?q=80&w=1200&auto=format&fit=crop', 'Access point ceiling untuk hotspot sekolah, kantor, dan lab jaringan. Kondisi normal.', 'Tersedia')
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
title = VALUES(title),
|
||||||
|
category = VALUES(category),
|
||||||
|
price = VALUES(price),
|
||||||
|
`condition` = VALUES(`condition`),
|
||||||
|
location = VALUES(location),
|
||||||
|
seller = VALUES(seller),
|
||||||
|
whatsapp = VALUES(whatsapp),
|
||||||
|
image = VALUES(image),
|
||||||
|
description = VALUES(description),
|
||||||
|
status = VALUES(status);
|
||||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+13
@@ -0,0 +1,13 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="id">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>SecondTech Market</title>
|
||||||
|
<script type="module" crossorigin src="/assets/index-DESju_tB.js"></script>
|
||||||
|
<link rel="stylesheet" crossorigin href="/assets/index-MCHiugha.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="id">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>SecondTech Market</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script type="module" src="/src/main.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+16
@@ -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/../acorn/bin/acorn" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../acorn/bin/acorn" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\acorn\bin\acorn" %*
|
||||||
+28
@@ -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/../acorn/bin/acorn" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../acorn/bin/acorn" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../acorn/bin/acorn" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../autoprefixer/bin/autoprefixer" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../autoprefixer/bin/autoprefixer" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\autoprefixer\bin\autoprefixer" %*
|
||||||
+28
@@ -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/../autoprefixer/bin/autoprefixer" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../autoprefixer/bin/autoprefixer" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../autoprefixer/bin/autoprefixer" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../autoprefixer/bin/autoprefixer" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../baseline-browser-mapping/dist/cli.cjs" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../baseline-browser-mapping/dist/cli.cjs" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\baseline-browser-mapping\dist\cli.cjs" %*
|
||||||
+28
@@ -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/../baseline-browser-mapping/dist/cli.cjs" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../baseline-browser-mapping/dist/cli.cjs" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../baseline-browser-mapping/dist/cli.cjs" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../baseline-browser-mapping/dist/cli.cjs" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../bcryptjs/bin/bcrypt" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../bcryptjs/bin/bcrypt" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\bcryptjs\bin\bcrypt" %*
|
||||||
+28
@@ -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/../bcryptjs/bin/bcrypt" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../bcryptjs/bin/bcrypt" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../bcryptjs/bin/bcrypt" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../bcryptjs/bin/bcrypt" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../browserslist/cli.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../browserslist/cli.js" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\browserslist\cli.js" %*
|
||||||
+28
@@ -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/../browserslist/cli.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../browserslist/cli.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../browserslist/cli.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../cssesc/bin/cssesc" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../cssesc/bin/cssesc" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\cssesc\bin\cssesc" %*
|
||||||
+28
@@ -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/../cssesc/bin/cssesc" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../cssesc/bin/cssesc" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../cssesc/bin/cssesc" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../cssesc/bin/cssesc" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../jiti/bin/jiti.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../jiti/bin/jiti.js" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\jiti\bin\jiti.js" %*
|
||||||
+28
@@ -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/../jiti/bin/jiti.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../jiti/bin/jiti.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../jiti/bin/jiti.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../jiti/bin/jiti.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../jsesc/bin/jsesc" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../jsesc/bin/jsesc" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\jsesc\bin\jsesc" %*
|
||||||
+28
@@ -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/../jsesc/bin/jsesc" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../jsesc/bin/jsesc" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../jsesc/bin/jsesc" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../jsesc/bin/jsesc" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../json5/lib/cli.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../json5/lib/cli.js" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\json5\lib\cli.js" %*
|
||||||
+28
@@ -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/../json5/lib/cli.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../json5/lib/cli.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../json5/lib/cli.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../nanoid/bin/nanoid.cjs" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../nanoid/bin/nanoid.cjs" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\nanoid\bin\nanoid.cjs" %*
|
||||||
+28
@@ -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/../nanoid/bin/nanoid.cjs" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../@babel/parser/bin/babel-parser.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\@babel\parser\bin\babel-parser.js" %*
|
||||||
+28
@@ -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/../@babel/parser/bin/babel-parser.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../resolve/bin/resolve" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../resolve/bin/resolve" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\resolve\bin\resolve" %*
|
||||||
+28
@@ -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/../resolve/bin/resolve" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../resolve/bin/resolve" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../resolve/bin/resolve" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../rolldown/bin/cli.mjs" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../rolldown/bin/cli.mjs" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\rolldown\bin\cli.mjs" %*
|
||||||
+28
@@ -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/../rolldown/bin/cli.mjs" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../rolldown/bin/cli.mjs" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../rolldown/bin/cli.mjs" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../rolldown/bin/cli.mjs" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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
|
||||||
+17
@@ -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" %*
|
||||||
+28
@@ -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
|
||||||
+16
@@ -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/../sucrase/bin/sucrase" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../sucrase/bin/sucrase" "$@"
|
||||||
|
fi
|
||||||
+16
@@ -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/../sucrase/bin/sucrase-node" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../sucrase/bin/sucrase-node" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\sucrase\bin\sucrase-node" %*
|
||||||
+28
@@ -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/../sucrase/bin/sucrase-node" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../sucrase/bin/sucrase-node" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../sucrase/bin/sucrase-node" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../sucrase/bin/sucrase-node" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+17
@@ -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%\..\sucrase\bin\sucrase" %*
|
||||||
+28
@@ -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/../sucrase/bin/sucrase" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../sucrase/bin/sucrase" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../sucrase/bin/sucrase" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../sucrase/bin/sucrase" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../tailwindcss/lib/cli.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../tailwindcss/lib/cli.js" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\tailwindcss\lib\cli.js" %*
|
||||||
+28
@@ -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/../tailwindcss/lib/cli.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../tailwindcss/lib/cli.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../tailwindcss/lib/cli.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../tailwindcss/lib/cli.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../tailwindcss/lib/cli.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../tailwindcss/lib/cli.js" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\tailwindcss\lib\cli.js" %*
|
||||||
+28
@@ -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/../tailwindcss/lib/cli.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../tailwindcss/lib/cli.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../tailwindcss/lib/cli.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../tailwindcss/lib/cli.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../update-browserslist-db/cli.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../update-browserslist-db/cli.js" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\update-browserslist-db\cli.js" %*
|
||||||
+28
@@ -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/../update-browserslist-db/cli.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../update-browserslist-db/cli.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../update-browserslist-db/cli.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../update-browserslist-db/cli.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../vite/bin/vite.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../vite/bin/vite.js" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\vite\bin\vite.js" %*
|
||||||
+28
@@ -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/../vite/bin/vite.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../vite/bin/vite.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../vite/bin/vite.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../vite/bin/vite.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -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/../yaml/bin.mjs" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../yaml/bin.mjs" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -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%\..\yaml\bin.mjs" %*
|
||||||
+28
@@ -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/../yaml/bin.mjs" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../yaml/bin.mjs" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../yaml/bin.mjs" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../yaml/bin.mjs" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+3245
File diff suppressed because it is too large
Load Diff
+32
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"hash": "40c30454",
|
||||||
|
"configHash": "f033ba72",
|
||||||
|
"lockfileHash": "f80977f6",
|
||||||
|
"browserHash": "69b1c7b1",
|
||||||
|
"optimized": {
|
||||||
|
"lucide-vue-next": {
|
||||||
|
"src": "../../lucide-vue-next/dist/esm/lucide-vue-next.js",
|
||||||
|
"file": "lucide-vue-next.js",
|
||||||
|
"fileHash": "1102272b",
|
||||||
|
"needsInterop": false
|
||||||
|
},
|
||||||
|
"vue-router": {
|
||||||
|
"src": "../../vue-router/dist/vue-router.js",
|
||||||
|
"file": "vue-router.js",
|
||||||
|
"fileHash": "c295d1ee",
|
||||||
|
"needsInterop": false
|
||||||
|
},
|
||||||
|
"vue": {
|
||||||
|
"src": "../../vue/dist/vue.runtime.esm-bundler.js",
|
||||||
|
"file": "vue.js",
|
||||||
|
"fileHash": "80604bd0",
|
||||||
|
"needsInterop": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"chunks": {
|
||||||
|
"vue.runtime.esm-bundler-C6sZGmPl": {
|
||||||
|
"file": "vue.runtime.esm-bundler-C6sZGmPl.js",
|
||||||
|
"isDynamicEntry": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+48068
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+3
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
+6437
File diff suppressed because it is too large
Load Diff
+1
File diff suppressed because one or more lines are too long
+2
@@ -0,0 +1,2 @@
|
|||||||
|
import { $ as createTextVNode, $n as toRefs, $t as resolveTransitionHooks, A as ErrorCodes, An as customRef, At as onBeforeMount, B as callWithErrorHandling, Bn as markRaw, Bt as onUpdated, C as vShow, Cn as withDirectives, Ct as isRuntimeOnly, D as BaseTransitionPropsValidators, Dn as ReactiveEffect, Dt as mergeProps, E as BaseTransition, En as EffectScope, Et as mergeModels, F as Suspense, Fn as isProxy, Ft as onMounted, G as createBlock, Gn as readonly, Gt as queuePostFlushCb, H as compatUtils, Hn as onWatcherCleanup, Ht as popScopeId, I as Teleport, In as isReactive, It as onRenderTracked, J as createHydrationRenderer, Jn as shallowReadonly, Jt as renderSlot, K as createCommentVNode, Kn as ref, Kt as registerRuntimeCompiler, L as Text, Ln as isReadonly, Lt as onRenderTriggered, M as Fragment, Mn as effectScope, Mt as onBeforeUpdate, N as KeepAlive, Nn as getCurrentScope, Nt as onDeactivated, O as Comment, On as TrackOpTypes, Ot as nextTick, P as Static, Pn as getCurrentWatcher, Pt as onErrorCaptured, Q as createStaticVNode, Qn as toRef, Qt as resolveFilter, R as assertNumber, Rn as isRef, Rt as onServerPrefetch, S as vModelText, Sn as withDefaults, St as isMemoSame, T as withModifiers, Tn as withScopeId, Tt as mergeDefaults, U as computed, Un as proxyRefs, Ut as provide, V as cloneVNode, Vn as onScopeDispose, Vt as openBlock, W as createBaseVNode, Wn as reactive, Wt as pushScopeId, X as createRenderer, Xn as stop, Xt as resolveDirective, Y as createPropsRestProxy, Yn as shallowRef, Yt as resolveComponent, Z as createSlots, Zn as toRaw, Zt as resolveDynamicComponent, _ as useShadowRoot, _n as watchEffect, _t as hydrateOnInteraction, a as createApp, an as toHandlers, ar as normalizeClass, at as defineModel, b as vModelRadio, bn as withAsyncContext, bt as initCustomFormatter, c as defineSSRCustomElement, cn as useId, cr as toDisplayString, ct as defineSlots, d as nodeOps, dn as useSlots, dt as getTransitionRawChildren, en as setBlockTracking, er as toValue, et as createVNode, f as patchProp, fn as useTemplateRef, ft as guardReactiveProps, g as useHost, gn as watch, gt as hydrateOnIdle, h as useCssVars, hn as warn, ht as hasInjectionContext, i as VueElement, in as ssrUtils, ir as capitalize, it as defineExpose, j as ErrorTypeStrings, jn as effect, jt as onBeforeUnmount, k as DeprecationTypes, kn as TriggerOpTypes, kt as onActivated, l as hydrate, ln as useModel, lr as toHandlerKey, lt as devtools, m as useCssModule, mn as version, mt as handleError, n as Transition, nn as setTransitionHooks, nr as unref, nt as defineComponent, o as createSSRApp, on as transformVNodeArgs, or as normalizeProps, ot as defineOptions, p as render, pn as useTransitionState, pt as h, q as createElementBlock, qn as shallowReactive, qt as renderList, r as TransitionGroup, rn as ssrContextKey, rr as camelize, rt as defineEmits, s as defineCustomElement, sn as useAttrs, sr as normalizeStyle, st as defineProps, t as compile, tn as setDevtoolsHook, tr as triggerRef, tt as defineAsyncComponent, u as initDirectivesForSSR, un as useSSRContext, ut as getCurrentInstance, v as vModelCheckbox, vn as watchPostEffect, vt as hydrateOnMediaQuery, w as withKeys, wn as withMemo, wt as isVNode, x as vModelSelect, xn as withCtx, xt as inject, y as vModelDynamic, yn as watchSyncEffect, yt as hydrateOnVisible, z as callWithAsyncErrorHandling, zn as isShallow, zt as onUnmounted } from "./vue.runtime.esm-bundler-C6sZGmPl.js";
|
||||||
|
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getCurrentWatcher, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, nodeOps, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, patchProp, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useHost, useId, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
|
||||||
+8610
File diff suppressed because it is too large
Load Diff
+1
File diff suppressed because one or more lines are too long
+128
@@ -0,0 +1,128 @@
|
|||||||
|
declare namespace QuickLRU {
|
||||||
|
interface Options<KeyType, ValueType> {
|
||||||
|
/**
|
||||||
|
The maximum number of milliseconds an item should remain in the cache.
|
||||||
|
|
||||||
|
@default Infinity
|
||||||
|
|
||||||
|
By default, `maxAge` will be `Infinity`, which means that items will never expire.
|
||||||
|
Lazy expiration upon the next write or read call.
|
||||||
|
|
||||||
|
Individual expiration of an item can be specified by the `set(key, value, maxAge)` method.
|
||||||
|
*/
|
||||||
|
readonly maxAge?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
The maximum number of items before evicting the least recently used items.
|
||||||
|
*/
|
||||||
|
readonly maxSize: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Called right before an item is evicted from the cache.
|
||||||
|
|
||||||
|
Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`).
|
||||||
|
*/
|
||||||
|
onEviction?: (key: KeyType, value: ValueType) => void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare class QuickLRU<KeyType, ValueType>
|
||||||
|
implements Iterable<[KeyType, ValueType]> {
|
||||||
|
/**
|
||||||
|
The stored item count.
|
||||||
|
*/
|
||||||
|
readonly size: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Simple ["Least Recently Used" (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29).
|
||||||
|
|
||||||
|
The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop.
|
||||||
|
|
||||||
|
@example
|
||||||
|
```
|
||||||
|
import QuickLRU = require('quick-lru');
|
||||||
|
|
||||||
|
const lru = new QuickLRU({maxSize: 1000});
|
||||||
|
|
||||||
|
lru.set('🦄', '🌈');
|
||||||
|
|
||||||
|
lru.has('🦄');
|
||||||
|
//=> true
|
||||||
|
|
||||||
|
lru.get('🦄');
|
||||||
|
//=> '🌈'
|
||||||
|
```
|
||||||
|
*/
|
||||||
|
constructor(options: QuickLRU.Options<KeyType, ValueType>);
|
||||||
|
|
||||||
|
[Symbol.iterator](): IterableIterator<[KeyType, ValueType]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Set an item. Returns the instance.
|
||||||
|
|
||||||
|
Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified in the constructor, otherwise the item will never expire.
|
||||||
|
|
||||||
|
@returns The list instance.
|
||||||
|
*/
|
||||||
|
set(key: KeyType, value: ValueType, options?: {maxAge?: number}): this;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get an item.
|
||||||
|
|
||||||
|
@returns The stored item or `undefined`.
|
||||||
|
*/
|
||||||
|
get(key: KeyType): ValueType | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Check if an item exists.
|
||||||
|
*/
|
||||||
|
has(key: KeyType): boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get an item without marking it as recently used.
|
||||||
|
|
||||||
|
@returns The stored item or `undefined`.
|
||||||
|
*/
|
||||||
|
peek(key: KeyType): ValueType | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Delete an item.
|
||||||
|
|
||||||
|
@returns `true` if the item is removed or `false` if the item doesn't exist.
|
||||||
|
*/
|
||||||
|
delete(key: KeyType): boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Delete all items.
|
||||||
|
*/
|
||||||
|
clear(): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Update the `maxSize` in-place, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee.
|
||||||
|
|
||||||
|
Useful for on-the-fly tuning of cache sizes in live systems.
|
||||||
|
*/
|
||||||
|
resize(maxSize: number): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Iterable for all the keys.
|
||||||
|
*/
|
||||||
|
keys(): IterableIterator<KeyType>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Iterable for all the values.
|
||||||
|
*/
|
||||||
|
values(): IterableIterator<ValueType>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Iterable for all entries, starting with the oldest (ascending in recency).
|
||||||
|
*/
|
||||||
|
entriesAscending(): IterableIterator<[KeyType, ValueType]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Iterable for all entries, starting with the newest (descending in recency).
|
||||||
|
*/
|
||||||
|
entriesDescending(): IterableIterator<[KeyType, ValueType]>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export = QuickLRU;
|
||||||
+263
@@ -0,0 +1,263 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
class QuickLRU {
|
||||||
|
constructor(options = {}) {
|
||||||
|
if (!(options.maxSize && options.maxSize > 0)) {
|
||||||
|
throw new TypeError('`maxSize` must be a number greater than 0');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof options.maxAge === 'number' && options.maxAge === 0) {
|
||||||
|
throw new TypeError('`maxAge` must be a number greater than 0');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.maxSize = options.maxSize;
|
||||||
|
this.maxAge = options.maxAge || Infinity;
|
||||||
|
this.onEviction = options.onEviction;
|
||||||
|
this.cache = new Map();
|
||||||
|
this.oldCache = new Map();
|
||||||
|
this._size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
_emitEvictions(cache) {
|
||||||
|
if (typeof this.onEviction !== 'function') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const [key, item] of cache) {
|
||||||
|
this.onEviction(key, item.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_deleteIfExpired(key, item) {
|
||||||
|
if (typeof item.expiry === 'number' && item.expiry <= Date.now()) {
|
||||||
|
if (typeof this.onEviction === 'function') {
|
||||||
|
this.onEviction(key, item.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.delete(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
_getOrDeleteIfExpired(key, item) {
|
||||||
|
const deleted = this._deleteIfExpired(key, item);
|
||||||
|
if (deleted === false) {
|
||||||
|
return item.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_getItemValue(key, item) {
|
||||||
|
return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
_peek(key, cache) {
|
||||||
|
const item = cache.get(key);
|
||||||
|
|
||||||
|
return this._getItemValue(key, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
_set(key, value) {
|
||||||
|
this.cache.set(key, value);
|
||||||
|
this._size++;
|
||||||
|
|
||||||
|
if (this._size >= this.maxSize) {
|
||||||
|
this._size = 0;
|
||||||
|
this._emitEvictions(this.oldCache);
|
||||||
|
this.oldCache = this.cache;
|
||||||
|
this.cache = new Map();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_moveToRecent(key, item) {
|
||||||
|
this.oldCache.delete(key);
|
||||||
|
this._set(key, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
* _entriesAscending() {
|
||||||
|
for (const item of this.oldCache) {
|
||||||
|
const [key, value] = item;
|
||||||
|
if (!this.cache.has(key)) {
|
||||||
|
const deleted = this._deleteIfExpired(key, value);
|
||||||
|
if (deleted === false) {
|
||||||
|
yield item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const item of this.cache) {
|
||||||
|
const [key, value] = item;
|
||||||
|
const deleted = this._deleteIfExpired(key, value);
|
||||||
|
if (deleted === false) {
|
||||||
|
yield item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get(key) {
|
||||||
|
if (this.cache.has(key)) {
|
||||||
|
const item = this.cache.get(key);
|
||||||
|
|
||||||
|
return this._getItemValue(key, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.oldCache.has(key)) {
|
||||||
|
const item = this.oldCache.get(key);
|
||||||
|
if (this._deleteIfExpired(key, item) === false) {
|
||||||
|
this._moveToRecent(key, item);
|
||||||
|
return item.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
set(key, value, {maxAge = this.maxAge === Infinity ? undefined : Date.now() + this.maxAge} = {}) {
|
||||||
|
if (this.cache.has(key)) {
|
||||||
|
this.cache.set(key, {
|
||||||
|
value,
|
||||||
|
maxAge
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this._set(key, {value, expiry: maxAge});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
has(key) {
|
||||||
|
if (this.cache.has(key)) {
|
||||||
|
return !this._deleteIfExpired(key, this.cache.get(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.oldCache.has(key)) {
|
||||||
|
return !this._deleteIfExpired(key, this.oldCache.get(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
peek(key) {
|
||||||
|
if (this.cache.has(key)) {
|
||||||
|
return this._peek(key, this.cache);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.oldCache.has(key)) {
|
||||||
|
return this._peek(key, this.oldCache);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete(key) {
|
||||||
|
const deleted = this.cache.delete(key);
|
||||||
|
if (deleted) {
|
||||||
|
this._size--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.oldCache.delete(key) || deleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
clear() {
|
||||||
|
this.cache.clear();
|
||||||
|
this.oldCache.clear();
|
||||||
|
this._size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
resize(newSize) {
|
||||||
|
if (!(newSize && newSize > 0)) {
|
||||||
|
throw new TypeError('`maxSize` must be a number greater than 0');
|
||||||
|
}
|
||||||
|
|
||||||
|
const items = [...this._entriesAscending()];
|
||||||
|
const removeCount = items.length - newSize;
|
||||||
|
if (removeCount < 0) {
|
||||||
|
this.cache = new Map(items);
|
||||||
|
this.oldCache = new Map();
|
||||||
|
this._size = items.length;
|
||||||
|
} else {
|
||||||
|
if (removeCount > 0) {
|
||||||
|
this._emitEvictions(items.slice(0, removeCount));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.oldCache = new Map(items.slice(removeCount));
|
||||||
|
this.cache = new Map();
|
||||||
|
this._size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.maxSize = newSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
* keys() {
|
||||||
|
for (const [key] of this) {
|
||||||
|
yield key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
* values() {
|
||||||
|
for (const [, value] of this) {
|
||||||
|
yield value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
* [Symbol.iterator]() {
|
||||||
|
for (const item of this.cache) {
|
||||||
|
const [key, value] = item;
|
||||||
|
const deleted = this._deleteIfExpired(key, value);
|
||||||
|
if (deleted === false) {
|
||||||
|
yield [key, value.value];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const item of this.oldCache) {
|
||||||
|
const [key, value] = item;
|
||||||
|
if (!this.cache.has(key)) {
|
||||||
|
const deleted = this._deleteIfExpired(key, value);
|
||||||
|
if (deleted === false) {
|
||||||
|
yield [key, value.value];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
* entriesDescending() {
|
||||||
|
let items = [...this.cache];
|
||||||
|
for (let i = items.length - 1; i >= 0; --i) {
|
||||||
|
const item = items[i];
|
||||||
|
const [key, value] = item;
|
||||||
|
const deleted = this._deleteIfExpired(key, value);
|
||||||
|
if (deleted === false) {
|
||||||
|
yield [key, value.value];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
items = [...this.oldCache];
|
||||||
|
for (let i = items.length - 1; i >= 0; --i) {
|
||||||
|
const item = items[i];
|
||||||
|
const [key, value] = item;
|
||||||
|
if (!this.cache.has(key)) {
|
||||||
|
const deleted = this._deleteIfExpired(key, value);
|
||||||
|
if (deleted === false) {
|
||||||
|
yield [key, value.value];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
* entriesAscending() {
|
||||||
|
for (const [key, value] of this._entriesAscending()) {
|
||||||
|
yield [key, value.value];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get size() {
|
||||||
|
if (!this._size) {
|
||||||
|
return this.oldCache.size;
|
||||||
|
}
|
||||||
|
|
||||||
|
let oldCacheSize = 0;
|
||||||
|
for (const key of this.oldCache.keys()) {
|
||||||
|
if (!this.cache.has(key)) {
|
||||||
|
oldCacheSize++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Math.min(this._size + oldCacheSize, this.maxSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = QuickLRU;
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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.
|
||||||
+43
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"name": "@alloc/quick-lru",
|
||||||
|
"version": "5.2.0",
|
||||||
|
"description": "Simple “Least Recently Used” (LRU) cache",
|
||||||
|
"license": "MIT",
|
||||||
|
"repository": "sindresorhus/quick-lru",
|
||||||
|
"funding": "https://github.com/sponsors/sindresorhus",
|
||||||
|
"author": {
|
||||||
|
"name": "Sindre Sorhus",
|
||||||
|
"email": "sindresorhus@gmail.com",
|
||||||
|
"url": "https://sindresorhus.com"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "xo && nyc ava && tsd"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"index.js",
|
||||||
|
"index.d.ts"
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
"lru",
|
||||||
|
"quick",
|
||||||
|
"cache",
|
||||||
|
"caching",
|
||||||
|
"least",
|
||||||
|
"recently",
|
||||||
|
"used",
|
||||||
|
"fast",
|
||||||
|
"map",
|
||||||
|
"hash",
|
||||||
|
"buffer"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"ava": "^2.0.0",
|
||||||
|
"coveralls": "^3.0.3",
|
||||||
|
"nyc": "^15.0.0",
|
||||||
|
"tsd": "^0.11.0",
|
||||||
|
"xo": "^0.26.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
+139
@@ -0,0 +1,139 @@
|
|||||||
|
# quick-lru [](https://travis-ci.org/sindresorhus/quick-lru) [](https://coveralls.io/github/sindresorhus/quick-lru?branch=master)
|
||||||
|
|
||||||
|
> Simple [“Least Recently Used” (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29)
|
||||||
|
|
||||||
|
Useful when you need to cache something and limit memory usage.
|
||||||
|
|
||||||
|
Inspired by the [`hashlru` algorithm](https://github.com/dominictarr/hashlru#algorithm), but instead uses [`Map`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map) to support keys of any type, not just strings, and values can be `undefined`.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```
|
||||||
|
$ npm install quick-lru
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```js
|
||||||
|
const QuickLRU = require('quick-lru');
|
||||||
|
|
||||||
|
const lru = new QuickLRU({maxSize: 1000});
|
||||||
|
|
||||||
|
lru.set('🦄', '🌈');
|
||||||
|
|
||||||
|
lru.has('🦄');
|
||||||
|
//=> true
|
||||||
|
|
||||||
|
lru.get('🦄');
|
||||||
|
//=> '🌈'
|
||||||
|
```
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
### new QuickLRU(options?)
|
||||||
|
|
||||||
|
Returns a new instance.
|
||||||
|
|
||||||
|
### options
|
||||||
|
|
||||||
|
Type: `object`
|
||||||
|
|
||||||
|
#### maxSize
|
||||||
|
|
||||||
|
*Required*\
|
||||||
|
Type: `number`
|
||||||
|
|
||||||
|
The maximum number of items before evicting the least recently used items.
|
||||||
|
|
||||||
|
#### maxAge
|
||||||
|
|
||||||
|
Type: `number`\
|
||||||
|
Default: `Infinity`
|
||||||
|
|
||||||
|
The maximum number of milliseconds an item should remain in cache.
|
||||||
|
By default maxAge will be Infinity, which means that items will never expire.
|
||||||
|
|
||||||
|
Lazy expiration happens upon the next `write` or `read` call.
|
||||||
|
|
||||||
|
Individual expiration of an item can be specified by the `set(key, value, options)` method.
|
||||||
|
|
||||||
|
#### onEviction
|
||||||
|
|
||||||
|
*Optional*\
|
||||||
|
Type: `(key, value) => void`
|
||||||
|
|
||||||
|
Called right before an item is evicted from the cache.
|
||||||
|
|
||||||
|
Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`).
|
||||||
|
|
||||||
|
### Instance
|
||||||
|
|
||||||
|
The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop.
|
||||||
|
|
||||||
|
Both `key` and `value` can be of any type.
|
||||||
|
|
||||||
|
#### .set(key, value, options?)
|
||||||
|
|
||||||
|
Set an item. Returns the instance.
|
||||||
|
|
||||||
|
Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified on the constructor, otherwise the item will never expire.
|
||||||
|
|
||||||
|
#### .get(key)
|
||||||
|
|
||||||
|
Get an item.
|
||||||
|
|
||||||
|
#### .has(key)
|
||||||
|
|
||||||
|
Check if an item exists.
|
||||||
|
|
||||||
|
#### .peek(key)
|
||||||
|
|
||||||
|
Get an item without marking it as recently used.
|
||||||
|
|
||||||
|
#### .delete(key)
|
||||||
|
|
||||||
|
Delete an item.
|
||||||
|
|
||||||
|
Returns `true` if the item is removed or `false` if the item doesn't exist.
|
||||||
|
|
||||||
|
#### .clear()
|
||||||
|
|
||||||
|
Delete all items.
|
||||||
|
|
||||||
|
#### .resize(maxSize)
|
||||||
|
|
||||||
|
Update the `maxSize`, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee.
|
||||||
|
|
||||||
|
Useful for on-the-fly tuning of cache sizes in live systems.
|
||||||
|
|
||||||
|
#### .keys()
|
||||||
|
|
||||||
|
Iterable for all the keys.
|
||||||
|
|
||||||
|
#### .values()
|
||||||
|
|
||||||
|
Iterable for all the values.
|
||||||
|
|
||||||
|
#### .entriesAscending()
|
||||||
|
|
||||||
|
Iterable for all entries, starting with the oldest (ascending in recency).
|
||||||
|
|
||||||
|
#### .entriesDescending()
|
||||||
|
|
||||||
|
Iterable for all entries, starting with the newest (descending in recency).
|
||||||
|
|
||||||
|
#### .size
|
||||||
|
|
||||||
|
The stored item count.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<b>
|
||||||
|
<a href="https://tidelift.com/subscription/pkg/npm-quick-lru?utm_source=npm-quick-lru&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||||
|
</b>
|
||||||
|
<br>
|
||||||
|
<sub>
|
||||||
|
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||||
|
</sub>
|
||||||
|
</div>
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2014-present Sebastian McKenzie and other 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.
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
# @babel/generator
|
||||||
|
|
||||||
|
> Turns an AST into code.
|
||||||
|
|
||||||
|
See our website [@babel/generator](https://babeljs.io/docs/babel-generator) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20generator%22+is%3Aopen) associated with this package.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
Using npm:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install --save-dev @babel/generator
|
||||||
|
```
|
||||||
|
|
||||||
|
or using yarn:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
yarn add @babel/generator --dev
|
||||||
|
```
|
||||||
+244
@@ -0,0 +1,244 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
const spaceIndents = [];
|
||||||
|
for (let i = 0; i < 32; i++) {
|
||||||
|
spaceIndents.push(" ".repeat(i * 2));
|
||||||
|
}
|
||||||
|
class Buffer {
|
||||||
|
constructor(map, indentChar) {
|
||||||
|
this._map = null;
|
||||||
|
this._buf = "";
|
||||||
|
this._str = "";
|
||||||
|
this._appendCount = 0;
|
||||||
|
this._last = 0;
|
||||||
|
this._canMarkIdName = true;
|
||||||
|
this._indentChar = "";
|
||||||
|
this._queuedChar = 0;
|
||||||
|
this._position = {
|
||||||
|
line: 1,
|
||||||
|
column: 0
|
||||||
|
};
|
||||||
|
this._sourcePosition = {
|
||||||
|
identifierName: undefined,
|
||||||
|
identifierNamePos: undefined,
|
||||||
|
line: undefined,
|
||||||
|
column: undefined,
|
||||||
|
filename: undefined
|
||||||
|
};
|
||||||
|
this._map = map;
|
||||||
|
this._indentChar = indentChar;
|
||||||
|
}
|
||||||
|
get() {
|
||||||
|
const {
|
||||||
|
_map,
|
||||||
|
_last
|
||||||
|
} = this;
|
||||||
|
if (this._queuedChar !== 32) {
|
||||||
|
this._flush();
|
||||||
|
}
|
||||||
|
const code = _last === 10 ? (this._buf + this._str).trimRight() : this._buf + this._str;
|
||||||
|
if (_map === null) {
|
||||||
|
return {
|
||||||
|
code: code,
|
||||||
|
decodedMap: undefined,
|
||||||
|
map: null,
|
||||||
|
rawMappings: undefined
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const result = {
|
||||||
|
code: code,
|
||||||
|
decodedMap: _map.getDecoded(),
|
||||||
|
get __mergedMap() {
|
||||||
|
return this.map;
|
||||||
|
},
|
||||||
|
get map() {
|
||||||
|
const resultMap = _map.get();
|
||||||
|
result.map = resultMap;
|
||||||
|
return resultMap;
|
||||||
|
},
|
||||||
|
set map(value) {
|
||||||
|
Object.defineProperty(result, "map", {
|
||||||
|
value,
|
||||||
|
writable: true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
get rawMappings() {
|
||||||
|
const mappings = _map.getRawMappings();
|
||||||
|
result.rawMappings = mappings;
|
||||||
|
return mappings;
|
||||||
|
},
|
||||||
|
set rawMappings(value) {
|
||||||
|
Object.defineProperty(result, "rawMappings", {
|
||||||
|
value,
|
||||||
|
writable: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
append(str, maybeNewline) {
|
||||||
|
this._flush();
|
||||||
|
this._append(str, maybeNewline);
|
||||||
|
}
|
||||||
|
appendChar(char) {
|
||||||
|
this._flush();
|
||||||
|
this._appendChar(char, 1, true);
|
||||||
|
}
|
||||||
|
queue(char) {
|
||||||
|
this._flush();
|
||||||
|
this._queuedChar = char;
|
||||||
|
}
|
||||||
|
_flush() {
|
||||||
|
const queuedChar = this._queuedChar;
|
||||||
|
if (queuedChar !== 0) {
|
||||||
|
this._appendChar(queuedChar, 1, true);
|
||||||
|
this._queuedChar = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_appendChar(char, repeat, useSourcePos) {
|
||||||
|
this._last = char;
|
||||||
|
if (char === -1) {
|
||||||
|
const indent = repeat >= 64 ? this._indentChar.repeat(repeat) : spaceIndents[repeat / 2];
|
||||||
|
this._str += indent;
|
||||||
|
} else {
|
||||||
|
this._str += repeat > 1 ? String.fromCharCode(char).repeat(repeat) : String.fromCharCode(char);
|
||||||
|
}
|
||||||
|
const isSpace = char === 32;
|
||||||
|
const position = this._position;
|
||||||
|
if (char !== 10) {
|
||||||
|
if (this._map) {
|
||||||
|
const sourcePos = this._sourcePosition;
|
||||||
|
if (useSourcePos && sourcePos) {
|
||||||
|
this._map.mark(position, sourcePos.line, sourcePos.column, isSpace ? undefined : sourcePos.identifierName, isSpace ? undefined : sourcePos.identifierNamePos, sourcePos.filename);
|
||||||
|
if (!isSpace && this._canMarkIdName) {
|
||||||
|
sourcePos.identifierName = undefined;
|
||||||
|
sourcePos.identifierNamePos = undefined;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this._map.mark(position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
position.column += repeat;
|
||||||
|
} else {
|
||||||
|
position.line++;
|
||||||
|
position.column = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_append(str, maybeNewline) {
|
||||||
|
const len = str.length;
|
||||||
|
const position = this._position;
|
||||||
|
const sourcePos = this._sourcePosition;
|
||||||
|
this._last = -1;
|
||||||
|
if (++this._appendCount > 4096) {
|
||||||
|
+this._str;
|
||||||
|
this._buf += this._str;
|
||||||
|
this._str = str;
|
||||||
|
this._appendCount = 0;
|
||||||
|
} else {
|
||||||
|
this._str += str;
|
||||||
|
}
|
||||||
|
const hasMap = this._map !== null;
|
||||||
|
if (!maybeNewline && !hasMap) {
|
||||||
|
position.column += len;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const {
|
||||||
|
column,
|
||||||
|
identifierName,
|
||||||
|
identifierNamePos,
|
||||||
|
filename
|
||||||
|
} = sourcePos;
|
||||||
|
let line = sourcePos.line;
|
||||||
|
if ((identifierName != null || identifierNamePos != null) && this._canMarkIdName) {
|
||||||
|
sourcePos.identifierName = undefined;
|
||||||
|
sourcePos.identifierNamePos = undefined;
|
||||||
|
}
|
||||||
|
let i = str.indexOf("\n");
|
||||||
|
let last = 0;
|
||||||
|
if (hasMap && i !== 0) {
|
||||||
|
this._map.mark(position, line, column, identifierName, identifierNamePos, filename);
|
||||||
|
}
|
||||||
|
while (i !== -1) {
|
||||||
|
position.line++;
|
||||||
|
position.column = 0;
|
||||||
|
last = i + 1;
|
||||||
|
if (last < len && line !== undefined) {
|
||||||
|
line++;
|
||||||
|
if (hasMap) {
|
||||||
|
this._map.mark(position, line, 0, undefined, undefined, filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i = str.indexOf("\n", last);
|
||||||
|
}
|
||||||
|
position.column += len - last;
|
||||||
|
}
|
||||||
|
removeLastSemicolon() {
|
||||||
|
if (this._queuedChar === 59) {
|
||||||
|
this._queuedChar = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getLastChar(checkQueue) {
|
||||||
|
if (!checkQueue) {
|
||||||
|
return this._last;
|
||||||
|
}
|
||||||
|
const queuedChar = this._queuedChar;
|
||||||
|
return queuedChar !== 0 ? queuedChar : this._last;
|
||||||
|
}
|
||||||
|
getNewlineCount() {
|
||||||
|
return this._queuedChar === 0 && this._last === 10 ? 1 : 0;
|
||||||
|
}
|
||||||
|
hasContent() {
|
||||||
|
return this._last !== 0;
|
||||||
|
}
|
||||||
|
exactSource(loc, cb) {
|
||||||
|
if (!this._map) {
|
||||||
|
cb();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.source("start", loc);
|
||||||
|
const identifierName = loc.identifierName;
|
||||||
|
const sourcePos = this._sourcePosition;
|
||||||
|
if (identifierName != null) {
|
||||||
|
this._canMarkIdName = false;
|
||||||
|
sourcePos.identifierName = identifierName;
|
||||||
|
}
|
||||||
|
cb();
|
||||||
|
if (identifierName != null) {
|
||||||
|
this._canMarkIdName = true;
|
||||||
|
sourcePos.identifierName = undefined;
|
||||||
|
sourcePos.identifierNamePos = undefined;
|
||||||
|
}
|
||||||
|
this.source("end", loc);
|
||||||
|
}
|
||||||
|
source(prop, loc) {
|
||||||
|
if (!this._map) return;
|
||||||
|
this._normalizePosition(prop, loc, 0);
|
||||||
|
}
|
||||||
|
sourceWithOffset(prop, loc, columnOffset) {
|
||||||
|
if (!this._map) return;
|
||||||
|
this._normalizePosition(prop, loc, columnOffset);
|
||||||
|
}
|
||||||
|
_normalizePosition(prop, loc, columnOffset) {
|
||||||
|
this._flush();
|
||||||
|
const pos = loc[prop];
|
||||||
|
const target = this._sourcePosition;
|
||||||
|
if (pos) {
|
||||||
|
target.line = pos.line;
|
||||||
|
target.column = Math.max(pos.column + columnOffset, 0);
|
||||||
|
target.filename = loc.filename;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getCurrentColumn() {
|
||||||
|
return this._position.column + (this._queuedChar ? 1 : 0);
|
||||||
|
}
|
||||||
|
getCurrentLine() {
|
||||||
|
return this._position.line;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.default = Buffer;
|
||||||
|
|
||||||
|
//# sourceMappingURL=buffer.js.map
|
||||||
+1
File diff suppressed because one or more lines are too long
+86
@@ -0,0 +1,86 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.BlockStatement = BlockStatement;
|
||||||
|
exports.Directive = Directive;
|
||||||
|
exports.DirectiveLiteral = DirectiveLiteral;
|
||||||
|
exports.File = File;
|
||||||
|
exports.InterpreterDirective = InterpreterDirective;
|
||||||
|
exports.Placeholder = Placeholder;
|
||||||
|
exports.Program = Program;
|
||||||
|
function File(node) {
|
||||||
|
if (node.program) {
|
||||||
|
this.print(node.program.interpreter);
|
||||||
|
}
|
||||||
|
this.print(node.program);
|
||||||
|
}
|
||||||
|
function Program(node) {
|
||||||
|
var _node$directives;
|
||||||
|
this.printInnerComments(false);
|
||||||
|
const directivesLen = (_node$directives = node.directives) == null ? void 0 : _node$directives.length;
|
||||||
|
if (directivesLen) {
|
||||||
|
var _node$directives$trai;
|
||||||
|
const newline = node.body.length ? 2 : 1;
|
||||||
|
this.printSequence(node.directives, undefined, undefined, newline);
|
||||||
|
if (!((_node$directives$trai = node.directives[directivesLen - 1].trailingComments) != null && _node$directives$trai.length)) {
|
||||||
|
this.newline(newline);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.printSequence(node.body);
|
||||||
|
}
|
||||||
|
function BlockStatement(node) {
|
||||||
|
var _node$directives2;
|
||||||
|
this.tokenChar(123);
|
||||||
|
const oldNoLineTerminatorAfterNode = this.enterDelimited();
|
||||||
|
const directivesLen = (_node$directives2 = node.directives) == null ? void 0 : _node$directives2.length;
|
||||||
|
if (directivesLen) {
|
||||||
|
var _node$directives$trai2;
|
||||||
|
const newline = node.body.length ? 2 : 1;
|
||||||
|
this.printSequence(node.directives, true, true, newline);
|
||||||
|
if (!((_node$directives$trai2 = node.directives[directivesLen - 1].trailingComments) != null && _node$directives$trai2.length)) {
|
||||||
|
this.newline(newline);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.printSequence(node.body, true, true);
|
||||||
|
this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
|
||||||
|
this.rightBrace(node);
|
||||||
|
}
|
||||||
|
function Directive(node) {
|
||||||
|
this.print(node.value);
|
||||||
|
this.semicolon();
|
||||||
|
}
|
||||||
|
const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;
|
||||||
|
const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
|
||||||
|
function DirectiveLiteral(node) {
|
||||||
|
const raw = this.getPossibleRaw(node);
|
||||||
|
if (!this.format.minified && raw !== undefined) {
|
||||||
|
this.token(raw);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const {
|
||||||
|
value
|
||||||
|
} = node;
|
||||||
|
if (!unescapedDoubleQuoteRE.test(value)) {
|
||||||
|
this.token(`"${value}"`);
|
||||||
|
} else if (!unescapedSingleQuoteRE.test(value)) {
|
||||||
|
this.token(`'${value}'`);
|
||||||
|
} else {
|
||||||
|
throw new Error("Malformed AST: it is not possible to print a directive containing" + " both unescaped single and double quotes.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function InterpreterDirective(node) {
|
||||||
|
this.token(`#!${node.value}`);
|
||||||
|
this._newline();
|
||||||
|
}
|
||||||
|
function Placeholder(node) {
|
||||||
|
this.token("%%");
|
||||||
|
this.print(node.name);
|
||||||
|
this.token("%%");
|
||||||
|
if (node.expectedNode === "Statement") {
|
||||||
|
this.semicolon();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//# sourceMappingURL=base.js.map
|
||||||
+1
File diff suppressed because one or more lines are too long
+215
@@ -0,0 +1,215 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.ClassAccessorProperty = ClassAccessorProperty;
|
||||||
|
exports.ClassBody = ClassBody;
|
||||||
|
exports.ClassExpression = exports.ClassDeclaration = ClassDeclaration;
|
||||||
|
exports.ClassMethod = ClassMethod;
|
||||||
|
exports.ClassPrivateMethod = ClassPrivateMethod;
|
||||||
|
exports.ClassPrivateProperty = ClassPrivateProperty;
|
||||||
|
exports.ClassProperty = ClassProperty;
|
||||||
|
exports.StaticBlock = StaticBlock;
|
||||||
|
exports._classMethodHead = _classMethodHead;
|
||||||
|
var _t = require("@babel/types");
|
||||||
|
var _expressions = require("./expressions.js");
|
||||||
|
var _typescript = require("./typescript.js");
|
||||||
|
var _flow = require("./flow.js");
|
||||||
|
var _methods = require("./methods.js");
|
||||||
|
const {
|
||||||
|
isExportDefaultDeclaration,
|
||||||
|
isExportNamedDeclaration
|
||||||
|
} = _t;
|
||||||
|
function ClassDeclaration(node, parent) {
|
||||||
|
const inExport = isExportDefaultDeclaration(parent) || isExportNamedDeclaration(parent);
|
||||||
|
if (!inExport || !_expressions._shouldPrintDecoratorsBeforeExport.call(this, parent)) {
|
||||||
|
this.printJoin(node.decorators);
|
||||||
|
}
|
||||||
|
if (node.declare) {
|
||||||
|
this.word("declare");
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
if (node.abstract) {
|
||||||
|
this.word("abstract");
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
this.word("class");
|
||||||
|
if (node.id) {
|
||||||
|
this.space();
|
||||||
|
this.print(node.id);
|
||||||
|
}
|
||||||
|
this.print(node.typeParameters);
|
||||||
|
if (node.superClass) {
|
||||||
|
this.space();
|
||||||
|
this.word("extends");
|
||||||
|
this.space();
|
||||||
|
this.print(node.superClass);
|
||||||
|
this.print(node.superTypeParameters);
|
||||||
|
}
|
||||||
|
if (node.implements) {
|
||||||
|
this.space();
|
||||||
|
this.word("implements");
|
||||||
|
this.space();
|
||||||
|
this.printList(node.implements);
|
||||||
|
}
|
||||||
|
this.space();
|
||||||
|
this.print(node.body);
|
||||||
|
}
|
||||||
|
function ClassBody(node) {
|
||||||
|
this.tokenChar(123);
|
||||||
|
if (node.body.length === 0) {
|
||||||
|
this.tokenChar(125);
|
||||||
|
} else {
|
||||||
|
const separator = classBodyEmptySemicolonsPrinter(this, node);
|
||||||
|
separator == null || separator(-1);
|
||||||
|
const oldNoLineTerminatorAfterNode = this.enterDelimited();
|
||||||
|
this.printJoin(node.body, true, true, separator, true, true);
|
||||||
|
this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
|
||||||
|
if (!this.endsWith(10)) this.newline();
|
||||||
|
this.rightBrace(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function classBodyEmptySemicolonsPrinter(printer, node) {
|
||||||
|
if (!printer.tokenMap || node.start == null || node.end == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const indexes = printer.tokenMap.getIndexes(node);
|
||||||
|
if (!indexes) return null;
|
||||||
|
let k = 1;
|
||||||
|
let occurrenceCount = 0;
|
||||||
|
let nextLocIndex = 0;
|
||||||
|
const advanceNextLocIndex = () => {
|
||||||
|
while (nextLocIndex < node.body.length && node.body[nextLocIndex].start == null) {
|
||||||
|
nextLocIndex++;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
advanceNextLocIndex();
|
||||||
|
return i => {
|
||||||
|
if (nextLocIndex <= i) {
|
||||||
|
nextLocIndex = i + 1;
|
||||||
|
advanceNextLocIndex();
|
||||||
|
}
|
||||||
|
const end = nextLocIndex === node.body.length ? node.end : node.body[nextLocIndex].start;
|
||||||
|
let tok;
|
||||||
|
while (k < indexes.length && printer.tokenMap.matchesOriginal(tok = printer._tokens[indexes[k]], ";") && tok.start < end) {
|
||||||
|
printer.tokenChar(59, occurrenceCount++);
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function ClassProperty(node) {
|
||||||
|
this.printJoin(node.decorators);
|
||||||
|
if (!node.static && !this.format.preserveFormat) {
|
||||||
|
var _node$key$loc;
|
||||||
|
const endLine = (_node$key$loc = node.key.loc) == null || (_node$key$loc = _node$key$loc.end) == null ? void 0 : _node$key$loc.line;
|
||||||
|
if (endLine) this.catchUp(endLine);
|
||||||
|
}
|
||||||
|
_typescript._tsPrintClassMemberModifiers.call(this, node);
|
||||||
|
if (node.computed) {
|
||||||
|
this.tokenChar(91);
|
||||||
|
this.print(node.key);
|
||||||
|
this.tokenChar(93);
|
||||||
|
} else {
|
||||||
|
_flow._variance.call(this, node);
|
||||||
|
this.print(node.key);
|
||||||
|
}
|
||||||
|
if (node.optional) {
|
||||||
|
this.tokenChar(63);
|
||||||
|
}
|
||||||
|
if (node.definite) {
|
||||||
|
this.tokenChar(33);
|
||||||
|
}
|
||||||
|
this.print(node.typeAnnotation);
|
||||||
|
if (node.value) {
|
||||||
|
this.space();
|
||||||
|
this.tokenChar(61);
|
||||||
|
this.space();
|
||||||
|
this.print(node.value);
|
||||||
|
}
|
||||||
|
this.semicolon();
|
||||||
|
}
|
||||||
|
function ClassAccessorProperty(node) {
|
||||||
|
var _node$key$loc2;
|
||||||
|
this.printJoin(node.decorators);
|
||||||
|
const endLine = (_node$key$loc2 = node.key.loc) == null || (_node$key$loc2 = _node$key$loc2.end) == null ? void 0 : _node$key$loc2.line;
|
||||||
|
if (endLine) this.catchUp(endLine);
|
||||||
|
_typescript._tsPrintClassMemberModifiers.call(this, node);
|
||||||
|
this.word("accessor", true);
|
||||||
|
this.space();
|
||||||
|
if (node.computed) {
|
||||||
|
this.tokenChar(91);
|
||||||
|
this.print(node.key);
|
||||||
|
this.tokenChar(93);
|
||||||
|
} else {
|
||||||
|
_flow._variance.call(this, node);
|
||||||
|
this.print(node.key);
|
||||||
|
}
|
||||||
|
if (node.optional) {
|
||||||
|
this.tokenChar(63);
|
||||||
|
}
|
||||||
|
if (node.definite) {
|
||||||
|
this.tokenChar(33);
|
||||||
|
}
|
||||||
|
this.print(node.typeAnnotation);
|
||||||
|
if (node.value) {
|
||||||
|
this.space();
|
||||||
|
this.tokenChar(61);
|
||||||
|
this.space();
|
||||||
|
this.print(node.value);
|
||||||
|
}
|
||||||
|
this.semicolon();
|
||||||
|
}
|
||||||
|
function ClassPrivateProperty(node) {
|
||||||
|
this.printJoin(node.decorators);
|
||||||
|
_typescript._tsPrintClassMemberModifiers.call(this, node);
|
||||||
|
this.print(node.key);
|
||||||
|
if (node.optional) {
|
||||||
|
this.tokenChar(63);
|
||||||
|
}
|
||||||
|
if (node.definite) {
|
||||||
|
this.tokenChar(33);
|
||||||
|
}
|
||||||
|
this.print(node.typeAnnotation);
|
||||||
|
if (node.value) {
|
||||||
|
this.space();
|
||||||
|
this.tokenChar(61);
|
||||||
|
this.space();
|
||||||
|
this.print(node.value);
|
||||||
|
}
|
||||||
|
this.semicolon();
|
||||||
|
}
|
||||||
|
function ClassMethod(node) {
|
||||||
|
_classMethodHead.call(this, node);
|
||||||
|
this.space();
|
||||||
|
this.print(node.body);
|
||||||
|
}
|
||||||
|
function ClassPrivateMethod(node) {
|
||||||
|
_classMethodHead.call(this, node);
|
||||||
|
this.space();
|
||||||
|
this.print(node.body);
|
||||||
|
}
|
||||||
|
function _classMethodHead(node) {
|
||||||
|
this.printJoin(node.decorators);
|
||||||
|
if (!this.format.preserveFormat) {
|
||||||
|
var _node$key$loc3;
|
||||||
|
const endLine = (_node$key$loc3 = node.key.loc) == null || (_node$key$loc3 = _node$key$loc3.end) == null ? void 0 : _node$key$loc3.line;
|
||||||
|
if (endLine) this.catchUp(endLine);
|
||||||
|
}
|
||||||
|
_typescript._tsPrintClassMemberModifiers.call(this, node);
|
||||||
|
_methods._methodHead.call(this, node);
|
||||||
|
}
|
||||||
|
function StaticBlock(node) {
|
||||||
|
this.word("static");
|
||||||
|
this.space();
|
||||||
|
this.tokenChar(123);
|
||||||
|
if (node.body.length === 0) {
|
||||||
|
this.tokenChar(125);
|
||||||
|
} else {
|
||||||
|
this.newline();
|
||||||
|
this.printSequence(node.body, true);
|
||||||
|
this.rightBrace(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//# sourceMappingURL=classes.js.map
|
||||||
+1
File diff suppressed because one or more lines are too long
+73
@@ -0,0 +1,73 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.DecimalLiteral = DecimalLiteral;
|
||||||
|
exports.Noop = Noop;
|
||||||
|
exports.RecordExpression = RecordExpression;
|
||||||
|
exports.TSExpressionWithTypeArguments = TSExpressionWithTypeArguments;
|
||||||
|
exports.TupleExpression = TupleExpression;
|
||||||
|
function Noop() {}
|
||||||
|
function TSExpressionWithTypeArguments(node) {
|
||||||
|
this.print(node.expression);
|
||||||
|
this.print(node.typeParameters);
|
||||||
|
}
|
||||||
|
function DecimalLiteral(node) {
|
||||||
|
const raw = this.getPossibleRaw(node);
|
||||||
|
if (!this.format.minified && raw !== undefined) {
|
||||||
|
this.word(raw);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.word(node.value + "m");
|
||||||
|
}
|
||||||
|
function RecordExpression(node) {
|
||||||
|
const props = node.properties;
|
||||||
|
let startToken;
|
||||||
|
let endToken;
|
||||||
|
if (this.format.recordAndTupleSyntaxType === "bar") {
|
||||||
|
startToken = "{|";
|
||||||
|
endToken = "|}";
|
||||||
|
} else if (this.format.recordAndTupleSyntaxType !== "hash" && this.format.recordAndTupleSyntaxType != null) {
|
||||||
|
throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`);
|
||||||
|
} else {
|
||||||
|
startToken = "#{";
|
||||||
|
endToken = "}";
|
||||||
|
}
|
||||||
|
this.token(startToken);
|
||||||
|
if (props.length) {
|
||||||
|
this.space();
|
||||||
|
this.printList(props, this.shouldPrintTrailingComma(endToken), true, true);
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
this.token(endToken);
|
||||||
|
}
|
||||||
|
function TupleExpression(node) {
|
||||||
|
const elems = node.elements;
|
||||||
|
const len = elems.length;
|
||||||
|
let startToken;
|
||||||
|
let endToken;
|
||||||
|
if (this.format.recordAndTupleSyntaxType === "bar") {
|
||||||
|
startToken = "[|";
|
||||||
|
endToken = "|]";
|
||||||
|
} else if (this.format.recordAndTupleSyntaxType === "hash") {
|
||||||
|
startToken = "#[";
|
||||||
|
endToken = "]";
|
||||||
|
} else {
|
||||||
|
throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`);
|
||||||
|
}
|
||||||
|
this.token(startToken);
|
||||||
|
for (let i = 0; i < elems.length; i++) {
|
||||||
|
const elem = elems[i];
|
||||||
|
if (elem) {
|
||||||
|
if (i > 0) this.space();
|
||||||
|
this.print(elem);
|
||||||
|
if (i < len - 1 || this.shouldPrintTrailingComma(endToken)) {
|
||||||
|
this.token(",", false, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.token(endToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
//# sourceMappingURL=deprecated.js.map
|
||||||
+1
File diff suppressed because one or more lines are too long
+309
@@ -0,0 +1,309 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.LogicalExpression = exports.AssignmentExpression = AssignmentExpression;
|
||||||
|
exports.AssignmentPattern = AssignmentPattern;
|
||||||
|
exports.AwaitExpression = AwaitExpression;
|
||||||
|
exports.BinaryExpression = BinaryExpression;
|
||||||
|
exports.BindExpression = BindExpression;
|
||||||
|
exports.CallExpression = CallExpression;
|
||||||
|
exports.ConditionalExpression = ConditionalExpression;
|
||||||
|
exports.Decorator = Decorator;
|
||||||
|
exports.DoExpression = DoExpression;
|
||||||
|
exports.EmptyStatement = EmptyStatement;
|
||||||
|
exports.ExpressionStatement = ExpressionStatement;
|
||||||
|
exports.Import = Import;
|
||||||
|
exports.MemberExpression = MemberExpression;
|
||||||
|
exports.MetaProperty = MetaProperty;
|
||||||
|
exports.ModuleExpression = ModuleExpression;
|
||||||
|
exports.NewExpression = NewExpression;
|
||||||
|
exports.OptionalCallExpression = OptionalCallExpression;
|
||||||
|
exports.OptionalMemberExpression = OptionalMemberExpression;
|
||||||
|
exports.ParenthesizedExpression = ParenthesizedExpression;
|
||||||
|
exports.PrivateName = PrivateName;
|
||||||
|
exports.SequenceExpression = SequenceExpression;
|
||||||
|
exports.Super = Super;
|
||||||
|
exports.ThisExpression = ThisExpression;
|
||||||
|
exports.UnaryExpression = UnaryExpression;
|
||||||
|
exports.UpdateExpression = UpdateExpression;
|
||||||
|
exports.V8IntrinsicIdentifier = V8IntrinsicIdentifier;
|
||||||
|
exports.YieldExpression = YieldExpression;
|
||||||
|
exports._shouldPrintDecoratorsBeforeExport = _shouldPrintDecoratorsBeforeExport;
|
||||||
|
var _t = require("@babel/types");
|
||||||
|
var _index = require("../node/index.js");
|
||||||
|
const {
|
||||||
|
isCallExpression,
|
||||||
|
isLiteral,
|
||||||
|
isMemberExpression,
|
||||||
|
isNewExpression,
|
||||||
|
isPattern
|
||||||
|
} = _t;
|
||||||
|
function UnaryExpression(node) {
|
||||||
|
const {
|
||||||
|
operator
|
||||||
|
} = node;
|
||||||
|
const firstChar = operator.charCodeAt(0);
|
||||||
|
if (firstChar >= 97 && firstChar <= 122) {
|
||||||
|
this.word(operator);
|
||||||
|
this.space();
|
||||||
|
} else {
|
||||||
|
this.tokenChar(firstChar);
|
||||||
|
}
|
||||||
|
this.print(node.argument);
|
||||||
|
}
|
||||||
|
function DoExpression(node) {
|
||||||
|
if (node.async) {
|
||||||
|
this.word("async", true);
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
this.word("do");
|
||||||
|
this.space();
|
||||||
|
this.print(node.body);
|
||||||
|
}
|
||||||
|
function ParenthesizedExpression(node) {
|
||||||
|
this.tokenChar(40);
|
||||||
|
const oldNoLineTerminatorAfterNode = this.enterDelimited();
|
||||||
|
this.print(node.expression, undefined, true);
|
||||||
|
this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
|
||||||
|
this.rightParens(node);
|
||||||
|
}
|
||||||
|
function UpdateExpression(node) {
|
||||||
|
if (node.prefix) {
|
||||||
|
this.token(node.operator, false, 0, true);
|
||||||
|
this.print(node.argument);
|
||||||
|
} else {
|
||||||
|
this.print(node.argument, true);
|
||||||
|
this.token(node.operator, false, 0, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function ConditionalExpression(node) {
|
||||||
|
this.print(node.test);
|
||||||
|
this.space();
|
||||||
|
this.tokenChar(63);
|
||||||
|
this.space();
|
||||||
|
this.print(node.consequent);
|
||||||
|
this.space();
|
||||||
|
this.tokenChar(58);
|
||||||
|
this.space();
|
||||||
|
this.print(node.alternate);
|
||||||
|
}
|
||||||
|
function NewExpression(node, parent) {
|
||||||
|
this.word("new");
|
||||||
|
this.space();
|
||||||
|
this.print(node.callee);
|
||||||
|
if (this.format.minified && node.arguments.length === 0 && !node.optional && !isCallExpression(parent, {
|
||||||
|
callee: node
|
||||||
|
}) && !isMemberExpression(parent) && !isNewExpression(parent)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.print(node.typeArguments);
|
||||||
|
this.print(node.typeParameters);
|
||||||
|
if (node.optional) {
|
||||||
|
this.token("?.");
|
||||||
|
}
|
||||||
|
if (node.arguments.length === 0 && this.tokenMap && !this.tokenMap.endMatches(node, ")")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.tokenChar(40);
|
||||||
|
const oldNoLineTerminatorAfterNode = this.enterDelimited();
|
||||||
|
this.printList(node.arguments, this.shouldPrintTrailingComma(")"), undefined, undefined, undefined, true);
|
||||||
|
this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
|
||||||
|
this.rightParens(node);
|
||||||
|
}
|
||||||
|
function SequenceExpression(node) {
|
||||||
|
this.printList(node.expressions);
|
||||||
|
}
|
||||||
|
function ThisExpression() {
|
||||||
|
this.word("this");
|
||||||
|
}
|
||||||
|
function Super() {
|
||||||
|
this.word("super");
|
||||||
|
}
|
||||||
|
function _shouldPrintDecoratorsBeforeExport(node) {
|
||||||
|
if (typeof this.format.decoratorsBeforeExport === "boolean") {
|
||||||
|
return this.format.decoratorsBeforeExport;
|
||||||
|
}
|
||||||
|
return typeof node.start === "number" && node.start === node.declaration.start;
|
||||||
|
}
|
||||||
|
function Decorator(node) {
|
||||||
|
this.tokenChar(64);
|
||||||
|
const {
|
||||||
|
expression
|
||||||
|
} = node;
|
||||||
|
this.print(expression);
|
||||||
|
this.newline();
|
||||||
|
}
|
||||||
|
function OptionalMemberExpression(node) {
|
||||||
|
let {
|
||||||
|
computed
|
||||||
|
} = node;
|
||||||
|
const {
|
||||||
|
optional,
|
||||||
|
property
|
||||||
|
} = node;
|
||||||
|
this.print(node.object);
|
||||||
|
if (!computed && isMemberExpression(property)) {
|
||||||
|
throw new TypeError("Got a MemberExpression for MemberExpression property");
|
||||||
|
}
|
||||||
|
if (isLiteral(property) && typeof property.value === "number") {
|
||||||
|
computed = true;
|
||||||
|
}
|
||||||
|
if (optional) {
|
||||||
|
this.token("?.");
|
||||||
|
}
|
||||||
|
if (computed) {
|
||||||
|
this.tokenChar(91);
|
||||||
|
this.print(property);
|
||||||
|
this.tokenChar(93);
|
||||||
|
} else {
|
||||||
|
if (!optional) {
|
||||||
|
this.tokenChar(46);
|
||||||
|
}
|
||||||
|
this.print(property);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function OptionalCallExpression(node) {
|
||||||
|
this.print(node.callee);
|
||||||
|
this.print(node.typeParameters);
|
||||||
|
if (node.optional) {
|
||||||
|
this.token("?.");
|
||||||
|
}
|
||||||
|
this.print(node.typeArguments);
|
||||||
|
this.tokenChar(40);
|
||||||
|
const oldNoLineTerminatorAfterNode = this.enterDelimited();
|
||||||
|
this.printList(node.arguments, undefined, undefined, undefined, undefined, true);
|
||||||
|
this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
|
||||||
|
this.rightParens(node);
|
||||||
|
}
|
||||||
|
function CallExpression(node) {
|
||||||
|
this.print(node.callee);
|
||||||
|
this.print(node.typeArguments);
|
||||||
|
this.print(node.typeParameters);
|
||||||
|
this.tokenChar(40);
|
||||||
|
const oldNoLineTerminatorAfterNode = this.enterDelimited();
|
||||||
|
this.printList(node.arguments, this.shouldPrintTrailingComma(")"), undefined, undefined, undefined, true);
|
||||||
|
this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
|
||||||
|
this.rightParens(node);
|
||||||
|
}
|
||||||
|
function Import() {
|
||||||
|
this.word("import");
|
||||||
|
}
|
||||||
|
function AwaitExpression(node) {
|
||||||
|
this.word("await");
|
||||||
|
this.space();
|
||||||
|
this.print(node.argument);
|
||||||
|
}
|
||||||
|
function YieldExpression(node) {
|
||||||
|
if (node.delegate) {
|
||||||
|
this.word("yield", true);
|
||||||
|
this.tokenChar(42);
|
||||||
|
if (node.argument) {
|
||||||
|
this.space();
|
||||||
|
this.print(node.argument);
|
||||||
|
}
|
||||||
|
} else if (node.argument) {
|
||||||
|
this.word("yield", true);
|
||||||
|
this.space();
|
||||||
|
this.print(node.argument);
|
||||||
|
} else {
|
||||||
|
this.word("yield");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function EmptyStatement() {
|
||||||
|
this.semicolon(true);
|
||||||
|
}
|
||||||
|
function ExpressionStatement(node) {
|
||||||
|
this.tokenContext |= _index.TokenContext.expressionStatement;
|
||||||
|
this.print(node.expression);
|
||||||
|
this.semicolon();
|
||||||
|
}
|
||||||
|
function AssignmentPattern(node) {
|
||||||
|
this.print(node.left);
|
||||||
|
if (node.left.type === "Identifier" || isPattern(node.left)) {
|
||||||
|
if (node.left.optional) this.tokenChar(63);
|
||||||
|
this.print(node.left.typeAnnotation);
|
||||||
|
}
|
||||||
|
this.space();
|
||||||
|
this.tokenChar(61);
|
||||||
|
this.space();
|
||||||
|
this.print(node.right);
|
||||||
|
}
|
||||||
|
function AssignmentExpression(node) {
|
||||||
|
this.print(node.left);
|
||||||
|
this.space();
|
||||||
|
this.token(node.operator, false, 0, true);
|
||||||
|
this.space();
|
||||||
|
this.print(node.right);
|
||||||
|
}
|
||||||
|
function BinaryExpression(node) {
|
||||||
|
this.print(node.left);
|
||||||
|
this.space();
|
||||||
|
const {
|
||||||
|
operator
|
||||||
|
} = node;
|
||||||
|
if (operator.charCodeAt(0) === 105) {
|
||||||
|
this.word(operator);
|
||||||
|
} else {
|
||||||
|
this.token(operator, false, 0, true);
|
||||||
|
this.setLastChar(operator.charCodeAt(operator.length - 1));
|
||||||
|
}
|
||||||
|
this.space();
|
||||||
|
this.print(node.right);
|
||||||
|
}
|
||||||
|
function BindExpression(node) {
|
||||||
|
this.print(node.object);
|
||||||
|
this.token("::");
|
||||||
|
this.print(node.callee);
|
||||||
|
}
|
||||||
|
function MemberExpression(node) {
|
||||||
|
this.print(node.object);
|
||||||
|
if (!node.computed && isMemberExpression(node.property)) {
|
||||||
|
throw new TypeError("Got a MemberExpression for MemberExpression property");
|
||||||
|
}
|
||||||
|
let computed = node.computed;
|
||||||
|
if (isLiteral(node.property) && typeof node.property.value === "number") {
|
||||||
|
computed = true;
|
||||||
|
}
|
||||||
|
if (computed) {
|
||||||
|
const oldNoLineTerminatorAfterNode = this.enterDelimited();
|
||||||
|
this.tokenChar(91);
|
||||||
|
this.print(node.property, undefined, true);
|
||||||
|
this.tokenChar(93);
|
||||||
|
this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
|
||||||
|
} else {
|
||||||
|
this.tokenChar(46);
|
||||||
|
this.print(node.property);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function MetaProperty(node) {
|
||||||
|
this.print(node.meta);
|
||||||
|
this.tokenChar(46);
|
||||||
|
this.print(node.property);
|
||||||
|
}
|
||||||
|
function PrivateName(node) {
|
||||||
|
this.tokenChar(35);
|
||||||
|
this.print(node.id);
|
||||||
|
}
|
||||||
|
function V8IntrinsicIdentifier(node) {
|
||||||
|
this.tokenChar(37);
|
||||||
|
this.word(node.name);
|
||||||
|
}
|
||||||
|
function ModuleExpression(node) {
|
||||||
|
this.word("module", true);
|
||||||
|
this.space();
|
||||||
|
this.tokenChar(123);
|
||||||
|
this.indent();
|
||||||
|
const {
|
||||||
|
body
|
||||||
|
} = node;
|
||||||
|
if (body.body.length || body.directives.length) {
|
||||||
|
this.newline();
|
||||||
|
}
|
||||||
|
this.print(body);
|
||||||
|
this.dedent();
|
||||||
|
this.rightBrace(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
//# sourceMappingURL=expressions.js.map
|
||||||
+1
File diff suppressed because one or more lines are too long
+658
@@ -0,0 +1,658 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.AnyTypeAnnotation = AnyTypeAnnotation;
|
||||||
|
exports.ArrayTypeAnnotation = ArrayTypeAnnotation;
|
||||||
|
exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
|
||||||
|
exports.BooleanTypeAnnotation = BooleanTypeAnnotation;
|
||||||
|
exports.DeclareClass = DeclareClass;
|
||||||
|
exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration;
|
||||||
|
exports.DeclareExportDeclaration = DeclareExportDeclaration;
|
||||||
|
exports.DeclareFunction = DeclareFunction;
|
||||||
|
exports.DeclareInterface = DeclareInterface;
|
||||||
|
exports.DeclareModule = DeclareModule;
|
||||||
|
exports.DeclareModuleExports = DeclareModuleExports;
|
||||||
|
exports.DeclareOpaqueType = DeclareOpaqueType;
|
||||||
|
exports.DeclareTypeAlias = DeclareTypeAlias;
|
||||||
|
exports.DeclareVariable = DeclareVariable;
|
||||||
|
exports.DeclaredPredicate = DeclaredPredicate;
|
||||||
|
exports.EmptyTypeAnnotation = EmptyTypeAnnotation;
|
||||||
|
exports.EnumBooleanBody = EnumBooleanBody;
|
||||||
|
exports.EnumBooleanMember = EnumBooleanMember;
|
||||||
|
exports.EnumDeclaration = EnumDeclaration;
|
||||||
|
exports.EnumDefaultedMember = EnumDefaultedMember;
|
||||||
|
exports.EnumNumberBody = EnumNumberBody;
|
||||||
|
exports.EnumNumberMember = EnumNumberMember;
|
||||||
|
exports.EnumStringBody = EnumStringBody;
|
||||||
|
exports.EnumStringMember = EnumStringMember;
|
||||||
|
exports.EnumSymbolBody = EnumSymbolBody;
|
||||||
|
exports.ExistsTypeAnnotation = ExistsTypeAnnotation;
|
||||||
|
exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
|
||||||
|
exports.FunctionTypeParam = FunctionTypeParam;
|
||||||
|
exports.IndexedAccessType = IndexedAccessType;
|
||||||
|
exports.InferredPredicate = InferredPredicate;
|
||||||
|
exports.InterfaceDeclaration = InterfaceDeclaration;
|
||||||
|
exports.GenericTypeAnnotation = exports.ClassImplements = exports.InterfaceExtends = InterfaceExtends;
|
||||||
|
exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation;
|
||||||
|
exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
|
||||||
|
exports.MixedTypeAnnotation = MixedTypeAnnotation;
|
||||||
|
exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
|
||||||
|
exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
||||||
|
Object.defineProperty(exports, "NumberLiteralTypeAnnotation", {
|
||||||
|
enumerable: true,
|
||||||
|
get: function () {
|
||||||
|
return _types2.NumericLiteral;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
exports.NumberTypeAnnotation = NumberTypeAnnotation;
|
||||||
|
exports.ObjectTypeAnnotation = ObjectTypeAnnotation;
|
||||||
|
exports.ObjectTypeCallProperty = ObjectTypeCallProperty;
|
||||||
|
exports.ObjectTypeIndexer = ObjectTypeIndexer;
|
||||||
|
exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot;
|
||||||
|
exports.ObjectTypeProperty = ObjectTypeProperty;
|
||||||
|
exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;
|
||||||
|
exports.OpaqueType = OpaqueType;
|
||||||
|
exports.OptionalIndexedAccessType = OptionalIndexedAccessType;
|
||||||
|
exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
|
||||||
|
Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
|
||||||
|
enumerable: true,
|
||||||
|
get: function () {
|
||||||
|
return _types2.StringLiteral;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
exports.StringTypeAnnotation = StringTypeAnnotation;
|
||||||
|
exports.SymbolTypeAnnotation = SymbolTypeAnnotation;
|
||||||
|
exports.ThisTypeAnnotation = ThisTypeAnnotation;
|
||||||
|
exports.TupleTypeAnnotation = TupleTypeAnnotation;
|
||||||
|
exports.TypeAlias = TypeAlias;
|
||||||
|
exports.TypeAnnotation = TypeAnnotation;
|
||||||
|
exports.TypeCastExpression = TypeCastExpression;
|
||||||
|
exports.TypeParameter = TypeParameter;
|
||||||
|
exports.TypeParameterDeclaration = exports.TypeParameterInstantiation = TypeParameterInstantiation;
|
||||||
|
exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
|
||||||
|
exports.UnionTypeAnnotation = UnionTypeAnnotation;
|
||||||
|
exports.Variance = Variance;
|
||||||
|
exports.VoidTypeAnnotation = VoidTypeAnnotation;
|
||||||
|
exports._interfaceish = _interfaceish;
|
||||||
|
exports._variance = _variance;
|
||||||
|
var _t = require("@babel/types");
|
||||||
|
var _modules = require("./modules.js");
|
||||||
|
var _index = require("../node/index.js");
|
||||||
|
var _types2 = require("./types.js");
|
||||||
|
const {
|
||||||
|
isDeclareExportDeclaration,
|
||||||
|
isStatement
|
||||||
|
} = _t;
|
||||||
|
function AnyTypeAnnotation() {
|
||||||
|
this.word("any");
|
||||||
|
}
|
||||||
|
function ArrayTypeAnnotation(node) {
|
||||||
|
this.print(node.elementType, true);
|
||||||
|
this.tokenChar(91);
|
||||||
|
this.tokenChar(93);
|
||||||
|
}
|
||||||
|
function BooleanTypeAnnotation() {
|
||||||
|
this.word("boolean");
|
||||||
|
}
|
||||||
|
function BooleanLiteralTypeAnnotation(node) {
|
||||||
|
this.word(node.value ? "true" : "false");
|
||||||
|
}
|
||||||
|
function NullLiteralTypeAnnotation() {
|
||||||
|
this.word("null");
|
||||||
|
}
|
||||||
|
function DeclareClass(node, parent) {
|
||||||
|
if (!isDeclareExportDeclaration(parent)) {
|
||||||
|
this.word("declare");
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
this.word("class");
|
||||||
|
this.space();
|
||||||
|
_interfaceish.call(this, node);
|
||||||
|
}
|
||||||
|
function DeclareFunction(node, parent) {
|
||||||
|
if (!isDeclareExportDeclaration(parent)) {
|
||||||
|
this.word("declare");
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
this.word("function");
|
||||||
|
this.space();
|
||||||
|
this.print(node.id);
|
||||||
|
this.print(node.id.typeAnnotation.typeAnnotation);
|
||||||
|
if (node.predicate) {
|
||||||
|
this.space();
|
||||||
|
this.print(node.predicate);
|
||||||
|
}
|
||||||
|
this.semicolon();
|
||||||
|
}
|
||||||
|
function InferredPredicate() {
|
||||||
|
this.tokenChar(37);
|
||||||
|
this.word("checks");
|
||||||
|
}
|
||||||
|
function DeclaredPredicate(node) {
|
||||||
|
this.tokenChar(37);
|
||||||
|
this.word("checks");
|
||||||
|
this.tokenChar(40);
|
||||||
|
this.print(node.value);
|
||||||
|
this.tokenChar(41);
|
||||||
|
}
|
||||||
|
function DeclareInterface(node) {
|
||||||
|
this.word("declare");
|
||||||
|
this.space();
|
||||||
|
InterfaceDeclaration.call(this, node);
|
||||||
|
}
|
||||||
|
function DeclareModule(node) {
|
||||||
|
this.word("declare");
|
||||||
|
this.space();
|
||||||
|
this.word("module");
|
||||||
|
this.space();
|
||||||
|
this.print(node.id);
|
||||||
|
this.space();
|
||||||
|
this.print(node.body);
|
||||||
|
}
|
||||||
|
function DeclareModuleExports(node) {
|
||||||
|
this.word("declare");
|
||||||
|
this.space();
|
||||||
|
this.word("module");
|
||||||
|
this.tokenChar(46);
|
||||||
|
this.word("exports");
|
||||||
|
this.print(node.typeAnnotation);
|
||||||
|
}
|
||||||
|
function DeclareTypeAlias(node) {
|
||||||
|
this.word("declare");
|
||||||
|
this.space();
|
||||||
|
TypeAlias.call(this, node);
|
||||||
|
}
|
||||||
|
function DeclareOpaqueType(node, parent) {
|
||||||
|
if (!isDeclareExportDeclaration(parent)) {
|
||||||
|
this.word("declare");
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
OpaqueType.call(this, node);
|
||||||
|
}
|
||||||
|
function DeclareVariable(node, parent) {
|
||||||
|
if (!isDeclareExportDeclaration(parent)) {
|
||||||
|
this.word("declare");
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
this.word("var");
|
||||||
|
this.space();
|
||||||
|
this.print(node.id);
|
||||||
|
this.print(node.id.typeAnnotation);
|
||||||
|
this.semicolon();
|
||||||
|
}
|
||||||
|
function DeclareExportDeclaration(node) {
|
||||||
|
this.word("declare");
|
||||||
|
this.space();
|
||||||
|
this.word("export");
|
||||||
|
this.space();
|
||||||
|
if (node.default) {
|
||||||
|
this.word("default");
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
FlowExportDeclaration.call(this, node);
|
||||||
|
}
|
||||||
|
function DeclareExportAllDeclaration(node) {
|
||||||
|
this.word("declare");
|
||||||
|
this.space();
|
||||||
|
_modules.ExportAllDeclaration.call(this, node);
|
||||||
|
}
|
||||||
|
function EnumDeclaration(node) {
|
||||||
|
const {
|
||||||
|
id,
|
||||||
|
body
|
||||||
|
} = node;
|
||||||
|
this.word("enum");
|
||||||
|
this.space();
|
||||||
|
this.print(id);
|
||||||
|
this.print(body);
|
||||||
|
}
|
||||||
|
function enumExplicitType(context, name, hasExplicitType) {
|
||||||
|
if (hasExplicitType) {
|
||||||
|
context.space();
|
||||||
|
context.word("of");
|
||||||
|
context.space();
|
||||||
|
context.word(name);
|
||||||
|
}
|
||||||
|
context.space();
|
||||||
|
}
|
||||||
|
function enumBody(context, node) {
|
||||||
|
const {
|
||||||
|
members
|
||||||
|
} = node;
|
||||||
|
context.token("{");
|
||||||
|
context.indent();
|
||||||
|
context.newline();
|
||||||
|
for (const member of members) {
|
||||||
|
context.print(member);
|
||||||
|
context.newline();
|
||||||
|
}
|
||||||
|
if (node.hasUnknownMembers) {
|
||||||
|
context.token("...");
|
||||||
|
context.newline();
|
||||||
|
}
|
||||||
|
context.dedent();
|
||||||
|
context.token("}");
|
||||||
|
}
|
||||||
|
function EnumBooleanBody(node) {
|
||||||
|
const {
|
||||||
|
explicitType
|
||||||
|
} = node;
|
||||||
|
enumExplicitType(this, "boolean", explicitType);
|
||||||
|
enumBody(this, node);
|
||||||
|
}
|
||||||
|
function EnumNumberBody(node) {
|
||||||
|
const {
|
||||||
|
explicitType
|
||||||
|
} = node;
|
||||||
|
enumExplicitType(this, "number", explicitType);
|
||||||
|
enumBody(this, node);
|
||||||
|
}
|
||||||
|
function EnumStringBody(node) {
|
||||||
|
const {
|
||||||
|
explicitType
|
||||||
|
} = node;
|
||||||
|
enumExplicitType(this, "string", explicitType);
|
||||||
|
enumBody(this, node);
|
||||||
|
}
|
||||||
|
function EnumSymbolBody(node) {
|
||||||
|
enumExplicitType(this, "symbol", true);
|
||||||
|
enumBody(this, node);
|
||||||
|
}
|
||||||
|
function EnumDefaultedMember(node) {
|
||||||
|
const {
|
||||||
|
id
|
||||||
|
} = node;
|
||||||
|
this.print(id);
|
||||||
|
this.tokenChar(44);
|
||||||
|
}
|
||||||
|
function enumInitializedMember(context, node) {
|
||||||
|
context.print(node.id);
|
||||||
|
context.space();
|
||||||
|
context.token("=");
|
||||||
|
context.space();
|
||||||
|
context.print(node.init);
|
||||||
|
context.token(",");
|
||||||
|
}
|
||||||
|
function EnumBooleanMember(node) {
|
||||||
|
enumInitializedMember(this, node);
|
||||||
|
}
|
||||||
|
function EnumNumberMember(node) {
|
||||||
|
enumInitializedMember(this, node);
|
||||||
|
}
|
||||||
|
function EnumStringMember(node) {
|
||||||
|
enumInitializedMember(this, node);
|
||||||
|
}
|
||||||
|
function FlowExportDeclaration(node) {
|
||||||
|
if (node.declaration) {
|
||||||
|
const declar = node.declaration;
|
||||||
|
this.print(declar);
|
||||||
|
if (!isStatement(declar)) this.semicolon();
|
||||||
|
} else {
|
||||||
|
this.tokenChar(123);
|
||||||
|
if (node.specifiers.length) {
|
||||||
|
this.space();
|
||||||
|
this.printList(node.specifiers);
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
this.tokenChar(125);
|
||||||
|
if (node.source) {
|
||||||
|
this.space();
|
||||||
|
this.word("from");
|
||||||
|
this.space();
|
||||||
|
this.print(node.source);
|
||||||
|
}
|
||||||
|
this.semicolon();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function ExistsTypeAnnotation() {
|
||||||
|
this.tokenChar(42);
|
||||||
|
}
|
||||||
|
function FunctionTypeAnnotation(node, parent) {
|
||||||
|
this.print(node.typeParameters);
|
||||||
|
this.tokenChar(40);
|
||||||
|
if (node.this) {
|
||||||
|
this.word("this");
|
||||||
|
this.tokenChar(58);
|
||||||
|
this.space();
|
||||||
|
this.print(node.this.typeAnnotation);
|
||||||
|
if (node.params.length || node.rest) {
|
||||||
|
this.tokenChar(44);
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.printList(node.params);
|
||||||
|
if (node.rest) {
|
||||||
|
if (node.params.length) {
|
||||||
|
this.tokenChar(44);
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
this.token("...");
|
||||||
|
this.print(node.rest);
|
||||||
|
}
|
||||||
|
this.tokenChar(41);
|
||||||
|
const type = parent == null ? void 0 : parent.type;
|
||||||
|
if (type != null && (type === "ObjectTypeCallProperty" || type === "ObjectTypeInternalSlot" || type === "DeclareFunction" || type === "ObjectTypeProperty" && parent.method)) {
|
||||||
|
this.tokenChar(58);
|
||||||
|
} else {
|
||||||
|
this.space();
|
||||||
|
this.token("=>");
|
||||||
|
}
|
||||||
|
this.space();
|
||||||
|
this.print(node.returnType);
|
||||||
|
}
|
||||||
|
function FunctionTypeParam(node) {
|
||||||
|
this.print(node.name);
|
||||||
|
if (node.optional) this.tokenChar(63);
|
||||||
|
if (node.name) {
|
||||||
|
this.tokenChar(58);
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
this.print(node.typeAnnotation);
|
||||||
|
}
|
||||||
|
function InterfaceExtends(node) {
|
||||||
|
this.print(node.id);
|
||||||
|
this.print(node.typeParameters, true);
|
||||||
|
}
|
||||||
|
function _interfaceish(node) {
|
||||||
|
var _node$extends;
|
||||||
|
this.print(node.id);
|
||||||
|
this.print(node.typeParameters);
|
||||||
|
if ((_node$extends = node.extends) != null && _node$extends.length) {
|
||||||
|
this.space();
|
||||||
|
this.word("extends");
|
||||||
|
this.space();
|
||||||
|
this.printList(node.extends);
|
||||||
|
}
|
||||||
|
if (node.type === "DeclareClass") {
|
||||||
|
var _node$mixins, _node$implements;
|
||||||
|
if ((_node$mixins = node.mixins) != null && _node$mixins.length) {
|
||||||
|
this.space();
|
||||||
|
this.word("mixins");
|
||||||
|
this.space();
|
||||||
|
this.printList(node.mixins);
|
||||||
|
}
|
||||||
|
if ((_node$implements = node.implements) != null && _node$implements.length) {
|
||||||
|
this.space();
|
||||||
|
this.word("implements");
|
||||||
|
this.space();
|
||||||
|
this.printList(node.implements);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.space();
|
||||||
|
this.print(node.body);
|
||||||
|
}
|
||||||
|
function _variance(node) {
|
||||||
|
var _node$variance;
|
||||||
|
const kind = (_node$variance = node.variance) == null ? void 0 : _node$variance.kind;
|
||||||
|
if (kind != null) {
|
||||||
|
if (kind === "plus") {
|
||||||
|
this.tokenChar(43);
|
||||||
|
} else if (kind === "minus") {
|
||||||
|
this.tokenChar(45);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function InterfaceDeclaration(node) {
|
||||||
|
this.word("interface");
|
||||||
|
this.space();
|
||||||
|
_interfaceish.call(this, node);
|
||||||
|
}
|
||||||
|
function andSeparator(occurrenceCount) {
|
||||||
|
this.space();
|
||||||
|
this.token("&", false, occurrenceCount);
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
function InterfaceTypeAnnotation(node) {
|
||||||
|
var _node$extends2;
|
||||||
|
this.word("interface");
|
||||||
|
if ((_node$extends2 = node.extends) != null && _node$extends2.length) {
|
||||||
|
this.space();
|
||||||
|
this.word("extends");
|
||||||
|
this.space();
|
||||||
|
this.printList(node.extends);
|
||||||
|
}
|
||||||
|
this.space();
|
||||||
|
this.print(node.body);
|
||||||
|
}
|
||||||
|
function IntersectionTypeAnnotation(node) {
|
||||||
|
this.printJoin(node.types, undefined, undefined, andSeparator);
|
||||||
|
}
|
||||||
|
function MixedTypeAnnotation() {
|
||||||
|
this.word("mixed");
|
||||||
|
}
|
||||||
|
function EmptyTypeAnnotation() {
|
||||||
|
this.word("empty");
|
||||||
|
}
|
||||||
|
function NullableTypeAnnotation(node) {
|
||||||
|
this.tokenChar(63);
|
||||||
|
this.print(node.typeAnnotation);
|
||||||
|
}
|
||||||
|
function NumberTypeAnnotation() {
|
||||||
|
this.word("number");
|
||||||
|
}
|
||||||
|
function StringTypeAnnotation() {
|
||||||
|
this.word("string");
|
||||||
|
}
|
||||||
|
function ThisTypeAnnotation() {
|
||||||
|
this.word("this");
|
||||||
|
}
|
||||||
|
function TupleTypeAnnotation(node) {
|
||||||
|
this.tokenChar(91);
|
||||||
|
this.printList(node.types);
|
||||||
|
this.tokenChar(93);
|
||||||
|
}
|
||||||
|
function TypeofTypeAnnotation(node) {
|
||||||
|
this.word("typeof");
|
||||||
|
this.space();
|
||||||
|
this.print(node.argument);
|
||||||
|
}
|
||||||
|
function TypeAlias(node) {
|
||||||
|
this.word("type");
|
||||||
|
this.space();
|
||||||
|
this.print(node.id);
|
||||||
|
this.print(node.typeParameters);
|
||||||
|
this.space();
|
||||||
|
this.tokenChar(61);
|
||||||
|
this.space();
|
||||||
|
this.print(node.right);
|
||||||
|
this.semicolon();
|
||||||
|
}
|
||||||
|
function TypeAnnotation(node, parent) {
|
||||||
|
this.tokenChar(58);
|
||||||
|
this.space();
|
||||||
|
if (parent.type === "ArrowFunctionExpression") {
|
||||||
|
this.tokenContext |= _index.TokenContext.arrowFlowReturnType;
|
||||||
|
} else if (node.optional) {
|
||||||
|
this.tokenChar(63);
|
||||||
|
}
|
||||||
|
this.print(node.typeAnnotation);
|
||||||
|
}
|
||||||
|
function TypeParameterInstantiation(node) {
|
||||||
|
this.tokenChar(60);
|
||||||
|
this.printList(node.params);
|
||||||
|
this.tokenChar(62);
|
||||||
|
}
|
||||||
|
function TypeParameter(node) {
|
||||||
|
_variance.call(this, node);
|
||||||
|
this.word(node.name);
|
||||||
|
if (node.bound) {
|
||||||
|
this.print(node.bound);
|
||||||
|
}
|
||||||
|
if (node.default) {
|
||||||
|
this.space();
|
||||||
|
this.tokenChar(61);
|
||||||
|
this.space();
|
||||||
|
this.print(node.default);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function OpaqueType(node) {
|
||||||
|
this.word("opaque");
|
||||||
|
this.space();
|
||||||
|
this.word("type");
|
||||||
|
this.space();
|
||||||
|
this.print(node.id);
|
||||||
|
this.print(node.typeParameters);
|
||||||
|
if (node.supertype) {
|
||||||
|
this.tokenChar(58);
|
||||||
|
this.space();
|
||||||
|
this.print(node.supertype);
|
||||||
|
}
|
||||||
|
if (node.impltype) {
|
||||||
|
this.space();
|
||||||
|
this.tokenChar(61);
|
||||||
|
this.space();
|
||||||
|
this.print(node.impltype);
|
||||||
|
}
|
||||||
|
this.semicolon();
|
||||||
|
}
|
||||||
|
function ObjectTypeAnnotation(node) {
|
||||||
|
if (node.exact) {
|
||||||
|
this.token("{|");
|
||||||
|
} else {
|
||||||
|
this.tokenChar(123);
|
||||||
|
}
|
||||||
|
const props = [...node.properties, ...(node.callProperties || []), ...(node.indexers || []), ...(node.internalSlots || [])];
|
||||||
|
if (props.length) {
|
||||||
|
this.newline();
|
||||||
|
this.space();
|
||||||
|
this.printJoin(props, true, true, () => {
|
||||||
|
if (props.length !== 1 || node.inexact) {
|
||||||
|
this.tokenChar(44);
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
}, true);
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
if (node.inexact) {
|
||||||
|
this.indent();
|
||||||
|
this.token("...");
|
||||||
|
if (props.length) {
|
||||||
|
this.newline();
|
||||||
|
}
|
||||||
|
this.dedent();
|
||||||
|
}
|
||||||
|
if (node.exact) {
|
||||||
|
this.token("|}");
|
||||||
|
} else {
|
||||||
|
this.tokenChar(125);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function ObjectTypeInternalSlot(node) {
|
||||||
|
if (node.static) {
|
||||||
|
this.word("static");
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
this.tokenChar(91);
|
||||||
|
this.tokenChar(91);
|
||||||
|
this.print(node.id);
|
||||||
|
this.tokenChar(93);
|
||||||
|
this.tokenChar(93);
|
||||||
|
if (node.optional) this.tokenChar(63);
|
||||||
|
if (!node.method) {
|
||||||
|
this.tokenChar(58);
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
this.print(node.value);
|
||||||
|
}
|
||||||
|
function ObjectTypeCallProperty(node) {
|
||||||
|
if (node.static) {
|
||||||
|
this.word("static");
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
this.print(node.value);
|
||||||
|
}
|
||||||
|
function ObjectTypeIndexer(node) {
|
||||||
|
if (node.static) {
|
||||||
|
this.word("static");
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
_variance.call(this, node);
|
||||||
|
this.tokenChar(91);
|
||||||
|
if (node.id) {
|
||||||
|
this.print(node.id);
|
||||||
|
this.tokenChar(58);
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
this.print(node.key);
|
||||||
|
this.tokenChar(93);
|
||||||
|
this.tokenChar(58);
|
||||||
|
this.space();
|
||||||
|
this.print(node.value);
|
||||||
|
}
|
||||||
|
function ObjectTypeProperty(node) {
|
||||||
|
if (node.proto) {
|
||||||
|
this.word("proto");
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
if (node.static) {
|
||||||
|
this.word("static");
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
if (node.kind === "get" || node.kind === "set") {
|
||||||
|
this.word(node.kind);
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
_variance.call(this, node);
|
||||||
|
this.print(node.key);
|
||||||
|
if (node.optional) this.tokenChar(63);
|
||||||
|
if (!node.method) {
|
||||||
|
this.tokenChar(58);
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
this.print(node.value);
|
||||||
|
}
|
||||||
|
function ObjectTypeSpreadProperty(node) {
|
||||||
|
this.token("...");
|
||||||
|
this.print(node.argument);
|
||||||
|
}
|
||||||
|
function QualifiedTypeIdentifier(node) {
|
||||||
|
this.print(node.qualification);
|
||||||
|
this.tokenChar(46);
|
||||||
|
this.print(node.id);
|
||||||
|
}
|
||||||
|
function SymbolTypeAnnotation() {
|
||||||
|
this.word("symbol");
|
||||||
|
}
|
||||||
|
function orSeparator(occurrenceCount) {
|
||||||
|
this.space();
|
||||||
|
this.token("|", false, occurrenceCount);
|
||||||
|
this.space();
|
||||||
|
}
|
||||||
|
function UnionTypeAnnotation(node) {
|
||||||
|
this.printJoin(node.types, undefined, undefined, orSeparator);
|
||||||
|
}
|
||||||
|
function TypeCastExpression(node) {
|
||||||
|
this.tokenChar(40);
|
||||||
|
this.print(node.expression);
|
||||||
|
this.print(node.typeAnnotation);
|
||||||
|
this.tokenChar(41);
|
||||||
|
}
|
||||||
|
function Variance(node) {
|
||||||
|
if (node.kind === "plus") {
|
||||||
|
this.tokenChar(43);
|
||||||
|
} else {
|
||||||
|
this.tokenChar(45);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function VoidTypeAnnotation() {
|
||||||
|
this.word("void");
|
||||||
|
}
|
||||||
|
function IndexedAccessType(node) {
|
||||||
|
this.print(node.objectType, true);
|
||||||
|
this.tokenChar(91);
|
||||||
|
this.print(node.indexType);
|
||||||
|
this.tokenChar(93);
|
||||||
|
}
|
||||||
|
function OptionalIndexedAccessType(node) {
|
||||||
|
this.print(node.objectType);
|
||||||
|
if (node.optional) {
|
||||||
|
this.token("?.");
|
||||||
|
}
|
||||||
|
this.tokenChar(91);
|
||||||
|
this.print(node.indexType);
|
||||||
|
this.tokenChar(93);
|
||||||
|
}
|
||||||
|
|
||||||
|
//# sourceMappingURL=flow.js.map
|
||||||
+1
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user