moment-range
Advanced tools
Comparing version 3.0.0 to 3.0.1
# Moment Range | ||
All notable changes to this project will be documented in this file. | ||
The format is based on [Keep a Changelog](http://keepachangelog.com/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/). | ||
## [Unreleased] | ||
*Nothing* | ||
## [3.0.1] | ||
### Added | ||
* Added contributors to *README* | ||
* Added CircleCI badge to *README* | ||
* Added yarn lockfile | ||
* Added polyfill for `Symbol` | ||
### Changed | ||
* Updated contributors in *package.json* | ||
* Updated usage instructions for browsers (`window['moment-range']`) | ||
* Moved `expect.js` from dependencies to development dependencies | ||
## [3.0.0] | ||
@@ -54,3 +72,4 @@ ### Added | ||
[Unreleased]: https://github.com/gf3/moment-range/tree/master | ||
[3.0.0]: https://github.com/gf3/moment-range/releases/tag/v3.0.0 | ||
[Unreleased]: https://github.com/gf3/moment-range/compare/v3.0.1...HEAD | ||
[3.0.1]: https://github.com/gf3/moment-range/compare/v3.0.0...v3.0.1 | ||
[3.0.0]: https://github.com/gf3/moment-range/compare/v1.0.5...v3.0.1 |
@@ -76,2 +76,6 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
var _es6Symbol = __webpack_require__(2); | ||
var _es6Symbol2 = _interopRequireDefault(_es6Symbol); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -153,3 +157,3 @@ | ||
return _defineProperty({}, Symbol.iterator, function () { | ||
return _defineProperty({}, _es6Symbol2.default.iterator, function () { | ||
var exclusive = options.exclusive || false; | ||
@@ -187,3 +191,3 @@ var step = options.step || 1; | ||
return _defineProperty({}, Symbol.iterator, function () { | ||
return _defineProperty({}, _es6Symbol2.default.iterator, function () { | ||
if (unit === Infinity) { | ||
@@ -300,3 +304,3 @@ return { done: true }; | ||
return _defineProperty({}, Symbol.iterator, function () { | ||
return _defineProperty({}, _es6Symbol2.default.iterator, function () { | ||
var exclusive = options.exclusive || false; | ||
@@ -334,3 +338,3 @@ var step = options.step || 1; | ||
return _defineProperty({}, Symbol.iterator, function () { | ||
return _defineProperty({}, _es6Symbol2.default.iterator, function () { | ||
if (unit === Infinity) { | ||
@@ -443,2 +447,432 @@ return { done: true }; | ||
/***/ }, | ||
/* 2 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
module.exports = __webpack_require__(3)() ? Symbol : __webpack_require__(4); | ||
/***/ }, | ||
/* 3 */ | ||
/***/ function(module, exports) { | ||
'use strict'; | ||
var validTypes = { object: true, symbol: true }; | ||
module.exports = function () { | ||
var symbol; | ||
if (typeof Symbol !== 'function') return false; | ||
symbol = Symbol('test symbol'); | ||
try { String(symbol); } catch (e) { return false; } | ||
// Return 'true' also for polyfills | ||
if (!validTypes[typeof Symbol.iterator]) return false; | ||
if (!validTypes[typeof Symbol.toPrimitive]) return false; | ||
if (!validTypes[typeof Symbol.toStringTag]) return false; | ||
return true; | ||
}; | ||
/***/ }, | ||
/* 4 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
// ES2015 Symbol polyfill for environments that do not support it (or partially support it) | ||
'use strict'; | ||
var d = __webpack_require__(5) | ||
, validateSymbol = __webpack_require__(18) | ||
, create = Object.create, defineProperties = Object.defineProperties | ||
, defineProperty = Object.defineProperty, objPrototype = Object.prototype | ||
, NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null) | ||
, isNativeSafe; | ||
if (typeof Symbol === 'function') { | ||
NativeSymbol = Symbol; | ||
try { | ||
String(NativeSymbol()); | ||
isNativeSafe = true; | ||
} catch (ignore) {} | ||
} | ||
var generateName = (function () { | ||
var created = create(null); | ||
return function (desc) { | ||
var postfix = 0, name, ie11BugWorkaround; | ||
while (created[desc + (postfix || '')]) ++postfix; | ||
desc += (postfix || ''); | ||
created[desc] = true; | ||
name = '@@' + desc; | ||
defineProperty(objPrototype, name, d.gs(null, function (value) { | ||
// For IE11 issue see: | ||
// https://connect.microsoft.com/IE/feedbackdetail/view/1928508/ | ||
// ie11-broken-getters-on-dom-objects | ||
// https://github.com/medikoo/es6-symbol/issues/12 | ||
if (ie11BugWorkaround) return; | ||
ie11BugWorkaround = true; | ||
defineProperty(this, name, d(value)); | ||
ie11BugWorkaround = false; | ||
})); | ||
return name; | ||
}; | ||
}()); | ||
// Internal constructor (not one exposed) for creating Symbol instances. | ||
// This one is used to ensure that `someSymbol instanceof Symbol` always return false | ||
HiddenSymbol = function Symbol(description) { | ||
if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor'); | ||
return SymbolPolyfill(description); | ||
}; | ||
// Exposed `Symbol` constructor | ||
// (returns instances of HiddenSymbol) | ||
module.exports = SymbolPolyfill = function Symbol(description) { | ||
var symbol; | ||
if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor'); | ||
if (isNativeSafe) return NativeSymbol(description); | ||
symbol = create(HiddenSymbol.prototype); | ||
description = (description === undefined ? '' : String(description)); | ||
return defineProperties(symbol, { | ||
__description__: d('', description), | ||
__name__: d('', generateName(description)) | ||
}); | ||
}; | ||
defineProperties(SymbolPolyfill, { | ||
for: d(function (key) { | ||
if (globalSymbols[key]) return globalSymbols[key]; | ||
return (globalSymbols[key] = SymbolPolyfill(String(key))); | ||
}), | ||
keyFor: d(function (s) { | ||
var key; | ||
validateSymbol(s); | ||
for (key in globalSymbols) if (globalSymbols[key] === s) return key; | ||
}), | ||
// If there's native implementation of given symbol, let's fallback to it | ||
// to ensure proper interoperability with other native functions e.g. Array.from | ||
hasInstance: d('', (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill('hasInstance')), | ||
isConcatSpreadable: d('', (NativeSymbol && NativeSymbol.isConcatSpreadable) || | ||
SymbolPolyfill('isConcatSpreadable')), | ||
iterator: d('', (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill('iterator')), | ||
match: d('', (NativeSymbol && NativeSymbol.match) || SymbolPolyfill('match')), | ||
replace: d('', (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill('replace')), | ||
search: d('', (NativeSymbol && NativeSymbol.search) || SymbolPolyfill('search')), | ||
species: d('', (NativeSymbol && NativeSymbol.species) || SymbolPolyfill('species')), | ||
split: d('', (NativeSymbol && NativeSymbol.split) || SymbolPolyfill('split')), | ||
toPrimitive: d('', (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill('toPrimitive')), | ||
toStringTag: d('', (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill('toStringTag')), | ||
unscopables: d('', (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill('unscopables')) | ||
}); | ||
// Internal tweaks for real symbol producer | ||
defineProperties(HiddenSymbol.prototype, { | ||
constructor: d(SymbolPolyfill), | ||
toString: d('', function () { return this.__name__; }) | ||
}); | ||
// Proper implementation of methods exposed on Symbol.prototype | ||
// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype | ||
defineProperties(SymbolPolyfill.prototype, { | ||
toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }), | ||
valueOf: d(function () { return validateSymbol(this); }) | ||
}); | ||
defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', function () { | ||
var symbol = validateSymbol(this); | ||
if (typeof symbol === 'symbol') return symbol; | ||
return symbol.toString(); | ||
})); | ||
defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol')); | ||
// Proper implementaton of toPrimitive and toStringTag for returned symbol instances | ||
defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, | ||
d('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])); | ||
// Note: It's important to define `toPrimitive` as last one, as some implementations | ||
// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols) | ||
// And that may invoke error in definition flow: | ||
// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149 | ||
defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, | ||
d('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])); | ||
/***/ }, | ||
/* 5 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var assign = __webpack_require__(6) | ||
, normalizeOpts = __webpack_require__(13) | ||
, isCallable = __webpack_require__(14) | ||
, contains = __webpack_require__(15) | ||
, d; | ||
d = module.exports = function (dscr, value/*, options*/) { | ||
var c, e, w, options, desc; | ||
if ((arguments.length < 2) || (typeof dscr !== 'string')) { | ||
options = value; | ||
value = dscr; | ||
dscr = null; | ||
} else { | ||
options = arguments[2]; | ||
} | ||
if (dscr == null) { | ||
c = w = true; | ||
e = false; | ||
} else { | ||
c = contains.call(dscr, 'c'); | ||
e = contains.call(dscr, 'e'); | ||
w = contains.call(dscr, 'w'); | ||
} | ||
desc = { value: value, configurable: c, enumerable: e, writable: w }; | ||
return !options ? desc : assign(normalizeOpts(options), desc); | ||
}; | ||
d.gs = function (dscr, get, set/*, options*/) { | ||
var c, e, options, desc; | ||
if (typeof dscr !== 'string') { | ||
options = set; | ||
set = get; | ||
get = dscr; | ||
dscr = null; | ||
} else { | ||
options = arguments[3]; | ||
} | ||
if (get == null) { | ||
get = undefined; | ||
} else if (!isCallable(get)) { | ||
options = get; | ||
get = set = undefined; | ||
} else if (set == null) { | ||
set = undefined; | ||
} else if (!isCallable(set)) { | ||
options = set; | ||
set = undefined; | ||
} | ||
if (dscr == null) { | ||
c = true; | ||
e = false; | ||
} else { | ||
c = contains.call(dscr, 'c'); | ||
e = contains.call(dscr, 'e'); | ||
} | ||
desc = { get: get, set: set, configurable: c, enumerable: e }; | ||
return !options ? desc : assign(normalizeOpts(options), desc); | ||
}; | ||
/***/ }, | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
module.exports = __webpack_require__(7)() | ||
? Object.assign | ||
: __webpack_require__(8); | ||
/***/ }, | ||
/* 7 */ | ||
/***/ function(module, exports) { | ||
'use strict'; | ||
module.exports = function () { | ||
var assign = Object.assign, obj; | ||
if (typeof assign !== 'function') return false; | ||
obj = { foo: 'raz' }; | ||
assign(obj, { bar: 'dwa' }, { trzy: 'trzy' }); | ||
return (obj.foo + obj.bar + obj.trzy) === 'razdwatrzy'; | ||
}; | ||
/***/ }, | ||
/* 8 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var keys = __webpack_require__(9) | ||
, value = __webpack_require__(12) | ||
, max = Math.max; | ||
module.exports = function (dest, src/*, …srcn*/) { | ||
var error, i, l = max(arguments.length, 2), assign; | ||
dest = Object(value(dest)); | ||
assign = function (key) { | ||
try { dest[key] = src[key]; } catch (e) { | ||
if (!error) error = e; | ||
} | ||
}; | ||
for (i = 1; i < l; ++i) { | ||
src = arguments[i]; | ||
keys(src).forEach(assign); | ||
} | ||
if (error !== undefined) throw error; | ||
return dest; | ||
}; | ||
/***/ }, | ||
/* 9 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
module.exports = __webpack_require__(10)() | ||
? Object.keys | ||
: __webpack_require__(11); | ||
/***/ }, | ||
/* 10 */ | ||
/***/ function(module, exports) { | ||
'use strict'; | ||
module.exports = function () { | ||
try { | ||
Object.keys('primitive'); | ||
return true; | ||
} catch (e) { return false; } | ||
}; | ||
/***/ }, | ||
/* 11 */ | ||
/***/ function(module, exports) { | ||
'use strict'; | ||
var keys = Object.keys; | ||
module.exports = function (object) { | ||
return keys(object == null ? object : Object(object)); | ||
}; | ||
/***/ }, | ||
/* 12 */ | ||
/***/ function(module, exports) { | ||
'use strict'; | ||
module.exports = function (value) { | ||
if (value == null) throw new TypeError("Cannot use null or undefined"); | ||
return value; | ||
}; | ||
/***/ }, | ||
/* 13 */ | ||
/***/ function(module, exports) { | ||
'use strict'; | ||
var forEach = Array.prototype.forEach, create = Object.create; | ||
var process = function (src, obj) { | ||
var key; | ||
for (key in src) obj[key] = src[key]; | ||
}; | ||
module.exports = function (options/*, …options*/) { | ||
var result = create(null); | ||
forEach.call(arguments, function (options) { | ||
if (options == null) return; | ||
process(Object(options), result); | ||
}); | ||
return result; | ||
}; | ||
/***/ }, | ||
/* 14 */ | ||
/***/ function(module, exports) { | ||
// Deprecated | ||
'use strict'; | ||
module.exports = function (obj) { return typeof obj === 'function'; }; | ||
/***/ }, | ||
/* 15 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
module.exports = __webpack_require__(16)() | ||
? String.prototype.contains | ||
: __webpack_require__(17); | ||
/***/ }, | ||
/* 16 */ | ||
/***/ function(module, exports) { | ||
'use strict'; | ||
var str = 'razdwatrzy'; | ||
module.exports = function () { | ||
if (typeof str.contains !== 'function') return false; | ||
return ((str.contains('dwa') === true) && (str.contains('foo') === false)); | ||
}; | ||
/***/ }, | ||
/* 17 */ | ||
/***/ function(module, exports) { | ||
'use strict'; | ||
var indexOf = String.prototype.indexOf; | ||
module.exports = function (searchString/*, position*/) { | ||
return indexOf.call(this, searchString, arguments[1]) > -1; | ||
}; | ||
/***/ }, | ||
/* 18 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var isSymbol = __webpack_require__(19); | ||
module.exports = function (value) { | ||
if (!isSymbol(value)) throw new TypeError(value + " is not a symbol"); | ||
return value; | ||
}; | ||
/***/ }, | ||
/* 19 */ | ||
/***/ function(module, exports) { | ||
'use strict'; | ||
module.exports = function (x) { | ||
if (!x) return false; | ||
if (typeof x === 'symbol') return true; | ||
if (!x.constructor) return false; | ||
if (x.constructor.name !== 'Symbol') return false; | ||
return (x[x.constructor.toStringTag] === 'Symbol'); | ||
}; | ||
/***/ } | ||
@@ -445,0 +879,0 @@ /******/ ]) |
@@ -6,13 +6,20 @@ { | ||
"contributors": [ | ||
"Adam Biggs <adam.biggs@lightmaker.com>", | ||
"Adam Biggs (lightmaker.com)", | ||
"Mats Julian Olsen (https://github.com/mewwts)", | ||
"Matt Patterson <matt@reprocessed.org> (http://reprocessed.org/)", | ||
"Stuart Kelly <stuart.leigh83@gmail.com>", | ||
"Wilgert Velinga <wilgert@wilgert.nl> (http://neocles.io)", | ||
"Tomasz Bak (http://twitter.com/tomaszbak)", | ||
"Stuart Kelly (https://github.com/stuartleigh)", | ||
"Jeremy Forsythe <jdforsythe@gmail.com> (https://github.com/jdforsythe)", | ||
"Александр Гренишин <nd0ut.me@gmail.com> (https://github.com/nd0ut)", | ||
"@scotthovestadt (https://github.com/scotthovestadt)", | ||
"Thomas van Lankveld (https://github.com/thomasvanlankveld)", | ||
"nebel <nebel@outlook.com> (https://github.com/pronebel)", | ||
"Kevin Ross <kevin.ross@alienfast.com> (http://www.alienfast.com)", | ||
"Scott Hovestadt <scott.hovestadt@gmail.com>", | ||
"Nebel <nebel08@gmail.com>", | ||
"Aristide Niyungeko <niyungeko@gmail.com>", | ||
"Thomas Walpole <twalpole@gmail.com> (https://github.com/twalpole)", | ||
"Jonathan Kim <hello@jkimbo.co.uk> (jkimbo.co.uk)", | ||
"Tymon Tobolski <i@teamon.eu> (http://teamon.eu)", | ||
"Bradley Ayers <bradley.ayers@gmail.com>", | ||
"Thomas Walpole <twalpole@gmail.com>", | ||
"Daniel Sarfati <daniel@knockrentals.com>" | ||
"Aristide Niyungeko <aristide.niyungeko@gmail.com> (https://github.com/aristiden7o)", | ||
"Bradley Ayers <bradley.ayers@gmail.com> (https://github.com/bradleyayers)", | ||
"Ross Hadden <ross@hadden.family> (http://rosshadden.github.com/resume)" | ||
], | ||
@@ -22,3 +29,3 @@ "homepage": "https://github.com/gf3/moment-range", | ||
"main": "./dist/moment-range", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"engines": { | ||
@@ -51,2 +58,3 @@ "node": "*" | ||
"eslint-loader": "^1.6.1", | ||
"expect.js": "^0.3.1", | ||
"flow-bin": "^0.36.0", | ||
@@ -62,2 +70,3 @@ "karma": "^1.3.0", | ||
"mocha": "^2.5.3", | ||
"moment": "^2.17.1", | ||
"webpack": "^1.13.3" | ||
@@ -77,4 +86,4 @@ }, | ||
"dependencies": { | ||
"expect.js": "^0.3.1" | ||
"es6-symbol": "^3.1.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# moment-range | ||
# moment-range [![CircleCI](https://circleci.com/gh/gf3/moment-range.svg?style=shield)](https://circleci.com/gh/gf3/moment-range) | ||
@@ -39,2 +39,3 @@ Fancy date ranges for [Moment.js][moment]. | ||
- [Running Tests](#running-tests) | ||
- [Contributors](#contributors) | ||
- [License](#license) | ||
@@ -83,3 +84,3 @@ | ||
``` js | ||
DateRange.extendMoment(moment); | ||
window['moment-range'].extendMoment(moment); | ||
``` | ||
@@ -584,3 +585,24 @@ | ||
## Contributors | ||
- [**Adam Biggs**](https://github.com/adambiggs) (http://lightmaker.com) | ||
- [**Mats Julian Olsen**](https://github.com/mewwts) | ||
- [**Matt Patterson**](https://github.com/fidothe) (http://reprocessed.org/) | ||
- [**Wilgert Velinga**](https://github.com/wilgert) (http://neocles.io) | ||
- [**Tomasz Bak**](https://github.com/tb) (http://twitter.com/tomaszbak) | ||
- [**Stuart Kelly**](https://github.com/stuartleigh) | ||
- [**Jeremy Forsythe**](https://github.com/jdforsythe) | ||
- [**Александр Гренишин**](https://github.com/nd0ut) | ||
- [**@scotthovestadt**](https://github.com/scotthovestadt) | ||
- [**Thomas van Lankveld**](https://github.com/thomasvanlankveld) | ||
- [**nebel**](https://github.com/pronebel) | ||
- [**Kevin Ross**](https://github.com/rosskevin) (http://www.alienfast.com) | ||
- [**Thomas Walpole**](https://github.com/twalpole) | ||
- [**Jonathan Kim**](https://github.com/jkimbo) (http://jkimbo.co.uk) | ||
- [**Tymon Tobolski**](https://github.com/teamon) (http://teamon.eu) | ||
- [**Aristide Niyungeko**](https://github.com/aristiden7o) | ||
- [**Bradley Ayers**](https://github.com/bradleyayers) | ||
- [**Ross Hadden**](https://github.com/rosshadden) (http://rosshadden.github.com/resume) | ||
## License | ||
@@ -587,0 +609,0 @@ |
Sorry, the diff of this file is not supported yet
83350
708
617
23
+ Addedes6-symbol@^3.1.0
+ Addedd@1.0.2(transitive)
+ Addedes5-ext@0.10.64(transitive)
+ Addedes6-iterator@2.0.3(transitive)
+ Addedes6-symbol@3.1.4(transitive)
+ Addedesniff@2.0.1(transitive)
+ Addedevent-emitter@0.3.5(transitive)
+ Addedext@1.7.0(transitive)
+ Addednext-tick@1.1.0(transitive)
+ Addedtype@2.7.2(transitive)
- Removedexpect.js@^0.3.1
- Removedexpect.js@0.3.1(transitive)