native-document 1.0.0 → 1.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-document",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -66,7 +66,6 @@ Observable.init = function(value) {
66
66
  for(const key in value) {
67
67
  const itemValue = value[key];
68
68
  if(Validator.isJson(itemValue)) {
69
- console.log(itemValue)
70
69
  data[key] = Observable.init(itemValue);
71
70
  continue;
72
71
  }
@@ -174,7 +174,6 @@ export default function Router($options = {}) {
174
174
  $currentState.query = query;
175
175
  $currentState.path = path;
176
176
 
177
- console.log($currentState.query)
178
177
  const middlewares = [...route.middlewares(), trigger];
179
178
  let currentIndex = 0;
180
179
  const request = { ...$currentState };
@@ -195,7 +194,7 @@ Router.routers = {};
195
194
 
196
195
  /**
197
196
  *
198
- * @param {{mode: 'memory'|'history'|'hash', name:string, entry: string}} options
197
+ * @param {{mode: 'memory'|'history'|'hash', name?:string, entry?: string}} options
199
198
  * @param {Function} callback
200
199
  * @param {Element} container
201
200
  */
@@ -19,12 +19,10 @@ export function RouterComponent(router, container) {
19
19
  const { route, params, query, path } = state;
20
20
  if($cache.has(path)) {
21
21
  const cacheNode = $cache.get(path);
22
- console.log(cacheNode);
23
22
  updateContainer(cacheNode);
24
23
  return;
25
24
  }
26
- const Component = route.component()
27
- console.log({ params, query })
25
+ const Component = route.component();
28
26
  const node = Component({ params, query });
29
27
  $cache.set(path, node);
30
28
  updateContainer(node);
@@ -1,8 +1,5 @@
1
- // Build configuration
2
- const isProd = process.env.NODE_ENV === 'production';
3
-
4
1
  const DebugManager = {
5
- enabled: !isProd,
2
+ enabled: false,
6
3
 
7
4
  enable() {
8
5
  this.enabled = true;
@@ -13,7 +10,7 @@ const DebugManager = {
13
10
  this.enabled = false;
14
11
  },
15
12
 
16
- log: isProd ? () => {} : function(category, message, data) {
13
+ log(category, message, data) {
17
14
  if (!this.enabled) return;
18
15
  console.group(`🔍 [${category}] ${message}`);
19
16
  if (data) console.log(data);
@@ -21,12 +18,12 @@ const DebugManager = {
21
18
  console.groupEnd();
22
19
  },
23
20
 
24
- warn: isProd ? () => {} : function(category, message, data) {
21
+ warn(category, message, data) {
25
22
  if (!this.enabled) return;
26
23
  console.warn(`⚠️ [${category}] ${message}`, data);
27
24
  },
28
25
 
29
- error: isProd ? () => {} : function(category, message, error) {
26
+ error(category, message, error) {
30
27
  console.error(`❌ [${category}] ${message}`, error);
31
28
  }
32
29
  };
@@ -62,7 +62,6 @@ export default function AttributesWrapper(element, attributes) {
62
62
  Validator.validateAttributes(attributes);
63
63
 
64
64
  if(!Validator.isObject(attributes)) {
65
- console.log(attributes);
66
65
  throw new NativeDocumentError('Attributes must be an object');
67
66
  }
68
67