Skip to content

Commit df0299b

Browse files
committed
Removed the "require" to help with the rollup in other libraries.
1 parent 4b11f68 commit df0299b

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

packages/dynamodb-data-mapper/src/DataMapper.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ import {
8686
} from '@aws-sdk/client-dynamodb';
8787
import { DynamoDB } from "@aws-sdk/client-dynamodb";
8888

89-
require('./asyncIteratorSymbolPolyfill');
89+
if (Symbol && !Symbol.asyncIterator) {
90+
(Symbol as any).asyncIterator = Symbol.for("__@@asyncIterator__");
91+
}
92+
9093

9194
/**
9295
* Object mapper for domain object interaction with DynamoDB.

packages/dynamodb-data-mapper/src/Iterator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { Paginator as AbstractPaginator } from './Paginator';
22
import { ConsumedCapacity } from '@aws-sdk/client-dynamodb';
33

4-
require('./asyncIteratorSymbolPolyfill');
4+
if (Symbol && !Symbol.asyncIterator) {
5+
(Symbol as any).asyncIterator = Symbol.for("__@@asyncIterator__");
6+
}
57

68
export abstract class Iterator<
79
T,

packages/dynamodb-data-mapper/src/Paginator.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import {
77
} from '@awslabs-community-fork/dynamodb-data-marshaller';
88
import { ConsumedCapacity } from '@aws-sdk/client-dynamodb';
99

10-
require('./asyncIteratorSymbolPolyfill');
10+
if (Symbol && !Symbol.asyncIterator) {
11+
(Symbol as any).asyncIterator = Symbol.for("__@@asyncIterator__");
12+
}
13+
1114

1215
export abstract class Paginator<T> implements AsyncIterableIterator<Array<T>> {
1316
private readonly itemSchema: Schema;

packages/dynamodb-data-mapper/src/asyncIteratorSymbolPolyfill.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/dynamodb-data-marshaller/src/marshallItem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
Marshaller,
1010
NumberValueSet,
1111
} from '@awslabs-community-fork/dynamodb-auto-marshaller';
12-
const bytes = require('utf8-bytes');
12+
import * as bytes from "utf8-bytes";
1313

1414
/**
1515
* Converts a JavaScript object into a DynamoDB Item.

0 commit comments

Comments
 (0)