mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-06-07 00:36:12 +02:00
publishing v1 of action
This commit is contained in:
parent
91baa89272
commit
2d5ca45eab
569 changed files with 61688 additions and 2 deletions
16
node_modules/traverse/examples/json.js
generated
vendored
Executable file
16
node_modules/traverse/examples/json.js
generated
vendored
Executable file
|
@ -0,0 +1,16 @@
|
|||
var Traverse = require('traverse');
|
||||
|
||||
var id = 54;
|
||||
var callbacks = {};
|
||||
var obj = { moo : function () {}, foo : [2,3,4, function () {}] };
|
||||
|
||||
var scrubbed = Traverse(obj).map(function (x) {
|
||||
if (typeof x === 'function') {
|
||||
callbacks[id] = { id : id, f : x, path : this.path };
|
||||
this.update('[Function]');
|
||||
id++;
|
||||
}
|
||||
});
|
||||
|
||||
console.dir(scrubbed);
|
||||
console.dir(callbacks);
|
15
node_modules/traverse/examples/leaves.js
generated
vendored
Executable file
15
node_modules/traverse/examples/leaves.js
generated
vendored
Executable file
|
@ -0,0 +1,15 @@
|
|||
var Traverse = require('traverse');
|
||||
|
||||
var obj = {
|
||||
a : [1,2,3],
|
||||
b : 4,
|
||||
c : [5,6],
|
||||
d : { e : [7,8], f : 9 },
|
||||
};
|
||||
|
||||
var leaves = Traverse(obj).reduce(function (acc, x) {
|
||||
if (this.isLeaf) acc.push(x);
|
||||
return acc;
|
||||
}, []);
|
||||
|
||||
console.dir(leaves);
|
8
node_modules/traverse/examples/negative.js
generated
vendored
Executable file
8
node_modules/traverse/examples/negative.js
generated
vendored
Executable file
|
@ -0,0 +1,8 @@
|
|||
var Traverse = require('traverse');
|
||||
var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ];
|
||||
|
||||
Traverse(obj).forEach(function (x) {
|
||||
if (x < 0) this.update(x + 128);
|
||||
});
|
||||
|
||||
console.dir(obj);
|
38
node_modules/traverse/examples/stringify.js
generated
vendored
Executable file
38
node_modules/traverse/examples/stringify.js
generated
vendored
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/env node
|
||||
var Traverse = require('traverse');
|
||||
|
||||
var obj = [ 'five', 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ];
|
||||
|
||||
var s = '';
|
||||
Traverse(obj).forEach(function to_s (node) {
|
||||
if (Array.isArray(node)) {
|
||||
this.before(function () { s += '[' });
|
||||
this.post(function (child) {
|
||||
if (!child.isLast) s += ',';
|
||||
});
|
||||
this.after(function () { s += ']' });
|
||||
}
|
||||
else if (typeof node == 'object') {
|
||||
this.before(function () { s += '{' });
|
||||
this.pre(function (x, key) {
|
||||
to_s(key);
|
||||
s += ':';
|
||||
});
|
||||
this.post(function (child) {
|
||||
if (!child.isLast) s += ',';
|
||||
});
|
||||
this.after(function () { s += '}' });
|
||||
}
|
||||
else if (typeof node == 'string') {
|
||||
s += '"' + node.toString().replace(/"/g, '\\"') + '"';
|
||||
}
|
||||
else if (typeof node == 'function') {
|
||||
s += 'null';
|
||||
}
|
||||
else {
|
||||
s += node.toString();
|
||||
}
|
||||
});
|
||||
|
||||
console.log('JSON.stringify: ' + JSON.stringify(obj));
|
||||
console.log('this stringify: ' + s);
|
Loading…
Add table
Add a link
Reference in a new issue