@exercode/problem-utils 1.7.4 → 1.7.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"spawnSyncWithTimeout.cjs","sources":["../../src/helpers/spawnSyncWithTimeout.ts"],"sourcesContent":["import child_process from 'node:child_process';\nimport os from 'node:os';\n\nconst TIME_COMMAND = [os.platform() === 'darwin' ? 'gtime' : '/usr/bin/time', '--format', '%e %M'] as const;\n\nexport function spawnSyncWithTimeout(\n command: string,\n args: readonly string[],\n options: child_process.SpawnSyncOptionsWithStringEncoding,\n timeoutSeconds: number\n): child_process.SpawnSyncReturns<string> & { timeSeconds: number; memoryBytes: number } {\n const startTimeMilliseconds = Date.now();\n\n const spawnResult = child_process.spawnSync(\n 'timeout',\n [timeoutSeconds.toFixed(3), ...TIME_COMMAND, command, ...args],\n options\n );\n\n const stopTimeMilliseconds = Date.now();\n\n const match = /(?:^|\\n)(\\d+\\.\\d+) (\\d+)\\s*$/.exec(spawnResult.stderr);\n const stderr = match ? spawnResult.stderr.slice(0, match.index) : spawnResult.stderr;\n const timeSeconds = Number(match?.[1]) || (stopTimeMilliseconds - startTimeMilliseconds) / 1000;\n const memoryBytes = Number(match?.[2]) * 1024 || 0;\n\n // timeout\n if (spawnResult.status === 124) {\n return { ...spawnResult, status: 0, stderr, timeSeconds: timeoutSeconds + 1e-3, memoryBytes };\n }\n\n return { ...spawnResult, stderr, timeSeconds, memoryBytes };\n}\n"],"names":["TIME_COMMAND","platform","command","args","options","timeoutSeconds","startTimeMilliseconds","Date","now","spawnResult","child_process","spawnSync","toFixed","concat","_toConsumableArray","stopTimeMilliseconds","match","exec","stderr","slice","index","timeSeconds","Number","memoryBytes","status","_objectSpread"],"mappings":"wGAGMA,EAAe,CAAmB,8BAAfC,WAA0B,QAAU,gBAAiB,WAAY,sCAEnF,SACLC,EACAC,EACAC,EACAC,GAEA,IAAMC,EAAwBC,KAAKC,MAE7BC,EAAcC,EAAcC,UAChC,UAAS,CACRN,EAAeO,QAAQ,IAAEC,OAAKb,EAAY,CAAEE,GAAOY,EAAAA,kBAAKX,IACzDC,GAGIW,EAAuBR,KAAKC,MAE5BQ,EAAQ,+BAA+BC,KAAKR,EAAYS,QACxDA,EAASF,EAAQP,EAAYS,OAAOC,MAAM,EAAGH,EAAMI,OAASX,EAAYS,OACxEG,EAAcC,aAAON,SAAAA,EAAQ,MAAQD,EAAuBT,GAAyB,IACrFiB,EAAmC,KAArBD,OAAY,MAALN,OAAK,EAALA,EAAQ,KAAc,EAGjD,OAA2B,MAAvBP,EAAYe,OACdC,EAAAA,cAAAA,EAAAA,cAAA,CAAA,EAAYhB,GAAW,CAAA,EAAA,CAAEe,OAAQ,EAAGN,OAAAA,EAAQG,YAAahB,EAAiB,KAAMkB,YAAAA,IAGlFE,EAAAA,cAAAA,EAAAA,cAAA,CAAA,EAAYhB,GAAW,CAAA,EAAA,CAAES,OAAAA,EAAQG,YAAAA,EAAaE,YAAAA,GAChD"}
1
+ {"version":3,"file":"spawnSyncWithTimeout.cjs","sources":["../../src/helpers/spawnSyncWithTimeout.ts"],"sourcesContent":["import child_process from 'node:child_process';\nimport os from 'node:os';\n\nconst TIME_COMMAND = [os.platform() === 'darwin' ? 'gtime' : '/usr/bin/time', '--format', '%e %M'] as const;\n\nexport function spawnSyncWithTimeout(\n command: string,\n args: readonly string[],\n options: child_process.SpawnSyncOptionsWithStringEncoding,\n timeoutSeconds: number\n): child_process.SpawnSyncReturns<string> & { timeSeconds: number; memoryBytes: number } {\n const startTimeMilliseconds = Date.now();\n\n const spawnResult = child_process.spawnSync(\n 'timeout',\n [timeoutSeconds.toFixed(3), ...TIME_COMMAND, command, ...args],\n options\n );\n\n const stopTimeMilliseconds = Date.now();\n\n const match = /(?:^|\\n)(\\d+\\.\\d+) (\\d+)\\s*$/.exec(spawnResult.stderr);\n const stderr = match ? spawnResult.stderr.slice(0, match.index) : spawnResult.stderr;\n const timeSeconds = Number(match?.[1]) || (stopTimeMilliseconds - startTimeMilliseconds) / 1000;\n const memoryBytes = Number(match?.[2]) * 1024 || 0;\n\n // timeout\n if (spawnResult.status === 124) {\n return { ...spawnResult, status: 0, stderr, timeSeconds: timeoutSeconds + 1e-3, memoryBytes };\n }\n\n return { ...spawnResult, stderr, timeSeconds, memoryBytes };\n}\n"],"names":["TIME_COMMAND","platform","command","args","options","timeoutSeconds","startTimeMilliseconds","Date","now","spawnResult","child_process","spawnSync","toFixed","concat","_toConsumableArray","stopTimeMilliseconds","match","exec","stderr","slice","index","timeSeconds","Number","memoryBytes","status","_objectSpread"],"mappings":"wGAGMA,EAAe,CAAmB,8BAAfC,WAA0B,QAAU,gBAAiB,WAAY,sCAEnF,SACLC,EACAC,EACAC,EACAC,GAEA,IAAMC,EAAwBC,KAAKC,MAE7BC,EAAcC,EAAcC,UAChC,UAAS,CACRN,EAAeO,QAAQ,IAAEC,OAAKb,EAAY,CAAEE,GAAOY,EAAAA,kBAAKX,IACzDC,GAGIW,EAAuBR,KAAKC,MAE5BQ,EAAQ,+BAA+BC,KAAKR,EAAYS,QACxDA,EAASF,EAAQP,EAAYS,OAAOC,MAAM,EAAGH,EAAMI,OAASX,EAAYS,OACxEG,EAAcC,aAAON,SAAAA,EAAQ,MAAQD,EAAuBT,GAAyB,IACrFiB,EAAmC,KAArBD,OAAY,MAALN,SAAAA,EAAQ,KAAc,EAGjD,OAA2B,MAAvBP,EAAYe,OACdC,EAAAA,cAAAA,EAAAA,cAAA,CAAA,EAAYhB,GAAW,CAAA,EAAA,CAAEe,OAAQ,EAAGN,OAAAA,EAAQG,YAAahB,EAAiB,KAAMkB,YAAAA,IAGlFE,EAAAA,cAAAA,EAAAA,cAAA,CAAA,EAAYhB,GAAW,CAAA,EAAA,CAAES,OAAAA,EAAQG,YAAAA,EAAaE,YAAAA,GAChD"}
@@ -1 +1 @@
1
- {"version":3,"file":"spawnSyncWithTimeout.js","sources":["../../src/helpers/spawnSyncWithTimeout.ts"],"sourcesContent":["import child_process from 'node:child_process';\nimport os from 'node:os';\n\nconst TIME_COMMAND = [os.platform() === 'darwin' ? 'gtime' : '/usr/bin/time', '--format', '%e %M'] as const;\n\nexport function spawnSyncWithTimeout(\n command: string,\n args: readonly string[],\n options: child_process.SpawnSyncOptionsWithStringEncoding,\n timeoutSeconds: number\n): child_process.SpawnSyncReturns<string> & { timeSeconds: number; memoryBytes: number } {\n const startTimeMilliseconds = Date.now();\n\n const spawnResult = child_process.spawnSync(\n 'timeout',\n [timeoutSeconds.toFixed(3), ...TIME_COMMAND, command, ...args],\n options\n );\n\n const stopTimeMilliseconds = Date.now();\n\n const match = /(?:^|\\n)(\\d+\\.\\d+) (\\d+)\\s*$/.exec(spawnResult.stderr);\n const stderr = match ? spawnResult.stderr.slice(0, match.index) : spawnResult.stderr;\n const timeSeconds = Number(match?.[1]) || (stopTimeMilliseconds - startTimeMilliseconds) / 1000;\n const memoryBytes = Number(match?.[2]) * 1024 || 0;\n\n // timeout\n if (spawnResult.status === 124) {\n return { ...spawnResult, status: 0, stderr, timeSeconds: timeoutSeconds + 1e-3, memoryBytes };\n }\n\n return { ...spawnResult, stderr, timeSeconds, memoryBytes };\n}\n"],"names":["TIME_COMMAND","os","platform","spawnSyncWithTimeout","command","args","options","timeoutSeconds","startTimeMilliseconds","Date","now","spawnResult","child_process","spawnSync","toFixed","concat","_toConsumableArray","stopTimeMilliseconds","match","exec","stderr","slice","index","timeSeconds","Number","memoryBytes","status","_objectSpread"],"mappings":"yJAGA,IAAMA,EAAe,CAAmB,WAAlBC,EAAGC,WAA0B,QAAU,gBAAiB,WAAY,SAEnF,SAASC,EACdC,EACAC,EACAC,EACAC,GAEA,IAAMC,EAAwBC,KAAKC,MAE7BC,EAAcC,EAAcC,UAChC,UAAS,CACRN,EAAeO,QAAQ,IAAEC,OAAKf,EAAY,CAAEI,GAAOY,EAAKX,IACzDC,GAGIW,EAAuBR,KAAKC,MAE5BQ,EAAQ,+BAA+BC,KAAKR,EAAYS,QACxDA,EAASF,EAAQP,EAAYS,OAAOC,MAAM,EAAGH,EAAMI,OAASX,EAAYS,OACxEG,EAAcC,aAAON,SAAAA,EAAQ,MAAQD,EAAuBT,GAAyB,IACrFiB,EAAmC,KAArBD,OAAY,MAALN,OAAK,EAALA,EAAQ,KAAc,EAGjD,OAA2B,MAAvBP,EAAYe,OACdC,EAAAA,EAAA,CAAA,EAAYhB,GAAW,CAAA,EAAA,CAAEe,OAAQ,EAAGN,OAAAA,EAAQG,YAAahB,EAAiB,KAAMkB,YAAAA,IAGlFE,EAAAA,EAAA,CAAA,EAAYhB,GAAW,CAAA,EAAA,CAAES,OAAAA,EAAQG,YAAAA,EAAaE,YAAAA,GAChD"}
1
+ {"version":3,"file":"spawnSyncWithTimeout.js","sources":["../../src/helpers/spawnSyncWithTimeout.ts"],"sourcesContent":["import child_process from 'node:child_process';\nimport os from 'node:os';\n\nconst TIME_COMMAND = [os.platform() === 'darwin' ? 'gtime' : '/usr/bin/time', '--format', '%e %M'] as const;\n\nexport function spawnSyncWithTimeout(\n command: string,\n args: readonly string[],\n options: child_process.SpawnSyncOptionsWithStringEncoding,\n timeoutSeconds: number\n): child_process.SpawnSyncReturns<string> & { timeSeconds: number; memoryBytes: number } {\n const startTimeMilliseconds = Date.now();\n\n const spawnResult = child_process.spawnSync(\n 'timeout',\n [timeoutSeconds.toFixed(3), ...TIME_COMMAND, command, ...args],\n options\n );\n\n const stopTimeMilliseconds = Date.now();\n\n const match = /(?:^|\\n)(\\d+\\.\\d+) (\\d+)\\s*$/.exec(spawnResult.stderr);\n const stderr = match ? spawnResult.stderr.slice(0, match.index) : spawnResult.stderr;\n const timeSeconds = Number(match?.[1]) || (stopTimeMilliseconds - startTimeMilliseconds) / 1000;\n const memoryBytes = Number(match?.[2]) * 1024 || 0;\n\n // timeout\n if (spawnResult.status === 124) {\n return { ...spawnResult, status: 0, stderr, timeSeconds: timeoutSeconds + 1e-3, memoryBytes };\n }\n\n return { ...spawnResult, stderr, timeSeconds, memoryBytes };\n}\n"],"names":["TIME_COMMAND","os","platform","spawnSyncWithTimeout","command","args","options","timeoutSeconds","startTimeMilliseconds","Date","now","spawnResult","child_process","spawnSync","toFixed","concat","_toConsumableArray","stopTimeMilliseconds","match","exec","stderr","slice","index","timeSeconds","Number","memoryBytes","status","_objectSpread"],"mappings":"yJAGA,IAAMA,EAAe,CAAmB,WAAlBC,EAAGC,WAA0B,QAAU,gBAAiB,WAAY,SAEnF,SAASC,EACdC,EACAC,EACAC,EACAC,GAEA,IAAMC,EAAwBC,KAAKC,MAE7BC,EAAcC,EAAcC,UAChC,UAAS,CACRN,EAAeO,QAAQ,IAAEC,OAAKf,EAAY,CAAEI,GAAOY,EAAKX,IACzDC,GAGIW,EAAuBR,KAAKC,MAE5BQ,EAAQ,+BAA+BC,KAAKR,EAAYS,QACxDA,EAASF,EAAQP,EAAYS,OAAOC,MAAM,EAAGH,EAAMI,OAASX,EAAYS,OACxEG,EAAcC,aAAON,SAAAA,EAAQ,MAAQD,EAAuBT,GAAyB,IACrFiB,EAAmC,KAArBD,OAAY,MAALN,SAAAA,EAAQ,KAAc,EAGjD,OAA2B,MAAvBP,EAAYe,OACdC,EAAAA,EAAA,CAAA,EAAYhB,GAAW,CAAA,EAAA,CAAEe,OAAQ,EAAGN,OAAAA,EAAQG,YAAahB,EAAiB,KAAMkB,YAAAA,IAGlFE,EAAAA,EAAA,CAAA,EAAYhB,GAAW,CAAA,EAAA,CAAES,OAAAA,EAAQG,YAAAA,EAAaE,YAAAA,GAChD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exercode/problem-utils",
3
- "version": "1.7.4",
3
+ "version": "1.7.6",
4
4
  "description": ":100: A set of utilities for judging programs on Exercode (https://exercode.willbooster.com/).",
5
5
  "keywords": [
6
6
  "exercode",
@@ -49,13 +49,13 @@
49
49
  },
50
50
  "prettier": "@willbooster/prettier-config",
51
51
  "dependencies": {
52
- "@ai-sdk/amazon-bedrock": "4.0.19",
53
- "@ai-sdk/google": "3.0.10",
54
- "@ai-sdk/openai": "3.0.12",
55
- "@ai-sdk/xai": "3.0.26",
56
- "ai": "6.0.40",
52
+ "@ai-sdk/amazon-bedrock": "4.0.30",
53
+ "@ai-sdk/google": "3.0.13",
54
+ "@ai-sdk/openai": "3.0.18",
55
+ "@ai-sdk/xai": "3.0.34",
56
+ "ai": "6.0.49",
57
57
  "front-matter": "4.0.2",
58
- "zod": "4.3.5"
58
+ "zod": "4.3.6"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@tsconfig/node24": "24.0.4",
@@ -63,7 +63,7 @@
63
63
  "@types/node": "24.10.9",
64
64
  "@willbooster/eslint-config-ts": "11.4.12",
65
65
  "@willbooster/prettier-config": "10.2.4",
66
- "build-ts": "17.0.14",
66
+ "build-ts": "17.0.16",
67
67
  "conventional-changelog-conventionalcommits": "9.1.0",
68
68
  "dotenv-cli": "11.0.0",
69
69
  "eslint": "9.39.1",
@@ -75,19 +75,19 @@
75
75
  "eslint-plugin-sort-destructure-keys": "2.0.0",
76
76
  "eslint-plugin-unicorn": "62.0.0",
77
77
  "eslint-plugin-unused-imports": "4.3.0",
78
- "globals": "17.0.0",
78
+ "globals": "17.1.0",
79
79
  "husky": "9.1.7",
80
80
  "lint-staged": "16.2.7",
81
81
  "micromatch": "4.0.8",
82
82
  "pinst": "3.0.0",
83
- "prettier": "3.8.0",
83
+ "prettier": "3.8.1",
84
84
  "prettier-plugin-java": "2.8.1",
85
- "puppeteer": "24.35.0",
85
+ "puppeteer": "24.36.0",
86
86
  "semantic-release": "25.0.2",
87
- "sort-package-json": "3.6.0",
87
+ "sort-package-json": "3.6.1",
88
88
  "typescript": "5.9.3",
89
- "typescript-eslint": "8.53.0",
90
- "vitest": "4.0.17"
89
+ "typescript-eslint": "8.53.1",
90
+ "vitest": "4.0.18"
91
91
  },
92
92
  "packageManager": "yarn@4.12.0",
93
93
  "engines": {