/**1* Copyright 2013 Facebook, Inc.2*3* Licensed under the Apache License, Version 2.0 (the "License");4* you may not use this file except in compliance with the License.5* You may obtain a copy of the License at6*7* http://www.apache.org/licenses/LICENSE-2.08*9* Unless required by applicable law or agreed to in writing, software10* distributed under the License is distributed on an "AS IS" BASIS,11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12* See the License for the specific language governing permissions and13* limitations under the License.14*/1516var fbSpriteRe = /-fb-sprite\s*:\s*url\s*\(\s*[\'"]?([^\'")]+)[\'"]?\s*\)/g;17var splashRe = /^\//;18function extractFBSprites(contents) {19var result = {};20var match;21while (match = fbSpriteRe.exec(contents)) {22result[match[1].replace(splashRe, '')] = 1;23}24return Object.keys(result);25}2627var bgRe = /background[^:]*:.*?url\([\']*([^\)]*\/images\/[^\)]+)[\']*\)/g;28var quoteRe = /'"/g;29function extractBackgroundImages(contents) {30var result = {};31var match;32while (match = bgRe.exec(contents)) {33result[match[1].replace(splashRe, '').replace(quoteRe, '')] = 1;34}35return Object.keys(result);36}3738exports.extractFBSprites = extractFBSprites;394041