omis - v0.9.0

* Fix variable name(__o_) of obaa are compressed
This commit is contained in:
dntzhang 2019-07-24 20:30:33 +08:00
parent 72186090f5
commit 1dc69344a2
10 changed files with 80 additions and 80 deletions

View File

@ -1,5 +1,5 @@
/**
* omis v0.8.0 http://omijs.org
* omis v0.9.0 http://omijs.org
* Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript.
* By dntzhang https://github.com/dntzhang
* Github: https://github.com/Tencent/omis
@ -1297,7 +1297,7 @@
var eventPropArr = [];
if (isArray(target)) {
if (target.length === 0) {
target.__o_ = {
target['__o_'] = {
__r_: target,
__p_: '#'
};
@ -1343,11 +1343,11 @@
if (new RegExp('\\b' + item + '\\b').test(triggerStr)) {
for (var cprop in this) {
if (this.hasOwnProperty(cprop) && !isFunction(this[cprop])) {
watch(this, cprop, this.__o_.__p_, root);
watch(this, cprop, this['__o_'].__p_, root);
}
}
//todo
onPropertyChanged('Array-' + item, this, old, this, this.__o_.__p_, root);
onPropertyChanged('Array-' + item, this, old, this, this['__o_'].__p_, root);
}
return result;
};
@ -1360,24 +1360,24 @@
function watch(target, prop, path, root) {
if (prop === '__o_') return;
if (isFunction(target[prop])) return;
if (!target.__o_) target.__o_ = {
if (!target['__o_']) target['__o_'] = {
__r_: root
};
if (path !== undefined && path !== null) {
target.__o_.__p_ = path;
target['__o_'].__p_ = path;
} else {
target.__o_.__p_ = '#';
target['__o_'].__p_ = '#';
}
var currentValue = target.__o_[prop] = target[prop];
var currentValue = target['__o_'][prop] = target[prop];
Object.defineProperty(target, prop, {
get: function get() {
return this.__o_[prop];
return this['__o_'][prop];
},
set: function set(value) {
var old = this.__o_[prop];
this.__o_[prop] = value;
onPropertyChanged(prop, value, old, this, target.__o_.__p_, root);
var old = this['__o_'][prop];
this['__o_'][prop] = value;
onPropertyChanged(prop, value, old, this, target['__o_'].__p_, root);
},
configurable: true,
enumerable: true
@ -1386,17 +1386,17 @@
if (isArray(currentValue)) {
mock(currentValue, root);
if (currentValue.length === 0) {
if (!currentValue.__o_) currentValue.__o_ = {};
if (!currentValue['__o_']) currentValue['__o_'] = {};
if (path !== undefined && path !== null) {
currentValue.__o_.__p_ = path + '-' + prop;
currentValue['__o_'].__p_ = path + '-' + prop;
} else {
currentValue.__o_.__p_ = '#' + '-' + prop;
currentValue['__o_'].__p_ = '#' + '-' + prop;
}
}
}
for (var cprop in currentValue) {
if (currentValue.hasOwnProperty(cprop)) {
watch(currentValue, cprop, target.__o_.__p_ + '-' + prop, root);
watch(currentValue, cprop, target['__o_'].__p_ + '-' + prop, root);
}
}
}
@ -1414,7 +1414,7 @@
}
if (prop.indexOf('Array-') !== 0 && typeof value === 'object') {
watch(target, prop, target.__o_.__p_, root);
watch(target, prop, target['__o_'].__p_, root);
}
}
@ -1445,11 +1445,11 @@
}
obaa.add = function (obj, prop) {
watch(obj, prop, obj.__o_.__p_, obj.__o_.__r_);
watch(obj, prop, obj['__o_'].__p_, obj['__o_'].__r_);
};
obaa.set = function (obj, prop, value) {
watch(obj, prop, obj.__o_.__p_, obj.__o_.__r_);
watch(obj, prop, obj['__o_'].__p_, obj['__o_'].__r_);
obj[prop] = value;
};

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/**
* omis v0.8.0 http://omijs.org
* omis v0.9.0 http://omijs.org
* Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript.
* By dntzhang https://github.com/dntzhang
* Github: https://github.com/Tencent/omis
@ -1294,7 +1294,7 @@ function obaa(target, arr, callback) {
var eventPropArr = [];
if (isArray(target)) {
if (target.length === 0) {
target.__o_ = {
target['__o_'] = {
__r_: target,
__p_: '#'
};
@ -1340,11 +1340,11 @@ function mock(target, root) {
if (new RegExp('\\b' + item + '\\b').test(triggerStr)) {
for (var cprop in this) {
if (this.hasOwnProperty(cprop) && !isFunction(this[cprop])) {
watch(this, cprop, this.__o_.__p_, root);
watch(this, cprop, this['__o_'].__p_, root);
}
}
//todo
onPropertyChanged('Array-' + item, this, old, this, this.__o_.__p_, root);
onPropertyChanged('Array-' + item, this, old, this, this['__o_'].__p_, root);
}
return result;
};
@ -1357,24 +1357,24 @@ function mock(target, root) {
function watch(target, prop, path, root) {
if (prop === '__o_') return;
if (isFunction(target[prop])) return;
if (!target.__o_) target.__o_ = {
if (!target['__o_']) target['__o_'] = {
__r_: root
};
if (path !== undefined && path !== null) {
target.__o_.__p_ = path;
target['__o_'].__p_ = path;
} else {
target.__o_.__p_ = '#';
target['__o_'].__p_ = '#';
}
var currentValue = target.__o_[prop] = target[prop];
var currentValue = target['__o_'][prop] = target[prop];
Object.defineProperty(target, prop, {
get: function get() {
return this.__o_[prop];
return this['__o_'][prop];
},
set: function set(value) {
var old = this.__o_[prop];
this.__o_[prop] = value;
onPropertyChanged(prop, value, old, this, target.__o_.__p_, root);
var old = this['__o_'][prop];
this['__o_'][prop] = value;
onPropertyChanged(prop, value, old, this, target['__o_'].__p_, root);
},
configurable: true,
enumerable: true
@ -1383,17 +1383,17 @@ function watch(target, prop, path, root) {
if (isArray(currentValue)) {
mock(currentValue, root);
if (currentValue.length === 0) {
if (!currentValue.__o_) currentValue.__o_ = {};
if (!currentValue['__o_']) currentValue['__o_'] = {};
if (path !== undefined && path !== null) {
currentValue.__o_.__p_ = path + '-' + prop;
currentValue['__o_'].__p_ = path + '-' + prop;
} else {
currentValue.__o_.__p_ = '#' + '-' + prop;
currentValue['__o_'].__p_ = '#' + '-' + prop;
}
}
}
for (var cprop in currentValue) {
if (currentValue.hasOwnProperty(cprop)) {
watch(currentValue, cprop, target.__o_.__p_ + '-' + prop, root);
watch(currentValue, cprop, target['__o_'].__p_ + '-' + prop, root);
}
}
}
@ -1411,7 +1411,7 @@ function onPropertyChanged(prop, value, oldValue, target, path, root) {
}
if (prop.indexOf('Array-') !== 0 && typeof value === 'object') {
watch(target, prop, target.__o_.__p_, root);
watch(target, prop, target['__o_'].__p_, root);
}
}
@ -1442,11 +1442,11 @@ function getRootName(prop, path) {
}
obaa.add = function (obj, prop) {
watch(obj, prop, obj.__o_.__p_, obj.__o_.__r_);
watch(obj, prop, obj['__o_'].__p_, obj['__o_'].__r_);
};
obaa.set = function (obj, prop, value) {
watch(obj, prop, obj.__o_.__p_, obj.__o_.__r_);
watch(obj, prop, obj['__o_'].__p_, obj['__o_'].__r_);
obj[prop] = value;
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1302,7 +1302,7 @@
var eventPropArr = [];
if (isArray(target)) {
if (target.length === 0) {
target.__o_ = {
target['__o_'] = {
__r_: target,
__p_: '#'
};
@ -1348,11 +1348,11 @@
if (new RegExp('\\b' + item + '\\b').test(triggerStr)) {
for (var cprop in this) {
if (this.hasOwnProperty(cprop) && !isFunction(this[cprop])) {
watch(this, cprop, this.__o_.__p_, root);
watch(this, cprop, this['__o_'].__p_, root);
}
}
//todo
onPropertyChanged('Array-' + item, this, old, this, this.__o_.__p_, root);
onPropertyChanged('Array-' + item, this, old, this, this['__o_'].__p_, root);
}
return result;
};
@ -1365,24 +1365,24 @@
function watch(target, prop, path, root) {
if (prop === '__o_') return;
if (isFunction(target[prop])) return;
if (!target.__o_) target.__o_ = {
if (!target['__o_']) target['__o_'] = {
__r_: root
};
if (path !== undefined && path !== null) {
target.__o_.__p_ = path;
target['__o_'].__p_ = path;
} else {
target.__o_.__p_ = '#';
target['__o_'].__p_ = '#';
}
var currentValue = target.__o_[prop] = target[prop];
var currentValue = target['__o_'][prop] = target[prop];
Object.defineProperty(target, prop, {
get: function get() {
return this.__o_[prop];
return this['__o_'][prop];
},
set: function set(value) {
var old = this.__o_[prop];
this.__o_[prop] = value;
onPropertyChanged(prop, value, old, this, target.__o_.__p_, root);
var old = this['__o_'][prop];
this['__o_'][prop] = value;
onPropertyChanged(prop, value, old, this, target['__o_'].__p_, root);
},
configurable: true,
enumerable: true
@ -1391,17 +1391,17 @@
if (isArray(currentValue)) {
mock(currentValue, root);
if (currentValue.length === 0) {
if (!currentValue.__o_) currentValue.__o_ = {};
if (!currentValue['__o_']) currentValue['__o_'] = {};
if (path !== undefined && path !== null) {
currentValue.__o_.__p_ = path + '-' + prop;
currentValue['__o_'].__p_ = path + '-' + prop;
} else {
currentValue.__o_.__p_ = '#' + '-' + prop;
currentValue['__o_'].__p_ = '#' + '-' + prop;
}
}
}
for (var cprop in currentValue) {
if (currentValue.hasOwnProperty(cprop)) {
watch(currentValue, cprop, target.__o_.__p_ + '-' + prop, root);
watch(currentValue, cprop, target['__o_'].__p_ + '-' + prop, root);
}
}
}
@ -1419,7 +1419,7 @@
}
if (prop.indexOf('Array-') !== 0 && typeof value === 'object') {
watch(target, prop, target.__o_.__p_, root);
watch(target, prop, target['__o_'].__p_, root);
}
}
@ -1450,11 +1450,11 @@
}
obaa.add = function (obj, prop) {
watch(obj, prop, obj.__o_.__p_, obj.__o_.__r_);
watch(obj, prop, obj['__o_'].__p_, obj['__o_'].__r_);
};
obaa.set = function (obj, prop, value) {
watch(obj, prop, obj.__o_.__p_, obj.__o_.__r_);
watch(obj, prop, obj['__o_'].__p_, obj['__o_'].__r_);
obj[prop] = value;
};

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "omis",
"version": "0.8.0",
"version": "0.9.0",
"description": "Functional Component with store, scoped css and easy hyperscript.",
"main": "dist/omis.js",
"jsnext:main": "dist/omis.esm.js",

View File

@ -15,7 +15,7 @@ export function obaa(target, arr, callback) {
var eventPropArr = []
if (isArray(target)) {
if (target.length === 0) {
target.__o_ = {
target['__o_'] = {
__r_: target,
__p_: '#'
}
@ -110,7 +110,7 @@ function mock(target, root) {
this.hasOwnProperty(cprop) &&
!isFunction(this[cprop])
) {
watch(this, cprop, this.__o_.__p_, root)
watch(this, cprop, this['__o_'].__p_, root)
}
}
//todo
@ -119,7 +119,7 @@ function mock(target, root) {
this,
old,
this,
this.__o_.__p_,
this['__o_'].__p_,
root
)
}
@ -139,29 +139,29 @@ function mock(target, root) {
function watch(target, prop, path, root) {
if (prop === '__o_') return
if (isFunction(target[prop])) return
if (!target.__o_) target.__o_ = {
if (!target['__o_']) target['__o_'] = {
__r_: root
}
if (path !== undefined && path !== null) {
target.__o_.__p_ = path
target['__o_'].__p_ = path
} else {
target.__o_.__p_ = '#'
target['__o_'].__p_ = '#'
}
var currentValue = (target.__o_[prop] = target[prop])
var currentValue = (target['__o_'][prop] = target[prop])
Object.defineProperty(target, prop, {
get: function () {
return this.__o_[prop]
return this['__o_'][prop]
},
set: function (value) {
var old = this.__o_[prop]
this.__o_[prop] = value
var old = this['__o_'][prop]
this['__o_'][prop] = value
onPropertyChanged(
prop,
value,
old,
this,
target.__o_.__p_,
target['__o_'].__p_,
root
)
},
@ -172,11 +172,11 @@ function watch(target, prop, path, root) {
if (isArray(currentValue)) {
mock(currentValue, root)
if (currentValue.length === 0) {
if (!currentValue.__o_) currentValue.__o_ = {}
if (!currentValue['__o_']) currentValue['__o_'] = {}
if (path !== undefined && path !== null) {
currentValue.__o_.__p_ = path + '-' + prop
currentValue['__o_'].__p_ = path + '-' + prop
} else {
currentValue.__o_.__p_ = '#' + '-' + prop
currentValue['__o_'].__p_ = '#' + '-' + prop
}
}
}
@ -185,7 +185,7 @@ function watch(target, prop, path, root) {
watch(
currentValue,
cprop,
target.__o_.__p_ + '-' + prop,
target['__o_'].__p_ + '-' + prop,
root
)
}
@ -214,7 +214,7 @@ function onPropertyChanged(prop, value, oldValue, target, path, root) {
}
if (prop.indexOf('Array-') !== 0 && typeof value === 'object') {
watch(target, prop, target.__o_.__p_, root)
watch(target, prop, target['__o_'].__p_, root)
}
}
@ -248,11 +248,11 @@ function getRootName(prop, path) {
}
obaa.add = function (obj, prop) {
watch(obj, prop, obj.__o_.__p_, obj.__o_.__r_)
watch(obj, prop, obj['__o_'].__p_, obj['__o_'].__r_)
}
obaa.set = function (obj, prop, value) {
watch(obj, prop, obj.__o_.__p_, obj.__o_.__r_)
watch(obj, prop, obj['__o_'].__p_, obj['__o_'].__r_)
obj[prop] = value
}