Skip to content

Commit

Permalink
Using specific version of lodash instead of general version (oblador#…
Browse files Browse the repository at this point in the history
…1231)

* Using specific version of lodash instead of general version

* Update bundled-icon-set.tpl

* Update separated-icon-set.tpl

Co-authored-by: Joel Arvidsson <joel@oblador.se>
  • Loading branch information
martinheidegger and oblador authored Sep 10, 2020
1 parent 340d6f9 commit d0f0998
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 15 deletions.
4 changes: 2 additions & 2 deletions bin/generate-icon.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
/* eslint-disable no-console */

const _ = require('lodash');
const omit = require('lodash.omit');
const fs = require('fs');
const path = require('path');
const yargs = require('yargs');
Expand All @@ -28,7 +28,7 @@ if (argv.template) {
template = fs.readFileSync(argv.template, { encoding: 'utf8' });
}

const data = _.omit(
const data = omit(
argv,
'_ $0 o output p prefix t template g glyphmap'.split(' ')
);
Expand Down
7 changes: 4 additions & 3 deletions bin/generate-material-icons.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env node
/* eslint-disable no-console */

const _ = require('lodash');
const omit = require('lodash.omit');
const lodashTemplate = require('lodash.template');
const fs = require('fs');
const path = require('path');
const yargs = require('yargs');
Expand Down Expand Up @@ -39,12 +40,12 @@ if (argv.template) {
template = fs.readFileSync(argv.template, { encoding: 'utf8' });
}

let data = _.omit(argv, '_ $0 o output t template g glyphmap'.split(' '));
let data = omit(argv, '_ $0 o output t template g glyphmap'.split(' '));
const glyphMap = extractGlyphMapFromCodepoints(argv._[0]);

let content = JSON.stringify(glyphMap, null, ' ');
if (template) {
const compiled = _.template(template);
const compiled = lodashTemplate(template);
data = data || {};
data.glyphMap = content;
content = compiled(data);
Expand Down
7 changes: 4 additions & 3 deletions lib/generate-icon-set-from-css.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const _ = require('lodash');
const lodashTemplate = require('lodash.template');
const fromPairs = require('lodash.frompairs');
const fs = require('fs');

function extractGlyphMapFromCss(files, selectorPattern) {
Expand Down Expand Up @@ -38,7 +39,7 @@ function extractGlyphMapFromCss(files, selectorPattern) {
const selectors = extractSelectorsFromRule(rule);
return selectors.map(selector => [selector, glyph]);
})
.reduce((acc, glyphs) => Object.assign(acc, _.fromPairs(glyphs)), {});
.reduce((acc, glyphs) => Object.assign(acc, fromPairs(glyphs)), {});
}

function escapeRegExp(str) {
Expand All @@ -52,7 +53,7 @@ function generateIconSetFromCss(cssFiles, selectorPrefix, template, data = {}) {
);
const content = JSON.stringify(glyphMap, null, ' ');
if (template) {
return _.template(template)({ glyphMap: content, ...data });
return lodashTemplate(template)({ glyphMap: content, ...data });
}
return content;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/icon-button.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import isString from 'lodash/isString';
import omit from 'lodash/omit';
import pick from 'lodash/pick';
import isString from 'lodash.isstring';
import omit from 'lodash.omit';
import pick from 'lodash.pick';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, Text, TouchableHighlight, View } from './react-native';
Expand Down
4 changes: 2 additions & 2 deletions lib/tab-bar-item-ios.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/no-unused-prop-types */
import isEqual from 'lodash/isEqual';
import pick from 'lodash/pick';
import isEqual from 'lodash.isequal';
import pick from 'lodash.pick';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { TabBarIOS } from './react-native';
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@
},
"license": "MIT",
"dependencies": {
"lodash": "^4.17.15",
"lodash.frompairs": "^4.0.1",
"lodash.isequal": "^4.5.0",
"lodash.isstring": "^4.0.1",
"lodash.omit": "^4.5.0",
"lodash.pick": "^4.4.0",
"lodash.template": "^4.5.0",
"prop-types": "^15.7.2",
"yargs": "^15.0.2"
},
Expand Down
47 changes: 46 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2279,7 +2279,52 @@ locate-path@^5.0.0:
dependencies:
p-locate "^4.1.0"

lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15:
lodash._reinterpolate@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=

lodash.frompairs@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/lodash.frompairs/-/lodash.frompairs-4.0.1.tgz#bc4e5207fa2757c136e573614e9664506b2b1bd2"
integrity sha1-vE5SB/onV8E25XNhTpZkUGsrG9I=

lodash.isequal@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA=

lodash.isstring@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451"
integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=

lodash.omit@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.omit/-/lodash.omit-4.5.0.tgz#6eb19ae5a1ee1dd9df0b969e66ce0b7fa30b5e60"
integrity sha1-brGa5aHuHdnfC5aeZs4Lf6MLXmA=

lodash.pick@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3"
integrity sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=

lodash.template@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab"
integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==
dependencies:
lodash._reinterpolate "^3.0.0"
lodash.templatesettings "^4.0.0"

lodash.templatesettings@^4.0.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33"
integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==
dependencies:
lodash._reinterpolate "^3.0.0"

lodash@^4.17.13, lodash@^4.17.14:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
Expand Down

0 comments on commit d0f0998

Please sign in to comment.