@gesslar/sassy 0.21.1 → 0.22.0
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/package.json +18 -7
- package/src/BuildCommand.js +1 -2
- package/src/Colour.js +1 -3
- package/src/Command.js +1 -37
- package/src/Compiler.js +1 -6
- package/src/Evaluator.js +1 -1
- package/src/LintCommand.js +1 -2
- package/src/ResolveCommand.js +3 -6
- package/src/Session.js +1 -4
- package/src/Theme.js +1 -7
- package/src/ThemePool.js +1 -1
- package/src/ThemeToken.js +1 -1
- package/src/cli.js +1 -5
- package/src/index.js +40 -0
- package/types/BuildCommand.d.ts +40 -0
- package/types/Colour.d.ts +126 -0
- package/types/Command.d.ts +135 -0
- package/types/Compiler.d.ts +16 -0
- package/types/Evaluator.d.ts +86 -0
- package/types/LintCommand.d.ts +58 -0
- package/types/ResolveCommand.d.ts +58 -0
- package/types/Session.d.ts +132 -0
- package/types/Theme.d.ts +336 -0
- package/types/ThemePool.d.ts +81 -0
- package/types/ThemeToken.d.ts +150 -0
- package/types/cli.d.ts +2 -0
- package/types/index.d.ts +9 -0
- package/src/Cache.js +0 -74
- package/src/Data.js +0 -533
- package/src/DirectoryObject.js +0 -188
- package/src/File.js +0 -346
- package/src/FileObject.js +0 -226
- package/src/Sass.js +0 -166
- package/src/Term.js +0 -175
- package/src/Type.js +0 -207
- package/src/Util.js +0 -132
- package/src/Valid.js +0 -50
package/src/Valid.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import _assert from "node:assert/strict"
|
|
2
|
-
|
|
3
|
-
import Sass from "./Sass.js"
|
|
4
|
-
import Data from "./Data.js"
|
|
5
|
-
|
|
6
|
-
export default class Valid {
|
|
7
|
-
/**
|
|
8
|
-
* Validates a value against a type
|
|
9
|
-
*
|
|
10
|
-
* @param {unknown} value - The value to validate
|
|
11
|
-
* @param {string} type - The expected type in the form of "object",
|
|
12
|
-
* "object[]", "object|object[]"
|
|
13
|
-
* @param {object} [options] - Additional options for validation.
|
|
14
|
-
*/
|
|
15
|
-
static validType(value, type, options) {
|
|
16
|
-
Valid.assert(
|
|
17
|
-
Data.isType(value, type, options),
|
|
18
|
-
`Invalid type. Expected ${type}, got ${JSON.stringify(value)}`,
|
|
19
|
-
1,
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Asserts a condition
|
|
25
|
-
*
|
|
26
|
-
* @param {boolean} condition - The condition to assert
|
|
27
|
-
* @param {string} message - The message to display if the condition is not
|
|
28
|
-
* met
|
|
29
|
-
* @param {number} [arg] - The argument to display if the condition is not
|
|
30
|
-
* met (optional)
|
|
31
|
-
*/
|
|
32
|
-
static assert(condition, message, arg = null) {
|
|
33
|
-
_assert(
|
|
34
|
-
Data.isType(condition, "boolean"),
|
|
35
|
-
`Condition must be a boolean, got ${condition}`,
|
|
36
|
-
)
|
|
37
|
-
_assert(
|
|
38
|
-
Data.isType(message, "string"),
|
|
39
|
-
`Message must be a string, got ${message}`,
|
|
40
|
-
)
|
|
41
|
-
_assert(
|
|
42
|
-
arg !== null || arg !== undefined && typeof arg === "number",
|
|
43
|
-
`Arg must be a number, got ${arg}`,
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
if(!condition)
|
|
47
|
-
throw Sass.new(`${message}${arg ? `: ${arg}` : ""}`)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
}
|