native-document 1.0.259 → 1.0.261
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/index.js +2 -2
- package/package.json +1 -1
- package/src/core/utils/helpers.js +17 -0
- package/types/helpers.d.ts +7 -0
- package/utils.d.ts +2 -1
- package/utils.js +2 -0
package/index.js
CHANGED
|
@@ -8,8 +8,8 @@ export { SingletonView, useSingleton } from './src/core/wrappers/SingletonView';
|
|
|
8
8
|
export { default as PluginsManager } from './src/core/utils/plugins-manager';
|
|
9
9
|
export { default as Validator } from './src/core/utils/validator';
|
|
10
10
|
|
|
11
|
-
export { Formatters } from
|
|
12
|
-
export {default as ShortcutManager} from
|
|
11
|
+
export { Formatters } from './src/core/utils/formatters';
|
|
12
|
+
export {default as ShortcutManager} from './src/core/utils/shortcut-manager';
|
|
13
13
|
|
|
14
14
|
export * from './src/core/utils/property-accumulator';
|
|
15
15
|
export * from './src/core/utils/args-types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "native-document",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.261",
|
|
4
4
|
"description": "A reactive JavaScript framework that preserves native DOM simplicity without sacrificing modern features",
|
|
5
5
|
"author": "AfroCodeur <https://github.com/afrocodeur>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -141,4 +141,21 @@ export const deepClone = (value, onObservableFound) => {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
return cloned;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
export const lock = (fn, defaultReturn) => {
|
|
148
|
+
let isLocked = false;
|
|
149
|
+
|
|
150
|
+
return async (...args) => {
|
|
151
|
+
if(isLocked) {
|
|
152
|
+
return typeof defaultReturn === 'function' ? defaultReturn() : defaultReturn;
|
|
153
|
+
}
|
|
154
|
+
isLocked = true;
|
|
155
|
+
try {
|
|
156
|
+
return await fn(...args);
|
|
157
|
+
} finally {
|
|
158
|
+
isLocked = false;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
144
161
|
};
|
package/utils.d.ts
CHANGED
package/utils.js
CHANGED
|
@@ -4,6 +4,8 @@ import * as filters from './src/core/utils/filters/index';
|
|
|
4
4
|
import {classPropertyAccumulator, cssPropertyAccumulator} from './src/core/utils/property-accumulator';
|
|
5
5
|
import {LocalStorage} from './src/core/utils/localstorage';
|
|
6
6
|
|
|
7
|
+
export * from './src/core/utils/helpers';
|
|
8
|
+
|
|
7
9
|
const Service = Cache;
|
|
8
10
|
|
|
9
11
|
export {
|