id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
36,400
Zeindelf/utilify-js
dist/utilify.esm.js
objectArraySortByValue
function objectArraySortByValue(arr, map, key) { var _this2 = this; var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; if (!validateHelpers.isArray(map) || map.length < 1) { var compare = function compare(a, b, n) { return _this...
javascript
function objectArraySortByValue(arr, map, key) { var _this2 = this; var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; if (!validateHelpers.isArray(map) || map.length < 1) { var compare = function compare(a, b, n) { return _this...
[ "function", "objectArraySortByValue", "(", "arr", ",", "map", ",", "key", ")", "{", "var", "_this2", "=", "this", ";", "var", "reverse", "=", "arguments", ".", "length", ">", "3", "&&", "arguments", "[", "3", "]", "!==", "undefined", "?", "arguments", ...
Sorting an array of objects by values @param {Array} [arr] An Array of objects @param {Mix} [map] Map to custom order. If value isn't an array with values, will do natural sort @param {String} [key] Object key to use for sorting (accepts dot notation) @param {Boolean} ...
[ "Sorting", "an", "array", "of", "objects", "by", "values" ]
a16f6e578c953b10cec5ca89c06aeba73ff6674f
https://github.com/Zeindelf/utilify-js/blob/a16f6e578c953b10cec5ca89c06aeba73ff6674f/dist/utilify.esm.js#L2583-L2603
36,401
Zeindelf/utilify-js
dist/utilify.esm.js
objectToArray
function objectToArray(obj) { if (!validateHelpers.isPlainObject(obj)) { throw new Error('\'obj\' must be a plain object'); } return Object.keys(obj).map(function (key) { return obj[key]; }); }
javascript
function objectToArray(obj) { if (!validateHelpers.isPlainObject(obj)) { throw new Error('\'obj\' must be a plain object'); } return Object.keys(obj).map(function (key) { return obj[key]; }); }
[ "function", "objectToArray", "(", "obj", ")", "{", "if", "(", "!", "validateHelpers", ".", "isPlainObject", "(", "obj", ")", ")", "{", "throw", "new", "Error", "(", "'\\'obj\\' must be a plain object'", ")", ";", "}", "return", "Object", ".", "keys", "(", ...
Convert object given into an array values @param {Object} obj Object to convert @return {Array} @example const obj = {a: 'a', b: 'b'}; objectToArray(obj); // ['a', 'b']
[ "Convert", "object", "given", "into", "an", "array", "values" ]
a16f6e578c953b10cec5ca89c06aeba73ff6674f
https://github.com/Zeindelf/utilify-js/blob/a16f6e578c953b10cec5ca89c06aeba73ff6674f/dist/utilify.esm.js#L2682-L2690
36,402
Zeindelf/utilify-js
dist/utilify.esm.js
renameKeys
function renameKeys(obj, keysMap) { if (!validateHelpers.isPlainObject(obj)) { throw new Error('\'obj\' must be an plain object'); } return Object.keys(obj).reduce(function (acc, key) { return _extends({}, acc, defineProperty({}, keysMap[key] || key, obj[key])); ...
javascript
function renameKeys(obj, keysMap) { if (!validateHelpers.isPlainObject(obj)) { throw new Error('\'obj\' must be an plain object'); } return Object.keys(obj).reduce(function (acc, key) { return _extends({}, acc, defineProperty({}, keysMap[key] || key, obj[key])); ...
[ "function", "renameKeys", "(", "obj", ",", "keysMap", ")", "{", "if", "(", "!", "validateHelpers", ".", "isPlainObject", "(", "obj", ")", ")", "{", "throw", "new", "Error", "(", "'\\'obj\\' must be an plain object'", ")", ";", "}", "return", "Object", ".", ...
Replaces the names of multiple object keys with the values provided. @param {Object} obj The plain object @param {Object} keysMap Object with key and value to replace @returns {Object} @example const obj = { name: 'John', surename: 'Smith', age: 20 }; renameKeys(obj, { name: 'firstName', surename: 'lastN...
[ "Replaces", "the", "names", "of", "multiple", "object", "keys", "with", "the", "values", "provided", "." ]
a16f6e578c953b10cec5ca89c06aeba73ff6674f
https://github.com/Zeindelf/utilify-js/blob/a16f6e578c953b10cec5ca89c06aeba73ff6674f/dist/utilify.esm.js#L2704-L2712
36,403
Zeindelf/utilify-js
dist/utilify.esm.js
getUserLocation
function getUserLocation(cache, storage) { var _this = this; if (cache) { this._initLocationStorage(storage); } var store = storage.session.get(CONSTANTS.STORAGE_NAME); /* eslint-disable */ return $.Deferred(function (def) { /* eslint-enable */ ...
javascript
function getUserLocation(cache, storage) { var _this = this; if (cache) { this._initLocationStorage(storage); } var store = storage.session.get(CONSTANTS.STORAGE_NAME); /* eslint-disable */ return $.Deferred(function (def) { /* eslint-enable */ ...
[ "function", "getUserLocation", "(", "cache", ",", "storage", ")", "{", "var", "_this", "=", "this", ";", "if", "(", "cache", ")", "{", "this", ".", "_initLocationStorage", "(", "storage", ")", ";", "}", "var", "store", "=", "storage", ".", "session", "...
Get user location by HTML5 Geolocate API and translate coordinates to Brazilian State, City and Region @param {Boolean} cache Save user coordinates into localstorage @param {Object} storage Store2 lib instance @return {Promise} When success, response are an object with State, City, Region and user Coordina...
[ "Get", "user", "location", "by", "HTML5", "Geolocate", "API", "and", "translate", "coordinates", "to", "Brazilian", "State", "City", "and", "Region" ]
a16f6e578c953b10cec5ca89c06aeba73ff6674f
https://github.com/Zeindelf/utilify-js/blob/a16f6e578c953b10cec5ca89c06aeba73ff6674f/dist/utilify.esm.js#L3166-L3229
36,404
Zeindelf/utilify-js
dist/utilify.esm.js
filteredRegion
function filteredRegion(state) { var _this2 = this; var filteredRegion = ''; var _loop = function _loop(region) { if ({}.hasOwnProperty.call(_this2._regionMap, region)) { _this2._regionMap[region].some(function (el, i, arr) { if (stringHelpers.re...
javascript
function filteredRegion(state) { var _this2 = this; var filteredRegion = ''; var _loop = function _loop(region) { if ({}.hasOwnProperty.call(_this2._regionMap, region)) { _this2._regionMap[region].some(function (el, i, arr) { if (stringHelpers.re...
[ "function", "filteredRegion", "(", "state", ")", "{", "var", "_this2", "=", "this", ";", "var", "filteredRegion", "=", "''", ";", "var", "_loop", "=", "function", "_loop", "(", "region", ")", "{", "if", "(", "{", "}", ".", "hasOwnProperty", ".", "call"...
Get Brazilian region for an state initials given @param {String} state Initials state (e.g. 'SP') @return {String} Region (Norte, Sul, etc.) @example locationHelpers.filteredRegion('SP'); // Sudeste
[ "Get", "Brazilian", "region", "for", "an", "state", "initials", "given" ]
a16f6e578c953b10cec5ca89c06aeba73ff6674f
https://github.com/Zeindelf/utilify-js/blob/a16f6e578c953b10cec5ca89c06aeba73ff6674f/dist/utilify.esm.js#L3240-L3260
36,405
Zeindelf/utilify-js
dist/utilify.esm.js
Utilify
function Utilify() { classCallCheck(this, Utilify); /** * Version * @type {String} */ this.version = '0.10.1'; /** * Package name * @type {String} */ this.name = '@UtilifyJS'; /** * Global Helpers instance * @type {GlobalHelpers} */ this.globalHelpers = new GlobalHelpers(); ...
javascript
function Utilify() { classCallCheck(this, Utilify); /** * Version * @type {String} */ this.version = '0.10.1'; /** * Package name * @type {String} */ this.name = '@UtilifyJS'; /** * Global Helpers instance * @type {GlobalHelpers} */ this.globalHelpers = new GlobalHelpers(); ...
[ "function", "Utilify", "(", ")", "{", "classCallCheck", "(", "this", ",", "Utilify", ")", ";", "/**\n * Version\n * @type {String}\n */", "this", ".", "version", "=", "'0.10.1'", ";", "/**\n * Package name\n * @type {String}\n */", "this", ".", "name", "=", ...
Create a Utilify class Main class
[ "Create", "a", "Utilify", "class", "Main", "class" ]
a16f6e578c953b10cec5ca89c06aeba73ff6674f
https://github.com/Zeindelf/utilify-js/blob/a16f6e578c953b10cec5ca89c06aeba73ff6674f/dist/utilify.esm.js#L3338-L3376
36,406
avoidwork/abaaso
src/datalist.js
function ( target, store, template, options ) { var ref = [store], obj, instance; if ( !( target instanceof Element ) || typeof store !== "object" || !regex.string_object.test( typeof template ) ) { throw new Error( label.error.invalidArguments ); } obj = element.create( "ul", {"class": "list", id: s...
javascript
function ( target, store, template, options ) { var ref = [store], obj, instance; if ( !( target instanceof Element ) || typeof store !== "object" || !regex.string_object.test( typeof template ) ) { throw new Error( label.error.invalidArguments ); } obj = element.create( "ul", {"class": "list", id: s...
[ "function", "(", "target", ",", "store", ",", "template", ",", "options", ")", "{", "var", "ref", "=", "[", "store", "]", ",", "obj", ",", "instance", ";", "if", "(", "!", "(", "target", "instanceof", "Element", ")", "||", "typeof", "store", "!==", ...
Creates an instance of datalist @method factory @param {Object} target Element to receive the DataList @param {Object} store Data store to feed the DataList @param {Mixed} template Record field, template ( $.tpl ), or String, e.g. "<p>this is a {{field}} sample.</p>", fields are marked with {{ }} @param {Obj...
[ "Creates", "an", "instance", "of", "datalist" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/src/datalist.js#L13-L38
36,407
avoidwork/abaaso
src/datalist.js
function () { if ( isNaN( this.pageSize ) ) { throw new Error( label.error.invalidArguments ); } return number.round( ( !this.filter ? this.total : this.filtered.length ) / this.pageSize, "up" ); }
javascript
function () { if ( isNaN( this.pageSize ) ) { throw new Error( label.error.invalidArguments ); } return number.round( ( !this.filter ? this.total : this.filtered.length ) / this.pageSize, "up" ); }
[ "function", "(", ")", "{", "if", "(", "isNaN", "(", "this", ".", "pageSize", ")", ")", "{", "throw", "new", "Error", "(", "label", ".", "error", ".", "invalidArguments", ")", ";", "}", "return", "number", ".", "round", "(", "(", "!", "this", ".", ...
Calculates the total pages @method pages @private @return {Number} Total pages
[ "Calculates", "the", "total", "pages" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/src/datalist.js#L47-L53
36,408
spreadshirt/rAppid.js-sprd
sprd/type/UploadDesign.js
function (fileName) { fileName = (fileName || "").toLowerCase(); var validExtensions = ["svg", "cdr", "eps", "ai"], fileExtension = fileName.substr(fileName.lastIndexOf('.') + 1); return validExtensions.indexOf(fileExtension) != -1; }
javascript
function (fileName) { fileName = (fileName || "").toLowerCase(); var validExtensions = ["svg", "cdr", "eps", "ai"], fileExtension = fileName.substr(fileName.lastIndexOf('.') + 1); return validExtensions.indexOf(fileExtension) != -1; }
[ "function", "(", "fileName", ")", "{", "fileName", "=", "(", "fileName", "||", "\"\"", ")", ".", "toLowerCase", "(", ")", ";", "var", "validExtensions", "=", "[", "\"svg\"", ",", "\"cdr\"", ",", "\"eps\"", ",", "\"ai\"", "]", ",", "fileExtension", "=", ...
Checks if the file name matches a correct extension for a vector file. @param {String} fileName @returns {boolean}
[ "Checks", "if", "the", "file", "name", "matches", "a", "correct", "extension", "for", "a", "vector", "file", "." ]
b56f9f47fe01332f5bf885eaf4db59014f099019
https://github.com/spreadshirt/rAppid.js-sprd/blob/b56f9f47fe01332f5bf885eaf4db59014f099019/sprd/type/UploadDesign.js#L103-L109
36,409
tinwatchman/grawlix
spec/util-spec.js
function(pluginOptions, options) { options.isFactoryFunctionRun = true; return new GrawlixPlugin({ name: 'blank-plugin-2', init: function(opts) { opts.isLoaded = true; } }); }
javascript
function(pluginOptions, options) { options.isFactoryFunctionRun = true; return new GrawlixPlugin({ name: 'blank-plugin-2', init: function(opts) { opts.isLoaded = true; } }); }
[ "function", "(", "pluginOptions", ",", "options", ")", "{", "options", ".", "isFactoryFunctionRun", "=", "true", ";", "return", "new", "GrawlixPlugin", "(", "{", "name", ":", "'blank-plugin-2'", ",", "init", ":", "function", "(", "opts", ")", "{", "opts", ...
factory function plugin
[ "factory", "function", "plugin" ]
235cd9629992b97c62953b813d5034a9546211f1
https://github.com/tinwatchman/grawlix/blob/235cd9629992b97c62953b813d5034a9546211f1/spec/util-spec.js#L644-L652
36,410
LockateMe/cordova-plugin-minisodium
www/MiniSodium.js
function(ed25519Sk, callback){ if (typeof callback != 'function') throw new TypeError('callback must be a function'); try { isValidInput(ed25519Sk, 'ed25519Sk', MiniSodium.crypto_sign_SECRETKEYBYTES); } catch (e){ callback(e); return; } ed25519Sk = to_hex(ed25519Sk); var params = [ed25519Sk]; c...
javascript
function(ed25519Sk, callback){ if (typeof callback != 'function') throw new TypeError('callback must be a function'); try { isValidInput(ed25519Sk, 'ed25519Sk', MiniSodium.crypto_sign_SECRETKEYBYTES); } catch (e){ callback(e); return; } ed25519Sk = to_hex(ed25519Sk); var params = [ed25519Sk]; c...
[ "function", "(", "ed25519Sk", ",", "callback", ")", "{", "if", "(", "typeof", "callback", "!=", "'function'", ")", "throw", "new", "TypeError", "(", "'callback must be a function'", ")", ";", "try", "{", "isValidInput", "(", "ed25519Sk", ",", "'ed25519Sk'", ",...
Ed25519 -> Curve25519 keypair conversion
[ "Ed25519", "-", ">", "Curve25519", "keypair", "conversion" ]
4527565db27c488deca5f949d562192526ef1748
https://github.com/LockateMe/cordova-plugin-minisodium/blob/4527565db27c488deca5f949d562192526ef1748/www/MiniSodium.js#L220-L233
36,411
LockateMe/cordova-plugin-minisodium
www/MiniSodium.js
function(str) { if (str instanceof Uint8Array) return str; if (!is_hex(str)) { throw new TypeError("The provided string doesn't look like hex data"); } var result = new Uint8Array(str.length / 2); for (var i = 0; i < str.length; i += 2) { result[i >>> 1] = parseInt(str.substr(i, 2), 16); ...
javascript
function(str) { if (str instanceof Uint8Array) return str; if (!is_hex(str)) { throw new TypeError("The provided string doesn't look like hex data"); } var result = new Uint8Array(str.length / 2); for (var i = 0; i < str.length; i += 2) { result[i >>> 1] = parseInt(str.substr(i, 2), 16); ...
[ "function", "(", "str", ")", "{", "if", "(", "str", "instanceof", "Uint8Array", ")", "return", "str", ";", "if", "(", "!", "is_hex", "(", "str", ")", ")", "{", "throw", "new", "TypeError", "(", "\"The provided string doesn't look like hex data\"", ")", ";", ...
Hexdecimal encoding helpers
[ "Hexdecimal", "encoding", "helpers" ]
4527565db27c488deca5f949d562192526ef1748
https://github.com/LockateMe/cordova-plugin-minisodium/blob/4527565db27c488deca5f949d562192526ef1748/www/MiniSodium.js#L472-L482
36,412
Dashron/roads
src/middleware/simpleRouter.js
buildRouterPath
function buildRouterPath(path, prefix) { if (!prefix) { prefix = ''; } if (prefix.length && path === '/') { return prefix; } return prefix + path; }
javascript
function buildRouterPath(path, prefix) { if (!prefix) { prefix = ''; } if (prefix.length && path === '/') { return prefix; } return prefix + path; }
[ "function", "buildRouterPath", "(", "path", ",", "prefix", ")", "{", "if", "(", "!", "prefix", ")", "{", "prefix", "=", "''", ";", "}", "if", "(", "prefix", ".", "length", "&&", "path", "===", "'/'", ")", "{", "return", "prefix", ";", "}", "return"...
Applies a prefix to paths of route files @todo I'm pretty sure there's an existing library that will do this more accurately @param {string} path - The HTTP path of a route @param {string} [prefix] - An optional prefix for the HTTP path
[ "Applies", "a", "prefix", "to", "paths", "of", "route", "files" ]
c089d79d8181063c7fae00432a79b7a79a7809d3
https://github.com/Dashron/roads/blob/c089d79d8181063c7fae00432a79b7a79a7809d3/src/middleware/simpleRouter.js#L19-L29
36,413
Dashron/roads
src/middleware/simpleRouter.js
compareRouteAndApplyArgs
function compareRouteAndApplyArgs (route, request_url, request_method) { if (route.method !== request_method) { return false; } let template = route.path.split('/'); if (template[0] === '') { template = template.slice(1); // Slice kills the emptystring before the leading slash } let actual = request_url.pat...
javascript
function compareRouteAndApplyArgs (route, request_url, request_method) { if (route.method !== request_method) { return false; } let template = route.path.split('/'); if (template[0] === '') { template = template.slice(1); // Slice kills the emptystring before the leading slash } let actual = request_url.pat...
[ "function", "compareRouteAndApplyArgs", "(", "route", ",", "request_url", ",", "request_method", ")", "{", "if", "(", "route", ".", "method", "!==", "request_method", ")", "{", "return", "false", ";", "}", "let", "template", "=", "route", ".", "path", ".", ...
Checks to see if the route matches the request, and if true assigns any applicable url variables and returns the route @param {object} route - Route object from this simple router class @param {object} route.method - HTTP method associated with this route @param {object} route.path - HTTP path associated with this rou...
[ "Checks", "to", "see", "if", "the", "route", "matches", "the", "request", "and", "if", "true", "assigns", "any", "applicable", "url", "variables", "and", "returns", "the", "route" ]
c089d79d8181063c7fae00432a79b7a79a7809d3
https://github.com/Dashron/roads/blob/c089d79d8181063c7fae00432a79b7a79a7809d3/src/middleware/simpleRouter.js#L154-L204
36,414
Dashron/roads
src/middleware/simpleRouter.js
applyArg
function applyArg(request_url, template_part, actual_part) { if (typeof(request_url.args) === "undefined") { request_url.args = {}; } if (typeof request_url.args !== "object") { throw new Error("The request url's args have already been defined as a " + typeof request_url.args + " and we expected an object. For ...
javascript
function applyArg(request_url, template_part, actual_part) { if (typeof(request_url.args) === "undefined") { request_url.args = {}; } if (typeof request_url.args !== "object") { throw new Error("The request url's args have already been defined as a " + typeof request_url.args + " and we expected an object. For ...
[ "function", "applyArg", "(", "request_url", ",", "template_part", ",", "actual_part", ")", "{", "if", "(", "typeof", "(", "request_url", ".", "args", ")", "===", "\"undefined\"", ")", "{", "request_url", ".", "args", "=", "{", "}", ";", "}", "if", "(", ...
Assigns a value to the parsed request urls args parameter @param {object} request_url - The parsed url object @param {string} template_part - The template variable @param {*} actual_part - The url value
[ "Assigns", "a", "value", "to", "the", "parsed", "request", "urls", "args", "parameter" ]
c089d79d8181063c7fae00432a79b7a79a7809d3
https://github.com/Dashron/roads/blob/c089d79d8181063c7fae00432a79b7a79a7809d3/src/middleware/simpleRouter.js#L213-L223
36,415
felixrieseberg/windows-notification-state
lib/index.js
getNotificationState
function getNotificationState () { if (process.platform !== 'win32') { throw new Error('windows-notification-state only works on windows') } const QUERY_USER_NOTIFICATION_STATE = [ '', 'QUNS_NOT_PRESENT', 'QUNS_BUSY', 'QUNS_RUNNING_D3D_FULL_SCREEN', 'QUNS_PRESENTATION_MODE', 'QUNS_ACC...
javascript
function getNotificationState () { if (process.platform !== 'win32') { throw new Error('windows-notification-state only works on windows') } const QUERY_USER_NOTIFICATION_STATE = [ '', 'QUNS_NOT_PRESENT', 'QUNS_BUSY', 'QUNS_RUNNING_D3D_FULL_SCREEN', 'QUNS_PRESENTATION_MODE', 'QUNS_ACC...
[ "function", "getNotificationState", "(", ")", "{", "if", "(", "process", ".", "platform", "!==", "'win32'", ")", "{", "throw", "new", "Error", "(", "'windows-notification-state only works on windows'", ")", "}", "const", "QUERY_USER_NOTIFICATION_STATE", "=", "[", "'...
Returns the name of the QUERY_USER_NOTIFICATION_STATE enum rather than a number. @returns {string} QUERY_USER_NOTIFICATION_STATE
[ "Returns", "the", "name", "of", "the", "QUERY_USER_NOTIFICATION_STATE", "enum", "rather", "than", "a", "number", "." ]
a8e0710997f1744eb8129e691513f235f681807e
https://github.com/felixrieseberg/windows-notification-state/blob/a8e0710997f1744eb8129e691513f235f681807e/lib/index.js#L22-L45
36,416
HumanBrainProject/jsdoc-sphinx
template/util/rst-mixin.js
titlecase
function titlecase() { return function(data, render) { var text = render(data); if (text.length === 0) { return text; } return text[0].toUpperCase() + text.substring(1); }; }
javascript
function titlecase() { return function(data, render) { var text = render(data); if (text.length === 0) { return text; } return text[0].toUpperCase() + text.substring(1); }; }
[ "function", "titlecase", "(", ")", "{", "return", "function", "(", "data", ",", "render", ")", "{", "var", "text", "=", "render", "(", "data", ")", ";", "if", "(", "text", ".", "length", "===", "0", ")", "{", "return", "text", ";", "}", "return", ...
Mustache lambda that upercase the first letter of each word in the given data. @return {function} the titlecase helper function
[ "Mustache", "lambda", "that", "upercase", "the", "first", "letter", "of", "each", "word", "in", "the", "given", "data", "." ]
9d7c1d318ce535640588e7308917729c3849bc83
https://github.com/HumanBrainProject/jsdoc-sphinx/blob/9d7c1d318ce535640588e7308917729c3849bc83/template/util/rst-mixin.js#L19-L28
36,417
HumanBrainProject/jsdoc-sphinx
template/util/rst-mixin.js
generateHeading
function generateHeading() { var mixin = {}; // If two char are provided, first one is used as upperline of the text. _.each(['==', '=', '-', '~', '\''], function(char, idx) { // Mustach lambda function takes no parameters and return a function // whose signature is data, render. // see https://mustac...
javascript
function generateHeading() { var mixin = {}; // If two char are provided, first one is used as upperline of the text. _.each(['==', '=', '-', '~', '\''], function(char, idx) { // Mustach lambda function takes no parameters and return a function // whose signature is data, render. // see https://mustac...
[ "function", "generateHeading", "(", ")", "{", "var", "mixin", "=", "{", "}", ";", "// If two char are provided, first one is used as upperline of the text.", "_", ".", "each", "(", "[", "'=='", ",", "'='", ",", "'-'", ",", "'~'", ",", "'\\''", "]", ",", "funct...
Create a mixin object containing mustache lambda function for heading. The function are named h1 to h[n]. @return {function} Mustache lambda
[ "Create", "a", "mixin", "object", "containing", "mustache", "lambda", "function", "for", "heading", "." ]
9d7c1d318ce535640588e7308917729c3849bc83
https://github.com/HumanBrainProject/jsdoc-sphinx/blob/9d7c1d318ce535640588e7308917729c3849bc83/template/util/rst-mixin.js#L37-L56
36,418
HumanBrainProject/jsdoc-sphinx
template/util/rst-mixin.js
pre
function pre() { return function(data, render) { // remove first line if empty ; it happens because of // the {{pre}} tag on one line. logger.debug('empty line:', Boolean(data.match(/^\s+\n/, ''))); data = data.replace(/^\s+\n/, ''); // Find the first non-empty lines tabulation var m = data.ma...
javascript
function pre() { return function(data, render) { // remove first line if empty ; it happens because of // the {{pre}} tag on one line. logger.debug('empty line:', Boolean(data.match(/^\s+\n/, ''))); data = data.replace(/^\s+\n/, ''); // Find the first non-empty lines tabulation var m = data.ma...
[ "function", "pre", "(", ")", "{", "return", "function", "(", "data", ",", "render", ")", "{", "// remove first line if empty ; it happens because of", "// the {{pre}} tag on one line.", "logger", ".", "debug", "(", "'empty line:'", ",", "Boolean", "(", "data", ".", ...
Mustache lambda to preserve whitespace of the given string. @return {function} Mustache lambda
[ "Mustache", "lambda", "to", "preserve", "whitespace", "of", "the", "given", "string", "." ]
9d7c1d318ce535640588e7308917729c3849bc83
https://github.com/HumanBrainProject/jsdoc-sphinx/blob/9d7c1d318ce535640588e7308917729c3849bc83/template/util/rst-mixin.js#L63-L87
36,419
syntax-tree/unist-builder-blueprint
index.js
propsNode
function propsNode (node) { var props = flatmap(Object.keys(node), function (key) { if (key == 'type' || key == 'value' || key == 'children') { return; } var value = node[key]; if (key == 'data') { value = JSON.parse(JSON.stringify(value)); } return { type: 'Property', ...
javascript
function propsNode (node) { var props = flatmap(Object.keys(node), function (key) { if (key == 'type' || key == 'value' || key == 'children') { return; } var value = node[key]; if (key == 'data') { value = JSON.parse(JSON.stringify(value)); } return { type: 'Property', ...
[ "function", "propsNode", "(", "node", ")", "{", "var", "props", "=", "flatmap", "(", "Object", ".", "keys", "(", "node", ")", ",", "function", "(", "key", ")", "{", "if", "(", "key", "==", "'type'", "||", "key", "==", "'value'", "||", "key", "==", ...
Create ESTree object literal node representing Unist node properties.
[ "Create", "ESTree", "object", "literal", "node", "representing", "Unist", "node", "properties", "." ]
f63bf8f1474ea84cf1c127a3cc47814e7611783e
https://github.com/syntax-tree/unist-builder-blueprint/blob/f63bf8f1474ea84cf1c127a3cc47814e7611783e/index.js#L38-L64
36,420
syntax-tree/unist-builder-blueprint
index.js
literalNode
function literalNode (value) { if (value === undefined) { return { type: 'Identifier', name: 'undefined' }; } else if (typeof value == 'function') { throw Error('Unist property contains a function'); } else if (value === null || typeof value != 'object') { return { type: 'Lit...
javascript
function literalNode (value) { if (value === undefined) { return { type: 'Identifier', name: 'undefined' }; } else if (typeof value == 'function') { throw Error('Unist property contains a function'); } else if (value === null || typeof value != 'object') { return { type: 'Lit...
[ "function", "literalNode", "(", "value", ")", "{", "if", "(", "value", "===", "undefined", ")", "{", "return", "{", "type", ":", "'Identifier'", ",", "name", ":", "'undefined'", "}", ";", "}", "else", "if", "(", "typeof", "value", "==", "'function'", "...
Create ESTree node representing particular JavaScript literal.
[ "Create", "ESTree", "node", "representing", "particular", "JavaScript", "literal", "." ]
f63bf8f1474ea84cf1c127a3cc47814e7611783e
https://github.com/syntax-tree/unist-builder-blueprint/blob/f63bf8f1474ea84cf1c127a3cc47814e7611783e/index.js#L68-L105
36,421
avoidwork/abaaso
src/promise.js
function ( parent, child ) { parent.then( function ( arg ) { child.resolve( arg ); }, function ( e ) { child.reject( e ); }); }
javascript
function ( parent, child ) { parent.then( function ( arg ) { child.resolve( arg ); }, function ( e ) { child.reject( e ); }); }
[ "function", "(", "parent", ",", "child", ")", "{", "parent", ".", "then", "(", "function", "(", "arg", ")", "{", "child", ".", "resolve", "(", "arg", ")", ";", "}", ",", "function", "(", "e", ")", "{", "child", ".", "reject", "(", "e", ")", ";"...
Pipes a reconciliation from `parent` to `child` @method pipe @param {Object} parent Promise @param {Object} child Promise @return {Undefined} undefined
[ "Pipes", "a", "reconciliation", "from", "parent", "to", "child" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/src/promise.js#L43-L49
36,422
avoidwork/abaaso
src/promise.js
function ( obj, arg, state ) { if ( obj.state > promise.state.PENDING ) { return; } obj.value = arg; obj.state = state; if ( !obj.deferred ) { promise.delay( function () { obj.process(); }); obj.deferred = true; } return obj; }
javascript
function ( obj, arg, state ) { if ( obj.state > promise.state.PENDING ) { return; } obj.value = arg; obj.state = state; if ( !obj.deferred ) { promise.delay( function () { obj.process(); }); obj.deferred = true; } return obj; }
[ "function", "(", "obj", ",", "arg", ",", "state", ")", "{", "if", "(", "obj", ".", "state", ">", "promise", ".", "state", ".", "PENDING", ")", "{", "return", ";", "}", "obj", ".", "value", "=", "arg", ";", "obj", ".", "state", "=", "state", ";"...
Initiates processing a Promise @memberOf process @param {Object} obj Promise instance @param {Mixed} arg Promise value @param {Number} state State, e.g. "1" @return {Object} Promise instance
[ "Initiates", "processing", "a", "Promise" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/src/promise.js#L60-L77
36,423
HumanBrainProject/jsdoc-sphinx
template/util/index.js
view
function view(name, model, cb) { var basePath = path.join(path.dirname(__filename), '../views'); var render = function(err, files) { if (err) { cb(err); } cb(null, mustache.render(files[0], model, { toctreeChildren: files[1], func: files[2], member: files[3], constant: file...
javascript
function view(name, model, cb) { var basePath = path.join(path.dirname(__filename), '../views'); var render = function(err, files) { if (err) { cb(err); } cb(null, mustache.render(files[0], model, { toctreeChildren: files[1], func: files[2], member: files[3], constant: file...
[ "function", "view", "(", "name", ",", "model", ",", "cb", ")", "{", "var", "basePath", "=", "path", ".", "join", "(", "path", ".", "dirname", "(", "__filename", ")", ",", "'../views'", ")", ";", "var", "render", "=", "function", "(", "err", ",", "f...
Generate the output string given a template name and the model. @param {string} name the template name without the extension. @param {object} model the ViewModel to use with the template @param {viewCallback} cb callback
[ "Generate", "the", "output", "string", "given", "a", "template", "name", "and", "the", "model", "." ]
9d7c1d318ce535640588e7308917729c3849bc83
https://github.com/HumanBrainProject/jsdoc-sphinx/blob/9d7c1d318ce535640588e7308917729c3849bc83/template/util/index.js#L24-L50
36,424
avoidwork/abaaso
lib/abaaso.js
function ( obj, arg ) { if ( !array.contains( obj, arg ) ) { obj.push( arg ); } return obj; }
javascript
function ( obj, arg ) { if ( !array.contains( obj, arg ) ) { obj.push( arg ); } return obj; }
[ "function", "(", "obj", ",", "arg", ")", "{", "if", "(", "!", "array", ".", "contains", "(", "obj", ",", "arg", ")", ")", "{", "obj", ".", "push", "(", "arg", ")", ";", "}", "return", "obj", ";", "}" ]
Adds 'arg' to 'obj' if it is not found @method add @param {Array} obj Array to receive 'arg' @param {Mixed} arg Argument to set in 'obj' @return {Array} Array that was queried
[ "Adds", "arg", "to", "obj", "if", "it", "is", "not", "found" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L167-L173
36,425
avoidwork/abaaso
lib/abaaso.js
function ( obj, arg ) { var min = 0, max = obj.length - 1, idx, val; while ( min <= max ) { idx = Math.floor( ( min + max ) / 2 ); val = obj[idx]; if ( val < arg ) { min = idx + 1; } else if ( val > arg ) { max = idx - 1; } else { return idx; } } return -1; }
javascript
function ( obj, arg ) { var min = 0, max = obj.length - 1, idx, val; while ( min <= max ) { idx = Math.floor( ( min + max ) / 2 ); val = obj[idx]; if ( val < arg ) { min = idx + 1; } else if ( val > arg ) { max = idx - 1; } else { return idx; } } return -1; }
[ "function", "(", "obj", ",", "arg", ")", "{", "var", "min", "=", "0", ",", "max", "=", "obj", ".", "length", "-", "1", ",", "idx", ",", "val", ";", "while", "(", "min", "<=", "max", ")", "{", "idx", "=", "Math", ".", "floor", "(", "(", "min...
Preforms a binary search on a sorted Array @method binIndex @param {Array} obj Array to search @param {Mixed} arg Value to find index of @return {Number} Index of `arg` within `obj`
[ "Preforms", "a", "binary", "search", "on", "a", "sorted", "Array" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L183-L204
36,426
avoidwork/abaaso
lib/abaaso.js
function ( obj, size ) { var result = [], nth = number.round( ( obj.length / size ), "up" ), start = 0, i = -1; while ( ++i < nth ) { start = i * size; result.push( array.limit( obj, start, size ) ); } return result; }
javascript
function ( obj, size ) { var result = [], nth = number.round( ( obj.length / size ), "up" ), start = 0, i = -1; while ( ++i < nth ) { start = i * size; result.push( array.limit( obj, start, size ) ); } return result; }
[ "function", "(", "obj", ",", "size", ")", "{", "var", "result", "=", "[", "]", ",", "nth", "=", "number", ".", "round", "(", "(", "obj", ".", "length", "/", "size", ")", ",", "\"up\"", ")", ",", "start", "=", "0", ",", "i", "=", "-", "1", "...
Transforms an Array to a 2D Array of chunks @method chunk @param {Array} obj Array to parse @param {Number} size Chunk size ( integer ) @return {Array} Chunked Array
[ "Transforms", "an", "Array", "to", "a", "2D", "Array", "of", "chunks" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L274-L286
36,427
avoidwork/abaaso
lib/abaaso.js
function ( obj, fn ) { var result = []; array.each( obj, function ( i ) { result.push( fn( i ) ); }); return result; }
javascript
function ( obj, fn ) { var result = []; array.each( obj, function ( i ) { result.push( fn( i ) ); }); return result; }
[ "function", "(", "obj", ",", "fn", ")", "{", "var", "result", "=", "[", "]", ";", "array", ".", "each", "(", "obj", ",", "function", "(", "i", ")", "{", "result", ".", "push", "(", "fn", "(", "i", ")", ")", ";", "}", ")", ";", "return", "re...
Creates a new Array of the result of `fn` executed against every index of `obj` @method collect @param {Array} obj Array to iterate @param {Function} fn Function to execute against indices @return {Array} New Array
[ "Creates", "a", "new", "Array", "of", "the", "result", "of", "fn", "executed", "against", "every", "index", "of", "obj" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L330-L338
36,428
avoidwork/abaaso
lib/abaaso.js
function ( obj, diff ) { var result = []; result = obj.filter( function ( i ) { return !regex.null_undefined.test( i ); }); return !diff ? result : ( result.length < obj.length ? result : null ); }
javascript
function ( obj, diff ) { var result = []; result = obj.filter( function ( i ) { return !regex.null_undefined.test( i ); }); return !diff ? result : ( result.length < obj.length ? result : null ); }
[ "function", "(", "obj", ",", "diff", ")", "{", "var", "result", "=", "[", "]", ";", "result", "=", "obj", ".", "filter", "(", "function", "(", "i", ")", "{", "return", "!", "regex", ".", "null_undefined", ".", "test", "(", "i", ")", ";", "}", "...
Compacts a Array by removing `null` or `undefined` indices @method compact @param {Array} obj Array to compact @param {Boolean} diff Indicates to return resulting Array only if there's a difference @return {Array} Compacted copy of `obj`, or null ( if `diff` is passed & no diff is found )
[ "Compacts", "a", "Array", "by", "removing", "null", "or", "undefined", "indices" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L348-L356
36,429
avoidwork/abaaso
lib/abaaso.js
function ( array1, array2 ) { var result = []; array.each( array1, function ( i ) { if ( !array.contains( array2, i ) ) { array.add( result, i ); } }); array.each( array2, function ( i ) { if ( !array.contains( array1, i ) ) { array.add( result, i ); } }); return result; }
javascript
function ( array1, array2 ) { var result = []; array.each( array1, function ( i ) { if ( !array.contains( array2, i ) ) { array.add( result, i ); } }); array.each( array2, function ( i ) { if ( !array.contains( array1, i ) ) { array.add( result, i ); } }); return result; }
[ "function", "(", "array1", ",", "array2", ")", "{", "var", "result", "=", "[", "]", ";", "array", ".", "each", "(", "array1", ",", "function", "(", "i", ")", "{", "if", "(", "!", "array", ".", "contains", "(", "array2", ",", "i", ")", ")", "{",...
Finds the difference between array1 and array2 @method diff @param {Array} array1 Source Array @param {Array} array2 Comparison Array @return {Array} Array of the differences
[ "Finds", "the", "difference", "between", "array1", "and", "array2" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L380-L396
36,430
avoidwork/abaaso
lib/abaaso.js
function ( obj, arg, start, offset ) { var fn = typeof arg === "function", l = obj.length, i = !isNaN( start ) ? start : 0, nth = !isNaN( offset ) ? i + offset : l - 1; if ( nth > ( l - 1) ) { nth = l - 1; } while ( i <= nth ) { obj[i] = fn ? arg( obj[i] ) : arg; i++; } re...
javascript
function ( obj, arg, start, offset ) { var fn = typeof arg === "function", l = obj.length, i = !isNaN( start ) ? start : 0, nth = !isNaN( offset ) ? i + offset : l - 1; if ( nth > ( l - 1) ) { nth = l - 1; } while ( i <= nth ) { obj[i] = fn ? arg( obj[i] ) : arg; i++; } re...
[ "function", "(", "obj", ",", "arg", ",", "start", ",", "offset", ")", "{", "var", "fn", "=", "typeof", "arg", "===", "\"function\"", ",", "l", "=", "obj", ".", "length", ",", "i", "=", "!", "isNaN", "(", "start", ")", "?", "start", ":", "0", ",...
Fills `obj` with the evalution of `arg`, optionally from `start` to `offset` @method fill @param {Array} obj Array to fill @param {Mixed} arg String, Number of Function to fill with @param {Number} start [Optional] Index to begin filling at @param {Number} end [Optional] Offset from start to stop filling a...
[ "Fills", "obj", "with", "the", "evalution", "of", "arg", "optionally", "from", "start", "to", "offset" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L515-L531
36,431
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { var result = []; result = obj.reduce( function ( a, b ) { return a.concat( b ); }, result ); return result; }
javascript
function ( obj ) { var result = []; result = obj.reduce( function ( a, b ) { return a.concat( b ); }, result ); return result; }
[ "function", "(", "obj", ")", "{", "var", "result", "=", "[", "]", ";", "result", "=", "obj", ".", "reduce", "(", "function", "(", "a", ",", "b", ")", "{", "return", "a", ".", "concat", "(", "b", ")", ";", "}", ",", "result", ")", ";", "return...
Flattens a 2D Array @method flat @param {Array} obj 2D Array to flatten @return {Array} Flatten Array
[ "Flattens", "a", "2D", "Array" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L551-L559
36,432
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { var indexed = []; utility.iterate( obj, function ( v ) { indexed.push( v ); }); return indexed; }
javascript
function ( obj ) { var indexed = []; utility.iterate( obj, function ( v ) { indexed.push( v ); }); return indexed; }
[ "function", "(", "obj", ")", "{", "var", "indexed", "=", "[", "]", ";", "utility", ".", "iterate", "(", "obj", ",", "function", "(", "v", ")", "{", "indexed", ".", "push", "(", "v", ")", ";", "}", ")", ";", "return", "indexed", ";", "}" ]
Returns an Associative Array as an Indexed Array @method indexed @param {Array} obj Array to index @return {Array} Indexed Array
[ "Returns", "an", "Associative", "Array", "as", "an", "Indexed", "Array" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L591-L599
36,433
avoidwork/abaaso
lib/abaaso.js
function ( array1, array2 ) { var a = array1.length > array2.length ? array1 : array2, b = ( a === array1 ? array2 : array1 ); return a.filter( function ( key ) { return array.contains( b, key ); }); }
javascript
function ( array1, array2 ) { var a = array1.length > array2.length ? array1 : array2, b = ( a === array1 ? array2 : array1 ); return a.filter( function ( key ) { return array.contains( b, key ); }); }
[ "function", "(", "array1", ",", "array2", ")", "{", "var", "a", "=", "array1", ".", "length", ">", "array2", ".", "length", "?", "array1", ":", "array2", ",", "b", "=", "(", "a", "===", "array1", "?", "array2", ":", "array1", ")", ";", "return", ...
Finds the intersections between array1 and array2 @method intersect @param {Array} array1 Source Array @param {Array} array2 Comparison Array @return {Array} Array of the intersections
[ "Finds", "the", "intersections", "between", "array1", "and", "array2" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L609-L616
36,434
avoidwork/abaaso
lib/abaaso.js
function ( obj, arg ) { var n = obj.length - 1; if ( arg >= ( n + 1 ) ) { return obj; } else if ( isNaN( arg ) || arg === 1 ) { return obj[n]; } else { return array.limit( obj, ( n - ( --arg ) ), n ); } }
javascript
function ( obj, arg ) { var n = obj.length - 1; if ( arg >= ( n + 1 ) ) { return obj; } else if ( isNaN( arg ) || arg === 1 ) { return obj[n]; } else { return array.limit( obj, ( n - ( --arg ) ), n ); } }
[ "function", "(", "obj", ",", "arg", ")", "{", "var", "n", "=", "obj", ".", "length", "-", "1", ";", "if", "(", "arg", ">=", "(", "n", "+", "1", ")", ")", "{", "return", "obj", ";", "}", "else", "if", "(", "isNaN", "(", "arg", ")", "||", "...
Returns the last index of the Array @method last @param {Array} obj Array @param {Number} arg [Optional] Negative offset from last index to return @return {Mixed} Last index( s ) of Array
[ "Returns", "the", "last", "index", "of", "the", "Array" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L717-L729
36,435
avoidwork/abaaso
lib/abaaso.js
function ( obj, start, offset ) { var result = [], i = start - 1, nth = start + offset, max = obj.length; if ( max > 0 ) { while ( ++i < nth && i < max ) { result.push( obj[i] ); } } return result; }
javascript
function ( obj, start, offset ) { var result = [], i = start - 1, nth = start + offset, max = obj.length; if ( max > 0 ) { while ( ++i < nth && i < max ) { result.push( obj[i] ); } } return result; }
[ "function", "(", "obj", ",", "start", ",", "offset", ")", "{", "var", "result", "=", "[", "]", ",", "i", "=", "start", "-", "1", ",", "nth", "=", "start", "+", "offset", ",", "max", "=", "obj", ".", "length", ";", "if", "(", "max", ">", "0", ...
Returns a limited range of indices from the Array @method limit @param {Array} obj Array to iterate @param {Number} start Starting index @param {Number} offset Number of indices to return @return {Array} Array of indices
[ "Returns", "a", "limited", "range", "of", "indices", "from", "the", "Array" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L740-L753
36,436
avoidwork/abaaso
lib/abaaso.js
function ( obj, arg ) { array.each( arg, function ( i ) { array.add( obj, i ); }); return obj; }
javascript
function ( obj, arg ) { array.each( arg, function ( i ) { array.add( obj, i ); }); return obj; }
[ "function", "(", "obj", ",", "arg", ")", "{", "array", ".", "each", "(", "arg", ",", "function", "(", "i", ")", "{", "array", ".", "add", "(", "obj", ",", "i", ")", ";", "}", ")", ";", "return", "obj", ";", "}" ]
Merges `arg` into `obj`, excluding duplicate indices @method merge @param {Array} obj Array to receive indices @param {Array} arg Array to merge @return {Array} obj
[ "Merges", "arg", "into", "obj", "excluding", "duplicate", "indices" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L800-L806
36,437
avoidwork/abaaso
lib/abaaso.js
function ( obj1, obj2 ) { var result; result = obj1.map( function ( i, idx ) { return [i, obj2[idx]]; }); return result; }
javascript
function ( obj1, obj2 ) { var result; result = obj1.map( function ( i, idx ) { return [i, obj2[idx]]; }); return result; }
[ "function", "(", "obj1", ",", "obj2", ")", "{", "var", "result", ";", "result", "=", "obj1", ".", "map", "(", "function", "(", "i", ",", "idx", ")", "{", "return", "[", "i", ",", "obj2", "[", "idx", "]", "]", ";", "}", ")", ";", "return", "re...
Mingles Arrays and returns a 2D Array @method mingle @param {Array} obj1 Array to mingle @param {Array} obj2 Array to mingle @return {Array} 2D Array
[ "Mingles", "Arrays", "and", "returns", "a", "2D", "Array" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L827-L835
36,438
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { var values = {}, count = 0, nth = 0, mode = [], result; // Counting values array.each( obj, function ( i ) { if ( !isNaN( values[i] ) ) { values[i]++; } else { values[i] = 1; } }); // Finding the highest occurring count count = array.max...
javascript
function ( obj ) { var values = {}, count = 0, nth = 0, mode = [], result; // Counting values array.each( obj, function ( i ) { if ( !isNaN( values[i] ) ) { values[i]++; } else { values[i] = 1; } }); // Finding the highest occurring count count = array.max...
[ "function", "(", "obj", ")", "{", "var", "values", "=", "{", "}", ",", "count", "=", "0", ",", "nth", "=", "0", ",", "mode", "=", "[", "]", ",", "result", ";", "// Counting values", "array", ".", "each", "(", "obj", ",", "function", "(", "i", "...
Finds the mode value of an Array @method mode @param {Array} obj Array to parse @return {Mixed} Mode value of the Array
[ "Finds", "the", "mode", "value", "of", "an", "Array" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L844-L879
36,439
avoidwork/abaaso
lib/abaaso.js
function ( obj, arg ) { array.remove( obj, 0, obj.length ); array.each( arg, function ( i ) { obj.push( i ); }); return obj; }
javascript
function ( obj, arg ) { array.remove( obj, 0, obj.length ); array.each( arg, function ( i ) { obj.push( i ); }); return obj; }
[ "function", "(", "obj", ",", "arg", ")", "{", "array", ".", "remove", "(", "obj", ",", "0", ",", "obj", ".", "length", ")", ";", "array", ".", "each", "(", "arg", ",", "function", "(", "i", ")", "{", "obj", ".", "push", "(", "i", ")", ";", ...
Replaces the contents of `obj` with `arg` @method replace @param {Array} obj Array to modify @param {Array} arg Array to become `obj` @return {Array} New version of `obj`
[ "Replaces", "the", "contents", "of", "obj", "with", "arg" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L980-L987
36,440
avoidwork/abaaso
lib/abaaso.js
function ( obj, start, end ) { if ( isNaN( start ) ) { start = obj.index( start ); if ( start === -1 ) { return obj; } } else { start = start || 0; } var length = obj.length, remaining = obj.slice( ( end || start ) + 1 || length ); obj.length = start < 0 ? ( length + start ) : st...
javascript
function ( obj, start, end ) { if ( isNaN( start ) ) { start = obj.index( start ); if ( start === -1 ) { return obj; } } else { start = start || 0; } var length = obj.length, remaining = obj.slice( ( end || start ) + 1 || length ); obj.length = start < 0 ? ( length + start ) : st...
[ "function", "(", "obj", ",", "start", ",", "end", ")", "{", "if", "(", "isNaN", "(", "start", ")", ")", "{", "start", "=", "obj", ".", "index", "(", "start", ")", ";", "if", "(", "start", "===", "-", "1", ")", "{", "return", "obj", ";", "}", ...
Removes indices from an Array without recreating it @method remove @param {Array} obj Array to remove from @param {Mixed} start Starting index, or value to find within obj @param {Number} end [Optional] Ending index @return {Array} Modified Array
[ "Removes", "indices", "from", "an", "Array", "without", "recreating", "it" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L998-L1017
36,441
avoidwork/abaaso
lib/abaaso.js
function ( obj, fn ) { var remove; if ( typeof fn !== "function" ) { throw new Error( label.error.invalidArguments ); } remove = obj.filter( fn ); array.each( remove, function ( i ) { array.remove( obj, array.index ( obj, i ) ); }); return obj; }
javascript
function ( obj, fn ) { var remove; if ( typeof fn !== "function" ) { throw new Error( label.error.invalidArguments ); } remove = obj.filter( fn ); array.each( remove, function ( i ) { array.remove( obj, array.index ( obj, i ) ); }); return obj; }
[ "function", "(", "obj", ",", "fn", ")", "{", "var", "remove", ";", "if", "(", "typeof", "fn", "!==", "\"function\"", ")", "{", "throw", "new", "Error", "(", "label", ".", "error", ".", "invalidArguments", ")", ";", "}", "remove", "=", "obj", ".", "...
Deletes every element of `obj` for which `fn` evaluates to true @method removeIf @param {Array} obj Array to iterate @param {Function} fn Function to test indices against @return {Array} Array
[ "Deletes", "every", "element", "of", "obj", "for", "which", "fn", "evaluates", "to", "true" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1027-L1041
36,442
avoidwork/abaaso
lib/abaaso.js
function ( obj, fn ) { if ( typeof fn !== "function" ) { throw new Error( label.error.invalidArguments ); } var remove = []; array.each( obj, function ( i ) { if ( fn( i ) !== false ) { remove.push( i ); } else { return false; } }); array.each( remove, function ( i ) { array.rem...
javascript
function ( obj, fn ) { if ( typeof fn !== "function" ) { throw new Error( label.error.invalidArguments ); } var remove = []; array.each( obj, function ( i ) { if ( fn( i ) !== false ) { remove.push( i ); } else { return false; } }); array.each( remove, function ( i ) { array.rem...
[ "function", "(", "obj", ",", "fn", ")", "{", "if", "(", "typeof", "fn", "!==", "\"function\"", ")", "{", "throw", "new", "Error", "(", "label", ".", "error", ".", "invalidArguments", ")", ";", "}", "var", "remove", "=", "[", "]", ";", "array", ".",...
Deletes elements of `obj` until `fn` evaluates to false @method removeWhile @param {Array} obj Array to iterate @param {Function} fn Function to test indices against @return {Array} Array
[ "Deletes", "elements", "of", "obj", "until", "fn", "evaluates", "to", "false" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1051-L1072
36,443
avoidwork/abaaso
lib/abaaso.js
function ( obj, arg ) { arg = arg || 1; if ( arg < 1 ) { arg = 1; } return array.limit( obj, arg, obj.length ); }
javascript
function ( obj, arg ) { arg = arg || 1; if ( arg < 1 ) { arg = 1; } return array.limit( obj, arg, obj.length ); }
[ "function", "(", "obj", ",", "arg", ")", "{", "arg", "=", "arg", "||", "1", ";", "if", "(", "arg", "<", "1", ")", "{", "arg", "=", "1", ";", "}", "return", "array", ".", "limit", "(", "obj", ",", "arg", ",", "obj", ".", "length", ")", ";", ...
Returns the "rest" of `obj` from `arg` @method rest @param {Array} obj Array to parse @param {Number} arg [Optional] Start position of subset of `obj` ( positive number only ) @return {Array} Array of a subset of `obj`
[ "Returns", "the", "rest", "of", "obj", "from", "arg" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1082-L1090
36,444
avoidwork/abaaso
lib/abaaso.js
function ( obj, arg ) { var result = -1; array.each( obj, function ( i, idx ) { if ( i === arg ) { result = idx; } }); return result; }
javascript
function ( obj, arg ) { var result = -1; array.each( obj, function ( i, idx ) { if ( i === arg ) { result = idx; } }); return result; }
[ "function", "(", "obj", ",", "arg", ")", "{", "var", "result", "=", "-", "1", ";", "array", ".", "each", "(", "obj", ",", "function", "(", "i", ",", "idx", ")", "{", "if", "(", "i", "===", "arg", ")", "{", "result", "=", "idx", ";", "}", "}...
Finds the last index of `arg` in `obj` @method rindex @param {Array} obj Array to search @param {Mixed} arg Primitive to find @return {Mixed} Index or undefined
[ "Finds", "the", "last", "index", "of", "arg", "in", "obj" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1100-L1110
36,445
avoidwork/abaaso
lib/abaaso.js
function ( obj, arg ) { var nth = obj.length, result; if ( arg === 0 ) { result = obj; } else { if ( arg < 0 ) { arg += nth; } else { arg--; } result = array.limit( obj, arg, nth ); result = result.concat( array.limit( obj, 0, arg ) ); } return result; }
javascript
function ( obj, arg ) { var nth = obj.length, result; if ( arg === 0 ) { result = obj; } else { if ( arg < 0 ) { arg += nth; } else { arg--; } result = array.limit( obj, arg, nth ); result = result.concat( array.limit( obj, 0, arg ) ); } return result; }
[ "function", "(", "obj", ",", "arg", ")", "{", "var", "nth", "=", "obj", ".", "length", ",", "result", ";", "if", "(", "arg", "===", "0", ")", "{", "result", "=", "obj", ";", "}", "else", "{", "if", "(", "arg", "<", "0", ")", "{", "arg", "+=...
Returns new Array with `arg` moved to the first index @method rotate @param {Array} obj Array to rotate @param {Number} arg Index to become the first index, if negative the rotation is in the opposite direction @return {Array} Newly rotated Array
[ "Returns", "new", "Array", "with", "arg", "moved", "to", "the", "first", "index" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1120-L1140
36,446
avoidwork/abaaso
lib/abaaso.js
function ( start, end, offset ) { start = start || 0; end = end || start; offset = offset || 1; var result = [], n = -1, nth = Math.max( 0, Math.ceil( ( end - start ) / offset ) ); while ( ++n < nth ) { result[n] = start; start += offset; } return resul...
javascript
function ( start, end, offset ) { start = start || 0; end = end || start; offset = offset || 1; var result = [], n = -1, nth = Math.max( 0, Math.ceil( ( end - start ) / offset ) ); while ( ++n < nth ) { result[n] = start; start += offset; } return resul...
[ "function", "(", "start", ",", "end", ",", "offset", ")", "{", "start", "=", "start", "||", "0", ";", "end", "=", "end", "||", "start", ";", "offset", "=", "offset", "||", "1", ";", "var", "result", "=", "[", "]", ",", "n", "=", "-", "1", ","...
Generates a series Array @method series @param {Number} start Start value the series @param {Number} end [Optional] The end of the series @param {Number} offset [Optional] Offset for indices, default is 1 @return {Array} Array of new series
[ "Generates", "a", "series", "Array" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1151-L1165
36,447
avoidwork/abaaso
lib/abaaso.js
function ( obj, divisor ) { var result = [], total = obj.length, nth = Math.ceil( total / divisor ), low = Math.floor( total / divisor ), lower = Math.ceil( total / nth ), lowered = false, start = 0, i = -1; // Finding the fold if ( number.diff( tota...
javascript
function ( obj, divisor ) { var result = [], total = obj.length, nth = Math.ceil( total / divisor ), low = Math.floor( total / divisor ), lower = Math.ceil( total / nth ), lowered = false, start = 0, i = -1; // Finding the fold if ( number.diff( tota...
[ "function", "(", "obj", ",", "divisor", ")", "{", "var", "result", "=", "[", "]", ",", "total", "=", "obj", ".", "length", ",", "nth", "=", "Math", ".", "ceil", "(", "total", "/", "divisor", ")", ",", "low", "=", "Math", ".", "floor", "(", "tot...
Splits an Array by divisor @method split @param {Array} obj Array to parse @param {Number} divisor Integer to divide the Array by @return {Array} Split Array
[ "Splits", "an", "Array", "by", "divisor" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1175-L1207
36,448
avoidwork/abaaso
lib/abaaso.js
function ( a, b ) { var types = {a: typeof a, b: typeof b}, c, d, result; if ( types.a === "number" && types.b === "number" ) { result = a - b; } else { c = a.toString(); d = b.toString(); if ( c < d ) { result = -1; } else if ( c > d ) { result = 1; } else if ( types.a =...
javascript
function ( a, b ) { var types = {a: typeof a, b: typeof b}, c, d, result; if ( types.a === "number" && types.b === "number" ) { result = a - b; } else { c = a.toString(); d = b.toString(); if ( c < d ) { result = -1; } else if ( c > d ) { result = 1; } else if ( types.a =...
[ "function", "(", "a", ",", "b", ")", "{", "var", "types", "=", "{", "a", ":", "typeof", "a", ",", "b", ":", "typeof", "b", "}", ",", "c", ",", "d", ",", "result", ";", "if", "(", "types", ".", "a", "===", "\"number\"", "&&", "types", ".", "...
Sorts the Array by parsing values @method sort @param {Mixed} a Argument to compare @param {Mixed} b Argument to compare @return {Number} Number indicating sort order
[ "Sorts", "the", "Array", "by", "parsing", "values" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1217-L1246
36,449
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { var result = 0; if ( obj.length > 0 ) { result = obj.reduce( function ( prev, cur ) { return prev + cur; }); } return result; }
javascript
function ( obj ) { var result = 0; if ( obj.length > 0 ) { result = obj.reduce( function ( prev, cur ) { return prev + cur; }); } return result; }
[ "function", "(", "obj", ")", "{", "var", "result", "=", "0", ";", "if", "(", "obj", ".", "length", ">", "0", ")", "{", "result", "=", "obj", ".", "reduce", "(", "function", "(", "prev", ",", "cur", ")", "{", "return", "prev", "+", "cur", ";", ...
Gets the summation of an Array of numbers @method sum @param {Array} obj Array to sum @return {Number} Summation of Array
[ "Gets", "the", "summation", "of", "an", "Array", "of", "numbers" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1277-L1287
36,450
avoidwork/abaaso
lib/abaaso.js
function ( ar ) { var obj = {}, i = ar.length; while ( i-- ) { obj[i.toString()] = ar[i]; } return obj; }
javascript
function ( ar ) { var obj = {}, i = ar.length; while ( i-- ) { obj[i.toString()] = ar[i]; } return obj; }
[ "function", "(", "ar", ")", "{", "var", "obj", "=", "{", "}", ",", "i", "=", "ar", ".", "length", ";", "while", "(", "i", "--", ")", "{", "obj", "[", "i", ".", "toString", "(", ")", "]", "=", "ar", "[", "i", "]", ";", "}", "return", "obj"...
Casts an Array to Object @method toObject @param {Array} ar Array to transform @return {Object} New object
[ "Casts", "an", "Array", "to", "Object" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1319-L1328
36,451
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { var result = []; array.each( obj, function ( i ) { array.add( result, i ); }); return result; }
javascript
function ( obj ) { var result = []; array.each( obj, function ( i ) { array.add( result, i ); }); return result; }
[ "function", "(", "obj", ")", "{", "var", "result", "=", "[", "]", ";", "array", ".", "each", "(", "obj", ",", "function", "(", "i", ")", "{", "array", ".", "add", "(", "result", ",", "i", ")", ";", "}", ")", ";", "return", "result", ";", "}" ...
Returns an Array of unique indices of `obj` @method unique @param {Array} obj Array to parse @return {Array} Array of unique indices
[ "Returns", "an", "Array", "of", "unique", "indices", "of", "obj" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1337-L1345
36,452
avoidwork/abaaso
lib/abaaso.js
function ( obj, args ) { var result = []; // Preparing args if ( !(args instanceof Array) ) { args = typeof args === "object" ? array.cast( args ) : [args]; } array.each( args, function ( i, idx ) { if ( !( i instanceof Array ) ) { this[idx] = [i]; } }); // Building result Array array.ea...
javascript
function ( obj, args ) { var result = []; // Preparing args if ( !(args instanceof Array) ) { args = typeof args === "object" ? array.cast( args ) : [args]; } array.each( args, function ( i, idx ) { if ( !( i instanceof Array ) ) { this[idx] = [i]; } }); // Building result Array array.ea...
[ "function", "(", "obj", ",", "args", ")", "{", "var", "result", "=", "[", "]", ";", "// Preparing args", "if", "(", "!", "(", "args", "instanceof", "Array", ")", ")", "{", "args", "=", "typeof", "args", "===", "\"object\"", "?", "array", ".", "cast",...
Converts any arguments to Arrays, then merges elements of `obj` with corresponding elements from each argument @method zip @param {Array} obj Array to transform @param {Mixed} args Argument instance or Array to merge @return {Array} Array
[ "Converts", "any", "arguments", "to", "Arrays", "then", "merges", "elements", "of", "obj", "with", "corresponding", "elements", "from", "each", "argument" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1381-L1404
36,453
avoidwork/abaaso
lib/abaaso.js
function () { return utility.iterate( cache.items, function ( v, k ) { if ( cache.expired( k ) ) { cache.expire( k, true ); } }); }
javascript
function () { return utility.iterate( cache.items, function ( v, k ) { if ( cache.expired( k ) ) { cache.expire( k, true ); } }); }
[ "function", "(", ")", "{", "return", "utility", ".", "iterate", "(", "cache", ".", "items", ",", "function", "(", "v", ",", "k", ")", "{", "if", "(", "cache", ".", "expired", "(", "k", ")", ")", "{", "cache", ".", "expire", "(", "k", ",", "true...
Garbage collector for the cached items @method clean @private @return {Undefined} undefined
[ "Garbage", "collector", "for", "the", "cached", "items" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1419-L1425
36,454
avoidwork/abaaso
lib/abaaso.js
function ( uri, silent ) { silent = ( silent === true ); if ( cache.items[uri] !== undefined ) { delete cache.items[uri]; if ( !silent ) { observer.fire( uri, "beforeExpire, expire, afterExpire" ); } return true; } else { return false; } }
javascript
function ( uri, silent ) { silent = ( silent === true ); if ( cache.items[uri] !== undefined ) { delete cache.items[uri]; if ( !silent ) { observer.fire( uri, "beforeExpire, expire, afterExpire" ); } return true; } else { return false; } }
[ "function", "(", "uri", ",", "silent", ")", "{", "silent", "=", "(", "silent", "===", "true", ")", ";", "if", "(", "cache", ".", "items", "[", "uri", "]", "!==", "undefined", ")", "{", "delete", "cache", ".", "items", "[", "uri", "]", ";", "if", ...
Expires a URI from the local cache Events: expire Fires when the URI expires @method expire @private @param {String} uri URI of the local representation @param {Boolean} silent [Optional] If 'true', the event will not fire @return {Undefined} undefined
[ "Expires", "a", "URI", "from", "the", "local", "cache" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1438-L1452
36,455
avoidwork/abaaso
lib/abaaso.js
function ( uri ) { var item = cache.items[uri]; return item !== undefined && item.expires !== undefined && item.expires < new Date(); }
javascript
function ( uri ) { var item = cache.items[uri]; return item !== undefined && item.expires !== undefined && item.expires < new Date(); }
[ "function", "(", "uri", ")", "{", "var", "item", "=", "cache", ".", "items", "[", "uri", "]", ";", "return", "item", "!==", "undefined", "&&", "item", ".", "expires", "!==", "undefined", "&&", "item", ".", "expires", "<", "new", "Date", "(", ")", "...
Determines if a URI has expired @method expired @private @param {Object} uri Cached URI object @return {Boolean} True if the URI has expired
[ "Determines", "if", "a", "URI", "has", "expired" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1462-L1466
36,456
avoidwork/abaaso
lib/abaaso.js
function ( uri, property, value ) { uri = utility.parse( uri ).href; if ( cache.items[uri] === undefined ) { cache.items[uri] = {}; cache.items[uri].permission = 0; } if ( property === "permission" ) { cache.items[uri].permission |= value; } else if ( property === "!permission" ) { cache.items...
javascript
function ( uri, property, value ) { uri = utility.parse( uri ).href; if ( cache.items[uri] === undefined ) { cache.items[uri] = {}; cache.items[uri].permission = 0; } if ( property === "permission" ) { cache.items[uri].permission |= value; } else if ( property === "!permission" ) { cache.items...
[ "function", "(", "uri", ",", "property", ",", "value", ")", "{", "uri", "=", "utility", ".", "parse", "(", "uri", ")", ".", "href", ";", "if", "(", "cache", ".", "items", "[", "uri", "]", "===", "undefined", ")", "{", "cache", ".", "items", "[", ...
Sets, or updates an item in cache.items @method set @private @param {String} uri URI to set or update @param {String} property Property of the cached URI to set @param {Mixed} value Value to set @return {Mixed} URI Object {headers, response} or undefined
[ "Sets", "or", "updates", "an", "item", "in", "cache", ".", "items" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1505-L1524
36,457
avoidwork/abaaso
lib/abaaso.js
function ( uri, verb ) { if ( string.isEmpty( uri ) || string.isEmpty( verb ) ) { throw new Error( label.error.invalidArguments ); } uri = utility.parse( uri ).href; verb = verb.toLowerCase(); var result = false, bit = 0; if ( !cache.get( uri, false ) ) { result = undefined; ...
javascript
function ( uri, verb ) { if ( string.isEmpty( uri ) || string.isEmpty( verb ) ) { throw new Error( label.error.invalidArguments ); } uri = utility.parse( uri ).href; verb = verb.toLowerCase(); var result = false, bit = 0; if ( !cache.get( uri, false ) ) { result = undefined; ...
[ "function", "(", "uri", ",", "verb", ")", "{", "if", "(", "string", ".", "isEmpty", "(", "uri", ")", "||", "string", ".", "isEmpty", "(", "verb", ")", ")", "{", "throw", "new", "Error", "(", "label", ".", "error", ".", "invalidArguments", ")", ";",...
Quick way to see if a URI allows a specific verb @method allows @param {String} uri URI to query @param {String} verb HTTP verb @return {Boolean} `true` if the verb is allowed, undefined if unknown
[ "Quick", "way", "to", "see", "if", "a", "URI", "allows", "a", "specific", "verb" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1816-L1847
36,458
avoidwork/abaaso
lib/abaaso.js
function ( args ) { var result = 0; array.each( args, function ( verb ) { verb = verb.toLowerCase(); if ( regex.get_headers.test( verb ) ) { result |= 4; } else if ( regex.put_post.test( verb ) ) { result |= 2; } else if ( regex.patch.test( verb ) ) { result |= 8; } else if ( r...
javascript
function ( args ) { var result = 0; array.each( args, function ( verb ) { verb = verb.toLowerCase(); if ( regex.get_headers.test( verb ) ) { result |= 4; } else if ( regex.put_post.test( verb ) ) { result |= 2; } else if ( regex.patch.test( verb ) ) { result |= 8; } else if ( r...
[ "function", "(", "args", ")", "{", "var", "result", "=", "0", ";", "array", ".", "each", "(", "args", ",", "function", "(", "verb", ")", "{", "verb", "=", "verb", ".", "toLowerCase", "(", ")", ";", "if", "(", "regex", ".", "get_headers", ".", "te...
Gets bit value based on args @method bit @param {Array} args Array of commands the URI accepts @return {Number} To be set as a bit
[ "Gets", "bit", "value", "based", "on", "args" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1856-L1877
36,459
avoidwork/abaaso
lib/abaaso.js
function ( xhr, uri, type ) { var headers = string.trim( xhr.getAllResponseHeaders() ).split( "\n" ), items = {}, o = {}, allow = null, expires = new Date(), cors = client.cors( uri ); array.each( headers, function ( i ) { var header, value; value = i.repla...
javascript
function ( xhr, uri, type ) { var headers = string.trim( xhr.getAllResponseHeaders() ).split( "\n" ), items = {}, o = {}, allow = null, expires = new Date(), cors = client.cors( uri ); array.each( headers, function ( i ) { var header, value; value = i.repla...
[ "function", "(", "xhr", ",", "uri", ",", "type", ")", "{", "var", "headers", "=", "string", ".", "trim", "(", "xhr", ".", "getAllResponseHeaders", "(", ")", ")", ".", "split", "(", "\"\\n\"", ")", ",", "items", "=", "{", "}", ",", "o", "=", "{", ...
Caches the headers from the XHR response @method headers @param {Object} xhr XMLHttpRequest Object @param {String} uri URI to request @param {String} type Type of request @return {Object} Cached URI representation
[ "Caches", "the", "headers", "from", "the", "XHR", "response" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1899-L1946
36,460
avoidwork/abaaso
lib/abaaso.js
function ( xhr, type ) { type = type || ""; var result, obj; if ( ( regex.json_maybe.test( type ) || string.isEmpty( type ) ) && ( regex.json_wrap.test( xhr.responseText ) && Boolean( obj = json.decode( xhr.responseText, true ) ) ) ) { result = obj; } else if ( regex.xml.test( type ) ) { if ( type !== ...
javascript
function ( xhr, type ) { type = type || ""; var result, obj; if ( ( regex.json_maybe.test( type ) || string.isEmpty( type ) ) && ( regex.json_wrap.test( xhr.responseText ) && Boolean( obj = json.decode( xhr.responseText, true ) ) ) ) { result = obj; } else if ( regex.xml.test( type ) ) { if ( type !== ...
[ "function", "(", "xhr", ",", "type", ")", "{", "type", "=", "type", "||", "\"\"", ";", "var", "result", ",", "obj", ";", "if", "(", "(", "regex", ".", "json_maybe", ".", "test", "(", "type", ")", "||", "string", ".", "isEmpty", "(", "type", ")", ...
Parses an XHR response @method parse @param {Object} xhr XHR Object @param {String} type [Optional] Content-Type header value @return {Mixed} Array, Boolean, Document, Number, Object or String
[ "Parses", "an", "XHR", "response" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1956-L1978
36,461
avoidwork/abaaso
lib/abaaso.js
function ( uri ) { var cached = cache.get( uri, false ), bit = !cached ? 0 : cached.permission, result = {allows: [], bit: bit, map: {partial: 8, read: 4, write: 2, "delete": 1, unknown: 0}}; if ( bit & 1) { result.allows.push( "DELETE" ); } if ( bit & 2) { result.allows.push( "POST" ); ...
javascript
function ( uri ) { var cached = cache.get( uri, false ), bit = !cached ? 0 : cached.permission, result = {allows: [], bit: bit, map: {partial: 8, read: 4, write: 2, "delete": 1, unknown: 0}}; if ( bit & 1) { result.allows.push( "DELETE" ); } if ( bit & 2) { result.allows.push( "POST" ); ...
[ "function", "(", "uri", ")", "{", "var", "cached", "=", "cache", ".", "get", "(", "uri", ",", "false", ")", ",", "bit", "=", "!", "cached", "?", "0", ":", "cached", ".", "permission", ",", "result", "=", "{", "allows", ":", "[", "]", ",", "bit"...
Returns the permission of the cached URI @method permissions @param {String} uri URI to query @return {Object} Contains an Array of available commands, the permission bit and a map
[ "Returns", "the", "permission", "of", "the", "cached", "URI" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L1987-L2010
36,462
avoidwork/abaaso
lib/abaaso.js
function ( uri, success, failure, args ) { var defer = deferred(), callback = "callback", cbid, s; if ( external === undefined ) { if ( global.abaaso === undefined ) { utility.define( "abaaso.callback", {}, global ); } external = "abaaso"; } if ( args instanceof Object && args.callback ...
javascript
function ( uri, success, failure, args ) { var defer = deferred(), callback = "callback", cbid, s; if ( external === undefined ) { if ( global.abaaso === undefined ) { utility.define( "abaaso.callback", {}, global ); } external = "abaaso"; } if ( args instanceof Object && args.callback ...
[ "function", "(", "uri", ",", "success", ",", "failure", ",", "args", ")", "{", "var", "defer", "=", "deferred", "(", ")", ",", "callback", "=", "\"callback\"", ",", "cbid", ",", "s", ";", "if", "(", "external", "===", "undefined", ")", "{", "if", "...
Creates a JSONP request @method jsonp @param {String} uri URI to request @param {Function} success A handler function to execute when an appropriate response been received @param {Function} failure [Optional] A handler function to execute on error @param {Mixed} args Custom JSONP handler parameter name...
[ "Creates", "a", "JSONP", "request" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L2022-L2072
36,463
avoidwork/abaaso
lib/abaaso.js
function ( arg, target, pos ) { return element.create( "script", {type: "application/javascript", src: arg}, target || utility.$( "head" )[0], pos ); }
javascript
function ( arg, target, pos ) { return element.create( "script", {type: "application/javascript", src: arg}, target || utility.$( "head" )[0], pos ); }
[ "function", "(", "arg", ",", "target", ",", "pos", ")", "{", "return", "element", ".", "create", "(", "\"script\"", ",", "{", "type", ":", "\"application/javascript\"", ",", "src", ":", "arg", "}", ",", "target", "||", "utility", ".", "$", "(", "\"head...
Creates a script Element to load an external script @method script @param {String} arg URL to script @param {Object} target [Optional] Element to receive the script @param {String} pos [Optional] Position to create the script at within the target @return {Object} Script
[ "Creates", "a", "script", "Element", "to", "load", "an", "external", "script" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L2431-L2433
36,464
avoidwork/abaaso
lib/abaaso.js
function ( dest, ms ) { var defer = deferred(), start = client.scrollPos(), t = 0; ms = ( !isNaN( ms ) ? ms : 250 ) / 100; utility.repeat( function () { var pos = math.bezier( start[0], start[1], dest[0], dest[1], ++t / 100 ); window.scrollTo( pos[0], pos[1] ); if ( t === 100 ) { ...
javascript
function ( dest, ms ) { var defer = deferred(), start = client.scrollPos(), t = 0; ms = ( !isNaN( ms ) ? ms : 250 ) / 100; utility.repeat( function () { var pos = math.bezier( start[0], start[1], dest[0], dest[1], ++t / 100 ); window.scrollTo( pos[0], pos[1] ); if ( t === 100 ) { ...
[ "function", "(", "dest", ",", "ms", ")", "{", "var", "defer", "=", "deferred", "(", ")", ",", "start", "=", "client", ".", "scrollPos", "(", ")", ",", "t", "=", "0", ";", "ms", "=", "(", "!", "isNaN", "(", "ms", ")", "?", "ms", ":", "250", ...
Scrolls to a position in the view using a two point bezier curve @method scroll @param {Array} dest Coordinates @param {Number} ms [Optional] Milliseconds to scroll, default is 250, min is 100 @return {Object} Deferred
[ "Scrolls", "to", "a", "position", "in", "the", "view", "using", "a", "two", "point", "bezier", "curve" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L2443-L2462
36,465
avoidwork/abaaso
lib/abaaso.js
function ( arg, media ) { return element.create( "link", {rel: "stylesheet", type: "text/css", href: arg, media: media || "print, screen"}, utility.$( "head" )[0] ); }
javascript
function ( arg, media ) { return element.create( "link", {rel: "stylesheet", type: "text/css", href: arg, media: media || "print, screen"}, utility.$( "head" )[0] ); }
[ "function", "(", "arg", ",", "media", ")", "{", "return", "element", ".", "create", "(", "\"link\"", ",", "{", "rel", ":", "\"stylesheet\"", ",", "type", ":", "\"text/css\"", ",", "href", ":", "arg", ",", "media", ":", "media", "||", "\"print, screen\"",...
Creates a link Element to load an external stylesheet @method stylesheet @param {String} arg URL to stylesheet @param {String} media [Optional] Medias the stylesheet applies to @return {Objecct} Stylesheet
[ "Creates", "a", "link", "Element", "to", "load", "an", "external", "stylesheet" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L2498-L2500
36,466
avoidwork/abaaso
lib/abaaso.js
function ( name, domain, secure, path, jar ) { cookie.set( name, "", "-1s", domain, secure, path, jar ); return name; }
javascript
function ( name, domain, secure, path, jar ) { cookie.set( name, "", "-1s", domain, secure, path, jar ); return name; }
[ "function", "(", "name", ",", "domain", ",", "secure", ",", "path", ",", "jar", ")", "{", "cookie", ".", "set", "(", "name", ",", "\"\"", ",", "\"-1s\"", ",", "domain", ",", "secure", ",", "path", ",", "jar", ")", ";", "return", "name", ";", "}" ...
Expires a cookie if it exists @method expire @param {String} name Name of the cookie to expire @param {String} domain [Optional] Domain to set the cookie for @param {Boolean} secure [Optional] Make the cookie only accessible via SSL @param {String} path [Optional] Path the cookie is for @param {String} ja...
[ "Expires", "a", "cookie", "if", "it", "exists" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L2516-L2520
36,467
avoidwork/abaaso
lib/abaaso.js
function ( jar ) { var result = {}; if ( jar === undefined ) { jar = server ? "" : document.cookie; } if ( !string.isEmpty( jar ) ) { array.each( string.explode( jar, ";" ), function ( i ) { var item = string.explode( i, "=" ); result[item[0]] = utility.coerce( item[1] ); } ); } return ...
javascript
function ( jar ) { var result = {}; if ( jar === undefined ) { jar = server ? "" : document.cookie; } if ( !string.isEmpty( jar ) ) { array.each( string.explode( jar, ";" ), function ( i ) { var item = string.explode( i, "=" ); result[item[0]] = utility.coerce( item[1] ); } ); } return ...
[ "function", "(", "jar", ")", "{", "var", "result", "=", "{", "}", ";", "if", "(", "jar", "===", "undefined", ")", "{", "jar", "=", "server", "?", "\"\"", ":", "document", ".", "cookie", ";", "}", "if", "(", "!", "string", ".", "isEmpty", "(", "...
Gets the cookies for the domain @method list @param {String} jar [Optional] Cookie jar, defaults to document.cookie @return {Object} Collection of cookies
[ "Gets", "the", "cookies", "for", "the", "domain" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L2541-L2557
36,468
avoidwork/abaaso
lib/abaaso.js
function ( name, value, offset, domain, secure, path, jar ) { value = ( value || "" ) + ";"; offset = offset || ""; domain = typeof domain === "string" ? ( " Domain=" + domain + ";" ) : ""; secure = ( secure === true ) ? " secure" : ""; path = typeof path === "string" ? ( " Path=" + pat...
javascript
function ( name, value, offset, domain, secure, path, jar ) { value = ( value || "" ) + ";"; offset = offset || ""; domain = typeof domain === "string" ? ( " Domain=" + domain + ";" ) : ""; secure = ( secure === true ) ? " secure" : ""; path = typeof path === "string" ? ( " Path=" + pat...
[ "function", "(", "name", ",", "value", ",", "offset", ",", "domain", ",", "secure", ",", "path", ",", "jar", ")", "{", "value", "=", "(", "value", "||", "\"\"", ")", "+", "\";\"", ";", "offset", "=", "offset", "||", "\"\"", ";", "domain", "=", "t...
Creates a cookie The offset specifies a positive or negative span of time as day, hour, minute or second @method set @param {String} name Name of the cookie to create @param {String} value Value to set @param {String} offset A positive or negative integer followed by "d", "h", "m" or "s" @param {String} do...
[ "Creates", "a", "cookie" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L2574-L2631
36,469
avoidwork/abaaso
lib/abaaso.js
function ( obj, recs, args ) { utility.genId( obj ); // Decorating observer if not present in prototype chain if ( typeof obj.fire !== "function" ) { observer.decorate( obj ); } // Creating store obj.data = new DataStore( obj ); if ( args instanceof Object ) { utility.merge( obj.data, args ); } if ( re...
javascript
function ( obj, recs, args ) { utility.genId( obj ); // Decorating observer if not present in prototype chain if ( typeof obj.fire !== "function" ) { observer.decorate( obj ); } // Creating store obj.data = new DataStore( obj ); if ( args instanceof Object ) { utility.merge( obj.data, args ); } if ( re...
[ "function", "(", "obj", ",", "recs", ",", "args", ")", "{", "utility", ".", "genId", "(", "obj", ")", ";", "// Decorating observer if not present in prototype chain", "if", "(", "typeof", "obj", ".", "fire", "!==", "\"function\"", ")", "{", "observer", ".", ...
Decorates a DataStore on an Object @method decorator @param {Object} obj Object @param {Mixed} recs [Optional] Data to set with this.batch @param {Object} args [Optional] Arguments to set on the store @return {Object} Decorated Object
[ "Decorates", "a", "DataStore", "on", "an", "Object" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L2643-L2663
36,470
avoidwork/abaaso
lib/abaaso.js
function ( obj, key, value ) { var target, result; if ( regex.svg.test( obj.namespaceURI ) ) { if ( value === undefined ) { result = obj.getAttributeNS( obj.namespaceURI, key ); if ( result === null || string.isEmpty( result ) ) { result = undefined; } else { result = utility.coerce( ...
javascript
function ( obj, key, value ) { var target, result; if ( regex.svg.test( obj.namespaceURI ) ) { if ( value === undefined ) { result = obj.getAttributeNS( obj.namespaceURI, key ); if ( result === null || string.isEmpty( result ) ) { result = undefined; } else { result = utility.coerce( ...
[ "function", "(", "obj", ",", "key", ",", "value", ")", "{", "var", "target", ",", "result", ";", "if", "(", "regex", ".", "svg", ".", "test", "(", "obj", ".", "namespaceURI", ")", ")", "{", "if", "(", "value", "===", "undefined", ")", "{", "resul...
Gets or sets an Element attribute @method attr @param {Mixed} obj Element @param {String} name Attribute name @param {Mixed} value Attribute value @return {Object} Element
[ "Gets", "or", "sets", "an", "Element", "attribute" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L4926-L4988
36,471
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { if ( typeof obj.reset === "function" ) { obj.reset(); } else if ( obj.value !== undefined ) { element.update( obj, {innerHTML: "", value: ""} ); } else { element.update( obj, {innerHTML: ""} ); } return obj; }
javascript
function ( obj ) { if ( typeof obj.reset === "function" ) { obj.reset(); } else if ( obj.value !== undefined ) { element.update( obj, {innerHTML: "", value: ""} ); } else { element.update( obj, {innerHTML: ""} ); } return obj; }
[ "function", "(", "obj", ")", "{", "if", "(", "typeof", "obj", ".", "reset", "===", "\"function\"", ")", "{", "obj", ".", "reset", "(", ")", ";", "}", "else", "if", "(", "obj", ".", "value", "!==", "undefined", ")", "{", "element", ".", "update", ...
Clears an object's innerHTML, or resets it's state @method clear @param {Mixed} obj Element @return {Object} Element
[ "Clears", "an", "object", "s", "innerHTML", "or", "resets", "it", "s", "state" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L4997-L5009
36,472
avoidwork/abaaso
lib/abaaso.js
function ( type, args, target, pos ) { var svg = false, frag = false, obj, uid, result; // Removing potential HTML template formatting type = type.replace( /\t|\n|\r/g, "" ); if ( target !== undefined ) { svg = ( target.namespaceURI !== undefined && regex.svg.test( target.namespaceURI ) ); }...
javascript
function ( type, args, target, pos ) { var svg = false, frag = false, obj, uid, result; // Removing potential HTML template formatting type = type.replace( /\t|\n|\r/g, "" ); if ( target !== undefined ) { svg = ( target.namespaceURI !== undefined && regex.svg.test( target.namespaceURI ) ); }...
[ "function", "(", "type", ",", "args", ",", "target", ",", "pos", ")", "{", "var", "svg", "=", "false", ",", "frag", "=", "false", ",", "obj", ",", "uid", ",", "result", ";", "// Removing potential HTML template formatting", "type", "=", "type", ".", "rep...
Creates an Element in document.body or a target Element An id is generated if not specified with args @method create @param {String} type Type of Element to create @param {Object} args [Optional] Collection of properties to apply to the new element @param {Mixed} target [Optional] Target Element @param {Mixe...
[ "Creates", "an", "Element", "in", "document", ".", "body", "or", "a", "target", "Element" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5023-L5099
36,473
avoidwork/abaaso
lib/abaaso.js
function ( obj, key, value ) { key = string.toCamelCase( key ); if ( value !== undefined ) { obj.style[key] = value; return obj; } else { return obj.style[key]; } }
javascript
function ( obj, key, value ) { key = string.toCamelCase( key ); if ( value !== undefined ) { obj.style[key] = value; return obj; } else { return obj.style[key]; } }
[ "function", "(", "obj", ",", "key", ",", "value", ")", "{", "key", "=", "string", ".", "toCamelCase", "(", "key", ")", ";", "if", "(", "value", "!==", "undefined", ")", "{", "obj", ".", "style", "[", "key", "]", "=", "value", ";", "return", "obj"...
Gets or sets a CSS style attribute on an Element @method css @param {Mixed} obj Element @param {String} key CSS to put in a style tag @param {String} value [Optional] Value to set @return {Object} Element
[ "Gets", "or", "sets", "a", "CSS", "style", "attribute", "on", "an", "Element" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5110-L5120
36,474
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { observer.remove( obj ); if ( obj.parentNode !== null ) { obj.parentNode.removeChild( obj ); } return undefined; }
javascript
function ( obj ) { observer.remove( obj ); if ( obj.parentNode !== null ) { obj.parentNode.removeChild( obj ); } return undefined; }
[ "function", "(", "obj", ")", "{", "observer", ".", "remove", "(", "obj", ")", ";", "if", "(", "obj", ".", "parentNode", "!==", "null", ")", "{", "obj", ".", "parentNode", ".", "removeChild", "(", "obj", ")", ";", "}", "return", "undefined", ";", "}...
Destroys an Element @method destroy @param {Mixed} obj Element @return {Undefined} undefined
[ "Destroys", "an", "Element" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5148-L5156
36,475
avoidwork/abaaso
lib/abaaso.js
function ( obj, arg ) { var result = []; utility.genId( obj, true ); array.each( string.explode( arg ), function ( i ) { result = result.concat( utility.$( "#" + obj.id + " " + i ) ); }); return result; }
javascript
function ( obj, arg ) { var result = []; utility.genId( obj, true ); array.each( string.explode( arg ), function ( i ) { result = result.concat( utility.$( "#" + obj.id + " " + i ) ); }); return result; }
[ "function", "(", "obj", ",", "arg", ")", "{", "var", "result", "=", "[", "]", ";", "utility", ".", "genId", "(", "obj", ",", "true", ")", ";", "array", ".", "each", "(", "string", ".", "explode", "(", "arg", ")", ",", "function", "(", "i", ")",...
Finds descendant childNodes of Element matched by arg @method find @param {Mixed} obj Element to search @param {String} arg Comma delimited string of descendant selectors @return {Mixed} Array of Elements or undefined
[ "Finds", "descendant", "childNodes", "of", "Element", "matched", "by", "arg" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5257-L5267
36,476
avoidwork/abaaso
lib/abaaso.js
function ( arg ) { var obj = document.createDocumentFragment(); if ( arg ) { array.each( array.cast( element.create( "div", {innerHTML: arg}, obj ).childNodes ), function ( i ) { obj.appendChild( i ); }); obj.removeChild( obj.childNodes[0] ); } return obj; }
javascript
function ( arg ) { var obj = document.createDocumentFragment(); if ( arg ) { array.each( array.cast( element.create( "div", {innerHTML: arg}, obj ).childNodes ), function ( i ) { obj.appendChild( i ); }); obj.removeChild( obj.childNodes[0] ); } return obj; }
[ "function", "(", "arg", ")", "{", "var", "obj", "=", "document", ".", "createDocumentFragment", "(", ")", ";", "if", "(", "arg", ")", "{", "array", ".", "each", "(", "array", ".", "cast", "(", "element", ".", "create", "(", "\"div\"", ",", "{", "in...
Creates a document fragment @method frag @param {String} arg [Optional] innerHTML @return {Object} Document fragment
[ "Creates", "a", "document", "fragment" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5276-L5288
36,477
avoidwork/abaaso
lib/abaaso.js
function ( obj, arg ) { var result = element.find( obj, arg ); return ( !isNaN( result.length ) && result.length > 0 ); }
javascript
function ( obj, arg ) { var result = element.find( obj, arg ); return ( !isNaN( result.length ) && result.length > 0 ); }
[ "function", "(", "obj", ",", "arg", ")", "{", "var", "result", "=", "element", ".", "find", "(", "obj", ",", "arg", ")", ";", "return", "(", "!", "isNaN", "(", "result", ".", "length", ")", "&&", "result", ".", "length", ">", "0", ")", ";", "}"...
Determines if Element has descendants matching arg @method has @param {Mixed} obj Element or Array of Elements or $ queries @param {String} arg Type of Element to find @return {Boolean} True if 1 or more Elements are found
[ "Determines", "if", "Element", "has", "descendants", "matching", "arg" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5298-L5302
36,478
avoidwork/abaaso
lib/abaaso.js
function ( obj, arg ) { if ( arg === undefined ) { return obj.innerHTML; } else { obj.innerHTML = arg; return obj; } }
javascript
function ( obj, arg ) { if ( arg === undefined ) { return obj.innerHTML; } else { obj.innerHTML = arg; return obj; } }
[ "function", "(", "obj", ",", "arg", ")", "{", "if", "(", "arg", "===", "undefined", ")", "{", "return", "obj", ".", "innerHTML", ";", "}", "else", "{", "obj", ".", "innerHTML", "=", "arg", ";", "return", "obj", ";", "}", "}" ]
Gets or sets an Elements innerHTML @method html @param {Object} obj Element @param {String} arg [Optional] innerHTML value @return {Object} Element
[ "Gets", "or", "sets", "an", "Elements", "innerHTML" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5334-L5342
36,479
avoidwork/abaaso
lib/abaaso.js
function ( obj, arg ) { if ( regex.selector_is.test( arg ) ) { utility.id( obj ); return ( element.find( obj.parentNode, obj.nodeName.toLowerCase() + arg ).filter( function ( i ) { return ( i.id === obj.id ); }).length === 1 ); } else { return new RegExp( arg, "i" ).test( obj.nodeName ); } }
javascript
function ( obj, arg ) { if ( regex.selector_is.test( arg ) ) { utility.id( obj ); return ( element.find( obj.parentNode, obj.nodeName.toLowerCase() + arg ).filter( function ( i ) { return ( i.id === obj.id ); }).length === 1 ); } else { return new RegExp( arg, "i" ).test( obj.nodeName ); } }
[ "function", "(", "obj", ",", "arg", ")", "{", "if", "(", "regex", ".", "selector_is", ".", "test", "(", "arg", ")", ")", "{", "utility", ".", "id", "(", "obj", ")", ";", "return", "(", "element", ".", "find", "(", "obj", ".", "parentNode", ",", ...
Determines if Element is equal to arg, supports nodeNames & CSS2+ selectors @method is @param {Mixed} obj Element @param {String} arg Property to query @return {Boolean} True if a match
[ "Determines", "if", "Element", "is", "equal", "to", "arg", "supports", "nodeNames", "&", "CSS2", "+", "selectors" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5352-L5362
36,480
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { return obj.nodeName === "FORM" ? false : validate.test( {alphanum : obj.value || element.text( obj )} ).pass; }
javascript
function ( obj ) { return obj.nodeName === "FORM" ? false : validate.test( {alphanum : obj.value || element.text( obj )} ).pass; }
[ "function", "(", "obj", ")", "{", "return", "obj", ".", "nodeName", "===", "\"FORM\"", "?", "false", ":", "validate", ".", "test", "(", "{", "alphanum", ":", "obj", ".", "value", "||", "element", ".", "text", "(", "obj", ")", "}", ")", ".", "pass",...
Tests if Element value or text is alpha-numeric @method isAlphaNum @param {Object} obj Element to test @return {Boolean} Result of test
[ "Tests", "if", "Element", "value", "or", "text", "is", "alpha", "-", "numeric" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5371-L5373
36,481
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isDate( obj.value || element.text( obj ) ); }
javascript
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isDate( obj.value || element.text( obj ) ); }
[ "function", "(", "obj", ")", "{", "return", "obj", ".", "nodeName", "===", "\"FORM\"", "?", "false", ":", "string", ".", "isDate", "(", "obj", ".", "value", "||", "element", ".", "text", "(", "obj", ")", ")", ";", "}" ]
Tests if Element value or text is a date @method isDate @param {Object} obj Element to test @return {Boolean} Result of test
[ "Tests", "if", "Element", "value", "or", "text", "is", "a", "date" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5404-L5406
36,482
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isDomain( obj.value || element.text( obj ) ); }
javascript
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isDomain( obj.value || element.text( obj ) ); }
[ "function", "(", "obj", ")", "{", "return", "obj", ".", "nodeName", "===", "\"FORM\"", "?", "false", ":", "string", ".", "isDomain", "(", "obj", ".", "value", "||", "element", ".", "text", "(", "obj", ")", ")", ";", "}" ]
Tests if Element value or text is a domain @method isDomain @param {Object} obj Element to test @return {Boolean} Result of test
[ "Tests", "if", "Element", "value", "or", "text", "is", "a", "domain" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5426-L5428
36,483
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isEmail( obj.value || element.text( obj ) ); }
javascript
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isEmail( obj.value || element.text( obj ) ); }
[ "function", "(", "obj", ")", "{", "return", "obj", ".", "nodeName", "===", "\"FORM\"", "?", "false", ":", "string", ".", "isEmail", "(", "obj", ".", "value", "||", "element", ".", "text", "(", "obj", ")", ")", ";", "}" ]
Tests if Element value or text is an email address @method isEmail @param {Object} obj Element to test @return {Boolean} Result of test
[ "Tests", "if", "Element", "value", "or", "text", "is", "an", "email", "address" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5437-L5439
36,484
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isEmpty( obj.value || element.text( obj ) ); }
javascript
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isEmpty( obj.value || element.text( obj ) ); }
[ "function", "(", "obj", ")", "{", "return", "obj", ".", "nodeName", "===", "\"FORM\"", "?", "false", ":", "string", ".", "isEmpty", "(", "obj", ".", "value", "||", "element", ".", "text", "(", "obj", ")", ")", ";", "}" ]
Tests if Element value or text is empty @method isEmpty @param {Object} obj Element to test @return {Boolean} Result of test
[ "Tests", "if", "Element", "value", "or", "text", "is", "empty" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5448-L5450
36,485
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isIP( obj.value || element.text( obj ) ); }
javascript
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isIP( obj.value || element.text( obj ) ); }
[ "function", "(", "obj", ")", "{", "return", "obj", ".", "nodeName", "===", "\"FORM\"", "?", "false", ":", "string", ".", "isIP", "(", "obj", ".", "value", "||", "element", ".", "text", "(", "obj", ")", ")", ";", "}" ]
Tests if Element value or text is an IP address @method isIP @param {Object} obj Element to test @return {Boolean} Result of test
[ "Tests", "if", "Element", "value", "or", "text", "is", "an", "IP", "address" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5459-L5461
36,486
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isInt( obj.value || element.text( obj ) ); }
javascript
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isInt( obj.value || element.text( obj ) ); }
[ "function", "(", "obj", ")", "{", "return", "obj", ".", "nodeName", "===", "\"FORM\"", "?", "false", ":", "string", ".", "isInt", "(", "obj", ".", "value", "||", "element", ".", "text", "(", "obj", ")", ")", ";", "}" ]
Tests if Element value or text is an integer @method isInt @param {Object} obj Element to test @return {Boolean} Result of test
[ "Tests", "if", "Element", "value", "or", "text", "is", "an", "integer" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5470-L5472
36,487
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isNumber( obj.value || element.text( obj ) ); }
javascript
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isNumber( obj.value || element.text( obj ) ); }
[ "function", "(", "obj", ")", "{", "return", "obj", ".", "nodeName", "===", "\"FORM\"", "?", "false", ":", "string", ".", "isNumber", "(", "obj", ".", "value", "||", "element", ".", "text", "(", "obj", ")", ")", ";", "}" ]
Tests if Element value or text is numeric @method isNumber @param {Object} obj Element to test @return {Boolean} Result of test
[ "Tests", "if", "Element", "value", "or", "text", "is", "numeric" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5481-L5483
36,488
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isPhone( obj.value || element.text( obj ) ); }
javascript
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isPhone( obj.value || element.text( obj ) ); }
[ "function", "(", "obj", ")", "{", "return", "obj", ".", "nodeName", "===", "\"FORM\"", "?", "false", ":", "string", ".", "isPhone", "(", "obj", ".", "value", "||", "element", ".", "text", "(", "obj", ")", ")", ";", "}" ]
Tests if Element value or text is a phone number @method isPhone @param {Object} obj Element to test @return {Boolean} Result of test
[ "Tests", "if", "Element", "value", "or", "text", "is", "a", "phone", "number" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5492-L5494
36,489
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isUrl( obj.value || element.text( obj ) ); }
javascript
function ( obj ) { return obj.nodeName === "FORM" ? false : string.isUrl( obj.value || element.text( obj ) ); }
[ "function", "(", "obj", ")", "{", "return", "obj", ".", "nodeName", "===", "\"FORM\"", "?", "false", ":", "string", ".", "isUrl", "(", "obj", ".", "value", "||", "element", ".", "text", "(", "obj", ")", ")", ";", "}" ]
Tests if Element value or text is a URL @method isUrl @param {Object} obj Element to test @return {Boolean} Result of test
[ "Tests", "if", "Element", "value", "or", "text", "is", "a", "URL" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5503-L5505
36,490
avoidwork/abaaso
lib/abaaso.js
function ( obj, arg, add ) { add = ( add !== false ); arg = string.explode( arg, " " ); if ( add ) { array.each( arg, function ( i ) { obj.classList.add( i ); }); } else { array.each( arg, function ( i ) { if ( i !== "*" ) { obj.classList.remove( i ); } else { array.each( o...
javascript
function ( obj, arg, add ) { add = ( add !== false ); arg = string.explode( arg, " " ); if ( add ) { array.each( arg, function ( i ) { obj.classList.add( i ); }); } else { array.each( arg, function ( i ) { if ( i !== "*" ) { obj.classList.remove( i ); } else { array.each( o...
[ "function", "(", "obj", ",", "arg", ",", "add", ")", "{", "add", "=", "(", "add", "!==", "false", ")", ";", "arg", "=", "string", ".", "explode", "(", "arg", ",", "\" \"", ")", ";", "if", "(", "add", ")", "{", "array", ".", "each", "(", "arg"...
Adds or removes a CSS class @method klass @param {Mixed} obj Element @param {String} arg Class to add or remove ( can be a wildcard ) @param {Boolean} add Boolean to add or remove, defaults to true @return {Object} Element
[ "Adds", "or", "removes", "a", "CSS", "class" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5516-L5541
36,491
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { obj = obj || document.body; var left, top, right, bottom, height, width; left = top = 0; width = obj.offsetWidth; height = obj.offsetHeight; if ( obj.offsetParent ) { top = obj.offsetTop; left = obj.offsetLeft; while ( obj = obj.offsetParent ) { left += obj.offsetL...
javascript
function ( obj ) { obj = obj || document.body; var left, top, right, bottom, height, width; left = top = 0; width = obj.offsetWidth; height = obj.offsetHeight; if ( obj.offsetParent ) { top = obj.offsetTop; left = obj.offsetLeft; while ( obj = obj.offsetParent ) { left += obj.offsetL...
[ "function", "(", "obj", ")", "{", "obj", "=", "obj", "||", "document", ".", "body", ";", "var", "left", ",", "top", ",", "right", ",", "bottom", ",", "height", ",", "width", ";", "left", "=", "top", "=", "0", ";", "width", "=", "obj", ".", "off...
Finds the position of an element @method position @param {Mixed} obj Element @return {Array} Coordinates [left, top, right, bottom]
[ "Finds", "the", "position", "of", "an", "element" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5550-L5576
36,492
avoidwork/abaaso
lib/abaaso.js
function ( obj, child ) { return obj.childNodes.length === 0 ? obj.appendChild( child ) : obj.insertBefore( child, obj.childNodes[0] ); }
javascript
function ( obj, child ) { return obj.childNodes.length === 0 ? obj.appendChild( child ) : obj.insertBefore( child, obj.childNodes[0] ); }
[ "function", "(", "obj", ",", "child", ")", "{", "return", "obj", ".", "childNodes", ".", "length", "===", "0", "?", "obj", ".", "appendChild", "(", "child", ")", ":", "obj", ".", "insertBefore", "(", "child", ",", "obj", ".", "childNodes", "[", "0", ...
Prepends an Element to an Element @method prependChild @param {Object} obj Element @param {Object} child Child Element @return {Object} Element
[ "Prepends", "an", "Element", "to", "an", "Element" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5586-L5588
36,493
avoidwork/abaaso
lib/abaaso.js
function ( obj, key ) { var target; if ( regex.svg.test( obj.namespaceURI ) ) { obj.removeAttributeNS( obj.namespaceURI, key ); } else { if ( obj.nodeName === "SELECT" && key === "selected") { target = utility.$( "#" + obj.id + " option[selected=\"selected\"]" )[0]; if ( target !== undefined ) {...
javascript
function ( obj, key ) { var target; if ( regex.svg.test( obj.namespaceURI ) ) { obj.removeAttributeNS( obj.namespaceURI, key ); } else { if ( obj.nodeName === "SELECT" && key === "selected") { target = utility.$( "#" + obj.id + " option[selected=\"selected\"]" )[0]; if ( target !== undefined ) {...
[ "function", "(", "obj", ",", "key", ")", "{", "var", "target", ";", "if", "(", "regex", ".", "svg", ".", "test", "(", "obj", ".", "namespaceURI", ")", ")", "{", "obj", ".", "removeAttributeNS", "(", "obj", ".", "namespaceURI", ",", "key", ")", ";",...
Removes an Element attribute @method removeAttr @param {Mixed} obj Element @param {String} key Attribute name @return {Object} Element
[ "Removes", "an", "Element", "attribute" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5598-L5619
36,494
avoidwork/abaaso
lib/abaaso.js
function ( obj, ms ) { return client.scroll( array.remove( element.position( obj ), 2, 3 ), ms ); }
javascript
function ( obj, ms ) { return client.scroll( array.remove( element.position( obj ), 2, 3 ), ms ); }
[ "function", "(", "obj", ",", "ms", ")", "{", "return", "client", ".", "scroll", "(", "array", ".", "remove", "(", "element", ".", "position", "(", "obj", ")", ",", "2", ",", "3", ")", ",", "ms", ")", ";", "}" ]
Scrolls to the position of an Element @method scrollTo @param {Object} obj Element to scroll to @param {Number} ms [Optional] Milliseconds to scroll, default is 250, min is 100 @return {Object} Deferred
[ "Scrolls", "to", "the", "position", "of", "an", "Element" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5629-L5631
36,495
avoidwork/abaaso
lib/abaaso.js
function ( obj, string, encode ) { string = ( string === true ); encode = ( encode !== false ); var children = [], registry = {}, result; children = obj.nodeName === "FORM" ? ( obj.elements !== undefined ? array.cast( obj.elements ) : obj.find( "button, input, select, textarea" ) ) : [o...
javascript
function ( obj, string, encode ) { string = ( string === true ); encode = ( encode !== false ); var children = [], registry = {}, result; children = obj.nodeName === "FORM" ? ( obj.elements !== undefined ? array.cast( obj.elements ) : obj.find( "button, input, select, textarea" ) ) : [o...
[ "function", "(", "obj", ",", "string", ",", "encode", ")", "{", "string", "=", "(", "string", "===", "true", ")", ";", "encode", "=", "(", "encode", "!==", "false", ")", ";", "var", "children", "=", "[", "]", ",", "registry", "=", "{", "}", ",", ...
Serializes the elements of an Element @method serialize @param {Object} obj Element @param {Boolean} string [Optional] true if you want a query string, default is false ( JSON ) @param {Boolean} encode [Optional] true if you want to URI encode the value, default is true @return {Mixed} String or Object
[ "Serializes", "the", "elements", "of", "an", "Element" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5642-L5674
36,496
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { var parse = function ( arg ) { return number.parse(arg, 10); }; return { height : obj.offsetHeight + parse( obj.style.paddingTop || 0 ) + parse( obj.style.paddingBottom || 0 ) + parse( obj.style.borderTop || 0 ) + parse( obj.style.borderBottom || 0 ), width : obj.offsetWidth + par...
javascript
function ( obj ) { var parse = function ( arg ) { return number.parse(arg, 10); }; return { height : obj.offsetHeight + parse( obj.style.paddingTop || 0 ) + parse( obj.style.paddingBottom || 0 ) + parse( obj.style.borderTop || 0 ) + parse( obj.style.borderBottom || 0 ), width : obj.offsetWidth + par...
[ "function", "(", "obj", ")", "{", "var", "parse", "=", "function", "(", "arg", ")", "{", "return", "number", ".", "parse", "(", "arg", ",", "10", ")", ";", "}", ";", "return", "{", "height", ":", "obj", ".", "offsetHeight", "+", "parse", "(", "ob...
Returns the size of the Object @method size @param {Mixed} obj Element @return {Object} Size {height: n, width:n}
[ "Returns", "the", "size", "of", "the", "Object" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5683-L5692
36,497
avoidwork/abaaso
lib/abaaso.js
function ( obj, args ) { args = args || {}; utility.iterate( args, function ( v, k ) { if ( regex.element_update.test( k ) ) { obj[k] = v; } else if ( k === "class" ) { !string.isEmpty( v ) ? element.klass( obj, v ) : element.klass( obj, "*", false ); } else if ( k.indexOf( "data-" ) === 0 )...
javascript
function ( obj, args ) { args = args || {}; utility.iterate( args, function ( v, k ) { if ( regex.element_update.test( k ) ) { obj[k] = v; } else if ( k === "class" ) { !string.isEmpty( v ) ? element.klass( obj, v ) : element.klass( obj, "*", false ); } else if ( k.indexOf( "data-" ) === 0 )...
[ "function", "(", "obj", ",", "args", ")", "{", "args", "=", "args", "||", "{", "}", ";", "utility", ".", "iterate", "(", "args", ",", "function", "(", "v", ",", "k", ")", "{", "if", "(", "regex", ".", "element_update", ".", "test", "(", "k", ")...
Updates an Element @method update @param {Mixed} obj Element @param {Object} args Collection of properties @return {Object} Element
[ "Updates", "an", "Element" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5737-L5764
36,498
avoidwork/abaaso
lib/abaaso.js
function ( obj, value ) { var event = "input", output; if ( value === undefined ) { if ( regex.radio_checkbox.test( obj.type ) ) { if ( string.isEmpty( obj.name ) ) { throw new Error( label.error.expectedProperty ); } array.each( utility.$( "input[name='" + obj.name + "']" ), function ( ...
javascript
function ( obj, value ) { var event = "input", output; if ( value === undefined ) { if ( regex.radio_checkbox.test( obj.type ) ) { if ( string.isEmpty( obj.name ) ) { throw new Error( label.error.expectedProperty ); } array.each( utility.$( "input[name='" + obj.name + "']" ), function ( ...
[ "function", "(", "obj", ",", "value", ")", "{", "var", "event", "=", "\"input\"", ",", "output", ";", "if", "(", "value", "===", "undefined", ")", "{", "if", "(", "regex", ".", "radio_checkbox", ".", "test", "(", "obj", ".", "type", ")", ")", "{", ...
Gets or sets the value of Element @method val @param {Mixed} obj Element @param {Mixed} value [Optional] Value to set @return {Object} Element
[ "Gets", "or", "sets", "the", "value", "of", "Element" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5774-L5844
36,499
avoidwork/abaaso
lib/abaaso.js
function ( obj ) { return obj.nodeName === "FORM" ? validate.test( obj ) : !string.isEmpty( obj.value || element.text( obj ) ); }
javascript
function ( obj ) { return obj.nodeName === "FORM" ? validate.test( obj ) : !string.isEmpty( obj.value || element.text( obj ) ); }
[ "function", "(", "obj", ")", "{", "return", "obj", ".", "nodeName", "===", "\"FORM\"", "?", "validate", ".", "test", "(", "obj", ")", ":", "!", "string", ".", "isEmpty", "(", "obj", ".", "value", "||", "element", ".", "text", "(", "obj", ")", ")", ...
Validates the contents of Element @method validate @param {Object} obj Element to test @return {Object} Result of test
[ "Validates", "the", "contents", "of", "Element" ]
07c147684bccd28868f377881eb80ffc285cd483
https://github.com/avoidwork/abaaso/blob/07c147684bccd28868f377881eb80ffc285cd483/lib/abaaso.js#L5853-L5855