cssstyle 1.3.0 → 2.2.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 (118) hide show
  1. package/README.md +1 -1
  2. package/lib/CSSStyleDeclaration.js +5 -0
  3. package/lib/CSSStyleDeclaration.test.js +31 -2
  4. package/lib/allExtraProperties.js +60 -241
  5. package/lib/allProperties.js +444 -489
  6. package/lib/allWebkitProperties.js +194 -0
  7. package/lib/implementedProperties.js +1 -1
  8. package/lib/parsers.js +7 -4
  9. package/lib/parsers.test.js +35 -1
  10. package/lib/properties.js +1 -1
  11. package/lib/utils/colorSpace.js +21 -0
  12. package/package.json +7 -4
  13. package/.eslintignore +0 -4
  14. package/.eslintrc.js +0 -55
  15. package/.travis.yml +0 -17
  16. package/AUTHORS +0 -31
  17. package/coverage/clover.xml +0 -2150
  18. package/coverage/coverage-final.json +0 -86
  19. package/coverage/lcov-report/base.css +0 -224
  20. package/coverage/lcov-report/block-navigation.js +0 -79
  21. package/coverage/lcov-report/index.html +0 -123
  22. package/coverage/lcov-report/lib/CSSStyleDeclaration.js.html +0 -834
  23. package/coverage/lcov-report/lib/allExtraProperties.js.html +0 -813
  24. package/coverage/lcov-report/lib/allProperties.js.html +0 -1560
  25. package/coverage/lcov-report/lib/constants.js.html +0 -87
  26. package/coverage/lcov-report/lib/index.html +0 -149
  27. package/coverage/lcov-report/lib/parsers.js.html +0 -2193
  28. package/coverage/lcov-report/lib/properties/azimuth.js.html +0 -270
  29. package/coverage/lcov-report/lib/properties/background.js.html +0 -126
  30. package/coverage/lcov-report/lib/properties/backgroundAttachment.js.html +0 -141
  31. package/coverage/lcov-report/lib/properties/backgroundColor.js.html +0 -177
  32. package/coverage/lcov-report/lib/properties/backgroundImage.js.html +0 -165
  33. package/coverage/lcov-report/lib/properties/backgroundPosition.js.html +0 -243
  34. package/coverage/lcov-report/lib/properties/backgroundRepeat.js.html +0 -165
  35. package/coverage/lcov-report/lib/properties/border.js.html +0 -168
  36. package/coverage/lcov-report/lib/properties/borderBottom.js.html +0 -120
  37. package/coverage/lcov-report/lib/properties/borderBottomColor.js.html +0 -117
  38. package/coverage/lcov-report/lib/properties/borderBottomStyle.js.html +0 -132
  39. package/coverage/lcov-report/lib/properties/borderBottomWidth.js.html +0 -117
  40. package/coverage/lcov-report/lib/properties/borderCollapse.js.html +0 -147
  41. package/coverage/lcov-report/lib/properties/borderColor.js.html +0 -159
  42. package/coverage/lcov-report/lib/properties/borderLeft.js.html +0 -120
  43. package/coverage/lcov-report/lib/properties/borderLeftColor.js.html +0 -117
  44. package/coverage/lcov-report/lib/properties/borderLeftStyle.js.html +0 -132
  45. package/coverage/lcov-report/lib/properties/borderLeftWidth.js.html +0 -117
  46. package/coverage/lcov-report/lib/properties/borderRight.js.html +0 -120
  47. package/coverage/lcov-report/lib/properties/borderRightColor.js.html +0 -117
  48. package/coverage/lcov-report/lib/properties/borderRightStyle.js.html +0 -132
  49. package/coverage/lcov-report/lib/properties/borderRightWidth.js.html +0 -117
  50. package/coverage/lcov-report/lib/properties/borderSpacing.js.html +0 -192
  51. package/coverage/lcov-report/lib/properties/borderStyle.js.html +0 -183
  52. package/coverage/lcov-report/lib/properties/borderTop.js.html +0 -120
  53. package/coverage/lcov-report/lib/properties/borderTopColor.js.html +0 -117
  54. package/coverage/lcov-report/lib/properties/borderTopStyle.js.html +0 -132
  55. package/coverage/lcov-report/lib/properties/borderTopWidth.js.html +0 -120
  56. package/coverage/lcov-report/lib/properties/borderWidth.js.html +0 -207
  57. package/coverage/lcov-report/lib/properties/bottom.js.html +0 -111
  58. package/coverage/lcov-report/lib/properties/clear.js.html +0 -117
  59. package/coverage/lcov-report/lib/properties/clip.js.html +0 -210
  60. package/coverage/lcov-report/lib/properties/color.js.html +0 -111
  61. package/coverage/lcov-report/lib/properties/cssFloat.js.html +0 -105
  62. package/coverage/lcov-report/lib/properties/flex.js.html +0 -204
  63. package/coverage/lcov-report/lib/properties/flexBasis.js.html +0 -153
  64. package/coverage/lcov-report/lib/properties/flexGrow.js.html +0 -126
  65. package/coverage/lcov-report/lib/properties/flexShrink.js.html +0 -126
  66. package/coverage/lcov-report/lib/properties/float.js.html +0 -105
  67. package/coverage/lcov-report/lib/properties/floodColor.js.html +0 -111
  68. package/coverage/lcov-report/lib/properties/font.js.html +0 -198
  69. package/coverage/lcov-report/lib/properties/fontFamily.js.html +0 -168
  70. package/coverage/lcov-report/lib/properties/fontSize.js.html +0 -183
  71. package/coverage/lcov-report/lib/properties/fontStyle.js.html +0 -123
  72. package/coverage/lcov-report/lib/properties/fontVariant.js.html +0 -123
  73. package/coverage/lcov-report/lib/properties/fontWeight.js.html +0 -168
  74. package/coverage/lcov-report/lib/properties/height.js.html +0 -141
  75. package/coverage/lcov-report/lib/properties/index.html +0 -1111
  76. package/coverage/lcov-report/lib/properties/left.js.html +0 -111
  77. package/coverage/lcov-report/lib/properties/lightingColor.js.html +0 -111
  78. package/coverage/lcov-report/lib/properties/lineHeight.js.html +0 -147
  79. package/coverage/lcov-report/lib/properties/margin.js.html +0 -273
  80. package/coverage/lcov-report/lib/properties/marginBottom.js.html +0 -108
  81. package/coverage/lcov-report/lib/properties/marginLeft.js.html +0 -108
  82. package/coverage/lcov-report/lib/properties/marginRight.js.html +0 -108
  83. package/coverage/lcov-report/lib/properties/marginTop.js.html +0 -108
  84. package/coverage/lcov-report/lib/properties/opacity.js.html +0 -111
  85. package/coverage/lcov-report/lib/properties/outlineColor.js.html +0 -111
  86. package/coverage/lcov-report/lib/properties/padding.js.html +0 -252
  87. package/coverage/lcov-report/lib/properties/paddingBottom.js.html +0 -108
  88. package/coverage/lcov-report/lib/properties/paddingLeft.js.html +0 -108
  89. package/coverage/lcov-report/lib/properties/paddingRight.js.html +0 -108
  90. package/coverage/lcov-report/lib/properties/paddingTop.js.html +0 -108
  91. package/coverage/lcov-report/lib/properties/right.js.html +0 -111
  92. package/coverage/lcov-report/lib/properties/stopColor.js.html +0 -111
  93. package/coverage/lcov-report/lib/properties/textLineThroughColor.js.html +0 -111
  94. package/coverage/lcov-report/lib/properties/textOverlineColor.js.html +0 -111
  95. package/coverage/lcov-report/lib/properties/textUnderlineColor.js.html +0 -111
  96. package/coverage/lcov-report/lib/properties/top.js.html +0 -111
  97. package/coverage/lcov-report/lib/properties/webkitBorderAfterColor.js.html +0 -111
  98. package/coverage/lcov-report/lib/properties/webkitBorderBeforeColor.js.html +0 -111
  99. package/coverage/lcov-report/lib/properties/webkitBorderEndColor.js.html +0 -111
  100. package/coverage/lcov-report/lib/properties/webkitBorderStartColor.js.html +0 -111
  101. package/coverage/lcov-report/lib/properties/webkitColumnRuleColor.js.html +0 -111
  102. package/coverage/lcov-report/lib/properties/webkitMatchNearestMailBlockquoteColor.js.html +0 -111
  103. package/coverage/lcov-report/lib/properties/webkitTapHighlightColor.js.html +0 -111
  104. package/coverage/lcov-report/lib/properties/webkitTextEmphasisColor.js.html +0 -111
  105. package/coverage/lcov-report/lib/properties/webkitTextFillColor.js.html +0 -111
  106. package/coverage/lcov-report/lib/properties/webkitTextStrokeColor.js.html +0 -111
  107. package/coverage/lcov-report/lib/properties/width.js.html +0 -141
  108. package/coverage/lcov-report/lib/utils/getBasicPropertyDescriptor.js.html +0 -111
  109. package/coverage/lcov-report/lib/utils/index.html +0 -97
  110. package/coverage/lcov-report/prettify.css +0 -1
  111. package/coverage/lcov-report/prettify.js +0 -2
  112. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  113. package/coverage/lcov-report/sorter.js +0 -170
  114. package/coverage/lcov.info +0 -3711
  115. package/jest.config.js +0 -10
  116. package/scripts/download_latest_properties.js +0 -88
  117. package/scripts/generate_implemented_properties.js +0 -61
  118. package/scripts/generate_properties.js +0 -292
package/jest.config.js DELETED
@@ -1,10 +0,0 @@
1
- module.exports = {
2
- "verbose": true,
3
- "collectCoverage": true,
4
- "collectCoverageFrom": [
5
- "lib/**/*.js",
6
- "!lib/implementedProperties.js",
7
- "!lib/properties.js",
8
- ],
9
- "coverageDirectory": "coverage",
10
- };
@@ -1,88 +0,0 @@
1
- 'use strict';
2
-
3
- /*
4
- * W3C provides JSON list of all CSS properties and their status in the standard
5
- *
6
- * documentation: https://www.w3.org/Style/CSS/all-properties.en.html
7
- * JSON url: ( https://www.w3.org/Style/CSS/all-properties.en.json )
8
- *
9
- * Download that file, filter out duplicates and filter the properties based on the wanted standard level
10
- *
11
- * ED - Editors' Draft (not a W3C Technical Report)
12
- * FPWD - First Public Working Draft
13
- * WD - Working Draft
14
- * LC - Last Call Working Draft
15
- * CR - Candidate Recommendation
16
- * PR - Proposed Recommendation
17
- * REC - Recommendation
18
- * NOTE - Working Group Note
19
- */
20
-
21
- var fs = require('fs');
22
- var path = require('path');
23
-
24
- var request = require('request');
25
-
26
- const { camelToDashed } = require('../lib/parsers');
27
-
28
- var url = 'https://www.w3.org/Style/CSS/all-properties.en.json';
29
-
30
- console.log('Downloading CSS properties...');
31
-
32
- function toCamelCase(propName) {
33
- return propName.replace(/-([a-z])/g, function(g) {
34
- return g[1].toUpperCase();
35
- });
36
- }
37
-
38
- request(url, function(error, response, body) {
39
- if (!error && response.statusCode === 200) {
40
- var allCSSProperties = JSON.parse(body);
41
-
42
- // Filter out all properties newer than Working Draft
43
- var workingDraftAndOlderProperties = allCSSProperties.filter(function(cssProp) {
44
- // TODO: --* css Needs additional logic to this module, so filter it out for now
45
- return cssProp.status !== 'ED' && cssProp.status !== 'FPWD' && cssProp.property !== '--*';
46
- });
47
-
48
- // Remove duplicates, there can be many properties in different states of standard
49
- // and add only property names to the list
50
- var CSSpropertyNames = [];
51
- workingDraftAndOlderProperties.forEach(function(cssProp) {
52
- const camelCaseName = toCamelCase(cssProp.property);
53
-
54
- if (CSSpropertyNames.indexOf(camelCaseName) === -1) {
55
- CSSpropertyNames.push(camelCaseName);
56
- }
57
- });
58
-
59
- var out_file = fs.createWriteStream(path.resolve(__dirname, './../lib/allProperties.js'), {
60
- encoding: 'utf-8',
61
- });
62
-
63
- var date_today = new Date();
64
- out_file.write(
65
- "'use strict';\n\n// autogenerated - " +
66
- (date_today.getMonth() + 1 + '/' + date_today.getDate() + '/' + date_today.getFullYear()) +
67
- '\n\n'
68
- );
69
- out_file.write('/*\n *\n * https://www.w3.org/Style/CSS/all-properties.en.html\n */\n\n');
70
-
71
- out_file.write('var allProperties = new Set();\n');
72
- out_file.write('module.exports = allProperties;\n');
73
-
74
- CSSpropertyNames.forEach(function(property) {
75
- out_file.write('allProperties.add(' + JSON.stringify(camelToDashed(property)) + ');\n');
76
- });
77
-
78
- out_file.end(function(err) {
79
- if (err) {
80
- throw err;
81
- }
82
-
83
- console.log('Generated ' + Object.keys(CSSpropertyNames).length + ' properties.');
84
- });
85
- } else {
86
- throw error;
87
- }
88
- });
@@ -1,61 +0,0 @@
1
- 'use strict';
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
- const t = require('babel-types');
6
- const generate = require('babel-generator').default;
7
- const camelToDashed = require('../lib/parsers').camelToDashed;
8
-
9
- const dashedProperties = fs
10
- .readdirSync(path.resolve(__dirname, '../lib/properties'))
11
- .filter(propertyFile => propertyFile.substr(-3) === '.js')
12
- .map(propertyFile => camelToDashed(propertyFile.replace('.js', '')));
13
-
14
- const out_file = fs.createWriteStream(path.resolve(__dirname, '../lib/implementedProperties.js'), {
15
- encoding: 'utf-8',
16
- });
17
- var date_today = new Date();
18
- out_file.write(
19
- "'use strict';\n\n// autogenerated - " +
20
- (date_today.getMonth() + 1 + '/' + date_today.getDate() + '/' + date_today.getFullYear()) +
21
- '\n\n'
22
- );
23
- out_file.write('/*\n *\n * https://www.w3.org/Style/CSS/all-properties.en.html\n */\n\n');
24
-
25
- const statements = [];
26
- statements.push(
27
- t.variableDeclaration('var', [
28
- t.variableDeclarator(
29
- t.identifier('implementedProperties'),
30
- t.newExpression(t.identifier('Set'), [])
31
- ),
32
- ])
33
- );
34
-
35
- dashedProperties.forEach(property => {
36
- statements.push(
37
- t.expressionStatement(
38
- t.callExpression(
39
- t.memberExpression(t.identifier('implementedProperties'), t.identifier('add')),
40
- [t.stringLiteral(property)]
41
- )
42
- )
43
- );
44
- });
45
-
46
- statements.push(
47
- t.expressionStatement(
48
- t.assignmentExpression(
49
- '=',
50
- t.memberExpression(t.identifier('module'), t.identifier('exports')),
51
- t.identifier('implementedProperties')
52
- )
53
- )
54
- );
55
-
56
- out_file.write(generate(t.program(statements)).code + '\n');
57
- out_file.end(function(err) {
58
- if (err) {
59
- throw err;
60
- }
61
- });
@@ -1,292 +0,0 @@
1
- 'use strict';
2
-
3
- var fs = require('fs');
4
- var path = require('path');
5
- var babylon = require('babylon');
6
- var t = require('babel-types');
7
- var generate = require('babel-generator').default;
8
- var traverse = require('babel-traverse').default;
9
- var resolve = require('resolve');
10
-
11
- var camelToDashed = require('../lib/parsers').camelToDashed;
12
-
13
- var basename = path.basename;
14
- var dirname = path.dirname;
15
-
16
- var uniqueIndex = 0;
17
- function getUniqueIndex() {
18
- return uniqueIndex++;
19
- }
20
-
21
- var property_files = fs
22
- .readdirSync(path.resolve(__dirname, '../lib/properties'))
23
- .filter(function(property) {
24
- return property.substr(-3) === '.js';
25
- });
26
- var out_file = fs.createWriteStream(path.resolve(__dirname, '../lib/properties.js'), {
27
- encoding: 'utf-8',
28
- });
29
- var date_today = new Date();
30
- out_file.write(
31
- "'use strict';\n\n// autogenerated - " +
32
- (date_today.getMonth() + 1 + '/' + date_today.getDate() + '/' + date_today.getFullYear()) +
33
- '\n\n'
34
- );
35
- out_file.write('/*\n *\n * https://www.w3.org/Style/CSS/all-properties.en.html\n */\n\n');
36
-
37
- function isModuleDotExports(node) {
38
- return (
39
- t.isMemberExpression(node, { computed: false }) &&
40
- t.isIdentifier(node.object, { name: 'module' }) &&
41
- t.isIdentifier(node.property, { name: 'exports' })
42
- );
43
- }
44
- function isRequire(node, filename) {
45
- if (
46
- t.isCallExpression(node) &&
47
- t.isIdentifier(node.callee, { name: 'require' }) &&
48
- node.arguments.length === 1 &&
49
- t.isStringLiteral(node.arguments[0])
50
- ) {
51
- var relative = node.arguments[0].value;
52
- var fullPath = resolve.sync(relative, { basedir: dirname(filename) });
53
- return { relative: relative, fullPath: fullPath };
54
- } else {
55
- return false;
56
- }
57
- }
58
-
59
- // step 1: parse all files and figure out their dependencies
60
- var parsedFilesByPath = {};
61
- property_files.map(function(property) {
62
- var filename = path.resolve(__dirname, '../lib/properties/' + property);
63
- var src = fs.readFileSync(filename, 'utf8');
64
- property = basename(property, '.js');
65
- var ast = babylon.parse(src);
66
- var dependencies = [];
67
- traverse(ast, {
68
- enter(path) {
69
- var r;
70
- if ((r = isRequire(path.node, filename))) {
71
- dependencies.push(r.fullPath);
72
- }
73
- },
74
- });
75
- parsedFilesByPath[filename] = {
76
- filename: filename,
77
- property: property,
78
- ast: ast,
79
- dependencies: dependencies,
80
- };
81
- });
82
-
83
- // step 2: serialize the files in an order where dependencies are always above
84
- // the files they depend on
85
- var externalDependencies = [];
86
- var parsedFiles = [];
87
- var addedFiles = {};
88
- function addFile(filename, dependencyPath) {
89
- if (dependencyPath.indexOf(filename) !== -1) {
90
- throw new Error(
91
- 'Circular dependency: ' +
92
- dependencyPath
93
- .slice(dependencyPath.indexOf(filename))
94
- .concat([filename])
95
- .join(' -> ')
96
- );
97
- }
98
- var file = parsedFilesByPath[filename];
99
- if (addedFiles[filename]) {
100
- return;
101
- }
102
- if (!file) {
103
- externalDependencies.push(filename);
104
- } else {
105
- file.dependencies.forEach(function(dependency) {
106
- addFile(dependency, dependencyPath.concat([filename]));
107
- });
108
- parsedFiles.push(parsedFilesByPath[filename]);
109
- }
110
- addedFiles[filename] = true;
111
- }
112
- Object.keys(parsedFilesByPath).forEach(function(filename) {
113
- addFile(filename, []);
114
- });
115
- // Step 3: add files to output
116
- // renaming exports to local variables `moduleName_export_exportName`
117
- // and updating require calls as appropriate
118
- var moduleExportsByPath = {};
119
- var statements = [];
120
- externalDependencies.forEach(function(filename, i) {
121
- var id = t.identifier(
122
- 'external_dependency_' + basename(filename, '.js').replace(/[^A-Za-z]/g, '') + '_' + i
123
- );
124
- moduleExportsByPath[filename] = { defaultExports: id };
125
- var relativePath = path.relative(path.resolve(__dirname + '/../lib'), filename);
126
- if (relativePath[0] !== '.') {
127
- relativePath = './' + relativePath;
128
- }
129
- statements.push(
130
- t.variableDeclaration('var', [
131
- t.variableDeclarator(
132
- id,
133
- t.callExpression(t.identifier('require'), [t.stringLiteral(relativePath)])
134
- ),
135
- ])
136
- );
137
- });
138
- function getRequireValue(node, file) {
139
- var r, e;
140
- // replace require("./foo").bar with the named export from foo
141
- if (
142
- t.isMemberExpression(node, { computed: false }) &&
143
- (r = isRequire(node.object, file.filename))
144
- ) {
145
- e = moduleExportsByPath[r.fullPath];
146
- if (!e) {
147
- return;
148
- }
149
- if (!e.namedExports) {
150
- return t.memberExpression(e.defaultExports, node.property);
151
- }
152
- if (!e.namedExports[node.property.name]) {
153
- throw new Error(r.relative + ' does not export ' + node.property.name);
154
- }
155
- return e.namedExports[node.property.name];
156
-
157
- // replace require("./foo") with the default export of foo
158
- } else if ((r = isRequire(node, file.filename))) {
159
- e = moduleExportsByPath[r.fullPath];
160
- if (!e) {
161
- if (/^\.\.\//.test(r.relative)) {
162
- node.arguments[0].value = r.relative.substr(1);
163
- }
164
- return;
165
- }
166
- return e.defaultExports;
167
- }
168
- }
169
- parsedFiles.forEach(function(file) {
170
- var namedExports = {};
171
- var localVariableMap = {};
172
-
173
- traverse(file.ast, {
174
- enter(path) {
175
- // replace require calls with the corresponding value
176
- var r;
177
- if ((r = getRequireValue(path.node, file))) {
178
- path.replaceWith(r);
179
- return;
180
- }
181
-
182
- // if we see `var foo = require('bar')` we can just inline the variable
183
- // representing `require('bar')` wherever `foo` was used.
184
- if (
185
- t.isVariableDeclaration(path.node) &&
186
- path.node.declarations.length === 1 &&
187
- t.isIdentifier(path.node.declarations[0].id) &&
188
- (r = getRequireValue(path.node.declarations[0].init, file))
189
- ) {
190
- var newName = 'compiled_local_variable_reference_' + getUniqueIndex();
191
- path.scope.rename(path.node.declarations[0].id.name, newName);
192
- localVariableMap[newName] = r;
193
- path.remove();
194
- return;
195
- }
196
-
197
- // rename all top level functions to keep them local to the module
198
- if (t.isFunctionDeclaration(path.node) && t.isProgram(path.parent)) {
199
- path.scope.rename(path.node.id.name, file.property + '_local_fn_' + path.node.id.name);
200
- return;
201
- }
202
-
203
- // rename all top level variables to keep them local to the module
204
- if (t.isVariableDeclaration(path.node) && t.isProgram(path.parent)) {
205
- path.node.declarations.forEach(function(declaration) {
206
- path.scope.rename(
207
- declaration.id.name,
208
- file.property + '_local_var_' + declaration.id.name
209
- );
210
- });
211
- return;
212
- }
213
-
214
- // replace module.exports.bar with a variable for the named export
215
- if (
216
- t.isMemberExpression(path.node, { computed: false }) &&
217
- isModuleDotExports(path.node.object)
218
- ) {
219
- var name = path.node.property.name;
220
- var identifier = t.identifier(file.property + '_export_' + name);
221
- path.replaceWith(identifier);
222
- namedExports[name] = identifier;
223
- }
224
- },
225
- });
226
- traverse(file.ast, {
227
- enter(path) {
228
- if (
229
- t.isIdentifier(path.node) &&
230
- Object.prototype.hasOwnProperty.call(localVariableMap, path.node.name)
231
- ) {
232
- path.replaceWith(localVariableMap[path.node.name]);
233
- }
234
- },
235
- });
236
- var defaultExports = t.objectExpression(
237
- Object.keys(namedExports).map(function(name) {
238
- return t.objectProperty(t.identifier(name), namedExports[name]);
239
- })
240
- );
241
- moduleExportsByPath[file.filename] = {
242
- namedExports: namedExports,
243
- defaultExports: defaultExports,
244
- };
245
- statements.push(
246
- t.variableDeclaration(
247
- 'var',
248
- Object.keys(namedExports).map(function(name) {
249
- return t.variableDeclarator(namedExports[name]);
250
- })
251
- )
252
- );
253
- statements.push.apply(statements, file.ast.program.body);
254
- });
255
- var propertyDefinitions = [];
256
- parsedFiles.forEach(function(file) {
257
- var dashed = camelToDashed(file.property);
258
- propertyDefinitions.push(
259
- t.objectProperty(
260
- t.identifier(file.property),
261
- t.identifier(file.property + '_export_definition')
262
- )
263
- );
264
- if (file.property !== dashed) {
265
- propertyDefinitions.push(
266
- t.objectProperty(t.stringLiteral(dashed), t.identifier(file.property + '_export_definition'))
267
- );
268
- }
269
- });
270
- var definePropertiesCall = t.callExpression(
271
- t.memberExpression(t.identifier('Object'), t.identifier('defineProperties')),
272
- [t.identifier('prototype'), t.objectExpression(propertyDefinitions)]
273
- );
274
- statements.push(
275
- t.expressionStatement(
276
- t.assignmentExpression(
277
- '=',
278
- t.memberExpression(t.identifier('module'), t.identifier('exports')),
279
- t.functionExpression(
280
- null,
281
- [t.identifier('prototype')],
282
- t.blockStatement([t.expressionStatement(definePropertiesCall)])
283
- )
284
- )
285
- )
286
- );
287
- out_file.write(generate(t.program(statements)).code + '\n');
288
- out_file.end(function(err) {
289
- if (err) {
290
- throw err;
291
- }
292
- });