@satisfactory-dev/docs.json.ts 0.14.5 → 0.15.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.
@@ -6,6 +6,8 @@ export class UnrealEngineString {
6
6
  this.right = right;
7
7
  }
8
8
  static fromString(value) {
9
+ if (value.startsWith('"') && value.endsWith('"'))
10
+ value = value.substring(1, value.length - 1);
9
11
  const result = /^([^']+)'(?:"([^"]+)"|([^"]+))'$/.exec(value);
10
12
  if (!result)
11
13
  throw new Error(`Not an UnrealEngineString (${value})`);
@@ -6,6 +6,8 @@ export class UnrealEngineString {
6
6
  this.right = right;
7
7
  }
8
8
  static fromString(value) {
9
+ if (value.startsWith('"') && value.endsWith('"'))
10
+ value = value.substring(1, value.length - 1);
9
11
  const result = /^([^']+)'(?:"([^"]+)"|([^"]+))'$/.exec(value);
10
12
  if (!result)
11
13
  throw new Error(`Not an UnrealEngineString (${value})`);
@@ -6,6 +6,8 @@ export class UnrealEngineString {
6
6
  this.right = right;
7
7
  }
8
8
  static fromString(value) {
9
+ if (value.startsWith('"') && value.endsWith('"'))
10
+ value = value.substring(1, value.length - 1);
9
11
  const result = /^([^']+)'(?:"([^"]+)"|([^"]+))'$/.exec(value);
10
12
  if (!result)
11
13
  throw new Error(`Not an UnrealEngineString (${value})`);
@@ -251,6 +251,14 @@ export class UnrealEngineString {
251
251
  ], [
252
252
  createParameter('value', create_type('string')),
253
253
  ], [
254
+ ts.factory.createIfStatement(ts.factory.createBinaryExpression(ts.factory.createCallExpression(create_property_access(ts.factory.createIdentifier('value'), 'startsWith'), undefined, [ts.factory.createStringLiteral('"')]), ts.SyntaxKind.AmpersandAmpersandToken, ts.factory.createCallExpression(create_property_access(ts.factory.createIdentifier('value'), 'endsWith'), undefined, [ts.factory.createStringLiteral('"')])),
255
+ // eslint-disable-next-line max-len
256
+ ts.factory.createExpressionStatement(ts.factory.createBinaryExpression(ts.factory.createIdentifier('value'), ts.SyntaxKind.EqualsToken, ts.factory.createCallExpression(create_property_access(ts.factory.createIdentifier('value'), 'substring'), undefined, [
257
+ ts.factory.createNumericLiteral(1),
258
+ ts.factory.createBinaryExpression(
259
+ // eslint-disable-next-line max-len
260
+ create_property_access(ts.factory.createIdentifier('value'), 'length'), ts.SyntaxKind.MinusToken, ts.factory.createNumericLiteral(1)),
261
+ ])))),
254
262
  create_const_statement(variable('result', ts.factory.createCallExpression(create_property_access(ts.factory.createRegularExpressionLiteral(UnrealEngineString_regex.toString()), 'exec'), undefined, [
255
263
  ts.factory.createIdentifier('value'),
256
264
  ]))),
package/package.json CHANGED
@@ -38,5 +38,5 @@
38
38
  "typescript": "~5.5.2",
39
39
  "typescript-eslint": "^8.2.0"
40
40
  },
41
- "version": "0.14.5"
41
+ "version": "0.15.0"
42
42
  }