diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..e4e8dd0 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,45 @@ +version: 2.1 + +map-1: &filter_only_develop + filters: + branches: + only: develop + +map-2: &filter_only_tag + filters: + branches: + ignore: /.*/ + tags: + only: /^v?[0-9]+(\.[0-9]+)*$/ + +orbs: + v1: aurelia/v1@volatile + +workflows: + main: + jobs: + - v1/build_test + - v1/build_merge: + <<: *filter_only_develop + requires: + - v1/build_test + - v1/npm_publish: + <<: *filter_only_tag + name: npm_publish_dry + args: "--dry-run" + - request_publish_latest: + <<: *filter_only_tag + type: approval + requires: + - npm_publish_dry + - v1/npm_publish: + <<: *filter_only_tag + name: npm_publish + context: Aurelia + requires: + - request_publish_latest + - v1/merge_back: + <<: *filter_only_tag + requires: + - npm_publish + diff --git a/.gitignore b/.gitignore index 76489e1..99de32e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ bower_components .idea .DS_STORE build/reports +dist diff --git a/dist/amd/aurelia-polyfills.js b/dist/amd/aurelia-polyfills.js deleted file mode 100644 index e7087f9..0000000 --- a/dist/amd/aurelia-polyfills.js +++ /dev/null @@ -1,857 +0,0 @@ -define(['aurelia-pal'], function (_aureliaPal) { - 'use strict'; - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; - } : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; - }; - - if (typeof FEATURE_NO_ES2015 === 'undefined') { - - (function (Object, GOPS) { - 'use strict'; - - if (GOPS in Object) return; - - var setDescriptor, - G = _aureliaPal.PLATFORM.global, - id = 0, - random = '' + Math.random(), - prefix = '__\x01symbol:', - prefixLength = prefix.length, - internalSymbol = '__\x01symbol@@' + random, - DP = 'defineProperty', - DPies = 'defineProperties', - GOPN = 'getOwnPropertyNames', - GOPD = 'getOwnPropertyDescriptor', - PIE = 'propertyIsEnumerable', - gOPN = Object[GOPN], - gOPD = Object[GOPD], - create = Object.create, - keys = Object.keys, - defineProperty = Object[DP], - $defineProperties = Object[DPies], - descriptor = gOPD(Object, GOPN), - ObjectProto = Object.prototype, - hOP = ObjectProto.hasOwnProperty, - pIE = ObjectProto[PIE], - toString = ObjectProto.toString, - indexOf = Array.prototype.indexOf || function (v) { - for (var i = this.length; i-- && this[i] !== v;) {} - return i; - }, - addInternalIfNeeded = function addInternalIfNeeded(o, uid, enumerable) { - if (!hOP.call(o, internalSymbol)) { - defineProperty(o, internalSymbol, { - enumerable: false, - configurable: false, - writable: false, - value: {} - }); - } - o[internalSymbol]['@@' + uid] = enumerable; - }, - createWithSymbols = function createWithSymbols(proto, descriptors) { - var self = create(proto); - if (descriptors !== null && (typeof descriptors === 'undefined' ? 'undefined' : _typeof(descriptors)) === 'object') { - gOPN(descriptors).forEach(function (key) { - if (propertyIsEnumerable.call(descriptors, key)) { - $defineProperty(self, key, descriptors[key]); - } - }); - } - return self; - }, - copyAsNonEnumerable = function copyAsNonEnumerable(descriptor) { - var newDescriptor = create(descriptor); - newDescriptor.enumerable = false; - return newDescriptor; - }, - get = function get() {}, - onlyNonSymbols = function onlyNonSymbols(name) { - return name != internalSymbol && !hOP.call(source, name); - }, - onlySymbols = function onlySymbols(name) { - return name != internalSymbol && hOP.call(source, name); - }, - propertyIsEnumerable = function propertyIsEnumerable(key) { - var uid = '' + key; - return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol] && this[internalSymbol]['@@' + uid] : pIE.call(this, key); - }, - setAndGetSymbol = function setAndGetSymbol(uid) { - var descriptor = { - enumerable: false, - configurable: true, - get: get, - set: function set(value) { - setDescriptor(this, uid, { - enumerable: false, - configurable: true, - writable: true, - value: value - }); - addInternalIfNeeded(this, uid, true); - } - }; - defineProperty(ObjectProto, uid, descriptor); - return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor); - }, - _Symbol = function _Symbol2(description) { - if (this && this !== G) { - throw new TypeError('Symbol is not a constructor'); - } - return setAndGetSymbol(prefix.concat(description || '', random, ++id)); - }, - source = create(null), - sourceConstructor = { value: _Symbol }, - sourceMap = function sourceMap(uid) { - return source[uid]; - }, - $defineProperty = function defineProp(o, key, descriptor) { - var uid = '' + key; - if (onlySymbols(uid)) { - setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor); - addInternalIfNeeded(o, uid, !!descriptor.enumerable); - } else { - defineProperty(o, key, descriptor); - } - return o; - }, - $getOwnPropertySymbols = function getOwnPropertySymbols(o) { - var cof = toString.call(o); - o = cof === '[object String]' ? o.split('') : Object(o); - return gOPN(o).filter(onlySymbols).map(sourceMap); - }; - - descriptor.value = $defineProperty; - defineProperty(Object, DP, descriptor); - - descriptor.value = $getOwnPropertySymbols; - defineProperty(Object, GOPS, descriptor); - - var cachedWindowNames = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' ? Object.getOwnPropertyNames(window) : []; - var originalObjectGetOwnPropertyNames = Object.getOwnPropertyNames; - descriptor.value = function getOwnPropertyNames(o) { - if (toString.call(o) === '[object Window]') { - try { - return originalObjectGetOwnPropertyNames(o); - } catch (e) { - return [].concat([], cachedWindowNames); - } - } - return gOPN(o).filter(onlyNonSymbols); - }; - defineProperty(Object, GOPN, descriptor); - - descriptor.value = function defineProperties(o, descriptors) { - var symbols = $getOwnPropertySymbols(descriptors); - if (symbols.length) { - keys(descriptors).concat(symbols).forEach(function (uid) { - if (propertyIsEnumerable.call(descriptors, uid)) { - $defineProperty(o, uid, descriptors[uid]); - } - }); - } else { - $defineProperties(o, descriptors); - } - return o; - }; - defineProperty(Object, DPies, descriptor); - - descriptor.value = propertyIsEnumerable; - defineProperty(ObjectProto, PIE, descriptor); - - descriptor.value = _Symbol; - defineProperty(G, 'Symbol', descriptor); - - descriptor.value = function (key) { - var uid = prefix.concat(prefix, key, random); - return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); - }; - defineProperty(_Symbol, 'for', descriptor); - - descriptor.value = function (symbol) { - return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; - }; - defineProperty(_Symbol, 'keyFor', descriptor); - - descriptor.value = function getOwnPropertyDescriptor(o, key) { - var descriptor = gOPD(o, key); - if (descriptor && onlySymbols(key)) { - descriptor.enumerable = propertyIsEnumerable.call(o, key); - } - return descriptor; - }; - defineProperty(Object, GOPD, descriptor); - - descriptor.value = function (proto, descriptors) { - return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); - }; - defineProperty(Object, 'create', descriptor); - - descriptor.value = function () { - var str = toString.call(this); - return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; - }; - defineProperty(ObjectProto, 'toString', descriptor); - - try { - setDescriptor = create(defineProperty({}, prefix, { - get: function get() { - return defineProperty(this, prefix, { value: false })[prefix]; - } - }))[prefix] || defineProperty; - } catch (o_O) { - setDescriptor = function setDescriptor(o, key, descriptor) { - var protoDescriptor = gOPD(ObjectProto, key); - delete ObjectProto[key]; - defineProperty(o, key, descriptor); - defineProperty(ObjectProto, key, protoDescriptor); - }; - } - })(Object, 'getOwnPropertySymbols'); - - (function (O, S) { - var dP = O.defineProperty, - ObjectProto = O.prototype, - toString = ObjectProto.toString, - toStringTag = 'toStringTag', - descriptor; - ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) { - if (!(name in Symbol)) { - dP(Symbol, name, { value: Symbol(name) }); - switch (name) { - case toStringTag: - descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); - descriptor.value = function () { - var str = toString.call(this), - tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag]; - return typeof tst === 'undefined' ? str : '[object ' + tst + ']'; - }; - dP(ObjectProto, 'toString', descriptor); - break; - } - } - }); - })(Object, Symbol); - - (function (Si, AP, SP) { - - function returnThis() { - return this; - } - - if (!AP[Si]) AP[Si] = function () { - var i = 0, - self = this, - iterator = { - next: function next() { - var done = self.length <= i; - return done ? { done: done } : { done: done, value: self[i++] }; - } - }; - iterator[Si] = returnThis; - return iterator; - }; - - if (!SP[Si]) SP[Si] = function () { - var fromCodePoint = String.fromCodePoint, - self = this, - i = 0, - length = self.length, - iterator = { - next: function next() { - var done = length <= i, - c = done ? '' : fromCodePoint(self.codePointAt(i)); - i += c.length; - return done ? { done: done } : { done: done, value: c }; - } - }; - iterator[Si] = returnThis; - return iterator; - }; - })(Symbol.iterator, Array.prototype, String.prototype); - } - - if (typeof FEATURE_NO_ES2015 === 'undefined') { - - Number.isNaN = Number.isNaN || function (value) { - return value !== value; - }; - - Number.isFinite = Number.isFinite || function (value) { - return typeof value === "number" && isFinite(value); - }; - } - - if (!String.prototype.endsWith || function () { - try { - return !"ab".endsWith("a", 1); - } catch (e) { - return true; - } - }()) { - String.prototype.endsWith = function (searchString, position) { - var subjectString = this.toString(); - if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { - position = subjectString.length; - } - position -= searchString.length; - var lastIndex = subjectString.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; - } - - if (!String.prototype.startsWith || function () { - try { - return !"ab".startsWith("b", 1); - } catch (e) { - return true; - } - }()) { - String.prototype.startsWith = function (searchString, position) { - position = position || 0; - return this.substr(position, searchString.length) === searchString; - }; - } - - if (typeof FEATURE_NO_ES2015 === 'undefined') { - - if (!Array.from) { - Array.from = function () { - var toInteger = function toInteger(it) { - return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); - }; - var toLength = function toLength(it) { - return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; - }; - var iterCall = function iterCall(iter, fn, val, index) { - try { - return fn(val, index); - } catch (E) { - if (typeof iter.return == 'function') iter.return(); - throw E; - } - }; - - return function from(arrayLike) { - var O = Object(arrayLike), - C = typeof this == 'function' ? this : Array, - aLen = arguments.length, - mapfn = aLen > 1 ? arguments[1] : undefined, - mapping = mapfn !== undefined, - index = 0, - iterFn = O[Symbol.iterator], - length, - result, - step, - iterator; - if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); - if (iterFn != undefined && !Array.isArray(arrayLike)) { - for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { - result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; - } - } else { - length = toLength(O.length); - for (result = new C(length); length > index; index++) { - result[index] = mapping ? mapfn(O[index], index) : O[index]; - } - } - result.length = index; - return result; - }; - }(); - } - - if (!Array.prototype.find) { - Object.defineProperty(Array.prototype, 'find', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.find called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return value; - } - } - return undefined; - } - }); - } - - if (!Array.prototype.findIndex) { - Object.defineProperty(Array.prototype, 'findIndex', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.findIndex called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return i; - } - } - return -1; - } - }); - } - } - - if (typeof FEATURE_NO_ES2016 === 'undefined' && !Array.prototype.includes) { - Object.defineProperty(Array.prototype, 'includes', { - configurable: true, - writable: true, - enumerable: false, - value: function value(searchElement) { - var O = Object(this); - var len = parseInt(O.length) || 0; - if (len === 0) { - return false; - } - var n = parseInt(arguments[1]) || 0; - var k; - if (n >= 0) { - k = n; - } else { - k = len + n; - if (k < 0) { - k = 0; - } - } - var currentElement; - while (k < len) { - currentElement = O[k]; - if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) { - return true; - } - k++; - } - return false; - } - }); - } - - if (typeof FEATURE_NO_ES2015 === 'undefined') { - - (function () { - var needsFix = false; - - try { - var s = Object.keys('a'); - needsFix = s.length !== 1 || s[0] !== '0'; - } catch (e) { - needsFix = true; - } - - if (needsFix) { - Object.keys = function () { - var hasOwnProperty = Object.prototype.hasOwnProperty, - hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), - dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], - dontEnumsLength = dontEnums.length; - - return function (obj) { - if (obj === undefined || obj === null) { - throw TypeError('Cannot convert undefined or null to object'); - } - - obj = Object(obj); - - var result = [], - prop, - i; - - for (prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - result.push(prop); - } - } - - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); - } - } - } - - return result; - }; - }(); - } - })(); - - (function (O) { - if ('assign' in O) { - return; - } - - O.defineProperty(O, 'assign', { - configurable: true, - writable: true, - value: function () { - var gOPS = O.getOwnPropertySymbols, - pIE = O.propertyIsEnumerable, - filterOS = gOPS ? function (self) { - return gOPS(self).filter(pIE, self); - } : function () { - return Array.prototype; - }; - - return function assign(where) { - if (gOPS && !(where instanceof O)) { - console.warn('problematic Symbols', where); - } - - function set(keyOrSymbol) { - where[keyOrSymbol] = arg[keyOrSymbol]; - } - - for (var i = 1, ii = arguments.length; i < ii; ++i) { - var arg = arguments[i]; - - if (arg === null || arg === undefined) { - continue; - } - - O.keys(arg).concat(filterOS(arg)).forEach(set); - } - - return where; - }; - }() - }); - })(Object); - - if (!Object.is) { - Object.is = function (x, y) { - if (x === y) { - return x !== 0 || 1 / x === 1 / y; - } else { - return x !== x && y !== y; - } - }; - } - } - - if (typeof FEATURE_NO_ES2015 === 'undefined') { - - (function (global) { - var i; - - var defineProperty = Object.defineProperty, - is = function is(a, b) { - return a === b || a !== a && b !== b; - }; - - if (typeof WeakMap == 'undefined') { - global.WeakMap = createCollection({ - 'delete': sharedDelete, - - clear: sharedClear, - - get: sharedGet, - - has: mapHas, - - set: sharedSet - }, true); - } - - if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { - var _createCollection; - - global.Map = createCollection((_createCollection = { - 'delete': sharedDelete, - - has: mapHas, - - get: sharedGet, - - set: sharedSet, - - keys: sharedKeys, - - values: sharedValues, - - entries: mapEntries, - - forEach: sharedForEach, - - clear: sharedClear - }, _createCollection[Symbol.iterator] = mapEntries, _createCollection)); - } - - if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { - var _createCollection2; - - global.Set = createCollection((_createCollection2 = { - has: setHas, - - add: sharedAdd, - - 'delete': sharedDelete, - - clear: sharedClear, - - keys: sharedValues, - values: sharedValues, - - entries: setEntries, - - forEach: sharedForEach - }, _createCollection2[Symbol.iterator] = sharedValues, _createCollection2)); - } - - if (typeof WeakSet == 'undefined') { - global.WeakSet = createCollection({ - 'delete': sharedDelete, - - add: sharedAdd, - - clear: sharedClear, - - has: setHas - }, true); - } - - function createCollection(proto, objectOnly) { - function Collection(a) { - if (!this || this.constructor !== Collection) return new Collection(a); - this._keys = []; - this._values = []; - this._itp = []; - this.objectOnly = objectOnly; - - if (a) init.call(this, a); - } - - if (!objectOnly) { - defineProperty(proto, 'size', { - get: sharedSize - }); - } - - proto.constructor = Collection; - Collection.prototype = proto; - - return Collection; - } - - function init(a) { - var i; - - if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { - this.set(a[0], a[1]); - }, this); - } - - function sharedDelete(key) { - if (this.has(key)) { - this._keys.splice(i, 1); - this._values.splice(i, 1); - - this._itp.forEach(function (p) { - if (i < p[0]) p[0]--; - }); - } - - return -1 < i; - }; - - function sharedGet(key) { - return this.has(key) ? this._values[i] : undefined; - } - - function has(list, key) { - if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); - - if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); - return -1 < i; - } - - function setHas(value) { - return has.call(this, this._values, value); - } - - function mapHas(value) { - return has.call(this, this._keys, value); - } - - function sharedSet(key, value) { - this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; - return this; - } - - function sharedAdd(value) { - if (!this.has(value)) this._values.push(value); - return this; - } - - function sharedClear() { - (this._keys || 0).length = this._values.length = 0; - } - - function sharedKeys() { - return sharedIterator(this._itp, this._keys); - } - - function sharedValues() { - return sharedIterator(this._itp, this._values); - } - - function mapEntries() { - return sharedIterator(this._itp, this._keys, this._values); - } - - function setEntries() { - return sharedIterator(this._itp, this._values, this._values); - } - - function sharedIterator(itp, array, array2) { - var _ref; - - var p = [0], - done = false; - itp.push(p); - return _ref = {}, _ref[Symbol.iterator] = function () { - return this; - }, _ref.next = function next() { - var v, - k = p[0]; - if (!done && k < array.length) { - v = array2 ? [array[k], array2[k]] : array[k]; - p[0]++; - } else { - done = true; - itp.splice(itp.indexOf(p), 1); - } - return { done: done, value: v }; - }, _ref; - } - - function sharedSize() { - return this._values.length; - } - - function sharedForEach(callback, context) { - var it = this.entries(); - for (;;) { - var r = it.next(); - if (r.done) break; - callback.call(context, r.value[1], r.value[0], this); - } - } - })(_aureliaPal.PLATFORM.global); - } - - if (typeof FEATURE_NO_ES2015 === 'undefined') { - (function () { - - var bind = Function.prototype.bind; - - if (typeof _aureliaPal.PLATFORM.global.Reflect === 'undefined') { - _aureliaPal.PLATFORM.global.Reflect = {}; - } - - if (typeof Reflect.defineProperty !== 'function') { - Reflect.defineProperty = function (target, propertyKey, descriptor) { - if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' ? target === null : typeof target !== 'function') { - throw new TypeError('Reflect.defineProperty called on non-object'); - } - try { - Object.defineProperty(target, propertyKey, descriptor); - return true; - } catch (e) { - return false; - } - }; - } - - if (typeof Reflect.construct !== 'function') { - Reflect.construct = function (Target, args) { - if (args) { - switch (args.length) { - case 0: - return new Target(); - case 1: - return new Target(args[0]); - case 2: - return new Target(args[0], args[1]); - case 3: - return new Target(args[0], args[1], args[2]); - case 4: - return new Target(args[0], args[1], args[2], args[3]); - } - } - - var a = [null]; - a.push.apply(a, args); - return new (bind.apply(Target, a))(); - }; - } - - if (typeof Reflect.ownKeys !== 'function') { - Reflect.ownKeys = function (o) { - return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); - }; - } - })(); - } - - if (typeof FEATURE_NO_ESNEXT === 'undefined') { - (function () { - - var emptyMetadata = Object.freeze({}); - var metadataContainerKey = '__metadata__'; - - if (typeof Reflect.getOwnMetadata !== 'function') { - Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { - if (target.hasOwnProperty(metadataContainerKey)) { - return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; - } - }; - } - - if (typeof Reflect.defineMetadata !== 'function') { - Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { - var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; - var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); - targetContainer[metadataKey] = metadataValue; - }; - } - - if (typeof Reflect.metadata !== 'function') { - Reflect.metadata = function (metadataKey, metadataValue) { - return function (target, targetKey) { - Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); - }; - }; - } - })(); - } -}); \ No newline at end of file diff --git a/dist/amd/index.js b/dist/amd/index.js deleted file mode 100644 index 0a8c06a..0000000 --- a/dist/amd/index.js +++ /dev/null @@ -1,16 +0,0 @@ -define(['exports', './aurelia-polyfills'], function (exports, _aureliaPolyfills) { - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - Object.keys(_aureliaPolyfills).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _aureliaPolyfills[key]; - } - }); - }); -}); \ No newline at end of file diff --git a/dist/aurelia-polyfills.d.ts b/dist/aurelia-polyfills.d.ts deleted file mode 100644 index 1f2932e..0000000 --- a/dist/aurelia-polyfills.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { - PLATFORM -} from 'aurelia-pal'; \ No newline at end of file diff --git a/dist/aurelia-polyfills.js b/dist/aurelia-polyfills.js deleted file mode 100644 index 2f16b1a..0000000 --- a/dist/aurelia-polyfills.js +++ /dev/null @@ -1,941 +0,0 @@ -import {PLATFORM} from 'aurelia-pal'; - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - -(function (Object, GOPS) {'use strict'; - - // (C) Andrea Giammarchi - Mit Style - - if (GOPS in Object) return; - - var - setDescriptor, - G = PLATFORM.global, - id = 0, - random = '' + Math.random(), - prefix = '__\x01symbol:', - prefixLength = prefix.length, - internalSymbol = '__\x01symbol@@' + random, - DP = 'defineProperty', - DPies = 'defineProperties', - GOPN = 'getOwnPropertyNames', - GOPD = 'getOwnPropertyDescriptor', - PIE = 'propertyIsEnumerable', - gOPN = Object[GOPN], - gOPD = Object[GOPD], - create = Object.create, - keys = Object.keys, - defineProperty = Object[DP], - $defineProperties = Object[DPies], - descriptor = gOPD(Object, GOPN), - ObjectProto = Object.prototype, - hOP = ObjectProto.hasOwnProperty, - pIE = ObjectProto[PIE], - toString = ObjectProto.toString, - indexOf = Array.prototype.indexOf || function (v) { - for (var i = this.length; i-- && this[i] !== v;) {} - return i; - }, - addInternalIfNeeded = function (o, uid, enumerable) { - if (!hOP.call(o, internalSymbol)) { - defineProperty(o, internalSymbol, { - enumerable: false, - configurable: false, - writable: false, - value: {} - }); - } - o[internalSymbol]['@@' + uid] = enumerable; - }, - createWithSymbols = function (proto, descriptors) { - var self = create(proto); - if (descriptors !== null && typeof descriptors === 'object') { - gOPN(descriptors).forEach(function (key) { - if (propertyIsEnumerable.call(descriptors, key)) { - $defineProperty(self, key, descriptors[key]); - } - }); - } - return self; - }, - copyAsNonEnumerable = function (descriptor) { - var newDescriptor = create(descriptor); - newDescriptor.enumerable = false; - return newDescriptor; - }, - get = function get(){}, - onlyNonSymbols = function (name) { - return name != internalSymbol && - !hOP.call(source, name); - }, - onlySymbols = function (name) { - return name != internalSymbol && - hOP.call(source, name); - }, - propertyIsEnumerable = function propertyIsEnumerable(key) { - var uid = '' + key; - return onlySymbols(uid) ? ( - hOP.call(this, uid) && - this[internalSymbol] && - this[internalSymbol]['@@' + uid] - ) : pIE.call(this, key); - }, - setAndGetSymbol = function (uid) { - var descriptor = { - enumerable: false, - configurable: true, - get: get, - set: function (value) { - setDescriptor(this, uid, { - enumerable: false, - configurable: true, - writable: true, - value: value - }); - addInternalIfNeeded(this, uid, true); - } - }; - defineProperty(ObjectProto, uid, descriptor); - return (source[uid] = defineProperty( - Object(uid), - 'constructor', - sourceConstructor - )); - }, - Symbol = function Symbol(description) { - if (this && this !== G) { - throw new TypeError('Symbol is not a constructor'); - } - return setAndGetSymbol( - prefix.concat(description || '', random, ++id) - ); - }, - source = create(null), - sourceConstructor = {value: Symbol}, - sourceMap = function (uid) { - return source[uid]; - }, - $defineProperty = function defineProp(o, key, descriptor) { - var uid = '' + key; - if (onlySymbols(uid)) { - setDescriptor(o, uid, descriptor.enumerable ? - copyAsNonEnumerable(descriptor) : descriptor); - addInternalIfNeeded(o, uid, !!descriptor.enumerable); - } else { - defineProperty(o, key, descriptor); - } - return o; - }, - $getOwnPropertySymbols = function getOwnPropertySymbols(o) { - var cof = toString.call(o); - o = (cof === '[object String]') ? o.split('') : Object(o); - return gOPN(o).filter(onlySymbols).map(sourceMap); - } - ; - - descriptor.value = $defineProperty; - defineProperty(Object, DP, descriptor); - - descriptor.value = $getOwnPropertySymbols; - defineProperty(Object, GOPS, descriptor); - - var cachedWindowNames = typeof window === 'object' ? Object.getOwnPropertyNames(window) : []; - var originalObjectGetOwnPropertyNames = Object.getOwnPropertyNames; - descriptor.value = function getOwnPropertyNames(o) { - if (toString.call(o) === '[object Window]') { - try { - return originalObjectGetOwnPropertyNames(o); - } catch (e) { - // IE bug where layout engine calls userland gOPN for cross-domain "window" objects  - return [].concat([], cachedWindowNames); - } - } - return gOPN(o).filter(onlyNonSymbols); - }; - defineProperty(Object, GOPN, descriptor); - - descriptor.value = function defineProperties(o, descriptors) { - var symbols = $getOwnPropertySymbols(descriptors); - if (symbols.length) { - keys(descriptors).concat(symbols).forEach(function (uid) { - if (propertyIsEnumerable.call(descriptors, uid)) { - $defineProperty(o, uid, descriptors[uid]); - } - }); - } else { - $defineProperties(o, descriptors); - } - return o; - }; - defineProperty(Object, DPies, descriptor); - - descriptor.value = propertyIsEnumerable; - defineProperty(ObjectProto, PIE, descriptor); - - descriptor.value = Symbol; - defineProperty(G, 'Symbol', descriptor); - - // defining `Symbol.for(key)` - descriptor.value = function (key) { - var uid = prefix.concat(prefix, key, random); - return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); - }; - defineProperty(Symbol, 'for', descriptor); - - // defining `Symbol.keyFor(symbol)` - descriptor.value = function (symbol) { - return hOP.call(source, symbol) ? - symbol.slice(prefixLength * 2, -random.length) : - void 0 - ; - }; - defineProperty(Symbol, 'keyFor', descriptor); - - descriptor.value = function getOwnPropertyDescriptor(o, key) { - var descriptor = gOPD(o, key); - if (descriptor && onlySymbols(key)) { - descriptor.enumerable = propertyIsEnumerable.call(o, key); - } - return descriptor; - }; - defineProperty(Object, GOPD, descriptor); - - descriptor.value = function (proto, descriptors) { - return arguments.length === 1 ? - create(proto) : - createWithSymbols(proto, descriptors); - }; - defineProperty(Object, 'create', descriptor); - - descriptor.value = function () { - var str = toString.call(this); - return (str === '[object String]' && onlySymbols(this)) ? '[object Symbol]' : str; - }; - defineProperty(ObjectProto, 'toString', descriptor); - - try { // fails in few pre ES 5.1 engines - setDescriptor = create( - defineProperty( - {}, - prefix, - { - get: function () { - return defineProperty(this, prefix, {value: false})[prefix]; - } - } - ) - )[prefix] || defineProperty; - } catch(o_O) { - setDescriptor = function (o, key, descriptor) { - var protoDescriptor = gOPD(ObjectProto, key); - delete ObjectProto[key]; - defineProperty(o, key, descriptor); - defineProperty(ObjectProto, key, protoDescriptor); - }; - } - -}(Object, 'getOwnPropertySymbols')); - -(function (O, S) { - var - dP = O.defineProperty, - ObjectProto = O.prototype, - toString = ObjectProto.toString, - toStringTag = 'toStringTag', - descriptor - ; - [ - 'iterator', // A method returning the default iterator for an object. Used by for...of. - 'match', // A method that matches against a string, also used to determine if an object may be used as a regular expression. Used by String.prototype.match(). - 'replace', // A method that replaces matched substrings of a string. Used by String.prototype.replace(). - 'search', // A method that returns the index within a string that matches the regular expression. Used by String.prototype.search(). - 'split', // A method that splits a string at the indices that match a regular expression. Used by String.prototype.split(). - 'hasInstance', // A method determining if a constructor object recognizes an object as its instance. Used by instanceof. - 'isConcatSpreadable', // A Boolean value indicating if an object should be flattened to its array elements. Used by Array.prototype.concat(). - 'unscopables', // An Array of string values that are property values. These are excluded from the with environment bindings of the associated objects. - 'species', // A constructor function that is used to create derived objects. - 'toPrimitive', // A method converting an object to a primitive value. - toStringTag // A string value used for the default description of an object. Used by Object.prototype.toString(). - ].forEach(function (name) { - if (!(name in Symbol)) { - dP(Symbol, name, {value: Symbol(name)}); - switch (name) { - case toStringTag: - descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); - descriptor.value = function () { - var - str = toString.call(this), - tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag] - ; - return typeof tst === 'undefined' ? str : ('[object ' + tst + ']'); - }; - dP(ObjectProto, 'toString', descriptor); - break; - } - } - }); -}(Object, Symbol)); - -(function (Si, AP, SP) { - - function returnThis() { return this; } - - // make Arrays usable as iterators - // so that other iterables can copy same logic - if (!AP[Si]) AP[Si] = function () { - var - i = 0, - self = this, - iterator = { - next: function next() { - var done = self.length <= i; - return done ? - {done: done} : - {done: done, value: self[i++]}; - } - } - ; - iterator[Si] = returnThis; - return iterator; - }; - - // make Strings usable as iterators - // to simplify Array.from and - if (!SP[Si]) SP[Si] = function () { - var - fromCodePoint = String.fromCodePoint, - self = this, - i = 0, - length = self.length, - iterator = { - next: function next() { - var - done = length <= i, - c = done ? '' : fromCodePoint(self.codePointAt(i)) - ; - i += c.length; - return done ? - {done: done} : - {done: done, value: c}; - } - } - ; - iterator[Si] = returnThis; - return iterator; - }; - -}(Symbol.iterator, Array.prototype, String.prototype)); - - -} // endif FEATURE_NO_ES2015 - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - -Number.isNaN = Number.isNaN || function(value) { - return value !== value; -}; - -Number.isFinite = Number.isFinite || function(value) { - return typeof value === "number" && isFinite(value); -}; - -} // endif FEATURE_NO_ES2015 - -if ((!String.prototype.endsWith) || ((function() { try { return !("ab".endsWith("a",1)); } catch (e) { return true; } } )())) { - String.prototype.endsWith = function(searchString, position) { - let subjectString = this.toString(); - if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { - position = subjectString.length; - } - position -= searchString.length; - let lastIndex = subjectString.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; -} - -if ((!String.prototype.startsWith) || ((function() { try { return !("ab".startsWith("b", 1)); } catch (e) { return true; } } )())) { - String.prototype.startsWith = function(searchString, position){ - position = position || 0; - return this.substr(position, searchString.length) === searchString; - }; -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - -if (!Array.from) { - Array.from = (function () { - var toInteger = function(it) { - return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); - }; - var toLength = function(it) { - return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 - }; - var iterCall = function(iter, fn, val, index) { - try { - return fn(val, index) - } - catch (E) { - if (typeof iter.return == 'function') iter.return(); - throw E; - } - }; - - // The length property of the from method is 1. - return function from(arrayLike/*, mapFn, thisArg */) { - var O = Object(arrayLike) - , C = typeof this == 'function' ? this : Array - , aLen = arguments.length - , mapfn = aLen > 1 ? arguments[1] : undefined - , mapping = mapfn !== undefined - , index = 0 - , iterFn = O[Symbol.iterator] - , length, result, step, iterator; - if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); - if (iterFn != undefined && !Array.isArray(arrayLike)) { - for (iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++) { - result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; - } - } else { - length = toLength(O.length); - for (result = new C(length); length > index; index++) { - result[index] = mapping ? mapfn(O[index], index) : O[index]; - } - } - result.length = index; - return result; - }; - }()); -} - -if (!Array.prototype.find) { - Object.defineProperty(Array.prototype, 'find', { - configurable: true, - writable: true, - enumerable: false, - value: function(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.find called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return value; - } - } - return undefined; - } - }); -} - -if (!Array.prototype.findIndex) { - Object.defineProperty(Array.prototype, 'findIndex', { - configurable: true, - writable: true, - enumerable: false, - value: function(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.findIndex called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return i; - } - } - return -1; - } - }); -} - -} // endif FEATURE_NO_ES2015 - -if (typeof FEATURE_NO_ES2016 === 'undefined' && !Array.prototype.includes) { - Object.defineProperty(Array.prototype, 'includes', { - configurable: true, - writable: true, - enumerable: false, - value: function(searchElement /*, fromIndex*/ ) { - var O = Object(this); - var len = parseInt(O.length) || 0; - if (len === 0) { - return false; - } - var n = parseInt(arguments[1]) || 0; - var k; - if (n >= 0) { - k = n; - } else { - k = len + n; - if (k < 0) {k = 0;} - } - var currentElement; - while (k < len) { - currentElement = O[k]; - if (searchElement === currentElement || - (searchElement !== searchElement && currentElement !== currentElement)) { // NaN !== NaN - return true; - } - k++; - } - return false; - } - }); -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - -(function() { - let needsFix = false; - - //ES5 did not accept primitives, but ES6 does - try { - let s = Object.keys('a'); - needsFix = (s.length !== 1 || s[0] !== '0'); - } catch(e) { - needsFix = true; - } - - if (needsFix) { - Object.keys = (function() { - var hasOwnProperty = Object.prototype.hasOwnProperty, - hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'), - dontEnums = [ - 'toString', - 'toLocaleString', - 'valueOf', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'constructor' - ], - dontEnumsLength = dontEnums.length; - - return function(obj) { - if (obj === undefined || obj === null){ - throw TypeError(`Cannot convert undefined or null to object`); - } - - obj = Object(obj); - - var result = [], prop, i; - - for (prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - result.push(prop); - } - } - - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); - } - } - } - - return result; - }; - }()); - } -}()); - -(function (O) { - if ('assign' in O) { - return; - } - - O.defineProperty(O, 'assign', { - configurable: true, - writable: true, - value: (function() { - var gOPS = O.getOwnPropertySymbols, - // shortcut without explicitly passing through prototype - pIE = O.propertyIsEnumerable, - filterOS = gOPS ? - function (self) { - return gOPS(self).filter(pIE, self); - } : function () { - // just empty Array won't do much within a .concat(...) - return Array.prototype; - }; - - return function assign(where) { - // Object.create(null) and null objects in general - // might not be fully compatible with Symbols libraries - // it is important to know this, in case you assign Symbols - // to null object ... but it should NOT be a show-stopper - // if you know what you are doing ... so .... - if (gOPS && !(where instanceof O)) { - console.warn('problematic Symbols', where); - // ... now this script does its business !!! - } - // avoid JSHint "don't make function in loop" - function set(keyOrSymbol) { - where[keyOrSymbol] = arg[keyOrSymbol]; - } - // the loop - for (var i = 1, ii = arguments.length; i < ii; ++i) { - var arg = arguments[i]; - - if (arg === null || arg === undefined) { - continue; - } - - O.keys(arg).concat(filterOS(arg)).forEach(set); - } - - return where; - }; - }()) - }); -}(Object)); - -/** - * Object.is() polyfill - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ -if (!Object.is) { - Object.is = function(x, y) { - // SameValue algorithm - if (x === y) { // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - return x !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } - }; -} - -} // endif FEATURE_NO_ES2015 - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - -(function (global) { - //shared pointer - var i; - //shortcuts - var defineProperty = Object.defineProperty, is = function(a,b) { return (a === b) || (a !== a && b !== b) }; - - //Polyfill global objects - if (typeof WeakMap == 'undefined') { - global.WeakMap = createCollection({ - // WeakMap#delete(key:void*):boolean - 'delete': sharedDelete, - // WeakMap#clear(): - clear: sharedClear, - // WeakMap#get(key:void*):void* - get: sharedGet, - // WeakMap#has(key:void*):boolean - has: mapHas, - // WeakMap#set(key:void*, value:void*):void - set: sharedSet - }, true); - } - - if (typeof Map == 'undefined' || typeof ((new Map).values) !== 'function' || !(new Map).values().next) { - global.Map = createCollection({ - // WeakMap#delete(key:void*):boolean - 'delete': sharedDelete, - //:was Map#get(key:void*[, d3fault:void*]):void* - // Map#has(key:void*):boolean - has: mapHas, - // Map#get(key:void*):boolean - get: sharedGet, - // Map#set(key:void*, value:void*):void - set: sharedSet, - // Map#keys(void):Iterator - keys: sharedKeys, - // Map#values(void):Iterator - values: sharedValues, - // Map#entries(void):Iterator - entries: mapEntries, - // Map#forEach(callback:Function, context:void*):void ==> callback.call(context, key, value, mapObject) === not in specs` - forEach: sharedForEach, - // Map#clear(): - clear: sharedClear, - //iterator - [Symbol.iterator]: mapEntries - }); - } - - if (typeof Set == 'undefined' || typeof ((new Set).values) !== 'function' || !(new Set).values().next) { - global.Set = createCollection({ - // Set#has(value:void*):boolean - has: setHas, - // Set#add(value:void*):boolean - add: sharedAdd, - // Set#delete(key:void*):boolean - 'delete': sharedDelete, - // Set#clear(): - clear: sharedClear, - // Set#keys(void):Iterator - keys: sharedValues, // specs actually say "the same function object as the initial value of the values property" - // Set#values(void):Iterator - values: sharedValues, - // Set#entries(void):Iterator - entries: setEntries, - // Set#forEach(callback:Function, context:void*):void ==> callback.call(context, value, index) === not in specs - forEach: sharedForEach, - //iterator - [Symbol.iterator]: sharedValues - }); - } - - if (typeof WeakSet == 'undefined') { - global.WeakSet = createCollection({ - // WeakSet#delete(key:void*):boolean - 'delete': sharedDelete, - // WeakSet#add(value:void*):boolean - add: sharedAdd, - // WeakSet#clear(): - clear: sharedClear, - // WeakSet#has(value:void*):boolean - has: setHas - }, true); - } - - /** - * ES6 collection constructor - * @return {Function} a collection class - */ - function createCollection(proto, objectOnly){ - function Collection(a){ - if (!this || this.constructor !== Collection) return new Collection(a); - this._keys = []; - this._values = []; - this._itp = []; // iteration pointers - this.objectOnly = objectOnly; - - //parse initial iterable argument passed - if (a) init.call(this, a); - } - - //define size for non object-only collections - if (!objectOnly) { - defineProperty(proto, 'size', { - get: sharedSize - }); - } - - //set prototype - proto.constructor = Collection; - Collection.prototype = proto; - - return Collection; - } - - - /** parse initial iterable argument passed */ - function init(a){ - var i; - //init Set argument, like `[1,2,3,{}]` - if (this.add) - a.forEach(this.add, this); - //init Map argument like `[[1,2], [{}, 4]]` - else - a.forEach(function(a){this.set(a[0],a[1])}, this); - } - - - /** delete */ - function sharedDelete(key) { - if (this.has(key)) { - this._keys.splice(i, 1); - this._values.splice(i, 1); - // update iteration pointers - this._itp.forEach(function(p) { if (i < p[0]) p[0]--; }); - } - // Aurora here does it while Canary doesn't - return -1 < i; - }; - - function sharedGet(key) { - return this.has(key) ? this._values[i] : undefined; - } - - function has(list, key) { - if (this.objectOnly && key !== Object(key)) - throw new TypeError("Invalid value used as weak collection key"); - //NaN or 0 passed - if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);){} - else i = list.indexOf(key); - return -1 < i; - } - - function setHas(value) { - return has.call(this, this._values, value); - } - - function mapHas(value) { - return has.call(this, this._keys, value); - } - - /** @chainable */ - function sharedSet(key, value) { - this.has(key) ? - this._values[i] = value - : - this._values[this._keys.push(key) - 1] = value - ; - return this; - } - - /** @chainable */ - function sharedAdd(value) { - if (!this.has(value)) this._values.push(value); - return this; - } - - function sharedClear() { - (this._keys || 0).length = - this._values.length = 0; - } - - /** keys, values, and iterate related methods */ - function sharedKeys() { - return sharedIterator(this._itp, this._keys); - } - - function sharedValues() { - return sharedIterator(this._itp, this._values); - } - - function mapEntries() { - return sharedIterator(this._itp, this._keys, this._values); - } - - function setEntries() { - return sharedIterator(this._itp, this._values, this._values); - } - - function sharedIterator(itp, array, array2) { - var p = [0], done = false; - itp.push(p); - return { - [Symbol.iterator]: function () { - return this; - }, - next: function() { - var v, k = p[0]; - if (!done && k < array.length) { - v = array2 ? [array[k], array2[k]]: array[k]; - p[0]++; - } else { - done = true; - itp.splice(itp.indexOf(p), 1); - } - return { done: done, value: v }; - } - }; - } - - function sharedSize() { - return this._values.length; - } - - function sharedForEach(callback, context) { - var it = this.entries(); - for (;;) { - var r = it.next(); - if (r.done) break; - callback.call(context, r.value[1], r.value[0], this); - } - } - -})(PLATFORM.global); - -} // endif (FEATURE_NO_ES2015) - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - -const bind = Function.prototype.bind; - -if (typeof PLATFORM.global.Reflect === 'undefined') { - PLATFORM.global.Reflect = {}; -} - -if (typeof Reflect.defineProperty !== 'function') { - Reflect.defineProperty = function(target, propertyKey, descriptor) { - if (typeof target === 'object' ? target === null : typeof target !== 'function') { - throw new TypeError('Reflect.defineProperty called on non-object'); - } - try { - Object.defineProperty(target, propertyKey, descriptor); - return true; - } catch (e) { - return false; - } - }; -} - -if (typeof Reflect.construct !== 'function') { - Reflect.construct = function(Target, args) { - if (args) { - switch (args.length){ - case 0: return new Target(); - case 1: return new Target(args[0]); - case 2: return new Target(args[0], args[1]); - case 3: return new Target(args[0], args[1], args[2]); - case 4: return new Target(args[0], args[1], args[2], args[3]); - } - } - - var a = [null]; - a.push.apply(a, args); - return new (bind.apply(Target, a)); - }; -} - -if (typeof Reflect.ownKeys !== 'function') { - Reflect.ownKeys = function(o) { return (Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))); } -} - -} // endif FEATURE_NO_ES2015 - -if (typeof FEATURE_NO_ESNEXT === 'undefined') { - -const emptyMetadata = Object.freeze({}); -const metadataContainerKey = '__metadata__'; - -if (typeof Reflect.getOwnMetadata !== 'function') { - Reflect.getOwnMetadata = function(metadataKey, target, targetKey) { - if (target.hasOwnProperty(metadataContainerKey)) { - return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; - } - }; -} - -if (typeof Reflect.defineMetadata !== 'function') { - Reflect.defineMetadata = function(metadataKey, metadataValue, target, targetKey) { - let metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : (target[metadataContainerKey] = {}); - let targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); - targetContainer[metadataKey] = metadataValue; - }; -} - -if (typeof Reflect.metadata !== 'function') { - Reflect.metadata = function(metadataKey, metadataValue) { - return function(target, targetKey) { - Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); - }; - }; -} - -} // endif FEATURE_NO_ESNEXT diff --git a/dist/commonjs/aurelia-polyfills.js b/dist/commonjs/aurelia-polyfills.js deleted file mode 100644 index 2a55876..0000000 --- a/dist/commonjs/aurelia-polyfills.js +++ /dev/null @@ -1,853 +0,0 @@ -'use strict'; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; - -var _aureliaPal = require('aurelia-pal'); - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - (function (Object, GOPS) { - 'use strict'; - - if (GOPS in Object) return; - - var setDescriptor, - G = _aureliaPal.PLATFORM.global, - id = 0, - random = '' + Math.random(), - prefix = '__\x01symbol:', - prefixLength = prefix.length, - internalSymbol = '__\x01symbol@@' + random, - DP = 'defineProperty', - DPies = 'defineProperties', - GOPN = 'getOwnPropertyNames', - GOPD = 'getOwnPropertyDescriptor', - PIE = 'propertyIsEnumerable', - gOPN = Object[GOPN], - gOPD = Object[GOPD], - create = Object.create, - keys = Object.keys, - defineProperty = Object[DP], - $defineProperties = Object[DPies], - descriptor = gOPD(Object, GOPN), - ObjectProto = Object.prototype, - hOP = ObjectProto.hasOwnProperty, - pIE = ObjectProto[PIE], - toString = ObjectProto.toString, - indexOf = Array.prototype.indexOf || function (v) { - for (var i = this.length; i-- && this[i] !== v;) {} - return i; - }, - addInternalIfNeeded = function addInternalIfNeeded(o, uid, enumerable) { - if (!hOP.call(o, internalSymbol)) { - defineProperty(o, internalSymbol, { - enumerable: false, - configurable: false, - writable: false, - value: {} - }); - } - o[internalSymbol]['@@' + uid] = enumerable; - }, - createWithSymbols = function createWithSymbols(proto, descriptors) { - var self = create(proto); - if (descriptors !== null && (typeof descriptors === 'undefined' ? 'undefined' : _typeof(descriptors)) === 'object') { - gOPN(descriptors).forEach(function (key) { - if (propertyIsEnumerable.call(descriptors, key)) { - $defineProperty(self, key, descriptors[key]); - } - }); - } - return self; - }, - copyAsNonEnumerable = function copyAsNonEnumerable(descriptor) { - var newDescriptor = create(descriptor); - newDescriptor.enumerable = false; - return newDescriptor; - }, - get = function get() {}, - onlyNonSymbols = function onlyNonSymbols(name) { - return name != internalSymbol && !hOP.call(source, name); - }, - onlySymbols = function onlySymbols(name) { - return name != internalSymbol && hOP.call(source, name); - }, - propertyIsEnumerable = function propertyIsEnumerable(key) { - var uid = '' + key; - return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol] && this[internalSymbol]['@@' + uid] : pIE.call(this, key); - }, - setAndGetSymbol = function setAndGetSymbol(uid) { - var descriptor = { - enumerable: false, - configurable: true, - get: get, - set: function set(value) { - setDescriptor(this, uid, { - enumerable: false, - configurable: true, - writable: true, - value: value - }); - addInternalIfNeeded(this, uid, true); - } - }; - defineProperty(ObjectProto, uid, descriptor); - return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor); - }, - _Symbol = function _Symbol2(description) { - if (this && this !== G) { - throw new TypeError('Symbol is not a constructor'); - } - return setAndGetSymbol(prefix.concat(description || '', random, ++id)); - }, - source = create(null), - sourceConstructor = { value: _Symbol }, - sourceMap = function sourceMap(uid) { - return source[uid]; - }, - $defineProperty = function defineProp(o, key, descriptor) { - var uid = '' + key; - if (onlySymbols(uid)) { - setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor); - addInternalIfNeeded(o, uid, !!descriptor.enumerable); - } else { - defineProperty(o, key, descriptor); - } - return o; - }, - $getOwnPropertySymbols = function getOwnPropertySymbols(o) { - var cof = toString.call(o); - o = cof === '[object String]' ? o.split('') : Object(o); - return gOPN(o).filter(onlySymbols).map(sourceMap); - }; - - descriptor.value = $defineProperty; - defineProperty(Object, DP, descriptor); - - descriptor.value = $getOwnPropertySymbols; - defineProperty(Object, GOPS, descriptor); - - var cachedWindowNames = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' ? Object.getOwnPropertyNames(window) : []; - var originalObjectGetOwnPropertyNames = Object.getOwnPropertyNames; - descriptor.value = function getOwnPropertyNames(o) { - if (toString.call(o) === '[object Window]') { - try { - return originalObjectGetOwnPropertyNames(o); - } catch (e) { - return [].concat([], cachedWindowNames); - } - } - return gOPN(o).filter(onlyNonSymbols); - }; - defineProperty(Object, GOPN, descriptor); - - descriptor.value = function defineProperties(o, descriptors) { - var symbols = $getOwnPropertySymbols(descriptors); - if (symbols.length) { - keys(descriptors).concat(symbols).forEach(function (uid) { - if (propertyIsEnumerable.call(descriptors, uid)) { - $defineProperty(o, uid, descriptors[uid]); - } - }); - } else { - $defineProperties(o, descriptors); - } - return o; - }; - defineProperty(Object, DPies, descriptor); - - descriptor.value = propertyIsEnumerable; - defineProperty(ObjectProto, PIE, descriptor); - - descriptor.value = _Symbol; - defineProperty(G, 'Symbol', descriptor); - - descriptor.value = function (key) { - var uid = prefix.concat(prefix, key, random); - return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); - }; - defineProperty(_Symbol, 'for', descriptor); - - descriptor.value = function (symbol) { - return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; - }; - defineProperty(_Symbol, 'keyFor', descriptor); - - descriptor.value = function getOwnPropertyDescriptor(o, key) { - var descriptor = gOPD(o, key); - if (descriptor && onlySymbols(key)) { - descriptor.enumerable = propertyIsEnumerable.call(o, key); - } - return descriptor; - }; - defineProperty(Object, GOPD, descriptor); - - descriptor.value = function (proto, descriptors) { - return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); - }; - defineProperty(Object, 'create', descriptor); - - descriptor.value = function () { - var str = toString.call(this); - return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; - }; - defineProperty(ObjectProto, 'toString', descriptor); - - try { - setDescriptor = create(defineProperty({}, prefix, { - get: function get() { - return defineProperty(this, prefix, { value: false })[prefix]; - } - }))[prefix] || defineProperty; - } catch (o_O) { - setDescriptor = function setDescriptor(o, key, descriptor) { - var protoDescriptor = gOPD(ObjectProto, key); - delete ObjectProto[key]; - defineProperty(o, key, descriptor); - defineProperty(ObjectProto, key, protoDescriptor); - }; - } - })(Object, 'getOwnPropertySymbols'); - - (function (O, S) { - var dP = O.defineProperty, - ObjectProto = O.prototype, - toString = ObjectProto.toString, - toStringTag = 'toStringTag', - descriptor; - ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) { - if (!(name in Symbol)) { - dP(Symbol, name, { value: Symbol(name) }); - switch (name) { - case toStringTag: - descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); - descriptor.value = function () { - var str = toString.call(this), - tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag]; - return typeof tst === 'undefined' ? str : '[object ' + tst + ']'; - }; - dP(ObjectProto, 'toString', descriptor); - break; - } - } - }); - })(Object, Symbol); - - (function (Si, AP, SP) { - - function returnThis() { - return this; - } - - if (!AP[Si]) AP[Si] = function () { - var i = 0, - self = this, - iterator = { - next: function next() { - var done = self.length <= i; - return done ? { done: done } : { done: done, value: self[i++] }; - } - }; - iterator[Si] = returnThis; - return iterator; - }; - - if (!SP[Si]) SP[Si] = function () { - var fromCodePoint = String.fromCodePoint, - self = this, - i = 0, - length = self.length, - iterator = { - next: function next() { - var done = length <= i, - c = done ? '' : fromCodePoint(self.codePointAt(i)); - i += c.length; - return done ? { done: done } : { done: done, value: c }; - } - }; - iterator[Si] = returnThis; - return iterator; - }; - })(Symbol.iterator, Array.prototype, String.prototype); -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - Number.isNaN = Number.isNaN || function (value) { - return value !== value; - }; - - Number.isFinite = Number.isFinite || function (value) { - return typeof value === "number" && isFinite(value); - }; -} - -if (!String.prototype.endsWith || function () { - try { - return !"ab".endsWith("a", 1); - } catch (e) { - return true; - } -}()) { - String.prototype.endsWith = function (searchString, position) { - var subjectString = this.toString(); - if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { - position = subjectString.length; - } - position -= searchString.length; - var lastIndex = subjectString.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; -} - -if (!String.prototype.startsWith || function () { - try { - return !"ab".startsWith("b", 1); - } catch (e) { - return true; - } -}()) { - String.prototype.startsWith = function (searchString, position) { - position = position || 0; - return this.substr(position, searchString.length) === searchString; - }; -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - if (!Array.from) { - Array.from = function () { - var toInteger = function toInteger(it) { - return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); - }; - var toLength = function toLength(it) { - return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; - }; - var iterCall = function iterCall(iter, fn, val, index) { - try { - return fn(val, index); - } catch (E) { - if (typeof iter.return == 'function') iter.return(); - throw E; - } - }; - - return function from(arrayLike) { - var O = Object(arrayLike), - C = typeof this == 'function' ? this : Array, - aLen = arguments.length, - mapfn = aLen > 1 ? arguments[1] : undefined, - mapping = mapfn !== undefined, - index = 0, - iterFn = O[Symbol.iterator], - length, - result, - step, - iterator; - if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); - if (iterFn != undefined && !Array.isArray(arrayLike)) { - for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { - result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; - } - } else { - length = toLength(O.length); - for (result = new C(length); length > index; index++) { - result[index] = mapping ? mapfn(O[index], index) : O[index]; - } - } - result.length = index; - return result; - }; - }(); - } - - if (!Array.prototype.find) { - Object.defineProperty(Array.prototype, 'find', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.find called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return value; - } - } - return undefined; - } - }); - } - - if (!Array.prototype.findIndex) { - Object.defineProperty(Array.prototype, 'findIndex', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.findIndex called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return i; - } - } - return -1; - } - }); - } -} - -if (typeof FEATURE_NO_ES2016 === 'undefined' && !Array.prototype.includes) { - Object.defineProperty(Array.prototype, 'includes', { - configurable: true, - writable: true, - enumerable: false, - value: function value(searchElement) { - var O = Object(this); - var len = parseInt(O.length) || 0; - if (len === 0) { - return false; - } - var n = parseInt(arguments[1]) || 0; - var k; - if (n >= 0) { - k = n; - } else { - k = len + n; - if (k < 0) { - k = 0; - } - } - var currentElement; - while (k < len) { - currentElement = O[k]; - if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) { - return true; - } - k++; - } - return false; - } - }); -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - (function () { - var needsFix = false; - - try { - var s = Object.keys('a'); - needsFix = s.length !== 1 || s[0] !== '0'; - } catch (e) { - needsFix = true; - } - - if (needsFix) { - Object.keys = function () { - var hasOwnProperty = Object.prototype.hasOwnProperty, - hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), - dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], - dontEnumsLength = dontEnums.length; - - return function (obj) { - if (obj === undefined || obj === null) { - throw TypeError('Cannot convert undefined or null to object'); - } - - obj = Object(obj); - - var result = [], - prop, - i; - - for (prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - result.push(prop); - } - } - - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); - } - } - } - - return result; - }; - }(); - } - })(); - - (function (O) { - if ('assign' in O) { - return; - } - - O.defineProperty(O, 'assign', { - configurable: true, - writable: true, - value: function () { - var gOPS = O.getOwnPropertySymbols, - pIE = O.propertyIsEnumerable, - filterOS = gOPS ? function (self) { - return gOPS(self).filter(pIE, self); - } : function () { - return Array.prototype; - }; - - return function assign(where) { - if (gOPS && !(where instanceof O)) { - console.warn('problematic Symbols', where); - } - - function set(keyOrSymbol) { - where[keyOrSymbol] = arg[keyOrSymbol]; - } - - for (var i = 1, ii = arguments.length; i < ii; ++i) { - var arg = arguments[i]; - - if (arg === null || arg === undefined) { - continue; - } - - O.keys(arg).concat(filterOS(arg)).forEach(set); - } - - return where; - }; - }() - }); - })(Object); - - if (!Object.is) { - Object.is = function (x, y) { - if (x === y) { - return x !== 0 || 1 / x === 1 / y; - } else { - return x !== x && y !== y; - } - }; - } -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - (function (global) { - var i; - - var defineProperty = Object.defineProperty, - is = function is(a, b) { - return a === b || a !== a && b !== b; - }; - - if (typeof WeakMap == 'undefined') { - global.WeakMap = createCollection({ - 'delete': sharedDelete, - - clear: sharedClear, - - get: sharedGet, - - has: mapHas, - - set: sharedSet - }, true); - } - - if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { - var _createCollection; - - global.Map = createCollection((_createCollection = { - 'delete': sharedDelete, - - has: mapHas, - - get: sharedGet, - - set: sharedSet, - - keys: sharedKeys, - - values: sharedValues, - - entries: mapEntries, - - forEach: sharedForEach, - - clear: sharedClear - }, _createCollection[Symbol.iterator] = mapEntries, _createCollection)); - } - - if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { - var _createCollection2; - - global.Set = createCollection((_createCollection2 = { - has: setHas, - - add: sharedAdd, - - 'delete': sharedDelete, - - clear: sharedClear, - - keys: sharedValues, - values: sharedValues, - - entries: setEntries, - - forEach: sharedForEach - }, _createCollection2[Symbol.iterator] = sharedValues, _createCollection2)); - } - - if (typeof WeakSet == 'undefined') { - global.WeakSet = createCollection({ - 'delete': sharedDelete, - - add: sharedAdd, - - clear: sharedClear, - - has: setHas - }, true); - } - - function createCollection(proto, objectOnly) { - function Collection(a) { - if (!this || this.constructor !== Collection) return new Collection(a); - this._keys = []; - this._values = []; - this._itp = []; - this.objectOnly = objectOnly; - - if (a) init.call(this, a); - } - - if (!objectOnly) { - defineProperty(proto, 'size', { - get: sharedSize - }); - } - - proto.constructor = Collection; - Collection.prototype = proto; - - return Collection; - } - - function init(a) { - var i; - - if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { - this.set(a[0], a[1]); - }, this); - } - - function sharedDelete(key) { - if (this.has(key)) { - this._keys.splice(i, 1); - this._values.splice(i, 1); - - this._itp.forEach(function (p) { - if (i < p[0]) p[0]--; - }); - } - - return -1 < i; - }; - - function sharedGet(key) { - return this.has(key) ? this._values[i] : undefined; - } - - function has(list, key) { - if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); - - if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); - return -1 < i; - } - - function setHas(value) { - return has.call(this, this._values, value); - } - - function mapHas(value) { - return has.call(this, this._keys, value); - } - - function sharedSet(key, value) { - this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; - return this; - } - - function sharedAdd(value) { - if (!this.has(value)) this._values.push(value); - return this; - } - - function sharedClear() { - (this._keys || 0).length = this._values.length = 0; - } - - function sharedKeys() { - return sharedIterator(this._itp, this._keys); - } - - function sharedValues() { - return sharedIterator(this._itp, this._values); - } - - function mapEntries() { - return sharedIterator(this._itp, this._keys, this._values); - } - - function setEntries() { - return sharedIterator(this._itp, this._values, this._values); - } - - function sharedIterator(itp, array, array2) { - var _ref; - - var p = [0], - done = false; - itp.push(p); - return _ref = {}, _ref[Symbol.iterator] = function () { - return this; - }, _ref.next = function next() { - var v, - k = p[0]; - if (!done && k < array.length) { - v = array2 ? [array[k], array2[k]] : array[k]; - p[0]++; - } else { - done = true; - itp.splice(itp.indexOf(p), 1); - } - return { done: done, value: v }; - }, _ref; - } - - function sharedSize() { - return this._values.length; - } - - function sharedForEach(callback, context) { - var it = this.entries(); - for (;;) { - var r = it.next(); - if (r.done) break; - callback.call(context, r.value[1], r.value[0], this); - } - } - })(_aureliaPal.PLATFORM.global); -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - (function () { - - var bind = Function.prototype.bind; - - if (typeof _aureliaPal.PLATFORM.global.Reflect === 'undefined') { - _aureliaPal.PLATFORM.global.Reflect = {}; - } - - if (typeof Reflect.defineProperty !== 'function') { - Reflect.defineProperty = function (target, propertyKey, descriptor) { - if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' ? target === null : typeof target !== 'function') { - throw new TypeError('Reflect.defineProperty called on non-object'); - } - try { - Object.defineProperty(target, propertyKey, descriptor); - return true; - } catch (e) { - return false; - } - }; - } - - if (typeof Reflect.construct !== 'function') { - Reflect.construct = function (Target, args) { - if (args) { - switch (args.length) { - case 0: - return new Target(); - case 1: - return new Target(args[0]); - case 2: - return new Target(args[0], args[1]); - case 3: - return new Target(args[0], args[1], args[2]); - case 4: - return new Target(args[0], args[1], args[2], args[3]); - } - } - - var a = [null]; - a.push.apply(a, args); - return new (bind.apply(Target, a))(); - }; - } - - if (typeof Reflect.ownKeys !== 'function') { - Reflect.ownKeys = function (o) { - return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); - }; - } - })(); -} - -if (typeof FEATURE_NO_ESNEXT === 'undefined') { - (function () { - - var emptyMetadata = Object.freeze({}); - var metadataContainerKey = '__metadata__'; - - if (typeof Reflect.getOwnMetadata !== 'function') { - Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { - if (target.hasOwnProperty(metadataContainerKey)) { - return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; - } - }; - } - - if (typeof Reflect.defineMetadata !== 'function') { - Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { - var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; - var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); - targetContainer[metadataKey] = metadataValue; - }; - } - - if (typeof Reflect.metadata !== 'function') { - Reflect.metadata = function (metadataKey, metadataValue) { - return function (target, targetKey) { - Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); - }; - }; - } - })(); -} \ No newline at end of file diff --git a/dist/commonjs/index.js b/dist/commonjs/index.js deleted file mode 100644 index 11c3ea6..0000000 --- a/dist/commonjs/index.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _aureliaPolyfills = require('./aurelia-polyfills'); - -Object.keys(_aureliaPolyfills).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function get() { - return _aureliaPolyfills[key]; - } - }); -}); \ No newline at end of file diff --git a/dist/es2015/aurelia-polyfills.js b/dist/es2015/aurelia-polyfills.js deleted file mode 100644 index 3440ea8..0000000 --- a/dist/es2015/aurelia-polyfills.js +++ /dev/null @@ -1,846 +0,0 @@ -import { PLATFORM } from 'aurelia-pal'; - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - (function (Object, GOPS) { - 'use strict'; - - if (GOPS in Object) return; - - var setDescriptor, - G = PLATFORM.global, - id = 0, - random = '' + Math.random(), - prefix = '__\x01symbol:', - prefixLength = prefix.length, - internalSymbol = '__\x01symbol@@' + random, - DP = 'defineProperty', - DPies = 'defineProperties', - GOPN = 'getOwnPropertyNames', - GOPD = 'getOwnPropertyDescriptor', - PIE = 'propertyIsEnumerable', - gOPN = Object[GOPN], - gOPD = Object[GOPD], - create = Object.create, - keys = Object.keys, - defineProperty = Object[DP], - $defineProperties = Object[DPies], - descriptor = gOPD(Object, GOPN), - ObjectProto = Object.prototype, - hOP = ObjectProto.hasOwnProperty, - pIE = ObjectProto[PIE], - toString = ObjectProto.toString, - indexOf = Array.prototype.indexOf || function (v) { - for (var i = this.length; i-- && this[i] !== v;) {} - return i; - }, - addInternalIfNeeded = function (o, uid, enumerable) { - if (!hOP.call(o, internalSymbol)) { - defineProperty(o, internalSymbol, { - enumerable: false, - configurable: false, - writable: false, - value: {} - }); - } - o[internalSymbol]['@@' + uid] = enumerable; - }, - createWithSymbols = function (proto, descriptors) { - var self = create(proto); - if (descriptors !== null && typeof descriptors === 'object') { - gOPN(descriptors).forEach(function (key) { - if (propertyIsEnumerable.call(descriptors, key)) { - $defineProperty(self, key, descriptors[key]); - } - }); - } - return self; - }, - copyAsNonEnumerable = function (descriptor) { - var newDescriptor = create(descriptor); - newDescriptor.enumerable = false; - return newDescriptor; - }, - get = function get() {}, - onlyNonSymbols = function (name) { - return name != internalSymbol && !hOP.call(source, name); - }, - onlySymbols = function (name) { - return name != internalSymbol && hOP.call(source, name); - }, - propertyIsEnumerable = function propertyIsEnumerable(key) { - var uid = '' + key; - return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol] && this[internalSymbol]['@@' + uid] : pIE.call(this, key); - }, - setAndGetSymbol = function (uid) { - var descriptor = { - enumerable: false, - configurable: true, - get: get, - set: function (value) { - setDescriptor(this, uid, { - enumerable: false, - configurable: true, - writable: true, - value: value - }); - addInternalIfNeeded(this, uid, true); - } - }; - defineProperty(ObjectProto, uid, descriptor); - return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor); - }, - Symbol = function Symbol(description) { - if (this && this !== G) { - throw new TypeError('Symbol is not a constructor'); - } - return setAndGetSymbol(prefix.concat(description || '', random, ++id)); - }, - source = create(null), - sourceConstructor = { value: Symbol }, - sourceMap = function (uid) { - return source[uid]; - }, - $defineProperty = function defineProp(o, key, descriptor) { - var uid = '' + key; - if (onlySymbols(uid)) { - setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor); - addInternalIfNeeded(o, uid, !!descriptor.enumerable); - } else { - defineProperty(o, key, descriptor); - } - return o; - }, - $getOwnPropertySymbols = function getOwnPropertySymbols(o) { - var cof = toString.call(o); - o = cof === '[object String]' ? o.split('') : Object(o); - return gOPN(o).filter(onlySymbols).map(sourceMap); - }; - - descriptor.value = $defineProperty; - defineProperty(Object, DP, descriptor); - - descriptor.value = $getOwnPropertySymbols; - defineProperty(Object, GOPS, descriptor); - - var cachedWindowNames = typeof window === 'object' ? Object.getOwnPropertyNames(window) : []; - var originalObjectGetOwnPropertyNames = Object.getOwnPropertyNames; - descriptor.value = function getOwnPropertyNames(o) { - if (toString.call(o) === '[object Window]') { - try { - return originalObjectGetOwnPropertyNames(o); - } catch (e) { - return [].concat([], cachedWindowNames); - } - } - return gOPN(o).filter(onlyNonSymbols); - }; - defineProperty(Object, GOPN, descriptor); - - descriptor.value = function defineProperties(o, descriptors) { - var symbols = $getOwnPropertySymbols(descriptors); - if (symbols.length) { - keys(descriptors).concat(symbols).forEach(function (uid) { - if (propertyIsEnumerable.call(descriptors, uid)) { - $defineProperty(o, uid, descriptors[uid]); - } - }); - } else { - $defineProperties(o, descriptors); - } - return o; - }; - defineProperty(Object, DPies, descriptor); - - descriptor.value = propertyIsEnumerable; - defineProperty(ObjectProto, PIE, descriptor); - - descriptor.value = Symbol; - defineProperty(G, 'Symbol', descriptor); - - descriptor.value = function (key) { - var uid = prefix.concat(prefix, key, random); - return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); - }; - defineProperty(Symbol, 'for', descriptor); - - descriptor.value = function (symbol) { - return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; - }; - defineProperty(Symbol, 'keyFor', descriptor); - - descriptor.value = function getOwnPropertyDescriptor(o, key) { - var descriptor = gOPD(o, key); - if (descriptor && onlySymbols(key)) { - descriptor.enumerable = propertyIsEnumerable.call(o, key); - } - return descriptor; - }; - defineProperty(Object, GOPD, descriptor); - - descriptor.value = function (proto, descriptors) { - return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); - }; - defineProperty(Object, 'create', descriptor); - - descriptor.value = function () { - var str = toString.call(this); - return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; - }; - defineProperty(ObjectProto, 'toString', descriptor); - - try { - setDescriptor = create(defineProperty({}, prefix, { - get: function () { - return defineProperty(this, prefix, { value: false })[prefix]; - } - }))[prefix] || defineProperty; - } catch (o_O) { - setDescriptor = function (o, key, descriptor) { - var protoDescriptor = gOPD(ObjectProto, key); - delete ObjectProto[key]; - defineProperty(o, key, descriptor); - defineProperty(ObjectProto, key, protoDescriptor); - }; - } - })(Object, 'getOwnPropertySymbols'); - - (function (O, S) { - var dP = O.defineProperty, - ObjectProto = O.prototype, - toString = ObjectProto.toString, - toStringTag = 'toStringTag', - descriptor; - ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) { - if (!(name in Symbol)) { - dP(Symbol, name, { value: Symbol(name) }); - switch (name) { - case toStringTag: - descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); - descriptor.value = function () { - var str = toString.call(this), - tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag]; - return typeof tst === 'undefined' ? str : '[object ' + tst + ']'; - }; - dP(ObjectProto, 'toString', descriptor); - break; - } - } - }); - })(Object, Symbol); - - (function (Si, AP, SP) { - - function returnThis() { - return this; - } - - if (!AP[Si]) AP[Si] = function () { - var i = 0, - self = this, - iterator = { - next: function next() { - var done = self.length <= i; - return done ? { done: done } : { done: done, value: self[i++] }; - } - }; - iterator[Si] = returnThis; - return iterator; - }; - - if (!SP[Si]) SP[Si] = function () { - var fromCodePoint = String.fromCodePoint, - self = this, - i = 0, - length = self.length, - iterator = { - next: function next() { - var done = length <= i, - c = done ? '' : fromCodePoint(self.codePointAt(i)); - i += c.length; - return done ? { done: done } : { done: done, value: c }; - } - }; - iterator[Si] = returnThis; - return iterator; - }; - })(Symbol.iterator, Array.prototype, String.prototype); -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - Number.isNaN = Number.isNaN || function (value) { - return value !== value; - }; - - Number.isFinite = Number.isFinite || function (value) { - return typeof value === "number" && isFinite(value); - }; -} - -if (!String.prototype.endsWith || function () { - try { - return !"ab".endsWith("a", 1); - } catch (e) { - return true; - } -}()) { - String.prototype.endsWith = function (searchString, position) { - let subjectString = this.toString(); - if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { - position = subjectString.length; - } - position -= searchString.length; - let lastIndex = subjectString.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; -} - -if (!String.prototype.startsWith || function () { - try { - return !"ab".startsWith("b", 1); - } catch (e) { - return true; - } -}()) { - String.prototype.startsWith = function (searchString, position) { - position = position || 0; - return this.substr(position, searchString.length) === searchString; - }; -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - if (!Array.from) { - Array.from = function () { - var toInteger = function (it) { - return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); - }; - var toLength = function (it) { - return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; - }; - var iterCall = function (iter, fn, val, index) { - try { - return fn(val, index); - } catch (E) { - if (typeof iter.return == 'function') iter.return(); - throw E; - } - }; - - return function from(arrayLike) { - var O = Object(arrayLike), - C = typeof this == 'function' ? this : Array, - aLen = arguments.length, - mapfn = aLen > 1 ? arguments[1] : undefined, - mapping = mapfn !== undefined, - index = 0, - iterFn = O[Symbol.iterator], - length, - result, - step, - iterator; - if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); - if (iterFn != undefined && !Array.isArray(arrayLike)) { - for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { - result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; - } - } else { - length = toLength(O.length); - for (result = new C(length); length > index; index++) { - result[index] = mapping ? mapfn(O[index], index) : O[index]; - } - } - result.length = index; - return result; - }; - }(); - } - - if (!Array.prototype.find) { - Object.defineProperty(Array.prototype, 'find', { - configurable: true, - writable: true, - enumerable: false, - value: function (predicate) { - if (this === null) { - throw new TypeError('Array.prototype.find called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return value; - } - } - return undefined; - } - }); - } - - if (!Array.prototype.findIndex) { - Object.defineProperty(Array.prototype, 'findIndex', { - configurable: true, - writable: true, - enumerable: false, - value: function (predicate) { - if (this === null) { - throw new TypeError('Array.prototype.findIndex called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return i; - } - } - return -1; - } - }); - } -} - -if (typeof FEATURE_NO_ES2016 === 'undefined' && !Array.prototype.includes) { - Object.defineProperty(Array.prototype, 'includes', { - configurable: true, - writable: true, - enumerable: false, - value: function (searchElement) { - var O = Object(this); - var len = parseInt(O.length) || 0; - if (len === 0) { - return false; - } - var n = parseInt(arguments[1]) || 0; - var k; - if (n >= 0) { - k = n; - } else { - k = len + n; - if (k < 0) { - k = 0; - } - } - var currentElement; - while (k < len) { - currentElement = O[k]; - if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) { - return true; - } - k++; - } - return false; - } - }); -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - (function () { - let needsFix = false; - - try { - let s = Object.keys('a'); - needsFix = s.length !== 1 || s[0] !== '0'; - } catch (e) { - needsFix = true; - } - - if (needsFix) { - Object.keys = function () { - var hasOwnProperty = Object.prototype.hasOwnProperty, - hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), - dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], - dontEnumsLength = dontEnums.length; - - return function (obj) { - if (obj === undefined || obj === null) { - throw TypeError(`Cannot convert undefined or null to object`); - } - - obj = Object(obj); - - var result = [], - prop, - i; - - for (prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - result.push(prop); - } - } - - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); - } - } - } - - return result; - }; - }(); - } - })(); - - (function (O) { - if ('assign' in O) { - return; - } - - O.defineProperty(O, 'assign', { - configurable: true, - writable: true, - value: function () { - var gOPS = O.getOwnPropertySymbols, - pIE = O.propertyIsEnumerable, - filterOS = gOPS ? function (self) { - return gOPS(self).filter(pIE, self); - } : function () { - return Array.prototype; - }; - - return function assign(where) { - if (gOPS && !(where instanceof O)) { - console.warn('problematic Symbols', where); - } - - function set(keyOrSymbol) { - where[keyOrSymbol] = arg[keyOrSymbol]; - } - - for (var i = 1, ii = arguments.length; i < ii; ++i) { - var arg = arguments[i]; - - if (arg === null || arg === undefined) { - continue; - } - - O.keys(arg).concat(filterOS(arg)).forEach(set); - } - - return where; - }; - }() - }); - })(Object); - - if (!Object.is) { - Object.is = function (x, y) { - if (x === y) { - return x !== 0 || 1 / x === 1 / y; - } else { - return x !== x && y !== y; - } - }; - } -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - (function (global) { - var i; - - var defineProperty = Object.defineProperty, - is = function (a, b) { - return a === b || a !== a && b !== b; - }; - - if (typeof WeakMap == 'undefined') { - global.WeakMap = createCollection({ - 'delete': sharedDelete, - - clear: sharedClear, - - get: sharedGet, - - has: mapHas, - - set: sharedSet - }, true); - } - - if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { - global.Map = createCollection({ - 'delete': sharedDelete, - - has: mapHas, - - get: sharedGet, - - set: sharedSet, - - keys: sharedKeys, - - values: sharedValues, - - entries: mapEntries, - - forEach: sharedForEach, - - clear: sharedClear, - - [Symbol.iterator]: mapEntries - }); - } - - if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { - global.Set = createCollection({ - has: setHas, - - add: sharedAdd, - - 'delete': sharedDelete, - - clear: sharedClear, - - keys: sharedValues, - values: sharedValues, - - entries: setEntries, - - forEach: sharedForEach, - - [Symbol.iterator]: sharedValues - }); - } - - if (typeof WeakSet == 'undefined') { - global.WeakSet = createCollection({ - 'delete': sharedDelete, - - add: sharedAdd, - - clear: sharedClear, - - has: setHas - }, true); - } - - function createCollection(proto, objectOnly) { - function Collection(a) { - if (!this || this.constructor !== Collection) return new Collection(a); - this._keys = []; - this._values = []; - this._itp = []; - this.objectOnly = objectOnly; - - if (a) init.call(this, a); - } - - if (!objectOnly) { - defineProperty(proto, 'size', { - get: sharedSize - }); - } - - proto.constructor = Collection; - Collection.prototype = proto; - - return Collection; - } - - function init(a) { - var i; - - if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { - this.set(a[0], a[1]); - }, this); - } - - function sharedDelete(key) { - if (this.has(key)) { - this._keys.splice(i, 1); - this._values.splice(i, 1); - - this._itp.forEach(function (p) { - if (i < p[0]) p[0]--; - }); - } - - return -1 < i; - }; - - function sharedGet(key) { - return this.has(key) ? this._values[i] : undefined; - } - - function has(list, key) { - if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); - - if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); - return -1 < i; - } - - function setHas(value) { - return has.call(this, this._values, value); - } - - function mapHas(value) { - return has.call(this, this._keys, value); - } - - function sharedSet(key, value) { - this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; - return this; - } - - function sharedAdd(value) { - if (!this.has(value)) this._values.push(value); - return this; - } - - function sharedClear() { - (this._keys || 0).length = this._values.length = 0; - } - - function sharedKeys() { - return sharedIterator(this._itp, this._keys); - } - - function sharedValues() { - return sharedIterator(this._itp, this._values); - } - - function mapEntries() { - return sharedIterator(this._itp, this._keys, this._values); - } - - function setEntries() { - return sharedIterator(this._itp, this._values, this._values); - } - - function sharedIterator(itp, array, array2) { - var p = [0], - done = false; - itp.push(p); - return { - [Symbol.iterator]: function () { - return this; - }, - next: function () { - var v, - k = p[0]; - if (!done && k < array.length) { - v = array2 ? [array[k], array2[k]] : array[k]; - p[0]++; - } else { - done = true; - itp.splice(itp.indexOf(p), 1); - } - return { done: done, value: v }; - } - }; - } - - function sharedSize() { - return this._values.length; - } - - function sharedForEach(callback, context) { - var it = this.entries(); - for (;;) { - var r = it.next(); - if (r.done) break; - callback.call(context, r.value[1], r.value[0], this); - } - } - })(PLATFORM.global); -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - const bind = Function.prototype.bind; - - if (typeof PLATFORM.global.Reflect === 'undefined') { - PLATFORM.global.Reflect = {}; - } - - if (typeof Reflect.defineProperty !== 'function') { - Reflect.defineProperty = function (target, propertyKey, descriptor) { - if (typeof target === 'object' ? target === null : typeof target !== 'function') { - throw new TypeError('Reflect.defineProperty called on non-object'); - } - try { - Object.defineProperty(target, propertyKey, descriptor); - return true; - } catch (e) { - return false; - } - }; - } - - if (typeof Reflect.construct !== 'function') { - Reflect.construct = function (Target, args) { - if (args) { - switch (args.length) { - case 0: - return new Target(); - case 1: - return new Target(args[0]); - case 2: - return new Target(args[0], args[1]); - case 3: - return new Target(args[0], args[1], args[2]); - case 4: - return new Target(args[0], args[1], args[2], args[3]); - } - } - - var a = [null]; - a.push.apply(a, args); - return new (bind.apply(Target, a))(); - }; - } - - if (typeof Reflect.ownKeys !== 'function') { - Reflect.ownKeys = function (o) { - return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); - }; - } -} - -if (typeof FEATURE_NO_ESNEXT === 'undefined') { - - const emptyMetadata = Object.freeze({}); - const metadataContainerKey = '__metadata__'; - - if (typeof Reflect.getOwnMetadata !== 'function') { - Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { - if (target.hasOwnProperty(metadataContainerKey)) { - return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; - } - }; - } - - if (typeof Reflect.defineMetadata !== 'function') { - Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { - let metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; - let targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); - targetContainer[metadataKey] = metadataValue; - }; - } - - if (typeof Reflect.metadata !== 'function') { - Reflect.metadata = function (metadataKey, metadataValue) { - return function (target, targetKey) { - Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); - }; - }; - } -} \ No newline at end of file diff --git a/dist/es2015/index.js b/dist/es2015/index.js deleted file mode 100644 index 6a0f1ce..0000000 --- a/dist/es2015/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './aurelia-polyfills'; \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 9f06f56..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from 'aurelia-polyfills/aurelia-polyfills'; \ No newline at end of file diff --git a/dist/native-modules/aurelia-polyfills.js b/dist/native-modules/aurelia-polyfills.js deleted file mode 100644 index da664da..0000000 --- a/dist/native-modules/aurelia-polyfills.js +++ /dev/null @@ -1,851 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; - -import { PLATFORM } from 'aurelia-pal'; - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - (function (Object, GOPS) { - 'use strict'; - - if (GOPS in Object) return; - - var setDescriptor, - G = PLATFORM.global, - id = 0, - random = '' + Math.random(), - prefix = '__\x01symbol:', - prefixLength = prefix.length, - internalSymbol = '__\x01symbol@@' + random, - DP = 'defineProperty', - DPies = 'defineProperties', - GOPN = 'getOwnPropertyNames', - GOPD = 'getOwnPropertyDescriptor', - PIE = 'propertyIsEnumerable', - gOPN = Object[GOPN], - gOPD = Object[GOPD], - create = Object.create, - keys = Object.keys, - defineProperty = Object[DP], - $defineProperties = Object[DPies], - descriptor = gOPD(Object, GOPN), - ObjectProto = Object.prototype, - hOP = ObjectProto.hasOwnProperty, - pIE = ObjectProto[PIE], - toString = ObjectProto.toString, - indexOf = Array.prototype.indexOf || function (v) { - for (var i = this.length; i-- && this[i] !== v;) {} - return i; - }, - addInternalIfNeeded = function addInternalIfNeeded(o, uid, enumerable) { - if (!hOP.call(o, internalSymbol)) { - defineProperty(o, internalSymbol, { - enumerable: false, - configurable: false, - writable: false, - value: {} - }); - } - o[internalSymbol]['@@' + uid] = enumerable; - }, - createWithSymbols = function createWithSymbols(proto, descriptors) { - var self = create(proto); - if (descriptors !== null && (typeof descriptors === 'undefined' ? 'undefined' : _typeof(descriptors)) === 'object') { - gOPN(descriptors).forEach(function (key) { - if (propertyIsEnumerable.call(descriptors, key)) { - $defineProperty(self, key, descriptors[key]); - } - }); - } - return self; - }, - copyAsNonEnumerable = function copyAsNonEnumerable(descriptor) { - var newDescriptor = create(descriptor); - newDescriptor.enumerable = false; - return newDescriptor; - }, - get = function get() {}, - onlyNonSymbols = function onlyNonSymbols(name) { - return name != internalSymbol && !hOP.call(source, name); - }, - onlySymbols = function onlySymbols(name) { - return name != internalSymbol && hOP.call(source, name); - }, - propertyIsEnumerable = function propertyIsEnumerable(key) { - var uid = '' + key; - return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol] && this[internalSymbol]['@@' + uid] : pIE.call(this, key); - }, - setAndGetSymbol = function setAndGetSymbol(uid) { - var descriptor = { - enumerable: false, - configurable: true, - get: get, - set: function set(value) { - setDescriptor(this, uid, { - enumerable: false, - configurable: true, - writable: true, - value: value - }); - addInternalIfNeeded(this, uid, true); - } - }; - defineProperty(ObjectProto, uid, descriptor); - return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor); - }, - _Symbol = function _Symbol2(description) { - if (this && this !== G) { - throw new TypeError('Symbol is not a constructor'); - } - return setAndGetSymbol(prefix.concat(description || '', random, ++id)); - }, - source = create(null), - sourceConstructor = { value: _Symbol }, - sourceMap = function sourceMap(uid) { - return source[uid]; - }, - $defineProperty = function defineProp(o, key, descriptor) { - var uid = '' + key; - if (onlySymbols(uid)) { - setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor); - addInternalIfNeeded(o, uid, !!descriptor.enumerable); - } else { - defineProperty(o, key, descriptor); - } - return o; - }, - $getOwnPropertySymbols = function getOwnPropertySymbols(o) { - var cof = toString.call(o); - o = cof === '[object String]' ? o.split('') : Object(o); - return gOPN(o).filter(onlySymbols).map(sourceMap); - }; - - descriptor.value = $defineProperty; - defineProperty(Object, DP, descriptor); - - descriptor.value = $getOwnPropertySymbols; - defineProperty(Object, GOPS, descriptor); - - var cachedWindowNames = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' ? Object.getOwnPropertyNames(window) : []; - var originalObjectGetOwnPropertyNames = Object.getOwnPropertyNames; - descriptor.value = function getOwnPropertyNames(o) { - if (toString.call(o) === '[object Window]') { - try { - return originalObjectGetOwnPropertyNames(o); - } catch (e) { - return [].concat([], cachedWindowNames); - } - } - return gOPN(o).filter(onlyNonSymbols); - }; - defineProperty(Object, GOPN, descriptor); - - descriptor.value = function defineProperties(o, descriptors) { - var symbols = $getOwnPropertySymbols(descriptors); - if (symbols.length) { - keys(descriptors).concat(symbols).forEach(function (uid) { - if (propertyIsEnumerable.call(descriptors, uid)) { - $defineProperty(o, uid, descriptors[uid]); - } - }); - } else { - $defineProperties(o, descriptors); - } - return o; - }; - defineProperty(Object, DPies, descriptor); - - descriptor.value = propertyIsEnumerable; - defineProperty(ObjectProto, PIE, descriptor); - - descriptor.value = _Symbol; - defineProperty(G, 'Symbol', descriptor); - - descriptor.value = function (key) { - var uid = prefix.concat(prefix, key, random); - return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); - }; - defineProperty(_Symbol, 'for', descriptor); - - descriptor.value = function (symbol) { - return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; - }; - defineProperty(_Symbol, 'keyFor', descriptor); - - descriptor.value = function getOwnPropertyDescriptor(o, key) { - var descriptor = gOPD(o, key); - if (descriptor && onlySymbols(key)) { - descriptor.enumerable = propertyIsEnumerable.call(o, key); - } - return descriptor; - }; - defineProperty(Object, GOPD, descriptor); - - descriptor.value = function (proto, descriptors) { - return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); - }; - defineProperty(Object, 'create', descriptor); - - descriptor.value = function () { - var str = toString.call(this); - return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; - }; - defineProperty(ObjectProto, 'toString', descriptor); - - try { - setDescriptor = create(defineProperty({}, prefix, { - get: function get() { - return defineProperty(this, prefix, { value: false })[prefix]; - } - }))[prefix] || defineProperty; - } catch (o_O) { - setDescriptor = function setDescriptor(o, key, descriptor) { - var protoDescriptor = gOPD(ObjectProto, key); - delete ObjectProto[key]; - defineProperty(o, key, descriptor); - defineProperty(ObjectProto, key, protoDescriptor); - }; - } - })(Object, 'getOwnPropertySymbols'); - - (function (O, S) { - var dP = O.defineProperty, - ObjectProto = O.prototype, - toString = ObjectProto.toString, - toStringTag = 'toStringTag', - descriptor; - ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) { - if (!(name in Symbol)) { - dP(Symbol, name, { value: Symbol(name) }); - switch (name) { - case toStringTag: - descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); - descriptor.value = function () { - var str = toString.call(this), - tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag]; - return typeof tst === 'undefined' ? str : '[object ' + tst + ']'; - }; - dP(ObjectProto, 'toString', descriptor); - break; - } - } - }); - })(Object, Symbol); - - (function (Si, AP, SP) { - - function returnThis() { - return this; - } - - if (!AP[Si]) AP[Si] = function () { - var i = 0, - self = this, - iterator = { - next: function next() { - var done = self.length <= i; - return done ? { done: done } : { done: done, value: self[i++] }; - } - }; - iterator[Si] = returnThis; - return iterator; - }; - - if (!SP[Si]) SP[Si] = function () { - var fromCodePoint = String.fromCodePoint, - self = this, - i = 0, - length = self.length, - iterator = { - next: function next() { - var done = length <= i, - c = done ? '' : fromCodePoint(self.codePointAt(i)); - i += c.length; - return done ? { done: done } : { done: done, value: c }; - } - }; - iterator[Si] = returnThis; - return iterator; - }; - })(Symbol.iterator, Array.prototype, String.prototype); -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - Number.isNaN = Number.isNaN || function (value) { - return value !== value; - }; - - Number.isFinite = Number.isFinite || function (value) { - return typeof value === "number" && isFinite(value); - }; -} - -if (!String.prototype.endsWith || function () { - try { - return !"ab".endsWith("a", 1); - } catch (e) { - return true; - } -}()) { - String.prototype.endsWith = function (searchString, position) { - var subjectString = this.toString(); - if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { - position = subjectString.length; - } - position -= searchString.length; - var lastIndex = subjectString.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; -} - -if (!String.prototype.startsWith || function () { - try { - return !"ab".startsWith("b", 1); - } catch (e) { - return true; - } -}()) { - String.prototype.startsWith = function (searchString, position) { - position = position || 0; - return this.substr(position, searchString.length) === searchString; - }; -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - if (!Array.from) { - Array.from = function () { - var toInteger = function toInteger(it) { - return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); - }; - var toLength = function toLength(it) { - return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; - }; - var iterCall = function iterCall(iter, fn, val, index) { - try { - return fn(val, index); - } catch (E) { - if (typeof iter.return == 'function') iter.return(); - throw E; - } - }; - - return function from(arrayLike) { - var O = Object(arrayLike), - C = typeof this == 'function' ? this : Array, - aLen = arguments.length, - mapfn = aLen > 1 ? arguments[1] : undefined, - mapping = mapfn !== undefined, - index = 0, - iterFn = O[Symbol.iterator], - length, - result, - step, - iterator; - if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); - if (iterFn != undefined && !Array.isArray(arrayLike)) { - for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { - result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; - } - } else { - length = toLength(O.length); - for (result = new C(length); length > index; index++) { - result[index] = mapping ? mapfn(O[index], index) : O[index]; - } - } - result.length = index; - return result; - }; - }(); - } - - if (!Array.prototype.find) { - Object.defineProperty(Array.prototype, 'find', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.find called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return value; - } - } - return undefined; - } - }); - } - - if (!Array.prototype.findIndex) { - Object.defineProperty(Array.prototype, 'findIndex', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.findIndex called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return i; - } - } - return -1; - } - }); - } -} - -if (typeof FEATURE_NO_ES2016 === 'undefined' && !Array.prototype.includes) { - Object.defineProperty(Array.prototype, 'includes', { - configurable: true, - writable: true, - enumerable: false, - value: function value(searchElement) { - var O = Object(this); - var len = parseInt(O.length) || 0; - if (len === 0) { - return false; - } - var n = parseInt(arguments[1]) || 0; - var k; - if (n >= 0) { - k = n; - } else { - k = len + n; - if (k < 0) { - k = 0; - } - } - var currentElement; - while (k < len) { - currentElement = O[k]; - if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) { - return true; - } - k++; - } - return false; - } - }); -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - (function () { - var needsFix = false; - - try { - var s = Object.keys('a'); - needsFix = s.length !== 1 || s[0] !== '0'; - } catch (e) { - needsFix = true; - } - - if (needsFix) { - Object.keys = function () { - var hasOwnProperty = Object.prototype.hasOwnProperty, - hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), - dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], - dontEnumsLength = dontEnums.length; - - return function (obj) { - if (obj === undefined || obj === null) { - throw TypeError('Cannot convert undefined or null to object'); - } - - obj = Object(obj); - - var result = [], - prop, - i; - - for (prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - result.push(prop); - } - } - - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); - } - } - } - - return result; - }; - }(); - } - })(); - - (function (O) { - if ('assign' in O) { - return; - } - - O.defineProperty(O, 'assign', { - configurable: true, - writable: true, - value: function () { - var gOPS = O.getOwnPropertySymbols, - pIE = O.propertyIsEnumerable, - filterOS = gOPS ? function (self) { - return gOPS(self).filter(pIE, self); - } : function () { - return Array.prototype; - }; - - return function assign(where) { - if (gOPS && !(where instanceof O)) { - console.warn('problematic Symbols', where); - } - - function set(keyOrSymbol) { - where[keyOrSymbol] = arg[keyOrSymbol]; - } - - for (var i = 1, ii = arguments.length; i < ii; ++i) { - var arg = arguments[i]; - - if (arg === null || arg === undefined) { - continue; - } - - O.keys(arg).concat(filterOS(arg)).forEach(set); - } - - return where; - }; - }() - }); - })(Object); - - if (!Object.is) { - Object.is = function (x, y) { - if (x === y) { - return x !== 0 || 1 / x === 1 / y; - } else { - return x !== x && y !== y; - } - }; - } -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - - (function (global) { - var i; - - var defineProperty = Object.defineProperty, - is = function is(a, b) { - return a === b || a !== a && b !== b; - }; - - if (typeof WeakMap == 'undefined') { - global.WeakMap = createCollection({ - 'delete': sharedDelete, - - clear: sharedClear, - - get: sharedGet, - - has: mapHas, - - set: sharedSet - }, true); - } - - if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { - var _createCollection; - - global.Map = createCollection((_createCollection = { - 'delete': sharedDelete, - - has: mapHas, - - get: sharedGet, - - set: sharedSet, - - keys: sharedKeys, - - values: sharedValues, - - entries: mapEntries, - - forEach: sharedForEach, - - clear: sharedClear - }, _createCollection[Symbol.iterator] = mapEntries, _createCollection)); - } - - if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { - var _createCollection2; - - global.Set = createCollection((_createCollection2 = { - has: setHas, - - add: sharedAdd, - - 'delete': sharedDelete, - - clear: sharedClear, - - keys: sharedValues, - values: sharedValues, - - entries: setEntries, - - forEach: sharedForEach - }, _createCollection2[Symbol.iterator] = sharedValues, _createCollection2)); - } - - if (typeof WeakSet == 'undefined') { - global.WeakSet = createCollection({ - 'delete': sharedDelete, - - add: sharedAdd, - - clear: sharedClear, - - has: setHas - }, true); - } - - function createCollection(proto, objectOnly) { - function Collection(a) { - if (!this || this.constructor !== Collection) return new Collection(a); - this._keys = []; - this._values = []; - this._itp = []; - this.objectOnly = objectOnly; - - if (a) init.call(this, a); - } - - if (!objectOnly) { - defineProperty(proto, 'size', { - get: sharedSize - }); - } - - proto.constructor = Collection; - Collection.prototype = proto; - - return Collection; - } - - function init(a) { - var i; - - if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { - this.set(a[0], a[1]); - }, this); - } - - function sharedDelete(key) { - if (this.has(key)) { - this._keys.splice(i, 1); - this._values.splice(i, 1); - - this._itp.forEach(function (p) { - if (i < p[0]) p[0]--; - }); - } - - return -1 < i; - }; - - function sharedGet(key) { - return this.has(key) ? this._values[i] : undefined; - } - - function has(list, key) { - if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); - - if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); - return -1 < i; - } - - function setHas(value) { - return has.call(this, this._values, value); - } - - function mapHas(value) { - return has.call(this, this._keys, value); - } - - function sharedSet(key, value) { - this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; - return this; - } - - function sharedAdd(value) { - if (!this.has(value)) this._values.push(value); - return this; - } - - function sharedClear() { - (this._keys || 0).length = this._values.length = 0; - } - - function sharedKeys() { - return sharedIterator(this._itp, this._keys); - } - - function sharedValues() { - return sharedIterator(this._itp, this._values); - } - - function mapEntries() { - return sharedIterator(this._itp, this._keys, this._values); - } - - function setEntries() { - return sharedIterator(this._itp, this._values, this._values); - } - - function sharedIterator(itp, array, array2) { - var _ref; - - var p = [0], - done = false; - itp.push(p); - return _ref = {}, _ref[Symbol.iterator] = function () { - return this; - }, _ref.next = function next() { - var v, - k = p[0]; - if (!done && k < array.length) { - v = array2 ? [array[k], array2[k]] : array[k]; - p[0]++; - } else { - done = true; - itp.splice(itp.indexOf(p), 1); - } - return { done: done, value: v }; - }, _ref; - } - - function sharedSize() { - return this._values.length; - } - - function sharedForEach(callback, context) { - var it = this.entries(); - for (;;) { - var r = it.next(); - if (r.done) break; - callback.call(context, r.value[1], r.value[0], this); - } - } - })(PLATFORM.global); -} - -if (typeof FEATURE_NO_ES2015 === 'undefined') { - (function () { - - var bind = Function.prototype.bind; - - if (typeof PLATFORM.global.Reflect === 'undefined') { - PLATFORM.global.Reflect = {}; - } - - if (typeof Reflect.defineProperty !== 'function') { - Reflect.defineProperty = function (target, propertyKey, descriptor) { - if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' ? target === null : typeof target !== 'function') { - throw new TypeError('Reflect.defineProperty called on non-object'); - } - try { - Object.defineProperty(target, propertyKey, descriptor); - return true; - } catch (e) { - return false; - } - }; - } - - if (typeof Reflect.construct !== 'function') { - Reflect.construct = function (Target, args) { - if (args) { - switch (args.length) { - case 0: - return new Target(); - case 1: - return new Target(args[0]); - case 2: - return new Target(args[0], args[1]); - case 3: - return new Target(args[0], args[1], args[2]); - case 4: - return new Target(args[0], args[1], args[2], args[3]); - } - } - - var a = [null]; - a.push.apply(a, args); - return new (bind.apply(Target, a))(); - }; - } - - if (typeof Reflect.ownKeys !== 'function') { - Reflect.ownKeys = function (o) { - return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); - }; - } - })(); -} - -if (typeof FEATURE_NO_ESNEXT === 'undefined') { - (function () { - - var emptyMetadata = Object.freeze({}); - var metadataContainerKey = '__metadata__'; - - if (typeof Reflect.getOwnMetadata !== 'function') { - Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { - if (target.hasOwnProperty(metadataContainerKey)) { - return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; - } - }; - } - - if (typeof Reflect.defineMetadata !== 'function') { - Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { - var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; - var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); - targetContainer[metadataKey] = metadataValue; - }; - } - - if (typeof Reflect.metadata !== 'function') { - Reflect.metadata = function (metadataKey, metadataValue) { - return function (target, targetKey) { - Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); - }; - }; - } - })(); -} \ No newline at end of file diff --git a/dist/native-modules/index.js b/dist/native-modules/index.js deleted file mode 100644 index 6a0f1ce..0000000 --- a/dist/native-modules/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './aurelia-polyfills'; \ No newline at end of file diff --git a/dist/system/aurelia-polyfills.js b/dist/system/aurelia-polyfills.js deleted file mode 100644 index a161ce8..0000000 --- a/dist/system/aurelia-polyfills.js +++ /dev/null @@ -1,869 +0,0 @@ -'use strict'; - -System.register(['aurelia-pal'], function (_export, _context) { - "use strict"; - - var PLATFORM, _typeof; - - return { - setters: [function (_aureliaPal) { - PLATFORM = _aureliaPal.PLATFORM; - }], - execute: function () { - _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; - } : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; - }; - - - if (typeof FEATURE_NO_ES2015 === 'undefined') { - - (function (Object, GOPS) { - 'use strict'; - - if (GOPS in Object) return; - - var setDescriptor, - G = PLATFORM.global, - id = 0, - random = '' + Math.random(), - prefix = '__\x01symbol:', - prefixLength = prefix.length, - internalSymbol = '__\x01symbol@@' + random, - DP = 'defineProperty', - DPies = 'defineProperties', - GOPN = 'getOwnPropertyNames', - GOPD = 'getOwnPropertyDescriptor', - PIE = 'propertyIsEnumerable', - gOPN = Object[GOPN], - gOPD = Object[GOPD], - create = Object.create, - keys = Object.keys, - defineProperty = Object[DP], - $defineProperties = Object[DPies], - descriptor = gOPD(Object, GOPN), - ObjectProto = Object.prototype, - hOP = ObjectProto.hasOwnProperty, - pIE = ObjectProto[PIE], - toString = ObjectProto.toString, - indexOf = Array.prototype.indexOf || function (v) { - for (var i = this.length; i-- && this[i] !== v;) {} - return i; - }, - addInternalIfNeeded = function addInternalIfNeeded(o, uid, enumerable) { - if (!hOP.call(o, internalSymbol)) { - defineProperty(o, internalSymbol, { - enumerable: false, - configurable: false, - writable: false, - value: {} - }); - } - o[internalSymbol]['@@' + uid] = enumerable; - }, - createWithSymbols = function createWithSymbols(proto, descriptors) { - var self = create(proto); - if (descriptors !== null && (typeof descriptors === 'undefined' ? 'undefined' : _typeof(descriptors)) === 'object') { - gOPN(descriptors).forEach(function (key) { - if (propertyIsEnumerable.call(descriptors, key)) { - $defineProperty(self, key, descriptors[key]); - } - }); - } - return self; - }, - copyAsNonEnumerable = function copyAsNonEnumerable(descriptor) { - var newDescriptor = create(descriptor); - newDescriptor.enumerable = false; - return newDescriptor; - }, - get = function get() {}, - onlyNonSymbols = function onlyNonSymbols(name) { - return name != internalSymbol && !hOP.call(source, name); - }, - onlySymbols = function onlySymbols(name) { - return name != internalSymbol && hOP.call(source, name); - }, - propertyIsEnumerable = function propertyIsEnumerable(key) { - var uid = '' + key; - return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol] && this[internalSymbol]['@@' + uid] : pIE.call(this, key); - }, - setAndGetSymbol = function setAndGetSymbol(uid) { - var descriptor = { - enumerable: false, - configurable: true, - get: get, - set: function set(value) { - setDescriptor(this, uid, { - enumerable: false, - configurable: true, - writable: true, - value: value - }); - addInternalIfNeeded(this, uid, true); - } - }; - defineProperty(ObjectProto, uid, descriptor); - return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor); - }, - _Symbol = function _Symbol2(description) { - if (this && this !== G) { - throw new TypeError('Symbol is not a constructor'); - } - return setAndGetSymbol(prefix.concat(description || '', random, ++id)); - }, - source = create(null), - sourceConstructor = { value: _Symbol }, - sourceMap = function sourceMap(uid) { - return source[uid]; - }, - $defineProperty = function defineProp(o, key, descriptor) { - var uid = '' + key; - if (onlySymbols(uid)) { - setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor); - addInternalIfNeeded(o, uid, !!descriptor.enumerable); - } else { - defineProperty(o, key, descriptor); - } - return o; - }, - $getOwnPropertySymbols = function getOwnPropertySymbols(o) { - var cof = toString.call(o); - o = cof === '[object String]' ? o.split('') : Object(o); - return gOPN(o).filter(onlySymbols).map(sourceMap); - }; - - descriptor.value = $defineProperty; - defineProperty(Object, DP, descriptor); - - descriptor.value = $getOwnPropertySymbols; - defineProperty(Object, GOPS, descriptor); - - var cachedWindowNames = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' ? Object.getOwnPropertyNames(window) : []; - var originalObjectGetOwnPropertyNames = Object.getOwnPropertyNames; - descriptor.value = function getOwnPropertyNames(o) { - if (toString.call(o) === '[object Window]') { - try { - return originalObjectGetOwnPropertyNames(o); - } catch (e) { - return [].concat([], cachedWindowNames); - } - } - return gOPN(o).filter(onlyNonSymbols); - }; - defineProperty(Object, GOPN, descriptor); - - descriptor.value = function defineProperties(o, descriptors) { - var symbols = $getOwnPropertySymbols(descriptors); - if (symbols.length) { - keys(descriptors).concat(symbols).forEach(function (uid) { - if (propertyIsEnumerable.call(descriptors, uid)) { - $defineProperty(o, uid, descriptors[uid]); - } - }); - } else { - $defineProperties(o, descriptors); - } - return o; - }; - defineProperty(Object, DPies, descriptor); - - descriptor.value = propertyIsEnumerable; - defineProperty(ObjectProto, PIE, descriptor); - - descriptor.value = _Symbol; - defineProperty(G, 'Symbol', descriptor); - - descriptor.value = function (key) { - var uid = prefix.concat(prefix, key, random); - return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); - }; - defineProperty(_Symbol, 'for', descriptor); - - descriptor.value = function (symbol) { - return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; - }; - defineProperty(_Symbol, 'keyFor', descriptor); - - descriptor.value = function getOwnPropertyDescriptor(o, key) { - var descriptor = gOPD(o, key); - if (descriptor && onlySymbols(key)) { - descriptor.enumerable = propertyIsEnumerable.call(o, key); - } - return descriptor; - }; - defineProperty(Object, GOPD, descriptor); - - descriptor.value = function (proto, descriptors) { - return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); - }; - defineProperty(Object, 'create', descriptor); - - descriptor.value = function () { - var str = toString.call(this); - return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; - }; - defineProperty(ObjectProto, 'toString', descriptor); - - try { - setDescriptor = create(defineProperty({}, prefix, { - get: function get() { - return defineProperty(this, prefix, { value: false })[prefix]; - } - }))[prefix] || defineProperty; - } catch (o_O) { - setDescriptor = function setDescriptor(o, key, descriptor) { - var protoDescriptor = gOPD(ObjectProto, key); - delete ObjectProto[key]; - defineProperty(o, key, descriptor); - defineProperty(ObjectProto, key, protoDescriptor); - }; - } - })(Object, 'getOwnPropertySymbols'); - - (function (O, S) { - var dP = O.defineProperty, - ObjectProto = O.prototype, - toString = ObjectProto.toString, - toStringTag = 'toStringTag', - descriptor; - ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) { - if (!(name in Symbol)) { - dP(Symbol, name, { value: Symbol(name) }); - switch (name) { - case toStringTag: - descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); - descriptor.value = function () { - var str = toString.call(this), - tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag]; - return typeof tst === 'undefined' ? str : '[object ' + tst + ']'; - }; - dP(ObjectProto, 'toString', descriptor); - break; - } - } - }); - })(Object, Symbol); - - (function (Si, AP, SP) { - - function returnThis() { - return this; - } - - if (!AP[Si]) AP[Si] = function () { - var i = 0, - self = this, - iterator = { - next: function next() { - var done = self.length <= i; - return done ? { done: done } : { done: done, value: self[i++] }; - } - }; - iterator[Si] = returnThis; - return iterator; - }; - - if (!SP[Si]) SP[Si] = function () { - var fromCodePoint = String.fromCodePoint, - self = this, - i = 0, - length = self.length, - iterator = { - next: function next() { - var done = length <= i, - c = done ? '' : fromCodePoint(self.codePointAt(i)); - i += c.length; - return done ? { done: done } : { done: done, value: c }; - } - }; - iterator[Si] = returnThis; - return iterator; - }; - })(Symbol.iterator, Array.prototype, String.prototype); - } - - if (typeof FEATURE_NO_ES2015 === 'undefined') { - - Number.isNaN = Number.isNaN || function (value) { - return value !== value; - }; - - Number.isFinite = Number.isFinite || function (value) { - return typeof value === "number" && isFinite(value); - }; - } - - if (!String.prototype.endsWith || function () { - try { - return !"ab".endsWith("a", 1); - } catch (e) { - return true; - } - }()) { - String.prototype.endsWith = function (searchString, position) { - var subjectString = this.toString(); - if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { - position = subjectString.length; - } - position -= searchString.length; - var lastIndex = subjectString.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; - } - - if (!String.prototype.startsWith || function () { - try { - return !"ab".startsWith("b", 1); - } catch (e) { - return true; - } - }()) { - String.prototype.startsWith = function (searchString, position) { - position = position || 0; - return this.substr(position, searchString.length) === searchString; - }; - } - - if (typeof FEATURE_NO_ES2015 === 'undefined') { - - if (!Array.from) { - Array.from = function () { - var toInteger = function toInteger(it) { - return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); - }; - var toLength = function toLength(it) { - return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; - }; - var iterCall = function iterCall(iter, fn, val, index) { - try { - return fn(val, index); - } catch (E) { - if (typeof iter.return == 'function') iter.return(); - throw E; - } - }; - - return function from(arrayLike) { - var O = Object(arrayLike), - C = typeof this == 'function' ? this : Array, - aLen = arguments.length, - mapfn = aLen > 1 ? arguments[1] : undefined, - mapping = mapfn !== undefined, - index = 0, - iterFn = O[Symbol.iterator], - length, - result, - step, - iterator; - if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); - if (iterFn != undefined && !Array.isArray(arrayLike)) { - for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { - result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; - } - } else { - length = toLength(O.length); - for (result = new C(length); length > index; index++) { - result[index] = mapping ? mapfn(O[index], index) : O[index]; - } - } - result.length = index; - return result; - }; - }(); - } - - if (!Array.prototype.find) { - Object.defineProperty(Array.prototype, 'find', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.find called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return value; - } - } - return undefined; - } - }); - } - - if (!Array.prototype.findIndex) { - Object.defineProperty(Array.prototype, 'findIndex', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.findIndex called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return i; - } - } - return -1; - } - }); - } - } - - if (typeof FEATURE_NO_ES2016 === 'undefined' && !Array.prototype.includes) { - Object.defineProperty(Array.prototype, 'includes', { - configurable: true, - writable: true, - enumerable: false, - value: function value(searchElement) { - var O = Object(this); - var len = parseInt(O.length) || 0; - if (len === 0) { - return false; - } - var n = parseInt(arguments[1]) || 0; - var k; - if (n >= 0) { - k = n; - } else { - k = len + n; - if (k < 0) { - k = 0; - } - } - var currentElement; - while (k < len) { - currentElement = O[k]; - if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) { - return true; - } - k++; - } - return false; - } - }); - } - - if (typeof FEATURE_NO_ES2015 === 'undefined') { - - (function () { - var needsFix = false; - - try { - var s = Object.keys('a'); - needsFix = s.length !== 1 || s[0] !== '0'; - } catch (e) { - needsFix = true; - } - - if (needsFix) { - Object.keys = function () { - var hasOwnProperty = Object.prototype.hasOwnProperty, - hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), - dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], - dontEnumsLength = dontEnums.length; - - return function (obj) { - if (obj === undefined || obj === null) { - throw TypeError('Cannot convert undefined or null to object'); - } - - obj = Object(obj); - - var result = [], - prop, - i; - - for (prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - result.push(prop); - } - } - - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); - } - } - } - - return result; - }; - }(); - } - })(); - - (function (O) { - if ('assign' in O) { - return; - } - - O.defineProperty(O, 'assign', { - configurable: true, - writable: true, - value: function () { - var gOPS = O.getOwnPropertySymbols, - pIE = O.propertyIsEnumerable, - filterOS = gOPS ? function (self) { - return gOPS(self).filter(pIE, self); - } : function () { - return Array.prototype; - }; - - return function assign(where) { - if (gOPS && !(where instanceof O)) { - console.warn('problematic Symbols', where); - } - - function set(keyOrSymbol) { - where[keyOrSymbol] = arg[keyOrSymbol]; - } - - for (var i = 1, ii = arguments.length; i < ii; ++i) { - var arg = arguments[i]; - - if (arg === null || arg === undefined) { - continue; - } - - O.keys(arg).concat(filterOS(arg)).forEach(set); - } - - return where; - }; - }() - }); - })(Object); - - if (!Object.is) { - Object.is = function (x, y) { - if (x === y) { - return x !== 0 || 1 / x === 1 / y; - } else { - return x !== x && y !== y; - } - }; - } - } - - if (typeof FEATURE_NO_ES2015 === 'undefined') { - - (function (global) { - var i; - - var defineProperty = Object.defineProperty, - is = function is(a, b) { - return a === b || a !== a && b !== b; - }; - - if (typeof WeakMap == 'undefined') { - global.WeakMap = createCollection({ - 'delete': sharedDelete, - - clear: sharedClear, - - get: sharedGet, - - has: mapHas, - - set: sharedSet - }, true); - } - - if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { - var _createCollection; - - global.Map = createCollection((_createCollection = { - 'delete': sharedDelete, - - has: mapHas, - - get: sharedGet, - - set: sharedSet, - - keys: sharedKeys, - - values: sharedValues, - - entries: mapEntries, - - forEach: sharedForEach, - - clear: sharedClear - }, _createCollection[Symbol.iterator] = mapEntries, _createCollection)); - } - - if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { - var _createCollection2; - - global.Set = createCollection((_createCollection2 = { - has: setHas, - - add: sharedAdd, - - 'delete': sharedDelete, - - clear: sharedClear, - - keys: sharedValues, - values: sharedValues, - - entries: setEntries, - - forEach: sharedForEach - }, _createCollection2[Symbol.iterator] = sharedValues, _createCollection2)); - } - - if (typeof WeakSet == 'undefined') { - global.WeakSet = createCollection({ - 'delete': sharedDelete, - - add: sharedAdd, - - clear: sharedClear, - - has: setHas - }, true); - } - - function createCollection(proto, objectOnly) { - function Collection(a) { - if (!this || this.constructor !== Collection) return new Collection(a); - this._keys = []; - this._values = []; - this._itp = []; - this.objectOnly = objectOnly; - - if (a) init.call(this, a); - } - - if (!objectOnly) { - defineProperty(proto, 'size', { - get: sharedSize - }); - } - - proto.constructor = Collection; - Collection.prototype = proto; - - return Collection; - } - - function init(a) { - var i; - - if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { - this.set(a[0], a[1]); - }, this); - } - - function sharedDelete(key) { - if (this.has(key)) { - this._keys.splice(i, 1); - this._values.splice(i, 1); - - this._itp.forEach(function (p) { - if (i < p[0]) p[0]--; - }); - } - - return -1 < i; - }; - - function sharedGet(key) { - return this.has(key) ? this._values[i] : undefined; - } - - function has(list, key) { - if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); - - if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); - return -1 < i; - } - - function setHas(value) { - return has.call(this, this._values, value); - } - - function mapHas(value) { - return has.call(this, this._keys, value); - } - - function sharedSet(key, value) { - this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; - return this; - } - - function sharedAdd(value) { - if (!this.has(value)) this._values.push(value); - return this; - } - - function sharedClear() { - (this._keys || 0).length = this._values.length = 0; - } - - function sharedKeys() { - return sharedIterator(this._itp, this._keys); - } - - function sharedValues() { - return sharedIterator(this._itp, this._values); - } - - function mapEntries() { - return sharedIterator(this._itp, this._keys, this._values); - } - - function setEntries() { - return sharedIterator(this._itp, this._values, this._values); - } - - function sharedIterator(itp, array, array2) { - var _ref; - - var p = [0], - done = false; - itp.push(p); - return _ref = {}, _ref[Symbol.iterator] = function () { - return this; - }, _ref.next = function next() { - var v, - k = p[0]; - if (!done && k < array.length) { - v = array2 ? [array[k], array2[k]] : array[k]; - p[0]++; - } else { - done = true; - itp.splice(itp.indexOf(p), 1); - } - return { done: done, value: v }; - }, _ref; - } - - function sharedSize() { - return this._values.length; - } - - function sharedForEach(callback, context) { - var it = this.entries(); - for (;;) { - var r = it.next(); - if (r.done) break; - callback.call(context, r.value[1], r.value[0], this); - } - } - })(PLATFORM.global); - } - - if (typeof FEATURE_NO_ES2015 === 'undefined') { - (function () { - - var bind = Function.prototype.bind; - - if (typeof PLATFORM.global.Reflect === 'undefined') { - PLATFORM.global.Reflect = {}; - } - - if (typeof Reflect.defineProperty !== 'function') { - Reflect.defineProperty = function (target, propertyKey, descriptor) { - if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' ? target === null : typeof target !== 'function') { - throw new TypeError('Reflect.defineProperty called on non-object'); - } - try { - Object.defineProperty(target, propertyKey, descriptor); - return true; - } catch (e) { - return false; - } - }; - } - - if (typeof Reflect.construct !== 'function') { - Reflect.construct = function (Target, args) { - if (args) { - switch (args.length) { - case 0: - return new Target(); - case 1: - return new Target(args[0]); - case 2: - return new Target(args[0], args[1]); - case 3: - return new Target(args[0], args[1], args[2]); - case 4: - return new Target(args[0], args[1], args[2], args[3]); - } - } - - var a = [null]; - a.push.apply(a, args); - return new (bind.apply(Target, a))(); - }; - } - - if (typeof Reflect.ownKeys !== 'function') { - Reflect.ownKeys = function (o) { - return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); - }; - } - })(); - } - - if (typeof FEATURE_NO_ESNEXT === 'undefined') { - (function () { - - var emptyMetadata = Object.freeze({}); - var metadataContainerKey = '__metadata__'; - - if (typeof Reflect.getOwnMetadata !== 'function') { - Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { - if (target.hasOwnProperty(metadataContainerKey)) { - return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; - } - }; - } - - if (typeof Reflect.defineMetadata !== 'function') { - Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { - var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; - var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); - targetContainer[metadataKey] = metadataValue; - }; - } - - if (typeof Reflect.metadata !== 'function') { - Reflect.metadata = function (metadataKey, metadataValue) { - return function (target, targetKey) { - Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); - }; - }; - } - })(); - } - } - }; -}); \ No newline at end of file diff --git a/dist/system/index.js b/dist/system/index.js deleted file mode 100644 index 670ad3a..0000000 --- a/dist/system/index.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -System.register(['./aurelia-polyfills'], function (_export, _context) { - "use strict"; - - return { - setters: [function (_aureliaPolyfills) { - var _exportObj = {}; - - for (var _key in _aureliaPolyfills) { - if (_key !== "default" && key !== "__esModule") _exportObj[_key] = _aureliaPolyfills[_key]; - } - - _export(_exportObj); - }], - execute: function () {} - }; -}); \ No newline at end of file diff --git a/package.json b/package.json index 2076877..fe786e6 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,13 @@ "type": "git", "url": "http://github.com/aurelia/polyfills" }, + "files": [ + "dist", + "doc", + "src", + "README.md", + "LICENSE" + ], "jspm": { "registry": "npm", "jspmPackage": true,