@quenty/optional 4.1.2-canary.c50dead.0 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -2
- package/LICENSE.md +1 -1
- package/README.md +7 -7
- package/package.json +3 -3
- package/src/Shared/optional.lua +19 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,20 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [4.
|
|
6
|
+
## [4.2.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/optional@4.2.0...@quenty/optional@4.2.1) (2021-12-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/optional
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [4.2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/optional@4.1.1...@quenty/optional@4.2.0) (2021-11-20)
|
|
7
15
|
|
|
8
16
|
|
|
9
17
|
### Bug Fixes
|
|
10
18
|
|
|
11
|
-
* Support MacOS syncing ([
|
|
19
|
+
* Support MacOS syncing ([#225](https://github.com/Quenty/NevermoreEngine/issues/225)) ([03f9183](https://github.com/Quenty/NevermoreEngine/commit/03f918392c6a5bdd33f8a17c38de371d1e06c67a))
|
|
12
20
|
|
|
13
21
|
|
|
14
22
|
|
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
## Optional
|
|
2
2
|
<div align="center">
|
|
3
|
-
<a href="http://quenty.github.io/
|
|
4
|
-
<img src="https://
|
|
3
|
+
<a href="http://quenty.github.io/NevermoreEngine/">
|
|
4
|
+
<img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/docs.yml/badge.svg" alt="Documentation status" />
|
|
5
5
|
</a>
|
|
6
6
|
<a href="https://discord.gg/mhtGUS8">
|
|
7
|
-
<img src="https://img.shields.io/
|
|
7
|
+
<img src="https://img.shields.io/discord/385151591524597761?color=5865F2&label=discord&logo=discord&logoColor=white" alt="Discord" />
|
|
8
8
|
</a>
|
|
9
9
|
<a href="https://github.com/Quenty/NevermoreEngine/actions">
|
|
10
10
|
<img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/build.yml/badge.svg" alt="Build and release status" />
|
|
11
11
|
</a>
|
|
12
12
|
</div>
|
|
13
|
+
|
|
13
14
|
Sets up `require.optional("Name")`.
|
|
14
15
|
|
|
16
|
+
<div align="center"><a href="https://quenty.github.io/NevermoreEngine/api/optional">View docs →</a></div>
|
|
17
|
+
|
|
15
18
|
## Installation
|
|
16
19
|
```
|
|
17
20
|
npm install @quenty/optional --save
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Errors are still preserved because Roblox reports errors of module scripts regardless of caller
|
|
21
|
-
execution context.
|
|
21
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/optional",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "Adds the optional function to Roblox for Nevermore require",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/loader": "3.1.
|
|
28
|
+
"@quenty/loader": "^3.1.2"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "d146c77d0a8e452824de0ab0b4b03ba0370bcc1b"
|
|
34
34
|
}
|
package/src/Shared/optional.lua
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
-- @author Quenty
|
|
4
|
-
|
|
5
|
-
--[[
|
|
6
|
-
Sets up require.optional("Name").
|
|
1
|
+
--[=[
|
|
2
|
+
Sets up `require.optional("Name")`.
|
|
7
3
|
|
|
8
4
|
Errors are still preserved because Roblox reports errors of module scripts regardless of caller
|
|
9
5
|
execution context.
|
|
10
|
-
]]
|
|
11
6
|
|
|
7
|
+
```lua
|
|
8
|
+
local BasicPane = require.optional("BasicPane")
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
@class optional
|
|
12
|
+
]=]
|
|
13
|
+
|
|
14
|
+
--[=[
|
|
15
|
+
Optional require, if the instance does not exist, or errors while loading, then
|
|
16
|
+
nil is returned.
|
|
17
|
+
|
|
18
|
+
@function optional
|
|
19
|
+
@param _require function
|
|
20
|
+
@param _module string | number | Instance
|
|
21
|
+
@return T?
|
|
22
|
+
@within optional
|
|
23
|
+
]=]
|
|
12
24
|
return function(_require, _module)
|
|
13
25
|
assert(_require, "Bad _require function")
|
|
14
26
|
assert(type(_module) == "string"
|