初始化
This commit is contained in:
21
node_modules/.store/sass@1.69.5/node_modules/chokidar/LICENSE
generated
vendored
Normal file
21
node_modules/.store/sass@1.69.5/node_modules/chokidar/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2012-2019 Paul Miller (https://paulmillr.com), Elan Shanker
|
||||
|
||||
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.
|
||||
308
node_modules/.store/sass@1.69.5/node_modules/chokidar/README.md
generated
vendored
Normal file
308
node_modules/.store/sass@1.69.5/node_modules/chokidar/README.md
generated
vendored
Normal file
@@ -0,0 +1,308 @@
|
||||
# Chokidar [](https://github.com/paulmillr/chokidar) [](https://github.com/paulmillr/chokidar)
|
||||
|
||||
> Minimal and efficient cross-platform file watching library
|
||||
|
||||
[](https://www.npmjs.com/package/chokidar)
|
||||
|
||||
## Why?
|
||||
|
||||
Node.js `fs.watch`:
|
||||
|
||||
* Doesn't report filenames on MacOS.
|
||||
* Doesn't report events at all when using editors like Sublime on MacOS.
|
||||
* Often reports events twice.
|
||||
* Emits most changes as `rename`.
|
||||
* Does not provide an easy way to recursively watch file trees.
|
||||
* Does not support recursive watching on Linux.
|
||||
|
||||
Node.js `fs.watchFile`:
|
||||
|
||||
* Almost as bad at event handling.
|
||||
* Also does not provide any recursive watching.
|
||||
* Results in high CPU utilization.
|
||||
|
||||
Chokidar resolves these problems.
|
||||
|
||||
Initially made for **[Brunch](https://brunch.io/)** (an ultra-swift web app build tool), it is now used in
|
||||
[Microsoft's Visual Studio Code](https://github.com/microsoft/vscode),
|
||||
[gulp](https://github.com/gulpjs/gulp/),
|
||||
[karma](https://karma-runner.github.io/),
|
||||
[PM2](https://github.com/Unitech/PM2),
|
||||
[browserify](http://browserify.org/),
|
||||
[webpack](https://webpack.github.io/),
|
||||
[BrowserSync](https://www.browsersync.io/),
|
||||
and [many others](https://www.npmjs.com/browse/depended/chokidar).
|
||||
It has proven itself in production environments.
|
||||
|
||||
Version 3 is out! Check out our blog post about it: [Chokidar 3: How to save 32TB of traffic every week](https://paulmillr.com/posts/chokidar-3-save-32tb-of-traffic/)
|
||||
|
||||
## How?
|
||||
|
||||
Chokidar does still rely on the Node.js core `fs` module, but when using
|
||||
`fs.watch` and `fs.watchFile` for watching, it normalizes the events it
|
||||
receives, often checking for truth by getting file stats and/or dir contents.
|
||||
|
||||
On MacOS, chokidar by default uses a native extension exposing the Darwin
|
||||
`FSEvents` API. This provides very efficient recursive watching compared with
|
||||
implementations like `kqueue` available on most \*nix platforms. Chokidar still
|
||||
does have to do some work to normalize the events received that way as well.
|
||||
|
||||
On most other platforms, the `fs.watch`-based implementation is the default, which
|
||||
avoids polling and keeps CPU usage down. Be advised that chokidar will initiate
|
||||
watchers recursively for everything within scope of the paths that have been
|
||||
specified, so be judicious about not wasting system resources by watching much
|
||||
more than needed.
|
||||
|
||||
## Getting started
|
||||
|
||||
Install with npm:
|
||||
|
||||
```sh
|
||||
npm install chokidar
|
||||
```
|
||||
|
||||
Then `require` and use it in your code:
|
||||
|
||||
```javascript
|
||||
const chokidar = require('chokidar');
|
||||
|
||||
// One-liner for current directory
|
||||
chokidar.watch('.').on('all', (event, path) => {
|
||||
console.log(event, path);
|
||||
});
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```javascript
|
||||
// Example of a more typical implementation structure
|
||||
|
||||
// Initialize watcher.
|
||||
const watcher = chokidar.watch('file, dir, glob, or array', {
|
||||
ignored: /(^|[\/\\])\../, // ignore dotfiles
|
||||
persistent: true
|
||||
});
|
||||
|
||||
// Something to use when events are received.
|
||||
const log = console.log.bind(console);
|
||||
// Add event listeners.
|
||||
watcher
|
||||
.on('add', path => log(`File ${path} has been added`))
|
||||
.on('change', path => log(`File ${path} has been changed`))
|
||||
.on('unlink', path => log(`File ${path} has been removed`));
|
||||
|
||||
// More possible events.
|
||||
watcher
|
||||
.on('addDir', path => log(`Directory ${path} has been added`))
|
||||
.on('unlinkDir', path => log(`Directory ${path} has been removed`))
|
||||
.on('error', error => log(`Watcher error: ${error}`))
|
||||
.on('ready', () => log('Initial scan complete. Ready for changes'))
|
||||
.on('raw', (event, path, details) => { // internal
|
||||
log('Raw event info:', event, path, details);
|
||||
});
|
||||
|
||||
// 'add', 'addDir' and 'change' events also receive stat() results as second
|
||||
// argument when available: https://nodejs.org/api/fs.html#fs_class_fs_stats
|
||||
watcher.on('change', (path, stats) => {
|
||||
if (stats) console.log(`File ${path} changed size to ${stats.size}`);
|
||||
});
|
||||
|
||||
// Watch new files.
|
||||
watcher.add('new-file');
|
||||
watcher.add(['new-file-2', 'new-file-3', '**/other-file*']);
|
||||
|
||||
// Get list of actual paths being watched on the filesystem
|
||||
var watchedPaths = watcher.getWatched();
|
||||
|
||||
// Un-watch some files.
|
||||
await watcher.unwatch('new-file*');
|
||||
|
||||
// Stop watching.
|
||||
// The method is async!
|
||||
watcher.close().then(() => console.log('closed'));
|
||||
|
||||
// Full list of options. See below for descriptions.
|
||||
// Do not use this example!
|
||||
chokidar.watch('file', {
|
||||
persistent: true,
|
||||
|
||||
ignored: '*.txt',
|
||||
ignoreInitial: false,
|
||||
followSymlinks: true,
|
||||
cwd: '.',
|
||||
disableGlobbing: false,
|
||||
|
||||
usePolling: false,
|
||||
interval: 100,
|
||||
binaryInterval: 300,
|
||||
alwaysStat: false,
|
||||
depth: 99,
|
||||
awaitWriteFinish: {
|
||||
stabilityThreshold: 2000,
|
||||
pollInterval: 100
|
||||
},
|
||||
|
||||
ignorePermissionErrors: false,
|
||||
atomic: true // or a custom 'atomicity delay', in milliseconds (default 100)
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
`chokidar.watch(paths, [options])`
|
||||
|
||||
* `paths` (string or array of strings). Paths to files, dirs to be watched
|
||||
recursively, or glob patterns.
|
||||
- Note: globs must not contain windows separators (`\`),
|
||||
because that's how they work by the standard —
|
||||
you'll need to replace them with forward slashes (`/`).
|
||||
- Note 2: for additional glob documentation, check out low-level
|
||||
library: [picomatch](https://github.com/micromatch/picomatch).
|
||||
* `options` (object) Options object as defined below:
|
||||
|
||||
#### Persistence
|
||||
|
||||
* `persistent` (default: `true`). Indicates whether the process
|
||||
should continue to run as long as files are being watched. If set to
|
||||
`false` when using `fsevents` to watch, no more events will be emitted
|
||||
after `ready`, even if the process continues to run.
|
||||
|
||||
#### Path filtering
|
||||
|
||||
* `ignored` ([anymatch](https://github.com/es128/anymatch)-compatible definition)
|
||||
Defines files/paths to be ignored. The whole relative or absolute path is
|
||||
tested, not just filename. If a function with two arguments is provided, it
|
||||
gets called twice per path - once with a single argument (the path), second
|
||||
time with two arguments (the path and the
|
||||
[`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats)
|
||||
object of that path).
|
||||
* `ignoreInitial` (default: `false`). If set to `false` then `add`/`addDir` events are also emitted for matching paths while
|
||||
instantiating the watching as chokidar discovers these file paths (before the `ready` event).
|
||||
* `followSymlinks` (default: `true`). When `false`, only the
|
||||
symlinks themselves will be watched for changes instead of following
|
||||
the link references and bubbling events through the link's path.
|
||||
* `cwd` (no default). The base directory from which watch `paths` are to be
|
||||
derived. Paths emitted with events will be relative to this.
|
||||
* `disableGlobbing` (default: `false`). If set to `true` then the strings passed to `.watch()` and `.add()` are treated as
|
||||
literal path names, even if they look like globs.
|
||||
|
||||
#### Performance
|
||||
|
||||
* `usePolling` (default: `false`).
|
||||
Whether to use fs.watchFile (backed by polling), or fs.watch. If polling
|
||||
leads to high CPU utilization, consider setting this to `false`. It is
|
||||
typically necessary to **set this to `true` to successfully watch files over
|
||||
a network**, and it may be necessary to successfully watch files in other
|
||||
non-standard situations. Setting to `true` explicitly on MacOS overrides the
|
||||
`useFsEvents` default. You may also set the CHOKIDAR_USEPOLLING env variable
|
||||
to true (1) or false (0) in order to override this option.
|
||||
* _Polling-specific settings_ (effective when `usePolling: true`)
|
||||
* `interval` (default: `100`). Interval of file system polling, in milliseconds. You may also
|
||||
set the CHOKIDAR_INTERVAL env variable to override this option.
|
||||
* `binaryInterval` (default: `300`). Interval of file system
|
||||
polling for binary files.
|
||||
([see list of binary extensions](https://github.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json))
|
||||
* `useFsEvents` (default: `true` on MacOS). Whether to use the
|
||||
`fsevents` watching interface if available. When set to `true` explicitly
|
||||
and `fsevents` is available this supercedes the `usePolling` setting. When
|
||||
set to `false` on MacOS, `usePolling: true` becomes the default.
|
||||
* `alwaysStat` (default: `false`). If relying upon the
|
||||
[`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats)
|
||||
object that may get passed with `add`, `addDir`, and `change` events, set
|
||||
this to `true` to ensure it is provided even in cases where it wasn't
|
||||
already available from the underlying watch events.
|
||||
* `depth` (default: `undefined`). If set, limits how many levels of
|
||||
subdirectories will be traversed.
|
||||
* `awaitWriteFinish` (default: `false`).
|
||||
By default, the `add` event will fire when a file first appears on disk, before
|
||||
the entire file has been written. Furthermore, in some cases some `change`
|
||||
events will be emitted while the file is being written. In some cases,
|
||||
especially when watching for large files there will be a need to wait for the
|
||||
write operation to finish before responding to a file creation or modification.
|
||||
Setting `awaitWriteFinish` to `true` (or a truthy value) will poll file size,
|
||||
holding its `add` and `change` events until the size does not change for a
|
||||
configurable amount of time. The appropriate duration setting is heavily
|
||||
dependent on the OS and hardware. For accurate detection this parameter should
|
||||
be relatively high, making file watching much less responsive.
|
||||
Use with caution.
|
||||
* *`options.awaitWriteFinish` can be set to an object in order to adjust
|
||||
timing params:*
|
||||
* `awaitWriteFinish.stabilityThreshold` (default: 2000). Amount of time in
|
||||
milliseconds for a file size to remain constant before emitting its event.
|
||||
* `awaitWriteFinish.pollInterval` (default: 100). File size polling interval, in milliseconds.
|
||||
|
||||
#### Errors
|
||||
|
||||
* `ignorePermissionErrors` (default: `false`). Indicates whether to watch files
|
||||
that don't have read permissions if possible. If watching fails due to `EPERM`
|
||||
or `EACCES` with this set to `true`, the errors will be suppressed silently.
|
||||
* `atomic` (default: `true` if `useFsEvents` and `usePolling` are `false`).
|
||||
Automatically filters out artifacts that occur when using editors that use
|
||||
"atomic writes" instead of writing directly to the source file. If a file is
|
||||
re-added within 100 ms of being deleted, Chokidar emits a `change` event
|
||||
rather than `unlink` then `add`. If the default of 100 ms does not work well
|
||||
for you, you can override it by setting `atomic` to a custom value, in
|
||||
milliseconds.
|
||||
|
||||
### Methods & Events
|
||||
|
||||
`chokidar.watch()` produces an instance of `FSWatcher`. Methods of `FSWatcher`:
|
||||
|
||||
* `.add(path / paths)`: Add files, directories, or glob patterns for tracking.
|
||||
Takes an array of strings or just one string.
|
||||
* `.on(event, callback)`: Listen for an FS event.
|
||||
Available events: `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `ready`,
|
||||
`raw`, `error`.
|
||||
Additionally `all` is available which gets emitted with the underlying event
|
||||
name and path for every event other than `ready`, `raw`, and `error`. `raw` is internal, use it carefully.
|
||||
* `.unwatch(path / paths)`: Stop watching files, directories, or glob patterns.
|
||||
Takes an array of strings or just one string.
|
||||
* `.close()`: **async** Removes all listeners from watched files. Asynchronous, returns Promise. Use with `await` to ensure bugs don't happen.
|
||||
* `.getWatched()`: Returns an object representing all the paths on the file
|
||||
system being watched by this `FSWatcher` instance. The object's keys are all the
|
||||
directories (using absolute paths unless the `cwd` option was used), and the
|
||||
values are arrays of the names of the items contained in each directory.
|
||||
|
||||
## CLI
|
||||
|
||||
If you need a CLI interface for your file watching, check out
|
||||
[chokidar-cli](https://github.com/open-cli-tools/chokidar-cli), allowing you to
|
||||
execute a command on each change, or get a stdio stream of change events.
|
||||
|
||||
## Install Troubleshooting
|
||||
|
||||
* `npm WARN optional dep failed, continuing fsevents@n.n.n`
|
||||
* This message is normal part of how `npm` handles optional dependencies and is
|
||||
not indicative of a problem. Even if accompanied by other related error messages,
|
||||
Chokidar should function properly.
|
||||
|
||||
* `TypeError: fsevents is not a constructor`
|
||||
* Update chokidar by doing `rm -rf node_modules package-lock.json yarn.lock && npm install`, or update your dependency that uses chokidar.
|
||||
|
||||
* Chokidar is producing `ENOSP` error on Linux, like this:
|
||||
* `bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell`
|
||||
`Error: watch /home/ ENOSPC`
|
||||
* This means Chokidar ran out of file handles and you'll need to increase their count by executing the following command in Terminal:
|
||||
`echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p`
|
||||
|
||||
## Changelog
|
||||
|
||||
For more detailed changelog, see [`full_changelog.md`](.github/full_changelog.md).
|
||||
- **v3.5 (Jan 6, 2021):** Support for ARM Macs with Apple Silicon. Fixes for deleted symlinks.
|
||||
- **v3.4 (Apr 26, 2020):** Support for directory-based symlinks. Fixes for macos file replacement.
|
||||
- **v3.3 (Nov 2, 2019):** `FSWatcher#close()` method became async. That fixes IO race conditions related to close method.
|
||||
- **v3.2 (Oct 1, 2019):** Improve Linux RAM usage by 50%. Race condition fixes. Windows glob fixes. Improve stability by using tight range of dependency versions.
|
||||
- **v3.1 (Sep 16, 2019):** dotfiles are no longer filtered out by default. Use `ignored` option if needed. Improve initial Linux scan time by 50%.
|
||||
- **v3 (Apr 30, 2019):** massive CPU & RAM consumption improvements; reduces deps / package size by a factor of 17x and bumps Node.js requirement to v8.16 and higher.
|
||||
- **v2 (Dec 29, 2017):** Globs are now posix-style-only; without windows support. Tons of bugfixes.
|
||||
- **v1 (Apr 7, 2015):** Glob support, symlink support, tons of bugfixes. Node 0.8+ is supported
|
||||
- **v0.1 (Apr 20, 2012):** Initial release, extracted from [Brunch](https://github.com/brunch/brunch/blob/9847a065aea300da99bd0753f90354cde9de1261/src/helpers.coffee#L66)
|
||||
|
||||
## Also
|
||||
|
||||
Why was chokidar named this way? What's the meaning behind it?
|
||||
|
||||
>Chowkidar is a transliteration of a Hindi word meaning 'watchman, gatekeeper', चौकीदार. This ultimately comes from Sanskrit _ चतुष्क_ (crossway, quadrangle, consisting-of-four).
|
||||
|
||||
## License
|
||||
|
||||
MIT (c) Paul Miller (<https://paulmillr.com>), see [LICENSE](LICENSE) file.
|
||||
973
node_modules/.store/sass@1.69.5/node_modules/chokidar/index.js
generated
vendored
Normal file
973
node_modules/.store/sass@1.69.5/node_modules/chokidar/index.js
generated
vendored
Normal file
@@ -0,0 +1,973 @@
|
||||
'use strict';
|
||||
|
||||
const { EventEmitter } = require('events');
|
||||
const fs = require('fs');
|
||||
const sysPath = require('path');
|
||||
const { promisify } = require('util');
|
||||
const readdirp = require('readdirp');
|
||||
const anymatch = require('anymatch').default;
|
||||
const globParent = require('glob-parent');
|
||||
const isGlob = require('is-glob');
|
||||
const braces = require('braces');
|
||||
const normalizePath = require('normalize-path');
|
||||
|
||||
const NodeFsHandler = require('./lib/nodefs-handler');
|
||||
const FsEventsHandler = require('./lib/fsevents-handler');
|
||||
const {
|
||||
EV_ALL,
|
||||
EV_READY,
|
||||
EV_ADD,
|
||||
EV_CHANGE,
|
||||
EV_UNLINK,
|
||||
EV_ADD_DIR,
|
||||
EV_UNLINK_DIR,
|
||||
EV_RAW,
|
||||
EV_ERROR,
|
||||
|
||||
STR_CLOSE,
|
||||
STR_END,
|
||||
|
||||
BACK_SLASH_RE,
|
||||
DOUBLE_SLASH_RE,
|
||||
SLASH_OR_BACK_SLASH_RE,
|
||||
DOT_RE,
|
||||
REPLACER_RE,
|
||||
|
||||
SLASH,
|
||||
SLASH_SLASH,
|
||||
BRACE_START,
|
||||
BANG,
|
||||
ONE_DOT,
|
||||
TWO_DOTS,
|
||||
GLOBSTAR,
|
||||
SLASH_GLOBSTAR,
|
||||
ANYMATCH_OPTS,
|
||||
STRING_TYPE,
|
||||
FUNCTION_TYPE,
|
||||
EMPTY_STR,
|
||||
EMPTY_FN,
|
||||
|
||||
isWindows,
|
||||
isMacos,
|
||||
isIBMi
|
||||
} = require('./lib/constants');
|
||||
|
||||
const stat = promisify(fs.stat);
|
||||
const readdir = promisify(fs.readdir);
|
||||
|
||||
/**
|
||||
* @typedef {String} Path
|
||||
* @typedef {'all'|'add'|'addDir'|'change'|'unlink'|'unlinkDir'|'raw'|'error'|'ready'} EventName
|
||||
* @typedef {'readdir'|'watch'|'add'|'remove'|'change'} ThrottleType
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @typedef {Object} WatchHelpers
|
||||
* @property {Boolean} followSymlinks
|
||||
* @property {'stat'|'lstat'} statMethod
|
||||
* @property {Path} path
|
||||
* @property {Path} watchPath
|
||||
* @property {Function} entryPath
|
||||
* @property {Boolean} hasGlob
|
||||
* @property {Object} globFilter
|
||||
* @property {Function} filterPath
|
||||
* @property {Function} filterDir
|
||||
*/
|
||||
|
||||
const arrify = (value = []) => Array.isArray(value) ? value : [value];
|
||||
const flatten = (list, result = []) => {
|
||||
list.forEach(item => {
|
||||
if (Array.isArray(item)) {
|
||||
flatten(item, result);
|
||||
} else {
|
||||
result.push(item);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
const unifyPaths = (paths_) => {
|
||||
/**
|
||||
* @type {Array<String>}
|
||||
*/
|
||||
const paths = flatten(arrify(paths_));
|
||||
if (!paths.every(p => typeof p === STRING_TYPE)) {
|
||||
throw new TypeError(`Non-string provided as watch path: ${paths}`);
|
||||
}
|
||||
return paths.map(normalizePathToUnix);
|
||||
};
|
||||
|
||||
// If SLASH_SLASH occurs at the beginning of path, it is not replaced
|
||||
// because "//StoragePC/DrivePool/Movies" is a valid network path
|
||||
const toUnix = (string) => {
|
||||
let str = string.replace(BACK_SLASH_RE, SLASH);
|
||||
let prepend = false;
|
||||
if (str.startsWith(SLASH_SLASH)) {
|
||||
prepend = true;
|
||||
}
|
||||
while (str.match(DOUBLE_SLASH_RE)) {
|
||||
str = str.replace(DOUBLE_SLASH_RE, SLASH);
|
||||
}
|
||||
if (prepend) {
|
||||
str = SLASH + str;
|
||||
}
|
||||
return str;
|
||||
};
|
||||
|
||||
// Our version of upath.normalize
|
||||
// TODO: this is not equal to path-normalize module - investigate why
|
||||
const normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path)));
|
||||
|
||||
const normalizeIgnored = (cwd = EMPTY_STR) => (path) => {
|
||||
if (typeof path !== STRING_TYPE) return path;
|
||||
return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path));
|
||||
};
|
||||
|
||||
const getAbsolutePath = (path, cwd) => {
|
||||
if (sysPath.isAbsolute(path)) {
|
||||
return path;
|
||||
}
|
||||
if (path.startsWith(BANG)) {
|
||||
return BANG + sysPath.join(cwd, path.slice(1));
|
||||
}
|
||||
return sysPath.join(cwd, path);
|
||||
};
|
||||
|
||||
const undef = (opts, key) => opts[key] === undefined;
|
||||
|
||||
/**
|
||||
* Directory entry.
|
||||
* @property {Path} path
|
||||
* @property {Set<Path>} items
|
||||
*/
|
||||
class DirEntry {
|
||||
/**
|
||||
* @param {Path} dir
|
||||
* @param {Function} removeWatcher
|
||||
*/
|
||||
constructor(dir, removeWatcher) {
|
||||
this.path = dir;
|
||||
this._removeWatcher = removeWatcher;
|
||||
/** @type {Set<Path>} */
|
||||
this.items = new Set();
|
||||
}
|
||||
|
||||
add(item) {
|
||||
const {items} = this;
|
||||
if (!items) return;
|
||||
if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item);
|
||||
}
|
||||
|
||||
async remove(item) {
|
||||
const {items} = this;
|
||||
if (!items) return;
|
||||
items.delete(item);
|
||||
if (items.size > 0) return;
|
||||
|
||||
const dir = this.path;
|
||||
try {
|
||||
await readdir(dir);
|
||||
} catch (err) {
|
||||
if (this._removeWatcher) {
|
||||
this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
has(item) {
|
||||
const {items} = this;
|
||||
if (!items) return;
|
||||
return items.has(item);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Array<String>}
|
||||
*/
|
||||
getChildren() {
|
||||
const {items} = this;
|
||||
if (!items) return;
|
||||
return [...items.values()];
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this.items.clear();
|
||||
delete this.path;
|
||||
delete this._removeWatcher;
|
||||
delete this.items;
|
||||
Object.freeze(this);
|
||||
}
|
||||
}
|
||||
|
||||
const STAT_METHOD_F = 'stat';
|
||||
const STAT_METHOD_L = 'lstat';
|
||||
class WatchHelper {
|
||||
constructor(path, watchPath, follow, fsw) {
|
||||
this.fsw = fsw;
|
||||
this.path = path = path.replace(REPLACER_RE, EMPTY_STR);
|
||||
this.watchPath = watchPath;
|
||||
this.fullWatchPath = sysPath.resolve(watchPath);
|
||||
this.hasGlob = watchPath !== path;
|
||||
/** @type {object|boolean} */
|
||||
if (path === EMPTY_STR) this.hasGlob = false;
|
||||
this.globSymlink = this.hasGlob && follow ? undefined : false;
|
||||
this.globFilter = this.hasGlob ? anymatch(path, undefined, ANYMATCH_OPTS) : false;
|
||||
this.dirParts = this.getDirParts(path);
|
||||
this.dirParts.forEach((parts) => {
|
||||
if (parts.length > 1) parts.pop();
|
||||
});
|
||||
this.followSymlinks = follow;
|
||||
this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
|
||||
}
|
||||
|
||||
checkGlobSymlink(entry) {
|
||||
// only need to resolve once
|
||||
// first entry should always have entry.parentDir === EMPTY_STR
|
||||
if (this.globSymlink === undefined) {
|
||||
this.globSymlink = entry.fullParentDir === this.fullWatchPath ?
|
||||
false : {realPath: entry.fullParentDir, linkPath: this.fullWatchPath};
|
||||
}
|
||||
|
||||
if (this.globSymlink) {
|
||||
return entry.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath);
|
||||
}
|
||||
|
||||
return entry.fullPath;
|
||||
}
|
||||
|
||||
entryPath(entry) {
|
||||
return sysPath.join(this.watchPath,
|
||||
sysPath.relative(this.watchPath, this.checkGlobSymlink(entry))
|
||||
);
|
||||
}
|
||||
|
||||
filterPath(entry) {
|
||||
const {stats} = entry;
|
||||
if (stats && stats.isSymbolicLink()) return this.filterDir(entry);
|
||||
const resolvedPath = this.entryPath(entry);
|
||||
const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ?
|
||||
this.globFilter(resolvedPath) : true;
|
||||
return matchesGlob &&
|
||||
this.fsw._isntIgnored(resolvedPath, stats) &&
|
||||
this.fsw._hasReadPermissions(stats);
|
||||
}
|
||||
|
||||
getDirParts(path) {
|
||||
if (!this.hasGlob) return [];
|
||||
const parts = [];
|
||||
const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path];
|
||||
expandedPath.forEach((path) => {
|
||||
parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE));
|
||||
});
|
||||
return parts;
|
||||
}
|
||||
|
||||
filterDir(entry) {
|
||||
if (this.hasGlob) {
|
||||
const entryParts = this.getDirParts(this.checkGlobSymlink(entry));
|
||||
let globstar = false;
|
||||
this.unmatchedGlob = !this.dirParts.some((parts) => {
|
||||
return parts.every((part, i) => {
|
||||
if (part === GLOBSTAR) globstar = true;
|
||||
return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS);
|
||||
});
|
||||
});
|
||||
}
|
||||
return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Watches files & directories for changes. Emitted events:
|
||||
* `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error`
|
||||
*
|
||||
* new FSWatcher()
|
||||
* .add(directories)
|
||||
* .on('add', path => log('File', path, 'was added'))
|
||||
*/
|
||||
class FSWatcher extends EventEmitter {
|
||||
// Not indenting methods for history sake; for now.
|
||||
constructor(_opts) {
|
||||
super();
|
||||
|
||||
const opts = {};
|
||||
if (_opts) Object.assign(opts, _opts); // for frozen objects
|
||||
|
||||
/** @type {Map<String, DirEntry>} */
|
||||
this._watched = new Map();
|
||||
/** @type {Map<String, Array>} */
|
||||
this._closers = new Map();
|
||||
/** @type {Set<String>} */
|
||||
this._ignoredPaths = new Set();
|
||||
|
||||
/** @type {Map<ThrottleType, Map>} */
|
||||
this._throttled = new Map();
|
||||
|
||||
/** @type {Map<Path, String|Boolean>} */
|
||||
this._symlinkPaths = new Map();
|
||||
|
||||
this._streams = new Set();
|
||||
this.closed = false;
|
||||
|
||||
// Set up default options.
|
||||
if (undef(opts, 'persistent')) opts.persistent = true;
|
||||
if (undef(opts, 'ignoreInitial')) opts.ignoreInitial = false;
|
||||
if (undef(opts, 'ignorePermissionErrors')) opts.ignorePermissionErrors = false;
|
||||
if (undef(opts, 'interval')) opts.interval = 100;
|
||||
if (undef(opts, 'binaryInterval')) opts.binaryInterval = 300;
|
||||
if (undef(opts, 'disableGlobbing')) opts.disableGlobbing = false;
|
||||
opts.enableBinaryInterval = opts.binaryInterval !== opts.interval;
|
||||
|
||||
// Enable fsevents on OS X when polling isn't explicitly enabled.
|
||||
if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling;
|
||||
|
||||
// If we can't use fsevents, ensure the options reflect it's disabled.
|
||||
const canUseFsEvents = FsEventsHandler.canUse();
|
||||
if (!canUseFsEvents) opts.useFsEvents = false;
|
||||
|
||||
// Use polling on Mac if not using fsevents.
|
||||
// Other platforms use non-polling fs_watch.
|
||||
if (undef(opts, 'usePolling') && !opts.useFsEvents) {
|
||||
opts.usePolling = isMacos;
|
||||
}
|
||||
|
||||
// Always default to polling on IBM i because fs.watch() is not available on IBM i.
|
||||
if(isIBMi) {
|
||||
opts.usePolling = true;
|
||||
}
|
||||
|
||||
// Global override (useful for end-developers that need to force polling for all
|
||||
// instances of chokidar, regardless of usage/dependency depth)
|
||||
const envPoll = process.env.CHOKIDAR_USEPOLLING;
|
||||
if (envPoll !== undefined) {
|
||||
const envLower = envPoll.toLowerCase();
|
||||
|
||||
if (envLower === 'false' || envLower === '0') {
|
||||
opts.usePolling = false;
|
||||
} else if (envLower === 'true' || envLower === '1') {
|
||||
opts.usePolling = true;
|
||||
} else {
|
||||
opts.usePolling = !!envLower;
|
||||
}
|
||||
}
|
||||
const envInterval = process.env.CHOKIDAR_INTERVAL;
|
||||
if (envInterval) {
|
||||
opts.interval = Number.parseInt(envInterval, 10);
|
||||
}
|
||||
|
||||
// Editor atomic write normalization enabled by default with fs.watch
|
||||
if (undef(opts, 'atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents;
|
||||
if (opts.atomic) this._pendingUnlinks = new Map();
|
||||
|
||||
if (undef(opts, 'followSymlinks')) opts.followSymlinks = true;
|
||||
|
||||
if (undef(opts, 'awaitWriteFinish')) opts.awaitWriteFinish = false;
|
||||
if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {};
|
||||
const awf = opts.awaitWriteFinish;
|
||||
if (awf) {
|
||||
if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000;
|
||||
if (!awf.pollInterval) awf.pollInterval = 100;
|
||||
this._pendingWrites = new Map();
|
||||
}
|
||||
if (opts.ignored) opts.ignored = arrify(opts.ignored);
|
||||
|
||||
let readyCalls = 0;
|
||||
this._emitReady = () => {
|
||||
readyCalls++;
|
||||
if (readyCalls >= this._readyCount) {
|
||||
this._emitReady = EMPTY_FN;
|
||||
this._readyEmitted = true;
|
||||
// use process.nextTick to allow time for listener to be bound
|
||||
process.nextTick(() => this.emit(EV_READY));
|
||||
}
|
||||
};
|
||||
this._emitRaw = (...args) => this.emit(EV_RAW, ...args);
|
||||
this._readyEmitted = false;
|
||||
this.options = opts;
|
||||
|
||||
// Initialize with proper watcher.
|
||||
if (opts.useFsEvents) {
|
||||
this._fsEventsHandler = new FsEventsHandler(this);
|
||||
} else {
|
||||
this._nodeFsHandler = new NodeFsHandler(this);
|
||||
}
|
||||
|
||||
// You’re frozen when your heart’s not open.
|
||||
Object.freeze(opts);
|
||||
}
|
||||
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Adds paths to be watched on an existing FSWatcher instance
|
||||
* @param {Path|Array<Path>} paths_
|
||||
* @param {String=} _origAdd private; for handling non-existent paths to be watched
|
||||
* @param {Boolean=} _internal private; indicates a non-user add
|
||||
* @returns {FSWatcher} for chaining
|
||||
*/
|
||||
add(paths_, _origAdd, _internal) {
|
||||
const {cwd, disableGlobbing} = this.options;
|
||||
this.closed = false;
|
||||
let paths = unifyPaths(paths_);
|
||||
if (cwd) {
|
||||
paths = paths.map((path) => {
|
||||
const absPath = getAbsolutePath(path, cwd);
|
||||
|
||||
// Check `path` instead of `absPath` because the cwd portion can't be a glob
|
||||
if (disableGlobbing || !isGlob(path)) {
|
||||
return absPath;
|
||||
}
|
||||
return normalizePath(absPath);
|
||||
});
|
||||
}
|
||||
|
||||
// set aside negated glob strings
|
||||
paths = paths.filter((path) => {
|
||||
if (path.startsWith(BANG)) {
|
||||
this._ignoredPaths.add(path.slice(1));
|
||||
return false;
|
||||
}
|
||||
|
||||
// if a path is being added that was previously ignored, stop ignoring it
|
||||
this._ignoredPaths.delete(path);
|
||||
this._ignoredPaths.delete(path + SLASH_GLOBSTAR);
|
||||
|
||||
// reset the cached userIgnored anymatch fn
|
||||
// to make ignoredPaths changes effective
|
||||
this._userIgnored = undefined;
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
if (this.options.useFsEvents && this._fsEventsHandler) {
|
||||
if (!this._readyCount) this._readyCount = paths.length;
|
||||
if (this.options.persistent) this._readyCount *= 2;
|
||||
paths.forEach((path) => this._fsEventsHandler._addToFsEvents(path));
|
||||
} else {
|
||||
if (!this._readyCount) this._readyCount = 0;
|
||||
this._readyCount += paths.length;
|
||||
Promise.all(
|
||||
paths.map(async path => {
|
||||
const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, 0, 0, _origAdd);
|
||||
if (res) this._emitReady();
|
||||
return res;
|
||||
})
|
||||
).then(results => {
|
||||
if (this.closed) return;
|
||||
results.filter(item => item).forEach(item => {
|
||||
this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Close watchers or start ignoring events from specified paths.
|
||||
* @param {Path|Array<Path>} paths_ - string or array of strings, file/directory paths and/or globs
|
||||
* @returns {FSWatcher} for chaining
|
||||
*/
|
||||
unwatch(paths_) {
|
||||
if (this.closed) return this;
|
||||
const paths = unifyPaths(paths_);
|
||||
const {cwd} = this.options;
|
||||
|
||||
paths.forEach((path) => {
|
||||
// convert to absolute path unless relative path already matches
|
||||
if (!sysPath.isAbsolute(path) && !this._closers.has(path)) {
|
||||
if (cwd) path = sysPath.join(cwd, path);
|
||||
path = sysPath.resolve(path);
|
||||
}
|
||||
|
||||
this._closePath(path);
|
||||
|
||||
this._ignoredPaths.add(path);
|
||||
if (this._watched.has(path)) {
|
||||
this._ignoredPaths.add(path + SLASH_GLOBSTAR);
|
||||
}
|
||||
|
||||
// reset the cached userIgnored anymatch fn
|
||||
// to make ignoredPaths changes effective
|
||||
this._userIgnored = undefined;
|
||||
});
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Close watchers and remove all listeners from watched paths.
|
||||
* @returns {Promise<void>}.
|
||||
*/
|
||||
close() {
|
||||
if (this.closed) return this._closePromise;
|
||||
this.closed = true;
|
||||
|
||||
// Memory management.
|
||||
this.removeAllListeners();
|
||||
const closers = [];
|
||||
this._closers.forEach(closerList => closerList.forEach(closer => {
|
||||
const promise = closer();
|
||||
if (promise instanceof Promise) closers.push(promise);
|
||||
}));
|
||||
this._streams.forEach(stream => stream.destroy());
|
||||
this._userIgnored = undefined;
|
||||
this._readyCount = 0;
|
||||
this._readyEmitted = false;
|
||||
this._watched.forEach(dirent => dirent.dispose());
|
||||
['closers', 'watched', 'streams', 'symlinkPaths', 'throttled'].forEach(key => {
|
||||
this[`_${key}`].clear();
|
||||
});
|
||||
|
||||
this._closePromise = closers.length ? Promise.all(closers).then(() => undefined) : Promise.resolve();
|
||||
return this._closePromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expose list of watched paths
|
||||
* @returns {Object} for chaining
|
||||
*/
|
||||
getWatched() {
|
||||
const watchList = {};
|
||||
this._watched.forEach((entry, dir) => {
|
||||
const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir;
|
||||
watchList[key || ONE_DOT] = entry.getChildren().sort();
|
||||
});
|
||||
return watchList;
|
||||
}
|
||||
|
||||
emitWithAll(event, args) {
|
||||
this.emit(...args);
|
||||
if (event !== EV_ERROR) this.emit(EV_ALL, ...args);
|
||||
}
|
||||
|
||||
// Common helpers
|
||||
// --------------
|
||||
|
||||
/**
|
||||
* Normalize and emit events.
|
||||
* Calling _emit DOES NOT MEAN emit() would be called!
|
||||
* @param {EventName} event Type of event
|
||||
* @param {Path} path File or directory path
|
||||
* @param {*=} val1 arguments to be passed with event
|
||||
* @param {*=} val2
|
||||
* @param {*=} val3
|
||||
* @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
|
||||
*/
|
||||
async _emit(event, path, val1, val2, val3) {
|
||||
if (this.closed) return;
|
||||
|
||||
const opts = this.options;
|
||||
if (isWindows) path = sysPath.normalize(path);
|
||||
if (opts.cwd) path = sysPath.relative(opts.cwd, path);
|
||||
/** @type Array<any> */
|
||||
const args = [event, path];
|
||||
if (val3 !== undefined) args.push(val1, val2, val3);
|
||||
else if (val2 !== undefined) args.push(val1, val2);
|
||||
else if (val1 !== undefined) args.push(val1);
|
||||
|
||||
const awf = opts.awaitWriteFinish;
|
||||
let pw;
|
||||
if (awf && (pw = this._pendingWrites.get(path))) {
|
||||
pw.lastChange = new Date();
|
||||
return this;
|
||||
}
|
||||
|
||||
if (opts.atomic) {
|
||||
if (event === EV_UNLINK) {
|
||||
this._pendingUnlinks.set(path, args);
|
||||
setTimeout(() => {
|
||||
this._pendingUnlinks.forEach((entry, path) => {
|
||||
this.emit(...entry);
|
||||
this.emit(EV_ALL, ...entry);
|
||||
this._pendingUnlinks.delete(path);
|
||||
});
|
||||
}, typeof opts.atomic === 'number' ? opts.atomic : 100);
|
||||
return this;
|
||||
}
|
||||
if (event === EV_ADD && this._pendingUnlinks.has(path)) {
|
||||
event = args[0] = EV_CHANGE;
|
||||
this._pendingUnlinks.delete(path);
|
||||
}
|
||||
}
|
||||
|
||||
if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) {
|
||||
const awfEmit = (err, stats) => {
|
||||
if (err) {
|
||||
event = args[0] = EV_ERROR;
|
||||
args[1] = err;
|
||||
this.emitWithAll(event, args);
|
||||
} else if (stats) {
|
||||
// if stats doesn't exist the file must have been deleted
|
||||
if (args.length > 2) {
|
||||
args[2] = stats;
|
||||
} else {
|
||||
args.push(stats);
|
||||
}
|
||||
this.emitWithAll(event, args);
|
||||
}
|
||||
};
|
||||
|
||||
this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit);
|
||||
return this;
|
||||
}
|
||||
|
||||
if (event === EV_CHANGE) {
|
||||
const isThrottled = !this._throttle(EV_CHANGE, path, 50);
|
||||
if (isThrottled) return this;
|
||||
}
|
||||
|
||||
if (opts.alwaysStat && val1 === undefined &&
|
||||
(event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE)
|
||||
) {
|
||||
const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path;
|
||||
let stats;
|
||||
try {
|
||||
stats = await stat(fullPath);
|
||||
} catch (err) {}
|
||||
// Suppress event when fs_stat fails, to avoid sending undefined 'stat'
|
||||
if (!stats || this.closed) return;
|
||||
args.push(stats);
|
||||
}
|
||||
this.emitWithAll(event, args);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Common handler for errors
|
||||
* @param {Error} error
|
||||
* @returns {Error|Boolean} The error if defined, otherwise the value of the FSWatcher instance's `closed` flag
|
||||
*/
|
||||
_handleError(error) {
|
||||
const code = error && error.code;
|
||||
if (error && code !== 'ENOENT' && code !== 'ENOTDIR' &&
|
||||
(!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES'))
|
||||
) {
|
||||
this.emit(EV_ERROR, error);
|
||||
}
|
||||
return error || this.closed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper utility for throttling
|
||||
* @param {ThrottleType} actionType type being throttled
|
||||
* @param {Path} path being acted upon
|
||||
* @param {Number} timeout duration of time to suppress duplicate actions
|
||||
* @returns {Object|false} tracking object or false if action should be suppressed
|
||||
*/
|
||||
_throttle(actionType, path, timeout) {
|
||||
if (!this._throttled.has(actionType)) {
|
||||
this._throttled.set(actionType, new Map());
|
||||
}
|
||||
|
||||
/** @type {Map<Path, Object>} */
|
||||
const action = this._throttled.get(actionType);
|
||||
/** @type {Object} */
|
||||
const actionPath = action.get(path);
|
||||
|
||||
if (actionPath) {
|
||||
actionPath.count++;
|
||||
return false;
|
||||
}
|
||||
|
||||
let timeoutObject;
|
||||
const clear = () => {
|
||||
const item = action.get(path);
|
||||
const count = item ? item.count : 0;
|
||||
action.delete(path);
|
||||
clearTimeout(timeoutObject);
|
||||
if (item) clearTimeout(item.timeoutObject);
|
||||
return count;
|
||||
};
|
||||
timeoutObject = setTimeout(clear, timeout);
|
||||
const thr = {timeoutObject, clear, count: 0};
|
||||
action.set(path, thr);
|
||||
return thr;
|
||||
}
|
||||
|
||||
_incrReadyCount() {
|
||||
return this._readyCount++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Awaits write operation to finish.
|
||||
* Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback.
|
||||
* @param {Path} path being acted upon
|
||||
* @param {Number} threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished
|
||||
* @param {EventName} event
|
||||
* @param {Function} awfEmit Callback to be called when ready for event to be emitted.
|
||||
*/
|
||||
_awaitWriteFinish(path, threshold, event, awfEmit) {
|
||||
let timeoutHandler;
|
||||
|
||||
let fullPath = path;
|
||||
if (this.options.cwd && !sysPath.isAbsolute(path)) {
|
||||
fullPath = sysPath.join(this.options.cwd, path);
|
||||
}
|
||||
|
||||
const now = new Date();
|
||||
|
||||
const awaitWriteFinish = (prevStat) => {
|
||||
fs.stat(fullPath, (err, curStat) => {
|
||||
if (err || !this._pendingWrites.has(path)) {
|
||||
if (err && err.code !== 'ENOENT') awfEmit(err);
|
||||
return;
|
||||
}
|
||||
|
||||
const now = Number(new Date());
|
||||
|
||||
if (prevStat && curStat.size !== prevStat.size) {
|
||||
this._pendingWrites.get(path).lastChange = now;
|
||||
}
|
||||
const pw = this._pendingWrites.get(path);
|
||||
const df = now - pw.lastChange;
|
||||
|
||||
if (df >= threshold) {
|
||||
this._pendingWrites.delete(path);
|
||||
awfEmit(undefined, curStat);
|
||||
} else {
|
||||
timeoutHandler = setTimeout(
|
||||
awaitWriteFinish,
|
||||
this.options.awaitWriteFinish.pollInterval,
|
||||
curStat
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (!this._pendingWrites.has(path)) {
|
||||
this._pendingWrites.set(path, {
|
||||
lastChange: now,
|
||||
cancelWait: () => {
|
||||
this._pendingWrites.delete(path);
|
||||
clearTimeout(timeoutHandler);
|
||||
return event;
|
||||
}
|
||||
});
|
||||
timeoutHandler = setTimeout(
|
||||
awaitWriteFinish,
|
||||
this.options.awaitWriteFinish.pollInterval
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
_getGlobIgnored() {
|
||||
return [...this._ignoredPaths.values()];
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether user has asked to ignore this path.
|
||||
* @param {Path} path filepath or dir
|
||||
* @param {fs.Stats=} stats result of fs.stat
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
_isIgnored(path, stats) {
|
||||
if (this.options.atomic && DOT_RE.test(path)) return true;
|
||||
if (!this._userIgnored) {
|
||||
const {cwd} = this.options;
|
||||
const ign = this.options.ignored;
|
||||
|
||||
const ignored = ign && ign.map(normalizeIgnored(cwd));
|
||||
const paths = arrify(ignored)
|
||||
.filter((path) => typeof path === STRING_TYPE && !isGlob(path))
|
||||
.map((path) => path + SLASH_GLOBSTAR);
|
||||
const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths);
|
||||
this._userIgnored = anymatch(list, undefined, ANYMATCH_OPTS);
|
||||
}
|
||||
|
||||
return this._userIgnored([path, stats]);
|
||||
}
|
||||
|
||||
_isntIgnored(path, stat) {
|
||||
return !this._isIgnored(path, stat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a set of common helpers and properties relating to symlink and glob handling.
|
||||
* @param {Path} path file, directory, or glob pattern being watched
|
||||
* @param {Number=} depth at any depth > 0, this isn't a glob
|
||||
* @returns {WatchHelper} object containing helpers for this path
|
||||
*/
|
||||
_getWatchHelpers(path, depth) {
|
||||
const watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path);
|
||||
const follow = this.options.followSymlinks;
|
||||
|
||||
return new WatchHelper(path, watchPath, follow, this);
|
||||
}
|
||||
|
||||
// Directory helpers
|
||||
// -----------------
|
||||
|
||||
/**
|
||||
* Provides directory tracking objects
|
||||
* @param {String} directory path of the directory
|
||||
* @returns {DirEntry} the directory's tracking object
|
||||
*/
|
||||
_getWatchedDir(directory) {
|
||||
if (!this._boundRemove) this._boundRemove = this._remove.bind(this);
|
||||
const dir = sysPath.resolve(directory);
|
||||
if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove));
|
||||
return this._watched.get(dir);
|
||||
}
|
||||
|
||||
// File helpers
|
||||
// ------------
|
||||
|
||||
/**
|
||||
* Check for read permissions.
|
||||
* Based on this answer on SO: https://stackoverflow.com/a/11781404/1358405
|
||||
* @param {fs.Stats} stats - object, result of fs_stat
|
||||
* @returns {Boolean} indicates whether the file can be read
|
||||
*/
|
||||
_hasReadPermissions(stats) {
|
||||
if (this.options.ignorePermissionErrors) return true;
|
||||
|
||||
// stats.mode may be bigint
|
||||
const md = stats && Number.parseInt(stats.mode, 10);
|
||||
const st = md & 0o777;
|
||||
const it = Number.parseInt(st.toString(8)[0], 10);
|
||||
return Boolean(4 & it);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles emitting unlink events for
|
||||
* files and directories, and via recursion, for
|
||||
* files and directories within directories that are unlinked
|
||||
* @param {String} directory within which the following item is located
|
||||
* @param {String} item base path of item/directory
|
||||
* @returns {void}
|
||||
*/
|
||||
_remove(directory, item, isDirectory) {
|
||||
// if what is being deleted is a directory, get that directory's paths
|
||||
// for recursive deleting and cleaning of watched object
|
||||
// if it is not a directory, nestedDirectoryChildren will be empty array
|
||||
const path = sysPath.join(directory, item);
|
||||
const fullPath = sysPath.resolve(path);
|
||||
isDirectory = isDirectory != null
|
||||
? isDirectory
|
||||
: this._watched.has(path) || this._watched.has(fullPath);
|
||||
|
||||
// prevent duplicate handling in case of arriving here nearly simultaneously
|
||||
// via multiple paths (such as _handleFile and _handleDir)
|
||||
if (!this._throttle('remove', path, 100)) return;
|
||||
|
||||
// if the only watched file is removed, watch for its return
|
||||
if (!isDirectory && !this.options.useFsEvents && this._watched.size === 1) {
|
||||
this.add(directory, item, true);
|
||||
}
|
||||
|
||||
// This will create a new entry in the watched object in either case
|
||||
// so we got to do the directory check beforehand
|
||||
const wp = this._getWatchedDir(path);
|
||||
const nestedDirectoryChildren = wp.getChildren();
|
||||
|
||||
// Recursively remove children directories / files.
|
||||
nestedDirectoryChildren.forEach(nested => this._remove(path, nested));
|
||||
|
||||
// Check if item was on the watched list and remove it
|
||||
const parent = this._getWatchedDir(directory);
|
||||
const wasTracked = parent.has(item);
|
||||
parent.remove(item);
|
||||
|
||||
// Fixes issue #1042 -> Relative paths were detected and added as symlinks
|
||||
// (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612),
|
||||
// but never removed from the map in case the path was deleted.
|
||||
// This leads to an incorrect state if the path was recreated:
|
||||
// https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553
|
||||
if (this._symlinkPaths.has(fullPath)) {
|
||||
this._symlinkPaths.delete(fullPath);
|
||||
}
|
||||
|
||||
// If we wait for this file to be fully written, cancel the wait.
|
||||
let relPath = path;
|
||||
if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path);
|
||||
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
||||
const event = this._pendingWrites.get(relPath).cancelWait();
|
||||
if (event === EV_ADD) return;
|
||||
}
|
||||
|
||||
// The Entry will either be a directory that just got removed
|
||||
// or a bogus entry to a file, in either case we have to remove it
|
||||
this._watched.delete(path);
|
||||
this._watched.delete(fullPath);
|
||||
const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK;
|
||||
if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path);
|
||||
|
||||
// Avoid conflicts if we later create another file with the same name
|
||||
if (!this.options.useFsEvents) {
|
||||
this._closePath(path);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes all watchers for a path
|
||||
* @param {Path} path
|
||||
*/
|
||||
_closePath(path) {
|
||||
this._closeFile(path)
|
||||
const dir = sysPath.dirname(path);
|
||||
this._getWatchedDir(dir).remove(sysPath.basename(path));
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes only file-specific watchers
|
||||
* @param {Path} path
|
||||
*/
|
||||
_closeFile(path) {
|
||||
const closers = this._closers.get(path);
|
||||
if (!closers) return;
|
||||
closers.forEach(closer => closer());
|
||||
this._closers.delete(path);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Path} path
|
||||
* @param {Function} closer
|
||||
*/
|
||||
_addPathCloser(path, closer) {
|
||||
if (!closer) return;
|
||||
let list = this._closers.get(path);
|
||||
if (!list) {
|
||||
list = [];
|
||||
this._closers.set(path, list);
|
||||
}
|
||||
list.push(closer);
|
||||
}
|
||||
|
||||
_readdirp(root, opts) {
|
||||
if (this.closed) return;
|
||||
const options = {type: EV_ALL, alwaysStat: true, lstat: true, ...opts};
|
||||
let stream = readdirp(root, options);
|
||||
this._streams.add(stream);
|
||||
stream.once(STR_CLOSE, () => {
|
||||
stream = undefined;
|
||||
});
|
||||
stream.once(STR_END, () => {
|
||||
if (stream) {
|
||||
this._streams.delete(stream);
|
||||
stream = undefined;
|
||||
}
|
||||
});
|
||||
return stream;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Export FSWatcher class
|
||||
exports.FSWatcher = FSWatcher;
|
||||
|
||||
/**
|
||||
* Instantiates watcher with paths to be tracked.
|
||||
* @param {String|Array<String>} paths file/directory paths and/or globs
|
||||
* @param {Object=} options chokidar opts
|
||||
* @returns an instance of FSWatcher for chaining.
|
||||
*/
|
||||
const watch = (paths, options) => {
|
||||
const watcher = new FSWatcher(options);
|
||||
watcher.add(paths);
|
||||
return watcher;
|
||||
};
|
||||
|
||||
exports.watch = watch;
|
||||
65
node_modules/.store/sass@1.69.5/node_modules/chokidar/lib/constants.js
generated
vendored
Normal file
65
node_modules/.store/sass@1.69.5/node_modules/chokidar/lib/constants.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
'use strict';
|
||||
|
||||
const {sep} = require('path');
|
||||
const {platform} = process;
|
||||
const os = require('os');
|
||||
|
||||
exports.EV_ALL = 'all';
|
||||
exports.EV_READY = 'ready';
|
||||
exports.EV_ADD = 'add';
|
||||
exports.EV_CHANGE = 'change';
|
||||
exports.EV_ADD_DIR = 'addDir';
|
||||
exports.EV_UNLINK = 'unlink';
|
||||
exports.EV_UNLINK_DIR = 'unlinkDir';
|
||||
exports.EV_RAW = 'raw';
|
||||
exports.EV_ERROR = 'error';
|
||||
|
||||
exports.STR_DATA = 'data';
|
||||
exports.STR_END = 'end';
|
||||
exports.STR_CLOSE = 'close';
|
||||
|
||||
exports.FSEVENT_CREATED = 'created';
|
||||
exports.FSEVENT_MODIFIED = 'modified';
|
||||
exports.FSEVENT_DELETED = 'deleted';
|
||||
exports.FSEVENT_MOVED = 'moved';
|
||||
exports.FSEVENT_CLONED = 'cloned';
|
||||
exports.FSEVENT_UNKNOWN = 'unknown';
|
||||
exports.FSEVENT_TYPE_FILE = 'file';
|
||||
exports.FSEVENT_TYPE_DIRECTORY = 'directory';
|
||||
exports.FSEVENT_TYPE_SYMLINK = 'symlink';
|
||||
|
||||
exports.KEY_LISTENERS = 'listeners';
|
||||
exports.KEY_ERR = 'errHandlers';
|
||||
exports.KEY_RAW = 'rawEmitters';
|
||||
exports.HANDLER_KEYS = [exports.KEY_LISTENERS, exports.KEY_ERR, exports.KEY_RAW];
|
||||
|
||||
exports.DOT_SLASH = `.${sep}`;
|
||||
|
||||
exports.BACK_SLASH_RE = /\\/g;
|
||||
exports.DOUBLE_SLASH_RE = /\/\//;
|
||||
exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/;
|
||||
exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
|
||||
exports.REPLACER_RE = /^\.[/\\]/;
|
||||
|
||||
exports.SLASH = '/';
|
||||
exports.SLASH_SLASH = '//';
|
||||
exports.BRACE_START = '{';
|
||||
exports.BANG = '!';
|
||||
exports.ONE_DOT = '.';
|
||||
exports.TWO_DOTS = '..';
|
||||
exports.STAR = '*';
|
||||
exports.GLOBSTAR = '**';
|
||||
exports.ROOT_GLOBSTAR = '/**/*';
|
||||
exports.SLASH_GLOBSTAR = '/**';
|
||||
exports.DIR_SUFFIX = 'Dir';
|
||||
exports.ANYMATCH_OPTS = {dot: true};
|
||||
exports.STRING_TYPE = 'string';
|
||||
exports.FUNCTION_TYPE = 'function';
|
||||
exports.EMPTY_STR = '';
|
||||
exports.EMPTY_FN = () => {};
|
||||
exports.IDENTITY_FN = val => val;
|
||||
|
||||
exports.isWindows = platform === 'win32';
|
||||
exports.isMacos = platform === 'darwin';
|
||||
exports.isLinux = platform === 'linux';
|
||||
exports.isIBMi = os.type() === 'OS400';
|
||||
524
node_modules/.store/sass@1.69.5/node_modules/chokidar/lib/fsevents-handler.js
generated
vendored
Normal file
524
node_modules/.store/sass@1.69.5/node_modules/chokidar/lib/fsevents-handler.js
generated
vendored
Normal file
@@ -0,0 +1,524 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const sysPath = require('path');
|
||||
const { promisify } = require('util');
|
||||
|
||||
let fsevents;
|
||||
try {
|
||||
fsevents = require('fsevents');
|
||||
} catch (error) {
|
||||
if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error);
|
||||
}
|
||||
|
||||
if (fsevents) {
|
||||
// TODO: real check
|
||||
const mtch = process.version.match(/v(\d+)\.(\d+)/);
|
||||
if (mtch && mtch[1] && mtch[2]) {
|
||||
const maj = Number.parseInt(mtch[1], 10);
|
||||
const min = Number.parseInt(mtch[2], 10);
|
||||
if (maj === 8 && min < 16) {
|
||||
fsevents = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const {
|
||||
EV_ADD,
|
||||
EV_CHANGE,
|
||||
EV_ADD_DIR,
|
||||
EV_UNLINK,
|
||||
EV_ERROR,
|
||||
STR_DATA,
|
||||
STR_END,
|
||||
FSEVENT_CREATED,
|
||||
FSEVENT_MODIFIED,
|
||||
FSEVENT_DELETED,
|
||||
FSEVENT_MOVED,
|
||||
// FSEVENT_CLONED,
|
||||
FSEVENT_UNKNOWN,
|
||||
FSEVENT_TYPE_FILE,
|
||||
FSEVENT_TYPE_DIRECTORY,
|
||||
FSEVENT_TYPE_SYMLINK,
|
||||
|
||||
ROOT_GLOBSTAR,
|
||||
DIR_SUFFIX,
|
||||
DOT_SLASH,
|
||||
FUNCTION_TYPE,
|
||||
EMPTY_FN,
|
||||
IDENTITY_FN
|
||||
} = require('./constants');
|
||||
|
||||
const Depth = (value) => isNaN(value) ? {} : {depth: value};
|
||||
|
||||
const stat = promisify(fs.stat);
|
||||
const lstat = promisify(fs.lstat);
|
||||
const realpath = promisify(fs.realpath);
|
||||
|
||||
const statMethods = { stat, lstat };
|
||||
|
||||
/**
|
||||
* @typedef {String} Path
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} FsEventsWatchContainer
|
||||
* @property {Set<Function>} listeners
|
||||
* @property {Function} rawEmitter
|
||||
* @property {{stop: Function}} watcher
|
||||
*/
|
||||
|
||||
// fsevents instance helper functions
|
||||
/**
|
||||
* Object to hold per-process fsevents instances (may be shared across chokidar FSWatcher instances)
|
||||
* @type {Map<Path,FsEventsWatchContainer>}
|
||||
*/
|
||||
const FSEventsWatchers = new Map();
|
||||
|
||||
// Threshold of duplicate path prefixes at which to start
|
||||
// consolidating going forward
|
||||
const consolidateThreshhold = 10;
|
||||
|
||||
const wrongEventFlags = new Set([
|
||||
69888, 70400, 71424, 72704, 73472, 131328, 131840, 262912
|
||||
]);
|
||||
|
||||
/**
|
||||
* Instantiates the fsevents interface
|
||||
* @param {Path} path path to be watched
|
||||
* @param {Function} callback called when fsevents is bound and ready
|
||||
* @returns {{stop: Function}} new fsevents instance
|
||||
*/
|
||||
const createFSEventsInstance = (path, callback) => {
|
||||
const stop = fsevents.watch(path, callback);
|
||||
return {stop};
|
||||
};
|
||||
|
||||
/**
|
||||
* Instantiates the fsevents interface or binds listeners to an existing one covering
|
||||
* the same file tree.
|
||||
* @param {Path} path - to be watched
|
||||
* @param {Path} realPath - real path for symlinks
|
||||
* @param {Function} listener - called when fsevents emits events
|
||||
* @param {Function} rawEmitter - passes data to listeners of the 'raw' event
|
||||
* @returns {Function} closer
|
||||
*/
|
||||
function setFSEventsListener(path, realPath, listener, rawEmitter) {
|
||||
let watchPath = sysPath.extname(realPath) ? sysPath.dirname(realPath) : realPath;
|
||||
|
||||
const parentPath = sysPath.dirname(watchPath);
|
||||
let cont = FSEventsWatchers.get(watchPath);
|
||||
|
||||
// If we've accumulated a substantial number of paths that
|
||||
// could have been consolidated by watching one directory
|
||||
// above the current one, create a watcher on the parent
|
||||
// path instead, so that we do consolidate going forward.
|
||||
if (couldConsolidate(parentPath)) {
|
||||
watchPath = parentPath;
|
||||
}
|
||||
|
||||
const resolvedPath = sysPath.resolve(path);
|
||||
const hasSymlink = resolvedPath !== realPath;
|
||||
|
||||
const filteredListener = (fullPath, flags, info) => {
|
||||
if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath);
|
||||
if (
|
||||
fullPath === resolvedPath ||
|
||||
!fullPath.indexOf(resolvedPath + sysPath.sep)
|
||||
) listener(fullPath, flags, info);
|
||||
};
|
||||
|
||||
// check if there is already a watcher on a parent path
|
||||
// modifies `watchPath` to the parent path when it finds a match
|
||||
let watchedParent = false;
|
||||
for (const watchedPath of FSEventsWatchers.keys()) {
|
||||
if (realPath.indexOf(sysPath.resolve(watchedPath) + sysPath.sep) === 0) {
|
||||
watchPath = watchedPath;
|
||||
cont = FSEventsWatchers.get(watchPath);
|
||||
watchedParent = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (cont || watchedParent) {
|
||||
cont.listeners.add(filteredListener);
|
||||
} else {
|
||||
cont = {
|
||||
listeners: new Set([filteredListener]),
|
||||
rawEmitter,
|
||||
watcher: createFSEventsInstance(watchPath, (fullPath, flags) => {
|
||||
if (!cont.listeners.size) return;
|
||||
const info = fsevents.getInfo(fullPath, flags);
|
||||
cont.listeners.forEach(list => {
|
||||
list(fullPath, flags, info);
|
||||
});
|
||||
|
||||
cont.rawEmitter(info.event, fullPath, info);
|
||||
})
|
||||
};
|
||||
FSEventsWatchers.set(watchPath, cont);
|
||||
}
|
||||
|
||||
// removes this instance's listeners and closes the underlying fsevents
|
||||
// instance if there are no more listeners left
|
||||
return () => {
|
||||
const lst = cont.listeners;
|
||||
|
||||
lst.delete(filteredListener);
|
||||
if (!lst.size) {
|
||||
FSEventsWatchers.delete(watchPath);
|
||||
if (cont.watcher) return cont.watcher.stop().then(() => {
|
||||
cont.rawEmitter = cont.watcher = undefined;
|
||||
Object.freeze(cont);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Decide whether or not we should start a new higher-level
|
||||
// parent watcher
|
||||
const couldConsolidate = (path) => {
|
||||
let count = 0;
|
||||
for (const watchPath of FSEventsWatchers.keys()) {
|
||||
if (watchPath.indexOf(path) === 0) {
|
||||
count++;
|
||||
if (count >= consolidateThreshhold) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
// returns boolean indicating whether fsevents can be used
|
||||
const canUse = () => fsevents && FSEventsWatchers.size < 128;
|
||||
|
||||
// determines subdirectory traversal levels from root to path
|
||||
const calcDepth = (path, root) => {
|
||||
let i = 0;
|
||||
while (!path.indexOf(root) && (path = sysPath.dirname(path)) !== root) i++;
|
||||
return i;
|
||||
};
|
||||
|
||||
// returns boolean indicating whether the fsevents' event info has the same type
|
||||
// as the one returned by fs.stat
|
||||
const sameTypes = (info, stats) => (
|
||||
info.type === FSEVENT_TYPE_DIRECTORY && stats.isDirectory() ||
|
||||
info.type === FSEVENT_TYPE_SYMLINK && stats.isSymbolicLink() ||
|
||||
info.type === FSEVENT_TYPE_FILE && stats.isFile()
|
||||
)
|
||||
|
||||
/**
|
||||
* @mixin
|
||||
*/
|
||||
class FsEventsHandler {
|
||||
|
||||
/**
|
||||
* @param {import('../index').FSWatcher} fsw
|
||||
*/
|
||||
constructor(fsw) {
|
||||
this.fsw = fsw;
|
||||
}
|
||||
checkIgnored(path, stats) {
|
||||
const ipaths = this.fsw._ignoredPaths;
|
||||
if (this.fsw._isIgnored(path, stats)) {
|
||||
ipaths.add(path);
|
||||
if (stats && stats.isDirectory()) {
|
||||
ipaths.add(path + ROOT_GLOBSTAR);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
ipaths.delete(path);
|
||||
ipaths.delete(path + ROOT_GLOBSTAR);
|
||||
}
|
||||
|
||||
addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
||||
const event = watchedDir.has(item) ? EV_CHANGE : EV_ADD;
|
||||
this.handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
}
|
||||
|
||||
async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
||||
try {
|
||||
const stats = await stat(path)
|
||||
if (this.fsw.closed) return;
|
||||
if (sameTypes(info, stats)) {
|
||||
this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
} else {
|
||||
this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
}
|
||||
} catch (error) {
|
||||
if (error.code === 'EACCES') {
|
||||
this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
} else {
|
||||
this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
||||
if (this.fsw.closed || this.checkIgnored(path)) return;
|
||||
|
||||
if (event === EV_UNLINK) {
|
||||
const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY
|
||||
// suppress unlink events on never before seen files
|
||||
if (isDirectory || watchedDir.has(item)) {
|
||||
this.fsw._remove(parent, item, isDirectory);
|
||||
}
|
||||
} else {
|
||||
if (event === EV_ADD) {
|
||||
// track new directories
|
||||
if (info.type === FSEVENT_TYPE_DIRECTORY) this.fsw._getWatchedDir(path);
|
||||
|
||||
if (info.type === FSEVENT_TYPE_SYMLINK && opts.followSymlinks) {
|
||||
// push symlinks back to the top of the stack to get handled
|
||||
const curDepth = opts.depth === undefined ?
|
||||
undefined : calcDepth(fullPath, realPath) + 1;
|
||||
return this._addToFsEvents(path, false, true, curDepth);
|
||||
}
|
||||
|
||||
// track new paths
|
||||
// (other than symlinks being followed, which will be tracked soon)
|
||||
this.fsw._getWatchedDir(parent).add(item);
|
||||
}
|
||||
/**
|
||||
* @type {'add'|'addDir'|'unlink'|'unlinkDir'}
|
||||
*/
|
||||
const eventName = info.type === FSEVENT_TYPE_DIRECTORY ? event + DIR_SUFFIX : event;
|
||||
this.fsw._emit(eventName, path);
|
||||
if (eventName === EV_ADD_DIR) this._addToFsEvents(path, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle symlinks encountered during directory scan
|
||||
* @param {String} watchPath - file/dir path to be watched with fsevents
|
||||
* @param {String} realPath - real path (in case of symlinks)
|
||||
* @param {Function} transform - path transformer
|
||||
* @param {Function} globFilter - path filter in case a glob pattern was provided
|
||||
* @returns {Function} closer for the watcher instance
|
||||
*/
|
||||
_watchWithFsEvents(watchPath, realPath, transform, globFilter) {
|
||||
if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return;
|
||||
const opts = this.fsw.options;
|
||||
const watchCallback = async (fullPath, flags, info) => {
|
||||
if (this.fsw.closed) return;
|
||||
if (
|
||||
opts.depth !== undefined &&
|
||||
calcDepth(fullPath, realPath) > opts.depth
|
||||
) return;
|
||||
const path = transform(sysPath.join(
|
||||
watchPath, sysPath.relative(watchPath, fullPath)
|
||||
));
|
||||
if (globFilter && !globFilter(path)) return;
|
||||
// ensure directories are tracked
|
||||
const parent = sysPath.dirname(path);
|
||||
const item = sysPath.basename(path);
|
||||
const watchedDir = this.fsw._getWatchedDir(
|
||||
info.type === FSEVENT_TYPE_DIRECTORY ? path : parent
|
||||
);
|
||||
|
||||
// correct for wrong events emitted
|
||||
if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) {
|
||||
if (typeof opts.ignored === FUNCTION_TYPE) {
|
||||
let stats;
|
||||
try {
|
||||
stats = await stat(path);
|
||||
} catch (error) {}
|
||||
if (this.fsw.closed) return;
|
||||
if (this.checkIgnored(path, stats)) return;
|
||||
if (sameTypes(info, stats)) {
|
||||
this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
} else {
|
||||
this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
}
|
||||
} else {
|
||||
this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
}
|
||||
} else {
|
||||
switch (info.event) {
|
||||
case FSEVENT_CREATED:
|
||||
case FSEVENT_MODIFIED:
|
||||
return this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
case FSEVENT_DELETED:
|
||||
case FSEVENT_MOVED:
|
||||
return this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const closer = setFSEventsListener(
|
||||
watchPath,
|
||||
realPath,
|
||||
watchCallback,
|
||||
this.fsw._emitRaw
|
||||
);
|
||||
|
||||
this.fsw._emitReady();
|
||||
return closer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle symlinks encountered during directory scan
|
||||
* @param {String} linkPath path to symlink
|
||||
* @param {String} fullPath absolute path to the symlink
|
||||
* @param {Function} transform pre-existing path transformer
|
||||
* @param {Number} curDepth level of subdirectories traversed to where symlink is
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) {
|
||||
// don't follow the same symlink more than once
|
||||
if (this.fsw.closed || this.fsw._symlinkPaths.has(fullPath)) return;
|
||||
|
||||
this.fsw._symlinkPaths.set(fullPath, true);
|
||||
this.fsw._incrReadyCount();
|
||||
|
||||
try {
|
||||
const linkTarget = await realpath(linkPath);
|
||||
if (this.fsw.closed) return;
|
||||
if (this.fsw._isIgnored(linkTarget)) {
|
||||
return this.fsw._emitReady();
|
||||
}
|
||||
|
||||
this.fsw._incrReadyCount();
|
||||
|
||||
// add the linkTarget for watching with a wrapper for transform
|
||||
// that causes emitted paths to incorporate the link's path
|
||||
this._addToFsEvents(linkTarget || linkPath, (path) => {
|
||||
let aliasedPath = linkPath;
|
||||
if (linkTarget && linkTarget !== DOT_SLASH) {
|
||||
aliasedPath = path.replace(linkTarget, linkPath);
|
||||
} else if (path !== DOT_SLASH) {
|
||||
aliasedPath = sysPath.join(linkPath, path);
|
||||
}
|
||||
return transform(aliasedPath);
|
||||
}, false, curDepth);
|
||||
} catch(error) {
|
||||
if (this.fsw._handleError(error)) {
|
||||
return this.fsw._emitReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Path} newPath
|
||||
* @param {fs.Stats} stats
|
||||
*/
|
||||
emitAdd(newPath, stats, processPath, opts, forceAdd) {
|
||||
const pp = processPath(newPath);
|
||||
const isDir = stats.isDirectory();
|
||||
const dirObj = this.fsw._getWatchedDir(sysPath.dirname(pp));
|
||||
const base = sysPath.basename(pp);
|
||||
|
||||
// ensure empty dirs get tracked
|
||||
if (isDir) this.fsw._getWatchedDir(pp);
|
||||
if (dirObj.has(base)) return;
|
||||
dirObj.add(base);
|
||||
|
||||
if (!opts.ignoreInitial || forceAdd === true) {
|
||||
this.fsw._emit(isDir ? EV_ADD_DIR : EV_ADD, pp, stats);
|
||||
}
|
||||
}
|
||||
|
||||
initWatch(realPath, path, wh, processPath) {
|
||||
if (this.fsw.closed) return;
|
||||
const closer = this._watchWithFsEvents(
|
||||
wh.watchPath,
|
||||
sysPath.resolve(realPath || wh.watchPath),
|
||||
processPath,
|
||||
wh.globFilter
|
||||
);
|
||||
this.fsw._addPathCloser(path, closer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle added path with fsevents
|
||||
* @param {String} path file/dir path or glob pattern
|
||||
* @param {Function|Boolean=} transform converts working path to what the user expects
|
||||
* @param {Boolean=} forceAdd ensure add is emitted
|
||||
* @param {Number=} priorDepth Level of subdirectories already traversed.
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async _addToFsEvents(path, transform, forceAdd, priorDepth) {
|
||||
if (this.fsw.closed) {
|
||||
return;
|
||||
}
|
||||
const opts = this.fsw.options;
|
||||
const processPath = typeof transform === FUNCTION_TYPE ? transform : IDENTITY_FN;
|
||||
|
||||
const wh = this.fsw._getWatchHelpers(path);
|
||||
|
||||
// evaluate what is at the path we're being asked to watch
|
||||
try {
|
||||
const stats = await statMethods[wh.statMethod](wh.watchPath);
|
||||
if (this.fsw.closed) return;
|
||||
if (this.fsw._isIgnored(wh.watchPath, stats)) {
|
||||
throw null;
|
||||
}
|
||||
if (stats.isDirectory()) {
|
||||
// emit addDir unless this is a glob parent
|
||||
if (!wh.globFilter) this.emitAdd(processPath(path), stats, processPath, opts, forceAdd);
|
||||
|
||||
// don't recurse further if it would exceed depth setting
|
||||
if (priorDepth && priorDepth > opts.depth) return;
|
||||
|
||||
// scan the contents of the dir
|
||||
this.fsw._readdirp(wh.watchPath, {
|
||||
fileFilter: entry => wh.filterPath(entry),
|
||||
directoryFilter: entry => wh.filterDir(entry),
|
||||
...Depth(opts.depth - (priorDepth || 0))
|
||||
}).on(STR_DATA, (entry) => {
|
||||
// need to check filterPath on dirs b/c filterDir is less restrictive
|
||||
if (this.fsw.closed) {
|
||||
return;
|
||||
}
|
||||
if (entry.stats.isDirectory() && !wh.filterPath(entry)) return;
|
||||
|
||||
const joinedPath = sysPath.join(wh.watchPath, entry.path);
|
||||
const {fullPath} = entry;
|
||||
|
||||
if (wh.followSymlinks && entry.stats.isSymbolicLink()) {
|
||||
// preserve the current depth here since it can't be derived from
|
||||
// real paths past the symlink
|
||||
const curDepth = opts.depth === undefined ?
|
||||
undefined : calcDepth(joinedPath, sysPath.resolve(wh.watchPath)) + 1;
|
||||
|
||||
this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth);
|
||||
} else {
|
||||
this.emitAdd(joinedPath, entry.stats, processPath, opts, forceAdd);
|
||||
}
|
||||
}).on(EV_ERROR, EMPTY_FN).on(STR_END, () => {
|
||||
this.fsw._emitReady();
|
||||
});
|
||||
} else {
|
||||
this.emitAdd(wh.watchPath, stats, processPath, opts, forceAdd);
|
||||
this.fsw._emitReady();
|
||||
}
|
||||
} catch (error) {
|
||||
if (!error || this.fsw._handleError(error)) {
|
||||
// TODO: Strange thing: "should not choke on an ignored watch path" will be failed without 2 ready calls -__-
|
||||
this.fsw._emitReady();
|
||||
this.fsw._emitReady();
|
||||
}
|
||||
}
|
||||
|
||||
if (opts.persistent && forceAdd !== true) {
|
||||
if (typeof transform === FUNCTION_TYPE) {
|
||||
// realpath has already been resolved
|
||||
this.initWatch(undefined, path, wh, processPath);
|
||||
} else {
|
||||
let realPath;
|
||||
try {
|
||||
realPath = await realpath(wh.watchPath);
|
||||
} catch (e) {}
|
||||
this.initWatch(realPath, path, wh, processPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = FsEventsHandler;
|
||||
module.exports.canUse = canUse;
|
||||
654
node_modules/.store/sass@1.69.5/node_modules/chokidar/lib/nodefs-handler.js
generated
vendored
Normal file
654
node_modules/.store/sass@1.69.5/node_modules/chokidar/lib/nodefs-handler.js
generated
vendored
Normal file
@@ -0,0 +1,654 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const sysPath = require('path');
|
||||
const { promisify } = require('util');
|
||||
const isBinaryPath = require('is-binary-path');
|
||||
const {
|
||||
isWindows,
|
||||
isLinux,
|
||||
EMPTY_FN,
|
||||
EMPTY_STR,
|
||||
KEY_LISTENERS,
|
||||
KEY_ERR,
|
||||
KEY_RAW,
|
||||
HANDLER_KEYS,
|
||||
EV_CHANGE,
|
||||
EV_ADD,
|
||||
EV_ADD_DIR,
|
||||
EV_ERROR,
|
||||
STR_DATA,
|
||||
STR_END,
|
||||
BRACE_START,
|
||||
STAR
|
||||
} = require('./constants');
|
||||
|
||||
const THROTTLE_MODE_WATCH = 'watch';
|
||||
|
||||
const open = promisify(fs.open);
|
||||
const stat = promisify(fs.stat);
|
||||
const lstat = promisify(fs.lstat);
|
||||
const close = promisify(fs.close);
|
||||
const fsrealpath = promisify(fs.realpath);
|
||||
|
||||
const statMethods = { lstat, stat };
|
||||
|
||||
// TODO: emit errors properly. Example: EMFILE on Macos.
|
||||
const foreach = (val, fn) => {
|
||||
if (val instanceof Set) {
|
||||
val.forEach(fn);
|
||||
} else {
|
||||
fn(val);
|
||||
}
|
||||
};
|
||||
|
||||
const addAndConvert = (main, prop, item) => {
|
||||
let container = main[prop];
|
||||
if (!(container instanceof Set)) {
|
||||
main[prop] = container = new Set([container]);
|
||||
}
|
||||
container.add(item);
|
||||
};
|
||||
|
||||
const clearItem = cont => key => {
|
||||
const set = cont[key];
|
||||
if (set instanceof Set) {
|
||||
set.clear();
|
||||
} else {
|
||||
delete cont[key];
|
||||
}
|
||||
};
|
||||
|
||||
const delFromSet = (main, prop, item) => {
|
||||
const container = main[prop];
|
||||
if (container instanceof Set) {
|
||||
container.delete(item);
|
||||
} else if (container === item) {
|
||||
delete main[prop];
|
||||
}
|
||||
};
|
||||
|
||||
const isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
|
||||
|
||||
/**
|
||||
* @typedef {String} Path
|
||||
*/
|
||||
|
||||
// fs_watch helpers
|
||||
|
||||
// object to hold per-process fs_watch instances
|
||||
// (may be shared across chokidar FSWatcher instances)
|
||||
|
||||
/**
|
||||
* @typedef {Object} FsWatchContainer
|
||||
* @property {Set} listeners
|
||||
* @property {Set} errHandlers
|
||||
* @property {Set} rawEmitters
|
||||
* @property {fs.FSWatcher=} watcher
|
||||
* @property {Boolean=} watcherUnusable
|
||||
*/
|
||||
|
||||
/**
|
||||
* @type {Map<String,FsWatchContainer>}
|
||||
*/
|
||||
const FsWatchInstances = new Map();
|
||||
|
||||
/**
|
||||
* Instantiates the fs_watch interface
|
||||
* @param {String} path to be watched
|
||||
* @param {Object} options to be passed to fs_watch
|
||||
* @param {Function} listener main event handler
|
||||
* @param {Function} errHandler emits info about errors
|
||||
* @param {Function} emitRaw emits raw event data
|
||||
* @returns {fs.FSWatcher} new fsevents instance
|
||||
*/
|
||||
function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
|
||||
const handleEvent = (rawEvent, evPath) => {
|
||||
listener(path);
|
||||
emitRaw(rawEvent, evPath, {watchedPath: path});
|
||||
|
||||
// emit based on events occurring for files from a directory's watcher in
|
||||
// case the file's watcher misses it (and rely on throttling to de-dupe)
|
||||
if (evPath && path !== evPath) {
|
||||
fsWatchBroadcast(
|
||||
sysPath.resolve(path, evPath), KEY_LISTENERS, sysPath.join(path, evPath)
|
||||
);
|
||||
}
|
||||
};
|
||||
try {
|
||||
return fs.watch(path, options, handleEvent);
|
||||
} catch (error) {
|
||||
errHandler(error);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper for passing fs_watch event data to a collection of listeners
|
||||
* @param {Path} fullPath absolute path bound to fs_watch instance
|
||||
* @param {String} type listener type
|
||||
* @param {*=} val1 arguments to be passed to listeners
|
||||
* @param {*=} val2
|
||||
* @param {*=} val3
|
||||
*/
|
||||
const fsWatchBroadcast = (fullPath, type, val1, val2, val3) => {
|
||||
const cont = FsWatchInstances.get(fullPath);
|
||||
if (!cont) return;
|
||||
foreach(cont[type], (listener) => {
|
||||
listener(val1, val2, val3);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Instantiates the fs_watch interface or binds listeners
|
||||
* to an existing one covering the same file system entry
|
||||
* @param {String} path
|
||||
* @param {String} fullPath absolute path
|
||||
* @param {Object} options to be passed to fs_watch
|
||||
* @param {Object} handlers container for event listener functions
|
||||
*/
|
||||
const setFsWatchListener = (path, fullPath, options, handlers) => {
|
||||
const {listener, errHandler, rawEmitter} = handlers;
|
||||
let cont = FsWatchInstances.get(fullPath);
|
||||
|
||||
/** @type {fs.FSWatcher=} */
|
||||
let watcher;
|
||||
if (!options.persistent) {
|
||||
watcher = createFsWatchInstance(
|
||||
path, options, listener, errHandler, rawEmitter
|
||||
);
|
||||
return watcher.close.bind(watcher);
|
||||
}
|
||||
if (cont) {
|
||||
addAndConvert(cont, KEY_LISTENERS, listener);
|
||||
addAndConvert(cont, KEY_ERR, errHandler);
|
||||
addAndConvert(cont, KEY_RAW, rawEmitter);
|
||||
} else {
|
||||
watcher = createFsWatchInstance(
|
||||
path,
|
||||
options,
|
||||
fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
|
||||
errHandler, // no need to use broadcast here
|
||||
fsWatchBroadcast.bind(null, fullPath, KEY_RAW)
|
||||
);
|
||||
if (!watcher) return;
|
||||
watcher.on(EV_ERROR, async (error) => {
|
||||
const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
|
||||
cont.watcherUnusable = true; // documented since Node 10.4.1
|
||||
// Workaround for https://github.com/joyent/node/issues/4337
|
||||
if (isWindows && error.code === 'EPERM') {
|
||||
try {
|
||||
const fd = await open(path, 'r');
|
||||
await close(fd);
|
||||
broadcastErr(error);
|
||||
} catch (err) {}
|
||||
} else {
|
||||
broadcastErr(error);
|
||||
}
|
||||
});
|
||||
cont = {
|
||||
listeners: listener,
|
||||
errHandlers: errHandler,
|
||||
rawEmitters: rawEmitter,
|
||||
watcher
|
||||
};
|
||||
FsWatchInstances.set(fullPath, cont);
|
||||
}
|
||||
// const index = cont.listeners.indexOf(listener);
|
||||
|
||||
// removes this instance's listeners and closes the underlying fs_watch
|
||||
// instance if there are no more listeners left
|
||||
return () => {
|
||||
delFromSet(cont, KEY_LISTENERS, listener);
|
||||
delFromSet(cont, KEY_ERR, errHandler);
|
||||
delFromSet(cont, KEY_RAW, rawEmitter);
|
||||
if (isEmptySet(cont.listeners)) {
|
||||
// Check to protect against issue gh-730.
|
||||
// if (cont.watcherUnusable) {
|
||||
cont.watcher.close();
|
||||
// }
|
||||
FsWatchInstances.delete(fullPath);
|
||||
HANDLER_KEYS.forEach(clearItem(cont));
|
||||
cont.watcher = undefined;
|
||||
Object.freeze(cont);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// fs_watchFile helpers
|
||||
|
||||
// object to hold per-process fs_watchFile instances
|
||||
// (may be shared across chokidar FSWatcher instances)
|
||||
const FsWatchFileInstances = new Map();
|
||||
|
||||
/**
|
||||
* Instantiates the fs_watchFile interface or binds listeners
|
||||
* to an existing one covering the same file system entry
|
||||
* @param {String} path to be watched
|
||||
* @param {String} fullPath absolute path
|
||||
* @param {Object} options options to be passed to fs_watchFile
|
||||
* @param {Object} handlers container for event listener functions
|
||||
* @returns {Function} closer
|
||||
*/
|
||||
const setFsWatchFileListener = (path, fullPath, options, handlers) => {
|
||||
const {listener, rawEmitter} = handlers;
|
||||
let cont = FsWatchFileInstances.get(fullPath);
|
||||
|
||||
/* eslint-disable no-unused-vars, prefer-destructuring */
|
||||
let listeners = new Set();
|
||||
let rawEmitters = new Set();
|
||||
|
||||
const copts = cont && cont.options;
|
||||
if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
|
||||
// "Upgrade" the watcher to persistence or a quicker interval.
|
||||
// This creates some unlikely edge case issues if the user mixes
|
||||
// settings in a very weird way, but solving for those cases
|
||||
// doesn't seem worthwhile for the added complexity.
|
||||
listeners = cont.listeners;
|
||||
rawEmitters = cont.rawEmitters;
|
||||
fs.unwatchFile(fullPath);
|
||||
cont = undefined;
|
||||
}
|
||||
|
||||
/* eslint-enable no-unused-vars, prefer-destructuring */
|
||||
|
||||
if (cont) {
|
||||
addAndConvert(cont, KEY_LISTENERS, listener);
|
||||
addAndConvert(cont, KEY_RAW, rawEmitter);
|
||||
} else {
|
||||
// TODO
|
||||
// listeners.add(listener);
|
||||
// rawEmitters.add(rawEmitter);
|
||||
cont = {
|
||||
listeners: listener,
|
||||
rawEmitters: rawEmitter,
|
||||
options,
|
||||
watcher: fs.watchFile(fullPath, options, (curr, prev) => {
|
||||
foreach(cont.rawEmitters, (rawEmitter) => {
|
||||
rawEmitter(EV_CHANGE, fullPath, {curr, prev});
|
||||
});
|
||||
const currmtime = curr.mtimeMs;
|
||||
if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
|
||||
foreach(cont.listeners, (listener) => listener(path, curr));
|
||||
}
|
||||
})
|
||||
};
|
||||
FsWatchFileInstances.set(fullPath, cont);
|
||||
}
|
||||
// const index = cont.listeners.indexOf(listener);
|
||||
|
||||
// Removes this instance's listeners and closes the underlying fs_watchFile
|
||||
// instance if there are no more listeners left.
|
||||
return () => {
|
||||
delFromSet(cont, KEY_LISTENERS, listener);
|
||||
delFromSet(cont, KEY_RAW, rawEmitter);
|
||||
if (isEmptySet(cont.listeners)) {
|
||||
FsWatchFileInstances.delete(fullPath);
|
||||
fs.unwatchFile(fullPath);
|
||||
cont.options = cont.watcher = undefined;
|
||||
Object.freeze(cont);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* @mixin
|
||||
*/
|
||||
class NodeFsHandler {
|
||||
|
||||
/**
|
||||
* @param {import("../index").FSWatcher} fsW
|
||||
*/
|
||||
constructor(fsW) {
|
||||
this.fsw = fsW;
|
||||
this._boundHandleError = (error) => fsW._handleError(error);
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch file for changes with fs_watchFile or fs_watch.
|
||||
* @param {String} path to file or dir
|
||||
* @param {Function} listener on fs change
|
||||
* @returns {Function} closer for the watcher instance
|
||||
*/
|
||||
_watchWithNodeFs(path, listener) {
|
||||
const opts = this.fsw.options;
|
||||
const directory = sysPath.dirname(path);
|
||||
const basename = sysPath.basename(path);
|
||||
const parent = this.fsw._getWatchedDir(directory);
|
||||
parent.add(basename);
|
||||
const absolutePath = sysPath.resolve(path);
|
||||
const options = {persistent: opts.persistent};
|
||||
if (!listener) listener = EMPTY_FN;
|
||||
|
||||
let closer;
|
||||
if (opts.usePolling) {
|
||||
options.interval = opts.enableBinaryInterval && isBinaryPath(basename) ?
|
||||
opts.binaryInterval : opts.interval;
|
||||
closer = setFsWatchFileListener(path, absolutePath, options, {
|
||||
listener,
|
||||
rawEmitter: this.fsw._emitRaw
|
||||
});
|
||||
} else {
|
||||
closer = setFsWatchListener(path, absolutePath, options, {
|
||||
listener,
|
||||
errHandler: this._boundHandleError,
|
||||
rawEmitter: this.fsw._emitRaw
|
||||
});
|
||||
}
|
||||
return closer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch a file and emit add event if warranted.
|
||||
* @param {Path} file Path
|
||||
* @param {fs.Stats} stats result of fs_stat
|
||||
* @param {Boolean} initialAdd was the file added at watch instantiation?
|
||||
* @returns {Function} closer for the watcher instance
|
||||
*/
|
||||
_handleFile(file, stats, initialAdd) {
|
||||
if (this.fsw.closed) {
|
||||
return;
|
||||
}
|
||||
const dirname = sysPath.dirname(file);
|
||||
const basename = sysPath.basename(file);
|
||||
const parent = this.fsw._getWatchedDir(dirname);
|
||||
// stats is always present
|
||||
let prevStats = stats;
|
||||
|
||||
// if the file is already being watched, do nothing
|
||||
if (parent.has(basename)) return;
|
||||
|
||||
const listener = async (path, newStats) => {
|
||||
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return;
|
||||
if (!newStats || newStats.mtimeMs === 0) {
|
||||
try {
|
||||
const newStats = await stat(file);
|
||||
if (this.fsw.closed) return;
|
||||
// Check that change event was not fired because of changed only accessTime.
|
||||
const at = newStats.atimeMs;
|
||||
const mt = newStats.mtimeMs;
|
||||
if (!at || at <= mt || mt !== prevStats.mtimeMs) {
|
||||
this.fsw._emit(EV_CHANGE, file, newStats);
|
||||
}
|
||||
if (isLinux && prevStats.ino !== newStats.ino) {
|
||||
this.fsw._closeFile(path)
|
||||
prevStats = newStats;
|
||||
this.fsw._addPathCloser(path, this._watchWithNodeFs(file, listener));
|
||||
} else {
|
||||
prevStats = newStats;
|
||||
}
|
||||
} catch (error) {
|
||||
// Fix issues where mtime is null but file is still present
|
||||
this.fsw._remove(dirname, basename);
|
||||
}
|
||||
// add is about to be emitted if file not already tracked in parent
|
||||
} else if (parent.has(basename)) {
|
||||
// Check that change event was not fired because of changed only accessTime.
|
||||
const at = newStats.atimeMs;
|
||||
const mt = newStats.mtimeMs;
|
||||
if (!at || at <= mt || mt !== prevStats.mtimeMs) {
|
||||
this.fsw._emit(EV_CHANGE, file, newStats);
|
||||
}
|
||||
prevStats = newStats;
|
||||
}
|
||||
}
|
||||
// kick off the watcher
|
||||
const closer = this._watchWithNodeFs(file, listener);
|
||||
|
||||
// emit an add event if we're supposed to
|
||||
if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) {
|
||||
if (!this.fsw._throttle(EV_ADD, file, 0)) return;
|
||||
this.fsw._emit(EV_ADD, file, stats);
|
||||
}
|
||||
|
||||
return closer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle symlinks encountered while reading a dir.
|
||||
* @param {Object} entry returned by readdirp
|
||||
* @param {String} directory path of dir being read
|
||||
* @param {String} path of this item
|
||||
* @param {String} item basename of this item
|
||||
* @returns {Promise<Boolean>} true if no more processing is needed for this entry.
|
||||
*/
|
||||
async _handleSymlink(entry, directory, path, item) {
|
||||
if (this.fsw.closed) {
|
||||
return;
|
||||
}
|
||||
const full = entry.fullPath;
|
||||
const dir = this.fsw._getWatchedDir(directory);
|
||||
|
||||
if (!this.fsw.options.followSymlinks) {
|
||||
// watch symlink directly (don't follow) and detect changes
|
||||
this.fsw._incrReadyCount();
|
||||
|
||||
let linkPath;
|
||||
try {
|
||||
linkPath = await fsrealpath(path);
|
||||
} catch (e) {
|
||||
this.fsw._emitReady();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.fsw.closed) return;
|
||||
if (dir.has(item)) {
|
||||
if (this.fsw._symlinkPaths.get(full) !== linkPath) {
|
||||
this.fsw._symlinkPaths.set(full, linkPath);
|
||||
this.fsw._emit(EV_CHANGE, path, entry.stats);
|
||||
}
|
||||
} else {
|
||||
dir.add(item);
|
||||
this.fsw._symlinkPaths.set(full, linkPath);
|
||||
this.fsw._emit(EV_ADD, path, entry.stats);
|
||||
}
|
||||
this.fsw._emitReady();
|
||||
return true;
|
||||
}
|
||||
|
||||
// don't follow the same symlink more than once
|
||||
if (this.fsw._symlinkPaths.has(full)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
this.fsw._symlinkPaths.set(full, true);
|
||||
}
|
||||
|
||||
_handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
||||
// Normalize the directory name on Windows
|
||||
directory = sysPath.join(directory, EMPTY_STR);
|
||||
|
||||
if (!wh.hasGlob) {
|
||||
throttler = this.fsw._throttle('readdir', directory, 1000);
|
||||
if (!throttler) return;
|
||||
}
|
||||
|
||||
const previous = this.fsw._getWatchedDir(wh.path);
|
||||
const current = new Set();
|
||||
|
||||
let stream = this.fsw._readdirp(directory, {
|
||||
fileFilter: entry => wh.filterPath(entry),
|
||||
directoryFilter: entry => wh.filterDir(entry),
|
||||
depth: 0
|
||||
}).on(STR_DATA, async (entry) => {
|
||||
if (this.fsw.closed) {
|
||||
stream = undefined;
|
||||
return;
|
||||
}
|
||||
const item = entry.path;
|
||||
let path = sysPath.join(directory, item);
|
||||
current.add(item);
|
||||
|
||||
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.fsw.closed) {
|
||||
stream = undefined;
|
||||
return;
|
||||
}
|
||||
// Files that present in current directory snapshot
|
||||
// but absent in previous are added to watch list and
|
||||
// emit `add` event.
|
||||
if (item === target || !target && !previous.has(item)) {
|
||||
this.fsw._incrReadyCount();
|
||||
|
||||
// ensure relativeness of path is preserved in case of watcher reuse
|
||||
path = sysPath.join(dir, sysPath.relative(dir, path));
|
||||
|
||||
this._addToNodeFs(path, initialAdd, wh, depth + 1);
|
||||
}
|
||||
}).on(EV_ERROR, this._boundHandleError);
|
||||
|
||||
return new Promise(resolve =>
|
||||
stream.once(STR_END, () => {
|
||||
if (this.fsw.closed) {
|
||||
stream = undefined;
|
||||
return;
|
||||
}
|
||||
const wasThrottled = throttler ? throttler.clear() : false;
|
||||
|
||||
resolve();
|
||||
|
||||
// Files that absent in current directory snapshot
|
||||
// but present in previous emit `remove` event
|
||||
// and are removed from @watched[directory].
|
||||
previous.getChildren().filter((item) => {
|
||||
return item !== directory &&
|
||||
!current.has(item) &&
|
||||
// in case of intersecting globs;
|
||||
// a path may have been filtered out of this readdir, but
|
||||
// shouldn't be removed because it matches a different glob
|
||||
(!wh.hasGlob || wh.filterPath({
|
||||
fullPath: sysPath.resolve(directory, item)
|
||||
}));
|
||||
}).forEach((item) => {
|
||||
this.fsw._remove(directory, item);
|
||||
});
|
||||
|
||||
stream = undefined;
|
||||
|
||||
// one more time for any missed in case changes came in extremely quickly
|
||||
if (wasThrottled) this._handleRead(directory, false, wh, target, dir, depth, throttler);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read directory to add / remove files from `@watched` list and re-read it on change.
|
||||
* @param {String} dir fs path
|
||||
* @param {fs.Stats} stats
|
||||
* @param {Boolean} initialAdd
|
||||
* @param {Number} depth relative to user-supplied path
|
||||
* @param {String} target child path targeted for watch
|
||||
* @param {Object} wh Common watch helpers for this path
|
||||
* @param {String} realpath
|
||||
* @returns {Promise<Function>} closer for the watcher instance.
|
||||
*/
|
||||
async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {
|
||||
const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir));
|
||||
const tracked = parentDir.has(sysPath.basename(dir));
|
||||
if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
|
||||
if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR, dir, stats);
|
||||
}
|
||||
|
||||
// ensure dir is tracked (harmless if redundant)
|
||||
parentDir.add(sysPath.basename(dir));
|
||||
this.fsw._getWatchedDir(dir);
|
||||
let throttler;
|
||||
let closer;
|
||||
|
||||
const oDepth = this.fsw.options.depth;
|
||||
if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) {
|
||||
if (!target) {
|
||||
await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler);
|
||||
if (this.fsw.closed) return;
|
||||
}
|
||||
|
||||
closer = this._watchWithNodeFs(dir, (dirPath, stats) => {
|
||||
// if current directory is removed, do nothing
|
||||
if (stats && stats.mtimeMs === 0) return;
|
||||
|
||||
this._handleRead(dirPath, false, wh, target, dir, depth, throttler);
|
||||
});
|
||||
}
|
||||
return closer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle added file, directory, or glob pattern.
|
||||
* Delegates call to _handleFile / _handleDir after checks.
|
||||
* @param {String} path to file or ir
|
||||
* @param {Boolean} initialAdd was the file added at watch instantiation?
|
||||
* @param {Object} priorWh depth relative to user-supplied path
|
||||
* @param {Number} depth Child path actually targeted for watch
|
||||
* @param {String=} target Child path actually targeted for watch
|
||||
* @returns {Promise}
|
||||
*/
|
||||
async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
|
||||
const ready = this.fsw._emitReady;
|
||||
if (this.fsw._isIgnored(path) || this.fsw.closed) {
|
||||
ready();
|
||||
return false;
|
||||
}
|
||||
|
||||
const wh = this.fsw._getWatchHelpers(path, depth);
|
||||
if (!wh.hasGlob && priorWh) {
|
||||
wh.hasGlob = priorWh.hasGlob;
|
||||
wh.globFilter = priorWh.globFilter;
|
||||
wh.filterPath = entry => priorWh.filterPath(entry);
|
||||
wh.filterDir = entry => priorWh.filterDir(entry);
|
||||
}
|
||||
|
||||
// evaluate what is at the path we're being asked to watch
|
||||
try {
|
||||
const stats = await statMethods[wh.statMethod](wh.watchPath);
|
||||
if (this.fsw.closed) return;
|
||||
if (this.fsw._isIgnored(wh.watchPath, stats)) {
|
||||
ready();
|
||||
return false;
|
||||
}
|
||||
|
||||
const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START);
|
||||
let closer;
|
||||
if (stats.isDirectory()) {
|
||||
const absPath = sysPath.resolve(path);
|
||||
const targetPath = follow ? await fsrealpath(path) : path;
|
||||
if (this.fsw.closed) return;
|
||||
closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
|
||||
if (this.fsw.closed) return;
|
||||
// preserve this symlink's target path
|
||||
if (absPath !== targetPath && targetPath !== undefined) {
|
||||
this.fsw._symlinkPaths.set(absPath, targetPath);
|
||||
}
|
||||
} else if (stats.isSymbolicLink()) {
|
||||
const targetPath = follow ? await fsrealpath(path) : path;
|
||||
if (this.fsw.closed) return;
|
||||
const parent = sysPath.dirname(wh.watchPath);
|
||||
this.fsw._getWatchedDir(parent).add(wh.watchPath);
|
||||
this.fsw._emit(EV_ADD, wh.watchPath, stats);
|
||||
closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath);
|
||||
if (this.fsw.closed) return;
|
||||
|
||||
// preserve this symlink's target path
|
||||
if (targetPath !== undefined) {
|
||||
this.fsw._symlinkPaths.set(sysPath.resolve(path), targetPath);
|
||||
}
|
||||
} else {
|
||||
closer = this._handleFile(wh.watchPath, stats, initialAdd);
|
||||
}
|
||||
ready();
|
||||
|
||||
this.fsw._addPathCloser(path, closer);
|
||||
return false;
|
||||
|
||||
} catch (error) {
|
||||
if (this.fsw._handleError(error)) {
|
||||
ready();
|
||||
return path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = NodeFsHandler;
|
||||
88
node_modules/.store/sass@1.69.5/node_modules/chokidar/package.json
generated
vendored
Normal file
88
node_modules/.store/sass@1.69.5/node_modules/chokidar/package.json
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"name": "chokidar",
|
||||
"description": "Minimal and efficient cross-platform file watching library",
|
||||
"version": "3.5.3",
|
||||
"homepage": "https://github.com/paulmillr/chokidar",
|
||||
"author": "Paul Miller (https://paulmillr.com)",
|
||||
"contributors": [
|
||||
"Paul Miller (https://paulmillr.com)",
|
||||
"Elan Shanker"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 8.10.0"
|
||||
},
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"anymatch": "~3.1.2",
|
||||
"braces": "~3.0.2",
|
||||
"glob-parent": "~5.1.2",
|
||||
"is-binary-path": "~2.1.0",
|
||||
"is-glob": "~4.0.1",
|
||||
"normalize-path": "~3.0.0",
|
||||
"readdirp": "~3.6.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14",
|
||||
"chai": "^4.3",
|
||||
"dtslint": "^3.3.0",
|
||||
"eslint": "^7.0.0",
|
||||
"mocha": "^7.0.0",
|
||||
"nyc": "^15.0.0",
|
||||
"rimraf": "^3.0.0",
|
||||
"sinon": "^9.0.1",
|
||||
"sinon-chai": "^3.3.0",
|
||||
"typescript": "~4.4.3",
|
||||
"upath": "^1.2.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib/*.js",
|
||||
"types/index.d.ts"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/paulmillr/chokidar.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/paulmillr/chokidar/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dtslint": "dtslint types",
|
||||
"lint": "eslint --report-unused-disable-directives --ignore-path .gitignore .",
|
||||
"mocha": "mocha --exit --timeout 90000",
|
||||
"test": "npm run lint && npm run mocha"
|
||||
},
|
||||
"keywords": [
|
||||
"fs",
|
||||
"watch",
|
||||
"watchFile",
|
||||
"watcher",
|
||||
"watching",
|
||||
"file",
|
||||
"fsevents"
|
||||
],
|
||||
"types": "./types/index.d.ts",
|
||||
"nyc": {
|
||||
"include": [
|
||||
"index.js",
|
||||
"lib/*.js"
|
||||
],
|
||||
"reporter": [
|
||||
"html",
|
||||
"text"
|
||||
]
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://paulmillr.com/funding/"
|
||||
}
|
||||
],
|
||||
"__npminstall_done": true,
|
||||
"_from": "chokidar@3.5.3",
|
||||
"_resolved": "https://registry.npmmirror.com/chokidar/-/chokidar-3.5.3.tgz"
|
||||
}
|
||||
188
node_modules/.store/sass@1.69.5/node_modules/chokidar/types/index.d.ts
generated
vendored
Normal file
188
node_modules/.store/sass@1.69.5/node_modules/chokidar/types/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,188 @@
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as fs from "fs";
|
||||
import { EventEmitter } from "events";
|
||||
import { Matcher } from 'anymatch';
|
||||
|
||||
export class FSWatcher extends EventEmitter implements fs.FSWatcher {
|
||||
options: WatchOptions;
|
||||
|
||||
/**
|
||||
* Constructs a new FSWatcher instance with optional WatchOptions parameter.
|
||||
*/
|
||||
constructor(options?: WatchOptions);
|
||||
|
||||
/**
|
||||
* Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
|
||||
* string.
|
||||
*/
|
||||
add(paths: string | ReadonlyArray<string>): this;
|
||||
|
||||
/**
|
||||
* Stop watching files, directories, or glob patterns. Takes an array of strings or just one
|
||||
* string.
|
||||
*/
|
||||
unwatch(paths: string | ReadonlyArray<string>): this;
|
||||
|
||||
/**
|
||||
* Returns an object representing all the paths on the file system being watched by this
|
||||
* `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless
|
||||
* the `cwd` option was used), and the values are arrays of the names of the items contained in
|
||||
* each directory.
|
||||
*/
|
||||
getWatched(): {
|
||||
[directory: string]: string[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes all listeners from watched files.
|
||||
*/
|
||||
close(): Promise<void>;
|
||||
|
||||
on(event: 'add'|'addDir'|'change', listener: (path: string, stats?: fs.Stats) => void): this;
|
||||
|
||||
on(event: 'all', listener: (eventName: 'add'|'addDir'|'change'|'unlink'|'unlinkDir', path: string, stats?: fs.Stats) => void): this;
|
||||
|
||||
/**
|
||||
* Error occurred
|
||||
*/
|
||||
on(event: 'error', listener: (error: Error) => void): this;
|
||||
|
||||
/**
|
||||
* Exposes the native Node `fs.FSWatcher events`
|
||||
*/
|
||||
on(event: 'raw', listener: (eventName: string, path: string, details: any) => void): this;
|
||||
|
||||
/**
|
||||
* Fires when the initial scan is complete
|
||||
*/
|
||||
on(event: 'ready', listener: () => void): this;
|
||||
|
||||
on(event: 'unlink'|'unlinkDir', listener: (path: string) => void): this;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
}
|
||||
|
||||
export interface WatchOptions {
|
||||
/**
|
||||
* Indicates whether the process should continue to run as long as files are being watched. If
|
||||
* set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`,
|
||||
* even if the process continues to run.
|
||||
*/
|
||||
persistent?: boolean;
|
||||
|
||||
/**
|
||||
* ([anymatch](https://github.com/micromatch/anymatch)-compatible definition) Defines files/paths to
|
||||
* be ignored. The whole relative or absolute path is tested, not just filename. If a function
|
||||
* with two arguments is provided, it gets called twice per path - once with a single argument
|
||||
* (the path), second time with two arguments (the path and the
|
||||
* [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path).
|
||||
*/
|
||||
ignored?: Matcher;
|
||||
|
||||
/**
|
||||
* If set to `false` then `add`/`addDir` events are also emitted for matching paths while
|
||||
* instantiating the watching as chokidar discovers these file paths (before the `ready` event).
|
||||
*/
|
||||
ignoreInitial?: boolean;
|
||||
|
||||
/**
|
||||
* When `false`, only the symlinks themselves will be watched for changes instead of following
|
||||
* the link references and bubbling events through the link's path.
|
||||
*/
|
||||
followSymlinks?: boolean;
|
||||
|
||||
/**
|
||||
* The base directory from which watch `paths` are to be derived. Paths emitted with events will
|
||||
* be relative to this.
|
||||
*/
|
||||
cwd?: string;
|
||||
|
||||
/**
|
||||
* If set to true then the strings passed to .watch() and .add() are treated as literal path
|
||||
* names, even if they look like globs. Default: false.
|
||||
*/
|
||||
disableGlobbing?: boolean;
|
||||
|
||||
/**
|
||||
* Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU
|
||||
* utilization, consider setting this to `false`. It is typically necessary to **set this to
|
||||
* `true` to successfully watch files over a network**, and it may be necessary to successfully
|
||||
* watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides
|
||||
* the `useFsEvents` default.
|
||||
*/
|
||||
usePolling?: boolean;
|
||||
|
||||
/**
|
||||
* Whether to use the `fsevents` watching interface if available. When set to `true` explicitly
|
||||
* and `fsevents` is available this supercedes the `usePolling` setting. When set to `false` on
|
||||
* OS X, `usePolling: true` becomes the default.
|
||||
*/
|
||||
useFsEvents?: boolean;
|
||||
|
||||
/**
|
||||
* If relying upon the [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object that
|
||||
* may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is
|
||||
* provided even in cases where it wasn't already available from the underlying watch events.
|
||||
*/
|
||||
alwaysStat?: boolean;
|
||||
|
||||
/**
|
||||
* If set, limits how many levels of subdirectories will be traversed.
|
||||
*/
|
||||
depth?: number;
|
||||
|
||||
/**
|
||||
* Interval of file system polling.
|
||||
*/
|
||||
interval?: number;
|
||||
|
||||
/**
|
||||
* Interval of file system polling for binary files. ([see list of binary extensions](https://gi
|
||||
* thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json))
|
||||
*/
|
||||
binaryInterval?: number;
|
||||
|
||||
/**
|
||||
* Indicates whether to watch files that don't have read permissions if possible. If watching
|
||||
* fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed
|
||||
* silently.
|
||||
*/
|
||||
ignorePermissionErrors?: boolean;
|
||||
|
||||
/**
|
||||
* `true` if `useFsEvents` and `usePolling` are `false`). Automatically filters out artifacts
|
||||
* that occur when using editors that use "atomic writes" instead of writing directly to the
|
||||
* source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change`
|
||||
* event rather than `unlink` then `add`. If the default of 100 ms does not work well for you,
|
||||
* you can override it by setting `atomic` to a custom value, in milliseconds.
|
||||
*/
|
||||
atomic?: boolean | number;
|
||||
|
||||
/**
|
||||
* can be set to an object in order to adjust timing params:
|
||||
*/
|
||||
awaitWriteFinish?: AwaitWriteFinishOptions | boolean;
|
||||
}
|
||||
|
||||
export interface AwaitWriteFinishOptions {
|
||||
/**
|
||||
* Amount of time in milliseconds for a file size to remain constant before emitting its event.
|
||||
*/
|
||||
stabilityThreshold?: number;
|
||||
|
||||
/**
|
||||
* File size polling interval.
|
||||
*/
|
||||
pollInterval?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* produces an instance of `FSWatcher`.
|
||||
*/
|
||||
export function watch(
|
||||
paths: string | ReadonlyArray<string>,
|
||||
options?: WatchOptions
|
||||
): FSWatcher;
|
||||
21
node_modules/.store/sass@1.69.5/node_modules/immutable/LICENSE
generated
vendored
Normal file
21
node_modules/.store/sass@1.69.5/node_modules/immutable/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present, Lee Byron and other contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
761
node_modules/.store/sass@1.69.5/node_modules/immutable/README.md
generated
vendored
Normal file
761
node_modules/.store/sass@1.69.5/node_modules/immutable/README.md
generated
vendored
Normal file
@@ -0,0 +1,761 @@
|
||||
# Immutable collections for JavaScript
|
||||
|
||||
[](https://github.com/immutable-js/immutable-js/actions/workflows/ci.yml?query=branch%3Amain) [Chat on slack](https://immutable-js.slack.com)
|
||||
|
||||
[Read the docs](https://immutable-js.com) and eat your vegetables.
|
||||
|
||||
Docs are automatically generated from [README.md][] and [immutable.d.ts][].
|
||||
Please contribute! Also, don't miss the [wiki][] which contains articles on
|
||||
additional specific topics. Can't find something? Open an [issue][].
|
||||
|
||||
**Table of contents:**
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Getting started](#getting-started)
|
||||
- [The case for Immutability](#the-case-for-immutability)
|
||||
- [JavaScript-first API](#javascript-first-api)
|
||||
- [Nested Structures](#nested-structures)
|
||||
- [Equality treats Collections as Values](#equality-treats-collections-as-values)
|
||||
- [Batching Mutations](#batching-mutations)
|
||||
- [Lazy Seq](#lazy-seq)
|
||||
- [Additional Tools and Resources](#additional-tools-and-resources)
|
||||
- [Contributing](#contributing)
|
||||
|
||||
## Introduction
|
||||
|
||||
[Immutable][] data cannot be changed once created, leading to much simpler
|
||||
application development, no defensive copying, and enabling advanced memoization
|
||||
and change detection techniques with simple logic. [Persistent][] data presents
|
||||
a mutative API which does not update the data in-place, but instead always
|
||||
yields new updated data.
|
||||
|
||||
Immutable.js provides many Persistent Immutable data structures including:
|
||||
`List`, `Stack`, `Map`, `OrderedMap`, `Set`, `OrderedSet` and `Record`.
|
||||
|
||||
These data structures are highly efficient on modern JavaScript VMs by using
|
||||
structural sharing via [hash maps tries][] and [vector tries][] as popularized
|
||||
by Clojure and Scala, minimizing the need to copy or cache data.
|
||||
|
||||
Immutable.js also provides a lazy `Seq`, allowing efficient
|
||||
chaining of collection methods like `map` and `filter` without creating
|
||||
intermediate representations. Create some `Seq` with `Range` and `Repeat`.
|
||||
|
||||
Want to hear more? Watch the presentation about Immutable.js:
|
||||
|
||||
[](https://youtu.be/I7IdS-PbEgI)
|
||||
|
||||
[README.md]: https://github.com/immutable-js/immutable-js/blob/main/README.md
|
||||
[immutable.d.ts]: https://github.com/immutable-js/immutable-js/blob/main/type-definitions/immutable.d.ts
|
||||
[wiki]: https://github.com/immutable-js/immutable-js/wiki
|
||||
[issue]: https://github.com/immutable-js/immutable-js/issues
|
||||
[Persistent]: https://en.wikipedia.org/wiki/Persistent_data_structure
|
||||
[Immutable]: https://en.wikipedia.org/wiki/Immutable_object
|
||||
[hash maps tries]: https://en.wikipedia.org/wiki/Hash_array_mapped_trie
|
||||
[vector tries]: https://hypirion.com/musings/understanding-persistent-vector-pt-1
|
||||
|
||||
## Getting started
|
||||
|
||||
Install `immutable` using npm.
|
||||
|
||||
```shell
|
||||
# using npm
|
||||
npm install immutable
|
||||
|
||||
# using Yarn
|
||||
yarn add immutable
|
||||
|
||||
# using pnpm
|
||||
pnpm add immutable
|
||||
|
||||
# using Bun
|
||||
bun add immutable
|
||||
```
|
||||
|
||||
Then require it into any module.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { Map } = require('immutable');
|
||||
const map1 = Map({ a: 1, b: 2, c: 3 });
|
||||
const map2 = map1.set('b', 50);
|
||||
map1.get('b') + ' vs. ' + map2.get('b'); // 2 vs. 50
|
||||
```
|
||||
|
||||
### Browser
|
||||
|
||||
Immutable.js has no dependencies, which makes it predictable to include in a Browser.
|
||||
|
||||
It's highly recommended to use a module bundler like [webpack](https://webpack.github.io/),
|
||||
[rollup](https://rollupjs.org/), or
|
||||
[browserify](https://browserify.org/). The `immutable` npm module works
|
||||
without any additional consideration. All examples throughout the documentation
|
||||
will assume use of this kind of tool.
|
||||
|
||||
Alternatively, Immutable.js may be directly included as a script tag. Download
|
||||
or link to a CDN such as [CDNJS](https://cdnjs.com/libraries/immutable)
|
||||
or [jsDelivr](https://www.jsdelivr.com/package/npm/immutable).
|
||||
|
||||
Use a script tag to directly add `Immutable` to the global scope:
|
||||
|
||||
```html
|
||||
<script src="immutable.min.js"></script>
|
||||
<script>
|
||||
var map1 = Immutable.Map({ a: 1, b: 2, c: 3 });
|
||||
var map2 = map1.set('b', 50);
|
||||
map1.get('b'); // 2
|
||||
map2.get('b'); // 50
|
||||
</script>
|
||||
```
|
||||
|
||||
Or use an AMD-style loader (such as [RequireJS](https://requirejs.org/)):
|
||||
|
||||
```js
|
||||
require(['./immutable.min.js'], function (Immutable) {
|
||||
var map1 = Immutable.Map({ a: 1, b: 2, c: 3 });
|
||||
var map2 = map1.set('b', 50);
|
||||
map1.get('b'); // 2
|
||||
map2.get('b'); // 50
|
||||
});
|
||||
```
|
||||
|
||||
### Flow & TypeScript
|
||||
|
||||
Use these Immutable collections and sequences as you would use native
|
||||
collections in your [Flowtype](https://flowtype.org/) or [TypeScript](https://typescriptlang.org) programs while still taking
|
||||
advantage of type generics, error detection, and auto-complete in your IDE.
|
||||
|
||||
Installing `immutable` via npm brings with it type definitions for Flow (v0.55.0 or higher)
|
||||
and TypeScript (v2.1.0 or higher), so you shouldn't need to do anything at all!
|
||||
|
||||
#### Using TypeScript with Immutable.js v4
|
||||
|
||||
Immutable.js type definitions embrace ES2015. While Immutable.js itself supports
|
||||
legacy browsers and environments, its type definitions require TypeScript's 2015
|
||||
lib. Include either `"target": "es2015"` or `"lib": "es2015"` in your
|
||||
`tsconfig.json`, or provide `--target es2015` or `--lib es2015` to the
|
||||
`tsc` command.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { Map } = require('immutable');
|
||||
const map1 = Map({ a: 1, b: 2, c: 3 });
|
||||
const map2 = map1.set('b', 50);
|
||||
map1.get('b') + ' vs. ' + map2.get('b'); // 2 vs. 50
|
||||
```
|
||||
|
||||
#### Using TypeScript with Immutable.js v3 and earlier:
|
||||
|
||||
Previous versions of Immutable.js include a reference file which you can include
|
||||
via relative path to the type definitions at the top of your file.
|
||||
|
||||
```js
|
||||
///<reference path='./node_modules/immutable/dist/immutable.d.ts'/>
|
||||
import Immutable from 'immutable';
|
||||
var map1: Immutable.Map<string, number>;
|
||||
map1 = Immutable.Map({ a: 1, b: 2, c: 3 });
|
||||
var map2 = map1.set('b', 50);
|
||||
map1.get('b'); // 2
|
||||
map2.get('b'); // 50
|
||||
```
|
||||
|
||||
## The case for Immutability
|
||||
|
||||
Much of what makes application development difficult is tracking mutation and
|
||||
maintaining state. Developing with immutable data encourages you to think
|
||||
differently about how data flows through your application.
|
||||
|
||||
Subscribing to data events throughout your application creates a huge overhead of
|
||||
book-keeping which can hurt performance, sometimes dramatically, and creates
|
||||
opportunities for areas of your application to get out of sync with each other
|
||||
due to easy to make programmer error. Since immutable data never changes,
|
||||
subscribing to changes throughout the model is a dead-end and new data can only
|
||||
ever be passed from above.
|
||||
|
||||
This model of data flow aligns well with the architecture of [React][]
|
||||
and especially well with an application designed using the ideas of [Flux][].
|
||||
|
||||
When data is passed from above rather than being subscribed to, and you're only
|
||||
interested in doing work when something has changed, you can use equality.
|
||||
|
||||
Immutable collections should be treated as _values_ rather than _objects_. While
|
||||
objects represent some thing which could change over time, a value represents
|
||||
the state of that thing at a particular instance of time. This principle is most
|
||||
important to understanding the appropriate use of immutable data. In order to
|
||||
treat Immutable.js collections as values, it's important to use the
|
||||
`Immutable.is()` function or `.equals()` method to determine _value equality_
|
||||
instead of the `===` operator which determines object _reference identity_.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { Map } = require('immutable');
|
||||
const map1 = Map({ a: 1, b: 2, c: 3 });
|
||||
const map2 = Map({ a: 1, b: 2, c: 3 });
|
||||
map1.equals(map2); // true
|
||||
map1 === map2; // false
|
||||
```
|
||||
|
||||
Note: As a performance optimization Immutable.js attempts to return the existing
|
||||
collection when an operation would result in an identical collection, allowing
|
||||
for using `===` reference equality to determine if something definitely has not
|
||||
changed. This can be extremely useful when used within a memoization function
|
||||
which would prefer to re-run the function if a deeper equality check could
|
||||
potentially be more costly. The `===` equality check is also used internally by
|
||||
`Immutable.is` and `.equals()` as a performance optimization.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { Map } = require('immutable');
|
||||
const map1 = Map({ a: 1, b: 2, c: 3 });
|
||||
const map2 = map1.set('b', 2); // Set to same value
|
||||
map1 === map2; // true
|
||||
```
|
||||
|
||||
If an object is immutable, it can be "copied" simply by making another reference
|
||||
to it instead of copying the entire object. Because a reference is much smaller
|
||||
than the object itself, this results in memory savings and a potential boost in
|
||||
execution speed for programs which rely on copies (such as an undo-stack).
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { Map } = require('immutable');
|
||||
const map = Map({ a: 1, b: 2, c: 3 });
|
||||
const mapCopy = map; // Look, "copies" are free!
|
||||
```
|
||||
|
||||
[React]: https://reactjs.org/
|
||||
[Flux]: https://facebook.github.io/flux/docs/in-depth-overview/
|
||||
|
||||
|
||||
## JavaScript-first API
|
||||
|
||||
While Immutable.js is inspired by Clojure, Scala, Haskell and other functional
|
||||
programming environments, it's designed to bring these powerful concepts to
|
||||
JavaScript, and therefore has an Object-Oriented API that closely mirrors that
|
||||
of [ES2015][] [Array][], [Map][], and [Set][].
|
||||
|
||||
[es2015]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla
|
||||
[array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
|
||||
[map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
|
||||
[set]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
|
||||
|
||||
The difference for the immutable collections is that methods which would mutate
|
||||
the collection, like `push`, `set`, `unshift` or `splice`, instead return a new
|
||||
immutable collection. Methods which return new arrays, like `slice` or `concat`,
|
||||
instead return new immutable collections.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { List } = require('immutable');
|
||||
const list1 = List([1, 2]);
|
||||
const list2 = list1.push(3, 4, 5);
|
||||
const list3 = list2.unshift(0);
|
||||
const list4 = list1.concat(list2, list3);
|
||||
assert.equal(list1.size, 2);
|
||||
assert.equal(list2.size, 5);
|
||||
assert.equal(list3.size, 6);
|
||||
assert.equal(list4.size, 13);
|
||||
assert.equal(list4.get(0), 1);
|
||||
```
|
||||
|
||||
Almost all of the methods on [Array][] will be found in similar form on
|
||||
`Immutable.List`, those of [Map][] found on `Immutable.Map`, and those of [Set][]
|
||||
found on `Immutable.Set`, including collection operations like `forEach()`
|
||||
and `map()`.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { Map } = require('immutable');
|
||||
const alpha = Map({ a: 1, b: 2, c: 3, d: 4 });
|
||||
alpha.map((v, k) => k.toUpperCase()).join();
|
||||
// 'A,B,C,D'
|
||||
```
|
||||
|
||||
### Convert from raw JavaScript objects and arrays.
|
||||
|
||||
Designed to inter-operate with your existing JavaScript, Immutable.js
|
||||
accepts plain JavaScript Arrays and Objects anywhere a method expects a
|
||||
`Collection`.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { Map, List } = require('immutable');
|
||||
const map1 = Map({ a: 1, b: 2, c: 3, d: 4 });
|
||||
const map2 = Map({ c: 10, a: 20, t: 30 });
|
||||
const obj = { d: 100, o: 200, g: 300 };
|
||||
const map3 = map1.merge(map2, obj);
|
||||
// Map { a: 20, b: 2, c: 10, d: 100, t: 30, o: 200, g: 300 }
|
||||
const list1 = List([1, 2, 3]);
|
||||
const list2 = List([4, 5, 6]);
|
||||
const array = [7, 8, 9];
|
||||
const list3 = list1.concat(list2, array);
|
||||
// List [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
|
||||
```
|
||||
|
||||
This is possible because Immutable.js can treat any JavaScript Array or Object
|
||||
as a Collection. You can take advantage of this in order to get sophisticated
|
||||
collection methods on JavaScript Objects, which otherwise have a very sparse
|
||||
native API. Because Seq evaluates lazily and does not cache intermediate
|
||||
results, these operations can be extremely efficient.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { Seq } = require('immutable');
|
||||
const myObject = { a: 1, b: 2, c: 3 };
|
||||
Seq(myObject)
|
||||
.map(x => x * x)
|
||||
.toObject();
|
||||
// { a: 1, b: 4, c: 9 }
|
||||
```
|
||||
|
||||
Keep in mind, when using JS objects to construct Immutable Maps, that
|
||||
JavaScript Object properties are always strings, even if written in a quote-less
|
||||
shorthand, while Immutable Maps accept keys of any type.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { fromJS } = require('immutable');
|
||||
|
||||
const obj = { 1: 'one' };
|
||||
console.log(Object.keys(obj)); // [ "1" ]
|
||||
console.log(obj['1'], obj[1]); // "one", "one"
|
||||
|
||||
const map = fromJS(obj);
|
||||
console.log(map.get('1'), map.get(1)); // "one", undefined
|
||||
```
|
||||
|
||||
Property access for JavaScript Objects first converts the key to a string, but
|
||||
since Immutable Map keys can be of any type the argument to `get()` is
|
||||
not altered.
|
||||
|
||||
### Converts back to raw JavaScript objects.
|
||||
|
||||
All Immutable.js Collections can be converted to plain JavaScript Arrays and
|
||||
Objects shallowly with `toArray()` and `toObject()` or deeply with `toJS()`.
|
||||
All Immutable Collections also implement `toJSON()` allowing them to be passed
|
||||
to `JSON.stringify` directly. They also respect the custom `toJSON()` methods of
|
||||
nested objects.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { Map, List } = require('immutable');
|
||||
const deep = Map({ a: 1, b: 2, c: List([3, 4, 5]) });
|
||||
console.log(deep.toObject()); // { a: 1, b: 2, c: List [ 3, 4, 5 ] }
|
||||
console.log(deep.toArray()); // [ 1, 2, List [ 3, 4, 5 ] ]
|
||||
console.log(deep.toJS()); // { a: 1, b: 2, c: [ 3, 4, 5 ] }
|
||||
JSON.stringify(deep); // '{"a":1,"b":2,"c":[3,4,5]}'
|
||||
```
|
||||
|
||||
### Embraces ES2015
|
||||
|
||||
Immutable.js supports all JavaScript environments, including legacy
|
||||
browsers (even IE11). However it also takes advantage of features added to
|
||||
JavaScript in [ES2015][], the latest standard version of JavaScript, including
|
||||
[Iterators][], [Arrow Functions][], [Classes][], and [Modules][]. It's inspired
|
||||
by the native [Map][] and [Set][] collections added to ES2015.
|
||||
|
||||
All examples in the Documentation are presented in ES2015. To run in all
|
||||
browsers, they need to be translated to ES5.
|
||||
|
||||
```js
|
||||
// ES2015
|
||||
const mapped = foo.map(x => x * x);
|
||||
// ES5
|
||||
var mapped = foo.map(function (x) {
|
||||
return x * x;
|
||||
});
|
||||
```
|
||||
|
||||
All Immutable.js collections are [Iterable][iterators], which allows them to be
|
||||
used anywhere an Iterable is expected, such as when spreading into an Array.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { List } = require('immutable');
|
||||
const aList = List([1, 2, 3]);
|
||||
const anArray = [0, ...aList, 4, 5]; // [ 0, 1, 2, 3, 4, 5 ]
|
||||
```
|
||||
|
||||
Note: A Collection is always iterated in the same order, however that order may
|
||||
not always be well defined, as is the case for the `Map` and `Set`.
|
||||
|
||||
[Iterators]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/The_Iterator_protocol
|
||||
[Arrow Functions]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
|
||||
[Classes]: https://wiki.ecmascript.org/doku.php?id=strawman:maximally_minimal_classes
|
||||
[Modules]: https://www.2ality.com/2014/09/es6-modules-final.html
|
||||
|
||||
|
||||
## Nested Structures
|
||||
|
||||
The collections in Immutable.js are intended to be nested, allowing for deep
|
||||
trees of data, similar to JSON.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { fromJS } = require('immutable');
|
||||
const nested = fromJS({ a: { b: { c: [3, 4, 5] } } });
|
||||
// Map { a: Map { b: Map { c: List [ 3, 4, 5 ] } } }
|
||||
```
|
||||
|
||||
A few power-tools allow for reading and operating on nested data. The
|
||||
most useful are `mergeDeep`, `getIn`, `setIn`, and `updateIn`, found on `List`,
|
||||
`Map` and `OrderedMap`.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { fromJS } = require('immutable');
|
||||
const nested = fromJS({ a: { b: { c: [3, 4, 5] } } });
|
||||
|
||||
const nested2 = nested.mergeDeep({ a: { b: { d: 6 } } });
|
||||
// Map { a: Map { b: Map { c: List [ 3, 4, 5 ], d: 6 } } }
|
||||
|
||||
console.log(nested2.getIn(['a', 'b', 'd'])); // 6
|
||||
|
||||
const nested3 = nested2.updateIn(['a', 'b', 'd'], value => value + 1);
|
||||
console.log(nested3);
|
||||
// Map { a: Map { b: Map { c: List [ 3, 4, 5 ], d: 7 } } }
|
||||
|
||||
const nested4 = nested3.updateIn(['a', 'b', 'c'], list => list.push(6));
|
||||
// Map { a: Map { b: Map { c: List [ 3, 4, 5, 6 ], d: 7 } } }
|
||||
```
|
||||
|
||||
## Equality treats Collections as Values
|
||||
|
||||
Immutable.js collections are treated as pure data _values_. Two immutable
|
||||
collections are considered _value equal_ (via `.equals()` or `is()`) if they
|
||||
represent the same collection of values. This differs from JavaScript's typical
|
||||
_reference equal_ (via `===` or `==`) for Objects and Arrays which only
|
||||
determines if two variables represent references to the same object instance.
|
||||
|
||||
Consider the example below where two identical `Map` instances are not
|
||||
_reference equal_ but are _value equal_.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
// First consider:
|
||||
const obj1 = { a: 1, b: 2, c: 3 };
|
||||
const obj2 = { a: 1, b: 2, c: 3 };
|
||||
obj1 !== obj2; // two different instances are always not equal with ===
|
||||
|
||||
const { Map, is } = require('immutable');
|
||||
const map1 = Map({ a: 1, b: 2, c: 3 });
|
||||
const map2 = Map({ a: 1, b: 2, c: 3 });
|
||||
map1 !== map2; // two different instances are not reference-equal
|
||||
map1.equals(map2); // but are value-equal if they have the same values
|
||||
is(map1, map2); // alternatively can use the is() function
|
||||
```
|
||||
|
||||
Value equality allows Immutable.js collections to be used as keys in Maps or
|
||||
values in Sets, and retrieved with different but equivalent collections:
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { Map, Set } = require('immutable');
|
||||
const map1 = Map({ a: 1, b: 2, c: 3 });
|
||||
const map2 = Map({ a: 1, b: 2, c: 3 });
|
||||
const set = Set().add(map1);
|
||||
set.has(map2); // true because these are value-equal
|
||||
```
|
||||
|
||||
Note: `is()` uses the same measure of equality as [Object.is][] for scalar
|
||||
strings and numbers, but uses value equality for Immutable collections,
|
||||
determining if both are immutable and all keys and values are equal
|
||||
using the same measure of equality.
|
||||
|
||||
[object.is]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
||||
|
||||
#### Performance tradeoffs
|
||||
|
||||
While value equality is useful in many circumstances, it has different
|
||||
performance characteristics than reference equality. Understanding these
|
||||
tradeoffs may help you decide which to use in each case, especially when used
|
||||
to memoize some operation.
|
||||
|
||||
When comparing two collections, value equality may require considering every
|
||||
item in each collection, on an `O(N)` time complexity. For large collections of
|
||||
values, this could become a costly operation. Though if the two are not equal
|
||||
and hardly similar, the inequality is determined very quickly. In contrast, when
|
||||
comparing two collections with reference equality, only the initial references
|
||||
to memory need to be compared which is not based on the size of the collections,
|
||||
which has an `O(1)` time complexity. Checking reference equality is always very
|
||||
fast, however just because two collections are not reference-equal does not rule
|
||||
out the possibility that they may be value-equal.
|
||||
|
||||
#### Return self on no-op optimization
|
||||
|
||||
When possible, Immutable.js avoids creating new objects for updates where no
|
||||
change in _value_ occurred, to allow for efficient _reference equality_ checking
|
||||
to quickly determine if no change occurred.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { Map } = require('immutable');
|
||||
const originalMap = Map({ a: 1, b: 2, c: 3 });
|
||||
const updatedMap = originalMap.set('b', 2);
|
||||
updatedMap === originalMap; // No-op .set() returned the original reference.
|
||||
```
|
||||
|
||||
However updates which do result in a change will return a new reference. Each
|
||||
of these operations occur independently, so two similar updates will not return
|
||||
the same reference:
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { Map } = require('immutable');
|
||||
const originalMap = Map({ a: 1, b: 2, c: 3 });
|
||||
const updatedMap = originalMap.set('b', 1000);
|
||||
// New instance, leaving the original immutable.
|
||||
updatedMap !== originalMap;
|
||||
const anotherUpdatedMap = originalMap.set('b', 1000);
|
||||
// Despite both the results of the same operation, each created a new reference.
|
||||
anotherUpdatedMap !== updatedMap;
|
||||
// However the two are value equal.
|
||||
anotherUpdatedMap.equals(updatedMap);
|
||||
```
|
||||
|
||||
## Batching Mutations
|
||||
|
||||
> If a tree falls in the woods, does it make a sound?
|
||||
>
|
||||
> If a pure function mutates some local data in order to produce an immutable
|
||||
> return value, is that ok?
|
||||
>
|
||||
> — Rich Hickey, Clojure
|
||||
|
||||
Applying a mutation to create a new immutable object results in some overhead,
|
||||
which can add up to a minor performance penalty. If you need to apply a series
|
||||
of mutations locally before returning, Immutable.js gives you the ability to
|
||||
create a temporary mutable (transient) copy of a collection and apply a batch of
|
||||
mutations in a performant manner by using `withMutations`. In fact, this is
|
||||
exactly how Immutable.js applies complex mutations itself.
|
||||
|
||||
As an example, building `list2` results in the creation of 1, not 3, new
|
||||
immutable Lists.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { List } = require('immutable');
|
||||
const list1 = List([1, 2, 3]);
|
||||
const list2 = list1.withMutations(function (list) {
|
||||
list.push(4).push(5).push(6);
|
||||
});
|
||||
assert.equal(list1.size, 3);
|
||||
assert.equal(list2.size, 6);
|
||||
```
|
||||
|
||||
Note: Immutable.js also provides `asMutable` and `asImmutable`, but only
|
||||
encourages their use when `withMutations` will not suffice. Use caution to not
|
||||
return a mutable copy, which could result in undesired behavior.
|
||||
|
||||
_Important!_: Only a select few methods can be used in `withMutations` including
|
||||
`set`, `push` and `pop`. These methods can be applied directly against a
|
||||
persistent data-structure where other methods like `map`, `filter`, `sort`,
|
||||
and `splice` will always return new immutable data-structures and never mutate
|
||||
a mutable collection.
|
||||
|
||||
## Lazy Seq
|
||||
|
||||
`Seq` describes a lazy operation, allowing them to efficiently chain
|
||||
use of all the higher-order collection methods (such as `map` and `filter`)
|
||||
by not creating intermediate collections.
|
||||
|
||||
**Seq is immutable** — Once a Seq is created, it cannot be
|
||||
changed, appended to, rearranged or otherwise modified. Instead, any mutative
|
||||
method called on a `Seq` will return a new `Seq`.
|
||||
|
||||
**Seq is lazy** — `Seq` does as little work as necessary to respond to any
|
||||
method call. Values are often created during iteration, including implicit
|
||||
iteration when reducing or converting to a concrete data structure such as
|
||||
a `List` or JavaScript `Array`.
|
||||
|
||||
For example, the following performs no work, because the resulting
|
||||
`Seq`'s values are never iterated:
|
||||
|
||||
```js
|
||||
const { Seq } = require('immutable');
|
||||
const oddSquares = Seq([1, 2, 3, 4, 5, 6, 7, 8])
|
||||
.filter(x => x % 2 !== 0)
|
||||
.map(x => x * x);
|
||||
```
|
||||
|
||||
Once the `Seq` is used, it performs only the work necessary. In this
|
||||
example, no intermediate arrays are ever created, filter is called three
|
||||
times, and map is only called once:
|
||||
|
||||
```js
|
||||
oddSquares.get(1); // 9
|
||||
```
|
||||
|
||||
Any collection can be converted to a lazy Seq with `Seq()`.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { Map, Seq } = require('immutable');
|
||||
const map = Map({ a: 1, b: 2, c: 3 });
|
||||
const lazySeq = Seq(map);
|
||||
```
|
||||
|
||||
`Seq` allows for the efficient chaining of operations, allowing for the
|
||||
expression of logic that can otherwise be very tedious:
|
||||
|
||||
```js
|
||||
lazySeq
|
||||
.flip()
|
||||
.map(key => key.toUpperCase())
|
||||
.flip();
|
||||
// Seq { A: 1, B: 2, C: 3 }
|
||||
```
|
||||
|
||||
As well as expressing logic that would otherwise seem memory or time
|
||||
limited, for example `Range` is a special kind of Lazy sequence.
|
||||
|
||||
<!-- runkit:activate -->
|
||||
|
||||
```js
|
||||
const { Range } = require('immutable');
|
||||
Range(1, Infinity)
|
||||
.skip(1000)
|
||||
.map(n => -n)
|
||||
.filter(n => n % 2 === 0)
|
||||
.take(2)
|
||||
.reduce((r, n) => r * n, 1);
|
||||
// 1006008
|
||||
```
|
||||
|
||||
## Comparison of filter(), groupBy(), and partition()
|
||||
|
||||
The `filter()`, `groupBy()`, and `partition()` methods are similar in that they
|
||||
all divide a collection into parts based on applying a function to each element.
|
||||
All three call the predicate or grouping function once for each item in the
|
||||
input collection. All three return zero or more collections of the same type as
|
||||
their input. The returned collections are always distinct from the input
|
||||
(according to `===`), even if the contents are identical.
|
||||
|
||||
Of these methods, `filter()` is the only one that is lazy and the only one which
|
||||
discards items from the input collection. It is the simplest to use, and the
|
||||
fact that it returns exactly one collection makes it easy to combine with other
|
||||
methods to form a pipeline of operations.
|
||||
|
||||
The `partition()` method is similar to an eager version of `filter()`, but it
|
||||
returns two collections; the first contains the items that would have been
|
||||
discarded by `filter()`, and the second contains the items that would have been
|
||||
kept. It always returns an array of exactly two collections, which can make it
|
||||
easier to use than `groupBy()`. Compared to making two separate calls to
|
||||
`filter()`, `partition()` makes half as many calls it the predicate passed to
|
||||
it.
|
||||
|
||||
The `groupBy()` method is a more generalized version of `partition()` that can
|
||||
group by an arbitrary function rather than just a predicate. It returns a map
|
||||
with zero or more entries, where the keys are the values returned by the
|
||||
grouping function, and the values are nonempty collections of the corresponding
|
||||
arguments. Although `groupBy()` is more powerful than `partition()`, it can be
|
||||
harder to use because it is not always possible predict in advance how many
|
||||
entries the returned map will have and what their keys will be.
|
||||
|
||||
| Summary | `filter` | `partition` | `groupBy` |
|
||||
|:------------------------------|:---------|:------------|:---------------|
|
||||
| ease of use | easiest | moderate | hardest |
|
||||
| generality | least | moderate | most |
|
||||
| laziness | lazy | eager | eager |
|
||||
| # of returned sub-collections | 1 | 2 | 0 or more |
|
||||
| sub-collections may be empty | yes | yes | no |
|
||||
| can discard items | yes | no | no |
|
||||
| wrapping container | none | array | Map/OrderedMap |
|
||||
|
||||
## Additional Tools and Resources
|
||||
|
||||
- [Atom-store](https://github.com/jameshopkins/atom-store/)
|
||||
- A Clojure-inspired atom implementation in Javascript with configurability
|
||||
for external persistance.
|
||||
|
||||
- [Chai Immutable](https://github.com/astorije/chai-immutable)
|
||||
- If you are using the [Chai Assertion Library](https://chaijs.com/), this
|
||||
provides a set of assertions to use against Immutable.js collections.
|
||||
|
||||
- [Fantasy-land](https://github.com/fantasyland/fantasy-land)
|
||||
- Specification for interoperability of common algebraic structures in JavaScript.
|
||||
|
||||
- [Immutagen](https://github.com/pelotom/immutagen)
|
||||
- A library for simulating immutable generators in JavaScript.
|
||||
|
||||
- [Immutable-cursor](https://github.com/redbadger/immutable-cursor)
|
||||
- Immutable cursors incorporating the Immutable.js interface over
|
||||
Clojure-inspired atom.
|
||||
|
||||
- [Immutable-ext](https://github.com/DrBoolean/immutable-ext)
|
||||
- Fantasyland extensions for immutablejs
|
||||
|
||||
- [Immutable-js-tools](https://github.com/madeinfree/immutable-js-tools)
|
||||
- Util tools for immutable.js
|
||||
|
||||
- [Immutable-Redux](https://github.com/gajus/redux-immutable)
|
||||
- redux-immutable is used to create an equivalent function of Redux
|
||||
combineReducers that works with Immutable.js state.
|
||||
|
||||
- [Immutable-Treeutils](https://github.com/lukasbuenger/immutable-treeutils)
|
||||
- Functional tree traversal helpers for ImmutableJS data structures.
|
||||
|
||||
- [Irecord](https://github.com/ericelliott/irecord)
|
||||
- An immutable store that exposes an RxJS observable. Great for React.
|
||||
|
||||
- [Mudash](https://github.com/brianneisler/mudash)
|
||||
- Lodash wrapper providing Immutable.JS support.
|
||||
|
||||
- [React-Immutable-PropTypes](https://github.com/HurricaneJames/react-immutable-proptypes)
|
||||
- PropType validators that work with Immutable.js.
|
||||
|
||||
- [Redux-Immutablejs](https://github.com/indexiatech/redux-immutablejs)
|
||||
- Redux Immutable facilities.
|
||||
|
||||
- [Rxstate](https://github.com/yamalight/rxstate)
|
||||
- Simple opinionated state management library based on RxJS and Immutable.js.
|
||||
|
||||
- [Transit-Immutable-js](https://github.com/glenjamin/transit-immutable-js)
|
||||
- Transit serialisation for Immutable.js.
|
||||
- See also: [Transit-js](https://github.com/cognitect/transit-js)
|
||||
|
||||
Have an additional tool designed to work with Immutable.js?
|
||||
Submit a PR to add it to this list in alphabetical order.
|
||||
|
||||
## Contributing
|
||||
|
||||
Use [Github issues](https://github.com/immutable-js/immutable-js/issues) for requests.
|
||||
|
||||
We actively welcome pull requests, learn how to [contribute](https://github.com/immutable-js/immutable-js/blob/main/.github/CONTRIBUTING.md).
|
||||
|
||||
Immutable.js is maintained within the [Contributor Covenant's Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/).
|
||||
|
||||
### Changelog
|
||||
|
||||
Changes are tracked as [Github releases](https://github.com/immutable-js/immutable-js/releases).
|
||||
|
||||
### License
|
||||
|
||||
Immutable.js is [MIT-licensed](./LICENSE).
|
||||
|
||||
### Thanks
|
||||
|
||||
[Phil Bagwell](https://www.youtube.com/watch?v=K2NYwP90bNs), for his inspiration
|
||||
and research in persistent data structures.
|
||||
|
||||
[Hugh Jackson](https://github.com/hughfdjackson/), for providing the npm package
|
||||
name. If you're looking for his unsupported package, see [this repository](https://github.com/hughfdjackson/immutable).
|
||||
5908
node_modules/.store/sass@1.69.5/node_modules/immutable/dist/immutable.d.ts
generated
vendored
Normal file
5908
node_modules/.store/sass@1.69.5/node_modules/immutable/dist/immutable.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5965
node_modules/.store/sass@1.69.5/node_modules/immutable/dist/immutable.es.js
generated
vendored
Normal file
5965
node_modules/.store/sass@1.69.5/node_modules/immutable/dist/immutable.es.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6021
node_modules/.store/sass@1.69.5/node_modules/immutable/dist/immutable.js
generated
vendored
Normal file
6021
node_modules/.store/sass@1.69.5/node_modules/immutable/dist/immutable.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2412
node_modules/.store/sass@1.69.5/node_modules/immutable/dist/immutable.js.flow
generated
vendored
Normal file
2412
node_modules/.store/sass@1.69.5/node_modules/immutable/dist/immutable.js.flow
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
55
node_modules/.store/sass@1.69.5/node_modules/immutable/dist/immutable.min.js
generated
vendored
Normal file
55
node_modules/.store/sass@1.69.5/node_modules/immutable/dist/immutable.min.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Immutable={})}(this,function(t){"use strict";var e="delete",d=5,l=1<<d,g=l-1,v={};function u(){return{value:!1}}function _(t){t&&(t.value=!0)}function m(){}function c(t){return void 0===t.size&&(t.size=t.__iterate(r)),t.size}function h(t,e){if("number"!=typeof e){var r=e>>>0;if(""+r!==e||4294967295==r)return NaN;e=r}return e<0?c(t)+e:e}function r(){return!0}function p(t,e,r){return(0===t&&!i(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&r<=e)}function y(t,e){return n(t,e,0)}function w(t,e){return n(t,e,e)}function n(t,e,r){return void 0===t?r:i(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function i(t){return t<0||0===t&&1/t==-1/0}var o="@@__IMMUTABLE_ITERABLE__@@";function f(t){return!(!t||!t[o])}var s="@@__IMMUTABLE_KEYED__@@";function a(t){return!(!t||!t[s])}var S="@@__IMMUTABLE_INDEXED__@@";function z(t){return!(!t||!t[S])}function b(t){return a(t)||z(t)}function I(t){return f(t)?t:F(t)}var O=function(t){function e(t){return a(t)?t:G(t)}return e.__proto__=t,(e.prototype=Object.create(t.prototype)).constructor=e}(I),E=function(t){function e(t){return z(t)?t:Z(t)}return e.__proto__=t,(e.prototype=Object.create(t.prototype)).constructor=e}(I),j=function(t){function e(t){return f(t)&&!b(t)?t:$(t)}return e.__proto__=t,(e.prototype=Object.create(t.prototype)).constructor=e}(I);I.Keyed=O,I.Indexed=E,I.Set=j;var q="@@__IMMUTABLE_SEQ__@@";function M(t){return!(!t||!t[q])}var D="@@__IMMUTABLE_RECORD__@@";function x(t){return!(!t||!t[D])}function A(t){return f(t)||x(t)}var k="@@__IMMUTABLE_ORDERED__@@";function R(t){return!(!t||!t[k])}var U=0,T=1,K=2,L="function"==typeof Symbol&&Symbol.iterator,C="@@iterator",B=L||C,P=function(t){this.next=t};function W(t,e,r,n){r=0===t?e:1===t?r:[e,r];return n?n.value=r:n={value:r,done:!1},n}function N(){return{value:void 0,done:!0}}function H(t){return Array.isArray(t
|
||||
)||Y(t)}function J(t){return t&&"function"==typeof t.next}function V(t){var e=Y(t);return e&&e.call(t)}function Y(t){t=t&&(L&&t[L]||t[C]);if("function"==typeof t)return t}P.prototype.toString=function(){return"[Iterator]"},P.KEYS=U,P.VALUES=T,P.ENTRIES=K,P.prototype.inspect=P.prototype.toSource=function(){return""+this},P.prototype[B]=function(){return this};var Q=Object.prototype.hasOwnProperty;function X(t){return Array.isArray(t)||"string"==typeof t||t&&"object"==typeof t&&Number.isInteger(t.length)&&0<=t.length&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var F=function(t){function e(t){return null==t?it():A(t)?t.toSeq():function(t){var e=st(t);if(e)return function(t){var e=Y(t);return e&&e===t.entries}(t)?e.fromEntrySeq():function(t){var e=Y(t);return e&&e===t.keys}(t)?e.toSetSeq():e;if("object"!=typeof t)throw new TypeError("Expected Array or collection object of values, or keyed object: "+t);return new et(t)}(t)}return e.__proto__=t,((e.prototype=Object.create(t.prototype)).constructor=e).prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var o=r[e?n-++i:i++];if(!1===t(o[1],o[0],this))break}return i}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(e,r){var n=this._cache;if(n){var i=n.length,o=0;return new P(function(){if(o===i)return N();var t=n[r?i-++o:o++];return W(e,t[0],t[1])})}return this.__iteratorUncached(e,r)},e}(I),G=function(t){function e(t){return null==t?it().toKeyedSeq():f(t)?a(t)?t.toSeq():t.fromEntrySeq():x(t)?t.toSeq():ot(t)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.toKeyedSeq=function(){return this},e}(F),Z=function(t){function e(t){return null==t?it():f(t)?a(t)?t.entrySeq():t.toIndexedSeq():x(t
|
||||
)?t.toSeq().entrySeq():ut(t)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(F),$=function(t){function e(t){return(f(t)&&!b(t)?t:Z(t)).toSetSeq()}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(F);F.isSeq=M,F.Keyed=G,F.Set=$,F.Indexed=Z,F.prototype[q]=!0;var tt=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.get=function(t,e){return this.has(t)?this._array[h(this,t)]:e},e.prototype.__iterate=function(t,e){for(var r=this._array,n=r.length,i=0;i!==n;){var o=e?n-++i:i++;if(!1===t(r[o],o,this))break}return i},e.prototype.__iterator=function(e,r){var n=this._array,i=n.length,o=0;return new P(function(){if(o===i)return N();var t=r?i-++o:o++;return W(e,t,n[t])})},e}(Z),et=function(t){function e(t){var e=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return Q.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length,o=0;o!==i;){var u=n[e?i-++o:o++];if(!1===t(r[u],u,this))break}return o},e.prototype.__iterator=function(e,r){var n=this._object,i=this._keys,o=i.length,u=0;return new P(function(){if(u===o)return N();var t=i[r?o-++u:u++];return W(e,t,n[t])})},e}(G);et.prototype[k]=!0;var rt,nt=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__iterateUncached=function(t,e){
|
||||
if(e)return this.cacheResult().__iterate(t,e);var r,n=V(this._collection),i=0;if(J(n))for(;!(r=n.next()).done&&!1!==t(r.value,i++,this););return i},e.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=V(this._collection);if(!J(r))return new P(N);var n=0;return new P(function(){var t=r.next();return t.done?t:W(e,n++,t.value)})},e}(Z);function it(){return rt=rt||new tt([])}function ot(t){var e=st(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new et(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function ut(t){var e=st(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function st(t){return X(t)?new tt(t):H(t)?new nt(t):void 0}var at="@@__IMMUTABLE_MAP__@@";function ct(t){return!(!t||!t[at])}function ft(t){return ct(t)&&R(t)}function ht(t){return!(!t||"function"!=typeof t.equals||"function"!=typeof t.hashCode)}function _t(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(ht(t)&&ht(e)&&t.equals(e))}var pt="function"==typeof Math.imul&&-2==Math.imul(4294967295,2)?Math.imul:function(t,e){var r=65535&(t|=0),n=65535&(e|=0);return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0};function lt(t){return t>>>1&1073741824|3221225471&t}var vt=Object.prototype.valueOf;function yt(t){if(null==t)return dt(t);if("function"==typeof t.hashCode)return lt(t.hashCode(t));var e,r=(e=t).valueOf!==vt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return dt(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;e!==t&&(e^=4294967295*t);for(;4294967295<t;)e^=t/=4294967295;return lt(e)}(r);case"string":return(jt<r.length?function(t){var e=Dt[t];void 0===e&&(e=gt(t),Mt===qt&&(Mt=0,Dt={}),Mt++,Dt[t]=e);return e}:gt)(r);case"object":case"function":return function(t){
|
||||
var e;if(bt&&void 0!==(e=zt.get(t)))return e;if(void 0!==(e=t[Et]))return e;if(!wt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Et]))return e;if(void 0!==(e=function(t){if(t&&0<t.nodeType)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=St(),bt)zt.set(t,e);else{if(void 0!==mt&&!1===mt(t))throw Error("Non-extensible objects are not allowed as keys.");if(wt)Object.defineProperty(t,Et,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Et]=e;else{if(void 0===t.nodeType)throw Error("Unable to set a non-enumerable property on object.");t[Et]=e}}return e}(r);case"symbol":return void 0===(e=It[t=r])?(e=St(),It[t]=e):e;default:if("function"==typeof r.toString)return gt(""+r);throw Error("Value type "+typeof r+" cannot be hashed.")}}function dt(t){return null===t?1108378658:1108378659}function gt(t){for(var e=0,r=0;r<t.length;r++)e=31*e+t.charCodeAt(r)|0;return lt(e)}var mt=Object.isExtensible,wt=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}();function St(){var t=++Ot;return 1073741824&Ot&&(Ot=0),t}var zt,bt="function"==typeof WeakMap;bt&&(zt=new WeakMap);var It=Object.create(null),Ot=0,Et="__immutablehash__";"function"==typeof Symbol&&(Et=Symbol(Et));var jt=16,qt=255,Mt=0,Dt={},xt=function(t){function e(t,e){this._iter=t,this._useKeys=e,this.size=t.size}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.get=function(t,e){return this._iter.get(t,e)},e.prototype.has=function(t){return this._iter.has(t)},e.prototype.valueSeq=function(){return this._iter.valueSeq()},e.prototype.reverse=function(){var t=this,e=Kt(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},
|
||||
e.prototype.map=function(t,e){var r=this,n=Tt(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},e.prototype.__iterate=function(r,t){var n=this;return this._iter.__iterate(function(t,e){return r(t,e,n)},t)},e.prototype.__iterator=function(t,e){return this._iter.__iterator(t,e)},e}(G);xt.prototype[k]=!0;var At=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.includes=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(e,r){var n=this,i=0;return r&&c(this),this._iter.__iterate(function(t){return e(t,r?n.size-++i:i++,n)},r)},e.prototype.__iterator=function(e,r){var n=this,i=this._iter.__iterator(T,r),o=0;return r&&c(this),new P(function(){var t=i.next();return t.done?t:W(e,r?n.size-++o:o++,t.value,t)})},e}(Z),kt=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.has=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate(function(t){return e(t,t,r)},t)},e.prototype.__iterator=function(e,t){var r=this._iter.__iterator(T,t);return new P(function(){var t=r.next();return t.done?t:W(e,t.value,t.value,t)})},e}($),Rt=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.entrySeq=function(){return this._iter.toSeq()},e.prototype.__iterate=function(r,t){var n=this;return this._iter.__iterate(function(t){if(t){Yt(t);var e=f(t);return r(e?t.get(1):t[1],e?t.get(0):t[0],n)}},t)},e.prototype.__iterator=function(n,t){var i=this._iter.__iterator(T,t);return new P(function(){for(;;){var t=i.next();if(t.done)return t;var e=t.value;if(e){Yt(e);var r=f(e);return W(n,r?e.get(0):e[0],r?e.get(1):e[1],t)}}})},e}(G);function Ut(i){var t=Xt(i);return t._iter=i,t.size=i.size,t.flip=function(){return i},t.reverse=function(){
|
||||
var t=i.reverse.apply(this);return t.flip=function(){return i.reverse()},t},t.has=function(t){return i.includes(t)},t.includes=function(t){return i.has(t)},t.cacheResult=Ft,t.__iterateUncached=function(r,t){var n=this;return i.__iterate(function(t,e){return!1!==r(e,t,n)},t)},t.__iteratorUncached=function(t,e){if(t!==K)return i.__iterator(t===T?U:T,e);var r=i.__iterator(t,e);return new P(function(){var t,e=r.next();return e.done||(t=e.value[0],e.value[0]=e.value[1],e.value[1]=t),e})},t}function Tt(o,u,s){var t=Xt(o);return t.size=o.size,t.has=function(t){return o.has(t)},t.get=function(t,e){var r=o.get(t,v);return r===v?e:u.call(s,r,t,o)},t.__iterateUncached=function(n,t){var i=this;return o.__iterate(function(t,e,r){return!1!==n(u.call(s,t,e,r),e,i)},t)},t.__iteratorUncached=function(n,t){var i=o.__iterator(K,t);return new P(function(){var t=i.next();if(t.done)return t;var e=t.value,r=e[0];return W(n,r,u.call(s,e[1],r,o),t)})},t}function Kt(u,s){var a=this,t=Xt(u);return t._iter=u,t.size=u.size,t.reverse=function(){return u},u.flip&&(t.flip=function(){var t=Ut(u);return t.reverse=function(){return u.flip()},t}),t.get=function(t,e){return u.get(s?t:-1-t,e)},t.has=function(t){return u.has(s?t:-1-t)},t.includes=function(t){return u.includes(t)},t.cacheResult=Ft,t.__iterate=function(r,n){var i=this,o=0;return n&&c(u),u.__iterate(function(t,e){return r(t,s?e:n?i.size-++o:o++,i)},!n)},t.__iterator=function(r,n){var i=0;n&&c(u);var o=u.__iterator(K,!n);return new P(function(){var t=o.next();if(t.done)return t;var e=t.value;return W(r,s?e[0]:n?a.size-++i:i++,e[1],t)})},t}function Lt(u,s,a,c){var t=Xt(u);return c&&(t.has=function(t){var e=u.get(t,v);return e!==v&&!!s.call(a,e,t,u)},t.get=function(t,e){var r=u.get(t,v);return r!==v&&s.call(a,r,t,u)?r:e}),t.__iterateUncached=function(n,t){var i=this,o=0;return u.__iterate(function(t,e,r){if(s.call(a,t,e,r))return o++,n(t,c?e:o-1,i)},t),o},t.__iteratorUncached=function(n,t){var i=u.__iterator(K,t),o=0;return new P(function(){for(;;){var t=i.next();if(t.done)return t
|
||||
;var e=t.value,r=e[0],e=e[1];if(s.call(a,e,r,u))return W(n,c?r:o++,e,t)}})},t}function Ct(s,t,e,a){var r=s.size;if(p(t,e,r))return s;var c=y(t,r),r=w(e,r);if(c!=c||r!=r)return Ct(s.toSeq().cacheResult(),t,e,a);var f,r=r-c;r==r&&(f=r<0?0:r);r=Xt(s);return r.size=0===f?f:s.size&&f||void 0,!a&&M(s)&&0<=f&&(r.get=function(t,e){return 0<=(t=h(this,t))&&t<f?s.get(t+c,e):e}),r.__iterateUncached=function(r,t){var n=this;if(0===f)return 0;if(t)return this.cacheResult().__iterate(r,t);var i=0,o=!0,u=0;return s.__iterate(function(t,e){if(!(o=o&&i++<c))return u++,!1!==r(t,a?e:u-1,n)&&u!==f}),u},r.__iteratorUncached=function(e,t){if(0!==f&&t)return this.cacheResult().__iterator(e,t);if(0===f)return new P(N);var r=s.__iterator(e,t),n=0,i=0;return new P(function(){for(;n++<c;)r.next();if(++i>f)return N();var t=r.next();return a||e===T||t.done?t:W(e,i-1,e===U?void 0:t.value[1],t)})},r}function Bt(e,c,f,h){var t=Xt(e);return t.__iterateUncached=function(n,t){var i=this;if(t)return this.cacheResult().__iterate(n,t);var o=!0,u=0;return e.__iterate(function(t,e,r){if(!(o=o&&c.call(f,t,e,r)))return u++,n(t,h?e:u-1,i)}),u},t.__iteratorUncached=function(i,t){var o=this;if(t)return this.cacheResult().__iterator(i,t);var u=e.__iterator(K,t),s=!0,a=0;return new P(function(){var t;do{if((t=u.next()).done)return h||i===T?t:W(i,a++,i===U?void 0:t.value[1],t);var e=t.value,r=e[0],n=e[1];s=s&&c.call(f,n,r,o)}while(s);return i===K?t:W(i,r,n,t)})},t}function Pt(t,s,a){var c=Xt(t);return c.__iterateUncached=function(i,e){if(e)return this.cacheResult().__iterate(i,e);var o=0,u=!1;return function r(t,n){t.__iterate(function(t,e){return(!s||n<s)&&f(t)?r(t,n+1):(o++,!1===i(t,a?e:o-1,c)&&(u=!0)),!u},e)}(t,0),o},c.__iteratorUncached=function(r,n){if(n)return this.cacheResult().__iterator(r,n);var i=t.__iterator(r,n),o=[],u=0;return new P(function(){for(;i;){var t=i.next();if(!1===t.done){var e=t.value;if(r===K&&(e=e[1]),s&&!(o.length<s)||!f(e))return a?t:W(r,u++,e,t);o.push(i),i=e.__iterator(r,n)}else i=o.pop()}return N()})},c}function Wt(r,n,i){
|
||||
n=n||Gt;var t=a(r),o=0,u=r.toSeq().map(function(t,e){return[e,t,o++,i?i(t,e,r):t]}).valueSeq().toArray();return u.sort(function(t,e){return n(t[3],e[3])||t[2]-e[2]}).forEach(t?function(t,e){u[e].length=2}:function(t,e){u[e]=t[1]}),(t?G:z(r)?Z:$)(u)}function Nt(r,n,i){if(n=n||Gt,i){var t=r.toSeq().map(function(t,e){return[t,i(t,e,r)]}).reduce(function(t,e){return Ht(n,t[1],e[1])?e:t});return t&&t[0]}return r.reduce(function(t,e){return Ht(n,t,e)?e:t})}function Ht(t,e,r){t=t(r,e);return 0===t&&r!==e&&(null==r||r!=r)||0<t}function Jt(t,u,s,a){var e=Xt(t),t=new tt(s).map(function(t){return t.size});return e.size=a?t.max():t.min(),e.__iterate=function(t,e){for(var r,n=this.__iterator(T,e),i=0;!(r=n.next()).done&&!1!==t(r.value,i++,this););return i},e.__iteratorUncached=function(e,r){var n=s.map(function(t){return t=I(t),V(r?t.reverse():t)}),i=0,o=!1;return new P(function(){var t;return o||(t=n.map(function(t){return t.next()}),o=a?t.every(function(t){return t.done}):t.some(function(t){return t.done})),o?N():W(e,i++,u.apply(null,t.map(function(t){return t.value})))})},e}function Vt(t,e){return t===e?t:M(t)?e:t.constructor(e)}function Yt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Qt(t){return a(t)?O:z(t)?E:j}function Xt(t){return Object.create((a(t)?G:z(t)?Z:$).prototype)}function Ft(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):F.prototype.cacheResult.call(this)}function Gt(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:e<t?1:t<e?-1:0}function Zt(t,e){for(var r=Math.max(0,t.length-(e=e||0)),n=Array(r),i=0;i<r;i++)n[i]=t[i+e];return n}function $t(t,e){if(!t)throw Error(e)}function te(t){$t(t!==1/0,"Cannot perform this action with an infinite size.")}function ee(t){if(X(t)&&"string"!=typeof t)return t;if(R(t))return t.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+t)}At.prototype.cacheResult=xt.prototype.cacheResult=kt.prototype.cacheResult=Rt.prototype.cacheResult=Ft
|
||||
;var re=Object.prototype.toString;function ne(t){if(!t||"object"!=typeof t||"[object Object]"!==re.call(t))return!1;t=Object.getPrototypeOf(t);if(null===t)return!0;for(var e=t,r=Object.getPrototypeOf(t);null!==r;)r=Object.getPrototypeOf(e=r);return e===t}function ie(t){return"object"==typeof t&&(A(t)||Array.isArray(t)||ne(t))}function oe(e){try{return"string"==typeof e?JSON.stringify(e):e+""}catch(t){return JSON.stringify(e)}}function ue(t,e){return A(t)?t.has(e):ie(t)&&Q.call(t,e)}function se(t,e,r){return A(t)?t.get(e,r):ue(t,e)?"function"==typeof t.get?t.get(e):t[e]:r}function ae(t){if(Array.isArray(t))return Zt(t);var e,r={};for(e in t)Q.call(t,e)&&(r[e]=t[e]);return r}function ce(t,e){if(!ie(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(A(t)){if(!t.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+t);return t.remove(e)}if(!Q.call(t,e))return t;t=ae(t);return Array.isArray(t)?t.splice(e,1):delete t[e],t}function fe(t,e,r){if(!ie(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(A(t)){if(!t.set)throw new TypeError("Cannot update immutable value without .set() method: "+t);return t.set(e,r)}if(Q.call(t,e)&&r===t[e])return t;t=ae(t);return t[e]=r,t}function he(t,e,r,n){n||(n=r,r=void 0);n=function t(e,r,n,i,o,u){var s=r===v;if(i===n.length){var a=s?o:r,c=u(a);return c===a?r:c}if(!s&&!ie(r))throw new TypeError("Cannot update within non-data-structure value in path ["+n.slice(0,i).map(oe)+"]: "+r);var a=n[i];var c=s?v:se(r,a,v);var u=t(c===v?e:A(c),c,n,i+1,o,u);return u===c?r:u===v?ce(r,a):fe(s?e?Qe():{}:r,a,u)}(A(t),t,ee(e),0,r,n);return n===v?r:n}function _e(t,e,r){return he(t,e,v,function(){return r})}function pe(t,e){return _e(this,t,e)}function le(t,e){return he(t,e,function(){return v})}function ve(t){return le(this,t)}function ye(t,e,r,n){return he(t,[e],r,n)}function de(t,e,r){return 1===arguments.length?t(this):ye(this,t,e,r)}function ge(t,e,r){return he(this,t,e,r)}function me(){for(var t=[],e=arguments.length;e--;
|
||||
)t[e]=arguments[e];return Se(this,t)}function we(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return Se(this,e,t)}function Se(t,e,i){for(var r=[],n=0;n<e.length;n++){var o=O(e[n]);0!==o.size&&r.push(o)}return 0===r.length?t:0!==t.toSeq().size||t.__ownerID||1!==r.length?t.withMutations(function(n){for(var t=i?function(e,r){ye(n,r,v,function(t){return t===v?e:i(t,e,r)})}:function(t,e){n.set(e,t)},e=0;e<r.length;e++)r[e].forEach(t)}):t.constructor(r[0])}function ze(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];return je(t,e)}function be(t,e){for(var r=[],n=arguments.length-2;0<n--;)r[n]=arguments[n+2];return je(e,r,t)}function Ie(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];return Ee(t,e)}function Oe(t,e){for(var r=[],n=arguments.length-2;0<n--;)r[n]=arguments[n+2];return Ee(e,r,t)}function Ee(t,e,r){return je(t,e,(i=r,function t(e,r,n){return ie(e)&&ie(r)&&function(t,e){return t=F(t),e=F(e),z(t)===z(e)&&a(t)===a(e)}(e,r)?je(e,[r],t):i?i(e,r,n):r}));var i}function je(n,t,i){if(!ie(n))throw new TypeError("Cannot merge into non-data-structure value: "+n);if(A(n))return"function"==typeof i&&n.mergeWith?n.mergeWith.apply(n,[i].concat(t)):(n.merge?n.merge:n.concat).apply(n,t);for(var e=Array.isArray(n),o=n,r=e?E:O,u=e?function(t){o===n&&(o=ae(o)),o.push(t)}:function(t,e){var r=Q.call(o,e),t=r&&i?i(o[e],t,e):t;r&&t===o[e]||(o===n&&(o=ae(o)),o[e]=t)},s=0;s<t.length;s++)r(t[s]).forEach(u);return o}function qe(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Ee(this,t)}function Me(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];return Ee(this,e,t)}function De(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];return he(this,t,Qe(),function(t){return je(t,e)})}function xe(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];return he(this,t,Qe(),function(t){return Ee(t,e)})}function Ae(t){var e=this.asMutable();return t(e),e.wasAltered(
|
||||
)?e.__ensureOwner(this.__ownerID):this}function ke(){return this.__ownerID?this:this.__ensureOwner(new m)}function Re(){return this.__ensureOwner()}function Ue(){return this.__altered}var Te=function(n){function t(e){return null==e?Qe():ct(e)&&!R(e)?e:Qe().withMutations(function(r){var t=n(e);te(t.size),t.forEach(function(t,e){return r.set(e,t)})})}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).of=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return Qe().withMutations(function(t){for(var e=0;e<r.length;e+=2){if(r.length<=e+1)throw Error("Missing value for key: "+r[e]);t.set(r[e],r[e+1])}})},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},t.prototype.set=function(t,e){return Xe(this,t,e)},t.prototype.remove=function(t){return Xe(this,t,v)},t.prototype.deleteAll=function(t){var r=I(t);return 0===r.size?this:this.withMutations(function(e){r.forEach(function(t){return e.remove(t)})})},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Qe()},t.prototype.sort=function(t){return wr(Wt(this,t))},t.prototype.sortBy=function(t,e){return wr(Wt(this,e,t))},t.prototype.map=function(n,i){var o=this;return this.withMutations(function(r){r.forEach(function(t,e){r.set(e,n.call(i,t,e,o))})})},t.prototype.__iterator=function(t,e){return new He(this,t,e)},t.prototype.__iterate=function(e,t){var r=this,n=0;return this._root&&this._root.iterate(function(t){return n++,e(t[1],t[0],r)},t),n},t.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ye(this.size,this._root,t,this.__hash):0===this.size?Qe():(this.__ownerID=t,this.__altered=!1,this)},t}(O);Te.isMap=ct;var Ke=Te.prototype;Ke[at]=!0,Ke[e]=Ke.remove,Ke.removeAll=Ke.deleteAll,Ke.setIn=pe,Ke.removeIn=Ke.deleteIn=ve,Ke.update=de,Ke.updateIn=ge,Ke.merge=Ke.concat=me,Ke.mergeWith=we,Ke.mergeDeep=qe,Ke.mergeDeepWith=Me,
|
||||
Ke.mergeIn=De,Ke.mergeDeepIn=xe,Ke.withMutations=Ae,Ke.wasAltered=Ue,Ke.asImmutable=Re,Ke["@@transducer/init"]=Ke.asMutable=ke,Ke["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ke["@@transducer/result"]=function(t){return t.asImmutable()};var Le=function(t,e){this.ownerID=t,this.entries=e};Le.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(_t(r,i[o][0]))return i[o][1];return n},Le.prototype.update=function(t,e,r,n,i,o,u){for(var s=i===v,a=this.entries,c=0,f=a.length;c<f&&!_t(n,a[c][0]);c++);var h=c<f;if(h?a[c][1]===i:s)return this;if(_(u),!s&&h||_(o),!s||1!==a.length){if(!h&&!s&&er<=a.length)return function(t,e,r,n){t=t||new m;for(var i=new We(t,yt(r),[r,n]),o=0;o<e.length;o++){var u=e[o];i=i.update(t,0,void 0,u[0],u[1])}return i}(t,a,n,i);u=t&&t===this.ownerID,o=u?a:Zt(a);return h?s?c===f-1?o.pop():o[c]=o.pop():o[c]=[n,i]:o.push([n,i]),u?(this.entries=o,this):new Le(t,o)}};var Ce=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r};Ce.prototype.get=function(t,e,r,n){void 0===e&&(e=yt(r));var i=1<<((0===t?e:e>>>t)&g),o=this.bitmap;return 0==(o&i)?n:this.nodes[$e(o&i-1)].get(t+d,e,r,n)},Ce.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=yt(n));var s=(0===e?r:r>>>e)&g,a=1<<s,c=this.bitmap,f=0!=(c&a);if(!f&&i===v)return this;var h=$e(c&a-1),_=this.nodes,p=f?_[h]:void 0,u=Fe(p,t,e+d,r,n,i,o,u);if(u===p)return this;if(!f&&u&&rr<=_.length)return function(t,e,r,n,i){for(var o=0,u=Array(l),s=0;0!==r;s++,r>>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new Be(t,o+1,u)}(t,_,c,s,u);if(f&&!u&&2===_.length&&Ge(_[1^h]))return _[1^h];if(f&&u&&1===_.length&&Ge(u))return u;s=t&&t===this.ownerID,a=f?u?c:c^a:c|a,u=f?u?tr(_,h,u,s):function(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=Array(n),o=0,u=0;u<n;u++)u===e&&(o=1),i[u]=t[u+o];return i}(_,h,s):function(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=Array(i),u=0,s=0;s<i;s++)s===e?(o[s]=r,u=-1):o[s]=t[s+u];return o}(_,h,u,s);return s?(this.bitmap=a,this.nodes=u,this):new Ce(t,a,u)}
|
||||
;var Be=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r};Be.prototype.get=function(t,e,r,n){void 0===e&&(e=yt(r));var i=this.nodes[(0===t?e:e>>>t)&g];return i?i.get(t+d,e,r,n):n},Be.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=yt(n));var s=(0===e?r:r>>>e)&g,a=this.nodes,c=a[s];if(i===v&&!c)return this;o=Fe(c,t,e+d,r,n,i,o,u);if(o===c)return this;u=this.count;if(c){if(!o&&--u<nr)return function(t,e,r,n){for(var i=0,o=0,u=Array(r),s=0,a=1,c=e.length;s<c;s++,a<<=1){var f=e[s];void 0!==f&&s!==n&&(i|=a,u[o++]=f)}return new Ce(t,i,u)}(t,a,u,s)}else u++;c=t&&t===this.ownerID,o=tr(a,s,o,c);return c?(this.count=u,this.nodes=o,this):new Be(t,u,o)};var Pe=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r};Pe.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(_t(r,i[o][0]))return i[o][1];return n},Pe.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=yt(n));var s=i===v;if(r!==this.keyHash)return s?this:(_(u),_(o),Ze(this,t,e,r,[n,i]));for(var a=this.entries,c=0,f=a.length;c<f&&!_t(n,a[c][0]);c++);r=c<f;if(r?a[c][1]===i:s)return this;if(_(u),!s&&r||_(o),s&&2===f)return new We(t,this.keyHash,a[1^c]);u=t&&t===this.ownerID,o=u?a:Zt(a);return r?s?c===f-1?o.pop():o[c]=o.pop():o[c]=[n,i]:o.push([n,i]),u?(this.entries=o,this):new Pe(t,this.keyHash,o)};var We=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r};We.prototype.get=function(t,e,r,n){return _t(r,this.entry[0])?this.entry[1]:n},We.prototype.update=function(t,e,r,n,i,o,u){var s=i===v,a=_t(n,this.entry[0]);return(a?i===this.entry[1]:s)?this:(_(u),s?void _(o):a?t&&t===this.ownerID?(this.entry[1]=i,this):new We(t,this.keyHash,[n,i]):(_(o),Ze(this,t,e,yt(n),[n,i])))},Le.prototype.iterate=Pe.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;n<=i;n++)if(!1===t(r[e?i-n:n]))return!1},Ce.prototype.iterate=Be.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;n<=i;n++){var o=r[e?i-n:n];if(o&&!1===o.iterate(t,e))return!1}},We.prototype.iterate=function(t,e){return t(
|
||||
this.entry)};var Ne,He=function(t){function e(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&Ve(t._root)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.next=function(){for(var t=this._type,e=this._stack;e;){var r=e.node,n=e.index++,i=void 0;if(r.entry){if(0==n)return Je(t,r.entry)}else if(r.entries){if(n<=(i=r.entries.length-1))return Je(t,r.entries[this._reverse?i-n:n])}else if(n<=(i=r.nodes.length-1)){n=r.nodes[this._reverse?i-n:n];if(n){if(n.entry)return Je(t,n.entry);e=this._stack=Ve(n,e)}continue}e=this._stack=this._stack.__prev}return N()},e}(P);function Je(t,e){return W(t,e[0],e[1])}function Ve(t,e){return{node:t,index:0,__prev:e}}function Ye(t,e,r,n){var i=Object.create(Ke);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Qe(){return Ne=Ne||Ye(0)}function Xe(t,e,r){if(t._root){var n=u(),i=u(),o=Fe(t._root,t.__ownerID,0,void 0,e,r,n,i);if(!i.value)return t;n=t.size+(n.value?r===v?-1:1:0)}else{if(r===v)return t;n=1,o=new Le(t.__ownerID,[[e,r]])}return t.__ownerID?(t.size=n,t._root=o,t.__hash=void 0,t.__altered=!0,t):o?Ye(n,o):Qe()}function Fe(t,e,r,n,i,o,u,s){return t?t.update(e,r,n,i,o,u,s):o===v?t:(_(s),_(u),new We(e,n,[i,o]))}function Ge(t){return t.constructor===We||t.constructor===Pe}function Ze(t,e,r,n,i){if(t.keyHash===n)return new Pe(e,n,[t.entry,i]);var o=(0===r?t.keyHash:t.keyHash>>>r)&g,u=(0===r?n:n>>>r)&g,t=o==u?[Ze(t,e,r+d,n,i)]:(i=new We(e,n,i),o<u?[t,i]:[i,t]);return new Ce(e,1<<o|1<<u,t)}function $e(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function tr(t,e,r,n){t=n?t:Zt(t);return t[e]=r,t}var er=l/4,rr=l/2,nr=l/4,ir="@@__IMMUTABLE_LIST__@@";function or(t){return!(!t||!t[ir])}var ur=function(o){function t(t){var e=pr();if(null==t)return e;if(or(t))return t;var n=o(t),i=n.size;return 0===i?e:(te(i),0<i&&i<l?_r(0,i,d,null,new ar(n.toArray())):e.withMutations(function(r){r.setSize(i),n.forEach(function(t,e){return r.set(e,t)})}))}return o&&(
|
||||
t.__proto__=o),((t.prototype=Object.create(o&&o.prototype)).constructor=t).of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(t,e){if(0<=(t=h(this,t))&&t<this.size){var r=yr(this,t+=this._origin);return r&&r.array[t&g]}return e},t.prototype.set=function(t,e){return function(t,e,r){if((e=h(t,e))!==e)return t;if(t.size<=e||e<0)return t.withMutations(function(t){e<0?dr(t,e).set(0,r):dr(t,0,e+1).set(e,r)});var n=t._tail,i=t._root,o=u();(e+=t._origin)>=gr(t._capacity)?n=lr(n,t.__ownerID,0,e,r,o):i=lr(i,t.__ownerID,t._level,e,r,o);if(!o.value)return t;if(t.__ownerID)return t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t;return _r(t._origin,t._capacity,t._level,i,n)}(this,t,e)},t.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},t.prototype.insert=function(t,e){return this.splice(t,0,e)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=d,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):pr()},t.prototype.push=function(){var r=arguments,n=this.size;return this.withMutations(function(t){dr(t,0,n+r.length);for(var e=0;e<r.length;e++)t.set(n+e,r[e])})},t.prototype.pop=function(){return dr(this,0,-1)},t.prototype.unshift=function(){var r=arguments;return this.withMutations(function(t){dr(t,-r.length);for(var e=0;e<r.length;e++)t.set(e,r[e])})},t.prototype.shift=function(){return dr(this,1)},t.prototype.concat=function(){for(var t=arguments,r=[],e=0;e<arguments.length;e++){var n=t[e],n=o("string"!=typeof n&&H(n)?n:[n]);0!==n.size&&r.push(n)}return 0===r.length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations(function(e){r.forEach(function(t){return t.forEach(function(t){return e.push(t)})})}):this.constructor(r[0])},t.prototype.setSize=function(t){return dr(this,0,t)},t.prototype.map=function(r,n){var i=this;return this.withMutations(function(t){for(
|
||||
var e=0;e<i.size;e++)t.set(e,r.call(n,t.get(e),e,i))})},t.prototype.slice=function(t,e){var r=this.size;return p(t,e,r)?this:dr(this,y(t,r),w(e,r))},t.prototype.__iterator=function(e,r){var n=r?this.size:0,i=hr(this,r);return new P(function(){var t=i();return t===fr?N():W(e,r?--n:n++,t)})},t.prototype.__iterate=function(t,e){for(var r,n=e?this.size:0,i=hr(this,e);(r=i())!==fr&&!1!==t(r,e?--n:n++,this););return n},t.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?_r(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):0===this.size?pr():(this.__ownerID=t,this.__altered=!1,this)},t}(E);ur.isList=or;var sr=ur.prototype;sr[ir]=!0,sr[e]=sr.remove,sr.merge=sr.concat,sr.setIn=pe,sr.deleteIn=sr.removeIn=ve,sr.update=de,sr.updateIn=ge,sr.mergeIn=De,sr.mergeDeepIn=xe,sr.withMutations=Ae,sr.wasAltered=Ue,sr.asImmutable=Re,sr["@@transducer/init"]=sr.asMutable=ke,sr["@@transducer/step"]=function(t,e){return t.push(e)},sr["@@transducer/result"]=function(t){return t.asImmutable()};var ar=function(t,e){this.array=t,this.ownerID=e};ar.prototype.removeBefore=function(t,e,r){if(r===e?1<<e:0===this.array.length)return this;var n=r>>>e&g;if(this.array.length<=n)return new ar([],t);var i=0==n;if(0<e){var o,u=this.array[n];if((o=u&&u.removeBefore(t,e-d,r))===u&&i)return this}if(i&&!o)return this;var s=vr(this,t);if(!i)for(var a=0;a<n;a++)s.array[a]=void 0;return o&&(s.array[n]=o),s},ar.prototype.removeAfter=function(t,e,r){if(r===(e?1<<e:0)||0===this.array.length)return this;var n=r-1>>>e&g;if(this.array.length<=n)return this;if(0<e){var i,o=this.array[n];if((i=o&&o.removeAfter(t,e-d,r))===o&&n==this.array.length-1)return this}t=vr(this,t);return t.array.splice(1+n),i&&(t.array[n]=i),t};var cr,fr={};function hr(t,s){var a=t._origin,c=t._capacity,o=gr(c),u=t._tail;return f(t._root,t._level,0);function f(t,e,r){return 0===e?function(t,e){var r=e===o?u&&u.array:t&&t.array,n=a<e?0:a-e,i=c-e;l<i&&(i=l);return function(){if(n===i)return fr;var t=s?--i:n++;return r&&r[t]}}(t,r):function(t,e,r){
|
||||
var n,i=t&&t.array,o=a<r?0:a-r>>e,u=1+(c-r>>e);l<u&&(u=l);return function(){for(;;){if(n){var t=n();if(t!==fr)return t;n=null}if(o===u)return fr;t=s?--u:o++;n=f(i&&i[t],e-d,r+(t<<e))}}}(t,e,r)}}function _r(t,e,r,n,i,o,u){var s=Object.create(sr);return s.size=e-t,s._origin=t,s._capacity=e,s._level=r,s._root=n,s._tail=i,s.__ownerID=o,s.__hash=u,s.__altered=!1,s}function pr(){return cr=cr||_r(0,0,d)}function lr(t,e,r,n,i,o){var u,s=n>>>r&g,a=t&&s<t.array.length;if(!a&&void 0===i)return t;if(0<r){var c=t&&t.array[s],n=lr(c,e,r-d,n,i,o);return n===c?t:((u=vr(t,e)).array[s]=n,u)}return a&&t.array[s]===i?t:(o&&_(o),u=vr(t,e),void 0===i&&s==u.array.length-1?u.array.pop():u.array[s]=i,u)}function vr(t,e){return e&&t&&e===t.ownerID?t:new ar(t?t.array.slice():[],e)}function yr(t,e){if(e>=gr(t._capacity))return t._tail;if(e<1<<t._level+d){for(var r=t._root,n=t._level;r&&0<n;)r=r.array[e>>>n&g],n-=d;return r}}function dr(t,e,r){void 0!==e&&(e|=0),void 0!==r&&(r|=0);var n=t.__ownerID||new m,i=t._origin,o=t._capacity,u=i+e,s=void 0===r?o:r<0?o+r:i+r;if(u===i&&s===o)return t;if(s<=u)return t.clear();for(var a=t._level,c=t._root,f=0;u+f<0;)c=new ar(c&&c.array.length?[void 0,c]:[],n),f+=1<<(a+=d);f&&(u+=f,i+=f,s+=f,o+=f);for(var h=gr(o),_=gr(s);1<<a+d<=_;)c=new ar(c&&c.array.length?[c]:[],n),a+=d;e=t._tail,r=_<h?yr(t,s-1):h<_?new ar([],n):e;if(e&&h<_&&u<o&&e.array.length){for(var p=c=vr(c,n),l=a;d<l;l-=d)var v=h>>>l&g,p=p.array[v]=vr(p.array[v],n);p.array[h>>>d&g]=e}if(s<o&&(r=r&&r.removeAfter(n,0,s)),_<=u)u-=_,s-=_,a=d,c=null,r=r&&r.removeBefore(n,0,u);else if(i<u||_<h){for(f=0;c;){var y=u>>>a&g;if(y!=_>>>a&g)break;y&&(f+=(1<<a)*y),a-=d,c=c.array[y]}c&&i<u&&(c=c.removeBefore(n,a,u-f)),c&&_<h&&(c=c.removeAfter(n,a,_-f)),f&&(u-=f,s-=f)}return t.__ownerID?(t.size=s-u,t._origin=u,t._capacity=s,t._level=a,t._root=c,t._tail=r,t.__hash=void 0,t.__altered=!0,t):_r(u,s,a,c,r)}function gr(t){return t<l?0:t-1>>>d<<d}var mr,wr=function(t){function e(e){return null==e?zr():ft(e)?e:zr().withMutations(function(r){var t=O(e);te(t.size),
|
||||
t.forEach(function(t,e){return r.set(e,t)})})}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("OrderedMap {","}")},e.prototype.get=function(t,e){t=this._map.get(t);return void 0!==t?this._list.get(t)[1]:e},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):zr()},e.prototype.set=function(t,e){return br(this,t,e)},e.prototype.remove=function(t){return br(this,t,v)},e.prototype.__iterate=function(e,t){var r=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],r)},t)},e.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?Sr(e,r,t,this.__hash):0===this.size?zr():(this.__ownerID=t,this.__altered=!1,this._map=e,this._list=r,this)},e}(Te);function Sr(t,e,r,n){var i=Object.create(wr.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function zr(){return mr=mr||Sr(Qe(),pr())}function br(t,e,r){var n,i,o=t._map,u=t._list,s=o.get(e),a=void 0!==s;if(r===v){if(!a)return t;l<=u.size&&2*o.size<=u.size?(n=(i=u.filter(function(t,e){return void 0!==t&&s!==e})).toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t.__altered=!0,t):Sr(n,i)}wr.isOrderedMap=ft,wr.prototype[k]=!0,wr.prototype[e]=wr.prototype.remove;var Ir="@@__IMMUTABLE_STACK__@@";function Or(t){return!(!t||!t[Ir])}var Er=function(i){function t(t){return null==t?Dr():Or(t)?t:Dr().pushAll(t)}return i&&(t.__proto__=i),((
|
||||
t.prototype=Object.create(i&&i.prototype)).constructor=t).of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(t,e){var r=this._head;for(t=h(this,t);r&&t--;)r=r.next;return r?r.value:e},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,r=this._head,n=arguments.length-1;0<=n;n--)r={value:t[n],next:r};return this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Mr(e,r)},t.prototype.pushAll=function(t){if(0===(t=i(t)).size)return this;if(0===this.size&&Or(t))return t;te(t.size);var e=this.size,r=this._head;return t.__iterate(function(t){e++,r={value:t,next:r}},!0),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Mr(e,r)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Dr()},t.prototype.slice=function(t,e){if(p(t,e,this.size))return this;var r=y(t,this.size);if(w(e,this.size)!==this.size)return i.prototype.slice.call(this,t,e);for(var e=this.size-r,n=this._head;r--;)n=n.next;return this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):Mr(e,n)},t.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Mr(this.size,this._head,t,this.__hash):0===this.size?Dr():(this.__ownerID=t,this.__altered=!1,this)},t.prototype.__iterate=function(r,t){var n=this;if(t)return new tt(this.toArray()).__iterate(function(t,e){return r(t,e,n)},t);for(var e=0,i=this._head;i&&!1!==r(i.value,e++,this);)i=i.next;return e},t.prototype.__iterator=function(e,t){if(t)return new tt(this.toArray()).__iterator(e,t);var r=0,n=this._head;return new P(function(){if(n){var t=n.value;return n=n.next,W(e,r++,t)}return N()})},t}(E);Er.isStack=Or;var jr,qr=Er.prototype;function Mr(t,e,r,n){
|
||||
var i=Object.create(qr);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Dr(){return jr=jr||Mr(0)}qr[Ir]=!0,qr.shift=qr.pop,qr.unshift=qr.push,qr.unshiftAll=qr.pushAll,qr.withMutations=Ae,qr.wasAltered=Ue,qr.asImmutable=Re,qr["@@transducer/init"]=qr.asMutable=ke,qr["@@transducer/step"]=function(t,e){return t.unshift(e)},qr["@@transducer/result"]=function(t){return t.asImmutable()};var xr="@@__IMMUTABLE_SET__@@";function Ar(t){return!(!t||!t[xr])}function kr(t){return Ar(t)&&R(t)}function Rr(r,t){if(r===t)return!0;if(!f(t)||void 0!==r.size&&void 0!==t.size&&r.size!==t.size||void 0!==r.__hash&&void 0!==t.__hash&&r.__hash!==t.__hash||a(r)!==a(t)||z(r)!==z(t)||R(r)!==R(t))return!1;if(0===r.size&&0===t.size)return!0;var n=!b(r);if(R(r)){var i=r.entries();return t.every(function(t,e){var r=i.next().value;return r&&_t(r[1],t)&&(n||_t(r[0],e))})&&i.next().done}var e,o=!1;void 0===r.size&&(void 0===t.size?"function"==typeof r.cacheResult&&r.cacheResult():(o=!0,e=r,r=t,t=e));var u=!0,t=t.__iterate(function(t,e){if(n?!r.has(t):o?!_t(t,r.get(e,v)):!_t(r.get(e,v),t))return u=!1});return u&&r.size===t}function Ur(e,r){function t(t){e.prototype[t]=r[t]}return Object.keys(r).forEach(t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(r).forEach(t),e}function Tr(t){if(!t||"object"!=typeof t)return t;if(!f(t)){if(!ie(t))return t;t=F(t)}if(a(t)){var r={};return t.__iterate(function(t,e){r[e]=Tr(t)}),r}var e=[];return t.__iterate(function(t){e.push(Tr(t))}),e}var Kr=function(n){function e(r){return null==r?Wr():Ar(r)&&!R(r)?r:Wr().withMutations(function(e){var t=n(r);te(t.size),t.forEach(function(t){return e.add(t)})})}return n&&(e.__proto__=n),((e.prototype=Object.create(n&&n.prototype)).constructor=e).of=function(){return this(arguments)},e.fromKeys=function(t){return this(O(t).keySeq())},e.intersect=function(t){return(t=I(t).toArray()).length?Cr.intersect.apply(e(t.pop()),t):Wr()},e.union=function(t){return(t=I(t).toArray()).length?Cr.union.apply(e(t.pop()),t):Wr()},
|
||||
e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Br(this,this._map.set(t,t))},e.prototype.remove=function(t){return Br(this,this._map.remove(t))},e.prototype.clear=function(){return Br(this,this._map.clear())},e.prototype.map=function(r,n){var i=this,o=!1,t=Br(this,this._map.mapEntries(function(t){var e=t[1],t=r.call(n,e,e,i);return t!==e&&(o=!0),[t,t]},n));return o?t:this},e.prototype.union=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return 0===(r=r.filter(function(t){return 0!==t.size})).length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations(function(e){for(var t=0;t<r.length;t++)"string"==typeof r[t]?e.add(r[t]):n(r[t]).forEach(function(t){return e.add(t)})}):this.constructor(r[0])},e.prototype.intersect=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return n(t)});var r=[];return this.forEach(function(e){t.every(function(t){return t.includes(e)})||r.push(e)}),this.withMutations(function(e){r.forEach(function(t){e.remove(t)})})},e.prototype.subtract=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return n(t)});var r=[];return this.forEach(function(e){t.some(function(t){return t.includes(e)})&&r.push(e)}),this.withMutations(function(e){r.forEach(function(t){e.remove(t)})})},e.prototype.sort=function(t){return an(Wt(this,t))},e.prototype.sortBy=function(t,e){return an(Wt(this,e,t))},e.prototype.wasAltered=function(){return this._map.wasAltered()},e.prototype.__iterate=function(e,t){var r=this;return this._map.__iterate(function(t){return e(t,t,r)},t)},e.prototype.__iterator=function(t,e){return this._map.__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):0===this.size?this.__empty():(this.__ownerID=t,this._map=e,this)},e}(j);Kr.isSet=Ar
|
||||
;var Lr,Cr=Kr.prototype;function Br(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Pr(t,e){var r=Object.create(Cr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Wr(){return Lr=Lr||Pr(Qe())}Cr[xr]=!0,Cr[e]=Cr.remove,Cr.merge=Cr.concat=Cr.union,Cr.withMutations=Ae,Cr.asImmutable=Re,Cr["@@transducer/init"]=Cr.asMutable=ke,Cr["@@transducer/step"]=function(t,e){return t.add(e)},Cr["@@transducer/result"]=function(t){return t.asImmutable()},Cr.__empty=Wr,Cr.__make=Pr;var Nr,Hr=function(t){function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);if($t(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),r=void 0===r?1:Math.abs(r),e<t&&(r=-r),this._start=t,this._end=e,this._step=r,this.size=Math.max(0,1+Math.ceil((e-t)/r-1)),0===this.size){if(Nr)return Nr;Nr=this}}return t&&(n.__proto__=t),((n.prototype=Object.create(t&&t.prototype)).constructor=n).prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},n.prototype.get=function(t,e){return this.has(t)?this._start+h(this,t)*this._step:e},n.prototype.includes=function(t){t=(t-this._start)/this._step;return 0<=t&&t<this.size&&t==Math.floor(t)},n.prototype.slice=function(t,e){return p(t,e,this.size)?this:(t=y(t,this.size),(e=w(e,this.size))<=t?new n(0,0):new n(this.get(t,this._end),this.get(e,this._end),this._step))},n.prototype.indexOf=function(t){t-=this._start;if(t%this._step==0){t=t/this._step;if(0<=t&&t<this.size)return t}return-1},n.prototype.lastIndexOf=function(t){return this.indexOf(t)},n.prototype.__iterate=function(t,e){for(var r=this.size,n=this._step,i=e?this._start+(r-1)*n:this._start,o=0;o!==r&&!1!==t(i,e?r-++o:o++,this);)i+=e?-n:n;return o},n.prototype.__iterator=function(e,r){var n=this.size,i=this._step,o=r?this._start+(n-1)*i:this._start,u=0;return new P(function(){if(u===n)return N();var t=o;return o+=r?-i:i,W(e,r?n-++u:u++,t)})},n.prototype.equals=function(t){
|
||||
return t instanceof n?this._start===t._start&&this._end===t._end&&this._step===t._step:Rr(this,t)},n}(Z);function Jr(t,e,r){for(var n=ee(e),i=0;i!==n.length;)if((t=se(t,n[i++],v))===v)return r;return t}function Vr(t,e){return Jr(this,t,e)}function Yr(t,e){return Jr(t,e,v)!==v}function Qr(){te(this.size);var r={};return this.__iterate(function(t,e){r[e]=t}),r}I.isIterable=f,I.isKeyed=a,I.isIndexed=z,I.isAssociative=b,I.isOrdered=R,I.Iterator=P,Ur(I,{toArray:function(){te(this.size);var r=Array(this.size||0),n=a(this),i=0;return this.__iterate(function(t,e){r[i++]=n?[e,t]:t}),r},toIndexedSeq:function(){return new At(this)},toJS:function(){return Tr(this)},toKeyedSeq:function(){return new xt(this,!0)},toMap:function(){return Te(this.toKeyedSeq())},toObject:Qr,toOrderedMap:function(){return wr(this.toKeyedSeq())},toOrderedSet:function(){return an(a(this)?this.valueSeq():this)},toSet:function(){return Kr(a(this)?this.valueSeq():this)},toSetSeq:function(){return new kt(this)},toSeq:function(){return z(this)?this.toIndexedSeq():a(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Er(a(this)?this.valueSeq():this)},toList:function(){return ur(a(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Vt(this,function(t,e){var r=a(t);if(0===(e=[t].concat(e).map(function(t){return f(t)?r&&(t=O(t)):t=r?ot(t):ut(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size})).length)return t;if(1===e.length){var n=e[0];if(n===t||r&&a(n)||z(t)&&z(n))return n}return n=new tt(e),r?n=n.toKeyedSeq():z(t)||(n=n.toSetSeq()),(n=n.flatten(!0)).size=e.reduce(function(t,e){if(void 0!==t){e=e.size;if(void 0!==e)return t+e}},0),n}(this,t))},includes:function(e){return this.some(function(t){return _t(t,e)})},entries:function(){return this.__iterator(K)},every:function(n,i){te(this.size);var o=!0
|
||||
;return this.__iterate(function(t,e,r){if(!n.call(i,t,e,r))return o=!1}),o},filter:function(t,e){return Vt(this,Lt(this,t,e,!0))},partition:function(t,e){return function(r,n,i){var o=a(r),u=[[],[]];r.__iterate(function(t,e){u[n.call(i,t,e,r)?1:0].push(o?[e,t]:t)});var e=Qt(r);return u.map(function(t){return Vt(r,e(t))})}(this,t,e)},find:function(t,e,r){e=this.findEntry(t,e);return e?e[1]:r},forEach:function(t,e){return te(this.size),this.__iterate(e?t.bind(e):t)},join:function(e){te(this.size),e=void 0!==e?""+e:",";var r="",n=!0;return this.__iterate(function(t){n?n=!1:r+=e,r+=null!=t?""+t:""}),r},keys:function(){return this.__iterator(U)},map:function(t,e){return Vt(this,Tt(this,t,e))},reduce:function(t,e,r){return $r(this,t,e,r,arguments.length<2,!1)},reduceRight:function(t,e,r){return $r(this,t,e,r,arguments.length<2,!0)},reverse:function(){return Vt(this,Kt(this,!0))},slice:function(t,e){return Vt(this,Ct(this,t,e,!0))},some:function(n,i){te(this.size);var o=!1;return this.__iterate(function(t,e,r){if(n.call(i,t,e,r))return!(o=!0)}),o},sort:function(t){return Vt(this,Wt(this,t))},values:function(){return this.__iterator(T)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return c(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return r=this,n=t,i=e,o=Te().asMutable(),r.__iterate(function(t,e){o.update(n.call(i,t,e,r),0,function(t){return t+1})}),o.asImmutable();var r,n,i,o},equals:function(t){return Rr(this,t)},entrySeq:function(){var t=this;if(t._cache)return new tt(t._cache);var e=t.toSeq().map(en).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(rn(t),e)},findEntry:function(n,i,t){var o=t;return this.__iterate(function(t,e,r){if(n.call(i,t,e,r))return!(o=[e,t])}),o},findKey:function(t,e){e=this.findEntry(t,e);return e&&e[0]},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},findLastEntry:function(t,e,r){
|
||||
return this.toKeyedSeq().reverse().findEntry(t,e,r)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(t){return this.find(r,null,t)},flatMap:function(t,e){return Vt(this,(n=t,i=e,o=Qt(r=this),r.toSeq().map(function(t,e){return o(n.call(i,t,e,r))}).flatten(!0)));var r,n,i,o},flatten:function(t){return Vt(this,Pt(this,t,!0))},fromEntrySeq:function(){return new Rt(this)},get:function(r,t){return this.find(function(t,e){return _t(e,r)},void 0,t)},getIn:Vr,groupBy:function(t,e){return function(n,t,i){var o=a(n),u=(R(n)?wr:Te)().asMutable();n.__iterate(function(e,r){u.update(t.call(i,e,r,n),function(t){return(t=t||[]).push(o?[r,e]:e),t})});var e=Qt(n);return u.map(function(t){return Vt(n,e(t))}).asImmutable()}(this,t,e)},has:function(t){return this.get(t,v)!==v},hasIn:function(t){return Yr(this,t)},isSubset:function(e){return e="function"==typeof e.includes?e:I(e),this.every(function(t){return e.includes(t)})},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:I(t)).isSubset(this)},keyOf:function(e){return this.findKey(function(t){return _t(t,e)})},keySeq:function(){return this.toSeq().map(tn).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Nt(this,t)},maxBy:function(t,e){return Nt(this,e,t)},min:function(t){return Nt(this,t?nn(t):un)},minBy:function(t,e){return Nt(this,e?nn(e):un,t)},rest:function(){return this.slice(1)},skip:function(t){return 0===t?this:this.slice(Math.max(0,t))},skipLast:function(t){return 0===t?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,e){return Vt(this,Bt(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(rn(t),e)},sortBy:function(t,e){return Vt(this,Wt(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,e){return Vt(this,(s=t,a=e,(e=Xt(r=this)).__iterateUncached=function(n,t){var i=this;if(t)return this.cacheResult(
|
||||
).__iterate(n,t);var o=0;return r.__iterate(function(t,e,r){return s.call(a,t,e,r)&&++o&&n(t,e,i)}),o},e.__iteratorUncached=function(n,t){var i=this;if(t)return this.cacheResult().__iterator(n,t);var o=r.__iterator(K,t),u=!0;return new P(function(){if(!u)return N();var t=o.next();if(t.done)return t;var e=t.value,r=e[0],e=e[1];return s.call(a,e,r,i)?n===K?t:W(n,r,e,t):(u=!1,N())})},e));var r,s,a},takeUntil:function(t,e){return this.takeWhile(rn(t),e)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(t){if(t.size===1/0)return 0;var e=R(t),r=a(t),n=e?1:0;return function(t,e){return e=pt(e,3432918353),e=pt(e<<15|e>>>-15,461845907),e=pt(e<<13|e>>>-13,5),e=pt((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=lt((e=pt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(r?e?function(t,e){n=31*n+sn(yt(t),yt(e))|0}:function(t,e){n=n+sn(yt(t),yt(e))|0}:e?function(t){n=31*n+yt(t)|0}:function(t){n=n+yt(t)|0}),n)}(this))}});var Xr=I.prototype;Xr[o]=!0,Xr[B]=Xr.values,Xr.toJSON=Xr.toArray,Xr.__toStringMapper=oe,Xr.inspect=Xr.toSource=function(){return""+this},Xr.chain=Xr.flatMap,Xr.contains=Xr.includes,Ur(O,{flip:function(){return Vt(this,Ut(this))},mapEntries:function(r,n){var i=this,o=0;return Vt(this,this.toSeq().map(function(t,e){return r.call(n,[e,t],o++,i)}).fromEntrySeq())},mapKeys:function(r,n){var i=this;return Vt(this,this.toSeq().flip().map(function(t,e){return r.call(n,t,e,i)}).flip())}});var Fr=O.prototype;Fr[s]=!0,Fr[B]=Xr.entries,Fr.toJSON=Qr,Fr.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Ur(E,{toKeyedSeq:function(){return new xt(this,!1)},filter:function(t,e){return Vt(this,Lt(this,t,e,!1))},findIndex:function(t,e){e=this.findEntry(t,e);return e?e[0]:-1},indexOf:function(t){t=this.keyOf(t);return void 0===t?-1:t},lastIndexOf:function(t){t=this.lastKeyOf(t);return void 0===t?-1:t},reverse:function(){return Vt(this,Kt(this,!1))},slice:function(t,e){return Vt(this,Ct(this,t,e,!1))},splice:function(t,e){
|
||||
var r=arguments.length;if(e=Math.max(e||0,0),0===r||2===r&&!e)return this;t=y(t,t<0?this.count():this.size);var n=this.slice(0,t);return Vt(this,1===r?n:n.concat(Zt(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){e=this.findLastEntry(t,e);return e?e[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Vt(this,Pt(this,t,!1))},get:function(r,t){return(r=h(this,r))<0||this.size===1/0||void 0!==this.size&&this.size<r?t:this.find(function(t,e){return e===r},void 0,t)},has:function(t){return 0<=(t=h(this,t))&&(void 0!==this.size?this.size===1/0||t<this.size:!!~this.indexOf(t))},interpose:function(t){return Vt(this,(u=t,(t=Xt(o=this)).size=o.size&&2*o.size-1,t.__iterateUncached=function(e,t){var r=this,n=0;return o.__iterate(function(t){return(!n||!1!==e(u,n++,r))&&!1!==e(t,n++,r)},t),n},t.__iteratorUncached=function(t,e){var r,n=o.__iterator(T,e),i=0;return new P(function(){return(!r||i%2)&&(r=n.next()).done?r:i%2?W(t,i++,u):W(t,i++,r.value,r)})},t));var o,u},interleave:function(){var t=[this].concat(Zt(arguments)),e=Jt(this.toSeq(),Z.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length),Vt(this,r)},keySeq:function(){return Hr(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,e){return Vt(this,Bt(this,t,e,!1))},zip:function(){var t=[this].concat(Zt(arguments));return Vt(this,Jt(this,on,t))},zipAll:function(){var t=[this].concat(Zt(arguments));return Vt(this,Jt(this,on,t,!0))},zipWith:function(t){var e=Zt(arguments);return Vt(e[0]=this,Jt(this,t,e))}});var Gr=E.prototype;Gr[S]=!0,Gr[k]=!0,Ur(j,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var Zr=j.prototype;function $r(t,n,i,o,u,e){return te(t.size),t.__iterate(function(t,e,r){i=u?(u=!1,t):n.call(o,i,t,e,r)},e),i}function tn(t,e){return e}function en(t,e){return[e,t]}function rn(t){return function(){return!t.apply(this,arguments)}}function nn(t){return function(){return-t.apply(this,arguments)}}function on(){return Zt(
|
||||
arguments)}function un(t,e){return t<e?1:e<t?-1:0}function sn(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}Zr.has=Xr.includes,Zr.contains=Zr.includes,Zr.keys=Zr.values,Ur(G,Fr),Ur(Z,Gr),Ur($,Zr);var an=function(t){function e(r){return null==r?_n():kr(r)?r:_n().withMutations(function(e){var t=j(r);te(t.size),t.forEach(function(t){return e.add(t)})})}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).of=function(){return this(arguments)},e.fromKeys=function(t){return this(O(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Kr);an.isOrderedSet=kr;var cn,fn=an.prototype;function hn(t,e){var r=Object.create(fn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function _n(){return cn=cn||hn(zr())}fn[k]=!0,fn.zip=Gr.zip,fn.zipWith=Gr.zipWith,fn.zipAll=Gr.zipAll,fn.__empty=_n,fn.__make=hn;Zr={LeftThenRight:-1,RightThenLeft:1};Gr=function(u,s){var a;!function(t){if(x(t))throw Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(A(t))throw Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(u);var c=function(t){var n=this;if(t instanceof c)return t;if(!(this instanceof c))return new c(t);if(!a){a=!0;var e=Object.keys(u),r=f._indices={};f._name=s,f._keys=e,f._defaultValues=u;for(var i=0;i<e.length;i++){var o=e[i];r[o]=i,f[o]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+vn(this)+' with property "'+o+'" since that property name is part of the Record API.'):function(t,e){try{Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){$t(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch(t){}}(f,o)}}return this.__ownerID=void 0,this._values=ur().withMutations(function(r){r.setSize(n._keys.length),O(t).forEach(
|
||||
function(t,e){r.set(n._indices[e],t===n._defaultValues[e]?void 0:t)})}),this},f=c.prototype=Object.create(pn);return f.constructor=c,s&&(c.displayName=s),c};Gr.prototype.toString=function(){for(var t,e=vn(this)+" { ",r=this._keys,n=0,i=r.length;n!==i;n++)e+=(n?", ":"")+(t=r[n])+": "+oe(this.get(t));return e+" }"},Gr.prototype.equals=function(t){return this===t||x(t)&&yn(this).equals(yn(t))},Gr.prototype.hashCode=function(){return yn(this).hashCode()},Gr.prototype.has=function(t){return this._indices.hasOwnProperty(t)},Gr.prototype.get=function(t,e){if(!this.has(t))return e;e=this._values.get(this._indices[t]);return void 0===e?this._defaultValues[t]:e},Gr.prototype.set=function(t,e){if(this.has(t)){e=this._values.set(this._indices[t],e===this._defaultValues[t]?void 0:e);if(e!==this._values&&!this.__ownerID)return ln(this,e)}return this},Gr.prototype.remove=function(t){return this.set(t)},Gr.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:ln(this,t)},Gr.prototype.wasAltered=function(){return this._values.wasAltered()},Gr.prototype.toSeq=function(){return yn(this)},Gr.prototype.toJS=function(){return Tr(this)},Gr.prototype.entries=function(){return this.__iterator(K)},Gr.prototype.__iterator=function(t,e){return yn(this).__iterator(t,e)},Gr.prototype.__iterate=function(t,e){return yn(this).__iterate(t,e)},Gr.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._values.__ensureOwner(t);return t?ln(this,e,t):(this.__ownerID=t,this._values=e,this)},Gr.isRecord=x,Gr.getDescriptiveName=vn;var pn=Gr.prototype;function ln(t,e,r){t=Object.create(Object.getPrototypeOf(t));return t._values=e,t.__ownerID=r,t}function vn(t){return t.constructor.displayName||t.constructor.name||"Record"}function yn(e){return ot(e._keys.map(function(t){return[t,e.get(t)]}))}pn[D]=!0,pn[e]=pn.remove,pn.deleteIn=pn.removeIn=ve,pn.getIn=Vr,pn.hasIn=Xr.hasIn,pn.merge=me,pn.mergeWith=we,pn.mergeIn=De,pn.mergeDeep=qe,pn.mergeDeepWith=Me,pn.mergeDeepIn=xe,
|
||||
pn.setIn=pe,pn.update=de,pn.updateIn=ge,pn.withMutations=Ae,pn.asMutable=ke,pn.asImmutable=Re,pn[B]=pn.entries,pn.toJSON=pn.toObject=Xr.toObject,pn.inspect=pn.toSource=function(){return""+this};var dn,e=function(t){function n(t,e){if(!(this instanceof n))return new n(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(dn)return dn;dn=this}}return t&&(n.__proto__=t),((n.prototype=Object.create(t&&t.prototype)).constructor=n).prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},n.prototype.get=function(t,e){return this.has(t)?this._value:e},n.prototype.includes=function(t){return _t(this._value,t)},n.prototype.slice=function(t,e){var r=this.size;return p(t,e,r)?this:new n(this._value,w(e,r)-y(t,r))},n.prototype.reverse=function(){return this},n.prototype.indexOf=function(t){return _t(this._value,t)?0:-1},n.prototype.lastIndexOf=function(t){return _t(this._value,t)?this.size:-1},n.prototype.__iterate=function(t,e){for(var r=this.size,n=0;n!==r&&!1!==t(this._value,e?r-++n:n++,this););return n},n.prototype.__iterator=function(t,e){var r=this,n=this.size,i=0;return new P(function(){return i===n?N():W(t,e?n-++i:i++,r._value)})},n.prototype.equals=function(t){return t instanceof n?_t(this._value,t._value):Rr(t)},n}(Z);function gn(t,e){return function r(n,i,o,t,u,e){if("string"!=typeof o&&!A(o)&&(X(o)||H(o)||ne(o))){if(~n.indexOf(o))throw new TypeError("Cannot convert circular structure to Immutable");n.push(o),u&&""!==t&&u.push(t);var t=i.call(e,t,F(o).map(function(t,e){return r(n,i,t,e,u,o)}),u&&u.slice());return n.pop(),u&&u.pop(),t}return o}([],e||mn,t,"",e&&2<e.length?[]:void 0,{"":t})}function mn(t,e){return z(e)?e.toList():a(e)?e.toMap():e.toSet()}B={version:"4.3.4",Collection:I,Iterable:I,Seq:F,Map:Te,OrderedMap:wr,List:ur,Stack:Er,Set:Kr,OrderedSet:an,PairSorting:Zr,Record:Gr,Range:Hr,Repeat:e,is:_t,fromJS:gn,hash:yt,isImmutable:A,isCollection:f,isKeyed:a,isIndexed:z,isAssociative:b,isOrdered:R,isValueObject:ht,
|
||||
isPlainObject:ne,isSeq:M,isList:or,isMap:ct,isOrderedMap:ft,isStack:Or,isSet:Ar,isOrderedSet:kr,isRecord:x,get:se,getIn:Jr,has:ue,hasIn:Yr,merge:ze,mergeDeep:Ie,mergeWith:be,mergeDeepWith:Oe,remove:ce,removeIn:le,set:fe,setIn:_e,update:ye,updateIn:he},Xr=I;t.Collection=I,t.Iterable=Xr,t.List=ur,t.Map=Te,t.OrderedMap=wr,t.OrderedSet=an,t.PairSorting=Zr,t.Range=Hr,t.Record=Gr,t.Repeat=e,t.Seq=F,t.Set=Kr,t.Stack=Er,t.default=B,t.fromJS=gn,t.get=se,t.getIn=Jr,t.has=ue,t.hasIn=Yr,t.hash=yt,t.is=_t,t.isAssociative=b,t.isCollection=f,t.isImmutable=A,t.isIndexed=z,t.isKeyed=a,t.isList=or,t.isMap=ct,t.isOrdered=R,t.isOrderedMap=ft,t.isOrderedSet=kr,t.isPlainObject=ne,t.isRecord=x,t.isSeq=M,t.isSet=Ar,t.isStack=Or,t.isValueObject=ht,t.merge=ze,t.mergeDeep=Ie,t.mergeDeepWith=Oe,t.mergeWith=be,t.remove=ce,t.removeIn=le,t.set=fe,t.setIn=_e,t.update=ye,t.updateIn=he,t.version="4.3.4",Object.defineProperty(t,"__esModule",{value:!0})});
|
||||
42
node_modules/.store/sass@1.69.5/node_modules/immutable/package.json
generated
vendored
Normal file
42
node_modules/.store/sass@1.69.5/node_modules/immutable/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "immutable",
|
||||
"version": "4.3.4",
|
||||
"description": "Immutable Data Collections",
|
||||
"license": "MIT",
|
||||
"homepage": "https://immutable-js.com",
|
||||
"author": {
|
||||
"name": "Lee Byron",
|
||||
"url": "https://github.com/leebyron"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/immutable-js/immutable-js.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/immutable-js/immutable-js/issues"
|
||||
},
|
||||
"main": "dist/immutable.js",
|
||||
"module": "dist/immutable.es.js",
|
||||
"sideEffects": false,
|
||||
"types": "dist/immutable.d.ts",
|
||||
"files": [
|
||||
"dist",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"keywords": [
|
||||
"immutable",
|
||||
"persistent",
|
||||
"lazy",
|
||||
"data",
|
||||
"datastructure",
|
||||
"functional",
|
||||
"collection",
|
||||
"stateless",
|
||||
"sequence",
|
||||
"iteration"
|
||||
],
|
||||
"__npminstall_done": true,
|
||||
"_from": "immutable@4.3.4",
|
||||
"_resolved": "https://registry.npmmirror.com/immutable/-/immutable-4.3.4.tgz"
|
||||
}
|
||||
1596
node_modules/.store/sass@1.69.5/node_modules/sass/LICENSE
generated
vendored
Normal file
1596
node_modules/.store/sass@1.69.5/node_modules/sass/LICENSE
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
173
node_modules/.store/sass@1.69.5/node_modules/sass/README.md
generated
vendored
Normal file
173
node_modules/.store/sass@1.69.5/node_modules/sass/README.md
generated
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
A pure JavaScript implementation of [Sass][sass]. **Sass makes CSS fun again**.
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<img width="118px" alt="Sass logo" src="https://rawgit.com/sass/sass-site/master/source/assets/img/logos/logo.svg" />
|
||||
</td>
|
||||
<td valign="middle">
|
||||
<a href="https://www.npmjs.com/package/sass"><img width="100%" alt="npm statistics" src="https://nodei.co/npm/sass.png?downloads=true"></a>
|
||||
</td>
|
||||
<td valign="middle">
|
||||
<a href="https://github.com/sass/dart-sass/actions"><img alt="GitHub actions build status" src="https://github.com/sass/dart-sass/workflows/CI/badge.svg"></a>
|
||||
<br>
|
||||
<a href="https://ci.appveyor.com/project/nex3/dart-sass"><img alt="Appveyor build status" src="https://ci.appveyor.com/api/projects/status/84rl9hvu8uoecgef?svg=true"></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
[sass]: https://sass-lang.com/
|
||||
|
||||
This package is a distribution of [Dart Sass][], compiled to pure JavaScript
|
||||
with no native code or external dependencies. It provides a command-line `sass`
|
||||
executable and a Node.js API.
|
||||
|
||||
[Dart Sass]: https://github.com/sass/dart-sass
|
||||
|
||||
* [Usage](#usage)
|
||||
* [See Also](#see-also)
|
||||
* [Behavioral Differences from Ruby Sass](#behavioral-differences-from-ruby-sass)
|
||||
|
||||
## Usage
|
||||
|
||||
You can install Sass globally using `npm install -g sass` which will provide
|
||||
access to the `sass` executable. You can also add it to your project using
|
||||
`npm install --save-dev sass`. This provides the executable as well as a
|
||||
library:
|
||||
|
||||
[npm]: https://www.npmjs.com/package/sass
|
||||
|
||||
```js
|
||||
const sass = require('sass');
|
||||
|
||||
const result = sass.compile(scssFilename);
|
||||
|
||||
// OR
|
||||
|
||||
// Note that `compileAsync()` is substantially slower than `compile()`.
|
||||
const result = await sass.compileAsync(scssFilename);
|
||||
```
|
||||
|
||||
See [the Sass website][js api] for full API documentation.
|
||||
|
||||
[js api]: https://sass-lang.com/documentation/js-api
|
||||
|
||||
### Legacy API
|
||||
|
||||
Dart Sass also supports an older JavaScript API that's fully compatible with
|
||||
[Node Sass] (with a few exceptions listed below), with support for both the
|
||||
[`render()`] and [`renderSync()`] functions. This API is considered deprecated
|
||||
and will be removed in Dart Sass 2.0.0, so it should be avoided in new projects.
|
||||
|
||||
[Node Sass]: https://github.com/sass/node-sass
|
||||
[`render()`]: https://sass-lang.com/documentation/js-api/functions/render
|
||||
[`renderSync()`]: https://sass-lang.com/documentation/js-api/functions/renderSync
|
||||
|
||||
Sass's support for the legacy JavaScript API has the following limitations:
|
||||
|
||||
* Only the `"expanded"` and `"compressed"` values of [`outputStyle`] are
|
||||
supported.
|
||||
|
||||
* Dart Sass doesn't support the [`precision`] option. Dart Sass defaults to a
|
||||
sufficiently high precision for all existing browsers, and making this
|
||||
customizable would make the code substantially less efficient.
|
||||
|
||||
* Dart Sass doesn't support the [`sourceComments`] option. Source maps are the
|
||||
recommended way of locating the origin of generated selectors.
|
||||
|
||||
[`outputStyle`]: https://sass-lang.com/documentation/js-api/interfaces/LegacySharedOptions#outputStyle
|
||||
[`precision`]: https://github.com/sass/node-sass#precision
|
||||
[`sourceComments`]: https://github.com/sass/node-sass#sourcecomments
|
||||
|
||||
## See Also
|
||||
|
||||
* [Dart Sass][], from which this package is compiled, can be used either as a
|
||||
stand-alone executable or as a Dart library. Running Dart Sass on the Dart VM
|
||||
is substantially faster than running the pure JavaScript version, so this may
|
||||
be appropriate for performance-sensitive applications. The Dart API is also
|
||||
(currently) more user-friendly than the JavaScript API. See
|
||||
[the Dart Sass README][Using Dart Sass] for details on how to use it.
|
||||
|
||||
* [Node Sass][], which is a wrapper around [LibSass][], the C++ implementation
|
||||
of Sass. Node Sass supports the same API as this package and is also faster
|
||||
(although it's usually a little slower than Dart Sass). However, it requires a
|
||||
native library which may be difficult to install, and it's generally slower to
|
||||
add features and fix bugs.
|
||||
|
||||
[Using Dart Sass]: https://github.com/sass/dart-sass#using-dart-sass
|
||||
[Node Sass]: https://www.npmjs.com/package/node-sass
|
||||
[LibSass]: https://sass-lang.com/libsass
|
||||
|
||||
## Behavioral Differences from Ruby Sass
|
||||
|
||||
There are a few intentional behavioral differences between Dart Sass and Ruby
|
||||
Sass. These are generally places where Ruby Sass has an undesired behavior, and
|
||||
it's substantially easier to implement the correct behavior than it would be to
|
||||
implement compatible behavior. These should all have tracking bugs against Ruby
|
||||
Sass to update the reference behavior.
|
||||
|
||||
1. `@extend` only accepts simple selectors, as does the second argument of
|
||||
`selector-extend()`. See [issue 1599][].
|
||||
|
||||
2. Subject selectors are not supported. See [issue 1126][].
|
||||
|
||||
3. Pseudo selector arguments are parsed as `<declaration-value>`s rather than
|
||||
having a more limited custom parsing. See [issue 2120][].
|
||||
|
||||
4. The numeric precision is set to 10. See [issue 1122][].
|
||||
|
||||
5. The indented syntax parser is more flexible: it doesn't require consistent
|
||||
indentation across the whole document. See [issue 2176][].
|
||||
|
||||
6. Colors do not support channel-by-channel arithmetic. See [issue 2144][].
|
||||
|
||||
7. Unitless numbers aren't `==` to unit numbers with the same value. In
|
||||
addition, map keys follow the same logic as `==`-equality. See
|
||||
[issue 1496][].
|
||||
|
||||
8. `rgba()` and `hsla()` alpha values with percentage units are interpreted as
|
||||
percentages. Other units are forbidden. See [issue 1525][].
|
||||
|
||||
9. Too many variable arguments passed to a function is an error. See
|
||||
[issue 1408][].
|
||||
|
||||
10. Allow `@extend` to reach outside a media query if there's an identical
|
||||
`@extend` defined outside that query. This isn't tracked explicitly, because
|
||||
it'll be irrelevant when [issue 1050][] is fixed.
|
||||
|
||||
11. Some selector pseudos containing placeholder selectors will be compiled
|
||||
where they wouldn't be in Ruby Sass. This better matches the semantics of
|
||||
the selectors in question, and is more efficient. See [issue 2228][].
|
||||
|
||||
12. The old-style `:property value` syntax is not supported in the indented
|
||||
syntax. See [issue 2245][].
|
||||
|
||||
13. The reference combinator is not supported. See [issue 303][].
|
||||
|
||||
14. Universal selector unification is symmetrical. See [issue 2247][].
|
||||
|
||||
15. `@extend` doesn't produce an error if it matches but fails to unify. See
|
||||
[issue 2250][].
|
||||
|
||||
16. Dart Sass currently only supports UTF-8 documents. We'd like to support
|
||||
more, but Dart currently doesn't support them. See [dart-lang/sdk#11744][],
|
||||
for example.
|
||||
|
||||
[issue 1599]: https://github.com/sass/sass/issues/1599
|
||||
[issue 1126]: https://github.com/sass/sass/issues/1126
|
||||
[issue 2120]: https://github.com/sass/sass/issues/2120
|
||||
[issue 1122]: https://github.com/sass/sass/issues/1122
|
||||
[issue 2176]: https://github.com/sass/sass/issues/2176
|
||||
[issue 2144]: https://github.com/sass/sass/issues/2144
|
||||
[issue 1496]: https://github.com/sass/sass/issues/1496
|
||||
[issue 1525]: https://github.com/sass/sass/issues/1525
|
||||
[issue 1408]: https://github.com/sass/sass/issues/1408
|
||||
[issue 1050]: https://github.com/sass/sass/issues/1050
|
||||
[issue 2228]: https://github.com/sass/sass/issues/2228
|
||||
[issue 2245]: https://github.com/sass/sass/issues/2245
|
||||
[issue 303]: https://github.com/sass/sass/issues/303
|
||||
[issue 2247]: https://github.com/sass/sass/issues/2247
|
||||
[issue 2250]: https://github.com/sass/sass/issues/2250
|
||||
[dart-lang/sdk#11744]: https://github.com/dart-lang/sdk/issues/11744
|
||||
|
||||
Disclaimer: this is not an official Google product.
|
||||
51
node_modules/.store/sass@1.69.5/node_modules/sass/package.json
generated
vendored
Normal file
51
node_modules/.store/sass@1.69.5/node_modules/sass/package.json
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "sass",
|
||||
"description": "A pure JavaScript implementation of Sass.",
|
||||
"license": "MIT",
|
||||
"bugs": "https://github.com/sass/dart-sass/issues",
|
||||
"homepage": "https://github.com/sass/dart-sass",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sass/dart-sass"
|
||||
},
|
||||
"author": {
|
||||
"name": "Natalie Weizenbaum",
|
||||
"email": "nweiz@google.com",
|
||||
"url": "https://github.com/nex3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"chokidar": ">=3.0.0 <4.0.0",
|
||||
"immutable": "^4.0.0",
|
||||
"source-map-js": ">=0.6.2 <2.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"style",
|
||||
"scss",
|
||||
"sass",
|
||||
"preprocessor",
|
||||
"css"
|
||||
],
|
||||
"types": "types/index.d.ts",
|
||||
"exports": {
|
||||
"types": "./types/index.d.ts",
|
||||
"node": {
|
||||
"require": "./sass.node.js",
|
||||
"default": "./sass.node.mjs"
|
||||
},
|
||||
"default": {
|
||||
"require": "./sass.default.cjs",
|
||||
"default": "./sass.default.js"
|
||||
}
|
||||
},
|
||||
"version": "1.69.5",
|
||||
"bin": {
|
||||
"sass": "sass.js"
|
||||
},
|
||||
"main": "sass.node.js",
|
||||
"__npminstall_done": true,
|
||||
"_from": "sass@1.69.5",
|
||||
"_resolved": "https://registry.npmmirror.com/sass/-/sass-1.69.5.tgz"
|
||||
}
|
||||
117910
node_modules/.store/sass@1.69.5/node_modules/sass/sass.dart.js
generated
vendored
Normal file
117910
node_modules/.store/sass@1.69.5/node_modules/sass/sass.dart.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
8
node_modules/.store/sass@1.69.5/node_modules/sass/sass.default.cjs
generated
vendored
Normal file
8
node_modules/.store/sass@1.69.5/node_modules/sass/sass.default.cjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
require('./sass.dart.js');
|
||||
const library = globalThis._cliPkgExports.pop();
|
||||
if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports;
|
||||
library.load({
|
||||
immutable: require("immutable"),
|
||||
});
|
||||
|
||||
module.exports = library;
|
||||
40
node_modules/.store/sass@1.69.5/node_modules/sass/sass.default.js
generated
vendored
Normal file
40
node_modules/.store/sass@1.69.5/node_modules/sass/sass.default.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import * as immutable from "immutable"
|
||||
import "./sass.dart.js";
|
||||
|
||||
const _cliPkgLibrary = globalThis._cliPkgExports.pop();
|
||||
if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports;
|
||||
const _cliPkgExports = {};
|
||||
_cliPkgLibrary.load({immutable}, _cliPkgExports);
|
||||
|
||||
export const compile = _cliPkgExports.compile;
|
||||
export const compileAsync = _cliPkgExports.compileAsync;
|
||||
export const compileString = _cliPkgExports.compileString;
|
||||
export const compileStringAsync = _cliPkgExports.compileStringAsync;
|
||||
export const Logger = _cliPkgExports.Logger;
|
||||
export const SassArgumentList = _cliPkgExports.SassArgumentList;
|
||||
export const SassBoolean = _cliPkgExports.SassBoolean;
|
||||
export const SassCalculation = _cliPkgExports.SassCalculation;
|
||||
export const CalculationOperation = _cliPkgExports.CalculationOperation;
|
||||
export const CalculationInterpolation = _cliPkgExports.CalculationInterpolation;
|
||||
export const SassColor = _cliPkgExports.SassColor;
|
||||
export const SassFunction = _cliPkgExports.SassFunction;
|
||||
export const SassList = _cliPkgExports.SassList;
|
||||
export const SassMap = _cliPkgExports.SassMap;
|
||||
export const SassMixin = _cliPkgExports.SassMixin;
|
||||
export const SassNumber = _cliPkgExports.SassNumber;
|
||||
export const SassString = _cliPkgExports.SassString;
|
||||
export const Value = _cliPkgExports.Value;
|
||||
export const CustomFunction = _cliPkgExports.CustomFunction;
|
||||
export const ListSeparator = _cliPkgExports.ListSeparator;
|
||||
export const sassFalse = _cliPkgExports.sassFalse;
|
||||
export const sassNull = _cliPkgExports.sassNull;
|
||||
export const sassTrue = _cliPkgExports.sassTrue;
|
||||
export const Exception = _cliPkgExports.Exception;
|
||||
export const PromiseOr = _cliPkgExports.PromiseOr;
|
||||
export const info = _cliPkgExports.info;
|
||||
export const render = _cliPkgExports.render;
|
||||
export const renderSync = _cliPkgExports.renderSync;
|
||||
export const TRUE = _cliPkgExports.TRUE;
|
||||
export const FALSE = _cliPkgExports.FALSE;
|
||||
export const NULL = _cliPkgExports.NULL;
|
||||
export const types = _cliPkgExports.types;
|
||||
16
node_modules/.store/sass@1.69.5/node_modules/sass/sass.js
generated
vendored
Normal file
16
node_modules/.store/sass@1.69.5/node_modules/sass/sass.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
require('./sass.dart.js');
|
||||
var library = globalThis._cliPkgExports.pop();
|
||||
if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports;
|
||||
|
||||
library.load({
|
||||
readline: require("readline"),
|
||||
chokidar: require("chokidar"),
|
||||
util: require("util"),
|
||||
stream: require("stream"),
|
||||
fs: require("fs"),
|
||||
immutable: require("immutable"),
|
||||
});
|
||||
|
||||
library.cli_pkg_main_0_(process.argv.slice(2));
|
||||
11
node_modules/.store/sass@1.69.5/node_modules/sass/sass.node.js
generated
vendored
Normal file
11
node_modules/.store/sass@1.69.5/node_modules/sass/sass.node.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
require('./sass.dart.js');
|
||||
const library = globalThis._cliPkgExports.pop();
|
||||
if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports;
|
||||
library.load({
|
||||
util: require("util"),
|
||||
stream: require("stream"),
|
||||
fs: require("fs"),
|
||||
immutable: require("immutable"),
|
||||
});
|
||||
|
||||
module.exports = library;
|
||||
174
node_modules/.store/sass@1.69.5/node_modules/sass/sass.node.mjs
generated
vendored
Normal file
174
node_modules/.store/sass@1.69.5/node_modules/sass/sass.node.mjs
generated
vendored
Normal file
@@ -0,0 +1,174 @@
|
||||
import cjs from "./sass.node.js";
|
||||
|
||||
export const compile = cjs.compile;
|
||||
export const compileAsync = cjs.compileAsync;
|
||||
export const compileString = cjs.compileString;
|
||||
export const compileStringAsync = cjs.compileStringAsync;
|
||||
export const Logger = cjs.Logger;
|
||||
export const SassArgumentList = cjs.SassArgumentList;
|
||||
export const SassBoolean = cjs.SassBoolean;
|
||||
export const SassCalculation = cjs.SassCalculation;
|
||||
export const CalculationOperation = cjs.CalculationOperation;
|
||||
export const CalculationInterpolation = cjs.CalculationInterpolation;
|
||||
export const SassColor = cjs.SassColor;
|
||||
export const SassFunction = cjs.SassFunction;
|
||||
export const SassList = cjs.SassList;
|
||||
export const SassMap = cjs.SassMap;
|
||||
export const SassMixin = cjs.SassMixin;
|
||||
export const SassNumber = cjs.SassNumber;
|
||||
export const SassString = cjs.SassString;
|
||||
export const Value = cjs.Value;
|
||||
export const CustomFunction = cjs.CustomFunction;
|
||||
export const ListSeparator = cjs.ListSeparator;
|
||||
export const sassFalse = cjs.sassFalse;
|
||||
export const sassNull = cjs.sassNull;
|
||||
export const sassTrue = cjs.sassTrue;
|
||||
export const Exception = cjs.Exception;
|
||||
export const PromiseOr = cjs.PromiseOr;
|
||||
export const info = cjs.info;
|
||||
export const render = cjs.render;
|
||||
export const renderSync = cjs.renderSync;
|
||||
export const TRUE = cjs.TRUE;
|
||||
export const FALSE = cjs.FALSE;
|
||||
export const NULL = cjs.NULL;
|
||||
export const types = cjs.types;
|
||||
|
||||
let printedDefaultExportDeprecation = false;
|
||||
function defaultExportDeprecation() {
|
||||
if (printedDefaultExportDeprecation) return;
|
||||
printedDefaultExportDeprecation = true;
|
||||
console.error(
|
||||
"`import sass from 'sass'` is deprecated.\n" +
|
||||
"Please use `import * as sass from 'sass'` instead.");
|
||||
}
|
||||
|
||||
export default {
|
||||
get compile() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.compile;
|
||||
},
|
||||
get compileAsync() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.compileAsync;
|
||||
},
|
||||
get compileString() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.compileString;
|
||||
},
|
||||
get compileStringAsync() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.compileStringAsync;
|
||||
},
|
||||
get Logger() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.Logger;
|
||||
},
|
||||
get SassArgumentList() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.SassArgumentList;
|
||||
},
|
||||
get SassBoolean() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.SassBoolean;
|
||||
},
|
||||
get SassCalculation() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.SassCalculation;
|
||||
},
|
||||
get CalculationOperation() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.CalculationOperation;
|
||||
},
|
||||
get CalculationInterpolation() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.CalculationInterpolation;
|
||||
},
|
||||
get SassColor() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.SassColor;
|
||||
},
|
||||
get SassFunction() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.SassFunction;
|
||||
},
|
||||
get SassList() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.SassList;
|
||||
},
|
||||
get SassMap() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.SassMap;
|
||||
},
|
||||
get SassMixin() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.SassMixin;
|
||||
},
|
||||
get SassNumber() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.SassNumber;
|
||||
},
|
||||
get SassString() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.SassString;
|
||||
},
|
||||
get Value() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.Value;
|
||||
},
|
||||
get CustomFunction() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.CustomFunction;
|
||||
},
|
||||
get ListSeparator() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.ListSeparator;
|
||||
},
|
||||
get sassFalse() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.sassFalse;
|
||||
},
|
||||
get sassNull() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.sassNull;
|
||||
},
|
||||
get sassTrue() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.sassTrue;
|
||||
},
|
||||
get Exception() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.Exception;
|
||||
},
|
||||
get PromiseOr() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.PromiseOr;
|
||||
},
|
||||
get info() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.info;
|
||||
},
|
||||
get render() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.render;
|
||||
},
|
||||
get renderSync() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.renderSync;
|
||||
},
|
||||
get TRUE() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.TRUE;
|
||||
},
|
||||
get FALSE() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.FALSE;
|
||||
},
|
||||
get NULL() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.NULL;
|
||||
},
|
||||
get types() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.types;
|
||||
},
|
||||
};
|
||||
164
node_modules/.store/sass@1.69.5/node_modules/sass/types/compile.d.ts
generated
vendored
Normal file
164
node_modules/.store/sass@1.69.5/node_modules/sass/types/compile.d.ts
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
import {RawSourceMap} from 'source-map-js';
|
||||
|
||||
import {Options, StringOptions} from './options';
|
||||
|
||||
/**
|
||||
* The result of compiling Sass to CSS. Returned by {@link compile}, {@link
|
||||
* compileAsync}, {@link compileString}, and {@link compileStringAsync}.
|
||||
*
|
||||
* @category Compile
|
||||
*/
|
||||
export interface CompileResult {
|
||||
/**
|
||||
* The generated CSS.
|
||||
*
|
||||
* Note that this *never* includes a `sourceMapUrl` comment—it's up to the
|
||||
* caller to determine where to save the source map and how to link to it from
|
||||
* the stylesheet.
|
||||
*/
|
||||
css: string;
|
||||
|
||||
/**
|
||||
* The canonical URLs of all the stylesheets that were loaded during the
|
||||
* Sass compilation. The order of these URLs is not guaranteed.
|
||||
*/
|
||||
loadedUrls: URL[];
|
||||
|
||||
/**
|
||||
* The object representation of the source map that maps locations in the
|
||||
* generated CSS back to locations in the Sass source code.
|
||||
*
|
||||
* This typically uses absolute `file:` URLs to refer to Sass files, although
|
||||
* this can be controlled by having a custom {@link Importer} return {@link
|
||||
* ImporterResult.sourceMapUrl}.
|
||||
*
|
||||
* This is set if and only if {@link Options.sourceMap} is `true`.
|
||||
*/
|
||||
sourceMap?: RawSourceMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronously compiles the Sass file at `path` to CSS. If it succeeds it
|
||||
* returns a {@link CompileResult}, and if it fails it throws an {@link
|
||||
* Exception}.
|
||||
*
|
||||
* This only allows synchronous {@link Importer}s and {@link CustomFunction}s.
|
||||
*
|
||||
* **Heads up!** When using the `sass-embedded` npm package,
|
||||
* **{@link compileAsync} is almost always faster than {@link compile}**, due to
|
||||
* the overhead of emulating synchronous messaging with worker threads and
|
||||
* concurrent compilations being blocked on main thread.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const sass = require('sass');
|
||||
*
|
||||
* const result = sass.compile("style.scss");
|
||||
* console.log(result.css);
|
||||
* ```
|
||||
*
|
||||
* @category Compile
|
||||
* @compatibility dart: "1.45.0", node: false
|
||||
*/
|
||||
export function compile(path: string, options?: Options<'sync'>): CompileResult;
|
||||
|
||||
/**
|
||||
* Asynchronously compiles the Sass file at `path` to CSS. Returns a promise
|
||||
* that resolves with a {@link CompileResult} if it succeeds and rejects with an
|
||||
* {@link Exception} if it fails.
|
||||
*
|
||||
* This only allows synchronous or asynchronous {@link Importer}s and
|
||||
* {@link CustomFunction}s.
|
||||
*
|
||||
* **Heads up!** When using the `sass` npm package, **{@link compile} is almost
|
||||
* twice as fast as {@link compileAsync}**, due to the overhead of making the
|
||||
* entire evaluation process asynchronous.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const sass = require('sass');
|
||||
*
|
||||
* const result = await sass.compileAsync("style.scss");
|
||||
* console.log(result.css);
|
||||
* ```
|
||||
*
|
||||
* @category Compile
|
||||
* @compatibility dart: "1.45.0", node: false
|
||||
*/
|
||||
export function compileAsync(
|
||||
path: string,
|
||||
options?: Options<'async'>
|
||||
): Promise<CompileResult>;
|
||||
|
||||
/**
|
||||
* Synchronously compiles a stylesheet whose contents is `source` to CSS. If it
|
||||
* succeeds it returns a {@link CompileResult}, and if it fails it throws an
|
||||
* {@link Exception}.
|
||||
*
|
||||
* This only allows synchronous {@link Importer}s and {@link CustomFunction}s.
|
||||
*
|
||||
* **Heads up!** When using the `sass-embedded` npm package,
|
||||
* **{@link compileStringAsync} is almost always faster than
|
||||
* {@link compileString}**, due to the overhead of emulating synchronous
|
||||
* messaging with worker threads and concurrent compilations being blocked on
|
||||
* main thread.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const sass = require('sass');
|
||||
*
|
||||
* const result = sass.compileString(`
|
||||
* h1 {
|
||||
* font-size: 40px;
|
||||
* code {
|
||||
* font-face: Roboto Mono;
|
||||
* }
|
||||
* }`);
|
||||
* console.log(result.css);
|
||||
* ```
|
||||
*
|
||||
* @category Compile
|
||||
* @compatibility dart: "1.45.0", node: false
|
||||
*/
|
||||
export function compileString(
|
||||
source: string,
|
||||
options?: StringOptions<'sync'>
|
||||
): CompileResult;
|
||||
|
||||
/**
|
||||
* Asynchronously compiles a stylesheet whose contents is `source` to CSS.
|
||||
* Returns a promise that resolves with a {@link CompileResult} if it succeeds
|
||||
* and rejects with an {@link Exception} if it fails.
|
||||
*
|
||||
* This only allows synchronous or asynchronous {@link Importer}s and {@link
|
||||
* CustomFunction}s.
|
||||
*
|
||||
* **Heads up!** When using the `sass` npm package, **{@link compileString} is
|
||||
* almost twice as fast as {@link compileStringAsync}**, due to the overhead
|
||||
* of making the entire evaluation process asynchronous.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const sass = require('sass');
|
||||
*
|
||||
* const result = await sass.compileStringAsync(`
|
||||
* h1 {
|
||||
* font-size: 40px;
|
||||
* code {
|
||||
* font-face: Roboto Mono;
|
||||
* }
|
||||
* }`);
|
||||
* console.log(result.css);
|
||||
* ```
|
||||
*
|
||||
* @category Compile
|
||||
* @compatibility dart: "1.45.0", node: false
|
||||
*/
|
||||
export function compileStringAsync(
|
||||
source: string,
|
||||
options?: StringOptions<'async'>
|
||||
): Promise<CompileResult>;
|
||||
41
node_modules/.store/sass@1.69.5/node_modules/sass/types/exception.d.ts
generated
vendored
Normal file
41
node_modules/.store/sass@1.69.5/node_modules/sass/types/exception.d.ts
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import {SourceSpan} from './logger';
|
||||
|
||||
/**
|
||||
* An exception thrown because a Sass compilation failed.
|
||||
*
|
||||
* @category Other
|
||||
*/
|
||||
export class Exception extends Error {
|
||||
private constructor();
|
||||
|
||||
/**
|
||||
* A human-friendly representation of the exception.
|
||||
*
|
||||
* Because many tools simply print `Error.message` directly, this includes not
|
||||
* only the textual description of what went wrong (the {@link sassMessage})
|
||||
* but also an indication of where in the Sass stylesheet the error occurred
|
||||
* (the {@link span}) and the Sass stack trace at the point of error (the
|
||||
* {@link sassStack}).
|
||||
*/
|
||||
message: string;
|
||||
|
||||
/**
|
||||
* A textual description of what went wrong.
|
||||
*
|
||||
* Unlike {@link message}, this does *not* include representations of {@link
|
||||
* span} or {@link sassStack}.
|
||||
*/
|
||||
readonly sassMessage: string;
|
||||
|
||||
/**
|
||||
* A human-friendly representation of the Sass stack trace at the point of
|
||||
* error.
|
||||
*/
|
||||
readonly sassStack: string;
|
||||
|
||||
/** The location the error occurred in the Sass file that triggered it. */
|
||||
readonly span: SourceSpan;
|
||||
|
||||
/** Returns the same string as {@link message}. */
|
||||
toString(): string;
|
||||
}
|
||||
332
node_modules/.store/sass@1.69.5/node_modules/sass/types/importer.d.ts
generated
vendored
Normal file
332
node_modules/.store/sass@1.69.5/node_modules/sass/types/importer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,332 @@
|
||||
import {Syntax} from './options';
|
||||
import {PromiseOr} from './util/promise_or';
|
||||
|
||||
/**
|
||||
* Contextual information passed to {@link Importer.canonicalize} and {@link
|
||||
* FileImporter.findFileUrl}. Not all importers will need this information to
|
||||
* resolve loads, but some may find it useful.
|
||||
*/
|
||||
export interface CanonicalizeContext {
|
||||
/**
|
||||
* Whether this is being invoked because of a Sass
|
||||
* `@import` rule, as opposed to a `@use` or `@forward` rule.
|
||||
*
|
||||
* This should *only* be used for determining whether or not to load
|
||||
* [import-only files](https://sass-lang.com/documentation/at-rules/import#import-only-files).
|
||||
*/
|
||||
fromImport: boolean;
|
||||
|
||||
/**
|
||||
* The canonical URL of the file that contains the load, if that information
|
||||
* is available.
|
||||
*
|
||||
* For an {@link Importer}, this is only passed when the `url` parameter is a
|
||||
* relative URL _or_ when its [URL scheme] is included in {@link
|
||||
* Importer.nonCanonicalScheme}. This ensures that canonical URLs are always
|
||||
* resolved the same way regardless of context.
|
||||
*
|
||||
* [URL scheme]: https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL#scheme
|
||||
*
|
||||
* For a {@link FileImporter}, this is always available as long as Sass knows
|
||||
* the canonical URL of the containing file.
|
||||
*/
|
||||
containingUrl: URL | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* A special type of importer that redirects all loads to existing files on
|
||||
* disk. Although this is less powerful than a full {@link Importer}, it
|
||||
* automatically takes care of Sass features like resolving partials and file
|
||||
* extensions and of loading the file from disk.
|
||||
*
|
||||
* Like all importers, this implements custom Sass loading logic for [`@use`
|
||||
* rules](https://sass-lang.com/documentation/at-rules/use) and [`@import`
|
||||
* rules](https://sass-lang.com/documentation/at-rules/import). It can be passed
|
||||
* to {@link Options.importers} or {@link StringOptionsWithImporter.importer}.
|
||||
*
|
||||
* @typeParam sync - A `FileImporter<'sync'>`'s {@link findFileUrl} must return
|
||||
* synchronously, but in return it can be passed to {@link compile} and {@link
|
||||
* compileString} in addition to {@link compileAsync} and {@link
|
||||
* compileStringAsync}.
|
||||
*
|
||||
* A `FileImporter<'async'>`'s {@link findFileUrl} may either return
|
||||
* synchronously or asynchronously, but it can only be used with {@link
|
||||
* compileAsync} and {@link compileStringAsync}.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const {pathToFileURL} = require('url');
|
||||
*
|
||||
* sass.compile('style.scss', {
|
||||
* importers: [{
|
||||
* // An importer that redirects relative URLs starting with "~" to
|
||||
* // `node_modules`.
|
||||
* findFileUrl(url) {
|
||||
* if (!url.startsWith('~')) return null;
|
||||
* return new URL(url.substring(1), pathToFileURL('node_modules'));
|
||||
* }
|
||||
* }]
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @category Importer
|
||||
*/
|
||||
export interface FileImporter<
|
||||
sync extends 'sync' | 'async' = 'sync' | 'async'
|
||||
> {
|
||||
/**
|
||||
* A callback that's called to partially resolve a load (such as
|
||||
* [`@use`](https://sass-lang.com/documentation/at-rules/use) or
|
||||
* [`@import`](https://sass-lang.com/documentation/at-rules/import)) to a file
|
||||
* on disk.
|
||||
*
|
||||
* Unlike an {@link Importer}, the compiler will automatically handle relative
|
||||
* loads for a {@link FileImporter}. See {@link Options.importers} for more
|
||||
* details on the way loads are resolved.
|
||||
*
|
||||
* @param url - The loaded URL. Since this might be relative, it's represented
|
||||
* as a string rather than a {@link URL} object.
|
||||
*
|
||||
* @returns An absolute `file:` URL if this importer recognizes the `url`.
|
||||
* This may be only partially resolved: the compiler will automatically look
|
||||
* for [partials](https://sass-lang.com/documentation/at-rules/use#partials),
|
||||
* [index files](https://sass-lang.com/documentation/at-rules/use#index-files),
|
||||
* and file extensions based on the returned URL. An importer may also return
|
||||
* a fully resolved URL if it so chooses.
|
||||
*
|
||||
* If this importer doesn't recognize the URL, it should return `null` instead
|
||||
* to allow other importers or {@link Options.loadPaths | load paths} to
|
||||
* handle it.
|
||||
*
|
||||
* This may also return a `Promise`, but if it does the importer may only be
|
||||
* passed to {@link compileAsync} and {@link compileStringAsync}, not {@link
|
||||
* compile} or {@link compileString}.
|
||||
*
|
||||
* @throws any - If this importer recognizes `url` but determines that it's
|
||||
* invalid, it may throw an exception that will be wrapped by Sass. If the
|
||||
* exception object has a `message` property, it will be used as the wrapped
|
||||
* exception's message; otherwise, the exception object's `toString()` will be
|
||||
* used. This means it's safe for importers to throw plain strings.
|
||||
*/
|
||||
findFileUrl(
|
||||
url: string,
|
||||
context: CanonicalizeContext
|
||||
): PromiseOr<URL | null, sync>;
|
||||
|
||||
/** @hidden */
|
||||
canonicalize?: never;
|
||||
}
|
||||
|
||||
/**
|
||||
* An object that implements custom Sass loading logic for [`@use`
|
||||
* rules](https://sass-lang.com/documentation/at-rules/use) and [`@import`
|
||||
* rules](https://sass-lang.com/documentation/at-rules/import). It can be passed
|
||||
* to {@link Options.importers} or {@link StringOptionsWithImporter.importer}.
|
||||
*
|
||||
* Importers that simply redirect to files on disk are encouraged to use the
|
||||
* {@link FileImporter} interface instead.
|
||||
*
|
||||
* ### Resolving a Load
|
||||
*
|
||||
* This is the process of resolving a load using a custom importer:
|
||||
*
|
||||
* - The compiler encounters `@use "db:foo/bar/baz"`.
|
||||
* - It calls {@link canonicalize} with `"db:foo/bar/baz"`.
|
||||
* - {@link canonicalize} returns `new URL("db:foo/bar/baz/_index.scss")`.
|
||||
* - If the compiler has already loaded a stylesheet with this canonical URL, it
|
||||
* re-uses the existing module.
|
||||
* - Otherwise, it calls {@link load} with `new
|
||||
* URL("db:foo/bar/baz/_index.scss")`.
|
||||
* - {@link load} returns an {@link ImporterResult} that the compiler uses as
|
||||
* the contents of the module.
|
||||
*
|
||||
* See {@link Options.importers} for more details on the way loads are resolved
|
||||
* using multiple importers and load paths.
|
||||
*
|
||||
* @typeParam sync - An `Importer<'sync'>`'s {@link canonicalize} and {@link
|
||||
* load} must return synchronously, but in return it can be passed to {@link
|
||||
* compile} and {@link compileString} in addition to {@link compileAsync} and
|
||||
* {@link compileStringAsync}.
|
||||
*
|
||||
* An `Importer<'async'>`'s {@link canonicalize} and {@link load} may either
|
||||
* return synchronously or asynchronously, but it can only be used with {@link
|
||||
* compileAsync} and {@link compileStringAsync}.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* sass.compile('style.scss', {
|
||||
* // An importer for URLs like `bgcolor:orange` that generates a
|
||||
* // stylesheet with the given background color.
|
||||
* importers: [{
|
||||
* canonicalize(url) {
|
||||
* if (!url.startsWith('bgcolor:')) return null;
|
||||
* return new URL(url);
|
||||
* },
|
||||
* load(canonicalUrl) {
|
||||
* return {
|
||||
* contents: `body {background-color: ${canonicalUrl.pathname}}`,
|
||||
* syntax: 'scss'
|
||||
* };
|
||||
* }
|
||||
* }]
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @category Importer
|
||||
*/
|
||||
export interface Importer<sync extends 'sync' | 'async' = 'sync' | 'async'> {
|
||||
/**
|
||||
* If `url` is recognized by this importer, returns its canonical format.
|
||||
*
|
||||
* If Sass has already loaded a stylesheet with the returned canonical URL, it
|
||||
* re-uses the existing parse tree (and the loaded module for `@use`). This
|
||||
* means that importers **must ensure** that the same canonical URL always
|
||||
* refers to the same stylesheet, *even across different importers*. As such,
|
||||
* importers are encouraged to use unique URL schemes to disambiguate between
|
||||
* one another.
|
||||
*
|
||||
* As much as possible, custom importers should canonicalize URLs the same way
|
||||
* as the built-in filesystem importer:
|
||||
*
|
||||
* - The importer should look for stylesheets by adding the prefix `_` to the
|
||||
* URL's basename, and by adding the extensions `.sass` and `.scss` if the
|
||||
* URL doesn't already have one of those extensions. For example, if the
|
||||
* URL was `foo/bar/baz`, the importer would look for:
|
||||
* - `foo/bar/baz.sass`
|
||||
* - `foo/bar/baz.scss`
|
||||
* - `foo/bar/_baz.sass`
|
||||
* - `foo/bar/_baz.scss`
|
||||
*
|
||||
* If the URL was `foo/bar/baz.scss`, the importer would just look for:
|
||||
* - `foo/bar/baz.scss`
|
||||
* - `foo/bar/_baz.scss`
|
||||
*
|
||||
* If the importer finds a stylesheet at more than one of these URLs, it
|
||||
* should throw an exception indicating that the URL is ambiguous. Note that
|
||||
* if the extension is explicitly specified, a stylesheet with the opposite
|
||||
* extension is allowed to exist.
|
||||
*
|
||||
* - If none of the possible paths is valid, the importer should perform the
|
||||
* same resolution on the URL followed by `/index`. In the example above,
|
||||
* it would look for:
|
||||
* - `foo/bar/baz/index.sass`
|
||||
* - `foo/bar/baz/index.scss`
|
||||
* - `foo/bar/baz/_index.sass`
|
||||
* - `foo/bar/baz/_index.scss`
|
||||
*
|
||||
* As above, if the importer finds a stylesheet at more than one of these
|
||||
* URLs, it should throw an exception indicating that the import is
|
||||
* ambiguous.
|
||||
*
|
||||
* If no stylesheets are found, the importer should return `null`.
|
||||
*
|
||||
* Calling {@link canonicalize} multiple times with the same URL must return
|
||||
* the same result. Calling {@link canonicalize} with a URL returned by a
|
||||
* previous call to {@link canonicalize} must return that URL.
|
||||
*
|
||||
* Relative loads in stylesheets loaded from an importer are handled by
|
||||
* resolving the loaded URL relative to the canonical URL of the stylesheet
|
||||
* that contains it, and passing that URL back to the importer's {@link
|
||||
* canonicalize} method. For example, suppose the "Resolving a Load" example
|
||||
* {@link Importer | above} returned a stylesheet that contained `@use
|
||||
* "mixins"`:
|
||||
*
|
||||
* - The compiler resolves the URL `mixins` relative to the current
|
||||
* stylesheet's canonical URL `db:foo/bar/baz/_index.scss` to get
|
||||
* `db:foo/bar/baz/mixins`.
|
||||
* - It calls {@link canonicalize} with `"db:foo/bar/baz/mixins"`.
|
||||
* - {@link canonicalize} returns `new URL("db:foo/bar/baz/_mixins.scss")`.
|
||||
*
|
||||
* Because of this, {@link canonicalize} must return a meaningful result when
|
||||
* called with a URL relative to one returned by an earlier call to {@link
|
||||
* canonicalize}.
|
||||
*
|
||||
* @param url - The loaded URL. Since this might be relative, it's represented
|
||||
* as a string rather than a {@link URL} object.
|
||||
*
|
||||
* @returns An absolute URL if this importer recognizes the `url`, or `null`
|
||||
* if it doesn't. If this returns `null`, other importers or {@link
|
||||
* Options.loadPaths | load paths} may handle the load.
|
||||
*
|
||||
* This may also return a `Promise`, but if it does the importer may only be
|
||||
* passed to {@link compileAsync} and {@link compileStringAsync}, not {@link
|
||||
* compile} or {@link compileString}.
|
||||
*
|
||||
* @throws any - If this importer recognizes `url` but determines that it's
|
||||
* invalid, it may throw an exception that will be wrapped by Sass. If the
|
||||
* exception object has a `message` property, it will be used as the wrapped
|
||||
* exception's message; otherwise, the exception object's `toString()` will be
|
||||
* used. This means it's safe for importers to throw plain strings.
|
||||
*/
|
||||
canonicalize(
|
||||
url: string,
|
||||
context: CanonicalizeContext
|
||||
): PromiseOr<URL | null, sync>;
|
||||
|
||||
/**
|
||||
* Loads the Sass text for the given `canonicalUrl`, or returns `null` if this
|
||||
* importer can't find the stylesheet it refers to.
|
||||
*
|
||||
* @param canonicalUrl - The canonical URL of the stylesheet to load. This is
|
||||
* guaranteed to come from a call to {@link canonicalize}, although not every
|
||||
* call to {@link canonicalize} will result in a call to {@link load}.
|
||||
*
|
||||
* @returns The contents of the stylesheet at `canonicalUrl` if it can be
|
||||
* loaded, or `null` if it can't.
|
||||
*
|
||||
* This may also return a `Promise`, but if it does the importer may only be
|
||||
* passed to {@link compileAsync} and {@link compileStringAsync}, not {@link
|
||||
* compile} or {@link compileString}.
|
||||
*
|
||||
* @throws any - If this importer finds a stylesheet at `url` but it fails to
|
||||
* load for some reason, or if `url` is uniquely associated with this importer
|
||||
* but doesn't refer to a real stylesheet, the importer may throw an exception
|
||||
* that will be wrapped by Sass. If the exception object has a `message`
|
||||
* property, it will be used as the wrapped exception's message; otherwise,
|
||||
* the exception object's `toString()` will be used. This means it's safe for
|
||||
* importers to throw plain strings.
|
||||
*/
|
||||
load(canonicalUrl: URL): PromiseOr<ImporterResult | null, sync>;
|
||||
|
||||
/** @hidden */
|
||||
findFileUrl?: never;
|
||||
|
||||
/**
|
||||
* A URL scheme or set of schemes (without the `:`) that this importer
|
||||
* promises never to use for URLs returned by {@link canonicalize}. If it does
|
||||
* return a URL with one of these schemes, that's an error.
|
||||
*
|
||||
* If this is set, any call to canonicalize for a URL with a non-canonical
|
||||
* scheme will be passed {@link CanonicalizeContext.containingUrl} if it's
|
||||
* known.
|
||||
*
|
||||
* These schemes may only contain lowercase ASCII letters, ASCII numerals,
|
||||
* `+`, `-`, and `.`. They may not be empty.
|
||||
*/
|
||||
nonCanonicalScheme?: string | string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* The result of successfully loading a stylesheet with an {@link Importer}.
|
||||
*
|
||||
* @category Importer
|
||||
*/
|
||||
export interface ImporterResult {
|
||||
/** The contents of the stylesheet. */
|
||||
contents: string;
|
||||
|
||||
/** The syntax with which to parse {@link contents}. */
|
||||
syntax: Syntax;
|
||||
|
||||
/**
|
||||
* The URL to use to link to the loaded stylesheet's source code in source
|
||||
* maps. A `file:` URL is ideal because it's accessible to both browsers and
|
||||
* other build tools, but an `http:` URL is also acceptable.
|
||||
*
|
||||
* If this isn't set, it defaults to a `data:` URL that contains the contents
|
||||
* of the loaded stylesheet.
|
||||
*/
|
||||
sourceMapUrl?: URL;
|
||||
}
|
||||
91
node_modules/.store/sass@1.69.5/node_modules/sass/types/index.d.ts
generated
vendored
Normal file
91
node_modules/.store/sass@1.69.5/node_modules/sass/types/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
// This is a mirror of the JS API definitions in `spec/js-api`, but with comments
|
||||
// written to provide user-facing documentation rather than to specify behavior for
|
||||
// implementations.
|
||||
|
||||
export {
|
||||
CompileResult,
|
||||
compile,
|
||||
compileAsync,
|
||||
compileString,
|
||||
compileStringAsync,
|
||||
} from './compile';
|
||||
export {Exception} from './exception';
|
||||
export {
|
||||
CanonicalizeContext,
|
||||
FileImporter,
|
||||
Importer,
|
||||
ImporterResult,
|
||||
} from './importer';
|
||||
export {Logger, SourceSpan, SourceLocation} from './logger';
|
||||
export {
|
||||
CustomFunction,
|
||||
Options,
|
||||
OutputStyle,
|
||||
StringOptions,
|
||||
StringOptionsWithImporter,
|
||||
StringOptionsWithoutImporter,
|
||||
Syntax,
|
||||
} from './options';
|
||||
export {PromiseOr} from './util/promise_or';
|
||||
export {
|
||||
CalculationInterpolation,
|
||||
CalculationOperation,
|
||||
CalculationOperator,
|
||||
CalculationValue,
|
||||
ListSeparator,
|
||||
SassArgumentList,
|
||||
SassBoolean,
|
||||
SassCalculation,
|
||||
SassColor,
|
||||
SassFunction,
|
||||
SassList,
|
||||
SassMap,
|
||||
SassMixin,
|
||||
SassNumber,
|
||||
SassString,
|
||||
Value,
|
||||
sassFalse,
|
||||
sassNull,
|
||||
sassTrue,
|
||||
} from './value';
|
||||
|
||||
// Legacy APIs
|
||||
export {LegacyException} from './legacy/exception';
|
||||
export {
|
||||
FALSE,
|
||||
LegacyAsyncFunction,
|
||||
LegacyAsyncFunctionDone,
|
||||
LegacyFunction,
|
||||
LegacySyncFunction,
|
||||
LegacyValue,
|
||||
NULL,
|
||||
TRUE,
|
||||
types,
|
||||
} from './legacy/function';
|
||||
export {
|
||||
LegacyAsyncImporter,
|
||||
LegacyImporter,
|
||||
LegacyImporterResult,
|
||||
LegacyImporterThis,
|
||||
LegacySyncImporter,
|
||||
} from './legacy/importer';
|
||||
export {
|
||||
LegacySharedOptions,
|
||||
LegacyFileOptions,
|
||||
LegacyStringOptions,
|
||||
LegacyOptions,
|
||||
} from './legacy/options';
|
||||
export {LegacyPluginThis} from './legacy/plugin_this';
|
||||
export {LegacyResult, render, renderSync} from './legacy/render';
|
||||
|
||||
/**
|
||||
* Information about the Sass implementation. This always begins with a unique
|
||||
* identifier for the Sass implementation, followed by U+0009 TAB, followed by
|
||||
* its npm package version. Some implementations include additional information
|
||||
* as well, but not in any standardized format.
|
||||
*
|
||||
* * For Dart Sass, the implementation name is `dart-sass`.
|
||||
* * For Node Sass, the implementation name is `node-sass`.
|
||||
* * For the embedded host, the implementation name is `sass-embedded`.
|
||||
*/
|
||||
export const info: string;
|
||||
55
node_modules/.store/sass@1.69.5/node_modules/sass/types/legacy/exception.d.ts
generated
vendored
Normal file
55
node_modules/.store/sass@1.69.5/node_modules/sass/types/legacy/exception.d.ts
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* The exception type thrown by {@link renderSync} and passed as the error to
|
||||
* {@link render}'s callback.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This is only thrown by the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link compile}, {@link compileString}, {@link
|
||||
* compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export interface LegacyException extends Error {
|
||||
/**
|
||||
* The error message. For Dart Sass, when possible this includes a highlighted
|
||||
* indication of where in the source file the error occurred as well as the
|
||||
* Sass stack trace.
|
||||
*/
|
||||
message: string;
|
||||
|
||||
/**
|
||||
* The error message. For Dart Sass, this is the same as the result of calling
|
||||
* {@link toString}, which is itself the same as {@link message} but with the
|
||||
* prefix "Error:".
|
||||
*/
|
||||
formatted: string;
|
||||
|
||||
/**
|
||||
* The (1-based) line number on which the error occurred, if this exception is
|
||||
* associated with a specific Sass file location.
|
||||
*/
|
||||
line?: number;
|
||||
|
||||
/**
|
||||
* The (1-based) column number within {@link line} at which the error
|
||||
* occurred, if this exception is associated with a specific Sass file
|
||||
* location.
|
||||
*/
|
||||
column?: number;
|
||||
|
||||
/**
|
||||
* Analogous to the exit code for an executable. `1` for an error caused by a
|
||||
* Sass file, `3` for any other type of error.
|
||||
*/
|
||||
status: number;
|
||||
|
||||
/**
|
||||
* If this exception was caused by an error in a Sass file, this will
|
||||
* represent the Sass file's location. It can be in one of three formats:
|
||||
*
|
||||
* * If the Sass file was loaded from disk, this is the path to that file.
|
||||
* * If the Sass file was generated by an importer, this is its canonical URL.
|
||||
* * If the Sass file was passed as {@link LegacyStringOptions.data} without a
|
||||
* corresponding {@link LegacyStringOptions.file}, this is the special
|
||||
* string `"stdin"`.
|
||||
*/
|
||||
file?: string;
|
||||
}
|
||||
757
node_modules/.store/sass@1.69.5/node_modules/sass/types/legacy/function.d.ts
generated
vendored
Normal file
757
node_modules/.store/sass@1.69.5/node_modules/sass/types/legacy/function.d.ts
generated
vendored
Normal file
@@ -0,0 +1,757 @@
|
||||
import {LegacyPluginThis} from './plugin_this';
|
||||
|
||||
/**
|
||||
* A synchronous callback that implements a custom Sass function. This can be
|
||||
* passed to {@link LegacySharedOptions.functions} for either {@link render} or
|
||||
* {@link renderSync}.
|
||||
*
|
||||
* If this throws an error, Sass will treat that as the function failing with
|
||||
* that error message.
|
||||
*
|
||||
* ```js
|
||||
* const result = sass.renderSync({
|
||||
* file: 'style.scss',
|
||||
* functions: {
|
||||
* "sum($arg1, $arg2)": (arg1, arg2) => {
|
||||
* if (!(arg1 instanceof sass.types.Number)) {
|
||||
* throw new Error("$arg1: Expected a number");
|
||||
* } else if (!(arg2 instanceof sass.types.Number)) {
|
||||
* throw new Error("$arg2: Expected a number");
|
||||
* }
|
||||
* return new sass.types.Number(arg1.getValue() + arg2.getValue());
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param args - One argument for each argument that's declared in the signature
|
||||
* that's passed to {@link LegacySharedOptions.functions}. If the signature
|
||||
* [takes arbitrary
|
||||
* arguments](https://sass-lang.com/documentation/at-rules/function#taking-arbitrary-arguments),
|
||||
* they're passed as a single argument list in the last argument.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link CustomFunction} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export type LegacySyncFunction = (
|
||||
this: LegacyPluginThis,
|
||||
...args: LegacyValue[]
|
||||
) => LegacyValue;
|
||||
|
||||
/**
|
||||
* An asynchronous callback that implements a custom Sass function. This can be
|
||||
* passed to {@link LegacySharedOptions.functions}, but only for {@link render}.
|
||||
*
|
||||
* An asynchronous function must return `undefined`. Its final argument will
|
||||
* always be a callback, which it should call with the result of the function
|
||||
* once it's done running.
|
||||
*
|
||||
* If this throws an error, Sass will treat that as the function failing with
|
||||
* that error message.
|
||||
*
|
||||
* ```js
|
||||
* sass.render({
|
||||
* file: 'style.scss',
|
||||
* functions: {
|
||||
* "sum($arg1, $arg2)": (arg1, arg2, done) => {
|
||||
* if (!(arg1 instanceof sass.types.Number)) {
|
||||
* throw new Error("$arg1: Expected a number");
|
||||
* } else if (!(arg2 instanceof sass.types.Number)) {
|
||||
* throw new Error("$arg2: Expected a number");
|
||||
* }
|
||||
* done(new sass.types.Number(arg1.getValue() + arg2.getValue()));
|
||||
* }
|
||||
* }
|
||||
* }, (result, error) => {
|
||||
* // ...
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* This is passed one argument for each argument that's declared in the
|
||||
* signature that's passed to {@link LegacySharedOptions.functions}. If the
|
||||
* signature [takes arbitrary
|
||||
* arguments](https://sass-lang.com/documentation/at-rules/function#taking-arbitrary-arguments),
|
||||
* they're passed as a single argument list in the last argument before the
|
||||
* callback.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link CustomFunction} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export type LegacyAsyncFunction =
|
||||
| ((this: LegacyPluginThis, done: (result: LegacyValue) => void) => void)
|
||||
| ((
|
||||
this: LegacyPluginThis,
|
||||
arg1: LegacyValue,
|
||||
done: LegacyAsyncFunctionDone
|
||||
) => void)
|
||||
| ((
|
||||
this: LegacyPluginThis,
|
||||
arg1: LegacyValue,
|
||||
arg2: LegacyValue,
|
||||
done: LegacyAsyncFunctionDone
|
||||
) => void)
|
||||
| ((
|
||||
this: LegacyPluginThis,
|
||||
arg1: LegacyValue,
|
||||
arg2: LegacyValue,
|
||||
arg3: LegacyValue,
|
||||
done: LegacyAsyncFunctionDone
|
||||
) => void)
|
||||
| ((
|
||||
this: LegacyPluginThis,
|
||||
arg1: LegacyValue,
|
||||
arg2: LegacyValue,
|
||||
arg3: LegacyValue,
|
||||
arg4: LegacyValue,
|
||||
done: LegacyAsyncFunctionDone
|
||||
) => void)
|
||||
| ((
|
||||
this: LegacyPluginThis,
|
||||
arg1: LegacyValue,
|
||||
arg2: LegacyValue,
|
||||
arg3: LegacyValue,
|
||||
arg4: LegacyValue,
|
||||
arg5: LegacyValue,
|
||||
done: LegacyAsyncFunctionDone
|
||||
) => void)
|
||||
| ((
|
||||
this: LegacyPluginThis,
|
||||
arg1: LegacyValue,
|
||||
arg2: LegacyValue,
|
||||
arg3: LegacyValue,
|
||||
arg4: LegacyValue,
|
||||
arg5: LegacyValue,
|
||||
arg6: LegacyValue,
|
||||
done: LegacyAsyncFunctionDone
|
||||
) => void)
|
||||
| ((
|
||||
this: LegacyPluginThis,
|
||||
...args: [...LegacyValue[], LegacyAsyncFunctionDone]
|
||||
) => void);
|
||||
|
||||
/**
|
||||
* The function called by a {@link LegacyAsyncFunction} to indicate that it's
|
||||
* finished.
|
||||
*
|
||||
* @param result - If this is a {@link LegacyValue}, that indicates that the
|
||||
* function call completed successfully. If it's a {@link types.Error}, that
|
||||
* indicates that the function call failed.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link CustomFunction} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export type LegacyAsyncFunctionDone = (
|
||||
result: LegacyValue | types.Error
|
||||
) => void;
|
||||
|
||||
/**
|
||||
* A callback that implements a custom Sass function. For {@link renderSync},
|
||||
* this must be a {@link LegacySyncFunction} which returns its result directly;
|
||||
* for {@link render}, it may be either a {@link LegacySyncFunction} or a {@link
|
||||
* LegacyAsyncFunction} which calls a callback with its result.
|
||||
*
|
||||
* See {@link LegacySharedOptions.functions} for more details.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link CustomFunction} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export type LegacyFunction<sync extends 'sync' | 'async'> = sync extends 'async'
|
||||
? LegacySyncFunction | LegacyAsyncFunction
|
||||
: LegacySyncFunction;
|
||||
|
||||
/**
|
||||
* A type representing all the possible values that may be passed to or returned
|
||||
* from a {@link LegacyFunction}.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link Value} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export type LegacyValue =
|
||||
| types.Null
|
||||
| types.Number
|
||||
| types.String
|
||||
| types.Boolean
|
||||
| types.Color
|
||||
| types.List
|
||||
| types.Map;
|
||||
|
||||
/**
|
||||
* A shorthand for `sass.types.Boolean.TRUE`.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link sassTrue} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export const TRUE: types.Boolean<true>;
|
||||
|
||||
/**
|
||||
* A shorthand for `sass.types.Boolean.FALSE`.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link sassFalse} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export const FALSE: types.Boolean<false>;
|
||||
|
||||
/**
|
||||
* A shorthand for `sass.types.Null.NULL`.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link sassNull} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export const NULL: types.Null;
|
||||
|
||||
/**
|
||||
* The namespace for value types used in the legacy function API.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link Value} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export namespace types {
|
||||
/**
|
||||
* The class for Sass's singleton [`null`
|
||||
* value](https://sass-lang.com/documentation/values/null). The value itself
|
||||
* can be accessed through the {@link NULL} field.
|
||||
*/
|
||||
export class Null {
|
||||
/** Sass's singleton `null` value. */
|
||||
static readonly NULL: Null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sass's [number type](https://sass-lang.com/documentation/values/numbers).
|
||||
*/
|
||||
export class Number {
|
||||
/**
|
||||
* @param value - The numeric value of the number.
|
||||
*
|
||||
* @param unit - If passed, the number's unit.
|
||||
*
|
||||
* Complex units can be represented as
|
||||
* `<unit>*<unit>*.../<unit>*<unit>*...`, with numerator units on the
|
||||
* left-hand side of the `/` and denominator units on the right. A number
|
||||
* with only numerator units may omit the `/` and the units after it, and a
|
||||
* number with only denominator units may be represented
|
||||
* with no units before the `/`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```scss
|
||||
* new sass.types.Number(0.5); // == 0.5
|
||||
* new sass.types.Number(10, "px"); // == 10px
|
||||
* new sass.types.Number(10, "px*px"); // == 10px * 1px
|
||||
* new sass.types.Number(10, "px/s"); // == math.div(10px, 1s)
|
||||
* new sass.types.Number(10, "px*px/s*s"); // == 10px * math.div(math.div(1px, 1s), 1s)
|
||||
* ```
|
||||
*/
|
||||
constructor(value: number, unit?: string);
|
||||
|
||||
/**
|
||||
* Returns the value of the number, ignoring units.
|
||||
*
|
||||
* **Heads up!** This means that `96px` and `1in` will return different
|
||||
* values, even though they represent the same length.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const number = new sass.types.Number(10, "px");
|
||||
* number.getValue(); // 10
|
||||
* ```
|
||||
*/
|
||||
getValue(): number;
|
||||
|
||||
/**
|
||||
* Destructively modifies this number by setting its numeric value to
|
||||
* `value`, independent of its units.
|
||||
*
|
||||
* @deprecated Use {@link constructor} instead.
|
||||
*/
|
||||
setValue(value: number): void;
|
||||
|
||||
/**
|
||||
* Returns a string representation of this number's units. Complex units are
|
||||
* returned in the same format that {@link constructor} accepts them.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* // number is `10px`.
|
||||
* number.getUnit(); // "px"
|
||||
*
|
||||
* // number is `math.div(10px, 1s)`.
|
||||
* number.getUnit(); // "px/s"
|
||||
* ```
|
||||
*/
|
||||
getUnit(): string;
|
||||
|
||||
/**
|
||||
* Destructively modifies this number by setting its units to `unit`,
|
||||
* independent of its numeric value. Complex units are specified in the same
|
||||
* format as {@link constructor}.
|
||||
*
|
||||
* @deprecated Use {@link constructor} instead.
|
||||
*/
|
||||
setUnit(unit: string): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sass's [string type](https://sass-lang.com/documentation/values/strings).
|
||||
*
|
||||
* **Heads up!** This API currently provides no way of distinguishing between
|
||||
* a [quoted](https://sass-lang.com/documentation/values/strings#quoted) and
|
||||
* [unquoted](https://sass-lang.com/documentation/values/strings#unquoted)
|
||||
* string.
|
||||
*/
|
||||
export class String {
|
||||
/**
|
||||
* Creates an unquoted string with the given contents.
|
||||
*
|
||||
* **Heads up!** This API currently provides no way of creating a
|
||||
* [quoted](https://sass-lang.com/documentation/values/strings#quoted)
|
||||
* string.
|
||||
*/
|
||||
constructor(value: string);
|
||||
|
||||
/**
|
||||
* Returns the contents of the string. If the string contains escapes,
|
||||
* those escapes are included literally if it’s
|
||||
* [unquoted](https://sass-lang.com/documentation/values/strings#unquoted),
|
||||
* while the values of the escapes are included if it’s
|
||||
* [quoted](https://sass-lang.com/documentation/values/strings#quoted).
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```
|
||||
* // string is `Arial`.
|
||||
* string.getValue(); // "Arial"
|
||||
*
|
||||
* // string is `"Helvetica Neue"`.
|
||||
* string.getValue(); // "Helvetica Neue"
|
||||
*
|
||||
* // string is `\1F46D`.
|
||||
* string.getValue(); // "\\1F46D"
|
||||
*
|
||||
* // string is `"\1F46D"`.
|
||||
* string.getValue(); // "👭"
|
||||
* ```
|
||||
*/
|
||||
getValue(): string;
|
||||
|
||||
/**
|
||||
* Destructively modifies this string by setting its numeric value to
|
||||
* `value`.
|
||||
*
|
||||
* **Heads up!** Even if the string was originally quoted, this will cause
|
||||
* it to become unquoted.
|
||||
*
|
||||
* @deprecated Use {@link constructor} instead.
|
||||
*/
|
||||
setValue(value: string): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sass's [boolean type](https://sass-lang.com/documentation/values/booleans).
|
||||
*
|
||||
* Custom functions should respect Sass’s notion of
|
||||
* [truthiness](https://sass-lang.com/documentation/at-rules/control/if#truthiness-and-falsiness)
|
||||
* by treating `false` and `null` as falsey and everything else as truthy.
|
||||
*
|
||||
* **Heads up!** Boolean values can't be constructed, they can only be
|
||||
* accessed through the {@link TRUE} and {@link FALSE} constants.
|
||||
*/
|
||||
export class Boolean<T extends boolean = boolean> {
|
||||
/**
|
||||
* Returns `true` if this is Sass's `true` value and `false` if this is
|
||||
* Sass's `false` value.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* // boolean is `true`.
|
||||
* boolean.getValue(); // true
|
||||
* boolean === sass.types.Boolean.TRUE; // true
|
||||
*
|
||||
* // boolean is `false`.
|
||||
* boolean.getValue(); // false
|
||||
* boolean === sass.types.Boolean.FALSE; // true
|
||||
* ```
|
||||
*/
|
||||
getValue(): T;
|
||||
|
||||
/** Sass's `true` value. */
|
||||
static readonly TRUE: Boolean<true>;
|
||||
|
||||
/** Sass's `false` value. */
|
||||
static readonly FALSE: Boolean<false>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sass's [color type](https://sass-lang.com/documentation/values/colors).
|
||||
*/
|
||||
export class Color {
|
||||
/**
|
||||
* Creates a new Sass color with the given red, green, blue, and alpha
|
||||
* channels. The red, green, and blue channels must be integers between 0
|
||||
* and 255 (inclusive), and alpha must be between 0 and 1 (inclusive).
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* new sass.types.Color(107, 113, 127); // #6b717f
|
||||
* new sass.types.Color(0, 0, 0, 0); // rgba(0, 0, 0, 0)
|
||||
* ```
|
||||
*/
|
||||
constructor(r: number, g: number, b: number, a?: number);
|
||||
|
||||
/**
|
||||
* Creates a new Sass color with alpha, red, green, and blue channels taken
|
||||
* from respective two-byte chunks of a hexidecimal number.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* new sass.types.Color(0xff6b717f); // #6b717f
|
||||
* new sass.types.Color(0x00000000); // rgba(0, 0, 0, 0)
|
||||
* ```
|
||||
*/
|
||||
constructor(argb: number);
|
||||
|
||||
/**
|
||||
* Returns the red channel of the color as an integer from 0 to 255.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* // color is `#6b717f`.
|
||||
* color.getR(); // 107
|
||||
*
|
||||
* // color is `#b37399`.
|
||||
* color.getR(); // 179
|
||||
* ```
|
||||
*/
|
||||
getR(): number;
|
||||
|
||||
/**
|
||||
* Sets the red channel of the color. The value must be an integer between 0
|
||||
* and 255 (inclusive).
|
||||
*
|
||||
* @deprecated Use {@link constructor} instead.
|
||||
*/
|
||||
setR(value: number): void;
|
||||
|
||||
/**
|
||||
* Returns the green channel of the color as an integer from 0 to 255.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* // color is `#6b717f`.
|
||||
* color.getG(); // 113
|
||||
*
|
||||
* // color is `#b37399`.
|
||||
* color.getG(); // 115
|
||||
* ```
|
||||
*/
|
||||
getG(): number;
|
||||
|
||||
/**
|
||||
* Sets the green channel of the color. The value must be an integer between
|
||||
* 0 and 255 (inclusive).
|
||||
*
|
||||
* @deprecated Use {@link constructor} instead.
|
||||
*/
|
||||
setG(value: number): void;
|
||||
|
||||
/**
|
||||
* Returns the blue channel of the color as an integer from 0 to 255.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* // color is `#6b717f`.
|
||||
* color.getB(); // 127
|
||||
*
|
||||
* // color is `#b37399`.
|
||||
* color.getB(); // 153
|
||||
* ```
|
||||
*/
|
||||
getB(): number;
|
||||
|
||||
/**
|
||||
* Sets the blue channel of the color. The value must be an integer between
|
||||
* 0 and 255 (inclusive).
|
||||
*
|
||||
* @deprecated Use {@link constructor} instead.
|
||||
*/
|
||||
setB(value: number): void;
|
||||
|
||||
/**
|
||||
* Returns the alpha channel of the color as a number from 0 to 1.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* // color is `#6b717f`.
|
||||
* color.getA(); // 1
|
||||
*
|
||||
* // color is `transparent`.
|
||||
* color.getA(); // 0
|
||||
* ```
|
||||
*/
|
||||
getA(): number;
|
||||
|
||||
/**
|
||||
* Sets the alpha channel of the color. The value must be between 0 and 1
|
||||
* (inclusive).
|
||||
*
|
||||
* @deprecated Use {@link constructor} instead.
|
||||
*/
|
||||
setA(value: number): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sass's [list type](https://sass-lang.com/documentation/values/lists).
|
||||
*
|
||||
* **Heads up!** This list type’s methods use 0-based indexing, even though
|
||||
* within Sass lists use 1-based indexing. These methods also don’t support
|
||||
* using negative numbers to index backwards from the end of the list.
|
||||
*/
|
||||
export class List {
|
||||
/**
|
||||
* Creates a new Sass list.
|
||||
*
|
||||
* **Heads up!** The initial values of the list elements are undefined.
|
||||
* These elements must be set using {@link setValue} before accessing them
|
||||
* or passing the list back to Sass.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const list = new sass.types.List(3);
|
||||
* list.setValue(0, new sass.types.Number(10, "px"));
|
||||
* list.setValue(1, new sass.types.Number(15, "px"));
|
||||
* list.setValue(2, new sass.types.Number(32, "px"));
|
||||
* list; // 10px, 15px, 32px
|
||||
* ```
|
||||
*
|
||||
* @param length - The number of (initially undefined) elements in the list.
|
||||
* @param commaSeparator - If `true`, the list is comma-separated; otherwise,
|
||||
* it's space-separated. Defaults to `true`.
|
||||
*/
|
||||
constructor(length: number, commaSeparator?: boolean);
|
||||
|
||||
/**
|
||||
* Returns the element at `index`, or `undefined` if that value hasn't yet
|
||||
* been set.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* // list is `10px, 15px, 32px`
|
||||
* list.getValue(0); // 10px
|
||||
* list.getValue(2); // 32px
|
||||
* ```
|
||||
*
|
||||
* @param index - A (0-based) index into this list.
|
||||
* @throws `Error` if `index` is less than 0 or greater than or equal to the
|
||||
* number of elements in this list.
|
||||
*/
|
||||
getValue(index: number): LegacyValue | undefined;
|
||||
|
||||
/**
|
||||
* Sets the element at `index` to `value`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* // list is `10px, 15px, 32px`
|
||||
* list.setValue(1, new sass.types.Number(18, "px"));
|
||||
* list; // 10px, 18px, 32px
|
||||
* ```
|
||||
*
|
||||
* @param index - A (0-based) index into this list.
|
||||
* @throws `Error` if `index` is less than 0 or greater than or equal to the
|
||||
* number of elements in this list.
|
||||
*/
|
||||
setValue(index: number, value: LegacyValue): void;
|
||||
|
||||
/**
|
||||
* Returns `true` if this list is comma-separated and `false` otherwise.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* // list is `10px, 15px, 32px`
|
||||
* list.getSeparator(); // true
|
||||
*
|
||||
* // list is `1px solid`
|
||||
* list.getSeparator(); // false
|
||||
* ```
|
||||
*/
|
||||
getSeparator(): boolean;
|
||||
|
||||
/**
|
||||
* Sets whether the list is comma-separated.
|
||||
*
|
||||
* @param isComma - `true` to make the list comma-separated, `false` otherwise.
|
||||
*/
|
||||
setSeparator(isComma: boolean): void;
|
||||
|
||||
/**
|
||||
* Returns the number of elements in the list.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* // list is `10px, 15px, 32px`
|
||||
* list.getLength(); // 3
|
||||
*
|
||||
* // list is `1px solid`
|
||||
* list.getLength(); // 2
|
||||
* ```
|
||||
*/
|
||||
getLength(): number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sass's [map type](https://sass-lang.com/documentation/values/maps).
|
||||
*
|
||||
* **Heads up!** This map type is represented as a list of key-value pairs
|
||||
* rather than a mapping from keys to values. The only way to find the value
|
||||
* associated with a given key is to iterate through the map checking for that
|
||||
* key. Maps created through this API are still forbidden from having duplicate
|
||||
* keys.
|
||||
*/
|
||||
export class Map {
|
||||
/**
|
||||
* Creates a new Sass map.
|
||||
*
|
||||
* **Heads up!** The initial keys and values of the map are undefined. They
|
||||
* must be set using {@link setKey} and {@link setValue} before accessing
|
||||
* them or passing the map back to Sass.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const map = new sass.types.Map(2);
|
||||
* map.setKey(0, new sass.types.String("width"));
|
||||
* map.setValue(0, new sass.types.Number(300, "px"));
|
||||
* map.setKey(1, new sass.types.String("height"));
|
||||
* map.setValue(1, new sass.types.Number(100, "px"));
|
||||
* map; // (width: 300px, height: 100px)
|
||||
* ```
|
||||
*
|
||||
* @param length - The number of (initially undefined) key/value pairs in the map.
|
||||
*/
|
||||
constructor(length: number);
|
||||
|
||||
/**
|
||||
* Returns the value in the key/value pair at `index`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* // map is `(width: 300px, height: 100px)`
|
||||
* map.getValue(0); // 300px
|
||||
* map.getValue(1); // 100px
|
||||
* ```
|
||||
*
|
||||
* @param index - A (0-based) index of a key/value pair in this map.
|
||||
* @throws `Error` if `index` is less than 0 or greater than or equal to the
|
||||
* number of pairs in this map.
|
||||
*/
|
||||
getValue(index: number): LegacyValue;
|
||||
|
||||
/**
|
||||
* Sets the value in the key/value pair at `index` to `value`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* // map is `("light": 200, "medium": 400, "bold": 600)`
|
||||
* map.setValue(1, new sass.types.Number(300));
|
||||
* map; // ("light": 200, "medium": 300, "bold": 600)
|
||||
* ```
|
||||
*
|
||||
* @param index - A (0-based) index of a key/value pair in this map.
|
||||
* @throws `Error` if `index` is less than 0 or greater than or equal to the
|
||||
* number of pairs in this map.
|
||||
*/
|
||||
setValue(index: number, value: LegacyValue): void;
|
||||
|
||||
/**
|
||||
* Returns the key in the key/value pair at `index`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* // map is `(width: 300px, height: 100px)`
|
||||
* map.getKey(0); // width
|
||||
* map.getKey(1); // height
|
||||
* ```
|
||||
*
|
||||
* @param index - A (0-based) index of a key/value pair in this map.
|
||||
* @throws `Error` if `index` is less than 0 or greater than or equal to the
|
||||
* number of pairs in this map.
|
||||
*/
|
||||
getKey(index: number): LegacyValue;
|
||||
|
||||
/**
|
||||
* Sets the value in the key/value pair at `index` to `value`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* // map is `("light": 200, "medium": 400, "bold": 600)`
|
||||
* map.setValue(1, new sass.types.String("lighter"));
|
||||
* map; // ("lighter": 200, "medium": 300, "bold": 600)
|
||||
* ```
|
||||
*
|
||||
* @param index - A (0-based) index of a key/value pair in this map.
|
||||
* @throws `Error` if `index` is less than 0 or greater than or equal to the
|
||||
* number of pairs in this map.
|
||||
*/
|
||||
setKey(index: number, key: LegacyValue): void;
|
||||
|
||||
/**
|
||||
* Returns the number of key/value pairs in this map.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* // map is `("light": 200, "medium": 400, "bold": 600)`
|
||||
* map.getLength(); // 3
|
||||
*
|
||||
* // map is `(width: 300px, height: 100px)`
|
||||
* map.getLength(); // 2
|
||||
* ```
|
||||
*/
|
||||
getLength(): number;
|
||||
}
|
||||
|
||||
/**
|
||||
* An error that can be returned from a Sass function to signal that it
|
||||
* encountered an error. This is the only way to signal an error
|
||||
* asynchronously from a {@link LegacyAsyncFunction}.
|
||||
*/
|
||||
export class Error {
|
||||
constructor(message: string);
|
||||
}
|
||||
}
|
||||
169
node_modules/.store/sass@1.69.5/node_modules/sass/types/legacy/importer.d.ts
generated
vendored
Normal file
169
node_modules/.store/sass@1.69.5/node_modules/sass/types/legacy/importer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,169 @@
|
||||
import {LegacyPluginThis} from './plugin_this';
|
||||
|
||||
/**
|
||||
* The value of `this` in the context of a {@link LegacyImporter} function.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This is only used by the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link Importer} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
interface LegacyImporterThis extends LegacyPluginThis {
|
||||
/**
|
||||
* Whether the importer is being invoked because of a Sass `@import` rule, as
|
||||
* opposed to a `@use` or `@forward` rule.
|
||||
*
|
||||
* This should *only* be used for determining whether or not to load
|
||||
* [import-only files](https://sass-lang.com/documentation/at-rules/import#import-only-files).
|
||||
*
|
||||
* @compatibility dart: "1.33.0", node: false
|
||||
*/
|
||||
fromImport: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* The result of running a {@link LegacyImporter}. It must be one of the
|
||||
* following types:
|
||||
*
|
||||
* * An object with the key `contents` whose value is the contents of a stylesheet
|
||||
* (in SCSS syntax). This causes Sass to load that stylesheet’s contents.
|
||||
*
|
||||
* * An object with the key `file` whose value is a path on disk. This causes Sass
|
||||
* to load that file as though it had been imported directly.
|
||||
*
|
||||
* * `null`, which indicates that it doesn’t recognize the URL and another
|
||||
* importer should be tried instead.
|
||||
*
|
||||
* * An [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)
|
||||
* object, indicating that importing failed.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link ImporterResult} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export type LegacyImporterResult =
|
||||
| {file: string}
|
||||
| {contents: string}
|
||||
| Error
|
||||
| null;
|
||||
|
||||
/**
|
||||
* A synchronous callback that implements custom Sass loading logic for
|
||||
* [`@import` rules](https://sass-lang.com/documentation/at-rules/import) and
|
||||
* [`@use` rules](https://sass-lang.com/documentation/at-rules/use). This can be
|
||||
* passed to {@link LegacySharedOptions.importer} for either {@link render} or
|
||||
* {@link renderSync}.
|
||||
*
|
||||
* See {@link LegacySharedOptions.importer} for more detailed documentation.
|
||||
*
|
||||
* ```js
|
||||
* sass.renderSync({
|
||||
* file: "style.scss",
|
||||
* importer: [
|
||||
* function(url, prev) {
|
||||
* if (url != "big-headers") return null;
|
||||
*
|
||||
* return {
|
||||
* contents: 'h1 { font-size: 40px; }'
|
||||
* };
|
||||
* }
|
||||
* ]
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param url - The `@use` or `@import` rule’s URL as a string, exactly as it
|
||||
* appears in the stylesheet.
|
||||
*
|
||||
* @param prev - A string identifying the stylesheet that contained the `@use`
|
||||
* or `@import`. This string’s format depends on how that stylesheet was loaded:
|
||||
*
|
||||
* * If the stylesheet was loaded from the filesystem, it’s the absolute path of
|
||||
* its file.
|
||||
* * If the stylesheet was loaded from an importer that returned its contents,
|
||||
* it’s the URL of the `@use` or `@import` rule that loaded it.
|
||||
* * If the stylesheet came from the data option, it’s the string "stdin".
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link Importer} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
type LegacySyncImporter = (
|
||||
this: LegacyImporterThis,
|
||||
url: string,
|
||||
prev: string
|
||||
) => LegacyImporterResult;
|
||||
|
||||
/**
|
||||
* An asynchronous callback that implements custom Sass loading logic for
|
||||
* [`@import` rules](https://sass-lang.com/documentation/at-rules/import) and
|
||||
* [`@use` rules](https://sass-lang.com/documentation/at-rules/use). This can be
|
||||
* passed to {@link LegacySharedOptions.importer} for either {@link render} or
|
||||
* {@link renderSync}.
|
||||
*
|
||||
* An asynchronous importer must return `undefined`, and then call `done` with
|
||||
* the result of its {@link LegacyImporterResult} once it's done running.
|
||||
*
|
||||
* See {@link LegacySharedOptions.importer} for more detailed documentation.
|
||||
*
|
||||
* ```js
|
||||
* sass.render({
|
||||
* file: "style.scss",
|
||||
* importer: [
|
||||
* function(url, prev, done) {
|
||||
* if (url != "big-headers") done(null);
|
||||
*
|
||||
* done({
|
||||
* contents: 'h1 { font-size: 40px; }'
|
||||
* });
|
||||
* }
|
||||
* ]
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param url - The `@use` or `@import` rule’s URL as a string, exactly as it
|
||||
* appears in the stylesheet.
|
||||
*
|
||||
* @param prev - A string identifying the stylesheet that contained the `@use`
|
||||
* or `@import`. This string’s format depends on how that stylesheet was loaded:
|
||||
*
|
||||
* * If the stylesheet was loaded from the filesystem, it’s the absolute path of
|
||||
* its file.
|
||||
* * If the stylesheet was loaded from an importer that returned its contents,
|
||||
* it’s the URL of the `@use` or `@import` rule that loaded it.
|
||||
* * If the stylesheet came from the data option, it’s the string "stdin".
|
||||
*
|
||||
* @param done - The callback to call once the importer has finished running.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link Importer} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
type LegacyAsyncImporter = (
|
||||
this: LegacyImporterThis,
|
||||
url: string,
|
||||
prev: string,
|
||||
done: (result: LegacyImporterResult) => void
|
||||
) => void;
|
||||
|
||||
/**
|
||||
* A callback that implements custom Sass loading logic for [`@import`
|
||||
* rules](https://sass-lang.com/documentation/at-rules/import) and [`@use`
|
||||
* rules](https://sass-lang.com/documentation/at-rules/use). For {@link
|
||||
* renderSync}, this must be a {@link LegacySyncImporter} which returns its
|
||||
* result directly; for {@link render}, it may be either a {@link
|
||||
* LegacySyncImporter} or a {@link LegacyAsyncImporter} which calls a callback
|
||||
* with its result.
|
||||
*
|
||||
* See {@link LegacySharedOptions.importer} for more details.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link Importer} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export type LegacyImporter<sync = 'sync' | 'async'> = sync extends 'async'
|
||||
? LegacySyncImporter | LegacyAsyncImporter
|
||||
: LegacySyncImporter;
|
||||
641
node_modules/.store/sass@1.69.5/node_modules/sass/types/legacy/options.d.ts
generated
vendored
Normal file
641
node_modules/.store/sass@1.69.5/node_modules/sass/types/legacy/options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,641 @@
|
||||
import {Logger} from '../logger';
|
||||
import {LegacyImporter} from './importer';
|
||||
import {LegacyFunction} from './function';
|
||||
|
||||
/**
|
||||
* Options for {@link render} and {@link renderSync} that are shared between
|
||||
* {@link LegacyFileOptions} and {@link LegacyStringOptions}.
|
||||
*
|
||||
* @typeParam sync - This lets the TypeScript checker verify that {@link
|
||||
* LegacyAsyncImporter}s and {@link LegacyAsyncFunction}s aren't passed to
|
||||
* {@link renderSync}.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link Options} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export interface LegacySharedOptions<sync extends 'sync' | 'async'> {
|
||||
/**
|
||||
* This array of strings option provides [load
|
||||
* paths](https://sass-lang.com/documentation/at-rules/import#load-paths) for
|
||||
* Sass to look for stylesheets. Earlier load paths will take precedence over
|
||||
* later ones.
|
||||
*
|
||||
* ```js
|
||||
* sass.renderSync({
|
||||
* file: "style.scss",
|
||||
* includePaths: ["node_modules/bootstrap/dist/css"]
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* Load paths are also loaded from the `SASS_PATH` environment variable, if
|
||||
* it’s set. This variable should be a list of paths separated by `;` (on
|
||||
* Windows) or `:` (on other operating systems). Load paths from the
|
||||
* `includePaths` option take precedence over load paths from `SASS_PATH`.
|
||||
*
|
||||
* ```sh
|
||||
* $ SASS_PATH=node_modules/bootstrap/dist/css sass style.scss style.css
|
||||
* ```
|
||||
*
|
||||
* @category Input
|
||||
* @compatibility feature: "SASS_PATH", dart: "1.15.0", node: "3.9.0"
|
||||
*
|
||||
* Earlier versions of Dart Sass and Node Sass didn’t support the `SASS_PATH`
|
||||
* environment variable.
|
||||
*/
|
||||
includePaths?: string[];
|
||||
|
||||
/**
|
||||
* Whether the generated CSS should use spaces or tabs for indentation.
|
||||
*
|
||||
* ```js
|
||||
* const result = sass.renderSync({
|
||||
* file: "style.scss",
|
||||
* indentType: "tab",
|
||||
* indentWidth: 1
|
||||
* });
|
||||
*
|
||||
* result.css.toString();
|
||||
* // "h1 {\n\tfont-size: 40px;\n}\n"
|
||||
* ```
|
||||
*
|
||||
* @defaultValue `'space'`
|
||||
* @category Output
|
||||
* @compatibility dart: true, node: "3.0.0"
|
||||
*/
|
||||
indentType?: 'space' | 'tab';
|
||||
|
||||
/**
|
||||
* How many spaces or tabs (depending on {@link indentType}) should be used
|
||||
* per indentation level in the generated CSS. It must be between 0 and 10
|
||||
* (inclusive).
|
||||
*
|
||||
* @defaultValue `2`
|
||||
* @category Output
|
||||
* @compatibility dart: true, node: "3.0.0"
|
||||
*/
|
||||
indentWidth?: number;
|
||||
|
||||
/**
|
||||
* Which character sequence to use at the end of each line in the generated
|
||||
* CSS. It can have the following values:
|
||||
*
|
||||
* * `'lf'` uses U+000A LINE FEED.
|
||||
* * `'lfcr'` uses U+000A LINE FEED followed by U+000D CARRIAGE RETURN.
|
||||
* * `'cr'` uses U+000D CARRIAGE RETURN.
|
||||
* * `'crlf'` uses U+000D CARRIAGE RETURN followed by U+000A LINE FEED.
|
||||
*
|
||||
* @defaultValue `'lf'`
|
||||
* @category Output
|
||||
* @compatibility dart: true, node: "3.0.0"
|
||||
*/
|
||||
linefeed?: 'cr' | 'crlf' | 'lf' | 'lfcr';
|
||||
|
||||
/**
|
||||
* If `true`, Sass won't add a link from the generated CSS to the source map.
|
||||
*
|
||||
* ```js
|
||||
* const result = sass.renderSync({
|
||||
* file: "style.scss",
|
||||
* sourceMap: "out.map",
|
||||
* omitSourceMapUrl: true
|
||||
* })
|
||||
* console.log(result.css.toString());
|
||||
* // h1 {
|
||||
* // font-size: 40px;
|
||||
* // }
|
||||
* ```
|
||||
*
|
||||
* @defaultValue `false`
|
||||
* @category Source Maps
|
||||
*/
|
||||
omitSourceMapUrl?: boolean;
|
||||
|
||||
/**
|
||||
* The location that Sass expects the generated CSS to be saved to. It’s used
|
||||
* to determine the URL used to link from the generated CSS to the source map,
|
||||
* and from the source map to the Sass source files.
|
||||
*
|
||||
* **Heads up!** Despite the name, Sass does *not* write the CSS output to
|
||||
* this file. The caller must do that themselves.
|
||||
*
|
||||
* ```js
|
||||
* result = sass.renderSync({
|
||||
* file: "style.scss",
|
||||
* sourceMap: true,
|
||||
* outFile: "out.css"
|
||||
* })
|
||||
* console.log(result.css.toString());
|
||||
* // h1 {
|
||||
* // font-size: 40px;
|
||||
* // }
|
||||
* // /*# sourceMappingURL=out.css.map * /
|
||||
* ```
|
||||
*
|
||||
* @category Source Maps
|
||||
*/
|
||||
outFile?: string;
|
||||
|
||||
/**
|
||||
* The output style of the compiled CSS. There are four possible output styles:
|
||||
*
|
||||
* * `"expanded"` (the default for Dart Sass) writes each selector and
|
||||
* declaration on its own line.
|
||||
*
|
||||
* * `"compressed"` removes as many extra characters as possible, and writes
|
||||
* the entire stylesheet on a single line.
|
||||
*
|
||||
* * `"nested"` (the default for Node Sass, not supported by Dart Sass)
|
||||
* indents CSS rules to match the nesting of the Sass source.
|
||||
*
|
||||
* * `"compact"` (not supported by Dart Sass) puts each CSS rule on its own single line.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const source = `
|
||||
* h1 {
|
||||
* font-size: 40px;
|
||||
* code {
|
||||
* font-face: Roboto Mono;
|
||||
* }
|
||||
* }`;
|
||||
*
|
||||
* let result = sass.renderSync({
|
||||
* data: source,
|
||||
* outputStyle: "expanded"
|
||||
* });
|
||||
* console.log(result.css.toString());
|
||||
* // h1 {
|
||||
* // font-size: 40px;
|
||||
* // }
|
||||
* // h1 code {
|
||||
* // font-face: Roboto Mono;
|
||||
* // }
|
||||
*
|
||||
* result = sass.renderSync({
|
||||
* data: source,
|
||||
* outputStyle: "compressed"
|
||||
* });
|
||||
* console.log(result.css.toString());
|
||||
* // h1{font-size:40px}h1 code{font-face:Roboto Mono}
|
||||
*
|
||||
* result = sass.renderSync({
|
||||
* data: source,
|
||||
* outputStyle: "nested"
|
||||
* });
|
||||
* console.log(result.css.toString());
|
||||
* // h1 {
|
||||
* // font-size: 40px; }
|
||||
* // h1 code {
|
||||
* // font-face: Roboto Mono; }
|
||||
*
|
||||
* result = sass.renderSync({
|
||||
* data: source,
|
||||
* outputStyle: "compact"
|
||||
* });
|
||||
* console.log(result.css.toString());
|
||||
* // h1 { font-size: 40px; }
|
||||
* // h1 code { font-face: Roboto Mono; }
|
||||
* ```
|
||||
*
|
||||
* @category Output
|
||||
*/
|
||||
outputStyle?: 'compressed' | 'expanded' | 'nested' | 'compact';
|
||||
|
||||
/**
|
||||
* Whether or not Sass should generate a source map. If it does, the source
|
||||
* map will be available as {@link LegacyResult.map} (unless {@link
|
||||
* sourceMapEmbed} is `true`).
|
||||
*
|
||||
* If this option is a string, it’s the path that the source map is expected
|
||||
* to be written to, which is used to link to the source map from the
|
||||
* generated CSS and to link *from* the source map to the Sass source files.
|
||||
* Note that if `sourceMap` is a string and {@link outFile} isn’t passed, Sass
|
||||
* assumes that the CSS will be written to the same directory as the file
|
||||
* option if it’s passed.
|
||||
*
|
||||
* If this option is `true`, the path is assumed to be {@link outFile} with
|
||||
* `.map` added to the end. If it’s `true` and {@link outFile} isn’t passed,
|
||||
* it has no effect.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* let result = sass.renderSync({
|
||||
* file: "style.scss",
|
||||
* sourceMap: "out.map"
|
||||
* })
|
||||
* console.log(result.css.toString());
|
||||
* // h1 {
|
||||
* // font-size: 40px;
|
||||
* // }
|
||||
* // /*# sourceMappingURL=out.map * /
|
||||
*
|
||||
* result = sass.renderSync({
|
||||
* file: "style.scss",
|
||||
* sourceMap: true,
|
||||
* outFile: "out.css"
|
||||
* })
|
||||
* console.log(result.css.toString());
|
||||
* // h1 {
|
||||
* // font-size: 40px;
|
||||
* // }
|
||||
* // /*# sourceMappingURL=out.css.map * /
|
||||
* ```
|
||||
*
|
||||
* @defaultValue `false`
|
||||
* @category Source Maps
|
||||
*/
|
||||
sourceMap?: boolean | string;
|
||||
|
||||
/**
|
||||
* Whether to embed the entire contents of the Sass files that contributed to
|
||||
* the generated CSS in the source map. This may produce very large source
|
||||
* maps, but it guarantees that the source will be available on any computer
|
||||
* no matter how the CSS is served.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* sass.renderSync({
|
||||
* file: "style.scss",
|
||||
* sourceMap: "out.map",
|
||||
* sourceMapContents: true
|
||||
* })
|
||||
* ```
|
||||
*
|
||||
* @defaultValue `false`
|
||||
* @category Source Maps
|
||||
*/
|
||||
sourceMapContents?: boolean;
|
||||
|
||||
/**
|
||||
* Whether to embed the contents of the source map file in the generated CSS,
|
||||
* rather than creating a separate file and linking to it from the CSS.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* sass.renderSync({
|
||||
* file: "style.scss",
|
||||
* sourceMap: "out.map",
|
||||
* sourceMapEmbed: true
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @defaultValue `false`
|
||||
* @category Source Maps
|
||||
*/
|
||||
sourceMapEmbed?: boolean;
|
||||
|
||||
/**
|
||||
* If this is passed, it's prepended to all the links from the source map to
|
||||
* the Sass source files.
|
||||
*
|
||||
* @category Source Maps
|
||||
*/
|
||||
sourceMapRoot?: string;
|
||||
|
||||
/**
|
||||
* Additional handler(s) for loading files when a [`@use`
|
||||
* rule](https://sass-lang.com/documentation/at-rules/use) or an [`@import`
|
||||
* rule](https://sass-lang.com/documentation/at-rules/import) is encountered.
|
||||
* It can either be a single {@link LegacyImporter} function, or an array of
|
||||
* {@link LegacyImporter}s.
|
||||
*
|
||||
* Importers take the URL of the `@import` or `@use` rule and return a {@link
|
||||
* LegacyImporterResult} indicating how to handle that rule. For more details,
|
||||
* see {@link LegacySyncImporter} and {@link LegacyAsyncImporter}.
|
||||
*
|
||||
* Loads are resolved by trying, in order:
|
||||
*
|
||||
* * Loading a file from disk relative to the file in which the `@use` or
|
||||
* `@import` appeared.
|
||||
*
|
||||
* * Each custom importer.
|
||||
*
|
||||
* * Loading a file relative to the current working directory.
|
||||
*
|
||||
* * Each load path in {@link includePaths}.
|
||||
*
|
||||
* * Each load path specified in the `SASS_PATH` environment variable, which
|
||||
* should be semicolon-separated on Windows and colon-separated elsewhere.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* sass.render({
|
||||
* file: "style.scss",
|
||||
* importer: [
|
||||
* // This importer uses the synchronous API, and can be passed to either
|
||||
* // renderSync() or render().
|
||||
* function(url, prev) {
|
||||
* // This generates a stylesheet from scratch for `@use "big-headers"`.
|
||||
* if (url != "big-headers") return null;
|
||||
*
|
||||
* return {
|
||||
* contents: `
|
||||
* h1 {
|
||||
* font-size: 40px;
|
||||
* }`
|
||||
* };
|
||||
* },
|
||||
*
|
||||
* // This importer uses the asynchronous API, and can only be passed to
|
||||
* // render().
|
||||
* function(url, prev, done) {
|
||||
* // Convert `@use "foo/bar"` to "node_modules/foo/sass/bar".
|
||||
* const components = url.split('/');
|
||||
* const innerPath = components.slice(1).join('/');
|
||||
* done({
|
||||
* file: `node_modules/${components.first}/sass/${innerPath}`
|
||||
* });
|
||||
* }
|
||||
* ]
|
||||
* }, function(err, result) {
|
||||
* // ...
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @category Plugins
|
||||
* @compatibility dart: true, node: "3.0.0"
|
||||
*
|
||||
* Versions of Node Sass before 3.0.0 don’t support arrays of importers, nor
|
||||
* do they support importers that return `Error` objects.
|
||||
*
|
||||
* Versions of Node Sass before 2.0.0 don’t support the `importer` option at
|
||||
* all.
|
||||
*
|
||||
* @compatibility feature: "Import order", dart: "1.20.2", node: false
|
||||
*
|
||||
* Versions of Dart Sass before 1.20.2 preferred resolving imports using
|
||||
* {@link includePaths} before resolving them using custom importers.
|
||||
*
|
||||
* All versions of Node Sass currently pass imports to importers before
|
||||
* loading them relative to the file in which the `@import` appears. This
|
||||
* behavior is considered incorrect and should not be relied on because it
|
||||
* violates the principle of *locality*, which says that it should be possible
|
||||
* to reason about a stylesheet without knowing everything about how the
|
||||
* entire system is set up. If a user tries to import a stylesheet relative to
|
||||
* another stylesheet, that import should *always* work. It shouldn’t be
|
||||
* possible for some configuration somewhere else to break it.
|
||||
*/
|
||||
importer?: LegacyImporter<sync> | LegacyImporter<sync>[];
|
||||
|
||||
/**
|
||||
* Additional built-in Sass functions that are available in all stylesheets.
|
||||
* This option takes an object whose keys are Sass function signatures and
|
||||
* whose values are {@link LegacyFunction}s. Each function should take the
|
||||
* same arguments as its signature.
|
||||
*
|
||||
* Functions are passed subclasses of {@link LegacyValue}, and must return the
|
||||
* same.
|
||||
*
|
||||
* **Heads up!** When writing custom functions, it’s important to ensure that
|
||||
* all the arguments are the types you expect. Otherwise, users’ stylesheets
|
||||
* could crash in hard-to-debug ways or, worse, compile to meaningless CSS.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* sass.render({
|
||||
* data: `
|
||||
* h1 {
|
||||
* font-size: pow(2, 5) * 1px;
|
||||
* }`,
|
||||
* functions: {
|
||||
* // This function uses the synchronous API, and can be passed to either
|
||||
* // renderSync() or render().
|
||||
* 'pow($base, $exponent)': function(base, exponent) {
|
||||
* if (!(base instanceof sass.types.Number)) {
|
||||
* throw "$base: Expected a number.";
|
||||
* } else if (base.getUnit()) {
|
||||
* throw "$base: Expected a unitless number.";
|
||||
* }
|
||||
*
|
||||
* if (!(exponent instanceof sass.types.Number)) {
|
||||
* throw "$exponent: Expected a number.";
|
||||
* } else if (exponent.getUnit()) {
|
||||
* throw "$exponent: Expected a unitless number.";
|
||||
* }
|
||||
*
|
||||
* return new sass.types.Number(
|
||||
* Math.pow(base.getValue(), exponent.getValue()));
|
||||
* },
|
||||
*
|
||||
* // This function uses the asynchronous API, and can only be passed to
|
||||
* // render().
|
||||
* 'sqrt($number)': function(number, done) {
|
||||
* if (!(number instanceof sass.types.Number)) {
|
||||
* throw "$number: Expected a number.";
|
||||
* } else if (number.getUnit()) {
|
||||
* throw "$number: Expected a unitless number.";
|
||||
* }
|
||||
*
|
||||
* done(new sass.types.Number(Math.sqrt(number.getValue())));
|
||||
* }
|
||||
* }
|
||||
* }, function(err, result) {
|
||||
* console.log(result.css.toString());
|
||||
* // h1 {
|
||||
* // font-size: 32px;
|
||||
* // }
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @category Plugins
|
||||
*/
|
||||
functions?: {[key: string]: LegacyFunction<sync>};
|
||||
|
||||
/**
|
||||
* By default, if the CSS document contains non-ASCII characters, Sass adds a
|
||||
* `@charset` declaration (in expanded output mode) or a byte-order mark (in
|
||||
* compressed mode) to indicate its encoding to browsers or other consumers.
|
||||
* If `charset` is `false`, these annotations are omitted.
|
||||
*
|
||||
* @category Output
|
||||
* @compatibility dart: "1.39.0", node: false
|
||||
*/
|
||||
charset?: boolean;
|
||||
|
||||
/**
|
||||
* If this option is set to `true`, Sass won’t print warnings that are caused
|
||||
* by dependencies. A “dependency” is defined as any file that’s loaded
|
||||
* through {@link includePaths} or {@link importer}. Stylesheets that are
|
||||
* imported relative to the entrypoint are not considered dependencies.
|
||||
*
|
||||
* This is useful for silencing deprecation warnings that you can’t fix on
|
||||
* your own. However, please <em>also</em> notify your dependencies of the deprecations
|
||||
* so that they can get fixed as soon as possible!
|
||||
*
|
||||
* **Heads up!** If {@link render} or {@link renderSync} is called without
|
||||
* {@link LegacyFileOptions.file} or {@link LegacyStringOptions.file},
|
||||
* <em>all</em> stylesheets it loads will be considered dependencies. Since it
|
||||
* doesn’t have a path of its own, everything it loads is coming from a load
|
||||
* path rather than a relative import.
|
||||
*
|
||||
* @defaultValue `false`
|
||||
* @category Messages
|
||||
* @compatibility dart: "1.35.0", node: false
|
||||
*/
|
||||
quietDeps?: boolean;
|
||||
|
||||
/**
|
||||
* By default, Dart Sass will print only five instances of the same
|
||||
* deprecation warning per compilation to avoid deluging users in console
|
||||
* noise. If you set `verbose` to `true`, it will instead print every
|
||||
* deprecation warning it encounters.
|
||||
*
|
||||
* @defaultValue `false`
|
||||
* @category Messages
|
||||
* @compatibility dart: "1.35.0", node: false
|
||||
*/
|
||||
verbose?: boolean;
|
||||
|
||||
/**
|
||||
* An object to use to handle warnings and/or debug messages from Sass.
|
||||
*
|
||||
* By default, Sass emits warnings and debug messages to standard error, but
|
||||
* if {@link Logger.warn} or {@link Logger.debug} is set, this will invoke
|
||||
* them instead.
|
||||
*
|
||||
* The special value {@link Logger.silent} can be used to easily silence all
|
||||
* messages.
|
||||
*
|
||||
* @category Messages
|
||||
* @compatibility dart: "1.43.0", node: false
|
||||
*/
|
||||
logger?: Logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* If {@link file} is passed without {@link data}, Sass will load the stylesheet
|
||||
* at {@link file} and compile it to CSS.
|
||||
*
|
||||
* @typeParam sync - This lets the TypeScript checker verify that {@link
|
||||
* LegacyAsyncImporter}s and {@link LegacyAsyncFunction}s aren't passed to
|
||||
* {@link renderSync}.
|
||||
*/
|
||||
export interface LegacyFileOptions<sync extends 'sync' | 'async'>
|
||||
extends LegacySharedOptions<sync> {
|
||||
/**
|
||||
* The path to the file for Sass to load and compile. If the file’s extension
|
||||
* is `.scss`, it will be parsed as SCSS; if it’s `.sass`, it will be parsed
|
||||
* as the indented syntax; and if it’s `.css`, it will be parsed as plain CSS.
|
||||
* If it has no extension, it will be parsed as SCSS.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* sass.renderSync({file: "style.scss"});
|
||||
* ```
|
||||
*
|
||||
* @category Input
|
||||
* @compatibility feature: "Plain CSS files", dart: "1.11.0", node: "partial"
|
||||
*
|
||||
* Node Sass and older versions of Dart Sass support loading files with the
|
||||
* extension `.css`, but contrary to the specification they’re treated as SCSS
|
||||
* files rather than being parsed as CSS. This behavior has been deprecated
|
||||
* and should not be relied on. Any files that use Sass features should use
|
||||
* the `.scss` extension.
|
||||
*
|
||||
* All versions of Node Sass and Dart Sass otherwise support the file option
|
||||
* as described below.
|
||||
*/
|
||||
file: string;
|
||||
|
||||
/**
|
||||
* See {@link LegacyStringOptions.file} for documentation of passing {@link
|
||||
* file} along with {@link data}.
|
||||
*
|
||||
* @category Input
|
||||
*/
|
||||
data?: never;
|
||||
}
|
||||
|
||||
/**
|
||||
* If {@link data} is passed, Sass will use it as the contents of the stylesheet
|
||||
* to compile.
|
||||
*
|
||||
* @typeParam sync - This lets the TypeScript checker verify that {@link
|
||||
* LegacyAsyncImporter}s and {@link LegacyAsyncFunction}s aren't passed to
|
||||
* {@link renderSync}.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link StringOptions} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export interface LegacyStringOptions<sync extends 'sync' | 'async'>
|
||||
extends LegacySharedOptions<sync> {
|
||||
/**
|
||||
* The contents of the stylesheet to compile. Unless {@link file} is passed as
|
||||
* well, the stylesheet’s URL is set to `"stdin"`.
|
||||
*
|
||||
* By default, this stylesheet is parsed as SCSS. This can be controlled using
|
||||
* {@link indentedSyntax}.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* sass.renderSync({
|
||||
* data: `
|
||||
* h1 {
|
||||
* font-size: 40px;
|
||||
* }`
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @category Input
|
||||
*/
|
||||
data: string;
|
||||
|
||||
/**
|
||||
* If `file` and {@link data} are both passed, `file` is used as the path of
|
||||
* the stylesheet for error reporting, but {@link data} is used as the
|
||||
* contents of the stylesheet. In this case, `file`’s extension is not used to
|
||||
* determine the syntax of the stylesheet.
|
||||
*
|
||||
* @category Input
|
||||
*/
|
||||
file?: string;
|
||||
|
||||
/**
|
||||
* This flag controls whether {@link data} is parsed as the indented syntax or
|
||||
* not.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* sass.renderSync({
|
||||
* data: `
|
||||
* h1
|
||||
* font-size: 40px`,
|
||||
* indentedSyntax: true
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @defaultValue `false`
|
||||
* @category Input
|
||||
*/
|
||||
indentedSyntax?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for {@link render} and {@link renderSync}. This can either be {@link
|
||||
* LegacyFileOptions} to load a file from disk, or {@link LegacyStringOptions}
|
||||
* to compile a string of Sass code.
|
||||
*
|
||||
* See {@link LegacySharedOptions} for options that are shared across both file
|
||||
* and string inputs.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This only works with the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link Options} with {@link compile}, {@link
|
||||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export type LegacyOptions<sync extends 'sync' | 'async'> =
|
||||
| LegacyFileOptions<sync>
|
||||
| LegacyStringOptions<sync>;
|
||||
74
node_modules/.store/sass@1.69.5/node_modules/sass/types/legacy/plugin_this.d.ts
generated
vendored
Normal file
74
node_modules/.store/sass@1.69.5/node_modules/sass/types/legacy/plugin_this.d.ts
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* The value of `this` in the context of a {@link LegacyImporter} or {@link
|
||||
* LegacyFunction} callback.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This is only used by the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link compile}, {@link compileString}, {@link
|
||||
* compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export interface LegacyPluginThis {
|
||||
/**
|
||||
* A partial representation of the options passed to {@link render} or {@link
|
||||
* renderSync}.
|
||||
*/
|
||||
options: {
|
||||
/** The same {@link LegacyPluginThis} instance that contains this object. */
|
||||
context: LegacyPluginThis;
|
||||
|
||||
/**
|
||||
* The value passed to {@link LegacyFileOptions.file} or {@link
|
||||
* LegacyStringOptions.file}.
|
||||
*/
|
||||
file?: string;
|
||||
|
||||
/** The value passed to {@link LegacyStringOptions.data}. */
|
||||
data?: string;
|
||||
|
||||
/**
|
||||
* The value passed to {@link LegacySharedOptions.includePaths} separated by
|
||||
* `";"` on Windows or `":"` on other operating systems. This always
|
||||
* includes the current working directory as the first entry.
|
||||
*/
|
||||
includePaths: string;
|
||||
|
||||
/** Always the number 10. */
|
||||
precision: 10;
|
||||
|
||||
/** Always the number 1. */
|
||||
style: 1;
|
||||
|
||||
/** 1 if {@link LegacySharedOptions.indentType} was `"tab"`, 0 otherwise. */
|
||||
indentType: 1 | 0;
|
||||
|
||||
/**
|
||||
* The value passed to {@link LegacySharedOptions.indentWidth}, or `2`
|
||||
* otherwise.
|
||||
*/
|
||||
indentWidth: number;
|
||||
|
||||
/**
|
||||
* The value passed to {@link LegacySharedOptions.linefeed}, or `"\n"`
|
||||
* otherwise.
|
||||
*/
|
||||
linefeed: '\r' | '\r\n' | '\n' | '\n\r';
|
||||
|
||||
/** A partially-constructed {@link LegacyResult} object. */
|
||||
result: {
|
||||
/** Partial information about the compilation in progress. */
|
||||
stats: {
|
||||
/**
|
||||
* The number of milliseconds between 1 January 1970 at 00:00:00 UTC and
|
||||
* the time at which Sass compilation began.
|
||||
*/
|
||||
start: number;
|
||||
|
||||
/**
|
||||
* {@link LegacyFileOptions.file} if it was passed, otherwise the string
|
||||
* `"data"`.
|
||||
*/
|
||||
entry: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
144
node_modules/.store/sass@1.69.5/node_modules/sass/types/legacy/render.d.ts
generated
vendored
Normal file
144
node_modules/.store/sass@1.69.5/node_modules/sass/types/legacy/render.d.ts
generated
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
import {LegacyException} from './exception';
|
||||
import {LegacyOptions} from './options';
|
||||
|
||||
/**
|
||||
* The object returned by {@link render} and {@link renderSync} after a
|
||||
* successful compilation.
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated This is only used by the legacy {@link render} and {@link
|
||||
* renderSync} APIs. Use {@link compile}, {@link compileString}, {@link
|
||||
* compileAsync}, and {@link compileStringAsync} instead.
|
||||
*/
|
||||
export interface LegacyResult {
|
||||
/**
|
||||
* The compiled CSS. This can be converted to a string by calling
|
||||
* [Buffer.toString](https://nodejs.org/api/buffer.html#buffer_buf_tostring_encoding_start_end).
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const result = sass.renderSync({file: "style.scss"});
|
||||
*
|
||||
* console.log(result.css.toString());
|
||||
* ```
|
||||
*/
|
||||
css: Buffer;
|
||||
|
||||
/**
|
||||
* The source map that maps the compiled CSS to the source files from which it
|
||||
* was generated. This can be converted to a string by calling
|
||||
* [Buffer.toString](https://nodejs.org/api/buffer.html#buffer_buf_tostring_encoding_start_end).
|
||||
*
|
||||
* This is `undefined` unless either
|
||||
*
|
||||
* * {@link LegacySharedOptions.sourceMap} is a string; or
|
||||
* * {@link LegacySharedOptions.sourceMap} is `true` and
|
||||
* {@link LegacySharedOptions.outFile} is set.
|
||||
*
|
||||
* The source map uses absolute [`file:`
|
||||
* URLs](https://en.wikipedia.org/wiki/File_URI_scheme) to link to the Sass
|
||||
* source files, except if the source file comes from {@link
|
||||
* LegacyStringOptions.data} in which case it lists its URL as `"stdin"`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const result = sass.renderSync({
|
||||
* file: "style.scss",
|
||||
* sourceMap: true,
|
||||
* outFile: "style.css"
|
||||
* })
|
||||
*
|
||||
* console.log(result.map.toString());
|
||||
* ```
|
||||
*/
|
||||
map?: Buffer;
|
||||
|
||||
/** Additional information about the compilation. */
|
||||
stats: {
|
||||
/**
|
||||
* The absolute path of {@link LegacyFileOptions.file} or {@link
|
||||
* LegacyStringOptions.file}, or `"data"` if {@link
|
||||
* LegacyStringOptions.file} wasn't set.
|
||||
*/
|
||||
entry: string;
|
||||
|
||||
/**
|
||||
* The number of milliseconds between 1 January 1970 at 00:00:00 UTC and the
|
||||
* time at which Sass compilation began.
|
||||
*/
|
||||
start: number;
|
||||
|
||||
/**
|
||||
* The number of milliseconds between 1 January 1970 at 00:00:00 UTC and the
|
||||
* time at which Sass compilation ended.
|
||||
*/
|
||||
end: number;
|
||||
|
||||
/**
|
||||
* The number of milliseconds it took to compile the Sass file. This is
|
||||
* always equal to `start` minus `end`.
|
||||
*/
|
||||
duration: number;
|
||||
|
||||
/**
|
||||
* An array of the absolute paths of all Sass files loaded during
|
||||
* compilation. If a stylesheet was loaded from a {@link LegacyImporter}
|
||||
* that returned the stylesheet’s contents, the raw string of the `@use` or
|
||||
* `@import` that loaded that stylesheet included in this array.
|
||||
*/
|
||||
includedFiles: string[];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* This function synchronously compiles a Sass file to CSS. If it succeeds, it
|
||||
* returns the result, and if it fails it throws an error.
|
||||
*
|
||||
* **Heads up!** When using the `sass-embedded` npm package, **{@link render}
|
||||
* is almost always faster than {@link renderSync}**, due to the overhead of
|
||||
* emulating synchronous messaging with worker threads and concurrent
|
||||
* compilations being blocked on main thread.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const sass = require('sass'); // or require('node-sass');
|
||||
*
|
||||
* const result = sass.renderSync({file: "style.scss"});
|
||||
* // ...
|
||||
* ```
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated Use {@link compile} or {@link compileString} instead.
|
||||
*/
|
||||
export function renderSync(options: LegacyOptions<'sync'>): LegacyResult;
|
||||
|
||||
/**
|
||||
|
||||
* This function asynchronously compiles a Sass file to CSS, and calls
|
||||
* `callback` with a {@link LegacyResult} if compilation succeeds or {@link
|
||||
* LegacyException} if it fails.
|
||||
*
|
||||
* **Heads up!** When using the `sass` npm package, **{@link renderSync} is
|
||||
* almost twice as fast as {@link render}** by default, due to the overhead of
|
||||
* making the entire evaluation process asynchronous.
|
||||
*
|
||||
* ```js
|
||||
* const sass = require('sass'); // or require('node-sass');
|
||||
*
|
||||
* sass.render({
|
||||
* file: "style.scss"
|
||||
* }, function(err, result) {
|
||||
* // ...
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @category Legacy
|
||||
* @deprecated Use {@link compileAsync} or {@link compileStringAsync} instead.
|
||||
*/
|
||||
export function render(
|
||||
options: LegacyOptions<'async'>,
|
||||
callback: (exception?: LegacyException, result?: LegacyResult) => void
|
||||
): void;
|
||||
94
node_modules/.store/sass@1.69.5/node_modules/sass/types/logger/index.d.ts
generated
vendored
Normal file
94
node_modules/.store/sass@1.69.5/node_modules/sass/types/logger/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
import {SourceSpan} from './source_span';
|
||||
|
||||
export {SourceLocation} from './source_location';
|
||||
export {SourceSpan} from './source_span';
|
||||
|
||||
/**
|
||||
* An object that can be passed to {@link LegacySharedOptions.logger} to control
|
||||
* how Sass emits warnings and debug messages.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const fs = require('fs');
|
||||
* const sass = require('sass');
|
||||
*
|
||||
* let log = "";
|
||||
* sass.renderSync({
|
||||
* file: 'input.scss',
|
||||
* logger: {
|
||||
* warn(message, options) {
|
||||
* if (options.span) {
|
||||
* log += `${span.url}:${span.start.line}:${span.start.column}: ` +
|
||||
* `${message}\n`;
|
||||
* } else {
|
||||
* log += `::: ${message}\n`;
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* fs.writeFileSync('log.txt', log);
|
||||
* ```
|
||||
*
|
||||
* @category Logger
|
||||
*/
|
||||
export interface Logger {
|
||||
/**
|
||||
* This method is called when Sass emits a warning, whether due to a [`@warn`
|
||||
* rule](https://sass-lang.com/documentation/at-rules/warn) or a warning
|
||||
* generated by the Sass compiler.
|
||||
*
|
||||
* If this is `undefined`, Sass will print warnings to standard error.
|
||||
*
|
||||
* @param message - The warning message.
|
||||
* @param options.deprecation - Whether this is a deprecation warning.
|
||||
* @param options.span - The location in the Sass source code that generated this
|
||||
* warning.
|
||||
* @param options.stack - The Sass stack trace at the point the warning was issued.
|
||||
*/
|
||||
warn?(
|
||||
message: string,
|
||||
options: {
|
||||
deprecation: boolean;
|
||||
span?: SourceSpan;
|
||||
stack?: string;
|
||||
}
|
||||
): void;
|
||||
|
||||
/**
|
||||
* This method is called when Sass emits a debug message due to a [`@debug`
|
||||
* rule](https://sass-lang.com/documentation/at-rules/debug).
|
||||
*
|
||||
* If this is `undefined`, Sass will print debug messages to standard error.
|
||||
*
|
||||
* @param message - The debug message.
|
||||
* @param options.span - The location in the Sass source code that generated this
|
||||
* debug message.
|
||||
*/
|
||||
debug?(message: string, options: {span: SourceSpan}): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* A namespace for built-in {@link Logger}s.
|
||||
*
|
||||
* @category Logger
|
||||
* @compatibility dart: "1.43.0", node: false
|
||||
*/
|
||||
export namespace Logger {
|
||||
/**
|
||||
* A {@link Logger} that silently ignores all warnings and debug messages.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const sass = require('sass');
|
||||
*
|
||||
* const result = sass.renderSync({
|
||||
* file: 'input.scss',
|
||||
* logger: sass.Logger.silent,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export const silent: Logger;
|
||||
}
|
||||
21
node_modules/.store/sass@1.69.5/node_modules/sass/types/logger/source_location.d.ts
generated
vendored
Normal file
21
node_modules/.store/sass@1.69.5/node_modules/sass/types/logger/source_location.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* A specific location within a source file.
|
||||
*
|
||||
* This is always associated with a {@link SourceSpan} which indicates *which*
|
||||
* file it refers to.
|
||||
*
|
||||
* @category Logger
|
||||
*/
|
||||
export interface SourceLocation {
|
||||
/**
|
||||
* The 0-based index of this location within its source file, in terms of
|
||||
* UTF-16 code units.
|
||||
*/
|
||||
offset: number;
|
||||
|
||||
/** The 0-based line number of this location. */
|
||||
line: number;
|
||||
|
||||
/** The 0-based column number of this location. */
|
||||
column: number;
|
||||
}
|
||||
34
node_modules/.store/sass@1.69.5/node_modules/sass/types/logger/source_span.d.ts
generated
vendored
Normal file
34
node_modules/.store/sass@1.69.5/node_modules/sass/types/logger/source_span.d.ts
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
import {SourceLocation} from './source_location';
|
||||
|
||||
/**
|
||||
* A span of text within a source file.
|
||||
*
|
||||
* @category Logger
|
||||
*/
|
||||
export interface SourceSpan {
|
||||
/** The beginning of this span, inclusive. */
|
||||
start: SourceLocation;
|
||||
|
||||
/**
|
||||
* The end of this span, exclusive.
|
||||
*
|
||||
* If {@link start} and {@link end} refer to the same location, the span has
|
||||
* zero length and refers to the point immediately after {@link start} and
|
||||
* before the next character.
|
||||
*/
|
||||
end: SourceLocation;
|
||||
|
||||
/** The canonical URL of the file this span refers to. */
|
||||
url?: URL;
|
||||
|
||||
/** The text covered by the span. */
|
||||
text: string;
|
||||
|
||||
/**
|
||||
* Text surrounding the span.
|
||||
*
|
||||
* If this is set, it must include only whole lines, and it must include at
|
||||
* least all line(s) which are partially covered by this span.
|
||||
*/
|
||||
context?: string;
|
||||
}
|
||||
439
node_modules/.store/sass@1.69.5/node_modules/sass/types/options.d.ts
generated
vendored
Normal file
439
node_modules/.store/sass@1.69.5/node_modules/sass/types/options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,439 @@
|
||||
import {FileImporter, Importer} from './importer';
|
||||
import {Logger} from './logger';
|
||||
import {Value} from './value';
|
||||
import {PromiseOr} from './util/promise_or';
|
||||
|
||||
/**
|
||||
* Syntaxes supported by Sass:
|
||||
*
|
||||
* - `'scss'` is the [SCSS
|
||||
* syntax](https://sass-lang.com/documentation/syntax#scss).
|
||||
* - `'indented'` is the [indented
|
||||
* syntax](https://sass-lang.com/documentation/syntax#the-indented-syntax)
|
||||
* - `'css'` is plain CSS, which is parsed like SCSS but forbids the use of any
|
||||
* special Sass features.
|
||||
*
|
||||
* @category Options
|
||||
*/
|
||||
export type Syntax = 'scss' | 'indented' | 'css';
|
||||
|
||||
/**
|
||||
* Possible output styles for the compiled CSS:
|
||||
*
|
||||
* - `"expanded"` (the default for Dart Sass) writes each selector and
|
||||
* declaration on its own line.
|
||||
*
|
||||
* - `"compressed"` removes as many extra characters as possible, and writes
|
||||
* the entire stylesheet on a single line.
|
||||
*
|
||||
* @category Options
|
||||
*/
|
||||
export type OutputStyle = 'expanded' | 'compressed';
|
||||
|
||||
/**
|
||||
* A callback that implements a custom Sass function. This can be passed to
|
||||
* {@link Options.functions}.
|
||||
*
|
||||
* ```js
|
||||
* const result = sass.compile('style.scss', {
|
||||
* functions: {
|
||||
* "sum($arg1, $arg2)": (args) => {
|
||||
* const arg1 = args[0].assertNumber('arg1');
|
||||
* const value1 = arg1.value;
|
||||
* const value2 = args[1].assertNumber('arg2')
|
||||
* .convertValueToMatch(arg1, 'arg2', 'arg1');
|
||||
* return new sass.SassNumber(value1 + value2).coerceToMatch(arg1);
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @typeParam sync - A `CustomFunction<'sync'>` must return synchronously, but
|
||||
* in return it can be passed to {@link compile} and {@link compileString} in
|
||||
* addition to {@link compileAsync} and {@link compileStringAsync}.
|
||||
*
|
||||
* A `CustomFunction<'async'>` may either return synchronously or
|
||||
* asynchronously, but it can only be used with {@link compileAsync} and {@link
|
||||
* compileStringAsync}.
|
||||
*
|
||||
* @param args - An array of arguments passed by the function's caller. If the
|
||||
* function takes [arbitrary
|
||||
* arguments](https://sass-lang.com/documentation/at-rules/function#taking-arbitrary-arguments),
|
||||
* the last element will be a {@link SassArgumentList}.
|
||||
*
|
||||
* @returns The function's result. This may be in the form of a `Promise`, but
|
||||
* if it is the function may only be passed to {@link compileAsync} and {@link
|
||||
* compileStringAsync}, not {@link compile} or {@link compileString}.
|
||||
*
|
||||
* @throws any - This function may throw an error, which the Sass compiler will
|
||||
* treat as the function call failing. If the exception object has a `message`
|
||||
* property, it will be used as the wrapped exception's message; otherwise, the
|
||||
* exception object's `toString()` will be used. This means it's safe for custom
|
||||
* functions to throw plain strings.
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export type CustomFunction<sync extends 'sync' | 'async'> = (
|
||||
args: Value[]
|
||||
) => PromiseOr<Value, sync>;
|
||||
|
||||
/**
|
||||
* Options that can be passed to {@link compile}, {@link compileAsync}, {@link
|
||||
* compileString}, or {@link compileStringAsync}.
|
||||
*
|
||||
* @typeParam sync - This lets the TypeScript checker verify that asynchronous
|
||||
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
|
||||
* passed to {@link compile} or {@link compileString}.
|
||||
*
|
||||
* @category Options
|
||||
*/
|
||||
export interface Options<sync extends 'sync' | 'async'> {
|
||||
/**
|
||||
* If this is `true`, the compiler will exclusively use ASCII characters in
|
||||
* its error and warning messages. Otherwise, it may use non-ASCII Unicode
|
||||
* characters as well.
|
||||
*
|
||||
* @defaultValue `false`
|
||||
* @category Messages
|
||||
*/
|
||||
alertAscii?: boolean;
|
||||
|
||||
/**
|
||||
* If this is `true`, the compiler will use ANSI color escape codes in its
|
||||
* error and warning messages. If it's `false`, it won't use these. If it's
|
||||
* undefined, the compiler will determine whether or not to use colors
|
||||
* depending on whether the user is using an interactive terminal.
|
||||
*
|
||||
* @category Messages
|
||||
*/
|
||||
alertColor?: boolean;
|
||||
|
||||
/**
|
||||
* If `true`, the compiler may prepend `@charset "UTF-8";` or U+FEFF
|
||||
* (byte-order marker) if it outputs non-ASCII CSS.
|
||||
*
|
||||
* If `false`, the compiler never emits these byte sequences. This is ideal
|
||||
* when concatenating or embedding in HTML `<style>` tags. (The output will
|
||||
* still be UTF-8.)
|
||||
*
|
||||
* @defaultValue `true`
|
||||
* @category Output
|
||||
* @compatibility dart: "1.54.0", node: false
|
||||
*/
|
||||
charset?: boolean;
|
||||
|
||||
/**
|
||||
* Additional built-in Sass functions that are available in all stylesheets.
|
||||
* This option takes an object whose keys are Sass function signatures like
|
||||
* you'd write for the [`@function
|
||||
* rule`](https://sass-lang.com/documentation/at-rules/function) and whose
|
||||
* values are {@link CustomFunction}s.
|
||||
*
|
||||
* Functions are passed subclasses of {@link Value}, and must return the same.
|
||||
* If the return value includes {@link SassCalculation}s they will be
|
||||
* simplified before being returned.
|
||||
*
|
||||
* When writing custom functions, it's important to make them as user-friendly
|
||||
* and as close to the standards set by Sass's core functions as possible. Some
|
||||
* good guidelines to follow include:
|
||||
*
|
||||
* * Use `Value.assert*` methods, like {@link Value.assertString}, to cast
|
||||
* untyped `Value` objects to more specific types. For values that were
|
||||
* passed directly as arguments, pass in the argument name as well. This
|
||||
* ensures that the user gets good error messages when they pass in the
|
||||
* wrong type to your function.
|
||||
*
|
||||
* * Individual classes may have more specific `assert*` methods, like {@link
|
||||
* SassNumber.assertInt}, which should be used when possible.
|
||||
*
|
||||
* * In Sass, every value counts as a list. Rather than trying to detect the
|
||||
* {@link SassList} type, you should use {@link Value.asList} to treat all
|
||||
* values as lists.
|
||||
*
|
||||
* * When manipulating values like lists, strings, and numbers that have
|
||||
* metadata (comma versus space separated, bracketed versus unbracketed,
|
||||
* quoted versus unquoted, units), the output metadata should match the
|
||||
* input metadata.
|
||||
*
|
||||
* * When in doubt, lists should default to comma-separated, strings should
|
||||
* default to quoted, and numbers should default to unitless.
|
||||
*
|
||||
* * In Sass, lists and strings use one-based indexing and use negative
|
||||
* indices to index from the end of value. Functions should follow these
|
||||
* conventions. {@link Value.sassIndexToListIndex} and {@link
|
||||
* SassString.sassIndexToStringIndex} can be used to do this automatically.
|
||||
*
|
||||
* * String indexes in Sass refer to Unicode code points while JavaScript
|
||||
* string indices refer to UTF-16 code units. For example, the character
|
||||
* U+1F60A SMILING FACE WITH SMILING EYES is a single Unicode code point but
|
||||
* is represented in UTF-16 as two code units (`0xD83D` and `0xDE0A`). So in
|
||||
* JavaScript, `"a😊b".charCodeAt(1)` returns `0xD83D`, whereas in Sass
|
||||
* `str-slice("a😊b", 1, 1)` returns `"😊"`. Functions should follow Sass's
|
||||
* convention. {@link SassString.sassIndexToStringIndex} can be used to do
|
||||
* this automatically, and the {@link SassString.sassLength} getter can be
|
||||
* used to access a string's length in code points.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* sass.compileString(`
|
||||
* h1 {
|
||||
* font-size: pow(2, 5) * 1px;
|
||||
* }`, {
|
||||
* functions: {
|
||||
* // Note: in real code, you should use `math.pow()` from the built-in
|
||||
* // `sass:math` module.
|
||||
* 'pow($base, $exponent)': function(args) {
|
||||
* const base = args[0].assertNumber('base').assertNoUnits('base');
|
||||
* const exponent =
|
||||
* args[1].assertNumber('exponent').assertNoUnits('exponent');
|
||||
*
|
||||
* return new sass.SassNumber(Math.pow(base.value, exponent.value));
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @category Plugins
|
||||
*/
|
||||
functions?: Record<string, CustomFunction<sync>>;
|
||||
|
||||
/**
|
||||
* Custom importers that control how Sass resolves loads from rules like
|
||||
* [`@use`](https://sass-lang.com/documentation/at-rules/use) and
|
||||
* [`@import`](https://sass-lang.com/documentation/at-rules/import).
|
||||
*
|
||||
* Loads are resolved by trying, in order:
|
||||
*
|
||||
* - The importer that was used to load the current stylesheet, with the
|
||||
* loaded URL resolved relative to the current stylesheet's canonical URL.
|
||||
*
|
||||
* - Each {@link Importer} or {@link FileImporter} in {@link importers}, in
|
||||
* order.
|
||||
*
|
||||
* - Each load path in {@link loadPaths}, in order.
|
||||
*
|
||||
* If none of these return a Sass file, the load fails and Sass throws an
|
||||
* error.
|
||||
*
|
||||
* @category Plugins
|
||||
*/
|
||||
importers?: (Importer<sync> | FileImporter<sync>)[];
|
||||
|
||||
/**
|
||||
* Paths in which to look for stylesheets loaded by rules like
|
||||
* [`@use`](https://sass-lang.com/documentation/at-rules/use) and
|
||||
* [`@import`](https://sass-lang.com/documentation/at-rules/import).
|
||||
*
|
||||
* A load path `loadPath` is equivalent to the following {@link FileImporter}:
|
||||
*
|
||||
* ```js
|
||||
* {
|
||||
* findFileUrl(url) {
|
||||
* // Load paths only support relative URLs.
|
||||
* if (/^[a-z]+:/i.test(url)) return null;
|
||||
* return new URL(url, pathToFileURL(loadPath));
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @category Input
|
||||
*/
|
||||
loadPaths?: string[];
|
||||
|
||||
/**
|
||||
* An object to use to handle warnings and/or debug messages from Sass.
|
||||
*
|
||||
* By default, Sass emits warnings and debug messages to standard error, but
|
||||
* if {@link Logger.warn} or {@link Logger.debug} is set, this will invoke
|
||||
* them instead.
|
||||
*
|
||||
* The special value {@link Logger.silent} can be used to easily silence all
|
||||
* messages.
|
||||
*
|
||||
* @category Messages
|
||||
*/
|
||||
logger?: Logger;
|
||||
|
||||
/**
|
||||
* If this option is set to `true`, Sass won’t print warnings that are caused
|
||||
* by dependencies. A “dependency” is defined as any file that’s loaded
|
||||
* through {@link loadPaths} or {@link importers}. Stylesheets that are
|
||||
* imported relative to the entrypoint are not considered dependencies.
|
||||
*
|
||||
* This is useful for silencing deprecation warnings that you can’t fix on
|
||||
* your own. However, please <em>also</em> notify your dependencies of the deprecations
|
||||
* so that they can get fixed as soon as possible!
|
||||
*
|
||||
* **Heads up!** If {@link compileString} or {@link compileStringAsync} is
|
||||
* called without {@link StringOptionsWithoutImporter.url}, <em>all</em>
|
||||
* stylesheets it loads will be considered dependencies. Since it doesn’t have
|
||||
* a path of its own, everything it loads is coming from a load path rather
|
||||
* than a relative import.
|
||||
*
|
||||
* @defaultValue `false`
|
||||
* @category Messages
|
||||
*/
|
||||
quietDeps?: boolean;
|
||||
|
||||
/**
|
||||
* Whether or not Sass should generate a source map. If it does, the source
|
||||
* map will be available as {@link CompileResult.sourceMap}.
|
||||
*
|
||||
* **Heads up!** Sass doesn't automatically add a `sourceMappingURL` comment
|
||||
* to the generated CSS. It's up to callers to do that, since callers have
|
||||
* full knowledge of where the CSS and the source map will exist in relation
|
||||
* to one another and how they'll be served to the browser.
|
||||
*
|
||||
* @defaultValue `false`
|
||||
* @category Output
|
||||
*/
|
||||
sourceMap?: boolean;
|
||||
|
||||
/**
|
||||
* Whether Sass should include the sources in the generated source map.
|
||||
*
|
||||
* This option has no effect if {@link sourceMap} is `false`.
|
||||
*
|
||||
* @defaultValue `false`
|
||||
* @category Output
|
||||
*/
|
||||
sourceMapIncludeSources?: boolean;
|
||||
|
||||
/**
|
||||
* The {@link OutputStyle} of the compiled CSS.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const source = `
|
||||
* h1 {
|
||||
* font-size: 40px;
|
||||
* code {
|
||||
* font-face: Roboto Mono;
|
||||
* }
|
||||
* }`;
|
||||
*
|
||||
* let result = sass.compileString(source, {style: "expanded"});
|
||||
* console.log(result.css.toString());
|
||||
* // h1 {
|
||||
* // font-size: 40px;
|
||||
* // }
|
||||
* // h1 code {
|
||||
* // font-face: Roboto Mono;
|
||||
* // }
|
||||
*
|
||||
* result = sass.compileString(source, {style: "compressed"})
|
||||
* console.log(result.css.toString());
|
||||
* // h1{font-size:40px}h1 code{font-face:Roboto Mono}
|
||||
* ```
|
||||
*
|
||||
* @category Output
|
||||
*/
|
||||
style?: OutputStyle;
|
||||
|
||||
/**
|
||||
* By default, Dart Sass will print only five instances of the same
|
||||
* deprecation warning per compilation to avoid deluging users in console
|
||||
* noise. If you set `verbose` to `true`, it will instead print every
|
||||
* deprecation warning it encounters.
|
||||
*
|
||||
* @defaultValue `false`
|
||||
* @category Messages
|
||||
*/
|
||||
verbose?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options that can be passed to {@link compileString} or {@link
|
||||
* compileStringAsync}.
|
||||
*
|
||||
* If the {@link StringOptionsWithImporter.importer} field isn't passed, the
|
||||
* entrypoint file can load files relative to itself if a `file://` URL is
|
||||
* passed to the {@link url} field.
|
||||
*
|
||||
* @typeParam sync - This lets the TypeScript checker verify that asynchronous
|
||||
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
|
||||
* passed to {@link compile} or {@link compileString}.
|
||||
*
|
||||
* @category Options
|
||||
*/
|
||||
export interface StringOptionsWithoutImporter<sync extends 'sync' | 'async'>
|
||||
extends Options<sync> {
|
||||
/**
|
||||
* The {@link Syntax} to use to parse the entrypoint stylesheet.
|
||||
*
|
||||
* @default `'scss'`
|
||||
*
|
||||
* @category Input
|
||||
*/
|
||||
syntax?: Syntax;
|
||||
|
||||
/**
|
||||
* The canonical URL of the entrypoint stylesheet.
|
||||
*
|
||||
* A relative load's URL is first resolved relative to {@link url}, then
|
||||
* resolved to a file on disk if it's a `file://` URL. If it can't be resolved
|
||||
* to a file on disk, it's then passed to {@link importers} and {@link
|
||||
* loadPaths}.
|
||||
*
|
||||
* @category Input
|
||||
*/
|
||||
url?: URL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options that can be passed to {@link compileString} or {@link
|
||||
* compileStringAsync}.
|
||||
*
|
||||
* If the {@link StringOptionsWithImporter.importer} field is passed, the
|
||||
* entrypoint file uses it to load files relative to itself and the {@link url}
|
||||
* field is mandatory.
|
||||
*
|
||||
* @typeParam sync - This lets the TypeScript checker verify that asynchronous
|
||||
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
|
||||
* passed to {@link compile} or {@link compileString}.
|
||||
*
|
||||
* @category Options
|
||||
*/
|
||||
export interface StringOptionsWithImporter<sync extends 'sync' | 'async'>
|
||||
extends StringOptionsWithoutImporter<sync> {
|
||||
/**
|
||||
* The importer to use to handle loads that are relative to the entrypoint
|
||||
* stylesheet.
|
||||
*
|
||||
* A relative load's URL is first resolved relative to {@link url}, then
|
||||
* passed to {@link importer}. If the importer doesn't recognize it, it's then
|
||||
* passed to {@link importers} and {@link loadPaths}.
|
||||
*
|
||||
* @category Input
|
||||
*/
|
||||
importer: Importer<sync> | FileImporter<sync>;
|
||||
|
||||
/**
|
||||
* The canonical URL of the entrypoint stylesheet. If this is passed along
|
||||
* with {@link importer}, it's used to resolve relative loads in the
|
||||
* entrypoint stylesheet.
|
||||
*
|
||||
* @category Input
|
||||
*/
|
||||
url: URL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options that can be passed to {@link compileString} or {@link
|
||||
* compileStringAsync}.
|
||||
*
|
||||
* This is a {@link StringOptionsWithImporter} if it has a {@link
|
||||
* StringOptionsWithImporter.importer} field, and a {@link
|
||||
* StringOptionsWithoutImporter} otherwise.
|
||||
*
|
||||
* @typeParam sync - This lets the TypeScript checker verify that asynchronous
|
||||
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
|
||||
* passed to {@link compile} or {@link compileString}.
|
||||
*
|
||||
* @category Options
|
||||
*/
|
||||
export type StringOptions<sync extends 'sync' | 'async'> =
|
||||
| StringOptionsWithImporter<sync>
|
||||
| StringOptionsWithoutImporter<sync>;
|
||||
17
node_modules/.store/sass@1.69.5/node_modules/sass/types/util/promise_or.d.ts
generated
vendored
Normal file
17
node_modules/.store/sass@1.69.5/node_modules/sass/types/util/promise_or.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* A utility type for choosing between synchronous and asynchronous return
|
||||
* values.
|
||||
*
|
||||
* This is used as the return value for plugins like {@link CustomFunction},
|
||||
* {@link Importer}, and {@link FileImporter} so that TypeScript enforces that
|
||||
* asynchronous plugins are only passed to {@link compileAsync} and {@link
|
||||
* compileStringAsync}, not {@link compile} or {@link compileString}.
|
||||
*
|
||||
* @typeParam sync - If this is `'sync'`, this can only be a `T`. If it's
|
||||
* `'async'`, this can be either a `T` or a `Promise<T>`.
|
||||
*
|
||||
* @category Other
|
||||
*/
|
||||
export type PromiseOr<T, sync extends 'sync' | 'async'> = sync extends 'async'
|
||||
? T | Promise<T>
|
||||
: T;
|
||||
47
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/argument_list.d.ts
generated
vendored
Normal file
47
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/argument_list.d.ts
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import {List, OrderedMap} from 'immutable';
|
||||
|
||||
import {Value} from './index';
|
||||
import {SassList, ListSeparator} from './list';
|
||||
|
||||
/**
|
||||
* Sass's [argument list
|
||||
* type](https://sass-lang.com/documentation/values/lists#argument-lists).
|
||||
*
|
||||
* An argument list comes from a rest argument. It's distinct from a normal
|
||||
* {@link SassList} in that it may contain a keyword map as well as the
|
||||
* positional arguments.
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export class SassArgumentList extends SassList {
|
||||
/**
|
||||
* Creates a new argument list.
|
||||
*
|
||||
* @param contents - The positional arguments that make up the primary
|
||||
* contents of the list. This may be either a plain JavaScript array or an
|
||||
* immutable {@link List} from the [`immutable`
|
||||
* package](https://immutable-js.com/).
|
||||
*
|
||||
* @param keywords - The keyword arguments attached to this argument list,
|
||||
* whose names should exclude `$`. This can be either a plain JavaScript
|
||||
* object with argument names as fields, or an immutable {@link OrderedMap}
|
||||
* from the [`immutable` package](https://immutable-js.com/)
|
||||
*
|
||||
* @param separator - The separator for this list. Defaults to `','`.
|
||||
*/
|
||||
constructor(
|
||||
contents: Value[] | List<Value>,
|
||||
keywords: Record<string, Value> | OrderedMap<string, Value>,
|
||||
separator?: ListSeparator
|
||||
);
|
||||
|
||||
/**
|
||||
* The keyword arguments attached to this argument list.
|
||||
*
|
||||
* The argument names don't include `$`.
|
||||
*
|
||||
* @returns An immutable {@link OrderedMap} from the [`immutable`
|
||||
* package](https://immutable-js.com/).
|
||||
*/
|
||||
get keywords(): OrderedMap<string, Value>;
|
||||
}
|
||||
29
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/boolean.d.ts
generated
vendored
Normal file
29
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/boolean.d.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import {Value} from './index';
|
||||
|
||||
/**
|
||||
* Sass's [`true` value](https://sass-lang.com/documentation/values/booleans).
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export const sassTrue: SassBoolean;
|
||||
|
||||
/**
|
||||
* Sass's [`false` value](https://sass-lang.com/documentation/values/booleans).
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export const sassFalse: SassBoolean;
|
||||
|
||||
/**
|
||||
* Sass's [boolean type](https://sass-lang.com/documentation/values/booleans).
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export class SassBoolean extends Value {
|
||||
private constructor();
|
||||
|
||||
/**
|
||||
* Whether this value is `true` or `false`.
|
||||
*/
|
||||
get value(): boolean;
|
||||
}
|
||||
137
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/calculation.d.ts
generated
vendored
Normal file
137
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/calculation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
import {List, ValueObject} from 'immutable';
|
||||
import {Value, SassNumber, SassString} from './index';
|
||||
|
||||
/**
|
||||
* The type of values that can be arguments to a {@link SassCalculation}.
|
||||
* @category Custom Function
|
||||
* */
|
||||
export type CalculationValue =
|
||||
| SassNumber
|
||||
| SassCalculation
|
||||
| SassString
|
||||
| CalculationOperation
|
||||
| CalculationInterpolation;
|
||||
|
||||
/**
|
||||
* Sass's [calculation
|
||||
* type](https://sass-lang.com/documentation/values/calculations).
|
||||
*
|
||||
* Note: in the JS API calculations are not simplified eagerly. This also means
|
||||
* that unsimplified calculations are not equal to the numbers they would be
|
||||
* simplified to.
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export class SassCalculation extends Value {
|
||||
/**
|
||||
* Creates a value that represents `calc(argument)`.
|
||||
*
|
||||
* @throws `Error` if `argument` is a quoted {@link SassString}
|
||||
* @returns A calculation with the name `calc` and `argument` as its single
|
||||
* argument.
|
||||
*/
|
||||
static calc(argument: CalculationValue): SassCalculation;
|
||||
|
||||
/**
|
||||
* Creates a value that represents `min(arguments...)`.
|
||||
*
|
||||
* @throws `Error` if `arguments` contains a quoted {@link SassString}
|
||||
* @returns A calculation with the name `min` and `arguments` as its
|
||||
* arguments.
|
||||
*/
|
||||
static min(
|
||||
arguments: CalculationValue[] | List<CalculationValue>
|
||||
): SassCalculation;
|
||||
|
||||
/**
|
||||
* Creates a value that represents `max(arguments...)`.
|
||||
*
|
||||
* @throws `Error` if `arguments` contains a quoted {@link SassString}
|
||||
* @returns A calculation with the name `max` and `arguments` as its
|
||||
* arguments.
|
||||
*/
|
||||
static max(
|
||||
arguments: CalculationValue[] | List<CalculationValue>
|
||||
): SassCalculation;
|
||||
|
||||
/**
|
||||
* Creates a value that represents `clamp(value, min, max)`.
|
||||
*
|
||||
* @throws `Error` if any of `value`, `min`, or `max` are a quoted
|
||||
* {@link SassString}.
|
||||
* @throws `Error` if `value` is undefined and `max` is not undefined.
|
||||
* @throws `Error` if either `value` or `max` is undefined and neither `min`
|
||||
nor `value` is a {@link SassString} or {@link CalculationInterpolation}.
|
||||
@returns A calculation with the name `clamp` and `min`, `value`, and `max`
|
||||
as it's arguments, excluding any arguments that are undefined.
|
||||
*/
|
||||
static clamp(
|
||||
min: CalculationValue,
|
||||
value?: CalculationValue,
|
||||
max?: CalculationValue
|
||||
): SassCalculation;
|
||||
|
||||
/** Returns the calculation's `name` field. */
|
||||
get name(): string;
|
||||
|
||||
/** Returns a list of the calculation's `arguments` */
|
||||
get arguments(): List<CalculationValue>;
|
||||
}
|
||||
|
||||
/**
|
||||
* The set of possible operators in a Sass calculation.
|
||||
* @category Custom Function
|
||||
*/
|
||||
export type CalculationOperator = '+' | '-' | '*' | '/';
|
||||
|
||||
/**
|
||||
* A binary operation that can appear in a {@link SassCalculation}.
|
||||
* @category Custom Function
|
||||
*/
|
||||
export class CalculationOperation implements ValueObject {
|
||||
/**
|
||||
* Creates a Sass CalculationOperation with the given `operator`, `left`, and
|
||||
* `right` values.
|
||||
* @throws `Error` if `left` or `right` are quoted {@link SassString}s.
|
||||
*/
|
||||
constructor(
|
||||
operator: CalculationOperator,
|
||||
left: CalculationValue,
|
||||
right: CalculationValue
|
||||
);
|
||||
|
||||
/** Returns the operation's `operator` field. */
|
||||
get operator(): CalculationOperator;
|
||||
|
||||
/** Returns the operation's `left` field. */
|
||||
get left(): CalculationValue;
|
||||
|
||||
/** Returns the operation's `right` field. */
|
||||
get right(): CalculationValue;
|
||||
|
||||
equals(other: unknown): boolean;
|
||||
|
||||
hashCode(): number;
|
||||
}
|
||||
|
||||
/**
|
||||
* A string injected into a {@link SassCalculation} using interpolation. Unlike
|
||||
* unquoted strings, interpolations are always surrounded in parentheses when
|
||||
* they appear in {@link CalculationOperation}s.
|
||||
* @category Custom Function
|
||||
*/
|
||||
export class CalculationInterpolation implements ValueObject {
|
||||
/**
|
||||
* Creates a Sass CalculationInterpolation with the given `value`.
|
||||
*/
|
||||
constructor(value: string);
|
||||
|
||||
/**
|
||||
* Returns the interpolation's `value` field.
|
||||
*/
|
||||
get value(): string;
|
||||
|
||||
equals(other: unknown): boolean;
|
||||
|
||||
hashCode(): number;
|
||||
}
|
||||
128
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/color.d.ts
generated
vendored
Normal file
128
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/color.d.ts
generated
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
import {Value} from './index';
|
||||
|
||||
/**
|
||||
* Sass's [color type](https://sass-lang.com/documentation/values/colors).
|
||||
*
|
||||
* No matter what representation was originally used to create this color, all
|
||||
* of its channels are accessible.
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export class SassColor extends Value {
|
||||
/**
|
||||
* Creates an RGB color.
|
||||
*
|
||||
* **Only** `undefined` should be passed to indicate a missing `alpha`. If
|
||||
* `null` is passed instead, it will be treated as a [missing component] in
|
||||
* future versions of Dart Sass. See [breaking changes] for details.
|
||||
*
|
||||
* [missing component]: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#missing_color_components
|
||||
* [breaking changes]: /documentation/breaking-changes/null-alpha
|
||||
*
|
||||
* @throws `Error` if `red`, `green`, and `blue` aren't between `0` and
|
||||
* `255`, or if `alpha` isn't between `0` and `1`.
|
||||
*/
|
||||
constructor(options: {
|
||||
red: number;
|
||||
green: number;
|
||||
blue: number;
|
||||
alpha?: number;
|
||||
});
|
||||
|
||||
/**
|
||||
* Creates an HSL color.
|
||||
*
|
||||
* **Only** `undefined` should be passed to indicate a missing `alpha`. If
|
||||
* `null` is passed instead, it will be treated as a [missing component] in
|
||||
* future versions of Dart Sass. See [breaking changes] for details.
|
||||
*
|
||||
* [missing component]: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#missing_color_components
|
||||
* [breaking changes]: /documentation/breaking-changes/null-alpha
|
||||
*
|
||||
* @throws `Error` if `saturation` or `lightness` aren't between `0` and
|
||||
* `100`, or if `alpha` isn't between `0` and `1`.
|
||||
*/
|
||||
constructor(options: {
|
||||
hue: number;
|
||||
saturation: number;
|
||||
lightness: number;
|
||||
alpha?: number;
|
||||
});
|
||||
|
||||
/**
|
||||
* Creates an HWB color.
|
||||
*
|
||||
* **Only** `undefined` should be passed to indicate a missing `alpha`. If
|
||||
* `null` is passed instead, it will be treated as a [missing component] in
|
||||
* future versions of Dart Sass. See [breaking changes] for details.
|
||||
*
|
||||
* [missing component]: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#missing_color_components
|
||||
* [breaking changes]: /documentation/breaking-changes/null-alpha
|
||||
*
|
||||
* @throws `Error` if `whiteness` or `blackness` aren't between `0` and `100`,
|
||||
* or if `alpha` isn't between `0` and `1`.
|
||||
*/
|
||||
constructor(options: {
|
||||
hue: number;
|
||||
whiteness: number;
|
||||
blackness: number;
|
||||
alpha?: number;
|
||||
});
|
||||
|
||||
/** This color's red channel, between `0` and `255`. */
|
||||
get red(): number;
|
||||
|
||||
/** This color's green channel, between `0` and `255`. */
|
||||
get green(): number;
|
||||
|
||||
/** This color's blue channel, between `0` and `255`. */
|
||||
get blue(): number;
|
||||
|
||||
/** This color's hue, between `0` and `360`. */
|
||||
get hue(): number;
|
||||
|
||||
/** This color's saturation, between `0` and `100`. */
|
||||
get saturation(): number;
|
||||
|
||||
/** This color's lightness, between `0` and `100`. */
|
||||
get lightness(): number;
|
||||
|
||||
/** This color's whiteness, between `0` and `100`. */
|
||||
get whiteness(): number;
|
||||
|
||||
/** This color's blackness, between `0` and `100`. */
|
||||
get blackness(): number;
|
||||
|
||||
/** This color's alpha channel, between `0` and `1`. */
|
||||
get alpha(): number;
|
||||
|
||||
/**
|
||||
* Changes one or more of this color's RGB channels and returns the result.
|
||||
*/
|
||||
change(options: {
|
||||
red?: number;
|
||||
green?: number;
|
||||
blue?: number;
|
||||
alpha?: number;
|
||||
}): SassColor;
|
||||
|
||||
/**
|
||||
* Changes one or more of this color's HSL channels and returns the result.
|
||||
*/
|
||||
change(options: {
|
||||
hue?: number;
|
||||
saturation?: number;
|
||||
lightness?: number;
|
||||
alpha?: number;
|
||||
}): SassColor;
|
||||
|
||||
/**
|
||||
* Changes one or more of this color's HWB channels and returns the result.
|
||||
*/
|
||||
change(options: {
|
||||
hue?: number;
|
||||
whiteness?: number;
|
||||
blackness?: number;
|
||||
alpha?: number;
|
||||
}): SassColor;
|
||||
}
|
||||
22
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/function.d.ts
generated
vendored
Normal file
22
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/function.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import {Value} from './index';
|
||||
|
||||
/**
|
||||
* Sass's [function type](https://sass-lang.com/documentation/values/functions).
|
||||
*
|
||||
* **Heads up!** Although first-class Sass functions can be processed by custom
|
||||
* functions, there's no way to invoke them outside of a Sass stylesheet.
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export class SassFunction extends Value {
|
||||
/**
|
||||
* Creates a new first-class function that can be invoked using
|
||||
* [`meta.call()`](https://sass-lang.com/documentation/modules/meta#call).
|
||||
*
|
||||
* @param signature - The function signature, like you'd write for the
|
||||
* [`@function rule`](https://sass-lang.com/documentation/at-rules/function).
|
||||
* @param callback - The callback that's invoked when this function is called,
|
||||
* just like for a {@link CustomFunction}.
|
||||
*/
|
||||
constructor(signature: string, callback: (args: Value[]) => Value);
|
||||
}
|
||||
199
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/index.d.ts
generated
vendored
Normal file
199
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,199 @@
|
||||
import {List, ValueObject} from 'immutable';
|
||||
|
||||
import {SassBoolean} from './boolean';
|
||||
import {SassCalculation} from './calculation';
|
||||
import {SassColor} from './color';
|
||||
import {SassFunction} from './function';
|
||||
import {ListSeparator} from './list';
|
||||
import {SassMap} from './map';
|
||||
import {SassMixin} from './mixin';
|
||||
import {SassNumber} from './number';
|
||||
import {SassString} from './string';
|
||||
|
||||
export {SassArgumentList} from './argument_list';
|
||||
export {SassBoolean, sassTrue, sassFalse} from './boolean';
|
||||
export {
|
||||
SassCalculation,
|
||||
CalculationValue,
|
||||
CalculationOperator,
|
||||
CalculationOperation,
|
||||
CalculationInterpolation,
|
||||
} from './calculation';
|
||||
export {SassColor} from './color';
|
||||
export {SassFunction} from './function';
|
||||
export {SassList, ListSeparator} from './list';
|
||||
export {SassMap} from './map';
|
||||
export {SassMixin} from './mixin';
|
||||
export {SassNumber} from './number';
|
||||
export {SassString} from './string';
|
||||
|
||||
/**
|
||||
* Sass's [`null` value](https://sass-lang.com/documentation/values/null).
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export const sassNull: Value;
|
||||
|
||||
/**
|
||||
* The abstract base class of Sass's value types.
|
||||
*
|
||||
* This is passed to and returned by {@link CustomFunction}s, which are passed
|
||||
* into the Sass implementation using {@link Options.functions}.
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export abstract class Value implements ValueObject {
|
||||
protected constructor();
|
||||
|
||||
/**
|
||||
* This value as a list.
|
||||
*
|
||||
* All SassScript values can be used as lists. Maps count as lists of pairs,
|
||||
* and all other values count as single-value lists.
|
||||
*
|
||||
* @returns An immutable {@link List} from the [`immutable`
|
||||
* package](https://immutable-js.com/).
|
||||
*/
|
||||
get asList(): List<Value>;
|
||||
|
||||
/**
|
||||
* Whether this value as a list has brackets.
|
||||
*
|
||||
* All SassScript values can be used as lists. Maps count as lists of pairs,
|
||||
* and all other values count as single-value lists.
|
||||
*/
|
||||
get hasBrackets(): boolean;
|
||||
|
||||
/**
|
||||
* Whether the value counts as `true` in an `@if` statement and other
|
||||
* contexts.
|
||||
*/
|
||||
get isTruthy(): boolean;
|
||||
|
||||
/**
|
||||
* Returns JavaScript's `null` value if this is {@link sassNull}, and returns
|
||||
* `this` otherwise.
|
||||
*/
|
||||
get realNull(): null | Value;
|
||||
|
||||
/**
|
||||
* The separator for this value as a list.
|
||||
*
|
||||
* All SassScript values can be used as lists. Maps count as lists of pairs,
|
||||
* and all other values count as single-value lists.
|
||||
*/
|
||||
get separator(): ListSeparator;
|
||||
|
||||
/**
|
||||
* Converts `sassIndex` into a JavaScript-style index into the list returned
|
||||
* by {@link asList}.
|
||||
*
|
||||
* Sass indexes are one-based, while JavaScript indexes are zero-based. Sass
|
||||
* indexes may also be negative in order to index from the end of the list.
|
||||
*
|
||||
* @param sassIndex - The Sass-style index into this as a list.
|
||||
* @param name - The name of the function argument `sassIndex` came from
|
||||
* (without the `$`) if it came from an argument. Used for error reporting.
|
||||
* @throws `Error` If `sassIndex` isn't a number, if that number isn't an
|
||||
* integer, or if that integer isn't a valid index for {@link asList}.
|
||||
*/
|
||||
sassIndexToListIndex(sassIndex: Value, name?: string): number;
|
||||
|
||||
/**
|
||||
* Returns the value at index `index` in this value as a list, or `undefined`
|
||||
* if `index` isn't valid for this list.
|
||||
*
|
||||
* All SassScript values can be used as lists. Maps count as lists of pairs,
|
||||
* and all other values count as single-value lists.
|
||||
*
|
||||
* This is a shorthand for `this.asList.get(index)`, although it may be more
|
||||
* efficient in some cases.
|
||||
*
|
||||
* **Heads up!** This method uses the same indexing conventions as the
|
||||
* `immutable` package: unlike Sass the index of the first element is 0, but
|
||||
* like Sass negative numbers index from the end of the list.
|
||||
*/
|
||||
get(index: number): Value | undefined;
|
||||
|
||||
/**
|
||||
* Throws if `this` isn't a {@link SassBoolean}.
|
||||
*
|
||||
* **Heads up!** Functions should generally use {@link isTruthy} rather than
|
||||
* requiring a literal boolean.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
assertBoolean(name?: string): SassBoolean;
|
||||
|
||||
/**
|
||||
* Throws if `this` isn't a {@link SassCalculation}.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
assertCalculation(name?: string): SassCalculation;
|
||||
|
||||
/**
|
||||
* Throws if `this` isn't a {@link SassColor}.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
assertColor(name?: string): SassColor;
|
||||
|
||||
/**
|
||||
* Throws if `this` isn't a {@link SassFunction}.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
assertFunction(name?: string): SassFunction;
|
||||
|
||||
/**
|
||||
* Throws if `this` isn't a {@link SassMap}.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
assertMap(name?: string): SassMap;
|
||||
|
||||
/**
|
||||
* Throws if `this` isn't a {@link SassMixin}.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
assertMixin(name?: string): SassMixin;
|
||||
|
||||
/**
|
||||
* Throws if `this` isn't a {@link SassNumber}.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
assertNumber(name?: string): SassNumber;
|
||||
|
||||
/**
|
||||
* Throws if `this` isn't a {@link SassString}.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
assertString(name?: string): SassString;
|
||||
|
||||
/**
|
||||
* Returns `this` as a map if it counts as one (empty lists count as empty
|
||||
* maps) or `null` if it doesn't.
|
||||
*/
|
||||
tryMap(): SassMap | null;
|
||||
|
||||
/** Returns whether `this` represents the same value as `other`. */
|
||||
equals(other: Value): boolean;
|
||||
|
||||
/** Returns a hash code that can be used to store `this` in a hash map. */
|
||||
hashCode(): number;
|
||||
|
||||
/** @hidden */
|
||||
toString(): string;
|
||||
}
|
||||
54
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/list.d.ts
generated
vendored
Normal file
54
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/list.d.ts
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
import {List} from 'immutable';
|
||||
|
||||
import {Value} from './index';
|
||||
|
||||
/**
|
||||
* Possible separators used by Sass lists. The special separator `null` is only
|
||||
* used for lists with fewer than two elements, and indicates that the separator
|
||||
* has not yet been decided for this list.
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export type ListSeparator = ',' | '/' | ' ' | null;
|
||||
|
||||
/**
|
||||
* Sass's [list type](https://sass-lang.com/documentation/values/lists).
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export class SassList extends Value {
|
||||
/**
|
||||
* Creates a new list.
|
||||
*
|
||||
* @param contents - The contents of the list. This may be either a plain
|
||||
* JavaScript array or an immutable {@link List} from the [`immutable`
|
||||
* package](https://immutable-js.com/).
|
||||
*
|
||||
* @param options.separator - The separator to use between elements of this
|
||||
* list. Defaults to `','`.
|
||||
*
|
||||
* @param options.brackets - Whether the list has square brackets. Defaults to
|
||||
* `false`.
|
||||
*/
|
||||
constructor(
|
||||
contents: Value[] | List<Value>,
|
||||
options?: {
|
||||
separator?: ListSeparator;
|
||||
brackets?: boolean;
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Creates an empty list.
|
||||
*
|
||||
* @param options.separator - The separator to use between elements of this
|
||||
* list. Defaults to `','`.
|
||||
*
|
||||
* @param options.brackets - Whether the list has square brackets. Defaults to
|
||||
* `false`.
|
||||
*/
|
||||
constructor(options?: {separator?: ListSeparator; brackets?: boolean});
|
||||
|
||||
/** @hidden */
|
||||
get separator(): ListSeparator;
|
||||
}
|
||||
41
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/map.d.ts
generated
vendored
Normal file
41
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/map.d.ts
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import {OrderedMap} from 'immutable';
|
||||
|
||||
import {SassList} from './list';
|
||||
import {Value} from './index';
|
||||
|
||||
/**
|
||||
* Sass's [map type](https://sass-lang.com/documentation/values/maps).
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export class SassMap extends Value {
|
||||
/**
|
||||
* Creates a new map.
|
||||
*
|
||||
* @param contents - The contents of the map. This is an immutable
|
||||
* `OrderedMap` from the [`immutable` package](https://immutable-js.com/).
|
||||
* Defaults to an empty map.
|
||||
*/
|
||||
constructor(contents?: OrderedMap<Value, Value>);
|
||||
|
||||
/**
|
||||
* Returns the contents of this map as an immutable {@link OrderedMap} from the
|
||||
* [`immutable` package](https://immutable-js.com/).
|
||||
*/
|
||||
get contents(): OrderedMap<Value, Value>;
|
||||
|
||||
/**
|
||||
* Returns the value associated with `key` in this map, or `undefined` if
|
||||
* `key` isn't in the map.
|
||||
*
|
||||
* This is a shorthand for `this.contents.get(key)`, although it may be more
|
||||
* efficient in some cases.
|
||||
*/
|
||||
get(key: Value): Value | undefined;
|
||||
|
||||
/** Inherited from {@link Value.get}. */
|
||||
get(index: number): SassList | undefined;
|
||||
|
||||
/** @hidden */
|
||||
tryMap(): SassMap;
|
||||
}
|
||||
14
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/mixin.d.ts
generated
vendored
Normal file
14
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/mixin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import {Value} from './index';
|
||||
|
||||
/**
|
||||
* Sass's [mixin type](https://sass-lang.com/documentation/values/mixins).
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export class SassMixin extends Value {
|
||||
/**
|
||||
* It is not possible to construct a Sass mixin outside of Sass. Attempting to
|
||||
* construct one will throw an exception.
|
||||
*/
|
||||
constructor();
|
||||
}
|
||||
305
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/number.d.ts
generated
vendored
Normal file
305
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/number.d.ts
generated
vendored
Normal file
@@ -0,0 +1,305 @@
|
||||
import {List} from 'immutable';
|
||||
|
||||
import {Value} from './index';
|
||||
|
||||
/**
|
||||
* Sass's [number type](https://sass-lang.com/documentation/values/numbers).
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export class SassNumber extends Value {
|
||||
/**
|
||||
* Creates a new number with more complex units than just a single numerator.
|
||||
*
|
||||
* Upon construction, any compatible numerator and denominator units are
|
||||
* simplified away according to the conversion factor between them.
|
||||
*
|
||||
* @param value - The number's numeric value.
|
||||
*
|
||||
* @param unit - If this is a string, it's used as the single numerator unit
|
||||
* for the number.
|
||||
*
|
||||
* @param unit.numeratorUnits - If passed, these are the numerator units to
|
||||
* use for the number. This may be either a plain JavaScript array or an
|
||||
* immutable {@link List} from the [`immutable`
|
||||
* package](https://immutable-js.com/).
|
||||
*
|
||||
* @param unit.denominatorUnits - If passed, these are the denominator units
|
||||
* to use for the number. This may be either a plain JavaScript array or an
|
||||
* immutable {@link List} from the [`immutable`
|
||||
* package](https://immutable-js.com/).
|
||||
*/
|
||||
constructor(
|
||||
value: number,
|
||||
unit?:
|
||||
| string
|
||||
| {
|
||||
numeratorUnits?: string[] | List<string>;
|
||||
denominatorUnits?: string[] | List<string>;
|
||||
}
|
||||
);
|
||||
|
||||
/** This number's numeric value. */
|
||||
get value(): number;
|
||||
|
||||
/** Whether {@link value} is an integer according to Sass's equality logic. */
|
||||
get isInt(): boolean;
|
||||
|
||||
/**
|
||||
* If {@link value} is an integer according to {@link isInt}, returns {@link
|
||||
* value} rounded to that integer. If it's not an integer, returns `null`.
|
||||
*/
|
||||
get asInt(): number | null;
|
||||
|
||||
/**
|
||||
* This number's numerator units as an immutable {@link List} from the
|
||||
* [`immutable` package](https://immutable-js.com/).
|
||||
*/
|
||||
get numeratorUnits(): List<string>;
|
||||
|
||||
/**
|
||||
* This number's denominator units as an immutable {@link List} from the
|
||||
* [`immutable` package](https://immutable-js.com/).
|
||||
*/
|
||||
get denominatorUnits(): List<string>;
|
||||
|
||||
/** Whether this number has any numerator or denominator units. */
|
||||
get hasUnits(): boolean;
|
||||
|
||||
/**
|
||||
* If {@link value} is an integer according to {@link isInt}, returns it
|
||||
* rounded to that integer. Otherwise, throws an error.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
assertInt(name?: string): number;
|
||||
|
||||
/**
|
||||
* Returns {@link value} if it's within `min` and `max`. If {@link value} is
|
||||
* equal to `min` or `max` according to Sass's equality, returns `min` or
|
||||
* `max` respectively. Otherwise, throws an error.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
assertInRange(min: number, max: number, name?: string): number;
|
||||
|
||||
/**
|
||||
* If this number has no units, returns it. Otherwise, throws an error.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
assertNoUnits(name?: string): SassNumber;
|
||||
|
||||
/**
|
||||
* If this number has `unit` as its only unit (and as a numerator), returns
|
||||
* this number. Otherwise, throws an error.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
assertUnit(unit: string, name?: string): SassNumber;
|
||||
|
||||
/** Whether this number has `unit` as its only unit (and as a numerator). */
|
||||
hasUnit(unit: string): boolean;
|
||||
|
||||
/**
|
||||
* Whether this has exactly one numerator unit, and that unit is compatible
|
||||
* with `unit`.
|
||||
*/
|
||||
compatibleWithUnit(unit: string): boolean;
|
||||
|
||||
/**
|
||||
* Returns a copy of this number, converted to the units represented by
|
||||
* `newNumerators` and `newDenominators`.
|
||||
*
|
||||
* @throws `Error` if this number's units are incompatible with
|
||||
* `newNumerators` and `newDenominators`; or if this number is unitless and
|
||||
* either `newNumerators` or `newDenominators` are not empty, or vice-versa.
|
||||
*
|
||||
* @param newNumerators - The numerator units to convert this number to. This
|
||||
* may be either a plain JavaScript array or an immutable {@link List} from
|
||||
* the [`immutable` package](https://immutable-js.com/).
|
||||
*
|
||||
* @param newDenominators - The denominator units to convert this number to.
|
||||
* This may be either a plain JavaScript array or an immutable {@link List}
|
||||
* from the [`immutable` package](https://immutable-js.com/).
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
convert(
|
||||
newNumerators: string[] | List<string>,
|
||||
newDenominators: string[] | List<string>,
|
||||
name?: string
|
||||
): SassNumber;
|
||||
|
||||
/**
|
||||
* Returns a copy of this number, converted to the same units as `other`.
|
||||
*
|
||||
* @throws `Error` if this number's units are incompatible with `other`'s
|
||||
* units, or if either number is unitless but the other is not.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*
|
||||
* @param otherName - The name of the function argument `other` came from
|
||||
* (without the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
convertToMatch(
|
||||
other: SassNumber,
|
||||
name?: string,
|
||||
otherName?: string
|
||||
): SassNumber;
|
||||
|
||||
/**
|
||||
* Returns {@link value}, converted to the units represented by
|
||||
* `newNumerators` and `newDenominators`.
|
||||
*
|
||||
* @throws `Error` if this number's units are incompatible with
|
||||
* `newNumerators` and `newDenominators`; or if this number is unitless and
|
||||
* either `newNumerators` or `newDenominators` are not empty, or vice-versa.
|
||||
*
|
||||
* @param newNumerators - The numerator units to convert {@link value} to.
|
||||
* This may be either a plain JavaScript array or an immutable {@link List}
|
||||
* from the [`immutable` package](https://immutable-js.com/).
|
||||
*
|
||||
* @param newDenominators - The denominator units to convert {@link value} to.
|
||||
* This may be either a plain JavaScript array or an immutable {@link List}
|
||||
* from the [`immutable` package](https://immutable-js.com/).
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
convertValue(
|
||||
newNumerators: string[] | List<string>,
|
||||
newDenominators: string[] | List<string>,
|
||||
name?: string
|
||||
): number;
|
||||
|
||||
/**
|
||||
* Returns {@link value}, converted to the same units as `other`.
|
||||
*
|
||||
* @throws `Error` if this number's units are incompatible with `other`'s
|
||||
* units, or if either number is unitless but the other is not.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*
|
||||
* @param otherName - The name of the function argument `other` came from
|
||||
* (without the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
convertValueToMatch(
|
||||
other: SassNumber,
|
||||
name?: string,
|
||||
otherName?: string
|
||||
): number;
|
||||
|
||||
/**
|
||||
* Returns a copy of this number, converted to the units represented by
|
||||
* `newNumerators` and `newDenominators`.
|
||||
*
|
||||
* Unlike {@link convert} this does *not* throw an error if this number is
|
||||
* unitless and either `newNumerators` or `newDenominators` are not empty, or
|
||||
* vice-versa. Instead, it treats all unitless numbers as convertible to and
|
||||
* from all units without changing the value.
|
||||
*
|
||||
* @throws `Error` if this number's units are incompatible with
|
||||
* `newNumerators` and `newDenominators`.
|
||||
*
|
||||
* @param newNumerators - The numerator units to convert this number to. This
|
||||
* may be either a plain JavaScript array or an immutable {@link List} from
|
||||
* the [`immutable` package](https://immutable-js.com/).
|
||||
*
|
||||
* @param newDenominators - The denominator units to convert this number to.
|
||||
* This may be either a plain JavaScript array or an immutable {@link List}
|
||||
* from the [`immutable` package](https://immutable-js.com/).
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
coerce(
|
||||
newNumerators: string[] | List<string>,
|
||||
newDenominators: string[] | List<string>,
|
||||
name?: string
|
||||
): SassNumber;
|
||||
|
||||
/**
|
||||
* Returns a copy of this number, converted to the units represented by
|
||||
* `newNumerators` and `newDenominators`.
|
||||
*
|
||||
* Unlike {@link convertToMatch} this does *not* throw an error if this number
|
||||
* is unitless and either `newNumerators` or `newDenominators` are not empty,
|
||||
* or vice-versa. Instead, it treats all unitless numbers as convertible to
|
||||
* and from all units without changing the value.
|
||||
*
|
||||
* @throws `Error` if this number's units are incompatible with `other`'s
|
||||
* units.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*
|
||||
* @param otherName - The name of the function argument `other` came from
|
||||
* (without the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
coerceToMatch(
|
||||
other: SassNumber,
|
||||
name?: string,
|
||||
otherName?: string
|
||||
): SassNumber;
|
||||
|
||||
/**
|
||||
* Returns {@link value}, converted to the units represented by
|
||||
* `newNumerators` and `newDenominators`.
|
||||
*
|
||||
* Unlike {@link convertValue} this does *not* throw an error if this number
|
||||
* is unitless and either `newNumerators` or `newDenominators` are not empty,
|
||||
* or vice-versa. Instead, it treats all unitless numbers as convertible to
|
||||
* and from all units without changing the value.
|
||||
*
|
||||
* @throws `Error` if this number's units are incompatible with
|
||||
* `newNumerators` and `newDenominators`.
|
||||
*
|
||||
* @param newNumerators - The numerator units to convert {@link value} to.
|
||||
* This may be either a plain JavaScript array or an immutable {@link List}
|
||||
* from the [`immutable` package](https://immutable-js.com/).
|
||||
*
|
||||
* @param newDenominators - The denominator units to convert {@link value} to.
|
||||
* This may be either a plain JavaScript array or an immutable {@link List}
|
||||
* from the [`immutable` package](https://immutable-js.com/).
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
coerceValue(
|
||||
newNumerators: string[] | List<string>,
|
||||
newDenominators: string[] | List<string>,
|
||||
name?: string
|
||||
): number;
|
||||
|
||||
/**
|
||||
* Returns {@link value}, converted to the units represented by
|
||||
* `newNumerators` and `newDenominators`.
|
||||
*
|
||||
* Unlike {@link convertValueToMatch} this does *not* throw an error if this
|
||||
* number is unitless and either `newNumerators` or `newDenominators` are not
|
||||
* empty, or vice-versa. Instead, it treats all unitless numbers as
|
||||
* convertible to and from all units without changing the value.
|
||||
*
|
||||
* @throws `Error` if this number's units are incompatible with `other`'s
|
||||
* units.
|
||||
*
|
||||
* @param name - The name of the function argument `this` came from (without
|
||||
* the `$`) if it came from an argument. Used for error reporting.
|
||||
*
|
||||
* @param otherName - The name of the function argument `other` came from
|
||||
* (without the `$`) if it came from an argument. Used for error reporting.
|
||||
*/
|
||||
coerceValueToMatch(
|
||||
other: SassNumber,
|
||||
name?: string,
|
||||
otherName?: string
|
||||
): number;
|
||||
}
|
||||
84
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/string.d.ts
generated
vendored
Normal file
84
node_modules/.store/sass@1.69.5/node_modules/sass/types/value/string.d.ts
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
import {Value} from './index';
|
||||
|
||||
/**
|
||||
* Sass's [string type](https://sass-lang.com/documentation/values/strings).
|
||||
*
|
||||
* @category Custom Function
|
||||
*/
|
||||
export class SassString extends Value {
|
||||
/**
|
||||
* Creates a new string.
|
||||
*
|
||||
* @param text - The contents of the string. For quoted strings, this is the
|
||||
* semantic content—any escape sequences that were been written in the source
|
||||
* text are resolved to their Unicode values. For unquoted strings, though,
|
||||
* escape sequences are preserved as literal backslashes.
|
||||
*
|
||||
* @param options.quotes - Whether the string is quoted. Defaults to `true`.
|
||||
*/
|
||||
constructor(
|
||||
text: string,
|
||||
options?: {
|
||||
quotes?: boolean;
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Creates an empty string.
|
||||
*
|
||||
* @param options.quotes - Whether the string is quoted. Defaults to `true`.
|
||||
*/
|
||||
constructor(options?: {quotes?: boolean});
|
||||
|
||||
/**
|
||||
* The contents of the string.
|
||||
*
|
||||
* For quoted strings, this is the semantic content—any escape sequences that
|
||||
* were been written in the source text are resolved to their Unicode values.
|
||||
* For unquoted strings, though, escape sequences are preserved as literal
|
||||
* backslashes.
|
||||
*
|
||||
* This difference allows us to distinguish between identifiers with escapes,
|
||||
* such as `url\u28 http://example.com\u29`, and unquoted strings that contain
|
||||
* characters that aren't valid in identifiers, such as
|
||||
* `url(http://example.com)`. Unfortunately, it also means that we don't
|
||||
* consider `foo` and `f\6F\6F` the same string.
|
||||
*/
|
||||
get text(): string;
|
||||
|
||||
/** Whether this string has quotes. */
|
||||
get hasQuotes(): boolean;
|
||||
|
||||
/**
|
||||
* Sass's notion of this string's length.
|
||||
*
|
||||
* Sass treats strings as a series of Unicode code points while JavaScript
|
||||
* treats them as a series of UTF-16 code units. For example, the character
|
||||
* U+1F60A SMILING FACE WITH SMILING EYES is a single Unicode code point but
|
||||
* is represented in UTF-16 as two code units (`0xD83D` and `0xDE0A`). So in
|
||||
* JavaScript, `"n😊b".length` returns `4`, whereas in Sass
|
||||
* `string.length("n😊b")` returns `3`.
|
||||
*/
|
||||
get sassLength(): number;
|
||||
|
||||
/**
|
||||
* Converts `sassIndex` to a JavaScript index into {@link text}.
|
||||
*
|
||||
* Sass indices are one-based, while JavaScript indices are zero-based. Sass
|
||||
* indices may also be negative in order to index from the end of the string.
|
||||
*
|
||||
* In addition, Sass indices refer to Unicode code points while JavaScript
|
||||
* string indices refer to UTF-16 code units. For example, the character
|
||||
* U+1F60A SMILING FACE WITH SMILING EYES is a single Unicode code point but
|
||||
* is represented in UTF-16 as two code units (`0xD83D` and `0xDE0A`). So in
|
||||
* JavaScript, `"n😊b".charCodeAt(1)` returns `0xD83D`, whereas in Sass
|
||||
* `string.slice("n😊b", 1, 1)` returns `"😊"`.
|
||||
*
|
||||
* This function converts Sass's code point indices to JavaScript's code unit
|
||||
* indices. This means it's O(n) in the length of `text`.
|
||||
*
|
||||
* @throws `Error` - If `sassIndex` isn't a number, if that number isn't an
|
||||
* integer, or if that integer isn't a valid index for this string.
|
||||
*/
|
||||
sassIndexToStringIndex(sassIndex: Value, name?: string): number;
|
||||
}
|
||||
320
node_modules/.store/sass@1.69.5/node_modules/source-map-js/CHANGELOG.md
generated
vendored
Normal file
320
node_modules/.store/sass@1.69.5/node_modules/source-map-js/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,320 @@
|
||||
# Change Log
|
||||
|
||||
## 1.0.2
|
||||
|
||||
* Add types for path imports ([#13](https://github.com/7rulnik/source-map-js/pull/13)) [@TrySound](https://github.com/TrySound)
|
||||
|
||||
## 1.0.1
|
||||
|
||||
* Remove cleanComments optimization ([#10](https://github.com/7rulnik/source-map-js/pull/10)) [@ai](https://github.com/ai)
|
||||
|
||||
## 1.0.0
|
||||
|
||||
* Fix package.json#typings field ([#6](https://github.com/7rulnik/source-map-js/pull/6)) [@chalkygames123](https://github.com/chalkygames123)
|
||||
|
||||
* Reduce memory usage of eachMapping w/ loop ([#5](https://github.com/7rulnik/source-map-js/pull/5)) [@noppa](https://github.com/noppa)
|
||||
|
||||
* Reduce npm package size ([#7](https://github.com/7rulnik/source-map-js/pull/7)) [@ai](https://github.com/ai)
|
||||
|
||||
----------
|
||||
# It doesn't related to this fork:
|
||||
|
||||
## 0.5.6
|
||||
|
||||
* Fix for regression when people were using numbers as names in source maps. See
|
||||
#236.
|
||||
|
||||
## 0.5.5
|
||||
|
||||
* Fix "regression" of unsupported, implementation behavior that half the world
|
||||
happens to have come to depend on. See #235.
|
||||
|
||||
* Fix regression involving function hoisting in SpiderMonkey. See #233.
|
||||
|
||||
## 0.5.4
|
||||
|
||||
* Large performance improvements to source-map serialization. See #228 and #229.
|
||||
|
||||
## 0.5.3
|
||||
|
||||
* Do not include unnecessary distribution files. See
|
||||
commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86.
|
||||
|
||||
## 0.5.2
|
||||
|
||||
* Include browser distributions of the library in package.json's `files`. See
|
||||
issue #212.
|
||||
|
||||
## 0.5.1
|
||||
|
||||
* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See
|
||||
ff05274becc9e6e1295ed60f3ea090d31d843379.
|
||||
|
||||
## 0.5.0
|
||||
|
||||
* Node 0.8 is no longer supported.
|
||||
|
||||
* Use webpack instead of dryice for bundling.
|
||||
|
||||
* Big speedups serializing source maps. See pull request #203.
|
||||
|
||||
* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that
|
||||
explicitly start with the source root. See issue #199.
|
||||
|
||||
## 0.4.4
|
||||
|
||||
* Fix an issue where using a `SourceMapGenerator` after having created a
|
||||
`SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See
|
||||
issue #191.
|
||||
|
||||
* Fix an issue with where `SourceMapGenerator` would mistakenly consider
|
||||
different mappings as duplicates of each other and avoid generating them. See
|
||||
issue #192.
|
||||
|
||||
## 0.4.3
|
||||
|
||||
* A very large number of performance improvements, particularly when parsing
|
||||
source maps. Collectively about 75% of time shaved off of the source map
|
||||
parsing benchmark!
|
||||
|
||||
* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy
|
||||
searching in the presence of a column option. See issue #177.
|
||||
|
||||
* Fix a bug with joining a source and its source root when the source is above
|
||||
the root. See issue #182.
|
||||
|
||||
* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to
|
||||
determine when all sources' contents are inlined into the source map. See
|
||||
issue #190.
|
||||
|
||||
## 0.4.2
|
||||
|
||||
* Add an `.npmignore` file so that the benchmarks aren't pulled down by
|
||||
dependent projects. Issue #169.
|
||||
|
||||
* Add an optional `column` argument to
|
||||
`SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines
|
||||
with no mappings. Issues #172 and #173.
|
||||
|
||||
## 0.4.1
|
||||
|
||||
* Fix accidentally defining a global variable. #170.
|
||||
|
||||
## 0.4.0
|
||||
|
||||
* The default direction for fuzzy searching was changed back to its original
|
||||
direction. See #164.
|
||||
|
||||
* There is now a `bias` option you can supply to `SourceMapConsumer` to control
|
||||
the fuzzy searching direction. See #167.
|
||||
|
||||
* About an 8% speed up in parsing source maps. See #159.
|
||||
|
||||
* Added a benchmark for parsing and generating source maps.
|
||||
|
||||
## 0.3.0
|
||||
|
||||
* Change the default direction that searching for positions fuzzes when there is
|
||||
not an exact match. See #154.
|
||||
|
||||
* Support for environments using json2.js for JSON serialization. See #156.
|
||||
|
||||
## 0.2.0
|
||||
|
||||
* Support for consuming "indexed" source maps which do not have any remote
|
||||
sections. See pull request #127. This introduces a minor backwards
|
||||
incompatibility if you are monkey patching `SourceMapConsumer.prototype`
|
||||
methods.
|
||||
|
||||
## 0.1.43
|
||||
|
||||
* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue
|
||||
#148 for some discussion and issues #150, #151, and #152 for implementations.
|
||||
|
||||
## 0.1.42
|
||||
|
||||
* Fix an issue where `SourceNode`s from different versions of the source-map
|
||||
library couldn't be used in conjunction with each other. See issue #142.
|
||||
|
||||
## 0.1.41
|
||||
|
||||
* Fix a bug with getting the source content of relative sources with a "./"
|
||||
prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768).
|
||||
|
||||
* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the
|
||||
column span of each mapping.
|
||||
|
||||
* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find
|
||||
all generated positions associated with a given original source and line.
|
||||
|
||||
## 0.1.40
|
||||
|
||||
* Performance improvements for parsing source maps in SourceMapConsumer.
|
||||
|
||||
## 0.1.39
|
||||
|
||||
* Fix a bug where setting a source's contents to null before any source content
|
||||
had been set before threw a TypeError. See issue #131.
|
||||
|
||||
## 0.1.38
|
||||
|
||||
* Fix a bug where finding relative paths from an empty path were creating
|
||||
absolute paths. See issue #129.
|
||||
|
||||
## 0.1.37
|
||||
|
||||
* Fix a bug where if the source root was an empty string, relative source paths
|
||||
would turn into absolute source paths. Issue #124.
|
||||
|
||||
## 0.1.36
|
||||
|
||||
* Allow the `names` mapping property to be an empty string. Issue #121.
|
||||
|
||||
## 0.1.35
|
||||
|
||||
* A third optional parameter was added to `SourceNode.fromStringWithSourceMap`
|
||||
to specify a path that relative sources in the second parameter should be
|
||||
relative to. Issue #105.
|
||||
|
||||
* If no file property is given to a `SourceMapGenerator`, then the resulting
|
||||
source map will no longer have a `null` file property. The property will
|
||||
simply not exist. Issue #104.
|
||||
|
||||
* Fixed a bug where consecutive newlines were ignored in `SourceNode`s.
|
||||
Issue #116.
|
||||
|
||||
## 0.1.34
|
||||
|
||||
* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103.
|
||||
|
||||
* Fix bug involving source contents and the
|
||||
`SourceMapGenerator.prototype.applySourceMap`. Issue #100.
|
||||
|
||||
## 0.1.33
|
||||
|
||||
* Fix some edge cases surrounding path joining and URL resolution.
|
||||
|
||||
* Add a third parameter for relative path to
|
||||
`SourceMapGenerator.prototype.applySourceMap`.
|
||||
|
||||
* Fix issues with mappings and EOLs.
|
||||
|
||||
## 0.1.32
|
||||
|
||||
* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns
|
||||
(issue 92).
|
||||
|
||||
* Fixed test runner to actually report number of failed tests as its process
|
||||
exit code.
|
||||
|
||||
* Fixed a typo when reporting bad mappings (issue 87).
|
||||
|
||||
## 0.1.31
|
||||
|
||||
* Delay parsing the mappings in SourceMapConsumer until queried for a source
|
||||
location.
|
||||
|
||||
* Support Sass source maps (which at the time of writing deviate from the spec
|
||||
in small ways) in SourceMapConsumer.
|
||||
|
||||
## 0.1.30
|
||||
|
||||
* Do not join source root with a source, when the source is a data URI.
|
||||
|
||||
* Extend the test runner to allow running single specific test files at a time.
|
||||
|
||||
* Performance improvements in `SourceNode.prototype.walk` and
|
||||
`SourceMapConsumer.prototype.eachMapping`.
|
||||
|
||||
* Source map browser builds will now work inside Workers.
|
||||
|
||||
* Better error messages when attempting to add an invalid mapping to a
|
||||
`SourceMapGenerator`.
|
||||
|
||||
## 0.1.29
|
||||
|
||||
* Allow duplicate entries in the `names` and `sources` arrays of source maps
|
||||
(usually from TypeScript) we are parsing. Fixes github issue 72.
|
||||
|
||||
## 0.1.28
|
||||
|
||||
* Skip duplicate mappings when creating source maps from SourceNode; github
|
||||
issue 75.
|
||||
|
||||
## 0.1.27
|
||||
|
||||
* Don't throw an error when the `file` property is missing in SourceMapConsumer,
|
||||
we don't use it anyway.
|
||||
|
||||
## 0.1.26
|
||||
|
||||
* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70.
|
||||
|
||||
## 0.1.25
|
||||
|
||||
* Make compatible with browserify
|
||||
|
||||
## 0.1.24
|
||||
|
||||
* Fix issue with absolute paths and `file://` URIs. See
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=885597
|
||||
|
||||
## 0.1.23
|
||||
|
||||
* Fix issue with absolute paths and sourcesContent, github issue 64.
|
||||
|
||||
## 0.1.22
|
||||
|
||||
* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21.
|
||||
|
||||
## 0.1.21
|
||||
|
||||
* Fixed handling of sources that start with a slash so that they are relative to
|
||||
the source root's host.
|
||||
|
||||
## 0.1.20
|
||||
|
||||
* Fixed github issue #43: absolute URLs aren't joined with the source root
|
||||
anymore.
|
||||
|
||||
## 0.1.19
|
||||
|
||||
* Using Travis CI to run tests.
|
||||
|
||||
## 0.1.18
|
||||
|
||||
* Fixed a bug in the handling of sourceRoot.
|
||||
|
||||
## 0.1.17
|
||||
|
||||
* Added SourceNode.fromStringWithSourceMap.
|
||||
|
||||
## 0.1.16
|
||||
|
||||
* Added missing documentation.
|
||||
|
||||
* Fixed the generating of empty mappings in SourceNode.
|
||||
|
||||
## 0.1.15
|
||||
|
||||
* Added SourceMapGenerator.applySourceMap.
|
||||
|
||||
## 0.1.14
|
||||
|
||||
* The sourceRoot is now handled consistently.
|
||||
|
||||
## 0.1.13
|
||||
|
||||
* Added SourceMapGenerator.fromSourceMap.
|
||||
|
||||
## 0.1.12
|
||||
|
||||
* SourceNode now generates empty mappings too.
|
||||
|
||||
## 0.1.11
|
||||
|
||||
* Added name support to SourceNode.
|
||||
|
||||
## 0.1.10
|
||||
|
||||
* Added sourcesContent support to the customer and generator.
|
||||
28
node_modules/.store/sass@1.69.5/node_modules/source-map-js/LICENSE
generated
vendored
Normal file
28
node_modules/.store/sass@1.69.5/node_modules/source-map-js/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
Copyright (c) 2009-2011, Mozilla Foundation and contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the names of the Mozilla Foundation nor the names of project
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
758
node_modules/.store/sass@1.69.5/node_modules/source-map-js/README.md
generated
vendored
Normal file
758
node_modules/.store/sass@1.69.5/node_modules/source-map-js/README.md
generated
vendored
Normal file
@@ -0,0 +1,758 @@
|
||||
# Source Map JS
|
||||
|
||||
[](https://www.npmjs.com/package/source-map-js)
|
||||
|
||||
Difference between original [source-map](https://github.com/mozilla/source-map):
|
||||
|
||||
> TL,DR: it's fork of original source-map@0.6, but with perfomance optimizations.
|
||||
|
||||
This journey starts from [source-map@0.7.0](https://github.com/mozilla/source-map/blob/master/CHANGELOG.md#070). Some part of it was rewritten to Rust and WASM and API became async.
|
||||
|
||||
It's still a major block for many libraries like PostCSS or Sass for example because they need to migrate the whole API to the async way. This is the reason why 0.6.1 has 2x more downloads than 0.7.3 while it's faster several times.
|
||||
|
||||

|
||||
|
||||
More important that WASM version has some optimizations in JS code too. This is why [community asked to create branch for 0.6 version](https://github.com/mozilla/source-map/issues/324) and port these optimizations but, sadly, the answer was «no». A bit later I discovered [the issue](https://github.com/mozilla/source-map/issues/370) created by [Ben Rothman (@benthemonkey)](https://github.com/benthemonkey) with no response at all.
|
||||
|
||||
[Roman Dvornov (@lahmatiy)](https://github.com/lahmatiy) wrote a [serveral posts](https://t.me/gorshochekvarit/76) (russian, only, sorry) about source-map library in his own Telegram channel. He mentioned the article [«Maybe you don't need Rust and WASM to speed up your JS»](https://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to-speed-up-your-js.html) written by [Vyacheslav Egorov (@mraleph)](https://github.com/mraleph). This article contains optimizations and hacks that lead to almost the same performance compare to WASM implementation.
|
||||
|
||||
I decided to fork the original source-map and port these optimizations from the article and several others PR from the original source-map.
|
||||
|
||||
---------
|
||||
|
||||
This is a library to generate and consume the source map format
|
||||
[described here][format].
|
||||
|
||||
[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
|
||||
|
||||
## Use with Node
|
||||
|
||||
$ npm install source-map-js
|
||||
|
||||
<!-- ## Use on the Web
|
||||
|
||||
<script src="https://raw.githubusercontent.com/mozilla/source-map/master/dist/source-map.min.js" defer></script> -->
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
<!-- `npm run toc` to regenerate the Table of Contents -->
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
## Table of Contents
|
||||
|
||||
- [Examples](#examples)
|
||||
- [Consuming a source map](#consuming-a-source-map)
|
||||
- [Generating a source map](#generating-a-source-map)
|
||||
- [With SourceNode (high level API)](#with-sourcenode-high-level-api)
|
||||
- [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api)
|
||||
- [API](#api)
|
||||
- [SourceMapConsumer](#sourcemapconsumer)
|
||||
- [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap)
|
||||
- [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans)
|
||||
- [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition)
|
||||
- [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition)
|
||||
- [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition)
|
||||
- [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources)
|
||||
- [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing)
|
||||
- [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order)
|
||||
- [SourceMapGenerator](#sourcemapgenerator)
|
||||
- [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap)
|
||||
- [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer)
|
||||
- [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping)
|
||||
- [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent)
|
||||
- [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath)
|
||||
- [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring)
|
||||
- [SourceNode](#sourcenode)
|
||||
- [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name)
|
||||
- [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath)
|
||||
- [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk)
|
||||
- [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk)
|
||||
- [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent)
|
||||
- [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn)
|
||||
- [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn)
|
||||
- [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep)
|
||||
- [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement)
|
||||
- [SourceNode.prototype.toString()](#sourcenodeprototypetostring)
|
||||
- [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
## Examples
|
||||
|
||||
### Consuming a source map
|
||||
|
||||
```js
|
||||
var rawSourceMap = {
|
||||
version: 3,
|
||||
file: 'min.js',
|
||||
names: ['bar', 'baz', 'n'],
|
||||
sources: ['one.js', 'two.js'],
|
||||
sourceRoot: 'http://example.com/www/js/',
|
||||
mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
|
||||
};
|
||||
|
||||
var smc = new SourceMapConsumer(rawSourceMap);
|
||||
|
||||
console.log(smc.sources);
|
||||
// [ 'http://example.com/www/js/one.js',
|
||||
// 'http://example.com/www/js/two.js' ]
|
||||
|
||||
console.log(smc.originalPositionFor({
|
||||
line: 2,
|
||||
column: 28
|
||||
}));
|
||||
// { source: 'http://example.com/www/js/two.js',
|
||||
// line: 2,
|
||||
// column: 10,
|
||||
// name: 'n' }
|
||||
|
||||
console.log(smc.generatedPositionFor({
|
||||
source: 'http://example.com/www/js/two.js',
|
||||
line: 2,
|
||||
column: 10
|
||||
}));
|
||||
// { line: 2, column: 28 }
|
||||
|
||||
smc.eachMapping(function (m) {
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
### Generating a source map
|
||||
|
||||
In depth guide:
|
||||
[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)
|
||||
|
||||
#### With SourceNode (high level API)
|
||||
|
||||
```js
|
||||
function compile(ast) {
|
||||
switch (ast.type) {
|
||||
case 'BinaryExpression':
|
||||
return new SourceNode(
|
||||
ast.location.line,
|
||||
ast.location.column,
|
||||
ast.location.source,
|
||||
[compile(ast.left), " + ", compile(ast.right)]
|
||||
);
|
||||
case 'Literal':
|
||||
return new SourceNode(
|
||||
ast.location.line,
|
||||
ast.location.column,
|
||||
ast.location.source,
|
||||
String(ast.value)
|
||||
);
|
||||
// ...
|
||||
default:
|
||||
throw new Error("Bad AST");
|
||||
}
|
||||
}
|
||||
|
||||
var ast = parse("40 + 2", "add.js");
|
||||
console.log(compile(ast).toStringWithSourceMap({
|
||||
file: 'add.js'
|
||||
}));
|
||||
// { code: '40 + 2',
|
||||
// map: [object SourceMapGenerator] }
|
||||
```
|
||||
|
||||
#### With SourceMapGenerator (low level API)
|
||||
|
||||
```js
|
||||
var map = new SourceMapGenerator({
|
||||
file: "source-mapped.js"
|
||||
});
|
||||
|
||||
map.addMapping({
|
||||
generated: {
|
||||
line: 10,
|
||||
column: 35
|
||||
},
|
||||
source: "foo.js",
|
||||
original: {
|
||||
line: 33,
|
||||
column: 2
|
||||
},
|
||||
name: "christopher"
|
||||
});
|
||||
|
||||
console.log(map.toString());
|
||||
// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
Get a reference to the module:
|
||||
|
||||
```js
|
||||
// Node.js
|
||||
var sourceMap = require('source-map');
|
||||
|
||||
// Browser builds
|
||||
var sourceMap = window.sourceMap;
|
||||
|
||||
// Inside Firefox
|
||||
const sourceMap = require("devtools/toolkit/sourcemap/source-map.js");
|
||||
```
|
||||
|
||||
### SourceMapConsumer
|
||||
|
||||
A SourceMapConsumer instance represents a parsed source map which we can query
|
||||
for information about the original file positions by giving it a file position
|
||||
in the generated source.
|
||||
|
||||
#### new SourceMapConsumer(rawSourceMap)
|
||||
|
||||
The only parameter is the raw source map (either as a string which can be
|
||||
`JSON.parse`'d, or an object). According to the spec, source maps have the
|
||||
following attributes:
|
||||
|
||||
* `version`: Which version of the source map spec this map is following.
|
||||
|
||||
* `sources`: An array of URLs to the original source files.
|
||||
|
||||
* `names`: An array of identifiers which can be referenced by individual
|
||||
mappings.
|
||||
|
||||
* `sourceRoot`: Optional. The URL root from which all sources are relative.
|
||||
|
||||
* `sourcesContent`: Optional. An array of contents of the original source files.
|
||||
|
||||
* `mappings`: A string of base64 VLQs which contain the actual mappings.
|
||||
|
||||
* `file`: Optional. The generated filename this source map is associated with.
|
||||
|
||||
```js
|
||||
var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData);
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.computeColumnSpans()
|
||||
|
||||
Compute the last column for each generated mapping. The last column is
|
||||
inclusive.
|
||||
|
||||
```js
|
||||
// Before:
|
||||
consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
|
||||
// [ { line: 2,
|
||||
// column: 1 },
|
||||
// { line: 2,
|
||||
// column: 10 },
|
||||
// { line: 2,
|
||||
// column: 20 } ]
|
||||
|
||||
consumer.computeColumnSpans();
|
||||
|
||||
// After:
|
||||
consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
|
||||
// [ { line: 2,
|
||||
// column: 1,
|
||||
// lastColumn: 9 },
|
||||
// { line: 2,
|
||||
// column: 10,
|
||||
// lastColumn: 19 },
|
||||
// { line: 2,
|
||||
// column: 20,
|
||||
// lastColumn: Infinity } ]
|
||||
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)
|
||||
|
||||
Returns the original source, line, and column information for the generated
|
||||
source's line and column positions provided. The only argument is an object with
|
||||
the following properties:
|
||||
|
||||
* `line`: The line number in the generated source. Line numbers in
|
||||
this library are 1-based (note that the underlying source map
|
||||
specification uses 0-based line numbers -- this library handles the
|
||||
translation).
|
||||
|
||||
* `column`: The column number in the generated source. Column numbers
|
||||
in this library are 0-based.
|
||||
|
||||
* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or
|
||||
`SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest
|
||||
element that is smaller than or greater than the one we are searching for,
|
||||
respectively, if the exact element cannot be found. Defaults to
|
||||
`SourceMapConsumer.GREATEST_LOWER_BOUND`.
|
||||
|
||||
and an object is returned with the following properties:
|
||||
|
||||
* `source`: The original source file, or null if this information is not
|
||||
available.
|
||||
|
||||
* `line`: The line number in the original source, or null if this information is
|
||||
not available. The line number is 1-based.
|
||||
|
||||
* `column`: The column number in the original source, or null if this
|
||||
information is not available. The column number is 0-based.
|
||||
|
||||
* `name`: The original identifier, or null if this information is not available.
|
||||
|
||||
```js
|
||||
consumer.originalPositionFor({ line: 2, column: 10 })
|
||||
// { source: 'foo.coffee',
|
||||
// line: 2,
|
||||
// column: 2,
|
||||
// name: null }
|
||||
|
||||
consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 })
|
||||
// { source: null,
|
||||
// line: null,
|
||||
// column: null,
|
||||
// name: null }
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)
|
||||
|
||||
Returns the generated line and column information for the original source,
|
||||
line, and column positions provided. The only argument is an object with
|
||||
the following properties:
|
||||
|
||||
* `source`: The filename of the original source.
|
||||
|
||||
* `line`: The line number in the original source. The line number is
|
||||
1-based.
|
||||
|
||||
* `column`: The column number in the original source. The column
|
||||
number is 0-based.
|
||||
|
||||
and an object is returned with the following properties:
|
||||
|
||||
* `line`: The line number in the generated source, or null. The line
|
||||
number is 1-based.
|
||||
|
||||
* `column`: The column number in the generated source, or null. The
|
||||
column number is 0-based.
|
||||
|
||||
```js
|
||||
consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 })
|
||||
// { line: 1,
|
||||
// column: 56 }
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)
|
||||
|
||||
Returns all generated line and column information for the original source, line,
|
||||
and column provided. If no column is provided, returns all mappings
|
||||
corresponding to a either the line we are searching for or the next closest line
|
||||
that has any mappings. Otherwise, returns all mappings corresponding to the
|
||||
given line and either the column we are searching for or the next closest column
|
||||
that has any offsets.
|
||||
|
||||
The only argument is an object with the following properties:
|
||||
|
||||
* `source`: The filename of the original source.
|
||||
|
||||
* `line`: The line number in the original source. The line number is
|
||||
1-based.
|
||||
|
||||
* `column`: Optional. The column number in the original source. The
|
||||
column number is 0-based.
|
||||
|
||||
and an array of objects is returned, each with the following properties:
|
||||
|
||||
* `line`: The line number in the generated source, or null. The line
|
||||
number is 1-based.
|
||||
|
||||
* `column`: The column number in the generated source, or null. The
|
||||
column number is 0-based.
|
||||
|
||||
```js
|
||||
consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" })
|
||||
// [ { line: 2,
|
||||
// column: 1 },
|
||||
// { line: 2,
|
||||
// column: 10 },
|
||||
// { line: 2,
|
||||
// column: 20 } ]
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.hasContentsOfAllSources()
|
||||
|
||||
Return true if we have the embedded source content for every source listed in
|
||||
the source map, false otherwise.
|
||||
|
||||
In other words, if this method returns `true`, then
|
||||
`consumer.sourceContentFor(s)` will succeed for every source `s` in
|
||||
`consumer.sources`.
|
||||
|
||||
```js
|
||||
// ...
|
||||
if (consumer.hasContentsOfAllSources()) {
|
||||
consumerReadyCallback(consumer);
|
||||
} else {
|
||||
fetchSources(consumer, consumerReadyCallback);
|
||||
}
|
||||
// ...
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])
|
||||
|
||||
Returns the original source content for the source provided. The only
|
||||
argument is the URL of the original source file.
|
||||
|
||||
If the source content for the given source is not found, then an error is
|
||||
thrown. Optionally, pass `true` as the second param to have `null` returned
|
||||
instead.
|
||||
|
||||
```js
|
||||
consumer.sources
|
||||
// [ "my-cool-lib.clj" ]
|
||||
|
||||
consumer.sourceContentFor("my-cool-lib.clj")
|
||||
// "..."
|
||||
|
||||
consumer.sourceContentFor("this is not in the source map");
|
||||
// Error: "this is not in the source map" is not in the source map
|
||||
|
||||
consumer.sourceContentFor("this is not in the source map", true);
|
||||
// null
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.eachMapping(callback, context, order)
|
||||
|
||||
Iterate over each mapping between an original source/line/column and a
|
||||
generated line/column in this source map.
|
||||
|
||||
* `callback`: The function that is called with each mapping. Mappings have the
|
||||
form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,
|
||||
name }`
|
||||
|
||||
* `context`: Optional. If specified, this object will be the value of `this`
|
||||
every time that `callback` is called.
|
||||
|
||||
* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or
|
||||
`SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over
|
||||
the mappings sorted by the generated file's line/column order or the
|
||||
original's source/line/column order, respectively. Defaults to
|
||||
`SourceMapConsumer.GENERATED_ORDER`.
|
||||
|
||||
```js
|
||||
consumer.eachMapping(function (m) { console.log(m); })
|
||||
// ...
|
||||
// { source: 'illmatic.js',
|
||||
// generatedLine: 1,
|
||||
// generatedColumn: 0,
|
||||
// originalLine: 1,
|
||||
// originalColumn: 0,
|
||||
// name: null }
|
||||
// { source: 'illmatic.js',
|
||||
// generatedLine: 2,
|
||||
// generatedColumn: 0,
|
||||
// originalLine: 2,
|
||||
// originalColumn: 0,
|
||||
// name: null }
|
||||
// ...
|
||||
```
|
||||
### SourceMapGenerator
|
||||
|
||||
An instance of the SourceMapGenerator represents a source map which is being
|
||||
built incrementally.
|
||||
|
||||
#### new SourceMapGenerator([startOfSourceMap])
|
||||
|
||||
You may pass an object with the following properties:
|
||||
|
||||
* `file`: The filename of the generated source that this source map is
|
||||
associated with.
|
||||
|
||||
* `sourceRoot`: A root for all relative URLs in this source map.
|
||||
|
||||
* `skipValidation`: Optional. When `true`, disables validation of mappings as
|
||||
they are added. This can improve performance but should be used with
|
||||
discretion, as a last resort. Even then, one should avoid using this flag when
|
||||
running tests, if possible.
|
||||
|
||||
```js
|
||||
var generator = new sourceMap.SourceMapGenerator({
|
||||
file: "my-generated-javascript-file.js",
|
||||
sourceRoot: "http://example.com/app/js/"
|
||||
});
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.fromSourceMap(sourceMapConsumer)
|
||||
|
||||
Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance.
|
||||
|
||||
* `sourceMapConsumer` The SourceMap.
|
||||
|
||||
```js
|
||||
var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer);
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.prototype.addMapping(mapping)
|
||||
|
||||
Add a single mapping from original source line and column to the generated
|
||||
source's line and column for this source map being created. The mapping object
|
||||
should have the following properties:
|
||||
|
||||
* `generated`: An object with the generated line and column positions.
|
||||
|
||||
* `original`: An object with the original line and column positions.
|
||||
|
||||
* `source`: The original source file (relative to the sourceRoot).
|
||||
|
||||
* `name`: An optional original token name for this mapping.
|
||||
|
||||
```js
|
||||
generator.addMapping({
|
||||
source: "module-one.scm",
|
||||
original: { line: 128, column: 0 },
|
||||
generated: { line: 3, column: 456 }
|
||||
})
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)
|
||||
|
||||
Set the source content for an original source file.
|
||||
|
||||
* `sourceFile` the URL of the original source file.
|
||||
|
||||
* `sourceContent` the content of the source file.
|
||||
|
||||
```js
|
||||
generator.setSourceContent("module-one.scm",
|
||||
fs.readFileSync("path/to/module-one.scm"))
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])
|
||||
|
||||
Applies a SourceMap for a source file to the SourceMap.
|
||||
Each mapping to the supplied source file is rewritten using the
|
||||
supplied SourceMap. Note: The resolution for the resulting mappings
|
||||
is the minimum of this map and the supplied map.
|
||||
|
||||
* `sourceMapConsumer`: The SourceMap to be applied.
|
||||
|
||||
* `sourceFile`: Optional. The filename of the source file.
|
||||
If omitted, sourceMapConsumer.file will be used, if it exists.
|
||||
Otherwise an error will be thrown.
|
||||
|
||||
* `sourceMapPath`: Optional. The dirname of the path to the SourceMap
|
||||
to be applied. If relative, it is relative to the SourceMap.
|
||||
|
||||
This parameter is needed when the two SourceMaps aren't in the same
|
||||
directory, and the SourceMap to be applied contains relative source
|
||||
paths. If so, those relative source paths need to be rewritten
|
||||
relative to the SourceMap.
|
||||
|
||||
If omitted, it is assumed that both SourceMaps are in the same directory,
|
||||
thus not needing any rewriting. (Supplying `'.'` has the same effect.)
|
||||
|
||||
#### SourceMapGenerator.prototype.toString()
|
||||
|
||||
Renders the source map being generated to a string.
|
||||
|
||||
```js
|
||||
generator.toString()
|
||||
// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}'
|
||||
```
|
||||
|
||||
### SourceNode
|
||||
|
||||
SourceNodes provide a way to abstract over interpolating and/or concatenating
|
||||
snippets of generated JavaScript source code, while maintaining the line and
|
||||
column information associated between those snippets and the original source
|
||||
code. This is useful as the final intermediate representation a compiler might
|
||||
use before outputting the generated JS and source map.
|
||||
|
||||
#### new SourceNode([line, column, source[, chunk[, name]]])
|
||||
|
||||
* `line`: The original line number associated with this source node, or null if
|
||||
it isn't associated with an original line. The line number is 1-based.
|
||||
|
||||
* `column`: The original column number associated with this source node, or null
|
||||
if it isn't associated with an original column. The column number
|
||||
is 0-based.
|
||||
|
||||
* `source`: The original source's filename; null if no filename is provided.
|
||||
|
||||
* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see
|
||||
below.
|
||||
|
||||
* `name`: Optional. The original identifier.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.cpp", [
|
||||
new SourceNode(3, 4, "b.cpp", "extern int status;\n"),
|
||||
new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"),
|
||||
new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"),
|
||||
]);
|
||||
```
|
||||
|
||||
#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])
|
||||
|
||||
Creates a SourceNode from generated code and a SourceMapConsumer.
|
||||
|
||||
* `code`: The generated code
|
||||
|
||||
* `sourceMapConsumer` The SourceMap for the generated code
|
||||
|
||||
* `relativePath` The optional path that relative sources in `sourceMapConsumer`
|
||||
should be relative to.
|
||||
|
||||
```js
|
||||
var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8"));
|
||||
var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"),
|
||||
consumer);
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.add(chunk)
|
||||
|
||||
Add a chunk of generated JS to this source node.
|
||||
|
||||
* `chunk`: A string snippet of generated JS code, another instance of
|
||||
`SourceNode`, or an array where each member is one of those things.
|
||||
|
||||
```js
|
||||
node.add(" + ");
|
||||
node.add(otherNode);
|
||||
node.add([leftHandOperandNode, " + ", rightHandOperandNode]);
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.prepend(chunk)
|
||||
|
||||
Prepend a chunk of generated JS to this source node.
|
||||
|
||||
* `chunk`: A string snippet of generated JS code, another instance of
|
||||
`SourceNode`, or an array where each member is one of those things.
|
||||
|
||||
```js
|
||||
node.prepend("/** Build Id: f783haef86324gf **/\n\n");
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)
|
||||
|
||||
Set the source content for a source file. This will be added to the
|
||||
`SourceMap` in the `sourcesContent` field.
|
||||
|
||||
* `sourceFile`: The filename of the source file
|
||||
|
||||
* `sourceContent`: The content of the source file
|
||||
|
||||
```js
|
||||
node.setSourceContent("module-one.scm",
|
||||
fs.readFileSync("path/to/module-one.scm"))
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.walk(fn)
|
||||
|
||||
Walk over the tree of JS snippets in this node and its children. The walking
|
||||
function is called once for each snippet of JS and is passed that snippet and
|
||||
the its original associated source's line/column location.
|
||||
|
||||
* `fn`: The traversal function.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.js", [
|
||||
new SourceNode(3, 4, "b.js", "uno"),
|
||||
"dos",
|
||||
[
|
||||
"tres",
|
||||
new SourceNode(5, 6, "c.js", "quatro")
|
||||
]
|
||||
]);
|
||||
|
||||
node.walk(function (code, loc) { console.log("WALK:", code, loc); })
|
||||
// WALK: uno { source: 'b.js', line: 3, column: 4, name: null }
|
||||
// WALK: dos { source: 'a.js', line: 1, column: 2, name: null }
|
||||
// WALK: tres { source: 'a.js', line: 1, column: 2, name: null }
|
||||
// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null }
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.walkSourceContents(fn)
|
||||
|
||||
Walk over the tree of SourceNodes. The walking function is called for each
|
||||
source file content and is passed the filename and source content.
|
||||
|
||||
* `fn`: The traversal function.
|
||||
|
||||
```js
|
||||
var a = new SourceNode(1, 2, "a.js", "generated from a");
|
||||
a.setSourceContent("a.js", "original a");
|
||||
var b = new SourceNode(1, 2, "b.js", "generated from b");
|
||||
b.setSourceContent("b.js", "original b");
|
||||
var c = new SourceNode(1, 2, "c.js", "generated from c");
|
||||
c.setSourceContent("c.js", "original c");
|
||||
|
||||
var node = new SourceNode(null, null, null, [a, b, c]);
|
||||
node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); })
|
||||
// WALK: a.js : original a
|
||||
// WALK: b.js : original b
|
||||
// WALK: c.js : original c
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.join(sep)
|
||||
|
||||
Like `Array.prototype.join` except for SourceNodes. Inserts the separator
|
||||
between each of this source node's children.
|
||||
|
||||
* `sep`: The separator.
|
||||
|
||||
```js
|
||||
var lhs = new SourceNode(1, 2, "a.rs", "my_copy");
|
||||
var operand = new SourceNode(3, 4, "a.rs", "=");
|
||||
var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()");
|
||||
|
||||
var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]);
|
||||
var joinedNode = node.join(" ");
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.replaceRight(pattern, replacement)
|
||||
|
||||
Call `String.prototype.replace` on the very right-most source snippet. Useful
|
||||
for trimming white space from the end of a source node, etc.
|
||||
|
||||
* `pattern`: The pattern to replace.
|
||||
|
||||
* `replacement`: The thing to replace the pattern with.
|
||||
|
||||
```js
|
||||
// Trim trailing white space.
|
||||
node.replaceRight(/\s*$/, "");
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.toString()
|
||||
|
||||
Return the string representation of this source node. Walks over the tree and
|
||||
concatenates all the various snippets together to one string.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.js", [
|
||||
new SourceNode(3, 4, "b.js", "uno"),
|
||||
"dos",
|
||||
[
|
||||
"tres",
|
||||
new SourceNode(5, 6, "c.js", "quatro")
|
||||
]
|
||||
]);
|
||||
|
||||
node.toString()
|
||||
// 'unodostresquatro'
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])
|
||||
|
||||
Returns the string representation of this tree of source nodes, plus a
|
||||
SourceMapGenerator which contains all the mappings between the generated and
|
||||
original sources.
|
||||
|
||||
The arguments are the same as those to `new SourceMapGenerator`.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.js", [
|
||||
new SourceNode(3, 4, "b.js", "uno"),
|
||||
"dos",
|
||||
[
|
||||
"tres",
|
||||
new SourceNode(5, 6, "c.js", "quatro")
|
||||
]
|
||||
]);
|
||||
|
||||
node.toStringWithSourceMap({ file: "my-output-file.js" })
|
||||
// { code: 'unodostresquatro',
|
||||
// map: [object SourceMapGenerator] }
|
||||
```
|
||||
121
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/array-set.js
generated
vendored
Normal file
121
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/array-set.js
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var util = require('./util');
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
var hasNativeMap = typeof Map !== "undefined";
|
||||
|
||||
/**
|
||||
* A data structure which is a combination of an array and a set. Adding a new
|
||||
* member is O(1), testing for membership is O(1), and finding the index of an
|
||||
* element is O(1). Removing elements from the set is not supported. Only
|
||||
* strings are supported for membership.
|
||||
*/
|
||||
function ArraySet() {
|
||||
this._array = [];
|
||||
this._set = hasNativeMap ? new Map() : Object.create(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Static method for creating ArraySet instances from an existing array.
|
||||
*/
|
||||
ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
|
||||
var set = new ArraySet();
|
||||
for (var i = 0, len = aArray.length; i < len; i++) {
|
||||
set.add(aArray[i], aAllowDuplicates);
|
||||
}
|
||||
return set;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return how many unique items are in this ArraySet. If duplicates have been
|
||||
* added, than those do not count towards the size.
|
||||
*
|
||||
* @returns Number
|
||||
*/
|
||||
ArraySet.prototype.size = function ArraySet_size() {
|
||||
return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add the given string to this set.
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
|
||||
var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
|
||||
var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
|
||||
var idx = this._array.length;
|
||||
if (!isDuplicate || aAllowDuplicates) {
|
||||
this._array.push(aStr);
|
||||
}
|
||||
if (!isDuplicate) {
|
||||
if (hasNativeMap) {
|
||||
this._set.set(aStr, idx);
|
||||
} else {
|
||||
this._set[sStr] = idx;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Is the given string a member of this set?
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
ArraySet.prototype.has = function ArraySet_has(aStr) {
|
||||
if (hasNativeMap) {
|
||||
return this._set.has(aStr);
|
||||
} else {
|
||||
var sStr = util.toSetString(aStr);
|
||||
return has.call(this._set, sStr);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* What is the index of the given string in the array?
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
|
||||
if (hasNativeMap) {
|
||||
var idx = this._set.get(aStr);
|
||||
if (idx >= 0) {
|
||||
return idx;
|
||||
}
|
||||
} else {
|
||||
var sStr = util.toSetString(aStr);
|
||||
if (has.call(this._set, sStr)) {
|
||||
return this._set[sStr];
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error('"' + aStr + '" is not in the set.');
|
||||
};
|
||||
|
||||
/**
|
||||
* What is the element at the given index?
|
||||
*
|
||||
* @param Number aIdx
|
||||
*/
|
||||
ArraySet.prototype.at = function ArraySet_at(aIdx) {
|
||||
if (aIdx >= 0 && aIdx < this._array.length) {
|
||||
return this._array[aIdx];
|
||||
}
|
||||
throw new Error('No element indexed by ' + aIdx);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the array representation of this set (which has the proper indices
|
||||
* indicated by indexOf). Note that this is a copy of the internal array used
|
||||
* for storing the members so that no one can mess with internal state.
|
||||
*/
|
||||
ArraySet.prototype.toArray = function ArraySet_toArray() {
|
||||
return this._array.slice();
|
||||
};
|
||||
|
||||
exports.ArraySet = ArraySet;
|
||||
140
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/base64-vlq.js
generated
vendored
Normal file
140
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/base64-vlq.js
generated
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* Based on the Base 64 VLQ implementation in Closure Compiler:
|
||||
* https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
|
||||
*
|
||||
* Copyright 2011 The Closure Compiler Authors. All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of Google Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
var base64 = require('./base64');
|
||||
|
||||
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
|
||||
// length quantities we use in the source map spec, the first bit is the sign,
|
||||
// the next four bits are the actual value, and the 6th bit is the
|
||||
// continuation bit. The continuation bit tells us whether there are more
|
||||
// digits in this value following this digit.
|
||||
//
|
||||
// Continuation
|
||||
// | Sign
|
||||
// | |
|
||||
// V V
|
||||
// 101011
|
||||
|
||||
var VLQ_BASE_SHIFT = 5;
|
||||
|
||||
// binary: 100000
|
||||
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
||||
|
||||
// binary: 011111
|
||||
var VLQ_BASE_MASK = VLQ_BASE - 1;
|
||||
|
||||
// binary: 100000
|
||||
var VLQ_CONTINUATION_BIT = VLQ_BASE;
|
||||
|
||||
/**
|
||||
* Converts from a two-complement value to a value where the sign bit is
|
||||
* placed in the least significant bit. For example, as decimals:
|
||||
* 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
|
||||
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
|
||||
*/
|
||||
function toVLQSigned(aValue) {
|
||||
return aValue < 0
|
||||
? ((-aValue) << 1) + 1
|
||||
: (aValue << 1) + 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts to a two-complement value from a value where the sign bit is
|
||||
* placed in the least significant bit. For example, as decimals:
|
||||
* 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
|
||||
* 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
|
||||
*/
|
||||
function fromVLQSigned(aValue) {
|
||||
var isNegative = (aValue & 1) === 1;
|
||||
var shifted = aValue >> 1;
|
||||
return isNegative
|
||||
? -shifted
|
||||
: shifted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the base 64 VLQ encoded value.
|
||||
*/
|
||||
exports.encode = function base64VLQ_encode(aValue) {
|
||||
var encoded = "";
|
||||
var digit;
|
||||
|
||||
var vlq = toVLQSigned(aValue);
|
||||
|
||||
do {
|
||||
digit = vlq & VLQ_BASE_MASK;
|
||||
vlq >>>= VLQ_BASE_SHIFT;
|
||||
if (vlq > 0) {
|
||||
// There are still more digits in this value, so we must make sure the
|
||||
// continuation bit is marked.
|
||||
digit |= VLQ_CONTINUATION_BIT;
|
||||
}
|
||||
encoded += base64.encode(digit);
|
||||
} while (vlq > 0);
|
||||
|
||||
return encoded;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes the next base 64 VLQ value from the given string and returns the
|
||||
* value and the rest of the string via the out parameter.
|
||||
*/
|
||||
exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
|
||||
var strLen = aStr.length;
|
||||
var result = 0;
|
||||
var shift = 0;
|
||||
var continuation, digit;
|
||||
|
||||
do {
|
||||
if (aIndex >= strLen) {
|
||||
throw new Error("Expected more digits in base 64 VLQ value.");
|
||||
}
|
||||
|
||||
digit = base64.decode(aStr.charCodeAt(aIndex++));
|
||||
if (digit === -1) {
|
||||
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
|
||||
}
|
||||
|
||||
continuation = !!(digit & VLQ_CONTINUATION_BIT);
|
||||
digit &= VLQ_BASE_MASK;
|
||||
result = result + (digit << shift);
|
||||
shift += VLQ_BASE_SHIFT;
|
||||
} while (continuation);
|
||||
|
||||
aOutParam.value = fromVLQSigned(result);
|
||||
aOutParam.rest = aIndex;
|
||||
};
|
||||
67
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/base64.js
generated
vendored
Normal file
67
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/base64.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
|
||||
|
||||
/**
|
||||
* Encode an integer in the range of 0 to 63 to a single base 64 digit.
|
||||
*/
|
||||
exports.encode = function (number) {
|
||||
if (0 <= number && number < intToCharMap.length) {
|
||||
return intToCharMap[number];
|
||||
}
|
||||
throw new TypeError("Must be between 0 and 63: " + number);
|
||||
};
|
||||
|
||||
/**
|
||||
* Decode a single base 64 character code digit to an integer. Returns -1 on
|
||||
* failure.
|
||||
*/
|
||||
exports.decode = function (charCode) {
|
||||
var bigA = 65; // 'A'
|
||||
var bigZ = 90; // 'Z'
|
||||
|
||||
var littleA = 97; // 'a'
|
||||
var littleZ = 122; // 'z'
|
||||
|
||||
var zero = 48; // '0'
|
||||
var nine = 57; // '9'
|
||||
|
||||
var plus = 43; // '+'
|
||||
var slash = 47; // '/'
|
||||
|
||||
var littleOffset = 26;
|
||||
var numberOffset = 52;
|
||||
|
||||
// 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
if (bigA <= charCode && charCode <= bigZ) {
|
||||
return (charCode - bigA);
|
||||
}
|
||||
|
||||
// 26 - 51: abcdefghijklmnopqrstuvwxyz
|
||||
if (littleA <= charCode && charCode <= littleZ) {
|
||||
return (charCode - littleA + littleOffset);
|
||||
}
|
||||
|
||||
// 52 - 61: 0123456789
|
||||
if (zero <= charCode && charCode <= nine) {
|
||||
return (charCode - zero + numberOffset);
|
||||
}
|
||||
|
||||
// 62: +
|
||||
if (charCode == plus) {
|
||||
return 62;
|
||||
}
|
||||
|
||||
// 63: /
|
||||
if (charCode == slash) {
|
||||
return 63;
|
||||
}
|
||||
|
||||
// Invalid base64 digit.
|
||||
return -1;
|
||||
};
|
||||
111
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/binary-search.js
generated
vendored
Normal file
111
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/binary-search.js
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
exports.GREATEST_LOWER_BOUND = 1;
|
||||
exports.LEAST_UPPER_BOUND = 2;
|
||||
|
||||
/**
|
||||
* Recursive implementation of binary search.
|
||||
*
|
||||
* @param aLow Indices here and lower do not contain the needle.
|
||||
* @param aHigh Indices here and higher do not contain the needle.
|
||||
* @param aNeedle The element being searched for.
|
||||
* @param aHaystack The non-empty array being searched.
|
||||
* @param aCompare Function which takes two elements and returns -1, 0, or 1.
|
||||
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
||||
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
||||
* closest element that is smaller than or greater than the one we are
|
||||
* searching for, respectively, if the exact element cannot be found.
|
||||
*/
|
||||
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
||||
// This function terminates when one of the following is true:
|
||||
//
|
||||
// 1. We find the exact element we are looking for.
|
||||
//
|
||||
// 2. We did not find the exact element, but we can return the index of
|
||||
// the next-closest element.
|
||||
//
|
||||
// 3. We did not find the exact element, and there is no next-closest
|
||||
// element than the one we are searching for, so we return -1.
|
||||
var mid = Math.floor((aHigh - aLow) / 2) + aLow;
|
||||
var cmp = aCompare(aNeedle, aHaystack[mid], true);
|
||||
if (cmp === 0) {
|
||||
// Found the element we are looking for.
|
||||
return mid;
|
||||
}
|
||||
else if (cmp > 0) {
|
||||
// Our needle is greater than aHaystack[mid].
|
||||
if (aHigh - mid > 1) {
|
||||
// The element is in the upper half.
|
||||
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
|
||||
}
|
||||
|
||||
// The exact needle element was not found in this haystack. Determine if
|
||||
// we are in termination case (3) or (2) and return the appropriate thing.
|
||||
if (aBias == exports.LEAST_UPPER_BOUND) {
|
||||
return aHigh < aHaystack.length ? aHigh : -1;
|
||||
} else {
|
||||
return mid;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Our needle is less than aHaystack[mid].
|
||||
if (mid - aLow > 1) {
|
||||
// The element is in the lower half.
|
||||
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
|
||||
}
|
||||
|
||||
// we are in termination case (3) or (2) and return the appropriate thing.
|
||||
if (aBias == exports.LEAST_UPPER_BOUND) {
|
||||
return mid;
|
||||
} else {
|
||||
return aLow < 0 ? -1 : aLow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is an implementation of binary search which will always try and return
|
||||
* the index of the closest element if there is no exact hit. This is because
|
||||
* mappings between original and generated line/col pairs are single points,
|
||||
* and there is an implicit region between each of them, so a miss just means
|
||||
* that you aren't on the very start of a region.
|
||||
*
|
||||
* @param aNeedle The element you are looking for.
|
||||
* @param aHaystack The array that is being searched.
|
||||
* @param aCompare A function which takes the needle and an element in the
|
||||
* array and returns -1, 0, or 1 depending on whether the needle is less
|
||||
* than, equal to, or greater than the element, respectively.
|
||||
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
||||
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
||||
* closest element that is smaller than or greater than the one we are
|
||||
* searching for, respectively, if the exact element cannot be found.
|
||||
* Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
|
||||
*/
|
||||
exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
|
||||
if (aHaystack.length === 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
|
||||
aCompare, aBias || exports.GREATEST_LOWER_BOUND);
|
||||
if (index < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// We have found either the exact element, or the next-closest element than
|
||||
// the one we are searching for. However, there may be more than one such
|
||||
// element. Make sure we always return the smallest of these.
|
||||
while (index - 1 >= 0) {
|
||||
if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
|
||||
break;
|
||||
}
|
||||
--index;
|
||||
}
|
||||
|
||||
return index;
|
||||
};
|
||||
79
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/mapping-list.js
generated
vendored
Normal file
79
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/mapping-list.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2014 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var util = require('./util');
|
||||
|
||||
/**
|
||||
* Determine whether mappingB is after mappingA with respect to generated
|
||||
* position.
|
||||
*/
|
||||
function generatedPositionAfter(mappingA, mappingB) {
|
||||
// Optimized for most common case
|
||||
var lineA = mappingA.generatedLine;
|
||||
var lineB = mappingB.generatedLine;
|
||||
var columnA = mappingA.generatedColumn;
|
||||
var columnB = mappingB.generatedColumn;
|
||||
return lineB > lineA || lineB == lineA && columnB >= columnA ||
|
||||
util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* A data structure to provide a sorted view of accumulated mappings in a
|
||||
* performance conscious manner. It trades a neglibable overhead in general
|
||||
* case for a large speedup in case of mappings being added in order.
|
||||
*/
|
||||
function MappingList() {
|
||||
this._array = [];
|
||||
this._sorted = true;
|
||||
// Serves as infimum
|
||||
this._last = {generatedLine: -1, generatedColumn: 0};
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate through internal items. This method takes the same arguments that
|
||||
* `Array.prototype.forEach` takes.
|
||||
*
|
||||
* NOTE: The order of the mappings is NOT guaranteed.
|
||||
*/
|
||||
MappingList.prototype.unsortedForEach =
|
||||
function MappingList_forEach(aCallback, aThisArg) {
|
||||
this._array.forEach(aCallback, aThisArg);
|
||||
};
|
||||
|
||||
/**
|
||||
* Add the given source mapping.
|
||||
*
|
||||
* @param Object aMapping
|
||||
*/
|
||||
MappingList.prototype.add = function MappingList_add(aMapping) {
|
||||
if (generatedPositionAfter(this._last, aMapping)) {
|
||||
this._last = aMapping;
|
||||
this._array.push(aMapping);
|
||||
} else {
|
||||
this._sorted = false;
|
||||
this._array.push(aMapping);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the flat, sorted array of mappings. The mappings are sorted by
|
||||
* generated position.
|
||||
*
|
||||
* WARNING: This method returns internal data without copying, for
|
||||
* performance. The return value must NOT be mutated, and should be treated as
|
||||
* an immutable borrow. If you want to take ownership, you must make your own
|
||||
* copy.
|
||||
*/
|
||||
MappingList.prototype.toArray = function MappingList_toArray() {
|
||||
if (!this._sorted) {
|
||||
this._array.sort(util.compareByGeneratedPositionsInflated);
|
||||
this._sorted = true;
|
||||
}
|
||||
return this._array;
|
||||
};
|
||||
|
||||
exports.MappingList = MappingList;
|
||||
132
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/quick-sort.js
generated
vendored
Normal file
132
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/quick-sort.js
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
// It turns out that some (most?) JavaScript engines don't self-host
|
||||
// `Array.prototype.sort`. This makes sense because C++ will likely remain
|
||||
// faster than JS when doing raw CPU-intensive sorting. However, when using a
|
||||
// custom comparator function, calling back and forth between the VM's C++ and
|
||||
// JIT'd JS is rather slow *and* loses JIT type information, resulting in
|
||||
// worse generated code for the comparator function than would be optimal. In
|
||||
// fact, when sorting with a comparator, these costs outweigh the benefits of
|
||||
// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
|
||||
// a ~3500ms mean speed-up in `bench/bench.html`.
|
||||
|
||||
function SortTemplate(comparator) {
|
||||
|
||||
/**
|
||||
* Swap the elements indexed by `x` and `y` in the array `ary`.
|
||||
*
|
||||
* @param {Array} ary
|
||||
* The array.
|
||||
* @param {Number} x
|
||||
* The index of the first item.
|
||||
* @param {Number} y
|
||||
* The index of the second item.
|
||||
*/
|
||||
function swap(ary, x, y) {
|
||||
var temp = ary[x];
|
||||
ary[x] = ary[y];
|
||||
ary[y] = temp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a random integer within the range `low .. high` inclusive.
|
||||
*
|
||||
* @param {Number} low
|
||||
* The lower bound on the range.
|
||||
* @param {Number} high
|
||||
* The upper bound on the range.
|
||||
*/
|
||||
function randomIntInRange(low, high) {
|
||||
return Math.round(low + (Math.random() * (high - low)));
|
||||
}
|
||||
|
||||
/**
|
||||
* The Quick Sort algorithm.
|
||||
*
|
||||
* @param {Array} ary
|
||||
* An array to sort.
|
||||
* @param {function} comparator
|
||||
* Function to use to compare two items.
|
||||
* @param {Number} p
|
||||
* Start index of the array
|
||||
* @param {Number} r
|
||||
* End index of the array
|
||||
*/
|
||||
function doQuickSort(ary, comparator, p, r) {
|
||||
// If our lower bound is less than our upper bound, we (1) partition the
|
||||
// array into two pieces and (2) recurse on each half. If it is not, this is
|
||||
// the empty array and our base case.
|
||||
|
||||
if (p < r) {
|
||||
// (1) Partitioning.
|
||||
//
|
||||
// The partitioning chooses a pivot between `p` and `r` and moves all
|
||||
// elements that are less than or equal to the pivot to the before it, and
|
||||
// all the elements that are greater than it after it. The effect is that
|
||||
// once partition is done, the pivot is in the exact place it will be when
|
||||
// the array is put in sorted order, and it will not need to be moved
|
||||
// again. This runs in O(n) time.
|
||||
|
||||
// Always choose a random pivot so that an input array which is reverse
|
||||
// sorted does not cause O(n^2) running time.
|
||||
var pivotIndex = randomIntInRange(p, r);
|
||||
var i = p - 1;
|
||||
|
||||
swap(ary, pivotIndex, r);
|
||||
var pivot = ary[r];
|
||||
|
||||
// Immediately after `j` is incremented in this loop, the following hold
|
||||
// true:
|
||||
//
|
||||
// * Every element in `ary[p .. i]` is less than or equal to the pivot.
|
||||
//
|
||||
// * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
|
||||
for (var j = p; j < r; j++) {
|
||||
if (comparator(ary[j], pivot, false) <= 0) {
|
||||
i += 1;
|
||||
swap(ary, i, j);
|
||||
}
|
||||
}
|
||||
|
||||
swap(ary, i + 1, j);
|
||||
var q = i + 1;
|
||||
|
||||
// (2) Recurse on each half.
|
||||
|
||||
doQuickSort(ary, comparator, p, q - 1);
|
||||
doQuickSort(ary, comparator, q + 1, r);
|
||||
}
|
||||
}
|
||||
|
||||
return doQuickSort;
|
||||
}
|
||||
|
||||
function cloneSort(comparator) {
|
||||
let template = SortTemplate.toString();
|
||||
let templateFn = new Function(`return ${template}`)();
|
||||
return templateFn(comparator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort the given array in-place with the given comparator function.
|
||||
*
|
||||
* @param {Array} ary
|
||||
* An array to sort.
|
||||
* @param {function} comparator
|
||||
* Function to use to compare two items.
|
||||
*/
|
||||
|
||||
let sortCache = new WeakMap();
|
||||
exports.quickSort = function (ary, comparator, start = 0) {
|
||||
let doQuickSort = sortCache.get(comparator);
|
||||
if (doQuickSort === void 0) {
|
||||
doQuickSort = cloneSort(comparator);
|
||||
sortCache.set(comparator, doQuickSort);
|
||||
}
|
||||
doQuickSort(ary, comparator, start, ary.length - 1);
|
||||
};
|
||||
1184
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/source-map-consumer.js
generated
vendored
Normal file
1184
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/source-map-consumer.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
425
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/source-map-generator.js
generated
vendored
Normal file
425
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/source-map-generator.js
generated
vendored
Normal file
@@ -0,0 +1,425 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var base64VLQ = require('./base64-vlq');
|
||||
var util = require('./util');
|
||||
var ArraySet = require('./array-set').ArraySet;
|
||||
var MappingList = require('./mapping-list').MappingList;
|
||||
|
||||
/**
|
||||
* An instance of the SourceMapGenerator represents a source map which is
|
||||
* being built incrementally. You may pass an object with the following
|
||||
* properties:
|
||||
*
|
||||
* - file: The filename of the generated source.
|
||||
* - sourceRoot: A root for all relative URLs in this source map.
|
||||
*/
|
||||
function SourceMapGenerator(aArgs) {
|
||||
if (!aArgs) {
|
||||
aArgs = {};
|
||||
}
|
||||
this._file = util.getArg(aArgs, 'file', null);
|
||||
this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
|
||||
this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
|
||||
this._sources = new ArraySet();
|
||||
this._names = new ArraySet();
|
||||
this._mappings = new MappingList();
|
||||
this._sourcesContents = null;
|
||||
}
|
||||
|
||||
SourceMapGenerator.prototype._version = 3;
|
||||
|
||||
/**
|
||||
* Creates a new SourceMapGenerator based on a SourceMapConsumer
|
||||
*
|
||||
* @param aSourceMapConsumer The SourceMap.
|
||||
*/
|
||||
SourceMapGenerator.fromSourceMap =
|
||||
function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
|
||||
var sourceRoot = aSourceMapConsumer.sourceRoot;
|
||||
var generator = new SourceMapGenerator({
|
||||
file: aSourceMapConsumer.file,
|
||||
sourceRoot: sourceRoot
|
||||
});
|
||||
aSourceMapConsumer.eachMapping(function (mapping) {
|
||||
var newMapping = {
|
||||
generated: {
|
||||
line: mapping.generatedLine,
|
||||
column: mapping.generatedColumn
|
||||
}
|
||||
};
|
||||
|
||||
if (mapping.source != null) {
|
||||
newMapping.source = mapping.source;
|
||||
if (sourceRoot != null) {
|
||||
newMapping.source = util.relative(sourceRoot, newMapping.source);
|
||||
}
|
||||
|
||||
newMapping.original = {
|
||||
line: mapping.originalLine,
|
||||
column: mapping.originalColumn
|
||||
};
|
||||
|
||||
if (mapping.name != null) {
|
||||
newMapping.name = mapping.name;
|
||||
}
|
||||
}
|
||||
|
||||
generator.addMapping(newMapping);
|
||||
});
|
||||
aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
||||
var sourceRelative = sourceFile;
|
||||
if (sourceRoot !== null) {
|
||||
sourceRelative = util.relative(sourceRoot, sourceFile);
|
||||
}
|
||||
|
||||
if (!generator._sources.has(sourceRelative)) {
|
||||
generator._sources.add(sourceRelative);
|
||||
}
|
||||
|
||||
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
||||
if (content != null) {
|
||||
generator.setSourceContent(sourceFile, content);
|
||||
}
|
||||
});
|
||||
return generator;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a single mapping from original source line and column to the generated
|
||||
* source's line and column for this source map being created. The mapping
|
||||
* object should have the following properties:
|
||||
*
|
||||
* - generated: An object with the generated line and column positions.
|
||||
* - original: An object with the original line and column positions.
|
||||
* - source: The original source file (relative to the sourceRoot).
|
||||
* - name: An optional original token name for this mapping.
|
||||
*/
|
||||
SourceMapGenerator.prototype.addMapping =
|
||||
function SourceMapGenerator_addMapping(aArgs) {
|
||||
var generated = util.getArg(aArgs, 'generated');
|
||||
var original = util.getArg(aArgs, 'original', null);
|
||||
var source = util.getArg(aArgs, 'source', null);
|
||||
var name = util.getArg(aArgs, 'name', null);
|
||||
|
||||
if (!this._skipValidation) {
|
||||
this._validateMapping(generated, original, source, name);
|
||||
}
|
||||
|
||||
if (source != null) {
|
||||
source = String(source);
|
||||
if (!this._sources.has(source)) {
|
||||
this._sources.add(source);
|
||||
}
|
||||
}
|
||||
|
||||
if (name != null) {
|
||||
name = String(name);
|
||||
if (!this._names.has(name)) {
|
||||
this._names.add(name);
|
||||
}
|
||||
}
|
||||
|
||||
this._mappings.add({
|
||||
generatedLine: generated.line,
|
||||
generatedColumn: generated.column,
|
||||
originalLine: original != null && original.line,
|
||||
originalColumn: original != null && original.column,
|
||||
source: source,
|
||||
name: name
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the source content for a source file.
|
||||
*/
|
||||
SourceMapGenerator.prototype.setSourceContent =
|
||||
function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
|
||||
var source = aSourceFile;
|
||||
if (this._sourceRoot != null) {
|
||||
source = util.relative(this._sourceRoot, source);
|
||||
}
|
||||
|
||||
if (aSourceContent != null) {
|
||||
// Add the source content to the _sourcesContents map.
|
||||
// Create a new _sourcesContents map if the property is null.
|
||||
if (!this._sourcesContents) {
|
||||
this._sourcesContents = Object.create(null);
|
||||
}
|
||||
this._sourcesContents[util.toSetString(source)] = aSourceContent;
|
||||
} else if (this._sourcesContents) {
|
||||
// Remove the source file from the _sourcesContents map.
|
||||
// If the _sourcesContents map is empty, set the property to null.
|
||||
delete this._sourcesContents[util.toSetString(source)];
|
||||
if (Object.keys(this._sourcesContents).length === 0) {
|
||||
this._sourcesContents = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Applies the mappings of a sub-source-map for a specific source file to the
|
||||
* source map being generated. Each mapping to the supplied source file is
|
||||
* rewritten using the supplied source map. Note: The resolution for the
|
||||
* resulting mappings is the minimium of this map and the supplied map.
|
||||
*
|
||||
* @param aSourceMapConsumer The source map to be applied.
|
||||
* @param aSourceFile Optional. The filename of the source file.
|
||||
* If omitted, SourceMapConsumer's file property will be used.
|
||||
* @param aSourceMapPath Optional. The dirname of the path to the source map
|
||||
* to be applied. If relative, it is relative to the SourceMapConsumer.
|
||||
* This parameter is needed when the two source maps aren't in the same
|
||||
* directory, and the source map to be applied contains relative source
|
||||
* paths. If so, those relative source paths need to be rewritten
|
||||
* relative to the SourceMapGenerator.
|
||||
*/
|
||||
SourceMapGenerator.prototype.applySourceMap =
|
||||
function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
|
||||
var sourceFile = aSourceFile;
|
||||
// If aSourceFile is omitted, we will use the file property of the SourceMap
|
||||
if (aSourceFile == null) {
|
||||
if (aSourceMapConsumer.file == null) {
|
||||
throw new Error(
|
||||
'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
|
||||
'or the source map\'s "file" property. Both were omitted.'
|
||||
);
|
||||
}
|
||||
sourceFile = aSourceMapConsumer.file;
|
||||
}
|
||||
var sourceRoot = this._sourceRoot;
|
||||
// Make "sourceFile" relative if an absolute Url is passed.
|
||||
if (sourceRoot != null) {
|
||||
sourceFile = util.relative(sourceRoot, sourceFile);
|
||||
}
|
||||
// Applying the SourceMap can add and remove items from the sources and
|
||||
// the names array.
|
||||
var newSources = new ArraySet();
|
||||
var newNames = new ArraySet();
|
||||
|
||||
// Find mappings for the "sourceFile"
|
||||
this._mappings.unsortedForEach(function (mapping) {
|
||||
if (mapping.source === sourceFile && mapping.originalLine != null) {
|
||||
// Check if it can be mapped by the source map, then update the mapping.
|
||||
var original = aSourceMapConsumer.originalPositionFor({
|
||||
line: mapping.originalLine,
|
||||
column: mapping.originalColumn
|
||||
});
|
||||
if (original.source != null) {
|
||||
// Copy mapping
|
||||
mapping.source = original.source;
|
||||
if (aSourceMapPath != null) {
|
||||
mapping.source = util.join(aSourceMapPath, mapping.source)
|
||||
}
|
||||
if (sourceRoot != null) {
|
||||
mapping.source = util.relative(sourceRoot, mapping.source);
|
||||
}
|
||||
mapping.originalLine = original.line;
|
||||
mapping.originalColumn = original.column;
|
||||
if (original.name != null) {
|
||||
mapping.name = original.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var source = mapping.source;
|
||||
if (source != null && !newSources.has(source)) {
|
||||
newSources.add(source);
|
||||
}
|
||||
|
||||
var name = mapping.name;
|
||||
if (name != null && !newNames.has(name)) {
|
||||
newNames.add(name);
|
||||
}
|
||||
|
||||
}, this);
|
||||
this._sources = newSources;
|
||||
this._names = newNames;
|
||||
|
||||
// Copy sourcesContents of applied map.
|
||||
aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
||||
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
||||
if (content != null) {
|
||||
if (aSourceMapPath != null) {
|
||||
sourceFile = util.join(aSourceMapPath, sourceFile);
|
||||
}
|
||||
if (sourceRoot != null) {
|
||||
sourceFile = util.relative(sourceRoot, sourceFile);
|
||||
}
|
||||
this.setSourceContent(sourceFile, content);
|
||||
}
|
||||
}, this);
|
||||
};
|
||||
|
||||
/**
|
||||
* A mapping can have one of the three levels of data:
|
||||
*
|
||||
* 1. Just the generated position.
|
||||
* 2. The Generated position, original position, and original source.
|
||||
* 3. Generated and original position, original source, as well as a name
|
||||
* token.
|
||||
*
|
||||
* To maintain consistency, we validate that any new mapping being added falls
|
||||
* in to one of these categories.
|
||||
*/
|
||||
SourceMapGenerator.prototype._validateMapping =
|
||||
function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
|
||||
aName) {
|
||||
// When aOriginal is truthy but has empty values for .line and .column,
|
||||
// it is most likely a programmer error. In this case we throw a very
|
||||
// specific error message to try to guide them the right way.
|
||||
// For example: https://github.com/Polymer/polymer-bundler/pull/519
|
||||
if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
|
||||
throw new Error(
|
||||
'original.line and original.column are not numbers -- you probably meant to omit ' +
|
||||
'the original mapping entirely and only map the generated position. If so, pass ' +
|
||||
'null for the original mapping instead of an object with empty or null values.'
|
||||
);
|
||||
}
|
||||
|
||||
if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
|
||||
&& aGenerated.line > 0 && aGenerated.column >= 0
|
||||
&& !aOriginal && !aSource && !aName) {
|
||||
// Case 1.
|
||||
return;
|
||||
}
|
||||
else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
|
||||
&& aOriginal && 'line' in aOriginal && 'column' in aOriginal
|
||||
&& aGenerated.line > 0 && aGenerated.column >= 0
|
||||
&& aOriginal.line > 0 && aOriginal.column >= 0
|
||||
&& aSource) {
|
||||
// Cases 2 and 3.
|
||||
return;
|
||||
}
|
||||
else {
|
||||
throw new Error('Invalid mapping: ' + JSON.stringify({
|
||||
generated: aGenerated,
|
||||
source: aSource,
|
||||
original: aOriginal,
|
||||
name: aName
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Serialize the accumulated mappings in to the stream of base 64 VLQs
|
||||
* specified by the source map format.
|
||||
*/
|
||||
SourceMapGenerator.prototype._serializeMappings =
|
||||
function SourceMapGenerator_serializeMappings() {
|
||||
var previousGeneratedColumn = 0;
|
||||
var previousGeneratedLine = 1;
|
||||
var previousOriginalColumn = 0;
|
||||
var previousOriginalLine = 0;
|
||||
var previousName = 0;
|
||||
var previousSource = 0;
|
||||
var result = '';
|
||||
var next;
|
||||
var mapping;
|
||||
var nameIdx;
|
||||
var sourceIdx;
|
||||
|
||||
var mappings = this._mappings.toArray();
|
||||
for (var i = 0, len = mappings.length; i < len; i++) {
|
||||
mapping = mappings[i];
|
||||
next = ''
|
||||
|
||||
if (mapping.generatedLine !== previousGeneratedLine) {
|
||||
previousGeneratedColumn = 0;
|
||||
while (mapping.generatedLine !== previousGeneratedLine) {
|
||||
next += ';';
|
||||
previousGeneratedLine++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (i > 0) {
|
||||
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
|
||||
continue;
|
||||
}
|
||||
next += ',';
|
||||
}
|
||||
}
|
||||
|
||||
next += base64VLQ.encode(mapping.generatedColumn
|
||||
- previousGeneratedColumn);
|
||||
previousGeneratedColumn = mapping.generatedColumn;
|
||||
|
||||
if (mapping.source != null) {
|
||||
sourceIdx = this._sources.indexOf(mapping.source);
|
||||
next += base64VLQ.encode(sourceIdx - previousSource);
|
||||
previousSource = sourceIdx;
|
||||
|
||||
// lines are stored 0-based in SourceMap spec version 3
|
||||
next += base64VLQ.encode(mapping.originalLine - 1
|
||||
- previousOriginalLine);
|
||||
previousOriginalLine = mapping.originalLine - 1;
|
||||
|
||||
next += base64VLQ.encode(mapping.originalColumn
|
||||
- previousOriginalColumn);
|
||||
previousOriginalColumn = mapping.originalColumn;
|
||||
|
||||
if (mapping.name != null) {
|
||||
nameIdx = this._names.indexOf(mapping.name);
|
||||
next += base64VLQ.encode(nameIdx - previousName);
|
||||
previousName = nameIdx;
|
||||
}
|
||||
}
|
||||
|
||||
result += next;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
SourceMapGenerator.prototype._generateSourcesContent =
|
||||
function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
|
||||
return aSources.map(function (source) {
|
||||
if (!this._sourcesContents) {
|
||||
return null;
|
||||
}
|
||||
if (aSourceRoot != null) {
|
||||
source = util.relative(aSourceRoot, source);
|
||||
}
|
||||
var key = util.toSetString(source);
|
||||
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
|
||||
? this._sourcesContents[key]
|
||||
: null;
|
||||
}, this);
|
||||
};
|
||||
|
||||
/**
|
||||
* Externalize the source map.
|
||||
*/
|
||||
SourceMapGenerator.prototype.toJSON =
|
||||
function SourceMapGenerator_toJSON() {
|
||||
var map = {
|
||||
version: this._version,
|
||||
sources: this._sources.toArray(),
|
||||
names: this._names.toArray(),
|
||||
mappings: this._serializeMappings()
|
||||
};
|
||||
if (this._file != null) {
|
||||
map.file = this._file;
|
||||
}
|
||||
if (this._sourceRoot != null) {
|
||||
map.sourceRoot = this._sourceRoot;
|
||||
}
|
||||
if (this._sourcesContents) {
|
||||
map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
|
||||
}
|
||||
|
||||
return map;
|
||||
};
|
||||
|
||||
/**
|
||||
* Render the source map being generated to a string.
|
||||
*/
|
||||
SourceMapGenerator.prototype.toString =
|
||||
function SourceMapGenerator_toString() {
|
||||
return JSON.stringify(this.toJSON());
|
||||
};
|
||||
|
||||
exports.SourceMapGenerator = SourceMapGenerator;
|
||||
413
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/source-node.js
generated
vendored
Normal file
413
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/source-node.js
generated
vendored
Normal file
@@ -0,0 +1,413 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;
|
||||
var util = require('./util');
|
||||
|
||||
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
|
||||
// operating systems these days (capturing the result).
|
||||
var REGEX_NEWLINE = /(\r?\n)/;
|
||||
|
||||
// Newline character code for charCodeAt() comparisons
|
||||
var NEWLINE_CODE = 10;
|
||||
|
||||
// Private symbol for identifying `SourceNode`s when multiple versions of
|
||||
// the source-map library are loaded. This MUST NOT CHANGE across
|
||||
// versions!
|
||||
var isSourceNode = "$$$isSourceNode$$$";
|
||||
|
||||
/**
|
||||
* SourceNodes provide a way to abstract over interpolating/concatenating
|
||||
* snippets of generated JavaScript source code while maintaining the line and
|
||||
* column information associated with the original source code.
|
||||
*
|
||||
* @param aLine The original line number.
|
||||
* @param aColumn The original column number.
|
||||
* @param aSource The original source's filename.
|
||||
* @param aChunks Optional. An array of strings which are snippets of
|
||||
* generated JS, or other SourceNodes.
|
||||
* @param aName The original identifier.
|
||||
*/
|
||||
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
|
||||
this.children = [];
|
||||
this.sourceContents = {};
|
||||
this.line = aLine == null ? null : aLine;
|
||||
this.column = aColumn == null ? null : aColumn;
|
||||
this.source = aSource == null ? null : aSource;
|
||||
this.name = aName == null ? null : aName;
|
||||
this[isSourceNode] = true;
|
||||
if (aChunks != null) this.add(aChunks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a SourceNode from generated code and a SourceMapConsumer.
|
||||
*
|
||||
* @param aGeneratedCode The generated code
|
||||
* @param aSourceMapConsumer The SourceMap for the generated code
|
||||
* @param aRelativePath Optional. The path that relative sources in the
|
||||
* SourceMapConsumer should be relative to.
|
||||
*/
|
||||
SourceNode.fromStringWithSourceMap =
|
||||
function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
|
||||
// The SourceNode we want to fill with the generated code
|
||||
// and the SourceMap
|
||||
var node = new SourceNode();
|
||||
|
||||
// All even indices of this array are one line of the generated code,
|
||||
// while all odd indices are the newlines between two adjacent lines
|
||||
// (since `REGEX_NEWLINE` captures its match).
|
||||
// Processed fragments are accessed by calling `shiftNextLine`.
|
||||
var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
|
||||
var remainingLinesIndex = 0;
|
||||
var shiftNextLine = function() {
|
||||
var lineContents = getNextLine();
|
||||
// The last line of a file might not have a newline.
|
||||
var newLine = getNextLine() || "";
|
||||
return lineContents + newLine;
|
||||
|
||||
function getNextLine() {
|
||||
return remainingLinesIndex < remainingLines.length ?
|
||||
remainingLines[remainingLinesIndex++] : undefined;
|
||||
}
|
||||
};
|
||||
|
||||
// We need to remember the position of "remainingLines"
|
||||
var lastGeneratedLine = 1, lastGeneratedColumn = 0;
|
||||
|
||||
// The generate SourceNodes we need a code range.
|
||||
// To extract it current and last mapping is used.
|
||||
// Here we store the last mapping.
|
||||
var lastMapping = null;
|
||||
|
||||
aSourceMapConsumer.eachMapping(function (mapping) {
|
||||
if (lastMapping !== null) {
|
||||
// We add the code from "lastMapping" to "mapping":
|
||||
// First check if there is a new line in between.
|
||||
if (lastGeneratedLine < mapping.generatedLine) {
|
||||
// Associate first line with "lastMapping"
|
||||
addMappingWithCode(lastMapping, shiftNextLine());
|
||||
lastGeneratedLine++;
|
||||
lastGeneratedColumn = 0;
|
||||
// The remaining code is added without mapping
|
||||
} else {
|
||||
// There is no new line in between.
|
||||
// Associate the code between "lastGeneratedColumn" and
|
||||
// "mapping.generatedColumn" with "lastMapping"
|
||||
var nextLine = remainingLines[remainingLinesIndex] || '';
|
||||
var code = nextLine.substr(0, mapping.generatedColumn -
|
||||
lastGeneratedColumn);
|
||||
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
|
||||
lastGeneratedColumn);
|
||||
lastGeneratedColumn = mapping.generatedColumn;
|
||||
addMappingWithCode(lastMapping, code);
|
||||
// No more remaining code, continue
|
||||
lastMapping = mapping;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// We add the generated code until the first mapping
|
||||
// to the SourceNode without any mapping.
|
||||
// Each line is added as separate string.
|
||||
while (lastGeneratedLine < mapping.generatedLine) {
|
||||
node.add(shiftNextLine());
|
||||
lastGeneratedLine++;
|
||||
}
|
||||
if (lastGeneratedColumn < mapping.generatedColumn) {
|
||||
var nextLine = remainingLines[remainingLinesIndex] || '';
|
||||
node.add(nextLine.substr(0, mapping.generatedColumn));
|
||||
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
|
||||
lastGeneratedColumn = mapping.generatedColumn;
|
||||
}
|
||||
lastMapping = mapping;
|
||||
}, this);
|
||||
// We have processed all mappings.
|
||||
if (remainingLinesIndex < remainingLines.length) {
|
||||
if (lastMapping) {
|
||||
// Associate the remaining code in the current line with "lastMapping"
|
||||
addMappingWithCode(lastMapping, shiftNextLine());
|
||||
}
|
||||
// and add the remaining lines without any mapping
|
||||
node.add(remainingLines.splice(remainingLinesIndex).join(""));
|
||||
}
|
||||
|
||||
// Copy sourcesContent into SourceNode
|
||||
aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
||||
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
||||
if (content != null) {
|
||||
if (aRelativePath != null) {
|
||||
sourceFile = util.join(aRelativePath, sourceFile);
|
||||
}
|
||||
node.setSourceContent(sourceFile, content);
|
||||
}
|
||||
});
|
||||
|
||||
return node;
|
||||
|
||||
function addMappingWithCode(mapping, code) {
|
||||
if (mapping === null || mapping.source === undefined) {
|
||||
node.add(code);
|
||||
} else {
|
||||
var source = aRelativePath
|
||||
? util.join(aRelativePath, mapping.source)
|
||||
: mapping.source;
|
||||
node.add(new SourceNode(mapping.originalLine,
|
||||
mapping.originalColumn,
|
||||
source,
|
||||
code,
|
||||
mapping.name));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a chunk of generated JS to this source node.
|
||||
*
|
||||
* @param aChunk A string snippet of generated JS code, another instance of
|
||||
* SourceNode, or an array where each member is one of those things.
|
||||
*/
|
||||
SourceNode.prototype.add = function SourceNode_add(aChunk) {
|
||||
if (Array.isArray(aChunk)) {
|
||||
aChunk.forEach(function (chunk) {
|
||||
this.add(chunk);
|
||||
}, this);
|
||||
}
|
||||
else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
||||
if (aChunk) {
|
||||
this.children.push(aChunk);
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new TypeError(
|
||||
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
||||
);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a chunk of generated JS to the beginning of this source node.
|
||||
*
|
||||
* @param aChunk A string snippet of generated JS code, another instance of
|
||||
* SourceNode, or an array where each member is one of those things.
|
||||
*/
|
||||
SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
|
||||
if (Array.isArray(aChunk)) {
|
||||
for (var i = aChunk.length-1; i >= 0; i--) {
|
||||
this.prepend(aChunk[i]);
|
||||
}
|
||||
}
|
||||
else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
||||
this.children.unshift(aChunk);
|
||||
}
|
||||
else {
|
||||
throw new TypeError(
|
||||
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
||||
);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Walk over the tree of JS snippets in this node and its children. The
|
||||
* walking function is called once for each snippet of JS and is passed that
|
||||
* snippet and the its original associated source's line/column location.
|
||||
*
|
||||
* @param aFn The traversal function.
|
||||
*/
|
||||
SourceNode.prototype.walk = function SourceNode_walk(aFn) {
|
||||
var chunk;
|
||||
for (var i = 0, len = this.children.length; i < len; i++) {
|
||||
chunk = this.children[i];
|
||||
if (chunk[isSourceNode]) {
|
||||
chunk.walk(aFn);
|
||||
}
|
||||
else {
|
||||
if (chunk !== '') {
|
||||
aFn(chunk, { source: this.source,
|
||||
line: this.line,
|
||||
column: this.column,
|
||||
name: this.name });
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
|
||||
* each of `this.children`.
|
||||
*
|
||||
* @param aSep The separator.
|
||||
*/
|
||||
SourceNode.prototype.join = function SourceNode_join(aSep) {
|
||||
var newChildren;
|
||||
var i;
|
||||
var len = this.children.length;
|
||||
if (len > 0) {
|
||||
newChildren = [];
|
||||
for (i = 0; i < len-1; i++) {
|
||||
newChildren.push(this.children[i]);
|
||||
newChildren.push(aSep);
|
||||
}
|
||||
newChildren.push(this.children[i]);
|
||||
this.children = newChildren;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Call String.prototype.replace on the very right-most source snippet. Useful
|
||||
* for trimming whitespace from the end of a source node, etc.
|
||||
*
|
||||
* @param aPattern The pattern to replace.
|
||||
* @param aReplacement The thing to replace the pattern with.
|
||||
*/
|
||||
SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
|
||||
var lastChild = this.children[this.children.length - 1];
|
||||
if (lastChild[isSourceNode]) {
|
||||
lastChild.replaceRight(aPattern, aReplacement);
|
||||
}
|
||||
else if (typeof lastChild === 'string') {
|
||||
this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
|
||||
}
|
||||
else {
|
||||
this.children.push(''.replace(aPattern, aReplacement));
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the source content for a source file. This will be added to the SourceMapGenerator
|
||||
* in the sourcesContent field.
|
||||
*
|
||||
* @param aSourceFile The filename of the source file
|
||||
* @param aSourceContent The content of the source file
|
||||
*/
|
||||
SourceNode.prototype.setSourceContent =
|
||||
function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
|
||||
this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
|
||||
};
|
||||
|
||||
/**
|
||||
* Walk over the tree of SourceNodes. The walking function is called for each
|
||||
* source file content and is passed the filename and source content.
|
||||
*
|
||||
* @param aFn The traversal function.
|
||||
*/
|
||||
SourceNode.prototype.walkSourceContents =
|
||||
function SourceNode_walkSourceContents(aFn) {
|
||||
for (var i = 0, len = this.children.length; i < len; i++) {
|
||||
if (this.children[i][isSourceNode]) {
|
||||
this.children[i].walkSourceContents(aFn);
|
||||
}
|
||||
}
|
||||
|
||||
var sources = Object.keys(this.sourceContents);
|
||||
for (var i = 0, len = sources.length; i < len; i++) {
|
||||
aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the string representation of this source node. Walks over the tree
|
||||
* and concatenates all the various snippets together to one string.
|
||||
*/
|
||||
SourceNode.prototype.toString = function SourceNode_toString() {
|
||||
var str = "";
|
||||
this.walk(function (chunk) {
|
||||
str += chunk;
|
||||
});
|
||||
return str;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the string representation of this source node along with a source
|
||||
* map.
|
||||
*/
|
||||
SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
|
||||
var generated = {
|
||||
code: "",
|
||||
line: 1,
|
||||
column: 0
|
||||
};
|
||||
var map = new SourceMapGenerator(aArgs);
|
||||
var sourceMappingActive = false;
|
||||
var lastOriginalSource = null;
|
||||
var lastOriginalLine = null;
|
||||
var lastOriginalColumn = null;
|
||||
var lastOriginalName = null;
|
||||
this.walk(function (chunk, original) {
|
||||
generated.code += chunk;
|
||||
if (original.source !== null
|
||||
&& original.line !== null
|
||||
&& original.column !== null) {
|
||||
if(lastOriginalSource !== original.source
|
||||
|| lastOriginalLine !== original.line
|
||||
|| lastOriginalColumn !== original.column
|
||||
|| lastOriginalName !== original.name) {
|
||||
map.addMapping({
|
||||
source: original.source,
|
||||
original: {
|
||||
line: original.line,
|
||||
column: original.column
|
||||
},
|
||||
generated: {
|
||||
line: generated.line,
|
||||
column: generated.column
|
||||
},
|
||||
name: original.name
|
||||
});
|
||||
}
|
||||
lastOriginalSource = original.source;
|
||||
lastOriginalLine = original.line;
|
||||
lastOriginalColumn = original.column;
|
||||
lastOriginalName = original.name;
|
||||
sourceMappingActive = true;
|
||||
} else if (sourceMappingActive) {
|
||||
map.addMapping({
|
||||
generated: {
|
||||
line: generated.line,
|
||||
column: generated.column
|
||||
}
|
||||
});
|
||||
lastOriginalSource = null;
|
||||
sourceMappingActive = false;
|
||||
}
|
||||
for (var idx = 0, length = chunk.length; idx < length; idx++) {
|
||||
if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
|
||||
generated.line++;
|
||||
generated.column = 0;
|
||||
// Mappings end at eol
|
||||
if (idx + 1 === length) {
|
||||
lastOriginalSource = null;
|
||||
sourceMappingActive = false;
|
||||
} else if (sourceMappingActive) {
|
||||
map.addMapping({
|
||||
source: original.source,
|
||||
original: {
|
||||
line: original.line,
|
||||
column: original.column
|
||||
},
|
||||
generated: {
|
||||
line: generated.line,
|
||||
column: generated.column
|
||||
},
|
||||
name: original.name
|
||||
});
|
||||
}
|
||||
} else {
|
||||
generated.column++;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.walkSourceContents(function (sourceFile, sourceContent) {
|
||||
map.setSourceContent(sourceFile, sourceContent);
|
||||
});
|
||||
|
||||
return { code: generated.code, map: map };
|
||||
};
|
||||
|
||||
exports.SourceNode = SourceNode;
|
||||
594
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/util.js
generated
vendored
Normal file
594
node_modules/.store/sass@1.69.5/node_modules/source-map-js/lib/util.js
generated
vendored
Normal file
@@ -0,0 +1,594 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
/**
|
||||
* This is a helper function for getting values from parameter/options
|
||||
* objects.
|
||||
*
|
||||
* @param args The object we are extracting values from
|
||||
* @param name The name of the property we are getting.
|
||||
* @param defaultValue An optional value to return if the property is missing
|
||||
* from the object. If this is not specified and the property is missing, an
|
||||
* error will be thrown.
|
||||
*/
|
||||
function getArg(aArgs, aName, aDefaultValue) {
|
||||
if (aName in aArgs) {
|
||||
return aArgs[aName];
|
||||
} else if (arguments.length === 3) {
|
||||
return aDefaultValue;
|
||||
} else {
|
||||
throw new Error('"' + aName + '" is a required argument.');
|
||||
}
|
||||
}
|
||||
exports.getArg = getArg;
|
||||
|
||||
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
|
||||
var dataUrlRegexp = /^data:.+\,.+$/;
|
||||
|
||||
function urlParse(aUrl) {
|
||||
var match = aUrl.match(urlRegexp);
|
||||
if (!match) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
scheme: match[1],
|
||||
auth: match[2],
|
||||
host: match[3],
|
||||
port: match[4],
|
||||
path: match[5]
|
||||
};
|
||||
}
|
||||
exports.urlParse = urlParse;
|
||||
|
||||
function urlGenerate(aParsedUrl) {
|
||||
var url = '';
|
||||
if (aParsedUrl.scheme) {
|
||||
url += aParsedUrl.scheme + ':';
|
||||
}
|
||||
url += '//';
|
||||
if (aParsedUrl.auth) {
|
||||
url += aParsedUrl.auth + '@';
|
||||
}
|
||||
if (aParsedUrl.host) {
|
||||
url += aParsedUrl.host;
|
||||
}
|
||||
if (aParsedUrl.port) {
|
||||
url += ":" + aParsedUrl.port
|
||||
}
|
||||
if (aParsedUrl.path) {
|
||||
url += aParsedUrl.path;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
exports.urlGenerate = urlGenerate;
|
||||
|
||||
var MAX_CACHED_INPUTS = 32;
|
||||
|
||||
/**
|
||||
* Takes some function `f(input) -> result` and returns a memoized version of
|
||||
* `f`.
|
||||
*
|
||||
* We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The
|
||||
* memoization is a dumb-simple, linear least-recently-used cache.
|
||||
*/
|
||||
function lruMemoize(f) {
|
||||
var cache = [];
|
||||
|
||||
return function(input) {
|
||||
for (var i = 0; i < cache.length; i++) {
|
||||
if (cache[i].input === input) {
|
||||
var temp = cache[0];
|
||||
cache[0] = cache[i];
|
||||
cache[i] = temp;
|
||||
return cache[0].result;
|
||||
}
|
||||
}
|
||||
|
||||
var result = f(input);
|
||||
|
||||
cache.unshift({
|
||||
input,
|
||||
result,
|
||||
});
|
||||
|
||||
if (cache.length > MAX_CACHED_INPUTS) {
|
||||
cache.pop();
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes a path, or the path portion of a URL:
|
||||
*
|
||||
* - Replaces consecutive slashes with one slash.
|
||||
* - Removes unnecessary '.' parts.
|
||||
* - Removes unnecessary '<dir>/..' parts.
|
||||
*
|
||||
* Based on code in the Node.js 'path' core module.
|
||||
*
|
||||
* @param aPath The path or url to normalize.
|
||||
*/
|
||||
var normalize = lruMemoize(function normalize(aPath) {
|
||||
var path = aPath;
|
||||
var url = urlParse(aPath);
|
||||
if (url) {
|
||||
if (!url.path) {
|
||||
return aPath;
|
||||
}
|
||||
path = url.path;
|
||||
}
|
||||
var isAbsolute = exports.isAbsolute(path);
|
||||
// Split the path into parts between `/` characters. This is much faster than
|
||||
// using `.split(/\/+/g)`.
|
||||
var parts = [];
|
||||
var start = 0;
|
||||
var i = 0;
|
||||
while (true) {
|
||||
start = i;
|
||||
i = path.indexOf("/", start);
|
||||
if (i === -1) {
|
||||
parts.push(path.slice(start));
|
||||
break;
|
||||
} else {
|
||||
parts.push(path.slice(start, i));
|
||||
while (i < path.length && path[i] === "/") {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
|
||||
part = parts[i];
|
||||
if (part === '.') {
|
||||
parts.splice(i, 1);
|
||||
} else if (part === '..') {
|
||||
up++;
|
||||
} else if (up > 0) {
|
||||
if (part === '') {
|
||||
// The first part is blank if the path is absolute. Trying to go
|
||||
// above the root is a no-op. Therefore we can remove all '..' parts
|
||||
// directly after the root.
|
||||
parts.splice(i + 1, up);
|
||||
up = 0;
|
||||
} else {
|
||||
parts.splice(i, 2);
|
||||
up--;
|
||||
}
|
||||
}
|
||||
}
|
||||
path = parts.join('/');
|
||||
|
||||
if (path === '') {
|
||||
path = isAbsolute ? '/' : '.';
|
||||
}
|
||||
|
||||
if (url) {
|
||||
url.path = path;
|
||||
return urlGenerate(url);
|
||||
}
|
||||
return path;
|
||||
});
|
||||
exports.normalize = normalize;
|
||||
|
||||
/**
|
||||
* Joins two paths/URLs.
|
||||
*
|
||||
* @param aRoot The root path or URL.
|
||||
* @param aPath The path or URL to be joined with the root.
|
||||
*
|
||||
* - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
|
||||
* scheme-relative URL: Then the scheme of aRoot, if any, is prepended
|
||||
* first.
|
||||
* - Otherwise aPath is a path. If aRoot is a URL, then its path portion
|
||||
* is updated with the result and aRoot is returned. Otherwise the result
|
||||
* is returned.
|
||||
* - If aPath is absolute, the result is aPath.
|
||||
* - Otherwise the two paths are joined with a slash.
|
||||
* - Joining for example 'http://' and 'www.example.com' is also supported.
|
||||
*/
|
||||
function join(aRoot, aPath) {
|
||||
if (aRoot === "") {
|
||||
aRoot = ".";
|
||||
}
|
||||
if (aPath === "") {
|
||||
aPath = ".";
|
||||
}
|
||||
var aPathUrl = urlParse(aPath);
|
||||
var aRootUrl = urlParse(aRoot);
|
||||
if (aRootUrl) {
|
||||
aRoot = aRootUrl.path || '/';
|
||||
}
|
||||
|
||||
// `join(foo, '//www.example.org')`
|
||||
if (aPathUrl && !aPathUrl.scheme) {
|
||||
if (aRootUrl) {
|
||||
aPathUrl.scheme = aRootUrl.scheme;
|
||||
}
|
||||
return urlGenerate(aPathUrl);
|
||||
}
|
||||
|
||||
if (aPathUrl || aPath.match(dataUrlRegexp)) {
|
||||
return aPath;
|
||||
}
|
||||
|
||||
// `join('http://', 'www.example.com')`
|
||||
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
|
||||
aRootUrl.host = aPath;
|
||||
return urlGenerate(aRootUrl);
|
||||
}
|
||||
|
||||
var joined = aPath.charAt(0) === '/'
|
||||
? aPath
|
||||
: normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
|
||||
|
||||
if (aRootUrl) {
|
||||
aRootUrl.path = joined;
|
||||
return urlGenerate(aRootUrl);
|
||||
}
|
||||
return joined;
|
||||
}
|
||||
exports.join = join;
|
||||
|
||||
exports.isAbsolute = function (aPath) {
|
||||
return aPath.charAt(0) === '/' || urlRegexp.test(aPath);
|
||||
};
|
||||
|
||||
/**
|
||||
* Make a path relative to a URL or another path.
|
||||
*
|
||||
* @param aRoot The root path or URL.
|
||||
* @param aPath The path or URL to be made relative to aRoot.
|
||||
*/
|
||||
function relative(aRoot, aPath) {
|
||||
if (aRoot === "") {
|
||||
aRoot = ".";
|
||||
}
|
||||
|
||||
aRoot = aRoot.replace(/\/$/, '');
|
||||
|
||||
// It is possible for the path to be above the root. In this case, simply
|
||||
// checking whether the root is a prefix of the path won't work. Instead, we
|
||||
// need to remove components from the root one by one, until either we find
|
||||
// a prefix that fits, or we run out of components to remove.
|
||||
var level = 0;
|
||||
while (aPath.indexOf(aRoot + '/') !== 0) {
|
||||
var index = aRoot.lastIndexOf("/");
|
||||
if (index < 0) {
|
||||
return aPath;
|
||||
}
|
||||
|
||||
// If the only part of the root that is left is the scheme (i.e. http://,
|
||||
// file:///, etc.), one or more slashes (/), or simply nothing at all, we
|
||||
// have exhausted all components, so the path is not relative to the root.
|
||||
aRoot = aRoot.slice(0, index);
|
||||
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
|
||||
return aPath;
|
||||
}
|
||||
|
||||
++level;
|
||||
}
|
||||
|
||||
// Make sure we add a "../" for each component we removed from the root.
|
||||
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
||||
}
|
||||
exports.relative = relative;
|
||||
|
||||
var supportsNullProto = (function () {
|
||||
var obj = Object.create(null);
|
||||
return !('__proto__' in obj);
|
||||
}());
|
||||
|
||||
function identity (s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Because behavior goes wacky when you set `__proto__` on objects, we
|
||||
* have to prefix all the strings in our set with an arbitrary character.
|
||||
*
|
||||
* See https://github.com/mozilla/source-map/pull/31 and
|
||||
* https://github.com/mozilla/source-map/issues/30
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
function toSetString(aStr) {
|
||||
if (isProtoString(aStr)) {
|
||||
return '$' + aStr;
|
||||
}
|
||||
|
||||
return aStr;
|
||||
}
|
||||
exports.toSetString = supportsNullProto ? identity : toSetString;
|
||||
|
||||
function fromSetString(aStr) {
|
||||
if (isProtoString(aStr)) {
|
||||
return aStr.slice(1);
|
||||
}
|
||||
|
||||
return aStr;
|
||||
}
|
||||
exports.fromSetString = supportsNullProto ? identity : fromSetString;
|
||||
|
||||
function isProtoString(s) {
|
||||
if (!s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var length = s.length;
|
||||
|
||||
if (length < 9 /* "__proto__".length */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
|
||||
s.charCodeAt(length - 2) !== 95 /* '_' */ ||
|
||||
s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
|
||||
s.charCodeAt(length - 4) !== 116 /* 't' */ ||
|
||||
s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
|
||||
s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
|
||||
s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
|
||||
s.charCodeAt(length - 8) !== 95 /* '_' */ ||
|
||||
s.charCodeAt(length - 9) !== 95 /* '_' */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = length - 10; i >= 0; i--) {
|
||||
if (s.charCodeAt(i) !== 36 /* '$' */) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Comparator between two mappings where the original positions are compared.
|
||||
*
|
||||
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
|
||||
* mappings with the same original source/line/column, but different generated
|
||||
* line and column the same. Useful when searching for a mapping with a
|
||||
* stubbed out mapping.
|
||||
*/
|
||||
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
|
||||
var cmp = strcmp(mappingA.source, mappingB.source);
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0 || onlyCompareOriginal) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedLine - mappingB.generatedLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return strcmp(mappingA.name, mappingB.name);
|
||||
}
|
||||
exports.compareByOriginalPositions = compareByOriginalPositions;
|
||||
|
||||
function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) {
|
||||
var cmp
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0 || onlyCompareOriginal) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedLine - mappingB.generatedLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return strcmp(mappingA.name, mappingB.name);
|
||||
}
|
||||
exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource;
|
||||
|
||||
/**
|
||||
* Comparator between two mappings with deflated source and name indices where
|
||||
* the generated positions are compared.
|
||||
*
|
||||
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
|
||||
* mappings with the same generated line and column, but different
|
||||
* source/name/original line and column the same. Useful when searching for a
|
||||
* mapping with a stubbed out mapping.
|
||||
*/
|
||||
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
|
||||
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0 || onlyCompareGenerated) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = strcmp(mappingA.source, mappingB.source);
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return strcmp(mappingA.name, mappingB.name);
|
||||
}
|
||||
exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
|
||||
|
||||
function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) {
|
||||
var cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0 || onlyCompareGenerated) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = strcmp(mappingA.source, mappingB.source);
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return strcmp(mappingA.name, mappingB.name);
|
||||
}
|
||||
exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine;
|
||||
|
||||
function strcmp(aStr1, aStr2) {
|
||||
if (aStr1 === aStr2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (aStr1 === null) {
|
||||
return 1; // aStr2 !== null
|
||||
}
|
||||
|
||||
if (aStr2 === null) {
|
||||
return -1; // aStr1 !== null
|
||||
}
|
||||
|
||||
if (aStr1 > aStr2) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Comparator between two mappings with inflated source and name strings where
|
||||
* the generated positions are compared.
|
||||
*/
|
||||
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
|
||||
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = strcmp(mappingA.source, mappingB.source);
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return strcmp(mappingA.name, mappingB.name);
|
||||
}
|
||||
exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
|
||||
|
||||
/**
|
||||
* Strip any JSON XSSI avoidance prefix from the string (as documented
|
||||
* in the source maps specification), and then parse the string as
|
||||
* JSON.
|
||||
*/
|
||||
function parseSourceMapInput(str) {
|
||||
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
|
||||
}
|
||||
exports.parseSourceMapInput = parseSourceMapInput;
|
||||
|
||||
/**
|
||||
* Compute the URL of a source given the the source root, the source's
|
||||
* URL, and the source map's URL.
|
||||
*/
|
||||
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
|
||||
sourceURL = sourceURL || '';
|
||||
|
||||
if (sourceRoot) {
|
||||
// This follows what Chrome does.
|
||||
if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
|
||||
sourceRoot += '/';
|
||||
}
|
||||
// The spec says:
|
||||
// Line 4: An optional source root, useful for relocating source
|
||||
// files on a server or removing repeated values in the
|
||||
// “sources” entry. This value is prepended to the individual
|
||||
// entries in the “source” field.
|
||||
sourceURL = sourceRoot + sourceURL;
|
||||
}
|
||||
|
||||
// Historically, SourceMapConsumer did not take the sourceMapURL as
|
||||
// a parameter. This mode is still somewhat supported, which is why
|
||||
// this code block is conditional. However, it's preferable to pass
|
||||
// the source map URL to SourceMapConsumer, so that this function
|
||||
// can implement the source URL resolution algorithm as outlined in
|
||||
// the spec. This block is basically the equivalent of:
|
||||
// new URL(sourceURL, sourceMapURL).toString()
|
||||
// ... except it avoids using URL, which wasn't available in the
|
||||
// older releases of node still supported by this library.
|
||||
//
|
||||
// The spec says:
|
||||
// If the sources are not absolute URLs after prepending of the
|
||||
// “sourceRoot”, the sources are resolved relative to the
|
||||
// SourceMap (like resolving script src in a html document).
|
||||
if (sourceMapURL) {
|
||||
var parsed = urlParse(sourceMapURL);
|
||||
if (!parsed) {
|
||||
throw new Error("sourceMapURL could not be parsed");
|
||||
}
|
||||
if (parsed.path) {
|
||||
// Strip the last path component, but keep the "/".
|
||||
var index = parsed.path.lastIndexOf('/');
|
||||
if (index >= 0) {
|
||||
parsed.path = parsed.path.substring(0, index + 1);
|
||||
}
|
||||
}
|
||||
sourceURL = join(urlGenerate(parsed), sourceURL);
|
||||
}
|
||||
|
||||
return normalize(sourceURL);
|
||||
}
|
||||
exports.computeSourceURL = computeSourceURL;
|
||||
74
node_modules/.store/sass@1.69.5/node_modules/source-map-js/package.json
generated
vendored
Normal file
74
node_modules/.store/sass@1.69.5/node_modules/source-map-js/package.json
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"name": "source-map-js",
|
||||
"description": "Generates and consumes source maps",
|
||||
"version": "1.0.2",
|
||||
"homepage": "https://github.com/7rulnik/source-map-js",
|
||||
"author": "Valentin 7rulnik Semirulnik <v7rulnik@gmail.com>",
|
||||
"contributors": [
|
||||
"Nick Fitzgerald <nfitzgerald@mozilla.com>",
|
||||
"Tobias Koppers <tobias.koppers@googlemail.com>",
|
||||
"Duncan Beevers <duncan@dweebd.com>",
|
||||
"Stephen Crane <scrane@mozilla.com>",
|
||||
"Ryan Seddon <seddon.ryan@gmail.com>",
|
||||
"Miles Elam <miles.elam@deem.com>",
|
||||
"Mihai Bazon <mihai.bazon@gmail.com>",
|
||||
"Michael Ficarra <github.public.email@michael.ficarra.me>",
|
||||
"Todd Wolfson <todd@twolfson.com>",
|
||||
"Alexander Solovyov <alexander@solovyov.net>",
|
||||
"Felix Gnass <fgnass@gmail.com>",
|
||||
"Conrad Irwin <conrad.irwin@gmail.com>",
|
||||
"usrbincc <usrbincc@yahoo.com>",
|
||||
"David Glasser <glasser@davidglasser.net>",
|
||||
"Chase Douglas <chase@newrelic.com>",
|
||||
"Evan Wallace <evan.exe@gmail.com>",
|
||||
"Heather Arthur <fayearthur@gmail.com>",
|
||||
"Hugh Kennedy <hughskennedy@gmail.com>",
|
||||
"David Glasser <glasser@davidglasser.net>",
|
||||
"Simon Lydell <simon.lydell@gmail.com>",
|
||||
"Jmeas Smith <jellyes2@gmail.com>",
|
||||
"Michael Z Goddard <mzgoddard@gmail.com>",
|
||||
"azu <azu@users.noreply.github.com>",
|
||||
"John Gozde <john@gozde.ca>",
|
||||
"Adam Kirkton <akirkton@truefitinnovation.com>",
|
||||
"Chris Montgomery <christopher.montgomery@dowjones.com>",
|
||||
"J. Ryan Stinnett <jryans@gmail.com>",
|
||||
"Jack Herrington <jherrington@walmartlabs.com>",
|
||||
"Chris Truter <jeffpalentine@gmail.com>",
|
||||
"Daniel Espeset <daniel@danielespeset.com>",
|
||||
"Jamie Wong <jamie.lf.wong@gmail.com>",
|
||||
"Eddy Bruël <ejpbruel@mozilla.com>",
|
||||
"Hawken Rives <hawkrives@gmail.com>",
|
||||
"Gilad Peleg <giladp007@gmail.com>",
|
||||
"djchie <djchie.dev@gmail.com>",
|
||||
"Gary Ye <garysye@gmail.com>",
|
||||
"Nicolas Lalevée <nicolas.lalevee@hibnet.org>"
|
||||
],
|
||||
"repository": "7rulnik/source-map-js",
|
||||
"main": "./source-map.js",
|
||||
"files": [
|
||||
"source-map.js",
|
||||
"source-map.d.ts",
|
||||
"lib/"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"scripts": {
|
||||
"test": "npm run build && node test/run-tests.js",
|
||||
"build": "webpack --color",
|
||||
"toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md"
|
||||
},
|
||||
"devDependencies": {
|
||||
"clean-publish": "^3.1.0",
|
||||
"doctoc": "^0.15.0",
|
||||
"webpack": "^1.12.0"
|
||||
},
|
||||
"clean-publish": {
|
||||
"cleanDocs": true
|
||||
},
|
||||
"typings": "source-map.d.ts",
|
||||
"__npminstall_done": true,
|
||||
"_from": "source-map-js@1.0.2",
|
||||
"_resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.0.2.tgz"
|
||||
}
|
||||
115
node_modules/.store/sass@1.69.5/node_modules/source-map-js/source-map.d.ts
generated
vendored
Normal file
115
node_modules/.store/sass@1.69.5/node_modules/source-map-js/source-map.d.ts
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
declare module 'source-map-js' {
|
||||
export interface StartOfSourceMap {
|
||||
file?: string;
|
||||
sourceRoot?: string;
|
||||
}
|
||||
|
||||
export interface RawSourceMap extends StartOfSourceMap {
|
||||
version: string;
|
||||
sources: string[];
|
||||
names: string[];
|
||||
sourcesContent?: string[];
|
||||
mappings: string;
|
||||
}
|
||||
|
||||
export interface Position {
|
||||
line: number;
|
||||
column: number;
|
||||
}
|
||||
|
||||
export interface LineRange extends Position {
|
||||
lastColumn: number;
|
||||
}
|
||||
|
||||
export interface FindPosition extends Position {
|
||||
// SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND
|
||||
bias?: number;
|
||||
}
|
||||
|
||||
export interface SourceFindPosition extends FindPosition {
|
||||
source: string;
|
||||
}
|
||||
|
||||
export interface MappedPosition extends Position {
|
||||
source: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export interface MappingItem {
|
||||
source: string;
|
||||
generatedLine: number;
|
||||
generatedColumn: number;
|
||||
originalLine: number;
|
||||
originalColumn: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class SourceMapConsumer {
|
||||
static GENERATED_ORDER: number;
|
||||
static ORIGINAL_ORDER: number;
|
||||
|
||||
static GREATEST_LOWER_BOUND: number;
|
||||
static LEAST_UPPER_BOUND: number;
|
||||
|
||||
constructor(rawSourceMap: RawSourceMap);
|
||||
computeColumnSpans(): void;
|
||||
originalPositionFor(generatedPosition: FindPosition): MappedPosition;
|
||||
generatedPositionFor(originalPosition: SourceFindPosition): LineRange;
|
||||
allGeneratedPositionsFor(originalPosition: MappedPosition): Position[];
|
||||
hasContentsOfAllSources(): boolean;
|
||||
sourceContentFor(source: string, returnNullOnMissing?: boolean): string;
|
||||
eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
|
||||
}
|
||||
|
||||
export interface Mapping {
|
||||
generated: Position;
|
||||
original: Position;
|
||||
source: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export class SourceMapGenerator {
|
||||
constructor(startOfSourceMap?: StartOfSourceMap);
|
||||
static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator;
|
||||
addMapping(mapping: Mapping): void;
|
||||
setSourceContent(sourceFile: string, sourceContent: string): void;
|
||||
applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export interface CodeWithSourceMap {
|
||||
code: string;
|
||||
map: SourceMapGenerator;
|
||||
}
|
||||
|
||||
export class SourceNode {
|
||||
constructor();
|
||||
constructor(line: number, column: number, source: string);
|
||||
constructor(line: number, column: number, source: string, chunk?: string, name?: string);
|
||||
static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode;
|
||||
add(chunk: string): void;
|
||||
prepend(chunk: string): void;
|
||||
setSourceContent(sourceFile: string, sourceContent: string): void;
|
||||
walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
|
||||
walkSourceContents(fn: (file: string, content: string) => void): void;
|
||||
join(sep: string): SourceNode;
|
||||
replaceRight(pattern: string, replacement: string): SourceNode;
|
||||
toString(): string;
|
||||
toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'source-map-js/lib/source-map-generator' {
|
||||
import { SourceMapGenerator } from 'source-map-js'
|
||||
export { SourceMapGenerator }
|
||||
}
|
||||
|
||||
declare module 'source-map-js/lib/source-map-consumer' {
|
||||
import { SourceMapConsumer } from 'source-map-js'
|
||||
export { SourceMapConsumer }
|
||||
}
|
||||
|
||||
declare module 'source-map-js/lib/source-node' {
|
||||
import { SourceNode } from 'source-map-js'
|
||||
export { SourceNode }
|
||||
}
|
||||
8
node_modules/.store/sass@1.69.5/node_modules/source-map-js/source-map.js
generated
vendored
Normal file
8
node_modules/.store/sass@1.69.5/node_modules/source-map-js/source-map.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* Copyright 2009-2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE.txt or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;
|
||||
exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;
|
||||
exports.SourceNode = require('./lib/source-node').SourceNode;
|
||||
Reference in New Issue
Block a user