Skip to content

Commit

Permalink
chore(all): prepare release 0.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Aug 14, 2015
1 parent 1818b0a commit 1cc8134
Show file tree
Hide file tree
Showing 14 changed files with 160 additions and 65 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-metadata",
"version": "0.7.2",
"version": "0.7.3",
"description": "Utilities for reading and writing the metadata of JavaScript functions.",
"keywords": [
"aurelia",
Expand Down
19 changes: 15 additions & 4 deletions dist/amd/aurelia-metadata.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
declare module 'aurelia-metadata' {
import core from 'core-js';
import * as core from 'core-js';
export interface MetadataType {
global: Object;
resource: string;
paramTypes: string;
properties: string;
}
export interface DecoratorsConfigType {
}
export interface DecoratorsType {
configure: DecoratorsConfigType;
}

/**
* Provides helpers for working with metadata.
Expand Down Expand Up @@ -28,7 +39,7 @@ declare module 'aurelia-metadata' {
* @param {Function} fn The function to inspect for Origin metadata.
* @return {Origin} Returns the Origin metadata.
*/
static get(fn: Function): any;
static get(fn: Function): Origin;

/**
* Set the Origin annotation for the specified function.
Expand All @@ -39,11 +50,11 @@ declare module 'aurelia-metadata' {
* @param {origin} fn The Origin metadata to store on the function.
* @return {Origin} Returns the Origin metadata.
*/
static set(fn: Function, origin: Origin): any;
static set(fn: Function, origin: Origin): void;
}
export class DecoratorApplicator {
constructor();
decorator(decorator: Function): DecoratorApplicator;
}
export var Decorators: any;
export let Decorators: any;
}
6 changes: 1 addition & 5 deletions dist/amd/aurelia-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ define(['exports', 'core-js'], function (exports, _coreJs) {

exports.__esModule = true;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

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

var _core = _interopRequireDefault(_coreJs);

var theGlobal = (function () {
if (typeof self !== 'undefined') {
return self;
Expand Down Expand Up @@ -44,7 +40,7 @@ define(['exports', 'core-js'], function (exports, _coreJs) {

if (typeof theGlobal.Reflect.defineMetadata === 'undefined') {
Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) {
var metadataContainer = target[metadataContainerKey] || (target[metadataContainerKey] = {});
var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {};
var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {});
targetContainer[metadataKey] = metadataValue;
};
Expand Down
19 changes: 15 additions & 4 deletions dist/aurelia-metadata.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
declare module 'aurelia-metadata' {
import core from 'core-js';
import * as core from 'core-js';
export interface MetadataType {
global: Object;
resource: string;
paramTypes: string;
properties: string;
}
export interface DecoratorsConfigType {
}
export interface DecoratorsType {
configure: DecoratorsConfigType;
}

/**
* Provides helpers for working with metadata.
Expand Down Expand Up @@ -28,7 +39,7 @@ declare module 'aurelia-metadata' {
* @param {Function} fn The function to inspect for Origin metadata.
* @return {Origin} Returns the Origin metadata.
*/
static get(fn: Function): any;
static get(fn: Function): Origin;

/**
* Set the Origin annotation for the specified function.
Expand All @@ -39,11 +50,11 @@ declare module 'aurelia-metadata' {
* @param {origin} fn The Origin metadata to store on the function.
* @return {Origin} Returns the Origin metadata.
*/
static set(fn: Function, origin: Origin): any;
static set(fn: Function, origin: Origin): void;
}
export class DecoratorApplicator {
constructor();
decorator(decorator: Function): DecoratorApplicator;
}
export var Decorators: any;
export let Decorators: any;
}
47 changes: 31 additions & 16 deletions dist/aurelia-metadata.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import core from 'core-js';
import * as core from 'core-js';

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

if(typeof theGlobal.Reflect.defineMetadata === 'undefined'){
Reflect.defineMetadata = function(metadataKey, metadataValue, target, targetKey){
var metadataContainer = target[metadataContainerKey] || (target[metadataContainerKey] = {});
var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : (target[metadataContainerKey] = {});
var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {});
targetContainer[metadataKey] = metadataValue;
};
Expand Down Expand Up @@ -69,26 +69,33 @@ function ensureDecorators(target){
}
}

interface MetadataType {
global: Object;
resource:string;
paramTypes:string;
properties:string;
}

/**
* Provides helpers for working with metadata.
*
* @class Metadata
* @static
*/
export var Metadata = {
export var Metadata : MetadataType = {
global: theGlobal,
resource:'aurelia:resource',
paramTypes:'design:paramtypes',
properties:'design:properties',
get(metadataKey:string, target:Function, targetKey:string){
get(metadataKey : string, target : Function, targetKey : string) : Object {
if(!target){
return undefined;
}

let result = Metadata.getOwn(metadataKey, target, targetKey);
return result === undefined ? Metadata.get(metadataKey, Object.getPrototypeOf(target), targetKey) : result;
},
getOwn(metadataKey:string, target:Function, targetKey:string){
getOwn(metadataKey : string, target : Function, targetKey : string) : Object {
if(!target){
return undefined;
}
Expand All @@ -99,10 +106,10 @@ export var Metadata = {

return Reflect.getOwnMetadata(metadataKey, target, targetKey);
},
define(metadataKey:string, metadataValue:string, target:Function, targetKey:string){
define(metadataKey : string, metadataValue : Object, target : Function, targetKey : string) : void {
Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey);
},
getOrCreateOwn(metadataKey:string, Type:Function, target:Function, targetKey:string){
getOrCreateOwn(metadataKey : string, Type : Function, target : Function, targetKey : string) : Object {
let result = Metadata.getOwn(metadataKey, target, targetKey);

if(result === undefined){
Expand All @@ -114,7 +121,7 @@ export var Metadata = {
}
}

var originStorage = new Map(),
let originStorage = new Map(),
unknownOrigin = Object.freeze({moduleId:undefined,moduleMember:undefined});

/**
Expand All @@ -126,7 +133,7 @@ var originStorage = new Map(),
* @param {string} moduleMember The name of the export in the origin module.
*/
export class Origin {
constructor(moduleId:string, moduleMember:string){
constructor(moduleId : string, moduleMember : string){
this.moduleId = moduleId;
this.moduleMember = moduleMember;
}
Expand All @@ -139,7 +146,7 @@ export class Origin {
* @param {Function} fn The function to inspect for Origin metadata.
* @return {Origin} Returns the Origin metadata.
*/
static get(fn:Function){
static get(fn : Function) : Origin {
var origin = originStorage.get(fn);

if(origin === undefined){
Expand Down Expand Up @@ -171,7 +178,7 @@ export class Origin {
* @param {origin} fn The Origin metadata to store on the function.
* @return {Origin} Returns the Origin metadata.
*/
static set(fn:Function, origin:Origin){
static set(fn : Function, origin : Origin) : void {
originStorage.set(fn, origin);
}
}
Expand All @@ -184,7 +191,7 @@ export class DecoratorApplicator {
this._rest = null;
}

decorator(decorator:Function):DecoratorApplicator{
decorator(decorator : Function) : DecoratorApplicator {
if(this._first === null){
this._first = decorator;
return this;
Expand All @@ -209,7 +216,7 @@ export class DecoratorApplicator {
return this;
}

_decorate(target:Function){
_decorate(target : Function) : void {
var i, ii, rest;

if(this._first !== null){
Expand All @@ -233,9 +240,17 @@ export class DecoratorApplicator {
}
}

export var Decorators = {
interface DecoratorsConfigType {

}

interface DecoratorsType {
configure : DecoratorsConfigType;
}

export let Decorators : DecoratorsType = {
configure: {
parameterizedDecorator(name:string, decorator:Function){
parameterizedDecorator(name : string, decorator : Function) : void {
Decorators[name] = function(){
var applicator = new DecoratorApplicator();
return applicator[name].apply(applicator, arguments);
Expand All @@ -246,7 +261,7 @@ export var Decorators = {
return this.decorator(result);
};
},
simpleDecorator(name:string, decorator:Function){
simpleDecorator(name : string, decorator : Function) : void {
Decorators[name] = function(){
return new DecoratorApplicator().decorator(decorator);
};
Expand Down
19 changes: 15 additions & 4 deletions dist/commonjs/aurelia-metadata.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
declare module 'aurelia-metadata' {
import core from 'core-js';
import * as core from 'core-js';
export interface MetadataType {
global: Object;
resource: string;
paramTypes: string;
properties: string;
}
export interface DecoratorsConfigType {
}
export interface DecoratorsType {
configure: DecoratorsConfigType;
}

/**
* Provides helpers for working with metadata.
Expand Down Expand Up @@ -28,7 +39,7 @@ declare module 'aurelia-metadata' {
* @param {Function} fn The function to inspect for Origin metadata.
* @return {Origin} Returns the Origin metadata.
*/
static get(fn: Function): any;
static get(fn: Function): Origin;

/**
* Set the Origin annotation for the specified function.
Expand All @@ -39,11 +50,11 @@ declare module 'aurelia-metadata' {
* @param {origin} fn The Origin metadata to store on the function.
* @return {Origin} Returns the Origin metadata.
*/
static set(fn: Function, origin: Origin): any;
static set(fn: Function, origin: Origin): void;
}
export class DecoratorApplicator {
constructor();
decorator(decorator: Function): DecoratorApplicator;
}
export var Decorators: any;
export let Decorators: any;
}
6 changes: 3 additions & 3 deletions dist/commonjs/aurelia-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

exports.__esModule = true;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
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; } }

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

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

var _coreJs2 = _interopRequireDefault(_coreJs);
var core = _interopRequireWildcard(_coreJs);

var theGlobal = (function () {
if (typeof self !== 'undefined') {
Expand Down Expand Up @@ -45,7 +45,7 @@ if (typeof theGlobal.Reflect.getOwnMetadata === 'undefined') {

if (typeof theGlobal.Reflect.defineMetadata === 'undefined') {
Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) {
var metadataContainer = target[metadataContainerKey] || (target[metadataContainerKey] = {});
var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {};
var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {});
targetContainer[metadataKey] = metadataValue;
};
Expand Down
19 changes: 15 additions & 4 deletions dist/es6/aurelia-metadata.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
declare module 'aurelia-metadata' {
import core from 'core-js';
import * as core from 'core-js';
export interface MetadataType {
global: Object;
resource: string;
paramTypes: string;
properties: string;
}
export interface DecoratorsConfigType {
}
export interface DecoratorsType {
configure: DecoratorsConfigType;
}

/**
* Provides helpers for working with metadata.
Expand Down Expand Up @@ -28,7 +39,7 @@ declare module 'aurelia-metadata' {
* @param {Function} fn The function to inspect for Origin metadata.
* @return {Origin} Returns the Origin metadata.
*/
static get(fn: Function): any;
static get(fn: Function): Origin;

/**
* Set the Origin annotation for the specified function.
Expand All @@ -39,11 +50,11 @@ declare module 'aurelia-metadata' {
* @param {origin} fn The Origin metadata to store on the function.
* @return {Origin} Returns the Origin metadata.
*/
static set(fn: Function, origin: Origin): any;
static set(fn: Function, origin: Origin): void;
}
export class DecoratorApplicator {
constructor();
decorator(decorator: Function): DecoratorApplicator;
}
export var Decorators: any;
export let Decorators: any;
}
Loading

0 comments on commit 1cc8134

Please sign in to comment.