|
| 1 | +/** |
| 2 | + * Copyright (c) 2002-2017 "Neo Technology,"," |
| 3 | + * Network Engine for Objects in Lund AB [http://neotechnology.com] |
| 4 | + * |
| 5 | + * This file is part of Neo4j. |
| 6 | + * |
| 7 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + * you may not use this file except in compliance with the License. |
| 9 | + * You may obtain a copy of the License at |
| 10 | + * |
| 11 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * |
| 13 | + * Unless required by applicable law or agreed to in writing, software |
| 14 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + * See the License for the specific language governing permissions and |
| 17 | + * limitations under the License. |
| 18 | + */ |
| 19 | + |
| 20 | +import Record from "../../../types/v1/record"; |
| 21 | + |
| 22 | +const record1 = new Record(["name", "age"], ["Alice", 20]); |
| 23 | +const record2 = new Record(["name", "age"], ["Bob", 22], {"key": "value"}); |
| 24 | + |
| 25 | +const record1Keys: string[] = record1.keys; |
| 26 | +const record1Length: number = record1.length; |
| 27 | + |
| 28 | +const record1Object: object = record1.toObject(); |
| 29 | + |
| 30 | +record1.forEach(() => { |
| 31 | +}); |
| 32 | + |
| 33 | +record1.forEach((value: any) => { |
| 34 | +}); |
| 35 | + |
| 36 | +record1.forEach((value: any, key: string) => { |
| 37 | +}); |
| 38 | + |
| 39 | +record1.forEach((value: any, key: string, record: Record) => { |
| 40 | +}); |
| 41 | + |
| 42 | +const record1Has: boolean = record1.has(42); |
| 43 | +const record2Has: boolean = record1.has("key"); |
| 44 | + |
| 45 | +const record1Get1: any = record1.get(42); |
| 46 | +const record2Get1: any = record2.get("key"); |
| 47 | + |
| 48 | +const record1Get2: object = record1.get(42); |
| 49 | +const record2Get2: string[] = record2.get("key"); |
0 commit comments