Browse Source

client

main
Pau 8 months ago
parent
commit
aff9d08cee
  1. BIN
      client/altures_bcn.pdf
  2. 55
      client/cadastre.html
  3. 49
      client/index.js
  4. 1
      client/node_modules/.bin/detect-libc
  5. 1
      client/node_modules/.bin/is-ci
  6. 1
      client/node_modules/.bin/mime
  7. 1
      client/node_modules/.bin/mkdirp
  8. 1
      client/node_modules/.bin/needle
  9. 1
      client/node_modules/.bin/node-gyp
  10. 1
      client/node_modules/.bin/node-pre-gyp
  11. 1
      client/node_modules/.bin/nodemon
  12. 1
      client/node_modules/.bin/nodetouch
  13. 1
      client/node_modules/.bin/nopt
  14. 1
      client/node_modules/.bin/rc
  15. 1
      client/node_modules/.bin/rimraf
  16. 1
      client/node_modules/.bin/semver
  17. 1
      client/node_modules/.bin/sshpk-conv
  18. 1
      client/node_modules/.bin/sshpk-sign
  19. 1
      client/node_modules/.bin/sshpk-verify
  20. 1
      client/node_modules/.bin/uuid
  21. 1
      client/node_modules/.bin/which
  22. 132
      client/node_modules/@sindresorhus/is/dist/index.d.ts
  23. 245
      client/node_modules/@sindresorhus/is/dist/index.js
  24. 1
      client/node_modules/@sindresorhus/is/dist/index.js.map
  25. 9
      client/node_modules/@sindresorhus/is/license
  26. 96
      client/node_modules/@sindresorhus/is/package.json
  27. 451
      client/node_modules/@sindresorhus/is/readme.md
  28. 21
      client/node_modules/@szmarczak/http-timer/LICENSE
  29. 70
      client/node_modules/@szmarczak/http-timer/README.md
  30. 75
      client/node_modules/@szmarczak/http-timer/package.json
  31. 99
      client/node_modules/@szmarczak/http-timer/source/index.js
  32. 21
      client/node_modules/@types/component-emitter/LICENSE
  33. 16
      client/node_modules/@types/component-emitter/README.md
  34. 22
      client/node_modules/@types/component-emitter/index.d.ts
  35. 53
      client/node_modules/@types/component-emitter/package.json
  36. 21
      client/node_modules/@types/cookie/LICENSE
  37. 16
      client/node_modules/@types/cookie/README.md
  38. 135
      client/node_modules/@types/cookie/index.d.ts
  39. 57
      client/node_modules/@types/cookie/package.json
  40. 21
      client/node_modules/@types/cors/LICENSE
  41. 16
      client/node_modules/@types/cors/README.md
  42. 58
      client/node_modules/@types/cors/index.d.ts
  43. 57
      client/node_modules/@types/cors/package.json
  44. 21
      client/node_modules/@types/node/LICENSE
  45. 16
      client/node_modules/@types/node/README.md
  46. 124
      client/node_modules/@types/node/assert.d.ts
  47. 4
      client/node_modules/@types/node/assert/strict.d.ts
  48. 226
      client/node_modules/@types/node/async_hooks.d.ts
  49. 19
      client/node_modules/@types/node/base.d.ts
  50. 22
      client/node_modules/@types/node/buffer.d.ts
  51. 517
      client/node_modules/@types/node/child_process.d.ts
  52. 262
      client/node_modules/@types/node/cluster.d.ts
  53. 133
      client/node_modules/@types/node/console.d.ts
  54. 13
      client/node_modules/@types/node/constants.d.ts
  55. 1270
      client/node_modules/@types/node/crypto.d.ts
  56. 141
      client/node_modules/@types/node/dgram.d.ts
  57. 34
      client/node_modules/@types/node/diagnostic_channel.d.ts
  58. 322
      client/node_modules/@types/node/dns.d.ts
  59. 97
      client/node_modules/@types/node/dns/promises.d.ts
  60. 24
      client/node_modules/@types/node/domain.d.ts
  61. 86
      client/node_modules/@types/node/events.d.ts
  62. 2275
      client/node_modules/@types/node/fs.d.ts
  63. 558
      client/node_modules/@types/node/fs/promises.d.ts
  64. 649
      client/node_modules/@types/node/globals.d.ts
  65. 1
      client/node_modules/@types/node/globals.global.d.ts
  66. 425
      client/node_modules/@types/node/http.d.ts
  67. 969
      client/node_modules/@types/node/http2.d.ts
  68. 36
      client/node_modules/@types/node/https.d.ts
  69. 58
      client/node_modules/@types/node/index.d.ts
  70. 3041
      client/node_modules/@types/node/inspector.d.ts
  71. 52
      client/node_modules/@types/node/module.d.ts
  72. 326
      client/node_modules/@types/node/net.d.ts
  73. 239
      client/node_modules/@types/node/os.d.ts
  74. 220
      client/node_modules/@types/node/package.json
  75. 163
      client/node_modules/@types/node/path.d.ts
  76. 274
      client/node_modules/@types/node/perf_hooks.d.ts
  77. 449
      client/node_modules/@types/node/process.d.ts
  78. 75
      client/node_modules/@types/node/punycode.d.ts
  79. 28
      client/node_modules/@types/node/querystring.d.ts
  80. 171
      client/node_modules/@types/node/readline.d.ts
  81. 395
      client/node_modules/@types/node/repl.d.ts
  82. 463
      client/node_modules/@types/node/stream.d.ts
  83. 67
      client/node_modules/@types/node/stream/promises.d.ts
  84. 7
      client/node_modules/@types/node/string_decoder.d.ts
  85. 30
      client/node_modules/@types/node/timers.d.ts
  86. 13
      client/node_modules/@types/node/timers/promises.d.ts
  87. 779
      client/node_modules/@types/node/tls.d.ts
  88. 61
      client/node_modules/@types/node/trace_events.d.ts
  89. 98
      client/node_modules/@types/node/ts3.6/assert.d.ts
  90. 68
      client/node_modules/@types/node/ts3.6/base.d.ts
  91. 7
      client/node_modules/@types/node/ts3.6/index.d.ts
  92. 66
      client/node_modules/@types/node/tty.d.ts
  93. 116
      client/node_modules/@types/node/url.d.ts
  94. 156
      client/node_modules/@types/node/util.d.ts
  95. 57
      client/node_modules/@types/node/util/types.d.ts
  96. 198
      client/node_modules/@types/node/v8.d.ts
  97. 152
      client/node_modules/@types/node/vm.d.ts
  98. 86
      client/node_modules/@types/node/wasi.d.ts
  99. 247
      client/node_modules/@types/node/worker_threads.d.ts
  100. 361
      client/node_modules/@types/node/zlib.d.ts

BIN
client/altures_bcn.pdf

Binary file not shown.

55
client/cadastre.html

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
crossorigin=""/>
<style>
#myMap {
height: 1000px;
}
</style>
<title>Map</title>
</head>
<body>
<div id="myMap"></div>
</body>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
crossorigin=""></script>
<script>
const tilesProvider = 'https://{s}.tile.openstreetmap.de/{z}/{x}/{y}.png'
let myMap = L.map ('myMap').setView([41.41,2.13],12)
L.tileLayer (tilesProvider, {
maxzoom: 18,
}).addTo (myMap)
/*DEfinim les propietats del marcador*/
let iconMarker = L.icon({
iconUrl:'marker.png',
iconSize:[30,30],
iconAnchor:[15,30] /*A quin punt en píxels de la imatge es clva el marcador al mapa */
})
/*Definim el marcador amb les coordenades i l'objecte iconMarker definit*/
/*carregar els arxius geojson*/
function fetchJSON(url){
return fetch(url)
.then(function(response){
return response.json();
});
}
var data=fetchJSON ('cadastre/constru.geojson').then(function(data){
return data;
});
L.geoJSON(data).addTo(myMap);
</script>
</html>

49
client/index.js

@ -0,0 +1,49 @@
const path = require ('path');
const express = require("express"); //carreguem el framework express
const app = express (); //inicialitzem express
var sqlite = require ('spatialite');
var db = new sqlite.Database('parceles.db');
//settings
app.set('port', process.env.PORT || 3000); //etablim quin ha de ser el port. El comando process.env.PORT indica que si hi ha un port preconfigurat a la màquina, agafi aquest iq ue si no sigui el 3000
//static files
app.use(express.static(path.join(__dirname,'public'))) //en comptes de posar el path a mà, utilitzem la funció path per evitar errors entre windows i linux del tipus /public o \public.
app.get('/parceles', function(req, res){
//ens hem quedat aquí! 28/05
var query = "SELECT geom FROM parcela WHERE Intersects(geom, GeomFromText('POLYGON((2.1464967727661137 41.42099183521083, 2.1464967727661137 41.40489940456091,2.1193313598632817 41.40489940456091, 2.1193313598632817 41.42099183521083, 2.1464967727661137 41.42099183521083))')) AS geojson;";
db.spatialite(function(err){
var rows = [];
db.each(query, function (err, row) {
rows.push(row.geojson);
}, function (err, count) {
res.send(`{
"type": "FeatureCollection",
"features": [
${rows.join(',')}
]
}`);
});
console.log("On ends query");
// .complete(function (data) {
// res.send(JSON.stringify(data));
// });
});
});
//start the server
const server = app.listen(app.get('port'), () => { //amb aquest comando començem a utilitzar el port
console.log('server on port', app.get('port'))
})
var testdata={
"type": "FeatureCollection",
"name": "test",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 2.131918098875751, 41.412998903027052 ], [ 2.131866898692675, 41.413043013550201 ], [ 2.131919107080173, 41.413060228915818 ], [ 2.131935458574848, 41.413009824945057 ], [ 2.132160039536676, 41.413151423066047 ], [ 2.132214160223189, 41.413148584102565 ], [ 2.13221512430667, 41.413157058386275 ], [ 2.132885535136759, 41.413112211768791 ], [ 2.132884563779806, 41.413104277883207 ], [ 2.132916422850901, 41.413101905831269 ], [ 2.132937144647257, 41.413100256004263 ], [ 2.133139598576212, 41.412920101121394 ], [ 2.133428494133724, 41.412662943673269 ], [ 2.133468524568111, 41.412627305410055 ], [ 2.133444022443288, 41.412602809727709 ], [ 2.133400680974415, 41.412559877984918 ], [ 2.133359579189742, 41.412519485185506 ], [ 2.133315297482119, 41.4124748349101 ], [ 2.133281676800167, 41.412438731944391 ], [ 2.133250087625188, 41.412402824422536 ], [ 2.133226690120387, 41.41237175256105 ], [ 2.133202091458698, 41.412341031943576 ], [ 2.133183789380371, 41.412313691521177 ], [ 2.133164822168687, 41.412282382801507 ], [ 2.133139247402766, 41.412244088548519 ], [ 2.133115664614324, 41.412208961910231 ], [ 2.133087296304647, 41.41217379920807 ], [ 2.133030149365936, 41.412107343898754 ], [ 2.132989819694177, 41.412071910887278 ], [ 2.132788630302131, 41.412247120965411 ], [ 2.132726528370582, 41.412301332640368 ], [ 2.132697716473734, 41.412326516488079 ], [ 2.132524732174752, 41.412477078120432 ], [ 2.132051240077475, 41.412884431893296 ], [ 2.131980796689533, 41.412944971021155 ], [ 2.131918098875751, 41.412998903027052 ] ] ] } },
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 2.131701239621936, 41.411908273609015 ], [ 2.131419749409599, 41.412090702711311 ], [ 2.131399471377777, 41.412103970737043 ], [ 2.131379797529412, 41.412116792947614 ], [ 2.131339003347898, 41.412143237108744 ], [ 2.131306173677312, 41.412164607138877 ], [ 2.131246683026703, 41.412202799945803 ], [ 2.131151828539192, 41.412263514540072 ], [ 2.131140844954818, 41.412252712715045 ], [ 2.130658344134337, 41.412518125226441 ], [ 2.13059882518509, 41.41255793882344 ], [ 2.130269438583491, 41.412736323583225 ], [ 2.130145623079942, 41.412806276235514 ], [ 2.130247390103653, 41.412909190201383 ], [ 2.130300231696364, 41.412948862180187 ], [ 2.130368832458563, 41.413008649813634 ], [ 2.130376875488746, 41.413015646351646 ], [ 2.130389048265573, 41.41302699768427 ], [ 2.130454045569683, 41.413087838924774 ], [ 2.130545879481549, 41.413173022929669 ], [ 2.130618428448181, 41.41324184320532 ], [ 2.130667301556527, 41.413291573380285 ], [ 2.130713187763582, 41.413332003283536 ], [ 2.13078724355454, 41.413395524939801 ], [ 2.131010330486906, 41.413562497024429 ], [ 2.131095441265656, 41.41349684494925 ], [ 2.131120795129148, 41.413479832182261 ], [ 2.131142584573999, 41.413469908383725 ], [ 2.131150278803043, 41.413467174177811 ], [ 2.131158087871615, 41.413464801136989 ], [ 2.131166131420798, 41.413462790164743 ], [ 2.131182566639081, 41.413459581518673 ], [ 2.131233197566957, 41.413458252435873 ], [ 2.131268940212464, 41.413460774194149 ], [ 2.131344026387681, 41.413473951577849 ], [ 2.1313811279455, 41.413482248334986 ], [ 2.131398425497036, 41.413486162061076 ], [ 2.13150846943713, 41.413506894792278 ], [ 2.131758035612068, 41.413554085961685 ], [ 2.131773128659075, 41.413507901523701 ], [ 2.131785968601889, 41.413469176271505 ], [ 2.13180093237309, 41.413423711450278 ], [ 2.1318105320962, 41.413394689798984 ], [ 2.131888758347303, 41.413153609947656 ], [ 2.131919107080173, 41.413060228915818 ], [ 2.131866898692675, 41.413043013550201 ], [ 2.131918098875751, 41.412998903027052 ], [ 2.131980796689533, 41.412944971021155 ], [ 2.132051240077475, 41.412884431893296 ], [ 2.132524732174752, 41.412477078120432 ], [ 2.132697716473734, 41.412326516488079 ], [ 2.132726528370582, 41.412301332640368 ], [ 2.132788630302131, 41.412247120965411 ], [ 2.132989819694177, 41.412071910887278 ], [ 2.133002048088574, 41.412061104009766 ], [ 2.13297237213985, 41.412034308363808 ], [ 2.132933597842677, 41.411998887053656 ], [ 2.132872554385094, 41.411946093640836 ], [ 2.132812677454009, 41.411896011226418 ], [ 2.132756746120195, 41.411855146133099 ], [ 2.132696801075153, 41.411810197397763 ], [ 2.132632429510611, 41.411765215259742 ], [ 2.132579296621746, 41.41172986572878 ], [ 2.132521737133453, 41.411694487300814 ], [ 2.132476630680257, 41.411667395031017 ], [ 2.13242782748088, 41.411639374121187 ], [ 2.132371878425293, 41.411608867287612 ], [ 2.132332572170567, 41.411587389816887 ], [ 2.131869915254524, 41.411822538916844 ], [ 2.131701239621936, 41.411908273609015 ] ] ] } }
]
}

1
client/node_modules/.bin/detect-libc

@ -0,0 +1 @@
../detect-libc/bin/detect-libc.js

1
client/node_modules/.bin/is-ci

@ -0,0 +1 @@
../is-ci/bin.js

1
client/node_modules/.bin/mime

@ -0,0 +1 @@
../mime/cli.js

1
client/node_modules/.bin/mkdirp

@ -0,0 +1 @@
../mkdirp/bin/cmd.js

1
client/node_modules/.bin/needle

@ -0,0 +1 @@
../needle/bin/needle

1
client/node_modules/.bin/node-gyp

@ -0,0 +1 @@
../node-gyp/bin/node-gyp.js

1
client/node_modules/.bin/node-pre-gyp

@ -0,0 +1 @@
../node-pre-gyp/bin/node-pre-gyp

1
client/node_modules/.bin/nodemon

@ -0,0 +1 @@
../nodemon/bin/nodemon.js

1
client/node_modules/.bin/nodetouch

@ -0,0 +1 @@
../touch/bin/nodetouch.js

1
client/node_modules/.bin/nopt

@ -0,0 +1 @@
../nopt/bin/nopt.js

1
client/node_modules/.bin/rc

@ -0,0 +1 @@
../rc/cli.js

1
client/node_modules/.bin/rimraf

@ -0,0 +1 @@
../rimraf/bin.js

1
client/node_modules/.bin/semver

@ -0,0 +1 @@
../semver/bin/semver

1
client/node_modules/.bin/sshpk-conv

@ -0,0 +1 @@
../sshpk/bin/sshpk-conv

1
client/node_modules/.bin/sshpk-sign

@ -0,0 +1 @@
../sshpk/bin/sshpk-sign

1
client/node_modules/.bin/sshpk-verify

@ -0,0 +1 @@
../sshpk/bin/sshpk-verify

1
client/node_modules/.bin/uuid

@ -0,0 +1 @@
../uuid/bin/uuid

1
client/node_modules/.bin/which

@ -0,0 +1 @@
../which/bin/which

132
client/node_modules/@sindresorhus/is/dist/index.d.ts

@ -0,0 +1,132 @@
/// <reference types="node" />
/// <reference lib="es2016" />
/// <reference lib="es2017.sharedmemory" />
/// <reference lib="esnext.asynciterable" />
/// <reference lib="dom" />
declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
declare type Primitive = null | undefined | string | number | boolean | Symbol;
export interface ArrayLike {
length: number;
}
export interface Class<T = unknown> {
new (...args: any[]): T;
}
declare type DomElement = object & {
nodeType: 1;
nodeName: string;
};
declare type NodeStream = object & {
pipe: Function;
};
export declare const enum TypeName {
null = "null",
boolean = "boolean",
undefined = "undefined",
string = "string",
number = "number",
symbol = "symbol",
Function = "Function",
GeneratorFunction = "GeneratorFunction",
AsyncFunction = "AsyncFunction",
Observable = "Observable",
Array = "Array",
Buffer = "Buffer",
Object = "Object",
RegExp = "RegExp",
Date = "Date",
Error = "Error",
Map = "Map",
Set = "Set",
WeakMap = "WeakMap",
WeakSet = "WeakSet",
Int8Array = "Int8Array",
Uint8Array = "Uint8Array",
Uint8ClampedArray = "Uint8ClampedArray",
Int16Array = "Int16Array",
Uint16Array = "Uint16Array",
Int32Array = "Int32Array",
Uint32Array = "Uint32Array",
Float32Array = "Float32Array",
Float64Array = "Float64Array",
ArrayBuffer = "ArrayBuffer",
SharedArrayBuffer = "SharedArrayBuffer",
DataView = "DataView",
Promise = "Promise",
URL = "URL"
}
declare function is(value: unknown): TypeName;
declare namespace is {
const undefined: (value: unknown) => value is undefined;
const string: (value: unknown) => value is string;
const number: (value: unknown) => value is number;
const function_: (value: unknown) => value is Function;
const null_: (value: unknown) => value is null;
const class_: (value: unknown) => value is Class<unknown>;
const boolean: (value: unknown) => value is boolean;
const symbol: (value: unknown) => value is Symbol;
const numericString: (value: unknown) => boolean;
const array: (arg: any) => arg is any[];
const buffer: (input: unknown) => input is Buffer;
const nullOrUndefined: (value: unknown) => value is null | undefined;
const object: (value: unknown) => value is object;
const iterable: (value: unknown) => value is IterableIterator<unknown>;
const asyncIterable: (value: unknown) => value is AsyncIterableIterator<unknown>;
const generator: (value: unknown) => value is Generator;
const nativePromise: (value: unknown) => value is Promise<unknown>;
const promise: (value: unknown) => value is Promise<unknown>;
const generatorFunction: (value: unknown) => value is GeneratorFunction;
const asyncFunction: (value: unknown) => value is Function;
const boundFunction: (value: unknown) => value is Function;
const regExp: (value: unknown) => value is RegExp;
const date: (value: unknown) => value is Date;
const error: (value: unknown) => value is Error;
const map: (value: unknown) => value is Map<unknown, unknown>;
const set: (value: unknown) => value is Set<unknown>;
const weakMap: (value: unknown) => value is WeakMap<object, unknown>;
const weakSet: (value: unknown) => value is WeakSet<object>;
const int8Array: (value: unknown) => value is Int8Array;
const uint8Array: (value: unknown) => value is Uint8Array;
const uint8ClampedArray: (value: unknown) => value is Uint8ClampedArray;
const int16Array: (value: unknown) => value is Int16Array;
const uint16Array: (value: unknown) => value is Uint16Array;
const int32Array: (value: unknown) => value is Int32Array;
const uint32Array: (value: unknown) => value is Uint32Array;
const float32Array: (value: unknown) => value is Float32Array;
const float64Array: (value: unknown) => value is Float64Array;
const arrayBuffer: (value: unknown) => value is ArrayBuffer;
const sharedArrayBuffer: (value: unknown) => value is SharedArrayBuffer;
const dataView: (value: unknown) => value is DataView;
const directInstanceOf: <T>(instance: unknown, klass: Class<T>) => instance is T;
const urlInstance: (value: unknown) => value is URL;
const urlString: (value: unknown) => boolean;
const truthy: (value: unknown) => boolean;
const falsy: (value: unknown) => boolean;
const nan: (value: unknown) => boolean;
const primitive: (value: unknown) => value is Primitive;
const integer: (value: unknown) => value is number;
const safeInteger: (value: unknown) => value is number;
const plainObject: (value: unknown) => boolean;
const typedArray: (value: unknown) => value is TypedArray;
const arrayLike: (value: unknown) => value is ArrayLike;
const inRange: (value: number, range: number | number[]) => boolean;
const domElement: (value: unknown) => value is DomElement;
const observable: (value: unknown) => boolean;
const nodeStream: (value: unknown) => value is NodeStream;
const infinite: (value: unknown) => boolean;
const even: (value: number) => boolean;
const odd: (value: number) => boolean;
const emptyArray: (value: unknown) => boolean;
const nonEmptyArray: (value: unknown) => boolean;
const emptyString: (value: unknown) => boolean;
const nonEmptyString: (value: unknown) => boolean;
const emptyStringOrWhitespace: (value: unknown) => boolean;
const emptyObject: (value: unknown) => boolean;
const nonEmptyObject: (value: unknown) => boolean;
const emptySet: (value: unknown) => boolean;
const nonEmptySet: (value: unknown) => boolean;
const emptyMap: (value: unknown) => boolean;
const nonEmptyMap: (value: unknown) => boolean;
const any: (predicate: unknown, ...values: unknown[]) => boolean;
const all: (predicate: unknown, ...values: unknown[]) => boolean;
}
export default is;

245
client/node_modules/@sindresorhus/is/dist/index.js

@ -0,0 +1,245 @@
"use strict";
/// <reference lib="es2016"/>
/// <reference lib="es2017.sharedmemory"/>
/// <reference lib="esnext.asynciterable"/>
/// <reference lib="dom"/>
Object.defineProperty(exports, "__esModule", { value: true });
// TODO: Use the `URL` global when targeting Node.js 10
// tslint:disable-next-line
const URLGlobal = typeof URL === 'undefined' ? require('url').URL : URL;
const toString = Object.prototype.toString;
const isOfType = (type) => (value) => typeof value === type;
const isBuffer = (input) => !is.nullOrUndefined(input) && !is.nullOrUndefined(input.constructor) && is.function_(input.constructor.isBuffer) && input.constructor.isBuffer(input);
const getObjectType = (value) => {
const objectName = toString.call(value).slice(8, -1);
if (objectName) {
return objectName;
}
return null;
};
const isObjectOfType = (type) => (value) => getObjectType(value) === type;
function is(value) {
switch (value) {
case null:
return "null" /* null */;
case true:
case false:
return "boolean" /* boolean */;
default:
}
switch (typeof value) {
case 'undefined':
return "undefined" /* undefined */;
case 'string':
return "string" /* string */;
case 'number':
return "number" /* number */;
case 'symbol':
return "symbol" /* symbol */;
default:
}
if (is.function_(value)) {
return "Function" /* Function */;
}
if (is.observable(value)) {
return "Observable" /* Observable */;
}
if (Array.isArray(value)) {
return "Array" /* Array */;
}
if (isBuffer(value)) {
return "Buffer" /* Buffer */;
}
const tagType = getObjectType(value);
if (tagType) {
return tagType;
}
if (value instanceof String || value instanceof Boolean || value instanceof Number) {
throw new TypeError('Please don\'t use object wrappers for primitive types');
}
return "Object" /* Object */;
}
(function (is) {
// tslint:disable-next-line:strict-type-predicates
const isObject = (value) => typeof value === 'object';
// tslint:disable:variable-name
is.undefined = isOfType('undefined');
is.string = isOfType('string');
is.number = isOfType('number');
is.function_ = isOfType('function');
// tslint:disable-next-line:strict-type-predicates
is.null_ = (value) => value === null;
is.class_ = (value) => is.function_(value) && value.toString().startsWith('class ');
is.boolean = (value) => value === true || value === false;
is.symbol = isOfType('symbol');
// tslint:enable:variable-name
is.numericString = (value) => is.string(value) && value.length > 0 && !Number.isNaN(Number(value));
is.array = Array.isArray;
is.buffer = isBuffer;
is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value);
is.object = (value) => !is.nullOrUndefined(value) && (is.function_(value) || isObject(value));
is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]);
is.asyncIterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.asyncIterator]);
is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw);
is.nativePromise = (value) => isObjectOfType("Promise" /* Promise */)(value);
const hasPromiseAPI = (value) => !is.null_(value) &&
isObject(value) &&
is.function_(value.then) &&
is.function_(value.catch);
is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value);
is.generatorFunction = isObjectOfType("GeneratorFunction" /* GeneratorFunction */);
is.asyncFunction = isObjectOfType("AsyncFunction" /* AsyncFunction */);
is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype');
is.regExp = isObjectOfType("RegExp" /* RegExp */);
is.date = isObjectOfType("Date" /* Date */);
is.error = isObjectOfType("Error" /* Error */);
is.map = (value) => isObjectOfType("Map" /* Map */)(value);
is.set = (value) => isObjectOfType("Set" /* Set */)(value);
is.weakMap = (value) => isObjectOfType("WeakMap" /* WeakMap */)(value);
is.weakSet = (value) => isObjectOfType("WeakSet" /* WeakSet */)(value);
is.int8Array = isObjectOfType("Int8Array" /* Int8Array */);
is.uint8Array = isObjectOfType("Uint8Array" /* Uint8Array */);
is.uint8ClampedArray = isObjectOfType("Uint8ClampedArray" /* Uint8ClampedArray */);
is.int16Array = isObjectOfType("Int16Array" /* Int16Array */);
is.uint16Array = isObjectOfType("Uint16Array" /* Uint16Array */);
is.int32Array = isObjectOfType("Int32Array" /* Int32Array */);
is.uint32Array = isObjectOfType("Uint32Array" /* Uint32Array */);
is.float32Array = isObjectOfType("Float32Array" /* Float32Array */);
is.float64Array = isObjectOfType("Float64Array" /* Float64Array */);
is.arrayBuffer = isObjectOfType("ArrayBuffer" /* ArrayBuffer */);
is.sharedArrayBuffer = isObjectOfType("SharedArrayBuffer" /* SharedArrayBuffer */);
is.dataView = isObjectOfType("DataView" /* DataView */);
is.directInstanceOf = (instance, klass) => Object.getPrototypeOf(instance) === klass.prototype;
is.urlInstance = (value) => isObjectOfType("URL" /* URL */)(value);
is.urlString = (value) => {
if (!is.string(value)) {
return false;
}
try {
new URLGlobal(value); // tslint:disable-line no-unused-expression
return true;
}
catch (_a) {
return false;
}
};
is.truthy = (value) => Boolean(value);
is.falsy = (value) => !value;
is.nan = (value) => Number.isNaN(value);
const primitiveTypes = new Set([
'undefined',
'string',
'number',
'boolean',
'symbol'
]);
is.primitive = (value) => is.null_(value) || primitiveTypes.has(typeof value);
is.integer = (value) => Number.isInteger(value);
is.safeInteger = (value) => Number.isSafeInteger(value);
is.plainObject = (value) => {
// From: https://github.com/sindresorhus/is-plain-obj/blob/master/index.js
let prototype;
return getObjectType(value) === "Object" /* Object */ &&
(prototype = Object.getPrototypeOf(value), prototype === null || // tslint:disable-line:ban-comma-operator
prototype === Object.getPrototypeOf({}));
};
const typedArrayTypes = new Set([
"Int8Array" /* Int8Array */,
"Uint8Array" /* Uint8Array */,
"Uint8ClampedArray" /* Uint8ClampedArray */,
"Int16Array" /* Int16Array */,
"Uint16Array" /* Uint16Array */,
"Int32Array" /* Int32Array */,
"Uint32Array" /* Uint32Array */,
"Float32Array" /* Float32Array */,
"Float64Array" /* Float64Array */
]);
is.typedArray = (value) => {
const objectType = getObjectType(value);
if (objectType === null) {
return false;
}
return typedArrayTypes.has(objectType);
};
const isValidLength = (value) => is.safeInteger(value) && value > -1;
is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length);
is.inRange = (value, range) => {
if (is.number(range)) {
return value >= Math.min(0, range) && value <= Math.max(range, 0);
}
if (is.array(range) && range.length === 2) {
return value >= Math.min(...range) && value <= Math.max(...range);
}
throw new TypeError(`Invalid range: ${JSON.stringify(range)}`);
};
const NODE_TYPE_ELEMENT = 1;
const DOM_PROPERTIES_TO_CHECK = [
'innerHTML',
'ownerDocument',
'style',
'attributes',
'nodeValue'
];
is.domElement = (value) => is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) &&
!is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value);
is.observable = (value) => {
if (!value) {
return false;
}
if (value[Symbol.observable] && value === value[Symbol.observable]()) {
return true;
}
if (value['@@observable'] && value === value['@@observable']()) {
return true;
}
return false;
};
is.nodeStream = (value) => !is.nullOrUndefined(value) && isObject(value) && is.function_(value.pipe) && !is.observable(value);
is.infinite = (value) => value === Infinity || value === -Infinity;
const isAbsoluteMod2 = (rem) => (value) => is.integer(value) && Math.abs(value % 2) === rem;
is.even = isAbsoluteMod2(0);
is.odd = isAbsoluteMod2(1);
const isWhiteSpaceString = (value) => is.string(value) && /\S/.test(value) === false;
is.emptyArray = (value) => is.array(value) && value.length === 0;
is.nonEmptyArray = (value) => is.array(value) && value.length > 0;
is.emptyString = (value) => is.string(value) && value.length === 0;
is.nonEmptyString = (value) => is.string(value) && value.length > 0;
is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value);
is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0;
is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0;
is.emptySet = (value) => is.set(value) && value.size === 0;
is.nonEmptySet = (value) => is.set(value) && value.size > 0;
is.emptyMap = (value) => is.map(value) && value.size === 0;
is.nonEmptyMap = (value) => is.map(value) && value.size > 0;
const predicateOnArray = (method, predicate, values) => {
if (is.function_(predicate) === false) {
throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`);
}
if (values.length === 0) {
throw new TypeError('Invalid number of values');
}
return method.call(values, predicate);
};
// tslint:disable variable-name
is.any = (predicate, ...values) => predicateOnArray(Array.prototype.some, predicate, values);
is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values);
// tslint:enable variable-name
})(is || (is = {}));
// Some few keywords are reserved, but we'll populate them for Node.js users
// See https://github.com/Microsoft/TypeScript/issues/2536
Object.defineProperties(is, {
class: {
value: is.class_
},
function: {
value: is.function_
},
null: {
value: is.null_
}
});
exports.default = is;
// For CommonJS default export support
module.exports = is;
module.exports.default = is;
//# sourceMappingURL=index.js.map

1
client/node_modules/@sindresorhus/is/dist/index.js.map

File diff suppressed because one or more lines are too long

9
client/node_modules/@sindresorhus/is/license

@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

96
client/node_modules/@sindresorhus/is/package.json

@ -0,0 +1,96 @@
{
"_from": "@sindresorhus/is@^0.14.0",
"_id": "@sindresorhus/is@0.14.0",
"_inBundle": false,
"_integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==",
"_location": "/@sindresorhus/is",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@sindresorhus/is@^0.14.0",
"name": "@sindresorhus/is",
"escapedName": "@sindresorhus%2fis",
"scope": "@sindresorhus",
"rawSpec": "^0.14.0",
"saveSpec": null,
"fetchSpec": "^0.14.0"
},
"_requiredBy": [
"/got"
],
"_resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz",
"_shasum": "9fb3a3cf3132328151f353de4632e01e52102bea",
"_spec": "@sindresorhus/is@^0.14.0",
"_where": "/home/pau/leaflet/cadastre/node_modules/got",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/is/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Type check values: `is.string('🦄') //=> true`",
"devDependencies": {
"@sindresorhus/tsconfig": "^0.1.0",
"@types/jsdom": "^11.12.0",
"@types/node": "^10.12.10",
"@types/tempy": "^0.2.0",
"@types/zen-observable": "^0.8.0",
"ava": "^0.25.0",
"del-cli": "^1.1.0",
"jsdom": "^11.6.2",
"rxjs": "^6.3.3",
"tempy": "^0.2.1",
"tslint": "^5.9.1",
"tslint-xo": "^0.10.0",
"typescript": "^3.2.1",
"zen-observable": "^0.8.8"
},
"engines": {
"node": ">=6"
},
"files": [
"dist"
],
"homepage": "https://github.com/sindresorhus/is#readme",
"keywords": [
"type",
"types",
"is",
"check",
"checking",
"validate",
"validation",
"utility",
"util",
"typeof",
"instanceof",
"object",
"assert",
"assertion",
"test",
"kind",
"primitive",
"verify",
"compare"
],
"license": "MIT",
"main": "dist/index.js",
"name": "@sindresorhus/is",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/is.git"
},
"scripts": {
"build": "del dist && tsc",
"lint": "tslint --format stylish --project .",
"prepublish": "npm run build && del dist/tests",
"test": "npm run lint && npm run build && ava dist/tests"
},
"types": "dist/index.d.ts",
"version": "0.14.0"
}

451
client/node_modules/@sindresorhus/is/readme.md

@ -0,0 +1,451 @@
# is [![Build Status](https://travis-ci.org/sindresorhus/is.svg?branch=master)](https://travis-ci.org/sindresorhus/is)
> Type check values: `is.string('🦄') //=> true`
<img src="header.gif" width="182" align="right">
## Install
```
$ npm install @sindresorhus/is
```
## Usage
```js
const is = require('@sindresorhus/is');
is('🦄');
//=> 'string'
is(new Map());
//=> 'Map'
is.number(6);
//=> true
```
When using `is` together with TypeScript, [type guards](http://www.typescriptlang.org/docs/handbook/advanced-types.html#type-guards-and-differentiating-types) are being used to infer the correct type inside if-else statements.
```ts
import is from '@sindresorhus/is';
const padLeft = (value: string, padding: string | number) => {
if (is.number(padding)) {
// `padding` is typed as `number`
return Array(padding + 1).join(' ') + value;
}
if (is.string(padding)) {
// `padding` is typed as `string`
return padding + value;
}
throw new TypeError(`Expected 'padding' to be of type 'string' or 'number', got '${is(padding)}'.`);
}
padLeft('🦄', 3);
//=> ' 🦄'
padLeft('🦄', '🌈');
//=> '🌈🦄'
```
## API
### is(value)
Returns the type of `value`.
Primitives are lowercase and object types are camelcase.
Example:
- `'undefined'`
- `'null'`
- `'string'`
- `'symbol'`
- `'Array'`
- `'Function'`
- `'Object'`
Note: It will throw an error if you try to feed it object-wrapped primitives, as that's a bad practice. For example `new String('foo')`.
### is.{method}
All the below methods accept a value and returns a boolean for whether the value is of the desired type.
#### Primitives
##### .undefined(value)
##### .null(value)
##### .string(value)
##### .number(value)
##### .boolean(value)
##### .symbol(value)
#### Built-in types
##### .array(value)
##### .function(value)
##### .buffer(value)
##### .object(value)
Keep in mind that [functions are objects too](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions).
##### .numericString(value)
Returns `true` for a string that represents a number. For example, `'42'` and `'-8'`.
Note: `'NaN'` returns `false`, but `'Infinity'` and `'-Infinity'` return `true`.
##### .regExp(value)
##### .date(value)
##### .error(value)
##### .nativePromise(value)
##### .promise(value)
Returns `true` for any object with a `.then()` and `.catch()` method. Prefer this one over `.nativePromise()` as you usually want to allow userland promise implementations too.
##### .generator(value)
Returns `true` for any object that implements its own `.next()` and `.throw()` methods and has a function definition for `Symbol.iterator`.
##### .generatorFunction(value)
##### .asyncFunction(value)
Returns `true` for any `async` function that can be called with the `await` operator.
```js
is.asyncFunction(async () => {});
// => true
is.asyncFunction(() => {});
// => false
```
##### .boundFunction(value)
Returns `true` for any `bound` function.
```js
is.boundFunction(() => {});
// => true
is.boundFunction(function () {}.bind(null));
// => true
is.boundFunction(function () {});
// => false
```
##### .map(value)
##### .set(value)
##### .weakMap(value)
##### .weakSet(value)
#### Typed arrays
##### .int8Array(value)
##### .uint8Array(value)
##### .uint8ClampedArray(value)
##### .int16Array(value)
##### .uint16Array(value)
##### .int32Array(value)
##### .uint32Array(value)
##### .float32Array(value)
##### .float64Array(value)
#### Structured data
##### .arrayBuffer(value)
##### .sharedArrayBuffer(value)
##### .dataView(value)
#### Emptiness
##### .emptyString(value)
Returns `true` if the value is a `string` and the `.length` is 0.
##### .nonEmptyString(value)
Returns `true` if the value is a `string` and the `.length` is more than 0.
##### .emptyStringOrWhitespace(value)
Returns `true` if `is.emptyString(value)` or if it's a `string` that is all whitespace.
##### .emptyArray(value)
Returns `true` if the value is an `Array` and the `.length` is 0.
##### .nonEmptyArray(value)
Returns `true` if the value is an `Array` and the `.length` is more than 0.
##### .emptyObject(value)
Returns `true` if the value is an `Object` and `Object.keys(value).length` is 0.
Please note that `Object.keys` returns only own enumerable properties. Hence something like this can happen:
```js
const object1 = {};
Object.defineProperty(object1, 'property1', {
value: 42,
writable: true,
enumerable: false,
configurable: true
});
is.emptyObject(object1);
// => true
```
##### .nonEmptyObject(value)
Returns `true` if the value is an `Object` and `Object.keys(value).length` is more than 0.
##### .emptySet(value)
Returns `true` if the value is a `Set` and the `.size` is 0.
##### .nonEmptySet(Value)
Returns `true` if the value is a `Set` and the `.size` is more than 0.
##### .emptyMap(value)
Returns `true` if the value is a `Map` and the `.size` is 0.
##### .nonEmptyMap(value)
Returns `true` if the value is a `Map` and the `.size` is more than 0.
#### Miscellaneous
##### .directInstanceOf(value, class)
Returns `true` if `value` is a direct instance of `class`.
```js
is.directInstanceOf(new Error(), Error);
//=> true
class UnicornError extends Error {}
is.directInstanceOf(new UnicornError(), Error);
//=> false
```
##### .urlInstance(value)
Returns `true` if `value` is an instance of the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL).
```js
const url = new URL('https://example.com');
is.urlInstance(url);
//=> true
```
### .url(value)
Returns `true` if `value` is a URL string.
Note: this only does basic checking using the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL) constructor.
```js
const url = 'https://example.com';
is.url(url);
//=> true
is.url(new URL(url));
//=> false
```
##### .truthy(value)
Returns `true` for all values that evaluate to true in a boolean context:
```js
is.truthy('🦄');
//=> true
is.truthy(undefined);
//=> false
```
##### .falsy(value)
Returns `true` if `value` is one of: `false`, `0`, `''`, `null`, `undefined`, `NaN`.
##### .nan(value)
##### .nullOrUndefined(value)
##### .primitive(value)
JavaScript primitives are as follows: `null`, `undefined`, `string`, `number`, `boolean`, `symbol`.
##### .integer(value)
##### .safeInteger(value)
Returns `true` if `value` is a [safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger).
##### .plainObject(value)
An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`.
##### .iterable(value)
##### .asyncIterable(value)
##### .class(value)
Returns `true` for instances created by a class.
##### .typedArray(value)
##### .arrayLike(value)
A `value` is array-like if it is not a function and has a `value.length` that is a safe integer greater than or equal to 0.
```js
is.arrayLike(document.forms);
//=> true
function foo() {
is.arrayLike(arguments);
//=> true
}
foo();
```
##### .inRange(value, range)
Check if `value` (number) is in the given `range`. The range is an array of two values, lower bound and upper bound, in no specific order.
```js
is.inRange(3, [0, 5]);
is.inRange(3, [5, 0]);
is.inRange(0, [-2, 2]);
```
##### .inRange(value, upperBound)
Check if `value` (number) is in the range of `0` to `upperBound`.
```js
is.inRange(3, 10);
```
##### .domElement(value)
Returns `true` if `value` is a DOM Element.
##### .nodeStream(value)
Returns `true` if `value` is a Node.js [stream](https://nodejs.org/api/stream.html).
```js
const fs = require('fs');
is.nodeStream(fs.createReadStream('unicorn.png'));
//=> true
```
##### .observable(value)
Returns `true` if `value` is an `Observable`.
```js
const {Observable} = require('rxjs');
is.observable(new Observable());
//=> true
```
##### .infinite(value)
Check if `value` is `Infinity` or `-Infinity`.
##### .even(value)
Returns `true` if `value` is an even integer.
##### .odd(value)
Returns `true` if `value` is an odd integer.
##### .any(predicate, ...values)
Returns `true` if **any** of the input `values` returns true in the `predicate`:
```js
is.any(is.string, {}, true, '🦄');
//=> true
is.any(is.boolean, 'unicorns', [], new Map());
//=> false
```
##### .all(predicate, ...values)
Returns `true` if **all** of the input `values` returns true in the `predicate`:
```js
is.all(is.object, {}, new Map(), new Set());
//=> true
is.all(is.string, '🦄', [], 'unicorns');
//=> false
```
## FAQ
### Why yet another type checking module?
There are hundreds of type checking modules on npm, unfortunately, I couldn't find any that fit my needs:
- Includes both type methods and ability to get the type
- Types of primitives returned as lowercase and object types as camelcase
- Covers all built-ins
- Unsurprising behavior
- Well-maintained
- Comprehensive test suite
For the ones I found, pick 3 of these.
The most common mistakes I noticed in these modules was using `instanceof` for type checking, forgetting that functions are objects, and omitting `symbol` as a primitive.
## Related
- [ow](https://github.com/sindresorhus/ow) - Function argument validation for humans
- [is-stream](https://github.com/sindresorhus/is-stream) - Check if something is a Node.js stream
- [is-observable](https://github.com/sindresorhus/is-observable) - Check if a value is an Observable
- [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array
- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address
- [is-array-sorted](https://github.com/sindresorhus/is-array-sorted) - Check if an Array is sorted
- [is-error-constructor](https://github.com/sindresorhus/is-error-constructor) - Check if a value is an error constructor
- [is-empty-iterable](https://github.com/sindresorhus/is-empty-iterable) - Check if an Iterable is empty
- [is-blob](https://github.com/sindresorhus/is-blob) - Check if a value is a Blob - File-like object of immutable, raw data
- [has-emoji](https://github.com/sindresorhus/has-emoji) - Check whether a string has any emoji
## Created by
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Giora Guttsait](https://github.com/gioragutt)
- [Brandon Smith](https://github.com/brandon93s)
## License
MIT

21
client/node_modules/@szmarczak/http-timer/LICENSE

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 Szymon Marczak
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

70
client/node_modules/@szmarczak/http-timer/README.md

@ -0,0 +1,70 @@
# http-timer
> Timings for HTTP requests
[![Build Status](https://travis-ci.org/szmarczak/http-timer.svg?branch=master)](https://travis-ci.org/szmarczak/http-timer)
[![Coverage Status](https://coveralls.io/repos/github/szmarczak/http-timer/badge.svg?branch=master)](https://coveralls.io/github/szmarczak/http-timer?branch=master)
[![install size](https://packagephobia.now.sh/badge?p=@szmarczak/http-timer)](https://packagephobia.now.sh/result?p=@szmarczak/http-timer)
Inspired by the [`request` package](https://github.com/request/request).
## Usage
```js
'use strict';
const https = require('https');
const timer = require('@szmarczak/http-timer');
const request = https.get('https://httpbin.org/anything');
const timings = timer(request);
request.on('response', response => {
response.on('data', () => {}); // Consume the data somehow
response.on('end', () => {
console.log(timings);
});
});
// { start: 1535708511443,
// socket: 1535708511444,
// lookup: 1535708511444,
// connect: 1535708511582,
// upload: 1535708511887,
// response: 1535708512037,
// end: 1535708512040,
// phases:
// { wait: 1,
// dns: 0,
// tcp: 138,
// request: 305,
// firstByte: 150,
// download: 3,
// total: 597 } }
```
## API
### timer(request)
Returns: `Object`
- `start` - Time when the request started.
- `socket` - Time when a socket was assigned to the request.
- `lookup` - Time when the DNS lookup finished.
- `connect` - Time when the socket successfully connected.
- `upload` - Time when the request finished uploading.
- `response` - Time when the request fired the `response` event.
- `end` - Time when the response fired the `end` event.
- `error` - Time when the request fired the `error` event.
- `phases`
- `wait` - `timings.socket - timings.start`
- `dns` - `timings.lookup - timings.socket`
- `tcp` - `timings.connect - timings.lookup`
- `request` - `timings.upload - timings.connect`
- `firstByte` - `timings.response - timings.upload`
- `download` - `timings.end - timings.response`
- `total` - `timings.end - timings.start` or `timings.error - timings.start`
**Note**: The time is a `number` representing the milliseconds elapsed since the UNIX epoch.
## License
MIT

75
client/node_modules/@szmarczak/http-timer/package.json

@ -0,0 +1,75 @@
{
"_from": "@szmarczak/http-timer@^1.1.2",
"_id": "@szmarczak/http-timer@1.1.2",
"_inBundle": false,
"_integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==",
"_location": "/@szmarczak/http-timer",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@szmarczak/http-timer@^1.1.2",
"name": "@szmarczak/http-timer",
"escapedName": "@szmarczak%2fhttp-timer",
"scope": "@szmarczak",
"rawSpec": "^1.1.2",
"saveSpec": null,
"fetchSpec": "^1.1.2"
},
"_requiredBy": [
"/got"
],
"_resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz",
"_shasum": "b1665e2c461a2cd92f4c1bbf50d5454de0d4b421",
"_spec": "@szmarczak/http-timer@^1.1.2",
"_where": "/home/pau/leaflet/cadastre/node_modules/got",
"author": {
"name": "Szymon Marczak"
},
"bugs": {
"url": "https://github.com/szmarczak/http-timer/issues"
},
"bundleDependencies": false,
"dependencies": {
"defer-to-connect": "^1.0.1"
},
"deprecated": false,
"description": "Timings for HTTP requests",
"devDependencies": {
"ava": "^0.25.0",
"coveralls": "^3.0.2",
"nyc": "^12.0.2",
"p-event": "^2.1.0",
"xo": "^0.22.0"
},
"engines": {
"node": ">=6"
},
"files": [
"source"
],
"homepage": "https://github.com/szmarczak/http-timer#readme",
"keywords": [
"http",
"https",
"timer",
"timings"
],
"license": "MIT",
"main": "source",
"name": "@szmarczak/http-timer",
"repository": {
"type": "git",
"url": "git+https://github.com/szmarczak/http-timer.git"
},
"scripts": {
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"test": "xo && nyc ava"
},
"version": "1.1.2",
"xo": {
"rules": {
"unicorn/filename-case": "camelCase"
}
}
}

99
client/node_modules/@szmarczak/http-timer/source/index.js

@ -0,0 +1,99 @@
'use strict';
const deferToConnect = require('defer-to-connect');
module.exports = request => {
const timings = {
start: Date.now(),
socket: null,
lookup: null,
connect: null,
upload: null,
response: null,
end: null,
error: null,
phases: {
wait: null,
dns: null,
tcp: null,
request: null,
firstByte: null,
download: null,
total: null
}
};
const handleError = origin => {
const emit = origin.emit.bind(origin);
origin.emit = (event, ...args) => {
// Catches the `error` event
if (event === 'error') {
timings.error = Date.now();
timings.phases.total = timings.error - timings.start;
origin.emit = emit;
}
// Saves the original behavior
return emit(event, ...args);
};
};
let uploadFinished = false;
const onUpload = () => {
timings.upload = Date.now();
timings.phases.request = timings.upload - timings.connect;
};
handleError(request);
request.once('socket', socket => {
timings.socket = Date.now();
timings.phases.wait = timings.socket - timings.start;
const lookupListener = () => {
timings.lookup = Date.now();
timings.phases.dns = timings.lookup - timings.socket;
};
socket.once('lookup', lookupListener);
deferToConnect(socket, () => {
timings.connect = Date.now();
if (timings.lookup === null) {
socket.removeListener('lookup', lookupListener);
timings.lookup = timings.connect;
timings.phases.dns = timings.lookup - timings.socket;
}
timings.phases.tcp = timings.connect - timings.lookup;
if (uploadFinished && !timings.upload) {
onUpload();
}
});
});
request.once('finish', () => {
uploadFinished = true;
if (timings.connect) {
onUpload();
}
});
request.once('response', response => {
timings.response = Date.now();
timings.phases.firstByte = timings.response - timings.upload;
handleError(response);
response.once('end', () => {
timings.end = Date.now();
timings.phases.download = timings.end - timings.response;
timings.phases.total = timings.end - timings.start;
});
});
return timings;
};

21
client/node_modules/@types/component-emitter/LICENSE

@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

16
client/node_modules/@types/component-emitter/README.md

@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/component-emitter`
# Summary
This package contains type definitions for component-emitter (https://www.npmjs.com/package/component-emitter).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/component-emitter.
### Additional Details
* Last updated: Wed, 09 Sep 2020 21:18:32 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Peter Snider](https://github.com/psnider).

22
client/node_modules/@types/component-emitter/index.d.ts

@ -0,0 +1,22 @@
// Type definitions for component-emitter v1.2.1
// Project: https://www.npmjs.com/package/component-emitter
// Definitions by: Peter Snider <https://github.com/psnider>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
interface Emitter<Event = string> {
on(event: Event, listener: Function): Emitter;
once(event: Event, listener: Function): Emitter;
off(event?: Event, listener?: Function): Emitter;
emit(event: Event, ...args: any[]): Emitter;
listeners(event: Event): Function[];
hasListeners(event: Event): boolean;
}
declare const Emitter: {
(obj?: object): Emitter;
new (obj?: object): Emitter;
};
export = Emitter;

53
client/node_modules/@types/component-emitter/package.json

@ -0,0 +1,53 @@
{
"_from": "@types/component-emitter@^1.2.10",
"_id": "@types/component-emitter@1.2.10",
"_inBundle": false,
"_integrity": "sha512-bsjleuRKWmGqajMerkzox19aGbscQX5rmmvvXl3wlIp5gMG1HgkiwPxsN5p070fBDKTNSPgojVbuY1+HWMbFhg==",
"_location": "/@types/component-emitter",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@types/component-emitter@^1.2.10",
"name": "@types/component-emitter",
"escapedName": "@types%2fcomponent-emitter",
"scope": "@types",
"rawSpec": "^1.2.10",
"saveSpec": null,
"fetchSpec": "^1.2.10"
},
"_requiredBy": [
"/socket.io-parser"
],
"_resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.10.tgz",
"_shasum": "ef5b1589b9f16544642e473db5ea5639107ef3ea",
"_spec": "@types/component-emitter@^1.2.10",
"_where": "/home/pau/leaflet/cadastre/node_modules/socket.io-parser",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Peter Snider",
"url": "https://github.com/psnider"
}
],
"dependencies": {},
"deprecated": false,
"description": "TypeScript definitions for component-emitter",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
"main": "",
"name": "@types/component-emitter",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/component-emitter"
},
"scripts": {},
"typeScriptVersion": "3.1",
"types": "index.d.ts",
"typesPublisherContentHash": "446bfc6b04cc0bdf3afbaa65ac393c5c9056ab15d158199b96d266059c762403",
"version": "1.2.10"
}

21
client/node_modules/@types/cookie/LICENSE

@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

16
client/node_modules/@types/cookie/README.md

@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/cookie`
# Summary
This package contains type definitions for cookie (https://github.com/jshttp/cookie).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie.
### Additional Details
* Last updated: Wed, 13 May 2020 15:49:11 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Pine Mizune](https://github.com/pine), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).

135
client/node_modules/@types/cookie/index.d.ts

@ -0,0 +1,135 @@
// Type definitions for cookie 0.4