vevet 2.7.0 → 2.9.0

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.
Files changed (34) hide show
  1. package/README.md +2 -1
  2. package/build/cdn/index.js +1 -1
  3. package/build/cjs/base/Callbacks.js +1 -1
  4. package/build/cjs/utils/common/id.js +12 -0
  5. package/build/cjs/utils/common/index.js +3 -3
  6. package/build/cjs/utils/common/orderId.js +12 -0
  7. package/build/cjs/utils/common/randID.js +1 -1
  8. package/build/cjs/utils/image/sizesToSrcSet.js +5 -2
  9. package/build/cjs/utils/listeners/onScroll.js +2 -2
  10. package/build/es/base/Callbacks.js +2 -2
  11. package/build/es/utils/common/id.js +8 -0
  12. package/build/es/utils/common/index.js +2 -2
  13. package/build/es/utils/common/orderId.js +8 -0
  14. package/build/es/utils/common/randID.js +1 -1
  15. package/build/es/utils/image/sizesToSrcSet.js +5 -2
  16. package/build/es/utils/listeners/onScroll.js +3 -3
  17. package/build/types/utils/common/id.d.ts +5 -0
  18. package/build/types/utils/common/id.d.ts.map +1 -0
  19. package/build/types/utils/common/index.d.ts +2 -2
  20. package/build/types/utils/common/index.d.ts.map +1 -1
  21. package/build/types/utils/common/orderId.d.ts +5 -0
  22. package/build/types/utils/common/orderId.d.ts.map +1 -0
  23. package/build/types/utils/image/sizesToSrcSet.d.ts.map +1 -1
  24. package/package.json +14 -6
  25. package/src/ts/base/Callbacks.ts +2 -2
  26. package/src/ts/utils/common/id.ts +11 -0
  27. package/src/ts/utils/common/index.ts +2 -2
  28. package/src/ts/utils/image/sizesToSrcSet.ts +5 -2
  29. package/src/ts/utils/listeners/onScroll.ts +3 -3
  30. package/build/cjs/utils/scroll/to.js +0 -41
  31. package/build/es/utils/scroll/to.js +0 -34
  32. package/build/types/utils/scroll/to.d.ts +0 -28
  33. package/build/types/utils/scroll/to.d.ts.map +0 -1
  34. package/src/ts/utils/common/randID.ts +0 -9
@@ -72,7 +72,7 @@ var Callbacks = /** @class */ (function () {
72
72
  */
73
73
  Callbacks.prototype.add = function (target, func, data) {
74
74
  if (data === void 0) { data = {}; }
75
- var id = (0, common_1.randID)('callback');
75
+ var id = (0, common_1.id)('callback');
76
76
  var obj = {
77
77
  id: id,
78
78
  on: true,
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var index = 0;
4
+ /**
5
+ * Generate an ID
6
+ */
7
+ function id(prefix) {
8
+ if (prefix === void 0) { prefix = 'id'; }
9
+ index += 1;
10
+ return "".concat(prefix, "_").concat(index);
11
+ }
12
+ exports.default = id;
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.timeoutCallback = exports.mergeWithoutArrays = exports.randID = void 0;
7
- var randID_1 = __importDefault(require("./randID"));
8
- exports.randID = randID_1.default;
6
+ exports.timeoutCallback = exports.mergeWithoutArrays = exports.id = void 0;
7
+ var id_1 = __importDefault(require("./id"));
8
+ exports.id = id_1.default;
9
9
  var mergeWithoutArrays_1 = __importDefault(require("./mergeWithoutArrays"));
10
10
  exports.mergeWithoutArrays = mergeWithoutArrays_1.default;
11
11
  var timeoutCallback_1 = __importDefault(require("./timeoutCallback"));
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var index = 0;
4
+ /**
5
+ * Generate a random ID
6
+ */
7
+ function orderId(prefix) {
8
+ if (prefix === void 0) { prefix = 'id'; }
9
+ index += 1;
10
+ return "".concat(prefix, "_").concat(index);
11
+ }
12
+ exports.default = orderId;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  */
6
6
  function randID(prefix) {
7
7
  if (prefix === void 0) { prefix = 'id'; }
8
- var id = "".concat(+new Date(), "_").concat(Math.round(Math.random() * 1000));
8
+ var id = "".concat(+new Date(), "_").concat(Math.round(Math.random() * 1));
9
9
  return "".concat(prefix, "_").concat(id);
10
10
  }
11
11
  exports.default = randID;
@@ -7,8 +7,11 @@ function imageSizesToSrcSet(sizes) {
7
7
  var keys = Object.keys(sizes);
8
8
  var srcParts = keys.map(function (key) {
9
9
  var value = sizes[key];
10
- return "".concat(value, " ").concat(key, "w");
10
+ if (value) {
11
+ return "".concat(value, " ").concat(key, "w");
12
+ }
13
+ return undefined;
11
14
  });
12
- return srcParts.join(', ');
15
+ return srcParts.filter(function (item) { return !!item; }).join(', ');
13
16
  }
14
17
  exports.default = imageSizesToSrcSet;
@@ -11,7 +11,7 @@ function onScroll(_a) {
11
11
  var container = _a.container, callback = _a.callback, _b = _a.isPassive, isPassive = _b === void 0 ? false : _b;
12
12
  // check if listeners for this element already exist
13
13
  var instance = instances.find(function (data) { return (data.container === container && data.isPassive === isPassive); });
14
- var callbackId = (0, common_1.randID)('scroll-event');
14
+ var callbackId = (0, common_1.id)('scroll-event');
15
15
  // if a listener exists, we just add a new callback to its stack
16
16
  if (instance) {
17
17
  instance.callbacks.push({
@@ -22,7 +22,7 @@ function onScroll(_a) {
22
22
  else {
23
23
  // otherwise we create a new instance
24
24
  instance = {
25
- id: (0, common_1.randID)('scroll-event-instance'),
25
+ id: (0, common_1.id)('scroll-event-instance'),
26
26
  container: container,
27
27
  callbacks: [{
28
28
  id: callbackId,
@@ -1,4 +1,4 @@
1
- import { timeoutCallback, randID } from '../utils/common';
1
+ import { timeoutCallback, id as orderId } from '../utils/common';
2
2
  /**
3
3
  * A class for callbacks' manipulation.
4
4
  */
@@ -52,7 +52,7 @@ export class Callbacks {
52
52
  * });
53
53
  */
54
54
  add(target, func, data = {}) {
55
- const id = randID('callback');
55
+ const id = orderId('callback');
56
56
  const obj = {
57
57
  id,
58
58
  on: true,
@@ -0,0 +1,8 @@
1
+ let index = 0;
2
+ /**
3
+ * Generate an ID
4
+ */
5
+ export default function id(prefix = 'id') {
6
+ index += 1;
7
+ return `${prefix}_${index}`;
8
+ }
@@ -1,4 +1,4 @@
1
- import randID from './randID';
1
+ import id from './id';
2
2
  import mergeWithoutArrays from './mergeWithoutArrays';
3
3
  import timeoutCallback from './timeoutCallback';
4
- export { randID, mergeWithoutArrays, timeoutCallback, };
4
+ export { id, mergeWithoutArrays, timeoutCallback, };
@@ -0,0 +1,8 @@
1
+ let index = 0;
2
+ /**
3
+ * Generate a random ID
4
+ */
5
+ export default function orderId(prefix = 'id') {
6
+ index += 1;
7
+ return `${prefix}_${index}`;
8
+ }
@@ -2,6 +2,6 @@
2
2
  * Generate a random ID
3
3
  */
4
4
  export default function randID(prefix = 'id') {
5
- const id = `${+new Date()}_${Math.round(Math.random() * 1000)}`;
5
+ const id = `${+new Date()}_${Math.round(Math.random() * 1)}`;
6
6
  return `${prefix}_${id}`;
7
7
  }
@@ -5,7 +5,10 @@ export default function imageSizesToSrcSet(sizes) {
5
5
  const keys = Object.keys(sizes);
6
6
  const srcParts = keys.map((key) => {
7
7
  const value = sizes[key];
8
- return `${value} ${key}w`;
8
+ if (value) {
9
+ return `${value} ${key}w`;
10
+ }
11
+ return undefined;
9
12
  });
10
- return srcParts.join(', ');
13
+ return srcParts.filter((item) => !!item).join(', ');
11
14
  }
@@ -1,6 +1,6 @@
1
1
  import { addEventListener, selectOne } from 'vevet-dom';
2
2
  import { SmoothScroll } from '../../components/scroll/smooth-scroll/SmoothScroll';
3
- import { randID } from '../common';
3
+ import { id as orderId } from '../common';
4
4
  let instances = [];
5
5
  /**
6
6
  * Add OnScroll event
@@ -8,7 +8,7 @@ let instances = [];
8
8
  export default function onScroll({ container, callback, isPassive = false, }) {
9
9
  // check if listeners for this element already exist
10
10
  let instance = instances.find((data) => (data.container === container && data.isPassive === isPassive));
11
- const callbackId = randID('scroll-event');
11
+ const callbackId = orderId('scroll-event');
12
12
  // if a listener exists, we just add a new callback to its stack
13
13
  if (instance) {
14
14
  instance.callbacks.push({
@@ -19,7 +19,7 @@ export default function onScroll({ container, callback, isPassive = false, }) {
19
19
  else {
20
20
  // otherwise we create a new instance
21
21
  instance = {
22
- id: randID('scroll-event-instance'),
22
+ id: orderId('scroll-event-instance'),
23
23
  container,
24
24
  callbacks: [{
25
25
  id: callbackId,
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generate an ID
3
+ */
4
+ export default function id(prefix?: string): string;
5
+ //# sourceMappingURL=id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/common/id.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,EAAE,CACtB,MAAM,SAAO,UAIhB"}
@@ -1,5 +1,5 @@
1
- import randID from './randID';
1
+ import id from './id';
2
2
  import mergeWithoutArrays from './mergeWithoutArrays';
3
3
  import timeoutCallback from './timeoutCallback';
4
- export { randID, mergeWithoutArrays, timeoutCallback, };
4
+ export { id, mergeWithoutArrays, timeoutCallback, };
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACH,MAAM,EACN,kBAAkB,EAClB,eAAe,GAClB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACH,EAAE,EACF,kBAAkB,EAClB,eAAe,GAClB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generate a random ID
3
+ */
4
+ export default function orderId(prefix?: string): string;
5
+ //# sourceMappingURL=orderId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orderId.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/common/orderId.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAC3B,MAAM,SAAO,UAIhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"sizesToSrcSet.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/image/sizesToSrcSet.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACtC,KAAK,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,UAQzC"}
1
+ {"version":3,"file":"sizesToSrcSet.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/image/sizesToSrcSet.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACtC,KAAK,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,UAWzC"}
package/package.json CHANGED
@@ -1,22 +1,24 @@
1
1
  {
2
2
  "name": "vevet",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "description": "VEVET - A JavaScript library",
5
5
  "browserslist": [
6
6
  "since 2015"
7
7
  ],
8
8
  "scripts": {
9
- "pages-build": "node ./examples-src/compiler/index.js && webpack --config ./examples-src/webpack/webpack.prod.js",
9
+ "pages-build": "node ./examples-src/compiler/index.js && NODE_ENV=production webpack --config ./examples-src/webpack/prod.js",
10
10
  "pages-dev": "npm-run-all --parallel pages-dev:pug pages-dev:webpack",
11
11
  "pages-dev:pug": "nodemon --watch ./examples-src/pages --watch ./examples-src/compiler --ext pug,json,ts,js,html,css ./examples-src/compiler/index.js",
12
- "pages-dev:webpack": "webpack serve --config ./examples-src/webpack/webpack.dev.js",
13
- "watch-tsc": "nodemon --watch ./src/ts --ext ts,js --exec \"npm run prepare:es\"",
12
+ "pages-dev:webpack": "NODE_ENV=development webpack serve --config ./examples-src/webpack/dev.js",
14
13
  "prepare:all": "npm run prepare:es && npm run prepare:cjs && npm run prepare:cdn",
15
14
  "prepare:es": "tsc ./src/ts/index.ts --outDir ./build/es --target es6 --module es6 --moduleResolution node --esModuleInterop true --allowSyntheticDefaultImports true --declaration true --declarationDir ./build/types --declarationMap true",
16
15
  "prepare:cjs": "tsc ./src/ts/index.ts --outDir ./build/cjs --target es5 --module commonjs --moduleResolution node --esModuleInterop true --allowSyntheticDefaultImports true",
17
16
  "prepare:cdn": "webpack --config ./config/webpack.cdn.js",
18
17
  "lint:js": "eslint . --ext .ts,.js",
19
- "prepare": "npm run prepare:all",
18
+ "docs": "typedoc --out examples-build/docs ./src/ts --theme default --hideGenerator",
19
+ "gh-pages": "git add examples-build/* && git commit -m \"Update github pages\" && npm run gh-pages:push",
20
+ "gh-pages:push": "git subtree split --prefix examples-build/ -b gh-pages-temp && git push -f origin gh-pages-temp:gh-pages && git branch -D gh-pages-temp",
21
+ "prepare": "npm run lint:js && npm run prepare:all && npm run pages-build && npm run docs && npm run gh-pages",
20
22
  "release": "npm publish"
21
23
  },
22
24
  "main": "./build/cjs/index.js",
@@ -57,6 +59,10 @@
57
59
  "text animation",
58
60
  "timeline"
59
61
  ],
62
+ "files": [
63
+ "src",
64
+ "build"
65
+ ],
60
66
  "author": "Anton Bobrov <anton.bobrov@hotmail.com>",
61
67
  "license": "MIT",
62
68
  "devDependencies": {
@@ -67,7 +73,8 @@
67
73
  "@typescript-eslint/eslint-plugin": "^4.28.1",
68
74
  "@typescript-eslint/parser": "^4.28.1",
69
75
  "babel-loader": "^8.2.2",
70
- "bootstrap": "^5.0.2",
76
+ "base-href-webpack-plugin": "^3.0.1",
77
+ "bootstrap": "^5.1.3",
71
78
  "clean-webpack-plugin": "^4.0.0-alpha.0",
72
79
  "copy-webpack-plugin": "^9.0.1",
73
80
  "css-loader": "^6.2.0",
@@ -90,6 +97,7 @@
90
97
  "style-loader": "^3.2.1",
91
98
  "terser-webpack-plugin": "^5.1.4",
92
99
  "ts-loader": "^9.2.3",
100
+ "typedoc": "^0.22.15",
93
101
  "typescript": "^4.3.5",
94
102
  "webpack": "^5.41.1",
95
103
  "webpack-cli": "^4.7.2",
@@ -1,5 +1,5 @@
1
1
  import { Application } from '../app/Application';
2
- import { timeoutCallback, randID } from '../utils/common';
2
+ import { timeoutCallback, id as orderId } from '../utils/common';
3
3
 
4
4
 
5
5
 
@@ -174,7 +174,7 @@ export class Callbacks<
174
174
  func: NCallbacks.CallbackSettings<Types, Target>['do'],
175
175
  data: NCallbacks.CallbackBaseSettings = {},
176
176
  ): NCallbacks.AddedCallback {
177
- const id = randID('callback');
177
+ const id = orderId('callback');
178
178
  const obj: NCallbacks.CallbacksData<Types> = {
179
179
  id,
180
180
  on: true,
@@ -0,0 +1,11 @@
1
+ let index = 0;
2
+
3
+ /**
4
+ * Generate an ID
5
+ */
6
+ export default function id (
7
+ prefix = 'id',
8
+ ) {
9
+ index += 1;
10
+ return `${prefix}_${index}`;
11
+ }
@@ -1,9 +1,9 @@
1
- import randID from './randID';
1
+ import id from './id';
2
2
  import mergeWithoutArrays from './mergeWithoutArrays';
3
3
  import timeoutCallback from './timeoutCallback';
4
4
 
5
5
  export {
6
- randID,
6
+ id,
7
7
  mergeWithoutArrays,
8
8
  timeoutCallback,
9
9
  };
@@ -7,7 +7,10 @@ export default function imageSizesToSrcSet (
7
7
  const keys = Object.keys(sizes);
8
8
  const srcParts = keys.map((key) => {
9
9
  const value = sizes[key];
10
- return `${value} ${key}w`;
10
+ if (value) {
11
+ return `${value} ${key}w`;
12
+ }
13
+ return undefined;
11
14
  });
12
- return srcParts.join(', ');
15
+ return srcParts.filter((item) => !!item).join(', ');
13
16
  }
@@ -1,7 +1,7 @@
1
1
  import { addEventListener, selectOne } from 'vevet-dom';
2
2
  import { IRemovable } from '../types/general';
3
3
  import { SmoothScroll } from '../../components/scroll/smooth-scroll/SmoothScroll';
4
- import { randID } from '../common';
4
+ import { id as orderId } from '../common';
5
5
 
6
6
  type Container = string | Element | SmoothScroll | Window;
7
7
 
@@ -43,7 +43,7 @@ export default function onScroll ({
43
43
  let instance = instances.find((data) => (
44
44
  data.container === container && data.isPassive === isPassive
45
45
  ))!;
46
- const callbackId = randID('scroll-event');
46
+ const callbackId = orderId('scroll-event');
47
47
 
48
48
  // if a listener exists, we just add a new callback to its stack
49
49
  if (instance) {
@@ -54,7 +54,7 @@ export default function onScroll ({
54
54
  } else {
55
55
  // otherwise we create a new instance
56
56
  instance = {
57
- id: randID('scroll-event-instance'),
57
+ id: orderId('scroll-event-instance'),
58
58
  container,
59
59
  callbacks: [{
60
60
  id: callbackId,
@@ -1,41 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var Timeline_1 = require("../../components/timeline/Timeline");
7
- var getScrollValues_1 = __importDefault(require("./getScrollValues"));
8
- /**
9
- * Scroll to coordinates
10
- */
11
- function scrollTo(_a) {
12
- var _b = _a.container, container = _b === void 0 ? window : _b, _c = _a.top, top = _c === void 0 ? 0 : _c, _d = _a.left, left = _d === void 0 ? 0 : _d, _e = _a.duration, duration = _e === void 0 ? 250 : _e;
13
- return new Promise(function (resolve, reject) {
14
- // save start values
15
- var startValues = (0, getScrollValues_1.default)(container);
16
- if (startValues) {
17
- // create animation
18
- var timeline = new Timeline_1.Timeline({
19
- duration: duration,
20
- });
21
- timeline.addCallback('progress', function (data) {
22
- if (container) {
23
- container.scrollTo({
24
- top: startValues.scrollTop
25
- + (top - startValues.scrollTop) * data.easing,
26
- left: startValues.scrollLeft
27
- + (left - startValues.scrollLeft) * data.easing,
28
- behavior: 'auto',
29
- });
30
- }
31
- });
32
- timeline.addCallback('end', function () {
33
- resolve();
34
- });
35
- timeline.play();
36
- return;
37
- }
38
- reject();
39
- });
40
- }
41
- exports.default = scrollTo;
@@ -1,34 +0,0 @@
1
- import { Timeline } from '../../components/timeline/Timeline';
2
- import getScrollValues from './getScrollValues';
3
- /**
4
- * Scroll to coordinates
5
- */
6
- export default function scrollTo({ container = window, top = 0, left = 0, duration = 250, }) {
7
- return new Promise((resolve, reject) => {
8
- // save start values
9
- const startValues = getScrollValues(container);
10
- if (startValues) {
11
- // create animation
12
- const timeline = new Timeline({
13
- duration,
14
- });
15
- timeline.addCallback('progress', (data) => {
16
- if (container) {
17
- container.scrollTo({
18
- top: startValues.scrollTop
19
- + (top - startValues.scrollTop) * data.easing,
20
- left: startValues.scrollLeft
21
- + (left - startValues.scrollLeft) * data.easing,
22
- behavior: 'auto',
23
- });
24
- }
25
- });
26
- timeline.addCallback('end', () => {
27
- resolve();
28
- });
29
- timeline.play();
30
- return;
31
- }
32
- reject();
33
- });
34
- }
@@ -1,28 +0,0 @@
1
- import { ScrollLike } from '../types/general';
2
- interface Props {
3
- /**
4
- * @default window
5
- */
6
- container?: Window | Element | ScrollLike;
7
- /**
8
- * top padding
9
- * @default 0
10
- */
11
- top?: number;
12
- /**
13
- * left padding
14
- * @default 0
15
- */
16
- left?: number;
17
- /**
18
- * scroll duration
19
- * @default 250
20
- */
21
- duration?: number;
22
- }
23
- /**
24
- * Scroll to coordinates
25
- */
26
- export default function scrollTo({ container, top, left, duration, }: Props): Promise<void>;
27
- export {};
28
- //# sourceMappingURL=to.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"to.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/scroll/to.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,UAAU,KAAK;IACX;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IAC1C;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAE,EAC9B,SAAkB,EAClB,GAAO,EACP,IAAQ,EACR,QAAc,GACjB,EAAE,KAAK,iBA8BP"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Generate a random ID
3
- */
4
- export default function randID (
5
- prefix = 'id',
6
- ) {
7
- const id = `${+new Date()}_${Math.round(Math.random() * 1000)}`;
8
- return `${prefix}_${id}`;
9
- }