Last active
August 28, 2016 07:44
-
-
Save godDLL/ee5d2e73d491d7c0d68bef130788b0f3 to your computer and use it in GitHub Desktop.
short ES2015 function class
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
(function(w){"use strict";var a=Object.assign=Object.assign||function assign(t){var i=0,s,key;while(s=arguments[i++])for(k in s)if(s.hasOwnProperty(k))t[k]=s[k];return t};w.ass=function(t,s){a(t.p,s);return t}})(window) |
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
// short ES2015 function class | |
(function (root, factory){ | |
'use strict' | |
if ('function' == typeof define && define.amd){ | |
define([], factory) | |
} else if ('object' == typeof module && module.exports){ | |
module.exports= factory() | |
} else | |
root.ass= factory() | |
}(this, function (){ | |
Object.assign= Object.assign || function assign (target){ | |
var i= 0, src, key | |
while (src= arguments[i++]) | |
for (key in src) | |
if (src.hasOwnProperty(key)) | |
target[key]= src[key] | |
return target | |
} | |
return function (type, share){ | |
Object.assign( type.prototype, share) | |
return type | |
} | |
})) |
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
{ | |
"name": "ass.js", | |
"version": "0.0.0", | |
"description": "short ES2015 function class", | |
"license": "MIT", | |
"keywords": [ | |
"class", | |
"ES6" | |
], | |
"main": "ass.js" | |
} |
Author
godDLL
commented
Aug 28, 2016
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment