native-document 1.0.274 → 1.0.275

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.
@@ -38,7 +38,7 @@ export function transformObservableImports(code, params = {}) {
38
38
  }
39
39
 
40
40
  export function transformObservableDeclarations(code, id) {
41
- const regex = /(const|let|var)\s+([\w$]+)\s*=\s*(\$|Observable)(\.(?:init|array|json|ref|resource|object))?\s*\(/g;
41
+ const regex = /(const|let|var)\s+([\w$]+)\s*=\s*(\$|Observable)(\.(?:init|array|json|object))?\s*\(/g;
42
42
 
43
43
  return code.replace(regex, (match, varType, varName, caller, method) => {
44
44
  const obsName = method ? `${caller}${method}` : caller;
@@ -55,5 +55,5 @@ export function isFileMustBeModified(file) {
55
55
  if(isContainObservableImport) {
56
56
  return true;
57
57
  }
58
- return /(const|let|var)\s+([\w$]+)\s*=\s*(\$|Observable)(\.(?:init|array|json|ref|resource|object))?\s*\(/g.test(content);
58
+ return /(const|let|var)\s+([\w$]+)\s*=\s*(\$|Observable)(\.(?:init|array|json|object))?\s*\(/g.test(content);
59
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-document",
3
- "version": "1.0.274",
3
+ "version": "1.0.275",
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",
@@ -2,7 +2,8 @@ import {Observable as ObservableOriginal} from './Observable';
2
2
 
3
3
  const HrmGlobakObservableRegistry = new Map();
4
4
 
5
- const overrideMethods = ['array', 'init', 'object', 'json', 'ref', 'resource'];
5
+ const overrideMethods = ['array', 'init', 'object', 'json'];
6
+ const noObservableOverride = ['ref', 'resource'];
6
7
 
7
8
 
8
9
  const override = (callback) => {
@@ -52,7 +53,9 @@ export const Observable = override(ObservableOriginal);
52
53
  export const $ = Observable;
53
54
 
54
55
  overrideMethods.forEach(method => {
55
-
56
56
  Observable[method] = override(ObservableOriginal[method]);
57
-
58
57
  });
58
+
59
+ noObservableOverride.forEach(method => {
60
+ Observable[method] = ObservableOriginal[method];
61
+ });