Compare commits
No commits in common. "1b9f2dde5e9844555d7ee1ab874fdbc040d8f453" and "c91124ead46e5ef9b4e3478340b71847404b5ae5" have entirely different histories.
1b9f2dde5e
...
c91124ead4
14
.gitignore
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# ---> VisualStudioCode
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
!.vscode/*.code-snippets
|
||||||
|
|
||||||
|
# Local History for Visual Studio Code
|
||||||
|
.history/
|
||||||
|
|
||||||
|
# Built Visual Studio Code Extensions
|
||||||
|
*.vsix
|
||||||
|
|
@ -1,24 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
root: true,
|
|
||||||
env: { browser: true, es2020: true },
|
|
||||||
extends: [
|
|
||||||
'airbnb-base',
|
|
||||||
'plugin:react/recommended',
|
|
||||||
'plugin:react/jsx-runtime',
|
|
||||||
'plugin:react-hooks/recommended',
|
|
||||||
],
|
|
||||||
ignorePatterns: ['dist', '.eslintrc.cjs'],
|
|
||||||
parserOptions: { ecmaVersion: 12, sourceType: 'module' },
|
|
||||||
settings: { react: { version: '18.2' } },
|
|
||||||
plugins: ['react-refresh'],
|
|
||||||
rules: {
|
|
||||||
'react-refresh/only-export-components': [
|
|
||||||
'warn',
|
|
||||||
{ allowConstantExport: true },
|
|
||||||
],
|
|
||||||
'indent': 'off',
|
|
||||||
'no-console': 'off',
|
|
||||||
'arrow-body-style': 'off',
|
|
||||||
'implicit-arrow-linebreak': 'off',
|
|
||||||
},
|
|
||||||
}
|
|
20
IP/.eslintrc.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es2021": true
|
||||||
|
},
|
||||||
|
"extends": "airbnb-base",
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 12,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"quotes": "off",
|
||||||
|
"indent": "off",
|
||||||
|
"no-console": "off",
|
||||||
|
"no-use-before-define": "off",
|
||||||
|
"no-alert": "off",
|
||||||
|
"no-restricted-globals": "off",
|
||||||
|
"quote-props": "off"
|
||||||
|
}
|
||||||
|
}
|
24
IP/.gitignore
vendored
@ -1,24 +0,0 @@
|
|||||||
# Logs
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
pnpm-debug.log*
|
|
||||||
lerna-debug.log*
|
|
||||||
|
|
||||||
node_modules
|
|
||||||
dist
|
|
||||||
dist-ssr
|
|
||||||
*.local
|
|
||||||
|
|
||||||
# Editor directories and files
|
|
||||||
.vscode/*
|
|
||||||
!.vscode/extensions.json
|
|
||||||
.idea
|
|
||||||
.DS_Store
|
|
||||||
*.suo
|
|
||||||
*.ntvs*
|
|
||||||
*.njsproj
|
|
||||||
*.sln
|
|
||||||
*.sw?
|
|
17
IP/.vscode/launch.json
vendored
@ -1,21 +1,14 @@
|
|||||||
{
|
{
|
||||||
// Use IntelliSense to learn about possible attributes.
|
// Используйте IntelliSense, чтобы узнать о возможных атрибутах.
|
||||||
// Hover to view descriptions of existing attributes.
|
// Наведите указатель мыши, чтобы просмотреть описания существующих атрибутов.
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
// Для получения дополнительной информации посетите: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"type": "chrome",
|
"type": "chrome",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "Launch Chrome",
|
"name": "Запустить Chrome на localhost",
|
||||||
"url": "http://localhost:5173",
|
"url": "http://localhost:8080",
|
||||||
"webRoot": "${workspaceFolder}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "chrome",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "Launch Edge",
|
|
||||||
"url": "http://localhost:5173",
|
|
||||||
"webRoot": "${workspaceFolder}"
|
"webRoot": "${workspaceFolder}"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Before Width: | Height: | Size: 667 KiB After Width: | Height: | Size: 667 KiB |
Before Width: | Height: | Size: 503 KiB After Width: | Height: | Size: 503 KiB |
Before Width: | Height: | Size: 854 KiB After Width: | Height: | Size: 854 KiB |
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 2.5 MiB |
Before Width: | Height: | Size: 678 KiB After Width: | Height: | Size: 678 KiB |
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 2.5 MiB |
41
IP/data.json
Normal file
125
IP/index.html
@ -1,15 +1,122 @@
|
|||||||
<html lang="ru">
|
<html lang="ru">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="utf-8">
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<title>YourHome</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>My shop</title>
|
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||||
|
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
|
||||||
|
<link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet"/>
|
||||||
|
<link rel="stylesheet" href="./style.css">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body class="h-100 d-flex flex-column">
|
||||||
<div id="root" class="h-100 d-flex flex-column"></div>
|
<main class="container-fluid">
|
||||||
<script type="module" src="/src/main.jsx"></script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="text-center">
|
||||||
|
<div id="myCarousel" class="carousel slide" data-bs-ride="carousel">
|
||||||
|
<div class="carousel-inner">
|
||||||
|
<div class="carousel-item active">
|
||||||
|
<img src="1pic.jpg" class="d-block w-100" alt="Slide 1">
|
||||||
|
</div>
|
||||||
|
<div class="carousel-item">
|
||||||
|
<img src="2pic.jpg" class="d-block w-100" alt="Slide 2">
|
||||||
|
</div>
|
||||||
|
<div class="carousel-item">
|
||||||
|
<img src="3pic.jpg" class="d-block w-100" alt="Slide 3">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button class="carousel-control-prev" type="button" data-bs-target="#myCarousel" data-bs-slide="prev">
|
||||||
|
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||||
|
<span class="visually-hidden">Previous</span>
|
||||||
|
</button>
|
||||||
|
<button class="carousel-control-next" type="button" data-bs-target="#myCarousel" data-bs-slide="next">
|
||||||
|
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||||
|
<span class="visually-hidden">Next</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="text-center">
|
||||||
|
<header class="header1-fluid">
|
||||||
|
<nav class="navbar navbar-expand-md navbar-dark">
|
||||||
|
<a class="navbar-brand" href="/">
|
||||||
|
<i class="fa-solid fa-house-chimney"></i>
|
||||||
|
YourHome
|
||||||
|
</a>
|
||||||
|
<!-- Кнопка, которая поялвяется при узком экране и позволяте развернуть навигационное меню-->
|
||||||
|
<button class="navbar-toggler custom-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
|
||||||
|
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span> <!-- Иконка навигационного меню-->>
|
||||||
|
</button>
|
||||||
|
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
|
||||||
|
<div class="navbar-nav">
|
||||||
|
<a class="nav-link active" href="./index.html">Главная</a>
|
||||||
|
<a class="nav-link" href="./page2.html">Магазин</a>
|
||||||
|
<a class="nav-link" href="./page4.html">О нас</a>
|
||||||
|
<a class="nav-link" href="./page3.html">Войти</a>
|
||||||
|
<a class="nav-link" href="./page8.html">Администратору</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
<h1>Поможем подобрать для Вас жильё!</h1>
|
||||||
|
<a href="./page2.html" class="btn btn-info text-white custom-rounded-btn btn-lg btn-custom">Узнать подробнее</a>
|
||||||
|
<div class="container mt-5">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="card mb-4 h-10">
|
||||||
|
<img src="prod1.jpg" class="card-img-top custom-image" alt="Product Image">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title text-truncate">Дом «Лебедь»</h5>
|
||||||
|
<ul class="list-group list-group-flush">
|
||||||
|
<li class="list-group-item"><strong>Площадь дома:</strong> 220 м2</li>
|
||||||
|
<li class="list-group-item"><strong>Цена:</strong> 10 500 000 руб</li>
|
||||||
|
</ul>
|
||||||
|
<a href="#" class="btn btn-custom mt-3">Купить</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="card mb-4 h-10">
|
||||||
|
<img src="prod2.jpg" class="card-img-top custom-image" alt="Product Image">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title text-truncate">Дом Вашей мечты</h5>
|
||||||
|
<ul class="list-group list-group-flush">
|
||||||
|
<li class="list-group-item"><strong>Площадь дома:</strong> 230 м2</li>
|
||||||
|
<li class="list-group-item"><strong>Цена:</strong> 20 500 000 руб</li>
|
||||||
|
</ul>
|
||||||
|
<a href="#" class="btn btn-custom mt-3">Купить</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="card mb-4 h-10">
|
||||||
|
<img src="prod3.jpg" class="card-img-top custom-image" alt="Product Image">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title text-truncate">Элитная вилла</h5>
|
||||||
|
<ul class="list-group list-group-flush">
|
||||||
|
<li class="list-group-item"><strong>Площадь дома:</strong> 250 м2</li>
|
||||||
|
<li class="list-group-item"><strong>Цена:</strong> 30 500 000 руб</li>
|
||||||
|
</ul>
|
||||||
|
<a href="#" class="btn btn-custom mt-3">Купить</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
|
||||||
|
Алексеев Иван, ПИбд-21
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
61
IP/js/lines-modal.js
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
// Модуль для работы с модальным окном
|
||||||
|
|
||||||
|
// импорт компонента Modal из bootstrap
|
||||||
|
import { Modal } from "bootstrap";
|
||||||
|
import { cntrls, imagePlaceholder } from "./lines-ui";
|
||||||
|
|
||||||
|
// поиск модального окна на странице
|
||||||
|
const modal = document.getElementById("items-update");
|
||||||
|
// если он найден, то создается экземпляр компонента Modal
|
||||||
|
// для программного управления модальным окном
|
||||||
|
const myModal = modal ? new Modal(modal, {}) : null;
|
||||||
|
|
||||||
|
// поиск тега с заголовком модального кона для его смены
|
||||||
|
const modalTitle = document.getElementById("items-update-title");
|
||||||
|
|
||||||
|
// обнуление значений модального окна, т. к.
|
||||||
|
// используется одно окно для всех операций
|
||||||
|
function resetValues() {
|
||||||
|
cntrls.lineId.value = "";
|
||||||
|
cntrls.itemsType.value = "";
|
||||||
|
cntrls.price.value = parseFloat(0).toFixed(2);
|
||||||
|
cntrls.count.value = 0;
|
||||||
|
cntrls.materialsType.value = "";
|
||||||
|
cntrls.image.value = "";
|
||||||
|
cntrls.imagePreview.src = imagePlaceholder;
|
||||||
|
}
|
||||||
|
|
||||||
|
// функция для показа модального окна
|
||||||
|
// перед показом происходит заполнение формы для редактирования
|
||||||
|
// если объект item не пуст
|
||||||
|
export function showUpdateModal(item) {
|
||||||
|
modalTitle.innerHTML = item === null ? "Добавить" : "Изменить";
|
||||||
|
console.info(item);
|
||||||
|
|
||||||
|
if (item) {
|
||||||
|
cntrls.lineId.value = item.id;
|
||||||
|
cntrls.itemsType.value = item.itemsId;
|
||||||
|
cntrls.price.value = item.price;
|
||||||
|
cntrls.count.value = item.count;
|
||||||
|
cntrls.materialsType.value = item.materialsId;
|
||||||
|
// заполнение превью
|
||||||
|
// Если пользователь выбрал изображение, то оно загружается
|
||||||
|
// в тэг image с id image - preview
|
||||||
|
// иначе устанавливается заглушка, адрес которой указан в imagePlaceholder
|
||||||
|
cntrls.imagePreview.src = item.image ? item.image : imagePlaceholder;
|
||||||
|
} else {
|
||||||
|
resetValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
myModal.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
// функция для скрытия модального окна
|
||||||
|
export function hideUpdateModal() {
|
||||||
|
resetValues();
|
||||||
|
|
||||||
|
// удаление класса was-validated для скрытия результатов валидации
|
||||||
|
cntrls.form.classList.remove("was-validated");
|
||||||
|
|
||||||
|
myModal.hide();
|
||||||
|
}
|
110
IP/js/lines-rest-api.js
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
// модуль для работы с REST API сервера
|
||||||
|
|
||||||
|
// адрес сервера
|
||||||
|
const serverUrl = "http://localhost:8081";
|
||||||
|
|
||||||
|
// функция возвращает объект нужной структуры для отправки на сервер
|
||||||
|
function createLineObject(item, price, count, material, image) {
|
||||||
|
return {
|
||||||
|
itemsId: item,
|
||||||
|
price: parseFloat(price).toFixed(2),
|
||||||
|
count,
|
||||||
|
materialsId: material,
|
||||||
|
sum: parseFloat(price * count).toFixed(2),
|
||||||
|
image,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// обращение к серверу для получения всех типов товара (get)
|
||||||
|
export async function getAllItemTypes() {
|
||||||
|
const response = await fetch(`${serverUrl}/items`);
|
||||||
|
if (!response.ok) {
|
||||||
|
throw response.statusText;
|
||||||
|
}
|
||||||
|
return response.json();
|
||||||
|
}
|
||||||
|
|
||||||
|
// обращение к серверу для получения всех типов товара (get)
|
||||||
|
export async function getAllMaterialTypes() {
|
||||||
|
const response = await fetch(`${serverUrl}/materials`);
|
||||||
|
if (!response.ok) {
|
||||||
|
throw response.statusText;
|
||||||
|
}
|
||||||
|
return response.json();
|
||||||
|
}
|
||||||
|
|
||||||
|
// обращение к серверу для получения всех записей (get)
|
||||||
|
export async function getAllLines() {
|
||||||
|
const response = await fetch(`${serverUrl}/lines?_expand=items&_expand=materials`);
|
||||||
|
if (!response.ok) {
|
||||||
|
throw response.statusText;
|
||||||
|
}
|
||||||
|
return response.json();
|
||||||
|
}
|
||||||
|
|
||||||
|
// обращение к серверу для получения записи по первичному ключу (id) (get)
|
||||||
|
// id передается в качестве части пути URL get-запроса
|
||||||
|
export async function getLine(id) {
|
||||||
|
const response = await fetch(`${serverUrl}/lines/${id}?_expand=items&`);
|
||||||
|
if (!response.ok) {
|
||||||
|
throw response.statusText;
|
||||||
|
}
|
||||||
|
return response.json();
|
||||||
|
}
|
||||||
|
|
||||||
|
// обращение к серверу для создания записи (post)
|
||||||
|
// объект отправляется в теле запроса (body)
|
||||||
|
export async function createLine(item, price, count, material, image) {
|
||||||
|
const itemObject = createLineObject(item, price, count, material, image);
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify(itemObject),
|
||||||
|
headers: {
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await fetch(`${serverUrl}/lines`, options);
|
||||||
|
if (!response.ok) {
|
||||||
|
throw response.statusText;
|
||||||
|
}
|
||||||
|
return response.json();
|
||||||
|
}
|
||||||
|
|
||||||
|
// обращение к серверу для обновления записи по id (put)
|
||||||
|
// объект отправляется в теле запроса (body)
|
||||||
|
// id передается в качестве части пути URL get-запроса
|
||||||
|
export async function updateLine(id, item, price, count, material, image) {
|
||||||
|
const itemObject = createLineObject(item, price, count, material, image);
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
method: "PUT",
|
||||||
|
body: JSON.stringify(itemObject),
|
||||||
|
headers: {
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await fetch(`${serverUrl}/lines/${id}`, options);
|
||||||
|
if (!response.ok) {
|
||||||
|
throw response.statusText;
|
||||||
|
}
|
||||||
|
return response.json();
|
||||||
|
}
|
||||||
|
|
||||||
|
// обращение к серверу для удаления записи по id (delete)
|
||||||
|
// id передается в качестве части пути URL get-запроса
|
||||||
|
export async function deleteLine(id) {
|
||||||
|
const options = {
|
||||||
|
method: "DELETE",
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await fetch(`${serverUrl}/lines/${id}`, options);
|
||||||
|
if (!response.ok) {
|
||||||
|
throw response.statusText;
|
||||||
|
}
|
||||||
|
return response.json();
|
||||||
|
}
|
114
IP/js/lines-ui.js
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
// модуль для работы с элементами управления
|
||||||
|
|
||||||
|
// объект для удобного получения элементов
|
||||||
|
// при обращении к атрибуту объекта вызывается
|
||||||
|
// нужная функция для поиска элемента
|
||||||
|
export const cntrls = {
|
||||||
|
productContainer: document.getElementById("productСontainer"),
|
||||||
|
button: document.getElementById("items-add"),
|
||||||
|
table: document.querySelector("#items-table tbody"),
|
||||||
|
form: document.getElementById("items-form"),
|
||||||
|
lineId: document.getElementById("items-line-id"),
|
||||||
|
itemsType: document.getElementById("item"),
|
||||||
|
price: document.getElementById("price"),
|
||||||
|
count: document.getElementById("count"),
|
||||||
|
materialsType: document.getElementById("material"),
|
||||||
|
image: document.getElementById("image"),
|
||||||
|
imagePreview: document.getElementById("image-preview"),
|
||||||
|
};
|
||||||
|
|
||||||
|
// Дефолтное превью
|
||||||
|
export const imagePlaceholder = "https://via.placeholder.com/200";
|
||||||
|
|
||||||
|
// функция создает тег option для select
|
||||||
|
// <option value="" selected>name</option>
|
||||||
|
export function createItemsOption(name, value = "", isSelected = false) {
|
||||||
|
const option = document.createElement("option");
|
||||||
|
option.value = value || "";
|
||||||
|
option.selected = isSelected;
|
||||||
|
option.text = name;
|
||||||
|
return option;
|
||||||
|
}
|
||||||
|
|
||||||
|
// функция создает ссылку (a) для таблицы
|
||||||
|
// содержимое тега a заполняется необходимой иконкой (icon)
|
||||||
|
// при нажатии вызывается callback
|
||||||
|
// ссылка "оборачивается" тегом td
|
||||||
|
// <td><a href="#" onclick="callback()"><i class="fa-solid icon"></i></a></td>
|
||||||
|
function createTableAnchor(icon, callback) {
|
||||||
|
const i = document.createElement("i");
|
||||||
|
i.classList.add("fa-solid", icon);
|
||||||
|
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.href = "#";
|
||||||
|
a.appendChild(i);
|
||||||
|
a.onclick = (event) => {
|
||||||
|
// чтобы в URL не добавлялась решетка
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
callback();
|
||||||
|
};
|
||||||
|
|
||||||
|
const td = document.createElement("td");
|
||||||
|
td.appendChild(a);
|
||||||
|
return td;
|
||||||
|
}
|
||||||
|
|
||||||
|
// функция создает колонку таблицы с текстом value
|
||||||
|
// <td>value</td>
|
||||||
|
function createTableColumn(value) {
|
||||||
|
const td = document.createElement("td");
|
||||||
|
td.textContent = value;
|
||||||
|
return td;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createAnchor(icon, callback) {
|
||||||
|
const i = document.createElement("i");
|
||||||
|
i.classList.add("fa-solid", icon);
|
||||||
|
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.href = "#";
|
||||||
|
a.appendChild(i);
|
||||||
|
a.onclick = (event) => {
|
||||||
|
// чтобы в URL не добавлялась решетка
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
callback(icon);
|
||||||
|
};
|
||||||
|
const div = document.createElement("div");
|
||||||
|
div.appendChild(a);
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
// функция создает строку таблицы
|
||||||
|
// <tr>
|
||||||
|
// <th scope="row">index + 1</th>
|
||||||
|
// <td>item.items.name</td>
|
||||||
|
// <td>parseFloat(item.price).toFixed(2))</td>
|
||||||
|
// <td>item.count</td>
|
||||||
|
// <td>parseFloat(item.sum).toFixed(2))</td>
|
||||||
|
// <td><a href="#" onclick="editCallback()"><i class="fa-solid fa-pencil"></i></a></td>
|
||||||
|
// <td><a href="#" onclick="editPageCallback()"><i class="fa-solid fa-pen-to-square"></i></a></td>
|
||||||
|
// <td><a href="#" onclick="deleteCallback()"><i class="fa-solid fa-trash"></i></a></td>
|
||||||
|
// </tr>
|
||||||
|
export function createTableRow(item, index, editCallback, editPageCallback, deleteCallback) {
|
||||||
|
const rowNumber = document.createElement("th");
|
||||||
|
rowNumber.scope = "row";
|
||||||
|
rowNumber.textContent = index + 1;
|
||||||
|
|
||||||
|
const row = document.createElement("tr");
|
||||||
|
row.id = `line-${item.id}`;
|
||||||
|
|
||||||
|
row.appendChild(rowNumber);
|
||||||
|
row.appendChild(createTableColumn(item.items.name));
|
||||||
|
row.appendChild(createTableColumn(parseFloat(item.price).toFixed(2)));
|
||||||
|
row.appendChild(createTableColumn(item.count));
|
||||||
|
row.appendChild(createTableColumn(item.materials.name));
|
||||||
|
row.appendChild(createTableColumn(parseFloat(item.sum).toFixed(2)));
|
||||||
|
// редактировать в модальном окне
|
||||||
|
row.appendChild(createTableAnchor("fa-pencil", editCallback));
|
||||||
|
// редактировать на странице page-edit
|
||||||
|
row.appendChild(createTableAnchor("fa-pen-to-square", editPageCallback));
|
||||||
|
// удаление
|
||||||
|
row.appendChild(createTableAnchor("fa-trash", deleteCallback));
|
||||||
|
return row;
|
||||||
|
}
|
279
IP/js/lines.js
Normal file
@ -0,0 +1,279 @@
|
|||||||
|
// модуль с логикой
|
||||||
|
|
||||||
|
import { hideUpdateModal, showUpdateModal } from "./lines-modal";
|
||||||
|
import {
|
||||||
|
createLine, deleteLine, getAllItemTypes, getAllMaterialTypes, getAllLines, updateLine,
|
||||||
|
} from "./lines-rest-api";
|
||||||
|
import {
|
||||||
|
cntrls, createItemsOption, createTableRow, imagePlaceholder,
|
||||||
|
} from "./lines-ui";
|
||||||
|
|
||||||
|
async function drawItemsSelect() {
|
||||||
|
// вызов метода REST API для получения списка типов товаров
|
||||||
|
const data = await getAllItemTypes();
|
||||||
|
// очистка содержимого select
|
||||||
|
// удаляется все, что находится между тегами <select></select>
|
||||||
|
// но не атрибуты
|
||||||
|
cntrls.itemsType.innerHTML = "";
|
||||||
|
// пустое значение
|
||||||
|
cntrls.itemsType.appendChild(createItemsOption("Выберите значение", "", true));
|
||||||
|
// цикл по результату ответа от сервера
|
||||||
|
// используется лямбда-выражение
|
||||||
|
// (item) => {} аналогично function(item) {}
|
||||||
|
data.forEach((item) => {
|
||||||
|
cntrls.itemsType.appendChild(createItemsOption(item.name, item.id));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async function drawMaterialsSelect() {
|
||||||
|
// вызов метода REST API для получения списка типов товаров
|
||||||
|
const data = await getAllMaterialTypes();
|
||||||
|
// очистка содержимого select
|
||||||
|
// удаляется все, что находится между тегами <select></select>
|
||||||
|
// но не атрибуты
|
||||||
|
cntrls.materialsType.innerHTML = "";
|
||||||
|
// пустое значение
|
||||||
|
cntrls.materialsType.appendChild(createItemsOption("Выберите значение", "", true));
|
||||||
|
// цикл по результату ответа от сервера
|
||||||
|
// используется лямбда-выражение
|
||||||
|
// (item) => {} аналогично function(item) {}
|
||||||
|
data.forEach((item) => {
|
||||||
|
cntrls.materialsType.appendChild(createItemsOption(item.name, item.id));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function drawLinesTable() {
|
||||||
|
console.info("Try to load data");
|
||||||
|
if (!cntrls.table) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// вызов метода REST API для получения всех записей
|
||||||
|
const data = await getAllLines();
|
||||||
|
// очистка содержимого table
|
||||||
|
// удаляется все, что находится между тегами <table></table>
|
||||||
|
// но не атрибуты
|
||||||
|
cntrls.table.innerHTML = "";
|
||||||
|
// цикл по результату ответа от сервера
|
||||||
|
// используется лямбда-выражение
|
||||||
|
// (item, index) => {} аналогично function(item, index) {}
|
||||||
|
data.forEach((item, index) => {
|
||||||
|
cntrls.table.appendChild(
|
||||||
|
createTableRow(
|
||||||
|
item,
|
||||||
|
index,
|
||||||
|
// функции передаются в качестве параметра
|
||||||
|
// это очень удобно, так как аргументы функций доступны только
|
||||||
|
// в данном месте кода и не передаются в сервисные модули
|
||||||
|
() => showUpdateModal(item),
|
||||||
|
() => location.assign(`page-edit.html?id=${item.id}`),
|
||||||
|
() => removeLine(item.id),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function addLine(item, price, count, material, image) {
|
||||||
|
console.info("Try to add item");
|
||||||
|
// вызов метода REST API для добавления записи
|
||||||
|
const data = await createLine(item, price, count, material, image);
|
||||||
|
console.info("Added");
|
||||||
|
console.info(data);
|
||||||
|
// загрузка и заполнение table
|
||||||
|
drawLinesTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function editLine(id, item, price, count, material, image) {
|
||||||
|
console.info("Try to update item");
|
||||||
|
// вызов метода REST API для обновления записи
|
||||||
|
const data = await updateLine(id, item, price, count, material, image);
|
||||||
|
console.info("Updated");
|
||||||
|
console.info(data);
|
||||||
|
// загрузка и заполнение table
|
||||||
|
drawLinesTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function removeLine(id) {
|
||||||
|
if (!confirm("Do you really want to remove this item?")) {
|
||||||
|
console.info("Canceled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.info("Try to remove item");
|
||||||
|
// вызов метода REST API для удаления записи
|
||||||
|
const data = await deleteLine(id);
|
||||||
|
console.info(data);
|
||||||
|
// загрузка и заполнение table
|
||||||
|
drawLinesTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
// функция для получения содержимого файла в виде base64 строки
|
||||||
|
// https://ru.wikipedia.org/wiki/Base64
|
||||||
|
async function readFile(file) {
|
||||||
|
const reader = new FileReader();
|
||||||
|
|
||||||
|
// создание Promise-объекта для использования функции
|
||||||
|
// с помощью await (асинхронно) без коллбэков (callback)
|
||||||
|
// https://learn.javascript.ru/promise
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
// 2. "Возвращаем" содержимое когда файл прочитан
|
||||||
|
// через вызов resolve
|
||||||
|
// Если не использовать Promise, то всю работу по взаимодействию
|
||||||
|
// с REST API пришлось бы делать в обработчике (callback) функции
|
||||||
|
// onloadend
|
||||||
|
reader.onloadend = () => {
|
||||||
|
const fileContent = reader.result;
|
||||||
|
// Здесь могла бы быть работа с REST API
|
||||||
|
// Чтение заканчивает выполняться здесь
|
||||||
|
resolve(fileContent);
|
||||||
|
};
|
||||||
|
// 3. Возвращаем ошибку
|
||||||
|
reader.onerror = () => {
|
||||||
|
// Или здесь в случае ошибки
|
||||||
|
reject(new Error("oops, something went wrong with the file reader."));
|
||||||
|
};
|
||||||
|
// Шаг 1. Сначала читаем файл
|
||||||
|
// Чтение начинает выполняться здесь
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// функция для обновления блока с превью выбранного изображения
|
||||||
|
async function updateImagePreview() {
|
||||||
|
// получение выбранного файла
|
||||||
|
// возможен выбор нескольких файлов, поэтому необходимо получить только первый
|
||||||
|
const file = cntrls.image.files[0];
|
||||||
|
// чтение содержимого файла в виде base64 строки
|
||||||
|
const fileContent = await readFile(file);
|
||||||
|
console.info("base64 ", fileContent);
|
||||||
|
// обновление атрибута src для тега img с id image-preview
|
||||||
|
cntrls.imagePreview.src = fileContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Функция для обработки создания и редактирования элементов таблицы через модальное окно
|
||||||
|
// Если хотите делать через страницу, то удалите эту функцию
|
||||||
|
export function linesForm() {
|
||||||
|
console.info("linesForm");
|
||||||
|
|
||||||
|
// загрузка и заполнение select со списком товаров
|
||||||
|
drawItemsSelect();
|
||||||
|
drawMaterialsSelect();
|
||||||
|
// загрузка и заполнение table
|
||||||
|
drawLinesTable();
|
||||||
|
|
||||||
|
// Вызов функции обновления превью изображения при возникновении
|
||||||
|
// события oncahnge в тэге input с id image
|
||||||
|
cntrls.image.addEventListener("change", () => updateImagePreview());
|
||||||
|
|
||||||
|
// обработчик события нажатия на кнопку для показа модального окна
|
||||||
|
cntrls.button.addEventListener("click", () => showUpdateModal(null));
|
||||||
|
|
||||||
|
// обработчик события отправки формы
|
||||||
|
// возникает при нажатии на кнопку (button) с типом submit
|
||||||
|
// кнопка должна находится внутри тега form
|
||||||
|
cntrls.form.addEventListener("submit", async (event) => {
|
||||||
|
console.info("Form onSubmit");
|
||||||
|
// отключение стандартного поведения формы при отправке
|
||||||
|
// при отправке страница обновляется и JS перестает работать
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
// если форма не прошла валидацию, то ничего делать не нужно
|
||||||
|
if (!cntrls.form.checkValidity()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let imageBase64 = "";
|
||||||
|
// Получение выбранного пользователем изображения в виде base64 строки
|
||||||
|
// Если пользователь ничего не выбрал, то не нужно сохранять в БД
|
||||||
|
// дефолтное изображение
|
||||||
|
if (cntrls.imagePreview.src !== imagePlaceholder) {
|
||||||
|
// Загрузка содержимого атрибута src тэга img с id image-preview
|
||||||
|
// Здесь выполняется HTTP запрос с типом GET
|
||||||
|
const result = await fetch(cntrls.imagePreview.src);
|
||||||
|
// Получение из HTTP-ответа бинарного содержимого
|
||||||
|
const blob = await result.blob();
|
||||||
|
// Получение base64 строки для файла
|
||||||
|
// Здесь выполняется Promise из функции readFile
|
||||||
|
// Promise позволяет писать линейный код для работы с асинхронными методами
|
||||||
|
// без использования обработчиков (callback) с помощью await
|
||||||
|
imageBase64 = await readFile(blob);
|
||||||
|
}
|
||||||
|
|
||||||
|
// получение id строки для редактирования
|
||||||
|
// это значение содержится в скрытом input
|
||||||
|
const currentId = cntrls.lineId.value;
|
||||||
|
// если значение id не задано,
|
||||||
|
// то необходимо выполнить добавление записи
|
||||||
|
// иначе обновление записи
|
||||||
|
if (!currentId) {
|
||||||
|
await addLine(
|
||||||
|
cntrls.itemsType.value,
|
||||||
|
cntrls.price.value,
|
||||||
|
cntrls.count.value,
|
||||||
|
cntrls.materialsType.value,
|
||||||
|
imageBase64,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
await editLine(
|
||||||
|
currentId,
|
||||||
|
cntrls.itemsType.value,
|
||||||
|
cntrls.price.value,
|
||||||
|
cntrls.count.value,
|
||||||
|
cntrls.materialsType.value,
|
||||||
|
imageBase64,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// после выполнения добавления/обновления модальное окно скрывается
|
||||||
|
hideUpdateModal();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearCollection() {
|
||||||
|
const newsElements = document.querySelectorAll(".mainDiv");
|
||||||
|
newsElements.forEach((element) => element.remove());
|
||||||
|
}
|
||||||
|
export async function UpdateCollection() {
|
||||||
|
clearCollection();
|
||||||
|
console.info("UpdateNews");
|
||||||
|
|
||||||
|
const data = await getAllLines();
|
||||||
|
|
||||||
|
data.forEach((item) => {
|
||||||
|
document.addEventListener("DOMContentLoaded", async (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
const div0 = document.createElement("div");
|
||||||
|
div0.setAttribute("class", "col-md-3 product my-2");
|
||||||
|
|
||||||
|
const div2 = document.createElement("div");
|
||||||
|
div2.setAttribute("class", "product-img");
|
||||||
|
|
||||||
|
const image = document.createElement("img");
|
||||||
|
image.setAttribute("class", "img-fluid");
|
||||||
|
image.setAttribute("src", item.image);
|
||||||
|
image.setAttribute("width", "100%");
|
||||||
|
image.setAttribute("alt", item.ItName);
|
||||||
|
div2.appendChild(image);
|
||||||
|
|
||||||
|
const div3 = document.createElement("div");
|
||||||
|
div3.setAttribute("class", "product-info");
|
||||||
|
|
||||||
|
const h2 = document.createElement("h2");
|
||||||
|
h2.textContent = `Название: ${item.itemsType}`;
|
||||||
|
div3.appendChild(h2);
|
||||||
|
|
||||||
|
const p1 = document.createElement("p");
|
||||||
|
p1.textContent = `Количество: ${item.count}`;
|
||||||
|
div3.appendChild(p1);
|
||||||
|
|
||||||
|
const p2 = document.createElement("p");
|
||||||
|
p1.textContent = `Цена: ${item.price}`;
|
||||||
|
div3.appendChild(p2);
|
||||||
|
|
||||||
|
div0.appendChild(div2);
|
||||||
|
div0.appendChild(div3);
|
||||||
|
|
||||||
|
const collectionContainer = document.getElementById("collectionContainer");
|
||||||
|
collectionContainer.appendChild(div0);
|
||||||
|
});
|
||||||
|
}
|
25
IP/js/validation.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// модуль используется для валидации форма на странице
|
||||||
|
|
||||||
|
function validation() {
|
||||||
|
// поиск всех форма с классом .needs-validation
|
||||||
|
const forms = document.querySelectorAll("form.needs-validation");
|
||||||
|
|
||||||
|
for (let i = 0; i < forms.length; i += 1) {
|
||||||
|
const form = forms[i];
|
||||||
|
// для каждой формы добавляется обработчик события отправки
|
||||||
|
form.addEventListener("submit", (event) => {
|
||||||
|
// если форма не прошла валидацию
|
||||||
|
// то выключить стандартное действие
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault();
|
||||||
|
// предотвращает распространение preventDefault
|
||||||
|
// на другие объекты
|
||||||
|
event.stopPropagation();
|
||||||
|
}
|
||||||
|
// добавляет к форме класс was-validated
|
||||||
|
form.classList.add("was-validated");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default validation;
|
@ -3,7 +3,7 @@
|
|||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "Node",
|
"moduleResolution": "Node",
|
||||||
"target": "ES2020",
|
"target": "ES2020",
|
||||||
"jsx": "react",
|
"jsx": "preserve",
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
"strictFunctionTypes": true
|
"strictFunctionTypes": true
|
||||||
},
|
},
|
||||||
|
12
IP/node_modules/.bin/.nanoid-OFta2BNq
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../nanoid/bin/nanoid.cjs" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../nanoid/bin/nanoid.cjs" "$@"
|
||||||
|
fi
|
17
IP/node_modules/.bin/.nanoid.cmd-FMiwCz4y
generated
vendored
Normal file
@ -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
IP/node_modules/.bin/.nanoid.ps1-prp7iS2Q
generated
vendored
Normal file
@ -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
|
12
IP/node_modules/.bin/.resolve-U8S2AIEA
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../resolve/bin/resolve" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../resolve/bin/resolve" "$@"
|
||||||
|
fi
|
17
IP/node_modules/.bin/.resolve.cmd-VWu4PvGF
generated
vendored
Normal file
@ -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
IP/node_modules/.bin/.resolve.ps1-ipYGtDsW
generated
vendored
Normal file
@ -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
|
12
IP/node_modules/.bin/.rollup-CWMJmJKh
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../rollup/dist/bin/rollup" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../rollup/dist/bin/rollup" "$@"
|
||||||
|
fi
|
17
IP/node_modules/.bin/.rollup.cmd-aUIVJPf1
generated
vendored
Normal file
@ -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%\..\rollup\dist\bin\rollup" %*
|
28
IP/node_modules/.bin/.rollup.ps1-GSBjEWaA
generated
vendored
Normal file
@ -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/../rollup/dist/bin/rollup" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../rollup/dist/bin/rollup" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../rollup/dist/bin/rollup" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../rollup/dist/bin/rollup" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
IP/node_modules/.bin/he
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../he/bin/he" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../he/bin/he" "$@"
|
||||||
|
fi
|
17
IP/node_modules/.bin/he.cmd
generated
vendored
Normal file
@ -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%\..\he\bin\he" %*
|
28
IP/node_modules/.bin/he.ps1
generated
vendored
Normal file
@ -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/../he/bin/he" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../he/bin/he" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../he/bin/he" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../he/bin/he" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
IP/node_modules/.bin/http-server
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../http-server/bin/http-server" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../http-server/bin/http-server" "$@"
|
||||||
|
fi
|
17
IP/node_modules/.bin/http-server.cmd
generated
vendored
Normal file
@ -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%\..\http-server\bin\http-server" %*
|
28
IP/node_modules/.bin/http-server.ps1
generated
vendored
Normal file
@ -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/../http-server/bin/http-server" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../http-server/bin/http-server" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../http-server/bin/http-server" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../http-server/bin/http-server" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
IP/node_modules/.bin/json-server
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../json-server/lib/cli/bin.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../json-server/lib/cli/bin.js" "$@"
|
||||||
|
fi
|
17
IP/node_modules/.bin/json-server.cmd
generated
vendored
Normal file
@ -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%\..\json-server\lib\cli\bin.js" %*
|
28
IP/node_modules/.bin/json-server.ps1
generated
vendored
Normal file
@ -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/../json-server/lib/cli/bin.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../json-server/lib/cli/bin.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../json-server/lib/cli/bin.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../json-server/lib/cli/bin.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
IP/node_modules/.bin/mime
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../mime/cli.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../mime/cli.js" "$@"
|
||||||
|
fi
|
17
IP/node_modules/.bin/mime.cmd
generated
vendored
Normal file
@ -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%\..\mime\cli.js" %*
|
28
IP/node_modules/.bin/mime.ps1
generated
vendored
Normal file
@ -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/../mime/cli.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../mime/cli.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../mime/cli.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../mime/cli.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
IP/node_modules/.bin/mkdirp
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../mkdirp/bin/cmd.js" "$@"
|
||||||
|
fi
|
17
IP/node_modules/.bin/mkdirp.cmd
generated
vendored
Normal file
@ -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%\..\mkdirp\bin\cmd.js" %*
|
28
IP/node_modules/.bin/mkdirp.ps1
generated
vendored
Normal file
@ -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/../mkdirp/bin/cmd.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
IP/node_modules/.bin/npm-run-all
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../npm-run-all/bin/npm-run-all/index.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../npm-run-all/bin/npm-run-all/index.js" "$@"
|
||||||
|
fi
|
17
IP/node_modules/.bin/npm-run-all.cmd
generated
vendored
Normal file
@ -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%\..\npm-run-all\bin\npm-run-all\index.js" %*
|
28
IP/node_modules/.bin/npm-run-all.ps1
generated
vendored
Normal file
@ -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/../npm-run-all/bin/npm-run-all/index.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../npm-run-all/bin/npm-run-all/index.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../npm-run-all/bin/npm-run-all/index.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../npm-run-all/bin/npm-run-all/index.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
IP/node_modules/.bin/opener
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../opener/bin/opener-bin.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../opener/bin/opener-bin.js" "$@"
|
||||||
|
fi
|
17
IP/node_modules/.bin/opener.cmd
generated
vendored
Normal file
@ -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%\..\opener\bin\opener-bin.js" %*
|
28
IP/node_modules/.bin/opener.ps1
generated
vendored
Normal file
@ -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/../opener/bin/opener-bin.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../opener/bin/opener-bin.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../opener/bin/opener-bin.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../opener/bin/opener-bin.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
IP/node_modules/.bin/pidtree
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../pidtree/bin/pidtree.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../pidtree/bin/pidtree.js" "$@"
|
||||||
|
fi
|
17
IP/node_modules/.bin/pidtree.cmd
generated
vendored
Normal file
@ -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%\..\pidtree\bin\pidtree.js" %*
|
28
IP/node_modules/.bin/pidtree.ps1
generated
vendored
Normal file
@ -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/../pidtree/bin/pidtree.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../pidtree/bin/pidtree.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../pidtree/bin/pidtree.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../pidtree/bin/pidtree.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
IP/node_modules/.bin/run-p
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../npm-run-all/bin/run-p/index.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../npm-run-all/bin/run-p/index.js" "$@"
|
||||||
|
fi
|
17
IP/node_modules/.bin/run-p.cmd
generated
vendored
Normal file
@ -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%\..\npm-run-all\bin\run-p\index.js" %*
|
28
IP/node_modules/.bin/run-p.ps1
generated
vendored
Normal file
@ -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/../npm-run-all/bin/run-p/index.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../npm-run-all/bin/run-p/index.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../npm-run-all/bin/run-p/index.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../npm-run-all/bin/run-p/index.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
IP/node_modules/.bin/run-s
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../npm-run-all/bin/run-s/index.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../npm-run-all/bin/run-s/index.js" "$@"
|
||||||
|
fi
|
17
IP/node_modules/.bin/run-s.cmd
generated
vendored
Normal file
@ -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%\..\npm-run-all\bin\run-s\index.js" %*
|
28
IP/node_modules/.bin/run-s.ps1
generated
vendored
Normal file
@ -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/../npm-run-all/bin/run-s/index.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../npm-run-all/bin/run-s/index.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../npm-run-all/bin/run-s/index.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../npm-run-all/bin/run-s/index.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
4
IP/node_modules/.bin/semver
generated
vendored
@ -6,7 +6,7 @@ case `uname` in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
if [ -x "$basedir/node" ]; then
|
||||||
exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@"
|
exec "$basedir/node" "$basedir/../semver/bin/semver" "$@"
|
||||||
else
|
else
|
||||||
exec node "$basedir/../semver/bin/semver.js" "$@"
|
exec node "$basedir/../semver/bin/semver" "$@"
|
||||||
fi
|
fi
|
||||||
|
2
IP/node_modules/.bin/semver.cmd
generated
vendored
@ -14,4 +14,4 @@ IF EXIST "%dp0%\node.exe" (
|
|||||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
)
|
)
|
||||||
|
|
||||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver.js" %*
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver" %*
|
||||||
|
8
IP/node_modules/.bin/semver.ps1
generated
vendored
@ -11,17 +11,17 @@ $ret=0
|
|||||||
if (Test-Path "$basedir/node$exe") {
|
if (Test-Path "$basedir/node$exe") {
|
||||||
# Support pipeline input
|
# Support pipeline input
|
||||||
if ($MyInvocation.ExpectingInput) {
|
if ($MyInvocation.ExpectingInput) {
|
||||||
$input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args
|
$input | & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args
|
||||||
} else {
|
} else {
|
||||||
& "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args
|
& "$basedir/node$exe" "$basedir/../semver/bin/semver" $args
|
||||||
}
|
}
|
||||||
$ret=$LASTEXITCODE
|
$ret=$LASTEXITCODE
|
||||||
} else {
|
} else {
|
||||||
# Support pipeline input
|
# Support pipeline input
|
||||||
if ($MyInvocation.ExpectingInput) {
|
if ($MyInvocation.ExpectingInput) {
|
||||||
$input | & "node$exe" "$basedir/../semver/bin/semver.js" $args
|
$input | & "node$exe" "$basedir/../semver/bin/semver" $args
|
||||||
} else {
|
} else {
|
||||||
& "node$exe" "$basedir/../semver/bin/semver.js" $args
|
& "node$exe" "$basedir/../semver/bin/semver" $args
|
||||||
}
|
}
|
||||||
$ret=$LASTEXITCODE
|
$ret=$LASTEXITCODE
|
||||||
}
|
}
|
||||||
|
12
IP/node_modules/.bin/which
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../which/bin/which" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../which/bin/which" "$@"
|
||||||
|
fi
|
17
IP/node_modules/.bin/which.cmd
generated
vendored
Normal file
@ -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%\..\which\bin\which" %*
|
28
IP/node_modules/.bin/which.ps1
generated
vendored
Normal file
@ -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/../which/bin/which" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../which/bin/which" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../which/bin/which" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../which/bin/which" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
1
IP/node_modules/.call-bind-l24kcOp1/.eslintignore
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
coverage/
|
17
IP/node_modules/.call-bind-l24kcOp1/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
|
||||||
|
"extends": "@ljharb",
|
||||||
|
|
||||||
|
"rules": {
|
||||||
|
"func-name-matching": 0,
|
||||||
|
"id-length": 0,
|
||||||
|
"new-cap": [2, {
|
||||||
|
"capIsNewExceptions": [
|
||||||
|
"GetIntrinsic",
|
||||||
|
],
|
||||||
|
}],
|
||||||
|
"no-magic-numbers": 0,
|
||||||
|
"operator-linebreak": [2, "before"],
|
||||||
|
},
|
||||||
|
}
|
12
IP/node_modules/.call-bind-l24kcOp1/.github/FUNDING.yml
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: [ljharb]
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: # Replace with a single Open Collective username
|
||||||
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
tidelift: npm/call-bind
|
||||||
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
|
liberapay: # Replace with a single Liberapay username
|
||||||
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
|
otechie: # Replace with a single Otechie username
|
||||||
|
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
13
IP/node_modules/.call-bind-l24kcOp1/.nycrc
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"all": true,
|
||||||
|
"check-coverage": false,
|
||||||
|
"reporter": ["text-summary", "text", "html", "json"],
|
||||||
|
"lines": 86,
|
||||||
|
"statements": 85.93,
|
||||||
|
"functions": 82.43,
|
||||||
|
"branches": 76.06,
|
||||||
|
"exclude": [
|
||||||
|
"coverage",
|
||||||
|
"test"
|
||||||
|
]
|
||||||
|
}
|
42
IP/node_modules/.call-bind-l24kcOp1/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [v1.0.2](https://github.com/ljharb/call-bind/compare/v1.0.1...v1.0.2) - 2021-01-11
|
||||||
|
|
||||||
|
### Commits
|
||||||
|
|
||||||
|
- [Fix] properly include the receiver in the bound length [`dbae7bc`](https://github.com/ljharb/call-bind/commit/dbae7bc676c079a0d33c0a43e9ef92cb7b01345d)
|
||||||
|
|
||||||
|
## [v1.0.1](https://github.com/ljharb/call-bind/compare/v1.0.0...v1.0.1) - 2021-01-08
|
||||||
|
|
||||||
|
### Commits
|
||||||
|
|
||||||
|
- [Tests] migrate tests to Github Actions [`b6db284`](https://github.com/ljharb/call-bind/commit/b6db284c36f8ccd195b88a6764fe84b7223a0da1)
|
||||||
|
- [meta] do not publish github action workflow files [`ec7fe46`](https://github.com/ljharb/call-bind/commit/ec7fe46e60cfa4764ee943d2755f5e5a366e578e)
|
||||||
|
- [Fix] preserve original function’s length when possible [`adbceaa`](https://github.com/ljharb/call-bind/commit/adbceaa3cac4b41ea78bb19d7ccdbaaf7e0bdadb)
|
||||||
|
- [Tests] gather coverage data on every job [`d69e23c`](https://github.com/ljharb/call-bind/commit/d69e23cc65f101ba1d4c19bb07fa8eb0ec624be8)
|
||||||
|
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`2fd3586`](https://github.com/ljharb/call-bind/commit/2fd3586c5d47b335364c14293114c6b625ae1f71)
|
||||||
|
- [Deps] update `get-intrinsic` [`f23e931`](https://github.com/ljharb/call-bind/commit/f23e9318cc271c2add8bb38cfded85ee7baf8eee)
|
||||||
|
- [Deps] update `get-intrinsic` [`72d9f44`](https://github.com/ljharb/call-bind/commit/72d9f44e184465ba8dd3fb48260bbcff234985f2)
|
||||||
|
- [meta] fix FUNDING.yml [`e723573`](https://github.com/ljharb/call-bind/commit/e723573438c5a68dcec31fb5d96ea6b7e4a93be8)
|
||||||
|
- [eslint] ignore coverage output [`15e76d2`](https://github.com/ljharb/call-bind/commit/15e76d28a5f43e504696401e5b31ebb78ee1b532)
|
||||||
|
- [meta] add Automatic Rebase and Require Allow Edits workflows [`8fa4dab`](https://github.com/ljharb/call-bind/commit/8fa4dabb23ba3dd7bb92c9571c1241c08b56e4b6)
|
||||||
|
|
||||||
|
## v1.0.0 - 2020-10-30
|
||||||
|
|
||||||
|
### Commits
|
||||||
|
|
||||||
|
- Initial commit [`306cf98`](https://github.com/ljharb/call-bind/commit/306cf98c7ec9e7ef66b653ec152277ac1381eb50)
|
||||||
|
- Tests [`e10d0bb`](https://github.com/ljharb/call-bind/commit/e10d0bbdadc7a10ecedc9a1c035112d3e368b8df)
|
||||||
|
- Implementation [`43852ed`](https://github.com/ljharb/call-bind/commit/43852eda0f187327b7fad2423ca972149a52bd65)
|
||||||
|
- npm init [`408f860`](https://github.com/ljharb/call-bind/commit/408f860b773a2f610805fd3613d0d71bac1b6249)
|
||||||
|
- [meta] add Automatic Rebase and Require Allow Edits workflows [`fb349b2`](https://github.com/ljharb/call-bind/commit/fb349b2e48defbec8b5ec8a8395cc8f69f220b13)
|
||||||
|
- [meta] add `auto-changelog` [`c4001fc`](https://github.com/ljharb/call-bind/commit/c4001fc43031799ef908211c98d3b0fb2b60fde4)
|
||||||
|
- [meta] add "funding"; create `FUNDING.yml` [`d4d6d29`](https://github.com/ljharb/call-bind/commit/d4d6d2974a14bc2e98830468eda7fe6d6a776717)
|
||||||
|
- [Tests] add `npm run lint` [`dedfb98`](https://github.com/ljharb/call-bind/commit/dedfb98bd0ecefb08ddb9a94061bd10cde4332af)
|
||||||
|
- Only apps should have lockfiles [`54ac776`](https://github.com/ljharb/call-bind/commit/54ac77653db45a7361dc153d2f478e743f110650)
|
||||||
|
- [meta] add `safe-publish-latest` [`9ea8e43`](https://github.com/ljharb/call-bind/commit/9ea8e435b950ce9b705559cd651039f9bf40140f)
|
21
IP/node_modules/.call-bind-l24kcOp1/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2020 Jordan Harband
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
2
IP/node_modules/.call-bind-l24kcOp1/README.md
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# call-bind
|
||||||
|
Robustly `.call.bind()` a function.
|
15
IP/node_modules/.call-bind-l24kcOp1/callBound.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var GetIntrinsic = require('get-intrinsic');
|
||||||
|
|
||||||
|
var callBind = require('./');
|
||||||
|
|
||||||
|
var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
|
||||||
|
|
||||||
|
module.exports = function callBoundIntrinsic(name, allowMissing) {
|
||||||
|
var intrinsic = GetIntrinsic(name, !!allowMissing);
|
||||||
|
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
||||||
|
return callBind(intrinsic);
|
||||||
|
}
|
||||||
|
return intrinsic;
|
||||||
|
};
|
47
IP/node_modules/.call-bind-l24kcOp1/index.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var bind = require('function-bind');
|
||||||
|
var GetIntrinsic = require('get-intrinsic');
|
||||||
|
|
||||||
|
var $apply = GetIntrinsic('%Function.prototype.apply%');
|
||||||
|
var $call = GetIntrinsic('%Function.prototype.call%');
|
||||||
|
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
|
||||||
|
|
||||||
|
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
||||||
|
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
||||||
|
var $max = GetIntrinsic('%Math.max%');
|
||||||
|
|
||||||
|
if ($defineProperty) {
|
||||||
|
try {
|
||||||
|
$defineProperty({}, 'a', { value: 1 });
|
||||||
|
} catch (e) {
|
||||||
|
// IE 8 has a broken defineProperty
|
||||||
|
$defineProperty = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = function callBind(originalFunction) {
|
||||||
|
var func = $reflectApply(bind, $call, arguments);
|
||||||
|
if ($gOPD && $defineProperty) {
|
||||||
|
var desc = $gOPD(func, 'length');
|
||||||
|
if (desc.configurable) {
|
||||||
|
// original length, plus the receiver, minus any additional arguments (after the receiver)
|
||||||
|
$defineProperty(
|
||||||
|
func,
|
||||||
|
'length',
|
||||||
|
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return func;
|
||||||
|
};
|
||||||
|
|
||||||
|
var applyBind = function applyBind() {
|
||||||
|
return $reflectApply(bind, $apply, arguments);
|
||||||
|
};
|
||||||
|
|
||||||
|
if ($defineProperty) {
|
||||||
|
$defineProperty(module.exports, 'apply', { value: applyBind });
|
||||||
|
} else {
|
||||||
|
module.exports.apply = applyBind;
|
||||||
|
}
|
80
IP/node_modules/.call-bind-l24kcOp1/package.json
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
{
|
||||||
|
"name": "call-bind",
|
||||||
|
"version": "1.0.2",
|
||||||
|
"description": "Robustly `.call.bind()` a function",
|
||||||
|
"main": "index.js",
|
||||||
|
"exports": {
|
||||||
|
".": [
|
||||||
|
{
|
||||||
|
"default": "./index.js"
|
||||||
|
},
|
||||||
|
"./index.js"
|
||||||
|
],
|
||||||
|
"./callBound": [
|
||||||
|
{
|
||||||
|
"default": "./callBound.js"
|
||||||
|
},
|
||||||
|
"./callBound.js"
|
||||||
|
],
|
||||||
|
"./package.json": "./package.json"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"prepublish": "safe-publish-latest",
|
||||||
|
"lint": "eslint --ext=.js,.mjs .",
|
||||||
|
"pretest": "npm run lint",
|
||||||
|
"tests-only": "nyc tape 'test/*'",
|
||||||
|
"test": "npm run tests-only",
|
||||||
|
"posttest": "aud --production",
|
||||||
|
"version": "auto-changelog && git add CHANGELOG.md",
|
||||||
|
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/ljharb/call-bind.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"javascript",
|
||||||
|
"ecmascript",
|
||||||
|
"es",
|
||||||
|
"js",
|
||||||
|
"callbind",
|
||||||
|
"callbound",
|
||||||
|
"call",
|
||||||
|
"bind",
|
||||||
|
"bound",
|
||||||
|
"call-bind",
|
||||||
|
"call-bound",
|
||||||
|
"function",
|
||||||
|
"es-abstract"
|
||||||
|
],
|
||||||
|
"author": "Jordan Harband <ljharb@gmail.com>",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/ljharb/call-bind/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/ljharb/call-bind#readme",
|
||||||
|
"devDependencies": {
|
||||||
|
"@ljharb/eslint-config": "^17.3.0",
|
||||||
|
"aud": "^1.1.3",
|
||||||
|
"auto-changelog": "^2.2.1",
|
||||||
|
"eslint": "^7.17.0",
|
||||||
|
"nyc": "^10.3.2",
|
||||||
|
"safe-publish-latest": "^1.1.4",
|
||||||
|
"tape": "^5.1.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"function-bind": "^1.1.1",
|
||||||
|
"get-intrinsic": "^1.0.2"
|
||||||
|
},
|
||||||
|
"auto-changelog": {
|
||||||
|
"output": "CHANGELOG.md",
|
||||||
|
"template": "keepachangelog",
|
||||||
|
"unreleased": false,
|
||||||
|
"commitLimit": false,
|
||||||
|
"backfillLimit": false,
|
||||||
|
"hideCredit": true
|
||||||
|
}
|
||||||
|
}
|
55
IP/node_modules/.call-bind-l24kcOp1/test/callBound.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var test = require('tape');
|
||||||
|
|
||||||
|
var callBound = require('../callBound');
|
||||||
|
|
||||||
|
test('callBound', function (t) {
|
||||||
|
// static primitive
|
||||||
|
t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself');
|
||||||
|
t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself');
|
||||||
|
|
||||||
|
// static non-function object
|
||||||
|
t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself');
|
||||||
|
t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself');
|
||||||
|
t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself');
|
||||||
|
t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself');
|
||||||
|
|
||||||
|
// static function
|
||||||
|
t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself');
|
||||||
|
t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself');
|
||||||
|
|
||||||
|
// prototype primitive
|
||||||
|
t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself');
|
||||||
|
t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself');
|
||||||
|
|
||||||
|
// prototype function
|
||||||
|
t.notEqual(callBound('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString does not yield itself');
|
||||||
|
t.notEqual(callBound('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% does not yield itself');
|
||||||
|
t.equal(callBound('Object.prototype.toString')(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original');
|
||||||
|
t.equal(callBound('%Object.prototype.toString%')(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original');
|
||||||
|
|
||||||
|
t['throws'](
|
||||||
|
function () { callBound('does not exist'); },
|
||||||
|
SyntaxError,
|
||||||
|
'nonexistent intrinsic throws'
|
||||||
|
);
|
||||||
|
t['throws'](
|
||||||
|
function () { callBound('does not exist', true); },
|
||||||
|
SyntaxError,
|
||||||
|
'allowMissing arg still throws for unknown intrinsic'
|
||||||
|
);
|
||||||
|
|
||||||
|
/* globals WeakRef: false */
|
||||||
|
t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) {
|
||||||
|
st['throws'](
|
||||||
|
function () { callBound('WeakRef'); },
|
||||||
|
TypeError,
|
||||||
|
'real but absent intrinsic throws'
|
||||||
|
);
|
||||||
|
st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception');
|
||||||
|
st.end();
|
||||||
|
});
|
||||||
|
|
||||||
|
t.end();
|
||||||
|
});
|
66
IP/node_modules/.call-bind-l24kcOp1/test/index.js
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var callBind = require('../');
|
||||||
|
var bind = require('function-bind');
|
||||||
|
|
||||||
|
var test = require('tape');
|
||||||
|
|
||||||
|
/*
|
||||||
|
* older engines have length nonconfigurable
|
||||||
|
* in io.js v3, it is configurable except on bound functions, hence the .bind()
|
||||||
|
*/
|
||||||
|
var functionsHaveConfigurableLengths = !!(
|
||||||
|
Object.getOwnPropertyDescriptor
|
||||||
|
&& Object.getOwnPropertyDescriptor(bind.call(function () {}), 'length').configurable
|
||||||
|
);
|
||||||
|
|
||||||
|
test('callBind', function (t) {
|
||||||
|
var sentinel = { sentinel: true };
|
||||||
|
var func = function (a, b) {
|
||||||
|
// eslint-disable-next-line no-invalid-this
|
||||||
|
return [this, a, b];
|
||||||
|
};
|
||||||
|
t.equal(func.length, 2, 'original function length is 2');
|
||||||
|
t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args');
|
||||||
|
t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args');
|
||||||
|
t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args');
|
||||||
|
|
||||||
|
var bound = callBind(func);
|
||||||
|
t.equal(bound.length, func.length + 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths });
|
||||||
|
t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with too few args');
|
||||||
|
t.deepEqual(bound(1, 2), [1, 2, undefined], 'bound func with right args');
|
||||||
|
t.deepEqual(bound(1, 2, 3), [1, 2, 3], 'bound func with too many args');
|
||||||
|
|
||||||
|
var boundR = callBind(func, sentinel);
|
||||||
|
t.equal(boundR.length, func.length, 'function length is preserved', { skip: !functionsHaveConfigurableLengths });
|
||||||
|
t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args');
|
||||||
|
t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args');
|
||||||
|
t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args');
|
||||||
|
|
||||||
|
var boundArg = callBind(func, sentinel, 1);
|
||||||
|
t.equal(boundArg.length, func.length - 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths });
|
||||||
|
t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args');
|
||||||
|
t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg');
|
||||||
|
t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args');
|
||||||
|
|
||||||
|
t.test('callBind.apply', function (st) {
|
||||||
|
var aBound = callBind.apply(func);
|
||||||
|
st.deepEqual(aBound(sentinel), [sentinel, undefined, undefined], 'apply-bound func with no args');
|
||||||
|
st.deepEqual(aBound(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args');
|
||||||
|
st.deepEqual(aBound(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args');
|
||||||
|
|
||||||
|
var aBoundArg = callBind.apply(func);
|
||||||
|
st.deepEqual(aBoundArg(sentinel, [1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with too many args');
|
||||||
|
st.deepEqual(aBoundArg(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args');
|
||||||
|
st.deepEqual(aBoundArg(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args');
|
||||||
|
|
||||||
|
var aBoundR = callBind.apply(func, sentinel);
|
||||||
|
st.deepEqual(aBoundR([1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with receiver and too many args');
|
||||||
|
st.deepEqual(aBoundR([1, 2], 4), [sentinel, 1, 2], 'apply-bound func with receiver and right args');
|
||||||
|
st.deepEqual(aBoundR([1], 4), [sentinel, 1, undefined], 'apply-bound func with receiver and too few args');
|
||||||
|
|
||||||
|
st.end();
|
||||||
|
});
|
||||||
|
|
||||||
|
t.end();
|
||||||
|
});
|
24
IP/node_modules/.define-data-property-EGe29QAY/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
|
||||||
|
"extends": "@ljharb",
|
||||||
|
|
||||||
|
"rules": {
|
||||||
|
"complexity": 0,
|
||||||
|
"id-length": 0,
|
||||||
|
"new-cap": ["error", {
|
||||||
|
"capIsNewExceptions": [
|
||||||
|
"GetIntrinsic",
|
||||||
|
],
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": "test/**",
|
||||||
|
"rules": {
|
||||||
|
"max-lines-per-function": "off",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
12
IP/node_modules/.define-data-property-EGe29QAY/.github/FUNDING.yml
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: [ljharb]
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: # Replace with a single Open Collective username
|
||||||
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
tidelift: npm/define-data-property
|
||||||
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
|
liberapay: # Replace with a single Liberapay username
|
||||||
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
|
otechie: # Replace with a single Otechie username
|
||||||
|
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
13
IP/node_modules/.define-data-property-EGe29QAY/.nycrc
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"all": true,
|
||||||
|
"check-coverage": false,
|
||||||
|
"reporter": ["text-summary", "text", "html", "json"],
|
||||||
|
"lines": 86,
|
||||||
|
"statements": 85.93,
|
||||||
|
"functions": 82.43,
|
||||||
|
"branches": 76.06,
|
||||||
|
"exclude": [
|
||||||
|
"coverage",
|
||||||
|
"test"
|
||||||
|
]
|
||||||
|
}
|
31
IP/node_modules/.define-data-property-EGe29QAY/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [v1.1.0](https://github.com/ljharb/define-data-property/compare/v1.0.1...v1.1.0) - 2023-09-13
|
||||||
|
|
||||||
|
### Commits
|
||||||
|
|
||||||
|
- [New] add `loose` arg [`155235a`](https://github.com/ljharb/define-data-property/commit/155235a4c4d7741f6de01cd87c99599a56654b72)
|
||||||
|
- [New] allow `null` to be passed for the non* args [`7d2fa5f`](https://github.com/ljharb/define-data-property/commit/7d2fa5f06be0392736c13b126f7cd38979f34792)
|
||||||
|
|
||||||
|
## [v1.0.1](https://github.com/ljharb/define-data-property/compare/v1.0.0...v1.0.1) - 2023-09-12
|
||||||
|
|
||||||
|
### Commits
|
||||||
|
|
||||||
|
- [meta] add TS types [`43d763c`](https://github.com/ljharb/define-data-property/commit/43d763c6c883f652de1c9c02ef6216ee507ffa69)
|
||||||
|
- [Dev Deps] update `@types/tape`, `typescript` [`f444985`](https://github.com/ljharb/define-data-property/commit/f444985811c36f3e6448a03ad2f9b7898917f4c7)
|
||||||
|
- [meta] add `safe-publish-latest`, [`172bb10`](https://github.com/ljharb/define-data-property/commit/172bb10890896ebb160e64398f6ee55760107bee)
|
||||||
|
|
||||||
|
## v1.0.0 - 2023-09-12
|
||||||
|
|
||||||
|
### Commits
|
||||||
|
|
||||||
|
- Initial implementation, tests, readme [`5b43d6b`](https://github.com/ljharb/define-data-property/commit/5b43d6b44e675a904810467a7d4e0adb7efc3196)
|
||||||
|
- Initial commit [`35e577a`](https://github.com/ljharb/define-data-property/commit/35e577a6ba59a98befa97776d70d90f3bea9009d)
|
||||||
|
- npm init [`82a0a04`](https://github.com/ljharb/define-data-property/commit/82a0a04a321ca7de220af02d41e2745e8a9962ed)
|
||||||
|
- Only apps should have lockfiles [`96df244`](https://github.com/ljharb/define-data-property/commit/96df244a3c6f426f9a2437be825d1c6f5dd7158e)
|
||||||
|
- [meta] use `npmignore` to autogenerate an npmignore file [`a87ff18`](https://github.com/ljharb/define-data-property/commit/a87ff18cb79e14c2eb5720486c4759fd9a189375)
|
21
IP/node_modules/.define-data-property-EGe29QAY/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2023 Jordan Harband
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
67
IP/node_modules/.define-data-property-EGe29QAY/README.md
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
# define-data-property <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
||||||
|
|
||||||
|
[![github actions][actions-image]][actions-url]
|
||||||
|
[![coverage][codecov-image]][codecov-url]
|
||||||
|
[![License][license-image]][license-url]
|
||||||
|
[![Downloads][downloads-image]][downloads-url]
|
||||||
|
|
||||||
|
[![npm badge][npm-badge-png]][package-url]
|
||||||
|
|
||||||
|
Define a data property on an object. Will fall back to assignment in an engine without descriptors.
|
||||||
|
|
||||||
|
The three `non*` argument can also be passed `null`, which will use the existing state if available.
|
||||||
|
|
||||||
|
The `loose` argument will mean that if you attempt to set a non-normal data property, in an environment without descriptor support, it will fall back to normal assignment.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var defineDataProperty = require('define-data-property');
|
||||||
|
var assert = require('assert');
|
||||||
|
|
||||||
|
var obj = {};
|
||||||
|
defineDataProperty(obj, 'key', 'value');
|
||||||
|
defineDataProperty(
|
||||||
|
obj,
|
||||||
|
'key2',
|
||||||
|
'value',
|
||||||
|
true, // nonEnumerable, optional
|
||||||
|
false, // nonWritable, optional
|
||||||
|
true, // nonConfigurable, optional
|
||||||
|
false // loose, optional
|
||||||
|
);
|
||||||
|
|
||||||
|
assert.deepEqual(
|
||||||
|
Object.getOwnPropertyDescriptors(obj),
|
||||||
|
{
|
||||||
|
key: {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
value: 'value',
|
||||||
|
writable: true,
|
||||||
|
},
|
||||||
|
key2: {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
value: 'value',
|
||||||
|
writable: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
[package-url]: https://npmjs.org/package/define-data-property
|
||||||
|
[npm-version-svg]: https://versionbadg.es/ljharb/define-data-property.svg
|
||||||
|
[deps-svg]: https://david-dm.org/ljharb/define-data-property.svg
|
||||||
|
[deps-url]: https://david-dm.org/ljharb/define-data-property
|
||||||
|
[dev-deps-svg]: https://david-dm.org/ljharb/define-data-property/dev-status.svg
|
||||||
|
[dev-deps-url]: https://david-dm.org/ljharb/define-data-property#info=devDependencies
|
||||||
|
[npm-badge-png]: https://nodei.co/npm/define-data-property.png?downloads=true&stars=true
|
||||||
|
[license-image]: https://img.shields.io/npm/l/define-data-property.svg
|
||||||
|
[license-url]: LICENSE
|
||||||
|
[downloads-image]: https://img.shields.io/npm/dm/define-data-property.svg
|
||||||
|
[downloads-url]: https://npm-stat.com/charts.html?package=define-data-property
|
||||||
|
[codecov-image]: https://codecov.io/gh/ljharb/define-data-property/branch/main/graphs/badge.svg
|
||||||
|
[codecov-url]: https://app.codecov.io/gh/ljharb/define-data-property/
|
||||||
|
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/define-data-property
|
||||||
|
[actions-url]: https://github.com/ljharb/define-data-property/actions
|
3
IP/node_modules/.define-data-property-EGe29QAY/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
declare const _exports: (obj: Record<PropertyKey, unknown>, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void;
|
||||||
|
export = _exports;
|
||||||
|
//# sourceMappingURL=index.d.ts.map
|
1
IP/node_modules/.define-data-property-EGe29QAY/index.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"8BAaiB,OAAO,WAAW,EAAE,OAAO,CAAC,YAAY,WAAW,SAAS,OAAO,kBAAkB,OAAO,GAAG,IAAI,gBAAgB,OAAO,GAAG,IAAI,oBAAoB,OAAO,GAAG,IAAI,UAAU,OAAO,KAAK,IAAI"}
|
60
IP/node_modules/.define-data-property-EGe29QAY/index.js
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var hasPropertyDescriptors = require('has-property-descriptors')();
|
||||||
|
|
||||||
|
var GetIntrinsic = require('get-intrinsic');
|
||||||
|
|
||||||
|
var $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);
|
||||||
|
|
||||||
|
var $SyntaxError = GetIntrinsic('%SyntaxError%');
|
||||||
|
var $TypeError = GetIntrinsic('%TypeError%');
|
||||||
|
|
||||||
|
var gopd = require('gopd');
|
||||||
|
|
||||||
|
/** @type {(obj: Record<PropertyKey, unknown>, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */
|
||||||
|
module.exports = function defineDataProperty(
|
||||||
|
obj,
|
||||||
|
property,
|
||||||
|
value
|
||||||
|
) {
|
||||||
|
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||||
|
throw new $TypeError('`obj` must be an object or a function`');
|
||||||
|
}
|
||||||
|
if (typeof property !== 'string' && typeof property !== 'symbol') {
|
||||||
|
throw new $TypeError('`property` must be a string or a symbol`');
|
||||||
|
}
|
||||||
|
if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
|
||||||
|
throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');
|
||||||
|
}
|
||||||
|
if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
|
||||||
|
throw new $TypeError('`nonWritable`, if provided, must be a boolean or null');
|
||||||
|
}
|
||||||
|
if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
|
||||||
|
throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');
|
||||||
|
}
|
||||||
|
if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
|
||||||
|
throw new $TypeError('`loose`, if provided, must be a boolean');
|
||||||
|
}
|
||||||
|
|
||||||
|
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
||||||
|
var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
||||||
|
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
||||||
|
var loose = arguments.length > 6 ? arguments[6] : false;
|
||||||
|
|
||||||
|
/* @type {false | TypedPropertyDescriptor<unknown>} */
|
||||||
|
var desc = !!gopd && gopd(obj, property);
|
||||||
|
|
||||||
|
if ($defineProperty) {
|
||||||
|
$defineProperty(obj, property, {
|
||||||
|
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
||||||
|
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
||||||
|
value: value,
|
||||||
|
writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
||||||
|
});
|
||||||
|
} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
|
||||||
|
// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
|
||||||
|
obj[property] = value; // eslint-disable-line no-param-reassign
|
||||||
|
} else {
|
||||||
|
throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
|
||||||
|
}
|
||||||
|
};
|
111
IP/node_modules/.define-data-property-EGe29QAY/package.json
generated
vendored
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
{
|
||||||
|
"name": "define-data-property",
|
||||||
|
"version": "1.1.0",
|
||||||
|
"description": "Define a data property on an object. Will fall back to assignment in an engine without descriptors.",
|
||||||
|
"main": "index.js",
|
||||||
|
"exports": {
|
||||||
|
".": [
|
||||||
|
{
|
||||||
|
"types": "./index.d.ts",
|
||||||
|
"default": "./index.js"
|
||||||
|
},
|
||||||
|
"./index.js"
|
||||||
|
],
|
||||||
|
"./package.json": "./package.json"
|
||||||
|
},
|
||||||
|
"sideEffects": false,
|
||||||
|
"types": "./index.d.ts",
|
||||||
|
"scripts": {
|
||||||
|
"prepack": "npmignore --auto --commentLines=autogenerated",
|
||||||
|
"prepublish": "not-in-publish || npm run prepublishOnly",
|
||||||
|
"prepublishOnly": "safe-publish-latest",
|
||||||
|
"tsc": "tsc -p .",
|
||||||
|
"preemit-types": "rm -f *.ts *.ts.map test/*.ts test/*.ts.map",
|
||||||
|
"emit-types": "npm run tsc -- --noEmit false --emitDeclarationOnly",
|
||||||
|
"postemit-types": "rm test/*.ts test/*.ts.map",
|
||||||
|
"prelint": "evalmd README.md",
|
||||||
|
"lint": "eslint --ext=js,mjs .",
|
||||||
|
"postlint": "npm run tsc",
|
||||||
|
"pretest": "npm run lint",
|
||||||
|
"tests-only": "nyc tape 'test/**/*.js'",
|
||||||
|
"test": "npm run tests-only",
|
||||||
|
"posttest": "aud --production",
|
||||||
|
"version": "auto-changelog && git add CHANGELOG.md",
|
||||||
|
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/ljharb/define-data-property.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"define",
|
||||||
|
"data",
|
||||||
|
"property",
|
||||||
|
"object",
|
||||||
|
"accessor",
|
||||||
|
"javascript",
|
||||||
|
"ecmascript",
|
||||||
|
"enumerable",
|
||||||
|
"configurable",
|
||||||
|
"writable"
|
||||||
|
],
|
||||||
|
"author": "Jordan Harband <ljharb@gmail.com>",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/ljharb/define-data-property/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/ljharb/define-data-property#readme",
|
||||||
|
"dependencies": {
|
||||||
|
"get-intrinsic": "^1.2.1",
|
||||||
|
"gopd": "^1.0.1",
|
||||||
|
"has-property-descriptors": "^1.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@ljharb/eslint-config": "^21.1.0",
|
||||||
|
"@types/es-value-fixtures": "^1.4.0",
|
||||||
|
"@types/for-each": "^0.3.0",
|
||||||
|
"@types/get-intrinsic": "^1.2.0",
|
||||||
|
"@types/gopd": "^1.0.0",
|
||||||
|
"@types/has": "^1.0.0",
|
||||||
|
"@types/has-property-descriptors": "^1.0.0",
|
||||||
|
"@types/object-inspect": "^1.8.2",
|
||||||
|
"@types/object.getownpropertydescriptors": "^2.1.2",
|
||||||
|
"@types/tape": "^5.6.1",
|
||||||
|
"aud": "^2.0.3",
|
||||||
|
"auto-changelog": "^2.4.0",
|
||||||
|
"es-value-fixtures": "^1.4.2",
|
||||||
|
"eslint": "=8.8.0",
|
||||||
|
"evalmd": "^0.0.19",
|
||||||
|
"for-each": "^0.3.3",
|
||||||
|
"has": "^1.0.3",
|
||||||
|
"in-publish": "^2.0.1",
|
||||||
|
"npmignore": "^0.3.0",
|
||||||
|
"nyc": "^10.3.2",
|
||||||
|
"object-inspect": "^1.12.3",
|
||||||
|
"object.getownpropertydescriptors": "^2.1.7",
|
||||||
|
"safe-publish-latest": "^2.0.0",
|
||||||
|
"tape": "^5.6.6",
|
||||||
|
"typescript": "^5.3.0-dev.20230912"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"testling": {
|
||||||
|
"files": "test/index.js"
|
||||||
|
},
|
||||||
|
"auto-changelog": {
|
||||||
|
"output": "CHANGELOG.md",
|
||||||
|
"template": "keepachangelog",
|
||||||
|
"unreleased": false,
|
||||||
|
"commitLimit": false,
|
||||||
|
"backfillLimit": false,
|
||||||
|
"hideCredit": true
|
||||||
|
},
|
||||||
|
"publishConfig": {
|
||||||
|
"ignore": [
|
||||||
|
".github/workflows",
|
||||||
|
"!*.ts",
|
||||||
|
"!*.ts.map"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
397
IP/node_modules/.define-data-property-EGe29QAY/test/index.js
generated
vendored
Normal file
@ -0,0 +1,397 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var test = require('tape');
|
||||||
|
var v = require('es-value-fixtures');
|
||||||
|
var forEach = require('for-each');
|
||||||
|
var inspect = require('object-inspect');
|
||||||
|
var has = require('has');
|
||||||
|
var hasPropertyDescriptors = require('has-property-descriptors')();
|
||||||
|
var getOwnPropertyDescriptors = require('object.getownpropertydescriptors');
|
||||||
|
|
||||||
|
var defineDataProperty = require('../');
|
||||||
|
|
||||||
|
test('defineDataProperty', function (t) {
|
||||||
|
t.test('argument validation', function (st) {
|
||||||
|
forEach(v.primitives, function (nonObject) {
|
||||||
|
st['throws'](
|
||||||
|
// @ts-expect-error
|
||||||
|
function () { defineDataProperty(nonObject, 'key', 'value'); },
|
||||||
|
TypeError,
|
||||||
|
'throws on non-object input: ' + inspect(nonObject)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
forEach(v.nonPropertyKeys, function (nonPropertyKey) {
|
||||||
|
st['throws'](
|
||||||
|
// @ts-expect-error
|
||||||
|
function () { defineDataProperty({}, nonPropertyKey, 'value'); },
|
||||||
|
TypeError,
|
||||||
|
'throws on non-PropertyKey input: ' + inspect(nonPropertyKey)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
forEach(v.nonBooleans, function (nonBoolean) {
|
||||||
|
if (nonBoolean !== null) {
|
||||||
|
st['throws'](
|
||||||
|
// @ts-expect-error
|
||||||
|
function () { defineDataProperty({}, 'key', 'value', nonBoolean); },
|
||||||
|
TypeError,
|
||||||
|
'throws on non-boolean nonEnumerable: ' + inspect(nonBoolean)
|
||||||
|
);
|
||||||
|
|
||||||
|
st['throws'](
|
||||||
|
// @ts-expect-error
|
||||||
|
function () { defineDataProperty({}, 'key', 'value', false, nonBoolean); },
|
||||||
|
TypeError,
|
||||||
|
'throws on non-boolean nonWritable: ' + inspect(nonBoolean)
|
||||||
|
);
|
||||||
|
|
||||||
|
st['throws'](
|
||||||
|
// @ts-expect-error
|
||||||
|
function () { defineDataProperty({}, 'key', 'value', false, false, nonBoolean); },
|
||||||
|
TypeError,
|
||||||
|
'throws on non-boolean nonConfigurable: ' + inspect(nonBoolean)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
st.end();
|
||||||
|
});
|
||||||
|
|
||||||
|
t.test('normal data property', function (st) {
|
||||||
|
/** @type {Record<PropertyKey, string>} */
|
||||||
|
var obj = { existing: 'existing property' };
|
||||||
|
st.ok(has(obj, 'existing'), 'has initial own property');
|
||||||
|
st.equal(obj.existing, 'existing property', 'has expected initial value');
|
||||||
|
|
||||||
|
var res = defineDataProperty(obj, 'added', 'added property');
|
||||||
|
st.equal(res, void undefined, 'returns `undefined`');
|
||||||
|
st.ok(has(obj, 'added'), 'has expected own property');
|
||||||
|
st.equal(obj.added, 'added property', 'has expected value');
|
||||||
|
|
||||||
|
defineDataProperty(obj, 'existing', 'new value');
|
||||||
|
st.ok(has(obj, 'existing'), 'still has expected own property');
|
||||||
|
st.equal(obj.existing, 'new value', 'has new expected value');
|
||||||
|
|
||||||
|
defineDataProperty(obj, 'explicit1', 'new value', false);
|
||||||
|
st.ok(has(obj, 'explicit1'), 'has expected own property (explicit enumerable)');
|
||||||
|
st.equal(obj.explicit1, 'new value', 'has new expected value (explicit enumerable)');
|
||||||
|
|
||||||
|
defineDataProperty(obj, 'explicit2', 'new value', false, false);
|
||||||
|
st.ok(has(obj, 'explicit2'), 'has expected own property (explicit writable)');
|
||||||
|
st.equal(obj.explicit2, 'new value', 'has new expected value (explicit writable)');
|
||||||
|
|
||||||
|
defineDataProperty(obj, 'explicit3', 'new value', false, false, false);
|
||||||
|
st.ok(has(obj, 'explicit3'), 'has expected own property (explicit configurable)');
|
||||||
|
st.equal(obj.explicit3, 'new value', 'has new expected value (explicit configurable)');
|
||||||
|
|
||||||
|
st.end();
|
||||||
|
});
|
||||||
|
|
||||||
|
t.test('loose mode', function (st) {
|
||||||
|
var obj = { existing: 'existing property' };
|
||||||
|
|
||||||
|
defineDataProperty(obj, 'added', 'added value 1', true, null, null, true);
|
||||||
|
st.deepEqual(
|
||||||
|
getOwnPropertyDescriptors(obj),
|
||||||
|
{
|
||||||
|
existing: {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
value: 'existing property',
|
||||||
|
writable: true
|
||||||
|
},
|
||||||
|
added: {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: !hasPropertyDescriptors,
|
||||||
|
value: 'added value 1',
|
||||||
|
writable: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'in loose mode, obj still adds property 1'
|
||||||
|
);
|
||||||
|
|
||||||
|
defineDataProperty(obj, 'added', 'added value 2', false, true, null, true);
|
||||||
|
st.deepEqual(
|
||||||
|
getOwnPropertyDescriptors(obj),
|
||||||
|
{
|
||||||
|
existing: {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
value: 'existing property',
|
||||||
|
writable: true
|
||||||
|
},
|
||||||
|
added: {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
value: 'added value 2',
|
||||||
|
writable: !hasPropertyDescriptors
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'in loose mode, obj still adds property 2'
|
||||||
|
);
|
||||||
|
|
||||||
|
defineDataProperty(obj, 'added', 'added value 3', false, false, true, true);
|
||||||
|
st.deepEqual(
|
||||||
|
getOwnPropertyDescriptors(obj),
|
||||||
|
{
|
||||||
|
existing: {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
value: 'existing property',
|
||||||
|
writable: true
|
||||||
|
},
|
||||||
|
added: {
|
||||||
|
configurable: !hasPropertyDescriptors,
|
||||||
|
enumerable: true,
|
||||||
|
value: 'added value 3',
|
||||||
|
writable: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'in loose mode, obj still adds property 3'
|
||||||
|
);
|
||||||
|
|
||||||
|
st.end();
|
||||||
|
});
|
||||||
|
|
||||||
|
t.test('non-normal data property, ES3', { skip: hasPropertyDescriptors }, function (st) {
|
||||||
|
/** @type {Record<PropertyKey, string>} */
|
||||||
|
var obj = { existing: 'existing property' };
|
||||||
|
|
||||||
|
st['throws'](
|
||||||
|
function () { defineDataProperty(obj, 'added', 'added value', true); },
|
||||||
|
SyntaxError,
|
||||||
|
'nonEnumerable throws a Syntax Error'
|
||||||
|
);
|
||||||
|
|
||||||
|
st['throws'](
|
||||||
|
function () { defineDataProperty(obj, 'added', 'added value', false, true); },
|
||||||
|
SyntaxError,
|
||||||
|
'nonWritable throws a Syntax Error'
|
||||||
|
);
|
||||||
|
|
||||||
|
st['throws'](
|
||||||
|
function () { defineDataProperty(obj, 'added', 'added value', false, false, true); },
|
||||||
|
SyntaxError,
|
||||||
|
'nonWritable throws a Syntax Error'
|
||||||
|
);
|
||||||
|
|
||||||
|
st.deepEqual(
|
||||||
|
getOwnPropertyDescriptors(obj),
|
||||||
|
{
|
||||||
|
existing: {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
value: 'existing property',
|
||||||
|
writable: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'obj still has expected descriptors'
|
||||||
|
);
|
||||||
|
|
||||||
|
st.end();
|
||||||
|
});
|
||||||
|
|
||||||
|
t.test('new non-normal data property, ES5+', { skip: !hasPropertyDescriptors }, function (st) {
|
||||||
|
/** @type {Record<PropertyKey, string>} */
|
||||||
|
var obj = { existing: 'existing property' };
|
||||||
|
|
||||||
|
defineDataProperty(obj, 'nonEnum', null, true);
|
||||||
|
defineDataProperty(obj, 'nonWrit', null, false, true);
|
||||||
|
defineDataProperty(obj, 'nonConf', null, false, false, true);
|
||||||
|
|
||||||
|
st.deepEqual(
|
||||||
|
getOwnPropertyDescriptors(obj),
|
||||||
|
{
|
||||||
|
existing: {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
value: 'existing property',
|
||||||
|
writable: true
|
||||||
|
},
|
||||||
|
nonEnum: {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: false,
|
||||||
|
value: null,
|
||||||
|
writable: true
|
||||||
|
},
|
||||||
|
nonWrit: {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
value: null,
|
||||||
|
writable: false
|
||||||
|
},
|
||||||
|
nonConf: {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: true,
|
||||||
|
value: null,
|
||||||
|
writable: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'obj has expected property descriptors'
|
||||||
|
);
|
||||||
|
|
||||||
|
st.end();
|
||||||
|
});
|
||||||
|
|
||||||
|
t.test('existing non-normal data property, ES5+', { skip: !hasPropertyDescriptors }, function (st) {
|
||||||
|
// test case changing an existing non-normal property
|
||||||
|
|
||||||
|
/** @type {Record<string, null | string>} */
|
||||||
|
var obj = {};
|
||||||
|
Object.defineProperty(obj, 'nonEnum', { configurable: true, enumerable: false, value: null, writable: true });
|
||||||
|
Object.defineProperty(obj, 'nonWrit', { configurable: true, enumerable: true, value: null, writable: false });
|
||||||
|
Object.defineProperty(obj, 'nonConf', { configurable: false, enumerable: true, value: null, writable: true });
|
||||||
|
|
||||||
|
st.deepEqual(
|
||||||
|
getOwnPropertyDescriptors(obj),
|
||||||
|
{
|
||||||
|
nonEnum: {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: false,
|
||||||
|
value: null,
|
||||||
|
writable: true
|
||||||
|
},
|
||||||
|
nonWrit: {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
value: null,
|
||||||
|
writable: false
|
||||||
|
},
|
||||||
|
nonConf: {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: true,
|
||||||
|
value: null,
|
||||||
|
writable: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'obj initially has expected property descriptors'
|
||||||
|
);
|
||||||
|
|
||||||
|
defineDataProperty(obj, 'nonEnum', 'new value', false);
|
||||||
|
defineDataProperty(obj, 'nonWrit', 'new value', false, false);
|
||||||
|
st['throws'](
|
||||||
|
function () { defineDataProperty(obj, 'nonConf', 'new value', false, false, false); },
|
||||||
|
TypeError,
|
||||||
|
'can not alter a nonconfigurable property'
|
||||||
|
);
|
||||||
|
|
||||||
|
st.deepEqual(
|
||||||
|
getOwnPropertyDescriptors(obj),
|
||||||
|
{
|
||||||
|
nonEnum: {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
value: 'new value',
|
||||||
|
writable: true
|
||||||
|
},
|
||||||
|
nonWrit: {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
value: 'new value',
|
||||||
|
writable: true
|
||||||
|
},
|
||||||
|
nonConf: {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: true,
|
||||||
|
value: null,
|
||||||
|
writable: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'obj ends up with expected property descriptors'
|
||||||
|
);
|
||||||
|
|
||||||
|
st.end();
|
||||||
|
});
|
||||||
|
|
||||||
|
t.test('frozen object, ES5+', { skip: !hasPropertyDescriptors }, function (st) {
|
||||||
|
var frozen = Object.freeze({ existing: true });
|
||||||
|
|
||||||
|
st['throws'](
|
||||||
|
function () { defineDataProperty(frozen, 'existing', 'new value'); },
|
||||||
|
TypeError,
|
||||||
|
'frozen object can not modify an existing property'
|
||||||
|
);
|
||||||
|
|
||||||
|
st['throws'](
|
||||||
|
function () { defineDataProperty(frozen, 'new', 'new property'); },
|
||||||
|
TypeError,
|
||||||
|
'frozen object can not add a new property'
|
||||||
|
);
|
||||||
|
|
||||||
|
st.end();
|
||||||
|
});
|
||||||
|
|
||||||
|
t.test('sealed object, ES5+', { skip: !hasPropertyDescriptors }, function (st) {
|
||||||
|
var sealed = Object.seal({ existing: true });
|
||||||
|
st.deepEqual(
|
||||||
|
Object.getOwnPropertyDescriptor(sealed, 'existing'),
|
||||||
|
{
|
||||||
|
configurable: false,
|
||||||
|
enumerable: true,
|
||||||
|
value: true,
|
||||||
|
writable: true
|
||||||
|
},
|
||||||
|
'existing value on sealed object has expected descriptor'
|
||||||
|
);
|
||||||
|
|
||||||
|
defineDataProperty(sealed, 'existing', 'new value');
|
||||||
|
|
||||||
|
st.deepEqual(
|
||||||
|
Object.getOwnPropertyDescriptor(sealed, 'existing'),
|
||||||
|
{
|
||||||
|
configurable: false,
|
||||||
|
enumerable: true,
|
||||||
|
value: 'new value',
|
||||||
|
writable: true
|
||||||
|
},
|
||||||
|
'existing value on sealed object has changed descriptor'
|
||||||
|
);
|
||||||
|
|
||||||
|
st['throws'](
|
||||||
|
function () { defineDataProperty(sealed, 'new', 'new property'); },
|
||||||
|
TypeError,
|
||||||
|
'sealed object can not add a new property'
|
||||||
|
);
|
||||||
|
|
||||||
|
st.end();
|
||||||
|
});
|
||||||
|
|
||||||
|
t.test('nonextensible object, ES5+', { skip: !hasPropertyDescriptors }, function (st) {
|
||||||
|
var nonExt = Object.preventExtensions({ existing: true });
|
||||||
|
|
||||||
|
st.deepEqual(
|
||||||
|
Object.getOwnPropertyDescriptor(nonExt, 'existing'),
|
||||||
|
{
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
value: true,
|
||||||
|
writable: true
|
||||||
|
},
|
||||||
|
'existing value on non-extensible object has expected descriptor'
|
||||||
|
);
|
||||||
|
|
||||||
|
defineDataProperty(nonExt, 'existing', 'new value', true);
|
||||||
|
|
||||||
|
st.deepEqual(
|
||||||
|
Object.getOwnPropertyDescriptor(nonExt, 'existing'),
|
||||||
|
{
|
||||||
|
configurable: true,
|
||||||
|
enumerable: false,
|
||||||
|
value: 'new value',
|
||||||
|
writable: true
|
||||||
|
},
|
||||||
|
'existing value on non-extensible object has changed descriptor'
|
||||||
|
);
|
||||||
|
|
||||||
|
st['throws'](
|
||||||
|
function () { defineDataProperty(nonExt, 'new', 'new property'); },
|
||||||
|
TypeError,
|
||||||
|
'non-extensible object can not add a new property'
|
||||||
|
);
|
||||||
|
|
||||||
|
st.end();
|
||||||
|
});
|
||||||
|
|
||||||
|
t.end();
|
||||||
|
});
|
58
IP/node_modules/.define-data-property-EGe29QAY/tsconfig.json
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
/* Visit https://aka.ms/tsconfig to read more about this file */
|
||||||
|
|
||||||
|
/* Projects */
|
||||||
|
|
||||||
|
/* Language and Environment */
|
||||||
|
"target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
||||||
|
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||||
|
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
||||||
|
"useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
||||||
|
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
||||||
|
|
||||||
|
/* Modules */
|
||||||
|
"module": "commonjs", /* Specify what module code is generated. */
|
||||||
|
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||||
|
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||||
|
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||||
|
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||||
|
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||||
|
"resolveJsonModule": true, /* Enable importing .json files. */
|
||||||
|
|
||||||
|
/* JavaScript Support */
|
||||||
|
"allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
||||||
|
"checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
||||||
|
"maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
||||||
|
|
||||||
|
/* Emit */
|
||||||
|
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
||||||
|
"declarationMap": true, /* Create sourcemaps for d.ts files. */
|
||||||
|
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
||||||
|
"noEmit": true, /* Disable emitting files from a compilation. */
|
||||||
|
|
||||||
|
/* Interop Constraints */
|
||||||
|
"allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
||||||
|
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
||||||
|
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
||||||
|
|
||||||
|
/* Type Checking */
|
||||||
|
"strict": true, /* Enable all strict type-checking options. */
|
||||||
|
"noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
||||||
|
"noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
||||||
|
"useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
||||||
|
"noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
||||||
|
"noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
||||||
|
"noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
||||||
|
"noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
||||||
|
"noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
||||||
|
"noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
||||||
|
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
||||||
|
|
||||||
|
/* Completeness */
|
||||||
|
// "skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||||
|
},
|
||||||
|
"exclude": [
|
||||||
|
"coverage"
|
||||||
|
]
|
||||||
|
}
|
109
IP/node_modules/.define-data-property-EGe29QAY/tsinit
generated
vendored
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
/* Visit https://aka.ms/tsconfig to read more about this file */
|
||||||
|
|
||||||
|
/* Projects */
|
||||||
|
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
||||||
|
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
||||||
|
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
||||||
|
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
||||||
|
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
||||||
|
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
||||||
|
|
||||||
|
/* Language and Environment */
|
||||||
|
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
||||||
|
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||||
|
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
||||||
|
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
||||||
|
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
||||||
|
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
||||||
|
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
||||||
|
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
||||||
|
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
||||||
|
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
||||||
|
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
||||||
|
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
||||||
|
|
||||||
|
/* Modules */
|
||||||
|
"module": "commonjs", /* Specify what module code is generated. */
|
||||||
|
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||||
|
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||||
|
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||||
|
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||||
|
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||||
|
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
||||||
|
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
||||||
|
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||||
|
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
||||||
|
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
||||||
|
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
||||||
|
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
||||||
|
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
||||||
|
// "resolveJsonModule": true, /* Enable importing .json files. */
|
||||||
|
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
||||||
|
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
||||||
|
|
||||||
|
/* JavaScript Support */
|
||||||
|
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
||||||
|
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
||||||
|
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
||||||
|
|
||||||
|
/* Emit */
|
||||||
|
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
||||||
|
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
||||||
|
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
||||||
|
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||||
|
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
||||||
|
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
||||||
|
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
||||||
|
// "removeComments": true, /* Disable emitting comments. */
|
||||||
|
// "noEmit": true, /* Disable emitting files from a compilation. */
|
||||||
|
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
||||||
|
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
||||||
|
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
||||||
|
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
||||||
|
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||||
|
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
||||||
|
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
||||||
|
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
||||||
|
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
||||||
|
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
||||||
|
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
||||||
|
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
||||||
|
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
||||||
|
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
||||||
|
|
||||||
|
/* Interop Constraints */
|
||||||
|
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
||||||
|
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
||||||
|
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
||||||
|
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
||||||
|
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
||||||
|
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
||||||
|
|
||||||
|
/* Type Checking */
|
||||||
|
"strict": true, /* Enable all strict type-checking options. */
|
||||||
|
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
||||||
|
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
||||||
|
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
||||||
|
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
||||||
|
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
||||||
|
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
||||||
|
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
||||||
|
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
||||||
|
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
||||||
|
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
||||||
|
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
||||||
|
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
||||||
|
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
||||||
|
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
||||||
|
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
||||||
|
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
||||||
|
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
||||||
|
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
||||||
|
|
||||||
|
/* Completeness */
|
||||||
|
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
||||||
|
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||||
|
}
|
||||||
|
}
|
15
IP/node_modules/.es-abstract-S1aq3iW2/.editorconfig
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = tab;
|
||||||
|
insert_final_newline = true;
|
||||||
|
quote_type = auto;
|
||||||
|
space_after_anonymous_functions = true;
|
||||||
|
space_after_control_statements = true;
|
||||||
|
spaces_around_operators = true;
|
||||||
|
trim_trailing_whitespace = true;
|
||||||
|
spaces_in_brackets = false;
|
||||||
|
end_of_line = lf;
|
||||||
|
|
||||||
|
[CHANGELOG.md]
|
||||||
|
indent_style = space
|
88
IP/node_modules/.es-abstract-S1aq3iW2/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
|
||||||
|
"extends": "@ljharb",
|
||||||
|
|
||||||
|
"env": {
|
||||||
|
"es6": true,
|
||||||
|
},
|
||||||
|
|
||||||
|
"rules": {
|
||||||
|
"array-bracket-newline": 0,
|
||||||
|
"complexity": 0,
|
||||||
|
"eqeqeq": [2, "allow-null"],
|
||||||
|
"func-name-matching": 0,
|
||||||
|
"id-length": [2, { "min": 1, "max": 40 }],
|
||||||
|
"max-params": [2, 5],
|
||||||
|
"max-lines-per-function": 1,
|
||||||
|
"max-statements": 1,
|
||||||
|
"max-statements-per-line": [2, { "max": 2 }],
|
||||||
|
"multiline-comment-style": 0,
|
||||||
|
"no-magic-numbers": 0,
|
||||||
|
"new-cap": 0,
|
||||||
|
"no-extra-parens": 1,
|
||||||
|
"sort-keys": 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": "GetIntrinsic.js",
|
||||||
|
"rules": {
|
||||||
|
"max-statements": 0,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": "operations/*",
|
||||||
|
"rules": {
|
||||||
|
"max-lines": 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"operations/deltas.js",
|
||||||
|
"operations/getOps.js",
|
||||||
|
"operations/spackle.js",
|
||||||
|
"operations/years.js",
|
||||||
|
],
|
||||||
|
"extends": "@ljharb/eslint-config/node/latest",
|
||||||
|
"rules": {
|
||||||
|
"complexity": 0,
|
||||||
|
"func-style": 0,
|
||||||
|
"max-lines-per-function": 0,
|
||||||
|
"max-nested-callbacks": 0,
|
||||||
|
"max-statements": 0,
|
||||||
|
"no-magic-numbers": 0,
|
||||||
|
"no-throw-literal": 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": "test/**",
|
||||||
|
"extends": "@ljharb/eslint-config/tests",
|
||||||
|
"rules": {
|
||||||
|
"max-len": 0,
|
||||||
|
"max-lines-per-function": 0,
|
||||||
|
"no-implicit-coercion": 0,
|
||||||
|
"no-invalid-this": 1,
|
||||||
|
"prefer-promise-reject-errors": 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*/Num*ToRawBytes.js",
|
||||||
|
"*/RawBytesToNum*.js",
|
||||||
|
"helpers/bytesAs*.js",
|
||||||
|
"helpers/valueToFloat*.js",
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"max-lines-per-function": "off",
|
||||||
|
"max-statements": "off",
|
||||||
|
"no-redeclare": "warn",
|
||||||
|
"operator-linebreak": [2, "before", {
|
||||||
|
"overrides": {
|
||||||
|
"=": "none"
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
15
IP/node_modules/.es-abstract-S1aq3iW2/.nycrc
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"all": true,
|
||||||
|
"check-coverage": false,
|
||||||
|
"reporter": ["text-summary", "text", "html", "json"],
|
||||||
|
"exclude": [
|
||||||
|
"coverage",
|
||||||
|
"operations",
|
||||||
|
"test",
|
||||||
|
"helpers/callBind.js",
|
||||||
|
"helpers/callBound.js",
|
||||||
|
"helpers/getOwnPropertyDescriptor.js",
|
||||||
|
"helpers/getSymbolDescription.js",
|
||||||
|
"helpers/regexTester.js"
|
||||||
|
]
|
||||||
|
}
|
37
IP/node_modules/.es-abstract-S1aq3iW2/2015/AbstractEqualityComparison.js
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var ToNumber = require('./ToNumber');
|
||||||
|
var ToPrimitive = require('./ToPrimitive');
|
||||||
|
var Type = require('./Type');
|
||||||
|
|
||||||
|
// https://262.ecma-international.org/6.0/#sec-abstract-equality-comparison
|
||||||
|
|
||||||
|
module.exports = function AbstractEqualityComparison(x, y) {
|
||||||
|
var xType = Type(x);
|
||||||
|
var yType = Type(y);
|
||||||
|
if (xType === yType) {
|
||||||
|
return x === y; // ES6+ specified this shortcut anyways.
|
||||||
|
}
|
||||||
|
if (x == null && y == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (xType === 'Number' && yType === 'String') {
|
||||||
|
return AbstractEqualityComparison(x, ToNumber(y));
|
||||||
|
}
|
||||||
|
if (xType === 'String' && yType === 'Number') {
|
||||||
|
return AbstractEqualityComparison(ToNumber(x), y);
|
||||||
|
}
|
||||||
|
if (xType === 'Boolean') {
|
||||||
|
return AbstractEqualityComparison(ToNumber(x), y);
|
||||||
|
}
|
||||||
|
if (yType === 'Boolean') {
|
||||||
|
return AbstractEqualityComparison(x, ToNumber(y));
|
||||||
|
}
|
||||||
|
if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') {
|
||||||
|
return AbstractEqualityComparison(x, ToPrimitive(y));
|
||||||
|
}
|
||||||
|
if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) {
|
||||||
|
return AbstractEqualityComparison(ToPrimitive(x), y);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
63
IP/node_modules/.es-abstract-S1aq3iW2/2015/AbstractRelationalComparison.js
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var GetIntrinsic = require('get-intrinsic');
|
||||||
|
|
||||||
|
var $Number = GetIntrinsic('%Number%');
|
||||||
|
var $TypeError = GetIntrinsic('%TypeError%');
|
||||||
|
|
||||||
|
var $isNaN = require('../helpers/isNaN');
|
||||||
|
var $isFinite = require('../helpers/isFinite');
|
||||||
|
var isPrefixOf = require('../helpers/isPrefixOf');
|
||||||
|
|
||||||
|
var ToNumber = require('./ToNumber');
|
||||||
|
var ToPrimitive = require('./ToPrimitive');
|
||||||
|
var Type = require('./Type');
|
||||||
|
|
||||||
|
// https://262.ecma-international.org/5.1/#sec-11.8.5
|
||||||
|
|
||||||
|
// eslint-disable-next-line max-statements
|
||||||
|
module.exports = function AbstractRelationalComparison(x, y, LeftFirst) {
|
||||||
|
if (Type(LeftFirst) !== 'Boolean') {
|
||||||
|
throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean');
|
||||||
|
}
|
||||||
|
var px;
|
||||||
|
var py;
|
||||||
|
if (LeftFirst) {
|
||||||
|
px = ToPrimitive(x, $Number);
|
||||||
|
py = ToPrimitive(y, $Number);
|
||||||
|
} else {
|
||||||
|
py = ToPrimitive(y, $Number);
|
||||||
|
px = ToPrimitive(x, $Number);
|
||||||
|
}
|
||||||
|
var bothStrings = Type(px) === 'String' && Type(py) === 'String';
|
||||||
|
if (!bothStrings) {
|
||||||
|
var nx = ToNumber(px);
|
||||||
|
var ny = ToNumber(py);
|
||||||
|
if ($isNaN(nx) || $isNaN(ny)) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if ($isFinite(nx) && $isFinite(ny) && nx === ny) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (nx === Infinity) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (ny === Infinity) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (ny === -Infinity) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (nx === -Infinity) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return nx < ny; // by now, these are both nonzero, finite, and not equal
|
||||||
|
}
|
||||||
|
if (isPrefixOf(py, px)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (isPrefixOf(px, py)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f
|
||||||
|
};
|
47
IP/node_modules/.es-abstract-S1aq3iW2/2015/AdvanceStringIndex.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var GetIntrinsic = require('get-intrinsic');
|
||||||
|
|
||||||
|
var Type = require('./Type');
|
||||||
|
|
||||||
|
var isInteger = require('../helpers/isInteger');
|
||||||
|
var isLeadingSurrogate = require('../helpers/isLeadingSurrogate');
|
||||||
|
var isTrailingSurrogate = require('../helpers/isTrailingSurrogate');
|
||||||
|
var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');
|
||||||
|
|
||||||
|
var $TypeError = GetIntrinsic('%TypeError%');
|
||||||
|
|
||||||
|
var $charCodeAt = require('call-bind/callBound')('String.prototype.charCodeAt');
|
||||||
|
|
||||||
|
// https://262.ecma-international.org/6.0/#sec-advancestringindex
|
||||||
|
|
||||||
|
module.exports = function AdvanceStringIndex(S, index, unicode) {
|
||||||
|
if (Type(S) !== 'String') {
|
||||||
|
throw new $TypeError('Assertion failed: `S` must be a String');
|
||||||
|
}
|
||||||
|
if (!isInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {
|
||||||
|
throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53');
|
||||||
|
}
|
||||||
|
if (Type(unicode) !== 'Boolean') {
|
||||||
|
throw new $TypeError('Assertion failed: `unicode` must be a Boolean');
|
||||||
|
}
|
||||||
|
if (!unicode) {
|
||||||
|
return index + 1;
|
||||||
|
}
|
||||||
|
var length = S.length;
|
||||||
|
if ((index + 1) >= length) {
|
||||||
|
return index + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var first = $charCodeAt(S, index);
|
||||||
|
if (!isLeadingSurrogate(first)) {
|
||||||
|
return index + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var second = $charCodeAt(S, index + 1);
|
||||||
|
if (!isTrailingSurrogate(second)) {
|
||||||
|
return index + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return index + 2;
|
||||||
|
};
|
54
IP/node_modules/.es-abstract-S1aq3iW2/2015/ArrayCreate.js
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var GetIntrinsic = require('get-intrinsic');
|
||||||
|
|
||||||
|
var $ArrayPrototype = GetIntrinsic('%Array.prototype%');
|
||||||
|
var $RangeError = GetIntrinsic('%RangeError%');
|
||||||
|
var $SyntaxError = GetIntrinsic('%SyntaxError%');
|
||||||
|
var $TypeError = GetIntrinsic('%TypeError%');
|
||||||
|
|
||||||
|
var isInteger = require('../helpers/isInteger');
|
||||||
|
|
||||||
|
var hasProto = require('has-proto')();
|
||||||
|
|
||||||
|
var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1;
|
||||||
|
|
||||||
|
var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || (
|
||||||
|
hasProto
|
||||||
|
? function (O, proto) {
|
||||||
|
O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign
|
||||||
|
return O;
|
||||||
|
}
|
||||||
|
: null
|
||||||
|
);
|
||||||
|
|
||||||
|
// https://262.ecma-international.org/6.0/#sec-arraycreate
|
||||||
|
|
||||||
|
module.exports = function ArrayCreate(length) {
|
||||||
|
if (!isInteger(length) || length < 0) {
|
||||||
|
throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0');
|
||||||
|
}
|
||||||
|
if (length > MAX_ARRAY_LENGTH) {
|
||||||
|
throw new $RangeError('length is greater than (2**32 - 1)');
|
||||||
|
}
|
||||||
|
var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype;
|
||||||
|
var A = []; // steps 5 - 7, and 9
|
||||||
|
if (proto !== $ArrayPrototype) { // step 8
|
||||||
|
if (!$setProto) {
|
||||||
|
throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]');
|
||||||
|
}
|
||||||
|
$setProto(A, proto);
|
||||||
|
}
|
||||||
|
if (length !== 0) { // bypasses the need for step 2
|
||||||
|
A.length = length;
|
||||||
|
}
|
||||||
|
/* step 10, the above as a shortcut for the below
|
||||||
|
OrdinaryDefineOwnProperty(A, 'length', {
|
||||||
|
'[[Configurable]]': false,
|
||||||
|
'[[Enumerable]]': false,
|
||||||
|
'[[Value]]': length,
|
||||||
|
'[[Writable]]': true
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
return A;
|
||||||
|
};
|
85
IP/node_modules/.es-abstract-S1aq3iW2/2015/ArraySetLength.js
generated
vendored
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var GetIntrinsic = require('get-intrinsic');
|
||||||
|
|
||||||
|
var $RangeError = GetIntrinsic('%RangeError%');
|
||||||
|
var $TypeError = GetIntrinsic('%TypeError%');
|
||||||
|
|
||||||
|
var assign = require('object.assign');
|
||||||
|
|
||||||
|
var isPropertyDescriptor = require('../helpers/isPropertyDescriptor');
|
||||||
|
|
||||||
|
var IsArray = require('./IsArray');
|
||||||
|
var IsAccessorDescriptor = require('./IsAccessorDescriptor');
|
||||||
|
var IsDataDescriptor = require('./IsDataDescriptor');
|
||||||
|
var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty');
|
||||||
|
var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty');
|
||||||
|
var ToNumber = require('./ToNumber');
|
||||||
|
var ToString = require('./ToString');
|
||||||
|
var ToUint32 = require('./ToUint32');
|
||||||
|
var Type = require('./Type');
|
||||||
|
|
||||||
|
// https://262.ecma-international.org/6.0/#sec-arraysetlength
|
||||||
|
|
||||||
|
// eslint-disable-next-line max-statements, max-lines-per-function
|
||||||
|
module.exports = function ArraySetLength(A, Desc) {
|
||||||
|
if (!IsArray(A)) {
|
||||||
|
throw new $TypeError('Assertion failed: A must be an Array');
|
||||||
|
}
|
||||||
|
if (!isPropertyDescriptor({
|
||||||
|
Type: Type,
|
||||||
|
IsDataDescriptor: IsDataDescriptor,
|
||||||
|
IsAccessorDescriptor: IsAccessorDescriptor
|
||||||
|
}, Desc)) {
|
||||||
|
throw new $TypeError('Assertion failed: Desc must be a Property Descriptor');
|
||||||
|
}
|
||||||
|
if (!('[[Value]]' in Desc)) {
|
||||||
|
return OrdinaryDefineOwnProperty(A, 'length', Desc);
|
||||||
|
}
|
||||||
|
var newLenDesc = assign({}, Desc);
|
||||||
|
var newLen = ToUint32(Desc['[[Value]]']);
|
||||||
|
var numberLen = ToNumber(Desc['[[Value]]']);
|
||||||
|
if (newLen !== numberLen) {
|
||||||
|
throw new $RangeError('Invalid array length');
|
||||||
|
}
|
||||||
|
newLenDesc['[[Value]]'] = newLen;
|
||||||
|
var oldLenDesc = OrdinaryGetOwnProperty(A, 'length');
|
||||||
|
if (!IsDataDescriptor(oldLenDesc)) {
|
||||||
|
throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`');
|
||||||
|
}
|
||||||
|
var oldLen = oldLenDesc['[[Value]]'];
|
||||||
|
if (newLen >= oldLen) {
|
||||||
|
return OrdinaryDefineOwnProperty(A, 'length', newLenDesc);
|
||||||
|
}
|
||||||
|
if (!oldLenDesc['[[Writable]]']) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var newWritable;
|
||||||
|
if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) {
|
||||||
|
newWritable = true;
|
||||||
|
} else {
|
||||||
|
newWritable = false;
|
||||||
|
newLenDesc['[[Writable]]'] = true;
|
||||||
|
}
|
||||||
|
var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc);
|
||||||
|
if (!succeeded) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
while (newLen < oldLen) {
|
||||||
|
oldLen -= 1;
|
||||||
|
// eslint-disable-next-line no-param-reassign
|
||||||
|
var deleteSucceeded = delete A[ToString(oldLen)];
|
||||||
|
if (!deleteSucceeded) {
|
||||||
|
newLenDesc['[[Value]]'] = oldLen + 1;
|
||||||
|
if (!newWritable) {
|
||||||
|
newLenDesc['[[Writable]]'] = false;
|
||||||
|
OrdinaryDefineOwnProperty(A, 'length', newLenDesc);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!newWritable) {
|
||||||
|
return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false });
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
47
IP/node_modules/.es-abstract-S1aq3iW2/2015/ArraySpeciesCreate.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var GetIntrinsic = require('get-intrinsic');
|
||||||
|
|
||||||
|
var $Array = GetIntrinsic('%Array%');
|
||||||
|
var $species = GetIntrinsic('%Symbol.species%', true);
|
||||||
|
var $TypeError = GetIntrinsic('%TypeError%');
|
||||||
|
|
||||||
|
var Get = require('./Get');
|
||||||
|
var IsArray = require('./IsArray');
|
||||||
|
var IsConstructor = require('./IsConstructor');
|
||||||
|
var Type = require('./Type');
|
||||||
|
|
||||||
|
var isInteger = require('../helpers/isInteger');
|
||||||
|
|
||||||
|
// https://262.ecma-international.org/6.0/#sec-arrayspeciescreate
|
||||||
|
|
||||||
|
module.exports = function ArraySpeciesCreate(originalArray, length) {
|
||||||
|
if (!isInteger(length) || length < 0) {
|
||||||
|
throw new $TypeError('Assertion failed: length must be an integer >= 0');
|
||||||
|
}
|
||||||
|
var len = length === 0 ? 0 : length;
|
||||||
|
var C;
|
||||||
|
var isArray = IsArray(originalArray);
|
||||||
|
if (isArray) {
|
||||||
|
C = Get(originalArray, 'constructor');
|
||||||
|
// TODO: figure out how to make a cross-realm normal Array, a same-realm Array
|
||||||
|
// if (IsConstructor(C)) {
|
||||||
|
// if C is another realm's Array, C = undefined
|
||||||
|
// Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ?
|
||||||
|
// }
|
||||||
|
if ($species && Type(C) === 'Object') {
|
||||||
|
C = Get(C, $species);
|
||||||
|
if (C === null) {
|
||||||
|
C = void 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (typeof C === 'undefined') {
|
||||||
|
return $Array(len);
|
||||||
|
}
|
||||||
|
if (!IsConstructor(C)) {
|
||||||
|
throw new $TypeError('C must be a constructor');
|
||||||
|
}
|
||||||
|
return new C(len); // Construct(C, len);
|
||||||
|
};
|
||||||
|
|
20
IP/node_modules/.es-abstract-S1aq3iW2/2015/Call.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var GetIntrinsic = require('get-intrinsic');
|
||||||
|
var callBound = require('call-bind/callBound');
|
||||||
|
|
||||||
|
var $TypeError = GetIntrinsic('%TypeError%');
|
||||||
|
|
||||||
|
var IsArray = require('./IsArray');
|
||||||
|
|
||||||
|
var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('Function.prototype.apply');
|
||||||
|
|
||||||
|
// https://262.ecma-international.org/6.0/#sec-call
|
||||||
|
|
||||||
|
module.exports = function Call(F, V) {
|
||||||
|
var argumentsList = arguments.length > 2 ? arguments[2] : [];
|
||||||
|
if (!IsArray(argumentsList)) {
|
||||||
|
throw new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List');
|
||||||
|
}
|
||||||
|
return $apply(F, V, argumentsList);
|
||||||
|
};
|
22
IP/node_modules/.es-abstract-S1aq3iW2/2015/CanonicalNumericIndexString.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var GetIntrinsic = require('get-intrinsic');
|
||||||
|
|
||||||
|
var $TypeError = GetIntrinsic('%TypeError%');
|
||||||
|
|
||||||
|
var SameValue = require('./SameValue');
|
||||||
|
var ToNumber = require('./ToNumber');
|
||||||
|
var ToString = require('./ToString');
|
||||||
|
var Type = require('./Type');
|
||||||
|
|
||||||
|
// https://262.ecma-international.org/6.0/#sec-canonicalnumericindexstring
|
||||||
|
|
||||||
|
module.exports = function CanonicalNumericIndexString(argument) {
|
||||||
|
if (Type(argument) !== 'String') {
|
||||||
|
throw new $TypeError('Assertion failed: `argument` must be a String');
|
||||||
|
}
|
||||||
|
if (argument === '-0') { return -0; }
|
||||||
|
var n = ToNumber(argument);
|
||||||
|
if (SameValue(ToString(n), argument)) { return n; }
|
||||||
|
return void 0;
|
||||||
|
};
|