Skip to content

Commit 1cc8134

Browse files
chore(all): prepare release 0.7.3
1 parent 1818b0a commit 1cc8134

14 files changed

+160
-65
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aurelia-metadata",
3-
"version": "0.7.2",
3+
"version": "0.7.3",
44
"description": "Utilities for reading and writing the metadata of JavaScript functions.",
55
"keywords": [
66
"aurelia",

dist/amd/aurelia-metadata.d.ts

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
declare module 'aurelia-metadata' {
2-
import core from 'core-js';
2+
import * as core from 'core-js';
3+
export interface MetadataType {
4+
global: Object;
5+
resource: string;
6+
paramTypes: string;
7+
properties: string;
8+
}
9+
export interface DecoratorsConfigType {
10+
}
11+
export interface DecoratorsType {
12+
configure: DecoratorsConfigType;
13+
}
314

415
/**
516
* Provides helpers for working with metadata.
@@ -28,7 +39,7 @@ declare module 'aurelia-metadata' {
2839
* @param {Function} fn The function to inspect for Origin metadata.
2940
* @return {Origin} Returns the Origin metadata.
3041
*/
31-
static get(fn: Function): any;
42+
static get(fn: Function): Origin;
3243

3344
/**
3445
* Set the Origin annotation for the specified function.
@@ -39,11 +50,11 @@ declare module 'aurelia-metadata' {
3950
* @param {origin} fn The Origin metadata to store on the function.
4051
* @return {Origin} Returns the Origin metadata.
4152
*/
42-
static set(fn: Function, origin: Origin): any;
53+
static set(fn: Function, origin: Origin): void;
4354
}
4455
export class DecoratorApplicator {
4556
constructor();
4657
decorator(decorator: Function): DecoratorApplicator;
4758
}
48-
export var Decorators: any;
59+
export let Decorators: any;
4960
}

dist/amd/aurelia-metadata.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@ define(['exports', 'core-js'], function (exports, _coreJs) {
33

44
exports.__esModule = true;
55

6-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
7-
86
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
97

10-
var _core = _interopRequireDefault(_coreJs);
11-
128
var theGlobal = (function () {
139
if (typeof self !== 'undefined') {
1410
return self;
@@ -44,7 +40,7 @@ define(['exports', 'core-js'], function (exports, _coreJs) {
4440

4541
if (typeof theGlobal.Reflect.defineMetadata === 'undefined') {
4642
Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) {
47-
var metadataContainer = target[metadataContainerKey] || (target[metadataContainerKey] = {});
43+
var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {};
4844
var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {});
4945
targetContainer[metadataKey] = metadataValue;
5046
};

dist/aurelia-metadata.d.ts

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
declare module 'aurelia-metadata' {
2-
import core from 'core-js';
2+
import * as core from 'core-js';
3+
export interface MetadataType {
4+
global: Object;
5+
resource: string;
6+
paramTypes: string;
7+
properties: string;
8+
}
9+
export interface DecoratorsConfigType {
10+
}
11+
export interface DecoratorsType {
12+
configure: DecoratorsConfigType;
13+
}
314

415
/**
516
* Provides helpers for working with metadata.
@@ -28,7 +39,7 @@ declare module 'aurelia-metadata' {
2839
* @param {Function} fn The function to inspect for Origin metadata.
2940
* @return {Origin} Returns the Origin metadata.
3041
*/
31-
static get(fn: Function): any;
42+
static get(fn: Function): Origin;
3243

3344
/**
3445
* Set the Origin annotation for the specified function.
@@ -39,11 +50,11 @@ declare module 'aurelia-metadata' {
3950
* @param {origin} fn The Origin metadata to store on the function.
4051
* @return {Origin} Returns the Origin metadata.
4152
*/
42-
static set(fn: Function, origin: Origin): any;
53+
static set(fn: Function, origin: Origin): void;
4354
}
4455
export class DecoratorApplicator {
4556
constructor();
4657
decorator(decorator: Function): DecoratorApplicator;
4758
}
48-
export var Decorators: any;
59+
export let Decorators: any;
4960
}

dist/aurelia-metadata.js

+31-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import core from 'core-js';
1+
import * as core from 'core-js';
22

33
const theGlobal = (function() {
44
// Workers don’t have `window`, only `self`
@@ -38,7 +38,7 @@ if(typeof theGlobal.Reflect.getOwnMetadata === 'undefined'){
3838

3939
if(typeof theGlobal.Reflect.defineMetadata === 'undefined'){
4040
Reflect.defineMetadata = function(metadataKey, metadataValue, target, targetKey){
41-
var metadataContainer = target[metadataContainerKey] || (target[metadataContainerKey] = {});
41+
var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : (target[metadataContainerKey] = {});
4242
var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {});
4343
targetContainer[metadataKey] = metadataValue;
4444
};
@@ -69,26 +69,33 @@ function ensureDecorators(target){
6969
}
7070
}
7171

72+
interface MetadataType {
73+
global: Object;
74+
resource:string;
75+
paramTypes:string;
76+
properties:string;
77+
}
78+
7279
/**
7380
* Provides helpers for working with metadata.
7481
*
7582
* @class Metadata
7683
* @static
7784
*/
78-
export var Metadata = {
85+
export var Metadata : MetadataType = {
7986
global: theGlobal,
8087
resource:'aurelia:resource',
8188
paramTypes:'design:paramtypes',
8289
properties:'design:properties',
83-
get(metadataKey:string, target:Function, targetKey:string){
90+
get(metadataKey : string, target : Function, targetKey : string) : Object {
8491
if(!target){
8592
return undefined;
8693
}
8794

8895
let result = Metadata.getOwn(metadataKey, target, targetKey);
8996
return result === undefined ? Metadata.get(metadataKey, Object.getPrototypeOf(target), targetKey) : result;
9097
},
91-
getOwn(metadataKey:string, target:Function, targetKey:string){
98+
getOwn(metadataKey : string, target : Function, targetKey : string) : Object {
9299
if(!target){
93100
return undefined;
94101
}
@@ -99,10 +106,10 @@ export var Metadata = {
99106

100107
return Reflect.getOwnMetadata(metadataKey, target, targetKey);
101108
},
102-
define(metadataKey:string, metadataValue:string, target:Function, targetKey:string){
109+
define(metadataKey : string, metadataValue : Object, target : Function, targetKey : string) : void {
103110
Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey);
104111
},
105-
getOrCreateOwn(metadataKey:string, Type:Function, target:Function, targetKey:string){
112+
getOrCreateOwn(metadataKey : string, Type : Function, target : Function, targetKey : string) : Object {
106113
let result = Metadata.getOwn(metadataKey, target, targetKey);
107114

108115
if(result === undefined){
@@ -114,7 +121,7 @@ export var Metadata = {
114121
}
115122
}
116123

117-
var originStorage = new Map(),
124+
let originStorage = new Map(),
118125
unknownOrigin = Object.freeze({moduleId:undefined,moduleMember:undefined});
119126

120127
/**
@@ -126,7 +133,7 @@ var originStorage = new Map(),
126133
* @param {string} moduleMember The name of the export in the origin module.
127134
*/
128135
export class Origin {
129-
constructor(moduleId:string, moduleMember:string){
136+
constructor(moduleId : string, moduleMember : string){
130137
this.moduleId = moduleId;
131138
this.moduleMember = moduleMember;
132139
}
@@ -139,7 +146,7 @@ export class Origin {
139146
* @param {Function} fn The function to inspect for Origin metadata.
140147
* @return {Origin} Returns the Origin metadata.
141148
*/
142-
static get(fn:Function){
149+
static get(fn : Function) : Origin {
143150
var origin = originStorage.get(fn);
144151

145152
if(origin === undefined){
@@ -171,7 +178,7 @@ export class Origin {
171178
* @param {origin} fn The Origin metadata to store on the function.
172179
* @return {Origin} Returns the Origin metadata.
173180
*/
174-
static set(fn:Function, origin:Origin){
181+
static set(fn : Function, origin : Origin) : void {
175182
originStorage.set(fn, origin);
176183
}
177184
}
@@ -184,7 +191,7 @@ export class DecoratorApplicator {
184191
this._rest = null;
185192
}
186193

187-
decorator(decorator:Function):DecoratorApplicator{
194+
decorator(decorator : Function) : DecoratorApplicator {
188195
if(this._first === null){
189196
this._first = decorator;
190197
return this;
@@ -209,7 +216,7 @@ export class DecoratorApplicator {
209216
return this;
210217
}
211218

212-
_decorate(target:Function){
219+
_decorate(target : Function) : void {
213220
var i, ii, rest;
214221

215222
if(this._first !== null){
@@ -233,9 +240,17 @@ export class DecoratorApplicator {
233240
}
234241
}
235242

236-
export var Decorators = {
243+
interface DecoratorsConfigType {
244+
245+
}
246+
247+
interface DecoratorsType {
248+
configure : DecoratorsConfigType;
249+
}
250+
251+
export let Decorators : DecoratorsType = {
237252
configure: {
238-
parameterizedDecorator(name:string, decorator:Function){
253+
parameterizedDecorator(name : string, decorator : Function) : void {
239254
Decorators[name] = function(){
240255
var applicator = new DecoratorApplicator();
241256
return applicator[name].apply(applicator, arguments);
@@ -246,7 +261,7 @@ export var Decorators = {
246261
return this.decorator(result);
247262
};
248263
},
249-
simpleDecorator(name:string, decorator:Function){
264+
simpleDecorator(name : string, decorator : Function) : void {
250265
Decorators[name] = function(){
251266
return new DecoratorApplicator().decorator(decorator);
252267
};

dist/commonjs/aurelia-metadata.d.ts

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
declare module 'aurelia-metadata' {
2-
import core from 'core-js';
2+
import * as core from 'core-js';
3+
export interface MetadataType {
4+
global: Object;
5+
resource: string;
6+
paramTypes: string;
7+
properties: string;
8+
}
9+
export interface DecoratorsConfigType {
10+
}
11+
export interface DecoratorsType {
12+
configure: DecoratorsConfigType;
13+
}
314

415
/**
516
* Provides helpers for working with metadata.
@@ -28,7 +39,7 @@ declare module 'aurelia-metadata' {
2839
* @param {Function} fn The function to inspect for Origin metadata.
2940
* @return {Origin} Returns the Origin metadata.
3041
*/
31-
static get(fn: Function): any;
42+
static get(fn: Function): Origin;
3243

3344
/**
3445
* Set the Origin annotation for the specified function.
@@ -39,11 +50,11 @@ declare module 'aurelia-metadata' {
3950
* @param {origin} fn The Origin metadata to store on the function.
4051
* @return {Origin} Returns the Origin metadata.
4152
*/
42-
static set(fn: Function, origin: Origin): any;
53+
static set(fn: Function, origin: Origin): void;
4354
}
4455
export class DecoratorApplicator {
4556
constructor();
4657
decorator(decorator: Function): DecoratorApplicator;
4758
}
48-
export var Decorators: any;
59+
export let Decorators: any;
4960
}

dist/commonjs/aurelia-metadata.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
exports.__esModule = true;
44

5-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
5+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
66

77
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
88

99
var _coreJs = require('core-js');
1010

11-
var _coreJs2 = _interopRequireDefault(_coreJs);
11+
var core = _interopRequireWildcard(_coreJs);
1212

1313
var theGlobal = (function () {
1414
if (typeof self !== 'undefined') {
@@ -45,7 +45,7 @@ if (typeof theGlobal.Reflect.getOwnMetadata === 'undefined') {
4545

4646
if (typeof theGlobal.Reflect.defineMetadata === 'undefined') {
4747
Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) {
48-
var metadataContainer = target[metadataContainerKey] || (target[metadataContainerKey] = {});
48+
var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {};
4949
var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {});
5050
targetContainer[metadataKey] = metadataValue;
5151
};

dist/es6/aurelia-metadata.d.ts

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
declare module 'aurelia-metadata' {
2-
import core from 'core-js';
2+
import * as core from 'core-js';
3+
export interface MetadataType {
4+
global: Object;
5+
resource: string;
6+
paramTypes: string;
7+
properties: string;
8+
}
9+
export interface DecoratorsConfigType {
10+
}
11+
export interface DecoratorsType {
12+
configure: DecoratorsConfigType;
13+
}
314

415
/**
516
* Provides helpers for working with metadata.
@@ -28,7 +39,7 @@ declare module 'aurelia-metadata' {
2839
* @param {Function} fn The function to inspect for Origin metadata.
2940
* @return {Origin} Returns the Origin metadata.
3041
*/
31-
static get(fn: Function): any;
42+
static get(fn: Function): Origin;
3243

3344
/**
3445
* Set the Origin annotation for the specified function.
@@ -39,11 +50,11 @@ declare module 'aurelia-metadata' {
3950
* @param {origin} fn The Origin metadata to store on the function.
4051
* @return {Origin} Returns the Origin metadata.
4152
*/
42-
static set(fn: Function, origin: Origin): any;
53+
static set(fn: Function, origin: Origin): void;
4354
}
4455
export class DecoratorApplicator {
4556
constructor();
4657
decorator(decorator: Function): DecoratorApplicator;
4758
}
48-
export var Decorators: any;
59+
export let Decorators: any;
4960
}

0 commit comments

Comments
 (0)