add lisp packages

This commit is contained in:
2020-12-05 21:29:49 +01:00
parent 85e20365ae
commit a6e2395755
7272 changed files with 1363243 additions and 0 deletions

View File

@@ -0,0 +1,104 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2018 Andy Stewart
#
# Author: Andy Stewart <lazycat.manatee@gmail.com>
# Maintainer: Andy Stewart <lazycat.manatee@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from PyQt5 import QtGui, QtCore
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QColor, QFont
from PyQt5.QtWidgets import QWidget, QLabel, QVBoxLayout
from core.buffer import Buffer
import qrcode
class AppBuffer(Buffer):
def __init__(self, buffer_id, url, config_dir, arguments, emacs_var_dict, module_path):
Buffer.__init__(self, buffer_id, url, arguments, emacs_var_dict, module_path, False)
self.add_widget(AirShareWidget(url, QColor(0, 0, 0, 255)))
class Image(qrcode.image.base.BaseImage):
def __init__(self, border, width, box_size):
self.border = border
self.width = width
self.box_size = box_size
size = (width + border * 2) * box_size
self._image = QtGui.QImage(size, size, QtGui.QImage.Format_RGB16)
self._image.fill(QtCore.Qt.white)
def pixmap(self):
return QtGui.QPixmap.fromImage(self._image)
def drawrect(self, row, col):
painter = QtGui.QPainter(self._image)
painter.fillRect(
(col + self.border) * self.box_size,
(row + self.border) * self.box_size,
self.box_size, self.box_size,
QtCore.Qt.black)
def save(self, stream, kind=None):
pass
class AirShareWidget(QWidget):
def __init__(self, url, color):
QWidget.__init__(self)
self.setStyleSheet("background-color: black")
self.file_name_font = QFont()
self.file_name_font.setPointSize(24)
self.file_name_label = QLabel(self)
self.file_name_label.setText(url)
self.file_name_label.setFont(self.file_name_font)
self.file_name_label.setAlignment(Qt.AlignCenter)
self.file_name_label.setStyleSheet("color: #eee")
self.qrcode_label = QLabel(self)
self.notify_font = QFont()
self.notify_font.setPointSize(12)
self.notify_label = QLabel(self)
self.notify_label.setText("Scan QR code above to copy data.")
self.notify_label.setFont(self.notify_font)
self.notify_label.setAlignment(Qt.AlignCenter)
self.notify_label.setStyleSheet("color: #eee")
layout = QVBoxLayout(self)
layout.setContentsMargins(0, 0, 0, 0)
layout.addStretch()
layout.addWidget(self.qrcode_label, 0, Qt.AlignCenter)
layout.addSpacing(20)
layout.addWidget(self.file_name_label, 0, Qt.AlignCenter)
layout.addSpacing(40)
layout.addWidget(self.notify_label, 0, Qt.AlignCenter)
layout.addStretch()
self.qrcode_label.setPixmap(qrcode.make(url, image_factory=Image).pixmap())
if __name__ == "__main__":
from PyQt5.QtWidgets import QApplication
import sys
import signal
app = QApplication(sys.argv)
test = AirShareWidget("/home/andy/rms/1.jpg", QColor(0, 0, 0, 255))
test.show()
signal.signal(signal.SIGINT, signal.SIG_DFL)
sys.exit(app.exec_())

View File

@@ -0,0 +1,60 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2018 Andy Stewart
#
# Author: Andy Stewart <lazycat.manatee@gmail.com>
# Maintainer: Andy Stewart <lazycat.manatee@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from PyQt5.QtCore import QUrl
from PyQt5.QtGui import QColor
from core.browser import BrowserBuffer
from core.utils import touch
import os
class AppBuffer(BrowserBuffer):
def __init__(self, buffer_id, url, config_dir, arguments, emacs_var_dict, module_path):
BrowserBuffer.__init__(self, buffer_id, url, config_dir, arguments, emacs_var_dict, module_path, False)
self.config_dir = config_dir
# When arguments is "temp_html_file", browser will load content of html file, then delete temp file.
# Usually use for render html mail.
if arguments == "temp_html_file":
with open(url, "r") as html_file:
self.buffer_widget.setHtml(html_file.read())
if os.path.exists(url):
os.remove(url)
else:
self.buffer_widget.setUrl(QUrl(url))
self.close_page.connect(self.record_close_page)
self.buffer_widget.titleChanged.connect(self.record_history)
self.buffer_widget.titleChanged.connect(self.change_title)
self.buffer_widget.translate_selected_text.connect(self.translate_text)
self.buffer_widget.open_url_in_new_tab.connect(self.open_url_in_new_tab)
self.buffer_widget.open_url_in_background_tab.connect(self.open_url_in_background_tab)
# Reset to default zoom when page init or url changed.
self.reset_default_zoom()
self.buffer_widget.urlChanged.connect(self.update_url)
def update_url(self, url):
self.reset_default_zoom()
self.url = self.buffer_widget.url().toString()

View File

@@ -0,0 +1,113 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2018 Andy Stewart
#
# Author: Andy Stewart <lazycat.manatee@gmail.com>
# Maintainer: Andy Stewart <lazycat.manatee@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from PyQt5.QtCore import Qt, QSizeF
from PyQt5.QtGui import QBrush
from PyQt5.QtGui import QColor
from PyQt5.QtMultimedia import QCameraInfo, QCamera, QCameraImageCapture
from PyQt5.QtMultimediaWidgets import QGraphicsVideoItem
from PyQt5.QtWidgets import QGraphicsScene, QGraphicsView
from PyQt5.QtWidgets import QWidget, QVBoxLayout
from core.buffer import Buffer
from pathlib import Path
import time
import os
class AppBuffer(Buffer):
def __init__(self, buffer_id, url, config_dir, arguments, emacs_var_dict, module_path):
Buffer.__init__(self, buffer_id, url, arguments, emacs_var_dict, module_path, True)
self.add_widget(CameraWidget(QColor(0, 0, 0, 255)))
def all_views_hide(self):
# Need stop camera if all view will hide, otherwise camera will crash.
self.buffer_widget.camera.stop()
def some_view_show(self):
# Re-start camero after some view show.
self.buffer_widget.camera.start()
def take_photo(self):
if os.path.exists(os.path.expanduser(self.emacs_var_dict["eaf-camera-save-path"])):
self.buffer_widget.take_photo(self.emacs_var_dict["eaf-camera-save-path"])
else:
self.buffer_widget.take_photo("~/Downloads")
def destroy_buffer(self):
self.buffer_widget.stop_camera()
super().destroy_buffer()
class CameraWidget(QWidget):
def __init__(self, background_color):
QWidget.__init__(self)
self.scene = QGraphicsScene(self)
self.scene.setBackgroundBrush(QBrush(background_color))
self.graphics_view = QGraphicsView(self.scene)
self.graphics_view.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.graphics_view.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.graphics_view.setFrameStyle(0)
self.graphics_view.setStyleSheet("QGraphicsView {background: transparent; border: 3px; outline: none;}")
self.graphics_view.scale(-1, 1) # this make live video from camero mirror.
self.video_item = QGraphicsVideoItem()
self.scene.addItem(self.video_item)
self.layout = QVBoxLayout(self)
self.layout.setContentsMargins(0, 0, 0, 0)
self.layout.addWidget(self.graphics_view)
self.available_cameras = QCameraInfo.availableCameras()
# Set the default camera.
self.select_camera(0)
def resizeEvent(self, event):
self.video_item.setSize(QSizeF(event.size().width(), event.size().height()))
QWidget.resizeEvent(self, event)
def select_camera(self, i):
self.camera = QCamera(self.available_cameras[i])
self.camera.setViewfinder(self.video_item)
self.camera.setCaptureMode(QCamera.CaptureStillImage)
self.camera.start()
def take_photo(self, camera_save_path):
image_capture = QCameraImageCapture(self.camera)
save_path = str(Path(os.path.expanduser(camera_save_path)))
photo_path = os.path.join(save_path, "EAF_Camera_Photo_" + time.strftime("%Y-%m-%d_%H:%M:%S", time.localtime(int(time.time()))))
image_capture.capture(photo_path)
self.message_to_emacs.emit("Captured Photo at " + photo_path)
def stop_camera(self):
self.camera.stop()
if __name__ == "__main__":
from PyQt5.QtWidgets import QApplication
import sys
import signal
app = QApplication(sys.argv)
test = CameraWidget(QColor(0, 0, 0, 255))
test.show()
signal.signal(signal.SIGINT, signal.SIG_DFL)
sys.exit(app.exec_())

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2018 Andy Stewart
#
# Author: Andy Stewart <lazycat.manatee@gmail.com>
# Maintainer: Andy Stewart <lazycat.manatee@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from PyQt5.QtGui import QColor
from PyQt5.QtWidgets import QPushButton
from core.buffer import Buffer
class AppBuffer(Buffer):
def __init__(self, buffer_id, url, config_dir, arguments, emacs_var_dict, module_path):
Buffer.__init__(self, buffer_id, url, arguments, emacs_var_dict, module_path, True)
self.add_widget(QPushButton("Hello, EAF hacker, it's working!!!"))
self.buffer_widget.setStyleSheet("font-size: 100px")

View File

@@ -0,0 +1,114 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2018 Andy Stewart
#
# Author: Andy Stewart <lazycat.manatee@gmail.com>
# Maintainer: Andy Stewart <lazycat.manatee@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from PyQt5 import QtGui, QtCore
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QColor, QFont
from PyQt5.QtWidgets import QWidget, QLabel, QVBoxLayout
from core.utils import get_local_ip, get_free_port
import subprocess
import os
import qrcode
import signal
from core.buffer import Buffer
class AppBuffer(Buffer):
def __init__(self, buffer_id, url, config_dir, argument, emacs_var_dict, module_path):
Buffer.__init__(self, buffer_id, url, argument, emacs_var_dict, module_path, False)
self.add_widget(FileUploaderWidget(url, QColor(0, 0, 0, 255)))
def destroy_buffer(self):
os.kill(self.buffer_widget.background_process.pid, signal.SIGKILL)
super().destroy_buffer()
class Image(qrcode.image.base.BaseImage):
def __init__(self, border, width, box_size):
self.border = border
self.width = width
self.box_size = box_size
size = (width + border * 2) * box_size
self._image = QtGui.QImage(size, size, QtGui.QImage.Format_RGB16)
self._image.fill(QtCore.Qt.white)
def pixmap(self):
return QtGui.QPixmap.fromImage(self._image)
def drawrect(self, row, col):
painter = QtGui.QPainter(self._image)
painter.fillRect(
(col + self.border) * self.box_size,
(row + self.border) * self.box_size,
self.box_size, self.box_size,
QtCore.Qt.black)
def save(self, stream, kind=None):
pass
class FileUploaderWidget(QWidget):
def __init__(self, url, color):
QWidget.__init__(self)
url = os.path.expanduser(url)
self.setStyleSheet("background-color: black")
self.file_name_font = QFont()
self.file_name_font.setPointSize(24)
self.file_name_label = QLabel(self)
self.file_name_label.setText("Your file will be share at\n{0}".format(url))
self.file_name_label.setFont(self.file_name_font)
self.file_name_label.setAlignment(Qt.AlignCenter)
self.file_name_label.setStyleSheet("color: #eee")
self.qrcode_label = QLabel(self)
self.notify_font = QFont()
self.notify_font.setPointSize(12)
self.notify_label = QLabel(self)
self.notify_label.setText("Scan QR code above to upload a file from your smartphone.\nMake sure the smartphone is connected to the same WiFi network as this computer.")
self.notify_label.setFont(self.notify_font)
self.notify_label.setAlignment(Qt.AlignCenter)
self.notify_label.setStyleSheet("color: #eee")
layout = QVBoxLayout(self)
layout.setContentsMargins(0, 0, 0, 0)
layout.addStretch()
layout.addWidget(self.qrcode_label, 0, Qt.AlignCenter)
layout.addSpacing(20)
layout.addWidget(self.file_name_label, 0, Qt.AlignCenter)
layout.addSpacing(40)
layout.addWidget(self.notify_label, 0, Qt.AlignCenter)
layout.addStretch()
self.port = get_free_port()
self.local_ip = get_local_ip()
self.address = "http://{0}:{1}".format(self.local_ip, self.port)
self.qrcode_label.setPixmap(qrcode.make(self.address, image_factory=Image).pixmap())
self.background_process = subprocess.Popen(
"cd {0} && filebrowser --noauth -d /tmp/filebrowser.db --address {1} -p {2}".format(url, self.local_ip, self.port),
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=True)

View File

@@ -0,0 +1,147 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2018 Andy Stewart
#
# Author: Andy Stewart <lazycat.manatee@gmail.com>
# Maintainer: Andy Stewart <lazycat.manatee@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from PyQt5 import QtGui, QtCore
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QColor, QFont
from PyQt5.QtWidgets import QWidget, QLabel, QVBoxLayout
from core.buffer import Buffer
from core.utils import get_free_port, get_local_ip
import http.server as BaseHTTPServer
import os
import qrcode
import shutil
import sys
import threading
import socket
class AppBuffer(Buffer):
def __init__(self, buffer_id, url, config_dir, arguments, emacs_var_dict, module_path):
Buffer.__init__(self, buffer_id, url, arguments, emacs_var_dict, module_path, False)
self.add_widget(FileTransferWidget(url, QColor(0, 0, 0, 255)))
class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
global local_file_path
try:
with open(local_file_path, 'rb') as f:
self.send_response(200)
self.send_header("Content-Type", 'application/octet-stream')
self.send_header("Content-Disposition", 'attachment; filename="{}"'.format(os.path.basename(local_file_path)))
fs = os.fstat(f.fileno())
self.send_header("Content-Length", str(fs.st_size))
self.end_headers()
shutil.copyfileobj(f, self.wfile)
except socket.error:
# Don't need handle socket error.
pass
class Image(qrcode.image.base.BaseImage):
def __init__(self, border, width, box_size):
self.border = border
self.width = width
self.box_size = box_size
size = (width + border * 2) * box_size
self._image = QtGui.QImage(size, size, QtGui.QImage.Format_RGB16)
self._image.fill(QtCore.Qt.white)
def pixmap(self):
return QtGui.QPixmap.fromImage(self._image)
def drawrect(self, row, col):
painter = QtGui.QPainter(self._image)
painter.fillRect(
(col + self.border) * self.box_size,
(row + self.border) * self.box_size,
self.box_size, self.box_size,
QtCore.Qt.black)
def save(self, stream, kind=None):
pass
class FileTransferWidget(QWidget):
def __init__(self, url, color):
QWidget.__init__(self)
self.setStyleSheet("background-color: black")
file_path = os.path.expanduser(url)
self.file_name_font = QFont()
self.file_name_font.setPointSize(24)
self.file_name_label = QLabel(self)
self.file_name_label.setText(file_path)
self.file_name_label.setFont(self.file_name_font)
self.file_name_label.setAlignment(Qt.AlignCenter)
self.file_name_label.setStyleSheet("color: #eee")
self.qrcode_label = QLabel(self)
self.notify_font = QFont()
self.notify_font.setPointSize(12)
self.notify_label = QLabel(self)
self.notify_label.setText("Scan QR code above to download this file on your smartphone.\nMake sure the smartphone is connected to the same WiFi network as this computer.")
self.notify_label.setFont(self.notify_font)
self.notify_label.setAlignment(Qt.AlignCenter)
self.notify_label.setStyleSheet("color: #eee")
layout = QVBoxLayout(self)
layout.setContentsMargins(0, 0, 0, 0)
layout.addStretch()
layout.addWidget(self.qrcode_label, 0, Qt.AlignCenter)
layout.addSpacing(20)
layout.addWidget(self.file_name_label, 0, Qt.AlignCenter)
layout.addSpacing(40)
layout.addWidget(self.notify_label, 0, Qt.AlignCenter)
layout.addStretch()
self.start_server(file_path)
def set_address(self, address):
self.qrcode_label.setPixmap(qrcode.make(address, image_factory=Image).pixmap())
def start_server(self, filename):
global local_file_path
local_file_path = filename
self.port = get_free_port()
self.local_ip = get_local_ip()
self.set_address("http://{0}:{1}/{2}".format(self.local_ip, self.port, filename))
self.sender_thread = threading.Thread(target=self.run_http_server, name='LoopThread')
self.sender_thread.start()
def run_http_server(self):
httpd = BaseHTTPServer.HTTPServer(('', self.port), SimpleHTTPRequestHandler)
httpd.serve_forever()
def destroy_buffer(self):
global local_file_path
self.message_to_emacs.emit("Stop file sender server: http://{0}:{1}/{2}".format(self.local_ip, self.port, local_file_path))
self.sender_thread.stop()
super().destroy_buffer()

View File

@@ -0,0 +1,68 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2018 Andy Stewart
#
# Author: Andy Stewart <lazycat.manatee@gmail.com>
# Maintainer: Andy Stewart <lazycat.manatee@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from PyQt5.QtCore import QUrl
from PyQt5.QtGui import QColor
from core.browser import BrowserBuffer
from core.utils import PostGui
from pathlib import Path
import os
class AppBuffer(BrowserBuffer):
def __init__(self, buffer_id, url, config_dir, arguments, emacs_var_dict, module_path):
BrowserBuffer.__init__(self, buffer_id, url, config_dir, arguments, emacs_var_dict, module_path, False)
self.load_image(url)
def load_image(self, url):
self.url = url
self.parent_dir = os.path.abspath(os.path.join(url, os.pardir))
self.image_name = os.path.basename(url)
self.buffer_widget.setUrl(QUrl("file://" + self.url))
def is_image_file(self, f):
return Path(f).suffix.lower() in ["jpg", "jpeg", "png", "bmp", "gif", "svg", "webp"]
def get_same_dir_images(self):
files = [f for f in os.listdir(self.parent_dir) if os.path.isfile(os.path.join(self.parent_dir, f))]
return list(filter(self.is_image_file, files))
def load_next_image(self):
images = self.get_same_dir_images()
if self.image_name in images:
image_index = images.index(self.image_name)
if image_index == len(images) - 1:
image_index = 0
else:
image_index += 1
self.load_image(os.path.join(self.parent_dir, images[image_index]))
def load_prev_image(self):
images = self.get_same_dir_images()
if self.image_name in images:
image_index = images.index(self.image_name)
if image_index == 0:
image_index = len(images) - 1
else:
image_index -= 1
self.load_image(os.path.join(self.parent_dir, images[image_index]))

View File

@@ -0,0 +1,511 @@
;;; eaf-interleave.el --- Interleaving text books on EAF -*- lexical-binding: t -*-
;; Author: Sebastian Christ <rudolfo.christ@gmail.com>
;; URL: https://github.com/rudolfochrist/interleave
;; Version: 1.4.20161123-610
;; Fork: luhuaei <luhuaei@gmail.com>
;; This file is not part of GNU Emacs
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; For a full copy of the GNU General Public License
;; see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; In the past, textbooks were sometimes published as 'interleaved'
;; editions. That meant, each page was followed by a blank page and
;; ambitious students/scholars had the ability to take their notes
;; directly in their copy of the textbook. Newton and Kant were
;; prominent representatives of this technique.
;; Nowadays textbooks (or lecture material) come in PDF format. Although almost
;; every PDF Reader has the ability to add some notes to the PDF itself, it is
;; not as powerful as it could be.
;; This is what this minor mode tries to accomplish. It presents your PDF side by
;; side to an [[http://orgmode.org][Org Mode]] buffer with your notes, narrowing
;; down to just those passages that are relevant to the particular page in the
;; document viewer.
;;; Usage:
;;; Code:
(require 'org)
(require 'org-element)
(defcustom eaf-interleave-org-notes-dir-list '("~/org/interleave_notes" ".")
"List of directories to look into when opening notes org from a pdf file.
The notes file is assumed to have the exact
same base name as the pdf file (just that the file extension is
.org instead of .pdf).
If the notes org file is not found, it is created in the
directory returned on doing `car' of this list (first element of
the list).
The notes file is searched in order from the first list element
till the last; the search is aborted once the file is found.
If a list element is \".\" or begins with \"./\", that portion is
replaced with the pdf directory name. e.g. \".\" is interpreted
as \"/pdf/file/dir/\", \"./notes\" is interpreted as
\"/pdf/file/dir/notes/\"."
:type '(repeat directory))
(defcustom eaf-interleave-split-direction 'vertical
"Specify how to split the notes buffer."
:type '(choice (const vertical)
(const horizontal)))
(defcustom eaf-interleave-split-lines nil
"Specify the number of lines the PDF buffer should be increased or decreased.
If nil both buffers are split equally. If the number is positive,
the window is enlarged. If the number is negative, the window is
shrunken.
If `eaf-interleave-split-direction' is 'vertical then the number is
taken as columns."
:type '(choice integer
(const nil)))
(defcustom eaf-interleave-disable-narrowing nil
"Disable narrowing in notes/org buffer."
:type 'boolean)
;; variables
(defvar eaf-interleave-org-buffer nil
"Org notes buffer name.")
(defvar eaf-interleave--window-configuration nil
"Variable to store the window configuration before interleave mode was enabled.")
(defconst eaf-interleave--page-note-prop "interleave_page_note"
"The page note property string.")
(defconst eaf-interleave--url-prop "interleave_url"
"The pdf property string.")
;; Minor mode for the org file buffer containing notes
(defvar eaf-interleave-mode-map (make-sparse-keymap)
"Keymap while command `eaf-interleave-mode' is active in the org file buffer.")
;;;###autoload
(define-minor-mode eaf-interleave-mode
"Interleaving your text books since 2015.
In the past, textbooks were sometimes published as 'interleaved' editions.
That meant, each page was followed by a blank page and the ambitious student/
scholar had the ability to take their notes directly in their copy of the
textbook. Newton and Kant were prominent representatives of this technique.
Nowadays textbooks (or lecture material) come in PDF format. Although almost
every PDF Reader has the ability to add some notes to the PDF itself, it is
not as powerful as it could be.
This is what this minor mode tries to accomplish. It presents your PDF side by
pppside to an [[http://orgmode.org][Org Mode]] buffer with your notes, narrowing
down to just those passages that are relevant to the particular page in the
document viewer.
The split direction is determined by the customizable variable
`eaf-interleave-split-direction'. When `eaf-interleave-mode' is invoked
with a prefix argument the inverse split direction is used
e.g. if `eaf-interleave-split-direction' is 'vertical the buffer is
split horizontally."
:keymap eaf-interleave-mode-map
(if eaf-interleave-mode
(setq eaf-interleave-org-buffer (current-buffer))
;; Disable the corresponding minor mode in the PDF file too.
(setq eaf-interleave-org-buffer nil)))
(defvar eaf-interleave-app-mode-map (make-sparse-keymap)
"Keymap while command `eaf-interleave-app-mode' is active.")
;;;###autoload
(define-minor-mode eaf-interleave-app-mode
"Interleave view for the EAF app."
:keymap eaf-interleave-app-mode-map)
;;; functions
;; interactive
(defun eaf-interleave-sync-current-note ()
"Sync EAF buffer on current note"
(interactive)
(let ((url (org-entry-get-with-inheritance eaf-interleave--url-prop)))
(cond ((and (string-prefix-p "/" url) (string-suffix-p "pdf" url t))
(eaf-interleave-sync-pdf-page-current))
((string-prefix-p "http" url)
(eaf-interleave-sync-browser-url-current))))
)
(defun eaf-interleave-sync-pdf-page-current ()
"Open PDF page for currently visible notes."
(interactive)
(let* ((pdf-page (org-entry-get-with-inheritance eaf-interleave--page-note-prop))
(pdf-url (org-entry-get-with-inheritance eaf-interleave--url-prop))
(buffer (eaf-interleave--find-buffer pdf-url)))
(if buffer
(progn
(eaf-interleave--display-buffer buffer)
(when pdf-page
(with-current-buffer buffer
(eaf-interleave--pdf-viewer-goto-page pdf-url pdf-page))))
(eaf-interleave--select-split-function)
(eaf-interleave--open-pdf pdf-url)
)))
(defun eaf-interleave-sync-next-note ()
"Move to the next set of notes.
This shows the next notes and synchronizes the PDF to the right page number."
(interactive)
(eaf-interleave--switch-to-org-buffer)
(widen)
(org-forward-heading-same-level 1)
(eaf-interleave--narrow-to-subtree)
(org-show-subtree)
(org-cycle-hide-drawers t)
(eaf-interleave-sync-current-note))
(defun eaf-interleave-add-note ()
"Add note for the EAF buffer.
If there are already notes for this url, jump to the notes
buffer."
(interactive)
(if (derived-mode-p 'eaf-mode)
(cond ((equal eaf--buffer-app-name "pdf-viewer")
(eaf-interleave--pdf-add-note))
((equal eaf--buffer-app-name "browser")
(eaf-interleave--browser-add-note)))
))
(defun eaf-interleave-add-file-url ()
"Add new url on note if property is none. else modify current url"
(interactive)
(let ((url (read-file-name "Please specify path: " nil nil t)))
(org-entry-put (point) eaf-interleave--url-prop url)))
(defun eaf-interleave-sync-previous-note ()
"Move to the previous set of notes.
This show the previous notes and synchronizes the PDF to the right page number."
(interactive)
(eaf-interleave--switch-to-org-buffer)
(widen)
(eaf-interleave--goto-parent-headline eaf-interleave--page-note-prop)
(org-backward-heading-same-level 1)
(eaf-interleave--narrow-to-subtree)
(org-show-subtree)
(org-cycle-hide-drawers t)
(eaf-interleave-sync-current-note))
(defun eaf-interleave-open-notes-file ()
"Find current EAF url corresponding note files if exists"
(interactive)
(if (derived-mode-p 'eaf-mode)
(cond ((equal eaf--buffer-app-name "pdf-viewer")
(eaf-interleave--open-notes-file-for-pdf))
((equal eaf--buffer-app-name "browser")
(eaf-interleave--open-notes-file-for-browser))))
)
(defun eaf-interleave-quit ()
"Quit interleave mode."
(interactive)
(with-current-buffer eaf-interleave-org-buffer
(widen)
(goto-char (point-min))
(when (eaf-interleave--headlines-available-p)
(org-overview))
(eaf-interleave-mode 0)))
;;;###autoload
(defun eaf-interleave--open-notes-file-for-pdf ()
"Open the notes org file for the current pdf file if it exists.
Else create it. It is assumed that the notes org file will have
the exact same base name as the pdf file (just that the notes
file will have a .org extension instead of .pdf)."
(let ((org-file (concat (file-name-base eaf--buffer-url) ".org")))
(eaf-interleave--open-notes-file-for-app org-file)))
(defun eaf-interleave--open-notes-file-for-browser ()
"Find current open interleave-mode org file, if exists, else
will create new org file with URL. It is assumed that the notes
org file will have the exact sam base name as the url domain."
(unless (buffer-live-p eaf-interleave-org-buffer)
(let* ((domain (url-domain (url-generic-parse-url eaf--buffer-url)))
(org-file (concat domain ".org")))
(eaf-interleave--open-notes-file-for-app org-file))))
(defun eaf-interleave--open-notes-file-for-app (org-file)
"Open the notes org file for the current url if it exists.
Else create it."
(let ((default-dir (nth 0 eaf-interleave-org-notes-dir-list))
(org-file-path (eaf-interleave--find-match-org eaf-interleave-org-notes-dir-list eaf--buffer-url))
(buffer (eaf-interleave--find-buffer eaf--buffer-url)))
;; Create the notes org file if it does not exist
(unless org-file-path
(setq org-file-path (eaf-interleave--ensure-org-file-exist eaf-interleave-org-notes-dir-list org-file)))
;; Open the notes org file and enable `eaf-interleave-mode'
(find-file org-file-path)
(eaf-interleave-mode)
(eaf-interleave--select-split-function)
(switch-to-buffer buffer)
))
(defun eaf-interleave--select-split-function ()
"Determine which split function to use.
This returns either `split-window-below' or `split-window-right'
based on a combination of `current-prefix-arg' and
`eaf-interleave-split-direction'."
(let ()
(delete-other-windows)
(if (string= eaf-interleave-split-direction "vertical")
(split-window-right)
(split-window-below))
(when (integerp eaf-interleave-split-lines)
(if (eql eaf-interleave-split-direction 'horizontal)
(enlarge-window eaf-interleave-split-lines)
(enlarge-window-horizontally eaf-interleave-split-lines)))
))
(defun eaf-interleave--go-to-page-note (url page)
"Look up the notes for the current pdf PAGE.
Effectively resolves the headline with the interleave_page_note
property set to PAGE and returns the point.
If `eaf-interleave-disable-narrowing' is non-nil then the buffer gets
re-centered to the page heading.
It (possibly) narrows the subtree when found."
(with-current-buffer eaf-interleave-org-buffer
(let ((window (get-buffer-window (current-buffer) 'visible))
(property-list (org-map-entries (lambda ()
(let ((url (org-entry-get-with-inheritance eaf-interleave--url-prop))
(page (org-entry-get-with-inheritance eaf-interleave--page-note-prop)))
(cons url page)))))
point)
(catch 'find-property
(dolist (property property-list)
(when (and (string= (car property) url)
(string= (cdr property) (number-to-string page)))
(widen)
(org-back-to-heading t)
(eaf-interleave--narrow-to-subtree)
(org-show-subtree)
(org-cycle-hide-drawers t)
(setq point (point))
(throw 'find-property nil))))
point)))
(defun eaf-interleave--narrow-to-subtree (&optional force)
"Narrow buffer to the current subtree.
If `eaf-interleave-disable-narrowing' is non-nil this
function does nothing.
When FORCE is non-nil `eaf-interleave-disable-narrowing' is
ignored."
(when (and (not (org-before-first-heading-p))
(or (not eaf-interleave-disable-narrowing)
force))
(org-narrow-to-subtree)))
(defun eaf-interleave--switch-to-org-buffer (&optional insert-newline-maybe position)
"Switch to the notes buffer.
Inserts a newline into the notes buffer if INSERT-NEWLINE-MAYBE
is non-nil.
If POSITION is non-nil move point to it."
(if (derived-mode-p 'eaf-mode)
(switch-to-buffer-other-window eaf-interleave-org-buffer)
(switch-to-buffer eaf-interleave-org-buffer))
(when (integerp position)
(goto-char position))
(when insert-newline-maybe
(save-restriction
(when eaf-interleave-disable-narrowing
(eaf-interleave--narrow-to-subtree t))
(goto-char (point-max)))
;; Expand again. Sometimes the new content is outside the narrowed
;; region.
(org-show-subtree)
(redisplay)
;; Insert a new line if not already on a new line
(when (not (looking-back "^ *" (line-beginning-position)))
(org-return))))
(defun eaf-interleave--insert-heading-respect-content (parent-headline)
"Create a new heading in the notes buffer.
Adjust the level of the new headline according to the
PARENT-HEADLINE.
Return the position of the newly inserted heading."
(org-insert-heading-respect-content)
(let* ((parent-level 0 )
(change-level (if (> (org-element-property :level (org-element-at-point))
(1+ parent-level))
#'org-promote
#'org-demote)))
(while (/= (org-element-property :level (org-element-at-point))
(1+ parent-level))
(funcall change-level)))
(point))
(defun eaf-interleave--create-new-note (url &optional title page)
"Create a new headline for current EAF url."
(let (new-note-position)
(with-current-buffer eaf-interleave-org-buffer
(save-excursion
(widen)
(let ((position (goto-char (point-max))))
(setq new-note-position (eaf-interleave--insert-heading-respect-content position)))
(org-set-property eaf-interleave--url-prop url)
(when title
(insert (format "Notes for %s" title)))
(when page
(org-set-property eaf-interleave--page-note-prop (number-to-string page)))
(eaf-interleave--narrow-to-subtree)
(org-cycle-hide-drawers t)))
(eaf-interleave--switch-to-org-buffer t new-note-position)))
(defun eaf-interleave-sync-browser-url-current ()
"Sync current note url for browser"
(let* ((web-url (org-entry-get-with-inheritance eaf-interleave--url-prop))
(buffer (eaf-interleave--find-buffer web-url)))
(if buffer
(eaf-interleave--display-buffer buffer)
(eaf-interleave--select-split-function)
(eaf-interleave--open-web-url web-url))))
(defun eaf-interleave--display-buffer (buffer)
"Use already used window display buffer"
(eaf-interleave--narrow-to-subtree)
(display-buffer-reuse-mode-window buffer '(("mode" . "eaf-interleave-app-mode")))
(eaf-interleave--ensure-buffer-window buffer))
(defun eaf-interleave--goto-parent-headline (property)
"Traverse the tree until the parent headline.
Consider a headline with property PROPERTY as parent headline."
(catch 'done
(if (and (eql (org-element-type (org-element-at-point)) 'headline)
(org-entry-get (point) property))
(org-element-at-point)
(condition-case nil
(org-up-element)
('error
(throw 'done nil)))
(eaf-interleave--goto-parent-headline property))))
(defun eaf-interleave--pdf-add-note ()
"EAF pdf-viewer-mode add note"
(let* ((page (eaf-interleave--pdf-viewer-current-page eaf--buffer-url))
(position (eaf-interleave--go-to-page-note eaf--buffer-url page)))
(if position
(eaf-interleave--switch-to-org-buffer t position)
(eaf-interleave--create-new-note eaf--buffer-url eaf--buffer-app-name page)))
)
(defun eaf-interleave--browser-add-note ()
"EAF browser add note"
(eaf-interleave--create-new-note eaf--buffer-url eaf--buffer-app-name))
(defun eaf-interleave--headlines-available-p ()
"True if there are headings in the notes buffer."
(save-excursion
(re-search-forward "^\* .*" nil t)))
;; utils
(defun eaf-interleave--open-pdf (pdf-file-name)
"Use EAF PdfViewer open this pdf-file-name document."
(eaf-open pdf-file-name)
(add-hook 'eaf-pdf-viewer-hook 'eaf-interleave-app-mode))
(defun eaf-interleave--open-web-url (url)
"Use EAF Browser open current note web address"
(eaf-open-browser url)
(add-hook 'eaf-browser-hook 'eaf-interleave-app-mode))
(defun eaf-interleave--find-buffer (url)
"find EAF buffer base url"
(let (current-buffer)
(catch 'find-buffer
(dolist (buffer (buffer-list))
(with-current-buffer buffer
(when (and
(derived-mode-p 'eaf-mode)
(equal eaf--buffer-url url))
(setq current-buffer buffer)
(throw 'find-buffer t)))))
current-buffer))
(defun eaf-interleave--kill-buffer (url)
"Kill the current converter process and buffer."
(let ((buffer (eaf-interleave--find-buffer url)))
(kill-buffer buffer)))
(defun eaf-interleave--pdf-viewer-current-page (url)
"get current page index."
(let ((id (buffer-local-value 'eaf--buffer-id (eaf-interleave--find-buffer url))))
(string-to-number (eaf-call "call_function" id "current_page"))))
(defun eaf-interleave--pdf-viewer-goto-page (url page)
"goto page"
(let ((id (buffer-local-value 'eaf--buffer-id (eaf-interleave--find-buffer url))))
(eaf-call "handle_input_message" id "jump_page" page)))
(defun eaf-interleave--ensure-buffer-window (buffer)
"If BUFFER don't display, will use other window display"
(if (get-buffer-window buffer)
nil
(eaf-interleave--select-split-function)
(switch-to-buffer buffer)))
(defun eaf-interleave--parse-current-dir (dir url)
"If dir is '.' or begins with './', replace the '.' or './' with the current url name"
(replace-regexp-in-string
"^\\(\\.$\\|\\./\\).*"
(file-name-directory url)
dir nil nil 1))
(defun eaf-interleave--find-match-org (dir-list url)
"Find corresponding org file base url on dir list"
(let ((org-file (concat (file-name-base url) ".org"))
path)
(catch 'break
(dolist (dir dir-list)
(setq dir (eaf-interleave--parse-current-dir dir url))
(setq path (locate-file org-file (list dir)))
(when path
;; return the first match
(throw 'break path))))
path))
(defun eaf-interleave--ensure-org-file-exist (dir-list file-name)
"If the org file directory exist return this path, else created directory."
(let ((default-dir (nth 0 dir-list)))
(if dir-list
(progn
(unless (file-exists-p default-dir)
(make-directory default-dir))
(expand-file-name file-name default-dir))
(read-file-name "Path for org file: " "~/"))))
(provide 'eaf-interleave)
;;; interleave.el ends here

View File

@@ -0,0 +1,63 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2018 Andy Stewart
#
# Author: Andy Stewart <lazycat.manatee@gmail.com>
# Maintainer: Andy Stewart <lazycat.manatee@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from PyQt5 import QtCore
from PyQt5.QtCore import QUrl, QTimer
from PyQt5.QtWidgets import QApplication
from PyQt5.QtGui import QColor
from core.browser import BrowserBuffer
from core.utils import touch, string_to_base64
import os
import base64
class AppBuffer(BrowserBuffer):
export_org_json = QtCore.pyqtSignal(str, str)
def __init__(self, buffer_id, url, config_dir, arguments, emacs_var_dict, module_path):
BrowserBuffer.__init__(self, buffer_id, url, config_dir, arguments, emacs_var_dict, module_path, False)
self.url = url
index_file = "file://" + (os.path.join(os.path.dirname(__file__), "index.html"))
self.buffer_widget.setUrl(QUrl(index_file))
for method_name in ["toggle_play", "forward", "backward", "restart", "increase_volume", "decrease_volume"]:
self.build_js_method(method_name)
QTimer.singleShot(500, self.play_video)
def save_session_data(self):
return str(self.buffer_widget.execute_js("get_current_time();"))
def restore_session_data(self, session_data):
self.position = session_data
QTimer.singleShot(600, self.restore_seek_position)
def restore_seek_position(self):
self.buffer_widget.eval_js("set_current_time('{}');".format(self.position))
def play_video(self):
self.buffer_widget.eval_js("play('{}');".format("file://" + self.url))
def build_js_method(self, method_name):
def _do ():
self.buffer_widget.eval_js("{}();".format(method_name))
setattr(self, method_name, _do)

View File

@@ -0,0 +1,55 @@
<head>
<link href="./node_modules/plyr/dist/plyr.css" rel="stylesheet" />
<link href="./style.css" rel="stylesheet" />
<script src="./node_modules/plyr/dist/plyr.min.js"></script>
</head>
<body>
<video
id="player"
autoplay
/>
<script type="text/javascript">
const player = new Plyr('#player', {
controls: ['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'captions', 'settings', "fullscreen"],
});
function play(file) {
var video = document.getElementById('player');
video.setAttribute('src', file);
}
function toggle_play() {
player.togglePlay();
}
function get_current_time() {
return player.currentTime;
}
function set_current_time(time) {
player.currentTime = parseFloat(time);
}
function forward() {
player.forward(10);
}
function backward() {
player.forward(-10);
}
function restart() {
player.restart();
}
function increase_volume() {
player.increaseVolume(0.1);
}
function decrease_volume() {
player.decreaseVolume(0.1);
}
</script>
</body>

View File

@@ -0,0 +1,19 @@
Copyright (c) 2014-2020 Denis Pushkarev
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.

View File

@@ -0,0 +1,58 @@
# core-js
[![Sponsors on Open Collective](https://opencollective.com/core-js/sponsors/badge.svg)](#sponsors) [![Backers on Open Collective](https://opencollective.com/core-js/backers/badge.svg)](#backers) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/zloirock/core-js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![version](https://img.shields.io/npm/v/core-js.svg)](https://www.npmjs.com/package/core-js) [![npm downloads](https://img.shields.io/npm/dm/core-js.svg)](http://npm-stat.com/charts.html?package=core-js&author=&from=2014-11-18) [![Build Status](https://travis-ci.org/zloirock/core-js.svg)](https://travis-ci.org/zloirock/core-js) [![devDependency status](https://david-dm.org/zloirock/core-js/dev-status.svg)](https://david-dm.org/zloirock/core-js?type=dev)
> Modular standard library for JavaScript. Includes polyfills for [ECMAScript up to 2019](https://github.com/zloirock/core-js#ecmascript): [promises](https://github.com/zloirock/core-js#ecmascript-promise), [symbols](https://github.com/zloirock/core-js#ecmascript-symbol), [collections](https://github.com/zloirock/core-js#ecmascript-collections), iterators, [typed arrays](https://github.com/zloirock/core-js#ecmascript-typed-arrays), many other features, [ECMAScript proposals](https://github.com/zloirock/core-js#ecmascript-proposals), [some cross-platform WHATWG / W3C features and proposals](#web-standards) like [`URL`](https://github.com/zloirock/core-js#url-and-urlsearchparams). You can load only required features or use it without global namespace pollution.
## As advertising: the author is looking for a good job -)
## [core-js@3, babel and a look into the future](https://github.com/zloirock/core-js/tree/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md)
## Raising funds
`core-js` isn't backed by a company, so the future of this project depends on you. Become a sponsor or a backer [**on Open Collective**](https://opencollective.com/core-js) or [**on Patreon**](https://www.patreon.com/zloirock) if you are interested in `core-js`.
---
<a href="https://opencollective.com/core-js/sponsor/0/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/0/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/1/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/1/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/2/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/2/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/3/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/3/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/4/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/4/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/5/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/5/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/6/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/6/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/7/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/7/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/8/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/8/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/9/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/9/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/10/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/10/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/11/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/11/avatar.svg"></a>
---
<a href="https://opencollective.com/core-js#backers" target="_blank"><img src="https://opencollective.com/core-js/backers.svg?width=890"></a>
---
[*Example*](http://goo.gl/a2xexl):
```js
import 'core-js'; // <- at the top of your entry point
Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3]
[1, [2, 3], [4, [5]]].flat(2); // => [1, 2, 3, 4, 5]
Promise.resolve(32).then(x => console.log(x)); // => 32
```
*You can load only required features*:
```js
import 'core-js/features/array/from'; // <- at the top of your entry point
import 'core-js/features/array/flat'; // <- at the top of your entry point
import 'core-js/features/set'; // <- at the top of your entry point
import 'core-js/features/promise'; // <- at the top of your entry point
Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3]
[1, [2, 3], [4, [5]]].flat(2); // => [1, 2, 3, 4, 5]
Promise.resolve(32).then(x => console.log(x)); // => 32
```
*Or use it without global namespace pollution*:
```js
import from from 'core-js-pure/features/array/from';
import flat from 'core-js-pure/features/array/flat';
import Set from 'core-js-pure/features/set';
import Promise from 'core-js-pure/features/promise';
from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3]
flat([1, [2, 3], [4, [5]]], 2); // => [1, 2, 3, 4, 5]
Promise.resolve(32).then(x => console.log(x)); // => 32
```
**It's a global version (first 2 examples), for more info see [`core-js` documentation](https://github.com/zloirock/core-js/blob/master/README.md).**

View File

@@ -0,0 +1,23 @@
var has = require('./internals/has');
var isArray = require('./internals/is-array');
var isForced = require('./internals/is-forced');
var shared = require('./internals/shared-store');
var data = isForced.data;
var normalize = isForced.normalize;
var USE_FUNCTION_CONSTRUCTOR = 'USE_FUNCTION_CONSTRUCTOR';
var ASYNC_ITERATOR_PROTOTYPE = 'AsyncIteratorPrototype';
var setAggressivenessLevel = function (object, constant) {
if (isArray(object)) for (var i = 0; i < object.length; i++) data[normalize(object[i])] = constant;
};
module.exports = function (options) {
if (typeof options == 'object') {
setAggressivenessLevel(options.useNative, isForced.NATIVE);
setAggressivenessLevel(options.usePolyfill, isForced.POLYFILL);
setAggressivenessLevel(options.useFeatureDetection, null);
if (has(options, USE_FUNCTION_CONSTRUCTOR)) shared[USE_FUNCTION_CONSTRUCTOR] = !!options[USE_FUNCTION_CONSTRUCTOR];
if (has(options, ASYNC_ITERATOR_PROTOTYPE)) shared[USE_FUNCTION_CONSTRUCTOR] = options[ASYNC_ITERATOR_PROTOTYPE];
}
};

View File

@@ -0,0 +1 @@
This folder contains entry points for [stable ECMAScript features](https://github.com/zloirock/core-js/tree/v3#ecmascript) with dependencies.

View File

@@ -0,0 +1,5 @@
require('../../modules/es.array-buffer.constructor');
require('../../modules/es.object.to-string');
var path = require('../../internals/path');
module.exports = path.ArrayBuffer;

View File

@@ -0,0 +1,7 @@
require('../../modules/es.array-buffer.constructor');
require('../../modules/es.array-buffer.is-view');
require('../../modules/es.array-buffer.slice');
require('../../modules/es.object.to-string');
var path = require('../../internals/path');
module.exports = path.ArrayBuffer;

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array-buffer.is-view');
var path = require('../../internals/path');
module.exports = path.ArrayBuffer.isView;

View File

@@ -0,0 +1 @@
require('../../modules/es.array-buffer.slice');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.concat');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'concat');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.copy-within');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'copyWithin');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.iterator');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'entries');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.every');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'every');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.fill');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'fill');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.filter');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'filter');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.find-index');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'findIndex');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.find');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'find');

View File

@@ -0,0 +1,5 @@
require('../../modules/es.array.flat-map');
require('../../modules/es.array.unscopables.flat-map');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'flatMap');

View File

@@ -0,0 +1,5 @@
require('../../modules/es.array.flat');
require('../../modules/es.array.unscopables.flat');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'flat');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.for-each');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'forEach');

View File

@@ -0,0 +1,5 @@
require('../../modules/es.string.iterator');
require('../../modules/es.array.from');
var path = require('../../internals/path');
module.exports = path.Array.from;

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.includes');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'includes');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.index-of');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'indexOf');

View File

@@ -0,0 +1,33 @@
require('../../modules/es.string.iterator');
require('../../modules/es.array.from');
require('../../modules/es.array.is-array');
require('../../modules/es.array.of');
require('../../modules/es.array.concat');
require('../../modules/es.array.copy-within');
require('../../modules/es.array.every');
require('../../modules/es.array.fill');
require('../../modules/es.array.filter');
require('../../modules/es.array.find');
require('../../modules/es.array.find-index');
require('../../modules/es.array.flat');
require('../../modules/es.array.flat-map');
require('../../modules/es.array.for-each');
require('../../modules/es.array.includes');
require('../../modules/es.array.index-of');
require('../../modules/es.array.iterator');
require('../../modules/es.array.join');
require('../../modules/es.array.last-index-of');
require('../../modules/es.array.map');
require('../../modules/es.array.reduce');
require('../../modules/es.array.reduce-right');
require('../../modules/es.array.reverse');
require('../../modules/es.array.slice');
require('../../modules/es.array.some');
require('../../modules/es.array.sort');
require('../../modules/es.array.species');
require('../../modules/es.array.splice');
require('../../modules/es.array.unscopables.flat');
require('../../modules/es.array.unscopables.flat-map');
var path = require('../../internals/path');
module.exports = path.Array;

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.is-array');
var path = require('../../internals/path');
module.exports = path.Array.isArray;

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.iterator');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'values');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.join');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'join');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.iterator');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'keys');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.last-index-of');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'lastIndexOf');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.map');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'map');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.of');
var path = require('../../internals/path');
module.exports = path.Array.of;

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.reduce-right');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'reduceRight');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.reduce');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'reduce');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.reverse');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'reverse');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.slice');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'slice');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.some');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'some');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.sort');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'sort');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.splice');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'splice');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.array.iterator');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Array', 'values');

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.concat');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').concat;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.copy-within');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').copyWithin;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.iterator');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').entries;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.every');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').every;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.fill');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').fill;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.filter');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').filter;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.find-index');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').findIndex;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.find');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').find;

View File

@@ -0,0 +1,5 @@
require('../../../modules/es.array.flat-map');
require('../../../modules/es.array.unscopables.flat-map');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').flatMap;

View File

@@ -0,0 +1,5 @@
require('../../../modules/es.array.flat');
require('../../../modules/es.array.unscopables.flat');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').flat;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.for-each');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').forEach;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.includes');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').includes;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.index-of');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').indexOf;

View File

@@ -0,0 +1,29 @@
require('../../../modules/es.array.concat');
require('../../../modules/es.array.copy-within');
require('../../../modules/es.array.every');
require('../../../modules/es.array.fill');
require('../../../modules/es.array.filter');
require('../../../modules/es.array.find');
require('../../../modules/es.array.find-index');
require('../../../modules/es.array.flat');
require('../../../modules/es.array.flat-map');
require('../../../modules/es.array.for-each');
require('../../../modules/es.array.includes');
require('../../../modules/es.array.index-of');
require('../../../modules/es.array.iterator');
require('../../../modules/es.array.join');
require('../../../modules/es.array.last-index-of');
require('../../../modules/es.array.map');
require('../../../modules/es.array.reduce');
require('../../../modules/es.array.reduce-right');
require('../../../modules/es.array.reverse');
require('../../../modules/es.array.slice');
require('../../../modules/es.array.some');
require('../../../modules/es.array.sort');
require('../../../modules/es.array.species');
require('../../../modules/es.array.splice');
require('../../../modules/es.array.unscopables.flat');
require('../../../modules/es.array.unscopables.flat-map');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array');

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.iterator');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').values;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.join');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').join;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.iterator');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').keys;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.last-index-of');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').lastIndexOf;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.map');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').map;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.reduce-right');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').reduceRight;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.reduce');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').reduce;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.reverse');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').reverse;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.slice');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').slice;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.some');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').some;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.sort');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').sort;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.splice');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').splice;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.array.iterator');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Array').values;

View File

@@ -0,0 +1,5 @@
require('../../modules/es.data-view');
require('../../modules/es.object.to-string');
var path = require('../../internals/path');
module.exports = path.DataView;

View File

@@ -0,0 +1,8 @@
require('../../modules/es.date.now');
require('../../modules/es.date.to-json');
require('../../modules/es.date.to-iso-string');
require('../../modules/es.date.to-string');
require('../../modules/es.date.to-primitive');
var path = require('../../internals/path');
module.exports = path.Date;

View File

@@ -0,0 +1,4 @@
require('../../modules/es.date.now');
var path = require('../../internals/path');
module.exports = path.Date.now;

View File

@@ -0,0 +1,5 @@
require('../../modules/es.date.to-iso-string');
require('../../modules/es.date.to-json');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Date', 'toISOString');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.date.to-json');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Date', 'toJSON');

View File

@@ -0,0 +1,6 @@
require('../../modules/es.date.to-primitive');
var toPrimitive = require('../../internals/date-to-primitive');
module.exports = function (it, hint) {
return toPrimitive.call(it, hint);
};

View File

@@ -0,0 +1,6 @@
require('../../modules/es.date.to-string');
var dateToString = Date.prototype.toString;
module.exports = function toString(it) {
return dateToString.call(it);
};

View File

@@ -0,0 +1,4 @@
require('../../modules/es.function.bind');
var entryUnbind = require('../../internals/entry-unbind');
module.exports = entryUnbind('Function', 'bind');

View File

@@ -0,0 +1,4 @@
require('../../modules/es.function.has-instance');
var wellKnownSymbol = require('../../internals/well-known-symbol');
module.exports = Function[wellKnownSymbol('hasInstance')];

View File

@@ -0,0 +1,6 @@
require('../../modules/es.function.bind');
require('../../modules/es.function.name');
require('../../modules/es.function.has-instance');
var path = require('../../internals/path');
module.exports = path.Function;

View File

@@ -0,0 +1 @@
require('../../modules/es.function.name');

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.function.bind');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Function').bind;

View File

@@ -0,0 +1,4 @@
require('../../../modules/es.function.bind');
var entryVirtual = require('../../../internals/entry-virtual');
module.exports = entryVirtual('Function');

View File

@@ -0,0 +1,3 @@
require('../modules/es.global-this');
module.exports = require('../internals/global');

View File

@@ -0,0 +1,210 @@
require('../modules/es.symbol');
require('../modules/es.symbol.async-iterator');
require('../modules/es.symbol.description');
require('../modules/es.symbol.has-instance');
require('../modules/es.symbol.is-concat-spreadable');
require('../modules/es.symbol.iterator');
require('../modules/es.symbol.match');
require('../modules/es.symbol.match-all');
require('../modules/es.symbol.replace');
require('../modules/es.symbol.search');
require('../modules/es.symbol.species');
require('../modules/es.symbol.split');
require('../modules/es.symbol.to-primitive');
require('../modules/es.symbol.to-string-tag');
require('../modules/es.symbol.unscopables');
require('../modules/es.object.assign');
require('../modules/es.object.create');
require('../modules/es.object.define-property');
require('../modules/es.object.define-properties');
require('../modules/es.object.entries');
require('../modules/es.object.freeze');
require('../modules/es.object.from-entries');
require('../modules/es.object.get-own-property-descriptor');
require('../modules/es.object.get-own-property-descriptors');
require('../modules/es.object.get-own-property-names');
require('../modules/es.object.get-prototype-of');
require('../modules/es.object.is');
require('../modules/es.object.is-extensible');
require('../modules/es.object.is-frozen');
require('../modules/es.object.is-sealed');
require('../modules/es.object.keys');
require('../modules/es.object.prevent-extensions');
require('../modules/es.object.seal');
require('../modules/es.object.set-prototype-of');
require('../modules/es.object.values');
require('../modules/es.object.to-string');
require('../modules/es.object.define-getter');
require('../modules/es.object.define-setter');
require('../modules/es.object.lookup-getter');
require('../modules/es.object.lookup-setter');
require('../modules/es.function.bind');
require('../modules/es.function.name');
require('../modules/es.function.has-instance');
require('../modules/es.global-this');
require('../modules/es.array.from');
require('../modules/es.array.is-array');
require('../modules/es.array.of');
require('../modules/es.array.concat');
require('../modules/es.array.copy-within');
require('../modules/es.array.every');
require('../modules/es.array.fill');
require('../modules/es.array.filter');
require('../modules/es.array.find');
require('../modules/es.array.find-index');
require('../modules/es.array.flat');
require('../modules/es.array.flat-map');
require('../modules/es.array.for-each');
require('../modules/es.array.includes');
require('../modules/es.array.index-of');
require('../modules/es.array.join');
require('../modules/es.array.last-index-of');
require('../modules/es.array.map');
require('../modules/es.array.reduce');
require('../modules/es.array.reduce-right');
require('../modules/es.array.reverse');
require('../modules/es.array.slice');
require('../modules/es.array.some');
require('../modules/es.array.sort');
require('../modules/es.array.splice');
require('../modules/es.array.species');
require('../modules/es.array.unscopables.flat');
require('../modules/es.array.unscopables.flat-map');
require('../modules/es.array.iterator');
require('../modules/es.string.from-code-point');
require('../modules/es.string.raw');
require('../modules/es.string.code-point-at');
require('../modules/es.string.ends-with');
require('../modules/es.string.includes');
require('../modules/es.string.match');
require('../modules/es.string.match-all');
require('../modules/es.string.pad-end');
require('../modules/es.string.pad-start');
require('../modules/es.string.repeat');
require('../modules/es.string.replace');
require('../modules/es.string.search');
require('../modules/es.string.split');
require('../modules/es.string.starts-with');
require('../modules/es.string.trim');
require('../modules/es.string.trim-start');
require('../modules/es.string.trim-end');
require('../modules/es.string.iterator');
require('../modules/es.string.anchor');
require('../modules/es.string.big');
require('../modules/es.string.blink');
require('../modules/es.string.bold');
require('../modules/es.string.fixed');
require('../modules/es.string.fontcolor');
require('../modules/es.string.fontsize');
require('../modules/es.string.italics');
require('../modules/es.string.link');
require('../modules/es.string.small');
require('../modules/es.string.strike');
require('../modules/es.string.sub');
require('../modules/es.string.sup');
require('../modules/es.regexp.constructor');
require('../modules/es.regexp.exec');
require('../modules/es.regexp.flags');
require('../modules/es.regexp.sticky');
require('../modules/es.regexp.test');
require('../modules/es.regexp.to-string');
require('../modules/es.parse-int');
require('../modules/es.parse-float');
require('../modules/es.number.constructor');
require('../modules/es.number.epsilon');
require('../modules/es.number.is-finite');
require('../modules/es.number.is-integer');
require('../modules/es.number.is-nan');
require('../modules/es.number.is-safe-integer');
require('../modules/es.number.max-safe-integer');
require('../modules/es.number.min-safe-integer');
require('../modules/es.number.parse-float');
require('../modules/es.number.parse-int');
require('../modules/es.number.to-fixed');
require('../modules/es.number.to-precision');
require('../modules/es.math.acosh');
require('../modules/es.math.asinh');
require('../modules/es.math.atanh');
require('../modules/es.math.cbrt');
require('../modules/es.math.clz32');
require('../modules/es.math.cosh');
require('../modules/es.math.expm1');
require('../modules/es.math.fround');
require('../modules/es.math.hypot');
require('../modules/es.math.imul');
require('../modules/es.math.log10');
require('../modules/es.math.log1p');
require('../modules/es.math.log2');
require('../modules/es.math.sign');
require('../modules/es.math.sinh');
require('../modules/es.math.tanh');
require('../modules/es.math.to-string-tag');
require('../modules/es.math.trunc');
require('../modules/es.date.now');
require('../modules/es.date.to-json');
require('../modules/es.date.to-iso-string');
require('../modules/es.date.to-string');
require('../modules/es.date.to-primitive');
require('../modules/es.json.stringify');
require('../modules/es.json.to-string-tag');
require('../modules/es.promise');
require('../modules/es.promise.all-settled');
require('../modules/es.promise.finally');
require('../modules/es.map');
require('../modules/es.set');
require('../modules/es.weak-map');
require('../modules/es.weak-set');
require('../modules/es.array-buffer.constructor');
require('../modules/es.array-buffer.is-view');
require('../modules/es.array-buffer.slice');
require('../modules/es.data-view');
require('../modules/es.typed-array.int8-array');
require('../modules/es.typed-array.uint8-array');
require('../modules/es.typed-array.uint8-clamped-array');
require('../modules/es.typed-array.int16-array');
require('../modules/es.typed-array.uint16-array');
require('../modules/es.typed-array.int32-array');
require('../modules/es.typed-array.uint32-array');
require('../modules/es.typed-array.float32-array');
require('../modules/es.typed-array.float64-array');
require('../modules/es.typed-array.from');
require('../modules/es.typed-array.of');
require('../modules/es.typed-array.copy-within');
require('../modules/es.typed-array.every');
require('../modules/es.typed-array.fill');
require('../modules/es.typed-array.filter');
require('../modules/es.typed-array.find');
require('../modules/es.typed-array.find-index');
require('../modules/es.typed-array.for-each');
require('../modules/es.typed-array.includes');
require('../modules/es.typed-array.index-of');
require('../modules/es.typed-array.iterator');
require('../modules/es.typed-array.join');
require('../modules/es.typed-array.last-index-of');
require('../modules/es.typed-array.map');
require('../modules/es.typed-array.reduce');
require('../modules/es.typed-array.reduce-right');
require('../modules/es.typed-array.reverse');
require('../modules/es.typed-array.set');
require('../modules/es.typed-array.slice');
require('../modules/es.typed-array.some');
require('../modules/es.typed-array.sort');
require('../modules/es.typed-array.subarray');
require('../modules/es.typed-array.to-locale-string');
require('../modules/es.typed-array.to-string');
require('../modules/es.reflect.apply');
require('../modules/es.reflect.construct');
require('../modules/es.reflect.define-property');
require('../modules/es.reflect.delete-property');
require('../modules/es.reflect.get');
require('../modules/es.reflect.get-own-property-descriptor');
require('../modules/es.reflect.get-prototype-of');
require('../modules/es.reflect.has');
require('../modules/es.reflect.is-extensible');
require('../modules/es.reflect.own-keys');
require('../modules/es.reflect.prevent-extensions');
require('../modules/es.reflect.set');
require('../modules/es.reflect.set-prototype-of');
var path = require('../internals/path');
module.exports = path;

View File

@@ -0,0 +1,8 @@
var bind = require('../function/virtual/bind');
var FunctionPrototype = Function.prototype;
module.exports = function (it) {
var own = it.bind;
return it === FunctionPrototype || (it instanceof Function && own === FunctionPrototype.bind) ? bind : own;
};

View File

@@ -0,0 +1,9 @@
var codePointAt = require('../string/virtual/code-point-at');
var StringPrototype = String.prototype;
module.exports = function (it) {
var own = it.codePointAt;
return typeof it === 'string' || it === StringPrototype
|| (it instanceof String && own === StringPrototype.codePointAt) ? codePointAt : own;
};

View File

@@ -0,0 +1,8 @@
var concat = require('../array/virtual/concat');
var ArrayPrototype = Array.prototype;
module.exports = function (it) {
var own = it.concat;
return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.concat) ? concat : own;
};

View File

@@ -0,0 +1,8 @@
var copyWithin = require('../array/virtual/copy-within');
var ArrayPrototype = Array.prototype;
module.exports = function (it) {
var own = it.copyWithin;
return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.copyWithin) ? copyWithin : own;
};

View File

@@ -0,0 +1,9 @@
var endsWith = require('../string/virtual/ends-with');
var StringPrototype = String.prototype;
module.exports = function (it) {
var own = it.endsWith;
return typeof it === 'string' || it === StringPrototype
|| (it instanceof String && own === StringPrototype.endsWith) ? endsWith : own;
};

View File

@@ -0,0 +1,8 @@
var entries = require('../array/virtual/entries');
var ArrayPrototype = Array.prototype;
module.exports = function (it) {
var own = it.entries;
return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.entries) ? entries : own;
};

View File

@@ -0,0 +1,8 @@
var every = require('../array/virtual/every');
var ArrayPrototype = Array.prototype;
module.exports = function (it) {
var own = it.every;
return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.every) ? every : own;
};

View File

@@ -0,0 +1,8 @@
var fill = require('../array/virtual/fill');
var ArrayPrototype = Array.prototype;
module.exports = function (it) {
var own = it.fill;
return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.fill) ? fill : own;
};

View File

@@ -0,0 +1,8 @@
var filter = require('../array/virtual/filter');
var ArrayPrototype = Array.prototype;
module.exports = function (it) {
var own = it.filter;
return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.filter) ? filter : own;
};

Some files were not shown because too many files have changed in this diff Show More