@emuanalytics/flow-rdf-core 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -0
- package/dist/flow-rdf-core.css +1 -0
- package/dist/index.cjs +3102 -0
- package/dist/index.d.cts +61 -0
- package/dist/index.d.mts +61 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.mjs +3062 -0
- package/dist/lib/map/plugins/index.cjs +1652 -0
- package/dist/lib/map/plugins/index.d.cts +309 -0
- package/dist/lib/map/plugins/index.d.mts +309 -0
- package/dist/lib/map/plugins/index.d.ts +309 -0
- package/dist/lib/map/plugins/index.mjs +1614 -0
- package/dist/lib/utils/index.cjs +45 -0
- package/dist/lib/utils/index.d.cts +39 -0
- package/dist/lib/utils/index.d.mts +39 -0
- package/dist/lib/utils/index.d.ts +39 -0
- package/dist/lib/utils/index.mjs +5 -0
- package/dist/shared/flow-rdf-core.08975378.d.cts +68 -0
- package/dist/shared/flow-rdf-core.08975378.d.mts +68 -0
- package/dist/shared/flow-rdf-core.08975378.d.ts +68 -0
- package/dist/shared/flow-rdf-core.278a260a.cjs +1364 -0
- package/dist/shared/flow-rdf-core.2e456f93.mjs +83 -0
- package/dist/shared/flow-rdf-core.3042be4a.cjs +93 -0
- package/dist/shared/flow-rdf-core.84eded74.cjs +34 -0
- package/dist/shared/flow-rdf-core.b4b16e78.mjs +1329 -0
- package/dist/shared/flow-rdf-core.b80085b4.mjs +66 -0
- package/dist/shared/flow-rdf-core.bd95d618.mjs +29 -0
- package/dist/shared/flow-rdf-core.c44cf082.cjs +88 -0
- package/dist/shared/flow-rdf-core.c9d2f730.d.cts +1815 -0
- package/dist/shared/flow-rdf-core.c9d2f730.d.mts +1815 -0
- package/dist/shared/flow-rdf-core.c9d2f730.d.ts +1815 -0
- package/package.json +106 -0
- package/plugins/package.json +7 -0
- package/utils/package.json +7 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const isUndefined = (val) => typeof val === "undefined";
|
|
2
|
+
const isNull = (val) => val === null;
|
|
3
|
+
const isNil = (val) => isUndefined(val) || isNull(val);
|
|
4
|
+
const isDefined = (val) => !isNil(val);
|
|
5
|
+
const isString = (val) => typeof val === "string";
|
|
6
|
+
const hasLength = (val) => isDefined(val) && val.length > 0;
|
|
7
|
+
const isStringFull = (val) => isString(val) && hasLength(val);
|
|
8
|
+
const isArray = (val) => Array.isArray(val);
|
|
9
|
+
const isArrayFull = (val) => Array.isArray(val) && hasLength(val);
|
|
10
|
+
const isArrayStrings = (val) => isArrayFull(val) && val.every((v) => isStringFull(v));
|
|
11
|
+
const isObject = (val) => typeof val === "object" && !isNull(val);
|
|
12
|
+
const isObjectFull = (val) => isObject(val) && hasLength(Object.keys(val));
|
|
13
|
+
const isNumber = (val) => typeof val === "number" && !Number.isNaN(val) && Number.isFinite(val);
|
|
14
|
+
const isFalse = (val) => val === false;
|
|
15
|
+
const isTrue = (val) => val === true;
|
|
16
|
+
const isIn = (val, arr) => isArrayFull(arr) && arr.some((o) => val === o);
|
|
17
|
+
const isBoolean = (val) => typeof val === "boolean";
|
|
18
|
+
const isNumeric = (val) => isString(val) && /^[+-]?([0-9]*[.])?[0-9]+$/.test(val);
|
|
19
|
+
const isDate = (val) => val instanceof Date;
|
|
20
|
+
const isValue = (val) => isStringFull(val) || isNumber(val) || isBoolean(val) || isDate(val);
|
|
21
|
+
const hasValue = (val) => isArrayFull(val) ? val.every((o) => isValue(o)) : isValue(val);
|
|
22
|
+
const isFunction = (val) => typeof val === "function";
|
|
23
|
+
function isPlainObject(o) {
|
|
24
|
+
if (!isObject(o)) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
const ctor = o.constructor;
|
|
28
|
+
if (ctor === void 0) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
const prot = ctor.prototype;
|
|
32
|
+
if (isObject(prot) === false) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
if (prot.hasOwnProperty("isPrototypeOf") === false) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
const urlRegex = new RegExp(
|
|
41
|
+
"^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$",
|
|
42
|
+
// fragment locator
|
|
43
|
+
"i"
|
|
44
|
+
);
|
|
45
|
+
function isURL(val) {
|
|
46
|
+
return isString(val) && !!urlRegex.test(val);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function ensureArray(a, ...rest) {
|
|
50
|
+
if (arguments.length === 0) {
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
if (arguments.length === 1) {
|
|
54
|
+
if (a === void 0 || a === null) {
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
if (Array.isArray(a)) {
|
|
58
|
+
return a;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return Array.prototype.slice.call(arguments);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const capitalize = (str, lowerRest = false) => str.slice(0, 1).toUpperCase() + (lowerRest ? str.slice(1).toLowerCase() : str.slice(1));
|
|
65
|
+
|
|
66
|
+
export { isNull as a, isNil as b, capitalize as c, isDefined as d, ensureArray as e, isString as f, isStringFull as g, hasLength as h, isUndefined as i, isArray as j, isArrayFull as k, isArrayStrings as l, isObject as m, isObjectFull as n, isNumber as o, isFalse as p, isTrue as q, isIn as r, isBoolean as s, isNumeric as t, isDate as u, isValue as v, hasValue as w, isFunction as x, isPlainObject as y, isURL as z };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { getType } from '@turf/invariant';
|
|
2
|
+
import { y as isPlainObject } from './flow-rdf-core.b80085b4.mjs';
|
|
3
|
+
|
|
4
|
+
const isPoint = (val) => {
|
|
5
|
+
if (!isPlainObject(val)) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
return getType(val) === "Point";
|
|
9
|
+
};
|
|
10
|
+
const isLineString = (val) => {
|
|
11
|
+
if (!isPlainObject(val)) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return getType(val) === "LineString";
|
|
15
|
+
};
|
|
16
|
+
const isPolygon = (val) => {
|
|
17
|
+
if (!isPlainObject(val)) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return getType(val) === "Polygon";
|
|
21
|
+
};
|
|
22
|
+
const isMultiPolygon = (val) => {
|
|
23
|
+
if (!val) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return getType(val) === "MultiPolygon";
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { isMultiPolygon as a, isPoint as b, isPolygon as c, isLineString as i };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const doNotMemoize = Symbol("Do not memoize");
|
|
4
|
+
function memoize(originalFunction, options) {
|
|
5
|
+
const cache = /* @__PURE__ */ new Map();
|
|
6
|
+
const hash = options.hash ? options.hash : (...args) => args[0];
|
|
7
|
+
const context = options.context;
|
|
8
|
+
return function memoizedFunction(...args) {
|
|
9
|
+
const key = hash.apply(context, args);
|
|
10
|
+
if (key === doNotMemoize) {
|
|
11
|
+
return originalFunction.apply(context, args);
|
|
12
|
+
}
|
|
13
|
+
let value;
|
|
14
|
+
if (!cache.has(key)) {
|
|
15
|
+
value = originalFunction.apply(context, args);
|
|
16
|
+
cache.set(key, value);
|
|
17
|
+
} else {
|
|
18
|
+
value = cache.get(key);
|
|
19
|
+
}
|
|
20
|
+
return value;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function throttle(callback, options) {
|
|
24
|
+
const { delay, noTrailing = false, noLeading = false, debounceMode = void 0 } = options;
|
|
25
|
+
let timeoutID;
|
|
26
|
+
let cancelled = false;
|
|
27
|
+
let lastExec = 0;
|
|
28
|
+
function clearExistingTimeout() {
|
|
29
|
+
if (timeoutID) {
|
|
30
|
+
clearTimeout(timeoutID);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function cancel(options2) {
|
|
34
|
+
const { upcomingOnly = false } = options2 || {};
|
|
35
|
+
clearExistingTimeout();
|
|
36
|
+
cancelled = !upcomingOnly;
|
|
37
|
+
}
|
|
38
|
+
function wrapper(...arguments_) {
|
|
39
|
+
const context = options.context;
|
|
40
|
+
const elapsed = Date.now() - lastExec;
|
|
41
|
+
if (cancelled) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
function exec() {
|
|
45
|
+
lastExec = Date.now();
|
|
46
|
+
callback.apply(context, arguments_);
|
|
47
|
+
}
|
|
48
|
+
function clear() {
|
|
49
|
+
timeoutID = void 0;
|
|
50
|
+
}
|
|
51
|
+
if (!noLeading && debounceMode && !timeoutID) {
|
|
52
|
+
exec();
|
|
53
|
+
}
|
|
54
|
+
clearExistingTimeout();
|
|
55
|
+
if (debounceMode === void 0 && elapsed > delay) {
|
|
56
|
+
if (noLeading) {
|
|
57
|
+
lastExec = Date.now();
|
|
58
|
+
if (!noTrailing) {
|
|
59
|
+
timeoutID = setTimeout(debounceMode ? clear : exec, delay);
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
exec();
|
|
63
|
+
}
|
|
64
|
+
} else if (noTrailing !== true) {
|
|
65
|
+
timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === void 0 ? delay - elapsed : delay);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
wrapper.cancel = cancel;
|
|
69
|
+
return wrapper;
|
|
70
|
+
}
|
|
71
|
+
function debounce(callback, options) {
|
|
72
|
+
const { delay, context, atBegin = false } = options;
|
|
73
|
+
return throttle(callback, { delay, debounceMode: atBegin !== false, context });
|
|
74
|
+
}
|
|
75
|
+
function debounceWithArgs(fn, options) {
|
|
76
|
+
const memoizedDebouncedFn = memoize(
|
|
77
|
+
() => debounce(fn, options),
|
|
78
|
+
options
|
|
79
|
+
);
|
|
80
|
+
return (...args) => {
|
|
81
|
+
memoizedDebouncedFn(...args)(...args);
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
exports.debounce = debounce;
|
|
86
|
+
exports.debounceWithArgs = debounceWithArgs;
|
|
87
|
+
exports.memoize = memoize;
|
|
88
|
+
exports.throttle = throttle;
|