@sealcode/jdd 0.8.1 → 0.8.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/.nyc_output/84cd24f4-cbad-45b4-a856-e203891ea18f.json +1 -0
- package/.nyc_output/processinfo/84cd24f4-cbad-45b4-a856-e203891ea18f.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/.xunit +48 -0
- package/@types/component-arguments/code.d.ts +14 -0
- package/@types/component-arguments/component-arguments.d.ts +1 -0
- package/coverage/clover.xml +948 -0
- package/lib/component-arguments/code.js +43 -0
- package/lib/component-arguments/code.js.map +1 -0
- package/lib/component-arguments/component-arguments.js +1 -0
- package/lib/component-arguments/component-arguments.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { is, predicates } from "@sealcode/ts-predicates";
|
|
2
|
+
import { StringBasedArgument } from "./string-based-argument.js";
|
|
3
|
+
export class Code extends StringBasedArgument {
|
|
4
|
+
constructor({ language }) {
|
|
5
|
+
super();
|
|
6
|
+
this.language = language;
|
|
7
|
+
}
|
|
8
|
+
getTypeName() {
|
|
9
|
+
return "code";
|
|
10
|
+
}
|
|
11
|
+
getEmptyValue() {
|
|
12
|
+
return "";
|
|
13
|
+
}
|
|
14
|
+
getExampleValue() {
|
|
15
|
+
return `
|
|
16
|
+
let maxSum = 0;
|
|
17
|
+
let tempSum = 0;
|
|
18
|
+
|
|
19
|
+
for (let i = 0; i < num; i++) {
|
|
20
|
+
maxSum += arr[i];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
tempSum = maxSum;
|
|
24
|
+
|
|
25
|
+
for (let i = num; i < arr.length; i++) {
|
|
26
|
+
tempSum = tempSum - arr[i - num] + arr[i];
|
|
27
|
+
maxSum = Math.max(maxSum, tempSum);
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
countWords(_, value) {
|
|
32
|
+
return value.toString().split(" ").length;
|
|
33
|
+
}
|
|
34
|
+
parseFormInput(_, input) {
|
|
35
|
+
if (is(input, predicates.string)) {
|
|
36
|
+
return input;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.js","sourceRoot":"","sources":["../../src/component-arguments/code.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,OAAO,IAAK,SAAQ,mBAA2B;IAGpD,YAAY,EAAE,QAAQ,EAAwB;QAC7C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,CAAC;IAED,WAAW;QACV,OAAO,MAAM,CAAC;IACf,CAAC;IAED,aAAa;QACZ,OAAO,EAAE,CAAC;IACX,CAAC;IAED,eAAe;QACd,OAAO;;;;;;;;;;;;;;CAcR,CAAC;IACD,CAAC;IAED,UAAU,CAAC,CAAa,EAAE,KAAa;QACtC,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,CAAC;IAED,cAAc,CAAC,CAAa,EAAE,KAAc;QAC3C,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE;YACjC,OAAO,KAAK,CAAC;SACb;aAAM;YACN,OAAO,IAAI,CAAC;SACZ;IACF,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-arguments.js","sourceRoot":"","sources":["../../src/component-arguments/component-arguments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK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