-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
275be2a
commit 457d910
Showing
23 changed files
with
175 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,7 @@ | |
/hooks | ||
/platforms | ||
/cloud | ||
/**/package.json | ||
/**/package.json | ||
/**/node_modules | ||
/dist | ||
/**/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
{ | ||
"name": "ims-decorator", | ||
"version": "1.0.6", | ||
"description": "> TODO: description", | ||
"author": "imeepos <1037483576@qq.com>", | ||
"homepage": "http://meepo.com.cn", | ||
"license": "ISC", | ||
"main": "lib/index", | ||
"directories": { | ||
"lib": "lib", | ||
"test": "__tests__" | ||
}, | ||
"files": [ | ||
"lib" | ||
], | ||
"scripts": { | ||
"test": "echo \"Error: run tests from root\" && exit 1" | ||
}, | ||
"gitHead": "b86981067c7da7653379ae461b9427f4aea193a7", | ||
"dependencies": { | ||
"reflect-metadata": "*" | ||
} | ||
"name": "@nger/decorator", | ||
"version": "1.0.7", | ||
"description": "> TODO: description", | ||
"author": "imeepos <1037483576@qq.com>", | ||
"homepage": "http://meepo.com.cn", | ||
"license": "ISC", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"directories": { | ||
"lib": "lib", | ||
"test": "__tests__" | ||
}, | ||
"files": [ "lib" ], | ||
"publishConfig": { | ||
"registry": "http://registry.npmjs.org/", | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: run tests from root\" && exit 1" | ||
}, | ||
"gitHead": "b86981067c7da7653379ae461b9427f4aea193a7", | ||
"dependencies": { | ||
"reflect-metadata": "*", | ||
"@nger/di": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"include": [ | ||
"lib" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|
||
"@nger/di@*": | ||
version "1.0.7" | ||
resolved "https://registry.yarnpkg.com/@nger/di/-/di-1.0.7.tgz#bc96262a65250e8709fed853640b2f0d79b66cb6" | ||
integrity sha512-hsE08gt/71gaemjX3/JzyaaT3x92UJHzOBtfLSK/I7nVJFVYUbB6bTNfAWqBheZmGO6fAjZR8XBSHsviqtiWfg== | ||
|
||
reflect-metadata@*: | ||
version "0.1.13" | ||
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08" | ||
integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
// export * from './injector'; | ||
export * from './util'; | ||
export * from './injection_token'; | ||
export * from './type'; | ||
export { Injector, StaticInjector,IToken } from './injector_ng'; | ||
export { Injector, StaticInjector, IToken } from './injector_ng'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
import { Type } from './type'; | ||
export function stringify(token: any): string { | ||
if (typeof token === 'string') { | ||
return token; | ||
} | ||
if (token instanceof Array) { | ||
return '[' + token.map(stringify).join(', ') + ']'; | ||
} | ||
if (token == null) { | ||
return '' + token; | ||
} | ||
if (token.overriddenName) { | ||
return `${token.overriddenName}`; | ||
} | ||
if (token.name) { | ||
return `${token.name}`; | ||
} | ||
const res = token.toString(); | ||
if (res == null) { | ||
return '' + res; | ||
} | ||
const newLineIndex = res.indexOf('\n'); | ||
return newLineIndex === -1 ? res : res.substring(0, newLineIndex); | ||
if (typeof token === 'string') { | ||
return token; | ||
} | ||
if (token instanceof Array) { | ||
return '[' + token.map(stringify).join(', ') + ']'; | ||
} | ||
if (token == null) { | ||
return '' + token; | ||
} | ||
if (token.overriddenName) { | ||
return `${token.overriddenName}`; | ||
} | ||
if (token.name) { | ||
return `${token.name}`; | ||
} | ||
const res = token.toString(); | ||
if (res == null) { | ||
return '' + res; | ||
} | ||
const newLineIndex = res.indexOf('\n'); | ||
return newLineIndex === -1 ? res : res.substring(0, newLineIndex); | ||
} | ||
|
||
export function getClosureSafeProperty<T>(objWithPropertyToExtract: T): string { | ||
for (let key in objWithPropertyToExtract) { | ||
if (objWithPropertyToExtract[key] === getClosureSafeProperty as any) { | ||
return key; | ||
for (let key in objWithPropertyToExtract) { | ||
if (objWithPropertyToExtract[key] === getClosureSafeProperty as any) { | ||
return key; | ||
} | ||
} | ||
} | ||
throw Error('Could not find renamed property on target object.'); | ||
throw Error('Could not find renamed property on target object.'); | ||
} | ||
|
||
export function forwardRef(forwardRefFn: ForwardRefFn): Type<any> { | ||
(<any>forwardRefFn).__forward_ref__ = forwardRef; | ||
(<any>forwardRefFn).toString = function () { return stringify(this()); }; | ||
return (<Type<any>><any>forwardRefFn); | ||
(<any>forwardRefFn).__forward_ref__ = forwardRef; | ||
(<any>forwardRefFn).toString = function () { return stringify(this()); }; | ||
return (<Type<any>><any>forwardRefFn); | ||
} | ||
export interface ForwardRefFn { (): any; } | ||
const __forward_ref__ = getClosureSafeProperty({ __forward_ref__: getClosureSafeProperty }); | ||
|
||
export function resolveForwardRef<T>(type: T): T { | ||
const fn: any = type; | ||
if (typeof fn === 'function' && fn.hasOwnProperty(__forward_ref__) && | ||
fn.__forward_ref__ === forwardRef) { | ||
return fn(); | ||
} else { | ||
return type; | ||
} | ||
const fn: any = type; | ||
if (typeof fn === 'function' && fn.hasOwnProperty(__forward_ref__) && | ||
fn.__forward_ref__ === forwardRef) { | ||
return fn(); | ||
} else { | ||
return type; | ||
} | ||
} |
Oops, something went wrong.