mark-3 0.0.4 → 0.0.6
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/CHANGELOG.md +25 -0
- package/components/index.js +1 -0
- package/components/scroll-aware-content.vue +162 -0
- package/composables/index.js +5 -0
- package/composables/use-event-listener.js +20 -6
- package/composables/use-intersection-observer.js +67 -0
- package/composables/use-outside-clicks.js +62 -0
- package/composables/use-pointer-swipe.js +138 -0
- package/composables/use-scroll-event.js +97 -0
- package/composables/use-swipeable-drawer.js +161 -0
- package/helpers/array/index.js +1 -0
- package/helpers/array/pick-random.js +24 -0
- package/helpers/array/tests/pick-random.test.js +39 -0
- package/helpers/date/index.js +1 -1
- package/helpers/date/{from-timestamp/index.test.js → tests/format-timestamp.test.js} +1 -1
- package/helpers/date/tests/format.test.js +97 -0
- package/helpers/date/{is-on-same-day/index.test.js → tests/is-on-same-day.test.js} +1 -1
- package/helpers/date/{is-on-same-year/index.test.js → tests/is-on-same-year.test.js} +1 -1
- package/helpers/number/clamp.js +17 -0
- package/helpers/number/index.js +2 -0
- package/helpers/number/random.js +24 -0
- package/helpers/number/tests/clamp.test.js +37 -0
- package/helpers/number/tests/random.test.js +51 -0
- package/helpers/string/{camel-to-dash/index.js → camel-to-dash.js} +2 -2
- package/helpers/string/encode-subscript.js +45 -0
- package/helpers/string/encode-superscript.js +46 -0
- package/helpers/string/{escape-regex/index.js → escape-regex.js} +1 -1
- package/helpers/string/index.js +2 -0
- package/helpers/string/{camel-to-dash/index.test.js → tests/camel-to-dash.test.js} +1 -1
- package/helpers/string/tests/encode-subscript.test.js +41 -0
- package/helpers/string/tests/encode-superscript.test.js +42 -0
- package/helpers/string/{escape-regex/index.test.js → tests/escape-regex.test.js} +1 -1
- package/helpers/string/{trim/index.test.js → tests/trim.test.js} +1 -1
- package/helpers/string/{trim/index.js → trim.js} +2 -2
- package/helpers/time/debounce.js +29 -0
- package/helpers/time/index.js +1 -0
- package/helpers/time/tests/debounce.test.js +58 -0
- package/helpers/types/index.js +1 -0
- package/helpers/types/{is-empty/index.js → is-empty.js} +1 -1
- package/helpers/types/{is-map/index.js → is-map.js} +1 -1
- package/helpers/types/is-numeric.js +22 -0
- package/helpers/types/{is-set/index.js → is-set.js} +1 -1
- package/helpers/types/{get-type-name/index.test.js → tests/get-type-name.test.js} +2 -2
- package/helpers/types/{is-array/index.test.js → tests/is-array.test.js} +1 -1
- package/helpers/types/{is-empty/index.test.js → tests/is-empty.test.js} +1 -1
- package/helpers/types/{is-map/index.test.js → tests/is-map.test.js} +1 -1
- package/helpers/types/tests/is-numeric.test.js +51 -0
- package/helpers/types/{is-plain-object/index.test.js → tests/is-plain-object.test.js} +1 -1
- package/helpers/types/{is-set/index.test.js → tests/is-set.test.js} +1 -1
- package/helpers/types/{is-string/index.test.js → tests/is-string.test.js} +1 -1
- package/package.json +4 -1
- package/helpers/date/format/README.md +0 -33
- package/helpers/date/format/index.test.js +0 -97
- package/helpers/date/from-timestamp/README.md +0 -14
- package/helpers/date/is-on-same-day/README.md +0 -12
- package/helpers/date/is-on-same-year/README.md +0 -13
- package/helpers/string/camel-to-dash/README.md +0 -24
- package/helpers/string/escape-regex/README.md +0 -12
- package/helpers/string/trim/README.md +0 -66
- package/helpers/types/get-type-name/README.md +0 -11
- package/helpers/types/is-array/README.md +0 -11
- package/helpers/types/is-empty/README.md +0 -35
- package/helpers/types/is-map/README.md +0 -15
- package/helpers/types/is-plain-object/README.md +0 -17
- package/helpers/types/is-set/README.md +0 -15
- package/helpers/types/is-string/README.md +0 -12
- /package/helpers/date/{from-timestamp/index.js → format-timestamp.js} +0 -0
- /package/helpers/date/{format/index.js → format.js} +0 -0
- /package/helpers/date/{is-on-same-day/index.js → is-on-same-day.js} +0 -0
- /package/helpers/date/{is-on-same-year/index.js → is-on-same-year.js} +0 -0
- /package/helpers/types/{get-type-name/index.js → get-type-name.js} +0 -0
- /package/helpers/types/{is-array/index.js → is-array.js} +0 -0
- /package/helpers/types/{is-plain-object/index.js → is-plain-object.js} +0 -0
- /package/helpers/types/{is-string/index.js → is-string.js} +0 -0
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# isEmpty
|
|
2
|
-
Checks if the given variable is empty.
|
|
3
|
-
|
|
4
|
-
If the variable is an object, it is considered empty if it has no keys.
|
|
5
|
-
If the variable is an array, it is considered empty if it has no elements.
|
|
6
|
-
If the variable is a map or a set, it is considered empty if it has no size.
|
|
7
|
-
If the variable is a string, it is considered empty if it is trimmed to be an empty string.
|
|
8
|
-
If the variable is undefined or null, it is considered empty.
|
|
9
|
-
|
|
10
|
-
Otherwise, it is not considered empty.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Usage
|
|
15
|
-
|
|
16
|
-
```js
|
|
17
|
-
import { isEmpty } from 'mark-3/helpers/types/isEmpty';
|
|
18
|
-
|
|
19
|
-
isEmpty( '' ); // true
|
|
20
|
-
isEmpty( ' ' ); // true
|
|
21
|
-
isEmpty([]); // true
|
|
22
|
-
isEmpty({}); // true
|
|
23
|
-
isEmpty( new Map()); // true
|
|
24
|
-
isEmpty( new Set()); // true
|
|
25
|
-
isEmpty( null ); // true
|
|
26
|
-
isEmpty( undefined ); // true
|
|
27
|
-
|
|
28
|
-
isEmpty( 'foo' ); // false
|
|
29
|
-
isEmpty([ 'foo' ]); // false
|
|
30
|
-
isEmpty({ foo: 'bar' }); // false
|
|
31
|
-
isEmpty( new Map([ 'foo', 'bar' ])); // false
|
|
32
|
-
isEmpty( new Set([ 'foo' ])); // false
|
|
33
|
-
isEmpty({ foo: 'bar' }); // false
|
|
34
|
-
isEmpty(() => {}); // false
|
|
35
|
-
```
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# isMap
|
|
2
|
-
Utility function to check if a value is a native `Map` object in JavaScript.
|
|
3
|
-
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Usage
|
|
7
|
-
```js
|
|
8
|
-
import { isMap } from "@mark-3/helpers/types";
|
|
9
|
-
|
|
10
|
-
isMap(new Map()); // true
|
|
11
|
-
isMap(new WeakMap()); // false
|
|
12
|
-
isMap({}); // false
|
|
13
|
-
isMap([]); // false
|
|
14
|
-
isMap(null); // false
|
|
15
|
-
```
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# isPlainObject
|
|
2
|
-
A utility function to check if a value is a plain object.
|
|
3
|
-
|
|
4
|
-
## Usage
|
|
5
|
-
```js
|
|
6
|
-
import { isPlainObject } from "mark-3/helpers/types";
|
|
7
|
-
|
|
8
|
-
isPlainObject({}); // true
|
|
9
|
-
isPlainObject({ a: 1 }); // true
|
|
10
|
-
isPlainObject(Object.create(null)); // true
|
|
11
|
-
isPlainObject([]); // false
|
|
12
|
-
isPlainObject(null); // false
|
|
13
|
-
isPlainObject(new Date()); // false
|
|
14
|
-
isPlainObject(function(){}); // false
|
|
15
|
-
isPlainObject(new Map()); // false
|
|
16
|
-
isPlainObject(new ( class MyClass{})()); // false
|
|
17
|
-
```
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# isSet
|
|
2
|
-
Utility function to check if a value is a native `Set` object in JavaScript.
|
|
3
|
-
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Usage
|
|
7
|
-
```js
|
|
8
|
-
import { isSet } from "mark-3/helpers/types";
|
|
9
|
-
|
|
10
|
-
isSet(new Set()); // true
|
|
11
|
-
isSet(new WeakSet()); // false
|
|
12
|
-
isSet({}); // false
|
|
13
|
-
isSet([]); // false
|
|
14
|
-
isSet(null); // false
|
|
15
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|