Commit Graph

53 Commits

Author SHA1 Message Date
Tim Schaub
99612e7f9a Remove opt_ prefix 2022-08-11 20:14:35 -06:00
Maximilian Krög
31ed30923d Remove array.includes 2022-08-05 01:26:25 +02:00
Tim Schaub
82ceaea4ab Use Array.prototype.findIndex 2022-07-27 14:00:06 -06:00
Tim Schaub
157bdc5208 Use Array.prototype.find 2022-07-27 13:57:35 -06:00
Frederic Junod
5c212008de Spelling fix 2021-09-07 09:47:47 +02:00
mike-000
90598156b6 Handle NearestDirectionFunction 2021-07-09 11:31:41 +01:00
Simon Seyock
8facb252f1 Replace google closure syntax = with brackets around name 2021-02-03 14:06:02 +01:00
Tim Schaub
054af09032 Make code prettier
This updates ESLint and our shared eslint-config-openlayers to use Prettier.  Most formatting changes were automatically applied with this:

    npm run lint -- --fix

A few manual changes were required:

 * In `examples/offscreen-canvas.js`, the `//eslint-disable-line` comment needed to be moved to the appropriate line to disable the error about the `'worker-loader!./offscreen-canvas.worker.js'` import.
 * In `examples/webpack/exapmle-builder.js`, spaces could not be added after a couple `function`s for some reason.  While editing this, I reworked `ExampleBuilder` to be a class.
 * In `src/ol/format/WMSGetFeatureInfo.js`, the `// @ts-ignore` comment needed to be moved down one line so it applied to the `parsersNS` argument.
2020-04-06 12:54:09 -06:00
Guillaume Beraudo
abbfb5c653 Document the stableSort function 2018-08-06 10:50:18 +02:00
Guillaume Beraudo
a4178d05ef Expose the stableSort function
This is a low level function, essential to OpenLayers so it is always
shipped with OpenLayers.
2018-08-06 09:18:56 +02:00
Tim Schaub
d12ef20b12 Use Array<Foo> instead of Array.<Foo> 2018-07-25 18:32:43 -07:00
Tim Schaub
b8c9125602 Remove lint 2018-07-18 10:35:54 -06:00
Frederic Junod
735798a88c Add some typecast for the closure-compiler 2018-03-08 08:29:20 +01:00
Tim Schaub
ad62739a6e Use blocked scoped variables
In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
2018-01-12 00:50:30 -07:00
Marc Jansen
02002082bf Named exports from ol/array module 2017-12-19 17:22:58 +01:00
Tim Schaub
7f47883c48 Transformed 2017-12-12 06:53:18 -07:00
Frederic Junod
5763e1d145 Remove unused goog.require 2017-02-03 12:40:53 +01:00
Frederic Junod
d8c5e81675 Remove unused ol.array.flatten function 2017-01-12 10:39:19 +01:00
Tim Schaub
137cdc04c8 Remove ol.DEBUG 2017-01-01 20:37:52 -07:00
Frederic Junod
d812804b2e Remove unused ol.array.binaryFindNearest function 2016-09-15 10:39:46 +02:00
Marc Jansen
d5691676de Require ol in ol.array 2016-09-02 11:08:33 +02:00
Andreas Hocevar
d1e4b33760 Rename goog.DEBUG to ol.DEBUG 2016-08-31 21:10:01 +02:00
Andreas Hocevar
e0015b3d4e Use goog.DEBUG instead of ol.DEBUG for now 2016-08-04 11:29:54 +02:00
Andreas Hocevar
6f5ed17fc5 Remove goog.asserts.*
This pull requests replaces type check hint assertions with type casts,
library sanity check assertions with conditional console.assert statements
in debug mode, and runtime sanity checks with assertions that throw an
ol.AssertionError with an error code for lookup outside the library.
2016-08-04 11:29:54 +02:00
Frederic Junod
89e377cb48 Get rid of goog.isArrayLike
With this change, it's no longer possible to extend an array with
an "array like" object (an object with a 'length' property).
We were not using this feature in the library.
2016-07-04 16:17:36 +02:00
Frederic Junod
4bf1f56405 Add missing semicolon 2016-06-09 15:39:46 +02:00
Frederic Junod
9507020218 Fix jsdoc tags indentation 2016-04-13 15:13:50 +02:00
Frederic Junod
80e984a9c3 Use Array.isArray instead of goog.isArray 2016-04-04 09:06:29 +02:00
Nicholas L
1771df0109 Change binary search to return the lowest position 2016-02-03 11:41:41 +13:00
Marc Jansen
434349cb55 Check length of arrays when checking equality 2016-02-03 11:41:40 +13:00
Andreas Hocevar
2fb33ba940 Type fixes and simplifications 2016-02-03 11:41:40 +13:00
Nicholas L
d81af7594c Update JSDocs/functions after review 2016-02-03 11:41:40 +13:00
Nicholas L
e08a88b76c Remove low and high from binarysearch, use numberSafeCompareFunction 2016-02-03 11:41:40 +13:00
Nicholas L
ef0e95847f Remove goog.array.binarySearch 2016-02-03 11:41:40 +13:00
Nicholas L
ab793a58b6 Remove goog.array.isSorted 2016-02-03 11:41:39 +13:00
Nicholas L
9b492f49c7 Remove goog.array.findIndex 2016-02-03 11:41:39 +13:00
Nicholas L
d820b54443 Remove goog.array.equals and goog.array.stableSort 2016-02-03 11:41:39 +13:00
Nicholas L
640c59d9af Remove goog.array.find 2016-02-03 11:41:39 +13:00
Nicholas L
d743ada8fd Remove goog.array.remove 2016-02-03 11:41:39 +13:00
Nicholas L
d1b6a17773 Remove goog.array.extend 2016-02-03 11:41:38 +13:00
Nicholas L
39ead1bb49 Remove use of goog.array.flatten 2016-02-03 11:41:38 +13:00
Bart van den Eijnden
25e0053a13 Rename defaultSort to numberSafeCompareFunction on ol.array 2015-12-16 13:40:05 +01:00
Bart van den Eijnden
e0be143ed5 Always pass on a compare function to sort 2015-12-16 10:54:46 +01:00
Frederic Junod
88c3891bef Replace goog.array.contains with ol.array.includes 2015-09-29 10:42:07 +02:00
Bart van den Eijnden
47ce127a10 Add assert messages for all assertions up until ol.renderer.vector. 2015-03-30 22:55:23 +02:00
Frederic Junod
f8b59dbd53 Use goog.array.extend instead of ol.array.safeExtend
The upstream implementation now supports large arrays.
See https://github.com/google/closure-library/pull/356
2014-12-09 11:55:27 +01:00
Tom Payne
71dae7b71e Add ol.array.safeExtend 2014-03-24 11:56:53 +01:00
Éric Lemoine
0d0b19128f Add ol.array.reverseSubArray 2013-12-08 21:35:27 +01:00
Tom Payne
6cc8104ad3 Add some type hints in ol.array 2013-07-22 18:21:57 +02:00
Tom Payne
e132943eef Use goog.asserts.fail 2013-04-08 19:14:16 +02:00