@aws-amplify/graphql-model-transformer 1.4.0 → 1.5.0-rds.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/API.md +15 -15
  2. package/CHANGELOG.md +11 -0
  3. package/lib/graphql-types/mutation.d.ts.map +1 -1
  4. package/lib/graphql-types/mutation.js +9 -2
  5. package/lib/graphql-types/mutation.js.map +1 -1
  6. package/lib/rds-lambda.zip +0 -0
  7. package/lib/rds-notification-lambda.zip +0 -0
  8. package/lib/rds-patching-lambda.zip +0 -0
  9. package/lib/resolvers/generators/dynamodb-vtl-generator.d.ts +6 -5
  10. package/lib/resolvers/generators/dynamodb-vtl-generator.d.ts.map +1 -1
  11. package/lib/resolvers/generators/dynamodb-vtl-generator.js +5 -5
  12. package/lib/resolvers/generators/dynamodb-vtl-generator.js.map +1 -1
  13. package/lib/resolvers/generators/rds-vtl-generator.d.ts +6 -5
  14. package/lib/resolvers/generators/rds-vtl-generator.d.ts.map +1 -1
  15. package/lib/resolvers/generators/rds-vtl-generator.js +10 -10
  16. package/lib/resolvers/generators/rds-vtl-generator.js.map +1 -1
  17. package/lib/resolvers/generators/vtl-generator.d.ts +6 -5
  18. package/lib/resolvers/generators/vtl-generator.d.ts.map +1 -1
  19. package/lib/resolvers/rds/mutation.d.ts +4 -3
  20. package/lib/resolvers/rds/mutation.d.ts.map +1 -1
  21. package/lib/resolvers/rds/mutation.js +7 -3
  22. package/lib/resolvers/rds/mutation.js.map +1 -1
  23. package/lib/resolvers/rds/query.d.ts +2 -1
  24. package/lib/resolvers/rds/query.d.ts.map +1 -1
  25. package/lib/resolvers/rds/query.js +3 -1
  26. package/lib/resolvers/rds/query.js.map +1 -1
  27. package/lib/resolvers/rds/resolver.d.ts +6 -2
  28. package/lib/resolvers/rds/resolver.d.ts.map +1 -1
  29. package/lib/resolvers/rds/resolver.js +39 -25
  30. package/lib/resolvers/rds/resolver.js.map +1 -1
  31. package/lib/resources/model-resource-generator.js +5 -5
  32. package/lib/resources/model-resource-generator.js.map +1 -1
  33. package/package.json +4 -4
  34. package/publish-notification-lambda/node_modules/.package-lock.json +13 -13
  35. package/publish-notification-lambda/node_modules/@smithy/protocol-http/package.json +2 -2
  36. package/publish-notification-lambda/node_modules/@smithy/types/README.md +37 -0
  37. package/publish-notification-lambda/node_modules/@smithy/types/package.json +3 -2
  38. package/publish-notification-lambda/node_modules/@types/node/README.md +2 -2
  39. package/publish-notification-lambda/node_modules/@types/node/package.json +2 -7
  40. package/publish-notification-lambda/node_modules/tslib/package.json +1 -1
  41. package/publish-notification-lambda/node_modules/tslib/tslib.es6.mjs +1 -1
  42. package/publish-notification-lambda/package-lock.json +13 -13
  43. package/rds-lambda/handler.ts +2 -1
  44. package/rds-lambda/node_modules/.package-lock.json +370 -345
  45. package/rds-lambda/node_modules/@babel/code-frame/README.md +1 -1
  46. package/rds-lambda/node_modules/@babel/code-frame/package.json +3 -2
  47. package/rds-lambda/node_modules/@babel/core/cjs-proxy.cjs +3 -1
  48. package/rds-lambda/node_modules/@babel/core/package.json +10 -10
  49. package/rds-lambda/node_modules/@babel/generator/package.json +3 -3
  50. package/rds-lambda/node_modules/@babel/helper-compilation-targets/package.json +1 -5
  51. package/rds-lambda/node_modules/@babel/helpers/package.json +6 -6
  52. package/rds-lambda/node_modules/@babel/highlight/README.md +1 -1
  53. package/rds-lambda/node_modules/@babel/highlight/package.json +2 -3
  54. package/rds-lambda/node_modules/@babel/parser/package.json +3 -3
  55. package/rds-lambda/node_modules/@babel/traverse/package.json +6 -5
  56. package/rds-lambda/node_modules/@babel/types/README.md +1 -1
  57. package/rds-lambda/node_modules/@babel/types/package.json +3 -4
  58. package/rds-lambda/node_modules/@jest/console/package.json +5 -5
  59. package/rds-lambda/node_modules/@jest/core/package.json +20 -20
  60. package/rds-lambda/node_modules/@jest/environment/package.json +4 -4
  61. package/rds-lambda/node_modules/@jest/expect/package.json +4 -4
  62. package/rds-lambda/node_modules/@jest/expect-utils/package.json +3 -3
  63. package/rds-lambda/node_modules/@jest/fake-timers/package.json +6 -6
  64. package/rds-lambda/node_modules/@jest/globals/package.json +5 -5
  65. package/rds-lambda/node_modules/@jest/reporters/package.json +10 -10
  66. package/rds-lambda/node_modules/@jest/test-result/package.json +5 -5
  67. package/rds-lambda/node_modules/@jest/test-sequencer/package.json +5 -5
  68. package/rds-lambda/node_modules/@jest/transform/package.json +6 -6
  69. package/rds-lambda/node_modules/@jridgewell/resolve-uri/package.json +2 -2
  70. package/rds-lambda/node_modules/@jridgewell/trace-mapping/package.json +3 -3
  71. package/rds-lambda/node_modules/@smithy/protocol-http/package.json +2 -2
  72. package/rds-lambda/node_modules/@smithy/types/README.md +37 -0
  73. package/rds-lambda/node_modules/@smithy/types/package.json +3 -2
  74. package/rds-lambda/node_modules/@types/node/README.md +2 -2
  75. package/rds-lambda/node_modules/@types/node/package.json +2 -7
  76. package/rds-lambda/node_modules/babel-jest/package.json +4 -4
  77. package/rds-lambda/node_modules/browserslist/package.json +4 -4
  78. package/rds-lambda/node_modules/caniuse-lite/package.json +1 -1
  79. package/rds-lambda/node_modules/dedent/README.md +56 -0
  80. package/rds-lambda/node_modules/dedent/dist/dedent.d.mts +17 -0
  81. package/rds-lambda/node_modules/dedent/dist/dedent.mjs +59 -0
  82. package/rds-lambda/node_modules/dedent/package.json +54 -10
  83. package/rds-lambda/node_modules/electron-to-chromium/full-chromium-versions.json +1 -1
  84. package/rds-lambda/node_modules/electron-to-chromium/full-versions.json +1 -1
  85. package/rds-lambda/node_modules/electron-to-chromium/package.json +1 -1
  86. package/rds-lambda/node_modules/electron-to-chromium/versions.json +1 -1
  87. package/rds-lambda/node_modules/expect/package.json +7 -7
  88. package/rds-lambda/node_modules/is-core-module/CHANGELOG.md +7 -0
  89. package/rds-lambda/node_modules/is-core-module/core.json +3 -3
  90. package/rds-lambda/node_modules/is-core-module/package.json +5 -5
  91. package/rds-lambda/node_modules/istanbul-lib-report/CHANGELOG.md +7 -0
  92. package/rds-lambda/node_modules/istanbul-lib-report/package.json +5 -6
  93. package/rds-lambda/node_modules/istanbul-reports/CHANGELOG.md +7 -0
  94. package/rds-lambda/node_modules/istanbul-reports/package.json +1 -1
  95. package/rds-lambda/node_modules/jest/package.json +4 -4
  96. package/rds-lambda/node_modules/jest-circus/package.json +13 -14
  97. package/rds-lambda/node_modules/jest-cli/package.json +7 -7
  98. package/rds-lambda/node_modules/jest-config/package.json +11 -11
  99. package/rds-lambda/node_modules/jest-diff/package.json +4 -4
  100. package/rds-lambda/node_modules/jest-each/package.json +4 -4
  101. package/rds-lambda/node_modules/jest-environment-node/package.json +7 -7
  102. package/rds-lambda/node_modules/jest-haste-map/package.json +4 -4
  103. package/rds-lambda/node_modules/jest-leak-detector/package.json +3 -3
  104. package/rds-lambda/node_modules/jest-matcher-utils/package.json +5 -5
  105. package/rds-lambda/node_modules/jest-message-util/package.json +3 -3
  106. package/rds-lambda/node_modules/jest-mock/package.json +3 -3
  107. package/rds-lambda/node_modules/jest-resolve/package.json +5 -5
  108. package/rds-lambda/node_modules/jest-resolve-dependencies/package.json +7 -7
  109. package/rds-lambda/node_modules/jest-runner/package.json +17 -17
  110. package/rds-lambda/node_modules/jest-runtime/package.json +15 -15
  111. package/rds-lambda/node_modules/jest-snapshot/package.json +12 -12
  112. package/rds-lambda/node_modules/jest-util/package.json +2 -2
  113. package/rds-lambda/node_modules/jest-validate/package.json +3 -3
  114. package/rds-lambda/node_modules/jest-watcher/package.json +4 -4
  115. package/rds-lambda/node_modules/jest-worker/package.json +4 -4
  116. package/rds-lambda/node_modules/make-dir/license +1 -1
  117. package/rds-lambda/node_modules/make-dir/node_modules/lru-cache/LICENSE +15 -0
  118. package/rds-lambda/node_modules/make-dir/node_modules/lru-cache/README.md +166 -0
  119. package/rds-lambda/node_modules/make-dir/node_modules/lru-cache/package.json +34 -0
  120. package/rds-lambda/node_modules/make-dir/node_modules/semver/LICENSE +15 -0
  121. package/rds-lambda/node_modules/make-dir/node_modules/semver/README.md +637 -0
  122. package/rds-lambda/node_modules/make-dir/node_modules/semver/package.json +87 -0
  123. package/rds-lambda/node_modules/make-dir/node_modules/semver/range.bnf +16 -0
  124. package/rds-lambda/node_modules/make-dir/node_modules/yallist/LICENSE +15 -0
  125. package/rds-lambda/node_modules/make-dir/node_modules/yallist/README.md +204 -0
  126. package/rds-lambda/node_modules/make-dir/node_modules/yallist/package.json +29 -0
  127. package/rds-lambda/node_modules/make-dir/package.json +15 -11
  128. package/rds-lambda/node_modules/make-dir/readme.md +1 -1
  129. package/rds-lambda/node_modules/pretty-format/package.json +3 -3
  130. package/rds-lambda/node_modules/resolve/lib/core.json +4 -1
  131. package/rds-lambda/node_modules/resolve/package.json +6 -6
  132. package/rds-lambda/node_modules/tslib/package.json +1 -1
  133. package/rds-lambda/node_modules/tslib/tslib.es6.mjs +1 -1
  134. package/rds-lambda/package-lock.json +370 -345
  135. package/rds-patching-lambda/node_modules/.package-lock.json +13 -13
  136. package/rds-patching-lambda/node_modules/@smithy/protocol-http/package.json +2 -2
  137. package/rds-patching-lambda/node_modules/@smithy/types/README.md +37 -0
  138. package/rds-patching-lambda/node_modules/@smithy/types/package.json +3 -2
  139. package/rds-patching-lambda/node_modules/@types/node/README.md +2 -2
  140. package/rds-patching-lambda/node_modules/@types/node/package.json +2 -7
  141. package/rds-patching-lambda/node_modules/tslib/package.json +1 -1
  142. package/rds-patching-lambda/node_modules/tslib/tslib.es6.mjs +1 -1
  143. package/rds-patching-lambda/package-lock.json +13 -13
  144. package/src/__tests__/__snapshots__/model-transformer.test.ts.snap +688 -0
  145. package/src/__tests__/model-transformer.test.ts +58 -1
  146. package/src/graphql-types/mutation.ts +11 -3
  147. package/src/resolvers/generators/dynamodb-vtl-generator.ts +7 -5
  148. package/src/resolvers/generators/rds-vtl-generator.ts +12 -10
  149. package/src/resolvers/generators/vtl-generator.ts +6 -5
  150. package/src/resolvers/rds/mutation.ts +18 -3
  151. package/src/resolvers/rds/query.ts +9 -1
  152. package/src/resolvers/rds/resolver.ts +45 -26
  153. package/src/resources/model-resource-generator.ts +5 -5
  154. package/tsconfig.tsbuildinfo +1 -1
  155. package/rds-lambda/node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec/LICENSE +0 -21
  156. package/rds-lambda/node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec/README.md +0 -200
  157. package/rds-lambda/node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +0 -164
  158. package/rds-lambda/node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +0 -1
  159. package/rds-lambda/node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec/package.json +0 -75
  160. package/rds-lambda/node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts +0 -198
  161. package/rds-lambda/node_modules/@types/prettier/LICENSE +0 -21
  162. package/rds-lambda/node_modules/@types/prettier/README.md +0 -16
  163. package/rds-lambda/node_modules/@types/prettier/package.json +0 -65
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jest/transform",
3
- "version": "29.6.1",
3
+ "version": "29.6.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/facebook/jest.git",
@@ -25,22 +25,22 @@
25
25
  "convert-source-map": "^2.0.0",
26
26
  "fast-json-stable-stringify": "^2.1.0",
27
27
  "graceful-fs": "^4.2.9",
28
- "jest-haste-map": "^29.6.1",
28
+ "jest-haste-map": "^29.6.2",
29
29
  "jest-regex-util": "^29.4.3",
30
- "jest-util": "^29.6.1",
30
+ "jest-util": "^29.6.2",
31
31
  "micromatch": "^4.0.4",
32
32
  "pirates": "^4.0.4",
33
33
  "slash": "^3.0.0",
34
34
  "write-file-atomic": "^4.0.2"
35
35
  },
36
36
  "devDependencies": {
37
- "@jest/test-utils": "^29.6.1",
37
+ "@jest/test-utils": "^29.6.2",
38
38
  "@types/babel__core": "^7.1.14",
39
39
  "@types/convert-source-map": "^2.0.0",
40
40
  "@types/graceful-fs": "^4.1.3",
41
41
  "@types/micromatch": "^4.0.1",
42
42
  "@types/write-file-atomic": "^4.0.0",
43
- "dedent": "^0.7.0"
43
+ "dedent": "^1.0.0"
44
44
  },
45
45
  "engines": {
46
46
  "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "1f019afdcdfc54a6664908bb45f343db4e3d0848"
51
+ "gitHead": "0fd5b1c37555f485c56a6ad2d6b010a72204f9f6"
52
52
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jridgewell/resolve-uri",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Resolve a URI relative to an optional base URI",
5
5
  "keywords": [
6
6
  "resolve",
@@ -13,7 +13,7 @@
13
13
  "repository": "https://github.com/jridgewell/resolve-uri",
14
14
  "main": "dist/resolve-uri.umd.js",
15
15
  "module": "dist/resolve-uri.mjs",
16
- "typings": "dist/types/resolve-uri.d.ts",
16
+ "types": "dist/types/resolve-uri.d.ts",
17
17
  "exports": {
18
18
  ".": [
19
19
  {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jridgewell/trace-mapping",
3
- "version": "0.3.18",
3
+ "version": "0.3.19",
4
4
  "description": "Trace the original position through a source map",
5
5
  "keywords": [
6
6
  "source",
@@ -69,7 +69,7 @@
69
69
  "typescript": "4.8.4"
70
70
  },
71
71
  "dependencies": {
72
- "@jridgewell/resolve-uri": "3.1.0",
73
- "@jridgewell/sourcemap-codec": "1.4.14"
72
+ "@jridgewell/resolve-uri": "^3.1.0",
73
+ "@jridgewell/sourcemap-codec": "^1.4.14"
74
74
  }
75
75
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/protocol-http",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@smithy/types": "^1.1.1",
26
+ "@smithy/types": "^1.2.0",
27
27
  "tslib": "^2.5.0"
28
28
  },
29
29
  "engines": {
@@ -2,3 +2,40 @@
2
2
 
3
3
  [![NPM version](https://img.shields.io/npm/v/@smithy/types/latest.svg)](https://www.npmjs.com/package/@smithy/types)
4
4
  [![NPM downloads](https://img.shields.io/npm/dm/@smithy/types.svg)](https://www.npmjs.com/package/@smithy/types)
5
+
6
+ ## Usage
7
+
8
+ This package is mostly used internally by generated clients.
9
+ Some public components have independent applications.
10
+
11
+ ### Scenario: Narrowing a smithy-typescript generated client's output payload blob types
12
+
13
+ ---
14
+
15
+ This is mostly relevant to operations with streaming bodies such as within
16
+ the S3Client in the AWS SDK for JavaScript v3.
17
+
18
+ Because blob payload types are platform dependent, you may wish to indicate in your application that a client is running in a specific
19
+ environment. This narrows the blob payload types.
20
+
21
+ ```typescript
22
+ import { GetObjectCommand, S3Client } from "@aws-sdk/client-s3";
23
+ import type { NodeJsClient, SdkStream, StreamingBlobPayloadOutputTypes } from "@smithy/types";
24
+ import type { IncomingMessage } from "node:http";
25
+
26
+ // default client init.
27
+ const s3Default = new S3Client({});
28
+
29
+ // client init with type narrowing.
30
+ const s3NarrowType = new S3Client({}) as NodeJsClient<S3Client>;
31
+
32
+ // The default type of blob payloads is a wide union type including multiple possible
33
+ // request handlers.
34
+ const body1: StreamingBlobPayloadOutputTypes = (await s3Default.send(new GetObjectCommand({ Key: "", Bucket: "" })))
35
+ .Body!;
36
+
37
+ // This is of the narrower type SdkStream<IncomingMessage> representing
38
+ // blob payload responses using specifically the node:http request handler.
39
+ const body2: SdkStream<IncomingMessage> = (await s3NarrowType.send(new GetObjectCommand({ Key: "", Bucket: "" })))
40
+ .Body!;
41
+ ```
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/types",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -11,7 +11,8 @@
11
11
  "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
12
12
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
13
13
  "format": "prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \"**/*.{ts,md,json}\"",
14
- "test": "tsc -p tsconfig.test.json"
14
+ "test": "tsc -p tsconfig.test.json",
15
+ "extract:docs": "api-extractor run --local"
15
16
  },
16
17
  "main": "./dist-cjs/index.js",
17
18
  "module": "./dist-es/index.js",
@@ -8,9 +8,9 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 12 Jul 2023 23:02:41 GMT
11
+ * Last updated: Sat, 05 Aug 2023 10:32:49 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
15
15
  # Credits
16
- These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky).
16
+ These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky).
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.4.2",
3
+ "version": "20.4.8",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -110,11 +110,6 @@
110
110
  "url": "https://github.com/eps1lon",
111
111
  "githubUsername": "eps1lon"
112
112
  },
113
- {
114
- "name": "Simon Schick",
115
- "url": "https://github.com/SimonSchick",
116
- "githubUsername": "SimonSchick"
117
- },
118
113
  {
119
114
  "name": "Thomas den Hollander",
120
115
  "url": "https://github.com/ThomasdenH",
@@ -232,6 +227,6 @@
232
227
  },
233
228
  "scripts": {},
234
229
  "dependencies": {},
235
- "typesPublisherContentHash": "8ccebbf79ef4c9ade9cde2b505492190d140170bf4372bb3fe1ebd36e9344eac",
230
+ "typesPublisherContentHash": "9acef897909a6e2f2e35b1241c4aee3acd41d6d87a7676afe8d21d5c84e063ad",
236
231
  "typeScriptVersion": "4.3"
237
232
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "babel-jest",
3
3
  "description": "Jest plugin to use babel for transformation.",
4
- "version": "29.6.1",
4
+ "version": "29.6.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/facebook/jest.git",
@@ -18,7 +18,7 @@
18
18
  "./package.json": "./package.json"
19
19
  },
20
20
  "dependencies": {
21
- "@jest/transform": "^29.6.1",
21
+ "@jest/transform": "^29.6.2",
22
22
  "@types/babel__core": "^7.1.14",
23
23
  "babel-plugin-istanbul": "^6.1.1",
24
24
  "babel-preset-jest": "^29.5.0",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@babel/core": "^7.11.6",
31
- "@jest/test-utils": "^29.6.1",
31
+ "@jest/test-utils": "^29.6.2",
32
32
  "@types/graceful-fs": "^4.1.3"
33
33
  },
34
34
  "peerDependencies": {
@@ -40,5 +40,5 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "1f019afdcdfc54a6664908bb45f343db4e3d0848"
43
+ "gitHead": "0fd5b1c37555f485c56a6ad2d6b010a72204f9f6"
44
44
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browserslist",
3
- "version": "4.21.9",
3
+ "version": "4.21.10",
4
4
  "description": "Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset",
5
5
  "keywords": [
6
6
  "caniuse",
@@ -25,9 +25,9 @@
25
25
  "license": "MIT",
26
26
  "repository": "browserslist/browserslist",
27
27
  "dependencies": {
28
- "caniuse-lite": "^1.0.30001503",
29
- "electron-to-chromium": "^1.4.431",
30
- "node-releases": "^2.0.12",
28
+ "caniuse-lite": "^1.0.30001517",
29
+ "electron-to-chromium": "^1.4.477",
30
+ "node-releases": "^2.0.13",
31
31
  "update-browserslist-db": "^1.0.11"
32
32
  },
33
33
  "engines": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "caniuse-lite",
3
- "version": "1.0.30001517",
3
+ "version": "1.0.30001519",
4
4
  "description": "A smaller version of caniuse-db, with only the essentials!",
5
5
  "main": "dist/unpacker/index.js",
6
6
  "files": [
@@ -54,6 +54,62 @@ That's all.
54
54
  Wait! I lied. Dedent can also be used as a function.
55
55
  ```
56
56
 
57
+ ## Options
58
+
59
+ You can customize the options `dedent` runs with by calling its `withOptions` method with an object:
60
+
61
+ <!-- prettier-ignore -->
62
+ ```js
63
+ import dedent from 'dedent';
64
+
65
+ dedent.withOptions({ /* ... */ })`input`;
66
+ dedent.withOptions({ /* ... */ })(`input`);
67
+ ```
68
+
69
+ `options` returns a new `dedent` function, so if you'd like to reuse the same options, you can create a dedicated `dedent` function:
70
+
71
+ <!-- prettier-ignore -->
72
+ ```js
73
+ import dedent from 'dedent';
74
+
75
+ const dedenter = dedent.withOptions({ /* ... */ });
76
+
77
+ dedenter`input`;
78
+ dedenter(`input`);
79
+ ```
80
+
81
+ ### `escapeSpecialCharacters`
82
+
83
+ JavaScript string tags by default add an extra `\` escape in front of some special characters such as `$` dollar signs.
84
+ `dedent` will escape those special characters when called as a string tag.
85
+
86
+ If you'd like to change the behavior, an `escapeSpecialCharacters` option is available.
87
+ It defaults to:
88
+
89
+ - `false`: when `dedent` is called as a function
90
+ - `true`: when `dedent` is called as a string tag
91
+
92
+ ```js
93
+ import dedent from "dedent";
94
+
95
+ // "$hello!"
96
+ dedent`
97
+ $hello!
98
+ `;
99
+
100
+ // "\$hello!"
101
+ dedent.withOptions({ escapeSpecialCharacters: false })`
102
+ $hello!
103
+ `;
104
+
105
+ // "$hello!"
106
+ dedent.withOptions({ escapeSpecialCharacters: true })`
107
+ $hello!
108
+ `;
109
+ ```
110
+
111
+ For more context, see [https://github.com/dmnd/dedent/issues/63](🚀 Feature: Add an option to disable special character escaping).
112
+
57
113
  ## License
58
114
 
59
115
  MIT
@@ -0,0 +1,17 @@
1
+ interface DedentOptions {
2
+ escapeSpecialCharacters?: boolean;
3
+ }
4
+ interface Dedent {
5
+ (literals: string): string;
6
+ (strings: TemplateStringsArray, ...values: unknown[]): string;
7
+ withOptions: CreateDedent;
8
+ }
9
+ type CreateDedent = (options: DedentOptions) => Dedent;
10
+
11
+ declare const _default: {
12
+ (literals: string): string;
13
+ (strings: TemplateStringsArray, ...values: unknown[]): string;
14
+ withOptions(newOptions: DedentOptions): any;
15
+ };
16
+
17
+ export { CreateDedent, Dedent, DedentOptions, _default as default };
@@ -0,0 +1,59 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ export default createDedent({});
7
+ function createDedent(options) {
8
+ dedent.withOptions = newOptions => createDedent(_objectSpread(_objectSpread({}, options), newOptions));
9
+ return dedent;
10
+ function dedent(strings, ...values) {
11
+ const raw = typeof strings === "string" ? [strings] : strings.raw;
12
+ const {
13
+ escapeSpecialCharacters = Array.isArray(strings)
14
+ } = options;
15
+
16
+ // first, perform interpolation
17
+ let result = "";
18
+ for (let i = 0; i < raw.length; i++) {
19
+ let next = raw[i];
20
+ if (escapeSpecialCharacters) {
21
+ // handle escaped newlines, backticks, and interpolation characters
22
+ next = next.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\{/g, "{");
23
+ }
24
+ result += next;
25
+ if (i < values.length) {
26
+ // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
27
+ result += values[i];
28
+ }
29
+ }
30
+
31
+ // now strip indentation
32
+ const lines = result.split("\n");
33
+ let mindent = null;
34
+ for (const l of lines) {
35
+ const m = l.match(/^(\s+)\S+/);
36
+ if (m) {
37
+ const indent = m[1].length;
38
+ if (!mindent) {
39
+ // this is the first indented line
40
+ mindent = indent;
41
+ } else {
42
+ mindent = Math.min(mindent, indent);
43
+ }
44
+ }
45
+ }
46
+ if (mindent !== null) {
47
+ const m = mindent; // appease TypeScript
48
+ result = lines
49
+ // https://github.com/typescript-eslint/typescript-eslint/issues/7140
50
+ // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
51
+ .map(l => l[0] === " " || l[0] === "\t" ? l.slice(m) : l).join("\n");
52
+ }
53
+ return result
54
+ // dedent eats leading and trailing whitespace too
55
+ .trim()
56
+ // handle escaped newlines at the end to ensure they don't get stripped too
57
+ .replace(/\\n/g, "\n");
58
+ }
59
+ }
@@ -1,10 +1,31 @@
1
1
  {
2
2
  "name": "dedent",
3
- "version": "0.7.0",
3
+ "version": "1.5.1",
4
4
  "description": "An ES6 string tag that strips indentation from multi-line strings",
5
5
  "main": "dist/dedent.js",
6
+ "types": "./dist/dedent.d.ts",
7
+ "module": "./dist/dedent.mjs",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./dist/dedent.d.mts",
12
+ "default": "./dist/dedent.mjs"
13
+ },
14
+ "require": {
15
+ "types": "./dist/dedent.d.ts",
16
+ "default": "./dist/dedent.js"
17
+ }
18
+ }
19
+ },
6
20
  "files": [
21
+ "dist/dedent.d.mts",
22
+ "dist/dedent.d.ts",
7
23
  "dist/dedent.js",
24
+ "dist/dedent.mjs",
25
+ "macro.js",
26
+ "index.d.ts",
27
+ "macro.d.ts",
28
+ "README.md",
8
29
  "LICENSE"
9
30
  ],
10
31
  "repository": {
@@ -27,17 +48,40 @@
27
48
  "url": "https://github.com/dmnd/dedent/issues"
28
49
  },
29
50
  "homepage": "https://github.com/dmnd/dedent",
51
+ "peerDependencies": {
52
+ "babel-plugin-macros": "^3.1.0"
53
+ },
54
+ "peerDependenciesMeta": {
55
+ "babel-plugin-macros": {
56
+ "optional": true
57
+ }
58
+ },
30
59
  "devDependencies": {
31
- "babel-cli": "^6.22.2",
32
- "babel-preset-es2015": "^6.22.0",
33
- "babel-preset-es2016": "^6.22.0",
34
- "babel-preset-es2017": "^6.22.0",
35
- "eslint": "^3.14.1",
36
- "jest": "^18.1.0"
60
+ "@babel/cli": "^7.21.5",
61
+ "@babel/core": "^7.21.8",
62
+ "@babel/preset-env": "^7.21.5",
63
+ "@babel/preset-typescript": "^7.22.5",
64
+ "@types/babel-plugin-macros": "^3.1.0",
65
+ "@types/jest": "^29.5.3",
66
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
67
+ "@typescript-eslint/parser": "^6.0.0",
68
+ "babel-plugin-add-module-exports": "^1.0.4",
69
+ "babel-plugin-macros": "^3.1.0",
70
+ "babel-plugin-tester": "^11.0.4",
71
+ "eslint": "^8.41.0",
72
+ "hermes-eslint": "^0.11.1",
73
+ "jest": "^29.5.0",
74
+ "tsup": "^7.1.0",
75
+ "typescript": "^5.1.6"
37
76
  },
38
77
  "scripts": {
39
- "build": "babel dedent.js --out-file dist/dedent.js",
40
- "lint": "eslint dedent.js __tests__",
41
- "test": "jest"
78
+ "build": "yarn build:legacy && yarn build:modern && yarn build:types",
79
+ "build:legacy": "BABEL_ENV=legacy babel dedent.ts --out-file dist/dedent.js",
80
+ "build:modern": "BABEL_ENV=modern babel dedent.ts --out-file dist/dedent.mjs",
81
+ "build:types": "tsup dedent.ts --dts-only --format cjs,esm",
82
+ "lint": "eslint .",
83
+ "prepack": "yarn build",
84
+ "test": "jest",
85
+ "tsc": "tsc"
42
86
  }
43
87
  }