Skip to content

Commit 73aad00

Browse files
committed
fix: remove unnecessary escape chars (again)
1 parent cfec695 commit 73aad00

File tree

3 files changed

+2
-74
lines changed

3 files changed

+2
-74
lines changed

dadi/lib/help.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ module.exports.transformQuery = function (obj, type) {
113113

114114
case 'String':
115115
transformFunction = function (obj) {
116-
var regexParts = obj.match(/\/([^\/]*)\/([i]{0,1})$/)
116+
var regexParts = obj.match(/\/([^/]*)\/([i]{0,1})$/)
117117

118118
if (regexParts) {
119119
try {

dadi/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Server.prototype.run = function (done) {
7777
// Watch the current directory for a "restart.api" file
7878
var watcher = chokidar.watch(process.cwd(), {
7979
depth: 1,
80-
ignored: /[\/\\]\./,
80+
ignored: /[/\\]\./,
8181
ignoreInitial: true
8282
})
8383

dadi/lib/model/utils.js

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -152,75 +152,3 @@ module.exports = {
152152
makeCaseInsensitive: makeCaseInsensitive,
153153
processReferenceFieldQuery: processReferenceFieldQuery
154154
}
155-
156-
_.mixin({
157-
// Get/set the value of a nested property
158-
deep: function (obj, key, value) {
159-
var keys = key.replace(/\[(["']?)([^\1]+?)\1?\]/g, '.$2').replace(/^\./, '').split('.')
160-
var root
161-
var i = 0
162-
var n = keys.length
163-
164-
// Set deep value
165-
if (arguments.length > 2) {
166-
root = obj
167-
n--
168-
169-
while (i < n) {
170-
key = keys[i++]
171-
obj = obj[key] = _.isObject(obj[key]) ? obj[key] : {}
172-
}
173-
174-
obj[keys[i]] = value
175-
176-
value = root
177-
178-
// Get deep value
179-
} else {
180-
while ((obj = obj[keys[i++]]) != null && i < n) {}
181-
value = i < n ? void 0 : obj
182-
}
183-
184-
return value
185-
}
186-
})
187-
188-
// Usage:
189-
//
190-
// var obj = {
191-
// a: {
192-
// b: {
193-
// c: {
194-
// d: ['e', 'f', 'g']
195-
// }
196-
// }
197-
// }
198-
// }
199-
//
200-
// Get deep value
201-
// _.deep(obj, 'a.b.c.d[2]'); // 'g'
202-
//
203-
// Set deep value
204-
// _.deep(obj, 'a.b.c.d[2]', 'george')
205-
//
206-
// _.deep(obj, 'a.b.c.d[2]'); // 'george'
207-
208-
_.mixin({
209-
pluckDeep: function (obj, key) {
210-
return _.map(obj, function (value) { return _.deep(value, key) })
211-
}
212-
})
213-
214-
// Usage:
215-
//
216-
// var arr = [{
217-
// deeply: {
218-
// nested: 'foo'
219-
// }
220-
// }, {
221-
// deeply: {
222-
// nested: 'bar'
223-
// }
224-
// }]
225-
//
226-
// _.pluckDeep(arr, 'deeply.nested') // ['foo', 'bar']

0 commit comments

Comments
 (0)