@carbon/utilities 0.2.0-rc.0 → 0.3.0

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.
@@ -1 +1 @@
1
- function u(r,s){const t=new Intl.RelativeTimeFormat(s?.locale,{style:s?.style??"long"}),m=typeof r=="number"?new Date(r):r,h=Date.now(),f=Math.floor((h-m.getTime())/1e3),a=Math.floor(f/60),e=Math.floor(a/60),o=Math.floor(e/24),n=Math.floor(o/7),l=Math.floor(n/4),i=Math.floor(o/365);return Math.abs(f)<60?"just now":Math.abs(a)<60?t.format(a*-1,"minutes"):Math.abs(e)<24?t.format(e*-1,"hours"):Math.abs(o)<7?t.format(o*-1,"days"):Math.abs(n)<4?t.format(n*-1,"weeks"):Math.abs(l)<12?t.format(l*-1,"months"):t.format(i*-1,"years")}export{u as format};
1
+ function i(a,e){const t=new Intl.RelativeTimeFormat(e?.locale,{style:e?.style??"long"}),m=typeof a=="number"?new Date(a):a,c=Date.now(),l=Math.floor((c-m.getTime())/1e3),r=Math.floor(l/60),n=Math.floor(r/60),o=Math.floor(n/24),s=Math.floor(o/7),f=Math.floor(s/4),h=Math.floor(o/365);return Math.abs(l)<60?new Intl.RelativeTimeFormat(e?.locale,{numeric:"auto",style:e?.style??"long"}).format(0,"seconds"):Math.abs(r)<60?t.format(r*-1,"minutes"):Math.abs(n)<24?t.format(n*-1,"hours"):Math.abs(o)<7?t.format(o*-1,"days"):Math.abs(s)<4?t.format(s*-1,"weeks"):Math.abs(f)<12?t.format(f*-1,"months"):t.format(h*-1,"years")}export{i as format};
@@ -1 +1 @@
1
- "use strict";var m=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var b=(o,t)=>{for(var r in t)m(o,r,{get:t[r],enumerable:!0})},w=(o,t,r,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of M(t))!y.call(o,a)&&a!==r&&m(o,a,{get:()=>t[a],enumerable:!(e=c(t,a))||e.enumerable});return o};var g=o=>w(m({},"__esModule",{value:!0}),o);var T={};b(T,{format:()=>D});module.exports=g(T);function D(o,t){const r=new Intl.RelativeTimeFormat(t?.locale,{style:t?.style??"long"}),e=typeof o=="number"?new Date(o):o,a=Date.now(),h=Math.floor((a-e.getTime())/1e3),s=Math.floor(h/60),f=Math.floor(s/60),n=Math.floor(f/24),l=Math.floor(n/7),i=Math.floor(l/4),u=Math.floor(n/365);return Math.abs(h)<60?"just now":Math.abs(s)<60?r.format(s*-1,"minutes"):Math.abs(f)<24?r.format(f*-1,"hours"):Math.abs(n)<7?r.format(n*-1,"days"):Math.abs(l)<4?r.format(l*-1,"weeks"):Math.abs(i)<12?r.format(i*-1,"months"):r.format(u*-1,"years")}
1
+ "use strict";var m=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var b=(e,t)=>{for(var o in t)m(e,o,{get:t[o],enumerable:!0})},w=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of M(t))!y.call(e,a)&&a!==o&&m(e,a,{get:()=>t[a],enumerable:!(r=u(t,a))||r.enumerable});return e};var g=e=>w(m({},"__esModule",{value:!0}),e);var d={};b(d,{format:()=>T});module.exports=g(d);function T(e,t){const o=new Intl.RelativeTimeFormat(t?.locale,{style:t?.style??"long"}),r=typeof e=="number"?new Date(e):e,a=Date.now(),c=Math.floor((a-r.getTime())/1e3),s=Math.floor(c/60),l=Math.floor(s/60),n=Math.floor(l/24),f=Math.floor(n/7),h=Math.floor(f/4),i=Math.floor(n/365);return Math.abs(c)<60?new Intl.RelativeTimeFormat(t?.locale,{numeric:"auto",style:t?.style??"long"}).format(0,"seconds"):Math.abs(s)<60?o.format(s*-1,"minutes"):Math.abs(l)<24?o.format(l*-1,"hours"):Math.abs(n)<7?o.format(n*-1,"days"):Math.abs(f)<4?o.format(f*-1,"weeks"):Math.abs(h)<12?o.format(h*-1,"months"):o.format(i*-1,"years")}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/utilities",
3
3
  "description": "Utilities and helpers to drive consistency across software products using the Carbon Design System",
4
- "version": "0.2.0-rc.0",
4
+ "version": "0.3.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -34,7 +34,6 @@
34
34
  "build": "yarn build:es & yarn build:cjs & yarn build:types",
35
35
  "watch": "yarn build:es --watch & yarn build:cjs --watch",
36
36
  "clean": "rimraf es lib",
37
- "test": "echo yay && exit 0",
38
37
  "postinstall": "ibmtelemetry --config=telemetry.yml"
39
38
  },
40
39
  "devDependencies": {
@@ -46,5 +45,5 @@
46
45
  "dependencies": {
47
46
  "@ibm/telemetry-js": "^1.6.1"
48
47
  },
49
- "gitHead": "e48f5e6815bd93e518e8da73c7555590b85cda22"
48
+ "gitHead": "ab3eba8531c341d5ee5d956b962d7cce04944ac3"
50
49
  }