oulu 0.15.3 → 0.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a39b38617bbdb1f597203bdb582d3fd79a4e2923
4
- data.tar.gz: 81b1d0160f4191e228c11fae58d1a8e51503e8fa
3
+ metadata.gz: 7319ac621f97ca458259ea13ee58fffa3faded5a
4
+ data.tar.gz: ed7f7a36f75bf0469949fd05f9a1cb67ac192cb0
5
5
  SHA512:
6
- metadata.gz: ee2c583a5f704ac2316caa3fe75e7007e9644a1230ead0f44d87f49ac59a3f927abcfd9b1a1be86ea09cc1182812c6f3552675909ca646a076453c7b66dc220b
7
- data.tar.gz: a96cf43ae7b275c7723c79bce357743a644d494ab99749e28a561e2b504850c7487f3ae3474705e9317070c06ebcc0f29a6ebc20738559f436074f6b35a59e09
6
+ metadata.gz: 9dc613ec629485ba8b6373bfbc4f3ca7b8aa2b2211685a47d813217ec6271bea02d3152c925e3119859892b507823e70fd2ed885a0c017ea5f36ca5e6f77ce90
7
+ data.tar.gz: 7e22830c731beb890bd0b1669301a3d74be1865b429a85c9e02aa56240eb98d0b4cf192efbe73330ff628c91e694d21028644e5819719e10f974652092565524
@@ -3,3 +3,56 @@
3
3
  @return true
4
4
  @else
5
5
  @return null
6
+
7
+ @function map-deep-get($map, $keys...)
8
+ @each $key in $keys
9
+ @if not map-has-key($map, $key)
10
+ @return null
11
+ $map: map-get($map, $key)
12
+ @return $map
13
+
14
+ @function map-deep-set($map, $keys...)
15
+ $map-list: ($map,)
16
+ $result: null
17
+ @if length($keys) == 2
18
+ @return map-merge($map, (nth($keys, 1): nth($keys, -1)))
19
+ @for $i from 1 through length($keys) - 2
20
+ $map-list: append($map-list, map-get(nth($map-list, -1), nth($keys, $i)))
21
+ @for $i from length($map-list) through 1
22
+ $result: map-merge(nth($map-list, $i), (nth($keys, $i): if($i == length($map-list), nth($keys, -1), $result)))
23
+ @return $result
24
+
25
+ @function map-has-keys($map, $keys...)
26
+ @each $key in $keys
27
+ @if not map-has-key($map, $key)
28
+ @return false
29
+ @return true
30
+
31
+ @function map-zip($keys, $values)
32
+ $l-keys: length($keys)
33
+ $l-values: length($values)
34
+ $min: min($l-keys, $l-values)
35
+ $map: ()
36
+ @if $l-keys != $l-values
37
+ @warn "There are #{$l-keys} key(s) for #{$l-values} value(s) in the map for `map-zip`. "
38
+ + "Resulting map will only have #{$min} pairs."
39
+ @if $min == 0
40
+ @return $map
41
+ @for $i from 1 through $min
42
+ $map: map-merge($map, (nth($keys, $i): nth($values, $i)))
43
+ @return $map
44
+
45
+ @function map-extend($map, $maps...)
46
+ $last: nth($maps, -1)
47
+ $deep: $last == true
48
+ $max: if($deep, length($maps) - 1, length($maps))
49
+ @for $i from 1 through $max
50
+ $current: nth($maps, $i)
51
+ @if not $deep
52
+ $map: map-merge($map, $current)
53
+ @else
54
+ @each $key, $value in $current
55
+ @if type-of($value) == "map" and type-of(map-get($map, $key)) == "map"
56
+ $value: map-extend(map-get($map, $key), $value, true)
57
+ $map: map-merge($map, ($key: $value))
58
+ @return $map
data/bower.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oulu",
3
- "version": "0.15.3",
3
+ "version": "0.15.4",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
data/lib/oulu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Oulu
2
- VERSION = "0.15.3"
2
+ VERSION = "0.15.4"
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oulu",
3
- "version": "0.15.3",
3
+ "version": "0.15.4",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oulu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.3
4
+ version: 0.15.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - machida
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-26 00:00:00.000000000 Z
11
+ date: 2017-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor