Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
* Fix string pluralization, closes #544
* Fix for isNumber in IE, closes #545
* `useYarn` in ember-try
  • Loading branch information
jamesdaniels authored Mar 26, 2018
1 parent ada5623 commit 8b3b309
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# dependencies
/node_modules
/bower_components
*.ember-try

# misc
/.sass-cache
Expand Down
12 changes: 9 additions & 3 deletions addon/adapters/firebase.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import Ember from 'ember';
import DS from 'ember-data';
import Inflector from 'ember-inflector';
import Waitable from '../mixins/waitable';
import toPromise from '../utils/to-promise';

const { assign, RSVP } = Ember;
const { Promise } = RSVP;

import { pluralize } from 'ember-inflector';

var uniq = function (arr) {
var ret = Ember.A();

Expand All @@ -19,6 +20,11 @@ var uniq = function (arr) {
return ret;
};

var isInteger = Number.isInteger || function(value) {
return typeof value === 'number' &&
isFinite(value) &&
Math.floor(value) === value;
};

/**
* The Firebase adapter allows your store to communicate with the Firebase
Expand Down Expand Up @@ -320,7 +326,7 @@ export default DS.Adapter.extend(Waitable, {
_applyLimitsToRef(ref, query) {
const methods = ['limitToFirst', 'limitToLast'];
methods.forEach(key => {
if (Number.isInteger(query[key])) {
if (isInteger(query[key])) {
ref = ref[key](query[key]);
}
});
Expand Down Expand Up @@ -634,7 +640,7 @@ export default DS.Adapter.extend(Waitable, {
*/
pathForType(modelName) {
var camelized = Ember.String.camelize(modelName);
return Inflector.inflector.pluralize(camelized);
return pluralize(camelized);
},


Expand Down
1 change: 1 addition & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* jshint node: true */
module.exports = {
useYarn: true,
scenarios: [
{
name: 'ember-data-release',
Expand Down
42 changes: 15 additions & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ ansi-escapes@^1.1.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e"

ansi-regex@*, ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"

ansi-regex@^0.2.0, ansi-regex@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-0.2.1.tgz#0d8e946967a3d8143f93e24e298525fc1b2235f9"
Expand All @@ -99,6 +95,10 @@ ansi-regex@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-1.1.1.tgz#41c847194646375e6a1a5d10c3ca054ef9fc980d"

ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"

ansi-styles@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.1.0.tgz#eaecbf66cd706882760b2f4691582b8f55d7a7de"
Expand Down Expand Up @@ -2868,14 +2868,6 @@ ember-load-initializers@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/ember-load-initializers/-/ember-load-initializers-0.5.1.tgz#76e3db23c111dbdcd3ae6f687036bf0b56be0cbe"

ember-lodash@0.0.7:
version "0.0.7"
resolved "https://registry.yarnpkg.com/ember-lodash/-/ember-lodash-0.0.7.tgz#539f838cce86f257bea2a5cd6ae354926e92f8c2"
dependencies:
broccoli-merge-trees "^1.1.1"
ember-cli-babel "^5.1.5"
lodash-es "^3.10.0"

ember-mocha@^0.9.4:
version "0.9.4"
resolved "https://registry.yarnpkg.com/ember-mocha/-/ember-mocha-0.9.4.tgz#260f2863dd289c34a139219ea1fce05d0b7da700"
Expand Down Expand Up @@ -4226,7 +4218,7 @@ iferr@^0.1.5:
version "0.1.5"
resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501"

imurmurhash@*, imurmurhash@^0.1.4:
imurmurhash@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"

Expand Down Expand Up @@ -4837,10 +4829,6 @@ lockfile@~1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/lockfile/-/lockfile-1.0.3.tgz#2638fc39a0331e9cac1a04b71799931c9c50df79"

lodash-es@^3.10.0:
version "3.10.1"
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-3.10.1.tgz#a1c85d9829c9009004339dc3846dbabb46cf4e19"

lodash-node@^2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/lodash-node/-/lodash-node-2.4.1.tgz#ea82f7b100c733d1a42af76801e506105e2a80ec"
Expand Down Expand Up @@ -5101,14 +5089,14 @@ lodash.uniqby@^4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302"

lodash@3.10.1, lodash@^3.0.1, lodash@^3.10.0, lodash@^3.10.1, lodash@^3.9.3:
version "3.10.1"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"

lodash@3.7.x:
version "3.7.0"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.7.0.tgz#3678bd8ab995057c07ade836ed2ef087da811d45"

lodash@^3.0.1, lodash@^3.10.0, lodash@^3.10.1, lodash@^3.9.3:
version "3.10.1"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"

lodash@^4.14.0, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.5.1, lodash@^4.6.1:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
Expand Down Expand Up @@ -7149,12 +7137,6 @@ stringstream@~0.0.4:
version "0.0.5"
resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878"

strip-ansi@*, strip-ansi@^3.0.0, strip-ansi@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
dependencies:
ansi-regex "^2.0.0"

strip-ansi@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.3.0.tgz#25f48ea22ca79187f3174a4db8759347bb126220"
Expand All @@ -7167,6 +7149,12 @@ strip-ansi@^2.0.1:
dependencies:
ansi-regex "^1.0.0"

strip-ansi@^3.0.0, strip-ansi@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
dependencies:
ansi-regex "^2.0.0"

strip-ansi@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.1.1.tgz#39e8a98d044d150660abe4a6808acf70bb7bc991"
Expand Down

0 comments on commit 8b3b309

Please sign in to comment.