Constructors
constructor
- new ScriptHandler(code?: string, options?: Object): ScriptHandler
-
Parameters
-
Default value code: string = ""
-
Optional options: Object
Properties
dirty
dirty: boolean = false
state
state: {}
Type declaration
-
[name: string]: string | number | Array<string>
Methods
export
- export(specifier?: string | {}): this
-
Parameters
-
Optional specifier: string | {}
Returns this
from
- from(source: string): this
import
- import(specifier: string | {}): this
mergeArray
- mergeArray(thisArray: ArrayExpression, thatArray: ArrayExpression): {}
-
Parameters
-
thisArray: ArrayExpression
-
thatArray: ArrayExpression
Returns {}
mergeFunction
- mergeFunction(thisFunction: ObjectMethod | FunctionExpression | ArrowFunctionExpression, thatFunction: ObjectMethod | FunctionExpression | ArrowFunctionExpression): {}
-
Parameters
-
thisFunction: ObjectMethod | FunctionExpression | ArrowFunctionExpression
-
thatFunction: ObjectMethod | FunctionExpression | ArrowFunctionExpression
Returns {}
mergeObject
- mergeObject(thisObject: ObjectExpression, thatObject: ObjectExpression): {}
-
Parameters
-
thisObject: ObjectExpression
-
thatObject: ObjectExpression
Returns {}
mergeVueObject
- mergeVueObject(thisObject: ObjectExpression, thatObject: ObjectExpression): {}
-
Parameters
-
thisObject: ObjectExpression
-
thatObject: ObjectExpression
Returns {}
parse
- parse(code: string): File
从哪里引入 如果遇到相同路径,以前的会被替换;如果不存在相同路径,则添加到最后一个 ImportDeclaration 之后