@accordproject/template-engine 2.0.3 → 2.2.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.
Files changed (127) hide show
  1. package/dist/index.d.ts +123 -2
  2. package/dist/index.js +1437 -21
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +1414 -0
  5. package/dist/index.mjs.map +1 -0
  6. package/dist/runtime.tgz +0 -0
  7. package/package.json +7 -3
  8. package/dist/Common.d.ts +0 -20
  9. package/dist/Common.js +0 -55
  10. package/dist/Common.js.map +0 -1
  11. package/dist/TemplateMarkInterpreter.d.ts +0 -34
  12. package/dist/TemplateMarkInterpreter.js +0 -401
  13. package/dist/TemplateMarkInterpreter.js.map +0 -1
  14. package/dist/TemplateMarkToJavaScriptCompiler.d.ts +0 -19
  15. package/dist/TemplateMarkToJavaScriptCompiler.js +0 -96
  16. package/dist/TemplateMarkToJavaScriptCompiler.js.map +0 -1
  17. package/dist/TemplateMarkToTypeScriptCompiler.d.ts +0 -77
  18. package/dist/TemplateMarkToTypeScriptCompiler.js +0 -311
  19. package/dist/TemplateMarkToTypeScriptCompiler.js.map +0 -1
  20. package/dist/TypeScriptCompilationContext.d.ts +0 -15
  21. package/dist/TypeScriptCompilationContext.js +0 -57
  22. package/dist/TypeScriptCompilationContext.js.map +0 -1
  23. package/dist/TypeScriptRuntime.d.ts +0 -14
  24. package/dist/TypeScriptRuntime.js +0 -79
  25. package/dist/TypeScriptRuntime.js.map +0 -1
  26. package/dist/TypeScriptToJavaScriptCompiler.d.ts +0 -14
  27. package/dist/TypeScriptToJavaScriptCompiler.js +0 -59
  28. package/dist/TypeScriptToJavaScriptCompiler.js.map +0 -1
  29. package/dist/compilers/Clause.d.ts +0 -14
  30. package/dist/compilers/Clause.js +0 -43
  31. package/dist/compilers/Clause.js.map +0 -1
  32. package/dist/compilers/Common.d.ts +0 -66
  33. package/dist/compilers/Common.js +0 -180
  34. package/dist/compilers/Common.js.map +0 -1
  35. package/dist/compilers/Conditional.d.ts +0 -12
  36. package/dist/compilers/Conditional.js +0 -36
  37. package/dist/compilers/Conditional.js.map +0 -1
  38. package/dist/compilers/ContractDefinition.d.ts +0 -8
  39. package/dist/compilers/ContractDefinition.js +0 -33
  40. package/dist/compilers/ContractDefinition.js.map +0 -1
  41. package/dist/compilers/EnumVariable.d.ts +0 -8
  42. package/dist/compilers/EnumVariable.js +0 -28
  43. package/dist/compilers/EnumVariable.js.map +0 -1
  44. package/dist/compilers/FormattedVariable.d.ts +0 -8
  45. package/dist/compilers/FormattedVariable.js +0 -29
  46. package/dist/compilers/FormattedVariable.js.map +0 -1
  47. package/dist/compilers/Formula.d.ts +0 -8
  48. package/dist/compilers/Formula.js +0 -24
  49. package/dist/compilers/Formula.js.map +0 -1
  50. package/dist/compilers/Join.d.ts +0 -8
  51. package/dist/compilers/Join.js +0 -23
  52. package/dist/compilers/Join.js.map +0 -1
  53. package/dist/compilers/ListBlock.d.ts +0 -11
  54. package/dist/compilers/ListBlock.js +0 -39
  55. package/dist/compilers/ListBlock.js.map +0 -1
  56. package/dist/compilers/NodeCompilers.d.ts +0 -7
  57. package/dist/compilers/NodeCompilers.js +0 -89
  58. package/dist/compilers/NodeCompilers.js.map +0 -1
  59. package/dist/compilers/Optional.d.ts +0 -11
  60. package/dist/compilers/Optional.js +0 -48
  61. package/dist/compilers/Optional.js.map +0 -1
  62. package/dist/compilers/Variable.d.ts +0 -8
  63. package/dist/compilers/Variable.js +0 -28
  64. package/dist/compilers/Variable.js.map +0 -1
  65. package/dist/compilers/With.d.ts +0 -10
  66. package/dist/compilers/With.js +0 -23
  67. package/dist/compilers/With.js.map +0 -1
  68. package/dist/drafting/Boolean/index.d.ts +0 -6
  69. package/dist/drafting/Boolean/index.js +0 -30
  70. package/dist/drafting/Boolean/index.js.map +0 -1
  71. package/dist/drafting/DateTime/index.d.ts +0 -7
  72. package/dist/drafting/DateTime/index.js +0 -33
  73. package/dist/drafting/DateTime/index.js.map +0 -1
  74. package/dist/drafting/Double/format.d.ts +0 -13
  75. package/dist/drafting/Double/format.js +0 -55
  76. package/dist/drafting/Double/format.js.map +0 -1
  77. package/dist/drafting/Double/index.d.ts +0 -7
  78. package/dist/drafting/Double/index.js +0 -33
  79. package/dist/drafting/Double/index.js.map +0 -1
  80. package/dist/drafting/Integer/format.d.ts +0 -13
  81. package/dist/drafting/Integer/format.js +0 -45
  82. package/dist/drafting/Integer/format.js.map +0 -1
  83. package/dist/drafting/Integer/index.d.ts +0 -7
  84. package/dist/drafting/Integer/index.js +0 -33
  85. package/dist/drafting/Integer/index.js.map +0 -1
  86. package/dist/drafting/Long/index.d.ts +0 -7
  87. package/dist/drafting/Long/index.js +0 -33
  88. package/dist/drafting/Long/index.js.map +0 -1
  89. package/dist/drafting/MonetaryAmount/currencycode.d.ts +0 -35
  90. package/dist/drafting/MonetaryAmount/currencycode.js +0 -53
  91. package/dist/drafting/MonetaryAmount/currencycode.js.map +0 -1
  92. package/dist/drafting/MonetaryAmount/index.d.ts +0 -12
  93. package/dist/drafting/MonetaryAmount/index.js +0 -67
  94. package/dist/drafting/MonetaryAmount/index.js.map +0 -1
  95. package/dist/drafting/String/index.d.ts +0 -6
  96. package/dist/drafting/String/index.js +0 -25
  97. package/dist/drafting/String/index.js.map +0 -1
  98. package/dist/drafting/index.d.ts +0 -1
  99. package/dist/drafting/index.js +0 -40
  100. package/dist/drafting/index.js.map +0 -1
  101. package/dist/model-gen/concerto.d.ts +0 -13
  102. package/dist/model-gen/concerto.js +0 -5
  103. package/dist/model-gen/concerto.js.map +0 -1
  104. package/dist/model-gen/concerto.metamodel@1.0.0.d.ts +0 -196
  105. package/dist/model-gen/concerto.metamodel@1.0.0.js +0 -5
  106. package/dist/model-gen/concerto.metamodel@1.0.0.js.map +0 -1
  107. package/dist/model-gen/concerto@1.0.0.d.ts +0 -19
  108. package/dist/model-gen/concerto@1.0.0.js +0 -5
  109. package/dist/model-gen/concerto@1.0.0.js.map +0 -1
  110. package/dist/model-gen/org.accordproject.ciceromark@0.6.0.d.ts +0 -49
  111. package/dist/model-gen/org.accordproject.ciceromark@0.6.0.js +0 -5
  112. package/dist/model-gen/org.accordproject.ciceromark@0.6.0.js.map +0 -1
  113. package/dist/model-gen/org.accordproject.commonmark@0.5.0.d.ts +0 -89
  114. package/dist/model-gen/org.accordproject.commonmark@0.5.0.js +0 -5
  115. package/dist/model-gen/org.accordproject.commonmark@0.5.0.js.map +0 -1
  116. package/dist/model-gen/org.accordproject.templatemark@0.5.0.d.ts +0 -76
  117. package/dist/model-gen/org.accordproject.templatemark@0.5.0.js +0 -12
  118. package/dist/model-gen/org.accordproject.templatemark@0.5.0.js.map +0 -1
  119. package/dist/runtime/declarations.d.ts +0 -2
  120. package/dist/runtime/declarations.js +0 -21
  121. package/dist/runtime/declarations.js.map +0 -1
  122. package/dist/runtime/runtime.d.ts +0 -1
  123. package/dist/runtime/runtime.js +0 -20
  124. package/dist/runtime/runtime.js.map +0 -1
  125. package/dist/utils.d.ts +0 -5
  126. package/dist/utils.js +0 -43
  127. package/dist/utils.js.map +0 -1
@@ -1,89 +0,0 @@
1
- "use strict";
2
- /*
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.getCompiler = void 0;
17
- const markdown_common_1 = require("@accordproject/markdown-common");
18
- const Clause_1 = require("./Clause");
19
- const Common_1 = require("./Common");
20
- const Conditional_1 = require("./Conditional");
21
- const ContractDefinition_1 = require("./ContractDefinition");
22
- const FormattedVariable_1 = require("./FormattedVariable");
23
- const Formula_1 = require("./Formula");
24
- const Join_1 = require("./Join");
25
- const ListBlock_1 = require("./ListBlock");
26
- const Optional_1 = require("./Optional");
27
- const Variable_1 = require("./Variable");
28
- const With_1 = require("./With");
29
- const EnumVariable_1 = require("./EnumVariable");
30
- /**
31
- * Registry of node compilers
32
- */
33
- const NODE_COMPILERS = {};
34
- // templatemark
35
- NODE_COMPILERS[ContractDefinition_1.ContractDefinition.TYPE] = new ContractDefinition_1.ContractDefinition();
36
- NODE_COMPILERS[Variable_1.Variable.TYPE] = new Variable_1.Variable();
37
- NODE_COMPILERS[EnumVariable_1.EnumVariable.TYPE] = new EnumVariable_1.EnumVariable();
38
- NODE_COMPILERS[FormattedVariable_1.FormattedVariable.TYPE] = new FormattedVariable_1.FormattedVariable();
39
- NODE_COMPILERS[Formula_1.Formula.TYPE] = new Formula_1.Formula();
40
- NODE_COMPILERS[Conditional_1.Conditional.TYPE] = new Conditional_1.Conditional();
41
- NODE_COMPILERS[Join_1.Join.TYPE] = new Join_1.Join();
42
- NODE_COMPILERS[With_1.With.TYPE] = new With_1.With();
43
- NODE_COMPILERS[Clause_1.Clause.TYPE] = new Clause_1.Clause();
44
- NODE_COMPILERS[Optional_1.Optional.TYPE] = new Optional_1.Optional();
45
- NODE_COMPILERS[ListBlock_1.ListBlock.TYPE] = new ListBlock_1.ListBlock();
46
- // ignored
47
- NODE_COMPILERS[`${markdown_common_1.TemplateMarkModel.NAMESPACE}.Code`] = new Common_1.Ignore();
48
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Document`] = new Common_1.Ignore();
49
- // commonmark
50
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Paragraph`] = new Common_1.PassThrough(false);
51
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Text`] = new Common_1.PassThrough(true);
52
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Attribute`] = new Common_1.PassThrough(false);
53
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.TagInfo`] = new Common_1.PassThrough(false);
54
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.CodeBlock`] = new Common_1.PassThrough(false);
55
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Code`] = new Common_1.PassThrough(false);
56
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.HtmlInline`] = new Common_1.PassThrough(false);
57
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.HtmlBlock`] = new Common_1.PassThrough(false);
58
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Emph`] = new Common_1.PassThrough(false);
59
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Strong`] = new Common_1.PassThrough(false);
60
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.BlockQuote`] = new Common_1.PassThrough(false);
61
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Heading`] = new Common_1.PassThrough(false);
62
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.ThematicBreak`] = new Common_1.PassThrough(false);
63
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Softbreak`] = new Common_1.PassThrough(false);
64
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Linebreak`] = new Common_1.PassThrough(false);
65
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Link`] = new Common_1.PassThrough(false);
66
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Image`] = new Common_1.PassThrough(false);
67
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.List`] = new Common_1.PassThrough(false);
68
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Item`] = new Common_1.PassThrough(false);
69
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Table`] = new Common_1.PassThrough(false);
70
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.TableHead`] = new Common_1.PassThrough(false);
71
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.TableBody`] = new Common_1.PassThrough(false);
72
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.TableRow`] = new Common_1.PassThrough(false);
73
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.TableRow`] = new Common_1.PassThrough(false);
74
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.HeaderCell`] = new Common_1.PassThrough(false);
75
- NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.TableCell`] = new Common_1.PassThrough(false);
76
- /**
77
- * Lookup a node compiler
78
- * @param {string} fqn the Concerto FQN of the node $class
79
- * @returns {INodeCompiler} the compiler to use for this node
80
- */
81
- function getCompiler(fqn) {
82
- const compiler = NODE_COMPILERS[fqn];
83
- if (!compiler) {
84
- throw new Error(`No compiler found for node ${fqn}`);
85
- }
86
- return compiler;
87
- }
88
- exports.getCompiler = getCompiler;
89
- //# sourceMappingURL=NodeCompilers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NodeCompilers.js","sourceRoot":"","sources":["../../src/compilers/NodeCompilers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,oEAAmF;AAEnF,qCAAkC;AAClC,qCAA8D;AAC9D,+CAA4C;AAC5C,6DAA0D;AAC1D,2DAAwD;AACxD,uCAAoC;AACpC,iCAA8B;AAC9B,2CAAwC;AACxC,yCAAsC;AACtC,yCAAsC;AACtC,iCAA8B;AAC9B,iDAA8C;AAE9C;;GAEG;AACH,MAAM,cAAc,GAAgC,EACnD,CAAC;AAEF,eAAe;AACf,cAAc,CAAC,uCAAkB,CAAC,IAAI,CAAC,GAAG,IAAI,uCAAkB,EAAE,CAAC;A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GAAG,EAAE,CAAC,CAAC;KACxD;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC;AAND,kCAMC"}
@@ -1,11 +0,0 @@
1
- import { FileWriter } from '@accordproject/concerto-util';
2
- import { ProcessingFunction } from '../TemplateMarkToTypeScriptCompiler';
3
- import { IOptionalDefinition } from '../model-gen/org.accordproject.templatemark@0.5.0';
4
- import { AbstractComplexCompiler } from './Common';
5
- export declare class Optional extends AbstractComplexCompiler {
6
- static TYPE: string;
7
- constructor();
8
- enter(fw: FileWriter, level: number, templateMarkNode: IOptionalDefinition): void;
9
- generate(fw: FileWriter, level: number, templateMarkNode: IOptionalDefinition, doIt: ProcessingFunction): void;
10
- exit(fw: FileWriter, level: number): void;
11
- }
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Optional = void 0;
4
- const markdown_common_1 = require("@accordproject/markdown-common");
5
- const Common_1 = require("./Common");
6
- class Optional extends Common_1.AbstractComplexCompiler {
7
- constructor() {
8
- super(false);
9
- }
10
- enter(fw, level, templateMarkNode) {
11
- (0, Common_1.writeDebug)(fw, level, templateMarkNode);
12
- (0, Common_1.writeOpenNodeScope)(fw, level);
13
- (0, Common_1.writeOpenDataScope)(fw, level, templateMarkNode.name, true); // allow pushing undefined onto the stack
14
- }
15
- generate(fw, level, templateMarkNode, doIt) {
16
- const clone = (0, Common_1.makeCiceroMark)(templateMarkNode);
17
- delete clone.nodes;
18
- delete clone.whenSome; // replaced below
19
- delete clone.whenNone;
20
- (0, Common_1.writeOpenGenerateScope)(fw, level);
21
- fw.writeLine(level, `const result = ${JSON.stringify(clone)} as ${(0, Common_1.getTypeScriptType)(templateMarkNode.$class)};`);
22
- fw.writeLine(level, 'const hasSome:boolean = !(Runtime.peek($data) === null || Runtime.peek($data) === undefined);');
23
- fw.writeLine(level, '(result as CiceroMark.IOptional).hasSome = hasSome;');
24
- fw.writeLine(level, 'if(hasSome) {');
25
- doIt(fw, level + 1, { $class: `${markdown_common_1.CommonMarkModel.NAMESPACE}.Paragraph`, nodes: templateMarkNode.whenSome });
26
- fw.writeLine(level, '(result as CiceroMark.IOptional).whenSome = $result.nodes[0];');
27
- fw.writeLine(level, '(result as CiceroMark.IOptional).whenNone = $result.nodes[0];'); // HACK - model needs to be updated
28
- fw.writeLine(level, 'return result;');
29
- fw.writeLine(level, '}');
30
- fw.writeLine(level, 'else {');
31
- doIt(fw, level + 1, { $class: `${markdown_common_1.CommonMarkModel.NAMESPACE}.Paragraph`, nodes: templateMarkNode.whenNone });
32
- fw.writeLine(level, '(result as CiceroMark.IOptional).whenNone = $result.nodes[0];');
33
- fw.writeLine(level, '(result as CiceroMark.IOptional).whenSome = $result.nodes[0];'); // HACK - model needs to be updated
34
- fw.writeLine(level, 'return result;');
35
- fw.writeLine(level, '}');
36
- (0, Common_1.writeCloseGenerateScope)(fw, level);
37
- delete templateMarkNode.nodes;
38
- delete templateMarkNode.whenSome; // already handled
39
- delete templateMarkNode.whenNone;
40
- }
41
- exit(fw, level) {
42
- (0, Common_1.writeCloseDataScope)(fw, level);
43
- (0, Common_1.writeCloseNodeScope)(fw, level);
44
- }
45
- }
46
- exports.Optional = Optional;
47
- Optional.TYPE = `${markdown_common_1.TemplateMarkModel.NAMESPACE}.OptionalDefinition`;
48
- //# sourceMappingURL=Optional.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Optional.js","sourceRoot":"","sources":["../../src/compilers/Optional.ts"],"names":[],"mappings":";;;AAcA,oEAAmF;AAInF,qCAAqO;AAGrO,MAAa,QAAS,SAAQ,gCAAuB;IAEjD;QACI,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,EAAa,EAAE,KAAY,EAAC,gBAAoC;QAClE,IAAA,mBAAU,EAAC,EAAE,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC;QACxC,IAAA,2BAAkB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;QAC7B,IAAA,2BAAkB,E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C,CAAC;QAC9B,IAAI,CAAC,EAAE,EAAE,KAAK,GAAC,CAAC,EAAE,EAAC,MAAM,EAAE,GAAG,iCAAe,CAAC,SAAS,YAAY,EAAE,KAAK,EAAE,gBAAgB,CAAC,QAAQ,EAAC,CAAC,CAAC;QACxG,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,+DAA+D,CAAC,CAAC;QACrF,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,+DAA+D,CAAC,CAAC,CAAE,mCAAmC;QAC1H,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;QACtC,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACzB,IAAA,gCAAuB,EAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACnC,OAAO,gBAAgB,CAAC,KAAK,CAAC;QAC9B,OAAQ,gBAAwB,CAAC,QAAQ,CAAC,CAAC,kBAAkB;QAC7D,OAAQ,gBAAwB,CAAC,QAAQ,CAAC;IAC9C,CAAC;IAED,IAAI,CAAC,EAAa,EAAE,KAAY;QAC5B,IAAA,4BAAmB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;QAC9B,IAAA,4BAAmB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;IAClC,CAAC;;AA1CL,4BA2CC;AA1CU,aAAI,GAAG,GAAG,mCAAiB,CAAC,SAAS,qBAAqB,CAAC"}
@@ -1,8 +0,0 @@
1
- import { FileWriter } from '@accordproject/concerto-util';
2
- import { IVariableDefinition } from '../model-gen/org.accordproject.templatemark@0.5.0';
3
- import { AbstractComplexCompiler } from './Common';
4
- export declare class Variable extends AbstractComplexCompiler {
5
- static TYPE: string;
6
- constructor();
7
- generate(fw: FileWriter, level: number, templateMarkNode: IVariableDefinition): void;
8
- }
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Variable = void 0;
4
- const markdown_common_1 = require("@accordproject/markdown-common");
5
- const Common_1 = require("./Common");
6
- class Variable extends Common_1.AbstractComplexCompiler {
7
- constructor() {
8
- super(true);
9
- }
10
- generate(fw, level, templateMarkNode) {
11
- const clone = (0, Common_1.makeCiceroMark)(templateMarkNode);
12
- (0, Common_1.writeOpenGenerateScope)(fw, level);
13
- if (templateMarkNode.name !== 'this') {
14
- (0, Common_1.writeOpenDataScope)(fw, level, templateMarkNode.name);
15
- }
16
- fw.writeLine(level, 'const text = JSON.stringify(Runtime.peek($data)) as string;');
17
- if (templateMarkNode.name !== 'this') {
18
- (0, Common_1.writeCloseDataScope)(fw, level);
19
- }
20
- fw.writeLine(level, `const variable:any = ${JSON.stringify(clone)};`);
21
- fw.writeLine(level, 'variable.value = text;');
22
- fw.writeLine(level, `return variable as ${(0, Common_1.getTypeScriptType)(clone.$class)};`);
23
- (0, Common_1.writeCloseGenerateScope)(fw, level);
24
- }
25
- }
26
- exports.Variable = Variable;
27
- Variable.TYPE = `${markdown_common_1.TemplateMarkModel.NAMESPACE}.VariableDefinition`;
28
- //# sourceMappingURL=Variable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Variable.js","sourceRoot":"","sources":["../../src/compilers/Variable.ts"],"names":[],"mappings":";;;AAcA,oEAAmE;AAGnE,qCAAgL;AAEhL,MAAa,QAAS,SAAQ,gCAAuB;IAEjD;QACI,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IACD,QAAQ,CAAC,EAAa,EAAE,KAAY,EAAE,gBAAoC;QACtE,MAAM,KAAK,GAAG,IAAA,uBAAc,EAAC,gBAAgB,CAAc,CAAC;QAC5D,IAAA,+BAAsB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;QACjC,IAAG,gBAAgB,CAAC,IAAI,KAAK,MAAM,EAAE;YACjC,IAAA,2BAAkB,EAAC,EAAE,EAAC,KAAK,EAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;SACtD;QACD,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,6DAA6D,CAAC,CAAC;QACnF,IAAG,gBAAgB,CAAC,IAAI,KAAK,MAAM,EAAE;YACjC,IAAA,4BAAmB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;SACjC;QACD,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,wBAAwB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC;QAC9C,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,sBAAsB,IAAA,0BAAiB,EAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC9E,IAAA,gCAAuB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;IACtC,CAAC;;AAnBL,4BAoBC;AAnBU,aAAI,GAAG,GAAG,mCAAiB,CAAC,SAAS,qBAAqB,CAAC"}
@@ -1,10 +0,0 @@
1
- import { FileWriter } from '@accordproject/concerto-util';
2
- import { IWithDefinition } from '../model-gen/org.accordproject.templatemark@0.5.0';
3
- import { AbstractComplexCompiler } from './Common';
4
- export declare class With extends AbstractComplexCompiler {
5
- static TYPE: string;
6
- constructor();
7
- enter(fw: FileWriter, level: number, templateMarkNode: IWithDefinition): void;
8
- generate(fw: FileWriter, level: number, templateMarkNode: IWithDefinition): void;
9
- exit(fw: FileWriter, level: number): void;
10
- }
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.With = void 0;
4
- const markdown_common_1 = require("@accordproject/markdown-common");
5
- const Common_1 = require("./Common");
6
- class With extends Common_1.AbstractComplexCompiler {
7
- constructor() {
8
- super(false);
9
- }
10
- enter(fw, level, templateMarkNode) {
11
- (0, Common_1.writeDebug)(fw, level, templateMarkNode);
12
- (0, Common_1.writeOpenDataScope)(fw, level, templateMarkNode.name);
13
- }
14
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
15
- generate(fw, level, templateMarkNode) {
16
- }
17
- exit(fw, level) {
18
- (0, Common_1.writeCloseDataScope)(fw, level);
19
- }
20
- }
21
- exports.With = With;
22
- With.TYPE = `${markdown_common_1.TemplateMarkModel.NAMESPACE}.WithDefinition`;
23
- //# sourceMappingURL=With.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"With.js","sourceRoot":"","sources":["../../src/compilers/With.ts"],"names":[],"mappings":";;;AAcA,oEAAmE;AAEnE,qCAAwG;AAExG,MAAa,IAAK,SAAQ,gCAAuB;IAE7C;QACI,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,EAAa,EAAE,KAAY,EAAC,gBAAgC;QAC9D,IAAA,mBAAU,EAAC,EAAE,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC;QACxC,IAAA,2BAAkB,EAAC,EAAE,EAAC,KAAK,EAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,mGAAmG;IACnG,QAAQ,CAAC,EAAa,EAAE,KAAY,EAAE,gBAAgC;IACtE,CAAC;IAED,IAAI,CAAC,EAAa,EAAE,KAAY;QAC5B,IAAA,4BAAmB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;IAClC,CAAC;;AAjBL,oBAkBC;AAjBU,SAAI,GAAG,GAAG,mCAAiB,CAAC,SAAS,iBAAiB,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Creates a drafter for Boolean
3
- * @param {Boolean} value the Boolean
4
- * @returns {string} the text
5
- */
6
- export default function booleanDrafter(value: boolean): string;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- /*
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- /**
17
- * Creates a drafter for Boolean
18
- * @param {Boolean} value the Boolean
19
- * @returns {string} the text
20
- */
21
- function booleanDrafter(value) {
22
- if (value) {
23
- return 'true';
24
- }
25
- else {
26
- return 'false';
27
- }
28
- }
29
- exports.default = booleanDrafter;
30
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drafting/Boolean/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAEH;;;;GAIG;AACH,SAAwB,cAAc,CAAC,KAAa;IAChD,IAAI,KAAK,EAAE;QACP,OAAO,MAAM,CAAC;KACjB;SAAM;QACH,OAAO,OAAO,CAAC;KAClB;AACL,CAAC;AAND,iCAMC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Creates a drafter for DateTime
3
- * @param {string} value the DateTime
4
- * @param {object} format the the format
5
- * @returns {string} the text
6
- */
7
- export default function dateTimeDrafter(value: string, format: string): string;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- /*
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- */
15
- var __importDefault = (this && this.__importDefault) || function (mod) {
16
- return (mod && mod.__esModule) ? mod : { "default": mod };
17
- };
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- const dayjs_1 = __importDefault(require("dayjs"));
20
- const utc_1 = __importDefault(require("dayjs/plugin/utc"));
21
- dayjs_1.default.extend(utc_1.default);
22
- /**
23
- * Creates a drafter for DateTime
24
- * @param {string} value the DateTime
25
- * @param {object} format the the format
26
- * @returns {string} the text
27
- */
28
- function dateTimeDrafter(value, format) {
29
- const f = format ? format : 'MM/DD/YYYY';
30
- return dayjs_1.default.utc(value).format(f);
31
- }
32
- exports.default = dateTimeDrafter;
33
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drafting/DateTime/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;;;AAEH,kDAA0B;AAC1B,2DAAmC;AACnC,eAAK,CAAC,MAAM,CAAC,aAAG,CAAC,CAAC;AAElB;;;;;GAKG;AACH,SAAwB,eAAe,CAAC,KAAY,EAAC,MAAa;IAC9D,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC;IACzC,OAAO,eAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtC,CAAC;AAHD,kCAGC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Creates a drafter for Double
3
- * @param {number} value - the double
4
- * @returns {string} the text
5
- */
6
- export declare function draftDoubleIEEE(value: number): string;
7
- /**
8
- * Creates a drafter for a formatted Double
9
- * @param {number} value - the Double
10
- * @param {string} format - the format
11
- * @returns {object} the parser
12
- */
13
- export declare function draftDoubleFormat(value: number, format: string): string;
@@ -1,55 +0,0 @@
1
- "use strict";
2
- /*
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.draftDoubleFormat = exports.draftDoubleIEEE = void 0;
17
- /**
18
- * Creates a drafter for Double
19
- * @param {number} value - the double
20
- * @returns {string} the text
21
- */
22
- function draftDoubleIEEE(value) {
23
- if (Math.floor(value) === value) {
24
- return (new Number(value)).toFixed(1); // Make sure there is always decimal point
25
- }
26
- else {
27
- return '' + value;
28
- }
29
- }
30
- exports.draftDoubleIEEE = draftDoubleIEEE;
31
- /**
32
- * Creates a drafter for a formatted Double
33
- * @param {number} value - the Double
34
- * @param {string} format - the format
35
- * @returns {object} the parser
36
- */
37
- function draftDoubleFormat(value, format) {
38
- return format.replace(/0(.)0((.)(0+))?/gi, function (_a, sep1, _b, sep2, digits) {
39
- const len = digits ? digits.length : 0;
40
- const vs = value.toFixed(len);
41
- let res = '';
42
- if (sep2) {
43
- const d = vs.substring(vs.length - len);
44
- res += sep2 + d;
45
- }
46
- let i = vs.substring(0, vs.length - (len === 0 ? 0 : len + 1));
47
- while (i.length > 3) {
48
- res = sep1 + i.substring(i.length - 3) + res;
49
- i = i.substring(0, i.length - 3);
50
- }
51
- return i + res;
52
- });
53
- }
54
- exports.draftDoubleFormat = draftDoubleFormat;
55
- //# sourceMappingURL=format.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/drafting/Double/format.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH;;;;GAIG;AACH,SAAgB,eAAe,CAAC,KAAY;IACxC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,EAAE;QAC7B,OAAO,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,0CAA0C;KACpF;SAAM;QACH,OAAO,EAAE,GAAG,KAAK,CAAC;KACrB;AACL,CAAC;AAND,0CAMC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,KAAY,EAAC,MAAa;IACxD,OAAO,MAAM,CAAC,OAAO,CAAC,mBAAmB,EAAE,UAAS,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,MAAM;QACtE,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,IAAI,IAAI,EAAE;YACN,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;YACxC,GAAG,IAAI,IAAI,GAAG,CAAC,CAAC;SACnB;QACD,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,EAAC,EAAE,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YACjB,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YAC7C,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SACpC;QACD,OAAO,CAAC,GAAG,GAAG,CAAC;IACnB,CAAC,CAAC,CAAC;AACP,CAAC;AAhBD,8CAgBC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Creates a drafter for a double
3
- * @param {number} value - the Double
4
- * @param {string} format - the format
5
- * @returns {string} the text
6
- */
7
- export default function doubleDrafter(value: number, format: string): string;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- /*
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- const format_1 = require("./format");
17
- const format_2 = require("./format");
18
- /**
19
- * Creates a drafter for a double
20
- * @param {number} value - the Double
21
- * @param {string} format - the format
22
- * @returns {string} the text
23
- */
24
- function doubleDrafter(value, format) {
25
- if (format) {
26
- return (0, format_2.draftDoubleFormat)(value, format);
27
- }
28
- else {
29
- return (0, format_1.draftDoubleIEEE)(value);
30
- }
31
- }
32
- exports.default = doubleDrafter;
33
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drafting/Double/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAEH,qCAA2C;AAC3C,qCAA6C;AAE7C;;;;;GAKG;AACH,SAAwB,aAAa,CAAC,KAAY,EAAC,MAAa;IAC5D,IAAI,MAAM,EAAE;QACR,OAAO,IAAA,0BAAiB,EAAC,KAAK,EAAC,MAAM,CAAC,CAAC;KAC1C;SAAM;QACH,OAAO,IAAA,wBAAe,EAAC,KAAK,CAAC,CAAC;KACjC;AACL,CAAC;AAND,gCAMC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Creates a drafter for Integer
3
- * @param {number} value - the integer
4
- * @returns {string} the text
5
- */
6
- export declare function draftInteger(value: number): string;
7
- /**
8
- * Creates a drafter for a formatted Integer
9
- * @param {number} value - the Integer
10
- * @param {string} format - the format
11
- * @returns {object} the parser
12
- */
13
- export declare function draftIntegerFormat(value: number, format: string): string;
@@ -1,45 +0,0 @@
1
- "use strict";
2
- /*
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.draftIntegerFormat = exports.draftInteger = void 0;
17
- /**
18
- * Creates a drafter for Integer
19
- * @param {number} value - the integer
20
- * @returns {string} the text
21
- */
22
- function draftInteger(value) {
23
- return '' + value;
24
- }
25
- exports.draftInteger = draftInteger;
26
- /**
27
- * Creates a drafter for a formatted Integer
28
- * @param {number} value - the Integer
29
- * @param {string} format - the format
30
- * @returns {object} the parser
31
- */
32
- function draftIntegerFormat(value, format) {
33
- return format.replace(/0(.)0/gi, function (_a, sep1) {
34
- const vs = value.toFixed(0);
35
- let res = '';
36
- let i = vs.substring(0, vs.length);
37
- while (i.length > 3) {
38
- res = sep1 + i.substring(i.length - 3) + res;
39
- i = i.substring(0, i.length - 3);
40
- }
41
- return i + res;
42
- });
43
- }
44
- exports.draftIntegerFormat = draftIntegerFormat;
45
- //# sourceMappingURL=format.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/drafting/Integer/format.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH;;;;GAIG;AACH,SAAgB,YAAY,CAAC,KAAY;IACrC,OAAO,EAAE,GAAG,KAAK,CAAC;AACtB,CAAC;AAFD,oCAEC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,KAAY,EAAC,MAAa;IACzD,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,UAAS,EAAE,EAAC,IAAI;QAC7C,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,EAAC,EAAE,CAAC,MAAM,CAAC,CAAC;QAClC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YACjB,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YAC7C,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SACpC;QACD,OAAO,CAAC,GAAG,GAAG,CAAC;IACnB,CAAC,CAAC,CAAC;AACP,CAAC;AAXD,gDAWC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Creates a drafter for an Integer
3
- * @param {number} value - the integer
4
- * @param {string} format - the format
5
- * @returns {string} the text
6
- */
7
- export default function integerDrafter(value: number, format: string): string;
@@ -1,33 +0,0 @@
1
- /*
2
- * Licensed under the Apache License, Version 2.0 (the "License");
3
- * you may not use this file except in compliance with the License.
4
- * You may obtain a copy of the License at
5
- *
6
- * http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS,
10
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- * See the License for the specific language governing permissions and
12
- * limitations under the License.
13
- */
14
- 'use strict';
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- const format_1 = require("./format");
17
- const format_2 = require("./format");
18
- /**
19
- * Creates a drafter for an Integer
20
- * @param {number} value - the integer
21
- * @param {string} format - the format
22
- * @returns {string} the text
23
- */
24
- function integerDrafter(value, format) {
25
- if (format) {
26
- return (0, format_2.draftIntegerFormat)(value, format);
27
- }
28
- else {
29
- return (0, format_1.draftInteger)(value);
30
- }
31
- }
32
- exports.default = integerDrafter;
33
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drafting/Integer/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,YAAY,CAAC;;AAEb,qCAAwC;AACxC,qCAA8C;AAE9C;;;;;GAKG;AACH,SAAwB,cAAc,CAAC,KAAY,EAAC,MAAa;IAC7D,IAAI,MAAM,EAAE;QACR,OAAO,IAAA,2BAAkB,EAAC,KAAK,EAAC,MAAM,CAAC,CAAC;KAC3C;SAAM;QACH,OAAO,IAAA,qBAAY,EAAC,KAAK,CAAC,CAAC;KAC9B;AACL,CAAC;AAND,iCAMC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Creates a drafter for a long
3
- * @param {number} value - the Long
4
- * @param {string} format - the format
5
- * @returns {string} the text
6
- */
7
- export default function longDrafter(value: number, format: string): string;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- /*
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- const format_1 = require("../Integer/format");
17
- const format_2 = require("../Integer/format");
18
- /**
19
- * Creates a drafter for a long
20
- * @param {number} value - the Long
21
- * @param {string} format - the format
22
- * @returns {string} the text
23
- */
24
- function longDrafter(value, format) {
25
- if (format) {
26
- return (0, format_2.draftIntegerFormat)(value, format);
27
- }
28
- else {
29
- return (0, format_1.draftInteger)(value);
30
- }
31
- }
32
- exports.default = longDrafter;
33
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drafting/Long/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAEH,8CAA8D;AAC9D,8CAA0E;AAE1E;;;;;GAKG;AACH,SAAwB,WAAW,CAAC,KAAY,EAAC,MAAa;IAC1D,IAAI,MAAM,EAAE;QACR,OAAO,IAAA,2BAAe,EAAC,KAAK,EAAC,MAAM,CAAC,CAAC;KACxC;SAAM;QACH,OAAO,IAAA,qBAAS,EAAC,KAAK,CAAC,CAAC;KAC3B;AACL,CAAC;AAND,8BAMC"}