Members
(static) isType
check type of object
- Source:
- Tutorials:
-
- Tutorial: use isType
Example
Crisp.isType("", "String"); // true
Crisp.isType(0, "Number"); // true
Crisp.isType({}, "String"); // false
Crisp.isType([], "Number"); // false
Methods
(static) ns(name, objopt) → {AnyItem}
managed Crisp Namespace
This:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
external:String | Dot seperatet Namespace-Path | |
obj |
AnyItem |
<optional> |
Any type of Objects |
Returns:
node of Namespace
- Type
- AnyItem
Example
// GET
Crisp.ns('a'); // return reference of a = {}
// SET and GET
Crisp.ns('b', { a: 'A' }); // return reference of b = { a: 'A' }
(static) parse(type) → {AnyItem}
parse data format
This:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
type |
external:String | "json" |
Returns:
JavaScript Objects
- Type
- AnyItem
Example
Crisp.parse.call('"a"'); // 'a'
Crisp.parse.call('{"a":"A"}'); // { a: 'A' }
(static) parseJson() → {AnyItem}
parse this.toString() to JavaScript Objects
This:
- Deprecated:
- change to
Crisp.parse('json')
- change to
- Source:
- Tutorials:
-
- Tutorial: use parseJson
Returns:
JavaScript Objects
- Type
- AnyItem
Examples
create a copy of module:BaseJS with AnyItem
Crisp.parseJson();
parse AnyItem to external:String and crate a new JavaScript object of AnyItem
Crisp.parseJson.call('{"a":"A"}'); // { "a": "A" }
(static) to(type) → {external:String}
create specified data format
This:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
type |
external:String | "json" |
Returns:
converted JavaScript Object
- Type
- external:String
Example
Crisp.to.call('a'); // '"a"'
Crisp.to.call({ a: 'A' }); // '{"a":"A"}'
(static) toJson(prity) → {external:String}
create JSON data format
This:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
prity |
external:Boolean | false |
- Deprecated:
- change to
Crisp.to('json')
- change to
- Source:
- Tutorials:
-
- Tutorial: use toJson
Returns:
converted JavaScript Object
- Type
- external:String
(static) toMath(name) → {external:Number}
This:
Parameters:
Name | Type | Description |
---|---|---|
name |
external:String | name of Math Function |
- Source:
- Tutorials:
-
- Tutorial: use toMath
- See:
Returns:
- Type
- external:Number
Example
Crisp.toMath.call( -1, 'abs'); // 1
(static) toType(object) → {external:String}
This:
Parameters:
Name | Type | Description |
---|---|---|
object |
AnyItem |
- Source:
- Tutorials:
-
- Tutorial: use toType
- See:
Returns:
- Type
- external:String
Example
Crisp.toType("") // "[object String]"
Crisp.toType(0) // "[object Number]"
(static) type(typeopt) → {external:Boolean|external:String}
get or check type of object
This:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
external:String |
<optional> |
Returns:
- Type
- external:Boolean | external:String
Example
Crisp.type.call(""); // "String"
Crisp.type.call(0); // "Number"
Crisp.type.call("", "String"); // true
Crisp.type.call(0, "Number"); // true
Crisp.type.call({}, "String"); // false
Crisp.type.call([], "Number"); // false
(static) utilTick(selfopt, callback, optopt, asyncopt) → {self}
execute function with (async) util.utilTickCall
This:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
self |
external:Object |
<optional> |
opt.self | alternate of opt.self and return param | ||||||||||||
callback |
util.utilTickCallback | Function for apply | ||||||||||||||
opt |
external:Object |
<optional> |
Options for apply
Properties
|
|||||||||||||
async |
external:Boolean |
<optional> |
false | Asynchronus apply |
- Source:
- Tutorials:
-
- Tutorial: use utilTick
Returns:
- Type
- self
Examples
synchronous execution of an anonymous function
Crisp.utilTick({ a: 'A' }, function() {
console.log(this);
});
console.log('end');
// logs:
// { "a": "A" }
// end
asynchronous exetution of an named function
function test( b ) {
console.log( b.c );
}
Crisp.utilTick( { a: 'A' }, test, { args: 'C' }, true );
console.log('end');
// logs:
// end
// { "a": "A" }