3
3
4
4
// module Data.StrMap
5
5
6
- exports . _copy = function ( m ) {
7
- var r = { } ;
8
- for ( var k in m ) {
9
- if ( m . hasOwnProperty ( k ) ) {
10
- r [ k ] = m [ k ] ;
11
- }
12
- }
13
- return r ;
14
- } ;
15
-
16
6
exports . _copyEff = function ( m ) {
17
7
return function ( ) {
18
8
var r = { } ;
19
9
for ( var k in m ) {
20
- if ( m . hasOwnProperty ( k ) ) {
10
+ if ( hasOwnProperty . call ( m , k ) ) {
21
11
r [ k ] = m [ k ] ;
22
12
}
23
13
}
@@ -35,7 +25,7 @@ exports.runST = function (f) {
35
25
exports . _fmapStrMap = function ( m0 , f ) {
36
26
var m = { } ;
37
27
for ( var k in m0 ) {
38
- if ( m0 . hasOwnProperty ( k ) ) {
28
+ if ( hasOwnProperty . call ( m0 , k ) ) {
39
29
m [ k ] = f ( m0 [ k ] ) ;
40
30
}
41
31
}
@@ -46,7 +36,7 @@ exports._fmapStrMap = function (m0, f) {
46
36
exports . _mapWithKey = function ( m0 , f ) {
47
37
var m = { } ;
48
38
for ( var k in m0 ) {
49
- if ( m0 . hasOwnProperty ( k ) ) {
39
+ if ( hasOwnProperty . call ( m0 , k ) ) {
50
40
m [ k ] = f ( k ) ( m0 [ k ] ) ;
51
41
}
52
42
}
@@ -65,7 +55,7 @@ exports._foldM = function (bind) {
65
55
} ;
66
56
}
67
57
for ( var k in m ) {
68
- if ( m . hasOwnProperty ( k ) ) {
58
+ if ( hasOwnProperty . call ( m , k ) ) {
69
59
acc = bind ( acc ) ( g ( k ) ) ;
70
60
}
71
61
}
@@ -78,7 +68,7 @@ exports._foldM = function (bind) {
78
68
// jshint maxparams: 4
79
69
exports . _foldSCStrMap = function ( m , z , f , fromMaybe ) {
80
70
for ( var k in m ) {
81
- if ( m . hasOwnProperty ( k ) ) {
71
+ if ( hasOwnProperty . call ( m , k ) ) {
82
72
var maybeR = f ( z ) ( k ) ( m [ k ] ) ;
83
73
var r = fromMaybe ( null ) ( maybeR ) ;
84
74
if ( r === null ) return z ;
@@ -92,7 +82,7 @@ exports._foldSCStrMap = function (m, z, f, fromMaybe) {
92
82
exports . all = function ( f ) {
93
83
return function ( m ) {
94
84
for ( var k in m ) {
95
- if ( m . hasOwnProperty ( k ) && ! f ( k ) ( m [ k ] ) ) return false ;
85
+ if ( hasOwnProperty . call ( m , k ) && ! f ( k ) ( m [ k ] ) ) return false ;
96
86
}
97
87
return true ;
98
88
} ;
@@ -101,7 +91,7 @@ exports.all = function (f) {
101
91
exports . size = function ( m ) {
102
92
var s = 0 ;
103
93
for ( var k in m ) {
104
- if ( m . hasOwnProperty ( k ) ) {
94
+ if ( hasOwnProperty . call ( m , k ) ) {
105
95
++ s ;
106
96
}
107
97
}
@@ -130,7 +120,7 @@ function _collect(f) {
130
120
return function ( m ) {
131
121
var r = [ ] ;
132
122
for ( var k in m ) {
133
- if ( m . hasOwnProperty ( k ) ) {
123
+ if ( hasOwnProperty . call ( m , k ) ) {
134
124
r . push ( f ( k ) ( m [ k ] ) ) ;
135
125
}
136
126
}
0 commit comments