public/javascripts/yui/datasource/datasource.js
function (needle) {
            var path = null, keys = [], i = 0;
            if (needle) {
                // Strip the ["string keys"] and [1] array indexes
                needle = needle.
                    replace(/\[(['"])(.*?)\1\]/g,
                    function (x,$1,$2) {keys[i]=$2;return '.@'+(i++);}).
                    replace(/\[(\d+)\]/g,
                    function (x,$1) {keys[i]=parseInt($1,10)|0;return '.@'+(i++);}).
                    replace(/^\./,''); // remove leading dot

                // If the cleaned needle contains invalid characters, the
                // path is invalid
                if (!/[^\w\.\$@]/.test(needle)) {
                    path = needle.split('.');
                    for (i=path.length-1; i >= 0; --i) {
                        if (path[i].charAt(0) === '@') {
                            path[i] = keys[parseInt(path[i].substr(1),10)];
                        }
                    }
                }
                else {
                }
            }
            return path;
        }
function (needle) {
            var path = null, keys = [], i = 0;
            if (needle) {
                // Strip the ["string keys"] and [1] array indexes
                needle = needle.
                    replace(/\[(['"])(.*?)\1\]/g,
                    function (x,$1,$2) {keys[i]=$2;return '.@'+(i++);}).
                    replace(/\[(\d+)\]/g,
                    function (x,$1) {keys[i]=parseInt($1,10)|0;return '.@'+(i++);}).
                    replace(/^\./,''); // remove leading dot

                // If the cleaned needle contains invalid characters, the
                // path is invalid
                if (!/[^\w\.\$@]/.test(needle)) {
                    path = needle.split('.');
                    for (i=path.length-1; i >= 0; --i) {
                        if (path[i].charAt(0) === '@') {
                            path[i] = keys[parseInt(path[i].substr(1),10)];
                        }
                    }
                }
                else {
                }
            }
            return path;
        }
function ( needle ) { var path = null , keys = [ ] , i = 0 ; if ( needle ) { // Strip the ["string keys"] and [1] array indexes needle = needle . replace ( / \[(['"])(.*?)\1\] / g , function ( x , $1 , $2 ) { keys [ i ] = $2 ; return '.@' + ( i ++ ) ; } ) . replace ( / \[(\d+)\] / g , function ( x , $1 ) { keys [ i ] = parseInt ( $1 , 10 ) | 0 ; return '.@' + ( i ++ ) ; } ) . replace ( / ^\. / , '' ) ; // remove leading dot // If the cleaned needle contains invalid characters, the // path is invalid if ( ! / [^\w\.\$@] / . test ( needle ) ) { path = needle . split ( '.' ) ; for ( i = path . length - 1 ; i >= 0 ; -- i ) { if ( path [ i ] . charAt ( 0 ) === '@' ) { path [ i ] = keys [ parseInt ( path [ i ] . substr ( 1 ) , 10 ) ] ; } } } else { } } return path ; }
Function to convert the schema's fields into walk paths
Function to convert the schema s fields into walk paths