first commit
This commit is contained in:
commit
604fef891f
8368 files changed
+1285228
No files matched your search
@@ -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
|
||||||
Whitespace-only changes.
@@ -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
@@ -0,0 +1 @@
|
|||||||
|
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>x(e)===`[object Map]`,p=e=>x(e)===`[object Set]`,m=e=>x(e)===`[object Date]`,h=e=>typeof e==`function`,g=e=>typeof e==`string`,_=e=>typeof e==`symbol`,v=e=>typeof e==`object`&&!!e,y=e=>(v(e)||h(e))&&h(e.then)&&h(e.catch),b=Object.prototype.toString,x=e=>b.call(e),ee=e=>x(e).slice(8,-1),S=e=>x(e)===`[object Object]`,C=e=>g(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,te=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ne=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},re=/-\w/g,w=ne(e=>e.replace(re,e=>e.slice(1).toUpperCase())),ie=/\B([A-Z])/g,T=ne(e=>e.replace(ie,`-$1`).toLowerCase()),ae=ne(e=>e.charAt(0).toUpperCase()+e.slice(1)),oe=ne(e=>e?`on${ae(e)}`:``),E=(e,t)=>!Object.is(e,t),se=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},D=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ce=e=>{let t=parseFloat(e);return isNaN(t)?e:t},le,ue=()=>le||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function de(e){if(d(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=g(r)?he(r):de(r);if(i)for(let e in i)t[e]=i[e]}return t}else if(g(e)||v(e))return e}var fe=/;(?![^(]*\))/g,pe=/:([^]+)/,me=/\/\*[^]*?\*\//g;function he(e){let t={};return e.replace(me,``).split(fe).forEach(e=>{if(e){let n=e.split(pe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ge(e){let t=``;if(g(e))t=e;else if(d(e))for(let n=0;n<e.length;n++){let r=ge(e[n]);r&&(t+=r+` `)}else if(v(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}var _e=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,ve=e(_e);_e+``;function ye(e){return!!e||e===``}function be(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=xe(e[r],t[r]);return n}function xe(e,t){if(e===t)return!0;let n=m(e),r=m(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=_(e),r=_(t),n||r)return e===t;if(n=d(e),r=d(t),n||r)return n&&r?be(e,t):!1;if(n=v(e),r=v(t),n||r){if(!n||!r||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!xe(e[n],t[n]))return!1}}return String(e)===String(t)}function Se(e,t){return e.findIndex(e=>xe(e,t))}var Ce=e=>!!(e&&e.__v_isRef===!0),O=e=>g(e)?e:e==null?``:d(e)||v(e)&&(e.toString===b||!h(e.toString))?Ce(e)?O(e.value):JSON.stringify(e,we,2):String(e),we=(e,t)=>Ce(t)?we(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Te(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Te(e))}:_(t)?Te(t):v(t)&&!d(t)&&!S(t)?String(t):t,Te=(e,t=``)=>_(e)?`Symbol(${e.description??t})`:e,k,Ee=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&k&&(k.active?(this.parent=k,this.index=(k.scopes||=[]).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){let t=k;try{return k=this,e()}finally{k=t}}}on(){++this._on===1&&(this.prevScope=k,k=this)}off(){if(this._on>0&&--this._on===0){if(k===this)k=this.prevScope;else{let e=k;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.lengLine truncated
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
@import "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap";.nav-link[data-v-5497948c]{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1));font-size:.875rem;font-weight:600;line-height:1.25rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.nav-link[data-v-5497948c]:hover,.router-link-active[data-v-5497948c]{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.mobile-link[data-v-5497948c]{--tw-text-opacity:1;color:rgb(51 65 85/var(--tw-text-opacity,1));border-radius:.75rem;padding:.5rem .75rem;font-size:.875rem;font-weight:600;line-height:1.25rem}.mobile-link[data-v-5497948c]:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.side-link[data-v-772b8fa3]{--tw-text-opacity:1;width:100%;color:rgb(51 65 85/var(--tw-text-opacity,1));border-radius:.75rem;align-items:center;gap:.75rem;padding:.75rem;font-size:.875rem;font-weight:600;line-height:1.25rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:flex}.side-link[data-v-772b8fa3]:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.router-link-active[data-v-772b8fa3]{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1));--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border:0 solid #e5e7eb}:before,:after{--tw-content:""}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:Inter,system-ui,sans-serif;line-height:1.5}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder{opacity:1;color:#9ca3af}textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[roLine truncated
|
||||||
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 it is too large.
Load diff
+1
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"lucide-vue-next.js","names":["Infinity"],"sources":["../../lucide-vue-next/dist/esm/shared/src/utils/hasA11yProp.js","../../lucide-vue-next/dist/esm/shared/src/utils/isEmptyString.js","../../lucide-vue-next/dist/esm/shared/src/utils/mergeClasses.js","../../lucide-vue-next/dist/esm/shared/src/utils/toKebabCase.js","../../lucide-vue-next/dist/esm/shared/src/utils/toCamelCase.js","../../lucide-vue-next/dist/esm/shared/src/utils/toPascalCase.js","../../lucide-vue-next/dist/esm/defaultAttributes.js","../../lucide-vue-next/dist/esm/Icon.js","../../lucide-vue-next/dist/esm/createLucideIcon.js","../../lucide-vue-next/dist/esm/icons/a-arrow-down.js","../../lucide-vue-next/dist/esm/icons/a-arrow-up.js","../../lucide-vue-next/dist/esm/icons/a-large-small.js","../../lucide-vue-next/dist/esm/icons/accessibility.js","../../lucide-vue-next/dist/esm/icons/activity.js","../../lucide-vue-next/dist/esm/icons/air-vent.js","../../lucide-vue-next/dist/esm/icons/airplay.js","../../lucide-vue-next/dist/esm/icons/alarm-clock-check.js","../../lucide-vue-next/dist/esm/icons/alarm-clock-minus.js","../../lucide-vue-next/dist/esm/icons/alarm-clock-off.js","../../lucide-vue-next/dist/esm/icons/alarm-clock-plus.js","../../lucide-vue-next/dist/esm/icons/alarm-clock.js","../../lucide-vue-next/dist/esm/icons/alarm-smoke.js","../../lucide-vue-next/dist/esm/icons/album.js","../../lucide-vue-next/dist/esm/icons/align-center-horizontal.js","../../lucide-vue-next/dist/esm/icons/align-center-vertical.js","../../lucide-vue-next/dist/esm/icons/align-end-horizontal.js","../../lucide-vue-next/dist/esm/icons/align-end-vertical.js","../../lucide-vue-next/dist/esm/icons/align-horizontal-distribute-center.js","../../lucide-vue-next/dist/esm/icons/align-horizontal-distribute-start.js","../../lucide-vue-next/dist/esm/icons/align-horizontal-distribute-end.js","../../lucide-vue-next/dist/esm/icons/align-horizontal-justify-center.js","../../lucide-vue-next/dist/esm/icons/align-horizontal-justify-end.js","../../lucide-vue-next/dist/esm/icons/align-horizontal-justify-start.js","../../lucide-vue-next/dist/esm/icons/align-horizontal-space-around.js","../../lucide-vue-next/dist/esm/icons/align-horizontal-space-between.js","../../lucide-vue-next/dist/esm/icons/align-start-horizontal.js","../../lucide-vue-next/dist/esm/icons/align-start-vertical.js","../../lucide-vue-next/dist/esm/icons/align-vertical-distribute-center.js","../../lucide-vue-next/dist/esm/icons/align-vertical-distribute-end.js","../../lucide-vue-next/dist/esm/icons/align-vertical-distribute-start.js","../../lucide-vue-next/dist/esm/icons/align-vertical-justify-center.js","../../lucide-vue-next/dist/esm/icons/align-vertical-justify-end.js","../../lucide-vue-next/dist/esm/icons/align-vertical-justify-start.js","../../lucide-vue-next/dist/esm/icons/align-vertical-space-between.js","../../lucide-vue-next/dist/esm/icons/align-vertical-space-around.js","../../lucide-vue-next/dist/esm/icons/ambulance.js","../../lucide-vue-next/dist/esm/icons/ampersands.js","../../lucide-vue-next/dist/esm/icons/ampersand.js","../../lucide-vue-next/dist/esm/icons/amphora.js","../../lucide-vue-next/dist/esm/icons/anchor.js","../../lucide-vue-next/dist/esm/icons/angry.js","../../lucide-vue-next/dist/esm/icons/annoyed.js","../../lucide-vue-next/dist/esm/icons/antenna.js","../../lucide-vue-next/dist/esm/icons/anvil.js","../../lucide-vue-next/dist/esm/icons/aperture.js","../../lucide-vue-next/dist/esm/icons/app-window-mac.js","../../lucide-vue-next/dist/esm/icons/app-window.js","../../lucide-vue-next/dist/esm/icons/apple.js","../../lucide-vue-next/dist/esm/icons/archive-restore.js","../../lucide-vue-next/dist/esm/icons/archive-x.js","../../lucide-vue-next/dist/esm/icons/archive.js","../../lucide-vue-next/dist/esm/icons/armchair.js","../../lucide-vue-next/dist/esm/icons/arrow-big-down-dash.js","../../lucide-vue-next/dist/esm/icons/arrow-big-down.js","../../lucide-vue-next/dist/esm/icons/arrow-big-left-dash.js","../../lucide-vue-next/dist/esm/icons/arrow-big-left.js","../../lucide-vue-next/dist/esm/icons/arrow-big-right-dash.js","../../lucide-vue-next/dist/esm/icons/arrow-big-right.js","../../lucide-vue-next/dist/esm/icons/arrow-big-up-dash.js","../../lucide-vue-next/dist/esm/icons/arrow-big-up.js","../../lucide-vue-next/dist/esm/icons/arrow-down-0-1.js","../../lucide-vue-next/dist/esm/icons/arrow-down-1-0.js","../../lucide-vue-next/dist/esm/icons/arrow-down-a-z.js","../../lucide-vue-next/dist/esm/icons/arrow-down-from-line.js","../../lucide-vue-next/dist/esm/icons/arrow-down-left.js","../../lucide-vue-next/dist/esm/icons/arrow-down-narrow-wide.js","../../lucide-vue-next/dist/esm/icons/arrow-down-to-dot.js","../../lucide-vue-next/dist/esm/icons/arrow-down-right.js","../../lucide-vue-next/dist/esm/icons/arrow-down-to-line.js","../../lucide-vue-next/dist/esm/icons/arrow-down-up.js","../../lucide-vue-next/dist/esm/icons/arrow-down-wide-narrow.js","../../lucide-vue-next/dist/esm/icons/arrow-down-z-a.js","../../lucidLine truncated
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
+6437
File diff suppressed because it is too large.
Load diff
+1
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"vue-router.js","names":["isBrowser","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__commonJSMin","__copyProps","__toESM","isBrowser","isBrowser"],"sources":["../../vue-router/dist/useApi-DtucMc-S.js","../../@vue/devtools-shared/dist/index.js","../../perfect-debounce/dist/index.mjs","../../hookable/dist/index.mjs","../../birpc/dist/index.mjs","../../@vue/devtools-kit/dist/index.js","../../vue-router/dist/devtools-BPov6AZY.js","../../vue-router/dist/vue-router.js"],"sourcesContent":["/*!\n * vue-router v5.0.6\n * (c) 2026 Eduardo San Martin Morote\n * @license MIT\n */\nimport { inject } from \"vue\";\n\n//#region src/utils/env.ts\nconst isBrowser = typeof document !== \"undefined\";\n\n//#endregion\n//#region src/utils/index.ts\n/**\n* Identity function that returns the value as is.\n*\n* @param v - the value to return\n*\n* @internal\n*/\nconst identityFn = (v) => v;\n/**\n* Allows differentiating lazy components from functional components and vue-class-component\n* @internal\n*\n* @param component\n*/\nfunction isRouteComponent(component) {\n\treturn typeof component === \"object\" || \"displayName\" in component || \"props\" in component || \"__vccOpts\" in component;\n}\nfunction isESModule(obj) {\n\treturn obj.__esModule || obj[Symbol.toStringTag] === \"Module\" || obj.default && isRouteComponent(obj.default);\n}\nconst assign = Object.assign;\nfunction applyToParams(fn, params) {\n\tconst newParams = {};\n\tfor (const key in params) {\n\t\tconst value = params[key];\n\t\tnewParams[key] = isArray(value) ? value.map(fn) : fn(value);\n\t}\n\treturn newParams;\n}\nconst noop = () => {};\n/**\n* Typesafe alternative to Array.isArray\n* https://github.com/microsoft/TypeScript/pull/48228\n*\n* @internal\n*/\nconst isArray = Array.isArray;\nfunction mergeOptions(defaults, partialOptions) {\n\tconst options = {};\n\tfor (const key in defaults) options[key] = key in partialOptions ? partialOptions[key] : defaults[key];\n\treturn options;\n}\n\n//#endregion\n//#region src/errors.ts\n/**\n* Flags so we can combine them when checking for multiple errors. This is the internal version of\n* {@link NavigationFailureType}.\n*\n* @internal\n*/\nlet ErrorTypes = /* @__PURE__ */ function(ErrorTypes) {\n\tErrorTypes[ErrorTypes[\"MATCHER_NOT_FOUND\"] = 1] = \"MATCHER_NOT_FOUND\";\n\tErrorTypes[ErrorTypes[\"NAVIGATION_GUARD_REDIRECT\"] = 2] = \"NAVIGATION_GUARD_REDIRECT\";\n\tErrorTypes[ErrorTypes[\"NAVIGATION_ABORTED\"] = 4] = \"NAVIGATION_ABORTED\";\n\tErrorTypes[ErrorTypes[\"NAVIGATION_CANCELLED\"] = 8] = \"NAVIGATION_CANCELLED\";\n\tErrorTypes[ErrorTypes[\"NAVIGATION_DUPLICATED\"] = 16] = \"NAVIGATION_DUPLICATED\";\n\treturn ErrorTypes;\n}({});\nconst NavigationFailureSymbol = Symbol(process.env.NODE_ENV !== \"production\" ? \"navigation failure\" : \"\");\n/**\n* Enumeration with all possible types for navigation failures. Can be passed to\n* {@link isNavigationFailure} to check for specific failures.\n*/\nlet NavigationFailureType = /* @__PURE__ */ function(NavigationFailureType) {\n\t/**\n\t* An aborted navigation is a navigation that failed because a navigation\n\t* guard returned `false` or called `next(false)`\n\t*/\n\tNavigationFailureType[NavigationFailureType[\"aborted\"] = 4] = \"aborted\";\n\t/**\n\t* A cancelled navigation is a navigation that failed because a more recent\n\t* navigation finished started (not necessarily finished).\n\t*/\n\tNavigationFailureType[NavigationFailureType[\"cancelled\"] = 8] = \"cancelled\";\n\t/**\n\t* A duplicated navigation is a navigation that failed because it was\n\t* initiated while already being at the exact same location.\n\t*/\n\tNavigationFailureType[NavigationFailureType[\"duplicated\"] = 16] = \"duplicated\";\n\treturn NavigationFailureType;\n}({});\nconst ErrorTypeMessages = {\n\t[ErrorTypes.MATCHER_NOT_FOUND]({ location, currentLocation }) {\n\t\treturn `No match for\\n ${JSON.stringify(location)}${currentLocation ? \"\\nwhile being at\\n\" + JSON.stringify(currentLocation) : \"\"}`;\n\t},\n\t[ErrorTypes.NAVIGATION_GUARD_REDIRECT]({ from, to }) {\n\t\treturn `Redirected from \"${from.fullPath}\" to \"${stringifyRoute(to)}\" via a navigation guard.`;\n\t},\n\t[ErrorTypes.NAVIGATION_ABORTED]({ from, to }) {\n\t\treturn `Navigation aborted from \"${from.fullPath}\" to \"${to.fullPath}\" via a navigation guard.`;\n\t},\n\t[ErrorTypes.NAVIGATION_CANCELLED]({ from, to }) {\n\t\treturn `Navigation cancelled from \"${from.fullPath}\" to \"${to.fullPath}\" with a new navigation.`;\n\t},\n\t[ErrorTypes.NAVIGATION_DUPLICATED]({ from, to: _to }) {\n\t\treturn `Avoided redundant navigation to current location: \"${from.fullPath}\".`;\n\t}\n};\n/**\n* Creates a typed NavigationFailure object.\n* @internal\n* @param type - NavigationFailureType\n* @param params - { from, to }\n*/\nfunction createRouterError(type, params) {\n\tif (process.env.NODE_ENV !== \"production\" || false) return assign(new Error(ErrorTypeMLine truncated
|
||||||
+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
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"vue.runtime.esm-bundler-C6sZGmPl.js","names":["hasOwnProperty","isRef","warn","computed","watch","enterCbKey","callHook","compile","camelize$1"],"sources":["../../@vue/shared/dist/shared.esm-bundler.js","../../@vue/reactivity/dist/reactivity.esm-bundler.js","../../@vue/runtime-core/dist/runtime-core.esm-bundler.js","../../@vue/runtime-dom/dist/runtime-dom.esm-bundler.js","../../vue/dist/vue.runtime.esm-bundler.js"],"sourcesContent":["/**\n* @vue/shared v3.5.34\n* (c) 2018-present Yuxi (Evan) You and Vue contributors\n* @license MIT\n**/\n// @__NO_SIDE_EFFECTS__\nfunction makeMap(str) {\n const map = /* @__PURE__ */ Object.create(null);\n for (const key of str.split(\",\")) map[key] = 1;\n return (val) => val in map;\n}\n\nconst EMPTY_OBJ = !!(process.env.NODE_ENV !== \"production\") ? Object.freeze({}) : {};\nconst EMPTY_ARR = !!(process.env.NODE_ENV !== \"production\") ? Object.freeze([]) : [];\nconst NOOP = () => {\n};\nconst NO = () => false;\nconst isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter\n(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);\nconst isModelListener = (key) => key.startsWith(\"onUpdate:\");\nconst extend = Object.assign;\nconst remove = (arr, el) => {\n const i = arr.indexOf(el);\n if (i > -1) {\n arr.splice(i, 1);\n }\n};\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst hasOwn = (val, key) => hasOwnProperty.call(val, key);\nconst isArray = Array.isArray;\nconst isMap = (val) => toTypeString(val) === \"[object Map]\";\nconst isSet = (val) => toTypeString(val) === \"[object Set]\";\nconst isDate = (val) => toTypeString(val) === \"[object Date]\";\nconst isRegExp = (val) => toTypeString(val) === \"[object RegExp]\";\nconst isFunction = (val) => typeof val === \"function\";\nconst isString = (val) => typeof val === \"string\";\nconst isSymbol = (val) => typeof val === \"symbol\";\nconst isObject = (val) => val !== null && typeof val === \"object\";\nconst isPromise = (val) => {\n return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);\n};\nconst objectToString = Object.prototype.toString;\nconst toTypeString = (value) => objectToString.call(value);\nconst toRawType = (value) => {\n return toTypeString(value).slice(8, -1);\n};\nconst isPlainObject = (val) => toTypeString(val) === \"[object Object]\";\nconst isIntegerKey = (key) => isString(key) && key !== \"NaN\" && key[0] !== \"-\" && \"\" + parseInt(key, 10) === key;\nconst isReservedProp = /* @__PURE__ */ makeMap(\n // the leading comma is intentional so empty string \"\" is also included\n \",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted\"\n);\nconst isBuiltInDirective = /* @__PURE__ */ makeMap(\n \"bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo\"\n);\nconst cacheStringFunction = (fn) => {\n const cache = /* @__PURE__ */ Object.create(null);\n return ((str) => {\n const hit = cache[str];\n return hit || (cache[str] = fn(str));\n });\n};\nconst camelizeRE = /-\\w/g;\nconst camelize = cacheStringFunction(\n (str) => {\n return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());\n }\n);\nconst hyphenateRE = /\\B([A-Z])/g;\nconst hyphenate = cacheStringFunction(\n (str) => str.replace(hyphenateRE, \"-$1\").toLowerCase()\n);\nconst capitalize = cacheStringFunction((str) => {\n return str.charAt(0).toUpperCase() + str.slice(1);\n});\nconst toHandlerKey = cacheStringFunction(\n (str) => {\n const s = str ? `on${capitalize(str)}` : ``;\n return s;\n }\n);\nconst hasChanged = (value, oldValue) => !Object.is(value, oldValue);\nconst invokeArrayFns = (fns, ...arg) => {\n for (let i = 0; i < fns.length; i++) {\n fns[i](...arg);\n }\n};\nconst def = (obj, key, value, writable = false) => {\n Object.defineProperty(obj, key, {\n configurable: true,\n enumerable: false,\n writable,\n value\n });\n};\nconst looseToNumber = (val) => {\n const n = parseFloat(val);\n return isNaN(n) ? val : n;\n};\nconst toNumber = (val) => {\n const n = isString(val) ? Number(val) : NaN;\n return isNaN(n) ? val : n;\n};\nlet _globalThis;\nconst getGlobalThis = () => {\n return _globalThis || (_globalThis = typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : {});\n};\nconst identRE = /^[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*$/;\nfunction genPropsAccessExp(name) {\n return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;\n}\nfunction genCacheKey(source, options) {\n return source + JSON.stringify(\n options,\n (_, val) => typeof val === \"function\" ? val.toString() : val\n );\n}\n\nconst PatchFlags = {\n \"TEXT\": 1,\n \"1\": \"TEXT\",\n \"CLASS\": 2,\n \"2\": \"CLASS\",\n \"STYLE\": 4,\n \"4\": \"STLine truncated
|
||||||
+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
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"names":["spaceIndents","i","push","repeat","Buffer","constructor","map","indentChar","_map","_buf","_str","_appendCount","_last","_canMarkIdName","_indentChar","_queuedChar","_position","line","column","_sourcePosition","identifierName","undefined","identifierNamePos","filename","get","_flush","code","trimRight","decodedMap","rawMappings","result","getDecoded","__mergedMap","resultMap","value","Object","defineProperty","writable","mappings","getRawMappings","append","str","maybeNewline","_append","appendChar","char","_appendChar","queue","queuedChar","useSourcePos","indent","String","fromCharCode","isSpace","position","sourcePos","mark","len","length","hasMap","indexOf","last","removeLastSemicolon","getLastChar","checkQueue","getNewlineCount","hasContent","exactSource","loc","cb","source","prop","_normalizePosition","sourceWithOffset","columnOffset","pos","target","Math","max","getCurrentColumn","getCurrentLine","exports","default"],"sources":["../src/buffer.ts"],"sourcesContent":["import type SourceMap from \"./source-map.ts\";\nimport type { SourceLocation } from \"@babel/types\";\n\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charcodes from \"charcodes\";\n\nexport type Loc = SourceLocation;\nexport type Pos = SourceLocation[\"start\"];\n\ntype SourcePosition = {\n line: number | undefined;\n column: number | undefined;\n identifierName: string | undefined;\n identifierNamePos: Pos | undefined;\n filename: string | undefined;\n};\n\nconst spaceIndents: string[] = [];\nfor (let i = 0; i < 32; i++) {\n spaceIndents.push(\" \".repeat(i * 2));\n}\n\nexport default class Buffer {\n constructor(map: SourceMap | null, indentChar: string) {\n this._map = map;\n this._indentChar = indentChar;\n }\n\n _map: SourceMap | null = null;\n _buf = \"\";\n _str = \"\";\n _appendCount = 0;\n _last = 0;\n _canMarkIdName = true;\n _indentChar = \"\";\n _queuedChar: typeof charcodes.space | typeof charcodes.semicolon | 0 = 0;\n\n _position = {\n line: 1,\n column: 0,\n };\n _sourcePosition: SourcePosition = {\n identifierName: undefined,\n identifierNamePos: undefined,\n line: undefined,\n column: undefined,\n filename: undefined,\n };\n\n /**\n * Get the final string output from the buffer, along with the sourcemap if one exists.\n */\n\n get() {\n const { _map, _last } = this;\n if (this._queuedChar !== charcodes.space) {\n this._flush();\n }\n\n // Whatever trim is used here should not execute a regex against the\n // source string since it may be arbitrarily large after all transformations\n const code =\n _last === charcodes.lineFeed\n ? (this._buf + this._str).trimRight()\n : this._buf + this._str;\n\n // Creating objects with getters is expensive.\n if (_map === null) {\n return {\n code: code,\n decodedMap: undefined,\n map: null,\n rawMappings: undefined,\n };\n }\n\n const result = {\n code: code,\n // Decoded sourcemap is free to generate.\n decodedMap: _map.getDecoded(),\n // Used as a marker for backwards compatibility. We moved input map merging\n // into the generator. We cannot merge the input map a second time, so the\n // presence of this field tells us we've already done the work.\n get __mergedMap() {\n return this.map;\n },\n // Encoding the sourcemap is moderately CPU expensive.\n get map() {\n const resultMap = _map.get();\n result.map = resultMap;\n return resultMap;\n },\n set map(value) {\n Object.defineProperty(result, \"map\", { value, writable: true });\n },\n // Retrieving the raw mappings is very memory intensive.\n get rawMappings() {\n const mappings = _map.getRawMappings();\n result.rawMappings = mappings;\n return mappings;\n },\n set rawMappings(value) {\n Object.defineProperty(result, \"rawMappings\", { value, writable: true });\n },\n };\n\n return result;\n }\n\n /**\n * Add a string to the buffer that cannot be reverted.\n */\n\n append(str: string, maybeNewline: boolean): void {\n this._flush();\n this._append(str, maybeNewline);\n }\n\n appendChar(char: number): void {\n this._flush();\n this._appendChar(char, 1, true);\n }\n\n /**\n * Add a string to the buffer than can be reverted.\n */\n queue(char: typeof charcodes.space | typeof charcodes.semicolon): void {\n this._flush();\n this._queuedChar = char;\n }\n\n _flush(): void {\n const queuedChar = this._queuedChar;\n if (queuedChar !== 0) {\n this._appendChar(queuedChar, 1, true);\n this._queuedChar = 0;\n }\n }\n\n _appendChar(char: number, repeat: number, useSourcePos: boolean): void {\n this._last = char;\n\n if (char === -1) {\n const indent =\n repeat >= 64\n ? this._indentCLine truncated
|
||||||
+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
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"names":["File","node","program","print","interpreter","Program","_node$directives","printInnerComments","directivesLen","directives","length","_node$directives$trai","newline","body","printSequence","undefined","trailingComments","BlockStatement","_node$directives2","token","oldNoLineTerminatorAfterNode","enterDelimited","_node$directives$trai2","_noLineTerminatorAfterNode","rightBrace","Directive","value","semicolon","unescapedSingleQuoteRE","unescapedDoubleQuoteRE","DirectiveLiteral","raw","getPossibleRaw","format","minified","test","Error","InterpreterDirective","_newline","Placeholder","name","expectedNode"],"sources":["../../src/generators/base.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport type * as t from \"@babel/types\";\n\nexport function File(this: Printer, node: t.File) {\n if (node.program) {\n // Print this here to ensure that Program node 'leadingComments' still\n // get printed after the hashbang.\n this.print(node.program.interpreter);\n }\n\n this.print(node.program);\n}\n\nexport function Program(this: Printer, node: t.Program) {\n // An empty Program doesn't have any inner tokens, so\n // we must explicitly print its inner comments.\n this.printInnerComments(false);\n\n const directivesLen = node.directives?.length;\n if (directivesLen) {\n const newline = node.body.length ? 2 : 1;\n this.printSequence(node.directives, undefined, undefined, newline);\n if (!node.directives[directivesLen - 1].trailingComments?.length) {\n this.newline(newline);\n }\n }\n\n this.printSequence(node.body);\n}\n\nexport function BlockStatement(this: Printer, node: t.BlockStatement) {\n this.token(\"{\");\n const oldNoLineTerminatorAfterNode = this.enterDelimited();\n\n const directivesLen = node.directives?.length;\n if (directivesLen) {\n const newline = node.body.length ? 2 : 1;\n this.printSequence(node.directives, true, true, newline);\n if (!node.directives[directivesLen - 1].trailingComments?.length) {\n this.newline(newline);\n }\n }\n\n this.printSequence(node.body, true, true);\n\n this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;\n this.rightBrace(node);\n}\n\nexport function Directive(this: Printer, node: t.Directive) {\n this.print(node.value);\n this.semicolon();\n}\n\n// These regexes match an even number of \\ followed by a quote\nconst unescapedSingleQuoteRE = /(?:^|[^\\\\])(?:\\\\\\\\)*'/;\nconst unescapedDoubleQuoteRE = /(?:^|[^\\\\])(?:\\\\\\\\)*\"/;\n\nexport function DirectiveLiteral(this: Printer, node: t.DirectiveLiteral) {\n const raw = this.getPossibleRaw(node);\n if (!this.format.minified && raw !== undefined) {\n this.token(raw);\n return;\n }\n\n const { value } = node;\n\n // NOTE: In directives we can't change escapings,\n // because they change the behavior.\n // e.g. \"us\\x65 strict\" (\\x65 is e) is not a \"use strict\" directive.\n\n if (!unescapedDoubleQuoteRE.test(value)) {\n this.token(`\"${value}\"`);\n } else if (!unescapedSingleQuoteRE.test(value)) {\n this.token(`'${value}'`);\n } else {\n throw new Error(\n \"Malformed AST: it is not possible to print a directive containing\" +\n \" both unescaped single and double quotes.\",\n );\n }\n}\n\nexport function InterpreterDirective(\n this: Printer,\n node: t.InterpreterDirective,\n) {\n this.token(`#!${node.value}`);\n this._newline();\n}\n\nexport function Placeholder(this: Printer, node: t.Placeholder) {\n this.token(\"%%\");\n this.print(node.name);\n this.token(\"%%\");\n\n if (node.expectedNode === \"Statement\") {\n this.semicolon();\n }\n}\n"],"mappings":";;;;;;;;;;;;AAGO,SAASA,IAAIA,CAAgBC,IAAY,EAAE;EAChD,IAAIA,IAAI,CAACC,OAAO,EAAE;IAGhB,IAAI,CAACC,KAAK,CAACF,IAAI,CAACC,OAAO,CAACE,WAAW,CAAC;EACtC;EAEA,IAAI,CAACD,KAAK,CAACF,IAAI,CAACC,OAAO,CAAC;AAC1B;AAEO,SAASG,OAAOA,CAAgBJ,IAAe,EAAE;EAAA,IAAAK,gBAAA;EAGtD,IAAI,CAACC,kBAAkB,CAAC,KAAK,CAAC;EAE9B,MAAMC,aAAa,IAAAF,gBAAA,GAAGL,IAAI,CAACQ,UAAU,qBAAfH,gBAAA,CAAiBI,MAAM;EAC7C,IAAIF,aAAa,EAAE;IAAA,IAAAG,qBAAA;IACjB,MAAMC,OAAO,GAAGX,IAAI,CAACY,IAAI,CAACH,MAAM,GAAG,CAAC,GAAG,CAAC;IACxC,IAAI,CAACI,aAAa,CAACb,IAAI,CAACQ,UAAU,EAAEM,SAAS,EAAEA,SAAS,EAAEH,OAAO,CAAC;IAClE,IAAI,GAAAD,qBAAA,GAACV,IAAI,CAACQ,UAAU,CAACD,aAAa,GAAG,CAAC,CAAC,CAACQ,gBAAgB,aAAnDL,qBAAA,CAAqDD,MAAM,GAAE;MAChE,IAAI,CAACE,OAAO,CAACA,OAAO,CAAC;IACvB;EACF;EAEA,IAAI,CAACE,aAAa,CAACb,IAAI,CAACY,IAAI,CAAC;AAC/B;AAEO,SAASI,cAAcA,CAAgBhB,IAAsB,EAAE;EAAA,IAAAiB,iBAAA;EACpE,IAAI,CAACC,SAAK,IAAI,CAAC;EACf,MAAMC,4BAA4B,GAAG,IAAI,CAACC,cAAc,CAAC,CAAC;EAE1D,MAAMb,aAAa,IAAAU,iBAAA,GAAGjB,IAAI,CAACQ,UAAU,qBAAfS,iBAAA,CAAiBR,MAAM;EAC7C,IAAIF,aAAa,EAAE;IAAA,IAAAc,sBAAA;IACjB,MAAMV,OAAO,GAAGX,IAAI,CAACY,IAAI,CAACH,MAAM,GAAG,CAAC,GAAG,CAAC;IACxC,IAAI,CAACI,aAAa,CAACb,IAAI,CAACQ,UAAU,EAAE,IAAI,EAAE,IAAI,EAAEG,OAAO,CAAC;IACxD,IAAI,GAAAU,sBAAA,GAACrB,IAAI,CAACQ,UAAU,CAACD,aAAa,GAAG,CAAC,CAAC,CAACQ,gBAAgB,aAAnDM,sBAAA,CAAqDZ,MAAM,GAAE;MAChE,IAAI,CAACE,OAAO,CALine truncated
|
||||||
+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
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"names":["_t","require","_expressions","_typescript","_flow","_methods","isExportDefaultDeclaration","isExportNamedDeclaration","ClassDeclaration","node","parent","inExport","_shouldPrintDecoratorsBeforeExport","call","printJoin","decorators","declare","word","space","abstract","id","print","typeParameters","superClass","superTypeParameters","implements","printList","body","ClassBody","token","length","separator","classBodyEmptySemicolonsPrinter","oldNoLineTerminatorAfterNode","enterDelimited","_noLineTerminatorAfterNode","endsWith","newline","rightBrace","printer","tokenMap","start","end","indexes","getIndexes","k","occurrenceCount","nextLocIndex","advanceNextLocIndex","i","tok","matchesOriginal","_tokens","tokenChar","ClassProperty","static","format","preserveFormat","_node$key$loc","endLine","key","loc","line","catchUp","_tsPrintClassMemberModifiers","computed","_variance","optional","definite","typeAnnotation","value","semicolon","ClassAccessorProperty","_node$key$loc2","ClassPrivateProperty","ClassMethod","_classMethodHead","ClassPrivateMethod","_node$key$loc3","_methodHead","StaticBlock","printSequence"],"sources":["../../src/generators/classes.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport {\n isExportDefaultDeclaration,\n isExportNamedDeclaration,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\nimport { _shouldPrintDecoratorsBeforeExport } from \"./expressions.ts\";\nimport { _tsPrintClassMemberModifiers } from \"./typescript.ts\";\nimport { _variance } from \"./flow.ts\";\nimport { _methodHead } from \"./methods.ts\";\n\nexport function ClassDeclaration(\n this: Printer,\n node: t.ClassDeclaration,\n parent: t.Node,\n) {\n const inExport =\n isExportDefaultDeclaration(parent) || isExportNamedDeclaration(parent);\n\n if (\n !inExport ||\n !_shouldPrintDecoratorsBeforeExport.call(\n this,\n parent as t.ExportDeclaration & { declaration: t.ClassDeclaration },\n )\n ) {\n this.printJoin(node.decorators);\n }\n\n if (node.declare) {\n // TS\n this.word(\"declare\");\n this.space();\n }\n\n if (node.abstract) {\n // TS\n this.word(\"abstract\");\n this.space();\n }\n\n this.word(\"class\");\n\n if (node.id) {\n this.space();\n this.print(node.id);\n }\n\n this.print(node.typeParameters);\n\n if (node.superClass) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.print(node.superClass);\n this.print(\n process.env.BABEL_8_BREAKING\n ? // @ts-ignore(Babel 7 vs Babel 8) Renamed\n node.superTypeArguments\n : // @ts-ignore(Babel 7 vs Babel 8) Renamed\n node.superTypeParameters,\n );\n }\n\n if (node.implements) {\n this.space();\n this.word(\"implements\");\n this.space();\n this.printList(node.implements);\n }\n\n this.space();\n this.print(node.body);\n}\n\nexport { ClassDeclaration as ClassExpression };\n\nexport function ClassBody(this: Printer, node: t.ClassBody) {\n this.token(\"{\");\n if (node.body.length === 0) {\n this.token(\"}\");\n } else {\n const separator = classBodyEmptySemicolonsPrinter(this, node);\n separator?.(-1); // print leading semicolons in preserveFormat mode\n\n const oldNoLineTerminatorAfterNode = this.enterDelimited();\n this.printJoin(node.body, true, true, separator, true, true);\n this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;\n\n if (!this.endsWith(charCodes.lineFeed)) this.newline();\n\n this.rightBrace(node);\n }\n}\n\nfunction classBodyEmptySemicolonsPrinter(printer: Printer, node: t.ClassBody) {\n if (!printer.tokenMap || node.start == null || node.end == null) {\n return null;\n }\n\n // \"empty statements\" in class bodies are not represented in the AST.\n // Print them by checking if there are any ; tokens between the current AST\n // member and the next one.\n\n const indexes = printer.tokenMap.getIndexes(node);\n if (!indexes) return null;\n\n let k = 1; // start from 1 to skip '{'\n\n let occurrenceCount = 0;\n\n let nextLocIndex = 0;\n const advanceNextLocIndex = () => {\n while (\n nextLocIndex < node.body.length &&\n node.body[nextLocIndex].start == null\n ) {\n nextLocIndex++;\n }\n };\n advanceNextLocIndex();\n\n return (i: number) => {\n if (nextLocIndex <= i) {\n nextLocIndex = i + 1;\n advanceNextLocIndex();\n }\n\n const end =\n nextLocIndex === node.body.length\n ? node.end\n : node.body[nextLocIndex].start;\n\n let tok;\n while (\n k < indexes.length &&\n printer.tokenMap!.matchesOriginal(\n (tok = printer._tokens![indexes[k]]),\n \";\",\n ) &&\n tok.start < end!\n ) {\n printer.tokenChar(charCodes.semicolon, occurrenceCount++);\n k+Line truncated
|
||||||
+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
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"names":["Noop","TSExpressionWithTypeArguments","node","print","expression","typeParameters","DecimalLiteral","raw","getPossibleRaw","format","minified","undefined","word","value","RecordExpression","props","properties","startToken","endToken","recordAndTupleSyntaxType","Error","JSON","stringify","token","length","space","printList","shouldPrintTrailingComma","TupleExpression","elems","elements","len","i","elem"],"sources":["../../src/generators/deprecated.ts"],"sourcesContent":["import type Printer from \"../printer\";\nimport type * as t from \"@babel/types\";\n\nexport type DeprecatedBabel7ASTTypes =\n | \"Noop\"\n | \"TSExpressionWithTypeArguments\"\n | \"DecimalLiteral\"\n | \"RecordExpression\"\n | \"TupleExpression\";\n\nexport function Noop(this: Printer) {}\n\nexport function TSExpressionWithTypeArguments(\n this: Printer,\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n node: t.TSExpressionWithTypeArguments,\n) {\n this.print(node.expression);\n this.print(node.typeParameters);\n}\n\nexport function DecimalLiteral(this: Printer, node: any) {\n const raw = this.getPossibleRaw(node);\n if (!this.format.minified && raw !== undefined) {\n this.word(raw);\n return;\n }\n this.word(node.value + \"m\");\n}\n\n// @ts-ignore(Babel 7 vs Babel 8) - t.RecordExpression only exists in Babel 7\nexport function RecordExpression(this: Printer, node: t.RecordExpression) {\n const props = node.properties;\n\n let startToken;\n let endToken;\n\n if (this.format.recordAndTupleSyntaxType === \"bar\") {\n startToken = \"{|\";\n endToken = \"|}\";\n } else if (\n this.format.recordAndTupleSyntaxType !== \"hash\" &&\n this.format.recordAndTupleSyntaxType != null\n ) {\n throw new Error(\n `The \"recordAndTupleSyntaxType\" generator option must be \"bar\" or \"hash\" (${JSON.stringify(\n this.format.recordAndTupleSyntaxType,\n )} received).`,\n );\n } else {\n startToken = \"#{\";\n endToken = \"}\";\n }\n\n this.token(startToken);\n\n if (props.length) {\n this.space();\n this.printList(props, this.shouldPrintTrailingComma(endToken), true, true);\n this.space();\n }\n this.token(endToken);\n}\n\n// @ts-ignore(Babel 7 vs Babel 8) - t.TupleExpression only exists in Babel 7\nexport function TupleExpression(this: Printer, node: t.TupleExpression) {\n const elems = node.elements;\n const len = elems.length;\n\n let startToken;\n let endToken;\n if (process.env.BABEL_8_BREAKING) {\n startToken = \"#[\";\n endToken = \"]\";\n } else {\n if (this.format.recordAndTupleSyntaxType === \"bar\") {\n startToken = \"[|\";\n endToken = \"|]\";\n } else if (this.format.recordAndTupleSyntaxType === \"hash\") {\n startToken = \"#[\";\n endToken = \"]\";\n } else {\n throw new Error(\n `${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`,\n );\n }\n }\n\n this.token(startToken);\n\n for (let i = 0; i < elems.length; i++) {\n const elem = elems[i];\n if (elem) {\n if (i > 0) this.space();\n this.print(elem);\n if (i < len - 1 || this.shouldPrintTrailingComma(endToken)) {\n this.token(\",\", false, i);\n }\n }\n }\n\n this.token(endToken);\n}\n"],"mappings":";;;;;;;;;;AAUO,SAASA,IAAIA,CAAA,EAAgB,CAAC;AAE9B,SAASC,6BAA6BA,CAG3CC,IAAqC,EACrC;EACA,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,UAAU,CAAC;EAC3B,IAAI,CAACD,KAAK,CAACD,IAAI,CAACG,cAAc,CAAC;AACjC;AAEO,SAASC,cAAcA,CAAgBJ,IAAS,EAAE;EACvD,MAAMK,GAAG,GAAG,IAAI,CAACC,cAAc,CAACN,IAAI,CAAC;EACrC,IAAI,CAAC,IAAI,CAACO,MAAM,CAACC,QAAQ,IAAIH,GAAG,KAAKI,SAAS,EAAE;IAC9C,IAAI,CAACC,IAAI,CAACL,GAAG,CAAC;IACd;EACF;EACA,IAAI,CAACK,IAAI,CAACV,IAAI,CAACW,KAAK,GAAG,GAAG,CAAC;AAC7B;AAGO,SAASC,gBAAgBA,CAAgBZ,IAAwB,EAAE;EACxE,MAAMa,KAAK,GAAGb,IAAI,CAACc,UAAU;EAE7B,IAAIC,UAAU;EACd,IAAIC,QAAQ;EAEZ,IAAI,IAAI,CAACT,MAAM,CAACU,wBAAwB,KAAK,KAAK,EAAE;IAClDF,UAAU,GAAG,IAAI;IACjBC,QAAQ,GAAG,IAAI;EACjB,CAAC,MAAM,IACL,IAAI,CAACT,MAAM,CAACU,wBAAwB,KAAK,MAAM,IAC/C,IAAI,CAACV,MAAM,CAACU,wBAAwB,IAAI,IAAI,EAC5C;IACA,MAAM,IAAIC,KAAK,CACb,4EAA4EC,IAAI,CAACC,SAAS,CACxF,IAAI,CAACb,MAAM,CAACU,wBACd,CAAC,aACH,CAAC;EACH,CAAC,MAAM;IACLF,UAAU,GAAG,IAAI;IACjBC,QAAQ,GAAG,GAAG;EAChB;EAEA,IAAI,CAACK,KAAK,CAACN,UAAU,CAAC;EAEtB,IAAIF,KAAK,CAACS,MAAM,EAAE;IAChB,IAAI,CAACC,KAAK,CAAC,CAAC;IACZ,IAAI,CAACC,SAAS,CAACX,KAAK,EAAE,IAAI,CAACY,wBAAwB,CAACT,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAC1E,IAAI,CAACO,KAAK,CAAC,CAAC;EACd;EACA,IAAI,CAACF,KAAK,CAACL,QAAQ,CAAC;AACtB;AAGO,SAASU,eAAeA,CAAgB1B,IAAuB,EAAE;EACtE,MAAM2B,KAAK,GAAG3B,IAAI,CAAC4B,QAAQ;EAC3B,MAAMC,GAAG,GAAGF,KAAK,CAACL,MAAM;EAExB,IAAIP,UAAU;EACd,IAAIC,QAAQ;EAKV,IAAI,IAAI,CAACT,MAAM,CAACU,wBAAwB,KAAK,KAAK,EAAE;IAClDF,UAAU,GAAG,IAAI;IACjBC,QAAQ,GAAG,IAAI;EACjB,CAAC,MAAM,IAAI,IAAI,CAACT,MAAM,CAACU,wBAAwB,KAAK,MAAM,EAAE;IAC1DF,UAAU,GAAG,IAAI;IACjBC,QAAQ,GAAG,GAAG;EAChB,CAAC,MAAM;IACL,MAAM,IAAIE,KAAK,CACb,GAAG,IAAI,CAACX,MAAM,CAACU,wBAAwB,4CACzC,CAAC;EACH;EAGF,IAAI,CAACI,KAAK,CAACN,ULine truncated
|
||||||
+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
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"names":["_t","require","_index","isCallExpression","isLiteral","isMemberExpression","isNewExpression","isPattern","UnaryExpression","node","operator","firstChar","charCodeAt","word","space","tokenChar","print","argument","DoExpression","async","body","ParenthesizedExpression","token","oldNoLineTerminatorAfterNode","enterDelimited","expression","undefined","_noLineTerminatorAfterNode","rightParens","UpdateExpression","prefix","ConditionalExpression","test","consequent","alternate","NewExpression","parent","callee","format","minified","arguments","length","optional","typeArguments","typeParameters","tokenMap","endMatches","printList","shouldPrintTrailingComma","SequenceExpression","expressions","ThisExpression","Super","_shouldPrintDecoratorsBeforeExport","decoratorsBeforeExport","start","declaration","Decorator","newline","OptionalMemberExpression","computed","property","object","TypeError","value","OptionalCallExpression","CallExpression","Import","AwaitExpression","YieldExpression","delegate","EmptyStatement","semicolon","ExpressionStatement","tokenContext","TokenContext","expressionStatement","AssignmentPattern","left","type","typeAnnotation","right","AssignmentExpression","BinaryExpression","setLastChar","BindExpression","MemberExpression","MetaProperty","meta","PrivateName","id","V8IntrinsicIdentifier","name","ModuleExpression","indent","directives","dedent","rightBrace"],"sources":["../../src/generators/expressions.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport {\n isCallExpression,\n isLiteral,\n isMemberExpression,\n isNewExpression,\n isPattern,\n} from \"@babel/types\";\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\nimport type * as t from \"@babel/types\";\nimport { TokenContext } from \"../node/index.ts\";\n\nexport function UnaryExpression(this: Printer, node: t.UnaryExpression) {\n const { operator } = node;\n const firstChar = operator.charCodeAt(0);\n if (firstChar >= charCodes.lowercaseA && firstChar <= charCodes.lowercaseZ) {\n this.word(operator);\n this.space();\n } else {\n this.tokenChar(firstChar);\n }\n\n this.print(node.argument);\n}\n\nexport function DoExpression(this: Printer, node: t.DoExpression) {\n if (node.async) {\n this.word(\"async\", true);\n this.space();\n }\n this.word(\"do\");\n this.space();\n this.print(node.body);\n}\n\nexport function ParenthesizedExpression(\n this: Printer,\n node: t.ParenthesizedExpression,\n) {\n this.token(\"(\");\n const oldNoLineTerminatorAfterNode = this.enterDelimited();\n this.print(node.expression, undefined, true);\n this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;\n this.rightParens(node);\n}\n\nexport function UpdateExpression(this: Printer, node: t.UpdateExpression) {\n if (node.prefix) {\n this.token(node.operator, false, 0, true);\n this.print(node.argument);\n } else {\n this.print(node.argument, true);\n this.token(node.operator, false, 0, true);\n }\n}\n\nexport function ConditionalExpression(\n this: Printer,\n node: t.ConditionalExpression,\n) {\n this.print(node.test);\n this.space();\n this.token(\"?\");\n this.space();\n this.print(node.consequent);\n this.space();\n this.token(\":\");\n this.space();\n this.print(node.alternate);\n}\n\nexport function NewExpression(\n this: Printer,\n node: t.NewExpression,\n parent: t.Node,\n) {\n this.word(\"new\");\n this.space();\n this.print(node.callee);\n if (\n this.format.minified &&\n node.arguments.length === 0 &&\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n !node.optional &&\n !isCallExpression(parent, { callee: node }) &&\n !isMemberExpression(parent) &&\n !isNewExpression(parent)\n ) {\n return;\n }\n\n this.print(node.typeArguments);\n if (!process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n this.print(node.typeParameters); // Legacy TS AST\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n if (node.optional) {\n this.token(\"?.\");\n }\n }\n\n if (\n node.arguments.length === 0 &&\n this.tokenMap &&\n !this.tokenMap.endMatches(node, \")\")\n ) {\n return;\n }\n\n this.token(\"(\");\n const oldNoLineTerminatorAfterNode = this.enterDelimited();\n this.printList(\n node.arguments,\n this.shouldPrintTrailingComma(\")\"),\n undefined,\n undefined,\n undefined,\n true,\n );\n this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;\n this.rightParens(node);\n}\n\nexport function SequenceExpression(this: Printer, node: t.SequenceExpression) {\n this.printList(node.expressions);\n}\n\nexport function ThisExpression(this: Printer) {\n this.word(\"this\");\n}\n\nexport function Super(this: Printer) {\n this.word(\"super\");\n}\n\nexport function _shouldPrintDecoratorsBeforeExport(\n this: Printer,\n node: t.ExportDeclLine truncated
|
||||||
+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
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"names":["_t","require","_modules","_index","_types2","isDeclareExportDeclaration","isStatement","AnyTypeAnnotation","word","ArrayTypeAnnotation","node","print","elementType","token","BooleanTypeAnnotation","BooleanLiteralTypeAnnotation","value","NullLiteralTypeAnnotation","DeclareClass","parent","space","_interfaceish","call","DeclareFunction","id","typeAnnotation","predicate","semicolon","InferredPredicate","DeclaredPredicate","DeclareInterface","InterfaceDeclaration","DeclareModule","body","DeclareModuleExports","DeclareTypeAlias","TypeAlias","DeclareOpaqueType","OpaqueType","DeclareVariable","DeclareExportDeclaration","default","FlowExportDeclaration","DeclareExportAllDeclaration","ExportAllDeclaration","EnumDeclaration","enumExplicitType","context","name","hasExplicitType","enumBody","members","indent","newline","member","hasUnknownMembers","dedent","EnumBooleanBody","explicitType","EnumNumberBody","EnumStringBody","EnumSymbolBody","EnumDefaultedMember","enumInitializedMember","init","EnumBooleanMember","EnumNumberMember","EnumStringMember","declaration","declar","specifiers","length","printList","source","ExistsTypeAnnotation","FunctionTypeAnnotation","typeParameters","this","params","rest","type","method","returnType","FunctionTypeParam","optional","InterfaceExtends","_node$extends","extends","_node$mixins","_node$implements","mixins","implements","_variance","_node$variance","kind","variance","andSeparator","occurrenceCount","InterfaceTypeAnnotation","_node$extends2","IntersectionTypeAnnotation","printJoin","types","undefined","MixedTypeAnnotation","EmptyTypeAnnotation","NullableTypeAnnotation","NumberTypeAnnotation","StringTypeAnnotation","ThisTypeAnnotation","TupleTypeAnnotation","TypeofTypeAnnotation","argument","right","TypeAnnotation","tokenContext","TokenContext","arrowFlowReturnType","TypeParameterInstantiation","TypeParameter","bound","supertype","impltype","ObjectTypeAnnotation","exact","props","properties","callProperties","indexers","internalSlots","inexact","ObjectTypeInternalSlot","static","ObjectTypeCallProperty","ObjectTypeIndexer","key","ObjectTypeProperty","proto","ObjectTypeSpreadProperty","QualifiedTypeIdentifier","qualification","SymbolTypeAnnotation","orSeparator","UnionTypeAnnotation","TypeCastExpression","expression","Variance","VoidTypeAnnotation","IndexedAccessType","objectType","indexType","OptionalIndexedAccessType"],"sources":["../../src/generators/flow.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport { isDeclareExportDeclaration, isStatement } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport { ExportAllDeclaration } from \"./modules.ts\";\nimport { TokenContext } from \"../node/index.ts\";\n\nexport function AnyTypeAnnotation(this: Printer) {\n this.word(\"any\");\n}\n\nexport function ArrayTypeAnnotation(\n this: Printer,\n node: t.ArrayTypeAnnotation,\n) {\n this.print(node.elementType, true);\n this.token(\"[\");\n this.token(\"]\");\n}\n\nexport function BooleanTypeAnnotation(this: Printer) {\n this.word(\"boolean\");\n}\n\nexport function BooleanLiteralTypeAnnotation(\n this: Printer,\n node: t.BooleanLiteralTypeAnnotation,\n) {\n this.word(node.value ? \"true\" : \"false\");\n}\n\nexport function NullLiteralTypeAnnotation(this: Printer) {\n this.word(\"null\");\n}\n\nexport function DeclareClass(\n this: Printer,\n node: t.DeclareClass,\n parent: t.Node,\n) {\n if (!isDeclareExportDeclaration(parent)) {\n this.word(\"declare\");\n this.space();\n }\n this.word(\"class\");\n this.space();\n _interfaceish.call(this, node);\n}\n\nexport function DeclareFunction(\n this: Printer,\n node: t.DeclareFunction,\n parent: t.Node,\n) {\n if (!isDeclareExportDeclaration(parent)) {\n this.word(\"declare\");\n this.space();\n }\n this.word(\"function\");\n this.space();\n this.print(node.id);\n // @ts-ignore(Babel 7 vs Babel 8) TODO(Babel 8) Remove this comment, since we'll remove the Noop node\n this.print(node.id.typeAnnotation.typeAnnotation);\n\n if (node.predicate) {\n this.space();\n this.print(node.predicate);\n }\n\n this.semicolon();\n}\n\nexport function InferredPredicate(this: Printer) {\n this.token(\"%\");\n this.word(\"checks\");\n}\n\nexport function DeclaredPredicate(this: Printer, node: t.DeclaredPredicate) {\n this.token(\"%\");\n this.word(\"checks\");\n this.token(\"(\");\n this.print(node.value);\n this.token(\")\");\n}\n\nexport function DeclareInterface(this: Printer, node: t.DeclareInterface) {\n this.word(\"declare\");\n this.space();\n InterfaceDeclaration.call(this, node);\n}\n\nexport function DeclareModule(this: Printer, node: t.DeclareModule) {\n this.word(\"declare\");\n this.space();\n this.word(\"module\");\n this.space();\n this.print(node.id);\n this.space();\n this.print(node.body);\n}\n\nexport function DeclareModuleExports(\n this: Printer,\n node: t.DeclareModuleExports,\n) {\n this.word(\"declare\");\n thLine truncated
|
||||||
Loaded 100 of 8368 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user