svelte2tsx 0.6.21 → 0.6.22

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 (3) hide show
  1. package/index.js +7 -7
  2. package/index.mjs +7 -7
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -3761,6 +3761,7 @@ function upserKitRouteFile(ts, basename, getSource, surround) {
3761
3761
  insertApiMethod('DELETE');
3762
3762
  insertApiMethod('OPTIONS');
3763
3763
  insertApiMethod('HEAD');
3764
+ insertApiMethod('fallback');
3764
3765
  return { addedCode, originalText: source.getFullText() };
3765
3766
  }
3766
3767
  function upserKitParamsFile(ts, fileName, basename, paramsPath, getSource, surround) {
@@ -4242,17 +4243,16 @@ class ExportedNames {
4242
4243
  // - The check if exports are assignable to $$Props is not done because a component should be allowed
4243
4244
  // to use less props than defined (it just ignores them)
4244
4245
  // - __sveltets_2_ensureRightProps needs to be declared in a way that doesn't affect the type result of props
4245
- return ('{...__sveltets_2_ensureRightProps<{' +
4246
+ return ('{ ...__sveltets_2_ensureRightProps<{' +
4246
4247
  this.createReturnElementsType(lets).join(',') +
4247
- '}>(__sveltets_2_any("") as $$Props), ' +
4248
- '...{} as unknown as $$Props, ...{' +
4248
+ '}>(__sveltets_2_any("") as $$Props)} as ' +
4249
4249
  // We add other exports of classes and functions here because
4250
4250
  // they need to appear in the props object in order to properly
4251
4251
  // type bind:xx but they are not needed to be part of $$Props
4252
- this.createReturnElements(others, false).join(', ') +
4253
- '} as {' +
4254
- this.createReturnElementsType(others).join(',') +
4255
- '}}');
4252
+ (others.length
4253
+ ? '{' + this.createReturnElementsType(others).join(',') + '} & '
4254
+ : '') +
4255
+ '$$Props');
4256
4256
  }
4257
4257
  if (names.length === 0 && !uses$$propsOr$$restProps) {
4258
4258
  // Necessary, because {} roughly equals to any
package/index.mjs CHANGED
@@ -3741,6 +3741,7 @@ function upserKitRouteFile(ts, basename, getSource, surround) {
3741
3741
  insertApiMethod('DELETE');
3742
3742
  insertApiMethod('OPTIONS');
3743
3743
  insertApiMethod('HEAD');
3744
+ insertApiMethod('fallback');
3744
3745
  return { addedCode, originalText: source.getFullText() };
3745
3746
  }
3746
3747
  function upserKitParamsFile(ts, fileName, basename, paramsPath, getSource, surround) {
@@ -4222,17 +4223,16 @@ class ExportedNames {
4222
4223
  // - The check if exports are assignable to $$Props is not done because a component should be allowed
4223
4224
  // to use less props than defined (it just ignores them)
4224
4225
  // - __sveltets_2_ensureRightProps needs to be declared in a way that doesn't affect the type result of props
4225
- return ('{...__sveltets_2_ensureRightProps<{' +
4226
+ return ('{ ...__sveltets_2_ensureRightProps<{' +
4226
4227
  this.createReturnElementsType(lets).join(',') +
4227
- '}>(__sveltets_2_any("") as $$Props), ' +
4228
- '...{} as unknown as $$Props, ...{' +
4228
+ '}>(__sveltets_2_any("") as $$Props)} as ' +
4229
4229
  // We add other exports of classes and functions here because
4230
4230
  // they need to appear in the props object in order to properly
4231
4231
  // type bind:xx but they are not needed to be part of $$Props
4232
- this.createReturnElements(others, false).join(', ') +
4233
- '} as {' +
4234
- this.createReturnElementsType(others).join(',') +
4235
- '}}');
4232
+ (others.length
4233
+ ? '{' + this.createReturnElementsType(others).join(',') + '} & '
4234
+ : '') +
4235
+ '$$Props');
4236
4236
  }
4237
4237
  if (names.length === 0 && !uses$$propsOr$$restProps) {
4238
4238
  // Necessary, because {} roughly equals to any
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte2tsx",
3
- "version": "0.6.21",
3
+ "version": "0.6.22",
4
4
  "description": "Convert Svelte components to TSX for type checking",
5
5
  "author": "David Pershouse",
6
6
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "svelte": "~3.57.0",
41
41
  "tiny-glob": "^0.2.6",
42
42
  "tslib": "^2.4.0",
43
- "typescript": "^5.1.3"
43
+ "typescript": "^5.2.2"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "svelte": "^3.55 || ^4.0.0-next.0 || ^4.0",