-
-
Notifications
You must be signed in to change notification settings - Fork 6
JavaScript
JsExtension
is a static class that provides methods to minify and beautify JavaScript code. The class is defined in the Skylark.Standard.Extension.Js
namespace.
This method minifies the JavaScript code passed in as a string. It uses the CrockfordJsMinifier
class from the NUglify.JavaScript
namespace to perform the minification.
-
Js
: The JavaScript code to minify. If no code is provided, the default code specified in theMJJM.Js
field is used.
A string containing the minified JavaScript code.
-
Skylark.Exception
: If an error occurs during the minification process, an exception is thrown with the error message.
string jsCode = "function foo() { return 'Hello, world!'; }";
string minifiedJs = JsExtension.ToMinify(jsCode);
This method is the asynchronous version of ToMinify
.
-
Js
: The JavaScript code to minify. If no code is provided, the default code specified in theMJJM.Js
field is used.
A Task<string>
object that represents the asynchronous operation. The Task
object returns a string containing the minified JavaScript code.
This method beautifies the JavaScript code passed in as a string. It uses the Uglify.Js
method from the NUglify
namespace to perform the beautification.
-
Js
: The JavaScript code to beautify. If no code is provided, the default code specified in theMJJM.Js
field is used.
A string containing the beautified JavaScript code.
-
Skylark.Exception
: If an error occurs during the beautification process, an exception is thrown with the error message.
string jsCode = "function foo() { return 'Hello, world!'; }";
string beautifiedJs = JsExtension.ToBeauty(jsCode);
This method is the asynchronous version of ToBeauty
.
- Tax
- Url
- Web
- Ping
- Port
- Text
- Time
- Hash
- Word
- Color
- Speed
- Lottery
- Storage
- Browser
- Unicode
- Password
- JavaScript
- Cryptology
- Typography
- Temperature
- Compression
- Decompression
- Cascading Style Sheets
- JavaScript Object Notation
- Hypertext Markup Language
- Extensible Markup Language
- Extensible HyperText Markup Language