File tree Expand file tree Collapse file tree 12 files changed +351
-0
lines changed
lib/node_modules/@stdlib/assert Expand file tree Collapse file tree 12 files changed +351
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * @license Apache-2.0
3+ *
4+ * Copyright (c) 2019 The Stdlib Authors.
5+ *
6+ * Licensed under the Apache License, Version 2.0 (the "License");
7+ * you may not use this file except in compliance with the License.
8+ * You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing, software
13+ * distributed under the License is distributed on an "AS IS" BASIS,
14+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ * See the License for the specific language governing permissions and
16+ * limitations under the License.
17+ */
18+
19+ // TypeScript Version: 2.0
20+
21+ /**
22+ * Tests if a value is an array containing a circular reference.
23+ *
24+ * @param value - value to test
25+ * @returns boolean indicating whether value is an array containing a circular reference
26+ *
27+ * @example
28+ * var arr = [ 1, 2, 3 ];
29+ * arr.push( arr );
30+ * var bool = isCircularArray( arr );
31+ * // returns true
32+ *
33+ * @example
34+ * var obj = {
35+ * 'a': 'beep',
36+ * 'b': {
37+ * 'c': 'boop'
38+ * }
39+ * };
40+ * obj.b.self = obj;
41+ * var bool = isCircularArray( obj );
42+ * // returns false
43+ *
44+ * @example
45+ * var bool = isCircularArray( [] );
46+ * // returns false
47+ *
48+ * @example
49+ * var bool = isCircularArray( null );
50+ * // returns false
51+ */
52+ declare function isCircularArray ( value : any ) : boolean ;
53+
54+
55+ // EXPORTS //
56+
57+ export = isCircularArray ;
Original file line number Diff line number Diff line change 1+ /*
2+ * @license Apache-2.0
3+ *
4+ * Copyright (c) 2019 The Stdlib Authors.
5+ *
6+ * Licensed under the Apache License, Version 2.0 (the "License");
7+ * you may not use this file except in compliance with the License.
8+ * You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing, software
13+ * distributed under the License is distributed on an "AS IS" BASIS,
14+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ * See the License for the specific language governing permissions and
16+ * limitations under the License.
17+ */
18+
19+ import isCircularArray = require( './index' ) ;
20+
21+
22+ // TESTS //
23+
24+ // The function returns a boolean...
25+ {
26+ const arr : Array < any > = [ 1 , 2 , 3 ] ;
27+ arr . push ( arr ) ;
28+ isCircularArray ( arr ) ; // $ExpectType boolean
29+ isCircularArray ( [ ] ) ; // $ExpectType boolean
30+ }
31+
32+ // The compiler throws an error if the function is provided an unsupported number of arguments...
33+ {
34+ isCircularArray ( ) ; // $ExpectError
35+ isCircularArray ( [ ] , 123 ) ; // $ExpectError
36+ }
Original file line number Diff line number Diff line change 2121 "lib" : " ./lib" ,
2222 "test" : " ./test"
2323 },
24+ "types" : " ./docs/types" ,
2425 "scripts" : {},
2526 "homepage" : " https://github.com/stdlib-js/stdlib" ,
2627 "repository" : {
Original file line number Diff line number Diff line change 1+ /*
2+ * @license Apache-2.0
3+ *
4+ * Copyright (c) 2019 The Stdlib Authors.
5+ *
6+ * Licensed under the Apache License, Version 2.0 (the "License");
7+ * you may not use this file except in compliance with the License.
8+ * You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing, software
13+ * distributed under the License is distributed on an "AS IS" BASIS,
14+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ * See the License for the specific language governing permissions and
16+ * limitations under the License.
17+ */
18+
19+ // TypeScript Version: 2.0
20+
21+ /**
22+ * Tests if an object-like value contains a circular reference.
23+ *
24+ * @param value - value to test
25+ * @returns boolean indicating whether value is object-like and contains a circular reference
26+ *
27+ * @example
28+ * var obj = {
29+ * 'a': 'beep',
30+ * 'b': {
31+ * 'c': 'boop'
32+ * }
33+ * };
34+ * obj.b.self = obj;
35+ * var bool = isCircular( obj );
36+ * // returns true
37+ *
38+ * @example
39+ * var arr = [ 1, 2, 3 ];
40+ * arr.push( arr );
41+ * var bool = isCircular( arr );
42+ * // returns true
43+ *
44+ * @example
45+ * var bool = isCircular( {} );
46+ * // returns false
47+ *
48+ * @example
49+ * var bool = isCircular( null );
50+ * // returns false
51+ */
52+ declare function isCircular ( value : any ) : boolean ;
53+
54+
55+ // EXPORTS //
56+
57+ export = isCircular ;
Original file line number Diff line number Diff line change 1+ /*
2+ * @license Apache-2.0
3+ *
4+ * Copyright (c) 2019 The Stdlib Authors.
5+ *
6+ * Licensed under the Apache License, Version 2.0 (the "License");
7+ * you may not use this file except in compliance with the License.
8+ * You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing, software
13+ * distributed under the License is distributed on an "AS IS" BASIS,
14+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ * See the License for the specific language governing permissions and
16+ * limitations under the License.
17+ */
18+
19+ import isCircular = require( './index' ) ;
20+
21+
22+ // TESTS //
23+
24+ // The function returns a boolean...
25+ {
26+ const obj = {
27+ 'a' : 'beep' ,
28+ 'b' : {
29+ 'c' : 'boop' ,
30+ 'self' : { }
31+ }
32+ } ;
33+ obj . b . self = obj ;
34+ isCircular ( obj ) ; // $ExpectType boolean
35+
36+ const arr : Array < any > = [ 1 , 2 , 3 ] ;
37+ arr . push ( arr ) ;
38+ isCircular ( arr ) ; // $ExpectType boolean
39+
40+ isCircular ( [ ] ) ; // $ExpectType boolean
41+ }
42+
43+ // The compiler throws an error if the function is provided an unsupported number of arguments...
44+ {
45+ isCircular ( ) ; // $ExpectError
46+ isCircular ( [ ] , 123 ) ; // $ExpectError
47+ }
Original file line number Diff line number Diff line change 2121 "lib" : " ./lib" ,
2222 "test" : " ./test"
2323 },
24+ "types" : " ./docs/types" ,
2425 "scripts" : {},
2526 "homepage" : " https://github.com/stdlib-js/stdlib" ,
2627 "repository" : {
Original file line number Diff line number Diff line change 1+ /*
2+ * @license Apache-2.0
3+ *
4+ * Copyright (c) 2019 The Stdlib Authors.
5+ *
6+ * Licensed under the Apache License, Version 2.0 (the "License");
7+ * you may not use this file except in compliance with the License.
8+ * You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing, software
13+ * distributed under the License is distributed on an "AS IS" BASIS,
14+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ * See the License for the specific language governing permissions and
16+ * limitations under the License.
17+ */
18+
19+ // TypeScript Version: 2.0
20+
21+ /**
22+ * Tests if a value is a collection.
23+ *
24+ * @param value - value to test
25+ * @returns boolean indicating whether a value is a collection
26+ *
27+ * @example
28+ * var bool = isCollection( [] );
29+ * // returns true
30+ *
31+ * @example
32+ * var bool = isCollection( {} );
33+ * // returns false
34+ */
35+ declare function isCollection ( value : any ) : boolean ;
36+
37+
38+ // EXPORTS //
39+
40+ export = isCollection ;
Original file line number Diff line number Diff line change 1+ /*
2+ * @license Apache-2.0
3+ *
4+ * Copyright (c) 2019 The Stdlib Authors.
5+ *
6+ * Licensed under the Apache License, Version 2.0 (the "License");
7+ * you may not use this file except in compliance with the License.
8+ * You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing, software
13+ * distributed under the License is distributed on an "AS IS" BASIS,
14+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ * See the License for the specific language governing permissions and
16+ * limitations under the License.
17+ */
18+
19+ import isCollection = require( './index' ) ;
20+
21+
22+ // TESTS //
23+
24+ // The function returns a boolean...
25+ {
26+ isCollection ( [ ] ) ; // $ExpectType boolean
27+ isCollection ( { } ) ; // $ExpectType boolean
28+ }
29+
30+ // The compiler throws an error if the function is provided an unsupported number of arguments...
31+ {
32+ isCollection ( ) ; // $ExpectError
33+ isCollection ( [ ] , 123 ) ; // $ExpectError
34+ }
Original file line number Diff line number Diff line change 2121 "lib" : " ./lib" ,
2222 "test" : " ./test"
2323 },
24+ "types" : " ./docs/types" ,
2425 "scripts" : {},
2526 "homepage" : " https://github.com/stdlib-js/stdlib" ,
2627 "repository" : {
Original file line number Diff line number Diff line change 1+ /*
2+ * @license Apache-2.0
3+ *
4+ * Copyright (c) 2019 The Stdlib Authors.
5+ *
6+ * Licensed under the Apache License, Version 2.0 (the "License");
7+ * you may not use this file except in compliance with the License.
8+ * You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing, software
13+ * distributed under the License is distributed on an "AS IS" BASIS,
14+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ * See the License for the specific language governing permissions and
16+ * limitations under the License.
17+ */
18+
19+ // TypeScript Version: 2.0
20+
21+ /**
22+ * Tests if a value is PRNG-like.
23+ *
24+ * @param v - value to test
25+ * @returns boolean indicating if a value is PRNG-like
26+ *
27+ * @example
28+ * var randu = require( '@stdlib/random/base/randu' );
29+ *
30+ * var bool = isPRNGLike( randu );
31+ * // returns true
32+ *
33+ * bool = isPRNGLike( [] );
34+ * // returns false
35+ */
36+ declare function isPRNGLike ( v : any ) : boolean ;
37+
38+
39+ // EXPORTS //
40+
41+ export = isPRNGLike ;
You can’t perform that action at this time.
0 commit comments