@twin.org/nameof 0.0.2-next.9 → 0.0.2
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/README.md +1 -3
- package/dist/es/index.js +33 -0
- package/dist/es/index.js.map +1 -0
- package/dist/types/index.d.ts +14 -0
- package/docs/changelog.md +893 -43
- package/docs/examples.md +34 -48
- package/docs/reference/functions/nameofCamelCase.md +31 -0
- package/docs/reference/functions/nameofKebabCase.md +31 -0
- package/docs/reference/index.md +2 -0
- package/package.json +19 -10
- package/dist/cjs/index.cjs +0 -16
- package/dist/esm/index.mjs +0 -14
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# TWIN Nameof
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
This package is used in conjunction with the `@twin.org/nameof-transformer` package, without using the transformer for compilation you will end up with an error string embedded in your code instead of the runtime name you are expecting.
|
|
3
|
+
This package is part of the framework workspace and provides the definitions for the methods which are processed by the nameof-transformer to support consistent development workflows across the ecosystem.
|
|
6
4
|
|
|
7
5
|
## Installation
|
|
8
6
|
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* Placeholder method which substitutes the type name as a string at runtime.
|
|
5
|
+
* @param property The property to get the name of.
|
|
6
|
+
* @param replaceParent Optional object name to replace the top level object of a property path.
|
|
7
|
+
* @returns The type name as a string.
|
|
8
|
+
*/
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
+
export function nameof(property, replaceParent) {
|
|
11
|
+
return "@twin.org/nameof-transformer is not in the build pipeline, you need to use a compiler that supports transformer plugins.";
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Placeholder method which substitutes the type name as a string at runtime.
|
|
15
|
+
* @param property The property to get the name of.
|
|
16
|
+
* @param replaceParent Optional object name to replace the top level object of a property path.
|
|
17
|
+
* @returns The type name as a string.
|
|
18
|
+
*/
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
|
+
export function nameofKebabCase(property, replaceParent) {
|
|
21
|
+
return "@twin.org/nameof-transformer is not in the build pipeline, you need to use a compiler that supports transformer plugins.";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Placeholder method which substitutes the type name as a string at runtime.
|
|
25
|
+
* @param property The property to get the name of.
|
|
26
|
+
* @param replaceParent Optional object name to replace the top level object of a property path.
|
|
27
|
+
* @returns The type name as a string.
|
|
28
|
+
*/
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
|
+
export function nameofCamelCase(property, replaceParent) {
|
|
31
|
+
return "@twin.org/nameof-transformer is not in the build pipeline, you need to use a compiler that supports transformer plugins.";
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;;;;GAKG;AACH,6DAA6D;AAC7D,MAAM,UAAU,MAAM,CAAI,QAAkB,EAAE,aAAsB;IACnE,OAAO,0HAA0H,CAAC;AACnI,CAAC;AAED;;;;;GAKG;AACH,6DAA6D;AAC7D,MAAM,UAAU,eAAe,CAAI,QAAkB,EAAE,aAAsB;IAC5E,OAAO,0HAA0H,CAAC;AACnI,CAAC;AAED;;;;;GAKG;AACH,6DAA6D;AAC7D,MAAM,UAAU,eAAe,CAAI,QAAkB,EAAE,aAAsB;IAC5E,OAAO,0HAA0H,CAAC;AACnI,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Placeholder method which substitutes the type name as a string at runtime.\n * @param property The property to get the name of.\n * @param replaceParent Optional object name to replace the top level object of a property path.\n * @returns The type name as a string.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function nameof<T>(property?: unknown, replaceParent?: string): string {\n\treturn \"@twin.org/nameof-transformer is not in the build pipeline, you need to use a compiler that supports transformer plugins.\";\n}\n\n/**\n * Placeholder method which substitutes the type name as a string at runtime.\n * @param property The property to get the name of.\n * @param replaceParent Optional object name to replace the top level object of a property path.\n * @returns The type name as a string.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function nameofKebabCase<T>(property?: unknown, replaceParent?: string): string {\n\treturn \"@twin.org/nameof-transformer is not in the build pipeline, you need to use a compiler that supports transformer plugins.\";\n}\n\n/**\n * Placeholder method which substitutes the type name as a string at runtime.\n * @param property The property to get the name of.\n * @param replaceParent Optional object name to replace the top level object of a property path.\n * @returns The type name as a string.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function nameofCamelCase<T>(property?: unknown, replaceParent?: string): string {\n\treturn \"@twin.org/nameof-transformer is not in the build pipeline, you need to use a compiler that supports transformer plugins.\";\n}\n"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,3 +5,17 @@
|
|
|
5
5
|
* @returns The type name as a string.
|
|
6
6
|
*/
|
|
7
7
|
export declare function nameof<T>(property?: unknown, replaceParent?: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Placeholder method which substitutes the type name as a string at runtime.
|
|
10
|
+
* @param property The property to get the name of.
|
|
11
|
+
* @param replaceParent Optional object name to replace the top level object of a property path.
|
|
12
|
+
* @returns The type name as a string.
|
|
13
|
+
*/
|
|
14
|
+
export declare function nameofKebabCase<T>(property?: unknown, replaceParent?: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Placeholder method which substitutes the type name as a string at runtime.
|
|
17
|
+
* @param property The property to get the name of.
|
|
18
|
+
* @param replaceParent Optional object name to replace the top level object of a property path.
|
|
19
|
+
* @returns The type name as a string.
|
|
20
|
+
*/
|
|
21
|
+
export declare function nameofCamelCase<T>(property?: unknown, replaceParent?: string): string;
|