@cap-js/ord 1.0.0 → 1.0.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/cds-plugin.js ADDED
@@ -0,0 +1,17 @@
1
+ require("./lib/plugin");
2
+ const cds = require("@sap/cds");
3
+
4
+ function _lazyRegisterCompileTarget() {
5
+ const ord = require("./lib/index").ord;
6
+ Object.defineProperty(this, "ord", { ord });
7
+ return ord;
8
+ }
9
+
10
+ const registerORDCompileTarget = () => {
11
+ Object.defineProperty(cds.compile.to, "ord", {
12
+ get: _lazyRegisterCompileTarget,
13
+ configurable: true,
14
+ });
15
+ };
16
+
17
+ registerORDCompileTarget();
package/lib/defaults.js CHANGED
@@ -1,6 +1,8 @@
1
1
 
2
2
  const regexWithRemoval = (name) => {
3
- return name.replace(/[^a-zA-Z0-9]/g,'');
3
+ if(name){
4
+ return name.replace(/[^a-zA-Z0-9]/g,'');
5
+ }
4
6
  }
5
7
  const regexWithUnderScore = (name) => {
6
8
  return regexWithRemoval(name.charAt(0)) + name.slice(1, name.length).replace(/[^a-zA-Z0-9]/g,'_');
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@cap-js/ord",
3
- "version": "1.0.0",
4
- "description": "CAP Tool for generating ORD information",
3
+ "version": "1.0.1",
4
+ "description": "CAP Plugin for generating ORD document.",
5
5
  "repository": "cap-js/ord",
6
6
  "author": "SAP SE (https://www.sap.com)",
7
7
  "homepage": "https://cap.cloud.sap/",
8
8
  "license": "SEE LICENSE IN LICENSE",
9
- "main": "./cds-plugin.js",
9
+ "main": "cds-plugin.js",
10
10
  "files": [
11
11
  "lib",
12
12
  "data",
@@ -23,4 +23,4 @@
23
23
  "@cap-js/asyncapi": "^1.0.0",
24
24
  "@cap-js/openapi": "^1.0.2"
25
25
  }
26
- }
26
+ }