项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

16 lines
498 B

  1. var $metadata = require('./_metadata');
  2. var anObject = require('./_an-object');
  3. var aFunction = require('./_a-function');
  4. var toMetaKey = $metadata.key;
  5. var ordinaryDefineOwnMetadata = $metadata.set;
  6. $metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {
  7. return function decorator(target, targetKey) {
  8. ordinaryDefineOwnMetadata(
  9. metadataKey, metadataValue,
  10. (targetKey !== undefined ? anObject : aFunction)(target),
  11. toMetaKey(targetKey)
  12. );
  13. };
  14. } });