Skip to content

Commit bd1f943

Browse files
committed
Fix #4 - mapping property in not exported for CommonJS/Node
1 parent 190490e commit bd1f943

6 files changed

+44
-16
lines changed

dist/knockout.mapping.js

+5
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@
1919
}
2020
else {
2121
// <script> tag: use the global `ko` object, attaching a `mapping` property
22+
if (typeof ko === 'undefined') {
23+
throw new Error('Knockout is required, please ensure it is loaded before loading this mapping plug-in');
24+
}
2225
factory(ko, ko.mapping = {});
2326
}
2427
}(function(ko, exports) {
2528
/*jshint sub:true,curly:false*/
2629
'use strict';
2730

31+
ko.mapping = exports;
32+
2833
var DEBUG=true;
2934
var mappingProperty = "__ko_mapping__";
3035
var realKoDependentObservable = ko.dependentObservable;

dist/knockout.mapping.min.js

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

0 commit comments

Comments
 (0)