Skip to content

Commit 16584e5

Browse files
committed
version bump 1.11.0: suppress exports
`DO_NOT_EXPORT_CODEPAGE` suppresses commonjs exports
1 parent e19c867 commit 16584e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+66
-50
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ the object, edit the `JSVAR` shell variable in `make.sh` and run the script.
4848
The utilities functions are contained in `cputils.js`, which assumes that the
4949
appropriate codepage scripts were loaded.
5050

51+
The script will manipulate `module.exports` if available (e.g. in a CommonJS
52+
`require` context). This is not always desirable. To prevent the behavior,
53+
define `DO_NOT_EXPORT_CODEPAGE`.
54+
5155
## Usage
5256

5357
Most codepages are indexed by number. To get the unicode character for a given

codepage.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ awk -F, '{print $1, $2, $3}' $INFILE | while read cp url cptype; do
427427
sed 's/"\([0-9]+\)":/\1:/g' <bits/$cp.js.tmp >bits/$cp.js
428428
rm -f bits/$cp.js.tmp
429429
done
430-
echo "if (typeof module !== 'undefined' && module.exports) module.exports = $JSVAR;" >> $OUTFILE.tmp
430+
echo "if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = $JSVAR;" >> $OUTFILE.tmp
431431
sed 's/"\([0-9]+\)":/\1:/g' <$OUTFILE.tmp >$OUTFILE
432432
rm -f $OUTFILE.tmp
433433
```
@@ -753,7 +753,7 @@ describe('failures', function() {
753753
```json>package.json
754754
{
755755
"name": "codepage",
756-
"version": "1.10.1",
756+
"version": "1.11.0",
757757
"author": "SheetJS",
758758
"description": "pure-JS library to handle codepages",
759759
"keywords": [ "codepage", "iconv", "convert", "strings" ],

cpexcel.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cptable.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cputils.flow.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
1212
if(typeof cptable === "undefined") {
1313
if(typeof require !== "undefined"){
1414
var cpt/*:CPTable*/ = require('./cptable');
15-
if (typeof module !== 'undefined' && module.exports) module.exports = factory(cpt);
15+
if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = factory(cpt);
1616
else root.cptable = factory(cpt);
1717
} else throw new Error("cptable not found");
1818
} else cptable = factory(cptable);

cputils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
if(typeof cptable === "undefined") {
77
if(typeof require !== "undefined"){
88
var cpt = require('./cptable');
9-
if (typeof module !== 'undefined' && module.exports) module.exports = factory(cpt);
9+
if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = factory(cpt);
1010
else root.cptable = factory(cpt);
1111
} else throw new Error("cptable not found");
1212
} else cptable = factory(cptable);

ctest/fixtures.js

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cpexcel.full.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)