Members
(static) isType
check type of object
- Deprecated:
- Yes
- Source:
- Tutorials:
-
- Tutorial: use isType
Example
Crisp.isType("", "String"); // true
Crisp.isType(0, "Number"); // true
Crisp.isType({}, "String"); // false
Crisp.isType([], "Number"); // false
(static) toType
- Deprecated:
- Yes
- Source:
- Tutorials:
-
- Tutorial: use toType
- See:
Example
Crisp.toType("") // "[object String]"
Crisp.toType(0) // "[object Number]"
Methods
(static) math(name) → {external:Number}
This:
Parameters:
Name | Type | Description |
---|---|---|
name |
external:String | name of Math Function |
- Source:
- Tutorials:
-
- Tutorial: use math
- See:
Returns:
- Type
- external:Number
Example
Crisp.math.call( -1, 'abs'); // 1
(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 |
- Deprecated:
- Yes
- Source:
- Tutorials:
-
- Tutorial: use toMath
- See:
Returns:
- Type
- external:Number
Example
Crisp.toMath.call( -1, 'abs'); // 1
(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
// GET the small type name of JavaScript objects
Crisp.type.call( '' ); // 'String'
Crisp.type.call( 0 ); // 'Number'
Crisp.type.call( true ); // 'Boolean'
Crisp.type.call( new Date() ); // 'Date'
Crisp.type.call( {} ); // 'Object'
Crisp.type.call( [] ); // 'Array'
Crisp.type.call( /a/g ); // 'RegExp'
// CHECK the small type name of JavaScript objects
Crisp.type.call( '', 'String' ); // true
Crisp.type.call( 0, 'Number' ); // true
Crisp.type.call( true, 'Boolean' ); // true
Crisp.type.call( new Date(), 'Date' ); // true
Crisp.type.call( {}, 'Object' ); // true
Crisp.type.call( null, 'Object' ); // true
Crisp.type.call( [], 'Array' ); // true
Crisp.type.call( /a/g, 'RegExp' ); // true
Crisp.type.call( undefined, 'Undefined' ); // true
// CHECH group of object type
Crisp.type.call( '', 'field' ); // true
Crisp.type.call( 0, 'field' ); // true
Crisp.type.call( true, 'field' ); // true
Crisp.type.call( new Date(), 'field' ); // true
Crisp.type.call( /a/g, 'field' ); // true
(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" }