https://github.com/khusamov/temp-typescript-rtti-on-rollup-errors
On rollup.js: this has been rewritten to undefined #46
https://github.com/khusamov/temp-typescript-rtti-on-rollup-errors
temp
Last synced: 27 days ago
JSON representation
On rollup.js: this has been rewritten to undefined #46
- Host: GitHub
- URL: https://github.com/khusamov/temp-typescript-rtti-on-rollup-errors
- Owner: khusamov
- Created: 2022-03-28T19:14:39.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-29T06:00:09.000Z (about 4 years ago)
- Last Synced: 2023-03-01T23:35:38.878Z (over 3 years ago)
- Topics: temp
- Language: JavaScript
- Homepage: https://github.com/typescript-rtti/typescript-rtti/issues/46
- Size: 45.9 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# temp-typescript-rtti-on-rollup-errors
Ошибка исправлена!
https://github.com/typescript-rtti/typescript-rtti/issues/46
Start
-----
```
yarn
yarn start
```
If you try to view the interface properties from a file, we get an empty array!
```typescript
import "reflect-metadata"
import {reflect} from 'typescript-rtti'
import IMovable from './IMovable';
// An array with two properties is expected to be output.
// But instead an empty array is output!
console.log(
reflect().as('interface').reflectedInterface.properties
)
```
File `IMovable.ts`:
```typescript
export default interface IMovable {
position: string
readonly movementVelocity: string
}
```
Rollup warning
--------------
There are also suspicious warnings from Rollup:
```
(!) `this` has been rewritten to `undefined`
https://rollupjs.org/guide/en/#error-this-is-undefined
node_modules/typescript-rtti/dist.esm/lib/reflect.js
1: var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
^
2: var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3: if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
...and 3 other occurrences
```