@master/css 2.0.0-rc.15 → 2.0.0-rc.16
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/dist/_virtual/_commonjsHelpers.cjs +5 -0
- package/dist/_virtual/_commonjsHelpers.mjs +3 -0
- package/dist/_virtual/css-escape.cjs +5 -0
- package/dist/_virtual/css-escape.mjs +3 -0
- package/dist/bin/index.cjs +11 -0
- package/dist/bin/index.mjs +9 -0
- package/dist/config/animations.cjs +113 -0
- package/dist/config/animations.mjs +111 -0
- package/dist/config/functions.cjs +352 -0
- package/dist/config/functions.mjs +350 -0
- package/dist/config/index.cjs +34 -0
- package/dist/config/index.mjs +25 -0
- package/dist/config/media-queries.cjs +7 -0
- package/dist/config/media-queries.mjs +1 -0
- package/dist/config/rules.cjs +2190 -0
- package/dist/config/rules.mjs +2184 -0
- package/dist/config/selectors.cjs +29 -0
- package/dist/config/selectors.mjs +27 -0
- package/dist/config/semantics.cjs +194 -0
- package/dist/config/semantics.mjs +192 -0
- package/dist/config/styles.cjs +2 -0
- package/dist/config/styles.mjs +1 -0
- package/dist/config/variables.cjs +583 -0
- package/dist/config/variables.mjs +581 -0
- package/dist/constants/base-unit-regex.cjs +5 -0
- package/dist/constants/base-unit-regex.mjs +3 -0
- package/dist/constants/start-symbol.cjs +10 -0
- package/dist/constants/start-symbol.mjs +8 -0
- package/dist/core.cjs +979 -0
- package/dist/core.d.ts +2 -3
- package/dist/core.mjs +974 -0
- package/dist/functions/reorder-for-readable-classes.cjs +68 -0
- package/dist/functions/reorder-for-readable-classes.d.ts +1 -1
- package/dist/functions/reorder-for-readable-classes.mjs +66 -0
- package/dist/functions/transform-color-with-opacity.cjs +9 -0
- package/dist/functions/transform-color-with-opacity.mjs +7 -0
- package/dist/index.cjs +37 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +13 -0
- package/dist/layer.cjs +23 -0
- package/dist/layer.mjs +23 -0
- package/dist/polyfills/css-escape.cjs +8 -0
- package/dist/polyfills/css-escape.mjs +2 -0
- package/dist/polyfills/css-escape2.cjs +68 -0
- package/dist/polyfills/css-escape2.mjs +64 -0
- package/dist/rule.cjs +702 -0
- package/dist/rule.d.ts +1 -1
- package/dist/rule.mjs +700 -0
- package/dist/shared/utils/css-escape.cjs +56 -0
- package/dist/shared/utils/css-escape.mjs +54 -0
- package/dist/tokens/screen-sizes.cjs +17 -0
- package/dist/tokens/screen-sizes.mjs +15 -0
- package/dist/utils/concat-arrays.cjs +12 -0
- package/dist/utils/concat-arrays.mjs +10 -0
- package/dist/utils/extend-config.cjs +59 -0
- package/dist/utils/extend-config.mjs +57 -0
- package/dist/utils/flatten-object.cjs +15 -0
- package/dist/utils/flatten-object.mjs +13 -0
- package/dist/utils/get-type.cjs +12 -0
- package/dist/utils/get-type.mjs +10 -0
- package/dist/utils/hex-to-rgb.cjs +30 -0
- package/dist/utils/hex-to-rgb.mjs +28 -0
- package/dist/utils/is-plain-object.cjs +15 -0
- package/dist/utils/is-plain-object.mjs +13 -0
- package/dist/utils/is-symbol.cjs +14 -0
- package/dist/utils/is-symbol.mjs +12 -0
- package/dist/utils/rgb-to-hex.cjs +7 -0
- package/dist/utils/rgb-to-hex.mjs +5 -0
- package/package.json +1 -1
- package/dist/bin/index.bundle.js +0 -1
- package/dist/index.bundle.js +0 -1
- package/dist/index.bundle.mjs +0 -1
- package/dist/types/global.d.ts +0 -5
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function cssEscape(value) {
|
|
4
|
+
if (typeof CSS !== 'undefined') return CSS.escape(value);
|
|
5
|
+
if (arguments.length == 0) {
|
|
6
|
+
throw new TypeError('`CSS.escape` requires an argument.');
|
|
7
|
+
}
|
|
8
|
+
const string = String(value);
|
|
9
|
+
const length = string.length;
|
|
10
|
+
let index = -1;
|
|
11
|
+
let result = '';
|
|
12
|
+
let codeUnit;
|
|
13
|
+
const firstCodeUnit = string.charCodeAt(0);
|
|
14
|
+
if (// If the character is the first character and is a `-` (U+002D), and
|
|
15
|
+
// there is no second character, […]
|
|
16
|
+
length == 1 && firstCodeUnit == 0x002D) {
|
|
17
|
+
return '\\' + string;
|
|
18
|
+
}
|
|
19
|
+
while(++index < length){
|
|
20
|
+
codeUnit = string.charCodeAt(index);
|
|
21
|
+
// Note: there’s no need to special-case astral symbols, surrogate
|
|
22
|
+
// pairs, or lone surrogates.
|
|
23
|
+
// If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
|
|
24
|
+
// (U+FFFD).
|
|
25
|
+
if (codeUnit == 0x0000) {
|
|
26
|
+
result += '\uFFFD';
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (// If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
|
|
30
|
+
// U+007F, […]
|
|
31
|
+
codeUnit >= 0x0001 && codeUnit <= 0x001F || codeUnit == 0x007F || // If the character is the first character and is in the range [0-9]
|
|
32
|
+
// (U+0030 to U+0039), […]
|
|
33
|
+
index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039 || // If the character is the second character and is in the range [0-9]
|
|
34
|
+
// (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
|
|
35
|
+
index == 1 && codeUnit >= 0x0030 && codeUnit <= 0x0039 && firstCodeUnit == 0x002D) {
|
|
36
|
+
// https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
|
|
37
|
+
result += '\\' + codeUnit.toString(16) + ' ';
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
// If the character is not handled by one of the above rules and is
|
|
41
|
+
// greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
|
|
42
|
+
// is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
|
|
43
|
+
// U+005A), or [a-z] (U+0061 to U+007A), […]
|
|
44
|
+
if (codeUnit >= 0x0080 || codeUnit == 0x002D || codeUnit == 0x005F || codeUnit >= 0x0030 && codeUnit <= 0x0039 || codeUnit >= 0x0041 && codeUnit <= 0x005A || codeUnit >= 0x0061 && codeUnit <= 0x007A) {
|
|
45
|
+
// the character itself
|
|
46
|
+
result += string.charAt(index);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
// Otherwise, the escaped character.
|
|
50
|
+
// https://drafts.csswg.org/cssom/#escape-a-character
|
|
51
|
+
result += '\\' + string.charAt(index);
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
module.exports = cssEscape;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
function cssEscape(value) {
|
|
2
|
+
if (typeof CSS !== 'undefined') return CSS.escape(value);
|
|
3
|
+
if (arguments.length == 0) {
|
|
4
|
+
throw new TypeError('`CSS.escape` requires an argument.');
|
|
5
|
+
}
|
|
6
|
+
const string = String(value);
|
|
7
|
+
const length = string.length;
|
|
8
|
+
let index = -1;
|
|
9
|
+
let result = '';
|
|
10
|
+
let codeUnit;
|
|
11
|
+
const firstCodeUnit = string.charCodeAt(0);
|
|
12
|
+
if (// If the character is the first character and is a `-` (U+002D), and
|
|
13
|
+
// there is no second character, […]
|
|
14
|
+
length == 1 && firstCodeUnit == 0x002D) {
|
|
15
|
+
return '\\' + string;
|
|
16
|
+
}
|
|
17
|
+
while(++index < length){
|
|
18
|
+
codeUnit = string.charCodeAt(index);
|
|
19
|
+
// Note: there’s no need to special-case astral symbols, surrogate
|
|
20
|
+
// pairs, or lone surrogates.
|
|
21
|
+
// If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
|
|
22
|
+
// (U+FFFD).
|
|
23
|
+
if (codeUnit == 0x0000) {
|
|
24
|
+
result += '\uFFFD';
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (// If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
|
|
28
|
+
// U+007F, […]
|
|
29
|
+
codeUnit >= 0x0001 && codeUnit <= 0x001F || codeUnit == 0x007F || // If the character is the first character and is in the range [0-9]
|
|
30
|
+
// (U+0030 to U+0039), […]
|
|
31
|
+
index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039 || // If the character is the second character and is in the range [0-9]
|
|
32
|
+
// (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
|
|
33
|
+
index == 1 && codeUnit >= 0x0030 && codeUnit <= 0x0039 && firstCodeUnit == 0x002D) {
|
|
34
|
+
// https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
|
|
35
|
+
result += '\\' + codeUnit.toString(16) + ' ';
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
// If the character is not handled by one of the above rules and is
|
|
39
|
+
// greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
|
|
40
|
+
// is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
|
|
41
|
+
// U+005A), or [a-z] (U+0061 to U+007A), […]
|
|
42
|
+
if (codeUnit >= 0x0080 || codeUnit == 0x002D || codeUnit == 0x005F || codeUnit >= 0x0030 && codeUnit <= 0x0039 || codeUnit >= 0x0041 && codeUnit <= 0x005A || codeUnit >= 0x0061 && codeUnit <= 0x007A) {
|
|
43
|
+
// the character itself
|
|
44
|
+
result += string.charAt(index);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
// Otherwise, the escaped character.
|
|
48
|
+
// https://drafts.csswg.org/cssom/#escape-a-character
|
|
49
|
+
result += '\\' + string.charAt(index);
|
|
50
|
+
}
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { cssEscape as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function concatArrays(originVal, newVal) {
|
|
4
|
+
if (Array.isArray(originVal) && Array.isArray(newVal)) {
|
|
5
|
+
// concat logic
|
|
6
|
+
return originVal.concat(newVal);
|
|
7
|
+
}
|
|
8
|
+
return newVal // always return newVal as fallback!!
|
|
9
|
+
;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.concatArrays = concatArrays;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var extend = require('@techor/extend');
|
|
4
|
+
|
|
5
|
+
function extendConfig(...configs) {
|
|
6
|
+
const formatConfig = (config)=>{
|
|
7
|
+
const clonedConfig = extend({}, config);
|
|
8
|
+
const formatDeeply = (obj)=>{
|
|
9
|
+
for(const key in obj){
|
|
10
|
+
const value = obj[key];
|
|
11
|
+
if (typeof value === 'object' && !Array.isArray(value)) {
|
|
12
|
+
formatDeeply(value);
|
|
13
|
+
} else if (key && !key.startsWith('@')) {
|
|
14
|
+
obj[key] = {
|
|
15
|
+
'': value
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
if (clonedConfig.styles) {
|
|
21
|
+
formatDeeply(clonedConfig.styles);
|
|
22
|
+
} else {
|
|
23
|
+
clonedConfig.styles = {};
|
|
24
|
+
}
|
|
25
|
+
if (clonedConfig.mediaQueries) {
|
|
26
|
+
formatDeeply(clonedConfig.mediaQueries);
|
|
27
|
+
} else {
|
|
28
|
+
clonedConfig.mediaQueries = {};
|
|
29
|
+
}
|
|
30
|
+
if (clonedConfig.variables) {
|
|
31
|
+
formatDeeply(clonedConfig.variables);
|
|
32
|
+
} else {
|
|
33
|
+
clonedConfig.variables = {};
|
|
34
|
+
}
|
|
35
|
+
return clonedConfig;
|
|
36
|
+
};
|
|
37
|
+
const formattedConfigs = [];
|
|
38
|
+
for (const eachConfig of configs){
|
|
39
|
+
(function getConfigsDeeply(config) {
|
|
40
|
+
if (config.extends?.length) {
|
|
41
|
+
for (const eachExtend of config.extends){
|
|
42
|
+
getConfigsDeeply('config' in eachExtend ? eachExtend.config : eachExtend);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
formattedConfigs.push(formatConfig(config));
|
|
46
|
+
})(eachConfig);
|
|
47
|
+
}
|
|
48
|
+
let extendedConfig = formattedConfigs[0];
|
|
49
|
+
for(let i = 1; i < formattedConfigs.length; i++){
|
|
50
|
+
const currentFormattedConfig = formattedConfigs[i];
|
|
51
|
+
extendedConfig = extend(extendedConfig, currentFormattedConfig);
|
|
52
|
+
if (Object.prototype.hasOwnProperty.call(currentFormattedConfig, 'animations') && extendedConfig.animations) {
|
|
53
|
+
Object.assign(extendedConfig.animations, currentFormattedConfig.animations);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return extendedConfig;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
exports.extendConfig = extendConfig;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import extend from '@techor/extend';
|
|
2
|
+
|
|
3
|
+
function extendConfig(...configs) {
|
|
4
|
+
const formatConfig = (config)=>{
|
|
5
|
+
const clonedConfig = extend({}, config);
|
|
6
|
+
const formatDeeply = (obj)=>{
|
|
7
|
+
for(const key in obj){
|
|
8
|
+
const value = obj[key];
|
|
9
|
+
if (typeof value === 'object' && !Array.isArray(value)) {
|
|
10
|
+
formatDeeply(value);
|
|
11
|
+
} else if (key && !key.startsWith('@')) {
|
|
12
|
+
obj[key] = {
|
|
13
|
+
'': value
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
if (clonedConfig.styles) {
|
|
19
|
+
formatDeeply(clonedConfig.styles);
|
|
20
|
+
} else {
|
|
21
|
+
clonedConfig.styles = {};
|
|
22
|
+
}
|
|
23
|
+
if (clonedConfig.mediaQueries) {
|
|
24
|
+
formatDeeply(clonedConfig.mediaQueries);
|
|
25
|
+
} else {
|
|
26
|
+
clonedConfig.mediaQueries = {};
|
|
27
|
+
}
|
|
28
|
+
if (clonedConfig.variables) {
|
|
29
|
+
formatDeeply(clonedConfig.variables);
|
|
30
|
+
} else {
|
|
31
|
+
clonedConfig.variables = {};
|
|
32
|
+
}
|
|
33
|
+
return clonedConfig;
|
|
34
|
+
};
|
|
35
|
+
const formattedConfigs = [];
|
|
36
|
+
for (const eachConfig of configs){
|
|
37
|
+
(function getConfigsDeeply(config) {
|
|
38
|
+
if (config.extends?.length) {
|
|
39
|
+
for (const eachExtend of config.extends){
|
|
40
|
+
getConfigsDeeply('config' in eachExtend ? eachExtend.config : eachExtend);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
formattedConfigs.push(formatConfig(config));
|
|
44
|
+
})(eachConfig);
|
|
45
|
+
}
|
|
46
|
+
let extendedConfig = formattedConfigs[0];
|
|
47
|
+
for(let i = 1; i < formattedConfigs.length; i++){
|
|
48
|
+
const currentFormattedConfig = formattedConfigs[i];
|
|
49
|
+
extendedConfig = extend(extendedConfig, currentFormattedConfig);
|
|
50
|
+
if (Object.prototype.hasOwnProperty.call(currentFormattedConfig, 'animations') && extendedConfig.animations) {
|
|
51
|
+
Object.assign(extendedConfig.animations, currentFormattedConfig.animations);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return extendedConfig;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { extendConfig };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function flattenObject(obj, parentKey = '') {
|
|
4
|
+
return Object.entries(obj).reduce((acc, [key, value])=>{
|
|
5
|
+
const currentKey = parentKey ? `${parentKey}${key ? '-' + key : ''}` : key;
|
|
6
|
+
if (typeof value === 'object' && !Array.isArray(value)) {
|
|
7
|
+
Object.assign(acc, flattenObject(value, currentKey));
|
|
8
|
+
} else {
|
|
9
|
+
acc[currentKey] = value;
|
|
10
|
+
}
|
|
11
|
+
return acc;
|
|
12
|
+
}, {});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.flattenObject = flattenObject;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function flattenObject(obj, parentKey = '') {
|
|
2
|
+
return Object.entries(obj).reduce((acc, [key, value])=>{
|
|
3
|
+
const currentKey = parentKey ? `${parentKey}${key ? '-' + key : ''}` : key;
|
|
4
|
+
if (typeof value === 'object' && !Array.isArray(value)) {
|
|
5
|
+
Object.assign(acc, flattenObject(value, currentKey));
|
|
6
|
+
} else {
|
|
7
|
+
acc[currentKey] = value;
|
|
8
|
+
}
|
|
9
|
+
return acc;
|
|
10
|
+
}, {});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { flattenObject };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function hexToRgb(hex) {
|
|
4
|
+
if (hex.startsWith('#')) {
|
|
5
|
+
hex = hex.slice(1);
|
|
6
|
+
}
|
|
7
|
+
let r;
|
|
8
|
+
let g;
|
|
9
|
+
let b;
|
|
10
|
+
let a;
|
|
11
|
+
if (hex.length === 3 || hex.length === 4) {
|
|
12
|
+
r = parseInt(hex[0] + hex[0], 16);
|
|
13
|
+
g = parseInt(hex[1] + hex[1], 16);
|
|
14
|
+
b = parseInt(hex[2] + hex[2], 16);
|
|
15
|
+
a = hex.length === 4 ? Math.round(parseInt(hex[3] + hex[3], 16) / 255 * 100) / 100 : 1;
|
|
16
|
+
} else if (hex.length === 6 || hex.length === 8) {
|
|
17
|
+
r = parseInt(hex.slice(0, 2), 16);
|
|
18
|
+
g = parseInt(hex.slice(2, 4), 16);
|
|
19
|
+
b = parseInt(hex.slice(4, 6), 16);
|
|
20
|
+
a = hex.length === 8 ? Math.round(parseInt(hex.slice(6, 8), 16) / 255 * 100) / 100 : 1;
|
|
21
|
+
}
|
|
22
|
+
return [
|
|
23
|
+
r,
|
|
24
|
+
g,
|
|
25
|
+
b,
|
|
26
|
+
a
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.hexToRgb = hexToRgb;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function hexToRgb(hex) {
|
|
2
|
+
if (hex.startsWith('#')) {
|
|
3
|
+
hex = hex.slice(1);
|
|
4
|
+
}
|
|
5
|
+
let r;
|
|
6
|
+
let g;
|
|
7
|
+
let b;
|
|
8
|
+
let a;
|
|
9
|
+
if (hex.length === 3 || hex.length === 4) {
|
|
10
|
+
r = parseInt(hex[0] + hex[0], 16);
|
|
11
|
+
g = parseInt(hex[1] + hex[1], 16);
|
|
12
|
+
b = parseInt(hex[2] + hex[2], 16);
|
|
13
|
+
a = hex.length === 4 ? Math.round(parseInt(hex[3] + hex[3], 16) / 255 * 100) / 100 : 1;
|
|
14
|
+
} else if (hex.length === 6 || hex.length === 8) {
|
|
15
|
+
r = parseInt(hex.slice(0, 2), 16);
|
|
16
|
+
g = parseInt(hex.slice(2, 4), 16);
|
|
17
|
+
b = parseInt(hex.slice(4, 6), 16);
|
|
18
|
+
a = hex.length === 8 ? Math.round(parseInt(hex.slice(6, 8), 16) / 255 * 100) / 100 : 1;
|
|
19
|
+
}
|
|
20
|
+
return [
|
|
21
|
+
r,
|
|
22
|
+
g,
|
|
23
|
+
b,
|
|
24
|
+
a
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { hexToRgb };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var getType = require('./get-type.cjs');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
|
|
7
|
+
*
|
|
8
|
+
* @param {*} payload
|
|
9
|
+
* @returns {payload is PlainObject}
|
|
10
|
+
*/ function isPlainObject(payload) {
|
|
11
|
+
if (getType.getType(payload) !== 'Object') return false;
|
|
12
|
+
return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.isPlainObject = isPlainObject;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getType } from './get-type.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
|
|
5
|
+
*
|
|
6
|
+
* @param {*} payload
|
|
7
|
+
* @returns {payload is PlainObject}
|
|
8
|
+
*/ function isPlainObject(payload) {
|
|
9
|
+
if (getType(payload) !== 'Object') return false;
|
|
10
|
+
return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { isPlainObject };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var getType = require('./get-type.cjs');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns whether the payload is a Symbol
|
|
7
|
+
*
|
|
8
|
+
* @param {*} payload
|
|
9
|
+
* @returns {payload is symbol}
|
|
10
|
+
*/ function isSymbol(payload) {
|
|
11
|
+
return getType.getType(payload) === 'Symbol';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exports.isSymbol = isSymbol;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getType } from './get-type.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns whether the payload is a Symbol
|
|
5
|
+
*
|
|
6
|
+
* @param {*} payload
|
|
7
|
+
* @returns {payload is symbol}
|
|
8
|
+
*/ function isSymbol(payload) {
|
|
9
|
+
return getType(payload) === 'Symbol';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { isSymbol };
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@master/css","scripts":{"build":"techor
|
|
1
|
+
{"name":"@master/css","type":"module","scripts":{"build":"techor build \"src/**/*.ts\"","dev":"pnpm build --watch","test":"jest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"The CSS language and framework for rapidly building modern and high-performance websites","author":"Aoyue Design LLC.","funding":"https://css.master.co/docs/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/css"},"keywords":["style","styles","html","variants","virtual","virtual-css","utility","css","ui","lightweight","class","webpack","plugin","integration","vite","parcel","build-tools","mastercss"],"sideEffects":false,"main":"./dist/index.cjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"bin":"./dist/bin/index.mjs","files":["dist"],"publishConfig":{"access":"public"},"dependencies":{"@master/normal.css":"^2.0.0-rc.16","@techor/extend":"^3.0.11"},"devDependencies":{"css-shared":"^2.0.0-rc.16","csstype":"^3.1.2"},"version":"2.0.0-rc.16"}
|
package/dist/bin/index.bundle.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var r=require("child_process");try{(0,r.execSync)("mastercss",{stdio:"inherit"})}catch{console.error('Command not found. Try installing "@master/css-cli" first.')}
|