How to use the endsWith function from lodash
Find comprehensive JavaScript lodash.endsWith code examples handpicked from public code repositorys.
GitHub: gardener/dashboard
96 97 98 99 100 101 102 103 104 105 106
function findImageDescription (containerImage, containerImageDescriptions) { return _ .chain(containerImageDescriptions) .find(({ image }) => { if (_.startsWith(image, '/') && _.endsWith(image, '/')) { image = image.substring(1, image.length - 1) return new RegExp(image).test(containerImage) } return image === containerImage
88
199
22
+ 3 other calls in file
GitHub: mingdaocom/pd-openweb
100 101 102 103 104 105 106 107 108 109
_.filter(assets, function (asset) { return _.endsWith(asset.name, '.js'); }).length + '个js文件,' + _.filter(assets, function (asset) { return _.endsWith(asset.name, '.map'); }).length + '个map文件'; message = assets .map(function (asset) {
58
132
11
+ 7 other calls in file
95 96 97 98 99 100 101 102 103 104
module.exports.dropRight = _.dropRight; module.exports.dropRightWhile = _.dropRightWhile; module.exports.dropWhile = _.dropWhile; module.exports.each = _.each; module.exports.eachRight = _.eachRight; module.exports.endsWith = _.endsWith; module.exports.enforce = _.enforce; module.exports.entries = _.entries; module.exports.entriesIn = _.entriesIn; module.exports.eq = _.eq;
19
122
0
+ 92 other calls in file
GitHub: mdmarufsarker/lodash
793 794 795 796 797 798 799 800 801 802 803 804 805
console.log(capitalize); // => 'Fred' const deburr = _.deburr('déjà vu'); console.log(deburr); // => 'deja vu' const endsWith = _.endsWith('abc', 'c'); console.log(endsWith); // => true const escape = _.escape('fred, barney, & pebbles'); console.log(escape); // => 'fred, barney, & pebbles'
0
4
0
+ 15 other calls in file
GitHub: vuducnghia/bkfoodv3
76 77 78 79 80 81 82 83 84 85 86 87
if (argv.d) { dest = path.normalize(argv.d); var exists = fs.existsSync(dest); var isDir = exists && fs.statSync(dest).isDirectory(); var fileRequested = _.endsWith(dest, '.js'); if ((exists && isDir) || (!exists && !fileRequested)) { dest = path.join(dest, 'modernizr.js'); }
1
0
2
301 302 303 304 305 306 307 308 309 310 311
function loadPolicies() { const folder = `${process.cwd()}/src/api/policies`; const files = fs.readdirSync(folder); files .filter(file => _.endsWith(file, '.ts') || _.endsWith(file, '.js')) .forEach((file) => { // eslint-disable-next-line const func = require(`${folder}/${file}`); axel.policies[file.split('.')[0]] = func;
0
3
1
GitHub: janeyuaws/test
41 42 43 44 45 46 47 48 49 50 51 52
if (resolved === '/') return '/'; // Remove the leading forward slash if present resolved = chopLeft(resolved, '/'); // Add a trailing forward slash if missing return _.endsWith(resolved, '/') ? resolved : `${resolved}/`; } /** * Runs the provided async function and prints the error object (if any) to the console, it does NOT rethrow
0
0
1
+ 3 other calls in file
GitHub: janeyuaws/test
53 54 55 56 57 58 59 60 61 62
let prefix = '/'; if (!_.isEmpty(trimmed)) { prefix = chopLeft(trimmed, '/'); prefix = chopRight(prefix, '*'); prefix = _.endsWith(prefix, '/') ? prefix : `${prefix}/`; } // eslint-disable-next-line consistent-return return {
0
0
1
+ 3 other calls in file
31 32 33 34 35 36 37 38 39
pagePath = `${pagePath}` } // Enforce a trailing slash on all paths const pathHasExtension = path.extname(pagePath) !== '' const pathEndsWithSlash = _.endsWith(pagePath, '/') if (!pathEndsWithSlash && !pathHasExtension) { pagePath = `${pagePath}/` }
0
0
1
+ 4 other calls in file
39 40 41 42 43 44 45 46 47 48
bundleStats.assets = _.filter(bundleStats.assets, function (asset) { // Removing query part from filename (yes, somebody uses it for some reason and Webpack supports it) // See #22 asset.name = asset.name.replace(FILENAME_QUERY_REGEXP, ''); return _.endsWith(asset.name, '.js') && !_.isEmpty(asset.chunks) && isAssetIncluded(asset.name); }); // Trying to parse bundle assets and get real module sizes if `bundleDir` is provided var bundlesSources = null;
0
0
1
+ 4 other calls in file
119 120 121 122 123 124 125 126 127 128
// region configuration/index noConfigurationSpecified() { return new DetoxConfigError({ message: 'Cannot run Detox without a configuration file.', hint: _.endsWith(this.filepath, 'package.json') ? `Create an external .detoxrc.json configuration, or add "detox" configuration section to your package.json at:\n${this.filepath}` : 'Make sure to create external .detoxrc.json configuration in the working directory before you run Detox.' }); }
0
0
0
lodash.get is the most popular function in lodash (7670 examples)