mirror of
https://github.com/SamEyeBam/animate.git
synced 2025-12-13 09:24:53 +00:00
larry babby and threejs for glsl
This commit is contained in:
4
webGl/my-threejs-test/node_modules/shallow-copy/.travis.yml
generated
vendored
Normal file
4
webGl/my-threejs-test/node_modules/shallow-copy/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.8"
|
||||
- "0.10"
|
||||
18
webGl/my-threejs-test/node_modules/shallow-copy/LICENSE
generated
vendored
Normal file
18
webGl/my-threejs-test/node_modules/shallow-copy/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
This software is released under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
9
webGl/my-threejs-test/node_modules/shallow-copy/example/array.js
generated
vendored
Normal file
9
webGl/my-threejs-test/node_modules/shallow-copy/example/array.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
var copy = require('../');
|
||||
|
||||
var xs = [ 3, 4, 5, { f: 6, g: 7 } ];
|
||||
var dup = copy(xs);
|
||||
dup.unshift(1, 2);
|
||||
dup[5].g += 100;
|
||||
|
||||
console.log('original: ', xs);
|
||||
console.log('copy: ', dup);
|
||||
9
webGl/my-threejs-test/node_modules/shallow-copy/example/object.js
generated
vendored
Normal file
9
webGl/my-threejs-test/node_modules/shallow-copy/example/object.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
var copy = require('../');
|
||||
|
||||
var obj = { a: 3, b: 4, c: [5,6] };
|
||||
var dup = copy(obj);
|
||||
dup.b *= 111;
|
||||
dup.c.push(7);
|
||||
|
||||
console.log('original: ', obj);
|
||||
console.log('copy: ', dup);
|
||||
35
webGl/my-threejs-test/node_modules/shallow-copy/index.js
generated
vendored
Normal file
35
webGl/my-threejs-test/node_modules/shallow-copy/index.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
module.exports = function (obj) {
|
||||
if (!obj || typeof obj !== 'object') return obj;
|
||||
|
||||
var copy;
|
||||
|
||||
if (isArray(obj)) {
|
||||
var len = obj.length;
|
||||
copy = Array(len);
|
||||
for (var i = 0; i < len; i++) {
|
||||
copy[i] = obj[i];
|
||||
}
|
||||
}
|
||||
else {
|
||||
var keys = objectKeys(obj);
|
||||
copy = {};
|
||||
|
||||
for (var i = 0, l = keys.length; i < l; i++) {
|
||||
var key = keys[i];
|
||||
copy[key] = obj[key];
|
||||
}
|
||||
}
|
||||
return copy;
|
||||
};
|
||||
|
||||
var objectKeys = Object.keys || function (obj) {
|
||||
var keys = [];
|
||||
for (var key in obj) {
|
||||
if ({}.hasOwnProperty.call(obj, key)) keys.push(key);
|
||||
}
|
||||
return keys;
|
||||
};
|
||||
|
||||
var isArray = Array.isArray || function (xs) {
|
||||
return {}.toString.call(xs) === '[object Array]';
|
||||
};
|
||||
44
webGl/my-threejs-test/node_modules/shallow-copy/package.json
generated
vendored
Normal file
44
webGl/my-threejs-test/node_modules/shallow-copy/package.json
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "shallow-copy",
|
||||
"version": "0.0.1",
|
||||
"description": "make a shallow copy of an object or array",
|
||||
"main": "index.js",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"tape": "~1.0.4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape test/*.js"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": [
|
||||
"ie/8..latest",
|
||||
"ff/latest",
|
||||
"chrome/latest",
|
||||
"safari/latest",
|
||||
"opera/latest",
|
||||
"android/latest",
|
||||
"iphone/latest",
|
||||
"ipad/latest"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/substack/shallow-copy.git"
|
||||
},
|
||||
"homepage": "https://github.com/substack/shallow-copy",
|
||||
"keywords": [
|
||||
"shallow",
|
||||
"copy",
|
||||
"data",
|
||||
"object",
|
||||
"array"
|
||||
],
|
||||
"author": {
|
||||
"name": "James Halliday",
|
||||
"email": "mail@substack.net",
|
||||
"url": "http://substack.net"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
64
webGl/my-threejs-test/node_modules/shallow-copy/readme.markdown
generated
vendored
Normal file
64
webGl/my-threejs-test/node_modules/shallow-copy/readme.markdown
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
# shallow-copy
|
||||
|
||||
make a shallow copy of an object or array
|
||||
|
||||
[](https://ci.testling.com/substack/shallow-copy)
|
||||
|
||||
[](http://travis-ci.org/substack/shallow-copy)
|
||||
|
||||
# example
|
||||
|
||||
you can copy objects shallowly:
|
||||
|
||||
``` js
|
||||
var copy = require('shallow-copy');
|
||||
|
||||
var obj = { a: 3, b: 4, c: [5,6] };
|
||||
var dup = copy(obj);
|
||||
dup.b *= 111;
|
||||
dup.c.push(7);
|
||||
|
||||
console.log('original: ', obj);
|
||||
console.log('copy: ', dup);
|
||||
```
|
||||
|
||||
and you can copy arrays shallowly:
|
||||
|
||||
``` js
|
||||
var copy = require('shallow-copy');
|
||||
|
||||
var xs = [ 3, 4, 5, { f: 6, g: 7 } ];
|
||||
var dup = copy(xs);
|
||||
dup.unshift(1, 2);
|
||||
dup[5].g += 100;
|
||||
|
||||
console.log('original: ', xs);
|
||||
console.log('copy: ', dup);
|
||||
```
|
||||
|
||||
# methods
|
||||
|
||||
``` js
|
||||
var copy = require('shallow-copy')
|
||||
```
|
||||
|
||||
## copy(obj)
|
||||
|
||||
Return a copy of the enumerable properties of the object `obj` without making
|
||||
copies of nested objects inside of `obj`.
|
||||
|
||||
If `obj` is an array, the result will be an array.
|
||||
If `obj` is an object, the result will be an object.
|
||||
If `obj` is not an object, its value is returned.
|
||||
|
||||
# install
|
||||
|
||||
With [npm](https://npmjs.org) do:
|
||||
|
||||
```
|
||||
npm install shallow-copy
|
||||
```
|
||||
|
||||
# license
|
||||
|
||||
MIT
|
||||
14
webGl/my-threejs-test/node_modules/shallow-copy/test/array.js
generated
vendored
Normal file
14
webGl/my-threejs-test/node_modules/shallow-copy/test/array.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
var copy = require('../');
|
||||
var test = require('tape');
|
||||
|
||||
test('array', function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var xs = [ 3, 4, 5, { f: 6, g: 7 } ];
|
||||
var dup = copy(xs);
|
||||
dup.unshift(1, 2);
|
||||
dup[5].g += 100;
|
||||
|
||||
t.deepEqual(xs, [ 3, 4, 5, { f: 6, g: 107 } ]);
|
||||
t.deepEqual(dup, [ 1, 2, 3, 4, 5, { f: 6, g: 107 } ]);
|
||||
});
|
||||
14
webGl/my-threejs-test/node_modules/shallow-copy/test/object.js
generated
vendored
Normal file
14
webGl/my-threejs-test/node_modules/shallow-copy/test/object.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
var copy = require('../');
|
||||
var test = require('tape');
|
||||
|
||||
test('object', function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var obj = { a: 3, b: 4, c: [5,6] };
|
||||
var dup = copy(obj);
|
||||
dup.b *= 111;
|
||||
dup.c.push(7);
|
||||
|
||||
t.deepEqual(obj, { a: 3, b: 4, c: [ 5, 6, 7 ] });
|
||||
t.deepEqual(dup, { a: 3, b: 444, c: [ 5, 6, 7 ] });
|
||||
});
|
||||
Reference in New Issue
Block a user