diff --git a/.gitignore b/.gitignore index 3c3629e..f06235c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +dist diff --git a/dist/trimkit.js b/dist/trimkit.js deleted file mode 100644 index 37dcb52..0000000 --- a/dist/trimkit.js +++ /dev/null @@ -1,129 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (factory((global.Trimkit = global.Trimkit || {}))); -}(this, function (exports) { 'use strict'; - - // Copyright (c) 2016 Timothy Farrell - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - // ES5 output: var a=void 0; - // Invocation comparison: undefined ~~~ a - // Size delta per invocation: 9 - 1 = 8 bytes - // Size saved after: ceil(13 / 8) = 2 usages - const Undefined = void 0; - - // ES5 output: var a=requestAnimationFrame; - // Invocation comparison: requestAnimationFrame(b) ~~~ a(b) - // Size delta per invocation: 24 - 4 = 20 bytes - // Size saved after: ceil(28 / 20) = 2 usages - const requestAnimationFrame = self.requestAnimationFrame; - - // ES5 output: var a=Array.isArray; - // Invocation comparison: Array.isArray(b) ~~~ a(b) - // Size delta per invocation: 16 - 4 = 12 bytes - // Size saved after: ceil(20 / 12) = 2 usages - const isArray = Array.isArray; - - // ES5 output: var a=Array.from; - // Invocation comparison: Array.from(b) ~~~ a(b) - // Size delta per invocation: 13 - 4 = 9 bytes - // Size saved after: ceil(17 / 9) = 2 usages - const asArray = Array.from; - - // ES5 output: var a=Object.keys; - // Invocation comparison: Object.Keys(b) ~~~ a(b) - // Size delta per invocation: 14 - 4 = 10 bytes - // Size saved after: ceil(18 / 10) = 2 usages - const ObjectKeys = Object.keys; - - // ES5 output: var a=self.document; - // Invocation comparison: document ~~~ a - // Size delta per invocation: 8 - 1 = 7 bytes - // Size saved after: ceil(20 / 7) = 3 usages - const DOMDocument = self.document; - - // ES5 output: function a(b){return"function"===typeof b}; - // Invocation comparison: typeof a==='function' ~~~ a(b) - // Size delta per invocation: 21 - 4 = 17 bytes - // Size saved after: ceil(43 / 17) = 3 usages - function isFunction(obj) { - return typeof obj === 'function'; - } - - // ES5 output: function a(b){return"string"===typeof b}; - // Invocation comparison: typeof a==='string' ~~~ a(b) - // Size delta per invocation: 19 - 4 = 15 bytes - // Size saved after: ceil(41 / 15) = 3 usages - function isString(obj) { - return typeof obj === 'string'; - } - - // ES5 output: function a(b){return"number"===typeof b}; - // Invocation comparison: typeof a==='number' ~~~ a(b) - // Size delta per invocation: 19 - 4 = 15 bytes - // Size saved after: ceil(41 / 15) = 3 usages - function isNumber(obj) { - return typeof obj === 'number'; - } - - // ES5 declaration: var a=null; - // Invocation comparison: null ~~~ a - // Size delta per invocation: 4 - 1 = 3 bytes - // Size saved after: ceil(11 / 3) = 4 usages - const Null = null; - - // ES5 output: function a(b){return void 0===b}; - // Invocation comparison: b===undefined ~~~ a(b) - // Size delta per invocation: 13 - 4 = 9 bytes - // Size saved after: ceil(33 / 9) = 4 usages - function isUndefined(a) { - return a === undefined; - } - - // ES5 output: function a(b,c){return a.apply(b,c)}; - // Invocation comparison A: a.apply(b,c,d) ~~~ a(b,c,d) - // Invocation comparison B: a.apply(b,c) ~~~ a(b,c) - // Size delta per invocation A: 14 - 8 = 6 bytes - // Size delta per invocation B: 12 - 6 = 6 bytes - // Size saved after: ceil(37 / 6) = 7 usages - function apply(obj, context, params) { - return obj.apply(context, params); - } - - // ES5 output: function a(b){return null===b}; - // Invocation comparison: b===null ~~~ a(b) - // Size delta per invocation: 8 - 4 = 4 bytes - // Size saved after: ceil(31 / 4) = 8 usages - function isNull(a) { - return a === null; - } - - exports.Undefined = Undefined; - exports.requestAnimationFrame = requestAnimationFrame; - exports.isArray = isArray; - exports.asArray = asArray; - exports.ObjectKeys = ObjectKeys; - exports.DOMDocument = DOMDocument; - exports.isFunction = isFunction; - exports.isString = isString; - exports.isNumber = isNumber; - exports.Null = Null; - exports.isUndefined = isUndefined; - exports.apply = apply; - exports.isNull = isNull; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); \ No newline at end of file diff --git a/dist/trimkit.min.js b/dist/trimkit.min.js deleted file mode 100644 index ab97076..0000000 --- a/dist/trimkit.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.Trimkit=e.Trimkit||{})}(this,function(e){"use strict";function n(e){return"function"==typeof e}function t(e){return"string"==typeof e}function i(e){return"number"==typeof e}function r(e){return void 0===e}function o(e,n,t){return e.apply(n,t)}function u(e){return null===e}const f=void 0,s=self.requestAnimationFrame,c=Array.isArray,d=Array.from,y=Object.keys,l=self.document,a=null;e.Undefined=f,e.requestAnimationFrame=s,e.isArray=c,e.asArray=d,e.ObjectKeys=y,e.DOMDocument=l,e.isFunction=n,e.isString=t,e.isNumber=i,e.Null=a,e.isUndefined=r,e.apply=o,e.isNull=u,Object.defineProperty(e,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/dist/trimkit.min.js.gz b/dist/trimkit.min.js.gz deleted file mode 100644 index 42dce8d..0000000 Binary files a/dist/trimkit.min.js.gz and /dev/null differ diff --git a/package.json b/package.json index 11fc076..65b71d0 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "description": "Javascript and DOM abstractions for smaller minifiable code", "main": "src/index.js", + "jsnext:main": "src/index.js", "files": [ "dist", "src"