Skip to content

Commit 34e66f2

Browse files
.
1 parent 64514c3 commit 34e66f2

19 files changed

+94
-76
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ readXlsxFile(file, { schema }).then(({ rows, errors }) => {
258258
The function for converting input data rows to JSON objects using a schema is exported independently as `read-excel-file/map`, if anyone's interested.
259259

260260
```js
261-
import convertToJson from "read-excel-file/map"
261+
import mapToObjects from "read-excel-file/map"
262262

263-
const { rows, errors } = convertToJson(data, schema, options)
263+
const { rows, errors } = mapToObjects(data, schema, options)
264264
```
265265

266266
Maps a list of rows — `data` — into a list of objects — `rows` — using a `schema` as a mapping specification.

map/index.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
exports = module.exports = require('../commonjs/read/schema/convertToJson.js').default
2-
exports['default'] = require('../commonjs/read/schema/convertToJson.js').default
1+
exports = module.exports = require('../commonjs/read/schema/mapToObjects.js').default
2+
exports['default'] = require('../commonjs/read/schema/mapToObjects.js').default

map/index.cjs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
// It fixes the issue when some software doesn't see files with `*.cjs` file extensions
44
// when used as the `main` property value in `package.json`.
55

6-
exports = module.exports = require('../commonjs/read/schema/convertToJson.js').default
7-
exports['default'] = require('../commonjs/read/schema/convertToJson.js').default
6+
exports = module.exports = require('../commonjs/read/schema/mapToObjects.js').default
7+
exports['default'] = require('../commonjs/read/schema/mapToObjects.js').default

map/index.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import {
22
Row,
33
Schema,
4+
Error,
45
MappingParameters
56
} from '../types.d.js';
67

78
export {
89
MappingParameters
910
} from '../types.d.js'
1011

11-
export default function map<T>(data: Row[], schema: Schema<T>, options?: MappingParameters): T[];
12+
export default function map<T>(data: Row[], schema: Schema<T>, options?: MappingParameters): {
13+
rows: T[];
14+
errors: Error[];
15+
};

map/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default as default } from '../modules/read/schema/convertToJson.js'
1+
export { default as default } from '../modules/read/schema/mapToObjects.js'

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "read-excel-file",
3-
"version": "5.8.6",
3+
"version": "5.8.7",
44
"description": "Read small to medium `*.xlsx` files in a browser or Node.js. Parse to JSON with a strict schema.",
55
"module": "index.js",
66
"main": "index.cjs",

schema/index.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
exports = module.exports = require('../commonjs/read/schema/convertToJson.legacy.js').default
2-
exports['default'] = require('../commonjs/read/schema/convertToJson.legacy.js').default
1+
exports = module.exports = require('../commonjs/read/schema/mapToObjects.legacy.js').default
2+
exports['default'] = require('../commonjs/read/schema/mapToObjects.legacy.js').default

schema/index.cjs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
// It fixes the issue when some software doesn't see files with `*.cjs` file extensions
44
// when used as the `main` property value in `package.json`.
55

6-
exports = module.exports = require('../commonjs/read/schema/convertToJson.legacy.js').default
7-
exports['default'] = require('../commonjs/read/schema/convertToJson.legacy.js').default
6+
exports = module.exports = require('../commonjs/read/schema/mapToObjects.legacy.js').default
7+
exports['default'] = require('../commonjs/read/schema/mapToObjects.legacy.js').default

schema/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default as default } from '../modules/read/schema/convertToJson.legacy.js'
1+
export { default as default } from '../modules/read/schema/mapToObjects.legacy.js'

0 commit comments

Comments
 (0)