@contember/utilities 1.3.0-alpha.15 → 1.3.0-alpha.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/development/class-name/flatClassNameList.cjs +3 -0
- package/dist/development/class-name/flatClassNameList.cjs.map +1 -1
- package/dist/development/class-name/flatClassNameList.js +3 -0
- package/dist/development/class-name/flatClassNameList.js.map +1 -1
- package/dist/development/deprecate/deprecate.cjs +11 -0
- package/dist/development/deprecate/deprecate.cjs.map +1 -1
- package/dist/development/deprecate/deprecate.js +11 -0
- package/dist/development/deprecate/deprecate.js.map +1 -1
- package/package.json +2 -2
|
@@ -9,6 +9,9 @@ function flatClassNameList(className) {
|
|
|
9
9
|
} else if (Array.isArray(className)) {
|
|
10
10
|
return className.flatMap(flatClassNameList);
|
|
11
11
|
} else {
|
|
12
|
+
{
|
|
13
|
+
console.error(`Unexpected className: ${JSON.stringify(className)}`);
|
|
14
|
+
}
|
|
12
15
|
assertNever.assertNever();
|
|
13
16
|
}
|
|
14
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatClassNameList.cjs","sources":["../../../src/class-name/flatClassNameList.ts"],"sourcesContent":["import { assertNever } from '../assert-types'\nimport { NestedClassName } from './types'\n\nexport function flatClassNameList(className: NestedClassName): string[] {\n\tif (!className) {\n\t\treturn []\n\t} else if (typeof className === 'string') {\n\t\treturn className.split(' ').filter(Boolean)\n\t} else if (Array.isArray(className)) {\n\t\treturn className.flatMap(flatClassNameList)\n\t} else {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconsole.error(`Unexpected className: ${JSON.stringify(className)}`)\n\t\t}\n\n\t\tassertNever(className)\n\t}\n}\n"],"names":["assertNever"],"mappings":";;;AAGO,SAAS,kBAAkB,WAAsC;AACvE,MAAI,CAAC,WAAW;AACf,WAAO;EAAC,WACE,OAAO,cAAc,UAAU;AACzC,WAAO,UAAU,MAAM,GAAG,EAAE,OAAO,OAAO;AAAA,EAChC,WAAA,MAAM,QAAQ,SAAS,GAAG;AAC7B,WAAA,UAAU,QAAQ,iBAAiB;AAAA,EAAA,OACpC;
|
|
1
|
+
{"version":3,"file":"flatClassNameList.cjs","sources":["../../../src/class-name/flatClassNameList.ts"],"sourcesContent":["import { assertNever } from '../assert-types'\nimport { NestedClassName } from './types'\n\nexport function flatClassNameList(className: NestedClassName): string[] {\n\tif (!className) {\n\t\treturn []\n\t} else if (typeof className === 'string') {\n\t\treturn className.split(' ').filter(Boolean)\n\t} else if (Array.isArray(className)) {\n\t\treturn className.flatMap(flatClassNameList)\n\t} else {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconsole.error(`Unexpected className: ${JSON.stringify(className)}`)\n\t\t}\n\n\t\tassertNever(className)\n\t}\n}\n"],"names":["assertNever"],"mappings":";;;AAGO,SAAS,kBAAkB,WAAsC;AACvE,MAAI,CAAC,WAAW;AACf,WAAO;EAAC,WACE,OAAO,cAAc,UAAU;AACzC,WAAO,UAAU,MAAM,GAAG,EAAE,OAAO,OAAO;AAAA,EAChC,WAAA,MAAM,QAAQ,SAAS,GAAG;AAC7B,WAAA,UAAU,QAAQ,iBAAiB;AAAA,EAAA,OACpC;AACmB;AACxB,cAAQ,MAAM,yBAAyB,KAAK,UAAU,SAAS,CAAC,EAAE;AAAA,IACnE;AAEAA,gBAAAA,YAAqB;AAAA,EACtB;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatClassNameList.js","sources":["../../../src/class-name/flatClassNameList.ts"],"sourcesContent":["import { assertNever } from '../assert-types'\nimport { NestedClassName } from './types'\n\nexport function flatClassNameList(className: NestedClassName): string[] {\n\tif (!className) {\n\t\treturn []\n\t} else if (typeof className === 'string') {\n\t\treturn className.split(' ').filter(Boolean)\n\t} else if (Array.isArray(className)) {\n\t\treturn className.flatMap(flatClassNameList)\n\t} else {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconsole.error(`Unexpected className: ${JSON.stringify(className)}`)\n\t\t}\n\n\t\tassertNever(className)\n\t}\n}\n"],"names":[],"mappings":";AAGO,SAAS,kBAAkB,WAAsC;AACvE,MAAI,CAAC,WAAW;AACf,WAAO;EAAC,WACE,OAAO,cAAc,UAAU;AACzC,WAAO,UAAU,MAAM,GAAG,EAAE,OAAO,OAAO;AAAA,EAChC,WAAA,MAAM,QAAQ,SAAS,GAAG;AAC7B,WAAA,UAAU,QAAQ,iBAAiB;AAAA,EAAA,OACpC;
|
|
1
|
+
{"version":3,"file":"flatClassNameList.js","sources":["../../../src/class-name/flatClassNameList.ts"],"sourcesContent":["import { assertNever } from '../assert-types'\nimport { NestedClassName } from './types'\n\nexport function flatClassNameList(className: NestedClassName): string[] {\n\tif (!className) {\n\t\treturn []\n\t} else if (typeof className === 'string') {\n\t\treturn className.split(' ').filter(Boolean)\n\t} else if (Array.isArray(className)) {\n\t\treturn className.flatMap(flatClassNameList)\n\t} else {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconsole.error(`Unexpected className: ${JSON.stringify(className)}`)\n\t\t}\n\n\t\tassertNever(className)\n\t}\n}\n"],"names":[],"mappings":";AAGO,SAAS,kBAAkB,WAAsC;AACvE,MAAI,CAAC,WAAW;AACf,WAAO;EAAC,WACE,OAAO,cAAc,UAAU;AACzC,WAAO,UAAU,MAAM,GAAG,EAAE,OAAO,OAAO;AAAA,EAChC,WAAA,MAAM,QAAQ,SAAS,GAAG;AAC7B,WAAA,UAAU,QAAQ,iBAAiB;AAAA,EAAA,OACpC;AACmB;AACxB,cAAQ,MAAM,yBAAyB,KAAK,UAAU,SAAS,CAAC,EAAE;AAAA,IACnE;AAEA,gBAAqB;AAAA,EACtB;AACD;"}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
var define_import_meta_env_default = { BASE_URL: "/", MODE: "development", DEV: true, PROD: false, SSR: false };
|
|
3
4
|
function deprecate(removal, condition, deprecated, replacement) {
|
|
5
|
+
if (condition === true) {
|
|
6
|
+
{
|
|
7
|
+
const shouldThrow = Boolean(define_import_meta_env_default.VITE_CONTEMBER_ADMIN_STRICT_DEPRECATIONS);
|
|
8
|
+
if (shouldThrow) {
|
|
9
|
+
throw new Error(`Support for ${deprecated} was planned to be removed in the ${removal} release.${replacement ? ` Replace it with ${replacement} instead.` : "Remove it."}`);
|
|
10
|
+
} else {
|
|
11
|
+
console.warn(`Use of ${deprecated} is deprecated and might be removed in the next release.${replacement ? ` Use ${replacement} instead.` : " There is no replacement."}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
4
15
|
}
|
|
5
16
|
exports.deprecate = deprecate;
|
|
6
17
|
//# sourceMappingURL=deprecate.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecate.cjs","sources":["../../../src/deprecate/deprecate.ts"],"sourcesContent":["import { SemverString } from './types'\n\n/**\n * Logs a deprecation warning if the assertion is `false`.\n * @internal\n *\n * @param removal - Version when the deprecated feature will be removed\n * @param condition - Condition under which the deprecation warning will be logged\n * @param deprecated - Name of the deprecated feature\n * @param replacement - Name of the feature that replaces the deprecated feature\n *\n * @example\n * ```ts\n * const { visible } = props\n * deprecate(visible !== 'default', '1.3.0', '\"default\"', '\"hidden\"')\n * // Logs: Use of \"default\" is deprecated and might be removed in the next release. Use \"hidden\" instead.\n * ```\n */\nexport function deprecate(removal: SemverString, condition: boolean, deprecated: string, replacement: string | null): void {\n\tif (condition === true) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconst shouldThrow = Boolean(import.meta.env.VITE_CONTEMBER_ADMIN_STRICT_DEPRECATIONS)\n\n\t\t\tif (shouldThrow) {\n\t\t\t\tthrow new Error(`Support for ${deprecated} was planned to be removed in the ${removal} release.${replacement ? ` Replace it with ${replacement} instead.` : 'Remove it.'}`)\n\t\t\t} else {\n\t\t\t\tconsole.warn(`Use of ${deprecated} is deprecated and might be removed in the next release.${replacement ? ` Use ${replacement} instead.` : ' There is no replacement.'}`)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAkBO,
|
|
1
|
+
{"version":3,"file":"deprecate.cjs","sources":["../../../src/deprecate/deprecate.ts"],"sourcesContent":["import { SemverString } from './types'\n\n/**\n * Logs a deprecation warning if the assertion is `false`.\n * @internal\n *\n * @param removal - Version when the deprecated feature will be removed\n * @param condition - Condition under which the deprecation warning will be logged\n * @param deprecated - Name of the deprecated feature\n * @param replacement - Name of the feature that replaces the deprecated feature\n *\n * @example\n * ```ts\n * const { visible } = props\n * deprecate(visible !== 'default', '1.3.0', '\"default\"', '\"hidden\"')\n * // Logs: Use of \"default\" is deprecated and might be removed in the next release. Use \"hidden\" instead.\n * ```\n */\nexport function deprecate(removal: SemverString, condition: boolean, deprecated: string, replacement: string | null): void {\n\tif (condition === true) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconst shouldThrow = Boolean(import.meta.env.VITE_CONTEMBER_ADMIN_STRICT_DEPRECATIONS)\n\n\t\t\tif (shouldThrow) {\n\t\t\t\tthrow new Error(`Support for ${deprecated} was planned to be removed in the ${removal} release.${replacement ? ` Replace it with ${replacement} instead.` : 'Remove it.'}`)\n\t\t\t} else {\n\t\t\t\tconsole.warn(`Use of ${deprecated} is deprecated and might be removed in the next release.${replacement ? ` Use ${replacement} instead.` : ' There is no replacement.'}`)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAkBO,IAAA,iCAAA,EAAA,UAAA,KAAmB,MAAA,eAA2C,KAAA,MAAA,MAAsD,OAAA,KAAA,MAAA;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
var define_import_meta_env_default = { BASE_URL: "/", MODE: "development", DEV: true, PROD: false, SSR: false };
|
|
1
2
|
function deprecate(removal, condition, deprecated, replacement) {
|
|
3
|
+
if (condition === true) {
|
|
4
|
+
{
|
|
5
|
+
const shouldThrow = Boolean(define_import_meta_env_default.VITE_CONTEMBER_ADMIN_STRICT_DEPRECATIONS);
|
|
6
|
+
if (shouldThrow) {
|
|
7
|
+
throw new Error(`Support for ${deprecated} was planned to be removed in the ${removal} release.${replacement ? ` Replace it with ${replacement} instead.` : "Remove it."}`);
|
|
8
|
+
} else {
|
|
9
|
+
console.warn(`Use of ${deprecated} is deprecated and might be removed in the next release.${replacement ? ` Use ${replacement} instead.` : " There is no replacement."}`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
2
13
|
}
|
|
3
14
|
export {
|
|
4
15
|
deprecate
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecate.js","sources":["../../../src/deprecate/deprecate.ts"],"sourcesContent":["import { SemverString } from './types'\n\n/**\n * Logs a deprecation warning if the assertion is `false`.\n * @internal\n *\n * @param removal - Version when the deprecated feature will be removed\n * @param condition - Condition under which the deprecation warning will be logged\n * @param deprecated - Name of the deprecated feature\n * @param replacement - Name of the feature that replaces the deprecated feature\n *\n * @example\n * ```ts\n * const { visible } = props\n * deprecate(visible !== 'default', '1.3.0', '\"default\"', '\"hidden\"')\n * // Logs: Use of \"default\" is deprecated and might be removed in the next release. Use \"hidden\" instead.\n * ```\n */\nexport function deprecate(removal: SemverString, condition: boolean, deprecated: string, replacement: string | null): void {\n\tif (condition === true) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconst shouldThrow = Boolean(import.meta.env.VITE_CONTEMBER_ADMIN_STRICT_DEPRECATIONS)\n\n\t\t\tif (shouldThrow) {\n\t\t\t\tthrow new Error(`Support for ${deprecated} was planned to be removed in the ${removal} release.${replacement ? ` Replace it with ${replacement} instead.` : 'Remove it.'}`)\n\t\t\t} else {\n\t\t\t\tconsole.warn(`Use of ${deprecated} is deprecated and might be removed in the next release.${replacement ? ` Use ${replacement} instead.` : ' There is no replacement.'}`)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAkBO,
|
|
1
|
+
{"version":3,"file":"deprecate.js","sources":["../../../src/deprecate/deprecate.ts"],"sourcesContent":["import { SemverString } from './types'\n\n/**\n * Logs a deprecation warning if the assertion is `false`.\n * @internal\n *\n * @param removal - Version when the deprecated feature will be removed\n * @param condition - Condition under which the deprecation warning will be logged\n * @param deprecated - Name of the deprecated feature\n * @param replacement - Name of the feature that replaces the deprecated feature\n *\n * @example\n * ```ts\n * const { visible } = props\n * deprecate(visible !== 'default', '1.3.0', '\"default\"', '\"hidden\"')\n * // Logs: Use of \"default\" is deprecated and might be removed in the next release. Use \"hidden\" instead.\n * ```\n */\nexport function deprecate(removal: SemverString, condition: boolean, deprecated: string, replacement: string | null): void {\n\tif (condition === true) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconst shouldThrow = Boolean(import.meta.env.VITE_CONTEMBER_ADMIN_STRICT_DEPRECATIONS)\n\n\t\t\tif (shouldThrow) {\n\t\t\t\tthrow new Error(`Support for ${deprecated} was planned to be removed in the ${removal} release.${replacement ? ` Replace it with ${replacement} instead.` : 'Remove it.'}`)\n\t\t\t} else {\n\t\t\t\tconsole.warn(`Use of ${deprecated} is deprecated and might be removed in the next release.${replacement ? ` Use ${replacement} instead.` : ' There is no replacement.'}`)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAkBO,IAAA,iCAAA,EAAA,UAAA,KAAmB,MAAA,eAA2C,KAAA,MAAA,MAAsD,OAAA,KAAA,MAAA;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/utilities",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "1.3.0-alpha.
|
|
4
|
+
"version": "1.3.0-alpha.16",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/production/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"typings": "./dist/types/index.d.ts",
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "yarn build:js:dev && yarn build:js:prod",
|
|
31
|
-
"build:js:dev": "vite build --mode development",
|
|
31
|
+
"build:js:dev": "NODE_ENV=development vite build --mode development",
|
|
32
32
|
"build:js:prod": "vite build --mode production",
|
|
33
33
|
"ae:build": "api-extractor run --local",
|
|
34
34
|
"ae:test": "api-extractor run",
|