-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds pad for adding zero padding to a number. #514
Open
jfrux
wants to merge
60
commits into
kellyselden:master
Choose a base branch
from
jfrux:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
b792755
Adds pad for adding zero padding to a number.
jfrux 0bfb215
Updates README.
jfrux cfed5bb
Fixes readme.
jfrux a0b4dc9
Updates Readme
jfrux c9e40b6
Add notEmpty macro (#512)
dnahodil 75161ff
alphabetize change
d0d7245
Update dependency ember-cli-inject-live-reload to v2 (#515)
renovate[bot] acffdc8
Update dependency ember-source to ~3.5.0 (#511)
renovate[bot] a83f184
Update dependency ember-cli-babel to v7 (#509)
renovate[bot] 0756369
update ember-cli 3.4 (#517)
0dc9e10
use npm 6
82fac14
Update dependency @ember/optional-features to ^0.7.0
renovate-bot 8bc9486
Add missing boolean operations (#516)
dnahodil b1d6001
3.1.0
bb1c47b
update changelog
98e8286
Update dependency eslint-plugin-node to v8
renovate-bot 5ec6555
Update dependency ember-load-initializers to v2
renovate-bot 11cc571
Update dependency ember-cli-eslint to v5
renovate-bot 467b144
Update dependency ember-sinon to v3
renovate-bot d6c3009
remove ember-macro-test-helpers
d6ec8ba
TravisCI: Remove deprecated `sudo: false` option
Turbo87 acf6ebb
update eslint-plugin-ember
52b3605
update ember-cli 3.5
261ec33
Update dependency ember-qunit to v4
renovate-bot fac9f54
Update dependency ember-source to ~3.6.0
renovate-bot 6edc7c2
update ember-cli 3.6
1596ddd
Update dependency ember-source to ~3.7.0
renovate-bot 0d170e7
ember-cli 3.7
48c3a8c
revert babel 7
67bf899
3.2.0
4351905
Revert "revert babel 7"
22d24c6
Update dependency ember-macro-helpers to v3
renovate-bot 90cc540
4.0.0
0c45aad
update changelog
6e1e71f
Update dependency ember-source to ~3.8.0
renovate-bot 5511f6c
Update dependency renovate-config-standard to v2
renovate-bot 32c841b
fix eslint
f7ae3da
ember-cli-update
543d545
Update dependency eslint-config-sane to ^0.7.0
renovate-bot f78b7ca
Lock file maintenance
renovate-bot 0a8a1a4
Update dependency ember-source to ~3.9.0
renovate-bot 3937213
Fix isEmpty doc
ctjhoa 102da9a
ember-cli-update
81bac65
Update dependency ember-sinon to v4
renovate-bot fbaf1a0
Update dependency ember-source-channel-url to v2
renovate-bot 8c64ba1
Update dependency ember-try to v1
renovate-bot 992f6e3
Lock file maintenance
renovate-bot de87424
5.0.0
d720d43
Lock file maintenance
renovate-bot 7a01d15
Update dependency qunit-dom to ^0.9.0
renovate-bot b1de6ab
Update dependency ember-source to ~3.11.0
renovate-bot 79a626f
Update dependency eslint-config-sane to ^0.8.0
renovate-bot 6d6e158
update ember-cli
5549612
update changelog
e259590
Version bump to include bug fix: https://github.com/kellyselden/ember…
amyrlam 2fa5f97
5.0.1
57158a8
Lock file maintenance
renovate-bot 0d933a4
Update dependency ember-source to ~3.12.0
renovate-bot 3700716
Update dependency ember-cli to ~3.12.0
renovate-bot 1ced82f
Lock file maintenance
renovate-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { curriedComputed } from 'ember-macro-helpers'; | ||
|
||
export default curriedComputed((val1, val2) => { | ||
let s = val1 + ''; | ||
while (s.length < parseInt(val2)) { | ||
s = '0' + s; | ||
} | ||
return s; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { pad, raw } from 'ember-awesome-macros'; | ||
import { module, test } from 'qunit'; | ||
import { compute } from 'ember-macro-test-helpers'; | ||
|
||
module('Integration | Macro | pad', function() { | ||
test('pad returns 001', function(assert) { | ||
compute({ | ||
assert, | ||
computed: pad('source1', 'source2'), | ||
properties: { | ||
source1: 1, | ||
source2: 3 | ||
}, | ||
strictEqual: '001' | ||
}); | ||
}); | ||
|
||
test('pad with string source returns 001', function(assert) { | ||
compute({ | ||
assert, | ||
computed: pad('source1', 'source2'), | ||
properties: { | ||
source1: 1, | ||
source2: '3' | ||
}, | ||
strictEqual: '001' | ||
}); | ||
}); | ||
|
||
test('it handles numbers', function(assert) { | ||
compute({ | ||
assert, | ||
computed: pad(1, 2), | ||
strictEqual: '01' | ||
}); | ||
}); | ||
|
||
test('it handles nesting', function(assert) { | ||
compute({ | ||
assert, | ||
computed: pad(raw(1), raw(2)), | ||
strictEqual: '01' | ||
}); | ||
}); | ||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example1 and example2 are now the same.