Project files
This commit is contained in:
480
receipeServer/frontend_old/node_modules/terser/CHANGELOG.md
generated
vendored
Normal file
480
receipeServer/frontend_old/node_modules/terser/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,480 @@
|
||||
# Changelog
|
||||
|
||||
## v5.12.1
|
||||
|
||||
- Fixed an issue with function definitions inside blocks (#1155)
|
||||
- Fixed parens of `new` in some situations (closes #1159)
|
||||
|
||||
## v5.12.0
|
||||
|
||||
- `TERSER_DEBUG_DIR` environment variable
|
||||
- @copyright comments are now preserved with the comments="some" option (#1153)
|
||||
|
||||
## v5.11.0
|
||||
|
||||
- Unicode code point escapes (`\u{abcde}`) are not emitted inside RegExp literals anymore (#1147)
|
||||
- acorn is now a regular dependency
|
||||
|
||||
## v5.10.0
|
||||
|
||||
- Massive optimization to max_line_len (#1109)
|
||||
- Basic support for import assertions
|
||||
- Marked ES2022 Object.hasOwn as a pure function
|
||||
- Fix `delete optional?.property`
|
||||
- New CI/CD pipeline with github actions (#1057)
|
||||
- Fix reordering of switch branches (#1092), (#1084)
|
||||
- Fix error when creating a class property called `get`
|
||||
- Acorn dependency is now an optional peerDependency
|
||||
- Fix mangling collision with exported variables (#1072)
|
||||
- Fix an issue with `return someVariable = (async () => { ... })()` (#1073)
|
||||
|
||||
## v5.9.0
|
||||
|
||||
- Collapsing switch cases with the same bodies (even if they're not next to each other) (#1070).
|
||||
- Fix evaluation of optional chain expressions (#1062)
|
||||
- Fix mangling collision in ESM exports (#1063)
|
||||
- Fix issue with mutating function objects after a second pass (#1047)
|
||||
- Fix for inlining object spread `{ ...obj }` (#1071)
|
||||
- Typescript typings fix (#1069)
|
||||
|
||||
## v5.8.0
|
||||
|
||||
- Fixed shadowing variables while moving code in some cases (#1065)
|
||||
- Stop mangling computed & quoted properties when keep_quoted is enabled.
|
||||
- Fix for mangling private getter/setter and .#private access (#1060, #1068)
|
||||
- Array.from has a new optimization when the unsafe option is set (#737)
|
||||
- Mangle/propmangle let you generate your own identifiers through the nth_identifier option (#1061)
|
||||
- More optimizations to switch statements (#1044)
|
||||
|
||||
## v5.7.2
|
||||
|
||||
- Fixed issues with compressing functions defined in `global_defs` option (#1036)
|
||||
- New recipe for using Terser in gulp was added to RECIPES.md (#1035)
|
||||
- Fixed issues with `??` and `?.` (#1045)
|
||||
- Future reserved words such as `package` no longer require you to disable strict mode to be used as names.
|
||||
- Refactored huge compressor file into multiple more focused files.
|
||||
- Avoided unparenthesized `in` operator in some for loops (it breaks parsing because of for..in loops)
|
||||
- Improved documentation (#1021, #1025)
|
||||
- More type definitions (#1021)
|
||||
|
||||
## v5.7.1
|
||||
|
||||
- Avoided collapsing assignments together if it would place a chain assignment on the left hand side, which is invalid syntax (`a?.b = c`)
|
||||
- Removed undefined from object expansions (`{ ...void 0 }` -> `{}`)
|
||||
- Fix crash when checking if something is nullish or undefined (#1009)
|
||||
- Fixed comparison of private class properties (#1015)
|
||||
- Minor performance improvements (#993)
|
||||
- Fixed scope of function defs in strict mode (they are block scoped)
|
||||
|
||||
## v5.7.0
|
||||
|
||||
- Several compile-time evaluation and inlining fixes
|
||||
- Allow `reduce_funcs` to be disabled again.
|
||||
- Add `spidermonkey` options to parse and format (#974)
|
||||
- Accept `{get = "default val"}` and `{set = "default val"}` in destructuring arguments.
|
||||
- Change package.json export map to help require.resolve (#971)
|
||||
- Improve docs
|
||||
- Fix `export default` of an anonymous class with `extends`
|
||||
|
||||
## v5.6.1
|
||||
|
||||
- Mark assignments to the `.prototype` of a class as pure
|
||||
- Parenthesize `await` on the left of `**` (while accepting legacy non-parenthesised input)
|
||||
- Avoided outputting NUL bytes in optimized RegExps, to stop the output from breaking other tools
|
||||
- Added `exports` to domprops (#939)
|
||||
- Fixed a crash when spreading `...this`
|
||||
- Fixed the computed size of arrow functions, which improves their inlining
|
||||
|
||||
## v5.6.0
|
||||
|
||||
- Added top-level await
|
||||
- Beautify option has been removed in #895
|
||||
- Private properties, getters and setters have been added in #913 and some more commits
|
||||
- Docs improvements: #896, #903, #916
|
||||
|
||||
## v5.5.1
|
||||
|
||||
- Fixed object properties with unicode surrogates on safari.
|
||||
|
||||
## v5.5.0
|
||||
|
||||
- Fixed crash when inlining uninitialized variable into template string.
|
||||
- The sourcemap for dist was removed for being too large.
|
||||
|
||||
## v5.4.0
|
||||
|
||||
- Logical assignment
|
||||
- Change `let x = undefined` to just `let x`
|
||||
- Removed some optimizations for template strings, placing them behind `unsafe` options. Reason: adding strings is not equivalent to template strings, due to valueOf differences.
|
||||
- The AST_Token class was slimmed down in order to use less memory.
|
||||
|
||||
## v5.3.8
|
||||
|
||||
- Restore node 13 support
|
||||
|
||||
## v5.3.7
|
||||
|
||||
Hotfix release, fixes package.json "engines" syntax
|
||||
|
||||
## v5.3.6
|
||||
|
||||
- Fixed parentheses when outputting `??` mixed with `||` and `&&`
|
||||
- Improved hygiene of the symbol generator
|
||||
|
||||
## v5.3.5
|
||||
|
||||
- Avoid moving named functions into default exports.
|
||||
- Enabled transform() for chain expressions. This allows AST transformers to reach inside chain expressions.
|
||||
|
||||
## v5.3.4
|
||||
|
||||
- Fixed a crash when hoisting (with `hoist_vars`) a destructuring variable declaration
|
||||
|
||||
## v5.3.3
|
||||
|
||||
- `source-map` library has been updated, bringing memory usage and CPU time improvements when reading input source maps (the SourceMapConsumer is now WASM based).
|
||||
- The `wrap_func_args` option now also wraps arrow functions, as opposed to only function expressions.
|
||||
|
||||
## v5.3.2
|
||||
|
||||
- Prevented spread operations from being expanded when the expanded array/object contains getters, setters, or array holes.
|
||||
- Fixed _very_ slow self-recursion in some cases of removing extraneous parentheses from `+` operations.
|
||||
|
||||
## v5.3.1
|
||||
|
||||
- An issue with destructuring declarations when `pure_getters` is enabled has been fixed
|
||||
- Fixed a crash when chain expressions need to be shallowly compared
|
||||
- Made inlining functions more conservative to make sure a function that contains a reference to itself isn't moved into a place that can create multiple instances of itself.
|
||||
|
||||
## v5.3.0
|
||||
|
||||
- Fixed a crash when compressing object spreads in some cases
|
||||
- Fixed compiletime evaluation of optional chains (caused typeof a?.b to always return "object")
|
||||
- domprops has been updated to contain every single possible prop
|
||||
|
||||
## v5.2.1
|
||||
|
||||
- The parse step now doesn't accept an `ecma` option, so that all ES code is accepted.
|
||||
- Optional dotted chains now accept keywords, just like dotted expressions (`foo?.default`)
|
||||
|
||||
## v5.2.0
|
||||
|
||||
- Optional chaining syntax is now supported.
|
||||
- Consecutive await expressions don't have unnecessary parens
|
||||
- Taking the variable name's length (after mangling) into consideration when deciding to inline
|
||||
|
||||
## v5.1.0
|
||||
|
||||
- `import.meta` is now supported
|
||||
- Typescript typings have been improved
|
||||
|
||||
## v5.0.0
|
||||
|
||||
- `in` operator now taken into account during property mangle.
|
||||
- Fixed infinite loop in face of a reference loop in some situations.
|
||||
- Kept exports and imports around even if there's something which will throw before them.
|
||||
- The main exported bundle for commonjs, dist/bundle.min.js is no longer minified.
|
||||
|
||||
## v5.0.0-beta.0
|
||||
|
||||
- BREAKING: `minify()` is now async and rejects a promise instead of returning an error.
|
||||
- BREAKING: Internal AST is no longer exposed, so that it can be improved without releasing breaking changes.
|
||||
- BREAKING: Lowest supported node version is 10
|
||||
- BREAKING: There are no more warnings being emitted
|
||||
- Module is now distributed as a dual package - You can `import` and `require()` too.
|
||||
- Inline improvements were made
|
||||
|
||||
## v4.8.0
|
||||
|
||||
- Support for numeric separators (`million = 1_000_000`) was added.
|
||||
- Assigning properties to a class is now assumed to be pure.
|
||||
- Fixed bug where `yield` wasn't considered a valid property key in generators.
|
||||
|
||||
## v4.7.0
|
||||
|
||||
- A bug was fixed where an arrow function would have the wrong size
|
||||
- `arguments` object is now considered safe to retrieve properties from (useful for `length`, or `0`) even when `pure_getters` is not set.
|
||||
- Fixed erroneous `const` declarations without value (which is invalid) in some corner cases when using `collapse_vars`.
|
||||
|
||||
## v4.6.13
|
||||
|
||||
- Fixed issue where ES5 object properties were being turned into ES6 object properties due to more lax unicode rules.
|
||||
- Fixed parsing of BigInt with lowercase `e` in them.
|
||||
|
||||
## v4.6.12
|
||||
|
||||
- Fixed subtree comparison code, making it see that `[1,[2, 3]]` is different from `[1, 2, [3]]`
|
||||
- Printing of unicode identifiers has been improved
|
||||
|
||||
## v4.6.11
|
||||
|
||||
- Read unused classes' properties and method keys, to figure out if they use other variables.
|
||||
- Prevent inlining into block scopes when there are name collisions
|
||||
- Functions are no longer inlined into parameter defaults, because they live in their own special scope.
|
||||
- When inlining identity functions, take into account the fact they may be used to drop `this` in function calls.
|
||||
- Nullish coalescing operator (`x ?? y`), plus basic optimization for it.
|
||||
- Template literals in binary expressions such as `+` have been further optimized
|
||||
|
||||
## v4.6.10
|
||||
|
||||
- Do not use reduce_vars when classes are present
|
||||
|
||||
## v4.6.9
|
||||
|
||||
- Check if block scopes actually exist in blocks
|
||||
|
||||
## v4.6.8
|
||||
|
||||
- Take into account "executed bits" of classes like static properties or computed keys, when checking if a class evaluation might throw or have side effects.
|
||||
|
||||
## v4.6.7
|
||||
|
||||
- Some new performance gains through a `AST_Node.size()` method which measures a node's source code length without printing it to a string first.
|
||||
- An issue with setting `--comments` to `false` in the CLI has been fixed.
|
||||
- Fixed some issues with inlining
|
||||
- `unsafe_symbols` compress option was added, which turns `Symbol("name")` into just `Symbol()`
|
||||
- Brought back compress performance improvement through the `AST_Node.equivalent_to(other)` method (which was reverted in v4.6.6).
|
||||
|
||||
## v4.6.6
|
||||
|
||||
(hotfix release)
|
||||
|
||||
- Reverted code to 4.6.4 to allow for more time to investigate an issue.
|
||||
|
||||
## v4.6.5 (REVERTED)
|
||||
|
||||
- Improved compress performance through using a new method to see if two nodes are equivalent, instead of printing them to a string.
|
||||
|
||||
## v4.6.4
|
||||
|
||||
- The `"some"` value in the `comments` output option now preserves `@lic` and other important comments when using `//`
|
||||
- `</script>` is now better escaped in regex, and in comments, when using the `inline_script` output option
|
||||
- Fixed an issue when transforming `new RegExp` into `/.../` when slashes are included in the source
|
||||
- `AST_Node.prototype.constructor` now exists, allowing for easier debugging of crashes
|
||||
- Multiple if statements with the same consequents are now collapsed
|
||||
- Typescript typings improvements
|
||||
- Optimizations while looking for surrogate pairs in strings
|
||||
|
||||
## v4.6.3
|
||||
|
||||
- Annotations such as `/*#__NOINLINE__*/` and `/*#__PURE__*/` may now be preserved using the `preserve_annotations` output option
|
||||
- A TypeScript definition update for the `keep_quoted` output option.
|
||||
|
||||
## v4.6.2
|
||||
|
||||
- A bug where functions were inlined into other functions with scope conflicts has been fixed.
|
||||
- `/*#__NOINLINE__*/` annotation fixed for more use cases where inlining happens.
|
||||
|
||||
## v4.6.1
|
||||
|
||||
- Fixed an issue where a class is duplicated by reduce_vars when there's a recursive reference to the class.
|
||||
|
||||
## v4.6.0
|
||||
|
||||
- Fixed issues with recursive class references.
|
||||
- BigInt evaluation has been prevented, stopping Terser from evaluating BigInts like it would do regular numbers.
|
||||
- Class property support has been added
|
||||
|
||||
## v4.5.1
|
||||
|
||||
(hotfix release)
|
||||
|
||||
- Fixed issue where `() => ({})[something]` was not parenthesised correctly.
|
||||
|
||||
## v4.5.0
|
||||
|
||||
- Inlining has been improved
|
||||
- An issue where keep_fnames combined with functions declared through variables was causing name shadowing has been fixed
|
||||
- You can now set the ES version through their year
|
||||
- The output option `keep_numbers` has been added, which prevents Terser from turning `1000` into `1e3` and such
|
||||
- Internal small optimisations and refactors
|
||||
|
||||
## v4.4.3
|
||||
|
||||
- Number and BigInt parsing has been fixed
|
||||
- `/*#__INLINE__*/` annotation fixed for arrow functions with non-block bodies.
|
||||
- Functional tests have been added, using [this repository](https://github.com/terser/terser-functional-tests).
|
||||
- A memory leak, where the entire AST lives on after compression, has been plugged.
|
||||
|
||||
## v4.4.2
|
||||
|
||||
- Fixed a problem with inlining identity functions
|
||||
|
||||
## v4.4.1
|
||||
|
||||
*note:* This introduced a feature, therefore it should have been a minor release.
|
||||
|
||||
- Fixed a crash when `unsafe` was enabled.
|
||||
- An issue has been fixed where `let` statements might be collapsed out of their scope.
|
||||
- Some error messages have been improved by adding quotes around variable names.
|
||||
|
||||
## v4.4.0
|
||||
|
||||
- Added `/*#__INLINE__*/` and `/*#__NOINLINE__*/` annotations for calls. If a call has one of these, it either forces or forbids inlining.
|
||||
|
||||
## v4.3.11
|
||||
|
||||
- Fixed a problem where `window` was considered safe to access, even though there are situations where it isn't (Node.js, workers...)
|
||||
- Fixed an error where `++` and `--` were considered side-effect free
|
||||
- `Number(x)` now needs both `unsafe` and and `unsafe_math` to be compressed into `+x` because `x` might be a `BigInt`
|
||||
- `keep_fnames` now correctly supports regexes when the function is in a variable declaration
|
||||
|
||||
## v4.3.10
|
||||
|
||||
- Fixed syntax error when repeated semicolons were encountered in classes
|
||||
- Fixed invalid output caused by the creation of empty sequences internally
|
||||
- Scopes are now updated when scopes are inlined into them
|
||||
|
||||
## v4.3.9
|
||||
- Fixed issue with mangle's `keep_fnames` option, introduced when adding code to keep variable names of anonymous functions
|
||||
|
||||
## v4.3.8
|
||||
|
||||
- Typescript typings fix
|
||||
|
||||
## v4.3.7
|
||||
|
||||
- Parsing of regex options in the CLI (which broke in v4.3.5) was fixed.
|
||||
- typescript definition updates
|
||||
|
||||
## v4.3.6
|
||||
|
||||
(crash hotfix)
|
||||
|
||||
## v4.3.5
|
||||
|
||||
- Fixed an issue with DOS line endings strings separated by `\` and a new line.
|
||||
- Improved fix for the output size regression related to unused references within the extends section of a class.
|
||||
- Variable names of anonymous functions (eg: `const x = () => { ... }` or `var func = function () {...}`) are now preserved when keep_fnames is true.
|
||||
- Fixed performance degradation introduced for large payloads in v4.2.0
|
||||
|
||||
## v4.3.4
|
||||
|
||||
- Fixed a regression where the output size was increased when unused classes were referred to in the extends clause of a class.
|
||||
- Small typescript typings fixes.
|
||||
- Comments with `@preserve`, `@license`, `@cc_on` as well as comments starting with `/*!` and `/**!` are now preserved by default.
|
||||
|
||||
## v4.3.3
|
||||
|
||||
- Fixed a problem where parsing template strings would mix up octal notation and a slash followed by a zero representing a null character.
|
||||
- Started accepting the name `async` in destructuring arguments with default value.
|
||||
- Now Terser takes into account side effects inside class `extends` clauses.
|
||||
- Added parens whenever there's a comment between a return statement and the returned value, to prevent issues with ASI.
|
||||
- Stopped using raw RegExp objects, since the spec is going to continue to evolve. This ensures Terser is able to process new, unknown RegExp flags and features. This is a breaking change in the AST node AST_RegExp.
|
||||
|
||||
## v4.3.2
|
||||
|
||||
- Typescript typing fix
|
||||
- Ensure that functions can't be inlined, by reduce_vars, into places where they're accessing variables with the same name, but from somewhere else.
|
||||
|
||||
## v4.3.1
|
||||
|
||||
- Fixed an issue from 4.3.0 where any block scope within a for loop erroneously had its parent set to the function scopee
|
||||
- Fixed an issue where compressing IIFEs with argument expansions would result in some parameters becoming undefined
|
||||
- addEventListener options argument's properties are now part of the DOM properties list.
|
||||
|
||||
## v4.3.0
|
||||
|
||||
- Do not drop computed object keys with side effects
|
||||
- Functions passed to other functions in calls are now wrapped in parentheses by default, which speeds up loading most modules
|
||||
- Objects with computed properties are now less likely to be hoisted
|
||||
- Speed and memory efficiency optimizations
|
||||
- Fixed scoping issues with `try` and `switch`
|
||||
|
||||
## v4.2.1
|
||||
|
||||
- Minor refactors
|
||||
- Fixed a bug similar to #369 in collapse_vars
|
||||
- Functions can no longer be inlined into a place where they're going to be compared with themselves.
|
||||
- reduce_funcs option is now legacy, as using reduce_vars without reduce_funcs caused some weird corner cases. As a result, it is now implied in reduce_vars and can't be turned off without turning off reduce_vars.
|
||||
- Bug which would cause a random stack overflow has now been fixed.
|
||||
|
||||
## v4.2.0
|
||||
|
||||
- When the source map URL is `inline`, don't write it to a file.
|
||||
- Fixed output parens when a lambda literal is the tag on a tagged template string.
|
||||
- The `mangle.properties.undeclared` option was added. This enables the property mangler to mangle properties of variables which can be found in the name cache, but whose properties are not known to this Terser run.
|
||||
- The v8 bug where the toString and source representations of regexes like `RegExp("\\\n")` includes an actual newline is now fixed.
|
||||
- Now we're guaranteed to not have duplicate comments in the output
|
||||
- Domprops updates
|
||||
|
||||
## v4.1.4
|
||||
|
||||
- Fixed a crash when inlining a function into somewhere else when it has interdependent, non-removable variables.
|
||||
|
||||
## v4.1.3
|
||||
|
||||
- Several issues with the `reduce_vars` option were fixed.
|
||||
- Starting this version, we only have a dist/bundle.min.js
|
||||
|
||||
## v4.1.2
|
||||
|
||||
- The hotfix was hotfixed
|
||||
|
||||
## v4.1.1
|
||||
|
||||
- Fixed a bug where toplevel scopes were being mixed up with lambda scopes
|
||||
|
||||
## v4.1.0
|
||||
|
||||
- Internal functions were replaced by `Object.assign`, `Array.prototype.some`, `Array.prototype.find` and `Array.prototype.every`.
|
||||
- A serious issue where some ESM-native code was broken was fixed.
|
||||
- Performance improvements were made.
|
||||
- Support for BigInt was added.
|
||||
- Inline efficiency was improved. Functions are now being inlined more proactively instead of being inlined only after another Compressor pass.
|
||||
|
||||
## v4.0.2
|
||||
|
||||
(Hotfix release. Reverts unmapped segments PR [#342](https://github.com/terser/terser/pull/342), which will be put back on Terser when the upstream issue is resolved)
|
||||
|
||||
## v4.0.1
|
||||
|
||||
- Collisions between the arguments of inlined functions and names in the outer scope are now being avoided while inlining
|
||||
- Unmapped segments are now preserved when compressing a file which has source maps
|
||||
- Default values of functions are now correctly converted from Mozilla AST to Terser AST
|
||||
- JSON ⊂ ECMAScript spec (if you don't know what this is you don't need to)
|
||||
- Export AST_* classes to library users
|
||||
- Fixed issue with `collapse_vars` when functions are created with the same name as a variable which already exists
|
||||
- Added `MutationObserverInit` (Object with options for initialising a mutation observer) properties to the DOM property list
|
||||
- Custom `Error` subclasses are now internally used instead of old-school Error inheritance hacks.
|
||||
- Documentation fixes
|
||||
- Performance optimizations
|
||||
|
||||
## v4.0.0
|
||||
|
||||
- **breaking change**: The `variables` property of all scopes has become a standard JavaScript `Map` as opposed to the old bespoke `Dictionary` object.
|
||||
- Typescript definitions were fixed
|
||||
- `terser --help` was fixed
|
||||
- The public interface was cleaned up
|
||||
- Fixed optimisation of `Array` and `new Array`
|
||||
- Added the `keep_quoted=strict` mode to mangle_props, which behaves more like Google Closure Compiler by mangling all unquoted property names, instead of reserving quoted property names automatically.
|
||||
- Fixed parent functions' parameters being shadowed in some cases
|
||||
- Allowed Terser to run in a situation where there are custom functions attached to Object.prototype
|
||||
- And more bug fixes, optimisations and internal changes
|
||||
|
||||
## v3.17.0
|
||||
|
||||
- More DOM properties added to --mangle-properties's DOM property list
|
||||
- Closed issue where if 2 functions had the same argument name, Terser would not inline them together properly
|
||||
- Fixed issue with `hasOwnProperty.call`
|
||||
- You can now list files to minify in a Terser config file
|
||||
- Started replacing `new Array(<number>)` with an array literal
|
||||
- Started using ES6 capabilities like `Set` and the `includes` method for strings and arrays
|
||||
|
||||
## v3.16.1
|
||||
|
||||
- Fixed issue where Terser being imported with `import` would cause it not to work due to the `__esModule` property. (PR #254 was submitted, which was nice, but since it wasn't a pure commonJS approach I decided to go with my own solution)
|
||||
|
||||
## v3.16.0
|
||||
|
||||
- No longer leaves names like Array or Object or window as a SimpleStatement (statement which is just a single expression).
|
||||
- Add support for sections sourcemaps (IndexedSourceMapConsumer)
|
||||
- Drops node.js v4 and starts using commonJS
|
||||
- Is now built with rollup
|
||||
|
||||
## v3.15.0
|
||||
|
||||
- Inlined spread syntax (`[...[1, 2, 3], 4, 5] => [1, 2, 3, 4, 5]`) in arrays and objects.
|
||||
- Fixed typo in compressor warning
|
||||
- Fixed inline source map input bug
|
||||
- Fixed parsing of template literals with unnecessary escapes (Like `\\a`)
|
||||
29
receipeServer/frontend_old/node_modules/terser/LICENSE
generated
vendored
Normal file
29
receipeServer/frontend_old/node_modules/terser/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
Terser is released under the BSD license:
|
||||
|
||||
Copyright 2012-2018 (c) Mihai Bazon <mihai.bazon@gmail.com>
|
||||
|
||||
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.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “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 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.
|
||||
15
receipeServer/frontend_old/node_modules/terser/PATRONS.md
generated
vendored
Normal file
15
receipeServer/frontend_old/node_modules/terser/PATRONS.md
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# Our patrons
|
||||
|
||||
These are the first-tier patrons from [Patreon](https://www.patreon.com/fabiosantoscode). My appreciation goes to everyone on this list for supporting the project!
|
||||
|
||||
* 38elements
|
||||
* Alan Orozco
|
||||
* Aria Buckles
|
||||
* CKEditor
|
||||
* Mariusz Nowak
|
||||
* Nakshatra Mukhopadhyay
|
||||
* Philippe Léger
|
||||
* Piotrek Koszuliński
|
||||
* Serhiy Shyyko
|
||||
* Viktor Hubert
|
||||
* 龙腾道
|
||||
1374
receipeServer/frontend_old/node_modules/terser/README.md
generated
vendored
Normal file
1374
receipeServer/frontend_old/node_modules/terser/README.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
10
receipeServer/frontend_old/node_modules/terser/bin/package.json
generated
vendored
Normal file
10
receipeServer/frontend_old/node_modules/terser/bin/package.json
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "bin",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"main": "terser",
|
||||
"type": "commonjs",
|
||||
"author": "",
|
||||
"license": "BSD-2-Clause",
|
||||
"description": "A package to hold the Terser bin bundle as commonjs while keeping the rest of it ESM."
|
||||
}
|
||||
21
receipeServer/frontend_old/node_modules/terser/bin/terser
generated
vendored
Executable file
21
receipeServer/frontend_old/node_modules/terser/bin/terser
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
"use strict";
|
||||
|
||||
require("../tools/exit.cjs");
|
||||
|
||||
try {
|
||||
require("source-map-support").install();
|
||||
} catch (err) {}
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const program = require("commander");
|
||||
|
||||
const packageJson = require("../package.json");
|
||||
const { _run_cli: run_cli } = require("..");
|
||||
|
||||
run_cli({ program, packageJson, fs, path }).catch((error) => {
|
||||
console.error(error);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
10
receipeServer/frontend_old/node_modules/terser/bin/uglifyjs
generated
vendored
Executable file
10
receipeServer/frontend_old/node_modules/terser/bin/uglifyjs
generated
vendored
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env node
|
||||
// -*- js -*-
|
||||
/* eslint-env node */
|
||||
|
||||
"use strict";
|
||||
|
||||
process.stderr.write( "DEPRECATION WARNING: uglifyjs binary will soon be discontinued!\n");
|
||||
process.stderr.write("Please use \"terser\" instead.\n\n");
|
||||
|
||||
require("./terser");
|
||||
27
receipeServer/frontend_old/node_modules/terser/main.js
generated
vendored
Normal file
27
receipeServer/frontend_old/node_modules/terser/main.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import "./lib/transform.js";
|
||||
import "./lib/mozilla-ast.js";
|
||||
import { minify } from "./lib/minify.js";
|
||||
|
||||
export { minify } from "./lib/minify.js";
|
||||
export { run_cli as _run_cli } from "./lib/cli.js";
|
||||
|
||||
export async function _default_options() {
|
||||
const defs = {};
|
||||
|
||||
Object.keys(infer_options({ 0: 0 })).forEach((component) => {
|
||||
const options = infer_options({
|
||||
[component]: {0: 0}
|
||||
});
|
||||
|
||||
if (options) defs[component] = options;
|
||||
});
|
||||
return defs;
|
||||
}
|
||||
|
||||
async function infer_options(options) {
|
||||
try {
|
||||
await minify("", options);
|
||||
} catch (error) {
|
||||
return error.defs;
|
||||
}
|
||||
}
|
||||
344
receipeServer/frontend_old/node_modules/terser/node_modules/source-map/CHANGELOG.md
generated
vendored
Normal file
344
receipeServer/frontend_old/node_modules/terser/node_modules/source-map/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,344 @@
|
||||
# Change Log
|
||||
|
||||
## 0.7.3
|
||||
|
||||
* Fix a bug where nested uses of `SourceMapConsumer` could result in a
|
||||
`TypeError`. [#338](https://github.com/mozilla/source-map/issues/338)
|
||||
[#330](https://github.com/mozilla/source-map/issues/330)
|
||||
[#319](https://github.com/mozilla/source-map/issues/319)
|
||||
|
||||
## 0.7.2
|
||||
|
||||
* Another 3x speed up in `SourceMapConsumer`. Read about it here:
|
||||
http://fitzgeraldnick.com/2018/02/26/speed-without-wizardry.html
|
||||
|
||||
## 0.7.1
|
||||
|
||||
* Updated TypeScript typings. [#321][]
|
||||
|
||||
[#321]: https://github.com/mozilla/source-map/pull/321
|
||||
|
||||
## 0.7.0
|
||||
|
||||
* `SourceMapConsumer` now uses WebAssembly, and is **much** faster! Read about
|
||||
it here:
|
||||
https://hacks.mozilla.org/2018/01/oxidizing-source-maps-with-rust-and-webassembly/
|
||||
|
||||
* **Breaking change:** `new SourceMapConsumer` now returns a `Promise` object
|
||||
that resolves to the newly constructed `SourceMapConsumer` instance, rather
|
||||
than returning the new instance immediately.
|
||||
|
||||
* **Breaking change:** when you're done using a `SourceMapConsumer` instance,
|
||||
you must call `SourceMapConsumer.prototype.destroy` on it. After calling
|
||||
`destroy`, you must not use the instance again.
|
||||
|
||||
* **Breaking change:** `SourceMapConsumer` used to be able to handle lines,
|
||||
columns numbers and source and name indices up to `2^53 - 1` (aka
|
||||
`Number.MAX_SAFE_INTEGER`). It can now only handle them up to `2^32 - 1`.
|
||||
|
||||
* **Breaking change:** The `source-map` library now uses modern ECMAScript-isms:
|
||||
`let`, arrow functions, `async`, etc. Use Babel to compile it down to
|
||||
ECMAScript 5 if you need to support older JavaScript environments.
|
||||
|
||||
* **Breaking change:** Drop support for Node < 8. If you want to support older
|
||||
versions of node, please use v0.6 or below.
|
||||
|
||||
## 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
receipeServer/frontend_old/node_modules/terser/node_modules/source-map/LICENSE
generated
vendored
Normal file
28
receipeServer/frontend_old/node_modules/terser/node_modules/source-map/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.
|
||||
822
receipeServer/frontend_old/node_modules/terser/node_modules/source-map/README.md
generated
vendored
Normal file
822
receipeServer/frontend_old/node_modules/terser/node_modules/source-map/README.md
generated
vendored
Normal file
@@ -0,0 +1,822 @@
|
||||
# Source Map
|
||||
|
||||
[](https://travis-ci.org/mozilla/source-map)
|
||||
|
||||
[](https://coveralls.io/github/mozilla/source-map)
|
||||
|
||||
[](https://www.npmjs.com/package/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
|
||||
|
||||
## Use on the Web
|
||||
|
||||
<script src="https://unpkg.com/source-map@0.7.3/dist/source-map.js"></script>
|
||||
<script>
|
||||
sourceMap.SourceMapConsumer.initialize({
|
||||
"lib/mappings.wasm": "https://unpkg.com/source-map@0.7.3/lib/mappings.wasm"
|
||||
});
|
||||
</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)
|
||||
- [SourceMapConsumer.initialize(options)](#sourcemapconsumerinitializeoptions)
|
||||
- [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap)
|
||||
- [SourceMapConsumer.with](#sourcemapconsumerwith)
|
||||
- [SourceMapConsumer.prototype.destroy()](#sourcemapconsumerprototypedestroy)
|
||||
- [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
|
||||
const 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'
|
||||
};
|
||||
|
||||
const whatever = await SourceMapConsumer.with(rawSourceMap, null, consumer => {
|
||||
|
||||
console.log(consumer.sources);
|
||||
// [ 'http://example.com/www/js/one.js',
|
||||
// 'http://example.com/www/js/two.js' ]
|
||||
|
||||
console.log(consumer.originalPositionFor({
|
||||
line: 2,
|
||||
column: 28
|
||||
}));
|
||||
// { source: 'http://example.com/www/js/two.js',
|
||||
// line: 2,
|
||||
// column: 10,
|
||||
// name: 'n' }
|
||||
|
||||
console.log(consumer.generatedPositionFor({
|
||||
source: 'http://example.com/www/js/two.js',
|
||||
line: 2,
|
||||
column: 10
|
||||
}));
|
||||
// { line: 2, column: 28 }
|
||||
|
||||
consumer.eachMapping(function (m) {
|
||||
// ...
|
||||
});
|
||||
|
||||
return computeWhatever();
|
||||
});
|
||||
```
|
||||
|
||||
### 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.
|
||||
|
||||
#### SourceMapConsumer.initialize(options)
|
||||
|
||||
When using `SourceMapConsumer` outside of node.js, for example on the Web, it
|
||||
needs to know from what URL to load `lib/mappings.wasm`. You must inform it by
|
||||
calling `initialize` before constructing any `SourceMapConsumer`s.
|
||||
|
||||
The options object has the following properties:
|
||||
|
||||
* `"lib/mappings.wasm"`: A `String` containing the URL of the
|
||||
`lib/mappings.wasm` file.
|
||||
|
||||
```js
|
||||
sourceMap.SourceMapConsumer.initialize({
|
||||
"lib/mappings.wasm": "https://example.com/source-map/lib/mappings.wasm"
|
||||
});
|
||||
```
|
||||
|
||||
#### 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.
|
||||
|
||||
The promise of the constructed souce map consumer is returned.
|
||||
|
||||
When the `SourceMapConsumer` will no longer be used anymore, you must call its
|
||||
`destroy` method.
|
||||
|
||||
```js
|
||||
const consumer = await new sourceMap.SourceMapConsumer(rawSourceMapJsonData);
|
||||
doStuffWith(consumer);
|
||||
consumer.destroy();
|
||||
```
|
||||
|
||||
Alternatively, you can use `SourceMapConsumer.with` to avoid needing to remember
|
||||
to call `destroy`.
|
||||
|
||||
#### SourceMapConsumer.with
|
||||
|
||||
Construct a new `SourceMapConsumer` from `rawSourceMap` and `sourceMapUrl`
|
||||
(see the `SourceMapConsumer` constructor for details. Then, invoke the `async
|
||||
function f(SourceMapConsumer) -> T` with the newly constructed consumer, wait
|
||||
for `f` to complete, call `destroy` on the consumer, and return `f`'s return
|
||||
value.
|
||||
|
||||
You must not use the consumer after `f` completes!
|
||||
|
||||
By using `with`, you do not have to remember to manually call `destroy` on
|
||||
the consumer, since it will be called automatically once `f` completes.
|
||||
|
||||
```js
|
||||
const xSquared = await SourceMapConsumer.with(
|
||||
myRawSourceMap,
|
||||
null,
|
||||
async function (consumer) {
|
||||
// Use `consumer` inside here and don't worry about remembering
|
||||
// to call `destroy`.
|
||||
|
||||
const x = await whatever(consumer);
|
||||
return x * x;
|
||||
}
|
||||
);
|
||||
|
||||
// You may not use that `consumer` anymore out here; it has
|
||||
// been destroyed. But you can use `xSquared`.
|
||||
console.log(xSquared);
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.destroy()
|
||||
|
||||
Free this source map consumer's associated wasm data that is manually-managed.
|
||||
|
||||
```js
|
||||
consumer.destroy();
|
||||
```
|
||||
|
||||
Alternatively, you can use `SourceMapConsumer.with` to avoid needing to remember
|
||||
to call `destroy`.
|
||||
|
||||
#### 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
|
||||
const consumer = await new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8"));
|
||||
const 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] }
|
||||
```
|
||||
90
receipeServer/frontend_old/node_modules/terser/node_modules/source-map/package.json
generated
vendored
Normal file
90
receipeServer/frontend_old/node_modules/terser/node_modules/source-map/package.json
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"name": "source-map",
|
||||
"description": "Generates and consumes source maps",
|
||||
"version": "0.7.3",
|
||||
"homepage": "https://github.com/mozilla/source-map",
|
||||
"author": "Nick Fitzgerald <nfitzgerald@mozilla.com>",
|
||||
"contributors": [
|
||||
"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": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/mozilla/source-map.git"
|
||||
},
|
||||
"main": "./source-map.js",
|
||||
"types": "./source-map.d.ts",
|
||||
"files": [
|
||||
"source-map.js",
|
||||
"source-map.d.ts",
|
||||
"lib/",
|
||||
"dist/source-map.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"scripts": {
|
||||
"lint": "eslint *.js lib/ test/",
|
||||
"prebuild": "npm run lint",
|
||||
"build": "webpack --color",
|
||||
"pretest": "npm run build",
|
||||
"test": "node test/run-tests.js",
|
||||
"precoverage": "npm run build",
|
||||
"coverage": "nyc node test/run-tests.js",
|
||||
"setup": "mkdir -p coverage && cp -n .waiting.html coverage/index.html || true",
|
||||
"dev:live": "live-server --port=4103 --ignorePattern='(js|css|png)$' coverage",
|
||||
"dev:watch": "watch 'npm run coverage' lib/ test/",
|
||||
"predev": "npm run setup",
|
||||
"dev": "npm-run-all -p --silent dev:*",
|
||||
"clean": "rm -rf coverage .nyc_output",
|
||||
"toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md"
|
||||
},
|
||||
"devDependencies": {
|
||||
"doctoc": "^0.15.0",
|
||||
"eslint": "^4.19.1",
|
||||
"live-server": "^1.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"nyc": "^11.7.1",
|
||||
"watch": "^1.0.2",
|
||||
"webpack": "^3.10"
|
||||
},
|
||||
"nyc": {
|
||||
"reporter": "html"
|
||||
},
|
||||
"typings": "source-map"
|
||||
}
|
||||
369
receipeServer/frontend_old/node_modules/terser/node_modules/source-map/source-map.d.ts
generated
vendored
Normal file
369
receipeServer/frontend_old/node_modules/terser/node_modules/source-map/source-map.d.ts
generated
vendored
Normal file
@@ -0,0 +1,369 @@
|
||||
// Type definitions for source-map 0.7
|
||||
// Project: https://github.com/mozilla/source-map
|
||||
// Definitions by: Morten Houston Ludvigsen <https://github.com/MortenHoustonLudvigsen>,
|
||||
// Ron Buckton <https://github.com/rbuckton>,
|
||||
// John Vilk <https://github.com/jvilk>
|
||||
// Definitions: https://github.com/mozilla/source-map
|
||||
export type SourceMapUrl = string;
|
||||
|
||||
export interface StartOfSourceMap {
|
||||
file?: string;
|
||||
sourceRoot?: string;
|
||||
skipValidation?: boolean;
|
||||
}
|
||||
|
||||
export interface RawSourceMap {
|
||||
version: number;
|
||||
sources: string[];
|
||||
names: string[];
|
||||
sourceRoot?: string;
|
||||
sourcesContent?: string[];
|
||||
mappings: string;
|
||||
file: string;
|
||||
}
|
||||
|
||||
export interface RawIndexMap extends StartOfSourceMap {
|
||||
version: number;
|
||||
sections: RawSection[];
|
||||
}
|
||||
|
||||
export interface RawSection {
|
||||
offset: Position;
|
||||
map: RawSourceMap;
|
||||
}
|
||||
|
||||
export interface Position {
|
||||
line: number;
|
||||
column: number;
|
||||
}
|
||||
|
||||
export interface NullablePosition {
|
||||
line: number | null;
|
||||
column: number | null;
|
||||
lastColumn: number | null;
|
||||
}
|
||||
|
||||
export interface MappedPosition {
|
||||
source: string;
|
||||
line: number;
|
||||
column: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export interface NullableMappedPosition {
|
||||
source: string | null;
|
||||
line: number | null;
|
||||
column: number | null;
|
||||
name: string | null;
|
||||
}
|
||||
|
||||
export interface MappingItem {
|
||||
source: string;
|
||||
generatedLine: number;
|
||||
generatedColumn: number;
|
||||
originalLine: number;
|
||||
originalColumn: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface Mapping {
|
||||
generated: Position;
|
||||
original: Position;
|
||||
source: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export interface CodeWithSourceMap {
|
||||
code: string;
|
||||
map: SourceMapGenerator;
|
||||
}
|
||||
|
||||
export interface SourceMapConsumer {
|
||||
/**
|
||||
* Compute the last column for each generated mapping. The last column is
|
||||
* inclusive.
|
||||
*/
|
||||
computeColumnSpans(): void;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* - column: The column number in the generated source.
|
||||
* - 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.
|
||||
* - line: The line number in the original source, or null.
|
||||
* - column: The column number in the original source, or null.
|
||||
* - name: The original identifier, or null.
|
||||
*/
|
||||
originalPositionFor(generatedPosition: Position & { bias?: number }): NullableMappedPosition;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* - column: The column number in the original source.
|
||||
* - 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:
|
||||
*
|
||||
* - line: The line number in the generated source, or null.
|
||||
* - column: The column number in the generated source, or null.
|
||||
*/
|
||||
generatedPositionFor(originalPosition: MappedPosition & { bias?: number }): NullablePosition;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* - column: Optional. the column number in the original source.
|
||||
*
|
||||
* and an array of objects is returned, each with the following properties:
|
||||
*
|
||||
* - line: The line number in the generated source, or null.
|
||||
* - column: The column number in the generated source, or null.
|
||||
*/
|
||||
allGeneratedPositionsFor(originalPosition: MappedPosition): NullablePosition[];
|
||||
|
||||
/**
|
||||
* Return true if we have the source content for every source in the source
|
||||
* map, false otherwise.
|
||||
*/
|
||||
hasContentsOfAllSources(): boolean;
|
||||
|
||||
/**
|
||||
* Returns the original source content. The only argument is the url of the
|
||||
* original source file. Returns null if no original source content is
|
||||
* available.
|
||||
*/
|
||||
sourceContentFor(source: string, returnNullOnMissing?: boolean): string | null;
|
||||
|
||||
/**
|
||||
* Iterate over each mapping between an original source/line/column and a
|
||||
* generated line/column in this source map.
|
||||
*
|
||||
* @param callback
|
||||
* The function that is called with each mapping.
|
||||
* @param context
|
||||
* Optional. If specified, this object will be the value of `this` every
|
||||
* time that `aCallback` is called.
|
||||
* @param 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`.
|
||||
*/
|
||||
eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
|
||||
/**
|
||||
* Free this source map consumer's associated wasm data that is manually-managed.
|
||||
* Alternatively, you can use SourceMapConsumer.with to avoid needing to remember to call destroy.
|
||||
*/
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
export interface SourceMapConsumerConstructor {
|
||||
prototype: SourceMapConsumer;
|
||||
|
||||
GENERATED_ORDER: number;
|
||||
ORIGINAL_ORDER: number;
|
||||
GREATEST_LOWER_BOUND: number;
|
||||
LEAST_UPPER_BOUND: number;
|
||||
|
||||
new (rawSourceMap: RawSourceMap, sourceMapUrl?: SourceMapUrl): Promise<BasicSourceMapConsumer>;
|
||||
new (rawSourceMap: RawIndexMap, sourceMapUrl?: SourceMapUrl): Promise<IndexedSourceMapConsumer>;
|
||||
new (rawSourceMap: RawSourceMap | RawIndexMap | string, sourceMapUrl?: SourceMapUrl): Promise<BasicSourceMapConsumer | IndexedSourceMapConsumer>;
|
||||
|
||||
/**
|
||||
* Create a BasicSourceMapConsumer from a SourceMapGenerator.
|
||||
*
|
||||
* @param sourceMap
|
||||
* The source map that will be consumed.
|
||||
*/
|
||||
fromSourceMap(sourceMap: SourceMapGenerator, sourceMapUrl?: SourceMapUrl): Promise<BasicSourceMapConsumer>;
|
||||
|
||||
/**
|
||||
* Construct a new `SourceMapConsumer` from `rawSourceMap` and `sourceMapUrl`
|
||||
* (see the `SourceMapConsumer` constructor for details. Then, invoke the `async
|
||||
* function f(SourceMapConsumer) -> T` with the newly constructed consumer, wait
|
||||
* for `f` to complete, call `destroy` on the consumer, and return `f`'s return
|
||||
* value.
|
||||
*
|
||||
* You must not use the consumer after `f` completes!
|
||||
*
|
||||
* By using `with`, you do not have to remember to manually call `destroy` on
|
||||
* the consumer, since it will be called automatically once `f` completes.
|
||||
*
|
||||
* ```js
|
||||
* const xSquared = await SourceMapConsumer.with(
|
||||
* myRawSourceMap,
|
||||
* null,
|
||||
* async function (consumer) {
|
||||
* // Use `consumer` inside here and don't worry about remembering
|
||||
* // to call `destroy`.
|
||||
*
|
||||
* const x = await whatever(consumer);
|
||||
* return x * x;
|
||||
* }
|
||||
* );
|
||||
*
|
||||
* // You may not use that `consumer` anymore out here; it has
|
||||
* // been destroyed. But you can use `xSquared`.
|
||||
* console.log(xSquared);
|
||||
* ```
|
||||
*/
|
||||
with<T>(rawSourceMap: RawSourceMap | RawIndexMap | string, sourceMapUrl: SourceMapUrl | null | undefined, callback: (consumer: BasicSourceMapConsumer | IndexedSourceMapConsumer) => Promise<T> | T): Promise<T>;
|
||||
}
|
||||
|
||||
export const SourceMapConsumer: SourceMapConsumerConstructor;
|
||||
|
||||
export interface BasicSourceMapConsumer extends SourceMapConsumer {
|
||||
file: string;
|
||||
sourceRoot: string;
|
||||
sources: string[];
|
||||
sourcesContent: string[];
|
||||
}
|
||||
|
||||
export interface BasicSourceMapConsumerConstructor {
|
||||
prototype: BasicSourceMapConsumer;
|
||||
|
||||
new (rawSourceMap: RawSourceMap | string): Promise<BasicSourceMapConsumer>;
|
||||
|
||||
/**
|
||||
* Create a BasicSourceMapConsumer from a SourceMapGenerator.
|
||||
*
|
||||
* @param sourceMap
|
||||
* The source map that will be consumed.
|
||||
*/
|
||||
fromSourceMap(sourceMap: SourceMapGenerator): Promise<BasicSourceMapConsumer>;
|
||||
}
|
||||
|
||||
export const BasicSourceMapConsumer: BasicSourceMapConsumerConstructor;
|
||||
|
||||
export interface IndexedSourceMapConsumer extends SourceMapConsumer {
|
||||
sources: string[];
|
||||
}
|
||||
|
||||
export interface IndexedSourceMapConsumerConstructor {
|
||||
prototype: IndexedSourceMapConsumer;
|
||||
|
||||
new (rawSourceMap: RawIndexMap | string): Promise<IndexedSourceMapConsumer>;
|
||||
}
|
||||
|
||||
export const IndexedSourceMapConsumer: IndexedSourceMapConsumerConstructor;
|
||||
|
||||
export class SourceMapGenerator {
|
||||
constructor(startOfSourceMap?: StartOfSourceMap);
|
||||
|
||||
/**
|
||||
* Creates a new SourceMapGenerator based on a SourceMapConsumer
|
||||
*
|
||||
* @param sourceMapConsumer The SourceMap.
|
||||
*/
|
||||
static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
addMapping(mapping: Mapping): void;
|
||||
|
||||
/**
|
||||
* Set the source content for a source file.
|
||||
*/
|
||||
setSourceContent(sourceFile: string, sourceContent: string): void;
|
||||
|
||||
/**
|
||||
* 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 sourceMapConsumer The source map to be applied.
|
||||
* @param sourceFile Optional. The filename of the source file.
|
||||
* If omitted, SourceMapConsumer's file property will be used.
|
||||
* @param sourceMapPath 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.
|
||||
*/
|
||||
applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
|
||||
|
||||
toString(): string;
|
||||
|
||||
toJSON(): RawSourceMap;
|
||||
}
|
||||
|
||||
export class SourceNode {
|
||||
children: SourceNode[];
|
||||
sourceContents: any;
|
||||
line: number;
|
||||
column: number;
|
||||
source: string;
|
||||
name: string;
|
||||
|
||||
constructor();
|
||||
constructor(
|
||||
line: number | null,
|
||||
column: number | null,
|
||||
source: string | null,
|
||||
chunks?: Array<(string | SourceNode)> | SourceNode | string,
|
||||
name?: string
|
||||
);
|
||||
|
||||
static fromStringWithSourceMap(
|
||||
code: string,
|
||||
sourceMapConsumer: SourceMapConsumer,
|
||||
relativePath?: string
|
||||
): SourceNode;
|
||||
|
||||
add(chunk: Array<(string | SourceNode)> | SourceNode | string): SourceNode;
|
||||
|
||||
prepend(chunk: Array<(string | SourceNode)> | SourceNode | string): SourceNode;
|
||||
|
||||
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;
|
||||
}
|
||||
8
receipeServer/frontend_old/node_modules/terser/node_modules/source-map/source-map.js
generated
vendored
Normal file
8
receipeServer/frontend_old/node_modules/terser/node_modules/source-map/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;
|
||||
152
receipeServer/frontend_old/node_modules/terser/package.json
generated
vendored
Normal file
152
receipeServer/frontend_old/node_modules/terser/package.json
generated
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
{
|
||||
"name": "terser",
|
||||
"description": "JavaScript parser, mangler/compressor and beautifier toolkit for ES6+",
|
||||
"homepage": "https://terser.org",
|
||||
"author": "Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)",
|
||||
"license": "BSD-2-Clause",
|
||||
"version": "5.12.1",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"maintainers": [
|
||||
"Fábio Santos <fabiosantosart@gmail.com>"
|
||||
],
|
||||
"repository": "https://github.com/terser/terser",
|
||||
"main": "dist/bundle.min.js",
|
||||
"type": "module",
|
||||
"module": "./main.js",
|
||||
"exports": {
|
||||
".": [
|
||||
{
|
||||
"import": "./main.js",
|
||||
"require": "./dist/bundle.min.js"
|
||||
},
|
||||
"./dist/bundle.min.js"
|
||||
],
|
||||
"./package": "./package.json",
|
||||
"./package.json": "./package.json",
|
||||
"./bin/terser": "./bin/terser"
|
||||
},
|
||||
"types": "tools/terser.d.ts",
|
||||
"bin": {
|
||||
"terser": "bin/terser"
|
||||
},
|
||||
"files": [
|
||||
"bin",
|
||||
"dist",
|
||||
"lib",
|
||||
"tools",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"CHANGELOG.md",
|
||||
"PATRONS.md",
|
||||
"main.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"acorn": "^8.5.0",
|
||||
"commander": "^2.20.0",
|
||||
"source-map": "~0.7.2",
|
||||
"source-map-support": "~0.5.20"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ls-lint/ls-lint": "^1.10.0",
|
||||
"astring": "^1.7.5",
|
||||
"eslint": "^7.32.0",
|
||||
"eslump": "^3.0.0",
|
||||
"esm": "^3.2.25",
|
||||
"mocha": "^9.2.0",
|
||||
"pre-commit": "^1.2.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"rollup": "2.56.3",
|
||||
"semver": "^7.3.4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test/compress.js && mocha test/mocha",
|
||||
"test:compress": "node test/compress.js",
|
||||
"test:mocha": "mocha test/mocha",
|
||||
"lint": "eslint lib",
|
||||
"lint-fix": "eslint --fix lib",
|
||||
"ls-lint": "ls-lint",
|
||||
"build": "rimraf dist/bundle* && rollup --config --silent",
|
||||
"prepare": "npm run build",
|
||||
"postversion": "echo 'Remember to update the changelog!'"
|
||||
},
|
||||
"keywords": [
|
||||
"uglify",
|
||||
"terser",
|
||||
"uglify-es",
|
||||
"uglify-js",
|
||||
"minify",
|
||||
"minifier",
|
||||
"javascript",
|
||||
"ecmascript",
|
||||
"es5",
|
||||
"es6",
|
||||
"es7",
|
||||
"es8",
|
||||
"es2015",
|
||||
"es2016",
|
||||
"es2017",
|
||||
"async",
|
||||
"await"
|
||||
],
|
||||
"eslintConfig": {
|
||||
"parserOptions": {
|
||||
"sourceType": "module",
|
||||
"ecmaVersion": 2020
|
||||
},
|
||||
"env": {
|
||||
"node": true,
|
||||
"browser": true,
|
||||
"es2020": true
|
||||
},
|
||||
"globals": {
|
||||
"describe": false,
|
||||
"it": false,
|
||||
"require": false,
|
||||
"before": false,
|
||||
"after": false,
|
||||
"global": false,
|
||||
"process": false
|
||||
},
|
||||
"rules": {
|
||||
"brace-style": [
|
||||
"error",
|
||||
"1tbs",
|
||||
{
|
||||
"allowSingleLine": true
|
||||
}
|
||||
],
|
||||
"quotes": [
|
||||
"error",
|
||||
"double",
|
||||
"avoid-escape"
|
||||
],
|
||||
"no-debugger": "error",
|
||||
"no-undef": "error",
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"varsIgnorePattern": "^_"
|
||||
}
|
||||
],
|
||||
"no-tabs": "error",
|
||||
"semi": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"no-extra-semi": "error",
|
||||
"no-irregular-whitespace": "error",
|
||||
"space-before-blocks": [
|
||||
"error",
|
||||
"always"
|
||||
]
|
||||
}
|
||||
},
|
||||
"pre-commit": [
|
||||
"build",
|
||||
"lint-fix",
|
||||
"ls-lint",
|
||||
"test"
|
||||
]
|
||||
}
|
||||
7771
receipeServer/frontend_old/node_modules/terser/tools/domprops.js
generated
vendored
Normal file
7771
receipeServer/frontend_old/node_modules/terser/tools/domprops.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
receipeServer/frontend_old/node_modules/terser/tools/exit.cjs
generated
vendored
Normal file
7
receipeServer/frontend_old/node_modules/terser/tools/exit.cjs
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
// workaround for tty output truncation upon process.exit()
|
||||
// https://github.com/nodejs/node/issues/6456
|
||||
|
||||
[process.stdout, process.stderr].forEach((s) => {
|
||||
s && s.isTTY && s._handle && s._handle.setBlocking &&
|
||||
s._handle.setBlocking(true)
|
||||
});
|
||||
55
receipeServer/frontend_old/node_modules/terser/tools/props.html
generated
vendored
Normal file
55
receipeServer/frontend_old/node_modules/terser/tools/props.html
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<script>(function(){
|
||||
var props = {};
|
||||
|
||||
function addObject(obj) {
|
||||
if (obj == null) return;
|
||||
try {
|
||||
Object.getOwnPropertyNames(obj).forEach(add);
|
||||
} catch(ex) {}
|
||||
if (obj.prototype) {
|
||||
Object.getOwnPropertyNames(obj.prototype).forEach(add);
|
||||
}
|
||||
if (typeof obj == "function") {
|
||||
try {
|
||||
Object.getOwnPropertyNames(new obj).forEach(add);
|
||||
} catch(ex) {}
|
||||
}
|
||||
}
|
||||
|
||||
function add(name) {
|
||||
props[name] = true;
|
||||
}
|
||||
|
||||
Object.getOwnPropertyNames(window).forEach(function(thing){
|
||||
addObject(window[thing]);
|
||||
});
|
||||
|
||||
try {
|
||||
addObject(new Event("click"));
|
||||
addObject(new Event("contextmenu"));
|
||||
addObject(new Event("mouseup"));
|
||||
addObject(new Event("mousedown"));
|
||||
addObject(new Event("keydown"));
|
||||
addObject(new Event("keypress"));
|
||||
addObject(new Event("keyup"));
|
||||
} catch(ex) {}
|
||||
|
||||
var ta = document.createElement("textarea");
|
||||
ta.style.width = "100%";
|
||||
ta.style.height = "20em";
|
||||
ta.style.boxSizing = "border-box";
|
||||
ta.value = 'export var domprops = ' + JSON.stringify(Object.keys(props).sort(cmp), null, 4);
|
||||
document.body.appendChild(ta);
|
||||
|
||||
function cmp(a, b) {
|
||||
a = a.toLowerCase();
|
||||
b = b.toLowerCase();
|
||||
return a < b ? -1 : a > b ? 1 : 0;
|
||||
}
|
||||
})();</script>
|
||||
</body>
|
||||
</html>
|
||||
207
receipeServer/frontend_old/node_modules/terser/tools/terser.d.ts
generated
vendored
Normal file
207
receipeServer/frontend_old/node_modules/terser/tools/terser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,207 @@
|
||||
/// <reference lib="es2015" />
|
||||
|
||||
import { RawSourceMap } from 'source-map';
|
||||
|
||||
export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020;
|
||||
|
||||
export interface ParseOptions {
|
||||
bare_returns?: boolean;
|
||||
ecma?: ECMA;
|
||||
html5_comments?: boolean;
|
||||
shebang?: boolean;
|
||||
}
|
||||
|
||||
export interface CompressOptions {
|
||||
arguments?: boolean;
|
||||
arrows?: boolean;
|
||||
booleans_as_integers?: boolean;
|
||||
booleans?: boolean;
|
||||
collapse_vars?: boolean;
|
||||
comparisons?: boolean;
|
||||
computed_props?: boolean;
|
||||
conditionals?: boolean;
|
||||
dead_code?: boolean;
|
||||
defaults?: boolean;
|
||||
directives?: boolean;
|
||||
drop_console?: boolean;
|
||||
drop_debugger?: boolean;
|
||||
ecma?: ECMA;
|
||||
evaluate?: boolean;
|
||||
expression?: boolean;
|
||||
global_defs?: object;
|
||||
hoist_funs?: boolean;
|
||||
hoist_props?: boolean;
|
||||
hoist_vars?: boolean;
|
||||
ie8?: boolean;
|
||||
if_return?: boolean;
|
||||
inline?: boolean | InlineFunctions;
|
||||
join_vars?: boolean;
|
||||
keep_classnames?: boolean | RegExp;
|
||||
keep_fargs?: boolean;
|
||||
keep_fnames?: boolean | RegExp;
|
||||
keep_infinity?: boolean;
|
||||
loops?: boolean;
|
||||
module?: boolean;
|
||||
negate_iife?: boolean;
|
||||
passes?: number;
|
||||
properties?: boolean;
|
||||
pure_funcs?: string[];
|
||||
pure_getters?: boolean | 'strict';
|
||||
reduce_funcs?: boolean;
|
||||
reduce_vars?: boolean;
|
||||
sequences?: boolean | number;
|
||||
side_effects?: boolean;
|
||||
switches?: boolean;
|
||||
toplevel?: boolean;
|
||||
top_retain?: null | string | string[] | RegExp;
|
||||
typeofs?: boolean;
|
||||
unsafe_arrows?: boolean;
|
||||
unsafe?: boolean;
|
||||
unsafe_comps?: boolean;
|
||||
unsafe_Function?: boolean;
|
||||
unsafe_math?: boolean;
|
||||
unsafe_symbols?: boolean;
|
||||
unsafe_methods?: boolean;
|
||||
unsafe_proto?: boolean;
|
||||
unsafe_regexp?: boolean;
|
||||
unsafe_undefined?: boolean;
|
||||
unused?: boolean;
|
||||
}
|
||||
|
||||
export enum InlineFunctions {
|
||||
Disabled = 0,
|
||||
SimpleFunctions = 1,
|
||||
WithArguments = 2,
|
||||
WithArgumentsAndVariables = 3
|
||||
}
|
||||
|
||||
export interface MangleOptions {
|
||||
eval?: boolean;
|
||||
keep_classnames?: boolean | RegExp;
|
||||
keep_fnames?: boolean | RegExp;
|
||||
module?: boolean;
|
||||
nth_identifier?: SimpleIdentifierMangler | WeightedIdentifierMangler;
|
||||
properties?: boolean | ManglePropertiesOptions;
|
||||
reserved?: string[];
|
||||
safari10?: boolean;
|
||||
toplevel?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* An identifier mangler for which the output is invariant with respect to the source code.
|
||||
*/
|
||||
export interface SimpleIdentifierMangler {
|
||||
/**
|
||||
* Obtains the nth most favored (usually shortest) identifier to rename a variable to.
|
||||
* The mangler will increment n and retry until the return value is not in use in scope, and is not a reserved word.
|
||||
* This function is expected to be stable; Evaluating get(n) === get(n) should always return true.
|
||||
* @param n The ordinal of the identifier.
|
||||
*/
|
||||
get(n: number): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* An identifier mangler that leverages character frequency analysis to determine identifier precedence.
|
||||
*/
|
||||
export interface WeightedIdentifierMangler extends SimpleIdentifierMangler {
|
||||
/**
|
||||
* Modifies the internal weighting of the input characters by the specified delta.
|
||||
* Will be invoked on the entire printed AST, and then deduct mangleable identifiers.
|
||||
* @param chars The characters to modify the weighting of.
|
||||
* @param delta The numeric weight to add to the characters.
|
||||
*/
|
||||
consider(chars: string, delta: number): number;
|
||||
/**
|
||||
* Resets character weights.
|
||||
*/
|
||||
reset(): void;
|
||||
/**
|
||||
* Sorts identifiers by character frequency, in preparation for calls to get(n).
|
||||
*/
|
||||
sort(): void;
|
||||
}
|
||||
|
||||
export interface ManglePropertiesOptions {
|
||||
builtins?: boolean;
|
||||
debug?: boolean;
|
||||
keep_quoted?: boolean | 'strict';
|
||||
nth_identifier?: SimpleIdentifierMangler | WeightedIdentifierMangler;
|
||||
regex?: RegExp | string;
|
||||
reserved?: string[];
|
||||
}
|
||||
|
||||
export interface FormatOptions {
|
||||
ascii_only?: boolean;
|
||||
/** @deprecated Not implemented anymore */
|
||||
beautify?: boolean;
|
||||
braces?: boolean;
|
||||
comments?: boolean | 'all' | 'some' | RegExp | ( (node: any, comment: {
|
||||
value: string,
|
||||
type: 'comment1' | 'comment2' | 'comment3' | 'comment4',
|
||||
pos: number,
|
||||
line: number,
|
||||
col: number,
|
||||
}) => boolean );
|
||||
ecma?: ECMA;
|
||||
ie8?: boolean;
|
||||
indent_level?: number;
|
||||
indent_start?: number;
|
||||
inline_script?: boolean;
|
||||
keep_quoted_props?: boolean;
|
||||
max_line_len?: number | false;
|
||||
preamble?: string;
|
||||
preserve_annotations?: boolean;
|
||||
quote_keys?: boolean;
|
||||
quote_style?: OutputQuoteStyle;
|
||||
safari10?: boolean;
|
||||
semicolons?: boolean;
|
||||
shebang?: boolean;
|
||||
shorthand?: boolean;
|
||||
source_map?: SourceMapOptions;
|
||||
webkit?: boolean;
|
||||
width?: number;
|
||||
wrap_iife?: boolean;
|
||||
wrap_func_args?: boolean;
|
||||
}
|
||||
|
||||
export enum OutputQuoteStyle {
|
||||
PreferDouble = 0,
|
||||
AlwaysSingle = 1,
|
||||
AlwaysDouble = 2,
|
||||
AlwaysOriginal = 3
|
||||
}
|
||||
|
||||
export interface MinifyOptions {
|
||||
compress?: boolean | CompressOptions;
|
||||
ecma?: ECMA;
|
||||
enclose?: boolean | string;
|
||||
ie8?: boolean;
|
||||
keep_classnames?: boolean | RegExp;
|
||||
keep_fnames?: boolean | RegExp;
|
||||
mangle?: boolean | MangleOptions;
|
||||
module?: boolean;
|
||||
nameCache?: object;
|
||||
format?: FormatOptions;
|
||||
/** @deprecated */
|
||||
output?: FormatOptions;
|
||||
parse?: ParseOptions;
|
||||
safari10?: boolean;
|
||||
sourceMap?: boolean | SourceMapOptions;
|
||||
toplevel?: boolean;
|
||||
}
|
||||
|
||||
export interface MinifyOutput {
|
||||
code?: string;
|
||||
map?: RawSourceMap | string;
|
||||
}
|
||||
|
||||
export interface SourceMapOptions {
|
||||
/** Source map object, 'inline' or source map file content */
|
||||
content?: RawSourceMap | string;
|
||||
includeSources?: boolean;
|
||||
filename?: string;
|
||||
root?: string;
|
||||
url?: string | 'inline';
|
||||
}
|
||||
|
||||
export function minify(files: string | string[] | { [file: string]: string }, options?: MinifyOptions): Promise<MinifyOutput>;
|
||||
Reference in New Issue
Block a user