npm install @ltd/j-ts
type T = any;
function * f (v :T) :T {
return <T> v as T;
}
require('@ltd/j-ts')(input :string, jsx :( (name :string, context :object) => string ) | boolean = false, fileName? :string)
function * f (v ) {
return v ;
}
(The error thrown for input
will have a index :number
property.)
(对 input
抛出的错误,会带上 index :number
属性。)
function* f(v) {
return v;
}
typescript |
@ltd/j-ts |
Alt | |
---|---|---|---|
public / protected / private / readonly constructor parameter |
✓ | ✗ | ECMAScript class field |
enum $ { } / namespace $ { } / module $ { } |
✓ | ✗ | import * as $ from ''; |
import $ = require(''); |
✓ | ✗ | var $ :typeof import('') = require(''); |
export = $; |
✓ | ✗ | module.exports = $; |
@$ |
✓ | ✗ | wait ECMAScript decorator proposal |
@ltd/j-ts |
typescript |
Alt | |
---|---|---|---|
let v :T = /*#__PURE__*/ f(); |
✓ | ✗ | let v :T = /*#__PURE__*/ f(); |