2017-08-14 05:01:11 +02:00
|
|
|
var $metadata = require('./_metadata');
|
|
|
|
var anObject = require('./_an-object');
|
|
|
|
var aFunction = require('./_a-function');
|
|
|
|
var toMetaKey = $metadata.key;
|
|
|
|
var ordinaryDefineOwnMetadata = $metadata.set;
|
2017-05-28 00:38:50 +02:00
|
|
|
|
2017-08-14 05:01:11 +02:00
|
|
|
$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {
|
|
|
|
return function decorator(target, targetKey) {
|
2017-05-28 00:38:50 +02:00
|
|
|
ordinaryDefineOwnMetadata(
|
|
|
|
metadataKey, metadataValue,
|
|
|
|
(targetKey !== undefined ? anObject : aFunction)(target),
|
|
|
|
toMetaKey(targetKey)
|
|
|
|
);
|
|
|
|
};
|
2017-08-14 05:01:11 +02:00
|
|
|
} });
|